ngx-tree-select
Version:
Angular component for select with tree items.
1 lines • 31.6 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@angular/core"),require("@angular/forms"),require("@angular/common")):"function"==typeof define&&define.amd?define(["@angular/core","@angular/forms","@angular/common"],e):"object"==typeof exports?exports.ngxTreeSelect=e(require("@angular/core"),require("@angular/forms"),require("@angular/common")):t.ngxTreeSelect=e(t["@angular/core"],t["@angular/forms"],t["@angular/common"])}(this,function(t,e,r){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e(e.s=17)}([function(e,r){e.exports=t},function(t,e,r){"use strict";r.d(e,"a",function(){return n});var n=function(){function t(){}return t.None="None",t.Selection="Selection",t.All="All",t}()},function(t,e,r){"use strict";r.d(e,"a",function(){return o});var n=r(0),i=(r.n(n),r(1)),o=function(){function t(){this.expandMode=i.a.None}return t.decorators=[{type:n.Injectable}],t.ctorParameters=function(){return[]},t}()},function(t,e,r){"use strict";r.d(e,"a",function(){return l}),r.d(e,"b",function(){return a});var n=r(0),i=(r.n(n),r(8)),o=(r.n(i),r(4)),s=r(2),c=r(1),u=function(){},l={provide:i.NG_VALUE_ACCESSOR,useExisting:Object(n.forwardRef)(function(){return a}),multi:!0},a=function(){function t(t,e){var r=this;this.svc=t,this.defaultOpts=e,this.onTouchedCallback=u,this.showMoreLink=!1,this.moreLoaded=!1,this.disabled=!1,this.placeholder="",this.filterPlaceholder="Type here for filtering items...",this.allowFilter=!0,this._isOpen=!1,this.onChangeCallback=u,this.haveFocus=!1,this.inputFocus=!1,this.clickedOutside=this.clickedOutside.bind(this),this.svc.modelChanged$.subscribe(function(t){r.onChangeCallback(t)}),this.maxVisibleItemCount=e.maxVisibleItemCount||0,this.allowParentSelection=void 0===e.allowParentSelection||null===e.allowParentSelection||e.allowParentSelection,this.allowFilter=void 0===e.allowFilter||null===e.allowFilter||e.allowFilter,this.filterCaseSensitive=void 0!==e.filterCaseSensitive&&null!==e.filterCaseSensitive&&e.filterCaseSensitive,this.filterPlaceholder=e.filterPlaceholder||"Type here for filtering items...",this.idField=e.idField||"id",this.textField=e.textField||"id",this.childrenField=e.childrenField||"",this.expandMode=e.expandMode||c.a.None}return Object.defineProperty(t.prototype,"items",{set:function(t){this.svc.setItems(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"idField",{set:function(t){this.svc.setConfiguration(function(e){return e.idProperty=t},!0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"textField",{set:function(t){this.svc.setConfiguration(function(e){return e.textProperty=t},!0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowParentSelection",{get:function(){return this.svc.Configuration.allowParentSelection},set:function(t){this.svc.setConfiguration(function(e){return e.allowParentSelection=t},!0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"restructureWhenChildSameName",{get:function(){return this.svc.Configuration.restructureWhenChildSameName},set:function(t){this.svc.setConfiguration(function(e){return e.restructureWhenChildSameName=t},!0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"childrenField",{set:function(t){this.svc.setConfiguration(function(e){return e.childProperty=t},!0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"multiple",{get:function(){return this.svc.Configuration.allowMultiple},set:function(t){this.svc.setConfiguration(function(e){return e.allowMultiple=t},!0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"filterCaseSensitive",{get:function(){return this.svc.Configuration.filterCaseSensitive},set:function(t){this.svc.setConfiguration(function(e){return e.filterCaseSensitive=t},!0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"expandMode",{get:function(){return this.svc.Configuration.expandMode},set:function(t){this.svc.setConfiguration(function(e){return e.expandMode=t},!0),this.svc.setExpand()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxVisibleItemCount",{get:function(){return this.svc.Configuration.maxVisibleItemCount},set:function(t){this.svc.setConfiguration(function(e){return e.maxVisibleItemCount=t},!0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"internalItems",{get:function(){return this.svc.getInternalItems()||[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.showMoreLink=this.maxVisibleItemCount>0&&this.svc.getInternalSelection().length-this.maxVisibleItemCount>0,this.svc.getInternalSelection()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"filter",{get:function(){return this.svc.Configuration.filter},set:function(t){this.svc.setConfiguration(function(e){return e.filter=t},!1);for(var e=0,r=this.internalItems;e<r.length;e++){var n=r[e];this.ProcessMatchFilterTreeItem(n,this.svc.Configuration.filter)}this.svc.setExpand()},enumerable:!0,configurable:!0}),t.prototype.keyUp=function(t){},t.prototype.toggle=function(t){t.preventDefault(),this.haveFocus=!0,this.svc.toggleOpen()},t.prototype.removeItem=function(t,e){t.stopPropagation(),this.svc.toggleItemSelection(e)},Object.defineProperty(t.prototype,"isOpen",{get:function(){return this.svc.Configuration.isOpen},enumerable:!0,configurable:!0}),t.prototype.clickedOutside=function(){this.inputFocus||((!this.haveFocus&&this.isOpen||this.haveFocus&&!this.isOpen)&&this.onTouched(),this.haveFocus=!1)},t.prototype.onTouched=function(){this.svc.close(),this.onTouchedCallback()},t.prototype.setInputFocus=function(){this.inputFocus=!0},t.prototype.setInputFocusOut=function(){this.inputFocus=!1},t.prototype.writeValue=function(t){this.svc.setSelection(t)},t.prototype.registerOnChange=function(t){this.onChangeCallback=t},t.prototype.registerOnTouched=function(t){this.onTouchedCallback=t},t.prototype.setDisabledState=function(t){this.disabled=t},t.prototype.loadMore=function(t){t.stopPropagation(),this.moreLoaded=!this.moreLoaded},t.prototype.ProcessMatchFilterTreeItem=function(t,e){var r=!1;if(t&&t.children&&t.children.length>0)for(var n=0,i=t.children;n<i.length;n++){var o=i[n];r=this.ProcessMatchFilterTreeItem(o,e)||r}return t.matchFilter=this.filterCaseSensitive?t.id.indexOf(e)>-1||t.text.indexOf(e)>-1||r:t.id.toLowerCase().indexOf(e.toLowerCase())>-1||t.text.toLowerCase().indexOf(e.toLowerCase())>-1||r,t.matchFilter},t.decorators=[{type:n.Component,args:[{selector:"tree-select",templateUrl:"./tree-select.component.html",providers:[l,o.a],styleUrls:["./tree-select.component.scss"]}]}],t.ctorParameters=function(){return[{type:o.a},{type:s.a}]},t.propDecorators={disabled:[{type:n.Input}],placeholder:[{type:n.Input}],filterPlaceholder:[{type:n.Input}],allowFilter:[{type:n.Input}],items:[{type:n.Input}],idField:[{type:n.Input}],textField:[{type:n.Input}],allowParentSelection:[{type:n.Input}],restructureWhenChildSameName:[{type:n.Input}],childrenField:[{type:n.Input}],multiple:[{type:n.Input}],filterCaseSensitive:[{type:n.Input}],expandMode:[{type:n.Input}],maxVisibleItemCount:[{type:n.Input}]},t}()},function(t,e,r){"use strict";r.d(e,"a",function(){return u});var n=r(19),i=(r.n(n),r(32)),o=r(33),s=r(0),c=(r.n(s),r(1)),u=function(){function t(){this.modelChanged$=new n.Subject,this._options=new o.a}return t.prototype.close=function(){this.Configuration.isOpen&&this.setConfiguration(function(t){return t.isOpen=!1},!1)},t.prototype.open=function(){this.Configuration.isOpen||this.setConfiguration(function(t){return t.isOpen=!0},!1)},t.prototype.toggleOpen=function(){this.setConfiguration(function(t){return t.isOpen=!t.isOpen},!1)},t.prototype.setItems=function(t){this.setConfiguration(function(e){return e.items=t},!0),this.setExpand()},t.prototype.getInternalItems=function(){return this._items},t.prototype.setSelection=function(t){this.setConfiguration(function(e){return e.model=t},!0),this.setExpand()},t.prototype.setSelectedItemOrChild=function(t,e){for(var r=0,n=t;r<n.length;r++){var i=n[r];i.hasChild?(i.id===e&&(i.selected=!0),this.setSelectedItemOrChild(i.children,e)):i.id===e&&(i.selected=!0)}},t.prototype.getSelection=function(){if(this.Configuration.allowMultiple)return this.getInternalSelection().map(function(t){return t.data});var t=this.getInternalSelection();return t&&t.length>0?t[0].data:null},t.prototype.getInternalSelection=function(){var t=this.getSelectedItems(this._items);if(t&&t.length>0)for(var e=0,r=this._options.maxVisibleItemCount?this._options.maxVisibleItemCount:0,n=0,i=t;n<i.length;n++){var o=i[n];o.isVisible=(e<r||0===r)&&(!o.hasChild||o.children.every(function(t){return!1===t.selected})),o.isVisible&&r>0&&e++}return t},t.prototype.toggleItemSelection=function(t){var e=this;this.Configuration.allowMultiple||this.setAllUnselected(this._items),t.selected=!t.selected,this.setConfiguration(function(t){return t.model=e.getSelection()},!1),this.Configuration.closeOnSelection&&this.setConfiguration(function(t){return t.isOpen=!1},!1)},t.prototype.setAllUnselected=function(t){for(var e=0,r=t;e<r.length;e++){var n=r[e];n.hasChild?(n.selected=!1,this.setAllUnselected(n.children)):n.selected=!1}},t.prototype.setConfiguration=function(t,e){var r=this._options.model;t(this._options),this._options.isValid()&&this.reconfigure(e),!e&&(r&&this._options.model!==r||!r&&this._options.model)&&this.modelChanged$.next(this._options.model)},Object.defineProperty(t.prototype,"Configuration",{get:function(){return this._options},enumerable:!0,configurable:!0}),t.prototype.setExpand=function(){this.setExpandForList(this._items)},t.prototype.setExpandForList=function(t){if(t)for(var e=0,r=t;e<r.length;e++){var n=r[e];this.setExpandForList(n.children),n.isOpen=this._options.filterExpandMode===c.a.All,this._options.filterExpandMode===c.a.Selection&&n.children&&(n.isOpen=n.children.some(function(t){return t.isOpen||t.selected}))}},t.prototype.toSelectableItems=function(t){var e=this;if(t&&Array.isArray(t)){var r=1;return t.map(function(t){var n;return t[e._options.idProperty]&&""!==t[e._options.idProperty]&&t[e._options.textProperty]?n=new i.a((t[e._options.idProperty]||"").toString(),t[e._options.textProperty],t,e):(n=new i.a(r.toString(),t,t,e),r++),e._options.isHierarchy()&&(n.children=e.toSelectableItems(t[e._options.childProperty])),n})}return[]},t.prototype.getSelectedItems=function(t){if(this.Configuration.isValid()){for(var e=[],r=0,n=t;r<n.length;r++){var i=n[r];i.hasChild&&!0===i.selected?e=i.children.every(function(t){return!1===t.selected})?e.concat([i]):e.concat(this.getSelectedItems(i.children)):i.hasChild?e=e.concat(this.getSelectedItems(i.children)):!0===i.selected&&(e=e.concat([i]))}return e}return[]},t.prototype.reconfigure=function(t){var e=this;if(this.Configuration.isValid()){this.checkConfig(),t&&(this._items=this.toSelectableItems(this.Configuration.items));var r=[];this.getModel().forEach(function(t){r=r.concat(e.getItemForModel(t,e._items))}),r.forEach(function(t){return t._selected=!0})}},t.prototype.checkConfig=function(){this.Configuration.allowMultiple&&this.Configuration.closeOnSelection?this.Configuration.closeOnSelection=!1:this.Configuration.allowMultiple||this.Configuration.closeOnSelection||(this.Configuration.closeOnSelection=!0)},t.prototype.getModel=function(){return this.Configuration.model?Array.isArray(this.Configuration.model)?this.Configuration.model:[this.Configuration.model]:[]},t.prototype.getItemForModel=function(t,e){for(var r=[],n=0,i=e;n<i.length;n++){var o=i[n];t&&("object"!=typeof t?o.data===t&&r.push(o):(t[this.Configuration.idProperty]&&o.id===(t[this.Configuration.idProperty]||"").toString()&&r.push(o),this.Configuration.isHierarchy()&&o.children&&o.children.length>0&&(r=r.concat(this.getItemForModel(t,o.children)))))}return r},t.decorators=[{type:s.Injectable}],t.ctorParameters=function(){return[]},t}()},function(t,e,r){"use strict";(function(t){var r="undefined"!=typeof window&&window,n="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,i=r||void 0!==t&&t||n;e.root=i,function(){if(!i)throw new Error("RxJS could not find any global context (window, self, global)")}()}).call(e,r(21))},function(t,e,r){"use strict";function n(t){return t.reduce(function(t,e){return t.concat(e instanceof l.UnsubscriptionError?e.errors:e)},[])}var i=r(23),o=r(24),s=r(10),c=r(25),u=r(11),l=r(26),a=function(){function t(t){this.closed=!1,this._parent=null,this._parents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}return t.prototype.unsubscribe=function(){var t,e=!1;if(!this.closed){var r=this,a=r._parent,h=r._parents,p=r._unsubscribe,f=r._subscriptions;this.closed=!0,this._parent=null,this._parents=null,this._subscriptions=null;for(var d=-1,b=h?h.length:0;a;)a.remove(this),a=++d<b&&h[d]||null;if(s.isFunction(p)&&(m=c.tryCatch(p).call(this))===u.errorObject&&(e=!0,t=t||(u.errorObject.e instanceof l.UnsubscriptionError?n(u.errorObject.e.errors):[u.errorObject.e])),i.isArray(f))for(d=-1,b=f.length;++d<b;){var y=f[d];if(o.isObject(y)){var m=c.tryCatch(y.unsubscribe).call(y);if(m===u.errorObject){e=!0,t=t||[];var g=u.errorObject.e;g instanceof l.UnsubscriptionError?t=t.concat(n(g.errors)):t.push(g)}}}if(e)throw new l.UnsubscriptionError(t)}},t.prototype.add=function(e){if(!e||e===t.EMPTY)return t.EMPTY;if(e===this)return this;var r=e;switch(typeof e){case"function":r=new t(e);case"object":if(r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if("function"!=typeof r._addParent){var n=r;(r=new t)._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}return(this._subscriptions||(this._subscriptions=[])).push(r),r._addParent(this),r},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var r=e.indexOf(t);-1!==r&&e.splice(r,1)}},t.prototype._addParent=function(t){var e=this,r=e._parent,n=e._parents;r&&r!==t?n?-1===n.indexOf(t)&&n.push(t):this._parents=[t]:this._parent=t},t.EMPTY=function(t){return t.closed=!0,t}(new t),t}();e.Subscription=a},function(t,e,r){"use strict";var n=r(5).root.Symbol;e.rxSubscriber="function"==typeof n&&"function"==typeof n.for?n.for("rxSubscriber"):"@@rxSubscriber",e.$$rxSubscriber=e.rxSubscriber},function(t,r){t.exports=e},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=r(10),o=r(6),s=r(12),c=r(7),u=function(t){function e(r,n,i){switch(t.call(this),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=s.empty;break;case 1:if(!r){this.destination=s.empty;break}if("object"==typeof r){r instanceof e?(this.destination=r,this.destination.add(this)):(this.syncErrorThrowable=!0,this.destination=new l(this,r));break}default:this.syncErrorThrowable=!0,this.destination=new l(this,r,n,i)}}return n(e,t),e.prototype[c.rxSubscriber]=function(){return this},e.create=function(t,r,n){var i=new e(t,r,n);return i.syncErrorThrowable=!1,i},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this,e=t._parent,r=t._parents;return this._parent=null,this._parents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parent=e,this._parents=r,this},e}(o.Subscription);e.Subscriber=u;var l=function(t){function e(e,r,n,o){t.call(this),this._parentSubscriber=e;var c,u=this;i.isFunction(r)?c=r:r&&(c=r.next,n=r.error,o=r.complete,r!==s.empty&&(u=Object.create(r),i.isFunction(u.unsubscribe)&&this.add(u.unsubscribe.bind(u)),u.unsubscribe=this.unsubscribe.bind(this))),this._context=u,this._next=c,this._error=n,this._complete=o}return n(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber;if(this._error)e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else{if(!e.syncErrorThrowable)throw this.unsubscribe(),t;e.syncErrorValue=t,e.syncErrorThrown=!0,this.unsubscribe()}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var r=function(){return t._complete.call(t._context)};e.syncErrorThrowable?(this.__tryOrSetError(e,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){throw this.unsubscribe(),t}},e.prototype.__tryOrSetError=function(t,e,r){try{e.call(this._context,r)}catch(e){return t.syncErrorValue=e,t.syncErrorThrown=!0,!0}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(u)},function(t,e,r){"use strict";e.isFunction=function(t){return"function"==typeof t}},function(t,e,r){"use strict";e.errorObject={e:{}}},function(t,e,r){"use strict";e.empty={closed:!0,next:function(t){},error:function(t){throw t},complete:function(){}}},function(t,e,r){"use strict";r.d(e,"a",function(){return i});var n=r(0),i=(r.n(n),function(){function t(){}return t.prototype.transform=function(t){return t.filter(function(t){return t.matchFilter})},t.decorators=[{type:n.Pipe,args:[{name:"itemPipe"}]}],t.ctorParameters=function(){return[]},t}())},function(t,e){t.exports=r},function(t,e,r){"use strict";r.d(e,"a",function(){return o});var n=r(0),i=(r.n(n),r(14)),o=(r.n(i),function(){function t(t){this.platformId=t}return t.prototype.ngOnInit=function(){var t=this;Object(i.isPlatformBrowser)(this.platformId)&&setTimeout(function(){document.addEventListener("click",t.offClickHandler)},0)},t.prototype.ngOnDestroy=function(){Object(i.isPlatformBrowser)(this.platformId)&&document.removeEventListener("click",this.offClickHandler)},t.decorators=[{type:n.Directive,args:[{selector:"[off-click]"}]}],t.ctorParameters=function(){return[{type:void 0,decorators:[{type:n.Inject,args:[n.PLATFORM_ID]}]}]},t.propDecorators={offClickHandler:[{type:n.Input,args:["off-click"]}]},t}())},function(t,e,r){"use strict";r.d(e,"a",function(){return o});var n=r(0),i=(r.n(n),r(4)),o=function(){function t(t){this.svc=t}return Object.defineProperty(t.prototype,"isOpen",{get:function(){return this.item.isOpen},enumerable:!0,configurable:!0}),t.prototype.toggleOpen=function(t){t.stopPropagation(),this.haveChildren?this.item.isOpen=!this.item.isOpen:this.select(t)},Object.defineProperty(t.prototype,"allowParentSelection",{get:function(){return this.svc.Configuration.allowParentSelection},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"restructureWhenChildSameName",{get:function(){return this.svc.Configuration.restructureWhenChildSameName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"needCheckBox",{get:function(){return this.svc.Configuration.isHierarchy()&&this.svc.Configuration.allowMultiple},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"haveChildren",{get:function(){return this.restructureWhenChildSameName&&this.item&&this.item.children&&1===this.item.children.length&&this.item.text===this.item.children[0].text&&(this.item=this.item.children[0]),this.item&&this.item.children&&this.item.children.length>0},enumerable:!0,configurable:!0}),t.prototype.select=function(t){t.stopPropagation(),(this.svc.Configuration.allowMultiple||!this.haveChildren||this.svc.Configuration.allowParentSelection)&&this.svc.toggleItemSelection(this.item),this.onTouchedCallBack()},Object.defineProperty(t.prototype,"filter",{get:function(){return this.svc.Configuration.filter},enumerable:!0,configurable:!0}),t.decorators=[{type:n.Component,args:[{selector:"tree-select-item",templateUrl:"./tree-select-item.component.html",styleUrls:["./tree-select-item.component.scss"]}]}],t.ctorParameters=function(){return[{type:i.a}]},t.propDecorators={onTouchedCallBack:[{type:n.Input}],item:[{type:n.Input}]},t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(18);r.d(e,"TreeSelectDefaultOptions",function(){return n.e}),r.d(e,"TreeSelectComponent",function(){return n.d}),r.d(e,"ItemPipe",function(){return n.b}),r.d(e,"NgxTreeSelectModule",function(){return n.c}),r.d(e,"ExpandMode",function(){return n.a});var i=r(16);r.d(e,"ɵc",function(){return i.a});var o=r(3);r.d(e,"ɵa",function(){return o.a});var s=r(15);r.d(e,"ɵd",function(){return s.a});var c=r(4);r.d(e,"ɵb",function(){return c.a})},function(t,e,r){"use strict";var n=r(2);r.d(e,"e",function(){return n.a});var i=r(3);r.d(e,"d",function(){return i.b});var o=r(13);r.d(e,"b",function(){return o.a});var s=r(34);r.d(e,"c",function(){return s.a});var c=r(1);r.d(e,"a",function(){return c.a})},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=r(20),o=r(9),s=r(6),c=r(30),u=r(31),l=r(7),a=function(t){function e(e){t.call(this,e),this.destination=e}return n(e,t),e}(o.Subscriber);e.SubjectSubscriber=a;var h=function(t){function e(){t.call(this),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}return n(e,t),e.prototype[l.rxSubscriber]=function(){return new a(this)},e.prototype.lift=function(t){var e=new p(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new c.ObjectUnsubscribedError;if(!this.isStopped)for(var e=this.observers,r=e.length,n=e.slice(),i=0;i<r;i++)n[i].next(t)},e.prototype.error=function(t){if(this.closed)throw new c.ObjectUnsubscribedError;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,r=e.length,n=e.slice(),i=0;i<r;i++)n[i].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new c.ObjectUnsubscribedError;this.isStopped=!0;for(var t=this.observers,e=t.length,r=t.slice(),n=0;n<e;n++)r[n].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new c.ObjectUnsubscribedError;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new c.ObjectUnsubscribedError;return this.hasError?(t.error(this.thrownError),s.Subscription.EMPTY):this.isStopped?(t.complete(),s.Subscription.EMPTY):(this.observers.push(t),new u.SubjectSubscription(this,t))},e.prototype.asObservable=function(){var t=new i.Observable;return t.source=this,t},e.create=function(t,e){return new p(t,e)},e}(i.Observable);e.Subject=h;var p=function(t){function e(e,r){t.call(this),this.destination=e,this.source=r}return n(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):s.Subscription.EMPTY},e}(h);e.AnonymousSubject=p},function(t,e,r){"use strict";var n=r(5),i=r(22),o=r(27),s=r(28),c=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,r){var n=this.operator,o=i.toSubscriber(t,e,r);if(n?n.call(o,this.source):o.add(this.source?this._subscribe(o):this._trySubscribe(o)),o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.syncErrorThrown=!0,t.syncErrorValue=e,t.error(e)}},t.prototype.forEach=function(t,e){var r=this;if(e||(n.root.Rx&&n.root.Rx.config&&n.root.Rx.config.Promise?e=n.root.Rx.config.Promise:n.root.Promise&&(e=n.root.Promise)),!e)throw new Error("no Promise impl found");return new e(function(e,n){var i;i=r.subscribe(function(e){if(i)try{t(e)}catch(t){n(t),i.unsubscribe()}else t(e)},n,e)})},t.prototype._subscribe=function(t){return this.source.subscribe(t)},t.prototype[o.observable]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return 0===t.length?this:s.pipeFromArray(t)(this)},t.prototype.toPromise=function(t){var e=this;if(t||(n.root.Rx&&n.root.Rx.config&&n.root.Rx.config.Promise?t=n.root.Rx.config.Promise:n.root.Promise&&(t=n.root.Promise)),!t)throw new Error("no Promise impl found");return new t(function(t,r){var n;e.subscribe(function(t){return n=t},function(t){return r(t)},function(){return t(n)})})},t.create=function(e){return new t(e)},t}();e.Observable=c},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";var n=r(9),i=r(7),o=r(12);e.toSubscriber=function(t,e,r){if(t){if(t instanceof n.Subscriber)return t;if(t[i.rxSubscriber])return t[i.rxSubscriber]()}return t||e||r?new n.Subscriber(t,e,r):new n.Subscriber(o.empty)}},function(t,e,r){"use strict";e.isArray=Array.isArray||function(t){return t&&"number"==typeof t.length}},function(t,e,r){"use strict";e.isObject=function(t){return null!=t&&"object"==typeof t}},function(t,e,r){"use strict";function n(){try{return i.apply(this,arguments)}catch(t){return o.errorObject.e=t,o.errorObject}}var i,o=r(11);e.tryCatch=function(t){return i=t,n}},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=function(t){function e(e){t.call(this),this.errors=e;var r=Error.call(this,e?e.length+" errors occurred during unsubscription:\n "+e.map(function(t,e){return e+1+") "+t.toString()}).join("\n "):"");this.name=r.name="UnsubscriptionError",this.stack=r.stack,this.message=r.message}return n(e,t),e}(Error);e.UnsubscriptionError=i},function(t,e,r){"use strict";function n(t){var e,r=t.Symbol;return"function"==typeof r?r.observable?e=r.observable:(e=r("observable"),r.observable=e):e="@@observable",e}var i=r(5);e.getSymbolObservable=n,e.observable=n(i.root),e.$$observable=e.observable},function(t,e,r){"use strict";function n(t){return t?1===t.length?t[0]:function(e){return t.reduce(function(t,e){return e(t)},e)}:i.noop}var i=r(29);e.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return n(t)},e.pipeFromArray=n},function(t,e,r){"use strict";e.noop=function(){}},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=function(t){function e(){var e=t.call(this,"object unsubscribed");this.name=e.name="ObjectUnsubscribedError",this.stack=e.stack,this.message=e.message}return n(e,t),e}(Error);e.ObjectUnsubscribedError=i},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=function(t){function e(e,r){t.call(this),this.subject=e,this.subscriber=r,this.closed=!1}return n(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var r=e.indexOf(this.subscriber);-1!==r&&e.splice(r,1)}}},e}(r(6).Subscription);e.SubjectSubscription=i},function(t,e,r){"use strict";r.d(e,"a",function(){return n});var n=function(){function t(t,e,r,n){this.id=t,this.text=e,this.data=r,this.svc=n,this._selected=!1,this.isOpen=!1,this.matchFilter=!0,this.isVisible=!1}return Object.defineProperty(t.prototype,"hasChild",{get:function(){return this.children&&this.children.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"checked",{get:function(){return this.hasChild&&this.svc.Configuration.allowMultiple?!!this.children.every(function(t){return t.selected})||(this.children.every(function(t){return!1===t.selected})?this._selected:null):this._selected},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selected",{get:function(){if(this.hasChild&&this.svc.Configuration.allowMultiple)return this.children.some(function(t){return t.selected})?(this.svc.Configuration.allowParentSelection&&(this._selected=!1),!0):!!this.children.every(function(t){return!1===t.selected})&&(this.svc.Configuration.allowParentSelection?this._selected:this._selected=!1);if(this.hasChild&&!0===this._selected)for(var t=0,e=this.children;t<e.length;t++)e[t].selected=!1;return this._selected},set:function(t){this.hasChild&&!this.svc.Configuration.allowParentSelection?null!==t&&this.children.forEach(function(e){return e.selected=t}):this._selected=t},enumerable:!0,configurable:!0}),t}()},function(t,e,r){"use strict";r.d(e,"a",function(){return i});var n=r(1),i=function(){function t(){this.idProperty="id",this.textProperty="text",this.childProperty=null,this.allowMultiple=!1,this.closeOnSelection=!0,this.items=[],this.isOpen=!1,this.filter="",this.filterCaseSensitive=!1,this.allowParentSelection=!1,this.restructureWhenChildSameName=!1,this.expandMode=n.a.None}return t.prototype.isHierarchy=function(){return this.childProperty&&this.childProperty.trim().length>0},Object.defineProperty(t.prototype,"filterExpandMode",{get:function(){return""!==this.filter?n.a.All:this.expandMode},enumerable:!0,configurable:!0}),t.prototype.displayCheckbox=function(){return this.allowMultiple&&this.isHierarchy()},t.prototype.isValid=function(){return this.idProperty&&this.idProperty.trim().length>0&&this.textProperty&&this.textProperty.trim().length>0&&this.items&&Array.isArray(this.items)&&this.items.length>0},t}()},function(t,e,r){"use strict";r.d(e,"a",function(){return h});var n=r(14),i=(r.n(n),r(8)),o=(r.n(i),r(13)),s=r(0),c=(r.n(s),r(15)),u=r(3),l=r(2),a=r(16),h=function(){function t(){}return t.forRoot=function(e){return{ngModule:t,providers:[{provide:l.a,useValue:e}]}},t.decorators=[{type:s.NgModule,args:[{imports:[n.CommonModule,i.FormsModule],declarations:[u.b,a.a,c.a,o.a],exports:[u.b]}]}],t.ctorParameters=function(){return[]},t}()}])});