UNPKG

ng-zorro-antd

Version:

An enterprise-class UI components based on Ant Design and Angular

16 lines (14 loc) 22 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/bidi"),require("@angular/cdk/scrolling"),require("@angular/common"),require("@angular/core"),require("ng-zorro-antd/core/no-animation"),require("ng-zorro-antd/core/util"),require("rxjs"),require("rxjs/operators"),require("@angular/cdk/tree"),require("@angular/cdk/coercion"),require("ng-zorro-antd/core/animation"),require("ng-zorro-antd/core/logger"),require("@angular/cdk/collections")):"function"==typeof define&&define.amd?define("ng-zorro-antd/tree-view",["exports","@angular/cdk/bidi","@angular/cdk/scrolling","@angular/common","@angular/core","ng-zorro-antd/core/no-animation","ng-zorro-antd/core/util","rxjs","rxjs/operators","@angular/cdk/tree","@angular/cdk/coercion","ng-zorro-antd/core/animation","ng-zorro-antd/core/logger","@angular/cdk/collections"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self)["ng-zorro-antd"]=e["ng-zorro-antd"]||{},e["ng-zorro-antd"]["tree-view"]={}),e.ng.cdk.bidi,e.ng.cdk.scrolling,e.ng.common,e.ng.core,e["ng-zorro-antd"].core["no-animation"],e["ng-zorro-antd"].core.util,e.rxjs,e.rxjs.operators,e.ng.cdk.tree,e.ng.cdk.coercion,e["ng-zorro-antd"].core.animation,e["ng-zorro-antd"].core.logger,e.ng.cdk.collections)}(this,(function(e,t,n,r,o,i,a,s,c,d,l,u,p,h){"use strict"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var f=function(e,t){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function g(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}f(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function y(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function v(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}Object.create;function z(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function N(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function m(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(N(arguments[t]));return e}Object.create;var C=function(){function e(){this.nzClick=new o.EventEmitter}return e.prototype.onClick=function(e){this.nzDisabled||this.nzClick.emit(e)},e}();C.decorators=[{type:o.Component,args:[{selector:"nz-tree-node-checkbox:not([builtin])",template:'\n <span class="ant-tree-checkbox-inner"></span>\n ',changeDetection:o.ChangeDetectionStrategy.OnPush,preserveWhitespaces:!1,host:{class:"ant-tree-checkbox","[class.ant-tree-checkbox-checked]":"nzChecked","[class.ant-tree-checkbox-indeterminate]":"nzIndeterminate","[class.ant-tree-checkbox-disabled]":"nzDisabled","(click)":"onClick($event)"}}]}],C.propDecorators={nzChecked:[{type:o.Input}],nzIndeterminate:[{type:o.Input}],nzDisabled:[{type:o.Input}],nzClick:[{type:o.Output}]},y([a.InputBoolean(),v("design:type",Boolean)],C.prototype,"nzDisabled",void 0);var b=function(e){function t(t,n,r,o){var i=e.call(this,t,n)||this;return i.differs=t,i.changeDetectorRef=n,i.noAnimation=r,i.directionality=o,i.destroy$=new s.Subject,i.dir="ltr",i._dataSourceChanged=new s.Subject,i.nzDirectoryTree=!1,i.nzBlockNode=!1,i}return g(t,e),Object.defineProperty(t.prototype,"dataSource",{get:function(){return e.prototype.dataSource},set:function(t){e.prototype.dataSource=t},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){var t,n=this;e.prototype.ngOnInit.call(this),this.directionality&&(this.dir=this.directionality.value,null===(t=this.directionality.change)||void 0===t||t.pipe(c.takeUntil(this.destroy$)).subscribe((function(e){n.dir=e,n.changeDetectorRef.detectChanges()})))},t.prototype.ngOnDestroy=function(){e.prototype.ngOnDestroy.call(this),this.destroy$.next(),this.destroy$.complete()},t.prototype.renderNodeChanges=function(t,n,r,o){e.prototype.renderNodeChanges.call(this,t,n,r,o),this._dataSourceChanged.next()},t}(d.CdkTree);b.decorators=[{type:o.Component,args:[{template:""}]}],b.ctorParameters=function(){return[{type:o.IterableDiffers},{type:o.ChangeDetectorRef},{type:i.NzNoAnimationDirective,decorators:[{type:o.Host},{type:o.Optional}]},{type:t.Directionality,decorators:[{type:o.Optional}]}]},b.propDecorators={treeControl:[{type:o.Input,args:["nzTreeControl"]}],dataSource:[{type:o.Input,args:["nzDataSource"]}],nzDirectoryTree:[{type:o.Input}],nzBlockNode:[{type:o.Input}]},y([a.InputBoolean(),v("design:type",Object)],b.prototype,"nzDirectoryTree",void 0),y([a.InputBoolean(),v("design:type",Object)],b.prototype,"nzBlockNode",void 0);var x=function(e){function t(t,n,r,o){var i=e.call(this,t,n)||this;return i.elementRef=t,i.tree=n,i.renderer=r,i.cdr=o,i.indents=[],i.disabled=!1,i.selected=!1,i.isLeaf=!1,i._elementRef.nativeElement.classList.add("ant-tree-treenode"),i}return g(t,e),t.prototype.ngOnInit=function(){this.isLeaf=!this.tree.treeControl.isExpandable(this.data)},t.prototype.disable=function(){this.disabled=!0,this.updateDisabledClass()},t.prototype.enable=function(){this.disabled=!1,this.updateDisabledClass()},t.prototype.select=function(){this.selected=!0,this.updateSelectedClass()},t.prototype.deselect=function(){this.selected=!1,this.updateSelectedClass()},t.prototype.setIndents=function(e){this.indents=e,this.cdr.markForCheck()},t.prototype.updateSelectedClass=function(){this.selected?this.renderer.addClass(this.elementRef.nativeElement,"ant-tree-treenode-selected"):this.renderer.removeClass(this.elementRef.nativeElement,"ant-tree-treenode-selected")},t.prototype.updateDisabledClass=function(){this.disabled?this.renderer.addClass(this.elementRef.nativeElement,"ant-tree-treenode-disabled"):this.renderer.removeClass(this.elementRef.nativeElement,"ant-tree-treenode-disabled")},t}(d.CdkTreeNode);x.decorators=[{type:o.Component,args:[{selector:"nz-tree-node:not([builtin])",exportAs:"nzTreeNode",changeDetection:o.ChangeDetectionStrategy.OnPush,providers:[{provide:d.CdkTreeNode,useExisting:x}],template:'\n <nz-tree-node-indents [indents]="indents" *ngIf="indents.length"></nz-tree-node-indents>\n <ng-content select="nz-tree-node-toggle, [nz-tree-node-toggle]"></ng-content>\n <nz-tree-node-toggle class="nz-tree-leaf-line-icon" *ngIf="indents.length && isLeaf" nzTreeNodeNoopToggle>\n <span class="ant-tree-switcher-leaf-line"></span>\n </nz-tree-node-toggle>\n <ng-content select="nz-tree-node-checkbox"></ng-content>\n <ng-content select="nz-tree-node-option"></ng-content>\n <ng-content></ng-content>\n ',host:{"[class.ant-tree-treenode-switcher-open]":"isExpanded","[class.ant-tree-treenode-switcher-close]":"!isExpanded"}}]}],x.ctorParameters=function(){return[{type:o.ElementRef},{type:b},{type:o.Renderer2},{type:o.ChangeDetectorRef}]};var D=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t}(d.CdkTreeNodeDef);D.decorators=[{type:o.Directive,args:[{selector:"[nzTreeNodeDef]",providers:[{provide:d.CdkTreeNodeDef,useExisting:D}]}]}],D.propDecorators={when:[{type:o.Input,args:["nzTreeNodeDefWhen"]}]};var T=function(){function e(e){this._viewContainerRef=e,this._viewRef=null}return e.prototype.ngOnChanges=function(e){if(this.shouldRecreateView(e)){var t=this._viewContainerRef;this._viewRef&&t.remove(t.indexOf(this._viewRef)),this._viewRef=this.data?t.createEmbeddedView(this.data.nodeDef.template,this.data.context):null,d.CdkTreeNode.mostRecentTreeNode&&this._viewRef&&(d.CdkTreeNode.mostRecentTreeNode.data=this.data.data)}else this._viewRef&&this.data.context&&this.updateExistingContext(this.data.context)},e.prototype.shouldRecreateView=function(e){var t=e.data;return!!e.data||t&&this.hasContextShapeChanged(t)},e.prototype.hasContextShapeChanged=function(e){var t,n,r=Object.keys(e.previousValue||{}),o=Object.keys(e.currentValue||{});if(r.length===o.length){try{for(var i=z(o),a=i.next();!a.done;a=i.next()){var s=a.value;if(-1===r.indexOf(s))return!0}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return!1}return!0},e.prototype.updateExistingContext=function(e){var t,n;try{for(var r=z(Object.keys(e)),o=r.next();!o.done;o=r.next()){var i=o.value;this._viewRef.context[i]=this.data.context[i]}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e}();function k(e,t,n){var r=e.indexOf(t);if(r<0)return null;var o=n(t);for(r--;r>=0;r--){var i=n(e[r]);if(i+1===o)return e[r];if(i+1<o)return null}return null}function w(e,t,n,r){var o=void 0!==r?r:e.indexOf(t);if(o<0)return null;var i=n(t);for(o++;o<e.length;o++){var a=n(e[o]);if(a<i)return null;if(a===i)return e[o]}return null}T.decorators=[{type:o.Directive,args:[{selector:"[nzTreeVirtualScrollNodeOutlet]"}]}],T.ctorParameters=function(){return[{type:o.ViewContainerRef}]},T.propDecorators={data:[{type:o.Input}]};var O="undefined"!=typeof requestAnimationFrame?s.animationFrameScheduler:s.asapScheduler,I=function(){this.indents=[]};I.decorators=[{type:o.Component,args:[{selector:"nz-tree-node-indents",template:'\n <span class="ant-tree-indent-unit" [class.ant-tree-indent-unit-end]="!isEnd" *ngFor="let isEnd of indents"></span>\n ',changeDetection:o.ChangeDetectionStrategy.OnPush,host:{class:"ant-tree-indent"}}]}],I.propDecorators={indents:[{type:o.Input}]};var _=function(){function e(e,t){var n=this;this.treeNode=e,this.tree=t,this.isLast="unset",this.isLeaf=!1,this.preNodeRef=null,this.nextNodeRef=null,this.currentIndents="",this.buildIndents(),this.checkLast(),this.changeSubscription=s.merge(this.treeNode._dataChanges,t._dataSourceChanged).pipe(c.auditTime(0,O)).subscribe((function(){n.buildIndents(),n.checkAdjacent()}))}return e.prototype.getIndents=function(){for(var e=[],t=this.tree.treeControl.dataNodes,n=this.tree.treeControl.getLevel,r=k(t,this.treeNode.data,n);r;){w(t,r,n)?e.unshift(!0):e.unshift(!1),r=k(t,r,n)}return e},e.prototype.buildIndents=function(){if(this.treeNode.data){var e=this.getIndents(),t=e.map((function(e){return e?1:0})).join("");t!==this.currentIndents&&(this.treeNode.setIndents(this.getIndents()),this.currentIndents=t)}},e.prototype.checkAdjacent=function(){var e=this.tree.treeControl.dataNodes,t=e.indexOf(this.treeNode.data),n=e[t-1]||null,r=e[t+1]||null;this.nextNodeRef===r&&this.preNodeRef===n||this.checkLast(t),this.preNodeRef=n,this.nextNodeRef=r},e.prototype.checkLast=function(e){var t=this.tree.treeControl.dataNodes;this.isLeaf=this.treeNode.isLeaf,this.isLast=!w(t,this.treeNode.data,this.tree.treeControl.getLevel,e)},e.prototype.ngOnDestroy=function(){this.preNodeRef=null,this.nextNodeRef=null,this.changeSubscription.unsubscribe()},e}();_.decorators=[{type:o.Directive,args:[{selector:"nz-tree-node[nzTreeNodeIndentLine]",host:{class:"ant-tree-show-line","[class.ant-tree-treenode-leaf-last]":"isLast && isLeaf"}}]}],_.ctorParameters=function(){return[{type:x},{type:b}]};var S=function(){function e(e){this.treeNode=e,this.nzSelected=!1,this.nzDisabled=!1,this.nzClick=new o.EventEmitter}return Object.defineProperty(e.prototype,"isExpanded",{get:function(){return this.treeNode.isExpanded},enumerable:!1,configurable:!0}),e.prototype.onClick=function(e){this.nzDisabled||this.nzClick.emit(e)},e.prototype.ngOnChanges=function(e){var t=e.nzDisabled,n=e.nzSelected;t&&(t.currentValue?this.treeNode.disable():this.treeNode.enable()),n&&(n.currentValue?this.treeNode.select():this.treeNode.deselect())},e}();S.decorators=[{type:o.Component,args:[{selector:"nz-tree-node-option",template:'\n <span class="ant-tree-title"><ng-content></ng-content></span>\n ',changeDetection:o.ChangeDetectionStrategy.OnPush,host:{class:"ant-tree-node-content-wrapper","[class.ant-tree-node-content-wrapper-open]":"isExpanded","[class.ant-tree-node-selected]":"nzSelected","(click)":"onClick($event)"}}]}],S.ctorParameters=function(){return[{type:x}]},S.propDecorators={nzSelected:[{type:o.Input}],nzDisabled:[{type:o.Input}],nzClick:[{type:o.Output}]},y([a.InputBoolean(),v("design:type",Object)],S.prototype,"nzSelected",void 0),y([a.InputBoolean(),v("design:type",Object)],S.prototype,"nzDisabled",void 0);var E=function(e,t){this.viewContainer=e,this._node=t};E.decorators=[{type:o.Directive,args:[{selector:"[nzTreeNodeOutlet]",providers:[{provide:d.CdkTreeNodeOutlet,useExisting:E}]}]}],E.ctorParameters=function(){return[{type:o.ViewContainerRef},{type:void 0,decorators:[{type:o.Inject,args:[d.CDK_TREE_NODE_OUTLET_NODE]},{type:o.Optional}]}]};var R=function(e){function t(){var t=e.apply(this,m(arguments))||this;return t._indent=24,t}return g(t,e),Object.defineProperty(t.prototype,"level",{get:function(){return this._level},set:function(e){this._setLevelInput(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"indent",{get:function(){return this._indent},set:function(e){this._setIndentInput(e)},enumerable:!1,configurable:!0}),t}(d.CdkTreeNodePadding);R.decorators=[{type:o.Directive,args:[{selector:"[nzTreeNodePadding]",providers:[{provide:d.CdkTreeNodePadding,useExisting:R}]}]}],R.propDecorators={level:[{type:o.Input,args:["nzTreeNodePadding"]}],indent:[{type:o.Input,args:["nzTreeNodePaddingIndent"]}]};var j=function(){};j.decorators=[{type:o.Directive,args:[{selector:"nz-tree-node-toggle[nzTreeNodeNoopToggle], [nzTreeNodeNoopToggle]",host:{class:"ant-tree-switcher ant-tree-switcher-noop"}}]}];var P=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),Object.defineProperty(t.prototype,"recursive",{get:function(){return this._recursive},set:function(e){this._recursive=l.coerceBooleanProperty(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isExpanded",{get:function(){return this._treeNode.isExpanded},enumerable:!1,configurable:!0}),t}(d.CdkTreeNodeToggle);P.decorators=[{type:o.Directive,args:[{selector:"nz-tree-node-toggle:not([nzTreeNodeNoopToggle]), [nzTreeNodeToggle]",providers:[{provide:d.CdkTreeNodeToggle,useExisting:P}],host:{class:"ant-tree-switcher","[class.ant-tree-switcher_open]":"isExpanded","[class.ant-tree-switcher_close]":"!isExpanded"}}]}],P.propDecorators={recursive:[{type:o.Input,args:["nzTreeNodeToggleRecursive"]}]};var V=function(){};V.decorators=[{type:o.Directive,args:[{selector:"[nz-icon][nzTreeNodeToggleRotateIcon]",host:{class:"ant-tree-switcher-icon"}}]}];var L=function(){};L.decorators=[{type:o.Directive,args:[{selector:"[nz-icon][nzTreeNodeToggleActiveIcon]",host:{class:"ant-tree-switcher-loading-icon"}}]}];var B=function(e){function t(){var t=e.apply(this,m(arguments))||this;return t._afterViewInit=!1,t}return g(t,e),t.prototype.ngAfterViewInit=function(){var e=this;Promise.resolve().then((function(){e._afterViewInit=!0,e.changeDetectorRef.markForCheck()}))},t}(b);B.decorators=[{type:o.Component,args:[{selector:"nz-tree-view",exportAs:"nzTreeView",template:'\n <div class="ant-tree-list-holder">\n <div\n [@.disabled]="!_afterViewInit || noAnimation?.nzNoAnimation"\n [@treeCollapseMotion]="_nodeOutlet.viewContainer.length"\n class="ant-tree-list-holder-inner"\n >\n <ng-container nzTreeNodeOutlet></ng-container>\n </div>\n </div>\n ',encapsulation:o.ViewEncapsulation.None,changeDetection:o.ChangeDetectionStrategy.OnPush,providers:[{provide:d.CdkTree,useExisting:B},{provide:b,useExisting:B}],host:{class:"ant-tree","[class.ant-tree-block-node]":"nzDirectoryTree || nzBlockNode","[class.ant-tree-directory]":"nzDirectoryTree","[class.ant-tree-rtl]":"dir === 'rtl'"},animations:[u.treeCollapseMotion]}]}],B.propDecorators={nodeOutlet:[{type:o.ViewChild,args:[E,{static:!0}]}]};var A=28,M=function(e){function t(){var t=e.apply(this,m(arguments))||this;return t.itemSize=A,t.nzNodeWidth=A,t.nzItemSize=A,t.nzMinBufferPx=140,t.nzMaxBufferPx=280,t.nodes=[],t}return g(t,e),t.prototype.renderNodeChanges=function(e){var t=this;this.nodes=(new(Array.bind.apply(Array,m([void 0],e)))).map((function(e,n){return t.createNode(e,n)}))},t.prototype.createNode=function(e,t){var n=this._getNodeDef(e,t),r=new d.CdkTreeNodeOutletContext(e);return this.treeControl.getLevel?r.level=this.treeControl.getLevel(e):r.level=0,{data:e,context:r,nodeDef:n}},t.prototype.ngOnChanges=function(e){var t=e.nzNodeWidth,n=e.nzItemSize;t&&(p.warnDeprecation("`nzNodeWidth` in nz-tree-virtual-scroll-view will be removed in 12.0.0, please use `nzItemSize` instead."),this.itemSize=t.currentValue),n&&(this.itemSize=n.currentValue)},t}(b);M.decorators=[{type:o.Component,args:[{selector:"nz-tree-virtual-scroll-view",exportAs:"nzTreeVirtualScrollView",template:'\n <div class="ant-tree-list">\n <cdk-virtual-scroll-viewport\n class="ant-tree-list-holder"\n [itemSize]="itemSize"\n [minBufferPx]="nzMinBufferPx"\n [maxBufferPx]="nzMaxBufferPx"\n >\n <ng-container *cdkVirtualFor="let item of nodes; let i = index">\n <ng-template nzTreeVirtualScrollNodeOutlet [data]="item"></ng-template>\n </ng-container>\n </cdk-virtual-scroll-viewport>\n </div>\n <ng-container nzTreeNodeOutlet></ng-container>\n ',encapsulation:o.ViewEncapsulation.None,changeDetection:o.ChangeDetectionStrategy.OnPush,providers:[{provide:b,useExisting:M},{provide:d.CdkTree,useExisting:M}],host:{class:"ant-tree","[class.ant-tree-block-node]":"nzDirectoryTree || nzBlockNode","[class.ant-tree-directory]":"nzDirectoryTree","[class.ant-tree-rtl]":"dir === 'rtl'"}}]}],M.propDecorators={nodeOutlet:[{type:o.ViewChild,args:[E,{static:!0}]}],virtualScrollViewport:[{type:o.ViewChild,args:[n.CdkVirtualScrollViewport,{static:!0}]}],nzNodeWidth:[{type:o.Input}],nzItemSize:[{type:o.Input}],nzMinBufferPx:[{type:o.Input}],nzMaxBufferPx:[{type:o.Input}]};var F=[b,E,B,D,x,P,R,V,L,S,j,C,I,M,T,_],q=function(){};q.decorators=[{type:o.NgModule,args:[{imports:[t.BidiModule,r.CommonModule,i.NzNoAnimationModule,n.ScrollingModule],declarations:[F],exports:[F]}]}];var W=function(){function e(e,t,n,r){this.transformFunction=e,this.getLevel=t,this.isExpandable=n,this.getChildren=r}return e.prototype.flattenNode=function(e,t,n,r){var o=this,i=this.transformFunction(e,t);if(n.push(i),this.isExpandable(i)){var a=this.getChildren(e);a&&(Array.isArray(a)?this.flattenChildren(a,t,n,r):a.pipe(c.take(1)).subscribe((function(e){o.flattenChildren(e,t,n,r)})))}return n},e.prototype.flattenChildren=function(e,t,n,r){var o=this;e.forEach((function(i,a){var s=r.slice();s.push(a!==e.length-1),o.flattenNode(i,t+1,n,s)}))},e.prototype.flattenNodes=function(e){var t=this,n=[];return e.forEach((function(e){return t.flattenNode(e,0,n,[])})),n},e.prototype.expandFlattenedNodes=function(e,t){var n=this,r=[],o=[];return o[0]=!0,e.forEach((function(e){for(var i=!0,a=0;a<=n.getLevel(e);a++)i=i&&o[a];i&&r.push(e),n.isExpandable(e)&&(o[n.getLevel(e)+1]=t.isExpanded(e))})),r},e}(),$=function(e){function t(t,n,r){void 0===r&&(r=[]);var o=e.call(this)||this;return o._treeControl=t,o._treeFlattener=n,o._flattenedData=new s.BehaviorSubject([]),o._expandedData=new s.BehaviorSubject([]),o._data=new s.BehaviorSubject(r),o.flatNodes(),o}return g(t,e),t.prototype.setData=function(e){this._data.next(e),this.flatNodes()},t.prototype.getData=function(){return this._data.getValue()},t.prototype.connect=function(e){var t=this,n=[e.viewChange,this._treeControl.expansionModel.changed,this._flattenedData];return s.merge.apply(void 0,m(n)).pipe(c.map((function(){return t._expandedData.next(t._treeFlattener.expandFlattenedNodes(t._flattenedData.value,t._treeControl)),t._expandedData.value})))},t.prototype.disconnect=function(){},t.prototype.flatNodes=function(){this._flattenedData.next(this._treeFlattener.flattenNodes(this.getData())),this._treeControl.dataNodes=this._flattenedData.value},t}(h.DataSource);e.NzTreeFlatDataSource=$,e.NzTreeFlattener=W,e.NzTreeNodeCheckboxComponent=C,e.NzTreeNodeComponent=x,e.NzTreeNodeDefDirective=D,e.NzTreeNodeIndentLineDirective=_,e.NzTreeNodeIndentsComponent=I,e.NzTreeNodeNoopToggleDirective=j,e.NzTreeNodeOptionComponent=S,e.NzTreeNodeOutletDirective=E,e.NzTreeNodePaddingDirective=R,e.NzTreeNodeToggleActiveIconDirective=L,e.NzTreeNodeToggleDirective=P,e.NzTreeNodeToggleRotateIconDirective=V,e.NzTreeViewComponent=B,e.NzTreeViewModule=q,e.NzTreeVirtualScrollNodeOutletDirective=T,e.NzTreeVirtualScrollViewComponent=M,e.getNextSibling=w,e.getParent=k,e.ɵa=b,Object.defineProperty(e,"__esModule",{value:!0})})); //# sourceMappingURL=ng-zorro-antd-tree-view.umd.min.js.map