Socket
Socket
Sign inDemoInstall

react-infinite-tree

Package Overview
Dependencies
17
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0-alpha to 1.0.0-alpha.1

6

dist/react-infinite-tree.min.js

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

/*! react-infinite-tree v1.0.0-alpha | (c) 2017 Cheton Wu <cheton@gmail.com> | MIT | https://github.com/cheton/react-infinite-tree */
exports.InfiniteTree=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=8)}([function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(f===setTimeout)return setTimeout(e,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(e,0);try{return f(e,0)}catch(t){try{return f.call(null,e,0)}catch(t){return f.call(this,e,0)}}}function i(e){if(c===clearTimeout)return clearTimeout(e);if((c===r||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(e);try{return c(e)}catch(t){try{return c.call(null,e)}catch(t){return c.call(this,e)}}}function s(){y&&p&&(y=!1,p.length?h=p.concat(h):v=-1,h.length&&a())}function a(){if(!y){var e=o(s);y=!0;for(var t=h.length;t;){for(p=h,h=[];++v<t;)p&&p[v].run();v=-1,t=h.length}p=null,y=!1,i(e)}}function u(e,t){this.fun=e,this.array=t}function l(){}var f,c,d=e.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:n}catch(e){f=n}try{c="function"==typeof clearTimeout?clearTimeout:r}catch(e){c=r}}();var p,h=[],y=!1,v=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];h.push(new u(e,t)),1!==h.length||y||o(a)},u.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=l,d.addListener=l,d.once=l,d.off=l,d.removeListener=l,d.removeAllListeners=l,d.emit=l,d.prependListener=l,d.prependOnceListener=l,d.listeners=function(e){return[]},d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";(function(t){function n(e,t,n,o,i,s,a,u){if(r(t),!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var f=[n,o,i,s,a,u],c=0;l=new Error(t.replace(/%s/g,function(){return f[c++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}}var r=function(e){};"production"!==t.env.NODE_ENV&&(r=function(e){if(void 0===e)throw new Error("invariant requires an error message argument")}),e.exports=n}).call(t,n(0))},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";(function(t){var r=n(1),o=r;if("production"!==t.env.NODE_ENV){var i=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=0,i="Warning: "+e.replace(/%s/g,function(){return n[o++]});"undefined"!=typeof console&&console.error(i);try{throw new Error(i)}catch(e){}};o=function(e,t){if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==t.indexOf("Failed Composite propType: ")&&!e){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];i.apply(void 0,[t].concat(r))}}}e.exports=o}).call(t,n(0))},function(e,t,n){(function(t){if("production"!==t.env.NODE_ENV){var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,o=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r};e.exports=n(12)(o,!0)}else e.exports=n(11)()}).call(t,n(0))},function(e,t){e.exports=require("react")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 a(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 u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),f=n(5),c=r(f),d=n(6),p=r(d),h=n(14),y=r(h),v=n(13),m=r(v),g=function(e){return e+="",e.charAt(0).toLowerCase()+e.substr(1)},b=function(e){function t(){var e,n,r,o;i(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=s(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.tree=null,r.state={nodes:[]},r.eventHandlers={onContentWillUpdate:null,onContentDidUpdate:null,onOpenNode:null,onCloseNode:null,onSelectNode:null,onWillOpenNode:null,onWillCloseNode:null,onWillSelectNode:null},o=n,s(r,o)}return a(t,e),l(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,n=(t.children,t.className,t.style,o(t,["children","className","style"]));void 0!==n.el&&delete n.el,n.rowRenderer=function(){return""},this.tree=new y.default(n),this.tree.scrollToNode=function(t){if(!e.tree||!e.virtualList)return!1;var n=e.tree.nodes.indexOf(t);if(n<0)return!1;var r=e.virtualList.getOffsetForIndex(n);return e.virtualList.scrollTo(r),!0},this.tree.scrollTop=function(t){if(e.tree&&e.virtualList)return void 0!==t&&e.virtualList.scrollTo(Number(t)),e.virtualList.getNodeOffset()},this.tree.update=function(){e.tree.emit("contentWillUpdate"),e.setState(function(t){return{nodes:e.tree.nodes}},function(){e.tree.emit("contentDidUpdate")})},Object.keys(this.eventHandlers).forEach(function(t){if(e.props[t]){var n=g(t.substr(2));e.eventHandlers[t]=e.props[t],e.tree.on(n,e.eventHandlers[t])}})}},{key:"componentWillUnmount",value:function(){var e=this;Object.keys(this.eventHandlers).forEach(function(t){if(e.eventHandlers[t]){var n=g(t.substr(2));e.tree.removeListener(n,e.eventHandlers[t]),e.eventHandlers[t]=null}}),this.tree.destroy(),this.tree=null}},{key:"render",value:function(){var e=this,t=this.props,n=(t.autoOpen,t.selectable,t.tabIndex),r=(t.data,t.width),i=t.height,s=t.rowHeight,a=t.rowRenderer,l=(t.loadNodes,t.shouldSelectNode,t.scrollOffset),f=t.scrollToIndex,c=t.onScroll,d=(t.onContentWillUpdate,t.onContentDidUpdate,t.onOpenNode,t.onCloseNode,t.onSelectNode,t.onWillOpenNode,t.onWillCloseNode,t.onWillSelectNode,t.style),h=o(t,["autoOpen","selectable","tabIndex","data","width","height","rowHeight","rowRenderer","loadNodes","shouldSelectNode","scrollOffset","scrollToIndex","onScroll","onContentWillUpdate","onContentDidUpdate","onOpenNode","onCloseNode","onSelectNode","onWillOpenNode","onWillCloseNode","onWillSelectNode","style"]),y="function"==typeof children?children:a,v=this.tree?this.tree.nodes.length:0,g={};return void 0!==l&&v>0&&(g.scrollOffset=l),void 0!==f&&f>=0&&f<v&&(g.scrollToIndex=f),"function"!=typeof c&&(g.onScroll=c),p.default.createElement("div",u({},h,{style:u({outline:"none"},d),tabIndex:n}),p.default.createElement(m.default,u({ref:function(t){e.virtualList=t},width:r,height:i,itemCount:v,itemSize:s,renderItem:function(t){var n=t.index,r=t.style,o=null;return"function"==typeof y&&e.tree&&e.tree.nodes.length>0&&(o=y({tree:e.tree,node:e.tree.nodes[n]})),p.default.createElement("div",{key:n,style:r},o)}},g)))}}]),t}(d.Component);b.displayName="InfiniteTree",b.propTypes={autoOpen:c.default.bool,selectable:c.default.bool,tabIndex:c.default.number,data:c.default.oneOfType([c.default.array,c.default.object]),width:c.default.oneOfType([c.default.string,c.default.number]).isRequired,height:c.default.oneOfType([c.default.string,c.default.number]).isRequired,rowHeight:c.default.oneOfType([c.default.number,c.default.array,c.default.func]).isRequired,rowRenderer:c.default.func,loadNodes:c.default.func,shouldSelectNode:c.default.func,scrollOffset:c.default.number,scrollToIndex:c.default.number,onScroll:c.default.func,onContentWillUpdate:c.default.func,onContentDidUpdate:c.default.func,onOpenNode:c.default.func,onCloseNode:c.default.func,onSelectNode:c.default.func,onWillOpenNode:c.default.func,onWillCloseNode:c.default.func,onWillSelectNode:c.default.func},b.defaultProps={autoOpen:!1,selectable:!0,tabIndex:0,data:[],width:"100%"},t.default=b},function(e,t,n){"use strict";var r=n(7),o=function(e){return e&&e.__esModule?e:{default:e}}(r);e.exports=o.default},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}/*
/*! react-infinite-tree v1.0.0-alpha.1 | (c) 2017 Cheton Wu <cheton@gmail.com> | MIT | https://github.com/cheton/react-infinite-tree */
exports.InfiniteTree=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=7)}([function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(f===setTimeout)return setTimeout(e,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(e,0);try{return f(e,0)}catch(t){try{return f.call(null,e,0)}catch(t){return f.call(this,e,0)}}}function i(e){if(c===clearTimeout)return clearTimeout(e);if((c===r||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(e);try{return c(e)}catch(t){try{return c.call(null,e)}catch(t){return c.call(this,e)}}}function s(){y&&p&&(y=!1,p.length?h=p.concat(h):v=-1,h.length&&a())}function a(){if(!y){var e=o(s);y=!0;for(var t=h.length;t;){for(p=h,h=[];++v<t;)p&&p[v].run();v=-1,t=h.length}p=null,y=!1,i(e)}}function u(e,t){this.fun=e,this.array=t}function l(){}var f,c,d=e.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:n}catch(e){f=n}try{c="function"==typeof clearTimeout?clearTimeout:r}catch(e){c=r}}();var p,h=[],y=!1,v=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];h.push(new u(e,t)),1!==h.length||y||o(a)},u.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=l,d.addListener=l,d.once=l,d.off=l,d.removeListener=l,d.removeAllListeners=l,d.emit=l,d.prependListener=l,d.prependOnceListener=l,d.listeners=function(e){return[]},d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";(function(t){function n(e,t,n,o,i,s,a,u){if(r(t),!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var f=[n,o,i,s,a,u],c=0;l=new Error(t.replace(/%s/g,function(){return f[c++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}}var r=function(e){};"production"!==t.env.NODE_ENV&&(r=function(e){if(void 0===e)throw new Error("invariant requires an error message argument")}),e.exports=n}).call(t,n(0))},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){(function(t){if("production"!==t.env.NODE_ENV){var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,o=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r};e.exports=n(9)(o,!0)}else e.exports=n(12)()}).call(t,n(0))},function(e,t,n){"use strict";(function(t){var r=n(1),o=r;if("production"!==t.env.NODE_ENV){var i=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=0,i="Warning: "+e.replace(/%s/g,function(){return n[o++]});"undefined"!=typeof console&&console.error(i);try{throw new Error(i)}catch(e){}};o=function(e,t){if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==t.indexOf("Failed Composite propType: ")&&!e){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];i.apply(void 0,[t].concat(r))}}}e.exports=o}).call(t,n(0))},function(e,t){e.exports=require("react")},function(e,t,n){"use strict";var r=n(8),o=function(e){return e&&e.__esModule?e:{default:e}}(r);e.exports=o.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 a(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 u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),f=n(4),c=r(f),d=n(6),p=r(d),h=n(13),y=r(h),v=n(14),m=r(v),g=function(e){return e+="",e.charAt(0).toLowerCase()+e.substr(1)},b=function(e){function t(){var e,n,r,o;i(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=s(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.tree=null,r.state={nodes:[]},r.eventHandlers={onContentWillUpdate:null,onContentDidUpdate:null,onOpenNode:null,onCloseNode:null,onSelectNode:null,onWillOpenNode:null,onWillCloseNode:null,onWillSelectNode:null},o=n,s(r,o)}return a(t,e),l(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,n=(t.children,t.className,t.style,o(t,["children","className","style"]));void 0!==n.el&&delete n.el,n.rowRenderer=function(){return""},this.tree=new y.default(n);var r=this.tree.filter.bind(this.tree);this.tree.filter=function(){return setTimeout(function(){e.virtualList.recomputeSizes(0)},0),r.apply(void 0,arguments)};var i=this.tree.unfilter.bind(this.tree);this.tree.unfilter=function(){return setTimeout(function(){e.virtualList.recomputeSizes(0)},0),i.apply(void 0,arguments)},this.tree.scrollToNode=function(t){if(!e.tree||!e.virtualList)return!1;var n=e.tree.nodes.indexOf(t);if(n<0)return!1;var r=e.virtualList.getOffsetForIndex(n);return e.virtualList.scrollTo(r),!0},this.tree.scrollTop=function(t){if(e.tree&&e.virtualList)return void 0!==t&&e.virtualList.scrollTo(Number(t)),e.virtualList.getNodeOffset()},this.tree.update=function(){e.tree.emit("contentWillUpdate"),e.setState(function(t){return{nodes:e.tree.nodes}},function(){e.tree.emit("contentDidUpdate")})},Object.keys(this.eventHandlers).forEach(function(t){if(e.props[t]){var n=g(t.substr(2));e.eventHandlers[t]=e.props[t],e.tree.on(n,e.eventHandlers[t])}})}},{key:"componentWillUnmount",value:function(){var e=this;Object.keys(this.eventHandlers).forEach(function(t){if(e.eventHandlers[t]){var n=g(t.substr(2));e.tree.removeListener(n,e.eventHandlers[t]),e.eventHandlers[t]=null}}),this.tree.destroy(),this.tree=null}},{key:"render",value:function(){var e=this,t=this.props,n=(t.autoOpen,t.selectable,t.tabIndex),r=(t.data,t.width),i=t.height,s=t.rowHeight,a=t.rowRenderer,l=(t.loadNodes,t.shouldSelectNode,t.scrollOffset),f=t.scrollToIndex,c=t.onScroll,d=(t.onContentWillUpdate,t.onContentDidUpdate,t.onOpenNode,t.onCloseNode,t.onSelectNode,t.onWillOpenNode,t.onWillCloseNode,t.onWillSelectNode,t.style),h=o(t,["autoOpen","selectable","tabIndex","data","width","height","rowHeight","rowRenderer","loadNodes","shouldSelectNode","scrollOffset","scrollToIndex","onScroll","onContentWillUpdate","onContentDidUpdate","onOpenNode","onCloseNode","onSelectNode","onWillOpenNode","onWillCloseNode","onWillSelectNode","style"]),y="function"==typeof children?children:a,v=this.tree?this.tree.nodes.length:0,g={};return void 0!==l&&v>0&&(g.scrollOffset=l),void 0!==f&&f>=0&&f<v&&(g.scrollToIndex=f),"function"!=typeof c&&(g.onScroll=c),p.default.createElement("div",u({},h,{style:u({outline:"none"},d),tabIndex:n}),p.default.createElement(m.default,u({ref:function(t){e.virtualList=t},width:r,height:i,itemCount:v,itemSize:function(t){var n=s;return"function"==typeof s&&(n=s({node:e.tree.nodes[t],tree:e.tree,index:t})),n},renderItem:function(t){var n=t.index,r=t.style,o=null;if("function"==typeof y){var i=e.tree.nodes[n];i&&!1!==i.state.filtered&&(o=y({node:e.tree.nodes[n],tree:e.tree,index:n}))}return p.default.createElement("div",{key:n,style:r},o)}},g)))}}]),t}(d.Component);b.displayName="InfiniteTree",b.propTypes={autoOpen:c.default.bool,selectable:c.default.bool,tabIndex:c.default.number,data:c.default.oneOfType([c.default.array,c.default.object]),width:c.default.oneOfType([c.default.string,c.default.number]).isRequired,height:c.default.oneOfType([c.default.string,c.default.number]).isRequired,rowHeight:c.default.oneOfType([c.default.number,c.default.array,c.default.func]).isRequired,rowRenderer:c.default.func,loadNodes:c.default.func,shouldSelectNode:c.default.func,scrollOffset:c.default.number,scrollToIndex:c.default.number,onScroll:c.default.func,onContentWillUpdate:c.default.func,onContentDidUpdate:c.default.func,onOpenNode:c.default.func,onCloseNode:c.default.func,onSelectNode:c.default.func,onWillOpenNode:c.default.func,onWillCloseNode:c.default.func,onWillSelectNode:c.default.func},b.defaultProps={autoOpen:!1,selectable:!0,tabIndex:0,data:[],width:"100%"},t.default=b},function(e,t,n){"use strict";(function(t){var r=n(1),o=n(2),i=n(5),s=n(10),a=n(3),u=n(11);e.exports=function(e,n){function l(e){var t=e&&(N&&e[N]||e[C]);if("function"==typeof t)return t}function f(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function c(e){this.message=e,this.stack=""}function d(e){function r(r,l,f,d,p,h,y){if(d=d||j,h=h||f,y!==a)if(n)o(!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");else if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var v=d+":"+f;!s[v]&&u<3&&(i(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",h,d),s[v]=!0,u++)}return null==l[f]?r?new c(null===l[f]?"The "+p+" `"+h+"` is marked as required in `"+d+"`, but its value is `null`.":"The "+p+" `"+h+"` is marked as required in `"+d+"`, but its value is `undefined`."):null:e(l,f,d,p,h)}if("production"!==t.env.NODE_ENV)var s={},u=0;var l=r.bind(null,!1);return l.isRequired=r.bind(null,!0),l}function p(e){function t(t,n,r,o,i,s){var a=t[n];if(w(a)!==e)return new c("Invalid "+o+" `"+i+"` of type `"+I(a)+"` supplied to `"+r+"`, expected `"+e+"`.");return null}return d(t)}function h(e){function t(t,n,r,o,i){if("function"!=typeof e)return new c("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s)){return new c("Invalid "+o+" `"+i+"` of type `"+w(s)+"` supplied to `"+r+"`, expected an array.")}for(var u=0;u<s.length;u++){var l=e(s,u,r,o,i+"["+u+"]",a);if(l instanceof Error)return l}return null}return d(t)}function y(e){function t(t,n,r,o,i){if(!(t[n]instanceof e)){var s=e.name||j;return new c("Invalid "+o+" `"+i+"` of type `"+z(t[n])+"` supplied to `"+r+"`, expected instance of `"+s+"`.")}return null}return d(t)}function v(e){function n(t,n,r,o,i){for(var s=t[n],a=0;a<e.length;a++)if(f(s,e[a]))return null;return new c("Invalid "+o+" `"+i+"` of value `"+s+"` supplied to `"+r+"`, expected one of "+JSON.stringify(e)+".")}return Array.isArray(e)?d(n):("production"!==t.env.NODE_ENV&&i(!1,"Invalid argument supplied to oneOf, expected an instance of array."),r.thatReturnsNull)}function m(e){function t(t,n,r,o,i){if("function"!=typeof e)return new c("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var s=t[n],u=w(s);if("object"!==u)return new c("Invalid "+o+" `"+i+"` of type `"+u+"` supplied to `"+r+"`, expected an object.");for(var l in s)if(s.hasOwnProperty(l)){var f=e(s,l,r,o,i+"."+l,a);if(f instanceof Error)return f}return null}return d(t)}function g(e){function n(t,n,r,o,i){for(var s=0;s<e.length;s++){if(null==(0,e[s])(t,n,r,o,i,a))return null}return new c("Invalid "+o+" `"+i+"` supplied to `"+r+"`.")}if(!Array.isArray(e))return"production"!==t.env.NODE_ENV&&i(!1,"Invalid argument supplied to oneOfType, expected an instance of array."),r.thatReturnsNull;for(var o=0;o<e.length;o++){var s=e[o];if("function"!=typeof s)return i(!1,"Invalid argument supplied to oneOfType. Expected an array of check functions, but received %s at index %s.",T(s),o),r.thatReturnsNull}return d(n)}function b(e){function t(t,n,r,o,i){var s=t[n],u=w(s);if("object"!==u)return new c("Invalid "+o+" `"+i+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");for(var l in e){var f=e[l];if(f){var d=f(s,l,r,o,i+"."+l,a);if(d)return d}}return null}return d(t)}function O(e){function t(t,n,r,o,i){var u=t[n],l=w(u);if("object"!==l)return new c("Invalid "+o+" `"+i+"` of type `"+l+"` supplied to `"+r+"`, expected `object`.");var f=s({},t[n],e);for(var d in f){var p=e[d];if(!p)return new c("Invalid "+o+" `"+i+"` key `"+d+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=p(u,d,r,o,i+"."+d,a);if(h)return h}return null}return d(t)}function S(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(S);if(null===t||e(t))return!0;var n=l(t);if(!n)return!1;var r,o=n.call(t);if(n!==t.entries){for(;!(r=o.next()).done;)if(!S(r.value))return!1}else for(;!(r=o.next()).done;){var i=r.value;if(i&&!S(i[1]))return!1}return!0;default:return!1}}function x(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function w(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":x(t,e)?"symbol":t}function I(e){if(void 0===e||null===e)return""+e;var t=w(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function T(e){var t=I(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}function z(e){return e.constructor&&e.constructor.name?e.constructor.name:j}var N="function"==typeof Symbol&&Symbol.iterator,C="@@iterator",j="<<anonymous>>",P={array:p("array"),bool:p("boolean"),func:p("function"),number:p("number"),object:p("object"),string:p("string"),symbol:p("symbol"),any:function(){return d(r.thatReturnsNull)}(),arrayOf:h,element:function(){function t(t,n,r,o,i){var s=t[n];if(!e(s)){return new c("Invalid "+o+" `"+i+"` of type `"+w(s)+"` supplied to `"+r+"`, expected a single ReactElement.")}return null}return d(t)}(),instanceOf:y,node:function(){function e(e,t,n,r,o){return S(e[t])?null:new c("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}return d(e)}(),objectOf:m,oneOf:v,oneOfType:g,shape:b,exact:O};return c.prototype=Error.prototype,P.checkPropTypes=u,P.PropTypes=P,P}}).call(t,n(0))},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}/*
object-assign

@@ -7,2 +7,2 @@ (c) Sindre Sorhus

*/
var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,u=r(e),l=1;l<arguments.length;l++){n=Object(arguments[l]);for(var f in n)i.call(n,f)&&(u[f]=n[f]);if(o){a=o(n);for(var c=0;c<a.length;c++)s.call(n,a[c])&&(u[a[c]]=n[a[c]])}}return u}},function(e,t,n){"use strict";(function(t){function r(e,n,r,u,l){if("production"!==t.env.NODE_ENV)for(var f in e)if(e.hasOwnProperty(f)){var c;try{o("function"==typeof e[f],"%s: %s type `%s` is invalid; it must be a function, usually from the `prop-types` package, but received `%s`.",u||"React class",r,f,typeof e[f]),c=e[f](n,f,u,r,null,s)}catch(e){c=e}if(i(!c||c instanceof Error,"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",u||"React class",r,f,typeof c),c instanceof Error&&!(c.message in a)){a[c.message]=!0;var d=l?l():"";i(!1,"Failed %s type: %s%s",r,c.message,null!=d?d:"")}}}if("production"!==t.env.NODE_ENV)var o=n(2),i=n(4),s=n(3),a={};e.exports=r}).call(t,n(0))},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(3);e.exports=function(){function e(e,t,n,r,s,a){a!==i&&o(!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=r,n.PropTypes=n,n}},function(e,t,n){"use strict";(function(t){var r=n(1),o=n(2),i=n(4),s=n(9),a=n(3),u=n(10);e.exports=function(e,n){function l(e){var t=e&&(N&&e[N]||e[C]);if("function"==typeof t)return t}function f(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function c(e){this.message=e,this.stack=""}function d(e){function r(r,l,f,d,p,h,y){if(d=d||P,h=h||f,y!==a)if(n)o(!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");else if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var v=d+":"+f;!s[v]&&u<3&&(i(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",h,d),s[v]=!0,u++)}return null==l[f]?r?new c(null===l[f]?"The "+p+" `"+h+"` is marked as required in `"+d+"`, but its value is `null`.":"The "+p+" `"+h+"` is marked as required in `"+d+"`, but its value is `undefined`."):null:e(l,f,d,p,h)}if("production"!==t.env.NODE_ENV)var s={},u=0;var l=r.bind(null,!1);return l.isRequired=r.bind(null,!0),l}function p(e){function t(t,n,r,o,i,s){var a=t[n];if(w(a)!==e)return new c("Invalid "+o+" `"+i+"` of type `"+I(a)+"` supplied to `"+r+"`, expected `"+e+"`.");return null}return d(t)}function h(e){function t(t,n,r,o,i){if("function"!=typeof e)return new c("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s)){return new c("Invalid "+o+" `"+i+"` of type `"+w(s)+"` supplied to `"+r+"`, expected an array.")}for(var u=0;u<s.length;u++){var l=e(s,u,r,o,i+"["+u+"]",a);if(l instanceof Error)return l}return null}return d(t)}function y(e){function t(t,n,r,o,i){if(!(t[n]instanceof e)){var s=e.name||P;return new c("Invalid "+o+" `"+i+"` of type `"+z(t[n])+"` supplied to `"+r+"`, expected instance of `"+s+"`.")}return null}return d(t)}function v(e){function n(t,n,r,o,i){for(var s=t[n],a=0;a<e.length;a++)if(f(s,e[a]))return null;return new c("Invalid "+o+" `"+i+"` of value `"+s+"` supplied to `"+r+"`, expected one of "+JSON.stringify(e)+".")}return Array.isArray(e)?d(n):("production"!==t.env.NODE_ENV&&i(!1,"Invalid argument supplied to oneOf, expected an instance of array."),r.thatReturnsNull)}function m(e){function t(t,n,r,o,i){if("function"!=typeof e)return new c("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var s=t[n],u=w(s);if("object"!==u)return new c("Invalid "+o+" `"+i+"` of type `"+u+"` supplied to `"+r+"`, expected an object.");for(var l in s)if(s.hasOwnProperty(l)){var f=e(s,l,r,o,i+"."+l,a);if(f instanceof Error)return f}return null}return d(t)}function g(e){function n(t,n,r,o,i){for(var s=0;s<e.length;s++){if(null==(0,e[s])(t,n,r,o,i,a))return null}return new c("Invalid "+o+" `"+i+"` supplied to `"+r+"`.")}if(!Array.isArray(e))return"production"!==t.env.NODE_ENV&&i(!1,"Invalid argument supplied to oneOfType, expected an instance of array."),r.thatReturnsNull;for(var o=0;o<e.length;o++){var s=e[o];if("function"!=typeof s)return i(!1,"Invalid argument supplied to oneOfType. Expected an array of check functions, but received %s at index %s.",T(s),o),r.thatReturnsNull}return d(n)}function b(e){function t(t,n,r,o,i){var s=t[n],u=w(s);if("object"!==u)return new c("Invalid "+o+" `"+i+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");for(var l in e){var f=e[l];if(f){var d=f(s,l,r,o,i+"."+l,a);if(d)return d}}return null}return d(t)}function O(e){function t(t,n,r,o,i){var u=t[n],l=w(u);if("object"!==l)return new c("Invalid "+o+" `"+i+"` of type `"+l+"` supplied to `"+r+"`, expected `object`.");var f=s({},t[n],e);for(var d in f){var p=e[d];if(!p)return new c("Invalid "+o+" `"+i+"` key `"+d+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=p(u,d,r,o,i+"."+d,a);if(h)return h}return null}return d(t)}function S(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(S);if(null===t||e(t))return!0;var n=l(t);if(!n)return!1;var r,o=n.call(t);if(n!==t.entries){for(;!(r=o.next()).done;)if(!S(r.value))return!1}else for(;!(r=o.next()).done;){var i=r.value;if(i&&!S(i[1]))return!1}return!0;default:return!1}}function x(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function w(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":x(t,e)?"symbol":t}function I(e){if(void 0===e||null===e)return""+e;var t=w(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function T(e){var t=I(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}function z(e){return e.constructor&&e.constructor.name?e.constructor.name:P}var N="function"==typeof Symbol&&Symbol.iterator,C="@@iterator",P="<<anonymous>>",E={array:p("array"),bool:p("boolean"),func:p("function"),number:p("number"),object:p("object"),string:p("string"),symbol:p("symbol"),any:function(){return d(r.thatReturnsNull)}(),arrayOf:h,element:function(){function t(t,n,r,o,i){var s=t[n];if(!e(s)){return new c("Invalid "+o+" `"+i+"` of type `"+w(s)+"` supplied to `"+r+"`, expected a single ReactElement.")}return null}return d(t)}(),instanceOf:y,node:function(){function e(e,t,n,r,o){return S(e[t])?null:new c("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}return d(e)}(),objectOf:m,oneOf:v,oneOfType:g,shape:b,exact:O};return c.prototype=Error.prototype,E.checkPropTypes=u,E.PropTypes=E,E}}).call(t,n(0))},function(e,t,n){"use strict";function r(e,t){function n(){this.constructor=e}f(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function o(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]]);return n}Object.defineProperty(t,"__esModule",{value:!0});var i,s,a,u=n(6),l=(n.n(u),n(5)),f=(n.n(l),Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}),c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},d="observed",p="requested",h=(i={},i.vertical="scrollTop",i.horizontal="scrollLeft",i),y=(s={},s.vertical="height",s.horizontal="width",s),v=(a={},a.vertical="top",a.horizontal="left",a),m=function(){function e(e){var t=e.itemCount,n=e.itemSizeGetter,r=e.estimatedItemSize;this.itemSizeGetter=n,this.itemCount=t,this.estimatedItemSize=r,this.itemSizeAndPositionData={},this.lastMeasuredIndex=-1}return e.prototype.updateConfig=function(e){var t=e.itemCount,n=e.estimatedItemSize;this.itemCount=t,this.estimatedItemSize=n},e.prototype.getLastMeasuredIndex=function(){return this.lastMeasuredIndex},e.prototype.getSizeAndPositionForIndex=function(e){if(e<0||e>=this.itemCount)throw Error("Requested index "+e+" is outside of range 0.."+this.itemCount);if(e>this.lastMeasuredIndex){for(var t=this.getSizeAndPositionOfLastMeasuredItem(),n=t.offset+t.size,r=this.lastMeasuredIndex+1;r<=e;r++){var o=this.itemSizeGetter(r);if(null==o||isNaN(o))throw Error("Invalid size returned for index "+r+" of value "+o);this.itemSizeAndPositionData[r]={offset:n,size:o},n+=o}this.lastMeasuredIndex=e}return this.itemSizeAndPositionData[e]},e.prototype.getSizeAndPositionOfLastMeasuredItem=function(){return this.lastMeasuredIndex>=0?this.itemSizeAndPositionData[this.lastMeasuredIndex]:{offset:0,size:0}},e.prototype.getTotalSize=function(){var e=this.getSizeAndPositionOfLastMeasuredItem();return e.offset+e.size+(this.itemCount-this.lastMeasuredIndex-1)*this.estimatedItemSize},e.prototype.getUpdatedOffsetForIndex=function(e){var t=e.align,n=void 0===t?"start":t,r=e.containerSize,o=e.currentOffset,i=e.targetIndex;if(r<=0)return 0;var s,a=this.getSizeAndPositionForIndex(i),u=a.offset,l=u-r+a.size;switch(n){case"end":s=l;break;case"center":s=u-(r-a.size)/2;break;case"start":s=u;break;default:s=Math.max(l,Math.min(u,o))}var f=this.getTotalSize();return Math.max(0,Math.min(f-r,s))},e.prototype.getVisibleRange=function(e){var t=e.containerSize,n=e.offset,r=e.overscanCount;if(0===this.getTotalSize())return{};var o=n+t,i=this.findNearestItem(n);if(void 0===i)throw Error("Invalid offset "+n+" specified");var s=this.getSizeAndPositionForIndex(i);n=s.offset+s.size;for(var a=i;n<o&&a<this.itemCount-1;)a++,n+=this.getSizeAndPositionForIndex(a).size;return r&&(i=Math.max(0,i-r),a=Math.min(a+r,this.itemCount-1)),{start:i,stop:a}},e.prototype.resetItem=function(e){this.lastMeasuredIndex=Math.min(this.lastMeasuredIndex,e-1)},e.prototype.findNearestItem=function(e){if(isNaN(e))throw Error("Invalid offset "+e+" specified");e=Math.max(0,e);var t=this.getSizeAndPositionOfLastMeasuredItem(),n=Math.max(0,this.lastMeasuredIndex);return t.offset>=e?this.binarySearch({high:n,low:0,offset:e}):this.exponentialSearch({index:n,offset:e})},e.prototype.binarySearch=function(e){for(var t=e.low,n=e.high,r=e.offset,o=0,i=0;t<=n;){if(o=t+Math.floor((n-t)/2),(i=this.getSizeAndPositionForIndex(o).offset)===r)return o;i<r?t=o+1:i>r&&(n=o-1)}return t>0?t-1:0},e.prototype.exponentialSearch=function(e){for(var t=e.index,n=e.offset,r=1;t<this.itemCount&&this.getSizeAndPositionForIndex(t).offset<n;)t+=r,r*=2;return this.binarySearch({high:Math.min(t,this.itemCount-1),low:Math.floor(t/2),offset:n})},e}(),g={overflow:"auto",willChange:"transform",WebkitOverflowScrolling:"touch"},b={position:"relative",overflow:"hidden",width:"100%",minHeight:"100%"},O={position:"absolute",left:0,width:"100%"},S=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.sizeAndPositionManager=new m({itemCount:t.props.itemCount,itemSizeGetter:function(e){return t.getSize(e)},estimatedItemSize:t.getEstimatedItemSize()}),t.state={offset:t.props.scrollOffset||null!=t.props.scrollToIndex&&t.getOffsetForIndex(t.props.scrollToIndex)||0,scrollChangeReason:p},t.styleCache={},t.handleScroll=function(e){var n=t.props.onScroll,r=t.getNodeOffset();r<0||t.state.offset===r||e.target!==t.rootNode||(t.setState({offset:r,scrollChangeReason:d}),"function"==typeof n&&n(r,e))},t.getRef=function(e){t.rootNode=e},t}return r(t,e),t.prototype.componentDidMount=function(){var e=this.props,t=e.scrollOffset,n=e.scrollToIndex;null!=t?this.scrollTo(t):null!=n&&this.scrollTo(this.getOffsetForIndex(n))},t.prototype.componentWillReceiveProps=function(e){var t=this.props,n=t.estimatedItemSize,r=t.itemCount,o=t.itemSize,i=t.scrollOffset,s=t.scrollToAlignment,a=t.scrollToIndex,u=e.scrollToIndex!==a||e.scrollToAlignment!==s,l=e.itemCount!==r||e.itemSize!==o||e.estimatedItemSize!==n;e.itemCount===r&&e.estimatedItemSize===n||this.sizeAndPositionManager.updateConfig({itemCount:e.itemCount,estimatedItemSize:this.getEstimatedItemSize(e)}),l&&this.recomputeSizes(),e.scrollOffset!==i?this.setState({offset:e.scrollOffset||0,scrollChangeReason:p}):"number"==typeof e.scrollToIndex&&(u||l)&&this.setState({offset:this.getOffsetForIndex(e.scrollToIndex,e.scrollToAlignment,e.itemCount),scrollChangeReason:p})},t.prototype.componentDidUpdate=function(e,t){var n=this.state,r=n.offset,o=n.scrollChangeReason;t.offset!==r&&o===p&&this.scrollTo(r)},t.prototype.getEstimatedItemSize=function(e){return void 0===e&&(e=this.props),e.estimatedItemSize||"number"==typeof e.itemSize&&e.itemSize||50},t.prototype.getNodeOffset=function(){var e=this.props.scrollDirection,t=void 0===e?"vertical":e;return this.rootNode[h[t]]},t.prototype.scrollTo=function(e){var t=this.props.scrollDirection,n=void 0===t?"vertical":t;this.rootNode[h[n]]=e},t.prototype.getOffsetForIndex=function(e,t,n){void 0===t&&(t=this.props.scrollToAlignment),void 0===n&&(n=this.props.itemCount);var r=this.props.scrollDirection,o=void 0===r?"vertical":r;return(e<0||e>=n)&&(e=0),this.sizeAndPositionManager.getUpdatedOffsetForIndex({align:t,containerSize:this.props[y[o]],currentOffset:this.state&&this.state.offset||0,targetIndex:e})},t.prototype.getSize=function(e){var t=this.props.itemSize;return"function"==typeof t?t(e):Array.isArray(t)?t[e]:t},t.prototype.getStyle=function(e){var t=this.styleCache[e];if(t)return t;var n=this.props.scrollDirection,r=void 0===n?"vertical":n,o=this.sizeAndPositionManager.getSizeAndPositionForIndex(e),i=o.size,s=o.offset;return this.styleCache[e]=c({},O,(a={},a[y[r]]=i,a[v[r]]=s,a));var a},t.prototype.recomputeSizes=function(e){void 0===e&&(e=0),this.styleCache={},this.sizeAndPositionManager.resetItem(e)},t.prototype.render=function(){var e=this.props,t=(e.estimatedItemSize,e.height),r=e.overscanCount,i=void 0===r?3:r,s=e.renderItem,a=(e.itemCount,e.itemSize,e.onItemsRendered),l=(e.onScroll,e.scrollDirection),f=void 0===l?"vertical":l,d=(e.scrollOffset,e.scrollToIndex,e.scrollToAlignment,e.style),p=e.width,h=o(e,["estimatedItemSize","height","overscanCount","renderItem","itemCount","itemSize","onItemsRendered","onScroll","scrollDirection","scrollOffset","scrollToIndex","scrollToAlignment","style","width"]),v=this.state.offset,m=this.sizeAndPositionManager.getVisibleRange({containerSize:this.props[y[f]]||0,offset:v,overscanCount:i}),O=m.start,S=m.stop,x=[];if(void 0!==O&&void 0!==S){for(var w=O;w<=S;w++)x.push(s({index:w,style:this.getStyle(w)}));"function"==typeof a&&a({startIndex:O,stopIndex:S})}return n.i(u.createElement)("div",c({ref:this.getRef},h,{onScroll:this.handleScroll,style:c({},g,d,{height:t,width:p})}),n.i(u.createElement)("div",{style:c({},b,(I={},I[y[f]]=this.sizeAndPositionManager.getTotalSize(),I))},x));var I},t.defaultProps={overscanCount:3,scrollDirection:"vertical",width:"100%"},t.propTypes={estimatedItemSize:l.number,height:n.i(l.oneOfType)([l.number,l.string]).isRequired,itemCount:l.number.isRequired,itemSize:n.i(l.oneOfType)([l.number,l.array,l.func]).isRequired,onItemsRendered:l.func,overscanCount:l.number,renderItem:l.func.isRequired,scrollOffset:l.number,scrollToIndex:l.number,scrollToAlignment:n.i(l.oneOf)(["auto","start","center","end"]),scrollDirection:n.i(l.oneOf)(["horizontal","vertical"]).isRequired,width:n.i(l.oneOfType)([l.number,l.string]).isRequired},t}(u.PureComponent);t.default=S},function(e,t){e.exports=require("infinite-tree")}]);
var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,u=r(e),l=1;l<arguments.length;l++){n=Object(arguments[l]);for(var f in n)i.call(n,f)&&(u[f]=n[f]);if(o){a=o(n);for(var c=0;c<a.length;c++)s.call(n,a[c])&&(u[a[c]]=n[a[c]])}}return u}},function(e,t,n){"use strict";(function(t){function r(e,n,r,u,l){if("production"!==t.env.NODE_ENV)for(var f in e)if(e.hasOwnProperty(f)){var c;try{o("function"==typeof e[f],"%s: %s type `%s` is invalid; it must be a function, usually from the `prop-types` package, but received `%s`.",u||"React class",r,f,typeof e[f]),c=e[f](n,f,u,r,null,s)}catch(e){c=e}if(i(!c||c instanceof Error,"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",u||"React class",r,f,typeof c),c instanceof Error&&!(c.message in a)){a[c.message]=!0;var d=l?l():"";i(!1,"Failed %s type: %s%s",r,c.message,null!=d?d:"")}}}if("production"!==t.env.NODE_ENV)var o=n(2),i=n(5),s=n(3),a={};e.exports=r}).call(t,n(0))},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(3);e.exports=function(){function e(e,t,n,r,s,a){a!==i&&o(!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=r,n.PropTypes=n,n}},function(e,t){e.exports=require("infinite-tree")},function(e,t,n){"use strict";function r(e,t){function n(){this.constructor=e}f(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function o(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]]);return n}Object.defineProperty(t,"__esModule",{value:!0});var i,s,a,u=n(6),l=(n.n(u),n(4)),f=(n.n(l),Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}),c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},d="observed",p="requested",h=(i={},i.vertical="scrollTop",i.horizontal="scrollLeft",i),y=(s={},s.vertical="height",s.horizontal="width",s),v=(a={},a.vertical="top",a.horizontal="left",a),m=function(){function e(e){var t=e.itemCount,n=e.itemSizeGetter,r=e.estimatedItemSize;this.itemSizeGetter=n,this.itemCount=t,this.estimatedItemSize=r,this.itemSizeAndPositionData={},this.lastMeasuredIndex=-1}return e.prototype.updateConfig=function(e){var t=e.itemCount,n=e.estimatedItemSize;this.itemCount=t,this.estimatedItemSize=n},e.prototype.getLastMeasuredIndex=function(){return this.lastMeasuredIndex},e.prototype.getSizeAndPositionForIndex=function(e){if(e<0||e>=this.itemCount)throw Error("Requested index "+e+" is outside of range 0.."+this.itemCount);if(e>this.lastMeasuredIndex){for(var t=this.getSizeAndPositionOfLastMeasuredItem(),n=t.offset+t.size,r=this.lastMeasuredIndex+1;r<=e;r++){var o=this.itemSizeGetter(r);if(null==o||isNaN(o))throw Error("Invalid size returned for index "+r+" of value "+o);this.itemSizeAndPositionData[r]={offset:n,size:o},n+=o}this.lastMeasuredIndex=e}return this.itemSizeAndPositionData[e]},e.prototype.getSizeAndPositionOfLastMeasuredItem=function(){return this.lastMeasuredIndex>=0?this.itemSizeAndPositionData[this.lastMeasuredIndex]:{offset:0,size:0}},e.prototype.getTotalSize=function(){var e=this.getSizeAndPositionOfLastMeasuredItem();return e.offset+e.size+(this.itemCount-this.lastMeasuredIndex-1)*this.estimatedItemSize},e.prototype.getUpdatedOffsetForIndex=function(e){var t=e.align,n=void 0===t?"start":t,r=e.containerSize,o=e.currentOffset,i=e.targetIndex;if(r<=0)return 0;var s,a=this.getSizeAndPositionForIndex(i),u=a.offset,l=u-r+a.size;switch(n){case"end":s=l;break;case"center":s=u-(r-a.size)/2;break;case"start":s=u;break;default:s=Math.max(l,Math.min(u,o))}var f=this.getTotalSize();return Math.max(0,Math.min(f-r,s))},e.prototype.getVisibleRange=function(e){var t=e.containerSize,n=e.offset,r=e.overscanCount;if(0===this.getTotalSize())return{};var o=n+t,i=this.findNearestItem(n);if(void 0===i)throw Error("Invalid offset "+n+" specified");var s=this.getSizeAndPositionForIndex(i);n=s.offset+s.size;for(var a=i;n<o&&a<this.itemCount-1;)a++,n+=this.getSizeAndPositionForIndex(a).size;return r&&(i=Math.max(0,i-r),a=Math.min(a+r,this.itemCount-1)),{start:i,stop:a}},e.prototype.resetItem=function(e){this.lastMeasuredIndex=Math.min(this.lastMeasuredIndex,e-1)},e.prototype.findNearestItem=function(e){if(isNaN(e))throw Error("Invalid offset "+e+" specified");e=Math.max(0,e);var t=this.getSizeAndPositionOfLastMeasuredItem(),n=Math.max(0,this.lastMeasuredIndex);return t.offset>=e?this.binarySearch({high:n,low:0,offset:e}):this.exponentialSearch({index:n,offset:e})},e.prototype.binarySearch=function(e){for(var t=e.low,n=e.high,r=e.offset,o=0,i=0;t<=n;){if(o=t+Math.floor((n-t)/2),(i=this.getSizeAndPositionForIndex(o).offset)===r)return o;i<r?t=o+1:i>r&&(n=o-1)}return t>0?t-1:0},e.prototype.exponentialSearch=function(e){for(var t=e.index,n=e.offset,r=1;t<this.itemCount&&this.getSizeAndPositionForIndex(t).offset<n;)t+=r,r*=2;return this.binarySearch({high:Math.min(t,this.itemCount-1),low:Math.floor(t/2),offset:n})},e}(),g={overflow:"auto",willChange:"transform",WebkitOverflowScrolling:"touch"},b={position:"relative",overflow:"hidden",width:"100%",minHeight:"100%"},O={position:"absolute",left:0,width:"100%"},S=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.sizeAndPositionManager=new m({itemCount:t.props.itemCount,itemSizeGetter:function(e){return t.getSize(e)},estimatedItemSize:t.getEstimatedItemSize()}),t.state={offset:t.props.scrollOffset||null!=t.props.scrollToIndex&&t.getOffsetForIndex(t.props.scrollToIndex)||0,scrollChangeReason:p},t.styleCache={},t.handleScroll=function(e){var n=t.props.onScroll,r=t.getNodeOffset();r<0||t.state.offset===r||e.target!==t.rootNode||(t.setState({offset:r,scrollChangeReason:d}),"function"==typeof n&&n(r,e))},t.getRef=function(e){t.rootNode=e},t}return r(t,e),t.prototype.componentDidMount=function(){var e=this.props,t=e.scrollOffset,n=e.scrollToIndex;null!=t?this.scrollTo(t):null!=n&&this.scrollTo(this.getOffsetForIndex(n))},t.prototype.componentWillReceiveProps=function(e){var t=this.props,n=t.estimatedItemSize,r=t.itemCount,o=t.itemSize,i=t.scrollOffset,s=t.scrollToAlignment,a=t.scrollToIndex,u=e.scrollToIndex!==a||e.scrollToAlignment!==s,l=e.itemCount!==r||e.itemSize!==o||e.estimatedItemSize!==n;e.itemCount===r&&e.estimatedItemSize===n||this.sizeAndPositionManager.updateConfig({itemCount:e.itemCount,estimatedItemSize:this.getEstimatedItemSize(e)}),l&&this.recomputeSizes(),e.scrollOffset!==i?this.setState({offset:e.scrollOffset||0,scrollChangeReason:p}):"number"==typeof e.scrollToIndex&&(u||l)&&this.setState({offset:this.getOffsetForIndex(e.scrollToIndex,e.scrollToAlignment,e.itemCount),scrollChangeReason:p})},t.prototype.componentDidUpdate=function(e,t){var n=this.state,r=n.offset,o=n.scrollChangeReason;t.offset!==r&&o===p&&this.scrollTo(r)},t.prototype.getEstimatedItemSize=function(e){return void 0===e&&(e=this.props),e.estimatedItemSize||"number"==typeof e.itemSize&&e.itemSize||50},t.prototype.getNodeOffset=function(){var e=this.props.scrollDirection,t=void 0===e?"vertical":e;return this.rootNode[h[t]]},t.prototype.scrollTo=function(e){var t=this.props.scrollDirection,n=void 0===t?"vertical":t;this.rootNode[h[n]]=e},t.prototype.getOffsetForIndex=function(e,t,n){void 0===t&&(t=this.props.scrollToAlignment),void 0===n&&(n=this.props.itemCount);var r=this.props.scrollDirection,o=void 0===r?"vertical":r;return(e<0||e>=n)&&(e=0),this.sizeAndPositionManager.getUpdatedOffsetForIndex({align:t,containerSize:this.props[y[o]],currentOffset:this.state&&this.state.offset||0,targetIndex:e})},t.prototype.getSize=function(e){var t=this.props.itemSize;return"function"==typeof t?t(e):Array.isArray(t)?t[e]:t},t.prototype.getStyle=function(e){var t=this.styleCache[e];if(t)return t;var n=this.props.scrollDirection,r=void 0===n?"vertical":n,o=this.sizeAndPositionManager.getSizeAndPositionForIndex(e),i=o.size,s=o.offset;return this.styleCache[e]=c({},O,(a={},a[y[r]]=i,a[v[r]]=s,a));var a},t.prototype.recomputeSizes=function(e){void 0===e&&(e=0),this.styleCache={},this.sizeAndPositionManager.resetItem(e)},t.prototype.render=function(){var e=this.props,t=(e.estimatedItemSize,e.height),n=e.overscanCount,r=void 0===n?3:n,i=e.renderItem,s=(e.itemCount,e.itemSize,e.onItemsRendered),a=(e.onScroll,e.scrollDirection),l=void 0===a?"vertical":a,f=(e.scrollOffset,e.scrollToIndex,e.scrollToAlignment,e.style),d=e.width,p=o(e,["estimatedItemSize","height","overscanCount","renderItem","itemCount","itemSize","onItemsRendered","onScroll","scrollDirection","scrollOffset","scrollToIndex","scrollToAlignment","style","width"]),h=this.state.offset,v=this.sizeAndPositionManager.getVisibleRange({containerSize:this.props[y[l]]||0,offset:h,overscanCount:r}),m=v.start,O=v.stop,S=[];if(void 0!==m&&void 0!==O){for(var x=m;x<=O;x++)S.push(i({index:x,style:this.getStyle(x)}));"function"==typeof s&&s({startIndex:m,stopIndex:O})}return Object(u.createElement)("div",c({ref:this.getRef},p,{onScroll:this.handleScroll,style:c({},g,f,{height:t,width:d})}),Object(u.createElement)("div",{style:c({},b,(w={},w[y[l]]=this.sizeAndPositionManager.getTotalSize(),w))},S));var w},t.defaultProps={overscanCount:3,scrollDirection:"vertical",width:"100%"},t.propTypes={estimatedItemSize:l.number,height:Object(l.oneOfType)([l.number,l.string]).isRequired,itemCount:l.number.isRequired,itemSize:Object(l.oneOfType)([l.number,l.array,l.func]).isRequired,onItemsRendered:l.func,overscanCount:l.number,renderItem:l.func.isRequired,scrollOffset:l.number,scrollToIndex:l.number,scrollToAlignment:Object(l.oneOf)(["auto","start","center","end"]),scrollDirection:Object(l.oneOf)(["horizontal","vertical"]).isRequired,width:Object(l.oneOfType)([l.number,l.string]).isRequired},t}(u.PureComponent);t.default=S}]);
import React, { PureComponent } from 'react';
import Tree from './Tree';
import Preview from './Preview';
import debounce from 'lodash.debounce';
class App extends PureComponent {
state = {
node: null
node: null,
filterText: '',
caseSensitive: false,
exactMatch: false,
includeAncestors: true,
includeDescendants: true
};
textFilter = null;
tree = null;
changeCheckedState = (key) => (event) => {
const checked = event.target.checked;
this.setState({
[key]: checked
}, () => {
this.filter();
});
};
onUpdate = (node) => {
this.setState({ node: node });
};
filter = (keyword) => {
if (!this.tree) {
return;
}
keyword = keyword || this.textFilter.value || '';
if (!keyword) {
this.tree.unfilter();
return;
}
const {
caseSensitive,
exactMatch,
includeAncestors,
includeDescendants
} = this.state;
this.tree.filter(keyword, {
filterPath: 'name',
caseSensitive: caseSensitive,
exactMatch: exactMatch,
includeAncestors: includeAncestors,
includeDescendants: includeDescendants
});
};
render() {

@@ -19,5 +64,93 @@ return (

<div className="col-xs-6">
<Tree onUpdate={this.onUpdate} />
<h4>Filter</h4>
<input
ref={node => {
this.textFilter = node;
}}
type="text"
className="form-control"
name="text-filter"
placeholder="Type to filter by text"
onKeyUp={(event) => {
event.persist();
const { keyCode } = event;
const BACKSPACE = 8;
const DELETE = 46;
const ENTER = 13;
if ([BACKSPACE, DELETE, ENTER].includes(keyCode)) {
this.filter();
}
}}
onKeyPress={debounce((event) => {
this.filter();
}, 250)}
/>
<div className="row">
<div className="col-xs-6">
<div className="checkbox" style={{ margin: '5px 0' }}>
<label>
<input
type="checkbox"
name="case-sensitive"
checked={this.state.caseSensitive}
onChange={this.changeCheckedState('caseSensitive')}
/>
Case-sensitive
</label>
</div>
</div>
<div className="col-xs-6">
<div className="checkbox" style={{ margin: '5px 0' }}>
<label>
<input
type="checkbox"
name="exact-match"
checked={this.state.exactMatch}
onChange={this.changeCheckedState('exactMatch')}
/>
Exact match
</label>
</div>
</div>
<div className="col-xs-6">
<div className="checkbox" style={{ margin: '5px 0' }}>
<label>
<input
type="checkbox"
name="include-ancestors"
checked={this.state.includeAncestors}
onChange={this.changeCheckedState('includeAncestors')}
/>
Include ancestors
</label>
</div>
</div>
<div className="col-xs-6">
<div className="checkbox" style={{ margin: '5px 0' }}>
<label>
<input
type="checkbox"
name="include-descendants"
checked={this.state.includeDescendants}
onChange={this.changeCheckedState('includeDescendants')}
/>
Include descendants
</label>
</div>
</div>
</div>
</div>
</div>
<div className="row">
<div className="col-xs-6">
<Tree
ref={c => {
this.tree = c ? c.tree : null;
}}
onUpdate={this.onUpdate}
/>
</div>
<div className="col-xs-6">
<Preview node={this.state.node} />

@@ -24,0 +157,0 @@ </div>

@@ -89,3 +89,2 @@ import Dropdown, { MenuItem } from '@trendmicro/react-dropdown';

height={400}
rowHeight={30}
rowRenderer={({ node, tree }) => {

@@ -104,2 +103,8 @@ const hasChildren = node.hasChildren();

}}
rowHeight={({ node, tree }) => {
if (node.state.filtered === false) {
return 0;
}
return 30;
}}
loadNodes={(parentNode, done) => {

@@ -106,0 +111,0 @@ const suffix = parentNode.id.replace(/(\w)+/, '');

@@ -69,8 +69,2 @@ /* eslint no-var: 0 */

}
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
mangle: false
})

@@ -77,0 +71,0 @@ ],

@@ -91,2 +91,22 @@ 'use strict';

// Filters nodes.
// https://github.com/cheton/infinite-tree/wiki/Functions:-Tree#filterpredicate-options
var treeFilter = this.tree.filter.bind(this.tree);
this.tree.filter = function () {
setTimeout(function () {
_this2.virtualList.recomputeSizes(0);
}, 0);
return treeFilter.apply(undefined, arguments);
};
// Unfilter nodes.
// https://github.com/cheton/infinite-tree/wiki/Functions:-Tree#unfilter
var treeUnfilter = this.tree.unfilter.bind(this.tree);
this.tree.unfilter = function () {
setTimeout(function () {
_this2.virtualList.recomputeSizes(0);
}, 0);
return treeUnfilter.apply(undefined, arguments);
};
// Sets the current scroll position to this node.

@@ -227,3 +247,15 @@ // @param {Node} node The Node object.

itemCount: count,
itemSize: rowHeight,
itemSize: function itemSize(index) {
var height = rowHeight;
if (typeof rowHeight === 'function') {
height = rowHeight({
node: _this4.tree.nodes[index],
tree: _this4.tree,
index: index
});
}
return height;
},
renderItem: function renderItem(_ref2) {

@@ -234,7 +266,12 @@ var index = _ref2.index,

var row = null;
if (typeof render === 'function' && _this4.tree && _this4.tree.nodes.length > 0) {
row = render({
tree: _this4.tree,
node: _this4.tree.nodes[index]
});
if (typeof render === 'function') {
var node = _this4.tree.nodes[index];
if (node && node.state.filtered !== false) {
row = render({
node: _this4.tree.nodes[index],
tree: _this4.tree,
index: index
});
}
}

@@ -241,0 +278,0 @@

{
"name": "react-infinite-tree",
"version": "1.0.0-alpha",
"version": "1.0.0-alpha.1",
"description": "The infinite-tree library for React.",

@@ -48,8 +48,8 @@ "main": "lib/index.js",

"devDependencies": {
"@trendmicro/react-buttons": "^1.2.1",
"@trendmicro/react-dropdown": "^0.7.2",
"babel-cli": "~6.24.1",
"babel-core": "~6.24.1",
"babel-eslint": "~7.2.3",
"babel-loader": "~7.0.0",
"@trendmicro/react-buttons": "~1.2.1",
"@trendmicro/react-dropdown": "~0.7.2",
"babel-cli": "~6.26.0",
"babel-core": "~6.26.0",
"babel-eslint": "~8.0.3",
"babel-loader": "~7.1.2",
"babel-preset-es2015": "~6.24.1",

@@ -59,24 +59,24 @@ "babel-preset-react": "~6.24.1",

"classnames": "~2.2.5",
"coveralls": "~2.13.1",
"css-loader": "~0.28.1",
"eslint": "~3.19.0",
"eslint-config-trendmicro": "~0.5.1",
"eslint-loader": "~1.7.1",
"eslint-plugin-import": "~2.2.0",
"eslint-plugin-jsx-a11y": "~2.2.3",
"eslint-plugin-react": "~6.10.3",
"infinite-tree": "~1.11.0",
"coveralls": "~3.0.0",
"css-loader": "~0.28.7",
"eslint": "~4.13.1",
"eslint-config-trendmicro": "~1.1.0",
"eslint-loader": "~1.9.0",
"eslint-plugin-import": "~2.8.0",
"eslint-plugin-jsx-a11y": "~6.0.2",
"eslint-plugin-react": "~7.5.1",
"lodash.debounce": "~4.0.8",
"nib": "~1.1.2",
"react": "^0.14.0 || >=15.0.0",
"react-dom": "^0.14.0 || >=15.0.0",
"style-loader": "~0.17.0",
"styled-components": "^2.2.3",
"style-loader": "~0.19.0",
"styled-components": "~2.2.4",
"stylint": "~1.5.9",
"stylus": "~0.54.5",
"stylus-loader": "~3.0.1",
"tap": "~10.3.2",
"webpack": "~2.5.1",
"webpack-dev-server": "~2.4.5",
"which": "~1.2.14"
"tap": "~11.0.0",
"webpack": "~3.10.0",
"webpack-dev-server": "~2.9.7",
"which": "~1.3.0"
}
}

@@ -13,6 +13,6 @@ # react-infinite-tree [![build status](https://travis-ci.org/cheton/react-infinite-tree.svg?branch=master)](https://travis-ci.org/cheton/react-infinite-tree) [![Coverage Status](https://coveralls.io/repos/github/cheton/react-infinite-tree/badge.svg?branch=master)](https://coveralls.io/github/cheton/react-infinite-tree?branch=master)

* High performance infinite scroll with large data set
* [Customizable renderer](https://github.com/cheton/infinite-tree/wiki/Options#rowrenderer) to render the tree in any form
* [Customizable renderer](https://github.com/cheton/react-infinite-tree#rendering-tree-nodes) to render the tree in any form
* [Load nodes on demand](https://github.com/cheton/infinite-tree/wiki/Options#loadnodes)
* Native HTML5 drag and drop API
* A rich set of [APIs](https://github.com/cheton/infinite-tree#api-documentation)
* A rich set of [APIs](https://github.com/cheton/react-infinite-tree#api)

@@ -70,6 +70,12 @@ ## Browser Support

height={400}
rowHeight={30}
rowHeight={({ node, tree }) => {
// Returns zero height to filter out nodes
if (node.state.filtered === false) {
return 0;
}
return 30;
}}
data={props.data}
>
{({ tree, node }) => {
{({ node, tree }) => {
// Determine the toggle state

@@ -189,4 +195,4 @@ let toggleState = '';

height \* | Number or String | | Height of the tree.
rowHeight \* | Number, Array, or Function(index: Number): Number | | Either a fixed height, an array containing the heights of all the rows, or a function that returns the height of a row given its index.
rowRenderer | Function({ node: Node, tree: Tree }): React Node | | A row renderer for rendering a tree node.
rowHeight \* | Number, Array, or Function({ node: Node, tree: Tree, index: Number }): Number | | Either a fixed height, an array containing the heights of all the rows, or a function that returns the height of the given node.
rowRenderer | Function({ node: Node, tree: Tree, index: Number }): React Node | | A row renderer for rendering a tree node.
loadNodes | Function(parentNode: Node, done: Function) | | Loads nodes on demand.

@@ -214,4 +220,33 @@ shouldSelectNode | Function(node: Node): Boolean | | Provides a function to determine if a node can be selected or deselected. The function must return `true` or `false`. This function will not take effect if `selectable` is not `true`.

### Node State
Name | Type | Description
:--- | :--- | :----------
depth | Number | The depth of a node.
open | Boolean | Whether the node is expanded.
path | String | A unique path string representing a node.
prefixMask | String | The prefix mask.
total | Number | The total number of child nodes.
#### Flat Tree Structure
https://github.com/cheton/flattree/blob/master/examples/tree1.js
```
<root>: path=".0", parent="", children=2, total=11, depth=0, prefix="0", open=1, lastChild=1
Alpha: path=".0.0", parent=".0", children=0, total=0, depth=1, prefix="00", open=0, lastChild=0
Bravo: path=".0.1", parent=".0", children=3, total=9, depth=1, prefix="00", open=1, lastChild=1
Charlie: path=".0.1.0", parent=".0.1", children=2, total=4, depth=2, prefix="000", open=1, lastChild=0
Delta: path=".0.1.0.0", parent=".0.1.0", children=2, total=2, depth=3, prefix="0001", open=1, lastChild=0
Echo: path=".0.1.0.0.0", parent=".0.1.0.0", children=0, total=0, depth=4, prefix="00011", open=0, lastChild=0
Foxtrot: path=".0.1.0.0.1", parent=".0.1.0.0", children=0, total=0, depth=4, prefix="00011", open=0, lastChild=1
Golf: path=".0.1.0.1", parent=".0.1.0", children=0, total=0, depth=3, prefix="0001", open=0, lastChild=1
Hotel: path=".0.1.1", parent=".0.1", children=1, total=2, depth=2, prefix="000", open=1, lastChild=0
India: path=".0.1.1.0", parent=".0.1.1", children=1, total=1, depth=3, prefix="0001", open=1, lastChild=1
Juliet: path=".0.1.1.0.0", parent=".0.1.1.0", children=0, total=0, depth=4, prefix="00010", open=0, lastChild=1
Kilo: path=".0.1.2", parent=".0.1", children=0, total=0, depth=2, prefix="000", open=0, lastChild=1
```
## License
MIT

@@ -125,2 +125,22 @@ import PropTypes from 'prop-types';

// Filters nodes.
// https://github.com/cheton/infinite-tree/wiki/Functions:-Tree#filterpredicate-options
const treeFilter = this.tree.filter.bind(this.tree);
this.tree.filter = (...args) => {
setTimeout(() => {
this.virtualList.recomputeSizes(0);
}, 0);
return treeFilter(...args);
};
// Unfilter nodes.
// https://github.com/cheton/infinite-tree/wiki/Functions:-Tree#unfilter
const treeUnfilter = this.tree.unfilter.bind(this.tree);
this.tree.unfilter = (...args) => {
setTimeout(() => {
this.virtualList.recomputeSizes(0);
}, 0);
return treeUnfilter(...args);
};
// Sets the current scroll position to this node.

@@ -257,12 +277,29 @@ // @param {Node} node The Node object.

itemCount={count}
itemSize={rowHeight}
renderItem={({ index, style }) => {
let row = null;
if (typeof render === 'function' && this.tree && this.tree.nodes.length > 0) {
row = render({
itemSize={(index) => {
let height = rowHeight;
if (typeof rowHeight === 'function') {
height = rowHeight({
node: this.tree.nodes[index],
tree: this.tree,
node: this.tree.nodes[index]
index: index
});
}
return height;
}}
renderItem={({ index, style }) => {
let row = null;
if (typeof render === 'function') {
const node = this.tree.nodes[index];
if (node && node.state.filtered !== false) {
row = render({
node: this.tree.nodes[index],
tree: this.tree,
index: index
});
}
}
return (

@@ -269,0 +306,0 @@ <div key={index} style={style}>

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

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc