{"version":3,"sources":["../../node_modules/tslib/tslib.es6.js","../../src/app/components/treetable/treetable.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","TreeTableService","this","sortSource","Subject","selectionSource","contextMenuSource","uiUpdateSource","totalRecordsSource","sortSource$","asObservable","selectionSource$","contextMenuSource$","uiUpdateSource$","totalRecordsSource$","prototype","onSort","sortMeta","onSelectionChange","onContextMenu","node","onUIUpdate","onTotalRecordsChange","Injectable","TreeTable","el","zone","tableService","filterService","lazy","lazyLoadOnInit","first","pageLinks","alwaysShowPaginator","paginatorPosition","currentPageReportTemplate","showFirstLastIcon","showPageLinks","defaultSortOrder","sortMode","resetPageOnSort","selectionChange","EventEmitter","contextMenuSelectionChange","contextMenuSelectionMode","compareSelectionBy","loadingIcon","showLoader","virtualScrollDelay","virtualRowHeight","columnResizeMode","rowTrackBy","index","item","filters","filterDelay","filterMode","onFilter","onNodeExpand","onNodeCollapse","onPage","onLazyLoad","sortFunction","onColResize","onColReorder","onNodeSelect","onNodeUnselect","onContextMenuSelect","onHeaderCheckboxToggle","onEditInit","onEditComplete","onEditCancel","_value","_totalRecords","_sortOrder","selectionKeys","ngOnInit","emit","createLazyLoadMetadata","initialized","ngAfterContentInit","_this","templates","forEach","getType","captionTemplate","template","headerTemplate","bodyTemplate","loadingBodyTemplate","footerTemplate","summaryTemplate","colGroupTemplate","emptyMessageTemplate","paginatorLeftTemplate","paginatorRightTemplate","paginatorDropdownItemTemplate","frozenHeaderTemplate","frozenBodyTemplate","frozenFooterTemplate","frozenColGroupTemplate","ngOnChanges","simpleChange","currentValue","totalRecords","sortField","sortSingle","multiSortMeta","sortMultiple","hasFilter","_filter","updateSerializedValue","_sortField","sortOrder","_multiSortMeta","selection","_selection","preventSelectionSetterPropagation","updateSelectionKeys","defineProperty","val","serializedValue","paginator","serializePageNodes","serializeNodes","filteredNodes","parent","nodes","level","visible","nodes_1","nodes_1_1","rowNode","expanded","children","data","rows","dataKey","Array","isArray","_b","_c","String","ObjectUtils","resolveFieldData","onPageChange","event","scrollable","resetScrollTop","sort","originalEvent","field","metaKey","ctrlKey","getSortMeta","order","sortNodes","customSort","mode","node1","node2","value1","value2","result","localeCompare","undefined","numeric","nodes_2","nodes_2_1","sortMultipleNodes","multisortmeta","multisortField","nodes_3","nodes_3_1","isSorted","sorted","globalFilter","virtualScroll","scrollToVirtualIndex","scrollTo","top","scrollableViewChild","scrollableFrozenViewChild","options","isEmpty","getBlockableElement","nativeElement","onColumnResizeBegin","containerLeft","DomHandler","getOffset","containerViewChild","left","lastResizerHelperX","pageX","scrollLeft","preventDefault","onColumnResize","addClass","resizeHelperViewChild","style","height","offsetHeight","display","onColumnResizeEnd","column","delta","offsetLeft","columnWidth","offsetWidth","newColumnWidth","minWidth","parseInt","nextColumn","nextElementSibling","offsetParent","nextColumnWidth","nextColumnMinWidth","scrollableView","findParentScrollableView","scrollableBodyTable","findSingle","scrollableHeaderTable","scrollableFooterTable","resizeColumnIndex","resizeColGroup","width","scrollableBody_1","scrollableHeader","scrollableFooter","scrollableBodyTableWidth","scrollableHeaderTableWidth","isContainerInViewport","setWidth","container","table","calculateScrollbarWidth","tableViewChild","containerWidth","element","removeClass","parentElement","hasClass","colGroup","nodeName","col","nextCol","onColumnDragStart","columnElement","reorderIconWidth","getHiddenElementOuterWidth","reorderIndicatorUpViewChild","reorderIconHeight","getHiddenElementOuterHeight","reorderIndicatorDownViewChild","draggedColumn","dataTransfer","setData","onColumnDragEnter","dropHeader","reorderableColumns","containerOffset","dropHeaderOffset","targetLeft","columnCenter","Math","ceil","dropPosition","dropEffect","onColumnDragLeave","onColumnDrop","dropColumn","dragIndex","indexWithinGroup","dropIndex","allowDrop","reorderArray","columns","draggable","handleRowClick","targetNode","target","selectionMode","selected","isSelected","metaSelection","rowTouched","metaKeySelection","dataKeyValue","isSingleSelectionMode","selectionIndex_1","findIndexInSelection","filter","type","isMultipleSelectionMode","rowIndex","selectionIndex_2","handleRowTouchEnd","handleRowRightClick","contextMenu","contextMenuSelection","show","toggleNodeWithCheckbox","propagateSelectionDown","propagateSelectionUp","toggleNodesWithCheckbox","check","slice","data_1","data_1_1","checked","select","selectedChildCount","childPartialSelected","child","partialSelected","index_1","equals","matchMode","filterTimeout","clearTimeout","isFilterBlank","setTimeout","filterGlobal","trim","globalFilterFieldsArray","globalFilterFields","Error","isStrictMode","isValueChanged","copyNode","assign","localMatch","globalMatch","paramsWithoutNode","prop","hasOwnProperty","filterMeta","filterField","filterValue","filterMatchMode","filterConstraint","findFilteredNodes","isFilterMatched","j","copyNodeForGlobal","matches","filteredValue","matched","childNodes","childNodes_1","childNodes_1_1","childNode","copyChildNode","_a","filterLocale","isNodeLeaf","leaf","empty","reset","updateEditingCell","cell","editingCell","bindDocumentEditListener","isEditingCellValid","find","documentEditListener","editingCellClick","unbindDocumentEditListener","document","addEventListener","removeEventListener","ngOnDestroy","Component","args","selector","providers","encapsulation","ViewEncapsulation","None","ElementRef","NgZone","FilterService","Input","Output","ViewChild","ContentChildren","PrimeTemplate","TTBody","tt","treeTableService","cd","subscription","subscribe","detectChanges","unsubscribe","ChangeDetectorRef","TTScrollableView","_scrollHeight","includes","console","log","virtualScrollBody","ngAfterViewInit","frozen","scrollableAlignerViewChild","calculateScrollbarHeight","frozenColumns","frozenView","previousElementSibling","frozenSiblingBody","scrollBarWidth","scrollHeaderBoxViewChild","paddingRight","scrollFooterBoxViewChild","bindEvents","runOutsideAngular","scrollHeaderViewChild","headerScrollListener","onHeaderScroll","bind","scrollFooterViewChild","footerScrollListener","onFooterScroll","bodyScrollListener","onBodyScroll","getElementRef","scrollBodyViewChild","unbindEvents","preventBodyScrollPropagation","marginLeft","scrollTop","scrollToIndex","CdkVirtualScrollViewport","TTSortableColumn","isEnabled","updateSortState","onClick","clearSelection","onEnterKey","ttSortableColumnDisabled","Directive","host","[class.p-sortable-column]","[class.p-highlight]","[attr.tabindex]","[attr.role]","HostListener","TTSortIcon","markForCheck","changeDetection","ChangeDetectionStrategy","OnPush","TTResizableColumn","resizer","createElement","className","appendChild","resizerMouseDownListener","onMouseDown","bindDocumentEvents","documentMouseMoveListener","onDocumentMouseMove","documentMouseUpListener","onDocumentMouseUp","unbindDocumentEvents","ttResizableColumnDisabled","TTReorderableColumn","mouseDownListener","dragStartListener","onDragStart","dragOverListener","onDragEnter","dragEnterListener","dragLeaveListener","onDragLeave","onDragOver","onDrop","ttReorderableColumnDisabled","TTSelectableRow","which","onTouchEnd","ttSelectableRowDisabled","TTSelectableRowDblClick","TTContextMenuRow","focus","ttContextMenuRowDisabled","[class.p-highlight-contextmenu]","TTCheckbox","disabled","onFocus","boxViewChild","onBlur","TTHeaderCheckbox","valueChangeSubscription","updateCheckedState","selectionChangeSubscription","data_2","data_2_1","TTEditableColumn","openCell","focusable","closeEditingCell","onKeyDown","keyCode","shiftKey","moveToPreviousCell","moveToNextCell","findCell","currentCell","targetCell","findPreviousEditableColumn","invokeElementMethod","findNextEditableColumn","prevCell","previousRow","lastElementChild","nextCell","nextRow","firstElementChild","ttEditableColumnDisabled","TreeTableCellEditor","editableColumn","inputTemplate","outputTemplate","TTRow","prevRow","toggleRowIndex","restoreFocus","row","TreeTableToggler","NgModule","imports","CommonModule","PaginatorModule","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,EAAEO,SAAQP,OAAI,GACrB,CAAES,MAAOT,GAAKA,EAAEK,KAAMK,MAAOV,KAG5C,MAAM,IAAIW,UAAUV,EAAI,0BAA4B,4CAGxCW,EAAOZ,EAAGa,GAC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,UAAAsa,QAAA,SAAQnS,GACJhJ,KAAKkI,QAAQhH,KAAKiH,UAAYnI,KAAKkI,QAAQhH,KAAKiH,SAE5CnI,KAAKkI,QAAQhH,KAAKiH,SAClBnI,KAAKmY,GAAG3U,aAAamB,KAAK,CACtByE,cAAeJ,EACf9H,KAAMlB,KAAKkI,QAAQhH,OAIvBlB,KAAKmY,GAAG1U,eAAekB,KAAK,CACxByE,cAAeJ,EACf9H,KAAMlB,KAAKkI,QAAQhH,OAI3BlB,KAAKmY,GAAGtR,wBACR7G,KAAKmY,GAAG1W,aAAaN,WAAWnB,KAAKmY,GAAGjZ,OAExC8J,EAAMkD,2CAnCbiL,EAAAA,UAASC,KAAA,CAAC,CACPC,SAAU,qBACVjS,SAAU,0cAMVmS,cAAeC,EAAAA,kBAAkBC,kDAMVnW,sCAFtBuW,EAAAA,eAgCL,iCALCoJ,EAAAA,SAAQ7J,KAAA,CAAC,CACN8J,QAAS,CAACC,EAAAA,aAAaC,EAAAA,gBAAgBC,EAAAA,gBAAgBC,EAAAA,cACvDC,QAAS,CAACjgB,EAAUkgB,EAAAA,aAAaR,EAAiBhG,EAAiBc,EAAWK,EAAkBwE,EAAM1D,EAAoBY,EAAgBI,EAAwBC,EAAiBI,EAAWK,EAAiBM,EAAiBsB,EAAoBc,EAAAA,iBACpPI,aAAc,CAACngB,EAAU0f,EAAiBrI,EAAiBT,EAAO8C,EAAiBc,EAAWK,EAAkBwE,EAAM1D,EAAoBY,EAAgBI,EAAwBC,EAAiBI,EAAWK,EAAiBM,EAAiBsB","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft 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, AfterContentInit, OnInit, OnDestroy, HostListener, Injectable, Directive, Component, Input, Output, EventEmitter, ContentChildren, TemplateRef, QueryList, ElementRef, NgZone, ViewChild, AfterViewInit, AfterViewChecked, OnChanges, SimpleChanges, ChangeDetectionStrategy, ViewEncapsulation, ChangeDetectorRef} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { TreeNode } from 'primeng/api';\nimport { Subject, Subscription } from 'rxjs';\nimport { DomHandler } from 'primeng/dom';\nimport { PaginatorModule } from 'primeng/paginator';\nimport { PrimeTemplate, SharedModule, FilterService } from 'primeng/api';\nimport { SortMeta } from 'primeng/api';\nimport { BlockableUI } from 'primeng/api';\nimport { FilterMetadata } from 'primeng/api';\nimport { ObjectUtils } from 'primeng/utils';\nimport { RippleModule } from 'primeng/ripple';\nimport { ScrollingModule, CdkVirtualScrollViewport } from '@angular/cdk/scrolling';\n\n@Injectable()\nexport class TreeTableService {\n\n private sortSource = new Subject();\n private selectionSource = new Subject();\n private contextMenuSource = new Subject();\n private uiUpdateSource = new Subject();\n private totalRecordsSource = new Subject();\n\n sortSource$ = this.sortSource.asObservable();\n selectionSource$ = this.selectionSource.asObservable();\n contextMenuSource$ = this.contextMenuSource.asObservable();\n uiUpdateSource$ = this.uiUpdateSource.asObservable();\n totalRecordsSource$ = this.totalRecordsSource.asObservable();\n\n onSort(sortMeta: SortMeta|SortMeta[]) {\n this.sortSource.next(sortMeta);\n }\n\n onSelectionChange() {\n this.selectionSource.next();\n }\n\n onContextMenu(node: any) {\n this.contextMenuSource.next(node);\n }\n\n onUIUpdate(value: any) {\n this.uiUpdateSource.next(value);\n }\n\n onTotalRecordsChange(value: number) {\n this.totalRecordsSource.next(value);\n }\n}\n\n@Component({\n selector: 'p-treeTable',\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
\n\n
\n
\n
\n
\n\n \n
\n \n
\n\n
\n\n \n \n
\n `,\n providers: [TreeTableService],\n encapsulation: ViewEncapsulation.None,\n styleUrls: ['./treetable.css']\n})\nexport class TreeTable implements AfterContentInit, OnInit, OnDestroy, BlockableUI, OnChanges {\n\n @Input() columns: any[];\n\n @Input() style: any;\n\n @Input() styleClass: string;\n\n @Input() tableStyle: any;\n\n @Input() tableStyleClass: string;\n\n @Input() autoLayout: boolean;\n\n @Input() lazy: boolean = false;\n\n @Input() lazyLoadOnInit: boolean = true;\n\n @Input() paginator: boolean;\n\n @Input() rows: number;\n\n @Input() first: number = 0;\n\n @Input() pageLinks: number = 5;\n\n @Input() rowsPerPageOptions: any[];\n\n @Input() alwaysShowPaginator: boolean = true;\n\n @Input() paginatorPosition: string = 'bottom';\n\n @Input() paginatorDropdownAppendTo: any;\n\n @Input() currentPageReportTemplate: string = '{currentPage} of {totalPages}';\n\n @Input() showCurrentPageReport: boolean;\n\n @Input() showJumpToPageDropdown: boolean;\n\n @Input() showFirstLastIcon: boolean = true;\n\n @Input() showPageLinks: boolean = true;\n\n @Input() defaultSortOrder: number = 1;\n\n @Input() sortMode: string = 'single';\n\n @Input() resetPageOnSort: boolean = true;\n\n @Input() customSort: boolean;\n\n @Input() selectionMode: string;\n\n @Output() selectionChange: EventEmitter = new EventEmitter();\n\n @Input() contextMenuSelection: any;\n\n @Output() contextMenuSelectionChange: EventEmitter = new EventEmitter();\n\n @Input() contextMenuSelectionMode: string = \"separate\";\n\n @Input() dataKey: string;\n\n @Input() metaKeySelection: boolean;\n\n @Input() compareSelectionBy: string = 'deepEquals';\n\n @Input() rowHover: boolean;\n\n @Input() loading: boolean;\n\n @Input() loadingIcon: string = 'pi pi-spinner';\n\n @Input() showLoader: boolean = true;\n\n @Input() scrollable: boolean;\n\n @Input() scrollHeight: string;\n\n @Input() virtualScroll: boolean;\n\n @Input() virtualScrollDelay: number = 150;\n\n @Input() virtualRowHeight: number = 28;\n\n @Input() minBufferPx: number;\n\n @Input() maxBufferPx: number;\n\n @Input() frozenWidth: string;\n\n @Input() frozenColumns: any[];\n\n @Input() resizableColumns: boolean;\n\n @Input() columnResizeMode: string = 'fit';\n\n @Input() reorderableColumns: boolean;\n\n @Input() contextMenu: any;\n\n @Input() rowTrackBy: Function = (index: number, item: any) => item;\n\n @Input() filters: { [s: string]: FilterMetadata; } = {};\n\n @Input() globalFilterFields: string[];\n\n @Input() filterDelay: number = 300;\n\n @Input() filterMode: string = 'lenient';\n\n @Input() filterLocale: string;\n\n @Output() onFilter: EventEmitter = new EventEmitter();\n\n @Output() onNodeExpand: EventEmitter = new EventEmitter();\n\n @Output() onNodeCollapse: EventEmitter = new EventEmitter();\n\n @Output() onPage: EventEmitter = new EventEmitter();\n\n @Output() onSort: EventEmitter = new EventEmitter();\n\n @Output() onLazyLoad: EventEmitter = new EventEmitter();\n\n @Output() sortFunction: EventEmitter = new EventEmitter();\n\n @Output() onColResize: EventEmitter = new EventEmitter();\n\n @Output() onColReorder: EventEmitter = new EventEmitter();\n\n @Output() onNodeSelect: EventEmitter = new EventEmitter();\n\n @Output() onNodeUnselect: EventEmitter = new EventEmitter();\n\n @Output() onContextMenuSelect: EventEmitter = new EventEmitter();\n\n @Output() onHeaderCheckboxToggle: EventEmitter = new EventEmitter();\n\n @Output() onEditInit: EventEmitter = new EventEmitter();\n\n @Output() onEditComplete: EventEmitter = new EventEmitter();\n\n @Output() onEditCancel: EventEmitter = new EventEmitter();\n\n @ViewChild('container') containerViewChild: ElementRef;\n\n @ViewChild('resizeHelper') resizeHelperViewChild: ElementRef;\n\n @ViewChild('reorderIndicatorUp') reorderIndicatorUpViewChild: ElementRef;\n\n @ViewChild('reorderIndicatorDown') reorderIndicatorDownViewChild: ElementRef;\n\n @ViewChild('table') tableViewChild: ElementRef;\n\n @ViewChild('scrollableView') scrollableViewChild;\n\n @ViewChild('scrollableFrozenView') scrollableFrozenViewChild;\n\n @ContentChildren(PrimeTemplate) templates: QueryList;\n\n _value: TreeNode[] = [];\n\n serializedValue: any[];\n\n _totalRecords: number = 0;\n\n _multiSortMeta: SortMeta[];\n\n _sortField: string;\n\n _sortOrder: number = 1;\n\n filteredNodes: any[];\n\n filterTimeout: any;\n\n colGroupTemplate: TemplateRef;\n\n captionTemplate: TemplateRef;\n\n headerTemplate: TemplateRef;\n\n bodyTemplate: TemplateRef;\n\n loadingBodyTemplate: TemplateRef;\n\n footerTemplate: TemplateRef;\n\n summaryTemplate: TemplateRef;\n\n emptyMessageTemplate: TemplateRef;\n\n paginatorLeftTemplate: TemplateRef;\n\n paginatorRightTemplate: TemplateRef;\n\n paginatorDropdownItemTemplate: TemplateRef;\n\n frozenHeaderTemplate: TemplateRef;\n\n frozenBodyTemplate: TemplateRef;\n\n frozenFooterTemplate: TemplateRef;\n\n frozenColGroupTemplate: TemplateRef;\n\n lastResizerHelperX: number;\n\n reorderIconWidth: number;\n\n reorderIconHeight: number;\n\n draggedColumn: any;\n\n dropPosition: number;\n\n preventSelectionSetterPropagation: boolean;\n\n _selection: any;\n\n selectionKeys: any = {};\n\n rowTouched: boolean;\n\n editingCell: Element;\n\n editingCellClick: boolean;\n\n documentEditListener: any;\n\n initialized: boolean;\n\n toggleRowIndex: number;\n\n ngOnInit() {\n if (this.lazy && this.lazyLoadOnInit) {\n this.onLazyLoad.emit(this.createLazyLoadMetadata());\n }\n this.initialized = true;\n }\n\n ngAfterContentInit() {\n this.templates.forEach((item) => {\n switch (item.getType()) {\n case 'caption':\n this.captionTemplate = item.template;\n break;\n\n case 'header':\n this.headerTemplate = item.template;\n break;\n\n case 'body':\n this.bodyTemplate = item.template;\n break;\n\n case 'loadingbody':\n this.loadingBodyTemplate = item.template;\n break;\n\n case 'footer':\n this.footerTemplate = item.template;\n break;\n\n case 'summary':\n this.summaryTemplate = item.template;\n break;\n\n case 'colgroup':\n this.colGroupTemplate = item.template;\n break;\n\n case 'emptymessage':\n this.emptyMessageTemplate = item.template;\n break;\n\n case 'paginatorleft':\n this.paginatorLeftTemplate = item.template;\n break;\n\n case 'paginatorright':\n this.paginatorRightTemplate = item.template;\n break;\n\n case 'paginatordropdownitem':\n this.paginatorDropdownItemTemplate = item.template;\n break;\n\n case 'frozenheader':\n this.frozenHeaderTemplate = item.template;\n break;\n\n case 'frozenbody':\n this.frozenBodyTemplate = item.template;\n break;\n\n case 'frozenfooter':\n this.frozenFooterTemplate = item.template;\n break;\n\n case 'frozencolgroup':\n this.frozenColGroupTemplate = item.template;\n break;\n }\n });\n }\n\n constructor(public el: ElementRef, public zone: NgZone, public tableService: TreeTableService, public filterService: FilterService) {}\n\n ngOnChanges(simpleChange: SimpleChanges) {\n if (simpleChange.value) {\n this._value = simpleChange.value.currentValue;\n\n if (!this.lazy) {\n this.totalRecords = (this._value ? this._value.length : 0);\n\n if (this.sortMode == 'single' && this.sortField)\n this.sortSingle();\n else if (this.sortMode == 'multiple' && this.multiSortMeta)\n this.sortMultiple();\n else if (this.hasFilter()) //sort already filters\n this._filter();\n }\n\n this.updateSerializedValue();\n this.tableService.onUIUpdate(this.value);\n }\n\n if (simpleChange.sortField) {\n this._sortField = simpleChange.sortField.currentValue;\n\n //avoid triggering lazy load prior to lazy initialization at onInit\n if ( !this.lazy || this.initialized ) {\n if (this.sortMode === 'single') {\n this.sortSingle();\n }\n }\n }\n\n if (simpleChange.sortOrder) {\n this._sortOrder = simpleChange.sortOrder.currentValue;\n\n //avoid triggering lazy load prior to lazy initialization at onInit\n if ( !this.lazy || this.initialized ) {\n if (this.sortMode === 'single') {\n this.sortSingle();\n }\n }\n }\n\n if (simpleChange.multiSortMeta) {\n this._multiSortMeta = simpleChange.multiSortMeta.currentValue;\n if (this.sortMode === 'multiple') {\n this.sortMultiple();\n }\n }\n\n if (simpleChange.selection) {\n this._selection = simpleChange.selection.currentValue;\n\n if (!this.preventSelectionSetterPropagation) {\n this.updateSelectionKeys();\n this.tableService.onSelectionChange();\n }\n this.preventSelectionSetterPropagation = false;\n }\n }\n\n @Input() get value(): any[] {\n return this._value;\n }\n set value(val: any[]) {\n this._value = val;\n }\n\n updateSerializedValue() {\n this.serializedValue = [];\n\n if (this.paginator)\n this.serializePageNodes();\n else\n this.serializeNodes(null, this.filteredNodes||this.value, 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 serializePageNodes() {\n let data = this.filteredNodes || this.value;\n this.serializedValue = [];\n if (data && data.length) {\n const first = this.lazy ? 0 : this.first;\n\n for(let i = first; i < (first + this.rows); i++) {\n let node = data[i];\n if (node) {\n this.serializedValue.push({\n node: node,\n parent: null,\n level: 0,\n visible: true\n });\n\n this.serializeNodes(node, node.children, 1, true);\n }\n }\n }\n }\n\n @Input() get totalRecords(): number {\n return this._totalRecords;\n }\n set totalRecords(val: number) {\n this._totalRecords = val;\n this.tableService.onTotalRecordsChange(this._totalRecords);\n }\n\n @Input() get sortField(): string {\n return this._sortField;\n }\n\n set sortField(val: string) {\n this._sortField = val;\n }\n\n @Input() get sortOrder(): number {\n return this._sortOrder;\n }\n set sortOrder(val: number) {\n this._sortOrder = val;\n }\n\n @Input() get multiSortMeta(): SortMeta[] {\n return this._multiSortMeta;\n }\n\n set multiSortMeta(val: SortMeta[]) {\n this._multiSortMeta = val;\n }\n\n @Input() get selection(): any {\n return this._selection;\n }\n\n set selection(val: any) {\n this._selection = val;\n }\n\n updateSelectionKeys() {\n if (this.dataKey && this._selection) {\n this.selectionKeys = {};\n if (Array.isArray(this._selection)) {\n for(let node of this._selection) {\n this.selectionKeys[String(ObjectUtils.resolveFieldData(node.data, this.dataKey))] = 1;\n }\n }\n else {\n this.selectionKeys[String(ObjectUtils.resolveFieldData(this._selection.data, this.dataKey))] = 1;\n }\n }\n }\n\n onPageChange(event) {\n this.first = event.first;\n this.rows = event.rows;\n\n if (this.lazy)\n this.onLazyLoad.emit(this.createLazyLoadMetadata());\n else\n this.serializePageNodes();\n\n this.onPage.emit({\n first: this.first,\n rows: this.rows\n });\n\n this.tableService.onUIUpdate(this.value);\n\n if (this.scrollable) {\n this.resetScrollTop();\n }\n }\n\n sort(event) {\n let originalEvent = event.originalEvent;\n\n if (this.sortMode === 'single') {\n this._sortOrder = (this.sortField === event.field) ? this.sortOrder * -1 : this.defaultSortOrder;\n this._sortField = event.field;\n this.sortSingle();\n\n if (this.resetPageOnSort && this.scrollable) {\n this.resetScrollTop();\n }\n }\n if (this.sortMode === 'multiple') {\n let metaKey = originalEvent.metaKey || originalEvent.ctrlKey;\n let sortMeta = this.getSortMeta(event.field);\n\n if (sortMeta) {\n if (!metaKey) {\n this._multiSortMeta = [{ field: event.field, order: sortMeta.order * -1 }]\n\n if (this.resetPageOnSort && this.scrollable) {\n this.resetScrollTop();\n }\n }\n else {\n sortMeta.order = sortMeta.order * -1;\n }\n }\n else {\n if (!metaKey || !this.multiSortMeta) {\n this._multiSortMeta = [];\n\n if (this.resetPageOnSort && this.scrollable) {\n this.resetScrollTop();\n }\n }\n this.multiSortMeta.push({ field: event.field, order: this.defaultSortOrder });\n }\n\n this.sortMultiple();\n }\n }\n\n sortSingle() {\n if (this.sortField && this.sortOrder) {\n if (this.lazy) {\n this.onLazyLoad.emit(this.createLazyLoadMetadata());\n }\n else if (this.value) {\n this.sortNodes(this.value);\n\n if (this.hasFilter()) {\n this._filter();\n }\n }\n\n let sortMeta: SortMeta = {\n field: this.sortField,\n order: this.sortOrder\n };\n\n this.onSort.emit(sortMeta);\n this.tableService.onSort(sortMeta);\n this.updateSerializedValue();\n }\n }\n\n sortNodes(nodes) {\n if (!nodes || nodes.length === 0) {\n return;\n }\n\n if (this.customSort) {\n this.sortFunction.emit({\n data: nodes,\n mode: this.sortMode,\n field: this.sortField,\n order: this.sortOrder\n });\n }\n else {\n nodes.sort((node1, node2) => {\n let value1 = ObjectUtils.resolveFieldData(node1.data, this.sortField);\n let value2 = ObjectUtils.resolveFieldData(node2.data, this.sortField);\n let result = null;\n\n if (value1 == null && value2 != null)\n result = -1;\n else if (value1 != null && value2 == null)\n result = 1;\n else if (value1 == null && value2 == null)\n result = 0;\n else if (typeof value1 === 'string' && typeof value2 === 'string')\n result = value1.localeCompare(value2, undefined, {numeric: true});\n else\n result = (value1 < value2) ? -1 : (value1 > value2) ? 1 : 0;\n\n return (this.sortOrder * result);\n });\n }\n\n for(let node of nodes) {\n this.sortNodes(node.children);\n }\n }\n\n sortMultiple() {\n if (this.multiSortMeta) {\n if (this.lazy) {\n this.onLazyLoad.emit(this.createLazyLoadMetadata());\n }\n else if (this.value) {\n this.sortMultipleNodes(this.value);\n\n if (this.hasFilter()) {\n this._filter();\n }\n }\n\n this.onSort.emit({\n multisortmeta: this.multiSortMeta\n });\n this.updateSerializedValue();\n this.tableService.onSort(this.multiSortMeta);\n }\n }\n\n sortMultipleNodes(nodes) {\n if (!nodes || nodes.length === 0) {\n return;\n }\n\n if (this.customSort) {\n this.sortFunction.emit({\n data: this.value,\n mode: this.sortMode,\n multiSortMeta: this.multiSortMeta\n });\n }\n else {\n nodes.sort((node1, node2) => {\n return this.multisortField(node1, node2, this.multiSortMeta, 0);\n });\n }\n\n for(let node of nodes) {\n this.sortMultipleNodes(node.children);\n }\n }\n\n multisortField(node1, node2, multiSortMeta, index) {\n let value1 = ObjectUtils.resolveFieldData(node1.data, multiSortMeta[index].field);\n let value2 = ObjectUtils.resolveFieldData(node2.data, multiSortMeta[index].field);\n let result = null;\n\n if (value1 == null && value2 != null)\n result = -1;\n else if (value1 != null && value2 == null)\n result = 1;\n else if (value1 == null && value2 == null)\n result = 0;\n if (typeof value1 == 'string' || value1 instanceof String) {\n if (value1.localeCompare && (value1 != value2)) {\n return (multiSortMeta[index].order * value1.localeCompare(value2, undefined, {numeric: true}));\n }\n }\n else {\n result = (value1 < value2) ? -1 : 1;\n }\n\n if (value1 == value2) {\n return (multiSortMeta.length - 1) > (index) ? (this.multisortField(node1, node2, multiSortMeta, index + 1)) : 0;\n }\n\n return (multiSortMeta[index].order * result);\n }\n\n getSortMeta(field: string) {\n if (this.multiSortMeta && this.multiSortMeta.length) {\n for (let i = 0; i < this.multiSortMeta.length; i++) {\n if (this.multiSortMeta[i].field === field) {\n return this.multiSortMeta[i];\n }\n }\n }\n\n return null;\n }\n\n isSorted(field: string) {\n if (this.sortMode === 'single') {\n return (this.sortField && this.sortField === field);\n }\n else if (this.sortMode === 'multiple') {\n let sorted = false;\n if (this.multiSortMeta) {\n for(let i = 0; i < this.multiSortMeta.length; i++) {\n if (this.multiSortMeta[i].field == field) {\n sorted = true;\n break;\n }\n }\n }\n return sorted;\n }\n }\n\n createLazyLoadMetadata(): any {\n return {\n first: this.first,\n rows: this.rows,\n sortField: this.sortField,\n sortOrder: this.sortOrder,\n filters: this.filters,\n globalFilter: this.filters && this.filters['global'] ? this.filters['global'].value : null,\n multiSortMeta: this.multiSortMeta\n };\n }\n\n public resetScrollTop() {\n if (this.virtualScroll)\n this.scrollToVirtualIndex(0);\n else\n this.scrollTo({top: 0});\n }\n\n public scrollToVirtualIndex(index: number) {\n if (this.scrollableViewChild) {\n this.scrollableViewChild.scrollToVirtualIndex(index);\n }\n\n if (this.scrollableFrozenViewChild) {\n this.scrollableFrozenViewChild.scrollToVirtualIndex(index);\n }\n }\n\n public scrollTo(options) {\n if (this.scrollableViewChild) {\n this.scrollableViewChild.scrollTo(options);\n }\n\n if (this.scrollableFrozenViewChild) {\n this.scrollableFrozenViewChild.scrollTo(options);\n }\n }\n\n isEmpty() {\n let data = this.filteredNodes||this.value;\n return data == null || data.length == 0;\n }\n\n getBlockableElement(): HTMLElement {\n return this.el.nativeElement.children[0];\n }\n\n onColumnResizeBegin(event) {\n let containerLeft = DomHandler.getOffset(this.containerViewChild.nativeElement).left;\n this.lastResizerHelperX = (event.pageX - containerLeft + this.containerViewChild.nativeElement.scrollLeft);\n event.preventDefault();\n }\n\n onColumnResize(event) {\n let containerLeft = DomHandler.getOffset(this.containerViewChild.nativeElement).left;\n DomHandler.addClass(this.containerViewChild.nativeElement, 'p-unselectable-text');\n this.resizeHelperViewChild.nativeElement.style.height = this.containerViewChild.nativeElement.offsetHeight + 'px';\n this.resizeHelperViewChild.nativeElement.style.top = 0 + 'px';\n this.resizeHelperViewChild.nativeElement.style.left = (event.pageX - containerLeft + this.containerViewChild.nativeElement.scrollLeft) + 'px';\n\n this.resizeHelperViewChild.nativeElement.style.display = 'block';\n }\n\n onColumnResizeEnd(event, column) {\n let delta = this.resizeHelperViewChild.nativeElement.offsetLeft - this.lastResizerHelperX;\n let columnWidth = column.offsetWidth;\n let newColumnWidth = columnWidth + delta;\n let minWidth = column.style.minWidth || 15;\n\n if (columnWidth + delta > parseInt(minWidth)) {\n if (this.columnResizeMode === 'fit') {\n let nextColumn = column.nextElementSibling;\n while (!nextColumn.offsetParent) {\n nextColumn = nextColumn.nextElementSibling;\n }\n\n if (nextColumn) {\n let nextColumnWidth = nextColumn.offsetWidth - delta;\n let nextColumnMinWidth = nextColumn.style.minWidth || 15;\n\n if (newColumnWidth > 15 && nextColumnWidth > parseInt(nextColumnMinWidth)) {\n if (this.scrollable) {\n let scrollableView = this.findParentScrollableView(column);\n let scrollableBodyTable = DomHandler.findSingle(scrollableView, '.p-treetable-scrollable-body table');\n let scrollableHeaderTable = DomHandler.findSingle(scrollableView, 'table.p-treetable-scrollable-header-table');\n let scrollableFooterTable = DomHandler.findSingle(scrollableView, 'table.p-treetable-scrollable-footer-table');\n let resizeColumnIndex = DomHandler.index(column);\n\n this.resizeColGroup(scrollableHeaderTable, resizeColumnIndex, newColumnWidth, nextColumnWidth);\n this.resizeColGroup(scrollableBodyTable, resizeColumnIndex, newColumnWidth, nextColumnWidth);\n this.resizeColGroup(scrollableFooterTable, resizeColumnIndex, newColumnWidth, nextColumnWidth);\n }\n else {\n column.style.width = newColumnWidth + 'px';\n if (nextColumn) {\n nextColumn.style.width = nextColumnWidth + 'px';\n }\n }\n }\n }\n }\n else if (this.columnResizeMode === 'expand') {\n if (this.scrollable) {\n let scrollableView = this.findParentScrollableView(column);\n let scrollableBody = DomHandler.findSingle(scrollableView, '.p-treetable-scrollable-body');\n let scrollableHeader = DomHandler.findSingle(scrollableView, '.p-treetable-scrollable-header');\n let scrollableFooter = DomHandler.findSingle(scrollableView, '.p-treetable-scrollable-footer');\n let scrollableBodyTable = DomHandler.findSingle(scrollableView, '.p-treetable-scrollable-body table');\n let scrollableHeaderTable = DomHandler.findSingle(scrollableView, 'table.p-treetable-scrollable-header-table');\n let scrollableFooterTable = DomHandler.findSingle(scrollableView, 'table.p-treetable-scrollable-footer-table');\n scrollableBodyTable.style.width = scrollableBodyTable.offsetWidth + delta + 'px';\n scrollableHeaderTable.style.width = scrollableHeaderTable.offsetWidth + delta + 'px';\n if (scrollableFooterTable) {\n scrollableFooterTable.style.width = scrollableFooterTable.offsetWidth + delta + 'px';\n }\n let resizeColumnIndex = DomHandler.index(column);\n\n const scrollableBodyTableWidth = column ? scrollableBodyTable.offsetWidth + delta : newColumnWidth;\n const scrollableHeaderTableWidth = column ? scrollableHeaderTable.offsetWidth + delta : newColumnWidth;\n const isContainerInViewport = this.containerViewChild.nativeElement.offsetWidth >= scrollableBodyTableWidth;\n\n let setWidth = (container, table, width, isContainerInViewport) => {\n if (container && table) {\n container.style.width = isContainerInViewport ? width + DomHandler.calculateScrollbarWidth(scrollableBody) + 'px' : 'auto'\n table.style.width = width + 'px';\n }\n };\n\n setWidth(scrollableBody, scrollableBodyTable, scrollableBodyTableWidth, isContainerInViewport);\n setWidth(scrollableHeader, scrollableHeaderTable, scrollableHeaderTableWidth, isContainerInViewport);\n setWidth(scrollableFooter, scrollableFooterTable, scrollableHeaderTableWidth, isContainerInViewport);\n\n this.resizeColGroup(scrollableHeaderTable, resizeColumnIndex, newColumnWidth, null);\n this.resizeColGroup(scrollableBodyTable, resizeColumnIndex, newColumnWidth, null);\n this.resizeColGroup(scrollableFooterTable, resizeColumnIndex, newColumnWidth, null);\n }\n else {\n this.tableViewChild.nativeElement.style.width = this.tableViewChild.nativeElement.offsetWidth + delta + 'px';\n column.style.width = newColumnWidth + 'px';\n let containerWidth = this.tableViewChild.nativeElement.style.width;\n this.containerViewChild.nativeElement.style.width = containerWidth + 'px';\n }\n }\n\n this.onColResize.emit({\n element: column,\n delta: delta\n });\n }\n\n this.resizeHelperViewChild.nativeElement.style.display = 'none';\n DomHandler.removeClass(this.containerViewChild.nativeElement, 'p-unselectable-text');\n }\n\n findParentScrollableView(column) {\n if (column) {\n let parent = column.parentElement;\n while (parent && !DomHandler.hasClass(parent, 'p-treetable-scrollable-view')) {\n parent = parent.parentElement;\n }\n\n return parent;\n }\n else {\n return null;\n }\n }\n\n resizeColGroup(table, resizeColumnIndex, newColumnWidth, nextColumnWidth) {\n if (table) {\n let colGroup = table.children[0].nodeName === 'COLGROUP' ? table.children[0] : null;\n\n if (colGroup) {\n let col = colGroup.children[resizeColumnIndex];\n let nextCol = col.nextElementSibling;\n col.style.width = newColumnWidth + 'px';\n\n if (nextCol && nextColumnWidth) {\n nextCol.style.width = nextColumnWidth + 'px';\n }\n }\n else {\n throw \"Scrollable tables require a colgroup to support resizable columns\";\n }\n }\n }\n\n onColumnDragStart(event, columnElement) {\n this.reorderIconWidth = DomHandler.getHiddenElementOuterWidth(this.reorderIndicatorUpViewChild.nativeElement);\n this.reorderIconHeight = DomHandler.getHiddenElementOuterHeight(this.reorderIndicatorDownViewChild.nativeElement);\n this.draggedColumn = columnElement;\n event.dataTransfer.setData('text', 'b'); // For firefox\n }\n\n onColumnDragEnter(event, dropHeader) {\n if (this.reorderableColumns && this.draggedColumn && dropHeader) {\n event.preventDefault();\n let containerOffset = DomHandler.getOffset(this.containerViewChild.nativeElement);\n let dropHeaderOffset = DomHandler.getOffset(dropHeader);\n\n if (this.draggedColumn != dropHeader) {\n let targetLeft = dropHeaderOffset.left - containerOffset.left;\n let targetTop = containerOffset.top - dropHeaderOffset.top;\n let columnCenter = dropHeaderOffset.left + dropHeader.offsetWidth / 2;\n\n this.reorderIndicatorUpViewChild.nativeElement.style.top = dropHeaderOffset.top - containerOffset.top - (this.reorderIconHeight - 1) + 'px';\n this.reorderIndicatorDownViewChild.nativeElement.style.top = dropHeaderOffset.top - containerOffset.top + dropHeader.offsetHeight + 'px';\n\n if (event.pageX > columnCenter) {\n this.reorderIndicatorUpViewChild.nativeElement.style.left = (targetLeft + dropHeader.offsetWidth - Math.ceil(this.reorderIconWidth / 2)) + 'px';\n this.reorderIndicatorDownViewChild.nativeElement.style.left = (targetLeft + dropHeader.offsetWidth - Math.ceil(this.reorderIconWidth / 2)) + 'px';\n this.dropPosition = 1;\n }\n else {\n this.reorderIndicatorUpViewChild.nativeElement.style.left = (targetLeft - Math.ceil(this.reorderIconWidth / 2)) + 'px';\n this.reorderIndicatorDownViewChild.nativeElement.style.left = (targetLeft - Math.ceil(this.reorderIconWidth / 2)) + 'px';\n this.dropPosition = -1;\n }\n\n this.reorderIndicatorUpViewChild.nativeElement.style.display = 'block';\n this.reorderIndicatorDownViewChild.nativeElement.style.display = 'block';\n }\n else {\n event.dataTransfer.dropEffect = 'none';\n }\n }\n }\n\n onColumnDragLeave(event) {\n if (this.reorderableColumns && this.draggedColumn) {\n event.preventDefault();\n this.reorderIndicatorUpViewChild.nativeElement.style.display = 'none';\n this.reorderIndicatorDownViewChild.nativeElement.style.display = 'none';\n }\n }\n\n onColumnDrop(event, dropColumn) {\n event.preventDefault();\n if (this.draggedColumn) {\n let dragIndex = DomHandler.indexWithinGroup(this.draggedColumn, 'ttreorderablecolumn');\n let dropIndex = DomHandler.indexWithinGroup(dropColumn, 'ttreorderablecolumn');\n let allowDrop = (dragIndex != dropIndex);\n if (allowDrop && ((dropIndex - dragIndex == 1 && this.dropPosition === -1) || (dragIndex - dropIndex == 1 && this.dropPosition === 1))) {\n allowDrop = false;\n }\n\n if (allowDrop && ((dropIndex < dragIndex && this.dropPosition === 1))) {\n dropIndex = dropIndex + 1;\n }\n\n if (allowDrop && ((dropIndex > dragIndex && this.dropPosition === -1))) {\n dropIndex = dropIndex - 1;\n }\n\n if (allowDrop) {\n ObjectUtils.reorderArray(this.columns, dragIndex, dropIndex);\n\n this.onColReorder.emit({\n dragIndex: dragIndex,\n dropIndex: dropIndex,\n columns: this.columns\n });\n }\n\n this.reorderIndicatorUpViewChild.nativeElement.style.display = 'none';\n this.reorderIndicatorDownViewChild.nativeElement.style.display = 'none';\n this.draggedColumn.draggable = false;\n this.draggedColumn = null;\n this.dropPosition = null;\n }\n }\n\n handleRowClick(event) {\n let targetNode = ( event.originalEvent.target).nodeName;\n if (targetNode == 'INPUT' || targetNode == 'BUTTON' || targetNode == 'A' || (DomHandler.hasClass(event.originalEvent.target, 'p-clickable'))) {\n return;\n }\n\n if (this.selectionMode) {\n this.preventSelectionSetterPropagation = true;\n let rowNode = event.rowNode;\n let selected = this.isSelected(rowNode.node);\n let metaSelection = this.rowTouched ? false : this.metaKeySelection;\n let dataKeyValue = this.dataKey ? String(ObjectUtils.resolveFieldData(rowNode.node.data, this.dataKey)) : null;\n\n if (metaSelection) {\n let metaKey = event.originalEvent.metaKey||event.originalEvent.ctrlKey;\n\n if (selected && metaKey) {\n if (this.isSingleSelectionMode()) {\n this._selection = null;\n this.selectionKeys = {};\n this.selectionChange.emit(null);\n }\n else {\n let selectionIndex = this.findIndexInSelection(rowNode.node);\n this._selection = this.selection.filter((val,i) => i != selectionIndex);\n this.selectionChange.emit(this.selection);\n if (dataKeyValue) {\n delete this.selectionKeys[dataKeyValue];\n }\n }\n\n this.onNodeUnselect.emit({originalEvent: event.originalEvent, node: rowNode.node, type: 'row'});\n }\n else {\n if (this.isSingleSelectionMode()) {\n this._selection = rowNode.node;\n this.selectionChange.emit(rowNode.node);\n if (dataKeyValue) {\n this.selectionKeys = {};\n this.selectionKeys[dataKeyValue] = 1;\n }\n }\n else if (this.isMultipleSelectionMode()) {\n if (metaKey) {\n this._selection = this.selection||[];\n }\n else {\n this._selection = [];\n this.selectionKeys = {};\n }\n\n this._selection = [...this.selection, rowNode.node];\n this.selectionChange.emit(this.selection);\n if (dataKeyValue) {\n this.selectionKeys[dataKeyValue] = 1;\n }\n }\n\n this.onNodeSelect.emit({originalEvent: event.originalEvent, node: rowNode.node, type: 'row', index: event.rowIndex});\n }\n }\n else {\n if (this.selectionMode === 'single') {\n if (selected) {\n this._selection = null;\n this.selectionKeys = {};\n this.selectionChange.emit(this.selection);\n this.onNodeUnselect.emit({ originalEvent: event.originalEvent, node: rowNode.node, type: 'row' });\n }\n else {\n this._selection = rowNode.node;\n this.selectionChange.emit(this.selection);\n this.onNodeSelect.emit({ originalEvent: event.originalEvent, node: rowNode.node, type: 'row', index: event.rowIndex });\n if (dataKeyValue) {\n this.selectionKeys = {};\n this.selectionKeys[dataKeyValue] = 1;\n }\n }\n }\n else if (this.selectionMode === 'multiple') {\n if (selected) {\n let selectionIndex = this.findIndexInSelection(rowNode.node);\n this._selection = this.selection.filter((val, i) => i != selectionIndex);\n this.selectionChange.emit(this.selection);\n this.onNodeUnselect.emit({ originalEvent: event.originalEvent, node: rowNode.node, type: 'row' });\n if (dataKeyValue) {\n delete this.selectionKeys[dataKeyValue];\n }\n }\n else {\n this._selection = this.selection ? [...this.selection, rowNode.node] : [rowNode.node];\n this.selectionChange.emit(this.selection);\n this.onNodeSelect.emit({ originalEvent: event.originalEvent, node: rowNode.node, type: 'row', index: event.rowIndex });\n if (dataKeyValue) {\n this.selectionKeys[dataKeyValue] = 1;\n }\n }\n }\n }\n\n this.tableService.onSelectionChange();\n }\n\n this.rowTouched = false;\n }\n\n handleRowTouchEnd(event) {\n this.rowTouched = true;\n }\n\n handleRowRightClick(event) {\n if (this.contextMenu) {\n const node = event.rowNode.node;\n\n if (this.contextMenuSelectionMode === 'separate') {\n this.contextMenuSelection = node;\n this.contextMenuSelectionChange.emit(node);\n this.onContextMenuSelect.emit({originalEvent: event.originalEvent, node: node});\n this.contextMenu.show(event.originalEvent);\n this.tableService.onContextMenu(node);\n }\n else if (this.contextMenuSelectionMode === 'joint') {\n this.preventSelectionSetterPropagation = true;\n let selected = this.isSelected(node);\n let dataKeyValue = this.dataKey ? String(ObjectUtils.resolveFieldData(node.data, this.dataKey)) : null;\n\n if (!selected) {\n if (this.isSingleSelectionMode()) {\n this.selection = node;\n this.selectionChange.emit(node);\n }\n else if (this.isMultipleSelectionMode()) {\n this.selection = [node];\n this.selectionChange.emit(this.selection);\n }\n\n if (dataKeyValue) {\n this.selectionKeys[dataKeyValue] = 1;\n }\n }\n\n this.contextMenu.show(event.originalEvent);\n this.onContextMenuSelect.emit({originalEvent: event.originalEvent, node: node});\n }\n }\n }\n\n toggleNodeWithCheckbox(event) {\n this.selection = this.selection||[];\n this.preventSelectionSetterPropagation = true;\n let node = event.rowNode.node;\n let selected = this.isSelected(node);\n\n if (selected) {\n this.propagateSelectionDown(node, false);\n if (event.rowNode.parent) {\n this.propagateSelectionUp(node.parent, false);\n }\n this.selectionChange.emit(this.selection);\n this.onNodeUnselect.emit({originalEvent: event, node: node});\n }\n else {\n this.propagateSelectionDown(node, true);\n if (event.rowNode.parent) {\n this.propagateSelectionUp(node.parent, true);\n }\n this.selectionChange.emit(this.selection);\n this.onNodeSelect.emit({originalEvent: event, node: node});\n }\n\n this.tableService.onSelectionChange();\n }\n\n toggleNodesWithCheckbox(event: Event, check: boolean) {\n let data = this.filteredNodes || this.value;\n this._selection = check && data ? data.slice() : [];\n if (check) {\n if (data && data.length) {\n for (let node of data) {\n this.propagateSelectionDown(node, true);\n }\n }\n }\n else {\n this._selection = [];\n this.selectionKeys = {};\n }\n\n this.preventSelectionSetterPropagation = true;\n this.selectionChange.emit(this._selection);\n this.tableService.onSelectionChange();\n this.onHeaderCheckboxToggle.emit({originalEvent: event, checked: check});\n }\n\n propagateSelectionUp(node: TreeNode, select: boolean) {\n if (node.children && node.children.length) {\n let selectedChildCount: number = 0;\n let childPartialSelected: boolean = false;\n let dataKeyValue = this.dataKey ? String(ObjectUtils.resolveFieldData(node.data, this.dataKey)) : null;\n\n for (let child of node.children) {\n if (this.isSelected(child))\n selectedChildCount++;\n else if (child.partialSelected)\n childPartialSelected = true;\n }\n\n if (select && selectedChildCount == node.children.length) {\n this._selection = [...this.selection||[], node];\n node.partialSelected = false;\n if (dataKeyValue) {\n this.selectionKeys[dataKeyValue] = 1;\n }\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 if (dataKeyValue) {\n delete this.selectionKeys[dataKeyValue];\n }\n }\n }\n\n if (childPartialSelected || selectedChildCount > 0 && selectedChildCount != node.children.length)\n node.partialSelected = true;\n else\n node.partialSelected = false;\n }\n }\n\n let parent = node.parent;\n if (parent) {\n this.propagateSelectionUp(parent, select);\n }\n }\n\n propagateSelectionDown(node: TreeNode, select: boolean) {\n let index = this.findIndexInSelection(node);\n let dataKeyValue = this.dataKey ? String(ObjectUtils.resolveFieldData(node.data, this.dataKey)) : null;\n\n if (select && index == -1) {\n this._selection = [...this.selection||[],node]\n if (dataKeyValue) {\n this.selectionKeys[dataKeyValue] = 1;\n }\n }\n else if (!select && index > -1) {\n this._selection = this.selection.filter((val,i) => i!=index);\n if (dataKeyValue) {\n delete this.selectionKeys[dataKeyValue];\n }\n }\n\n node.partialSelected = false;\n\n if (node.children && node.children.length) {\n for (let child of node.children) {\n this.propagateSelectionDown(child, select);\n }\n }\n }\n\n isSelected(node) {\n if (node && this.selection) {\n if (this.dataKey) {\n return this.selectionKeys[ObjectUtils.resolveFieldData(node.data, this.dataKey)] !== undefined;\n }\n else {\n if (this.selection instanceof Array)\n return this.findIndexInSelection(node) > -1;\n else\n return this.equals(node, this.selection);\n }\n }\n\n return false;\n }\n\n findIndexInSelection(node: any) {\n let index: number = -1;\n if (this.selection && this.selection.length) {\n for (let i = 0; i < this.selection.length; i++) {\n if (this.equals(node, this.selection[i])) {\n index = i;\n break;\n }\n }\n }\n\n return index;\n }\n\n isSingleSelectionMode() {\n return this.selectionMode === 'single';\n }\n\n isMultipleSelectionMode() {\n return this.selectionMode === 'multiple';\n }\n\n equals(node1, node2) {\n return this.compareSelectionBy === 'equals' ? (node1 === node2) : ObjectUtils.equals(node1.data, node2.data, this.dataKey);\n }\n\n filter(value, field, matchMode) {\n if (this.filterTimeout) {\n clearTimeout(this.filterTimeout);\n }\n\n if (!this.isFilterBlank(value)) {\n this.filters[field] = { value: value, matchMode: matchMode };\n } else if (this.filters[field]) {\n delete this.filters[field];\n }\n\n this.filterTimeout = setTimeout(() => {\n this._filter();\n this.filterTimeout = null;\n }, this.filterDelay);\n }\n\n filterGlobal(value, matchMode) {\n this.filter(value, 'global', matchMode);\n }\n\n isFilterBlank(filter: any): boolean {\n if (filter !== null && filter !== undefined) {\n if ((typeof filter === 'string' && filter.trim().length == 0) || (filter instanceof Array && filter.length == 0))\n return true;\n else\n return false;\n }\n return true;\n }\n\n _filter() {\n if (this.lazy) {\n this.onLazyLoad.emit(this.createLazyLoadMetadata());\n }\n else {\n if (!this.value) {\n return;\n }\n\n if (!this.hasFilter()) {\n this.filteredNodes = null;\n if (this.paginator) {\n this.totalRecords = this.value ? this.value.length : 0;\n }\n }\n else {\n let globalFilterFieldsArray;\n if (this.filters['global']) {\n if (!this.columns && !this.globalFilterFields)\n throw new Error('Global filtering requires dynamic columns or globalFilterFields to be defined.');\n else\n globalFilterFieldsArray = this.globalFilterFields||this.columns;\n }\n\n this.filteredNodes = [];\n const isStrictMode = this.filterMode === 'strict';\n let isValueChanged = false;\n\n for (let node of this.value) {\n let copyNode = {...node};\n let localMatch = true;\n let globalMatch = false;\n let paramsWithoutNode;\n\n for (let prop in this.filters) {\n if (this.filters.hasOwnProperty(prop) && prop !== 'global') {\n let filterMeta = this.filters[prop];\n let filterField = prop;\n let filterValue = filterMeta.value;\n let filterMatchMode = filterMeta.matchMode || 'startsWith';\n let filterConstraint = this.filterService.filters[filterMatchMode];\n paramsWithoutNode = {filterField, filterValue, filterConstraint, isStrictMode};\n if ((isStrictMode && !(this.findFilteredNodes(copyNode, paramsWithoutNode) || this.isFilterMatched(copyNode, paramsWithoutNode))) ||\n (!isStrictMode && !(this.isFilterMatched(copyNode, paramsWithoutNode) || this.findFilteredNodes(copyNode, paramsWithoutNode)))) {\n localMatch = false;\n }\n\n if (!localMatch) {\n break;\n }\n }\n }\n\n if (this.filters['global'] && !globalMatch && globalFilterFieldsArray) {\n for(let j = 0; j < globalFilterFieldsArray.length; j++) {\n let copyNodeForGlobal = {...copyNode};\n let filterField = globalFilterFieldsArray[j].field||globalFilterFieldsArray[j];\n let filterValue = this.filters['global'].value;\n let filterConstraint = this.filterService.filters[this.filters['global'].matchMode];\n paramsWithoutNode = {filterField, filterValue, filterConstraint, isStrictMode};\n\n if ((isStrictMode && (this.findFilteredNodes(copyNodeForGlobal, paramsWithoutNode) || this.isFilterMatched(copyNodeForGlobal, paramsWithoutNode))) ||\n (!isStrictMode && (this.isFilterMatched(copyNodeForGlobal, paramsWithoutNode) || this.findFilteredNodes(copyNodeForGlobal, paramsWithoutNode)))) {\n globalMatch = true;\n copyNode = copyNodeForGlobal;\n }\n }\n }\n\n let matches = localMatch;\n if (this.filters['global']) {\n matches = localMatch && globalMatch;\n }\n\n if (matches) {\n this.filteredNodes.push(copyNode);\n }\n\n isValueChanged = isValueChanged || !localMatch || globalMatch || (localMatch && this.filteredNodes.length > 0) || (!globalMatch && this.filteredNodes.length === 0)\n }\n\n if (!isValueChanged) {\n this.filteredNodes = null;\n }\n\n if (this.paginator) {\n this.totalRecords = this.filteredNodes ? this.filteredNodes.length : this.value ? this.value.length : 0;\n }\n }\n }\n\n this.first = 0;\n\n const filteredValue = this.filteredNodes || this.value;\n\n this.onFilter.emit({\n filters: this.filters,\n filteredValue: filteredValue\n });\n\n this.tableService.onUIUpdate(filteredValue);\n this.updateSerializedValue();\n\n if (this.scrollable) {\n this.resetScrollTop();\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 return true;\n }\n }\n }\n\n isFilterMatched(node, {filterField, filterValue, filterConstraint, isStrictMode}) {\n let matched = false;\n let dataFieldValue = ObjectUtils.resolveFieldData(node.data, filterField);\n if (filterConstraint(dataFieldValue, filterValue, this.filterLocale)) {\n matched = true;\n }\n\n if (!matched || (isStrictMode && !this.isNodeLeaf(node))) {\n matched = this.findFilteredNodes(node, {filterField, filterValue, filterConstraint, isStrictMode}) || matched;\n }\n\n return matched;\n }\n\n isNodeLeaf(node) {\n return node.leaf === false ? false : !(node.children && node.children.length);\n }\n\n hasFilter() {\n let empty = true;\n for (let prop in this.filters) {\n if (this.filters.hasOwnProperty(prop)) {\n empty = false;\n break;\n }\n }\n\n return !empty;\n }\n\n public reset() {\n this._sortField = null;\n this._sortOrder = 1;\n this._multiSortMeta = null;\n this.tableService.onSort(null);\n\n this.filteredNodes = null;\n this.filters = {};\n\n this.first = 0;\n\n if (this.lazy) {\n this.onLazyLoad.emit(this.createLazyLoadMetadata());\n }\n else {\n this.totalRecords = (this._value ? this._value.length : 0);\n }\n }\n\n updateEditingCell(cell) {\n this.editingCell = cell;\n this.bindDocumentEditListener();\n }\n\n isEditingCellValid() {\n return (this.editingCell && DomHandler.find(this.editingCell, '.ng-invalid.ng-dirty').length === 0);\n }\n\n bindDocumentEditListener() {\n if (!this.documentEditListener) {\n this.documentEditListener = (event) => {\n if (this.editingCell && !this.editingCellClick && this.isEditingCellValid()) {\n DomHandler.removeClass(this.editingCell, 'p-cell-editing');\n this.editingCell = null;\n this.unbindDocumentEditListener();\n }\n\n this.editingCellClick = false;\n };\n\n document.addEventListener('click', this.documentEditListener);\n }\n }\n\n unbindDocumentEditListener() {\n if (this.documentEditListener) {\n document.removeEventListener('click', this.documentEditListener);\n this.documentEditListener = null;\n }\n }\n\n ngOnDestroy() {\n this.unbindDocumentEditListener();\n this.editingCell = null;\n this.initialized = null;\n }\n\n}\n\n@Component({\n selector: '[pTreeTableBody]',\n template: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n `,\n encapsulation: ViewEncapsulation.None\n})\nexport class TTBody {\n\n @Input(\"pTreeTableBody\") columns: any[];\n\n @Input(\"pTreeTableBodyTemplate\") template: TemplateRef;\n\n @Input() frozen: boolean;\n\n subscription: Subscription;\n\n constructor(public tt: TreeTable, public treeTableService: TreeTableService, public cd: ChangeDetectorRef) {\n this.subscription = this.tt.tableService.uiUpdateSource$.subscribe(() => {\n if (this.tt.virtualScroll) {\n this.cd.detectChanges();\n }\n });\n }\n\n ngOnDestroy() {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n }\n}\n\n@Component({\n selector: '[ttScrollableView]',\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 \n \n
\n
\n
\n
\n
\n \n
\n `,\n encapsulation: ViewEncapsulation.None\n})\nexport class TTScrollableView implements AfterViewInit, OnDestroy {\n\n @Input(\"ttScrollableView\") columns: any[];\n\n @Input() frozen: boolean;\n\n @ViewChild('scrollHeader') scrollHeaderViewChild: ElementRef;\n\n @ViewChild('scrollHeaderBox') scrollHeaderBoxViewChild: ElementRef;\n\n @ViewChild('scrollBody') scrollBodyViewChild: ElementRef;\n\n @ViewChild('scrollTable') scrollTableViewChild: ElementRef;\n\n @ViewChild('loadingTable') scrollLoadingTableViewChild: ElementRef;\n\n @ViewChild('scrollFooter') scrollFooterViewChild: ElementRef;\n\n @ViewChild('scrollFooterBox') scrollFooterBoxViewChild: ElementRef;\n\n @ViewChild('scrollableAligner') scrollableAlignerViewChild: ElementRef;\n\n @ViewChild(CdkVirtualScrollViewport) virtualScrollBody: CdkVirtualScrollViewport;\n\n headerScrollListener;\n\n bodyScrollListener;\n\n footerScrollListener;\n\n frozenSiblingBody: Element;\n\n totalRecordsSubscription: Subscription;\n\n _scrollHeight: string;\n\n preventBodyScrollPropagation: boolean;\n\n @Input() get scrollHeight(): string {\n return this._scrollHeight;\n }\n set scrollHeight(val: string) {\n this._scrollHeight = val;\n if (val != null && (val.includes('%') || val.includes('calc'))) {\n console.log('Percentage scroll height calculation is removed in favor of the more performant CSS based flex mode, use scrollHeight=\"flex\" instead.')\n }\n\n if (this.tt.virtualScroll && this.virtualScrollBody) {\n this.virtualScrollBody.ngOnInit();\n }\n }\n\n constructor(public tt: TreeTable, public el: ElementRef, public zone: NgZone) {}\n\n ngAfterViewInit() {\n if (!this.frozen) {\n if (this.tt.frozenColumns || this.tt.frozenBodyTemplate) {\n DomHandler.addClass(this.el.nativeElement, 'p-treetable-unfrozen-view');\n }\n\n let frozenView = this.el.nativeElement.previousElementSibling;\n if (frozenView) {\n if (this.tt.virtualScroll)\n this.frozenSiblingBody = DomHandler.findSingle(frozenView, '.p-treetable-virtual-scrollable-body');\n else\n this.frozenSiblingBody = DomHandler.findSingle(frozenView, '.p-treetable-scrollable-body');\n }\n\n let scrollBarWidth = DomHandler.calculateScrollbarWidth();\n this.scrollHeaderBoxViewChild.nativeElement.style.paddingRight = scrollBarWidth + 'px';\n\n if (this.scrollFooterBoxViewChild && this.scrollFooterBoxViewChild.nativeElement) {\n this.scrollFooterBoxViewChild.nativeElement.style.paddingRight = scrollBarWidth + 'px';\n }\n }\n else {\n if (this.scrollableAlignerViewChild && this.scrollableAlignerViewChild.nativeElement) {\n this.scrollableAlignerViewChild.nativeElement.style.height = DomHandler.calculateScrollbarHeight() + 'px';\n }\n }\n\n this.bindEvents();\n }\n\n bindEvents() {\n this.zone.runOutsideAngular(() => {\n if (this.scrollHeaderViewChild && this.scrollHeaderViewChild.nativeElement) {\n this.headerScrollListener = this.onHeaderScroll.bind(this);\n this.scrollHeaderBoxViewChild.nativeElement.addEventListener('scroll', this.headerScrollListener);\n }\n\n if (this.scrollFooterViewChild && this.scrollFooterViewChild.nativeElement) {\n this.footerScrollListener = this.onFooterScroll.bind(this);\n this.scrollFooterViewChild.nativeElement.addEventListener('scroll', this.footerScrollListener);\n }\n\n if (!this.frozen) {\n this.bodyScrollListener = this.onBodyScroll.bind(this);\n\n if (this.tt.virtualScroll)\n this.virtualScrollBody.getElementRef().nativeElement.addEventListener('scroll', this.bodyScrollListener);\n else\n this.scrollBodyViewChild.nativeElement.addEventListener('scroll', this.bodyScrollListener);\n }\n });\n }\n\n unbindEvents() {\n if (this.scrollHeaderViewChild && this.scrollHeaderViewChild.nativeElement) {\n this.scrollHeaderBoxViewChild.nativeElement.removeEventListener('scroll', this.headerScrollListener);\n }\n\n if (this.scrollFooterViewChild && this.scrollFooterViewChild.nativeElement) {\n this.scrollFooterViewChild.nativeElement.removeEventListener('scroll', this.footerScrollListener);\n }\n\n if (this.scrollBodyViewChild && this.scrollBodyViewChild.nativeElement) {\n this.scrollBodyViewChild.nativeElement.removeEventListener('scroll', this.bodyScrollListener);\n }\n\n if (this.virtualScrollBody && this.virtualScrollBody.getElementRef()) {\n this.virtualScrollBody.getElementRef().nativeElement.removeEventListener('scroll', this.bodyScrollListener);\n }\n }\n\n onHeaderScroll() {\n const scrollLeft = this.scrollHeaderViewChild.nativeElement.scrollLeft;\n\n this.scrollBodyViewChild.nativeElement.scrollLeft = scrollLeft;\n\n if (this.scrollFooterViewChild && this.scrollFooterViewChild.nativeElement) {\n this.scrollFooterViewChild.nativeElement.scrollLeft = scrollLeft;\n }\n\n this.preventBodyScrollPropagation = true;\n }\n\n onFooterScroll() {\n const scrollLeft = this.scrollFooterViewChild.nativeElement.scrollLeft;\n this.scrollBodyViewChild.nativeElement.scrollLeft = scrollLeft;\n\n if (this.scrollHeaderViewChild && this.scrollHeaderViewChild.nativeElement) {\n this.scrollHeaderViewChild.nativeElement.scrollLeft = scrollLeft;\n }\n\n this.preventBodyScrollPropagation = true;\n }\n\n onBodyScroll(event) {\n if (this.preventBodyScrollPropagation) {\n this.preventBodyScrollPropagation = false;\n return;\n }\n\n if (this.scrollHeaderViewChild && this.scrollHeaderViewChild.nativeElement) {\n this.scrollHeaderBoxViewChild.nativeElement.style.marginLeft = -1 * event.target.scrollLeft + 'px';\n }\n\n if (this.scrollFooterViewChild && this.scrollFooterViewChild.nativeElement) {\n this.scrollFooterBoxViewChild.nativeElement.style.marginLeft = -1 * event.target.scrollLeft + 'px';\n }\n\n if (this.frozenSiblingBody) {\n this.frozenSiblingBody.scrollTop = event.target.scrollTop;\n }\n }\n\n scrollToVirtualIndex(index: number): void {\n if (this.virtualScrollBody) {\n this.virtualScrollBody.scrollToIndex(index);\n }\n }\n\n scrollTo(options): void {\n if (this.virtualScrollBody) {\n this.virtualScrollBody.scrollTo(options);\n }\n else {\n if (this.scrollBodyViewChild.nativeElement.scrollTo) {\n this.scrollBodyViewChild.nativeElement.scrollTo(options);\n }\n else {\n this.scrollBodyViewChild.nativeElement.scrollLeft = options.left;\n this.scrollBodyViewChild.nativeElement.scrollTop = options.top;\n }\n }\n }\n\n ngOnDestroy() {\n this.unbindEvents();\n\n this.frozenSiblingBody = null;\n }\n}\n\n@Directive({\n selector: '[ttSortableColumn]',\n host: {\n '[class.p-sortable-column]': 'isEnabled()',\n '[class.p-highlight]': 'sorted',\n '[attr.tabindex]': 'isEnabled() ? \"0\" : null',\n '[attr.role]': '\"columnheader\"'\n }\n})\nexport class TTSortableColumn implements OnInit, OnDestroy {\n\n @Input(\"ttSortableColumn\") field: string;\n\n @Input() ttSortableColumnDisabled: boolean;\n\n sorted: boolean;\n\n subscription: Subscription;\n\n constructor(public tt: TreeTable) {\n if (this.isEnabled()) {\n this.subscription = this.tt.tableService.sortSource$.subscribe(sortMeta => {\n this.updateSortState();\n });\n }\n }\n\n ngOnInit() {\n if (this.isEnabled()) {\n this.updateSortState();\n }\n }\n\n updateSortState() {\n this.sorted = this.tt.isSorted(this.field);\n }\n\n @HostListener('click', ['$event'])\n onClick(event: MouseEvent) {\n if (this.isEnabled()) {\n this.updateSortState();\n this.tt.sort({\n originalEvent: event,\n field: this.field\n });\n\n DomHandler.clearSelection();\n }\n }\n\n @HostListener('keydown.enter', ['$event'])\n onEnterKey(event: MouseEvent) {\n this.onClick(event);\n }\n\n isEnabled() {\n return this.ttSortableColumnDisabled !== true;\n }\n\n ngOnDestroy() {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n }\n}\n\n@Component({\n selector: 'p-treeTableSortIcon',\n template: `\n \n `,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TTSortIcon implements OnInit, OnDestroy {\n\n @Input() field: string;\n\n @Input() ariaLabelDesc: string;\n\n @Input() ariaLabelAsc: string;\n\n subscription: Subscription;\n\n sortOrder: number;\n\n constructor(public tt: TreeTable, public cd: ChangeDetectorRef) {\n this.subscription = this.tt.tableService.sortSource$.subscribe(sortMeta => {\n this.updateSortState();\n this.cd.markForCheck();\n });\n }\n\n ngOnInit() {\n this.updateSortState();\n }\n\n onClick(event){\n event.preventDefault();\n }\n\n updateSortState() {\n if (this.tt.sortMode === 'single') {\n this.sortOrder = this.tt.isSorted(this.field) ? this.tt.sortOrder : 0;\n }\n else if (this.tt.sortMode === 'multiple') {\n let sortMeta = this.tt.getSortMeta(this.field);\n this.sortOrder = sortMeta ? sortMeta.order: 0;\n }\n }\n\n ngOnDestroy() {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n }\n}\n\n@Directive({\n selector: '[ttResizableColumn]'\n})\nexport class TTResizableColumn implements AfterViewInit, OnDestroy {\n\n @Input() ttResizableColumnDisabled: boolean;\n\n resizer: HTMLSpanElement;\n\n resizerMouseDownListener: any;\n\n documentMouseMoveListener: any;\n\n documentMouseUpListener: any;\n\n constructor(public tt: TreeTable, public el: ElementRef, public zone: NgZone) { }\n\n ngAfterViewInit() {\n if (this.isEnabled()) {\n DomHandler.addClass(this.el.nativeElement, 'p-resizable-column');\n this.resizer = document.createElement('span');\n this.resizer.className = 'p-column-resizer';\n this.el.nativeElement.appendChild(this.resizer);\n\n this.zone.runOutsideAngular(() => {\n this.resizerMouseDownListener = this.onMouseDown.bind(this);\n this.resizer.addEventListener('mousedown', this.resizerMouseDownListener);\n });\n }\n }\n\n bindDocumentEvents() {\n this.zone.runOutsideAngular(() => {\n this.documentMouseMoveListener = this.onDocumentMouseMove.bind(this);\n document.addEventListener('mousemove', this.documentMouseMoveListener);\n\n this.documentMouseUpListener = this.onDocumentMouseUp.bind(this);\n document.addEventListener('mouseup', this.documentMouseUpListener);\n });\n }\n\n unbindDocumentEvents() {\n if (this.documentMouseMoveListener) {\n document.removeEventListener('mousemove', this.documentMouseMoveListener);\n this.documentMouseMoveListener = null;\n }\n\n if (this.documentMouseUpListener) {\n document.removeEventListener('mouseup', this.documentMouseUpListener);\n this.documentMouseUpListener = null;\n }\n }\n\n onMouseDown(event: Event) {\n this.tt.onColumnResizeBegin(event);\n this.bindDocumentEvents();\n }\n\n onDocumentMouseMove(event: Event) {\n this.tt.onColumnResize(event);\n }\n\n onDocumentMouseUp(event: Event) {\n this.tt.onColumnResizeEnd(event, this.el.nativeElement);\n this.unbindDocumentEvents();\n }\n\n isEnabled() {\n return this.ttResizableColumnDisabled !== true;\n }\n\n ngOnDestroy() {\n if (this.resizerMouseDownListener) {\n this.resizer.removeEventListener('mousedown', this.resizerMouseDownListener);\n }\n\n this.unbindDocumentEvents();\n }\n}\n\n@Directive({\n selector: '[ttReorderableColumn]'\n})\nexport class TTReorderableColumn implements AfterViewInit, OnDestroy {\n\n @Input() ttReorderableColumnDisabled: boolean;\n\n dragStartListener: any;\n\n dragOverListener: any;\n\n dragEnterListener: any;\n\n dragLeaveListener: any;\n\n mouseDownListener: any;\n\n constructor(public tt: TreeTable, public el: ElementRef, public zone: NgZone) { }\n\n ngAfterViewInit() {\n if (this.isEnabled()) {\n this.bindEvents();\n }\n }\n\n bindEvents() {\n this.zone.runOutsideAngular(() => {\n this.mouseDownListener = this.onMouseDown.bind(this);\n this.el.nativeElement.addEventListener('mousedown', this.mouseDownListener);\n\n this.dragStartListener = this.onDragStart.bind(this);\n this.el.nativeElement.addEventListener('dragstart', this.dragStartListener);\n\n this.dragOverListener = this.onDragEnter.bind(this);\n this.el.nativeElement.addEventListener('dragover', this.dragOverListener);\n\n this.dragEnterListener = this.onDragEnter.bind(this);\n this.el.nativeElement.addEventListener('dragenter', this.dragEnterListener);\n\n this.dragLeaveListener = this.onDragLeave.bind(this);\n this.el.nativeElement.addEventListener('dragleave', this.dragLeaveListener);\n });\n }\n\n unbindEvents() {\n if (this.mouseDownListener) {\n document.removeEventListener('mousedown', this.mouseDownListener);\n this.mouseDownListener = null;\n }\n\n if (this.dragOverListener) {\n document.removeEventListener('dragover', this.dragOverListener);\n this.dragOverListener = null;\n }\n\n if (this.dragEnterListener) {\n document.removeEventListener('dragenter', this.dragEnterListener);\n this.dragEnterListener = null;\n }\n\n if (this.dragEnterListener) {\n document.removeEventListener('dragenter', this.dragEnterListener);\n this.dragEnterListener = null;\n }\n\n if (this.dragLeaveListener) {\n document.removeEventListener('dragleave', this.dragLeaveListener);\n this.dragLeaveListener = null;\n }\n }\n\n onMouseDown(event) {\n if (event.target.nodeName === 'INPUT' || event.target.nodeName === 'TEXTAREA' || DomHandler.hasClass(event.target, 'p-column-resizer'))\n this.el.nativeElement.draggable = false;\n else\n this.el.nativeElement.draggable = true;\n }\n\n onDragStart(event) {\n this.tt.onColumnDragStart(event, this.el.nativeElement);\n }\n\n onDragOver(event) {\n event.preventDefault();\n }\n\n onDragEnter(event) {\n this.tt.onColumnDragEnter(event, this.el.nativeElement);\n }\n\n onDragLeave(event) {\n this.tt.onColumnDragLeave(event);\n }\n\n @HostListener('drop', ['$event'])\n onDrop(event) {\n if (this.isEnabled()) {\n this.tt.onColumnDrop(event, this.el.nativeElement);\n }\n }\n\n isEnabled() {\n return this.ttReorderableColumnDisabled !== true;\n }\n\n ngOnDestroy() {\n this.unbindEvents();\n }\n\n}\n\n@Directive({\n selector: '[ttSelectableRow]',\n host: {\n '[class.p-highlight]': 'selected'\n }\n})\nexport class TTSelectableRow implements OnInit, OnDestroy {\n\n @Input(\"ttSelectableRow\") rowNode: any;\n\n @Input() ttSelectableRowDisabled: boolean;\n\n selected: boolean;\n\n subscription: Subscription;\n\n constructor(public tt: TreeTable, public tableService: TreeTableService) {\n if (this.isEnabled()) {\n this.subscription = this.tt.tableService.selectionSource$.subscribe(() => {\n this.selected = this.tt.isSelected(this.rowNode.node);\n });\n }\n }\n\n ngOnInit() {\n if (this.isEnabled()) {\n this.selected = this.tt.isSelected(this.rowNode.node);\n }\n }\n\n @HostListener('click', ['$event'])\n onClick(event: Event) {\n if (this.isEnabled()) {\n this.tt.handleRowClick({\n originalEvent: event,\n rowNode: this.rowNode\n });\n }\n }\n\n @HostListener('keydown', ['$event'])\n onEnterKey(event: KeyboardEvent) {\n if (event.which === 13) {\n this.onClick(event);\n }\n }\n\n @HostListener('touchend', ['$event'])\n onTouchEnd(event: Event) {\n if (this.isEnabled()) {\n this.tt.handleRowTouchEnd(event);\n }\n }\n\n isEnabled() {\n return this.ttSelectableRowDisabled !== true;\n }\n\n ngOnDestroy() {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n }\n\n}\n\n@Directive({\n selector: '[ttSelectableRowDblClick]',\n host: {\n '[class.p-highlight]': 'selected'\n }\n})\nexport class TTSelectableRowDblClick implements OnInit, OnDestroy {\n\n @Input(\"ttSelectableRowDblClick\") rowNode: any;\n\n @Input() ttSelectableRowDisabled: boolean;\n\n selected: boolean;\n\n subscription: Subscription;\n\n constructor(public tt: TreeTable, public tableService: TreeTableService) {\n if (this.isEnabled()) {\n this.subscription = this.tt.tableService.selectionSource$.subscribe(() => {\n this.selected = this.tt.isSelected(this.rowNode.node);\n });\n }\n }\n\n ngOnInit() {\n if (this.isEnabled()) {\n this.selected = this.tt.isSelected(this.rowNode.node);\n }\n }\n\n @HostListener('dblclick', ['$event'])\n onClick(event: Event) {\n if (this.isEnabled()) {\n this.tt.handleRowClick({\n originalEvent: event,\n rowNode: this.rowNode\n });\n }\n }\n\n isEnabled() {\n return this.ttSelectableRowDisabled !== true;\n }\n\n ngOnDestroy() {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n }\n\n}\n\n@Directive({\n selector: '[ttContextMenuRow]',\n host: {\n '[class.p-highlight-contextmenu]': 'selected',\n '[attr.tabindex]': 'isEnabled() ? 0 : undefined'\n }\n})\nexport class TTContextMenuRow {\n\n @Input(\"ttContextMenuRow\") rowNode: any;\n\n @Input() ttContextMenuRowDisabled: boolean;\n\n selected: boolean;\n\n subscription: Subscription;\n\n constructor(public tt: TreeTable, public tableService: TreeTableService, private el: ElementRef) {\n if (this.isEnabled()) {\n this.subscription = this.tt.tableService.contextMenuSource$.subscribe((node) => {\n this.selected = this.tt.equals(this.rowNode.node, node);\n });\n }\n }\n\n @HostListener('contextmenu', ['$event'])\n onContextMenu(event: Event) {\n if (this.isEnabled()) {\n this.tt.handleRowRightClick({\n originalEvent: event,\n rowNode: this.rowNode\n });\n\n this.el.nativeElement.focus();\n\n event.preventDefault();\n }\n }\n\n isEnabled() {\n return this.ttContextMenuRowDisabled !== true;\n }\n\n ngOnDestroy() {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n }\n\n}\n\n@Component({\n selector: 'p-treeTableCheckbox',\n template: `\n
\n
\n \n
\n
\n \n
\n
\n `,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TTCheckbox {\n\n @Input() disabled: boolean;\n\n @Input(\"value\") rowNode: any;\n\n @ViewChild('box') boxViewChild: ElementRef;\n\n checked: boolean;\n\n subscription: Subscription;\n\n constructor(public tt: TreeTable, public tableService: TreeTableService, public cd: ChangeDetectorRef) {\n this.subscription = this.tt.tableService.selectionSource$.subscribe(() => {\n this.checked = this.tt.isSelected(this.rowNode.node);\n this.cd.markForCheck();\n });\n }\n\n ngOnInit() {\n this.checked = this.tt.isSelected(this.rowNode.node);\n }\n\n onClick(event: Event) {\n if (!this.disabled) {\n this.tt.toggleNodeWithCheckbox({\n originalEvent: event,\n rowNode: this.rowNode\n });\n }\n DomHandler.clearSelection();\n }\n\n onFocus() {\n DomHandler.addClass(this.boxViewChild.nativeElement, 'p-focus');\n }\n\n onBlur() {\n DomHandler.removeClass(this.boxViewChild.nativeElement, 'p-focus');\n }\n\n ngOnDestroy() {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n }\n\n}\n\n@Component({\n selector: 'p-treeTableHeaderCheckbox',\n template: `\n
\n
\n \n
\n
\n \n
\n
\n `,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TTHeaderCheckbox {\n\n @ViewChild('box') boxViewChild: ElementRef;\n\n checked: boolean;\n\n disabled: boolean;\n\n selectionChangeSubscription: Subscription;\n\n valueChangeSubscription: Subscription;\n\n constructor(public tt: TreeTable, public tableService: TreeTableService, private cd: ChangeDetectorRef) {\n this.valueChangeSubscription = this.tt.tableService.uiUpdateSource$.subscribe(() => {\n this.checked = this.updateCheckedState();\n });\n\n this.selectionChangeSubscription = this.tt.tableService.selectionSource$.subscribe(() => {\n this.checked = this.updateCheckedState();\n });\n }\n\n ngOnInit() {\n this.checked = this.updateCheckedState();\n }\n\n onClick(event: Event, checked) {\n if (this.tt.value && this.tt.value.length > 0) {\n this.tt.toggleNodesWithCheckbox(event, !checked);\n }\n\n DomHandler.clearSelection();\n }\n\n onFocus() {\n DomHandler.addClass(this.boxViewChild.nativeElement, 'p-focus');\n }\n\n onBlur() {\n DomHandler.removeClass(this.boxViewChild.nativeElement, 'p-focus');\n }\n\n ngOnDestroy() {\n if (this.selectionChangeSubscription) {\n this.selectionChangeSubscription.unsubscribe();\n }\n\n if (this.valueChangeSubscription) {\n this.valueChangeSubscription.unsubscribe();\n }\n }\n\n updateCheckedState() {\n this.cd.markForCheck();\n let checked: boolean;\n const data = this.tt.filteredNodes||this.tt.value;\n\n if (data) {\n for (let node of data) {\n if (this.tt.isSelected(node)) {\n checked = true;\n }\n else {\n checked = false;\n break;\n }\n }\n }\n else {\n checked = false;\n }\n\n return checked;\n }\n\n}\n\n@Directive({\n selector: '[ttEditableColumn]'\n})\nexport class TTEditableColumn implements AfterViewInit {\n\n @Input(\"ttEditableColumn\") data: any;\n\n @Input(\"ttEditableColumnField\") field: any;\n\n @Input() ttEditableColumnDisabled: boolean;\n\n constructor(public tt: TreeTable, public el: ElementRef, public zone: NgZone) {}\n\n ngAfterViewInit() {\n if (this.isEnabled()) {\n DomHandler.addClass(this.el.nativeElement, 'p-editable-column');\n }\n }\n\n @HostListener('click', ['$event'])\n onClick(event: MouseEvent) {\n if (this.isEnabled()) {\n this.tt.editingCellClick = true;\n\n if (this.tt.editingCell) {\n if (this.tt.editingCell !== this.el.nativeElement) {\n if (!this.tt.isEditingCellValid()) {\n return;\n }\n\n DomHandler.removeClass(this.tt.editingCell, 'p-cell-editing');\n this.openCell();\n }\n }\n else {\n this.openCell();\n }\n }\n }\n\n openCell() {\n this.tt.updateEditingCell(this.el.nativeElement);\n DomHandler.addClass(this.el.nativeElement, 'p-cell-editing');\n this.tt.onEditInit.emit({ field: this.field, data: this.data});\n this.tt.editingCellClick = true;\n this.zone.runOutsideAngular(() => {\n setTimeout(() => {\n let focusable = DomHandler.findSingle(this.el.nativeElement, 'input, textarea');\n if (focusable) {\n focusable.focus();\n }\n }, 50);\n });\n }\n\n closeEditingCell() {\n DomHandler.removeClass(this.tt.editingCell, 'p-checkbox-icon');\n this.tt.editingCell = null;\n this.tt.unbindDocumentEditListener();\n }\n\n @HostListener('keydown', ['$event'])\n onKeyDown(event: KeyboardEvent) {\n if (this.isEnabled()) {\n //enter\n if (event.keyCode == 13) {\n if (this.tt.isEditingCellValid()) {\n DomHandler.removeClass(this.tt.editingCell, 'p-cell-editing');\n this.closeEditingCell();\n this.tt.onEditComplete.emit({ field: this.field, data: this.data });\n }\n\n event.preventDefault();\n }\n\n //escape\n else if (event.keyCode == 27) {\n if (this.tt.isEditingCellValid()) {\n DomHandler.removeClass(this.tt.editingCell, 'p-cell-editing');\n this.closeEditingCell();\n this.tt.onEditCancel.emit({ field: this.field, data: this.data });\n }\n\n event.preventDefault();\n }\n\n //tab\n else if (event.keyCode == 9) {\n this.tt.onEditComplete.emit({ field: this.field, data: this.data });\n\n if (event.shiftKey)\n this.moveToPreviousCell(event);\n else\n this.moveToNextCell(event);\n }\n }\n }\n\n findCell(element) {\n if (element) {\n let cell = element;\n while (cell && !DomHandler.hasClass(cell, 'p-cell-editing')) {\n cell = cell.parentElement;\n }\n\n return cell;\n }\n else {\n return null;\n }\n }\n\n moveToPreviousCell(event: KeyboardEvent) {\n let currentCell = this.findCell(event.target);\n let row = currentCell.parentElement;\n let targetCell = this.findPreviousEditableColumn(currentCell);\n\n if (targetCell) {\n DomHandler.invokeElementMethod(targetCell, 'click');\n event.preventDefault();\n }\n }\n\n moveToNextCell(event: KeyboardEvent) {\n let currentCell = this.findCell(event.target);\n let row = currentCell.parentElement;\n let targetCell = this.findNextEditableColumn(currentCell);\n\n if (targetCell) {\n DomHandler.invokeElementMethod(targetCell, 'click');\n event.preventDefault();\n }\n }\n\n findPreviousEditableColumn(cell: Element) {\n let prevCell = cell.previousElementSibling;\n\n if (!prevCell) {\n let previousRow = cell.parentElement ? cell.parentElement.previousElementSibling : null;\n if (previousRow) {\n prevCell = previousRow.lastElementChild;\n }\n }\n\n if (prevCell) {\n if (DomHandler.hasClass(prevCell, 'p-editable-column'))\n return prevCell;\n else\n return this.findPreviousEditableColumn(prevCell);\n }\n else {\n return null;\n }\n }\n\n findNextEditableColumn(cell: Element) {\n let nextCell = cell.nextElementSibling;\n\n if (!nextCell) {\n let nextRow = cell.parentElement ? cell.parentElement.nextElementSibling : null;\n if (nextRow) {\n nextCell = nextRow.firstElementChild;\n }\n }\n\n if (nextCell) {\n if (DomHandler.hasClass(nextCell, 'p-editable-column'))\n return nextCell;\n else\n return this.findNextEditableColumn(nextCell);\n }\n else {\n return null;\n }\n }\n\n isEnabled() {\n return this.ttEditableColumnDisabled !== true;\n }\n\n}\n\n@Component({\n selector: 'p-treeTableCellEditor',\n template: `\n \n \n \n \n \n \n `,\n encapsulation: ViewEncapsulation.None\n})\nexport class TreeTableCellEditor implements AfterContentInit {\n\n @ContentChildren(PrimeTemplate) templates: QueryList;\n\n inputTemplate: TemplateRef;\n\n outputTemplate: TemplateRef;\n\n constructor(public tt: TreeTable, public editableColumn: TTEditableColumn) { }\n\n ngAfterContentInit() {\n this.templates.forEach((item) => {\n switch (item.getType()) {\n case 'input':\n this.inputTemplate = item.template;\n break;\n\n case 'output':\n this.outputTemplate = item.template;\n break;\n }\n });\n }\n}\n\n@Directive({\n selector: '[ttRow]',\n host: {\n '[attr.tabindex]': '\"0\"'\n }\n})\nexport class TTRow {\n\n @Input('ttRow') rowNode: any;\n\n constructor(public tt: TreeTable, public el: ElementRef, public zone: NgZone) {}\n\n @HostListener('keydown', ['$event'])\n onKeyDown(event: KeyboardEvent) {\n switch (event.which) {\n //down arrow\n case 40:\n let nextRow = this.el.nativeElement.nextElementSibling;\n if (nextRow) {\n nextRow.focus();\n }\n\n event.preventDefault();\n break;\n\n //down arrow\n case 38:\n let prevRow = this.el.nativeElement.previousElementSibling;\n if (prevRow) {\n prevRow.focus();\n }\n\n event.preventDefault();\n break;\n\n //left arrow\n case 37:\n if (this.rowNode.node.expanded) {\n this.tt.toggleRowIndex = DomHandler.index(this.el.nativeElement);\n this.rowNode.node.expanded = false;\n\n this.tt.onNodeCollapse.emit({\n originalEvent: event,\n node: this.rowNode.node\n });\n\n this.tt.updateSerializedValue();\n this.tt.tableService.onUIUpdate(this.tt.value);\n this.restoreFocus();\n }\n break;\n\n //right arrow\n case 39:\n if (!this.rowNode.node.expanded) {\n this.tt.toggleRowIndex = DomHandler.index(this.el.nativeElement);\n this.rowNode.node.expanded = true;\n\n this.tt.onNodeExpand.emit({\n originalEvent: event,\n node: this.rowNode.node\n });\n\n this.tt.updateSerializedValue();\n this.tt.tableService.onUIUpdate(this.tt.value);\n this.restoreFocus();\n }\n break;\n }\n }\n\n restoreFocus() {\n this.zone.runOutsideAngular(() => {\n setTimeout(() => {\n let row = DomHandler.findSingle(this.tt.containerViewChild.nativeElement, '.p-treetable-tbody').children[this.tt.toggleRowIndex];\n if (row) {\n row.focus();\n }\n }, 25);\n });\n }\n}\n\n@Component({\n selector: 'p-treeTableToggler',\n template: `\n \n `,\n encapsulation: ViewEncapsulation.None\n})\nexport class TreeTableToggler {\n\n @Input() rowNode: any;\n\n constructor(public tt: TreeTable) {}\n\n onClick(event: Event) {\n this.rowNode.node.expanded = !this.rowNode.node.expanded;\n\n if (this.rowNode.node.expanded) {\n this.tt.onNodeExpand.emit({\n originalEvent: event,\n node: this.rowNode.node\n });\n }\n else {\n this.tt.onNodeCollapse.emit({\n originalEvent: event,\n node: this.rowNode.node\n });\n }\n\n this.tt.updateSerializedValue();\n this.tt.tableService.onUIUpdate(this.tt.value);\n\n event.preventDefault();\n }\n}\n\n@NgModule({\n imports: [CommonModule,PaginatorModule,ScrollingModule,RippleModule],\n exports: [TreeTable,SharedModule,TreeTableToggler,TTSortableColumn,TTSortIcon,TTResizableColumn,TTRow,TTReorderableColumn,TTSelectableRow,TTSelectableRowDblClick,TTContextMenuRow,TTCheckbox,TTHeaderCheckbox,TTEditableColumn,TreeTableCellEditor,ScrollingModule],\n declarations: [TreeTable,TreeTableToggler,TTScrollableView,TTBody,TTSortableColumn,TTSortIcon,TTResizableColumn,TTRow,TTReorderableColumn,TTSelectableRow,TTSelectableRowDblClick,TTContextMenuRow,TTCheckbox,TTHeaderCheckbox,TTEditableColumn,TreeTableCellEditor]\n})\nexport class TreeTableModule { }\n"]}