UNPKG

primeng

Version:

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![npm version](https://badge.fury.io/js/primeng.svg)](https://badge.fury.io/js/primeng) [![Build Status](https://travis-ci.org/primefaces/primeng.

1 lines 70.4 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("rxjs"),require("primeng/dom"),require("primeng/paginator"),require("primeng/api"),require("primeng/utils")):"function"==typeof define&&define.amd?define("primeng/treetable",["exports","@angular/core","@angular/common","rxjs","primeng/dom","primeng/paginator","primeng/api","primeng/utils"],t):t(((e=e||self).primeng=e.primeng||{},e.primeng.treetable={}),e.ng.core,e.ng.common,e.rxjs,e.primeng.dom,e.primeng.paginator,e.primeng.api,e.primeng.utils)}(this,(function(e,t,i,o,n,l,r,s){"use strict";var a=this&&this.__assign||function(){return(a=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},d=this&&this.__decorate||function(e,t,i,o){var n,l=arguments.length,r=l<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},c=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],o=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},h=this&&this.__read||function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var o,n,l=i.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(o=l.next()).done;)r.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}return r},u=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(h(arguments[t]));return e},p=function(){function e(){this.sortSource=new o.Subject,this.selectionSource=new o.Subject,this.contextMenuSource=new o.Subject,this.uiUpdateSource=new o.Subject,this.totalRecordsSource=new o.Subject,this.sortSource$=this.sortSource.asObservable(),this.selectionSource$=this.selectionSource.asObservable(),this.contextMenuSource$=this.contextMenuSource.asObservable(),this.uiUpdateSource$=this.uiUpdateSource.asObservable(),this.totalRecordsSource$=this.totalRecordsSource.asObservable()}return e.prototype.onSort=function(e){this.sortSource.next(e)},e.prototype.onSelectionChange=function(){this.selectionSource.next()},e.prototype.onContextMenu=function(e){this.contextMenuSource.next(e)},e.prototype.onUIUpdate=function(e){this.uiUpdateSource.next(e)},e.prototype.onTotalRecordsChange=function(e){this.totalRecordsSource.next(e)},e=d([t.Injectable()],e)}(),f=function(){function e(e,i,o){this.el=e,this.zone=i,this.tableService=o,this.lazy=!1,this.first=0,this.pageLinks=5,this.alwaysShowPaginator=!0,this.paginatorPosition="bottom",this.currentPageReportTemplate="{currentPage} of {totalPages}",this.defaultSortOrder=1,this.sortMode="single",this.resetPageOnSort=!0,this.selectionChange=new t.EventEmitter,this.contextMenuSelectionChange=new t.EventEmitter,this.contextMenuSelectionMode="separate",this.compareSelectionBy="deepEquals",this.loadingIcon="pi pi-spinner",this.showLoader=!0,this.virtualScrollDelay=150,this.virtualRowHeight=28,this.columnResizeMode="fit",this.rowTrackBy=function(e,t){return t},this.filters={},this.filterDelay=300,this.filterMode="lenient",this.onFilter=new t.EventEmitter,this.onNodeExpand=new t.EventEmitter,this.onNodeCollapse=new t.EventEmitter,this.onPage=new t.EventEmitter,this.onSort=new t.EventEmitter,this.onLazyLoad=new t.EventEmitter,this.sortFunction=new t.EventEmitter,this.onColResize=new t.EventEmitter,this.onColReorder=new t.EventEmitter,this.onNodeSelect=new t.EventEmitter,this.onNodeUnselect=new t.EventEmitter,this.onContextMenuSelect=new t.EventEmitter,this.onHeaderCheckboxToggle=new t.EventEmitter,this.onEditInit=new t.EventEmitter,this.onEditComplete=new t.EventEmitter,this.onEditCancel=new t.EventEmitter,this._value=[],this._totalRecords=0,this._sortOrder=1,this.selectionKeys={}}return e.prototype.ngOnInit=function(){this.lazy&&this.onLazyLoad.emit(this.createLazyLoadMetadata()),this.initialized=!0},e.prototype.ngAfterContentInit=function(){var e=this;this.templates.forEach((function(t){switch(t.getType()){case"caption":e.captionTemplate=t.template;break;case"header":e.headerTemplate=t.template;break;case"body":e.bodyTemplate=t.template;break;case"loadingbody":e.loadingBodyTemplate=t.template;break;case"footer":e.footerTemplate=t.template;break;case"summary":e.summaryTemplate=t.template;break;case"colgroup":e.colGroupTemplate=t.template;break;case"emptymessage":e.emptyMessageTemplate=t.template;break;case"paginatorleft":e.paginatorLeftTemplate=t.template;break;case"paginatorright":e.paginatorRightTemplate=t.template;break;case"frozenheader":e.frozenHeaderTemplate=t.template;break;case"frozenbody":e.frozenBodyTemplate=t.template;break;case"frozenfooter":e.frozenFooterTemplate=t.template;break;case"frozencolgroup":e.frozenColGroupTemplate=t.template}}))},e.prototype.ngOnChanges=function(e){e.value&&(this._value=e.value.currentValue,this.lazy||(this.totalRecords=this._value?this._value.length:0,"single"==this.sortMode&&this.sortField?this.sortSingle():"multiple"==this.sortMode&&this.multiSortMeta?this.sortMultiple():this.hasFilter()&&this._filter()),this.virtualScroll&&this.virtualScrollCallback&&this.virtualScrollCallback(),this.updateSerializedValue(),this.tableService.onUIUpdate(this.value)),e.sortField&&(this._sortField=e.sortField.currentValue,this.lazy&&!this.initialized||"single"===this.sortMode&&this.sortSingle()),e.sortOrder&&(this._sortOrder=e.sortOrder.currentValue,this.lazy&&!this.initialized||"single"===this.sortMode&&this.sortSingle()),e.multiSortMeta&&(this._multiSortMeta=e.multiSortMeta.currentValue,"multiple"===this.sortMode&&this.sortMultiple()),e.selection&&(this._selection=e.selection.currentValue,this.preventSelectionSetterPropagation||(this.updateSelectionKeys(),this.tableService.onSelectionChange()),this.preventSelectionSetterPropagation=!1)},Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this._value=e},enumerable:!0,configurable:!0}),e.prototype.updateSerializedValue=function(){this.serializedValue=[],this.paginator?this.serializePageNodes():this.serializeNodes(null,this.filteredNodes||this.value,0,!0)},e.prototype.serializeNodes=function(e,t,i,o){var n,l;if(t&&t.length)try{for(var r=c(t),s=r.next();!s.done;s=r.next()){var a=s.value;a.parent=e;var d={node:a,parent:e,level:i,visible:o&&(!e||e.expanded)};this.serializedValue.push(d),d.visible&&a.expanded&&this.serializeNodes(a,a.children,i+1,d.visible)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(l=r.return)&&l.call(r)}finally{if(n)throw n.error}}},e.prototype.serializePageNodes=function(){var e=this.filteredNodes||this.value;if(this.serializedValue=[],e&&e.length)for(var t=this.lazy?0:this.first,i=t;i<t+this.rows;i++){var o=e[i];o&&(this.serializedValue.push({node:o,parent:null,level:0,visible:!0}),this.serializeNodes(o,o.children,1,!0))}},Object.defineProperty(e.prototype,"totalRecords",{get:function(){return this._totalRecords},set:function(e){this._totalRecords=e,this.tableService.onTotalRecordsChange(this._totalRecords)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sortField",{get:function(){return this._sortField},set:function(e){this._sortField=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sortOrder",{get:function(){return this._sortOrder},set:function(e){this._sortOrder=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"multiSortMeta",{get:function(){return this._multiSortMeta},set:function(e){this._multiSortMeta=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){return this._selection},set:function(e){this._selection=e},enumerable:!0,configurable:!0}),e.prototype.updateSelectionKeys=function(){var e,t;if(this.dataKey&&this._selection)if(this.selectionKeys={},Array.isArray(this._selection))try{for(var i=c(this._selection),o=i.next();!o.done;o=i.next()){var n=o.value;this.selectionKeys[String(s.ObjectUtils.resolveFieldData(n.data,this.dataKey))]=1}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}else this.selectionKeys[String(s.ObjectUtils.resolveFieldData(this._selection.data,this.dataKey))]=1},e.prototype.onPageChange=function(e){this.first=e.first,this.rows=e.rows,this.lazy?this.onLazyLoad.emit(this.createLazyLoadMetadata()):this.serializePageNodes(),this.onPage.emit({first:this.first,rows:this.rows}),this.tableService.onUIUpdate(this.value)},e.prototype.sort=function(e){var t=e.originalEvent;if("single"===this.sortMode&&(this._sortOrder=this.sortField===e.field?-1*this.sortOrder:this.defaultSortOrder,this._sortField=e.field,this.sortSingle()),"multiple"===this.sortMode){var i=t.metaKey||t.ctrlKey,o=this.getSortMeta(e.field);o?i?o.order=-1*o.order:this._multiSortMeta=[{field:e.field,order:-1*o.order}]:(i&&this.multiSortMeta||(this._multiSortMeta=[]),this.multiSortMeta.push({field:e.field,order:this.defaultSortOrder})),this.sortMultiple()}},e.prototype.sortSingle=function(){if(this.sortField&&this.sortOrder){this.resetPageOnSort&&(this.first=0),this.lazy?this.onLazyLoad.emit(this.createLazyLoadMetadata()):this.value&&(this.sortNodes(this.value),this.hasFilter()&&this._filter());var e={field:this.sortField,order:this.sortOrder};this.onSort.emit(e),this.tableService.onSort(e),this.updateSerializedValue()}},e.prototype.sortNodes=function(e){var t,i,o=this;if(e&&0!==e.length){this.customSort?this.sortFunction.emit({data:e,mode:this.sortMode,field:this.sortField,order:this.sortOrder}):e.sort((function(e,t){var i=s.ObjectUtils.resolveFieldData(e.data,o.sortField),n=s.ObjectUtils.resolveFieldData(t.data,o.sortField),l=null;return l=null==i&&null!=n?-1:null!=i&&null==n?1:null==i&&null==n?0:"string"==typeof i&&"string"==typeof n?i.localeCompare(n,void 0,{numeric:!0}):i<n?-1:i>n?1:0,o.sortOrder*l}));try{for(var n=c(e),l=n.next();!l.done;l=n.next()){var r=l.value;this.sortNodes(r.children)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(i=n.return)&&i.call(n)}finally{if(t)throw t.error}}}},e.prototype.sortMultiple=function(){this.multiSortMeta&&(this.lazy?this.onLazyLoad.emit(this.createLazyLoadMetadata()):this.value&&(this.sortMultipleNodes(this.value),this.hasFilter()&&this._filter()),this.onSort.emit({multisortmeta:this.multiSortMeta}),this.tableService.onSort(this.multiSortMeta),this.updateSerializedValue())},e.prototype.sortMultipleNodes=function(e){var t,i,o=this;if(e&&0!==e.length){this.customSort?this.sortFunction.emit({data:this.value,mode:this.sortMode,multiSortMeta:this.multiSortMeta}):this.value.sort((function(e,t){return o.multisortField(e,t,o.multiSortMeta,0)}));try{for(var n=c(e),l=n.next();!l.done;l=n.next()){var r=l.value;this.sortMultipleNodes(r.children)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(i=n.return)&&i.call(n)}finally{if(t)throw t.error}}}},e.prototype.multisortField=function(e,t,i,o){var n=s.ObjectUtils.resolveFieldData(e.data,i[o].field),l=s.ObjectUtils.resolveFieldData(t.data,i[o].field),r=null;if(null==n&&null!=l?r=-1:null!=n&&null==l?r=1:null==n&&null==l&&(r=0),"string"==typeof n||n instanceof String){if(n.localeCompare&&n!=l)return i[o].order*n.localeCompare(l,void 0,{numeric:!0})}else r=n<l?-1:1;return n==l?i.length-1>o?this.multisortField(e,t,i,o+1):0:i[o].order*r},e.prototype.getSortMeta=function(e){if(this.multiSortMeta&&this.multiSortMeta.length)for(var t=0;t<this.multiSortMeta.length;t++)if(this.multiSortMeta[t].field===e)return this.multiSortMeta[t];return null},e.prototype.isSorted=function(e){if("single"===this.sortMode)return this.sortField&&this.sortField===e;if("multiple"===this.sortMode){var t=!1;if(this.multiSortMeta)for(var i=0;i<this.multiSortMeta.length;i++)if(this.multiSortMeta[i].field==e){t=!0;break}return t}},e.prototype.createLazyLoadMetadata=function(){return{first:this.first,rows:this.virtualScroll?2*this.rows:this.rows,sortField:this.sortField,sortOrder:this.sortOrder,filters:this.filters,globalFilter:this.filters&&this.filters.global?this.filters.global.value:null,multiSortMeta:this.multiSortMeta}},e.prototype.handleVirtualScroll=function(e){var t=this;this.first=(e.page-1)*this.rows,this.virtualScrollCallback=e.callback,this.zone.run((function(){t.virtualScrollTimer&&clearTimeout(t.virtualScrollTimer),t.virtualScrollTimer=setTimeout((function(){t.onLazyLoad.emit(t.createLazyLoadMetadata())}),t.virtualScrollDelay)}))},e.prototype.isEmpty=function(){var e=this.filteredNodes||this.value;return null==e||0==e.length},e.prototype.getBlockableElement=function(){return this.el.nativeElement.children[0]},e.prototype.onColumnResizeBegin=function(e){var t=n.DomHandler.getOffset(this.containerViewChild.nativeElement).left;this.lastResizerHelperX=e.pageX-t+this.containerViewChild.nativeElement.scrollLeft,e.preventDefault()},e.prototype.onColumnResize=function(e){var t=n.DomHandler.getOffset(this.containerViewChild.nativeElement).left;n.DomHandler.addClass(this.containerViewChild.nativeElement,"ui-unselectable-text"),this.resizeHelperViewChild.nativeElement.style.height=this.containerViewChild.nativeElement.offsetHeight+"px",this.resizeHelperViewChild.nativeElement.style.top="0px",this.resizeHelperViewChild.nativeElement.style.left=e.pageX-t+this.containerViewChild.nativeElement.scrollLeft+"px",this.resizeHelperViewChild.nativeElement.style.display="block"},e.prototype.onColumnResizeEnd=function(e,t){var i=this.resizeHelperViewChild.nativeElement.offsetLeft-this.lastResizerHelperX,o=t.offsetWidth,l=o+i,r=t.style.minWidth||15;if(o+i>parseInt(r)){if("fit"===this.columnResizeMode){for(var s=t.nextElementSibling;!s.offsetParent;)s=s.nextElementSibling;if(s){var a=s.offsetWidth-i,d=s.style.minWidth||15;if(l>15&&a>parseInt(d))if(this.scrollable){var c=this.findParentScrollableView(t),h=n.DomHandler.findSingle(c,"table.ui-treetable-scrollable-body-table"),u=n.DomHandler.findSingle(c,"table.ui-treetable-scrollable-header-table"),p=n.DomHandler.findSingle(c,"table.ui-treetable-scrollable-footer-table"),f=n.DomHandler.index(t);this.resizeColGroup(u,f,l,a),this.resizeColGroup(h,f,l,a),this.resizeColGroup(p,f,l,a)}else t.style.width=l+"px",s&&(s.style.width=a+"px")}}else if("expand"===this.columnResizeMode)if(this.scrollable){c=this.findParentScrollableView(t),h=n.DomHandler.findSingle(c,"table.ui-treetable-scrollable-body-table"),u=n.DomHandler.findSingle(c,"table.ui-treetable-scrollable-header-table"),p=n.DomHandler.findSingle(c,"table.ui-treetable-scrollable-footer-table");h.style.width=h.offsetWidth+i+"px",u.style.width=u.offsetWidth+i+"px",p&&(p.style.width=p.offsetWidth+i+"px");f=n.DomHandler.index(t);this.resizeColGroup(u,f,l,null),this.resizeColGroup(h,f,l,null),this.resizeColGroup(p,f,l,null)}else{this.tableViewChild.nativeElement.style.width=this.tableViewChild.nativeElement.offsetWidth+i+"px",t.style.width=l+"px";var m=this.tableViewChild.nativeElement.style.width;this.containerViewChild.nativeElement.style.width=m+"px"}this.onColResize.emit({element:t,delta:i})}this.resizeHelperViewChild.nativeElement.style.display="none",n.DomHandler.removeClass(this.containerViewChild.nativeElement,"ui-unselectable-text")},e.prototype.findParentScrollableView=function(e){if(e){for(var t=e.parentElement;t&&!n.DomHandler.hasClass(t,"ui-treetable-scrollable-view");)t=t.parentElement;return t}return null},e.prototype.resizeColGroup=function(e,t,i,o){if(e){var n="COLGROUP"===e.children[0].nodeName?e.children[0]:null;if(!n)throw"Scrollable tables require a colgroup to support resizable columns";var l=n.children[t],r=l.nextElementSibling;l.style.width=i+"px",r&&o&&(r.style.width=o+"px")}},e.prototype.onColumnDragStart=function(e,t){this.reorderIconWidth=n.DomHandler.getHiddenElementOuterWidth(this.reorderIndicatorUpViewChild.nativeElement),this.reorderIconHeight=n.DomHandler.getHiddenElementOuterHeight(this.reorderIndicatorDownViewChild.nativeElement),this.draggedColumn=t,e.dataTransfer.setData("text","b")},e.prototype.onColumnDragEnter=function(e,t){if(this.reorderableColumns&&this.draggedColumn&&t){e.preventDefault();var i=n.DomHandler.getOffset(this.containerViewChild.nativeElement),o=n.DomHandler.getOffset(t);if(this.draggedColumn!=t){var l=o.left-i.left,r=(i.top,o.top,o.left+t.offsetWidth/2);this.reorderIndicatorUpViewChild.nativeElement.style.top=o.top-i.top-(this.reorderIconHeight-1)+"px",this.reorderIndicatorDownViewChild.nativeElement.style.top=o.top-i.top+t.offsetHeight+"px",e.pageX>r?(this.reorderIndicatorUpViewChild.nativeElement.style.left=l+t.offsetWidth-Math.ceil(this.reorderIconWidth/2)+"px",this.reorderIndicatorDownViewChild.nativeElement.style.left=l+t.offsetWidth-Math.ceil(this.reorderIconWidth/2)+"px",this.dropPosition=1):(this.reorderIndicatorUpViewChild.nativeElement.style.left=l-Math.ceil(this.reorderIconWidth/2)+"px",this.reorderIndicatorDownViewChild.nativeElement.style.left=l-Math.ceil(this.reorderIconWidth/2)+"px",this.dropPosition=-1),this.reorderIndicatorUpViewChild.nativeElement.style.display="block",this.reorderIndicatorDownViewChild.nativeElement.style.display="block"}else e.dataTransfer.dropEffect="none"}},e.prototype.onColumnDragLeave=function(e){this.reorderableColumns&&this.draggedColumn&&(e.preventDefault(),this.reorderIndicatorUpViewChild.nativeElement.style.display="none",this.reorderIndicatorDownViewChild.nativeElement.style.display="none")},e.prototype.onColumnDrop=function(e,t){if(e.preventDefault(),this.draggedColumn){var i=n.DomHandler.indexWithinGroup(this.draggedColumn,"ttreorderablecolumn"),o=n.DomHandler.indexWithinGroup(t,"ttreorderablecolumn"),l=i!=o;l&&(o-i==1&&-1===this.dropPosition||i-o==1&&1===this.dropPosition)&&(l=!1),l&&o<i&&1===this.dropPosition&&(o+=1),l&&o>i&&-1===this.dropPosition&&(o-=1),l&&(s.ObjectUtils.reorderArray(this.columns,i,o),this.onColReorder.emit({dragIndex:i,dropIndex:o,columns:this.columns})),this.reorderIndicatorUpViewChild.nativeElement.style.display="none",this.reorderIndicatorDownViewChild.nativeElement.style.display="none",this.draggedColumn.draggable=!1,this.draggedColumn=null,this.dropPosition=null}},e.prototype.handleRowClick=function(e){var t=e.originalEvent.target.nodeName;if("INPUT"!=t&&"BUTTON"!=t&&"A"!=t&&!n.DomHandler.hasClass(e.originalEvent.target,"ui-clickable")){if(this.selectionMode){this.preventSelectionSetterPropagation=!0;var i=e.rowNode,o=this.isSelected(i.node),l=!this.rowTouched&&this.metaKeySelection,r=this.dataKey?String(s.ObjectUtils.resolveFieldData(i.node.data,this.dataKey)):null;if(l){var a=e.originalEvent.metaKey||e.originalEvent.ctrlKey;if(o&&a){if(this.isSingleSelectionMode())this._selection=null,this.selectionKeys={},this.selectionChange.emit(null);else{var d=this.findIndexInSelection(i.node);this._selection=this.selection.filter((function(e,t){return t!=d})),this.selectionChange.emit(this.selection),r&&delete this.selectionKeys[r]}this.onNodeUnselect.emit({originalEvent:e.originalEvent,node:i.node,type:"row"})}else this.isSingleSelectionMode()?(this._selection=i.node,this.selectionChange.emit(i.node),r&&(this.selectionKeys={},this.selectionKeys[r]=1)):this.isMultipleSelectionMode()&&(a?this._selection=this.selection||[]:(this._selection=[],this.selectionKeys={}),this._selection=u(this.selection,[i.node]),this.selectionChange.emit(this.selection),r&&(this.selectionKeys[r]=1)),this.onNodeSelect.emit({originalEvent:e.originalEvent,node:i.node,type:"row",index:e.rowIndex})}else if("single"===this.selectionMode)o?(this._selection=null,this.selectionKeys={},this.selectionChange.emit(this.selection),this.onNodeUnselect.emit({originalEvent:e.originalEvent,node:i.node,type:"row"})):(this._selection=i.node,this.selectionChange.emit(this.selection),this.onNodeSelect.emit({originalEvent:e.originalEvent,node:i.node,type:"row",index:e.rowIndex}),r&&(this.selectionKeys={},this.selectionKeys[r]=1));else if("multiple"===this.selectionMode)if(o){var c=this.findIndexInSelection(i.node);this._selection=this.selection.filter((function(e,t){return t!=c})),this.selectionChange.emit(this.selection),this.onNodeUnselect.emit({originalEvent:e.originalEvent,node:i.node,type:"row"}),r&&delete this.selectionKeys[r]}else this._selection=this.selection?u(this.selection,[i.node]):[i.node],this.selectionChange.emit(this.selection),this.onNodeSelect.emit({originalEvent:e.originalEvent,node:i.node,type:"row",index:e.rowIndex}),r&&(this.selectionKeys[r]=1);this.tableService.onSelectionChange()}this.rowTouched=!1}},e.prototype.handleRowTouchEnd=function(e){this.rowTouched=!0},e.prototype.handleRowRightClick=function(e){if(this.contextMenu){var t=e.rowNode.node;if("separate"===this.contextMenuSelectionMode)this.contextMenuSelection=t,this.contextMenuSelectionChange.emit(t),this.onContextMenuSelect.emit({originalEvent:e.originalEvent,node:t}),this.contextMenu.show(e.originalEvent),this.tableService.onContextMenu(t);else if("joint"===this.contextMenuSelectionMode){this.preventSelectionSetterPropagation=!0;var i=this.isSelected(t),o=this.dataKey?String(s.ObjectUtils.resolveFieldData(t.data,this.dataKey)):null;i||(this.isSingleSelectionMode()?(this.selection=t,this.selectionChange.emit(t)):this.isMultipleSelectionMode()&&(this.selection=[t],this.selectionChange.emit(this.selection)),o&&(this.selectionKeys[o]=1)),this.contextMenu.show(e.originalEvent),this.onContextMenuSelect.emit({originalEvent:e.originalEvent,node:t})}}},e.prototype.toggleNodeWithCheckbox=function(e){this.selection=this.selection||[],this.preventSelectionSetterPropagation=!0;var t=e.rowNode.node;this.isSelected(t)?(this.propagateSelectionDown(t,!1),e.rowNode.parent&&this.propagateSelectionUp(t.parent,!1),this.selectionChange.emit(this.selection),this.onNodeUnselect.emit({originalEvent:e,node:t})):(this.propagateSelectionDown(t,!0),e.rowNode.parent&&this.propagateSelectionUp(t.parent,!0),this.selectionChange.emit(this.selection),this.onNodeSelect.emit({originalEvent:e,node:t})),this.tableService.onSelectionChange()},e.prototype.toggleNodesWithCheckbox=function(e,t){var i,o,n=this.filteredNodes||this.value;if(this._selection=t&&n?n.slice():[],t){if(n&&n.length)try{for(var l=c(n),r=l.next();!r.done;r=l.next()){var s=r.value;this.propagateSelectionDown(s,!0)}}catch(e){i={error:e}}finally{try{r&&!r.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}}else this._selection=[],this.selectionKeys={};this.preventSelectionSetterPropagation=!0,this.selectionChange.emit(this._selection),this.tableService.onSelectionChange(),this.onHeaderCheckboxToggle.emit({originalEvent:e,checked:t})},e.prototype.propagateSelectionUp=function(e,t){var i,o;if(e.children&&e.children.length){var n=0,l=!1,r=this.dataKey?String(s.ObjectUtils.resolveFieldData(e.data,this.dataKey)):null;try{for(var a=c(e.children),d=a.next();!d.done;d=a.next()){var h=d.value;this.isSelected(h)?n++:h.partialSelected&&(l=!0)}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}if(t&&n==e.children.length)this._selection=u(this.selection||[],[e]),e.partialSelected=!1,r&&(this.selectionKeys[r]=1);else{if(!t){var p=this.findIndexInSelection(e);p>=0&&(this._selection=this.selection.filter((function(e,t){return t!=p})),r&&delete this.selectionKeys[r])}l||n>0&&n!=e.children.length?e.partialSelected=!0:e.partialSelected=!1}}var f=e.parent;f&&this.propagateSelectionUp(f,t)},e.prototype.propagateSelectionDown=function(e,t){var i,o,n=this.findIndexInSelection(e),l=this.dataKey?String(s.ObjectUtils.resolveFieldData(e.data,this.dataKey)):null;if(t&&-1==n?(this._selection=u(this.selection||[],[e]),l&&(this.selectionKeys[l]=1)):!t&&n>-1&&(this._selection=this.selection.filter((function(e,t){return t!=n})),l&&delete this.selectionKeys[l]),e.partialSelected=!1,e.children&&e.children.length)try{for(var r=c(e.children),a=r.next();!a.done;a=r.next()){var d=a.value;this.propagateSelectionDown(d,t)}}catch(e){i={error:e}}finally{try{a&&!a.done&&(o=r.return)&&o.call(r)}finally{if(i)throw i.error}}},e.prototype.isSelected=function(e){return!(!e||!this.selection)&&(this.dataKey?void 0!==this.selectionKeys[s.ObjectUtils.resolveFieldData(e.data,this.dataKey)]:this.selection instanceof Array?this.findIndexInSelection(e)>-1:this.equals(e,this.selection))},e.prototype.findIndexInSelection=function(e){var t=-1;if(this.selection&&this.selection.length)for(var i=0;i<this.selection.length;i++)if(this.equals(e,this.selection[i])){t=i;break}return t},e.prototype.isSingleSelectionMode=function(){return"single"===this.selectionMode},e.prototype.isMultipleSelectionMode=function(){return"multiple"===this.selectionMode},e.prototype.equals=function(e,t){return"equals"===this.compareSelectionBy?e===t:s.ObjectUtils.equals(e.data,t.data,this.dataKey)},e.prototype.filter=function(e,t,i){var o=this;this.filterTimeout&&clearTimeout(this.filterTimeout),this.isFilterBlank(e)?this.filters[t]&&delete this.filters[t]:this.filters[t]={value:e,matchMode:i},this.filterTimeout=setTimeout((function(){o._filter(),o.filterTimeout=null}),this.filterDelay)},e.prototype.filterGlobal=function(e,t){this.filter(e,"global",t)},e.prototype.isFilterBlank=function(e){return null==e||("string"==typeof e&&0==e.trim().length||e instanceof Array&&0==e.length)},e.prototype._filter=function(){var e,t;if(this.lazy)this.onLazyLoad.emit(this.createLazyLoadMetadata());else{if(!this.value)return;if(this.hasFilter()){var i=void 0;if(this.filters.global){if(!this.columns&&!this.globalFilterFields)throw new Error("Global filtering requires dynamic columns or globalFilterFields to be defined.");i=this.globalFilterFields||this.columns}this.filteredNodes=[];var o="strict"===this.filterMode,n=!1;try{for(var l=c(this.value),r=l.next();!r.done;r=l.next()){var d=r.value,h=a({},d),u=!0,p=!1,f=void 0;for(var m in this.filters)if(this.filters.hasOwnProperty(m)&&"global"!==m){var v=this.filters[m],g=m,y=v.value,b=v.matchMode||"startsWith";if(f={filterField:g,filterValue:y,filterConstraint:s.FilterUtils[b],isStrictMode:o},(!o||this.findFilteredNodes(h,f)||this.isFilterMatched(h,f))&&(o||this.isFilterMatched(h,f)||this.findFilteredNodes(h,f))||(u=!1),!u)break}if(this.filters.global&&!p&&i)for(var C=0;C<i.length;C++){var w=a({},h);f={filterField:g=i[C].field||i[C],filterValue:y=this.filters.global.value,filterConstraint:s.FilterUtils[this.filters.global.matchMode],isStrictMode:o},(o&&(this.findFilteredNodes(w,f)||this.isFilterMatched(w,f))||!o&&(this.isFilterMatched(w,f)||this.findFilteredNodes(w,f)))&&(p=!0,h=w)}var S=u;this.filters.global&&(S=u&&p),S&&this.filteredNodes.push(h),n=n||!u||p||u&&this.filteredNodes.length>0||!p&&0===this.filteredNodes.length}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}n||(this.filteredNodes=null),this.paginator&&(this.totalRecords=this.filteredNodes?this.filteredNodes.length:this.value?this.value.length:0)}else this.filteredNodes=null,this.paginator&&(this.totalRecords=this.value?this.value.length:0)}this.first=0;var E=this.filteredNodes||this.value;this.onFilter.emit({filters:this.filters,filteredValue:E}),this.tableService.onUIUpdate(E),this.updateSerializedValue()},e.prototype.findFilteredNodes=function(e,t){var i,o;if(e){var n=!1;if(e.children){var l=u(e.children);e.children=[];try{for(var r=c(l),s=r.next();!s.done;s=r.next()){var d=s.value,h=a({},d);this.isFilterMatched(h,t)&&(n=!0,e.children.push(h))}}catch(e){i={error:e}}finally{try{s&&!s.done&&(o=r.return)&&o.call(r)}finally{if(i)throw i.error}}}if(n)return!0}},e.prototype.isFilterMatched=function(e,t){var i=t.filterField,o=t.filterValue,n=t.filterConstraint,l=t.isStrictMode,r=!1;return n(s.ObjectUtils.resolveFieldData(e.data,i),o)&&(r=!0),(!r||l&&!this.isNodeLeaf(e))&&(r=this.findFilteredNodes(e,{filterField:i,filterValue:o,filterConstraint:n,isStrictMode:l})||r),r},e.prototype.isNodeLeaf=function(e){return!1!==e.leaf&&!(e.children&&e.children.length)},e.prototype.hasFilter=function(){var e=!0;for(var t in this.filters)if(this.filters.hasOwnProperty(t)){e=!1;break}return!e},e.prototype.reset=function(){this._sortField=null,this._sortOrder=1,this._multiSortMeta=null,this.tableService.onSort(null),this.filteredNodes=null,this.filters={},this.first=0,this.lazy?this.onLazyLoad.emit(this.createLazyLoadMetadata()):this.totalRecords=this._value?this._value.length:0},e.prototype.updateEditingCell=function(e){this.editingCell=e,this.bindDocumentEditListener()},e.prototype.isEditingCellValid=function(){return this.editingCell&&0===n.DomHandler.find(this.editingCell,".ng-invalid.ng-dirty").length},e.prototype.bindDocumentEditListener=function(){var e=this;this.documentEditListener||(this.documentEditListener=function(t){e.editingCell&&!e.editingCellClick&&e.isEditingCellValid()&&(n.DomHandler.removeClass(e.editingCell,"ui-editing-cell"),e.editingCell=null,e.unbindDocumentEditListener()),e.editingCellClick=!1},document.addEventListener("click",this.documentEditListener))},e.prototype.unbindDocumentEditListener=function(){this.documentEditListener&&(document.removeEventListener("click",this.documentEditListener),this.documentEditListener=null)},e.prototype.ngOnDestroy=function(){this.unbindDocumentEditListener(),this.editingCell=null,this.initialized=null},e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.NgZone},{type:p}]},d([t.Input()],e.prototype,"columns",void 0),d([t.Input()],e.prototype,"style",void 0),d([t.Input()],e.prototype,"styleClass",void 0),d([t.Input()],e.prototype,"autoLayout",void 0),d([t.Input()],e.prototype,"lazy",void 0),d([t.Input()],e.prototype,"paginator",void 0),d([t.Input()],e.prototype,"rows",void 0),d([t.Input()],e.prototype,"first",void 0),d([t.Input()],e.prototype,"pageLinks",void 0),d([t.Input()],e.prototype,"rowsPerPageOptions",void 0),d([t.Input()],e.prototype,"alwaysShowPaginator",void 0),d([t.Input()],e.prototype,"paginatorPosition",void 0),d([t.Input()],e.prototype,"paginatorDropdownAppendTo",void 0),d([t.Input()],e.prototype,"currentPageReportTemplate",void 0),d([t.Input()],e.prototype,"showCurrentPageReport",void 0),d([t.Input()],e.prototype,"defaultSortOrder",void 0),d([t.Input()],e.prototype,"sortMode",void 0),d([t.Input()],e.prototype,"resetPageOnSort",void 0),d([t.Input()],e.prototype,"customSort",void 0),d([t.Input()],e.prototype,"selectionMode",void 0),d([t.Output()],e.prototype,"selectionChange",void 0),d([t.Input()],e.prototype,"contextMenuSelection",void 0),d([t.Output()],e.prototype,"contextMenuSelectionChange",void 0),d([t.Input()],e.prototype,"contextMenuSelectionMode",void 0),d([t.Input()],e.prototype,"dataKey",void 0),d([t.Input()],e.prototype,"metaKeySelection",void 0),d([t.Input()],e.prototype,"compareSelectionBy",void 0),d([t.Input()],e.prototype,"rowHover",void 0),d([t.Input()],e.prototype,"loading",void 0),d([t.Input()],e.prototype,"loadingIcon",void 0),d([t.Input()],e.prototype,"showLoader",void 0),d([t.Input()],e.prototype,"scrollable",void 0),d([t.Input()],e.prototype,"scrollHeight",void 0),d([t.Input()],e.prototype,"virtualScroll",void 0),d([t.Input()],e.prototype,"virtualScrollDelay",void 0),d([t.Input()],e.prototype,"virtualRowHeight",void 0),d([t.Input()],e.prototype,"frozenWidth",void 0),d([t.Input()],e.prototype,"frozenColumns",void 0),d([t.Input()],e.prototype,"resizableColumns",void 0),d([t.Input()],e.prototype,"columnResizeMode",void 0),d([t.Input()],e.prototype,"reorderableColumns",void 0),d([t.Input()],e.prototype,"contextMenu",void 0),d([t.Input()],e.prototype,"rowTrackBy",void 0),d([t.Input()],e.prototype,"filters",void 0),d([t.Input()],e.prototype,"globalFilterFields",void 0),d([t.Input()],e.prototype,"filterDelay",void 0),d([t.Input()],e.prototype,"filterMode",void 0),d([t.Output()],e.prototype,"onFilter",void 0),d([t.Output()],e.prototype,"onNodeExpand",void 0),d([t.Output()],e.prototype,"onNodeCollapse",void 0),d([t.Output()],e.prototype,"onPage",void 0),d([t.Output()],e.prototype,"onSort",void 0),d([t.Output()],e.prototype,"onLazyLoad",void 0),d([t.Output()],e.prototype,"sortFunction",void 0),d([t.Output()],e.prototype,"onColResize",void 0),d([t.Output()],e.prototype,"onColReorder",void 0),d([t.Output()],e.prototype,"onNodeSelect",void 0),d([t.Output()],e.prototype,"onNodeUnselect",void 0),d([t.Output()],e.prototype,"onContextMenuSelect",void 0),d([t.Output()],e.prototype,"onHeaderCheckboxToggle",void 0),d([t.Output()],e.prototype,"onEditInit",void 0),d([t.Output()],e.prototype,"onEditComplete",void 0),d([t.Output()],e.prototype,"onEditCancel",void 0),d([t.ViewChild("container")],e.prototype,"containerViewChild",void 0),d([t.ViewChild("resizeHelper")],e.prototype,"resizeHelperViewChild",void 0),d([t.ViewChild("reorderIndicatorUp")],e.prototype,"reorderIndicatorUpViewChild",void 0),d([t.ViewChild("reorderIndicatorDown")],e.prototype,"reorderIndicatorDownViewChild",void 0),d([t.ViewChild("table")],e.prototype,"tableViewChild",void 0),d([t.ContentChildren(r.PrimeTemplate)],e.prototype,"templates",void 0),d([t.Input()],e.prototype,"value",null),d([t.Input()],e.prototype,"totalRecords",null),d([t.Input()],e.prototype,"sortField",null),d([t.Input()],e.prototype,"sortOrder",null),d([t.Input()],e.prototype,"multiSortMeta",null),d([t.Input()],e.prototype,"selection",null),e=d([t.Component({selector:"p-treeTable",template:'\n <div #container [ngStyle]="style" [class]="styleClass"\n [ngClass]="{\'ui-treetable ui-widget\': true, \'ui-treetable-auto-layout\': autoLayout, \'ui-treetable-hoverable-rows\': (rowHover||(selectionMode === \'single\' || selectionMode === \'multiple\')),\n \'ui-treetable-resizable\': resizableColumns, \'ui-treetable-resizable-fit\': (resizableColumns && columnResizeMode === \'fit\')}">\n <div class="ui-treetable-loading ui-widget-overlay" *ngIf="loading && showLoader"></div>\n <div class="ui-treetable-loading-content" *ngIf="loading && showLoader">\n <i [class]="\'ui-treetable-loading-icon pi-spin \' + loadingIcon"></i>\n </div>\n <div *ngIf="captionTemplate" class="ui-treetable-caption ui-widget-header">\n <ng-container *ngTemplateOutlet="captionTemplate"></ng-container>\n </div>\n <p-paginator [rows]="rows" [first]="first" [totalRecords]="totalRecords" [pageLinkSize]="pageLinks" styleClass="ui-paginator-top" [alwaysShow]="alwaysShowPaginator"\n (onPageChange)="onPageChange($event)" [rowsPerPageOptions]="rowsPerPageOptions" *ngIf="paginator && (paginatorPosition === \'top\' || paginatorPosition ==\'both\')"\n [templateLeft]="paginatorLeftTemplate" [templateRight]="paginatorRightTemplate" [dropdownAppendTo]="paginatorDropdownAppendTo"\n [currentPageReportTemplate]="currentPageReportTemplate" [showCurrentPageReport]="showCurrentPageReport"></p-paginator>\n \n <div class="ui-treetable-wrapper" *ngIf="!scrollable">\n <table #table class="ui-treetable-table">\n <ng-container *ngTemplateOutlet="colGroupTemplate; context {$implicit: columns}"></ng-container>\n <thead class="ui-treetable-thead">\n <ng-container *ngTemplateOutlet="headerTemplate; context: {$implicit: columns}"></ng-container>\n </thead>\n <tfoot class="ui-treetable-tfoot">\n <ng-container *ngTemplateOutlet="footerTemplate; context {$implicit: columns}"></ng-container>\n </tfoot>\n <tbody class="ui-treetable-tbody" [pTreeTableBody]="columns" [pTreeTableBodyTemplate]="bodyTemplate"></tbody>\n </table>\n </div>\n\n <div class="ui-treetable-scrollable-wrapper" *ngIf="scrollable">\n <div class="ui-treetable-scrollable-view ui-treetable-frozen-view" *ngIf="frozenColumns||frozenBodyTemplate" [ttScrollableView]="frozenColumns" [frozen]="true" [ngStyle]="{width: frozenWidth}" [scrollHeight]="scrollHeight"></div>\n <div class="ui-treetable-scrollable-view" [ttScrollableView]="columns" [frozen]="false" [scrollHeight]="scrollHeight"></div>\n </div>\n\n <p-paginator [rows]="rows" [first]="first" [totalRecords]="totalRecords" [pageLinkSize]="pageLinks" styleClass="ui-paginator-bottom" [alwaysShow]="alwaysShowPaginator"\n (onPageChange)="onPageChange($event)" [rowsPerPageOptions]="rowsPerPageOptions" *ngIf="paginator && (paginatorPosition === \'bottom\' || paginatorPosition ==\'both\')"\n [templateLeft]="paginatorLeftTemplate" [templateRight]="paginatorRightTemplate" [dropdownAppendTo]="paginatorDropdownAppendTo"\n [currentPageReportTemplate]="currentPageReportTemplate" [showCurrentPageReport]="showCurrentPageReport"></p-paginator>\n <div *ngIf="summaryTemplate" class="ui-treetable-summary ui-widget-header">\n <ng-container *ngTemplateOutlet="summaryTemplate"></ng-container>\n </div>\n\n <div #resizeHelper class="ui-column-resizer-helper ui-state-highlight" style="display:none" *ngIf="resizableColumns"></div>\n\n <span #reorderIndicatorUp class="pi pi-arrow-down ui-table-reorder-indicator-up" *ngIf="reorderableColumns"></span>\n <span #reorderIndicatorDown class="pi pi-arrow-up ui-table-reorder-indicator-down" *ngIf="reorderableColumns"></span>\n </div>\n ',providers:[p],changeDetection:t.ChangeDetectionStrategy.Default})],e)}(),m=function(){function e(e){this.tt=e}return e.ctorParameters=function(){return[{type:f}]},d([t.Input("pTreeTableBody")],e.prototype,"columns",void 0),d([t.Input("pTreeTableBodyTemplate")],e.prototype,"template",void 0),e=d([t.Component({selector:"[pTreeTableBody]",template:'\n <ng-template ngFor let-serializedNode let-rowIndex="index" [ngForOf]="tt.serializedValue" [ngForTrackBy]="tt.rowTrackBy">\n <ng-container *ngIf="serializedNode.visible">\n <ng-container *ngTemplateOutlet="template; context: {$implicit: serializedNode, node: serializedNode.node, rowData: serializedNode.node.data, columns: columns}"></ng-container>\n </ng-container>\n </ng-template>\n <ng-container *ngIf="tt.isEmpty()">\n <ng-container *ngTemplateOutlet="tt.emptyMessageTemplate; context: {$implicit: columns}"></ng-container>\n </ng-container>\n '})],e)}(),v=function(){function e(e,t,i){var o=this;this.tt=e,this.el=t,this.zone=i,this.loadingArray=[],this.subscription=this.tt.tableService.uiUpdateSource$.subscribe((function(){o.zone.runOutsideAngular((function(){setTimeout((function(){o.alignScrollBar(),o.initialized=!0,o.scrollLoadingTableViewChild&&o.scrollLoadingTableViewChild.nativeElement&&(o.scrollLoadingTableViewChild.nativeElement.style.display="none")}),50)}))})),this.tt.virtualScroll&&(this.totalRecordsSubscription=this.tt.tableService.totalRecordsSource$.subscribe((function(){o.zone.runOutsideAngular((function(){setTimeout((function(){o.setVirtualScrollerHeight()}),50)}))}))),this.loadingArray=Array(this.tt.rows).fill(1),this.initialized=!1}return Object.defineProperty(e.prototype,"scrollHeight",{get:function(){return this._scrollHeight},set:function(e){this._scrollHeight=e,this.setScrollHeight()},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewChecked=function(){!this.initialized&&this.el.nativeElement.offsetParent&&(this.alignScrollBar(),this.initialized=!0)},e.prototype.ngAfterViewInit=function(){if(this.bindEvents(),this.setScrollHeight(),this.alignScrollBar(),this.frozen)this.scrollBodyViewChild.nativeElement.style.paddingBottom=n.DomHandler.calculateScrollbarWidth()+"px";else{(this.tt.frozenColumns||this.tt.frozenBodyTemplate)&&n.DomHandler.addClass(this.el.nativeElement,"ui-treetable-unfrozen-view"),this.tt.frozenWidth&&(this.el.nativeElement.style.left=this.tt.frozenWidth,this.el.nativeElement.style.width="calc(100% - "+this.tt.frozenWidth+")");var e=this.el.nativeElement.previousElementSibling;e&&(this.frozenSiblingBody=n.DomHandler.findSingle(e,".ui-treetable-scrollable-body"))}this.tt.virtualScroll&&(this.setVirtualScrollerHeight(),this.scrollLoadingTableViewChild&&this.scrollLoadingTableViewChild.nativeElement&&(this.scrollLoadingTableViewChild.nativeElement.style.display="table"))},e.prototype.bindEvents=function(){var e=this;this.zone.runOutsideAngular((function(){n.DomHandler.calculateScrollbarWidth();e.scrollHeaderViewChild&&e.scrollHeaderViewChild.nativeElement&&(e.headerScrollListener=e.onHeaderScroll.bind(e),e.scrollHeaderBoxViewChild.nativeElement.addEventListener("scroll",e.headerScrollListener)),e.scrollFooterViewChild&&e.scrollFooterViewChild.nativeElement&&(e.footerScrollListener=e.onFooterScroll.bind(e),e.scrollFooterViewChild.nativeElement.addEventListener("scroll",e.footerScrollListener)),e.frozen||(e.bodyScrollListener=e.onBodyScroll.bind(e),e.scrollBodyViewChild.nativeElement.addEventListener("scroll",e.bodyScrollListener))}))},e.prototype.unbindEvents=function(){this.scrollHeaderViewChild&&this.scrollHeaderViewChild.nativeElement&&this.scrollHeaderBoxViewChild.nativeElement.removeEventListener("scroll",this.headerScrollListener),this.scrollFooterViewChild&&this.scrollFooterViewChild.nativeElement&&this.scrollFooterViewChild.nativeElement.removeEventListener("scroll",this.footerScrollListener),this.scrollBodyViewChild.nativeElement.addEventListener("scroll",this.bodyScrollListener)},e.prototype.onHeaderScroll=function(e){this.scrollHeaderViewChild.nativeElement.scrollLeft=0},e.prototype.onFooterScroll=function(e){this.scrollFooterViewChild.nativeElement.scrollLeft=0},e.prototype.onBodyScroll=function(e){var t=this;if(this.scrollHeaderViewChild&&this.scrollHeaderViewChild.nativeElement&&(this.scrollHeaderBoxViewChild.nativeElement.style.marginLeft=-1*this.scrollBodyViewChild.nativeElement.scrollLeft+"px"),this.scrollFooterViewChild&&this.scrollFooterViewChild.nativeElement&&(this.scrollFooterBoxViewChild.nativeElement.style.marginLeft=-1*this.scrollBodyViewChild.nativeElement.scrollLeft+"px"),this.frozenSiblingBody&&(this.frozenSiblingBody.scrollTop=this.scrollBodyViewChild.nativeElement.scrollTop),this.tt.virtualScroll){var i=n.DomHandler.getOuterHeight(this.scrollBodyViewChild.nativeElement),o=n.DomHandler.getOuterHeight(this.scrollTableViewChild.nativeElement),l=this.tt.virtualRowHeight*this.tt.rows,r=n.DomHandler.getOuterHeight(this.virtualScrollerViewChild.nativeElement)/l||1,s=this.scrollTableViewChild.nativeElement.style.top||"0";if(this.scrollBodyViewChild.nativeElement.scrollTop+i>parseFloat(s)+o||this.scrollBodyViewChild.nativeElement.scrollTop<parseFloat(s)){this.scrollLoadingTableViewChild&&this.scrollLoadingTableViewChild.nativeElement&&(this.scrollLoadingTableViewChild.nativeElement.style.display="table",this.scrollLoadingTableViewChild.nativeElement.style.top=this.scrollBodyViewChild.nativeElement.scrollTop+"px");var a=Math.floor(this.scrollBodyViewChild.nativeElement.scrollTop*r/this.scrollBodyViewChild.nativeElement.scrollHeight)+1;this.tt.handleVirtualScroll({page:a,callback:function(){t.scrollLoadingTableViewChild&&t.scrollLoadingTableViewChild.nativeElement&&(t.scrollLoadingTableViewChild.nativeElement.style.display="none"),t.scrollTableViewChild.nativeElement.style.top=(a-1)*l+"px",t.frozenSiblingBody&&(t.frozenSiblingBody.children[0].style.top=t.scrollTableViewChild.nativeElement.style.top)}})}}},e.prototype.setScrollHeight=function(){if(this.scrollHeight&&this.scrollBodyViewChild&&this.scrollBodyViewChild.nativeElement)if(-1!==this.scrollHeight.indexOf("%")){var e=void 0;this.scrollBodyViewChild.nativeElement.style.visibility="hidden",this.scrollBodyViewChild.nativeElement.style.height="100px";var t=n.DomHandler.getOuterHeight(this.tt.el.nativeElement.children[0]);if(this.scrollHeight.includes("calc")){var i=parseInt(this.scrollHeight.slice(this.scrollHeight.indexOf("(")+1,this.scrollHeight.indexOf("%"))),o=parseInt(this.scrollHeight.slice(this.scrollHeight.indexOf("-")+1,this.scrollHeight.indexOf(")")));e=n.DomHandler.getOuterHeight(this.tt.el.nativeElement.parentElement)*i/100-o}else e=n.DomHandler.getOuterHeight(this.tt.el.nativeElement.parentElement)*parseInt(this.scrollHeight)/100;var l=e-(t-100);this.frozen&&(l-=n.DomHandler.calculateScrollbarWidth()),this.scrollBodyViewChild.nativeElement.style.height="auto",this.scrollBodyViewChild.nativeElement.style.maxHeight=l+"px",this.scrollBodyViewChild.nativeElement.style.visibility="visible"}else this.frozen?this.scrollBodyViewChild.nativeElement.style.maxHeight=parseInt(this.scrollHeight)-n.DomHandler.calculateScrollbarWidth()+"px":this.scrollBodyViewChild.nativeElement.style.maxHeight=this.scrollHeight},e.prototype.setVirtualScrollerHeight=function(){this.virtualScrollerViewChild.nativeElement&&(this.virtualScrollerViewChild.nativeElement.style.height=this.tt.totalRecords*this.tt.virtualRowHeight+"px")},e.prototype.hasVerticalOverflow=function(){return n.DomHandler.getOuterHeight(this.scrollTableViewChild.nativeElement)>n.DomHandler.getOuterHeight(this.scrollBodyViewChild.nativeElement)},e.prototype.alignScrollBar=function(){if(!this.frozen){var e=this.hasVerticalOverflow()?n.DomHandler.calculateScrollbarWidth():0;this.scrollHeaderBoxViewChild.nativeElement.style.marginRight=e+"px",this.scrollFooterBoxViewChild&&this.scrollFooterBoxViewChild.nativeElement&&(this.scrollFooterBoxViewChild.nativeElement.style.marginRight=e+"px")}this.initialized=!1},e.prototype.ngOnDestroy=function(){this.unbindEvents(),this.frozenSiblingBody=null,this.subscription&&this.subscription.unsubscribe(),this.totalRecordsSubscription&&this.totalRecordsSubscription.unsubscribe(),this.initialized=!1},e.ctorParameters=function(){return[{type:f},{type:t.ElementRef},{type:t.NgZone}]},d([t.Input("ttScrollableView")],e.prototype,"columns",void 0),d([t.Input()],e.prototype,"frozen",void 0),d([t.ViewChild("scrollHeader")],e.prototype,"scrollHeaderViewChild",void 0),d([t.ViewChild("scrollHeaderBox")],e.prototype,"scrollHeaderBoxViewChild",void 0),d([t.ViewChild("scrollBody")],e.prototype,"scrollBodyViewChild",void 0),d([t.ViewChild("scrollTable")],e.prototype,"scrollTableViewChild",void 0),d([t.ViewChild("loadingTable")],e.prototype,"scrollLoadingTableViewChild",void 0),d([t.ViewChild("scrollFooter")],e.prototype,"scrollFooterViewChild",void 0),d([t.ViewChild("scrollFooterBox")],e.prototype,"scrollFooterBoxViewChild",void 0),d([t.ViewChild("virtualScroller")],e.prototype,"virtualScrollerViewChild",void 0),d([t.Input()],e.prototype,"scrollHeight",null),e=d([t.Component({selector:"[ttScrollableView]",template:'\n <div #scrollHeader class="ui-treetable-scrollable-header ui-widget-header">\n <div #scrollHeaderBox class="ui-treetable-scrollable-header-box">\n <table class="ui-treetable-scrollable-header-table">\n <ng-container *ngTemplateOutlet="frozen ? tt.frozenColGroupTemplate||tt.colGroupTemplate : tt.colGroupTemplate; context {$implicit: columns}"></ng-container>\n <thead class="ui-treetable-thead">\n <ng-container *ngTemplateOutlet="frozen ? tt.frozenHeaderTemplate||tt.headerTemplate : tt.headerTemplate; context {$implicit: columns}"></ng-container>\n </thead>\n </table>\n </div>\n </div>\n <div #scrollBody class="ui-treetable-scrollable-body">\n <table #scrollTable [ngClass]="{\'ui-treetable-scrollable-body-table\': true, \'ui-treetable-virtual-table\': tt.virtualScroll}">\n <ng-container *ngTemplateOutlet="frozen ? tt.frozenColGroupTemplate||tt.colGroupTemplate : tt.colGroupTemplate; context {$implicit: columns}"></ng-container>\n <tbody class="ui-treetable-tbody" [pTreeTableBody]="columns" [pTreeTableBodyTemplate]="frozen ? tt.frozenBodyTemplate||tt.bodyTemplate : tt.bodyTemplate"></tbody>\n </table>\n <table #loadingTable *ngIf="tt.virtualScroll && tt.loadingBodyTemplate != null" [ngClass]="{\'ui-treetable-scrollable-body-table ui-treetable-loading-virtual-table\': true, \'ui-treetable-virtual-table\': tt.virtualScroll}">\n <tbody class="ui-treetable-tbody">\n <ng-template ngFor [ngForOf]="loadingArray">\n <ng-container *ngTemplateOutlet="tt.loadingBodyTemplate; context: {columns: columns}"></ng-container>\n </ng-template>\n </tbody>\n </table>\n <div #virtualScroller class="ui-treetable-virtual-scroller" *ngIf="tt.virtualScroll"></div>\n </div>\n <div #scrollFooter *ngIf="tt.footerTemplate" class="ui-treetable-scrollable-footer ui-widget-header">\n <div #scrollFooterBox class="ui-treetable-scrollable-footer-box">\n <table class="ui-treetable-scrollable-footer-table">\n <ng-container *ngTemplateOutlet="frozen ? tt.frozenColGroupTemplate||tt.colGroupTemplate : tt.colGroupTemplate; context {$implicit: columns}"></ng-container>\n <tfoot class="ui-treetable-tfoot">\n <ng-container *ngTemplateOutlet="frozen ? tt.frozenFooterTemplate||tt.footerTemplate : tt.footerTemplate; context {$implicit: columns}"></ng-container>\n </tfoot>\n </table>\n </div>\n </div>\n '})],e)}(),g=function(){function e(e){var t=this;this.tt=e,this.isEnabled()&&(this.subscription=this.tt.tableService.sortSource$.subscribe((function(e){t.updateSortState()})))}return e.prototype.ngOnInit=function(){this.isEnabled()&&this.updateSortState()},e.prototype.updateSortState=function(){this.sorted=this.tt.isSorted(this.field)},e.prototype.onClick=function(e){this.isEnabled()&&(this.updateSortState(),this.tt.sort(