react-tree-dropdown-
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -12,3 +12,3 @@ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define("ReactDropdownTreeSelect",["react"],t):"object"==typeof exports?exports.ReactDropdownTreeSelect=t(require("react")):e.ReactDropdownTreeSelect=t(e.React)}(this,function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=9)}([function(e,t,n){e.exports=n(17)()},function(t,n){t.exports=e},function(e,t,n){var r; | ||
*/ | ||
!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var a=typeof r;if("string"===a||"number"===a)e.push(this&&this[r]||r);else if(Array.isArray(r))e.push(o.apply(this,r));else if("object"===a)for(var i in r)n.call(r,i)&&r[i]&&e.push(this&&this[i]||i)}}return e.join(" ")}void 0!==e&&e.exports?e.exports=o:void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";e.exports=function(e,t){const n=e.filter(t);return 0!==n.length&&n.length!==e.length}},function(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}return n.m=e,n.c=t,n.p="",n(0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=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},o=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}}(),a=function(e,t,n){for(var r=!0;r;){var o=e,a=t,i=n;r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,a);if(void 0!==s){if("value"in s)return s.value;var l=s.get;if(void 0===l)return;return l.call(i)}var c=Object.getPrototypeOf(o);if(null===c)return;e=c,t=a,n=i,r=!0,s=c=void 0}};function i(e){return e&&e.__esModule?e:{default:e}}var s=n(7),l=i(s),c=i(n(5)),u=i(n(1)),h=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this.state={showLoader:!1,lastScrollTop:0,actionTriggered:!1,pullToRefreshThresholdBreached:!1},this.startY=0,this.currentY=0,this.dragging=!1,this.maxPullDownDistance=0,this.onScrollListener=this.onScrollListener.bind(this),this.throttledOnScrollListener=(0,u.default)(this.onScrollListener,150).bind(this),this.onStart=this.onStart.bind(this),this.onMove=this.onMove.bind(this),this.onEnd=this.onEnd.bind(this)}return function(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)}(t,s.Component),o(t,[{key:"componentDidMount",value:function(){if(this.el=this.props.height?this._infScroll:this.props.scrollableTarget||window,this.el.addEventListener("scroll",this.throttledOnScrollListener),"number"==typeof this.props.initialScrollY&&this.el.scrollHeight>this.props.initialScrollY&&this.el.scrollTo(0,this.props.initialScrollY),this.props.pullDownToRefresh&&(this.el.addEventListener("touchstart",this.onStart),this.el.addEventListener("touchmove",this.onMove),this.el.addEventListener("touchend",this.onEnd),this.el.addEventListener("mousedown",this.onStart),this.el.addEventListener("mousemove",this.onMove),this.el.addEventListener("mouseup",this.onEnd),this.maxPullDownDistance=this._pullDown.firstChild.getBoundingClientRect().height,this.forceUpdate(),"function"!=typeof this.props.refreshFunction))throw new Error('Mandatory prop "refreshFunction" missing.\n Pull Down To Refresh functionality will not work\n as expected. Check README.md for usage\'')}},{key:"componentWillUnmount",value:function(){this.el.removeEventListener("scroll",this.throttledOnScrollListener),this.props.pullDownToRefresh&&(this.el.removeEventListener("touchstart",this.onStart),this.el.removeEventListener("touchmove",this.onMove),this.el.removeEventListener("touchend",this.onEnd),this.el.removeEventListener("mousedown",this.onStart),this.el.removeEventListener("mousemove",this.onMove),this.el.removeEventListener("mouseup",this.onEnd))}},{key:"componentWillReceiveProps",value:function(e){this.props.dataLength!==e.dataLength&&this.setState({showLoader:!1,actionTriggered:!1,pullToRefreshThresholdBreached:!1})}},{key:"onStart",value:function(e){this.state.lastScrollTop||(this.dragging=!0,this.startY=e.pageY||e.touches[0].pageY,this.currentY=this.startY,this._infScroll.style.willChange="transform",this._infScroll.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)")}},{key:"onMove",value:function(e){this.dragging&&(this.currentY=e.pageY||e.touches[0].pageY,this.currentY<this.startY||(this.currentY-this.startY>=this.props.pullDownToRefreshThreshold&&this.setState({pullToRefreshThresholdBreached:!0}),this.currentY-this.startY>1.5*this.maxPullDownDistance||(this._infScroll.style.overflow="visible",this._infScroll.style.transform="translate3d(0px, "+(this.currentY-this.startY)+"px, 0px)")))}},{key:"onEnd",value:function(e){var t=this;this.startY=0,this.currentY=0,this.dragging=!1,this.state.pullToRefreshThresholdBreached&&this.props.refreshFunction&&this.props.refreshFunction(),requestAnimationFrame(function(){t._infScroll.style.overflow="auto",t._infScroll.style.transform="none",t._infScroll.style.willChange="none"})}},{key:"isElementAtBottom",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?.8:arguments[1],n=e===document.body||e===document.documentElement?window.screen.availHeight:e.clientHeight;return e.scrollTop+n>=t*e.scrollHeight}},{key:"onScrollListener",value:function(e){var t=this;"function"==typeof this.props.onScroll&&setTimeout(function(){return t.props.onScroll(e)},0);var n=this.props.height||this.props.scrollableTarget?e.target:document.documentElement.scrollTop?document.documentElement:document.body;this.state.actionTriggered||(this.isElementAtBottom(n,this.props.scrollThreshold)&&this.props.hasMore&&(this.setState({actionTriggered:!0,showLoader:!0}),this.props.next()),this.setState({lastScrollTop:n.scrollTop}))}},{key:"render",value:function(){var e=this,t=r({height:this.props.height||"auto",overflow:"auto",WebkitOverflowScrolling:"touch"},this.props.style),n=this.props.hasChildren||!(!this.props.children||!this.props.children.length),o=this.props.pullDownToRefresh&&this.props.height?{overflow:"auto"}:{};return l.default.createElement("div",{style:o},l.default.createElement("div",{className:"infinite-scroll-component",ref:function(t){return e._infScroll=t},style:t},this.props.pullDownToRefresh&&l.default.createElement("div",{style:{position:"relative"},ref:function(t){return e._pullDown=t}},l.default.createElement("div",{style:{position:"absolute",left:0,right:0,top:-1*this.maxPullDownDistance}},!this.state.pullToRefreshThresholdBreached&&this.props.pullDownToRefreshContent,this.state.pullToRefreshThresholdBreached&&this.props.releaseToRefreshContent)),this.props.children,!this.state.showLoader&&!n&&this.props.hasMore&&this.props.loader,this.state.showLoader&&this.props.hasMore&&this.props.loader,!this.props.hasMore&&this.props.endMessage))}}]),t}();t.default=h,h.defaultProps={pullDownToRefreshContent:l.default.createElement("h3",null,"Pull down to refresh"),releaseToRefreshContent:l.default.createElement("h3",null,"Release to refresh"),pullDownToRefreshThreshold:100,disableBrowserPullToRefresh:!0},h.propTypes={next:c.default.func,hasMore:c.default.bool,children:c.default.node,loader:c.default.node.isRequired,scrollThreshold:c.default.number,endMessage:c.default.node,style:c.default.object,height:c.default.number,scrollableTarget:c.default.node,hasChildren:c.default.bool,pullDownToRefresh:c.default.bool,pullDownToRefreshContent:c.default.node,releaseToRefreshContent:c.default.node,pullDownToRefreshThreshold:c.default.number,refreshFunction:c.default.func,onScroll:c.default.func,dataLength:c.default.number.isRequired},e.exports=t.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var r,o;return t||(t=250),function(){var a=n||this,i=+new Date,s=arguments;r&&i<r+t?(clearTimeout(o),o=setTimeout(function(){r=i,e.apply(a,s)},t)):(r=i,e.apply(a,s))}},e.exports=t.default},function(e,t){"use strict";function n(e){return function(){return e}}var r=function(){};r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,n){"use strict";var r=function(e){};e.exports=function(e,t,n,o,a,i,s,l){if(r(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,o,a,i,s,l],h=0;(c=new Error(t.replace(/%s/g,function(){return u[h++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}}},function(e,t,n){"use strict";var r=n(2),o=n(3),a=n(6);e.exports=function(){function e(e,t,n,r,i,s){s!==a&&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};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){e.exports=n(4)()},function(e,t){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,n){t.exports=e}])},e.exports=r(n(1))},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r=n(2),o=n.n(r),a=n(0),i=n.n(a),s=n(1),l=n.n(s),c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).reduce(function(t,n){var r;return t["data-"+(r=n,r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())]=e[n],t},{})},u=(function(){}(),function(e){return!e||Array.isArray(e)&&!e.length}),h=function(e,t){if(!(e instanceof Event))return!1;var n=t?t+" react-dropdown-tree-select":"react-dropdown-tree-select";return!function(e){if(e.path)return e.path;for(var t=e.target,n=[t];t.parentElement;)t=t.parentElement,n.unshift(t);return n}(e).some(function(e){return e.className&&e.className.indexOf(n)>=0})},p=function(e,t){var n=void 0;return function(){for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];var i=!n;clearTimeout(n),n=setTimeout(function(){n=null,e.apply(void 0,o)},t),i&&e.apply(void 0,o)}},f=n(8),d=n.n(f),g=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}}();function y(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}var v=o.a.bind(d.a),b=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,a=Array(o),i=0;i<o;i++)a[i]=arguments[i];return n=r=y(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.handleClick=function(e){var t=r.props,n=t.id,o=t.onDelete;e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o(n)},y(r,n)}return function(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)}(t,s["PureComponent"]),g(t,[{key:"render",value:function(){var e=this.props,t=e.label,n=e.tagRenderer;return n?n(t,this.handleClick):l.a.createElement("span",{className:v("tag")},t,l.a.createElement("button",{onClick:this.handleClick,className:v("tag-remove"),type:"button"},"x"))}}]),t}();b.propTypes={id:i.a.string.isRequired,label:i.a.string.isRequired,onDelete:i.a.func,tagRenderer:i.a.func};var m=b,w=n(7),O=n.n(w),_=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}}(),T=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};var k=o.a.bind(O.a),C=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleInputChange=function(e){e.persist(),n.delayedCallback(e)},n.delayedCallback=p(function(e){return n.props.onInputChange(e.target.value)},300),n}return function(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)}(t,s["PureComponent"]),_(t,[{key:"render",value:function(){var e=this.props,t=e.tags,n=e.onTagRemove,r=e.inputRef,o=e.placeholderText,a=void 0===o?"Choose...":o,i=e.onFocus,s=e.onBlur,u=e.tagRenderer;return l.a.createElement("ul",{className:k("tag-list")},function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],n=arguments[2];return e.map(function(e){var r=e._id,o=e.label,a=e.tagClassName,i=e.dataset;return l.a.createElement("li",T({className:k("tag-item",a),key:"tag-item-"+r},c(i)),l.a.createElement(m,{label:o,id:r,onDelete:t,tagRenderer:n}))})}(t,n,u),l.a.createElement("li",{className:k("tag-item")},l.a.createElement("input",{type:"text",ref:r,className:k("search"),placeholder:a,onChange:this.handleInputChange,onFocus:i,onBlur:s})))}}]),t}();C.propTypes={tags:i.a.array,placeholderText:i.a.string,onInputChange:i.a.func,onFocus:i.a.func,onBlur:i.a.func,onTagRemove:i.a.func,inputRef:i.a.func,tagRenderer:i.a.func};var S=C,P=n(6),E=n.n(P),R=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}}();function x(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}var j=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,a=Array(o),i=0;i<o;i++)a[i]=arguments[i];return n=r=x(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.handleClick=function(){r.props.onAction(r.props.actionData)},x(r,n)}return function(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)}(t,s["PureComponent"]),R(t,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.className,r=e.text;return l.a.createElement("i",{title:t,className:n,onClick:this.handleClick},r)}}]),t}();j.propTypes={title:i.a.string,text:i.a.string,className:i.a.string,actionData:i.a.object,onAction:i.a.func},j.defaultProps={onAction:function(){}};var N=j,M=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},D=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}}();var L=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,s["PureComponent"]),D(t,[{key:"render",value:function(){var e=this.props,t=e.actions,n=e.onAction,r=e.id;return u(t)?null:t.map(function(e,t){return l.a.createElement(N,M({key:"action-"+t},e,{actionData:{action:e.id,id:r},onAction:n}))})}}]),t}();L.propTypes={id:i.a.string.isRequired,actions:i.a.array,onAction:i.a.func},L.defaultProps={onAction:function(){}};var I=L,A=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},B=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}}();var Y=function(e){var t=e.checked,n=e.indeterminate;return function(e){e&&(e.checked=t,e.indeterminate=n)}},F=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,s["PureComponent"]),B(t,[{key:"render",value:function(){var e=this.props,t=e.checked,n=e.indeterminate,r=void 0!==n&&n,o=e.onChange,a=function(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}(e,["checked","indeterminate","onChange"]);return l.a.createElement("input",A({type:"checkbox",ref:Y({checked:t,indeterminate:r}),onChange:o},a))}}]),t}();F.propTypes={checked:i.a.bool,indeterminate:i.a.bool,onChange:i.a.func};var V=F,q=n(3),H=n.n(q),W=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}}();function z(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}var U=o.a.bind(H.a),J=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,a=Array(o),i=0;i<o;i++)a[i]=arguments[i];return n=r=z(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.handleCheckboxChange=function(e){var t=r.props,n=t.simpleSelect,o=t.id,a=t.onCheckboxChange;n?a(o,!0):a(o,e.target.checked)},z(r,n)}return function(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)}(t,s["PureComponent"]),W(t,[{key:"render",value:function(){var e=this.props,t=e.simpleSelect,n=e.title,r=e.label,o=e.id,a=e.partial,i=e.checked,s=e.value,c=e.disabled,u=e.showPartiallySelected,h=e.nodeRenderer,p={className:"node-label"};return t&&(p.onClick=this.handleCheckboxChange),h?h({id:o,value:s,disabled:c,checked:i,refUpdater:Y,title:n||r,onChange:this.handleCheckboxChange,indeterminate:u&&a}):l.a.createElement("label",{title:n||r,htmlFor:o},l.a.createElement(V,{name:o,id:o,indeterminate:u&&a,className:U("checkbox-item",{"simple-select":t}),checked:i,onChange:this.handleCheckboxChange,value:s,disabled:c}),l.a.createElement("span",p,r))}}]),t}();J.propTypes={id:i.a.string.isRequired,actions:i.a.array,title:i.a.string,label:i.a.string.isRequired,value:i.a.string.isRequired,checked:i.a.bool,partial:i.a.bool,expanded:i.a.bool,disabled:i.a.bool,dataset:i.a.object,simpleSelect:i.a.bool,showPartiallySelected:i.a.bool,onCheckboxChange:i.a.func,nodeRenderer:i.a.func};var $=J,Z=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}}();function G(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}var K=o.a.bind(H.a),Q=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,a=Array(o),i=0;i<o;i++)a[i]=arguments[i];return n=r=G(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.onToggle=function(){r.props.onNodeToggle(r.props.id)},G(r,n)}return function(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)}(t,s["PureComponent"]),Z(t,[{key:"render",value:function(){var e=this.props,t=e.expanded,n=e.isLeaf,r=e.iconRenderer,o=K("toggle",{expanded:!n&&t,collapsed:!n&&!t});return r?r(o,this.onToggle):l.a.createElement("i",{className:o,onClick:this.onToggle})}}]),t}();Q.propTypes={expanded:i.a.bool,isLeaf:i.a.bool,onNodeToggle:i.a.func,id:i.a.string,iconRenderer:i.a.func};var X=Q,ee=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},te=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}}();var ne=o.a.bind(H.a),re=function(e){return u(e)},oe=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,s["PureComponent"]),te(t,[{key:"render",value:function(){var e=this.props,t=e.simpleSelect,n=e.keepTreeOnSearch,r=e._id,o=e._children,a=e.dataset,i=e._depth,s=e.expanded,u=e.title,h=e.label,p=e.partial,f=e.checked,d=e.value,g=e.disabled,y=e.actions,v=e.onAction,b=e.searchModeOn,m=e.onNodeToggle,w=e.onCheckboxChange,O=e.showPartiallySelected,_=e.nodeRenderer,T=e.iconRenderer,k=function(e){var t=e.keepTreeOnSearch,n=e._children,r=e.matchInChildren,o=e.disabled,a=e.partial,i=e.hide,s=e.className,l=e.showPartiallySelected;return ne("node",{leaf:re(n),tree:!re(n),disabled:o,hide:i,"match-in-children":t&&r,partial:l&&a},s)}(this.props),C=n||!b?{paddingLeft:20*(i||0)+"px"}:{};return l.a.createElement("li",ee({className:k,style:C},c(a)),l.a.createElement(X,{isLeaf:re(o),expanded:s,id:r,onNodeToggle:m,iconRenderer:T}),l.a.createElement($,{title:u,label:h,id:r,partial:p,checked:f,value:d,disabled:g,simpleSelect:t,onCheckboxChange:w,showPartiallySelected:O,nodeRenderer:_}),l.a.createElement(I,{actions:y,onAction:v,id:r}))}}]),t}();oe.propTypes={_id:i.a.string.isRequired,_depth:i.a.number,_children:i.a.array,actions:i.a.array,className:i.a.string,title:i.a.string,label:i.a.string.isRequired,value:i.a.string.isRequired,checked:i.a.bool,expanded:i.a.bool,disabled:i.a.bool,partial:i.a.bool,dataset:i.a.object,keepTreeOnSearch:i.a.bool,searchModeOn:i.a.bool,onNodeToggle:i.a.func,onAction:i.a.func,onCheckboxChange:i.a.func,simpleSelect:i.a.bool,showPartiallySelected:i.a.bool,nodeRenderer:i.a.func,iconRenderer:i.a.func};var ae=oe,ie=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},se=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}}();var le=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return ce.call(n),n.computeInstanceProps(e),n.state={items:n.allVisibleNodes.slice(0,n.props.pageSize)},n}return function(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)}(t,s["Component"]),se(t,[{key:"render",value:function(){var e=this.props.searchModeOn;return l.a.createElement("ul",{className:"root "+(e?"searchModeOn":""),ref:this.setNodeRef},this.state.scrollableTarget&&l.a.createElement(E.a,{dataLength:this.state.items.length,next:this.loadMore,hasMore:this.hasMore(),loader:l.a.createElement("span",{className:"searchLoader"},"Loading..."),scrollableTarget:this.state.scrollableTarget},this.state.items))}}]),t}();le.propTypes={data:i.a.object,keepTreeOnSearch:i.a.bool,searchModeOn:i.a.bool,onChange:i.a.func,onNodeToggle:i.a.func,onAction:i.a.func,onCheckboxChange:i.a.func,simpleSelect:i.a.bool,showPartiallySelected:i.a.bool,pageSize:i.a.number,nodeRenderer:i.a.func,iconRenderer:i.a.func},le.defaultProps={pageSize:100};var ce=function(){var e=this;this.componentWillReceiveProps=function(t){e.computeInstanceProps(t),e.setState({items:e.allVisibleNodes.slice(0,e.props.pageSize)})},this.componentDidMount=function(){e.setState({scrollableTarget:e.node.parentNode})},this.computeInstanceProps=function(t){e.allVisibleNodes=e.getNodes(t),e.totalPages=Math.ceil(e.allVisibleNodes.length/e.props.pageSize),e.currentPage=1},this.getNodes=function(e){var t=e.data,n=e.keepTreeOnSearch,r=e.searchModeOn,o=e.simpleSelect,a=e.showPartiallySelected,i=e.nodeRenderer,s=e.iconRenderer,c=e.onAction,u=e.onChange,h=e.onCheckboxChange,p=e.onNodeToggle,f=[];return t.forEach(function(e){(function(e,t,n){if(t||e.expanded)return!0;var r=e._parent&&n.get(e._parent);return!r||r.expanded})(e,r,t)&&f.push(l.a.createElement(ae,ie({keepTreeOnSearch:n,key:e._id},e,{searchModeOn:r,onChange:u,onCheckboxChange:h,onNodeToggle:p,onAction:c,simpleSelect:o,showPartiallySelected:a,nodeRenderer:i,iconRenderer:s})))}),f},this.hasMore=function(){return e.currentPage<=e.totalPages},this.loadMore=function(){e.currentPage=e.currentPage+1;var t=e.allVisibleNodes.slice(0,e.currentPage*e.props.pageSize);e.setState({items:t})},this.setNodeRef=function(t){e.node=t}},ue=le,he=n(5),pe=n.n(he),fe=function(e){return e},de=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"children",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:fe;return pe()(e[t],function(e){return n(e).checked})||e[t].some(function(e){return n(e).partial})};var ge=function(e,t,n){var r=function e(t){var n=t.nodes,r=t.list,o=void 0===r?new Map:r,a=t.parent,i=t.depth,s=void 0===i?0:i,l=t.simple,c=t.showPartialState,h=t.defaultValues,p=void 0===h?[]:h;return n.forEach(function(t,n){t._depth=s,a?(t._id=t.id||a._id+"-"+n,t._parent=a._id,a._children.push(t._id)):t._id=t.id||""+n,t.isDefaultValue&&(p.push(t._id),t.checked=!0),function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=["checked","disabled"],r=0;r<n.length;r++){var o=n[r];void 0===e[o]&&void 0!==t[o]&&(e[o]=t[o])}}(t,a),o.set(t._id,t),!l&&t.children&&(t._children=[],e({nodes:t.children,list:o,parent:t,depth:s+1,showPartialState:c,defaultValues:p}),c&&!t.checked&&(t.partial=de(t),!u(t.children)&&t.children.every(function(e){return e.checked})&&(t.checked=!0)),t.children=void 0)}),{list:o,defaultValues:p}}({nodes:Array.isArray(e)?e:[e],simple:t,showPartialState:n});return{list:r.list,defaultValues:r.defaultValues}},ye=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}}();var ve=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._src=t;var o=ge(JSON.parse(JSON.stringify(t)),n,r),a=o.list,i=o.defaultValues;this.tree=a,this.defaultValues=i,this.simpleSelect=n,this.showPartialState=r,this.searchMaps=new Map}return ye(e,[{key:"getNodeById",value:function(e){return this.tree.get(e)}},{key:"getMatches",value:function(e){var t=this;if(this.searchMaps.has(e))return this.searchMaps.get(e);var n=-1,r=e;this.searchMaps.forEach(function(t,o){e.startsWith(o)&&o.length>n&&(n=o.length,r=o)});var o=[];r!==e?this.searchMaps.get(r).forEach(function(n){var r=t.getNodeById(n);r.label.toLowerCase().indexOf(e)>=0&&o.push(r._id)}):this.tree.forEach(function(t){t.label.toLowerCase().indexOf(e)>=0&&o.push(t._id)});return this.searchMaps.set(e,o),o}},{key:"setChildMatchStatus",value:function(e){if(void 0!==e){var t=this.getNodeById(e);t.matchInChildren=!0,this.setChildMatchStatus(t._parent)}}},{key:"filterTree",value:function(e){var t=this,n=this.getMatches(e.toLowerCase());return this.tree.forEach(function(e){e.hide=!0,e.matchInChildren=!1}),n.forEach(function(e){var n=t.getNodeById(e);n.hide=!1,t.setChildMatchStatus(n._parent)}),{allNodesHidden:0===n.length,tree:this.tree}}},{key:"restoreNodes",value:function(){return this.tree.forEach(function(e){e.hide=!1}),this.tree}},{key:"restoreDefaultValues",value:function(){var e=this;return this.defaultValues.forEach(function(t){e.setNodeCheckedState(t,!0)}),this.tree}},{key:"togglePreviousChecked",value:function(e){var t=this.currentChecked;t&&t!==e&&(this.getNodeById(t).checked=!1),this.currentChecked=e}},{key:"setNodeCheckedState",value:function(e,t){var n=this.getNodeById(e);n.checked=t,this.showPartialState&&(n.partial=!1),this.simpleSelect?this.togglePreviousChecked(e):(this.toggleChildren(e,t),this.showPartialState&&this.partialCheckParents(n),t||this.unCheckParents(n))}},{key:"unCheckParents",value:function(e){for(var t=e._parent;t;){var n=this.getNodeById(t);n.checked=!1,n.partial=de(n,"_children",this.getNodeById.bind(this)),t=n._parent}}},{key:"partialCheckParents",value:function(e){for(var t=this,n=e._parent;n;){var r=this.getNodeById(n);r.checked=r._children.every(function(e){return t.getNodeById(e).checked}),r.partial=de(r,"_children",this.getNodeById.bind(this)),n=r._parent}}},{key:"toggleChildren",value:function(e,t){var n=this,r=this.getNodeById(e);r.checked=t,this.showPartialState&&(r.partial=!1),u(r._children)||r._children.forEach(function(e){return n.toggleChildren(e,t)})}},{key:"toggleNodeExpandState",value:function(e){var t=this.getNodeById(e);return t.expanded=!t.expanded,t.expanded||this.collapseChildren(t),this.tree}},{key:"collapseChildren",value:function(e){var t=this;e.expanded=!1,u(e._children)||e._children.forEach(function(e){return t.collapseChildren(t.getNodeById(e))})}},{key:"getTags",value:function(){var e=this,t=[],n={};return this.tree.forEach(function(r,o){n[o]||(r.checked?(t.push(r),function t(r){n[r._id]=!0,u(r._children)||r._children.forEach(function(n){return t(e.getNodeById(n))})}(r)):n[o]=!0)}),t}}]),e}(),be=n(4),me=n.n(be),we=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},Oe=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}}(); | ||
!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var a=typeof r;if("string"===a||"number"===a)e.push(this&&this[r]||r);else if(Array.isArray(r))e.push(o.apply(this,r));else if("object"===a)for(var i in r)n.call(r,i)&&r[i]&&e.push(this&&this[i]||i)}}return e.join(" ")}void 0!==e&&e.exports?e.exports=o:void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";e.exports=function(e,t){const n=e.filter(t);return 0!==n.length&&n.length!==e.length}},function(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}return n.m=e,n.c=t,n.p="",n(0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=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},o=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}}(),a=function(e,t,n){for(var r=!0;r;){var o=e,a=t,i=n;r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,a);if(void 0!==s){if("value"in s)return s.value;var l=s.get;if(void 0===l)return;return l.call(i)}var c=Object.getPrototypeOf(o);if(null===c)return;e=c,t=a,n=i,r=!0,s=c=void 0}};function i(e){return e&&e.__esModule?e:{default:e}}var s=n(7),l=i(s),c=i(n(5)),u=i(n(1)),h=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this.state={showLoader:!1,lastScrollTop:0,actionTriggered:!1,pullToRefreshThresholdBreached:!1},this.startY=0,this.currentY=0,this.dragging=!1,this.maxPullDownDistance=0,this.onScrollListener=this.onScrollListener.bind(this),this.throttledOnScrollListener=(0,u.default)(this.onScrollListener,150).bind(this),this.onStart=this.onStart.bind(this),this.onMove=this.onMove.bind(this),this.onEnd=this.onEnd.bind(this)}return function(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)}(t,s.Component),o(t,[{key:"componentDidMount",value:function(){if(this.el=this.props.height?this._infScroll:this.props.scrollableTarget||window,this.el.addEventListener("scroll",this.throttledOnScrollListener),"number"==typeof this.props.initialScrollY&&this.el.scrollHeight>this.props.initialScrollY&&this.el.scrollTo(0,this.props.initialScrollY),this.props.pullDownToRefresh&&(this.el.addEventListener("touchstart",this.onStart),this.el.addEventListener("touchmove",this.onMove),this.el.addEventListener("touchend",this.onEnd),this.el.addEventListener("mousedown",this.onStart),this.el.addEventListener("mousemove",this.onMove),this.el.addEventListener("mouseup",this.onEnd),this.maxPullDownDistance=this._pullDown.firstChild.getBoundingClientRect().height,this.forceUpdate(),"function"!=typeof this.props.refreshFunction))throw new Error('Mandatory prop "refreshFunction" missing.\n Pull Down To Refresh functionality will not work\n as expected. Check README.md for usage\'')}},{key:"componentWillUnmount",value:function(){this.el.removeEventListener("scroll",this.throttledOnScrollListener),this.props.pullDownToRefresh&&(this.el.removeEventListener("touchstart",this.onStart),this.el.removeEventListener("touchmove",this.onMove),this.el.removeEventListener("touchend",this.onEnd),this.el.removeEventListener("mousedown",this.onStart),this.el.removeEventListener("mousemove",this.onMove),this.el.removeEventListener("mouseup",this.onEnd))}},{key:"componentWillReceiveProps",value:function(e){this.props.dataLength!==e.dataLength&&this.setState({showLoader:!1,actionTriggered:!1,pullToRefreshThresholdBreached:!1})}},{key:"onStart",value:function(e){this.state.lastScrollTop||(this.dragging=!0,this.startY=e.pageY||e.touches[0].pageY,this.currentY=this.startY,this._infScroll.style.willChange="transform",this._infScroll.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)")}},{key:"onMove",value:function(e){this.dragging&&(this.currentY=e.pageY||e.touches[0].pageY,this.currentY<this.startY||(this.currentY-this.startY>=this.props.pullDownToRefreshThreshold&&this.setState({pullToRefreshThresholdBreached:!0}),this.currentY-this.startY>1.5*this.maxPullDownDistance||(this._infScroll.style.overflow="visible",this._infScroll.style.transform="translate3d(0px, "+(this.currentY-this.startY)+"px, 0px)")))}},{key:"onEnd",value:function(e){var t=this;this.startY=0,this.currentY=0,this.dragging=!1,this.state.pullToRefreshThresholdBreached&&this.props.refreshFunction&&this.props.refreshFunction(),requestAnimationFrame(function(){t._infScroll.style.overflow="auto",t._infScroll.style.transform="none",t._infScroll.style.willChange="none"})}},{key:"isElementAtBottom",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?.8:arguments[1],n=e===document.body||e===document.documentElement?window.screen.availHeight:e.clientHeight;return e.scrollTop+n>=t*e.scrollHeight}},{key:"onScrollListener",value:function(e){var t=this;"function"==typeof this.props.onScroll&&setTimeout(function(){return t.props.onScroll(e)},0);var n=this.props.height||this.props.scrollableTarget?e.target:document.documentElement.scrollTop?document.documentElement:document.body;this.state.actionTriggered||(this.isElementAtBottom(n,this.props.scrollThreshold)&&this.props.hasMore&&(this.setState({actionTriggered:!0,showLoader:!0}),this.props.next()),this.setState({lastScrollTop:n.scrollTop}))}},{key:"render",value:function(){var e=this,t=r({height:this.props.height||"auto",overflow:"auto",WebkitOverflowScrolling:"touch"},this.props.style),n=this.props.hasChildren||!(!this.props.children||!this.props.children.length),o=this.props.pullDownToRefresh&&this.props.height?{overflow:"auto"}:{};return l.default.createElement("div",{style:o},l.default.createElement("div",{className:"infinite-scroll-component",ref:function(t){return e._infScroll=t},style:t},this.props.pullDownToRefresh&&l.default.createElement("div",{style:{position:"relative"},ref:function(t){return e._pullDown=t}},l.default.createElement("div",{style:{position:"absolute",left:0,right:0,top:-1*this.maxPullDownDistance}},!this.state.pullToRefreshThresholdBreached&&this.props.pullDownToRefreshContent,this.state.pullToRefreshThresholdBreached&&this.props.releaseToRefreshContent)),this.props.children,!this.state.showLoader&&!n&&this.props.hasMore&&this.props.loader,this.state.showLoader&&this.props.hasMore&&this.props.loader,!this.props.hasMore&&this.props.endMessage))}}]),t}();t.default=h,h.defaultProps={pullDownToRefreshContent:l.default.createElement("h3",null,"Pull down to refresh"),releaseToRefreshContent:l.default.createElement("h3",null,"Release to refresh"),pullDownToRefreshThreshold:100,disableBrowserPullToRefresh:!0},h.propTypes={next:c.default.func,hasMore:c.default.bool,children:c.default.node,loader:c.default.node.isRequired,scrollThreshold:c.default.number,endMessage:c.default.node,style:c.default.object,height:c.default.number,scrollableTarget:c.default.node,hasChildren:c.default.bool,pullDownToRefresh:c.default.bool,pullDownToRefreshContent:c.default.node,releaseToRefreshContent:c.default.node,pullDownToRefreshThreshold:c.default.number,refreshFunction:c.default.func,onScroll:c.default.func,dataLength:c.default.number.isRequired},e.exports=t.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var r,o;return t||(t=250),function(){var a=n||this,i=+new Date,s=arguments;r&&i<r+t?(clearTimeout(o),o=setTimeout(function(){r=i,e.apply(a,s)},t)):(r=i,e.apply(a,s))}},e.exports=t.default},function(e,t){"use strict";function n(e){return function(){return e}}var r=function(){};r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,n){"use strict";var r=function(e){};e.exports=function(e,t,n,o,a,i,s,l){if(r(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,o,a,i,s,l],h=0;(c=new Error(t.replace(/%s/g,function(){return u[h++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}}},function(e,t,n){"use strict";var r=n(2),o=n(3),a=n(6);e.exports=function(){function e(e,t,n,r,i,s){s!==a&&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};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){e.exports=n(4)()},function(e,t){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,n){t.exports=e}])},e.exports=r(n(1))},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r=n(2),o=n.n(r),a=n(0),i=n.n(a),s=n(1),l=n.n(s),c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).reduce(function(t,n){var r;return t["data-"+(r=n,r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())]=e[n],t},{})},u=(function(){}(),function(e){return!e||Array.isArray(e)&&!e.length}),h=function(e,t){if(!(e instanceof Event))return!1;var n=t?t+" react-dropdown-tree-select":"react-dropdown-tree-select";return!function(e){if(e.path)return e.path;for(var t=e.target,n=[t];t.parentElement;)t=t.parentElement,n.unshift(t);return n}(e).some(function(e){return e.className&&e.className.indexOf(n)>=0})},p=function(e,t){var n=void 0;return function(){for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];var i=!n;clearTimeout(n),n=setTimeout(function(){n=null,e.apply(void 0,o)},t),i&&e.apply(void 0,o)}},f=n(8),d=n.n(f),g=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}}();function y(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}var v=o.a.bind(d.a),b=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,a=Array(o),i=0;i<o;i++)a[i]=arguments[i];return n=r=y(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.handleClick=function(e){var t=r.props,n=t.id,o=t.onDelete;e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o(n)},y(r,n)}return function(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)}(t,s["PureComponent"]),g(t,[{key:"render",value:function(){var e=this.props,t=e.label,n=e.tagRenderer;return n?n(t,this.handleClick):l.a.createElement("span",{className:v("tag")},t,l.a.createElement("button",{onClick:this.handleClick,className:v("tag-remove"),type:"button"},"x"))}}]),t}();b.propTypes={id:i.a.string.isRequired,label:i.a.string.isRequired,onDelete:i.a.func,tagRenderer:i.a.func};var m=b,w=n(7),O=n.n(w),_=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}}(),T=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};var k=o.a.bind(O.a),C=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleInputChange=function(e){e.persist(),n.delayedCallback(e)},n.delayedCallback=p(function(e){return n.props.onInputChange(e.target.value)},300),n}return function(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)}(t,s["PureComponent"]),_(t,[{key:"render",value:function(){var e=this.props,t=e.tags,n=e.onTagRemove,r=e.inputRef,o=e.placeholderText,a=void 0===o?"Choose...":o,i=e.onFocus,s=e.onBlur,u=e.tagRenderer;return l.a.createElement("ul",{className:k("tag-list")},function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],n=arguments[2];return e.map(function(e){var r=e._id,o=e.label,a=e.tagClassName,i=e.dataset;return l.a.createElement("li",T({className:k("tag-item",a),key:"tag-item-"+r},c(i)),l.a.createElement(m,{label:o,id:r,onDelete:t,tagRenderer:n}))})}(t,n,u),l.a.createElement("li",{className:k("tag-item")},l.a.createElement("input",{type:"text",ref:r,className:k("search"),placeholder:a,onChange:this.handleInputChange,onFocus:i,onBlur:s})))}}]),t}();C.propTypes={tags:i.a.array,placeholderText:i.a.string,onInputChange:i.a.func,onFocus:i.a.func,onBlur:i.a.func,onTagRemove:i.a.func,inputRef:i.a.func,tagRenderer:i.a.func};var S=C,P=n(6),E=n.n(P),R=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}}();function x(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}var j=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,a=Array(o),i=0;i<o;i++)a[i]=arguments[i];return n=r=x(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.handleClick=function(){r.props.onAction(r.props.actionData)},x(r,n)}return function(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)}(t,s["PureComponent"]),R(t,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.className,r=e.text;return l.a.createElement("i",{title:t,className:n,onClick:this.handleClick},r)}}]),t}();j.propTypes={title:i.a.string,text:i.a.string,className:i.a.string,actionData:i.a.object,onAction:i.a.func},j.defaultProps={onAction:function(){}};var N=j,M=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},D=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}}();var L=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,s["PureComponent"]),D(t,[{key:"render",value:function(){var e=this.props,t=e.actions,n=e.onAction,r=e.id;return u(t)?null:t.map(function(e,t){return l.a.createElement(N,M({key:"action-"+t},e,{actionData:{action:e.id,id:r},onAction:n}))})}}]),t}();L.propTypes={id:i.a.string.isRequired,actions:i.a.array,onAction:i.a.func},L.defaultProps={onAction:function(){}};var I=L,A=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},B=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}}();var Y=function(e){var t=e.checked,n=e.indeterminate;return function(e){e&&(e.checked=t,e.indeterminate=n)}},F=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,s["PureComponent"]),B(t,[{key:"render",value:function(){var e=this.props,t=e.checked,n=e.indeterminate,r=void 0!==n&&n,o=e.onChange,a=function(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}(e,["checked","indeterminate","onChange"]);return l.a.createElement("input",A({type:"checkbox",ref:Y({checked:t,indeterminate:r}),onChange:o},a))}}]),t}();F.propTypes={checked:i.a.bool,indeterminate:i.a.bool,onChange:i.a.func};var V=F,q=n(3),H=n.n(q),W=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}}();function z(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}var U=o.a.bind(H.a),J=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,a=Array(o),i=0;i<o;i++)a[i]=arguments[i];return n=r=z(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.handleCheckboxChange=function(e){var t=r.props,n=t.simpleSelect,o=t.id,a=t.onCheckboxChange;n?a(o,!0):a(o,e.target.checked)},z(r,n)}return function(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)}(t,s["PureComponent"]),W(t,[{key:"render",value:function(){var e=this.props,t=e.simpleSelect,n=e.title,r=e.label,o=e.id,a=e.path,i=e.partial,s=e.checked,c=e.value,u=e.disabled,h=e.showPartiallySelected,p=e.nodeRenderer,f={className:"node-label"};return t&&(f.onClick=this.handleCheckboxChange),p?p({id:o,value:c,disabled:u,checked:s,path:a,refUpdater:Y,title:n||r,onChange:this.handleCheckboxChange,indeterminate:h&&i}):l.a.createElement("label",{title:n||r,htmlFor:o},l.a.createElement(V,{name:o,id:o,indeterminate:h&&i,className:U("checkbox-item",{"simple-select":t}),checked:s,onChange:this.handleCheckboxChange,value:c,disabled:u}),l.a.createElement("span",f,r))}}]),t}();J.propTypes={id:i.a.string.isRequired,actions:i.a.array,title:i.a.string,label:i.a.string.isRequired,value:i.a.string.isRequired,checked:i.a.bool,path:i.a.array,partial:i.a.bool,expanded:i.a.bool,disabled:i.a.bool,dataset:i.a.object,simpleSelect:i.a.bool,showPartiallySelected:i.a.bool,onCheckboxChange:i.a.func,nodeRenderer:i.a.func};var $=J,Z=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}}();function G(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}var K=o.a.bind(H.a),Q=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,a=Array(o),i=0;i<o;i++)a[i]=arguments[i];return n=r=G(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.onToggle=function(){r.props.onNodeToggle(r.props.id)},G(r,n)}return function(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)}(t,s["PureComponent"]),Z(t,[{key:"render",value:function(){var e=this.props,t=e.expanded,n=e.isLeaf,r=e.iconRenderer,o=K("toggle",{expanded:!n&&t,collapsed:!n&&!t});return r?r(o,this.onToggle):l.a.createElement("i",{className:o,onClick:this.onToggle})}}]),t}();Q.propTypes={expanded:i.a.bool,isLeaf:i.a.bool,onNodeToggle:i.a.func,id:i.a.string,iconRenderer:i.a.func};var X=Q,ee=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},te=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}}();var ne=o.a.bind(H.a),re=function(e){return u(e)},oe=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,s["PureComponent"]),te(t,[{key:"render",value:function(){var e=this.props,t=e.simpleSelect,n=e.keepTreeOnSearch,r=e._id,o=e._children,a=e.dataset,i=e._depth,s=e.expanded,u=e.title,h=e.label,p=e.partial,f=e.checked,d=e.value,g=e.path,y=e.disabled,v=e.actions,b=e.onAction,m=e.searchModeOn,w=e.onNodeToggle,O=e.onCheckboxChange,_=e.showPartiallySelected,T=e.nodeRenderer,k=e.iconRenderer,C=function(e){var t=e.keepTreeOnSearch,n=e._children,r=e.matchInChildren,o=e.disabled,a=e.partial,i=e.hide,s=e.className,l=e.showPartiallySelected;return ne("node",{leaf:re(n),tree:!re(n),disabled:o,hide:i,"match-in-children":t&&r,partial:l&&a},s)}(this.props),S=n||!m?{paddingLeft:20*(i||0)+"px"}:{};return l.a.createElement("li",ee({className:C,style:S},c(a)),l.a.createElement(X,{isLeaf:re(o),expanded:s,id:r,onNodeToggle:w,iconRenderer:k}),l.a.createElement($,{title:u,label:h,id:r,path:g,partial:p,checked:f,value:d,disabled:y,simpleSelect:t,onCheckboxChange:O,showPartiallySelected:_,nodeRenderer:T}),l.a.createElement(I,{actions:v,onAction:b,id:r}))}}]),t}();oe.propTypes={_id:i.a.string.isRequired,_depth:i.a.number,_children:i.a.array,actions:i.a.array,className:i.a.string,title:i.a.string,label:i.a.string.isRequired,value:i.a.string.isRequired,path:i.a.array,checked:i.a.bool,expanded:i.a.bool,disabled:i.a.bool,partial:i.a.bool,dataset:i.a.object,keepTreeOnSearch:i.a.bool,searchModeOn:i.a.bool,onNodeToggle:i.a.func,onAction:i.a.func,onCheckboxChange:i.a.func,simpleSelect:i.a.bool,showPartiallySelected:i.a.bool,nodeRenderer:i.a.func,iconRenderer:i.a.func};var ae=oe,ie=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},se=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}}();var le=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return ce.call(n),n.computeInstanceProps(e),n.state={items:n.allVisibleNodes.slice(0,n.props.pageSize)},n}return function(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)}(t,s["Component"]),se(t,[{key:"render",value:function(){var e=this.props.searchModeOn;return l.a.createElement("ul",{className:"root "+(e?"searchModeOn":""),ref:this.setNodeRef},this.state.scrollableTarget&&l.a.createElement(E.a,{dataLength:this.state.items.length,next:this.loadMore,hasMore:this.hasMore(),loader:l.a.createElement("span",{className:"searchLoader"},"Loading..."),scrollableTarget:this.state.scrollableTarget},this.state.items))}}]),t}();le.propTypes={data:i.a.object,keepTreeOnSearch:i.a.bool,searchModeOn:i.a.bool,onChange:i.a.func,onNodeToggle:i.a.func,onAction:i.a.func,onCheckboxChange:i.a.func,simpleSelect:i.a.bool,showPartiallySelected:i.a.bool,pageSize:i.a.number,nodeRenderer:i.a.func,iconRenderer:i.a.func},le.defaultProps={pageSize:100};var ce=function(){var e=this;this.componentWillReceiveProps=function(t){e.computeInstanceProps(t),e.setState({items:e.allVisibleNodes.slice(0,e.props.pageSize)})},this.componentDidMount=function(){e.setState({scrollableTarget:e.node.parentNode})},this.computeInstanceProps=function(t){e.allVisibleNodes=e.getNodes(t),e.totalPages=Math.ceil(e.allVisibleNodes.length/e.props.pageSize),e.currentPage=1},this.getNodes=function(e){var t=e.data,n=e.keepTreeOnSearch,r=e.searchModeOn,o=e.simpleSelect,a=e.showPartiallySelected,i=e.nodeRenderer,s=e.iconRenderer,c=e.onAction,u=e.onChange,h=e.onCheckboxChange,p=e.onNodeToggle,f=[];return t.forEach(function(e){(function(e,t,n){if(t||e.expanded)return!0;var r=e._parent&&n.get(e._parent);return!r||r.expanded})(e,r,t)&&f.push(l.a.createElement(ae,ie({keepTreeOnSearch:n,key:e._id},e,{searchModeOn:r,onChange:u,onCheckboxChange:h,onNodeToggle:p,onAction:c,simpleSelect:o,showPartiallySelected:a,nodeRenderer:i,iconRenderer:s})))}),f},this.hasMore=function(){return e.currentPage<=e.totalPages},this.loadMore=function(){e.currentPage=e.currentPage+1;var t=e.allVisibleNodes.slice(0,e.currentPage*e.props.pageSize);e.setState({items:t})},this.setNodeRef=function(t){e.node=t}},ue=le,he=n(5),pe=n.n(he),fe=function(e){return e},de=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"children",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:fe;return pe()(e[t],function(e){return n(e).checked})||e[t].some(function(e){return n(e).partial})};var ge=function(e,t,n){var r=function e(t){var n=t.nodes,r=t.list,o=void 0===r?new Map:r,a=t.parent,i=t.depth,s=void 0===i?0:i,l=t.simple,c=t.showPartialState,h=t.defaultValues,p=void 0===h?[]:h;return n.forEach(function(t,n){t._depth=s,a?(t._id=t.id||a._id+"-"+n,t._parent=a._id,a._children.push(t._id)):t._id=t.id||""+n,t.isDefaultValue&&(p.push(t._id),t.checked=!0),function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=["checked","disabled"],r=0;r<n.length;r++){var o=n[r];void 0===e[o]&&void 0!==t[o]&&(e[o]=t[o])}}(t,a),o.set(t._id,t),!l&&t.children&&(t._children=[],e({nodes:t.children,list:o,parent:t,depth:s+1,showPartialState:c,defaultValues:p}),c&&!t.checked&&(t.partial=de(t),!u(t.children)&&t.children.every(function(e){return e.checked})&&(t.checked=!0)),t.children=void 0)}),{list:o,defaultValues:p}}({nodes:Array.isArray(e)?e:[e],simple:t,showPartialState:n});return{list:r.list,defaultValues:r.defaultValues}},ye=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}}();var ve=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._src=t;var o=ge(JSON.parse(JSON.stringify(t)),n,r),a=o.list,i=o.defaultValues;this.tree=a,this.defaultValues=i,this.simpleSelect=n,this.showPartialState=r,this.searchMaps=new Map}return ye(e,[{key:"getNodeById",value:function(e){return this.tree.get(e)}},{key:"getMatches",value:function(e){var t=this;if(this.searchMaps.has(e))return this.searchMaps.get(e);var n=-1,r=e;this.searchMaps.forEach(function(t,o){e.startsWith(o)&&o.length>n&&(n=o.length,r=o)});var o=[];r!==e?this.searchMaps.get(r).forEach(function(n){var r=t.getNodeById(n);r.label.toLowerCase().indexOf(e)>=0&&o.push(r._id)}):this.tree.forEach(function(t){t.label.toLowerCase().indexOf(e)>=0&&o.push(t._id)});return this.searchMaps.set(e,o),o}},{key:"setChildMatchStatus",value:function(e){if(void 0!==e){var t=this.getNodeById(e);t.matchInChildren=!0,this.setChildMatchStatus(t._parent)}}},{key:"filterTree",value:function(e){var t=this,n=this.getMatches(e.toLowerCase());return this.tree.forEach(function(e){e.hide=!0,e.matchInChildren=!1}),n.forEach(function(e){var n=t.getNodeById(e);n.hide=!1,t.setChildMatchStatus(n._parent)}),{allNodesHidden:0===n.length,tree:this.tree}}},{key:"restoreNodes",value:function(){return this.tree.forEach(function(e){e.hide=!1}),this.tree}},{key:"restoreDefaultValues",value:function(){var e=this;return this.defaultValues.forEach(function(t){e.setNodeCheckedState(t,!0)}),this.tree}},{key:"togglePreviousChecked",value:function(e){var t=this.currentChecked;t&&t!==e&&(this.getNodeById(t).checked=!1),this.currentChecked=e}},{key:"setNodeCheckedState",value:function(e,t){var n=this.getNodeById(e);n.checked=t,this.showPartialState&&(n.partial=!1),this.simpleSelect?this.togglePreviousChecked(e):(this.toggleChildren(e,t),this.showPartialState&&this.partialCheckParents(n),t||this.unCheckParents(n))}},{key:"unCheckParents",value:function(e){for(var t=e._parent;t;){var n=this.getNodeById(t);n.checked=!1,n.partial=de(n,"_children",this.getNodeById.bind(this)),t=n._parent}}},{key:"partialCheckParents",value:function(e){for(var t=this,n=e._parent;n;){var r=this.getNodeById(n);r.checked=r._children.every(function(e){return t.getNodeById(e).checked}),r.partial=de(r,"_children",this.getNodeById.bind(this)),n=r._parent}}},{key:"toggleChildren",value:function(e,t){var n=this,r=this.getNodeById(e);r.checked=t,this.showPartialState&&(r.partial=!1),u(r._children)||r._children.forEach(function(e){return n.toggleChildren(e,t)})}},{key:"toggleNodeExpandState",value:function(e){var t=this.getNodeById(e);return t.expanded=!t.expanded,t.expanded||this.collapseChildren(t),this.tree}},{key:"collapseChildren",value:function(e){var t=this;e.expanded=!1,u(e._children)||e._children.forEach(function(e){return t.collapseChildren(t.getNodeById(e))})}},{key:"getTags",value:function(){var e=this,t=[],n={};return this.tree.forEach(function(r,o){n[o]||(r.checked?(t.push(r),function t(r){n[r._id]=!0,u(r._children)||r._children.forEach(function(n){return t(e.getNodeById(n))})}(r)):n[o]=!0)}),t}}]),e}(),be=n(4),me=n.n(be),we=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},Oe=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}}(); | ||
/*! | ||
@@ -15,0 +15,0 @@ * React Dropdown Tree Select |
{ | ||
"name": "react-tree-dropdown-", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "Lightweight, customizable and fast Dropdown Tree Select component for React", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
925690