UNPKG

63.2 kBSource Map (JSON)View Raw
1{"version":3,"sources":["ng://primeng/tree/tree.ts"],"names":["UITreeNode","tree","this","prototype","ngOnInit","node","parent","parentNode","syncNodeOption","value","getNodeWithKey","key","getIcon","icon","expanded","children","length","expandedIcon","collapsedIcon","UITreeNode_1","ICON_CLASS","isLeaf","isNodeLeaf","toggle","event","collapse","expand","onNodeExpand","emit","originalEvent","onNodeCollapse","onNodeClick","onNodeKeydown","which","onNodeTouchEnd","onNodeRightClick","isSelected","onDropPoint","position","_this","preventDefault","dragNode","dragNodeIndex","dragNodeScope","isValidDropPointIndex","dragNodeTree","index","allowDrop","validateDrop","onNodeDrop","dropNode","dropIndex","accept","processPointDrop","draghoverPrev","draghoverNext","newNodeList","dragNodeSubNodes","splice","push","dragDropService","stopDrag","subNodes","onDropPointDragOver","dataTransfer","dropEffect","onDropPointDragEnter","onDropPointDragLeave","onDragStart","draggableNodes","draggable","setData","startDrag","scope","draggableScope","onDragStop","onDropNodeDragOver","droppableNodes","stopPropagation","onDropNode","droppable","dragNode_1","processNodeDrop","draghoverNode","onDropNodeDragEnter","onDropNodeDragLeave","rect","currentTarget","getBoundingClientRect","x","left","width","y","Math","floor","top","height","onKeyDown","nodeElement","target","parentElement","nodeName","listElement","focusNode","nextNodeElement","nextElementSibling","nextSiblingAncestor","findNextSiblingOfAncestor","previousElementSibling","findLastVisibleDescendant","parentNodeElement","getParentNodeElement","childrenListElement","Array","from","find","el","DomHandler","hasClass","lastChildElement","tagName","element","focus","Inject","args","forwardRef","Tree","__decorate","Input","Component","selector","template","__param","selectionChange","EventEmitter","onNodeSelect","onNodeUnselect","onNodeContextMenuSelect","layout","metaKeySelection","propagateSelectionUp","propagateSelectionDown","loadingIcon","emptyMessage","filterBy","filterMode","onFilter","nodeTrackBy","item","dragStartSubscription","dragStart$","subscribe","dragStopSubscription","dragStop$","dragHover","Object","defineProperty","ngAfterContentInit","templates","templateMap","forEach","name","eventTarget","selectionMode","selectable","hasFilteredNodes","index_1","findIndexInSelection","selected","isCheckboxSelectionMode","propagateDown","selection","filter","val","i","propagateUp","__spread","nodeTouched","metaKey","ctrlKey","isSingleSelectionMode","isMultipleSelectionMode","contextMenu","className","indexOf","show","selectedNode","parentNodes","option","_node","filteredNodes","nodes","nodes_1","__values","nodes_1_1","next","done","matchedNode","select","selectedCount","childPartialSelected","_b","_c","child","partialSelected","index_2","leaf","getRootNode","getTemplateForNode","type","onDragOver","onDrop","onDragEnter","onDragLeave","isValidDragScope","allow","parent_1","dragScope","dropScope","droppableScope","dropScope_1","dropScope_1_1","s","dragScope_1","e_5","dragScope_1_1","_filter","filterValue","searchFields","split","filterText","ObjectUtils","removeAccents","toLocaleLowerCase","filterLocale","isStrictMode","copyNode","__assign","paramsWithoutNode","findFilteredNodes","isFilterMatched","filteredValue","matched","childNodes","childNodes_1","childNodes_1_1","childNode","copyChildNode","_a","searchFields_1","searchFields_1_1","field","String","resolveFieldData","getBlockableElement","nativeElement","ngOnDestroy","unsubscribe","ElementRef","TreeDragDropService","decorators","Optional","Output","ContentChildren","PrimeTemplate","changeDetection","ChangeDetectionStrategy","Default","TreeModule","NgModule","imports","CommonModule","exports","SharedModule","declarations"],"mappings":"+2DAAAA,EAAA,WA0GI,SAAAA,EAA4CC,GACxCC,KAAKD,KAAOA,QA0WpB,SA7XaD,EA4BTA,EAAAG,UAAAC,SAAA,WACIF,KAAKG,KAAKC,OAASJ,KAAKK,WAEpBL,KAAKK,YACLL,KAAKD,KAAKO,eAAeN,KAAKG,KAAMH,KAAKD,KAAKQ,MAAO,SAAUP,KAAKD,KAAKS,eAAeR,KAAKK,WAAWI,IAAKT,KAAKD,KAAKQ,SAI/HT,EAAAG,UAAAS,QAAA,WACI,IAAIC,EAOJ,OAJIA,EADAX,KAAKG,KAAKQ,KACHX,KAAKG,KAAKQ,KAEVX,KAAKG,KAAKS,UAAYZ,KAAKG,KAAKU,UAAYb,KAAKG,KAAKU,SAASC,OAASd,KAAKG,KAAKY,aAAef,KAAKG,KA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q","sourcesContent":["import {NgModule,Component,Input,AfterContentInit,OnDestroy,Output,EventEmitter,OnInit,\n ContentChildren,QueryList,TemplateRef,Inject,ElementRef,forwardRef,ChangeDetectionStrategy} from '@angular/core';\nimport {Optional} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {TreeNode} from 'primeng/api';\nimport {SharedModule} from 'primeng/api';\nimport {PrimeTemplate} from 'primeng/api';\nimport {TreeDragDropService} from 'primeng/api';\nimport {Subscription} from 'rxjs';\nimport {BlockableUI} from 'primeng/api';\nimport {ObjectUtils} from 'primeng/utils';\nimport {DomHandler} from 'primeng/dom';\n\n@Component({\n selector: 'p-treeNode',\n template: `\n <ng-template [ngIf]=\"node\">\n <li *ngIf=\"tree.droppableNodes\" class=\"ui-treenode-droppoint\" [ngClass]=\"{'ui-treenode-droppoint-active ui-state-highlight':draghoverPrev}\"\n (drop)=\"onDropPoint($event,-1)\" (dragover)=\"onDropPointDragOver($event)\" (dragenter)=\"onDropPointDragEnter($event,-1)\" (dragleave)=\"onDropPointDragLeave($event)\"></li>\n <li *ngIf=\"!tree.horizontal\" role=\"treeitem\" [ngClass]=\"['ui-treenode',node.styleClass||'', isLeaf() ? 'ui-treenode-leaf': '']\">\n <div class=\"ui-treenode-content\" (click)=\"onNodeClick($event)\" (contextmenu)=\"onNodeRightClick($event)\" (touchend)=\"onNodeTouchEnd()\"\n (drop)=\"onDropNode($event)\" (dragover)=\"onDropNodeDragOver($event)\" (dragenter)=\"onDropNodeDragEnter($event)\" (dragleave)=\"onDropNodeDragLeave($event)\"\n [draggable]=\"tree.draggableNodes\" (dragstart)=\"onDragStart($event)\" (dragend)=\"onDragStop($event)\" [attr.tabindex]=\"0\"\n [ngClass]=\"{'ui-treenode-selectable':tree.selectionMode && node.selectable !== false,'ui-treenode-dragover':draghoverNode, 'ui-treenode-content-selected':isSelected()}\"\n (keydown)=\"onKeyDown($event)\" [attr.aria-posinset]=\"this.index + 1\" [attr.aria-expanded]=\"this.node.expanded\" [attr.aria-selected]=\"isSelected()\" [attr.aria-label]=\"node.label\">\n <span class=\"ui-tree-toggler pi pi-fw ui-unselectable-text\" [ngClass]=\"{'pi-caret-right':!node.expanded,'pi-caret-down':node.expanded}\"\n (click)=\"toggle($event)\"></span\n ><div class=\"ui-chkbox\" *ngIf=\"tree.selectionMode == 'checkbox'\" [attr.aria-checked]=\"isSelected()\"><div class=\"ui-chkbox-box ui-widget ui-corner-all ui-state-default\" [ngClass]=\"{'ui-state-disabled': node.selectable === false}\">\n <span class=\"ui-chkbox-icon ui-clickable pi\"\n [ngClass]=\"{'pi-check':isSelected(),'pi-minus':node.partialSelected}\"></span></div></div\n ><span [class]=\"getIcon()\" *ngIf=\"node.icon||node.expandedIcon||node.collapsedIcon\"></span\n ><span class=\"ui-treenode-label ui-corner-all\"\n [ngClass]=\"{'ui-state-highlight':isSelected()}\">\n <span *ngIf=\"!tree.getTemplateForNode(node)\">{{node.label}}</span>\n <span *ngIf=\"tree.getTemplateForNode(node)\">\n <ng-container *ngTemplateOutlet=\"tree.getTemplateForNode(node); context: {$implicit: node}\"></ng-container>\n </span>\n </span>\n </div>\n <ul class=\"ui-treenode-children\" style=\"display: none;\" *ngIf=\"node.children && node.expanded\" [style.display]=\"node.expanded ? 'block' : 'none'\" role=\"group\">\n <p-treeNode *ngFor=\"let childNode of node.children;let firstChild=first;let lastChild=last; let index=index; trackBy: tree.nodeTrackBy\" [node]=\"childNode\" [parentNode]=\"node\"\n [firstChild]=\"firstChild\" [lastChild]=\"lastChild\" [index]=\"index\"></p-treeNode>\n </ul>\n </li>\n <li *ngIf=\"tree.droppableNodes&&lastChild\" class=\"ui-treenode-droppoint\" [ngClass]=\"{'ui-treenode-droppoint-active ui-state-highlight':draghoverNext}\"\n (drop)=\"onDropPoint($event,1)\" (dragover)=\"onDropPointDragOver($event)\" (dragenter)=\"onDropPointDragEnter($event,1)\" (dragleave)=\"onDropPointDragLeave($event)\"></li>\n <table *ngIf=\"tree.horizontal\" [class]=\"node.styleClass\">\n <tbody>\n <tr>\n <td class=\"ui-treenode-connector\" *ngIf=\"!root\">\n <table class=\"ui-treenode-connector-table\">\n <tbody>\n <tr>\n <td [ngClass]=\"{'ui-treenode-connector-line':!firstChild}\"></td>\n </tr>\n <tr>\n <td [ngClass]=\"{'ui-treenode-connector-line':!lastChild}\"></td>\n </tr>\n </tbody>\n </table>\n </td>\n <td class=\"ui-treenode\" [ngClass]=\"{'ui-treenode-collapsed':!node.expanded}\">\n <div class=\"ui-treenode-content ui-state-default ui-corner-all\" tabindex=\"0\"\n [ngClass]=\"{'ui-treenode-selectable':tree.selectionMode,'ui-state-highlight':isSelected()}\" (click)=\"onNodeClick($event)\" (contextmenu)=\"onNodeRightClick($event)\"\n (touchend)=\"onNodeTouchEnd()\" (keydown)=\"onNodeKeydown($event)\">\n <span class=\"ui-tree-toggler pi pi-fw ui-unselectable-text\" [ngClass]=\"{'pi-plus':!node.expanded,'pi-minus':node.expanded}\" *ngIf=\"!isLeaf()\"\n (click)=\"toggle($event)\"></span\n ><span [class]=\"getIcon()\" *ngIf=\"node.icon||node.expandedIcon||node.collapsedIcon\"></span\n ><span class=\"ui-treenode-label ui-corner-all\">\n <span *ngIf=\"!tree.getTemplateForNode(node)\">{{node.label}}</span>\n <span *ngIf=\"tree.getTemplateForNode(node)\">\n <ng-container *ngTemplateOutlet=\"tree.getTemplateForNode(node); context: {$implicit: node}\"></ng-container>\n </span>\n </span>\n </div>\n </td>\n <td class=\"ui-treenode-children-container\" *ngIf=\"node.children && node.expanded\" [style.display]=\"node.expanded ? 'table-cell' : 'none'\">\n <div class=\"ui-treenode-children\">\n <p-treeNode *ngFor=\"let childNode of node.children;let firstChild=first;let lastChild=last; trackBy: tree.nodeTrackBy\" [node]=\"childNode\"\n [firstChild]=\"firstChild\" [lastChild]=\"lastChild\"></p-treeNode>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </ng-template>\n `\n})\nexport class UITreeNode implements OnInit {\n\n static ICON_CLASS: string = 'ui-treenode-icon ';\n\n @Input() node: TreeNode;\n\n @Input() parentNode: TreeNode;\n\n @Input() root: boolean;\n\n @Input() index: number;\n\n @Input() firstChild: boolean;\n\n @Input() lastChild: boolean;\n\n tree: Tree;\n\n constructor(@Inject(forwardRef(() => Tree)) tree) {\n this.tree = tree as Tree;\n }\n\n draghoverPrev: boolean;\n\n draghoverNext: boolean;\n\n draghoverNode: boolean\n\n ngOnInit() {\n this.node.parent = this.parentNode;\n\n if (this.parentNode) {\n this.tree.syncNodeOption(this.node, this.tree.value, 'parent', this.tree.getNodeWithKey(this.parentNode.key, this.tree.value));\n }\n }\n\n getIcon() {\n let icon: string;\n\n if (this.node.icon)\n icon = this.node.icon;\n else\n icon = this.node.expanded && this.node.children && this.node.children.length ? this.node.expandedIcon : this.node.collapsedIcon;\n\n return UITreeNode.ICON_CLASS + ' ' + icon;\n }\n\n isLeaf() {\n return this.tree.isNodeLeaf(this.node);\n }\n\n toggle(event: Event) {\n if (this.node.expanded)\n this.collapse(event);\n else\n this.expand(event);\n }\n\n expand(event: Event) {\n this.node.expanded = true;\n this.tree.onNodeExpand.emit({originalEvent: event, node: this.node});\n }\n\n collapse(event: Event) {\n this.node.expanded = false;\n this.tree.onNodeCollapse.emit({originalEvent: event, node: this.node});\n }\n\n onNodeClick(event: MouseEvent) {\n this.tree.onNodeClick(event, this.node);\n }\n\n onNodeKeydown(event: KeyboardEvent) {\n if (event.which === 13) {\n this.tree.onNodeClick(event, this.node);\n }\n }\n\n onNodeTouchEnd() {\n this.tree.onNodeTouchEnd();\n }\n\n onNodeRightClick(event: MouseEvent) {\n this.tree.onNodeRightClick(event, this.node);\n }\n\n isSelected() {\n return this.tree.isSelected(this.node);\n }\n\n onDropPoint(event: Event, position: number) {\n event.preventDefault();\n let dragNode = this.tree.dragNode;\n let dragNodeIndex = this.tree.dragNodeIndex;\n let dragNodeScope = this.tree.dragNodeScope;\n let isValidDropPointIndex = this.tree.dragNodeTree === this.tree ? (position === 1 || dragNodeIndex !== this.index - 1) : true;\n\n if (this.tree.allowDrop(dragNode, this.node, dragNodeScope) && isValidDropPointIndex) {\n if (this.tree.validateDrop) {\n this.tree.onNodeDrop.emit({\n originalEvent: event,\n dragNode: dragNode,\n dropNode: this.node,\n dropIndex: this.index,\n accept: () => {\n this.processPointDrop(dragNode, dragNodeIndex, position);\n }\n });\n }\n else {\n this.processPointDrop(dragNode, dragNodeIndex, position);\n this.tree.onNodeDrop.emit({\n originalEvent: event,\n dragNode: dragNode,\n dropNode: this.node,\n dropIndex: this.index\n });\n }\n }\n\n this.draghoverPrev = false;\n this.draghoverNext = false;\n }\n\n processPointDrop(dragNode, dragNodeIndex, position) {\n let newNodeList = this.node.parent ? this.node.parent.children : this.tree.value;\n this.tree.dragNodeSubNodes.splice(dragNodeIndex, 1);\n let dropIndex = this.index;\n\n if (position < 0) {\n dropIndex = (this.tree.dragNodeSubNodes === newNodeList) ? ((this.tree.dragNodeIndex > this.index) ? this.index : this.index - 1) : this.index;\n newNodeList.splice(dropIndex, 0, dragNode);\n }\n else {\n dropIndex = newNodeList.length;\n newNodeList.push(dragNode);\n }\n\n this.tree.dragDropService.stopDrag({\n node: dragNode,\n subNodes: this.node.parent ? this.node.parent.children : this.tree.value,\n index: dragNodeIndex\n });\n }\n\n onDropPointDragOver(event) {\n event.dataTransfer.dropEffect = 'move';\n event.preventDefault();\n }\n\n onDropPointDragEnter(event: Event, position: number) {\n if (this.tree.allowDrop(this.tree.dragNode, this.node, this.tree.dragNodeScope)) {\n if (position < 0)\n this.draghoverPrev = true;\n else\n this.draghoverNext = true;\n }\n }\n\n onDropPointDragLeave(event: Event) {\n this.draghoverPrev = false;\n this.draghoverNext = false;\n }\n\n onDragStart(event) {\n if (this.tree.draggableNodes && this.node.draggable !== false) {\n event.dataTransfer.setData(\"text\", \"data\");\n\n this.tree.dragDropService.startDrag({\n tree: this,\n node: this.node,\n subNodes: this.node.parent ? this.node.parent.children : this.tree.value,\n index: this.index,\n scope: this.tree.draggableScope\n });\n }\n else {\n event.preventDefault();\n }\n }\n\n onDragStop(event) {\n this.tree.dragDropService.stopDrag({\n node: this.node,\n subNodes: this.node.parent ? this.node.parent.children : this.tree.value,\n index: this.index\n });\n }\n\n onDropNodeDragOver(event) {\n event.dataTransfer.dropEffect = 'move';\n if (this.tree.droppableNodes) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n\n onDropNode(event) {\n if (this.tree.droppableNodes && this.node.droppable !== false) {\n event.preventDefault();\n event.stopPropagation();\n let dragNode = this.tree.dragNode;\n if (this.tree.allowDrop(dragNode, this.node, this.tree.dragNodeScope)) {\n if (this.tree.validateDrop) {\n this.tree.onNodeDrop.emit({\n originalEvent: event,\n dragNode: dragNode,\n dropNode: this.node,\n index: this.index,\n accept: () => {\n this.processNodeDrop(dragNode);\n }\n });\n }\n else {\n this.processNodeDrop(dragNode);\n this.tree.onNodeDrop.emit({\n originalEvent: event,\n dragNode: dragNode,\n dropNode: this.node,\n index: this.index\n });\n }\n }\n }\n\n this.draghoverNode = false;\n }\n\n processNodeDrop(dragNode) {\n let dragNodeIndex = this.tree.dragNodeIndex;\n this.tree.dragNodeSubNodes.splice(dragNodeIndex, 1);\n\n if (this.node.children)\n this.node.children.push(dragNode);\n else\n this.node.children = [dragNode];\n\n this.tree.dragDropService.stopDrag({\n node: dragNode,\n subNodes: this.node.parent ? this.node.parent.children : this.tree.value,\n index: this.tree.dragNodeIndex\n });\n\n\n }\n\n onDropNodeDragEnter(event) {\n if (this.tree.droppableNodes && this.node.droppable !== false && this.tree.allowDrop(this.tree.dragNode, this.node, this.tree.dragNodeScope)) {\n this.draghoverNode = true;\n }\n }\n\n onDropNodeDragLeave(event) {\n if (this.tree.droppableNodes) {\n let rect = event.currentTarget.getBoundingClientRect();\n if (event.x > rect.left + rect.width || event.x < rect.left || event.y >= Math.floor(rect.top + rect.height) || event.y < rect.top) {\n this.draghoverNode = false;\n }\n }\n }\n\n onKeyDown(event: KeyboardEvent) {\n const nodeElement = (<HTMLDivElement> event.target).parentElement.parentElement;\n\n if (nodeElement.nodeName !== 'P-TREENODE') {\n return;\n }\n\n switch (event.which) {\n //down arrow\n case 40:\n const listElement = (this.tree.droppableNodes) ? nodeElement.children[1].children[1] : nodeElement.children[0].children[1];\n if (listElement && listElement.children.length > 0) {\n this.focusNode(listElement.children[0]);\n }\n else {\n const nextNodeElement = nodeElement.nextElementSibling;\n if (nextNodeElement) {\n this.focusNode(nextNodeElement);\n }\n else {\n let nextSiblingAncestor = this.findNextSiblingOfAncestor(nodeElement);\n if (nextSiblingAncestor) {\n this.focusNode(nextSiblingAncestor);\n }\n }\n }\n\n event.preventDefault();\n break;\n\n //up arrow\n case 38:\n if (nodeElement.previousElementSibling) {\n this.focusNode(this.findLastVisibleDescendant(nodeElement.previousElementSibling));\n }\n else {\n let parentNodeElement = this.getParentNodeElement(nodeElement);\n if (parentNodeElement) {\n this.focusNode(parentNodeElement);\n }\n }\n\n event.preventDefault();\n break;\n\n //right arrow\n case 39:\n if (!this.node.expanded && !this.tree.isNodeLeaf(this.node)) {\n this.expand(event);\n }\n\n event.preventDefault();\n break;\n\n //left arrow\n case 37:\n if (this.node.expanded) {\n this.collapse(event);\n }\n else {\n let parentNodeElement = this.getParentNodeElement(nodeElement);\n if (parentNodeElement) {\n this.focusNode(parentNodeElement);\n }\n }\n\n event.preventDefault();\n break;\n\n //enter\n case 13:\n this.tree.onNodeClick(event, this.node);\n event.preventDefault();\n break;\n\n default:\n //no op\n break;\n }\n }\n\n findNextSiblingOfAncestor(nodeElement) {\n let parentNodeElement = this.getParentNodeElement(nodeElement);\n if (parentNodeElement) {\n if (parentNodeElement.nextElementSibling)\n return parentNodeElement.nextElementSibling;\n else\n return this.findNextSiblingOfAncestor(parentNodeElement);\n }\n else {\n return null;\n }\n }\n\n findLastVisibleDescendant(nodeElement) {\n const listElement = <HTMLElement> Array.from(nodeElement.children).find(el => DomHandler.hasClass(el, 'ui-treenode'));\n const childrenListElement = listElement.children[1];\n if (childrenListElement && childrenListElement.children.length > 0) {\n const lastChildElement = childrenListElement.children[childrenListElement.children.length - 1];\n\n return this.findLastVisibleDescendant(lastChildElement);\n }\n else {\n return nodeElement;\n }\n }\n\n getParentNodeElement(nodeElement) {\n const parentNodeElement = nodeElement.parentElement.parentElement.parentElement;\n\n return parentNodeElement.tagName === 'P-TREENODE' ? parentNodeElement : null;\n }\n\n focusNode(element) {\n if (this.tree.droppableNodes)\n element.children[1].children[0].focus();\n else\n element.children[0].children[0].focus();\n }\n}\n\n@Component({\n selector: 'p-tree',\n template: `\n <div [ngClass]=\"{'ui-tree ui-widget ui-widget-content ui-corner-all':true,'ui-tree-selectable':selectionMode,'ui-treenode-dragover':dragHover,'ui-tree-loading': loading}\" [ngStyle]=\"style\" [class]=\"styleClass\" *ngIf=\"!horizontal\"\n (drop)=\"onDrop($event)\" (dragover)=\"onDragOver($event)\" (dragenter)=\"onDragEnter($event)\" (dragleave)=\"onDragLeave($event)\">\n <div class=\"ui-tree-loading-mask ui-widget-overlay\" *ngIf=\"loading\"></div>\n <div class=\"ui-tree-loading-content\" *ngIf=\"loading\">\n <i [class]=\"'ui-tree-loading-icon pi-spin ' + loadingIcon\"></i>\n </div>\n <div *ngIf=\"filter\" class=\"ui-tree-filter-container\">\n <input #filter type=\"text\" autocomplete=\"off\" class=\"ui-tree-filter ui-inputtext ui-widget ui-state-default ui-corner-all\" [attr.placeholder]=\"filterPlaceholder\"\n (keydown.enter)=\"$event.preventDefault()\" (input)=\"_filter($event)\">\n <span class=\"ui-tree-filter-icon pi pi-search\"></span>\n </div>\n <ul class=\"ui-tree-container\" *ngIf=\"getRootNode()\" role=\"tree\" [attr.aria-label]=\"ariaLabel\" [attr.aria-labelledby]=\"ariaLabelledBy\">\n <p-treeNode *ngFor=\"let node of getRootNode(); let firstChild=first;let lastChild=last; let index=index; trackBy: nodeTrackBy\" [node]=\"node\"\n [firstChild]=\"firstChild\" [lastChild]=\"lastChild\" [index]=\"index\"></p-treeNode>\n </ul>\n <div class=\"ui-tree-empty-message\" *ngIf=\"!loading && (value == null || value.length === 0)\">{{emptyMessage}}</div>\n </div>\n <div [ngClass]=\"{'ui-tree ui-tree-horizontal ui-widget ui-widget-content ui-corner-all':true,'ui-tree-selectable':selectionMode}\" [ngStyle]=\"style\" [class]=\"styleClass\" *ngIf=\"horizontal\">\n <div class=\"ui-tree-loading ui-widget-overlay\" *ngIf=\"loading\"></div>\n <div class=\"ui-tree-loading-content\" *ngIf=\"loading\">\n <i [class]=\"'ui-tree-loading-icon pi-spin ' + loadingIcon\"></i>\n </div>\n <table *ngIf=\"value&&value[0]\">\n <p-treeNode [node]=\"value[0]\" [root]=\"true\"></p-treeNode>\n </table>\n <div class=\"ui-tree-empty-message\" *ngIf=\"!loading && (value == null || value.length === 0)\">{{emptyMessage}}</div>\n </div>\n `,\n changeDetection: ChangeDetectionStrategy.Default\n})\nexport class Tree implements OnInit,AfterContentInit,OnDestroy,BlockableUI {\n\n @Input() value: TreeNode[];\n\n @Input() selectionMode: string;\n\n @Input() selection: any;\n\n @Output() selectionChange: EventEmitter<any> = new EventEmitter();\n\n @Output() onNodeSelect: EventEmitter<any> = new EventEmitter();\n\n @Output() onNodeUnselect: EventEmitter<any> = new EventEmitter();\n\n @Output() onNodeExpand: EventEmitter<any> = new EventEmitter();\n\n @Output() onNodeCollapse: EventEmitter<any> = new EventEmitter();\n\n @Output() onNodeContextMenuSelect: EventEmitter<any> = new EventEmitter();\n\n @Output() onNodeDrop: EventEmitter<any> = new EventEmitter();\n\n @Input() style: any;\n\n @Input() styleClass: string;\n\n @Input() contextMenu: any;\n\n @Input() layout: string = 'vertical';\n\n @Input() draggableScope: any;\n\n @Input() droppableScope: any;\n\n @Input() draggableNodes: boolean;\n\n @Input() droppableNodes: boolean;\n\n @Input() metaKeySelection: boolean = true;\n\n @Input() propagateSelectionUp: boolean = true;\n\n @Input() propagateSelectionDown: boolean = true;\n\n @Input() loading: boolean;\n\n @Input() loadingIcon: string = 'pi pi-spinner';\n\n @Input() emptyMessage: string = 'No records found';\n\n @Input() ariaLabel: string;\n\n @Input() ariaLabelledBy: string;\n\n @Input() validateDrop: boolean;\n\n @Input() filter: boolean;\n\n @Input() filterBy: string = 'label';\n\n @Input() filterMode: string = 'lenient';\n\n @Input() filterPlaceholder: string;\n\n @Input() filterLocale: string;\n\n @Output() onFilter: EventEmitter<any> = new EventEmitter();\n\n @Input() nodeTrackBy: Function = (index: number, item: any) => item;\n\n @ContentChildren(PrimeTemplate) templates: QueryList<any>;\n\n public templateMap: any;\n\n public nodeTouched: boolean;\n\n public dragNodeTree: Tree;\n\n public dragNode: TreeNode;\n\n public dragNodeSubNodes: TreeNode[];\n\n public dragNodeIndex: number;\n\n public dragNodeScope: any;\n\n public dragHover: boolean;\n\n public dragStartSubscription: Subscription;\n\n public dragStopSubscription: Subscription;\n\n public filteredNodes: TreeNode[];\n\n constructor(public el: ElementRef, @Optional() public dragDropService: TreeDragDropService) {}\n\n ngOnInit() {\n if (this.droppableNodes) {\n this.dragStartSubscription = this.dragDropService.dragStart$.subscribe(\n event => {\n this.dragNodeTree = event.tree;\n this.dragNode = event.node;\n this.dragNodeSubNodes = event.subNodes;\n this.dragNodeIndex = event.index;\n this.dragNodeScope = event.scope;\n });\n\n this.dragStopSubscription = this.dragDropService.dragStop$.subscribe(\n event => {\n this.dragNodeTree = null;\n this.dragNode = null;\n this.dragNodeSubNodes = null;\n this.dragNodeIndex = null;\n this.dragNodeScope = null;\n this.dragHover = false;\n });\n }\n }\n\n get horizontal(): boolean {\n return this.layout == 'horizontal';\n }\n\n ngAfterContentInit() {\n if (this.templates.length) {\n this.templateMap = {};\n }\n\n this.templates.forEach((item) => {\n this.templateMap[item.name] = item.template;\n });\n }\n\n onNodeClick(event, node: TreeNode) {\n let eventTarget = (<Element> event.target);\n\n if (DomHandler.hasClass(eventTarget, 'ui-tree-toggler')) {\n return;\n }\n else if (this.selectionMode) {\n if (node.selectable === false) {\n return;\n }\n\n if (this.hasFilteredNodes()) {\n node = this.getNodeWithKey(node.key, this.value);\n\n if (!node) {\n return;\n }\n }\n\n let index = this.findIndexInSelection(node);\n let selected = (index >= 0);\n\n if (this.isCheckboxSelectionMode()) {\n if (selected) {\n if (this.propagateSelectionDown)\n this.propagateDown(node, false);\n else\n this.selection = this.selection.filter((val,i) => i!=index);\n\n if (this.propagateSelectionUp && node.parent) {\n this.propagateUp(node.parent, false);\n }\n\n this.selectionChange.emit(this.selection);\n this.onNodeUnselect.emit({originalEvent: event, node: node});\n }\n else {\n if (this.propagateSelectionDown)\n this.propagateDown(node, true);\n else\n this.selection = [...this.selection||[],node];\n\n if (this.propagateSelectionUp && node.parent) {\n this.propagateUp(node.parent, true);\n }\n\n this.selectionChange.emit(this.selection);\n this.onNodeSelect.emit({originalEvent: event, node: node});\n }\n }\n else {\n let metaSelection = this.nodeTouched ? false : this.metaKeySelection;\n\n if (metaSelection) {\n let metaKey = (event.metaKey||event.ctrlKey);\n\n if (selected && metaKey) {\n if (this.isSingleSelectionMode()) {\n this.selectionChange.emit(null);\n }\n else {\n this.selection = this.selection.filter((val,i) => i!=index);\n this.selectionChange.emit(this.selection);\n }\n\n this.onNodeUnselect.emit({originalEvent: event, node: node});\n }\n else {\n if (this.isSingleSelectionMode()) {\n this.selectionChange.emit(node);\n }\n else if (this.isMultipleSelectionMode()) {\n this.selection = (!metaKey) ? [] : this.selection||[];\n this.selection = [...this.selection,node];\n this.selectionChange.emit(this.selection);\n }\n\n this.onNodeSelect.emit({originalEvent: event, node: node});\n }\n }\n else {\n if (this.isSingleSelectionMode()) {\n if (selected) {\n this.selection = null;\n this.onNodeUnselect.emit({originalEvent: event, node: node});\n }\n else {\n this.selection = node;\n this.onNodeSelect.emit({originalEvent: event, node: node});\n }\n }\n else {\n if (selected) {\n this.selection = this.selection.filter((val,i) => i!=index);\n this.onNodeUnselect.emit({originalEvent: event, node: node});\n }\n else {\n this.selection = [...this.selection||[],node];\n this.onNodeSelect.emit({originalEvent: event, node: node});\n }\n }\n\n this.selectionChange.emit(this.selection);\n }\n }\n }\n\n this.nodeTouched = false;\n }\n\n onNodeTouchEnd() {\n this.nodeTouched = true;\n }\n\n onNodeRightClick(event: MouseEvent, node: TreeNode) {\n if (this.contextMenu) {\n let eventTarget = (<Element> event.target);\n\n if (eventTarget.className && eventTarget.className.indexOf('ui-tree-toggler') === 0) {\n return;\n }\n else {\n let index = this.findIndexInSelection(node);\n let selected = (index >= 0);\n\n if (!selected) {\n if (this.isSingleSelectionMode())\n this.selectionChange.emit(node);\n else\n this.selectionChange.emit([node]);\n }\n\n this.contextMenu.show(event);\n this.onNodeContextMenuSelect.emit({originalEvent: event, node: node});\n }\n }\n }\n\n findIndexInSelection(node: TreeNode) {\n let index: number = -1;\n\n if (this.selectionMode && this.selection) {\n if (this.isSingleSelectionMode()) {\n let areNodesEqual = (this.selection.key && this.selection.key === node.key) || this.selection == node;\n index = areNodesEqual ? 0 : - 1;\n }\n else {\n for(let i = 0; i < this.selection.length; i++) {\n let selectedNode = this.selection[i];\n let areNodesEqual = (selectedNode.key && selectedNode.key === node.key) || selectedNode == node;\n if (areNodesEqual) {\n index = i;\n break;\n }\n }\n }\n }\n\n return index;\n }\n\n syncNodeOption(node, parentNodes, option, value?: any) {\n // to synchronize the node option between the filtered nodes and the original nodes(this.value)\n const _node = this.hasFilteredNodes() ? this.getNodeWithKey(node.key, parentNodes) : null;\n if (_node) {\n _node[option] = value||node[option];\n }\n }\n\n hasFilteredNodes() {\n return this.filter && this.filteredNodes && this.filteredNodes.length;\n }\n\n getNodeWithKey(key: string, nodes: TreeNode[]) {\n for (let node of nodes) {\n if (node.key === key) {\n return node;\n }\n\n if (node.children) {\n let matchedNode = this.getNodeWithKey(key, node.children);\n if (matchedNode) {\n return matchedNode;\n }\n }\n }\n }\n\n propagateUp(node: TreeNode, select: boolean) {\n if (node.children && node.children.length) {\n let selectedCount: number = 0;\n let childPartialSelected: boolean = false;\n for(let child of node.children) {\n if (this.isSelected(child)) {\n selectedCount++;\n }\n else if (child.partialSelected) {\n childPartialSelected = true;\n }\n }\n\n if (select && selectedCount == node.children.length) {\n this.selection = [...this.selection||[],node];\n node.partialSelected = false;\n }\n else {\n if (!select) {\n let index = this.findIndexInSelection(node);\n if (index >= 0) {\n this.selection = this.selection.filter((val,i) => i!=index);\n }\n }\n\n if (childPartialSelected || selectedCount > 0 && selectedCount != node.children.length)\n node.partialSelected = true;\n else\n node.partialSelected = false;\n }\n\n this.syncNodeOption(node, this.filteredNodes, 'partialSelected');\n }\n\n let parent = node.parent;\n if (parent) {\n this.propagateUp(parent, select);\n }\n }\n\n propagateDown(node: TreeNode, select: boolean) {\n let index = this.findIndexInSelection(node);\n\n if (select && index == -1) {\n this.selection = [...this.selection||[],node];\n }\n else if (!select && index > -1) {\n this.selection = this.selection.filter((val,i) => i!=index);\n }\n\n node.partialSelected = false;\n\n this.syncNodeOption(node, this.filteredNodes, 'partialSelected');\n\n if (node.children && node.children.length) {\n for(let child of node.children) {\n this.propagateDown(child, select);\n }\n }\n }\n\n isSelected(node: TreeNode) {\n return this.findIndexInSelection(node) != -1;\n }\n\n isSingleSelectionMode() {\n return this.selectionMode && this.selectionMode == 'single';\n }\n\n isMultipleSelectionMode() {\n return this.selectionMode && this.selectionMode == 'multiple';\n }\n\n isCheckboxSelectionMode() {\n return this.selectionMode && this.selectionMode == 'checkbox';\n }\n\n isNodeLeaf(node) {\n return node.leaf == false ? false : !(node.children && node.children.length);\n }\n\n getRootNode() {\n return this.filteredNodes ? this.filteredNodes : this.value;\n }\n\n getTemplateForNode(node: TreeNode): TemplateRef<any> {\n if (this.templateMap)\n return node.type ? this.templateMap[node.type] : this.templateMap['default'];\n else\n return null;\n }\n\n onDragOver(event) {\n if (this.droppableNodes && (!this.value || this.value.length === 0)) {\n event.dataTransfer.dropEffect = 'move';\n event.preventDefault();\n }\n }\n\n onDrop(event) {\n if (this.droppableNodes && (!this.value || this.value.length === 0)) {\n event.preventDefault();\n let dragNode = this.dragNode;\n if (this.allowDrop(dragNode, null, this.dragNodeScope)) {\n let dragNodeIndex = this.dragNodeIndex;\n this.dragNodeSubNodes.splice(dragNodeIndex, 1);\n this.value = this.value||[];\n this.value.push(dragNode);\n\n this.dragDropService.stopDrag({\n node: dragNode\n });\n }\n }\n }\n\n onDragEnter(event) {\n if (this.droppableNodes && this.allowDrop(this.dragNode, null, this.dragNodeScope)) {\n this.dragHover = true;\n }\n }\n\n onDragLeave(event) {\n if (this.droppableNodes) {\n let rect = event.currentTarget.getBoundingClientRect();\n if (event.x > rect.left + rect.width || event.x < rect.left || event.y > rect.top + rect.height || event.y < rect.top) {\n this.dragHover = false;\n }\n }\n }\n\n allowDrop(dragNode: TreeNode, dropNode: TreeNode, dragNodeScope: any): boolean {\n if (!dragNode) {\n //prevent random html elements to be dragged\n return false;\n }\n else if (this.isValidDragScope(dragNodeScope)) {\n let allow: boolean = true;\n if (dropNode) {\n if (dragNode === dropNode) {\n allow = false;\n }\n else {\n let parent = dropNode.parent;\n while(parent != null) {\n if (parent === dragNode) {\n allow = false;\n break;\n }\n parent = parent.parent;\n }\n }\n }\n\n return allow;\n }\n else {\n return false;\n }\n }\n\n isValidDragScope(dragScope: any): boolean {\n let dropScope = this.droppableScope;\n\n if (dropScope) {\n if (typeof dropScope === 'string') {\n if (typeof dragScope === 'string')\n return dropScope === dragScope;\n else if (dragScope instanceof Array)\n return (<Array<any>>dragScope).indexOf(dropScope) != -1;\n }\n else if (dropScope instanceof Array) {\n if (typeof dragScope === 'string') {\n return (<Array<any>>dropScope).indexOf(dragScope) != -1;\n }\n else if (dragScope instanceof Array) {\n for(let s of dropScope) {\n for(let ds of dragScope) {\n if (s === ds) {\n return true;\n }\n }\n }\n }\n }\n return false;\n }\n else {\n return true;\n }\n }\n\n _filter(event) {\n let filterValue = event.target.value;\n if (filterValue === '') {\n this.filteredNodes = null;\n }\n else {\n this.filteredNodes = [];\n const searchFields: string[] = this.filterBy.split(',');\n const filterText = ObjectUtils.removeAccents(filterValue).toLocaleLowerCase(this.filterLocale);\n const isStrictMode = this.filterMode === 'strict';\n for(let node of this.value) {\n let copyNode = {...node};\n let paramsWithoutNode = {searchFields, filterText, isStrictMode};\n if ((isStrictMode && (this.findFilteredNodes(copyNode, paramsWithoutNode) || this.isFilterMatched(copyNode, paramsWithoutNode))) ||\n (!isStrictMode && (this.isFilterMatched(copyNode, paramsWithoutNode) || this.findFilteredNodes(copyNode, paramsWithoutNode)))) {\n this.filteredNodes.push(copyNode);\n }\n }\n }\n\n this.onFilter.emit({\n filter: filterValue,\n filteredValue: this.filteredNodes\n });\n }\n\n findFilteredNodes(node, paramsWithoutNode) {\n if (node) {\n let matched = false;\n if (node.children) {\n let childNodes = [...node.children];\n node.children = [];\n for (let childNode of childNodes) {\n let copyChildNode = {...childNode};\n if (this.isFilterMatched(copyChildNode, paramsWithoutNode)) {\n matched = true;\n node.children.push(copyChildNode);\n }\n }\n }\n\n if (matched) {\n node.expanded = true;\n return true;\n }\n }\n }\n\n isFilterMatched(node, {searchFields, filterText, isStrictMode}) {\n let matched = false;\n for(let field of searchFields) {\n let fieldValue = ObjectUtils.removeAccents(String(ObjectUtils.resolveFieldData(node, field))).toLocaleLowerCase(this.filterLocale);\n if (fieldValue.indexOf(filterText) > -1) {\n matched = true;\n }\n }\n\n if (!matched || (isStrictMode && !this.isNodeLeaf(node))) {\n matched = this.findFilteredNodes(node, {searchFields, filterText, isStrictMode}) || matched;\n }\n\n return matched;\n }\n\n getBlockableElement(): HTMLElement {\n return this.el.nativeElement.children[0];\n }\n\n ngOnDestroy() {\n if (this.dragStartSubscription) {\n this.dragStartSubscription.unsubscribe();\n }\n\n if (this.dragStopSubscription) {\n this.dragStopSubscription.unsubscribe();\n }\n }\n}\n@NgModule({\n imports: [CommonModule],\n exports: [Tree,SharedModule],\n declarations: [Tree,UITreeNode]\n})\nexport class TreeModule { }\n"]}
\No newline at end of file