ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
16 lines (14 loc) • 34.8 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/scrolling"),require("@angular/common"),require("@angular/core"),require("ng-zorro-antd/core/highlight"),require("ng-zorro-antd/core/no-animation"),require("ng-zorro-antd/core/outlet"),require("ng-zorro-antd/icon"),require("ng-zorro-antd/core/tree"),require("ng-zorro-antd/core/util"),require("rxjs"),require("rxjs/operators"),require("@angular/forms"),require("ng-zorro-antd/core/animation"),require("ng-zorro-antd/core/config")):"function"==typeof define&&define.amd?define("ng-zorro-antd/tree",["exports","@angular/cdk/scrolling","@angular/common","@angular/core","ng-zorro-antd/core/highlight","ng-zorro-antd/core/no-animation","ng-zorro-antd/core/outlet","ng-zorro-antd/icon","ng-zorro-antd/core/tree","ng-zorro-antd/core/util","rxjs","rxjs/operators","@angular/forms","ng-zorro-antd/core/animation","ng-zorro-antd/core/config"],t):t(((e=e||self)["ng-zorro-antd"]=e["ng-zorro-antd"]||{},e["ng-zorro-antd"].tree={}),e.ng.cdk.scrolling,e.ng.common,e.ng.core,e["ng-zorro-antd"].core.highlight,e["ng-zorro-antd"].core["no-animation"],e["ng-zorro-antd"].core.outlet,e["ng-zorro-antd"].icon,e["ng-zorro-antd"].core.tree,e["ng-zorro-antd"].core.util,e.rxjs,e.rxjs.operators,e.ng.forms,e["ng-zorro-antd"].core.animation,e["ng-zorro-antd"].core.config)}(this,(function(e,t,n,r,o,i,a,c,s,d,l,p,h,u,z){"use strict";
/*! *****************************************************************************
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 g=function(e,t){return(g=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)};function y(e,t){function n(){this.constructor=e}g(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function f(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 c=e.length-1;c>=0;c--)(o=e[c])&&(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 S(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function v(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}var m=function(){function e(){this.nzSelectMode=!1,this.listOfUnit=[]}return e.prototype.unitMapOfClass=function(e){var t;return(t={})["ant-tree-indent-unit"]=!this.nzSelectMode,t["ant-tree-indent-unit-start"]=!this.nzSelectMode&&this.nzIsStart[e+1],t["ant-tree-indent-unit-end"]=!this.nzSelectMode&&this.nzIsEnd[e+1],t["ant-select-tree-indent-unit"]=this.nzSelectMode,t["ant-select-tree-indent-unit-start"]=this.nzSelectMode&&this.nzIsStart[e+1],t["ant-select-tree-indent-unit-end"]=this.nzSelectMode&&this.nzIsEnd[e+1],t},e.prototype.ngOnInit=function(){},e.prototype.ngOnChanges=function(e){var t=e.nzTreeLevel;t&&(this.listOfUnit=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(v(arguments[t]));return e}(new Array(t.currentValue||0)))},e.decorators=[{type:r.Component,args:[{selector:"nz-tree-indent",exportAs:"nzTreeIndent",template:' <span *ngFor="let i of listOfUnit; let index = index" [ngClass]="unitMapOfClass(index)"></span> ',changeDetection:r.ChangeDetectionStrategy.OnPush,preserveWhitespaces:!1,host:{"[attr.aria-hidden]":"true","[class.ant-tree-indent]":"!nzSelectMode","[class.ant-select-tree-indent]":"nzSelectMode"}}]}],e.propDecorators={nzTreeLevel:[{type:r.Input}],nzIsStart:[{type:r.Input}],nzIsEnd:[{type:r.Input}],nzSelectMode:[{type:r.Input}]},e}();var C=function(){function e(){this.nzSelectMode=!1}return e.decorators=[{type:r.Component,args:[{selector:"nz-tree-node-checkbox",template:' <span [class.ant-tree-checkbox-inner]="!nzSelectMode" [class.ant-select-tree-checkbox-inner]="nzSelectMode"></span> ',changeDetection:r.ChangeDetectionStrategy.OnPush,preserveWhitespaces:!1,host:{"[class.ant-select-tree-checkbox]":"nzSelectMode","[class.ant-select-tree-checkbox-checked]":"nzSelectMode && isChecked","[class.ant-select-tree-checkbox-indeterminate]":"nzSelectMode && isHalfChecked","[class.ant-select-tree-checkbox-disabled]":"nzSelectMode && (isDisabled || isDisableCheckbox)","[class.ant-tree-checkbox]":"!nzSelectMode","[class.ant-tree-checkbox-checked]":"!nzSelectMode && isChecked","[class.ant-tree-checkbox-indeterminate]":"!nzSelectMode && isHalfChecked","[class.ant-tree-checkbox-disabled]":"!nzSelectMode && (isDisabled || isDisableCheckbox)"}}]}],e.propDecorators={nzSelectMode:[{type:r.Input}],isChecked:[{type:r.Input}],isHalfChecked:[{type:r.Input}],isDisabled:[{type:r.Input}],isDisableCheckbox:[{type:r.Input}]},e}();var b=function(){function e(){this.nzSelectMode=!1}return Object.defineProperty(e.prototype,"isShowLineIcon",{get:function(){return!this.isLeaf&&this.nzShowLine},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isShowSwitchIcon",{get:function(){return!this.isLeaf&&!this.nzShowLine},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSwitcherOpen",{get:function(){return this.isExpanded&&!this.isLeaf},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSwitcherClose",{get:function(){return!this.isExpanded&&!this.isLeaf},enumerable:!0,configurable:!0}),e.decorators=[{type:r.Component,args:[{selector:"nz-tree-node-switcher",template:'\n <ng-container *ngIf="isShowSwitchIcon">\n <ng-container *ngIf="!isLoading; else loadingTemplate">\n <ng-container *nzStringTemplateOutlet="nzExpandedIcon; context: { $implicit: context, origin: context.origin }">\n <i\n nz-icon\n nzType="caret-down"\n [class.ant-select-tree-switcher-icon]="nzSelectMode"\n [class.ant-tree-switcher-icon]="!nzSelectMode"\n ></i>\n </ng-container>\n </ng-container>\n </ng-container>\n <ng-container *ngIf="nzShowLine">\n <ng-container *ngIf="!isLoading; else loadingTemplate">\n <ng-container *nzStringTemplateOutlet="nzExpandedIcon; context: { $implicit: context, origin: context.origin }">\n <i\n *ngIf="isShowLineIcon"\n nz-icon\n [nzType]="isSwitcherOpen ? \'minus-square\' : \'plus-square\'"\n class="ant-tree-switcher-line-icon"\n ></i>\n <i *ngIf="!isShowLineIcon" nz-icon nzType="file" class="ant-tree-switcher-line-icon"></i>\n </ng-container>\n </ng-container>\n </ng-container>\n <ng-template #loadingTemplate>\n <i nz-icon nzType="loading" [nzSpin]="true" class="ant-tree-switcher-loading-icon"></i>\n </ng-template>\n ',changeDetection:r.ChangeDetectionStrategy.OnPush,preserveWhitespaces:!1,host:{"[class.ant-select-tree-switcher]":"nzSelectMode","[class.ant-select-tree-switcher-noop]":"nzSelectMode && isLeaf","[class.ant-select-tree-switcher_open]":"nzSelectMode && isSwitcherOpen","[class.ant-select-tree-switcher_close]":"nzSelectMode && isSwitcherClose","[class.ant-tree-switcher]":"!nzSelectMode","[class.ant-tree-switcher-noop]":"!nzSelectMode && isLeaf","[class.ant-tree-switcher_open]":"!nzSelectMode && isSwitcherOpen","[class.ant-tree-switcher_close]":"!nzSelectMode && isSwitcherClose"}}]}],e.propDecorators={nzShowExpand:[{type:r.Input}],nzShowLine:[{type:r.Input}],nzExpandedIcon:[{type:r.Input}],nzSelectMode:[{type:r.Input}],context:[{type:r.Input}],isLeaf:[{type:r.Input}],isLoading:[{type:r.Input}],isExpanded:[{type:r.Input}]},e}();var E=function(){function e(){this.selectMode=!1}return Object.defineProperty(e.prototype,"canDraggable",{get:function(){return!(!this.draggable||this.isDisabled)||null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"matchedValue",{get:function(){return this.isMatched?this.searchValue:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSwitcherOpen",{get:function(){return this.isExpanded&&!this.isLeaf},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSwitcherClose",{get:function(){return!this.isExpanded&&!this.isLeaf},enumerable:!0,configurable:!0}),e.decorators=[{type:r.Component,args:[{selector:"nz-tree-node-title",template:' <ng-template [ngTemplateOutlet]="treeTemplate" [ngTemplateOutletContext]="{ $implicit: context, origin: context.origin }">\n </ng-template>\n <ng-container *ngIf="!treeTemplate">\n <span\n *ngIf="icon && showIcon"\n [class.ant-tree-icon__open]="isSwitcherOpen"\n [class.ant-tree-icon__close]="isSwitcherClose"\n [class.ant-tree-icon_loading]="isLoading"\n [class.ant-select-tree-iconEle]="selectMode"\n [class.ant-tree-iconEle]="!selectMode"\n >\n <span\n [class.ant-select-tree-iconEle]="selectMode"\n [class.ant-select-tree-icon__customize]="selectMode"\n [class.ant-tree-iconEle]="!selectMode"\n [class.ant-tree-icon__customize]="!selectMode"\n >\n <i nz-icon *ngIf="icon" [nzType]="icon"></i>\n </span>\n </span>\n <span class="ant-tree-title" [innerHTML]="title | nzHighlight: matchedValue:\'i\':\'font-highlight\'"> </span>\n </ng-container>',changeDetection:r.ChangeDetectionStrategy.OnPush,preserveWhitespaces:!1,host:{"[attr.title]":"title","[attr.draggable]":"canDraggable","[attr.aria-grabbed]":"canDraggable","[class.draggable]":"canDraggable","[class.ant-select-tree-node-content-wrapper]":"selectMode","[class.ant-select-tree-node-content-wrapper-open]":"selectMode && isSwitcherOpen","[class.ant-select-tree-node-content-wrapper-close]":"selectMode && isSwitcherClose","[class.ant-select-tree-node-selected]":"selectMode && isSelected","[class.ant-tree-node-content-wrapper]":"!selectMode","[class.ant-tree-node-content-wrapper-open]":"!selectMode && isSwitcherOpen","[class.ant-tree-node-content-wrapper-close]":"!selectMode && isSwitcherClose","[class.ant-tree-node-selected]":"!selectMode && isSelected"}}]}],e.propDecorators={searchValue:[{type:r.Input}],treeTemplate:[{type:r.Input}],draggable:[{type:r.Input}],showIcon:[{type:r.Input}],selectMode:[{type:r.Input}],context:[{type:r.Input}],icon:[{type:r.Input}],title:[{type:r.Input}],isLoading:[{type:r.Input}],isSelected:[{type:r.Input}],isDisabled:[{type:r.Input}],isMatched:[{type:r.Input}],isExpanded:[{type:r.Input}],isLeaf:[{type:r.Input}]},e}();var k=function(){function e(e,t,n,o,i,a){this.nzTreeService=e,this.ngZone=t,this.renderer=n,this.elementRef=o,this.cdr=i,this.noAnimation=a,this.nzHideUnMatched=!1,this.nzNoAnimation=!1,this.nzSelectMode=!1,this.nzShowIcon=!1,this.nzSearchValue="",this.nzClick=new r.EventEmitter,this.nzDblClick=new r.EventEmitter,this.nzContextMenu=new r.EventEmitter,this.nzCheckBoxChange=new r.EventEmitter,this.nzExpandChange=new r.EventEmitter,this.nzOnDragStart=new r.EventEmitter,this.nzOnDragEnter=new r.EventEmitter,this.nzOnDragOver=new r.EventEmitter,this.nzOnDragLeave=new r.EventEmitter,this.nzOnDrop=new r.EventEmitter,this.nzOnDragEnd=new r.EventEmitter,this.destroy$=new l.Subject,this.dragPos=2,this.dragPosClass={0:"drag-over",1:"drag-over-gap-bottom","-1":"drag-over-gap-top"}}return Object.defineProperty(e.prototype,"displayStyle",{get:function(){return this.nzSearchValue&&this.nzHideUnMatched&&!this.isMatched&&!this.isExpanded&&this.canHide?"none":""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSwitcherOpen",{get:function(){return this.isExpanded&&!this.isLeaf},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSwitcherClose",{get:function(){return!this.isExpanded&&!this.isLeaf},enumerable:!0,configurable:!0}),e.prototype.onMousedown=function(e){this.nzSelectMode&&e.preventDefault()},e.prototype.clickExpand=function(e){e.preventDefault(),this.isLoading||this.isLeaf||(this.nzAsyncData&&0===this.nzTreeNode.children.length&&!this.isExpanded&&(this.nzTreeNode.isLoading=!0),this.nzTreeNode.setExpanded(!this.isExpanded)),this.nzTreeService.setExpandedNodeList(this.nzTreeNode);var t=this.nzTreeService.formatEvent("expand",this.nzTreeNode,e);this.nzExpandChange.emit(t)},e.prototype.clickSelect=function(e){e.preventDefault(),this.isSelectable&&!this.isDisabled&&(this.nzTreeNode.isSelected=!this.nzTreeNode.isSelected),this.nzTreeService.setSelectedNodeList(this.nzTreeNode);var t=this.nzTreeService.formatEvent("click",this.nzTreeNode,e);this.nzClick.emit(t)},e.prototype.dblClick=function(e){e.preventDefault();var t=this.nzTreeService.formatEvent("dblclick",this.nzTreeNode,e);this.nzDblClick.emit(t)},e.prototype.contextMenu=function(e){e.preventDefault();var t=this.nzTreeService.formatEvent("contextmenu",this.nzTreeNode,e);this.nzContextMenu.emit(t)},e.prototype.clickCheckBox=function(e){if(e.preventDefault(),!this.isDisabled&&!this.isDisableCheckbox){this.nzTreeNode.isChecked=!this.nzTreeNode.isChecked,this.nzTreeNode.isHalfChecked=!1,this.nzTreeService.setCheckedNodeList(this.nzTreeNode);var t=this.nzTreeService.formatEvent("check",this.nzTreeNode,e);this.nzCheckBoxChange.emit(t)}},e.prototype.clearDragClass=function(){var e=this;["drag-over-gap-top","drag-over-gap-bottom","drag-over"].forEach((function(t){e.renderer.removeClass(e.elementRef.nativeElement,t)}))},e.prototype.handleDragStart=function(e){try{e.dataTransfer.setData("text/plain",this.nzTreeNode.key)}catch(e){}this.nzTreeService.setSelectedNode(this.nzTreeNode);var t=this.nzTreeService.formatEvent("dragstart",this.nzTreeNode,e);this.nzOnDragStart.emit(t)},e.prototype.handleDragEnter=function(e){var t=this;e.preventDefault(),this.dragPos=2,this.ngZone.run((function(){var n=t.nzTreeService.formatEvent("dragenter",t.nzTreeNode,e);t.nzOnDragEnter.emit(n)}))},e.prototype.handleDragOver=function(e){e.preventDefault();var t=this.nzTreeService.calcDropPosition(e);this.dragPos!==t&&(this.clearDragClass(),this.dragPos=t,0===this.dragPos&&this.isLeaf||this.renderer.addClass(this.elementRef.nativeElement,this.dragPosClass[this.dragPos]));var n=this.nzTreeService.formatEvent("dragover",this.nzTreeNode,e);this.nzOnDragOver.emit(n)},e.prototype.handleDragLeave=function(e){e.preventDefault(),this.clearDragClass();var t=this.nzTreeService.formatEvent("dragleave",this.nzTreeNode,e);this.nzOnDragLeave.emit(t)},e.prototype.handleDragDrop=function(e){var t=this;this.ngZone.run((function(){t.clearDragClass();var n=t.nzTreeService.getSelectedNode();if(!(!n||n&&n.key===t.nzTreeNode.key||0===t.dragPos&&t.isLeaf)){var r=t.nzTreeService.formatEvent("drop",t.nzTreeNode,e),o=t.nzTreeService.formatEvent("dragend",t.nzTreeNode,e);t.nzBeforeDrop?t.nzBeforeDrop({dragNode:t.nzTreeService.getSelectedNode(),node:t.nzTreeNode,pos:t.dragPos}).subscribe((function(e){e&&t.nzTreeService.dropAndApply(t.nzTreeNode,t.dragPos),t.nzOnDrop.emit(r),t.nzOnDragEnd.emit(o)})):t.nzTreeNode&&(t.nzTreeService.dropAndApply(t.nzTreeNode,t.dragPos),t.nzOnDrop.emit(r))}}))},e.prototype.handleDragEnd=function(e){var t=this;e.preventDefault(),this.ngZone.run((function(){if(!t.nzBeforeDrop){var n=t.nzTreeService.formatEvent("dragend",t.nzTreeNode,e);t.nzOnDragEnd.emit(n)}}))},e.prototype.handDragEvent=function(){var e=this;this.ngZone.runOutsideAngular((function(){if(e.nzDraggable){var t=e.elementRef.nativeElement;e.destroy$=new l.Subject,l.fromEvent(t,"dragstart").pipe(p.takeUntil(e.destroy$)).subscribe((function(t){return e.handleDragStart(t)})),l.fromEvent(t,"dragenter").pipe(p.takeUntil(e.destroy$)).subscribe((function(t){return e.handleDragEnter(t)})),l.fromEvent(t,"dragover").pipe(p.takeUntil(e.destroy$)).subscribe((function(t){return e.handleDragOver(t)})),l.fromEvent(t,"dragleave").pipe(p.takeUntil(e.destroy$)).subscribe((function(t){return e.handleDragLeave(t)})),l.fromEvent(t,"drop").pipe(p.takeUntil(e.destroy$)).subscribe((function(t){return e.handleDragDrop(t)})),l.fromEvent(t,"dragend").pipe(p.takeUntil(e.destroy$)).subscribe((function(t){return e.handleDragEnd(t)}))}else e.destroy$.next(),e.destroy$.complete()}))},e.prototype.markForCheck=function(){this.cdr.markForCheck()},e.prototype.ngOnInit=function(){this.nzTreeNode.component=this},e.prototype.ngOnChanges=function(e){e.nzDraggable&&this.handDragEvent()},e.prototype.ngOnDestroy=function(){this.destroy$.next(),this.destroy$.complete()},e.decorators=[{type:r.Component,args:[{selector:"nz-tree-node",exportAs:"nzTreeNode",template:'\n <nz-tree-indent [nzTreeLevel]="nzTreeNode.level" [nzSelectMode]="nzSelectMode" [nzIsStart]="isStart" [nzIsEnd]="isEnd"></nz-tree-indent>\n <nz-tree-node-switcher\n *ngIf="nzShowExpand"\n [nzShowExpand]="nzShowExpand"\n [nzShowLine]="nzShowLine"\n [nzExpandedIcon]="nzExpandedIcon"\n [nzSelectMode]="nzSelectMode"\n [context]="nzTreeNode"\n [isLeaf]="isLeaf"\n [isExpanded]="isExpanded"\n [isLoading]="isLoading"\n (click)="clickExpand($event)"\n ></nz-tree-node-switcher>\n <nz-tree-node-checkbox\n *ngIf="nzCheckable"\n (click)="clickCheckBox($event)"\n [nzSelectMode]="nzSelectMode"\n [isChecked]="isChecked"\n [isHalfChecked]="isHalfChecked"\n [isDisabled]="isDisabled"\n [isDisableCheckbox]="isDisableCheckbox"\n ></nz-tree-node-checkbox>\n <nz-tree-node-title\n [icon]="icon"\n [title]="title"\n [isLoading]="isLoading"\n [isSelected]="isSelected"\n [isDisabled]="isDisabled"\n [isMatched]="isMatched"\n [isExpanded]="isExpanded"\n [isLeaf]="isLeaf"\n [searchValue]="nzSearchValue"\n [treeTemplate]="nzTreeTemplate"\n [draggable]="nzDraggable"\n [showIcon]="nzShowIcon"\n [selectMode]="nzSelectMode"\n [context]="nzTreeNode"\n (dblclick)="dblClick($event)"\n (click)="clickSelect($event)"\n (contextmenu)="contextMenu($event)"\n ></nz-tree-node-title>\n ',changeDetection:r.ChangeDetectionStrategy.OnPush,preserveWhitespaces:!1,host:{"[class.ant-select-tree-treenode]":"nzSelectMode","[class.ant-select-tree-treenode-disabled]":"nzSelectMode && isDisabled","[class.ant-select-tree-treenode-switcher-open]":"nzSelectMode && isSwitcherOpen","[class.ant-select-tree-treenode-switcher-close]":"nzSelectMode && isSwitcherClose","[class.ant-select-tree-treenode-checkbox-checked]":"nzSelectMode && isChecked","[class.ant-select-tree-treenode-checkbox-indeterminate]":"nzSelectMode && isHalfChecked","[class.ant-select-tree-treenode-selected]":"nzSelectMode && isSelected","[class.ant-select-tree-treenode-loading]":"nzSelectMode && isLoading","[class.ant-tree-treenode]":"!nzSelectMode","[class.ant-tree-treenode-disabled]":"!nzSelectMode && isDisabled","[class.ant-tree-treenode-switcher-open]":"!nzSelectMode && isSwitcherOpen","[class.ant-tree-treenode-switcher-close]":"!nzSelectMode && isSwitcherClose","[class.ant-tree-treenode-checkbox-checked]":"!nzSelectMode && isChecked","[class.ant-tree-treenode-checkbox-indeterminate]":"!nzSelectMode && isHalfChecked","[class.ant-tree-treenode-selected]":"!nzSelectMode && isSelected","[class.ant-tree-treenode-loading]":"!nzSelectMode && isLoading","[style.display]":"displayStyle","(mousedown)":"onMousedown($event)"}}]}],e.ctorParameters=function(){return[{type:s.NzTreeBaseService},{type:r.NgZone},{type:r.Renderer2},{type:r.ElementRef},{type:r.ChangeDetectorRef},{type:i.NzNoAnimationDirective,decorators:[{type:r.Host},{type:r.Optional}]}]},e.propDecorators={icon:[{type:r.Input}],title:[{type:r.Input}],isLoading:[{type:r.Input}],isSelected:[{type:r.Input}],isDisabled:[{type:r.Input}],isMatched:[{type:r.Input}],isExpanded:[{type:r.Input}],isLeaf:[{type:r.Input}],isChecked:[{type:r.Input}],isHalfChecked:[{type:r.Input}],isDisableCheckbox:[{type:r.Input}],isSelectable:[{type:r.Input}],canHide:[{type:r.Input}],isStart:[{type:r.Input}],isEnd:[{type:r.Input}],nzTreeNode:[{type:r.Input}],nzShowLine:[{type:r.Input}],nzShowExpand:[{type:r.Input}],nzCheckable:[{type:r.Input}],nzAsyncData:[{type:r.Input}],nzHideUnMatched:[{type:r.Input}],nzNoAnimation:[{type:r.Input}],nzSelectMode:[{type:r.Input}],nzShowIcon:[{type:r.Input}],nzExpandedIcon:[{type:r.Input}],nzTreeTemplate:[{type:r.Input}],nzBeforeDrop:[{type:r.Input}],nzSearchValue:[{type:r.Input}],nzDraggable:[{type:r.Input}],nzClick:[{type:r.Output}],nzDblClick:[{type:r.Output}],nzContextMenu:[{type:r.Output}],nzCheckBoxChange:[{type:r.Output}],nzExpandChange:[{type:r.Output}],nzOnDragStart:[{type:r.Output}],nzOnDragEnter:[{type:r.Output}],nzOnDragOver:[{type:r.Output}],nzOnDragLeave:[{type:r.Output}],nzOnDrop:[{type:r.Output}],nzOnDragEnd:[{type:r.Output}]},f([d.InputBoolean(),S("design:type",Boolean)],e.prototype,"nzShowLine",void 0),f([d.InputBoolean(),S("design:type",Boolean)],e.prototype,"nzShowExpand",void 0),f([d.InputBoolean(),S("design:type",Boolean)],e.prototype,"nzCheckable",void 0),f([d.InputBoolean(),S("design:type",Boolean)],e.prototype,"nzAsyncData",void 0),f([d.InputBoolean(),S("design:type",Object)],e.prototype,"nzHideUnMatched",void 0),f([d.InputBoolean(),S("design:type",Object)],e.prototype,"nzNoAnimation",void 0),f([d.InputBoolean(),S("design:type",Object)],e.prototype,"nzSelectMode",void 0),f([d.InputBoolean(),S("design:type",Object)],e.prototype,"nzShowIcon",void 0),e}();var D=function(e){function t(){return e.call(this)||this}return y(t,e),t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[]},t}(s.NzTreeBaseService);function x(e,t){return e||t}var T=function(e){function n(t,n,o,i){var a=e.call(this,t)||this;return a.nzConfigService=n,a.cdr=o,a.noAnimation=i,a.nzExpandAll=!1,a.nzSelectMode=!1,a.nzCheckStrictly=!1,a.nzShowExpand=!0,a.nzShowLine=!1,a.nzCheckable=!1,a.nzAsyncData=!1,a.nzDraggable=!1,a.nzMultiple=!1,a.nzVirtualItemSize=28,a.nzVirtualMaxBufferPx=500,a.nzVirtualMinBufferPx=28,a.nzVirtualHeight=!1,a.nzData=[],a.nzExpandedKeys=[],a.nzSelectedKeys=[],a.nzCheckedKeys=[],a.nzFlattenNodes=[],a.beforeInit=!0,a.nzExpandedKeysChange=new r.EventEmitter,a.nzSelectedKeysChange=new r.EventEmitter,a.nzCheckedKeysChange=new r.EventEmitter,a.nzSearchValueChange=new r.EventEmitter,a.nzClick=new r.EventEmitter,a.nzDblClick=new r.EventEmitter,a.nzContextMenu=new r.EventEmitter,a.nzCheckBoxChange=new r.EventEmitter,a.nzExpandChange=new r.EventEmitter,a.nzOnDragStart=new r.EventEmitter,a.nzOnDragEnter=new r.EventEmitter,a.nzOnDragOver=new r.EventEmitter,a.nzOnDragLeave=new r.EventEmitter,a.nzOnDrop=new r.EventEmitter,a.nzOnDragEnd=new r.EventEmitter,a.HIDDEN_STYLE={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},a.destroy$=new l.Subject,a.onChange=function(){return null},a.onTouched=function(){return null},a}return y(n,e),n.prototype.writeValue=function(e){this.handleNzData(e)},n.prototype.registerOnChange=function(e){this.onChange=e},n.prototype.registerOnTouched=function(e){this.onTouched=e},n.prototype.renderTreeProperties=function(e){var t=!1,n=!1,r=e.nzData,o=e.nzExpandedKeys,i=e.nzSelectedKeys,a=e.nzCheckedKeys,c=e.nzCheckStrictly,s=e.nzExpandAll,d=e.nzMultiple,l=e.nzSearchValue;s&&(t=!0,n=this.nzExpandAll),d&&(this.nzTreeService.isMultiple=this.nzMultiple),c&&(this.nzTreeService.isCheckStrictly=this.nzCheckStrictly),r&&this.handleNzData(this.nzData),(a||c)&&this.handleCheckedKeys(this.nzCheckedKeys),(o||s)&&(t=!0,this.handleExpandedKeys(n||this.nzExpandedKeys)),i&&this.handleSelectedKeys(this.nzSelectedKeys,this.nzMultiple),l&&(l.firstChange&&!this.nzSearchValue||(t=!1,this.handleSearchValue(this.nzSearchValue,this.nzSearchFunc),this.nzSearchValueChange.emit(this.nzTreeService.formatEvent("search",null,null))));var p=this.getExpandedNodeList().map((function(e){return e.key})),h=t?n||this.nzExpandedKeys:p;this.handleFlattenNodes(this.nzTreeService.rootNodes,h)},n.prototype.trackByFlattenNode=function(e,t){return t.key},n.prototype.handleNzData=function(e){if(Array.isArray(e)){var t=this.coerceTreeNodes(e);this.nzTreeService.initTree(t)}},n.prototype.handleFlattenNodes=function(e,t){void 0===t&&(t=[]),this.nzTreeService.flattenTreeData(e,t)},n.prototype.handleCheckedKeys=function(e){this.nzTreeService.conductCheck(e,this.nzCheckStrictly)},n.prototype.handleExpandedKeys=function(e){void 0===e&&(e=[]),this.nzTreeService.conductExpandedKeys(e)},n.prototype.handleSelectedKeys=function(e,t){this.nzTreeService.conductSelectedKeys(e,t)},n.prototype.handleSearchValue=function(e,t){var n=this,r=s.flattenTreeData(this.nzTreeService.rootNodes,!0).map((function(e){return e.data}));r.forEach((function(r){var o;r.isMatched=(o=r,t?t(o.origin):!(!e||!o.title.toLowerCase().includes(e.toLowerCase()))),r.canHide=!r.isMatched,r.isMatched?n.nzTreeService.expandNodeAllParentBySearch(r):(r.setExpanded(!1),n.nzTreeService.setExpandedNodeList(r)),n.nzTreeService.setMatchedNodeList(r)}))},n.prototype.eventTriggerChanged=function(e){var t=e.node;switch(e.eventName){case"expand":this.renderTree(),this.nzExpandChange.emit(e);break;case"click":this.nzClick.emit(e);break;case"dblclick":this.nzDblClick.emit(e);break;case"contextmenu":this.nzContextMenu.emit(e);break;case"check":this.nzTreeService.setCheckedNodeList(t),this.nzCheckStrictly||this.nzTreeService.conduct(t);var n=this.nzTreeService.formatEvent("check",t,e.event);this.nzCheckBoxChange.emit(n);break;case"dragstart":t.isExpanded&&(t.setExpanded(!t.isExpanded),this.renderTree()),this.nzOnDragStart.emit(e);break;case"dragenter":var r=this.nzTreeService.getSelectedNode();!r||r.key===t.key||t.isExpanded||t.isLeaf||(t.setExpanded(!0),this.renderTree()),this.nzOnDragEnter.emit(e);break;case"dragover":this.nzOnDragOver.emit(e);break;case"dragleave":this.nzOnDragLeave.emit(e);break;case"dragend":this.nzOnDragEnd.emit(e);break;case"drop":this.renderTree(),this.nzOnDrop.emit(e)}},n.prototype.renderTree=function(){this.handleFlattenNodes(this.nzTreeService.rootNodes,this.getExpandedNodeList().map((function(e){return e.key}))),this.cdr.markForCheck()},n.prototype.ngOnInit=function(){var e=this;this.nzTreeService.flattenNodes$.pipe(p.takeUntil(this.destroy$)).subscribe((function(t){e.nzFlattenNodes=t,e.cdr.markForCheck()}))},n.prototype.ngOnChanges=function(e){this.renderTreeProperties(e)},n.prototype.ngAfterViewInit=function(){this.beforeInit=!1},n.prototype.ngOnDestroy=function(){this.destroy$.next(),this.destroy$.complete()},n.decorators=[{type:r.Component,args:[{selector:"nz-tree",exportAs:"nzTree",animations:[u.treeCollapseMotion],template:'\n <div role="tree">\n <input [ngStyle]="HIDDEN_STYLE" />\n </div>\n <div [class.ant-select-tree-list]="nzSelectMode" [class.ant-tree-list]="nzSelectMode">\n <div>\n <cdk-virtual-scroll-viewport\n *ngIf="nzVirtualHeight"\n [class.ant-select-tree-list-holder-inner]="nzSelectMode"\n [class.ant-tree-list-holder-inner]="nzSelectMode"\n [itemSize]="nzVirtualItemSize"\n [minBufferPx]="nzVirtualMinBufferPx"\n [maxBufferPx]="nzVirtualMaxBufferPx"\n [style.height]="nzVirtualHeight"\n >\n <ng-container *cdkVirtualFor="let node of nzFlattenNodes; trackBy: trackByFlattenNode">\n <ng-template [ngTemplateOutlet]="nodeTemplate" [ngTemplateOutletContext]="{ $implicit: node }"></ng-template>\n </ng-container>\n </cdk-virtual-scroll-viewport>\n\n <div\n *ngIf="!nzVirtualHeight"\n [class.ant-select-tree-list-holder-inner]="nzSelectMode"\n [class.ant-tree-list-holder-inner]="nzSelectMode"\n [@.disabled]="beforeInit || noAnimation?.nzNoAnimation"\n [nzNoAnimation]="noAnimation?.nzNoAnimation"\n [@treeCollapseMotion]="nzFlattenNodes.length"\n >\n <ng-container *ngFor="let node of nzFlattenNodes; trackBy: trackByFlattenNode">\n <ng-template [ngTemplateOutlet]="nodeTemplate" [ngTemplateOutletContext]="{ $implicit: node }"></ng-template>\n </ng-container>\n </div>\n </div>\n </div>\n <ng-template #nodeTemplate let-treeNode>\n <nz-tree-node\n [icon]="treeNode.icon"\n [title]="treeNode.title"\n [isLoading]="treeNode.isLoading"\n [isSelected]="treeNode.isSelected"\n [isDisabled]="treeNode.isDisabled"\n [isMatched]="treeNode.isMatched"\n [isExpanded]="treeNode.isExpanded"\n [isLeaf]="treeNode.isLeaf"\n [isStart]="treeNode.isStart"\n [isEnd]="treeNode.isEnd"\n [isChecked]="treeNode.isChecked"\n [isHalfChecked]="treeNode.isHalfChecked"\n [isDisableCheckbox]="treeNode.isDisableCheckbox"\n [isSelectable]="treeNode.isSelectable"\n [canHide]="treeNode.canHide"\n [nzTreeNode]="treeNode"\n [nzSelectMode]="nzSelectMode"\n [nzShowLine]="nzShowLine"\n [nzExpandedIcon]="nzExpandedIcon"\n [nzDraggable]="nzDraggable"\n [nzCheckable]="nzCheckable"\n [nzShowExpand]="nzShowExpand"\n [nzAsyncData]="nzAsyncData"\n [nzSearchValue]="nzSearchValue"\n [nzHideUnMatched]="nzHideUnMatched"\n [nzBeforeDrop]="nzBeforeDrop"\n [nzShowIcon]="nzShowIcon"\n [nzTreeTemplate]="nzTreeTemplate || nzTreeTemplateChild"\n (nzExpandChange)="eventTriggerChanged($event)"\n (nzClick)="eventTriggerChanged($event)"\n (nzDblClick)="eventTriggerChanged($event)"\n (nzContextMenu)="eventTriggerChanged($event)"\n (nzCheckBoxChange)="eventTriggerChanged($event)"\n (nzOnDragStart)="eventTriggerChanged($event)"\n (nzOnDragEnter)="eventTriggerChanged($event)"\n (nzOnDragOver)="eventTriggerChanged($event)"\n (nzOnDragLeave)="eventTriggerChanged($event)"\n (nzOnDragEnd)="eventTriggerChanged($event)"\n (nzOnDrop)="eventTriggerChanged($event)"\n >\n </nz-tree-node>\n </ng-template>\n ',changeDetection:r.ChangeDetectionStrategy.OnPush,providers:[D,{provide:s.NzTreeBaseService,useFactory:x,deps:[[new r.SkipSelf,new r.Optional,s.NzTreeHigherOrderServiceToken],D]},{provide:h.NG_VALUE_ACCESSOR,useExisting:r.forwardRef((function(){return n})),multi:!0}],host:{"[class.ant-select-tree]":"nzSelectMode","[class.ant-select-tree-show-line]":"nzSelectMode && nzShowLine","[class.ant-select-tree-icon-hide]":"nzSelectMode && !nzShowIcon","[class.ant-select-tree-block-node]":"nzSelectMode && nzBlockNode","[class.ant-tree]":"!nzSelectMode","[class.ant-tree-show-line]":"!nzSelectMode && nzShowLine","[class.ant-tree-icon-hide]":"!nzSelectMode && !nzShowIcon","[class.ant-tree-block-node]":"!nzSelectMode && nzBlockNode","[class.draggable-tree]":"nzDraggable"}}]}],n.ctorParameters=function(){return[{type:s.NzTreeBaseService},{type:z.NzConfigService},{type:r.ChangeDetectorRef},{type:i.NzNoAnimationDirective,decorators:[{type:r.Host},{type:r.Optional}]}]},n.propDecorators={nzShowIcon:[{type:r.Input}],nzHideUnMatched:[{type:r.Input}],nzBlockNode:[{type:r.Input}],nzExpandAll:[{type:r.Input}],nzSelectMode:[{type:r.Input}],nzCheckStrictly:[{type:r.Input}],nzShowExpand:[{type:r.Input}],nzShowLine:[{type:r.Input}],nzCheckable:[{type:r.Input}],nzAsyncData:[{type:r.Input}],nzDraggable:[{type:r.Input}],nzMultiple:[{type:r.Input}],nzExpandedIcon:[{type:r.Input}],nzVirtualItemSize:[{type:r.Input}],nzVirtualMaxBufferPx:[{type:r.Input}],nzVirtualMinBufferPx:[{type:r.Input}],nzVirtualHeight:[{type:r.Input}],nzTreeTemplate:[{type:r.Input}],nzBeforeDrop:[{type:r.Input}],nzData:[{type:r.Input}],nzExpandedKeys:[{type:r.Input}],nzSelectedKeys:[{type:r.Input}],nzCheckedKeys:[{type:r.Input}],nzSearchValue:[{type:r.Input}],nzSearchFunc:[{type:r.Input}],nzTreeTemplateChild:[{type:r.ContentChild,args:["nzTreeTemplate",{static:!0}]}],cdkVirtualScrollViewport:[{type:r.ViewChild,args:[t.CdkVirtualScrollViewport,{read:t.CdkVirtualScrollViewport}]}],nzExpandedKeysChange:[{type:r.Output}],nzSelectedKeysChange:[{type:r.Output}],nzCheckedKeysChange:[{type:r.Output}],nzSearchValueChange:[{type:r.Output}],nzClick:[{type:r.Output}],nzDblClick:[{type:r.Output}],nzContextMenu:[{type:r.Output}],nzCheckBoxChange:[{type:r.Output}],nzExpandChange:[{type:r.Output}],nzOnDragStart:[{type:r.Output}],nzOnDragEnter:[{type:r.Output}],nzOnDragOver:[{type:r.Output}],nzOnDragLeave:[{type:r.Output}],nzOnDrop:[{type:r.Output}],nzOnDragEnd:[{type:r.Output}]},f([d.InputBoolean(),z.WithConfig("tree",!1),S("design:type",Boolean)],n.prototype,"nzShowIcon",void 0),f([d.InputBoolean(),z.WithConfig("tree",!1),S("design:type",Boolean)],n.prototype,"nzHideUnMatched",void 0),f([d.InputBoolean(),z.WithConfig("tree",!1),S("design:type",Boolean)],n.prototype,"nzBlockNode",void 0),f([d.InputBoolean(),S("design:type",Object)],n.prototype,"nzExpandAll",void 0),f([d.InputBoolean(),S("design:type",Object)],n.prototype,"nzSelectMode",void 0),f([d.InputBoolean(),S("design:type",Object)],n.prototype,"nzCheckStrictly",void 0),f([d.InputBoolean(),S("design:type",Boolean)],n.prototype,"nzShowExpand",void 0),f([d.InputBoolean(),S("design:type",Object)],n.prototype,"nzShowLine",void 0),f([d.InputBoolean(),S("design:type",Object)],n.prototype,"nzCheckable",void 0),f([d.InputBoolean(),S("design:type",Object)],n.prototype,"nzAsyncData",void 0),f([d.InputBoolean(),S("design:type",Boolean)],n.prototype,"nzDraggable",void 0),f([d.InputBoolean(),S("design:type",Object)],n.prototype,"nzMultiple",void 0),n}(s.NzTreeBase);var I=function(){function e(){}return e.decorators=[{type:r.NgModule,args:[{imports:[n.CommonModule,a.NzOutletModule,c.NzIconModule,i.NzNoAnimationModule,o.NzHighlightModule,t.ScrollingModule],declarations:[T,k,m,b,C,E],exports:[T,k,m]}]}],e}();Object.defineProperty(e,"NzTreeNode",{enumerable:!0,get:function(){return s.NzTreeNode}}),e.NzTreeComponent=T,e.NzTreeIndentComponent=m,e.NzTreeModule=I,e.NzTreeNodeCheckboxComponent=C,e.NzTreeNodeComponent=k,e.NzTreeNodeSwitcherComponent=b,e.NzTreeNodeTitleComponent=E,e.NzTreeService=D,e.NzTreeServiceFactory=x,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=ng-zorro-antd-tree.umd.min.js.map