Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-virtual-list

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-virtual-list - npm Package Compare versions

Comparing version 2.2.4 to 2.3.0

2

demo/dist/app.js

@@ -1,1 +0,1 @@

webpackJsonp([2],{0:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var a=n(25),r=i(a),o=n(26),l=n(88),s=i(l);n(193);var u=function(e){var t=e.virtual,n=e.itemHeight;return r.default.createElement("ul",{className:"media-list list-group",style:t.style},t.items.map(function(e){return r.default.createElement("li",{key:"item"+e.id,className:"list-group-item",style:{height:n}},r.default.createElement("div",{className:"media-left"},r.default.createElement("img",{className:"media-object",src:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iNjQiIGhlaWdodD0iNjQiIHZpZXdCb3g9IjAgMCA2NCA2NCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+PGRlZnMvPjxyZWN0IHdpZHRoPSI2NCIgaGVpZ2h0PSI2NCIgZmlsbD0iI0VFRUVFRSIvPjxnPjx0ZXh0IHg9IjEzLjQ2ODc1IiB5PSIzMiIgc3R5bGU9ImZpbGw6I0FBQUFBQTtmb250LXdlaWdodDpib2xkO2ZvbnQtZmFtaWx5OkFyaWFsLCBIZWx2ZXRpY2EsIE9wZW4gU2Fucywgc2Fucy1zZXJpZiwgbW9ub3NwYWNlO2ZvbnQtc2l6ZToxMHB0O2RvbWluYW50LWJhc2VsaW5lOmNlbnRyYWwiPjY0eDY0PC90ZXh0PjwvZz48L3N2Zz4="})),r.default.createElement("div",{className:"media-body"},r.default.createElement("h4",{className:"media-heading"},e.title),r.default.createElement("p",null,e.text)))}))},c=(0,s.default)(u);(0,o.render)(r.default.createElement(c,null),document.getElementById("app"))},88:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=n(25),u=i(s),c=n(187),f=i(c),m=function(e){return{id:e,title:"Media heading #"+(e+1),text:"Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis."}},d=function(e){var t,n,i,c=(0,f.default)()(e);return n=t=function(e){function t(){a(this,t);var e=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));i.call(e);for(var n=1e5,o=[],l=0;l<n;l++)o[l]=m(l);var s={itemHeight:100,itemCount:n,items:o,contained:!1,containerHeight:250,itemBuffer:0};return e.state=s,e}return o(t,e),l(t,[{key:"render",value:function(){return u.default.createElement("div",null,u.default.createElement("div",{role:"form",className:"form-horizontal"},u.default.createElement("div",{className:"form-group"},u.default.createElement("label",{className:"col-xs-6 col-sm-2",htmlFor:"contained"},"Contained"),u.default.createElement("div",{className:"col-xs-6 col-sm-4"},u.default.createElement("input",{onChange:this.update,className:"form-control",type:"checkbox",checked:this.state.contained,id:"contained",ref:"contained"})),u.default.createElement("label",{className:"col-xs-6 col-sm-2",htmlFor:"containerHeight"},"Container Height"),u.default.createElement("div",{className:"col-xs-6 col-sm-4"},u.default.createElement("input",{onChange:this.update,className:"form-control",type:"number",min:"0",max:"10000",value:this.state.containerHeight,id:"containerHeight",ref:"containerHeight"}))),u.default.createElement("div",{className:"form-group"},u.default.createElement("label",{className:"col-xs-6 col-sm-2",htmlFor:"itemHeight"},"Item Height"),u.default.createElement("div",{className:"col-xs-6 col-sm-4"},u.default.createElement("input",{onChange:this.update,className:"form-control",type:"number",min:"0",value:this.state.itemHeight,id:"itemHeight",ref:"itemHeight"})),u.default.createElement("label",{className:"col-xs-6 col-sm-2",htmlFor:"itemCount"},"Item Count"),u.default.createElement("div",{className:"col-xs-6 col-sm-4"},u.default.createElement("input",{onChange:this.update,className:"form-control",type:"number",min:"0",value:this.state.itemCount,id:"itemCount",ref:"itemCount"}))),u.default.createElement("div",{className:"form-group"},u.default.createElement("label",{className:"col-xs-6 col-sm-2",htmlFor:"scrollDelay"},"Item Buffer"),u.default.createElement("div",{className:"col-xs-6 col-sm-4"},u.default.createElement("input",{onChange:this.update,className:"form-control",type:"number",min:"0",value:this.state.itemBuffer,id:"itemBuffer",ref:"itemBuffer"})))),u.default.createElement("div",{className:"row"},u.default.createElement("div",{className:"col-xs-12",id:"container",ref:"container",style:this.state.contained?{overflow:"scroll",height:this.state.containerHeight}:{}},u.default.createElement(c,{items:this.state.items,itemBuffer:this.state.itemBuffer,itemHeight:this.state.itemHeight}))))}}]),t}(s.PureComponent),i=function(){var t=this;this.update=function(){for(var n=[],i=parseInt(t.refs.itemCount.value,10),a=0;a<i;a++)n[a]=m(a);var r=t.refs.contained.checked,o={itemHeight:parseInt(t.refs.itemHeight.value,10),itemCount:i,items:n,contained:r,container:t.refs.container,containerHeight:parseInt(t.refs.containerHeight.value,10),itemBuffer:parseInt(t.refs.itemBuffer.value,10)};if(o.contained!==t.state.contained){var l={container:o.contained?o.container:window};c=(0,f.default)(l)(e)}t.setState(o)}},n};t.default=d},187:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),u=n(25),c=i(u),f=n(26),m=i(f),d=n(55),h=i(d),p=n(190),v=i(p),b=n(191),g=i(b),y=n(188),I=i(y),E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I.default;return function(n){var i,f;return f=i=function(i){function u(t){a(this,u);var n=r(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,t));return n.options=l({container:"undefined"!=typeof window?window:void 0},e),n.state={firstItemIndex:0,lastItemIndex:-1},e&&e.initialState&&(n.state=l({},n.state,e.initialState)),n.refreshState=n.refreshState.bind(n),"undefined"!=typeof window&&"requestAnimationFrame"in window&&(n.refreshState=(0,g.default)(n.refreshState)),n}return o(u,i),s(u,[{key:"setStateIfNeeded",value:function(e,t,n,i,a){var r=(0,v.default)(e,t,n,i,a);r.firstItemIndex>r.lastItemIndex||void 0===r||r.firstItemIndex===this.state.firstItemIndex&&r.lastItemIndex===this.state.lastItemIndex||this.setState(r)}},{key:"refreshState",value:function(){var e=this.props,t=e.itemHeight,n=e.items,i=e.itemBuffer;this.setStateIfNeeded(this.domNode,this.options.container,n,t,i)}},{key:"componentDidMount",value:function(){this.domNode=m.default.findDOMNode(this),this.refreshState(),this.options.container.addEventListener("scroll",this.refreshState),this.options.container.addEventListener("resize",this.refreshState)}},{key:"componentWillUnmount",value:function(){this.options.container.removeEventListener("scroll",this.refreshState),this.options.container.removeEventListener("resize",this.refreshState)}},{key:"componentWillReceiveProps",value:function(e){var t=e.itemHeight,n=e.items,i=e.itemBuffer;this.setStateIfNeeded(this.domNode,this.options.container,n,t,i)}},{key:"render",value:function(){return c.default.createElement(n,l({},this.props,t(this.props,this.state)))}}]),u}(u.PureComponent),i.propTypes={items:h.default.array.isRequired,itemHeight:h.default.number.isRequired,itemBuffer:h.default.number},i.defaultProps={itemBuffer:0},f}};t.default=E},188:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){var n=e.items,i=e.itemHeight,a=t.firstItemIndex,r=t.lastItemIndex,o=r>-1?n.slice(a,r+1):[],l=n.length*i,s=a*i;return{virtual:{items:o,style:{height:l,paddingTop:s,boxSizing:"border-box"}}}};t.default=n},189:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e.pageYOffset?e.pageYOffset:e.document?e.document.documentElement&&e.document.documentElement.scrollTop?e.document.documentElement.scrollTop:e.document.body&&e.document.body.scrollTop?e.document.body.scrollTop:0:e.scrollY||e.scrollTop||0};t.default=n},190:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(192),r=i(a),o=n(189),l=i(o),s=function(e,t,n,i,a){if(console.log("getVisibleItemBounds",e,t,n,i,a),t&&i&&n&&0!==n.length){var o=t.innerHeight,s=t.clientHeight,u=o||s;if(u){var c=(0,l.default)(t),f=c+u,m=(0,r.default)(e)-(0,r.default)(t),d=i*n.length,h=Math.max(0,c-m),p=Math.max(0,Math.min(d,f-m)),v=Math.max(0,Math.floor(h/i)-a),b=Math.min(n.length,Math.ceil(p/i)+a)-1;return console.log(v,b),{firstItemIndex:v,lastItemIndex:b}}}};t.default=s},191:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=arguments;t.default=function(e){var t=!1;return function(){t||(t=!0,window.requestAnimationFrame(function(){e.apply(void 0,n),t=!1}))}}},192:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function e(t){return"undefined"!=typeof t&&t?(t.offsetTop||0)+e(t.offsetParent):0};t.default=n},193:function(e,t,n){e.exports=n.p+"index.html"}});
webpackJsonp([2],[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var a=n(1),r=i(a),o=n(2),l=n(7),s=i(l);n(31);var u=function(e){var t=e.virtual,n=e.itemHeight;return r.default.createElement("ul",{className:"media-list list-group",style:t.style},t.items.map(function(e){return r.default.createElement("li",{key:"item"+e.id,className:"list-group-item",style:{height:n}},r.default.createElement("div",{className:"media-left"},r.default.createElement("img",{className:"media-object",src:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iNjQiIGhlaWdodD0iNjQiIHZpZXdCb3g9IjAgMCA2NCA2NCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+PGRlZnMvPjxyZWN0IHdpZHRoPSI2NCIgaGVpZ2h0PSI2NCIgZmlsbD0iI0VFRUVFRSIvPjxnPjx0ZXh0IHg9IjEzLjQ2ODc1IiB5PSIzMiIgc3R5bGU9ImZpbGw6I0FBQUFBQTtmb250LXdlaWdodDpib2xkO2ZvbnQtZmFtaWx5OkFyaWFsLCBIZWx2ZXRpY2EsIE9wZW4gU2Fucywgc2Fucy1zZXJpZiwgbW9ub3NwYWNlO2ZvbnQtc2l6ZToxMHB0O2RvbWluYW50LWJhc2VsaW5lOmNlbnRyYWwiPjY0eDY0PC90ZXh0PjwvZz48L3N2Zz4="})),r.default.createElement("div",{className:"media-body"},r.default.createElement("h4",{className:"media-heading"},e.title),r.default.createElement("p",null,e.text)))}))},c=(0,s.default)(u);(0,o.render)(r.default.createElement(c,null),document.getElementById("app"))},,,,,,,function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=n(1),u=i(s),c=n(25),f=i(c),m=function(e){return{id:e,title:"Media heading #"+(e+1),text:"Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis."}},d=function(e){var t,n,i,c=(0,f.default)()(e);return n=t=function(e){function t(){a(this,t);var e=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));i.call(e);for(var n=1e5,o=[],l=0;l<n;l++)o[l]=m(l);var s={itemHeight:100,itemCount:n,items:o,contained:!1,containerHeight:250,itemBuffer:0};return e.state=s,e}return o(t,e),l(t,[{key:"render",value:function(){return u.default.createElement("div",null,u.default.createElement("div",{role:"form",className:"form-horizontal"},u.default.createElement("div",{className:"form-group"},u.default.createElement("label",{className:"col-xs-6 col-sm-2",htmlFor:"contained"},"Contained"),u.default.createElement("div",{className:"col-xs-6 col-sm-4"},u.default.createElement("input",{onChange:this.update,className:"form-control",type:"checkbox",checked:this.state.contained,id:"contained",ref:"contained"})),u.default.createElement("label",{className:"col-xs-6 col-sm-2",htmlFor:"containerHeight"},"Container Height"),u.default.createElement("div",{className:"col-xs-6 col-sm-4"},u.default.createElement("input",{onChange:this.update,className:"form-control",type:"number",min:"0",max:"10000",value:this.state.containerHeight,id:"containerHeight",ref:"containerHeight"}))),u.default.createElement("div",{className:"form-group"},u.default.createElement("label",{className:"col-xs-6 col-sm-2",htmlFor:"itemHeight"},"Item Height"),u.default.createElement("div",{className:"col-xs-6 col-sm-4"},u.default.createElement("input",{onChange:this.update,className:"form-control",type:"number",min:"0",value:this.state.itemHeight,id:"itemHeight",ref:"itemHeight"})),u.default.createElement("label",{className:"col-xs-6 col-sm-2",htmlFor:"itemCount"},"Item Count"),u.default.createElement("div",{className:"col-xs-6 col-sm-4"},u.default.createElement("input",{onChange:this.update,className:"form-control",type:"number",min:"0",value:this.state.itemCount,id:"itemCount",ref:"itemCount"}))),u.default.createElement("div",{className:"form-group"},u.default.createElement("label",{className:"col-xs-6 col-sm-2",htmlFor:"scrollDelay"},"Item Buffer"),u.default.createElement("div",{className:"col-xs-6 col-sm-4"},u.default.createElement("input",{onChange:this.update,className:"form-control",type:"number",min:"0",value:this.state.itemBuffer,id:"itemBuffer",ref:"itemBuffer"})))),u.default.createElement("div",{className:"row"},u.default.createElement("div",{className:"col-xs-12",id:"container",ref:"container",style:this.state.contained?{overflow:"scroll",height:this.state.containerHeight}:{}},u.default.createElement(c,{items:this.state.items,itemBuffer:this.state.itemBuffer,itemHeight:this.state.itemHeight}))))}}]),t}(s.PureComponent),i=function(){var t=this;this.update=function(){for(var n=[],i=parseInt(t.refs.itemCount.value,10),a=0;a<i;a++)n[a]=m(a);var r=t.refs.contained.checked,o={itemHeight:parseInt(t.refs.itemHeight.value,10),itemCount:i,items:n,contained:r,container:t.refs.container,containerHeight:parseInt(t.refs.containerHeight.value,10),itemBuffer:parseInt(t.refs.itemBuffer.value,10)};if(o.contained!==t.state.contained){var l={container:o.contained?o.container:window};c=(0,f.default)(l)(e)}t.setState(o)}},n};t.default=d},,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),u=n(1),c=i(u),f=n(2),m=i(f),d=n(6),h=i(d),p=n(28),v=i(p),b=n(29),g=i(b),y=n(26),I=i(y),E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I.default;return function(n){var i,f;return f=i=function(i){function u(t){a(this,u);var n=r(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,t));return n._isMounted=!1,n.options=l({container:"undefined"!=typeof window?window:void 0},e),n.state={firstItemIndex:0,lastItemIndex:-1},e&&e.initialState&&(n.state=l({},n.state,e.initialState)),n.refreshState=n.refreshState.bind(n),"undefined"!=typeof window&&"requestAnimationFrame"in window&&(n.refreshState=(0,g.default)(n.refreshState)),n}return o(u,i),s(u,[{key:"setStateIfNeeded",value:function(e,t,n,i,a){var r=(0,v.default)(e,t,n,i,a);void 0!==r&&(r.firstItemIndex>r.lastItemIndex||r.firstItemIndex===this.state.firstItemIndex&&r.lastItemIndex===this.state.lastItemIndex||this.setState(r))}},{key:"refreshState",value:function(){if(this._isMounted){var e=this.props,t=e.itemHeight,n=e.items,i=e.itemBuffer;this.setStateIfNeeded(this.domNode,this.options.container,n,t,i)}}},{key:"componentWillMount",value:function(){this._isMounted=!0}},{key:"componentDidMount",value:function(){this.domNode=m.default.findDOMNode(this),this.refreshState(),this.options.container.addEventListener("scroll",this.refreshState),this.options.container.addEventListener("resize",this.refreshState)}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.options.container.removeEventListener("scroll",this.refreshState),this.options.container.removeEventListener("resize",this.refreshState)}},{key:"componentWillReceiveProps",value:function(e){var t=e.itemHeight,n=e.items,i=e.itemBuffer;this.setStateIfNeeded(this.domNode,this.options.container,n,t,i)}},{key:"render",value:function(){return c.default.createElement(n,l({},this.props,t(this.props,this.state)))}}]),u}(u.PureComponent),i.propTypes={items:h.default.array.isRequired,itemHeight:h.default.number.isRequired,itemBuffer:h.default.number},i.defaultProps={itemBuffer:0},f}};t.default=E},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){var n=e.items,i=e.itemHeight,a=t.firstItemIndex,r=t.lastItemIndex,o=r>-1?n.slice(a,r+1):[],l=n.length*i,s=a*i;return{virtual:{items:o,style:{height:l,paddingTop:s,boxSizing:"border-box"}}}};t.default=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e.pageYOffset?e.pageYOffset:e.document?e.document.documentElement&&e.document.documentElement.scrollTop?e.document.documentElement.scrollTop:e.document.body&&e.document.body.scrollTop?e.document.body.scrollTop:0:e.scrollY||e.scrollTop||0};t.default=n},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(30),r=i(a),o=n(27),l=i(o),s=function(e,t,n,i,a){if(t&&i&&n&&0!==n.length){var o=t.innerHeight,s=t.clientHeight,u=o||s;if(u){var c=(0,l.default)(t),f=c+u,m=(0,r.default)(e)-(0,r.default)(t),d=i*n.length,h=Math.max(0,c-m),p=Math.max(0,Math.min(d,f-m)),v=Math.max(0,Math.floor(h/i)-a),b=Math.min(n.length,Math.ceil(p/i)+a)-1;return{firstItemIndex:v,lastItemIndex:b}}}};t.default=s},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=arguments;t.default=function(e){var t=!1;return function(){t||(t=!0,window.requestAnimationFrame(function(){e.apply(void 0,n),t=!1}))}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function e(t){return"undefined"!=typeof t&&t?(t.offsetTop||0)+e(t.offsetParent):0};t.default=n},function(e,t,n){e.exports=n.p+"index.html"}]);

@@ -1,1 +0,1 @@

webpackJsonp([1],{0:function(e,t,n){e.exports=n(89)},55:function(e,t,n){"use strict";"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=n(97)()},89:function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==("undefined"==typeof t?"undefined":s(t))&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof t?"undefined":s(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},f=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),c=n(25),l=o(c),d=n(26),p=o(d),m=n(55),y=o(m),h=n(92),b=o(h),v=n(93),S=o(v),I=n(90),g=o(I),O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.default;return function(n){var o,s;return s=o=function(o){function s(t){r(this,s);var n=i(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,t));return n.options=a({container:"undefined"!=typeof window?window:void 0},e),n.state={firstItemIndex:0,lastItemIndex:-1},e&&e.initialState&&(n.state=a({},n.state,e.initialState)),n.refreshState=n.refreshState.bind(n),"undefined"!=typeof window&&"requestAnimationFrame"in window&&(n.refreshState=(0,S.default)(n.refreshState)),n}return u(s,o),f(s,[{key:"setStateIfNeeded",value:function(e,t,n,o,r){var i=(0,b.default)(e,t,n,o,r);i.firstItemIndex>i.lastItemIndex||void 0===i||i.firstItemIndex===this.state.firstItemIndex&&i.lastItemIndex===this.state.lastItemIndex||this.setState(i)}},{key:"refreshState",value:function(){var e=this.props,t=e.itemHeight,n=e.items,o=e.itemBuffer;this.setStateIfNeeded(this.domNode,this.options.container,n,t,o)}},{key:"componentDidMount",value:function(){this.domNode=p.default.findDOMNode(this),this.refreshState(),this.options.container.addEventListener("scroll",this.refreshState),this.options.container.addEventListener("resize",this.refreshState)}},{key:"componentWillUnmount",value:function(){this.options.container.removeEventListener("scroll",this.refreshState),this.options.container.removeEventListener("resize",this.refreshState)}},{key:"componentWillReceiveProps",value:function(e){var t=e.itemHeight,n=e.items,o=e.itemBuffer;this.setStateIfNeeded(this.domNode,this.options.container,n,t,o)}},{key:"render",value:function(){return l.default.createElement(n,a({},this.props,t(this.props,this.state)))}}]),s}(c.PureComponent),o.propTypes={items:y.default.array.isRequired,itemHeight:y.default.number.isRequired,itemBuffer:y.default.number},o.defaultProps={itemBuffer:0},s}};t.default=O},90:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){var n=e.items,o=e.itemHeight,r=t.firstItemIndex,i=t.lastItemIndex,u=i>-1?n.slice(r,i+1):[],s=n.length*o,a=r*o;return{virtual:{items:u,style:{height:s,paddingTop:a,boxSizing:"border-box"}}}};t.default=n},91:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e.pageYOffset?e.pageYOffset:e.document?e.document.documentElement&&e.document.documentElement.scrollTop?e.document.documentElement.scrollTop:e.document.body&&e.document.body.scrollTop?e.document.body.scrollTop:0:e.scrollY||e.scrollTop||0};t.default=n},92:function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(94),i=o(r),u=n(91),s=o(u),a=function(e,t,n,o,r){if(t&&o&&n&&0!==n.length){var u=t.innerHeight,a=t.clientHeight,f=u||a;if(f){var c=(0,s.default)(t),l=c+f,d=(0,i.default)(e)-(0,i.default)(t),p=o*n.length,m=Math.max(0,c-d),y=Math.max(0,Math.min(p,l-d)),h=Math.max(0,Math.floor(m/o)-r),b=Math.min(n.length,Math.ceil(y/o)+r)-1;return{firstItemIndex:h,lastItemIndex:b}}}};t.default=a},93:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=arguments;t.default=function(e){var t=!1;return function(){t||(t=!0,window.requestAnimationFrame(function(){e.apply(void 0,n),t=!1}))}}},94:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function e(t){return"undefined"!=typeof t&&t?(t.offsetTop||0)+e(t.offsetParent):0};t.default=n},97:function(e,t,n){"use strict";var o=n(34),r=n(57),i=n(56);e.exports=function(){function e(e,t,n,o,u,s){s!==i&&r(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=o,n.PropTypes=n,n}}});
webpackJsonp([1],[function(e,t,n){e.exports=n(8)},,,,,,function(e,t,n){"use strict";"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=n(21)()},,function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==("undefined"==typeof t?"undefined":u(t))&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof t?"undefined":u(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},f=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),c=n(1),l=o(c),d=n(2),p=o(d),m=n(6),h=o(m),y=n(11),v=o(y),b=n(12),_=o(b),S=n(9),I=o(S),O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I.default;return function(n){var o,u;return u=o=function(o){function u(t){r(this,u);var n=i(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,t));return n._isMounted=!1,n.options=a({container:"undefined"!=typeof window?window:void 0},e),n.state={firstItemIndex:0,lastItemIndex:-1},e&&e.initialState&&(n.state=a({},n.state,e.initialState)),n.refreshState=n.refreshState.bind(n),"undefined"!=typeof window&&"requestAnimationFrame"in window&&(n.refreshState=(0,_.default)(n.refreshState)),n}return s(u,o),f(u,[{key:"setStateIfNeeded",value:function(e,t,n,o,r){var i=(0,v.default)(e,t,n,o,r);void 0!==i&&(i.firstItemIndex>i.lastItemIndex||i.firstItemIndex===this.state.firstItemIndex&&i.lastItemIndex===this.state.lastItemIndex||this.setState(i))}},{key:"refreshState",value:function(){if(this._isMounted){var e=this.props,t=e.itemHeight,n=e.items,o=e.itemBuffer;this.setStateIfNeeded(this.domNode,this.options.container,n,t,o)}}},{key:"componentWillMount",value:function(){this._isMounted=!0}},{key:"componentDidMount",value:function(){this.domNode=p.default.findDOMNode(this),this.refreshState(),this.options.container.addEventListener("scroll",this.refreshState),this.options.container.addEventListener("resize",this.refreshState)}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.options.container.removeEventListener("scroll",this.refreshState),this.options.container.removeEventListener("resize",this.refreshState)}},{key:"componentWillReceiveProps",value:function(e){var t=e.itemHeight,n=e.items,o=e.itemBuffer;this.setStateIfNeeded(this.domNode,this.options.container,n,t,o)}},{key:"render",value:function(){return l.default.createElement(n,a({},this.props,t(this.props,this.state)))}}]),u}(c.PureComponent),o.propTypes={items:h.default.array.isRequired,itemHeight:h.default.number.isRequired,itemBuffer:h.default.number},o.defaultProps={itemBuffer:0},u}};t.default=O},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){var n=e.items,o=e.itemHeight,r=t.firstItemIndex,i=t.lastItemIndex,s=i>-1?n.slice(r,i+1):[],u=n.length*o,a=r*o;return{virtual:{items:s,style:{height:u,paddingTop:a,boxSizing:"border-box"}}}};t.default=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e.pageYOffset?e.pageYOffset:e.document?e.document.documentElement&&e.document.documentElement.scrollTop?e.document.documentElement.scrollTop:e.document.body&&e.document.body.scrollTop?e.document.body.scrollTop:0:e.scrollY||e.scrollTop||0};t.default=n},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(13),i=o(r),s=n(10),u=o(s),a=function(e,t,n,o,r){if(t&&o&&n&&0!==n.length){var s=t.innerHeight,a=t.clientHeight,f=s||a;if(f){var c=(0,u.default)(t),l=c+f,d=(0,i.default)(e)-(0,i.default)(t),p=o*n.length,m=Math.max(0,c-d),h=Math.max(0,Math.min(p,l-d)),y=Math.max(0,Math.floor(m/o)-r),v=Math.min(n.length,Math.ceil(h/o)+r)-1;return{firstItemIndex:y,lastItemIndex:v}}}};t.default=a},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=arguments;t.default=function(e){var t=!1;return function(){t||(t=!0,window.requestAnimationFrame(function(){e.apply(void 0,n),t=!1}))}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function e(t){return"undefined"!=typeof t&&t?(t.offsetTop||0)+e(t.offsetParent):0};t.default=n},,,,function(e,t,n){"use strict";function o(e,t,n,o,i,s,u,a){if(r(t),!e){var f;if(void 0===t)f=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,o,i,s,u,a],l=0;f=new Error(t.replace(/%s/g,function(){return c[l++]})),f.name="Invariant Violation"}throw f.framesToPop=1,f}}var r=function(e){};e.exports=o},,,,function(e,t,n){"use strict";var o=n(3),r=n(17),i=n(22);e.exports=function(){function e(e,t,n,o,s,u){u!==i&&r(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=o,n.PropTypes=n,n}},function(e,t){"use strict";var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=n}]);
{
"name": "react-virtual-list",
"version": "2.2.4",
"version": "2.3.0",
"description": "Super simple virtualized list React higher-order component",

@@ -48,11 +48,11 @@ "main": "lib/VirtualList.js",

"jest": "^17.0.3",
"react": "^15.0.0",
"react-dom": "^15.5.4",
"react-test-renderer": "^15.5.4",
"react": "^16.3.1",
"react-dom": "^16.3.1",
"react-test-renderer": "^16.3.1",
"webpack": "^1.13.3"
},
"peerDependencies": {
"react": "^15.0.0",
"react-dom": "^15.0.0"
"react": "^15.0.0 || ^16.0.0",
"react-dom": "^15.0.0 || ^16.0.0"
}
}

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc