ng-treetable
Version:
Tree table component for angular 2+.
3 lines (2 loc) • 26.9 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common"],t):t(e.ngTreetable=e.ngTreetable||{},e.ng.core,e._angular_common)}(this,function(e,t,n){"use strict";var o=function(){function e(){}return e.decorators=[{type:t.Component,args:[{selector:"ay-header",template:"<ng-content></ng-content>"}]}],e.ctorParameters=function(){return[]},e}(),i=function(){function e(){}return e.decorators=[{type:t.Component,args:[{selector:"ay-footer",template:"<ng-content></ng-content>"}]}],e.ctorParameters=function(){return[]},e}(),r=function(){function e(e){this.template=e}return e.prototype.getType=function(){return this.type?(console.log('Defining a pTemplate with type property is deprecated use pTemplate="type" instead.'),this.type):this.name},e.decorators=[{type:t.Directive,args:[{selector:"[pTemplate]",host:{}}]}],e.ctorParameters=function(){return[{type:t.TemplateRef}]},e.propDecorators={type:[{type:t.Input}],name:[{type:t.Input,args:["pTemplate"]}]},e}(),a=function(){function e(e){this.viewContainer=e}return e.prototype.ngOnInit=function(){this.view=this.viewContainer.createEmbeddedView(this.templateRef,{$implicit:this.item,index:this.index})},e.prototype.ngOnDestroy=function(){this.view.destroy()},e.decorators=[{type:t.Directive,args:[{selector:"[pTemplateWrapper]"}]}],e.ctorParameters=function(){return[{type:t.ViewContainerRef}]},e.propDecorators={item:[{type:t.Input}],index:[{type:t.Input}],templateRef:[{type:t.Input,args:["pTemplateWrapper"]}]},e}(),s=function(){function e(){this.sortFunction=new t.EventEmitter}return e.prototype.ngAfterContentInit=function(){var e=this;this.templates.forEach(function(t){switch(t.getType()){case"header":e.headerTemplate=t.template;break;case"body":e.bodyTemplate=t.template;break;case"footer":e.footerTemplate=t.template;break;case"filter":e.filterTemplate=t.template;break;case"editor":e.editorTemplate=t.template;break;default:e.bodyTemplate=t.template}})},e.decorators=[{type:t.Component,args:[{selector:"ay-column",template:""}]}],e.ctorParameters=function(){return[]},e.propDecorators={field:[{type:t.Input}],sortField:[{type:t.Input}],header:[{type:t.Input}],footer:[{type:t.Input}],sortable:[{type:t.Input}],editable:[{type:t.Input}],filter:[{type:t.Input}],filterMatchMode:[{type:t.Input}],rowspan:[{type:t.Input}],colspan:[{type:t.Input}],style:[{type:t.Input}],styleClass:[{type:t.Input}],hidden:[{type:t.Input}],expander:[{type:t.Input}],selectionMode:[{type:t.Input}],filterPlaceholder:[{type:t.Input}],frozen:[{type:t.Input}],sortFunction:[{type:t.Output}],templates:[{type:t.ContentChildren,args:[r]}],template:[{type:t.ContentChild,args:[t.TemplateRef]}]},e}(),l=function(){function e(){}return e.decorators=[{type:t.Component,args:[{selector:"ay-row",template:""}]}],e.ctorParameters=function(){return[]},e.propDecorators={columns:[{type:t.ContentChildren,args:[s]}]},e}(),p=function(){function e(){}return e.decorators=[{type:t.Component,args:[{selector:"ay-headerColumnGroup",template:""}]}],e.ctorParameters=function(){return[]},e.propDecorators={rows:[{type:t.ContentChildren,args:[l]}]},e}(),c=function(){function e(){}return e.decorators=[{type:t.Component,args:[{selector:"ay-footerColumnGroup",template:""}]}],e.ctorParameters=function(){return[]},e.propDecorators={rows:[{type:t.ContentChildren,args:[l]}]},e}(),u=function(){function e(e){this.viewContainer=e}return e.prototype.ngOnInit=function(){this.view=this.viewContainer.createEmbeddedView(this.column.bodyTemplate,{$implicit:this.column,rowData:this.rowData,rowIndex:this.rowIndex})},e.prototype.ngOnDestroy=function(){this.view.destroy()},e.decorators=[{type:t.Component,args:[{selector:"ay-columnBodyTemplateLoader",template:""}]}],e.ctorParameters=function(){return[{type:t.ViewContainerRef}]},e.propDecorators={column:[{type:t.Input}],rowData:[{type:t.Input}],rowIndex:[{type:t.Input}]},e}(),d=function(){function e(e){this.viewContainer=e}return e.prototype.ngOnInit=function(){this.view=this.viewContainer.createEmbeddedView(this.column.headerTemplate,{$implicit:this.column})},e.prototype.ngOnDestroy=function(){this.view.destroy()},e.decorators=[{type:t.Component,args:[{selector:"ay-columnHeaderTemplateLoader",template:""}]}],e.ctorParameters=function(){return[{type:t.ViewContainerRef}]},e.propDecorators={column:[{type:t.Input}]},e}(),h=function(){function e(e){this.viewContainer=e}return e.prototype.ngOnInit=function(){this.view=this.viewContainer.createEmbeddedView(this.column.footerTemplate,{$implicit:this.column})},e.prototype.ngOnDestroy=function(){this.view.destroy()},e.decorators=[{type:t.Component,args:[{selector:"ay-columnFooterTemplateLoader",template:""}]}],e.ctorParameters=function(){return[{type:t.ViewContainerRef}]},e.propDecorators={column:[{type:t.Input}]},e}(),g=function(){function e(e){this.viewContainer=e}return e.prototype.ngOnInit=function(){this.view=this.viewContainer.createEmbeddedView(this.column.filterTemplate,{$implicit:this.column})},e.prototype.ngOnDestroy=function(){this.view.destroy()},e.decorators=[{type:t.Component,args:[{selector:"ay-columnFilterTemplateLoader",template:""}]}],e.ctorParameters=function(){return[{type:t.ViewContainerRef}]},e.propDecorators={column:[{type:t.Input}]},e}(),f=function(){function e(e){this.viewContainer=e}return e.prototype.ngOnInit=function(){this.view=this.viewContainer.createEmbeddedView(this.column.editorTemplate,{$implicit:this.column,rowData:this.rowData})},e.prototype.ngOnDestroy=function(){this.view.destroy()},e.decorators=[{type:t.Component,args:[{selector:"ay-columnEditorTemplateLoader",template:""}]}],e.ctorParameters=function(){return[{type:t.ViewContainerRef}]},e.propDecorators={column:[{type:t.Input}],rowData:[{type:t.Input}]},e}(),y=function(){function e(e){this.viewContainer=e}return e.prototype.ngOnInit=function(){this.template&&(this.view=this.viewContainer.createEmbeddedView(this.template,{$implicit:this.data}))},e.prototype.ngOnDestroy=function(){this.view&&this.view.destroy()},e.decorators=[{type:t.Component,args:[{selector:"ay-templateLoader",template:""}]}],e.ctorParameters=function(){return[{type:t.ViewContainerRef}]},e.propDecorators={template:[{type:t.Input}],data:[{type:t.Input}]},e}(),m=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],exports:[o,i,s,a,d,u,h,g,r,y,l,p,c,f],declarations:[o,i,s,a,d,u,h,g,r,y,l,p,c,f]}]}],e.ctorParameters=function(){return[]},e}(),v=function(){function e(e){this.treeTable=e,this.level=0,this.labelExpand="Expand",this.labelCollapse="Collapse"}return e.prototype.ngOnInit=function(){this.node.parent=this.parentNode},e.prototype.ngOnChanges=function(e){e.node&&this.node},e.prototype.toggle=function(e){this.node.expanded?this.treeTable.onNodeCollapse.emit({originalEvent:e,node:this.node}):this.treeTable.onNodeExpand.emit({originalEvent:e,node:this.node}),this.node.expanded=!this.node.expanded,e.preventDefault()},e.prototype.isLeaf=function(){return 0!=this.node.leaf&&!(this.node.children&&this.node.children.length)},e.prototype.isSelected=function(){return this.treeTable.isSelected(this.node)},e.prototype.onRowClick=function(e){this.treeTable.onRowClick(e,this.node)},e.prototype.onRowRightClick=function(e){this.treeTable.onRowRightClick(e,this.node)},e.prototype.onRowTouchEnd=function(){this.treeTable.onRowTouchEnd()},e.prototype.resolveFieldData=function(e,t){if(e&&t){if(-1==t.indexOf("."))return e[t];for(var n=t.split("."),o=e,i=0,r=n.length;i<r;++i)o=o[n[i]];return o}return null},e.decorators=[{type:t.Component,args:[{selector:"[pTreeRow]",template:'\n <div *ngIf="treeTable.isFiltered(node)" class="ui-treetable-row" [class]="treeTable.getRowStyleClass(node)"\n [ngClass]="{\'ui-state-highlight\':isSelected() ,\'ui-treetable-row-selectable\':treeTable.selectionMode && node.selectable !== false}">\n <td *ngFor="let col of treeTable.columns; let i=index" [ngStyle]="col.style" [class]="col.styleClass" \n [style.display]="col.hidden ? \'none\' : \'table-cell\'"\n (click)="onRowClick($event)" (touchend)="onRowTouchEnd()" (contextmenu)="onRowRightClick($event)">\n <a href="#" *ngIf="i==0" class="ui-treetable-toggler fa fa-fw ui-c" [ngClass]="{\'fa-caret-down\':node.expanded,\'fa-caret-right\':!node.expanded}"\n [ngStyle]="{\'margin-left\':level*16 + \'px\',\'visibility\': isLeaf() ? \'hidden\' : \'visible\'}"\n (click)="toggle($event)"\n [title]="node.expanded ? labelCollapse : labelExpand">\n </a>\n <div class="ui-chkbox ui-treetable-checkbox" *ngIf="treeTable.selectionMode == \'checkbox\' && i==0">\n <div class="ui-chkbox-box ui-widget ui-corner-all ui-state-default">\n <span class="ui-chkbox-icon ui-c fa" \n [ngClass]="{\'fa-check\':isSelected(),\'fa-minus\':node.partialSelected}"></span>\n </div>\n </div>\n <span *ngIf="!col.template">{{resolveFieldData(node.data,col.field)}}</span>\n <ay-columnBodyTemplateLoader [column]="col" [rowData]="node" *ngIf="col.template"></ay-columnBodyTemplateLoader>\n </td>\n </div>\n <div *ngIf="node.children && node.expanded" class="ui-treetable-row" style="display:table-row;white-space: nowrap">\n <td [attr.colspan]="treeTable.shownColumns().length" class="ui-treetable-child-table-container">\n <table>\n <tbody pTreeRow *ngFor="let childNode of node.children" [node]="childNode" [level]="level+1" [labelExpand]="labelExpand" [labelCollapse]="labelCollapse" [parentNode]="node"></tbody>\n </table>\n </td>\n </div>\n '}]}],e.ctorParameters=function(){return[{type:b,decorators:[{type:t.Inject,args:[t.forwardRef(function(){return b})]}]}]},e.propDecorators={node:[{type:t.Input}],parentNode:[{type:t.Input}],level:[{type:t.Input}],labelExpand:[{type:t.Input}],labelCollapse:[{type:t.Input}]},e}(),w=function(){function e(){this.pageLinkSize=5,this.onPageChange=new t.EventEmitter,this._totalRecords=0,this._first=0,this._rows=0}return Object.defineProperty(e.prototype,"totalRecords",{get:function(){return this._totalRecords},set:function(e){this._totalRecords=e,this.updatePageLinks()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"first",{get:function(){return this._first},set:function(e){this._first=e,this.updatePageLinks()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rows",{get:function(){return this._rows},set:function(e){this._rows=e,this.updatePageLinks()},enumerable:!0,configurable:!0}),e.prototype.isFirstPage=function(){return 0===this.getPage()},e.prototype.isLastPage=function(){return this.getPage()===this.getPageCount()-1},e.prototype.getPageCount=function(){return Math.ceil(this.totalRecords/this.rows)||1},e.prototype.calculatePageLinkBoundaries=function(){var e=this.getPageCount(),t=Math.min(this.pageLinkSize,e),n=Math.max(0,Math.ceil(this.getPage()-t/2)),o=Math.min(e-1,n+t-1),i=this.pageLinkSize-(o-n+1);return n=Math.max(0,n-i),[n,o]},e.prototype.updatePageLinks=function(){this.pageLinks=[];for(var e=this.calculatePageLinkBoundaries(),t=e[0],n=e[1],o=t;o<=n;o++)this.pageLinks.push(o+1)},e.prototype.changePage=function(e,t){var n=this.getPageCount();if(e>=0&&e<n){this.first=this.rows*e;var o={page:e,first:this.first,rows:this.rows,pageCount:n};this.updatePageLinks(),this.onPageChange.emit(o)}t&&t.preventDefault()},e.prototype.getPage=function(){return Math.floor(this.first/this.rows)},e.prototype.changePageToFirst=function(e){this.changePage(0,e)},e.prototype.changePageToPrev=function(e){this.changePage(this.getPage()-1,e)},e.prototype.changePageToNext=function(e){this.changePage(this.getPage()+1,e)},e.prototype.changePageToLast=function(e){this.changePage(this.getPageCount()-1,e)},e.prototype.onRppChange=function(e){this.rows=this.rowsPerPageOptions[e.target.selectedIndex],this.changePageToFirst(e)},e.decorators=[{type:t.Component,args:[{selector:"ay-paginator",template:'\n <div [class]="styleClass" [ngStyle]="style" [ngClass]="\'ui-paginator ui-widget ui-widget-header ui-unselectable-text\'">\n <a href="#" class="ui-paginator-first ui-paginator-element ui-state-default ui-corner-all"\n (click)="changePageToFirst($event)" [ngClass]="{\'ui-state-disabled\':isFirstPage()}" [tabindex]="isFirstPage() ? -1 : null">\n <span class="fa fa-step-backward"></span>\n </a>\n <a href="#" class="ui-paginator-prev ui-paginator-element ui-state-default ui-corner-all"\n (click)="changePageToPrev($event)" [ngClass]="{\'ui-state-disabled\':isFirstPage()}" [tabindex]="isFirstPage() ? -1 : null">\n <span class="fa fa-backward"></span>\n </a>\n <span class="ui-paginator-pages">\n <a href="#" *ngFor="let pageLink of pageLinks" class="ui-paginator-page ui-paginator-element ui-state-default ui-corner-all"\n (click)="changePage(pageLink - 1, $event)" [ngClass]="{\'ui-state-active\': (pageLink-1 == getPage())}">{{pageLink}}</a>\n </span>\n <a href="#" class="ui-paginator-next ui-paginator-element ui-state-default ui-corner-all"\n (click)="changePageToNext($event)" [ngClass]="{\'ui-state-disabled\':isLastPage()}" [tabindex]="isLastPage() ? -1 : null">\n <span class="fa fa-forward"></span>\n </a>\n <a href="#" class="ui-paginator-last ui-paginator-element ui-state-default ui-corner-all"\n (click)="changePageToLast($event)" [ngClass]="{\'ui-state-disabled\':isLastPage()}" [tabindex]="isLastPage() ? -1 : null">\n <span class="fa fa-step-forward"></span>\n </a>\n <select class="ui-paginator-rpp-options ui-widget ui-state-default" *ngIf="rowsPerPageOptions" (change)="onRppChange($event)">\n <option *ngFor="let opt of rowsPerPageOptions" [value]="opt" [selected]="rows == opt">{{opt}}</option>\n </select>\n </div>\n '}]}],e.ctorParameters=function(){return[]},e.propDecorators={pageLinkSize:[{type:t.Input}],onPageChange:[{type:t.Output}],style:[{type:t.Input}],styleClass:[{type:t.Input}],rowsPerPageOptions:[{type:t.Input}],totalRecords:[{type:t.Input}],first:[{type:t.Input}],rows:[{type:t.Input}]},e}(),C=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],exports:[w],declarations:[w]}]}],e.ctorParameters=function(){return[]},e}(),b=function(){function e(e){this.renderer=e,this.pageLinks=5,this.first=0,this.labelExpand="Expand",this.labelCollapse="Collapse",this.metaKeySelection=!0,this.filterDelay=300,this.selectionChange=new t.EventEmitter,this.onNodeSelect=new t.EventEmitter,this.onNodeUnselect=new t.EventEmitter,this.onNodeExpand=new t.EventEmitter,this.onNodeCollapse=new t.EventEmitter,this.onContextMenuSelect=new t.EventEmitter,this.onLazyLoad=new t.EventEmitter,this.filterConstraints={startsWith:function(e,t){if(void 0===t||null===t||""===t.trim())return!0;if(void 0===e||null===e)return!1;var n=t.toString().toLowerCase();return e.toString().toLowerCase().slice(0,n.length)===n},contains:function(e,t){return void 0===t||null===t||"string"==typeof t&&""===t.trim()||void 0!==e&&null!==e&&-1!==e.toString().toLowerCase().indexOf(t.toLowerCase())},endsWith:function(e,t){if(void 0===t||null===t||""===t.trim())return!0;if(void 0===e||null===e)return!1;var n=t.toString().toLowerCase();return-1!==e.toString().toLowerCase().indexOf(n,e.toString().length-n.length)},equals:function(e,t){return void 0===t||null===t||"string"==typeof t&&""===t.trim()||void 0!==e&&null!==e&&e.toString().toLowerCase()==t.toString().toLowerCase()},in:function(e,t){if(void 0===t||null===t||0===t.length)return!0;if(void 0===e||null===e)return!1;for(var n=0;n<t.length;n++)if(t[n]===e)return!0;return!1}}}return e.prototype.onRowClick=function(e,t){var n=e.target;if(!n.className||0!==n.className.indexOf("ui-treetable-toggler")){if(this.selectionMode){if(!1===t.selectable)return;var o=!this.rowTouched&&this.metaKeySelection,i=this.findIndexInSelection(t),r=i>=0;if(this.isCheckboxSelectionMode())r?(this.propagateSelectionDown(t,!1),t.parent&&this.propagateSelectionUp(t.parent,!1),this.selectionChange.emit(this.selection),this.onNodeUnselect.emit({originalEvent:e,node:t})):(this.propagateSelectionDown(t,!0),t.parent&&this.propagateSelectionUp(t.parent,!0),this.selectionChange.emit(this.selection),this.onNodeSelect.emit({originalEvent:e,node:t}));else if(o){var a=e.metaKey||e.ctrlKey;r&&a?(this.isSingleSelectionMode()?this.selectionChange.emit(null):(this.selection.splice(i,1),this.selectionChange.emit(this.selection)),this.onNodeUnselect.emit({originalEvent:e,node:t})):(this.isSingleSelectionMode()?this.selectionChange.emit(t):this.isMultipleSelectionMode()&&(this.selection=a?this.selection||[]:[],this.selection.push(t),this.selectionChange.emit(this.selection)),this.onNodeSelect.emit({originalEvent:e,node:t}))}else this.isSingleSelectionMode()?r?(this.selection=null,this.onNodeUnselect.emit({originalEvent:e,node:t})):(this.selection=t,this.onNodeSelect.emit({originalEvent:e,node:t})):r?(this.selection.splice(i,1),this.onNodeUnselect.emit({originalEvent:e,node:t})):(this.selection=this.selection||[],this.selection.push(t),this.onNodeSelect.emit({originalEvent:e,node:t})),this.selectionChange.emit(this.selection)}this.rowTouched=!1}},e.prototype.onRowTouchEnd=function(){this.rowTouched=!0},e.prototype.onRowRightClick=function(e,t){if(this.contextMenu){this.findIndexInSelection(t)>=0||(this.isSingleSelectionMode()?this.selection=t:this.isMultipleSelectionMode()&&(this.selection=[],this.selection.push(t),this.selectionChange.emit(this.selection)),this.selectionChange.emit(this.selection)),this.contextMenu.show(e),this.onContextMenuSelect.emit({originalEvent:e,node:t})}},e.prototype.findIndexInSelection=function(e){var t=-1;if(this.selectionMode&&this.selection)if(this.isSingleSelectionMode())t=this.selection==e?0:-1;else for(var n=0;n<this.selection.length;n++)if(this.selection[n]==e){t=n;break}return t},e.prototype.propagateSelectionUp=function(e,t){if(e.children&&e.children.length){for(var n=0,o=!1,i=0,r=e.children;i<r.length;i++){var a=r[i];this.isSelected(a)?n++:a.partialSelected&&(o=!0)}if(t&&n==e.children.length)this.selection=this.selection||[],this.selection.push(e),e.partialSelected=!1;else{if(!t){var s=this.findIndexInSelection(e);s>=0&&this.selection.splice(s,1)}o||n>0&&n!=e.children.length?e.partialSelected=!0:e.partialSelected=!1}}var l=e.parent;l&&this.propagateSelectionUp(l,t)},e.prototype.propagateSelectionDown=function(e,t){var n=this.findIndexInSelection(e);if(t&&-1==n?(this.selection=this.selection||[],this.selection.push(e)):!t&&n>-1&&this.selection.splice(n,1),e.partialSelected=!1,e.children&&e.children.length)for(var o=0,i=e.children;o<i.length;o++){var r=i[o];this.propagateSelectionDown(r,t)}},e.prototype.isSelected=function(e){return-1!=this.findIndexInSelection(e)},e.prototype.isSingleSelectionMode=function(){return this.selectionMode&&"single"==this.selectionMode},e.prototype.isMultipleSelectionMode=function(){return this.selectionMode&&"multiple"==this.selectionMode},e.prototype.isCheckboxSelectionMode=function(){return this.selectionMode&&"checkbox"==this.selectionMode},e.prototype.getRowStyleClass=function(e){var t="";if(this.rowStyleClass){var n=this.rowStyleClass.call(this,e);n&&(t+=" "+n)}return t},e.prototype.hasFooter=function(){if(this.columns)for(var e=this.columns.toArray(),t=0;t<e.length;t++)if(e[t].footer)return!0;return!1},e.prototype.ngOnInit=function(){this.immutable&&this.handleDataChange()},e.prototype.ngAfterViewInit=function(){var e=this;this.globalFilter&&this.value&&(this.globalFilterFunction=this.renderer.listen(this.globalFilter,"keyup",function(){e.filterTimeout=setTimeout(function(){e.filter(),e.filterTimeout=null},e.filterDelay)}))},e.prototype.ngOnChanges=function(e){e.value&&this.value&&!this.immutable&&this.handleDataChange()},e.prototype.shownColumns=function(){return this.columns.filter(function(e){return!e.hidden})},e.prototype.handleDataChange=function(){this.paginator&&this.updatePaginator(),this.updateDataToRender(this.filteredValue||this.value)},e.prototype.updatePaginator=function(){if(this.totalRecords=this.lazy?this.totalRecords:this.value?this.value.length:0,this.totalRecords&&this.first>=this.totalRecords){var e=Math.ceil(this.totalRecords/this.rows);this.first=Math.max((e-1)*this.rows,0)}},e.prototype.paginate=function(e){this.first=e.first,this.rows=e.rows,this.lazy?this.stopFilterPropagation=!0:this.updateDataToRender(this.filteredValue||this.value)},e.prototype.updateDataToRender=function(e){if((this.paginator||this.virtualScroll)&&e){this.dataToRender=[];for(var t=this.lazy?0:this.first,n=this.virtualScroll?this.first+2*this.rows:t+this.rows,o=t;o<n&&!(o>=e.length);o++)this.dataToRender.push(e[o])}else this.dataToRender=e;this.loading=!1},e.prototype.filterFields=function(e){var t=this,n=!1;return this.columns.toArray().map(function(o){!n&&e[o.field]&&(n=e[o.field].toString().toLowerCase().includes(t.globalFilter.value.toString().toLowerCase()))}),n},e.prototype.filterChildren=function(e,t){var n=this,o=!1;return e&&(e.map(function(e){var t=n.filterFields(e.data),i=n.filterChildren(e.children,e);o=t||i||o}),t.expanded=o),o},e.prototype.isFiltered=function(e){return!this.globalFilter||(this.filterFields(e.data)||this.filterChildren(e.children,e))},e.prototype.filter=function(){var e=this;this.first=0,this.filteredValue=this.value.filter(function(t){return e.filterFields(t.data)||e.filterChildren(t.children,t)}),this.paginator&&(this.totalRecords=this.filteredValue?this.filteredValue.length:this.value?this.value.length:0),this.updateDataToRender(this.filteredValue||this.value)},e.prototype.resolveFieldData=function(e,t){if(e&&t){if(-1==t.indexOf("."))return e[t];for(var n=t.split("."),o=e,i=0,r=n.length;i<r;++i){if(null==o)return null;o=o[n[i]]}return o}return null},e.prototype.ngOnDestroy=function(){this.globalFilterFunction&&this.globalFilterFunction()},e.decorators=[{type:t.Component,args:[{selector:"ay-treeTable",template:'\n <div [ngClass]="\'ui-treetable ui-widget\'" [ngStyle]="style" [class]="styleClass">\n <div class="ui-treetable-header ui-widget-header" *ngIf="header">\n <ng-content select="ay-header"></ng-content>\n </div>\n <div class="ui-treetable-tablewrapper">\n <table class="ui-widget-content" [class]="tableStyleClass" [ngStyle]="tableStyle">\n <thead>\n <tr class="ui-state-default">\n <th #headerCell *ngFor="let col of columns" [ngStyle]="col.style" [class]="col.styleClass"\n [ngClass]="\'ui-state-default ui-unselectable-text\'"\n [style.display]="col.hidden ? \'none\' : \'table-cell\'">\n <span class="ui-column-title" *ngIf="!col.headerTemplate">{{col.header}}</span>\n <span class="ui-column-title" *ngIf="col.headerTemplate">\n <ay-columnHeaderTemplateLoader [column]="col"></ay-columnHeaderTemplateLoader>\n </span>\n </th>\n </tr>\n </thead>\n <tfoot *ngIf="hasFooter()">\n <tr>\n <td *ngFor="let col of columns" [ngStyle]="col.style" [class]="col.styleClass"\n [ngClass]="{\'ui-state-default\':true}">\n <span class="ui-column-footer" *ngIf="!col.footerTemplate">{{col.footer}}</span>\n <span class="ui-column-footer" *ngIf="col.footerTemplate">\n <ay-columnFooterTemplateLoader [column]="col"></ay-columnFooterTemplateLoader>\n </span>\n </td>\n </tr>\n </tfoot>\n <tbody pTreeRow *ngFor="let node of dataToRender;let odd = odd;let even=even"\n [node]="node" [level]="0"\n [labelExpand]="labelExpand" [labelCollapse]="labelCollapse"\n class="ui-widget-content"\n [ngClass]="{\'ui-treetable-even\':even,\'ui-treetable-odd\':odd}"\n ></tbody>\n </table>\n </div>\n <ay-paginator [rows]="rows" [first]="first" [totalRecords]="totalRecords" [pageLinkSize]="pageLinks"\n styleClass="ui-paginator-bottom"\n (onPageChange)="paginate($event)" [rowsPerPageOptions]="rowsPerPageOptions"\n *ngIf="paginator"></ay-paginator>\n <div class="ui-treetable-footer ui-widget-header" *ngIf="footer">\n <ng-content select="ay-footer"></ng-content>\n </div>\n </div>\n '}]}],e.ctorParameters=function(){return[{type:t.Renderer2}]},e.propDecorators={paginator:[{type:t.Input}],rows:[{type:t.Input}],totalRecords:[{type:t.Input}],pageLinks:[{type:t.Input}],rowsPerPageOptions:[{type:t.Input}],first:[{type:t.Input}],lazy:[{type:t.Input}],virtualScroll:[{type:t.Input}],value:[{type:t.Input}],selectionMode:[{type:t.Input}],selection:[{type:t.Input}],style:[{type:t.Input}],styleClass:[{type:t.Input}],labelExpand:[{type:t.Input}],labelCollapse:[{type:t.Input}],metaKeySelection:[{type:t.Input}],contextMenu:[{type:t.Input}],globalFilter:[{type:t.Input}],filterDelay:[{type:t.Input}],immutable:[{type:t.Input}],rowStyleClass:[{type:t.Input}],tableStyle:[{type:t.Input}],tableStyleClass:[{type:t.Input}],selectionChange:[{type:t.Output}],onNodeSelect:[{type:t.Output}],onNodeUnselect:[{type:t.Output}],onNodeExpand:[{type:t.Output}],onNodeCollapse:[{type:t.Output}],onContextMenuSelect:[{type:t.Output}],onLazyLoad:[{type:t.Output}],header:[{type:t.ContentChild,args:[o]}],footer:[{type:t.ContentChild,args:[i]}],columns:[{type:t.ContentChildren,args:[s]}]},e}(),I=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,m,C],exports:[b,m,C],declarations:[b,v]}]}],e.ctorParameters=function(){return[]},e}();e.TreeTableModule=I,e.ɵq=w,e.ɵr=C,e.ɵf=s,e.ɵj=u,e.ɵn=f,e.ɵm=g,e.ɵl=h,e.ɵk=d,e.ɵc=i,e.ɵi=c,e.ɵb=o,e.ɵh=p,e.ɵd=r,e.ɵg=l,e.ɵo=y,e.ɵe=a,e.ɵp=m,e.ɵs=v,e.ɵa=b,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=ng-treetable.umd.min.js.map