{"version":3,"sources":["../../node_modules/tslib/tslib.es6.js","../../src/app/components/tree/tree.ts"],"names":["Object","create","__values","o","s","Symbol","iterator","m","i","call","length","next","value","done","TypeError","__read","n","r","e","ar","push","error","__spread","arguments","concat","UITreeNode","tree","this","prototype","ngOnInit","node","parent","parentNode","syncNodeOption","getNodeWithKey","key","getIcon","icon","expanded","children","expandedIcon","collapsedIcon","ICON_CLASS","isLeaf","isNodeLeaf","toggle","event","collapse","expand","virtualScroll","updateSerializedValue","onNodeExpand","emit","originalEvent","onNodeCollapse","onNodeClick","onNodeKeydown","which","onNodeTouchEnd","onNodeRightClick","isSelected","onDropPoint","position","_this","preventDefault","dragNode","dragNodeIndex","dragNodeScope","isValidDropPointIndex","dragNodeTree","index","allowDrop","dropParams_1","assign","createDropPointEventMetadata","validateDrop","onNodeDrop","dropNode","dropIndex","accept","processPointDrop","draghoverPrev","draghoverNext","newNodeList","dragNodeSubNodes","splice","dragDropService","stopDrag","subNodes","onDropPointDragOver","dataTransfer","dropEffect","onDropPointDragEnter","onDropPointDragLeave","onDragStart","draggableNodes","draggable","setData","startDrag","scope","draggableScope","onDragStop","onDropNodeDragOver","droppableNodes","stopPropagation","onDropNode","droppable","dropParams_2","createDropNodeEventMetadata","processNodeDrop","draghoverNode","onDropNodeDragEnter","onDropNodeDragLeave","rect","currentTarget","getBoundingClientRect","x","left","width","y","Math","floor","top","height","onKeyDown","nodeElement","target","parentElement","nodeName","contextMenu","containerViewChild","nativeElement","style","display","listElement","focusNode","nextNodeElement","nextElementSibling","nextSiblingAncestor","findNextSiblingOfAncestor","previousElementSibling","findLastVisibleDescendant","parentNodeElement","getParentNodeElement","childrenListElement","Array","from","find","el","DomHandler","hasClass","lastChildElement","tagName","element","focus","Component","args","selector","template","encapsulation","ViewEncapsulation","None","Inject","forwardRef","Tree","Input","selectionChange","EventEmitter","onNodeSelect","onNodeUnselect","onNodeContextMenuSelect","layout","metaKeySelection","propagateSelectionUp","propagateSelectionDown","loadingIcon","emptyMessage","filterBy","filterMode","indentation","trackBy","item","onFilter","dragStartSubscription","dragStart$","subscribe","dragStopSubscription","dragStop$","dragHover","ngOnChanges","simpleChange","scrollHeight","virtualScrollBody","defineProperty","ngAfterContentInit","templates","templateMap","forEach","name","serializedValue","serializeNodes","getRootNode","nodes","level","visible","nodes_1","nodes_1_1","rowNode","eventTarget","selectionMode","selectable","hasFilteredNodes","index_1","findIndexInSelection","selected","isCheckboxSelectionMode","propagateDown","selection","filter","val","propagateUp","nodeTouched","metaKey","ctrlKey","isSingleSelectionMode","isMultipleSelectionMode","className","indexOf","show","selectedNode","parentNodes","option","_node","filteredNodes","nodes_2","nodes_2_1","matchedNode","select","selectedCount","childPartialSelected","_b","_c","child","partialSelected","index_2","leaf","getTemplateForNode","type","onDragOver","onDrop","onDragEnter","onDragLeave","isValidDragScope","allow","dragScope","dropScope","droppableScope","dropScope_1","dropScope_1_1","dragScope_1","e_6","dragScope_1_1","_filter","filterValue","searchFields","split","filterText","ObjectUtils","removeAccents","toLocaleLowerCase","filterLocale","isStrictMode","copyNode","paramsWithoutNode","findFilteredNodes","isFilterMatched","filteredValue","matched","childNodes","childNodes_1","childNodes_1_1","childNode","copyChildNode","_a","searchFields_1","searchFields_1_1","field","String","resolveFieldData","getBlockableElement","ngOnDestroy","unsubscribe","changeDetection","ChangeDetectionStrategy","Default","ElementRef","TreeDragDropService","decorators","Optional","Output","ContentChildren","PrimeTemplate","ViewChild","CdkVirtualScrollViewport","NgModule","imports","CommonModule","ScrollingModule","RippleModule","exports","SharedModule","declarations"],"mappings":";;;;;;;;;;;;;;oFAyG6BA,OAAOC,gBAYpBC,EAASC,GACrB,IAAIC,EAAsB,mBAAXC,QAAyBA,OAAOC,SAAUC,EAAIH,GAAKD,EAAEC,GAAII,EAAI,EAC5E,GAAID,EAAG,OAAOA,EAAEE,KAAKN,GACrB,GAAIA,GAAyB,iBAAbA,EAAEO,OAAqB,MAAO,CAC1CC,KAAM,WAEF,OADIR,GAAKK,GAAKL,EAA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corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import {NgModule,Component,Input,AfterContentInit,OnDestroy,Output,EventEmitter,OnInit,OnChanges,\n ContentChildren,QueryList,TemplateRef,Inject,ElementRef,forwardRef,ChangeDetectionStrategy,SimpleChanges, ViewEncapsulation, ViewChild} from '@angular/core';\nimport {CdkVirtualScrollViewport, ScrollingModule} from '@angular/cdk/scrolling';\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';\nimport {RippleModule} from 'primeng/ripple';\n\n@Component({\n selector: 'p-treeNode',\n template: `\n \n
  • \n
  • \n
    \n \n
    \n
    \n \n
    \n
    \n \n \n {{node.label}}\n \n \n \n \n
    \n \n
  • \n
  • \n \n \n \n \n \n \n \n \n
    \n \n \n \n \n \n \n \n \n \n
    \n
    \n
    \n \n \n \n {{node.label}}\n \n \n \n \n
    \n
    \n
    \n \n
    \n
    \n
    \n `,\n encapsulation: ViewEncapsulation.None\n})\nexport class UITreeNode implements OnInit {\n\n static ICON_CLASS: string = 'p-treenode-icon ';\n\n @Input() rowNode: any;\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 @Input() level: number;\n\n @Input() indentation: number;\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 if (this.tree.virtualScroll) {\n this.tree.updateSerializedValue();\n }\n this.tree.onNodeExpand.emit({originalEvent: event, node: this.node});\n }\n\n collapse(event: Event) {\n this.node.expanded = false;\n if (this.tree.virtualScroll) {\n this.tree.updateSerializedValue();\n }\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 let dropParams = {...this.createDropPointEventMetadata(position)};\n\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(dropParams);\n }\n });\n }\n else {\n this.processPointDrop(dropParams);\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(event) {\n let newNodeList = event.dropNode.parent ? event.dropNode.parent.children : this.tree.value;\n event.dragNodeSubNodes.splice(event.dragNodeIndex, 1);\n let dropIndex = this.index;\n\n if (event.position < 0) {\n dropIndex = (event.dragNodeSubNodes === newNodeList) ? ((event.dragNodeIndex > event.index) ? event.index : event.index - 1) : event.index;\n newNodeList.splice(dropIndex, 0, event.dragNode);\n }\n else {\n dropIndex = newNodeList.length;\n newNodeList.push(event.dragNode);\n }\n\n this.tree.dragDropService.stopDrag({\n node: event.dragNode,\n subNodes: event.dropNode.parent ? event.dropNode.parent.children : this.tree.value,\n index: event.dragNodeIndex\n });\n }\n\n createDropPointEventMetadata(position) {\n return {\n dragNode: this.tree.dragNode,\n dragNodeIndex: this.tree.dragNodeIndex,\n dragNodeSubNodes: this.tree.dragNodeSubNodes,\n dropNode: this.node,\n index: this.index,\n position: position\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 let dragNode = this.tree.dragNode;\n\n if (this.tree.allowDrop(dragNode, this.node, this.tree.dragNodeScope)) {\n let dropParams = {...this.createDropNodeEventMetadata()};\n\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(dropParams);\n }\n });\n }\n else {\n this.processNodeDrop(dropParams);\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 event.preventDefault();\n event.stopPropagation();\n this.draghoverNode = false;\n }\n\n createDropNodeEventMetadata() {\n return {\n dragNode: this.tree.dragNode,\n dragNodeIndex: this.tree.dragNodeIndex,\n dragNodeSubNodes: this.tree.dragNodeSubNodes,\n dropNode: this.node\n };\n }\n\n processNodeDrop(event) {\n let dragNodeIndex = event.dragNodeIndex;\n event.dragNodeSubNodes.splice(dragNodeIndex, 1);\n\n if (event.dropNode.children)\n event.dropNode.children.push(event.dragNode);\n else\n event.dropNode.children = [event.dragNode];\n\n this.tree.dragDropService.stopDrag({\n node: event.dragNode,\n subNodes: event.dropNode.parent ? event.dropNode.parent.children : this.tree.value,\n index: dragNodeIndex\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 = ( event.target).parentElement.parentElement;\n\n if (nodeElement.nodeName !== 'P-TREENODE' || (this.tree.contextMenu && this.tree.contextMenu.containerViewChild.nativeElement.style.display === 'block')) {\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 = Array.from(nodeElement.children).find(el => DomHandler.hasClass(el, 'p-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
    \n
    \n \n
    \n
    \n \n \n
    \n \n
    \n
      \n \n
    \n
    \n
    \n \n \n
      \n \n
    \n
    \n
    \n
    {{emptyMessage}}
    \n
    \n
    \n
    \n \n
    \n \n \n
    \n
    {{emptyMessage}}
    \n
    \n `,\n changeDetection: ChangeDetectionStrategy.Default,\n encapsulation: ViewEncapsulation.None,\n styleUrls: ['./tree.css']\n})\nexport class Tree implements OnInit,AfterContentInit,OnChanges,OnDestroy,BlockableUI {\n\n @Input() value: TreeNode[];\n\n @Input() selectionMode: string;\n\n @Input() selection: any;\n\n @Output() selectionChange: EventEmitter = new EventEmitter();\n\n @Output() onNodeSelect: EventEmitter = new EventEmitter();\n\n @Output() onNodeUnselect: EventEmitter = new EventEmitter();\n\n @Output() onNodeExpand: EventEmitter = new EventEmitter();\n\n @Output() onNodeCollapse: EventEmitter = new EventEmitter();\n\n @Output() onNodeContextMenuSelect: EventEmitter = new EventEmitter();\n\n @Output() onNodeDrop: EventEmitter = 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 @Input() scrollHeight: string;\n\n @Input() virtualScroll: boolean;\n\n @Input() virtualNodeHeight: string;\n\n @Input() minBufferPx: number;\n\n @Input() maxBufferPx: number;\n\n @Input() indentation: number = 1.5;\n\n @Input() trackBy: Function = (index: number, item: any) => item;\n\n @Output() onFilter: EventEmitter = new EventEmitter();\n\n @ContentChildren(PrimeTemplate) templates: QueryList;\n\n @ViewChild(CdkVirtualScrollViewport) virtualScrollBody: CdkVirtualScrollViewport;\n\n serializedValue: 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 ngOnChanges(simpleChange: SimpleChanges) {\n if (simpleChange.value) {\n this.updateSerializedValue();\n }\n\n if (simpleChange.scrollHeight && this.virtualScrollBody) {\n this.virtualScrollBody.ngOnInit();\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 updateSerializedValue() {\n this.serializedValue = [];\n this.serializeNodes(null, this.getRootNode(), 0, true);\n }\n\n serializeNodes(parent, nodes, level, visible) {\n if (nodes && nodes.length) {\n for(let node of nodes) {\n node.parent = parent;\n const rowNode = {\n node: node,\n parent: parent,\n level: level,\n visible: visible && (parent ? parent.expanded : true)\n };\n this.serializedValue.push(rowNode);\n\n if (rowNode.visible && node.expanded) {\n this.serializeNodes(node, node.children, level + 1, rowNode.visible);\n }\n }\n }\n }\n\n onNodeClick(event, node: TreeNode) {\n let eventTarget = ( event.target);\n\n if (DomHandler.hasClass(eventTarget, 'p-tree-toggler') || DomHandler.hasClass(eventTarget, 'p-tree-toggler-icon')) {\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 = ( event.target);\n\n if (eventTarget.className && eventTarget.className.indexOf('p-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 {\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 (>dragScope).indexOf(dropScope) != -1;\n }\n else if (dropScope instanceof Array) {\n if (typeof dragScope === 'string') {\n return (>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.updateSerializedValue();\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,ScrollingModule,RippleModule],\n exports: [Tree,SharedModule,ScrollingModule],\n declarations: [Tree,UITreeNode]\n})\nexport class TreeModule { }\n"]}