{"version":3,"sources":["webpack:///./node_modules/rmc-list-view/es/ListViewDataSource.js","webpack:///./node_modules/rmc-list-view/es/ListView.js"],"names":["defaultGetRowData","dataBlob","sectionID","rowID","defaultGetSectionHeaderData","keyedDictionaryFromArray","arr","isEmpty_default","result","ii","length","key","browser_default","es_ListViewDataSource","ListViewDataSource","params","classCallCheck_default","this","invariant_default","rowHasChanged","_rowHasChanged","_getRowData","getRowData","_sectionHeaderHasChanged","sectionHeaderHasChanged","_getSectionHeaderData","getSectionHeaderData","_dataBlob","_dirtyRows","_dirtySections","_cachedRowCount","rowIdentities","sectionIdentities","createClass_default","value","rowIds","cloneWithRowsAndSections","s1","newSource","Object","keys","forEach","push","allRowIDs","totalRows","sectionIdx","rowIDs","countRows","_calculateDirtyArrays","sectionIndex","rowIndex","needsUpdate","undefined","index","accessIndex","results","prevDataBlob","prevSectionIDs","prevRowIDs","dirty","prevSectionsHash","prevRowsHash","sIndex","rIndex","ListView_StaticRenderer","_React$Component","StaticRenderer","possibleConstructorReturn_default","__proto__","getPrototypeOf","apply","arguments","inherits_default","nextProps","shouldUpdate","props","render","react_default","a","Component","ListView_ListView","_React$Component2","ListView","_ref","_temp","_this2","_ret","_len","args","Array","_key","call","concat","_initialiseProps","scrollProperties","visibleLength","contentLength","offset","_childFrames","_visibleRows","_prevRenderedRowsCount","_sentEndForContentLength","_this3","dataSource","initialListSize","setState","state","curRenderedRowsCount","Math","min","max","getRowCount","_renderMoreRowsIfNeeded","_this4","bodyComponents","rowCount","renderSectionHeader","shouldUpdateHeader","sectionHeaderShouldUpdate","createElement","bind","sectionBody","rowIdx","comboID","shouldUpdateRow","rowShouldUpdate","row","renderRow","onRowHighlighted","renderSeparator","adjacentRowHighlighted","highlightedRow","separator","rowsAndSeparators","cloneElement","renderSectionBodyWrapper","className","sectionBodyClassName","renderSectionWrapper","_props","renderScrollComponent","objectWithoutProperties_default","extends_default","onScroll","_onScroll","ref","el","ListViewRef","onContentSizeChange","_onContentSizeChange","onLayout","_onLayout","renderHeader","renderBodyComponent","renderFooter","children","DataSource","propTypes","ScrollView","prop_types_default","instanceOf","isRequired","func","number","onEndReached","onEndReachedThreshold","pageSize","scrollRenderAheadDistance","onChangeVisibleRows","scrollEventThrottle","string","listViewPrefixCls","useBodyScroll","bool","defaultProps","scrollerOptions","_this5","getMetrics","renderedRows","visibleRows","getInnerViewNode","scrollTo","_ListViewRef","width","height","horizontal","event","_event$nativeEvent$la","nativeEvent","layout","_maybeCallOnEndReached","_getDistanceFromEnd","_pageInNewRows","rowsToRender","e","metrics","__webpack_exports__"],"mappings":"0RAMA,SAAAA,EAAAC,EAAAC,EAAAC,GACA,OAAAF,EAAAC,GAAAC,GAGA,SAAAC,EAAAH,EAAAC,GACA,OAAAD,EAAAC,GAmVA,SAAAG,EAAAC,GACA,GAAMC,IAAOD,GACb,SAGA,IADA,IAAAE,EAAA,GACAC,EAAA,EAAkBA,EAAAH,EAAAI,OAAiBD,IAAA,CACnC,IAAAE,EAAAL,EAAAG,GACIG,KAAOJ,EAAAG,GAAA,0CAAAA,GACXH,EAAAG,IAAA,EAEA,OAAAH,EAIe,IAAAK,EAnTO,WA2BtB,SAAAC,EAAAC,GACIC,IAAeC,KAAAH,GAEfI,IAASH,GAAA,mBAAAA,EAAAI,cAAA,0CACbF,KAAAG,eAAAL,EAAAI,cACAF,KAAAI,YAAAN,EAAAO,YAAAtB,EACAiB,KAAAM,yBAAAR,EAAAS,wBACAP,KAAAQ,sBAAAV,EAAAW,sBAAAtB,EAEAa,KAAAU,UAAA,KACAV,KAAAW,WAAA,GACAX,KAAAY,eAAA,GACAZ,KAAAa,gBAAA,EAIAb,KAAAc,cAAA,GACAd,KAAAe,kBAAA,GA6OA,OAxNEC,IAAYnB,EAAA,EACdH,IAAA,gBACAuB,MAAA,SAAAjC,EAAA8B,GACA,IAAAI,EAAAJ,EAAA,CAAAA,GAAA,KAMA,OALAd,KAAAM,2BACAN,KAAAM,yBAAA,WACA,WAGAN,KAAAmB,yBAAA,CA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AAC,cAAAD,EAAAG,QAGAhF,KAAA+H,UAAA,SAAAkD,EAAAC,GAGAnB,EAAA7B,cAIA6B,EAAAlF,iBAAAqG,EAEAnB,EAAAc,uBAAAI,IACAlB,EAAAhE,0BAGAgE,EAAArG,MAAAyF,cAAAY,EAAAe,oBAAAf,EAAAlF,kBAAAkF,EAAArG,MAAA0F,wBAEAW,EAAA3E,yBAAA,MAGA2E,EAAArG,MAAAoE,UAAAiC,EAAArG,MAAAoE,SAAAmD,MAIeE,EAAA","file":"vendor.rmc-list-view~f4933912.bundle.js","sourcesContent":["import _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from 'babel-runtime/helpers/createClass';\nimport invariant from 'fbjs/lib/invariant';\nimport isEmpty from 'fbjs/lib/isEmpty';\nimport warning from 'warning';\n\nfunction defaultGetRowData(dataBlob, sectionID, rowID) {\n  return dataBlob[sectionID][rowID];\n}\n\nfunction defaultGetSectionHeaderData(dataBlob, sectionID) {\n  return dataBlob[sectionID];\n}\n\n// type differType = (data1, data2) => bool;\n//\n// type ParamType = {\n//   rowHasChanged: differType;\n//   getRowData: ?typeof defaultGetRowData;\n//   sectionHeaderHasChanged: ?differType;\n//   getSectionHeaderData: ?typeof defaultGetSectionHeaderData;\n// }\n\n/**\n * Provides efficient data processing and access to the\n * `ListView` component.  A `ListViewDataSource` is created with functions for\n * extracting data from the input blob, and comparing elements (with default\n * implementations for convenience).  The input blob can be as simple as an\n * array of strings, or an object with rows nested inside section objects.\n *\n * To update the data in the datasource, use `cloneWithRows` (or\n * `cloneWithRowsAndSections` if you care about sections).  The data in the\n * data source is immutable, so you can't modify it directly.  The clone methods\n * suck in the new data and compute a diff for each row so ListView knows\n * whether to re-render it or not.\n *\n * In this example, a component receives data in chunks, handled by\n * `_onDataArrived`, which concats the new data onto the old data and updates the\n * data source.  We use `concat` to create a new array - mutating `this._data`,\n * e.g. with `this._data.push(newRowData)`, would be an error. `_rowHasChanged`\n * understands the shape of the row data and knows how to efficiently compare\n * it.\n *\n * ```\n * getInitialState: function() {\n *   var ds = new ListViewDataSource({rowHasChanged: this._rowHasChanged});\n *   return {ds};\n * },\n * _onDataArrived(newData) {\n *   this._data = this._data.concat(newData);\n *   this.setState({\n *     ds: this.state.ds.cloneWithRows(this._data)\n *   });\n * }\n * ```\n */\n\nvar ListViewDataSource = function () {\n\n  /**\n   * You can provide custom extraction and `hasChanged` functions for section\n   * headers and rows.  If absent, data will be extracted with the\n   * `defaultGetRowData` and `defaultGetSectionHeaderData` functions.\n   *\n   * The default extractor expects data of one of the following forms:\n   *\n   *      { sectionID_1: { rowID_1: <rowData1>, ... }, ... }\n   *\n   *    or\n   *\n   *      { sectionID_1: [ <rowData1>, <rowData2>, ... ], ... }\n   *\n   *    or\n   *\n   *      [ [ <rowData1>, <rowData2>, ... ], ... ]\n   *\n   * The constructor takes in a params argument that can contain any of the\n   * following:\n   *\n   * - getRowData(dataBlob, sectionID, rowID);\n   * - getSectionHeaderData(dataBlob, sectionID);\n   * - rowHasChanged(prevRowData, nextRowData);\n   * - sectionHeaderHasChanged(prevSectionData, nextSectionData);\n   */\n  function ListViewDataSource(params) {\n    _classCallCheck(this, ListViewDataSource);\n\n    invariant(params && typeof params.rowHasChanged === 'function', 'Must provide a rowHasChanged function.');\n    this._rowHasChanged = params.rowHasChanged;\n    this._getRowData = params.getRowData || defaultGetRowData;\n    this._sectionHeaderHasChanged = params.sectionHeaderHasChanged;\n    this._getSectionHeaderData = params.getSectionHeaderData || defaultGetSectionHeaderData;\n\n    this._dataBlob = null;\n    this._dirtyRows = [];\n    this._dirtySections = [];\n    this._cachedRowCount = 0;\n\n    // These two private variables are accessed by outsiders because ListView\n    // uses them to iterate over the data in this class.\n    this.rowIdentities = [];\n    this.sectionIdentities = [];\n  }\n\n  /**\n   * Clones this `ListViewDataSource` with the specified `dataBlob` and\n   * `rowIdentities`. The `dataBlob` is just an arbitrary blob of data. At\n   * construction an extractor to get the interesting information was defined\n   * (or the default was used).\n   *\n   * The `rowIdentities` is is a 2D array of identifiers for rows.\n   * ie. [['a1', 'a2'], ['b1', 'b2', 'b3'], ...].  If not provided, it's\n   * assumed that the keys of the section data are the row identities.\n   *\n   * Note: This function does NOT clone the data in this data source. It simply\n   * passes the functions defined at construction to a new data source with\n   * the data specified. If you wish to maintain the existing data you must\n   * handle merging of old and new data separately and then pass that into\n   * this function as the `dataBlob`.\n   */\n\n\n  _createClass(ListViewDataSource, [{\n    key: 'cloneWithRows',\n    value: function cloneWithRows(dataBlob, rowIdentities) {\n      var rowIds = rowIdentities ? [rowIdentities] : null;\n      if (!this._sectionHeaderHasChanged) {\n        this._sectionHeaderHasChanged = function () {\n          return false;\n        };\n      }\n      return this.cloneWithRowsAndSections({ s1: dataBlob }, ['s1'], rowIds);\n    }\n\n    /**\n     * This performs the same function as the `cloneWithRows` function but here\n     * you also specify what your `sectionIdentities` are. If you don't care\n     * about sections you should safely be able to use `cloneWithRows`.\n     *\n     * `sectionIdentities` is an array of identifiers for  sections.\n     * ie. ['s1', 's2', ...].  If not provided, it's assumed that the\n     * keys of dataBlob are the section identities.\n     *\n     * Note: this returns a new object!\n     */\n\n  }, {\n    key: 'cloneWithRowsAndSections',\n    value: function cloneWithRowsAndSections(dataBlob, sectionIdentities, rowIdentities) {\n      invariant(typeof this._sectionHeaderHasChanged === 'function', 'Must provide a sectionHeaderHasChanged function with section data.');\n      invariant(!sectionIdentities || !rowIdentities || sectionIdentities.length === rowIdentities.length, 'row and section ids lengths must be the same');\n\n      var newSource = new ListViewDataSource({\n        getRowData: this._getRowData,\n        getSectionHeaderData: this._getSectionHeaderData,\n        rowHasChanged: this._rowHasChanged,\n        sectionHeaderHasChanged: this._sectionHeaderHasChanged\n      });\n      newSource._dataBlob = dataBlob;\n      if (sectionIdentities) {\n        newSource.sectionIdentities = sectionIdentities;\n      } else {\n        newSource.sectionIdentities = Object.keys(dataBlob);\n      }\n      if (rowIdentities) {\n        newSource.rowIdentities = rowIdentities;\n      } else {\n        newSource.rowIdentities = [];\n        newSource.sectionIdentities.forEach(function (sectionID) {\n          newSource.rowIdentities.push(Object.keys(dataBlob[sectionID]));\n        });\n      }\n      newSource._cachedRowCount = countRows(newSource.rowIdentities);\n\n      newSource._calculateDirtyArrays(this._dataBlob, this.sectionIdentities, this.rowIdentities);\n\n      return newSource;\n    }\n  }, {\n    key: 'getRowCount',\n    value: function getRowCount() {\n      return this._cachedRowCount;\n    }\n  }, {\n    key: 'getRowAndSectionCount',\n    value: function getRowAndSectionCount() {\n      return this._cachedRowCount + this.sectionIdentities.length;\n    }\n\n    /**\n     * Returns if the row is dirtied and needs to be rerendered\n     */\n\n  }, {\n    key: 'rowShouldUpdate',\n    value: function rowShouldUpdate(sectionIndex, rowIndex) {\n      var needsUpdate = this._dirtyRows[sectionIndex][rowIndex];\n      warning(needsUpdate !== undefined, 'missing dirtyBit for section, row: ' + sectionIndex + ', ' + rowIndex);\n      return needsUpdate;\n    }\n\n    /**\n     * Gets the data required to render the row.\n     */\n\n  }, {\n    key: 'getRowData',\n    value: function getRowData(sectionIndex, rowIndex) {\n      var sectionID = this.sectionIdentities[sectionIndex];\n      var rowID = this.rowIdentities[sectionIndex][rowIndex];\n      warning(sectionID !== undefined && rowID !== undefined, 'rendering invalid section, row: ' + sectionIndex + ', ' + rowIndex);\n      return this._getRowData(this._dataBlob, sectionID, rowID);\n    }\n\n    /**\n     * Gets the rowID at index provided if the dataSource arrays were flattened,\n     * or null of out of range indexes.\n     */\n\n  }, {\n    key: 'getRowIDForFlatIndex',\n    value: function getRowIDForFlatIndex(index) {\n      var accessIndex = index;\n      for (var ii = 0; ii < this.sectionIdentities.length; ii++) {\n        if (accessIndex >= this.rowIdentities[ii].length) {\n          accessIndex -= this.rowIdentities[ii].length;\n        } else {\n          return this.rowIdentities[ii][accessIndex];\n        }\n      }\n      return null;\n    }\n\n    /**\n     * Gets the sectionID at index provided if the dataSource arrays were flattened,\n     * or null for out of range indexes.\n     */\n\n  }, {\n    key: 'getSectionIDForFlatIndex',\n    value: function getSectionIDForFlatIndex(index) {\n      var accessIndex = index;\n      for (var ii = 0; ii < this.sectionIdentities.length; ii++) {\n        if (accessIndex >= this.rowIdentities[ii].length) {\n          accessIndex -= this.rowIdentities[ii].length;\n        } else {\n          return this.sectionIdentities[ii];\n        }\n      }\n      return null;\n    }\n\n    /**\n     * Returns an array containing the number of rows in each section\n     */\n\n  }, {\n    key: 'getSectionLengths',\n    value: function getSectionLengths() {\n      var results = [];\n      for (var ii = 0; ii < this.sectionIdentities.length; ii++) {\n        results.push(this.rowIdentities[ii].length);\n      }\n      return results;\n    }\n\n    /**\n     * Returns if the section header is dirtied and needs to be rerendered\n     */\n\n  }, {\n    key: 'sectionHeaderShouldUpdate',\n    value: function sectionHeaderShouldUpdate(sectionIndex) {\n      var needsUpdate = this._dirtySections[sectionIndex];\n      warning(needsUpdate !== undefined, 'missing dirtyBit for section: ' + sectionIndex);\n      return needsUpdate;\n    }\n\n    /**\n     * Gets the data required to render the section header\n     */\n\n  }, {\n    key: 'getSectionHeaderData',\n    value: function getSectionHeaderData(sectionIndex) {\n      if (!this._getSectionHeaderData) {\n        return null;\n      }\n      var sectionID = this.sectionIdentities[sectionIndex];\n      warning(sectionID !== undefined, 'renderSection called on invalid section: ' + sectionIndex);\n      return this._getSectionHeaderData(this._dataBlob, sectionID);\n    }\n\n    /**\n     * Private members and methods.\n     */\n\n    // These two 'protected' variables are accessed by ListView to iterate over\n    // the data in this class.\n\n  }, {\n    key: '_calculateDirtyArrays',\n    value: function _calculateDirtyArrays(prevDataBlob, prevSectionIDs, prevRowIDs) {\n      // construct a hashmap of the existing (old) id arrays\n      var prevSectionsHash = keyedDictionaryFromArray(prevSectionIDs);\n      var prevRowsHash = {};\n      for (var ii = 0; ii < prevRowIDs.length; ii++) {\n        var sectionID = prevSectionIDs[ii];\n        warning(!prevRowsHash[sectionID], 'SectionID appears more than once: ' + sectionID);\n        prevRowsHash[sectionID] = keyedDictionaryFromArray(prevRowIDs[ii]);\n      }\n\n      // compare the 2 identity array and get the dirtied rows\n      this._dirtySections = [];\n      this._dirtyRows = [];\n\n      var dirty;\n      for (var sIndex = 0; sIndex < this.sectionIdentities.length; sIndex++) {\n        var sectionID = this.sectionIdentities[sIndex];\n        // dirty if the sectionHeader is new or _sectionHasChanged is true\n        dirty = !prevSectionsHash[sectionID];\n        var sectionHeaderHasChanged = this._sectionHeaderHasChanged;\n        if (!dirty && sectionHeaderHasChanged) {\n          dirty = sectionHeaderHasChanged(this._getSectionHeaderData(prevDataBlob, sectionID), this._getSectionHeaderData(this._dataBlob, sectionID));\n        }\n        this._dirtySections.push(!!dirty);\n\n        this._dirtyRows[sIndex] = [];\n        for (var rIndex = 0; rIndex < this.rowIdentities[sIndex].length; rIndex++) {\n          var rowID = this.rowIdentities[sIndex][rIndex];\n          // dirty if the section is new, row is new or _rowHasChanged is true\n          dirty = !prevSectionsHash[sectionID] || !prevRowsHash[sectionID][rowID] || this._rowHasChanged(this._getRowData(prevDataBlob, sectionID, rowID), this._getRowData(this._dataBlob, sectionID, rowID));\n          this._dirtyRows[sIndex].push(!!dirty);\n        }\n      }\n    }\n  }]);\n\n  return ListViewDataSource;\n}();\n\nfunction countRows(allRowIDs) {\n  var totalRows = 0;\n  for (var sectionIdx = 0; sectionIdx < allRowIDs.length; sectionIdx++) {\n    var rowIDs = allRowIDs[sectionIdx];\n    totalRows += rowIDs.length;\n  }\n  return totalRows;\n}\n\nfunction keyedDictionaryFromArray(arr) {\n  if (isEmpty(arr)) {\n    return {};\n  }\n  var result = {};\n  for (var ii = 0; ii < arr.length; ii++) {\n    var key = arr[ii];\n    warning(!result[key], 'Value appears more than once in array: ' + key);\n    result[key] = true;\n  }\n  return result;\n}\n\n// module.exports = ListViewDataSource;\nexport default ListViewDataSource;","import _extends from 'babel-runtime/helpers/extends';\nimport _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from 'babel-runtime/helpers/createClass';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\n/* eslint no-unused-vars: 0, react/no-multi-comp: 0\nreact/prop-types: 0, react/sort-comp: 0, no-unused-expressions: 0 */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport ReactDOM from 'react-dom';\nimport ListViewDataSource from './ListViewDataSource';\nimport ScrollView from './ScrollView';\n\nvar DEFAULT_PAGE_SIZE = 1;\nvar DEFAULT_INITIAL_ROWS = 10;\nvar DEFAULT_SCROLL_RENDER_AHEAD = 1000;\nvar DEFAULT_END_REACHED_THRESHOLD = 1000;\nvar DEFAULT_SCROLL_CALLBACK_THROTTLE = 50;\n// const SCROLLVIEW_REF = 'ListViewRef';\n\nvar StaticRenderer = function (_React$Component) {\n  _inherits(StaticRenderer, _React$Component);\n\n  function StaticRenderer() {\n    _classCallCheck(this, StaticRenderer);\n\n    return _possibleConstructorReturn(this, (StaticRenderer.__proto__ || Object.getPrototypeOf(StaticRenderer)).apply(this, arguments));\n  }\n\n  _createClass(StaticRenderer, [{\n    key: 'shouldComponentUpdate',\n    value: function shouldComponentUpdate(nextProps) {\n      return nextProps.shouldUpdate;\n    }\n  }, {\n    key: 'render',\n    value: function render() {\n      return this.props.render();\n    }\n  }]);\n\n  return StaticRenderer;\n}(React.Component);\n// https://github.com/facebook/react-native/blob/0.26-stable/Libraries/CustomComponents/ListView/ListView.js\n\n\nvar ListView = function (_React$Component2) {\n  _inherits(ListView, _React$Component2);\n\n  function ListView() {\n    var _ref;\n\n    var _temp, _this2, _ret;\n\n    _classCallCheck(this, ListView);\n\n    for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n\n    return _ret = (_temp = (_this2 = _possibleConstructorReturn(this, (_ref = ListView.__proto__ || Object.getPrototypeOf(ListView)).call.apply(_ref, [this].concat(args))), _this2), _initialiseProps.call(_this2), _temp), _possibleConstructorReturn(_this2, _ret);\n  }\n\n  /**\n   * Exports some data, e.g. for perf investigations or analytics.\n   */\n\n\n  _createClass(ListView, [{\n    key: 'componentWillMount',\n    value: function componentWillMount() {\n      // this data should never trigger a render pass, so don't put in state\n      this.scrollProperties = {\n        visibleLength: null,\n        contentLength: null,\n        offset: 0\n      };\n      this._childFrames = [];\n      this._visibleRows = {};\n      this._prevRenderedRowsCount = 0;\n      this._sentEndForContentLength = null;\n    }\n  }, {\n    key: 'componentWillReceiveProps',\n    value: function componentWillReceiveProps(nextProps) {\n      var _this3 = this;\n\n      if (this.props.dataSource !== nextProps.dataSource || this.props.initialListSize !== nextProps.initialListSize) {\n        this.setState(function (state, props) {\n          _this3._prevRenderedRowsCount = 0;\n          return {\n            curRenderedRowsCount: Math.min(Math.max(state.curRenderedRowsCount, nextProps.initialListSize // for preact\n            ), nextProps.dataSource.getRowCount() // for preact\n            )\n          };\n        }, function () {\n          return _this3._renderMoreRowsIfNeeded();\n        });\n      }\n    }\n  }, {\n    key: 'render',\n    value: function render() {\n      var _this4 = this;\n\n      var dataSource = this.props.dataSource;\n      var allRowIDs = dataSource.rowIdentities;\n      var bodyComponents = [];\n      var rowCount = 0;\n\n      for (var sectionIdx = 0; sectionIdx < allRowIDs.length; sectionIdx++) {\n        var sectionID = dataSource.sectionIdentities[sectionIdx];\n        var rowIDs = allRowIDs[sectionIdx];\n        if (rowIDs.length === 0) {\n          continue;\n        }\n\n        var renderSectionHeader = void 0;\n        if (this.props.renderSectionHeader) {\n          var shouldUpdateHeader = rowCount >= this._prevRenderedRowsCount && dataSource.sectionHeaderShouldUpdate(sectionIdx);\n\n          renderSectionHeader = React.createElement(StaticRenderer, {\n            key: 's_' + sectionID,\n            shouldUpdate: !!shouldUpdateHeader,\n            render: this.props.renderSectionHeader.bind(null, dataSource.getSectionHeaderData(sectionIdx), sectionID)\n          });\n        }\n\n        var sectionBody = [];\n        for (var rowIdx = 0; rowIdx < rowIDs.length; rowIdx++) {\n          var rowID = rowIDs[rowIdx];\n          var comboID = sectionID + '_' + rowID;\n          var shouldUpdateRow = rowCount >= this._prevRenderedRowsCount && dataSource.rowShouldUpdate(sectionIdx, rowIdx);\n          var row = React.createElement(StaticRenderer, {\n            key: 'r_' + comboID,\n            shouldUpdate: !!shouldUpdateRow,\n            render: this.props.renderRow.bind(null, dataSource.getRowData(sectionIdx, rowIdx), sectionID, rowID, this.onRowHighlighted)\n          });\n          sectionBody.push(row);\n\n          if (this.props.renderSeparator && (rowIdx !== rowIDs.length - 1 || sectionIdx === allRowIDs.length - 1)) {\n            var adjacentRowHighlighted = this.state.highlightedRow.sectionID === sectionID && (this.state.highlightedRow.rowID === rowID || this.state.highlightedRow.rowID === rowIDs[rowIdx + 1]);\n            var separator = this.props.renderSeparator(sectionID, rowID, adjacentRowHighlighted);\n            if (separator) {\n              sectionBody.push(separator);\n            }\n          }\n          if (++rowCount === this.state.curRenderedRowsCount) {\n            break;\n          }\n        }\n\n        var rowsAndSeparators = React.cloneElement(this.props.renderSectionBodyWrapper(sectionID), {\n          className: this.props.sectionBodyClassName\n        }, sectionBody);\n\n        if (this.props.renderSectionWrapper) {\n          bodyComponents.push(React.cloneElement(this.props.renderSectionWrapper(sectionID), {}, renderSectionHeader, rowsAndSeparators));\n        } else {\n          bodyComponents.push(renderSectionHeader);\n          bodyComponents.push(rowsAndSeparators);\n        }\n        if (rowCount >= this.state.curRenderedRowsCount) {\n          break;\n        }\n      }\n\n      var _props = this.props,\n          renderScrollComponent = _props.renderScrollComponent,\n          props = _objectWithoutProperties(_props, ['renderScrollComponent']);\n\n      return React.cloneElement(renderScrollComponent(_extends({}, props, { onScroll: this._onScroll })), {\n        ref: function ref(el) {\n          return _this4.ListViewRef = el;\n        },\n        onContentSizeChange: this._onContentSizeChange,\n        onLayout: this._onLayout\n      }, this.props.renderHeader ? this.props.renderHeader() : null, React.cloneElement(props.renderBodyComponent(), {}, bodyComponents), this.props.renderFooter ? this.props.renderFooter() : null, props.children);\n    }\n  }]);\n\n  return ListView;\n}(React.Component);\n\nListView.DataSource = ListViewDataSource;\nListView.propTypes = _extends({}, ScrollView.propTypes, {\n  dataSource: PropTypes.instanceOf(ListViewDataSource).isRequired,\n  renderSeparator: PropTypes.func,\n  renderRow: PropTypes.func.isRequired,\n  initialListSize: PropTypes.number,\n  onEndReached: PropTypes.func,\n  onEndReachedThreshold: PropTypes.number,\n  pageSize: PropTypes.number,\n  renderFooter: PropTypes.func,\n  renderHeader: PropTypes.func,\n  renderSectionHeader: PropTypes.func,\n  renderScrollComponent: PropTypes.func,\n  scrollRenderAheadDistance: PropTypes.number,\n  onChangeVisibleRows: PropTypes.func,\n  scrollEventThrottle: PropTypes.number,\n  // another added\n  renderBodyComponent: PropTypes.func,\n  renderSectionWrapper: PropTypes.func,\n  renderSectionBodyWrapper: PropTypes.func,\n  sectionBodyClassName: PropTypes.string,\n  listViewPrefixCls: PropTypes.string,\n  useBodyScroll: PropTypes.bool\n});\nListView.defaultProps = {\n  initialListSize: DEFAULT_INITIAL_ROWS,\n  pageSize: DEFAULT_PAGE_SIZE,\n  renderScrollComponent: function renderScrollComponent(props) {\n    return React.createElement(ScrollView, props);\n  },\n  renderBodyComponent: function renderBodyComponent() {\n    return React.createElement('div', null);\n  },\n  renderSectionBodyWrapper: function renderSectionBodyWrapper(sectionID) {\n    return React.createElement('div', { key: sectionID });\n  },\n  sectionBodyClassName: 'list-view-section-body',\n  listViewPrefixCls: 'rmc-list-view',\n  scrollRenderAheadDistance: DEFAULT_SCROLL_RENDER_AHEAD,\n  onEndReachedThreshold: DEFAULT_END_REACHED_THRESHOLD,\n  scrollEventThrottle: DEFAULT_SCROLL_CALLBACK_THROTTLE,\n  scrollerOptions: {}\n};\n\nvar _initialiseProps = function _initialiseProps() {\n  var _this5 = this;\n\n  this.state = {\n    curRenderedRowsCount: this.props.initialListSize,\n    highlightedRow: {} };\n\n  this.getMetrics = function () {\n    return {\n      contentLength: _this5.scrollProperties.contentLength,\n      totalRows: _this5.props.dataSource.getRowCount(),\n      renderedRows: _this5.state.curRenderedRowsCount,\n      visibleRows: Object.keys(_this5._visibleRows).length\n    };\n  };\n\n  this.getInnerViewNode = function () {\n    return _this5.ListViewRef.getInnerViewNode();\n  };\n\n  this.scrollTo = function () {\n    var _ListViewRef;\n\n    _this5.ListViewRef && _this5.ListViewRef.scrollTo && (_ListViewRef = _this5.ListViewRef).scrollTo.apply(_ListViewRef, arguments);\n  };\n\n  this.onRowHighlighted = function (sectionID, rowID) {\n    _this5.setState({ highlightedRow: { sectionID: sectionID, rowID: rowID } });\n  };\n\n  this._onContentSizeChange = function (width, height) {\n    var contentLength = !_this5.props.horizontal ? height : width;\n    if (contentLength !== _this5.scrollProperties.contentLength) {\n      _this5.scrollProperties.contentLength = contentLength;\n      _this5._renderMoreRowsIfNeeded();\n    }\n    _this5.props.onContentSizeChange && _this5.props.onContentSizeChange(width, height);\n  };\n\n  this._onLayout = function (event) {\n    var _event$nativeEvent$la = event.nativeEvent.layout,\n        width = _event$nativeEvent$la.width,\n        height = _event$nativeEvent$la.height;\n\n    var visibleLength = !_this5.props.horizontal ? height : width;\n    if (visibleLength !== _this5.scrollProperties.visibleLength) {\n      _this5.scrollProperties.visibleLength = visibleLength;\n      _this5._renderMoreRowsIfNeeded();\n    }\n    _this5.props.onLayout && _this5.props.onLayout(event);\n  };\n\n  this._maybeCallOnEndReached = function (event) {\n    // console.log(this.scrollProperties, this._getDistanceFromEnd(this.scrollProperties));\n    if (_this5.props.onEndReached && _this5.scrollProperties.contentLength !== _this5._sentEndForContentLength && _this5._getDistanceFromEnd(_this5.scrollProperties) < _this5.props.onEndReachedThreshold && _this5.state.curRenderedRowsCount === _this5.props.dataSource.getRowCount()) {\n      _this5._sentEndForContentLength = _this5.scrollProperties.contentLength;\n      _this5.props.onEndReached(event);\n      return true;\n    }\n    return false;\n  };\n\n  this._renderMoreRowsIfNeeded = function () {\n    if (_this5.scrollProperties.contentLength === null || _this5.scrollProperties.visibleLength === null || _this5.state.curRenderedRowsCount === _this5.props.dataSource.getRowCount()) {\n      _this5._maybeCallOnEndReached();\n      return;\n    }\n\n    var distanceFromEnd = _this5._getDistanceFromEnd(_this5.scrollProperties);\n    // console.log(distanceFromEnd, this.props.scrollRenderAheadDistance);\n    if (distanceFromEnd < _this5.props.scrollRenderAheadDistance) {\n      _this5._pageInNewRows();\n    }\n  };\n\n  this._pageInNewRows = function () {\n    _this5.setState(function (state, props) {\n      var rowsToRender = Math.min(state.curRenderedRowsCount + props.pageSize, props.dataSource.getRowCount());\n      _this5._prevRenderedRowsCount = state.curRenderedRowsCount;\n      return {\n        curRenderedRowsCount: rowsToRender\n      };\n    }, function () {\n      _this5._prevRenderedRowsCount = _this5.state.curRenderedRowsCount;\n    });\n  };\n\n  this._getDistanceFromEnd = function (scrollProperties) {\n    return scrollProperties.contentLength - scrollProperties.visibleLength - scrollProperties.offset;\n  };\n\n  this._onScroll = function (e, metrics) {\n    // when the ListView is destroyed,\n    // but also will trigger scroll event after `scrollEventThrottle`\n    if (!_this5.ListViewRef) {\n      return;\n    }\n\n    _this5.scrollProperties = metrics;\n\n    if (!_this5._maybeCallOnEndReached(e)) {\n      _this5._renderMoreRowsIfNeeded();\n    }\n\n    if (_this5.props.onEndReached && _this5._getDistanceFromEnd(_this5.scrollProperties) > _this5.props.onEndReachedThreshold) {\n      // Scrolled out of the end zone, so it should be able to trigger again.\n      _this5._sentEndForContentLength = null;\n    }\n\n    _this5.props.onScroll && _this5.props.onScroll(e);\n  };\n};\n\nexport default ListView;"],"sourceRoot":""}