UNPKG

react-tree-dropdown-

Version:

Lightweight, customizable and fast Dropdown Tree Select component for React

36 lines (34 loc) 42.8 kB
!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=8)}([function(e,t,n){e.exports=n(14)()},function(t,n){t.exports=e},function(e,t,n){var r; /*! Copyright (c) 2017 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ /*! Copyright (c) 2017 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ !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?(o.default=o,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){},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),l=n(1),s=n.n(l),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}),p=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){var t=e.className;return!(!t||!t.indexOf)&&e.className.indexOf(n)>=0})},h=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)}},d=n(7),f=n.n(d),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 b=o.a.bind(f.a),v=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,l["PureComponent"]),g(t,[{key:"render",value:function(){var e=this.props,t=e.label,n=e.originalObject,r=e.readOnly,o=e.tagRenderer;return o?o(n,this.handleClick):s.a.createElement("span",{className:b("tag")},t,s.a.createElement("button",{onClick:r?void 0:this.handleClick,className:b("tag-remove",{readOnly:r}),type:"button"},"x"))}}]),t}();v.propTypes={id:i.a.string.isRequired,label:i.a.string.isRequired,originalObject:i.a.object,onDelete:i.a.func,tagRenderer:i.a.func,readOnly:i.a.bool};var m=v,w=n(6),O=n.n(w),T=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}}(),_=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 S=o.a.bind(O.a),k=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=h(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,l["PureComponent"]),T(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,l=e.onBlur,u=e.disabled,p=e.readOnly,h=e.tagRenderer;return s.a.createElement("ul",{className:S("tag-list")},function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],n=arguments[2],r=arguments[3];return e.map(function(e){var o=e._id,a=e.label,i=e.tagClassName,l=e.dataset;return s.a.createElement("li",_({className:S("tag-item",i),key:"tag-item-"+o},c(l)),s.a.createElement(m,{label:a,id:o,originalObject:e,onDelete:t,readOnly:n,tagRenderer:r}))})}(t,n,p,h),s.a.createElement("li",{className:S("tag-item")},s.a.createElement("input",{type:"text",disabled:u,ref:r,className:S("search"),placeholder:a,onChange:this.handleInputChange,onFocus:i,onBlur:l,readOnly:p})))}}]),t}();k.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,disabled:i.a.bool,readOnly:i.a.bool};var C=k,P=function(e,t){return(P=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])})(e,t)}; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */var E=function(){return(E=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};var j={Pixel:"Pixel",Percent:"Percent"},x={unit:j.Percent,value:.8};function N(e){return"number"==typeof e?{unit:j.Percent,value:100*e}:"string"==typeof e?e.match(/^(\d*(\.\d+)?)px$/)?{unit:j.Pixel,value:parseFloat(e)}:e.match(/^(\d*(\.\d+)?)%$/)?{unit:j.Percent,value:parseFloat(e)}:(console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...'),x):(console.warn("scrollThreshold should be string or number"),x)}var R=function(e){function t(t){var n=e.call(this,t)||this;return n.lastScrollTop=0,n.actionTriggered=!1,n.startY=0,n.currentY=0,n.dragging=!1,n.maxPullDownDistance=0,n.getScrollableTarget=function(){return n.props.scrollableTarget instanceof HTMLElement?n.props.scrollableTarget:"string"==typeof n.props.scrollableTarget?document.getElementById(n.props.scrollableTarget):(null===n.props.scrollableTarget&&console.warn("You are trying to pass scrollableTarget but it is null. This might\n happen because the element may not have been added to DOM yet.\n See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info.\n "),null)},n.onStart=function(e){n.lastScrollTop||(n.dragging=!0,e instanceof MouseEvent?n.startY=e.pageY:e instanceof TouchEvent&&(n.startY=e.touches[0].pageY),n.currentY=n.startY,n._infScroll&&(n._infScroll.style.willChange="transform",n._infScroll.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)"))},n.onMove=function(e){n.dragging&&(e instanceof MouseEvent?n.currentY=e.pageY:e instanceof TouchEvent&&(n.currentY=e.touches[0].pageY),n.currentY<n.startY||(n.currentY-n.startY>=Number(n.props.pullDownToRefreshThreshold)&&n.setState({pullToRefreshThresholdBreached:!0}),n.currentY-n.startY>1.5*n.maxPullDownDistance||n._infScroll&&(n._infScroll.style.overflow="visible",n._infScroll.style.transform="translate3d(0px, "+(n.currentY-n.startY)+"px, 0px)")))},n.onEnd=function(){n.startY=0,n.currentY=0,n.dragging=!1,n.state.pullToRefreshThresholdBreached&&(n.props.refreshFunction&&n.props.refreshFunction(),n.setState({pullToRefreshThresholdBreached:!1})),requestAnimationFrame(function(){n._infScroll&&(n._infScroll.style.overflow="auto",n._infScroll.style.transform="none",n._infScroll.style.willChange="unset")})},n.onScrollListener=function(e){"function"==typeof n.props.onScroll&&setTimeout(function(){return n.props.onScroll&&n.props.onScroll(e)},0);var t=n.props.height||n._scrollableNode?e.target:document.documentElement.scrollTop?document.documentElement:document.body;n.actionTriggered||((n.props.inverse?n.isElementAtTop(t,n.props.scrollThreshold):n.isElementAtBottom(t,n.props.scrollThreshold))&&n.props.hasMore&&(n.actionTriggered=!0,n.setState({showLoader:!0}),n.props.next&&n.props.next()),n.lastScrollTop=t.scrollTop)},n.state={showLoader:!1,pullToRefreshThresholdBreached:!1,prevDataLength:t.dataLength},n.throttledOnScrollListener=function(e,t,n,r){var o,a=!1,i=0;function l(){o&&clearTimeout(o)}function s(){var s=this,c=Date.now()-i,u=arguments;function p(){i=Date.now(),n.apply(s,u)}a||(r&&!o&&p(),l(),void 0===r&&c>e?p():!0!==t&&(o=setTimeout(r?function(){o=void 0}:p,void 0===r?e-c:e)))}return"boolean"!=typeof t&&(r=n,n=t,t=void 0),s.cancel=function(){l(),a=!0},s}(150,n.onScrollListener).bind(n),n.onStart=n.onStart.bind(n),n.onMove=n.onMove.bind(n),n.onEnd=n.onEnd.bind(n),n}return function(e,t){function n(){this.constructor=e}P(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){if(void 0===this.props.dataLength)throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');if(this._scrollableNode=this.getScrollableTarget(),this.el=this.props.height?this._infScroll:this._scrollableNode||window,this.el&&this.el.addEventListener("scroll",this.throttledOnScrollListener),"number"==typeof this.props.initialScrollY&&this.el&&this.el instanceof HTMLElement&&this.el.scrollHeight>this.props.initialScrollY&&this.el.scrollTo(0,this.props.initialScrollY),this.props.pullDownToRefresh&&this.el&&(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&&this._pullDown.firstChild&&this._pullDown.firstChild.getBoundingClientRect().height||0,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\'')},t.prototype.componentWillUnmount=function(){this.el&&(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)))},t.prototype.componentDidUpdate=function(e){this.props.dataLength!==e.dataLength&&(this.actionTriggered=!1,this.setState({showLoader:!1}))},t.getDerivedStateFromProps=function(e,t){return e.dataLength!==t.prevDataLength?E(E({},t),{prevDataLength:e.dataLength}):null},t.prototype.isElementAtTop=function(e,t){void 0===t&&(t=.8);var n=e===document.body||e===document.documentElement?window.screen.availHeight:e.clientHeight,r=N(t);return r.unit===j.Pixel?e.scrollTop<=r.value+n-e.scrollHeight+1:e.scrollTop<=r.value/100+n-e.scrollHeight+1},t.prototype.isElementAtBottom=function(e,t){void 0===t&&(t=.8);var n=e===document.body||e===document.documentElement?window.screen.availHeight:e.clientHeight,r=N(t);return r.unit===j.Pixel?e.scrollTop+n>=e.scrollHeight-r.value:e.scrollTop+n>=r.value/100*e.scrollHeight},t.prototype.render=function(){var e=this,t=E({height:this.props.height||"auto",overflow:"auto",WebkitOverflowScrolling:"touch"},this.props.style),n=this.props.hasChildren||!!(this.props.children&&this.props.children instanceof Array&&this.props.children.length),r=this.props.pullDownToRefresh&&this.props.height?{overflow:"auto"}:{};return s.a.createElement("div",{style:r,className:"infinite-scroll-component__outerdiv"},s.a.createElement("div",{className:"infinite-scroll-component "+(this.props.className||""),ref:function(t){return e._infScroll=t},style:t},this.props.pullDownToRefresh&&s.a.createElement("div",{style:{position:"relative"},ref:function(t){return e._pullDown=t}},s.a.createElement("div",{style:{position:"absolute",left:0,right:0,top:-1*this.maxPullDownDistance}},this.state.pullToRefreshThresholdBreached?this.props.releaseToRefreshContent:this.props.pullDownToRefreshContent)),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}(l.Component),M=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 D(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 L=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=D(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.handleClick=function(){r.props.onAction(r.props.actionData)},D(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,l["PureComponent"]),M(t,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.className,r=e.text,o=e.readOnly;return s.a.createElement("i",{title:t,className:n,onClick:o?void 0:this.handleClick},r)}}]),t}();L.propTypes={title:i.a.string,text:i.a.string,className:i.a.string,actionData:i.a.object,onAction:i.a.func,readOnly:i.a.bool},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){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,l["PureComponent"]),B(t,[{key:"render",value:function(){var e=this.props,t=e.actions,n=e.id,r=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,["actions","id"]);return u(t)?null:t.map(function(e,t){var o=e.id||"action-"+t;return s.a.createElement(I,A({key:o},r,e,{actionData:{action:o,id:n}}))})}}]),t}();Y.propTypes={id:i.a.string.isRequired,actions:i.a.array};var V=Y,F=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},H=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 q(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 z=function(e){var t=e.checked,n=e.indeterminate;return function(e){e&&(e.checked=t,e.indeterminate=n)}},W=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=q(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.handleChange=function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r.props.onChange(e)},q(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,l["PureComponent"]),H(t,[{key:"render",value:function(){var e=this.props,t=e.checked,n=e.indeterminate,r=void 0!==n&&n,o=(e.onChange,e.disabled),a=e.readOnly,i=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","disabled","readOnly"]),l=o||a;return s.a.createElement("input",F({type:"checkbox",ref:z({checked:t,indeterminate:r}),onChange:this.handleChange,disabled:l},i))}}]),t}();W.propTypes={checked:i.a.bool,indeterminate:i.a.bool,onChange:i.a.func,disabled:i.a.bool,readOnly:i.a.bool};var U=W,$=n(3),J=n.n($),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(J.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.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)},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,l["PureComponent"]),Z(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.path,l=e.checked,c=e.value,u=e.disabled,p=e.showPartiallySelected,h=e.readOnly,d=e.approved,f=e.nodeRenderer,g={className:"node-label"};return t&&!h&&(g.onClick=this.handleCheckboxChange),f?f({id:o,value:c,disabled:u,checked:l,path:i,refUpdater:z,approved:d,title:n||r,onChange:this.handleCheckboxChange,indeterminate:p&&a}):s.a.createElement("label",{title:n||r,htmlFor:o},s.a.createElement(U,{name:o,id:o,indeterminate:p&&a,className:K("checkbox-item",{"simple-select":t}),checked:l,onChange:this.handleCheckboxChange,value:c,disabled:u,readOnly:h}),s.a.createElement("span",g,r))}}]),t}();Q.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,readOnly:i.a.bool,approved:i.a.bool};var X=Q,ee=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 te(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 ne=o.a.bind(J.a),re=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=te(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.onToggle=function(){r.props.onNodeToggle(r.props.id)},te(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,l["PureComponent"]),ee(t,[{key:"render",value:function(){var e=this.props,t=e.expanded,n=e.isLeaf,r=e.iconRenderer,o=ne("toggle",{expanded:!n&&t,collapsed:!n&&!t});return r?r(o,this.onToggle):s.a.createElement("i",{className:o,onClick:this.onToggle})}}]),t}();re.propTypes={expanded:i.a.bool,isLeaf:i.a.bool,onNodeToggle:i.a.func,id:i.a.string,iconRenderer:i.a.func};var oe=re,ae=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},ie=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=o.a.bind(J.a),se=function(e){return u(e)},ce=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,l["PureComponent"]),ie(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,l=e.expanded,u=e.title,p=e.label,h=e.partial,d=e.checked,f=e.value,g=e.path,y=e.disabled,b=e.actions,v=e.onAction,m=e.searchModeOn,w=e.onNodeToggle,O=e.onCheckboxChange,T=e.showPartiallySelected,_=e.nodeRenderer,S=e.iconRenderer,k=e.readOnly,C=e.approved,P=function(e){var t=e.keepTreeOnSearch,n=e.keepChildrenOnSearch,r=e._children,o=e.matchInChildren,a=e.matchInParent,i=e.disabled,l=e.partial,s=e.hide,c=e.className,u=e.showPartiallySelected,p=e.readOnly;return le("node",{leaf:se(r),tree:!se(r),disabled:i,hide:s,"match-in-children":t&&o,"match-in-parent":t&&n&&a,partial:u&&l,readOnly:p},c)}(this.props),E=n||!m?{paddingLeft:20*(i||0)+"px"}:{};return s.a.createElement("li",ae({className:P,style:E},c(a)),s.a.createElement(oe,{isLeaf:se(o),expanded:l,id:r,onNodeToggle:w,iconRenderer:S}),s.a.createElement(X,{title:u,label:p,id:r,path:g,partial:h,checked:d,value:f,disabled:y,simpleSelect:t,onCheckboxChange:O,showPartiallySelected:T,nodeRenderer:_,readOnly:k,approved:C}),s.a.createElement(V,{actions:b,onAction:v,id:r,readOnly:k}))}}]),t}();ce.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,keepChildrenOnSearch: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,readOnly:i.a.bool,approved:i.a.bool};var ue=ce,pe=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},he=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 de=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 fe.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,l["Component"]),he(t,[{key:"render",value:function(){var e=this.props,t=e.searchModeOn,n=e.noItemsPlaceholder;return this.state.items.length>0?s.a.createElement("ul",{className:"root "+(t?"searchModeOn":""),ref:this.setNodeRef},this.state.scrollableTarget&&s.a.createElement(R,{dataLength:this.state.items.length,next:this.loadMore,hasMore:this.hasMore(),loader:null,scrollableTarget:this.state.scrollableTarget},this.state.items)):n}}]),t}();de.propTypes={data:i.a.object,keepTreeOnSearch:i.a.bool,keepChildrenOnSearch: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,readOnly:i.a.bool,noItemsPlaceholder:i.a.any},de.defaultProps={pageSize:100,noItemsPlaceholder:s.a.createElement("p",null,"The data contains no valid elements for display")};var fe=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&&e.node.parentNode?e.node.parentNode:null})},this.computeInstanceProps=function(t){e.allVisibleNodes=e.getNodes(t),e.totalPages=Math.ceil(e.allVisibleNodes.length/e.props.pageSize),e.currentPage=1},this.hasValidData=function(e){return!(!e||e.constructor!==Map)&&e.size>0},this.getNodes=function(t){var n=t.data,r=t.keepTreeOnSearch,o=t.searchModeOn,a=t.simpleSelect,i=t.showPartiallySelected,l=t.readOnly,c=t.nodeRenderer,u=t.iconRenderer,p=t.onAction,h=t.onChange,d=t.onCheckboxChange,f=t.onNodeToggle,g=t.keepChildrenOnSearch,y=[];return e.hasValidData(n)&&n.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,o,n)&&y.push(s.a.createElement(ue,pe({keepTreeOnSearch:r,keepChildrenOnSearch:g,key:e._id},e,{searchModeOn:o,onChange:h,onCheckboxChange:d,onNodeToggle:f,onAction:p,simpleSelect:a,showPartiallySelected:i,nodeRenderer:c,iconRenderer:u,readOnly:l})))}),y},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}},ge=de,ye=n(5),be=n.n(ye),ve=function(e){return e},me=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"children",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ve;return be()(e[t],function(e){return n(e).checked})||e[t].some(function(e){return n(e).partial})};var we=function(e,t,n,r){var o=function e(t){var n=t.nodes,r=t.list,o=void 0===r?new Map:r,a=t.parent,i=t.depth,l=void 0===i?0:i,s=t.simple,c=t.showPartialState,p=t.defaultValues,h=void 0===p?[]:p,d=t.hierarchical;return n.forEach(function(t,n){t._depth=l,a?(t._id=t.id||a._id+"-"+n,t._parent=a._id,a._children.push(t._id)):t._id=t.id||""+n,t.isDefaultValue&&(h.push(t._id),t.checked=!0),d||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),!s&&t.children&&(t._children=[],e({nodes:t.children,list:o,parent:t,depth:l+1,showPartialState:c,defaultValues:h,hierarchical:d}),c&&!t.checked&&(t.partial=me(t),!u(t.children)&&t.children.every(function(e){return e.checked})&&(t.checked=!0)),t.children=void 0)}),{list:o,defaultValues:h}}({nodes:Array.isArray(e)?e:[e],simple:t,showPartialState:n,hierarchical:r});return{list:o.list,defaultValues:o.defaultValues}},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}}();var Te=function(){function e(t){var n=t.data,r=t.simpleSelect,o=t.showPartiallySelected,a=t.hierarchical;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._src=n;var i=we(JSON.parse(JSON.stringify(n)),r,o,a),l=i.list,s=i.defaultValues;this.tree=l,this.defaultValues=s,this.simpleSelect=r,this.showPartialState=!a&&o,this.searchMaps=new Map,this.hierarchical=a}return Oe(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:"addParentsToTree",value:function(e,t){if(void 0!==e){var n=this.getNodeById(e);this.addParentsToTree(n._parent,t),n.hide=!0,n.matchInChildren=!0,t.set(e,n)}}},{key:"addChildrenToTree",value:function(e,t,n){var r=this;void 0!==e&&e.forEach(function(e){if(!n||!n.includes(e)){var o=r.getNodeById(e);o.matchInParent=!0,t.set(e,o),r.addChildrenToTree(o._children,t)}})}},{key:"filterTree",value:function(e,t,n){var r=this,o=this.getMatches(e.toLowerCase()),a=new Map;this.tree.forEach(function(e){e.hide=!0,e.matchInChildren=!1}),o.forEach(function(e){var i=r.getNodeById(e);i.hide=!1,t&&r.addParentsToTree(i._parent,a),a.set(e,i),t&&n&&r.addChildrenToTree(i._children,a,o)});var i=0===o.length;return this.matchTree=a,{allNodesHidden:i,tree:a}}},{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.hierarchical||this.toggleChildren(e,t),this.showPartialState&&this.partialCheckParents(n),this.hierarchical||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=me(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=me(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),e.hierarchical||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}(),_e=n(4),Se=n.n(_e),ke=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},Ce=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}}(); /*! * React Dropdown Tree Select * A lightweight, fast and highly customizable tree select component. * Hrusikesh Panda <hrusikesh.panda@dowjones.com> * Copyright (c) 2017 Dow Jones, Inc. <support@dowjones.com> (http://dowjones.com) * license MIT * see https://github.com/dowjones/react-dropdown-tree-select */ var Pe=o.a.bind(Se.a),Ee=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.createList=function(e){var t=e.data,r=e.simpleSelect,o=e.showPartiallySelected,a=e.hierarchical;return n.treeManager=new Te({data:t,simpleSelect:r,showPartiallySelected:o,hierarchical:a}),n.treeManager.tree},n.resetSearchState=function(){return n.searchInput.value="",{tree:n.treeManager.restoreNodes(),searchModeOn:!1,allNodesHidden:!1}},n.handleClick=function(){n.setState(function(e){var t=n.keepDropdownActive||!e.showDropdown;return t!==e.showDropdown&&(t?document.addEventListener("click",n.handleOutsideClick,!1):document.removeEventListener("click",n.handleOutsideClick,!1)),t?n.props.onFocus():n.props.onBlur(),t?{showDropdown:t}:ke({showDropdown:t},n.resetSearchState())})},n.handleOutsideClick=function(e){p(e,n.props.className)&&n.handleClick()},n.onInputChange=function(e){var t=n.treeManager.filterTree(e,n.props.keepTreeOnSearch,n.props.keepChildrenOnSearch),r=t.allNodesHidden,o=t.tree,a=e.length>0;n.setState({tree:o,searchModeOn:a,allNodesHidden:r})},n.onTagRemove=function(e){n.onCheckboxChange(e,!1)},n.onNodeToggle=function(e){n.treeManager.toggleNodeExpandState(e);var t=n.state.searchModeOn?n.treeManager.matchTree:n.treeManager.tree;n.setState({tree:t}),"function"==typeof n.props.onNodeToggle&&n.props.onNodeToggle(n.treeManager.getNodeById(e))},n.onCheckboxChange=function(e,t){n.treeManager.setNodeCheckedState(e,t);var r=n.treeManager.getTags(),o=!n.props.simpleSelect&&n.state.showDropdown;r.length||(n.treeManager.restoreDefaultValues(),r=n.treeManager.getTags());var a={tree:n.state.searchModeOn?n.treeManager.matchTree:n.treeManager.tree,tags:r,showDropdown:o};(n.props.simpleSelect||n.props.clearSearchOnChange)&&Object.assign(a,n.resetSearchState()),n.props.simpleSelect&&document.removeEventListener("click",n.handleOutsideClick,!1),n.setState(a),n.props.onChange(n.treeManager.getNodeById(e),r)},n.onAction=function(e,t){"function"==typeof n.props.onAction&&n.props.onAction(e,n.treeManager.getNodeById(t))},n.onInputFocus=function(){n.keepDropdownActive=!0},n.onInputBlur=function(){n.keepDropdownActive=!1},n.state={showDropdown:n.props.showDropdown||!1,searchModeOn:!1},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,l["Component"]),Ce(t,[{key:"componentWillMount",value:function(){var e=this.props,t=e.data,n=e.simpleSelect,r=e.showPartiallySelected,o=e.hierarchical,a=this.createList({data:t,simpleSelect:n,showPartiallySelected:r,hierarchical:o}),i=this.treeManager.getTags();this.setState({tree:a,tags:i})}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this.handleOutsideClick,!1)}},{key:"componentWillReceiveProps",value:function(e){var t=e.data,n=e.simpleSelect,r=e.showPartiallySelected,o=e.hierarchical,a=this.createList({data:t,simpleSelect:n,showPartiallySelected:r,hierarchical:o}),i=this.treeManager.getTags();this.setState({tree:a,tags:i})}},{key:"render",value:function(){var e=this,t=Pe({"dropdown-trigger":!0,arrow:!0,disabled:this.props.disabled,readOnly:this.props.readOnly,top:this.state.showDropdown,bottom:!this.state.showDropdown});return s.a.createElement("div",{className:Pe(this.props.className,"react-dropdown-tree-select"),ref:function(t){e.node=t}},s.a.createElement("div",{className:"dropdown"},s.a.createElement("a",{className:t,onClick:this.props.disabled?void 0:this.handleClick},s.a.createElement(C,{inputRef:function(t){e.searchInput=t},tags:this.state.tags,placeholderText:this.props.placeholderText,onInputChange:this.onInputChange,onFocus:this.onInputFocus,onBlur:this.onInputBlur,onTagRemove:this.onTagRemove,tagRenderer:this.props.tagRenderer,disabled:this.props.disabled,readOnly:this.props.readOnly})),this.state.showDropdown&&s.a.createElement("div",{className:Pe("dropdown-content")},this.state.allNodesHidden?s.a.createElement("span",{className:"no-matches"},this.props.noMatchesText||"No matches found"):s.a.createElement(ge,{data:this.state.tree,keepTreeOnSearch:this.props.keepTreeOnSearch,searchModeOn:this.state.searchModeOn,onAction:this.onAction,onCheckboxChange:this.onCheckboxChange,onNodeToggle:this.onNodeToggle,simpleSelect:this.props.simpleSelect,showPartiallySelected:this.props.showPartiallySelected,nodeRenderer:this.props.nodeRenderer,iconRenderer:this.props.iconRenderer,readOnly:this.props.readOnly,noItemsPlaceholder:this.props.noItemsPlaceholder,keepChildrenOnSearch:this.props.keepChildrenOnSearch}))))}}]),t}();Ee.propTypes={data:i.a.oneOfType([i.a.object,i.a.array]).isRequired,clearSearchOnChange:i.a.bool,keepTreeOnSearch:i.a.bool,placeholderText:i.a.string,showDropdown:i.a.bool,className:i.a.string,onChange:i.a.func,onAction:i.a.func,onNodeToggle:i.a.func,onFocus:i.a.func,onBlur:i.a.func,simpleSelect:i.a.bool,noMatchesText:i.a.string,showPartiallySelected:i.a.bool,nodeRenderer:i.a.func,iconRenderer:i.a.func,tagRenderer:i.a.func,disabled:i.a.bool,readOnly:i.a.bool,hierarchical:i.a.bool,noItemsPlaceholder:i.a.any,keepChildrenOnSearch:i.a.bool},Ee.defaultProps={onFocus:function(){},onBlur:function(){},onChange:function(){}};t.default=Ee},,,,,function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";var r=n(13);function o(){}e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var l=new Error("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");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=o,n.PropTypes=n,n}}])}); //# sourceMappingURL=react-dropdown-tree-select.js.map