From 9dc4d91521e74cf7b670bf552bddb79c5846cca0 Mon Sep 17 00:00:00 2001 From: Alexander Beshchuk Date: Thu, 20 Oct 2016 16:05:38 +0300 Subject: [PATCH 1/2] Loading items on container height dynamically changed --- __tests__/infinite_test.js | 31 +++++++++++++++++++++++++++++++ src/react-infinite.jsx | 9 +++++++++ 2 files changed, 40 insertions(+) diff --git a/__tests__/infinite_test.js b/__tests__/infinite_test.js index 7f9405c..64c21a8 100644 --- a/__tests__/infinite_test.js +++ b/__tests__/infinite_test.js @@ -448,6 +448,37 @@ describe("React Infinite's Infinite Scroll Capabilities", function() { expect(infiniteSpy).not.toHaveBeenCalled(); }); + it('triggers the onInfiniteLoad function when containerHeight changes', function() { + var infiniteSpy = jasmine.createSpy('infiniteSpy'); + var elementHeight = 200; + + var rootNode = document.createElement('div'); + + ReactDOM.render( + + {renderHelpers.divGenerator(2, elementHeight)} + , + rootNode + ); + + ReactDOM.render( + + {renderHelpers.divGenerator(2, elementHeight)} + , + rootNode + ); + + expect(infiniteSpy).toHaveBeenCalled(); + }); + it('triggers the onInfiniteLoad function when scrolling past infiniteLoadBeginEdgeOffset', function() { var infiniteSpy = jasmine.createSpy('infiniteSpy'); var elementHeight = 200; diff --git a/src/react-infinite.jsx b/src/react-infinite.jsx index 7c3d403..8acc86b 100644 --- a/src/react-infinite.jsx +++ b/src/react-infinite.jsx @@ -305,6 +305,15 @@ var Infinite = React.createClass({ if (isMissingVisibleRows) { this.onInfiniteLoad(); } + + if (this.props.containerHeight !== prevProps.containerHeight) { + const scrollTop = this.utils.getScrollTop(); + const newApertureState = infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state, scrollTop); + if (this.passedEdgeForInfiniteScroll(scrollTop) && !this.state.isInfiniteLoading) { + this.setState({...newApertureState}); + this.onInfiniteLoad(); + } + } }, componentDidMount() { From 2d66c2955dca702558ff3f7ab2d5041f08be9693 Mon Sep 17 00:00:00 2001 From: Oleksandr Beshchuk Date: Mon, 22 May 2017 01:23:51 +0300 Subject: [PATCH 2/2] useWindowAsScrollContainer and dynamic containerHeight test. Fix for containerHeight value source. --- __tests__/infinite_test.js | 44 +++++++++++++++++++++++++++++++++----- dist/react-infinite.js | 2 +- dist/react-infinite.min.js | 4 ++-- src/react-infinite.jsx | 9 ++------ 4 files changed, 44 insertions(+), 15 deletions(-) diff --git a/__tests__/infinite_test.js b/__tests__/infinite_test.js index b1a01e0..83095b0 100644 --- a/__tests__/infinite_test.js +++ b/__tests__/infinite_test.js @@ -468,11 +468,11 @@ describe("React Infinite's Infinite Scroll Capabilities", function() { ReactDOM.render( - {renderHelpers.divGenerator(2, elementHeight)} + containerHeight={1000} + onInfiniteLoad={infiniteSpy} + infiniteLoadBeginEdgeOffset={100} + className={"correct-class-name"}> + {renderHelpers.divGenerator(2, elementHeight)} , rootNode ); @@ -480,6 +480,40 @@ describe("React Infinite's Infinite Scroll Capabilities", function() { expect(infiniteSpy).toHaveBeenCalled(); }); + it('does not trigger the onInfiniteLoad function when containerHeight changes and useWindowAsScrollContainer is true', function() { + var infiniteSpy = jasmine.createSpy('infiniteSpy'); + var elementHeight = 200; + window.innerHeight = 400; + + var rootNode = document.createElement('div'); + + ReactDOM.render( + + {renderHelpers.divGenerator(2, elementHeight)} + , + rootNode + ); + + ReactDOM.render( + + {renderHelpers.divGenerator(2, elementHeight)} + , + rootNode + ); + + expect(infiniteSpy).not.toHaveBeenCalled(); + }); + it('triggers the onInfiniteLoad function when scrolling past infiniteLoadBeginEdgeOffset', function() { var infiniteSpy = jasmine.createSpy('infiniteSpy'); var elementHeight = 200; diff --git a/dist/react-infinite.js b/dist/react-infinite.js index dbbcfbd..0aa13f7 100644 --- a/dist/react-infinite.js +++ b/dist/react-infinite.js @@ -1,6 +1,6 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Infinite = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o]);return i}var React=global.React||require("react"),PropTypes=global.PropTypes||require("prop-types"),createReactClass=global.createReactClass||require("create-react-class");require("./utils/establish-polyfills");var scaleEnum=require("./utils/scaleEnum"),infiniteHelpers=require("./utils/infiniteHelpers"),_isFinite=require("lodash.isfinite"),preloadType=require("./utils/types").preloadType,checkProps=checkProps=require("./utils/checkProps"),Infinite=createReactClass({propTypes:{children:PropTypes.any,handleScroll:PropTypes.func,preloadBatchSize:preloadType,preloadAdditionalHeight:preloadType,elementHeight:PropTypes.oneOfType([PropTypes.number,PropTypes.arrayOf(PropTypes.number)]).isRequired,containerHeight:PropTypes.number,useWindowAsScrollContainer:PropTypes.bool,displayBottomUpwards:PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:PropTypes.number,onInfiniteLoad:PropTypes.func,loadingSpinnerDelegate:PropTypes.node,isInfiniteLoading:PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:PropTypes.number,className:PropTypes.string,styles:PropTypes.shape({scrollableStyle:PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!_isFinite(e))throw new Error("The scale factor must be a number.");return{type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:React.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,n=_objectWithoutProperties(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),r={};t="number"==typeof t?t:0,r.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==n.infiniteLoadBeginBottomOffset&&(r.infiniteLoadBeginEdgeOffset=n.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var s={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},l=i&&i.type?i:s;"number"==typeof i?r.preloadBatchSize=i:"object"==typeof l&&l.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadBatchSize=r.containerHeight*l.amount:r.preloadBatchSize=0;var a={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},c=o&&o.type?o:a;return"number"==typeof o?r.preloadAdditionalHeight=o:"object"==typeof c&&c.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadAdditionalHeight=r.containerHeight*c.amount:r.preloadAdditionalHeight=0,Object.assign(n,r)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){checkProps(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=React.Children.count(t.children),o.infiniteComputer=infiniteHelpers.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(o,i.getScrollTop())),{computedProps:t,utils:i,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),n=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var r=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();r>0&&(o=r-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:React.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return React.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},React.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},React.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,React.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(n)})))}});module.exports=Infinite,global.Infinite=Infinite; +"use strict";function _objectWithoutProperties(e,t){var i={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o]);return i}var React=global.React||require("react"),PropTypes=global.PropTypes||require("prop-types"),createReactClass=global.createReactClass||require("create-react-class");require("./utils/establish-polyfills");var scaleEnum=require("./utils/scaleEnum"),infiniteHelpers=require("./utils/infiniteHelpers"),_isFinite=require("lodash.isfinite"),preloadType=require("./utils/types").preloadType,checkProps=checkProps=require("./utils/checkProps"),Infinite=createReactClass({propTypes:{children:PropTypes.any,handleScroll:PropTypes.func,preloadBatchSize:preloadType,preloadAdditionalHeight:preloadType,elementHeight:PropTypes.oneOfType([PropTypes.number,PropTypes.arrayOf(PropTypes.number)]).isRequired,containerHeight:PropTypes.number,useWindowAsScrollContainer:PropTypes.bool,displayBottomUpwards:PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:PropTypes.number,onInfiniteLoad:PropTypes.func,loadingSpinnerDelegate:PropTypes.node,isInfiniteLoading:PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:PropTypes.number,className:PropTypes.string,styles:PropTypes.shape({scrollableStyle:PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!_isFinite(e))throw new Error("The scale factor must be a number.");return{type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:React.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,n=_objectWithoutProperties(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),r={};t="number"==typeof t?t:0,r.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==n.infiniteLoadBeginBottomOffset&&(r.infiniteLoadBeginEdgeOffset=n.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var s={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},l=i&&i.type?i:s;"number"==typeof i?r.preloadBatchSize=i:"object"==typeof l&&l.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadBatchSize=r.containerHeight*l.amount:r.preloadBatchSize=0;var a={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},c=o&&o.type?o:a;return"number"==typeof o?r.preloadAdditionalHeight=o:"object"==typeof c&&c.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadAdditionalHeight=r.containerHeight*c.amount:r.preloadAdditionalHeight=0,Object.assign(n,r)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){checkProps(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=React.Children.count(t.children),o.infiniteComputer=infiniteHelpers.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(o,i.getScrollTop())),{computedProps:t,utils:i,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),n=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var r=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();r>0&&(o=r-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:React.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return React.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},React.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},React.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,React.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(n)})))}});module.exports=Infinite,global.Infinite=Infinite; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"./utils/checkProps":22,"./utils/establish-polyfills":23,"./utils/infiniteHelpers":24,"./utils/scaleEnum":25,"./utils/types":26,"create-react-class":3,"lodash.isfinite":10,"prop-types":16,"react":undefined}],2:[function(require,module,exports){ (function (process){ diff --git a/dist/react-infinite.min.js b/dist/react-infinite.min.js index aa1fc01..68e04e4 100644 --- a/dist/react-infinite.min.js +++ b/dist/react-infinite.min.js @@ -1,2 +1,2 @@ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Infinite=e()}}(function(){return function e(t,n,o){function r(a,s){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[a]={exports:{}};t[a][0].call(u.exports,function(e){var n=t[a][1][e];return r(n?n:e)},u,u.exports,e,t,n,o)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}var r=n.React||e("react"),i=n.PropTypes||e("prop-types"),a=n.createReactClass||e("create-react-class");e("./utils/establish-polyfills");var s=e("./utils/scaleEnum"),l=e("./utils/infiniteHelpers"),c=e("lodash.isfinite"),u=e("./utils/types").preloadType,p=p=e("./utils/checkProps"),f=a({propTypes:{children:i.any,handleScroll:i.func,preloadBatchSize:u,preloadAdditionalHeight:u,elementHeight:i.oneOfType([i.number,i.arrayOf(i.number)]).isRequired,containerHeight:i.number,useWindowAsScrollContainer:i.bool,displayBottomUpwards:i.bool.isRequired,infiniteLoadBeginEdgeOffset:i.number,onInfiniteLoad:i.func,loadingSpinnerDelegate:i.node,isInfiniteLoading:i.bool,timeScrollStateLastsForAfterUserScrolls:i.number,className:i.string,styles:i.shape({scrollableStyle:i.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!c(e))throw new Error("The scale factor must be a number.");return{type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:r.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,n=e.preloadBatchSize,r=e.preloadAdditionalHeight,i=o(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),a={};t="number"==typeof t?t:0,a.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==i.infiniteLoadBeginBottomOffset&&(a.infiniteLoadBeginEdgeOffset=i.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var l={type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},c=n&&n.type?n:l;"number"==typeof n?a.preloadBatchSize=n:"object"==typeof c&&c.type===s.CONTAINER_HEIGHT_SCALE_FACTOR?a.preloadBatchSize=a.containerHeight*c.amount:a.preloadBatchSize=0;var u={type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},p=r&&r.type?r:u;return"number"==typeof r?a.preloadAdditionalHeight=r:"object"==typeof p&&p.type===s.CONTAINER_HEIGHT_SCALE_FACTOR?a.preloadAdditionalHeight=a.containerHeight*p.amount:a.preloadAdditionalHeight=0,Object.assign(i,a)},generateComputedUtilityFunctions:function(e){var t=this,n={};return n.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(n.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},n.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},n.nodeScrollListener=function(){},n.getScrollTop=function(){return window.pageYOffset},n.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},n.scrollShouldBeIgnored=function(){return!1},n.buildScrollableStyle=function(){return{}}):(n.subscribeToScrollListener=function(){},n.unsubscribeFromScrollListener=function(){},n.nodeScrollListener=this.infiniteHandleScroll,n.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},n.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},n.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},n.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),n},recomputeInternalStateFromProps:function(e){p(e);var t=this.generateComputedProps(e),n=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=r.Children.count(t.children),o.infiniteComputer=l.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,l.recomputeApertureStateFromOptionsAndScrollTop(o,n.getScrollTop())),{computedProps:t,utils:n,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var n=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=l.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var n={};this.state.isScrolling&&(n.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),i=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var a=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();a>0&&(o=a-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:r.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return r.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},r.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:n},r.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,r.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(i)})))}});t.exports=f,n.Infinite=f}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/checkProps":22,"./utils/establish-polyfills":23,"./utils/infiniteHelpers":24,"./utils/scaleEnum":25,"./utils/types":26,"create-react-class":3,"lodash.isfinite":10,"prop-types":16,react:void 0}],2:[function(e,t,n){(function(n){"use strict";function o(e){return e}function r(e,t,r){function p(e,t,o){for(var r in t)t.hasOwnProperty(r)&&("production"!==n.env.NODE_ENV?l("function"==typeof t[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",c[o],r):void 0)}function f(e,t){var n=O.hasOwnProperty(t)?O[t]:null;_.hasOwnProperty(t)&&s("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&s("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function d(e,o){if(o){s("function"!=typeof o,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),s(!t(o),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;o.hasOwnProperty(u)&&w.mixins(e,o.mixins);for(var a in o)if(o.hasOwnProperty(a)&&a!==u){var c=o[a],p=r.hasOwnProperty(a);if(f(p,a),w.hasOwnProperty(a))w[a](e,c);else{var d=O.hasOwnProperty(a),h="function"==typeof c,y=h&&!d&&!p&&o.autobind!==!1;if(y)i.push(a,c),r[a]=c;else if(p){var v=O[a];s(d&&("DEFINE_MANY_MERGED"===v||"DEFINE_MANY"===v),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",v,a),"DEFINE_MANY_MERGED"===v?r[a]=m(r[a],c):"DEFINE_MANY"===v&&(r[a]=g(r[a],c))}else r[a]=c,"production"!==n.env.NODE_ENV&&"function"==typeof c&&o.displayName&&(r[a].displayName=o.displayName+"_"+a)}}}else if("production"!==n.env.NODE_ENV){var b=typeof o,S="object"===b&&null!==o;"production"!==n.env.NODE_ENV?l(S,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===o?null:b):void 0}}function h(e,t){if(t)for(var n in t){var o=t[n];if(t.hasOwnProperty(n)){var r=n in w;s(!r,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var i=n in e;s(!i,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=o}}}function y(e,t){s(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in t)t.hasOwnProperty(n)&&(s(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function m(e,t){return function(){var n=e.apply(this,arguments),o=t.apply(this,arguments);if(null==n)return o;if(null==o)return n;var r={};return y(r,n),y(r,o),r}}function g(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function v(e,t){var o=t.bind(e);if("production"!==n.env.NODE_ENV){o.__reactBoundContext=e,o.__reactBoundMethod=t,o.__reactBoundArguments=null;var r=e.constructor.displayName,i=o.bind;o.bind=function(a){for(var s=arguments.length,c=Array(s>1?s-1:0),u=1;u1?t-1:0),o=1;o2?o-2:0),i=2;i-1&&e%1==0&&e<=v}function a(e){return s(e)&&y.call(e)==u}function s(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function l(e){return null!=e&&(a(e)?m.test(d.call(e)):o(e)&&p.test(e))}var c="[object Array]",u="[object Function]",p=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.hasOwnProperty,y=f.toString,m=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),g=r(Array,"isArray"),v=9007199254740991,b=g||function(e){return o(e)&&i(e.length)&&y.call(e)==c};t.exports=b},{}],10:[function(e,t,n){(function(e){function n(e){return"number"==typeof e&&o(e)}var o=e.isFinite;t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(e,t,n){"use strict";function o(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e,t){for(var n,a,s=o(e),l=1;l0?t-1:t}},{key:"getTopSpacerHeight",value:function(e){return e*this.heightData}},{key:"getBottomSpacerHeight",value:function(e){var t=e+1;return Math.max(0,(this.numberOfChildren-t)*this.heightData)}}]),t}(s);t.exports=l},{"./infiniteComputer.js":20}],20:[function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;nt&&(s=i-1)}return n===o.CLOSEST_LOWER&&l>0?r=l-1:n===o.CLOSEST_HIGHER&&s=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}var r=n.React||e("react"),i=n.PropTypes||e("prop-types"),a=n.createReactClass||e("create-react-class");e("./utils/establish-polyfills");var s=e("./utils/scaleEnum"),l=e("./utils/infiniteHelpers"),c=e("lodash.isfinite"),u=e("./utils/types").preloadType,p=p=e("./utils/checkProps"),f=a({propTypes:{children:i.any,handleScroll:i.func,preloadBatchSize:u,preloadAdditionalHeight:u,elementHeight:i.oneOfType([i.number,i.arrayOf(i.number)]).isRequired,containerHeight:i.number,useWindowAsScrollContainer:i.bool,displayBottomUpwards:i.bool.isRequired,infiniteLoadBeginEdgeOffset:i.number,onInfiniteLoad:i.func,loadingSpinnerDelegate:i.node,isInfiniteLoading:i.bool,timeScrollStateLastsForAfterUserScrolls:i.number,className:i.string,styles:i.shape({scrollableStyle:i.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!c(e))throw new Error("The scale factor must be a number.");return{type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:r.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,n=e.preloadBatchSize,r=e.preloadAdditionalHeight,i=o(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),a={};t="number"==typeof t?t:0,a.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==i.infiniteLoadBeginBottomOffset&&(a.infiniteLoadBeginEdgeOffset=i.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var l={type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},c=n&&n.type?n:l;"number"==typeof n?a.preloadBatchSize=n:"object"==typeof c&&c.type===s.CONTAINER_HEIGHT_SCALE_FACTOR?a.preloadBatchSize=a.containerHeight*c.amount:a.preloadBatchSize=0;var u={type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},p=r&&r.type?r:u;return"number"==typeof r?a.preloadAdditionalHeight=r:"object"==typeof p&&p.type===s.CONTAINER_HEIGHT_SCALE_FACTOR?a.preloadAdditionalHeight=a.containerHeight*p.amount:a.preloadAdditionalHeight=0,Object.assign(i,a)},generateComputedUtilityFunctions:function(e){var t=this,n={};return n.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(n.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},n.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},n.nodeScrollListener=function(){},n.getScrollTop=function(){return window.pageYOffset},n.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},n.scrollShouldBeIgnored=function(){return!1},n.buildScrollableStyle=function(){return{}}):(n.subscribeToScrollListener=function(){},n.unsubscribeFromScrollListener=function(){},n.nodeScrollListener=this.infiniteHandleScroll,n.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},n.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},n.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},n.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),n},recomputeInternalStateFromProps:function(e){p(e);var t=this.generateComputedProps(e),n=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=r.Children.count(t.children),o.infiniteComputer=l.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,l.recomputeApertureStateFromOptionsAndScrollTop(o,n.getScrollTop())),{computedProps:t,utils:n,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var n=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=l.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var n={};this.state.isScrolling&&(n.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),i=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var a=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();a>0&&(o=a-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:r.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return r.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},r.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:n},r.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,r.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(i)})))}});t.exports=f,n.Infinite=f}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/checkProps":22,"./utils/establish-polyfills":23,"./utils/infiniteHelpers":24,"./utils/scaleEnum":25,"./utils/types":26,"create-react-class":3,"lodash.isfinite":10,"prop-types":16,react:void 0}],2:[function(e,t,n){(function(n){"use strict";function o(e){return e}function r(e,t,r){function p(e,t,o){for(var r in t)t.hasOwnProperty(r)&&("production"!==n.env.NODE_ENV?l("function"==typeof t[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",c[o],r):void 0)}function f(e,t){var n=O.hasOwnProperty(t)?O[t]:null;_.hasOwnProperty(t)&&s("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&s("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function d(e,o){if(o){s("function"!=typeof o,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),s(!t(o),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;o.hasOwnProperty(u)&&w.mixins(e,o.mixins);for(var a in o)if(o.hasOwnProperty(a)&&a!==u){var c=o[a],p=r.hasOwnProperty(a);if(f(p,a),w.hasOwnProperty(a))w[a](e,c);else{var d=O.hasOwnProperty(a),h="function"==typeof c,y=h&&!d&&!p&&o.autobind!==!1;if(y)i.push(a,c),r[a]=c;else if(p){var v=O[a];s(d&&("DEFINE_MANY_MERGED"===v||"DEFINE_MANY"===v),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",v,a),"DEFINE_MANY_MERGED"===v?r[a]=m(r[a],c):"DEFINE_MANY"===v&&(r[a]=g(r[a],c))}else r[a]=c,"production"!==n.env.NODE_ENV&&"function"==typeof c&&o.displayName&&(r[a].displayName=o.displayName+"_"+a)}}}else if("production"!==n.env.NODE_ENV){var b=typeof o,S="object"===b&&null!==o;"production"!==n.env.NODE_ENV?l(S,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===o?null:b):void 0}}function h(e,t){if(t)for(var n in t){var o=t[n];if(t.hasOwnProperty(n)){var r=n in w;s(!r,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var i=n in e;s(!i,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=o}}}function y(e,t){s(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in t)t.hasOwnProperty(n)&&(s(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function m(e,t){return function(){var n=e.apply(this,arguments),o=t.apply(this,arguments);if(null==n)return o;if(null==o)return n;var r={};return y(r,n),y(r,o),r}}function g(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function v(e,t){var o=t.bind(e);if("production"!==n.env.NODE_ENV){o.__reactBoundContext=e,o.__reactBoundMethod=t,o.__reactBoundArguments=null;var r=e.constructor.displayName,i=o.bind;o.bind=function(a){for(var s=arguments.length,c=Array(s>1?s-1:0),u=1;u1?t-1:0),o=1;o2?o-2:0),i=2;i-1&&e%1==0&&e<=v}function a(e){return s(e)&&y.call(e)==u}function s(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function l(e){return null!=e&&(a(e)?m.test(d.call(e)):o(e)&&p.test(e))}var c="[object Array]",u="[object Function]",p=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.hasOwnProperty,y=f.toString,m=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),g=r(Array,"isArray"),v=9007199254740991,b=g||function(e){return o(e)&&i(e.length)&&y.call(e)==c};t.exports=b},{}],10:[function(e,t,n){(function(e){function n(e){return"number"==typeof e&&o(e)}var o=e.isFinite;t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(e,t,n){"use strict";function o(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e,t){for(var n,a,s=o(e),l=1;l0?t-1:t}},{key:"getTopSpacerHeight",value:function(e){return e*this.heightData}},{key:"getBottomSpacerHeight",value:function(e){var t=e+1;return Math.max(0,(this.numberOfChildren-t)*this.heightData)}}]),t}(s);t.exports=l},{"./infiniteComputer.js":20}],20:[function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;nt&&(s=i-1)}return n===o.CLOSEST_LOWER&&l>0?r=l-1:n===o.CLOSEST_HIGHER&&s