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OAAO,SAAW","file":"/npm/@cwmoo740/react-infinite@0.13.0/build/react-infinite.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@cwmoo740/react-infinite@0.13.0/build/react-infinite.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar React = global.React || require('react');\nvar PropTypes = global.PropTypes || require('prop-types');\n\nvar window = require('./utils/window');\n\nrequire('./utils/establish-polyfills');\nvar scaleEnum = require('./utils/scaleEnum');\nvar infiniteHelpers = require('./utils/infiniteHelpers');\nvar _isFinite = require('lodash.isfinite');\n\nvar checkProps = require('./utils/checkProps');\n\nvar Infinite = function (_React$Component) {\n  _inherits(Infinite, _React$Component);\n\n  _createClass(Infinite, null, [{\n    key: 'containerHeightScaleFactor',\n    value: function containerHeightScaleFactor(factor) {\n      if (!_isFinite(factor)) {\n        throw new Error('The scale factor must be a number.');\n      }\n      return {\n        type: scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,\n        amount: factor\n      };\n    }\n  }]);\n\n  function Infinite(props) {\n    _classCallCheck(this, Infinite);\n\n    var _this = _possibleConstructorReturn(this, (Infinite.__proto__ || Object.getPrototypeOf(Infinite)).call(this, props));\n\n    _initialiseProps.call(_this);\n\n    var nextInternalState = _this.recomputeInternalStateFromProps(props);\n\n    _this.computedProps = nextInternalState.computedProps;\n    _this.utils = nextInternalState.utils;\n    _this.shouldAttachToBottom = props.displayBottomUpwards;\n\n    var state = nextInternalState.newState;\n    state.scrollTimeout = undefined;\n    state.isScrolling = false;\n\n    _this.state = state;\n    return _this;\n  }\n\n  // Properties currently used but which may be\n  // refactored away in the future.\n\n\n  // Refs\n\n\n  _createClass(Infinite, [{\n    key: 'componentWillReceiveProps',\n    value: function componentWillReceiveProps(nextProps) {\n      var nextInternalState = this.recomputeInternalStateFromProps(nextProps);\n\n      this.computedProps = nextInternalState.computedProps;\n      this.utils = nextInternalState.utils;\n\n      this.setState(nextInternalState.newState);\n    }\n  }, {\n    key: 'componentWillUpdate',\n    value: function componentWillUpdate() {\n      if (this.props.displayBottomUpwards) {\n        this.preservedScrollState = this.utils.getScrollTop() - this.loadingSpinnerHeight;\n      }\n    }\n  }, {\n    key: 'componentDidUpdate',\n    value: function componentDidUpdate(prevProps, prevState) {\n      this.loadingSpinnerHeight = this.utils.getLoadingSpinnerHeight();\n\n      if (!prevProps.useWindowAsScrollContainer && this.props.useWindowAsScrollContainer) {\n        this.utils.subscribeToScrollListener();\n      }\n\n      if (this.props.displayBottomUpwards) {\n        var lowestScrollTop = this.getLowestPossibleScrollTop();\n        if (this.shouldAttachToBottom && this.utils.getScrollTop() < lowestScrollTop) {\n          this.utils.setScrollTop(lowestScrollTop);\n        } else if (prevProps.isInfiniteLoading && !this.props.isInfiniteLoading) {\n          this.utils.setScrollTop(this.state.infiniteComputer.getTotalScrollableHeight() - prevState.infiniteComputer.getTotalScrollableHeight() + this.preservedScrollState);\n        }\n      }\n\n      var hasLoadedMoreChildren = this.state.numberOfChildren !== prevState.numberOfChildren;\n      if (hasLoadedMoreChildren) {\n        var newApertureState = infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state, this.utils.getScrollTop());\n        this.setState(newApertureState);\n      }\n\n      var isMissingVisibleRows = hasLoadedMoreChildren && !this.hasAllVisibleItems() && !this.state.isInfiniteLoading;\n      if (isMissingVisibleRows) {\n        this.onInfiniteLoad();\n      }\n    }\n  }, {\n    key: 'componentDidMount',\n    value: function componentDidMount() {\n      this.utils.subscribeToScrollListener();\n\n      if (!this.hasAllVisibleItems()) {\n        this.onInfiniteLoad();\n      }\n\n      if (this.props.displayBottomUpwards) {\n        var lowestScrollTop = this.getLowestPossibleScrollTop();\n        if (this.shouldAttachToBottom && this.utils.getScrollTop() < lowestScrollTop) {\n          this.utils.setScrollTop(lowestScrollTop);\n        }\n      }\n    }\n  }, {\n    key: 'componentWillUnmount',\n    value: function componentWillUnmount() {\n      this.utils.unsubscribeFromScrollListener();\n    }\n  }, {\n    key: 'render',\n    value: function render() {\n      var _this2 = this;\n\n      var displayables;\n      if (this.state.numberOfChildren > 1) {\n        displayables = this.computedProps.children.slice(this.state.displayIndexStart, this.state.displayIndexEnd + 1);\n      } else {\n        displayables = this.computedProps.children;\n      }\n\n      var infiniteScrollStyles = {};\n      if (this.state.isScrolling) {\n        infiniteScrollStyles.pointerEvents = 'none';\n      }\n\n      var topSpacerHeight = this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),\n          bottomSpacerHeight = this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);\n\n      // This asymmetry is due to a reluctance to use CSS to control\n      // the bottom alignment\n      if (this.computedProps.displayBottomUpwards) {\n        var heightDifference = this.computedProps.containerHeight - this.state.infiniteComputer.getTotalScrollableHeight();\n        if (heightDifference > 0) {\n          topSpacerHeight = heightDifference - this.loadingSpinnerHeight;\n        }\n      }\n\n      var loadingSpinner = this.computedProps.infiniteLoadBeginEdgeOffset === undefined ? null : React.createElement(\n        'div',\n        {\n          ref: function ref(c) {\n            _this2.loadingSpinner = c;\n          }\n        },\n        this.state.isInfiniteLoading ? this.computedProps.loadingSpinnerDelegate : null\n      );\n\n      // topSpacer and bottomSpacer take up the amount of space that the\n      // rendered elements would have taken up otherwise\n      return React.createElement(\n        'div',\n        {\n          className: this.computedProps.className,\n          ref: function ref(c) {\n            _this2.scrollable = c;\n          },\n          style: this.utils.buildScrollableStyle(),\n          onScroll: this.utils.nodeScrollListener\n        },\n        React.createElement(\n          'div',\n          {\n            ref: function ref(c) {\n              _this2.smoothScrollingWrapper = c;\n            },\n            style: infiniteScrollStyles\n          },\n          React.createElement('div', {\n            ref: function ref(c) {\n              _this2.topSpacer = c;\n            },\n            style: infiniteHelpers.buildHeightStyle(topSpacerHeight)\n          }),\n          this.computedProps.displayBottomUpwards && loadingSpinner,\n          displayables,\n          !this.computedProps.displayBottomUpwards && loadingSpinner,\n          React.createElement('div', {\n            ref: function ref(c) {\n              _this2.bottomSpacer = c;\n            },\n            style: infiniteHelpers.buildHeightStyle(bottomSpacerHeight)\n          })\n        )\n      );\n    }\n  }]);\n\n  return Infinite;\n}(React.Component);\n\nInfinite.propTypes = {\n  children: PropTypes.any,\n\n  handleScroll: PropTypes.func,\n\n  // preloadBatchSize causes updates only to\n  // happen each preloadBatchSize pixels of scrolling.\n  // Set a larger number to cause fewer updates to the\n  // element list.\n  preloadBatchSize: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({\n    type: PropTypes.oneOf(['containerHeightScaleFactor']).isRequired,\n    amount: PropTypes.number.isRequired\n  })]),\n  // preloadAdditionalHeight determines how much of the\n  // list above and below the container is preloaded even\n  // when it is not currently visible to the user. In the\n  // regular scroll implementation, preloadAdditionalHeight\n  // is equal to the entire height of the list.\n  preloadAdditionalHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({\n    type: PropTypes.oneOf(['containerHeightScaleFactor']).isRequired,\n    amount: PropTypes.number.isRequired\n  })]), // page to screen ratio\n\n  // The provided elementHeight can be either\n  //  1. a constant: all elements are the same height\n  //  2. an array containing the height of each element\n  elementHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.arrayOf(PropTypes.number)]).isRequired,\n  // This is the total height of the visible window. One\n  // of\n  containerHeight: PropTypes.number,\n  useWindowAsScrollContainer: PropTypes.bool,\n\n  displayBottomUpwards: PropTypes.bool.isRequired,\n\n  infiniteLoadBeginEdgeOffset: PropTypes.number,\n  onInfiniteLoad: PropTypes.func,\n  loadingSpinnerDelegate: PropTypes.node,\n\n  isInfiniteLoading: PropTypes.bool,\n  timeScrollStateLastsForAfterUserScrolls: PropTypes.number,\n\n  className: PropTypes.string,\n\n  styles: PropTypes.shape({\n    scrollableStyle: PropTypes.object\n  }).isRequired\n};\nInfinite.defaultProps = {\n  handleScroll: function handleScroll() {},\n\n  useWindowAsScrollContainer: false,\n\n  onInfiniteLoad: function onInfiniteLoad() {},\n  loadingSpinnerDelegate: React.createElement('div', null),\n\n  displayBottomUpwards: false,\n\n  isInfiniteLoading: false,\n  timeScrollStateLastsForAfterUserScrolls: 150,\n\n  className: '',\n\n  styles: {}\n};\n\nvar _initialiseProps = function _initialiseProps() {\n  var _this3 = this;\n\n  this.shouldAttachToBottom = false;\n  this.preservedScrollState = 0;\n  this.loadingSpinnerHeight = 0;\n\n  this.generateComputedUtilityFunctions = function (props) {\n    var utilities = {};\n    utilities.getLoadingSpinnerHeight = function () {\n      var loadingSpinnerHeight = 0;\n      if (_this3.loadingSpinner) {\n        loadingSpinnerHeight = _this3.loadingSpinner.offsetHeight || 0;\n      }\n      return loadingSpinnerHeight;\n    };\n    if (props.useWindowAsScrollContainer) {\n      utilities.subscribeToScrollListener = function () {\n        window.addEventListener('scroll', _this3.infiniteHandleScroll);\n      };\n      utilities.unsubscribeFromScrollListener = function () {\n        window.removeEventListener('scroll', _this3.infiniteHandleScroll);\n      };\n      utilities.nodeScrollListener = function () {};\n      utilities.getScrollTop = function () {\n        return window.pageYOffset;\n      };\n      utilities.setScrollTop = function (top) {\n        window.scroll(window.pageXOffset, top);\n      };\n      utilities.scrollShouldBeIgnored = function () {\n        return false;\n      };\n      utilities.buildScrollableStyle = function () {\n        return {};\n      };\n    } else {\n      utilities.subscribeToScrollListener = function () {};\n      utilities.unsubscribeFromScrollListener = function () {};\n      utilities.nodeScrollListener = _this3.infiniteHandleScroll;\n      utilities.getScrollTop = function () {\n        return _this3.scrollable ? _this3.scrollable.scrollTop : 0;\n      };\n\n      utilities.setScrollTop = function (top) {\n        if (_this3.scrollable) {\n          _this3.scrollable.scrollTop = top;\n        }\n      };\n      utilities.scrollShouldBeIgnored = function (event) {\n        return event.target !== _this3.scrollable;\n      };\n\n      utilities.buildScrollableStyle = function () {\n        return Object.assign({}, {\n          height: _this3.computedProps.containerHeight,\n          overflowX: 'hidden',\n          overflowY: 'scroll',\n          WebkitOverflowScrolling: 'touch'\n        }, _this3.computedProps.styles.scrollableStyle || {});\n      };\n    }\n    return utilities;\n  };\n\n  this.recomputeInternalStateFromProps = function (props) {\n    checkProps(props);\n    var computedProps = infiniteHelpers.generateComputedProps(props);\n    var utils = _this3.generateComputedUtilityFunctions(props);\n\n    var newState = {};\n\n    newState.numberOfChildren = React.Children.count(computedProps.children);\n    newState.infiniteComputer = infiniteHelpers.createInfiniteComputer(computedProps.elementHeight, computedProps.children);\n\n    if (computedProps.isInfiniteLoading !== undefined) {\n      newState.isInfiniteLoading = computedProps.isInfiniteLoading;\n    }\n\n    newState.preloadBatchSize = computedProps.preloadBatchSize;\n    newState.preloadAdditionalHeight = computedProps.preloadAdditionalHeight;\n\n    newState = Object.assign(newState, infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(newState, utils.getScrollTop()));\n\n    return {\n      computedProps: computedProps,\n      utils: utils,\n      newState: newState\n    };\n  };\n\n  this.infiniteHandleScroll = function (e) {\n    if (_this3.utils.scrollShouldBeIgnored(e)) {\n      return;\n    }\n    _this3.computedProps.handleScroll(_this3.scrollable);\n    _this3.handleScroll(_this3.utils.getScrollTop());\n  };\n\n  this.manageScrollTimeouts = function () {\n    // Maintains a series of timeouts to set this.state.isScrolling\n    // to be true when the element is scrolling.\n\n    if (_this3.state.scrollTimeout) {\n      clearTimeout(_this3.state.scrollTimeout);\n    }\n\n    var that = _this3,\n        scrollTimeout = setTimeout(function () {\n      that.setState({\n        isScrolling: false,\n        scrollTimeout: undefined\n      });\n    }, _this3.computedProps.timeScrollStateLastsForAfterUserScrolls);\n\n    _this3.setState({\n      isScrolling: true,\n      scrollTimeout: scrollTimeout\n    });\n  };\n\n  this.getLowestPossibleScrollTop = function () {\n    return _this3.state.infiniteComputer.getTotalScrollableHeight() - _this3.computedProps.containerHeight;\n  };\n\n  this.hasAllVisibleItems = function () {\n    return !(_isFinite(_this3.computedProps.infiniteLoadBeginEdgeOffset) && _this3.state.infiniteComputer.getTotalScrollableHeight() < _this3.computedProps.containerHeight);\n  };\n\n  this.passedEdgeForInfiniteScroll = function (scrollTop) {\n    var edgeOffset = _this3.computedProps.infiniteLoadBeginEdgeOffset;\n    if (typeof edgeOffset !== 'number') {\n      return false;\n    }\n\n    if (_this3.computedProps.displayBottomUpwards) {\n      return !_this3.shouldAttachToBottom && scrollTop < edgeOffset;\n    } else {\n      return scrollTop > _this3.state.infiniteComputer.getTotalScrollableHeight() - _this3.computedProps.containerHeight - edgeOffset;\n    }\n  };\n\n  this.onInfiniteLoad = function () {\n    _this3.setState({ isInfiniteLoading: true });\n    _this3.computedProps.onInfiniteLoad();\n  };\n\n  this.handleScroll = function (scrollTop) {\n    _this3.shouldAttachToBottom = _this3.computedProps.displayBottomUpwards && scrollTop >= _this3.getLowestPossibleScrollTop();\n\n    _this3.manageScrollTimeouts();\n\n    var newApertureState = infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(_this3.state, scrollTop);\n\n    if (_this3.passedEdgeForInfiniteScroll(scrollTop) && !_this3.state.isInfiniteLoading) {\n      _this3.setState(Object.assign({}, newApertureState));\n      _this3.onInfiniteLoad();\n    } else {\n      _this3.setState(newApertureState);\n    }\n  };\n};\n\nmodule.exports = Infinite;\nglobal.Infinite = Infinite;"]}