primeng
Version:
[](https://opensource.org/licenses/MIT) [](https://badge.fury.io/js/primeng) [{"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("primeng/api"),require("primeng/paginator"),require("primeng/dom"),require("primeng/utils"),require("rxjs")):"function"==typeof define&&define.amd?define("primeng/table",["exports","@angular/core","@angular/common","primeng/api","primeng/paginator","primeng/dom","primeng/utils","rxjs"],t):t(((e=e||self).primeng=e.primeng||{},e.primeng.table={}),e.ng.core,e.ng.common,e.primeng.api,e.primeng.paginator,e.primeng.dom,e.primeng.utils,e.rxjs)}(this,(function(e,t,i,o,n,l,r,s){"use strict";var a=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},d=this&&this.__param||function(e,t){return function(i,o){t(i,o,e)}},h=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.")},c=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(c(arguments[t]));return e},p=function(){function e(){this.sortSource=new s.Subject,this.selectionSource=new s.Subject,this.contextMenuSource=new s.Subject,this.valueSource=new s.Subject,this.totalRecordsSource=new s.Subject,this.columnsSource=new s.Subject,this.sortSource$=this.sortSource.asObservable(),this.selectionSource$=this.selectionSource.asObservable(),this.contextMenuSource$=this.contextMenuSource.asObservable(),this.valueSource$=this.valueSource.asObservable(),this.totalRecordsSource$=this.totalRecordsSource.asObservable(),this.columnsSource$=this.columnsSource.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.onValueChange=function(e){this.valueSource.next(e)},e.prototype.onTotalRecordsChange=function(e){this.totalRecordsSource.next(e)},e.prototype.onColumnsChange=function(e){this.columnsSource.next(e)},e=a([t.Injectable()],e)}(),g=function(){function e(e,i,o,n){this.el=e,this.zone=i,this.tableService=o,this.cd=n,this.pageLinks=5,this.alwaysShowPaginator=!0,this.paginatorPosition="bottom",this.paginatorDropdownScrollHeight="200px",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.rowTrackBy=function(e,t){return t},this.lazy=!1,this.lazyLoadOnInit=!0,this.compareSelectionBy="deepEquals",this.csvSeparator=",",this.exportFilename="download",this.filters={},this.filterDelay=300,this.expandedRowKeys={},this.editingRowKeys={},this.rowExpandMode="multiple",this.virtualScrollDelay=150,this.virtualRowHeight=28,this.columnResizeMode="fit",this.loadingIcon="pi pi-spinner",this.showLoader=!0,this.stateStorage="session",this.editMode="cell",this.onRowSelect=new t.EventEmitter,this.onRowUnselect=new t.EventEmitter,this.onPage=new t.EventEmitter,this.onSort=new t.EventEmitter,this.onFilter=new t.EventEmitter,this.onLazyLoad=new t.EventEmitter,this.onRowExpand=new t.EventEmitter,this.onRowCollapse=new t.EventEmitter,this.onContextMenuSelect=new t.EventEmitter,this.onColResize=new t.EventEmitter,this.onColReorder=new t.EventEmitter,this.onRowReorder=new t.EventEmitter,this.onEditInit=new t.EventEmitter,this.onEditComplete=new t.EventEmitter,this.onEditCancel=new t.EventEmitter,this.onHeaderCheckboxToggle=new t.EventEmitter,this.sortFunction=new t.EventEmitter,this.firstChange=new t.EventEmitter,this.rowsChange=new t.EventEmitter,this.onStateSave=new t.EventEmitter,this.onStateRestore=new t.EventEmitter,this._value=[],this._totalRecords=0,this._first=0,this.selectionKeys={},this._sortOrder=1}return e.prototype.ngOnInit=function(){this.lazy&&this.lazyLoadOnInit&&(this.onLazyLoad.emit(this.createLazyLoadMetadata()),this.restoringFilter&&(this.restoringFilter=!1)),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"rowexpansion":e.expandedRowTemplate=t.template;break;case"frozenrows":e.frozenRowsTemplate=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;break;case"emptymessage":e.emptyMessageTemplate=t.template;break;case"paginatorleft":e.paginatorLeftTemplate=t.template;break;case"paginatorright":e.paginatorRightTemplate=t.template}}))},e.prototype.ngAfterViewInit=function(){this.isStateful()&&this.resizableColumns&&this.restoreColumnWidths()},e.prototype.ngOnChanges=function(e){e.value&&(this.isStateful()&&!this.stateRestored&&this.restoreState(),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.tableService.onValueChange(e.value.currentValue)),e.columns&&(this._columns=e.columns.currentValue,this.tableService.onColumnsChange(e.columns.currentValue),this._columns&&this.isStateful()&&this.reorderableColumns&&!this.columnOrderStateRestored&&this.restoreColumnOrder()),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}),Object.defineProperty(e.prototype,"columns",{get:function(){return this._columns},set:function(e){this._columns=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"first",{get:function(){return this._first},set:function(e){this._first=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rows",{get:function(){return this._rows},set:function(e){this._rows=e},enumerable:!0,configurable:!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=h(this._selection),o=i.next();!o.done;o=i.next()){var n=o.value;this.selectionKeys[String(r.ObjectUtils.resolveFieldData(n,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(r.ObjectUtils.resolveFieldData(this._selection,this.dataKey))]=1},e.prototype.onPageChange=function(e){this.first=e.first,this.rows=e.rows,this.lazy&&this.onLazyLoad.emit(this.createLazyLoadMetadata()),this.onPage.emit({first:this.first,rows:this.rows}),this.firstChange.emit(this.first),this.rowsChange.emit(this.rows),this.tableService.onValueChange(this.value),this.isStateful()&&this.saveState(),this.anchorRowIndex=null},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(),this.resetPageOnSort&&(this._first=0,this.firstChange.emit(this._first))),"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}],this.resetPageOnSort&&(this._first=0,this.firstChange.emit(this._first))):(i&&this.multiSortMeta||(this._multiSortMeta=[],this.resetPageOnSort&&(this._first=0,this.firstChange.emit(this._first))),this._multiSortMeta.push({field:e.field,order:this.defaultSortOrder})),this.sortMultiple()}this.isStateful()&&this.saveState(),this.anchorRowIndex=null},e.prototype.sortSingle=function(){var e=this;if(this.sortField&&this.sortOrder){this.restoringSort&&(this.restoringSort=!1),this.lazy?this.onLazyLoad.emit(this.createLazyLoadMetadata()):this.value&&(this.customSort?this.sortFunction.emit({data:this.value,mode:this.sortMode,field:this.sortField,order:this.sortOrder}):this.value.sort((function(t,i){var o=r.ObjectUtils.resolveFieldData(t,e.sortField),n=r.ObjectUtils.resolveFieldData(i,e.sortField),l=null;return l=null==o&&null!=n?-1:null!=o&&null==n?1:null==o&&null==n?0:"string"==typeof o&&"string"==typeof n?o.localeCompare(n):o<n?-1:o>n?1:0,e.sortOrder*l})),this.hasFilter()&&this._filter());var t={field:this.sortField,order:this.sortOrder};this.onSort.emit(t),this.tableService.onSort(t)}},e.prototype.sortMultiple=function(){var e=this;this.multiSortMeta&&(this.lazy?this.onLazyLoad.emit(this.createLazyLoadMetadata()):this.value&&(this.customSort?this.sortFunction.emit({data:this.value,mode:this.sortMode,multiSortMeta:this.multiSortMeta}):this.value.sort((function(t,i){return e.multisortField(t,i,e.multiSortMeta,0)})),this.hasFilter()&&this._filter()),this.onSort.emit({multisortmeta:this.multiSortMeta}),this.tableService.onSort(this.multiSortMeta))},e.prototype.multisortField=function(e,t,i,o){var n=r.ObjectUtils.resolveFieldData(e,i[o].field),l=r.ObjectUtils.resolveFieldData(t,i[o].field),s=null;if(null==n&&null!=l)s=-1;else if(null!=n&&null==l)s=1;else if(null==n&&null==l)s=0;else if("string"==typeof n||n instanceof String){if(n.localeCompare&&n!=l)return i[o].order*n.localeCompare(l)}else s=n<l?-1:1;return n==l?i.length-1>o?this.multisortField(e,t,i,o+1):0:i[o].order*s},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.handleRowClick=function(e){var t=e.originalEvent.target,i=t.nodeName,o=t.parentElement&&t.parentElement.nodeName;if("INPUT"!=i&&"BUTTON"!=i&&"A"!=i&&"INPUT"!=o&&"BUTTON"!=o&&"A"!=o&&!l.DomHandler.hasClass(e.originalEvent.target,"ui-clickable")){if(this.selectionMode){if(this.preventSelectionSetterPropagation=!0,this.isMultipleSelectionMode()&&e.originalEvent.shiftKey&&null!=this.anchorRowIndex)l.DomHandler.clearSelection(),null!=this.rangeRowIndex&&this.clearSelectionRange(e.originalEvent),this.rangeRowIndex=e.rowIndex,this.selectRange(e.originalEvent,e.rowIndex);else{var n=e.rowData,s=this.isSelected(n),a=!this.rowTouched&&this.metaKeySelection,d=this.dataKey?String(r.ObjectUtils.resolveFieldData(n,this.dataKey)):null;if(this.anchorRowIndex=e.rowIndex,this.rangeRowIndex=e.rowIndex,a){var h=e.originalEvent.metaKey||e.originalEvent.ctrlKey;if(s&&h){if(this.isSingleSelectionMode())this._selection=null,this.selectionKeys={},this.selectionChange.emit(null);else{var c=this.findIndexInSelection(n);this._selection=this.selection.filter((function(e,t){return t!=c})),this.selectionChange.emit(this.selection),d&&delete this.selectionKeys[d]}this.onRowUnselect.emit({originalEvent:e.originalEvent,data:n,type:"row"})}else this.isSingleSelectionMode()?(this._selection=n,this.selectionChange.emit(n),d&&(this.selectionKeys={},this.selectionKeys[d]=1)):this.isMultipleSelectionMode()&&(h?this._selection=this.selection||[]:(this._selection=[],this.selectionKeys={}),this._selection=u(this.selection,[n]),this.selectionChange.emit(this.selection),d&&(this.selectionKeys[d]=1)),this.onRowSelect.emit({originalEvent:e.originalEvent,data:n,type:"row",index:e.rowIndex})}else if("single"===this.selectionMode)s?(this._selection=null,this.selectionKeys={},this.selectionChange.emit(this.selection),this.onRowUnselect.emit({originalEvent:e.originalEvent,data:n,type:"row"})):(this._selection=n,this.selectionChange.emit(this.selection),this.onRowSelect.emit({originalEvent:e.originalEvent,data:n,type:"row",index:e.rowIndex}),d&&(this.selectionKeys={},this.selectionKeys[d]=1));else if("multiple"===this.selectionMode)if(s){var p=this.findIndexInSelection(n);this._selection=this.selection.filter((function(e,t){return t!=p})),this.selectionChange.emit(this.selection),this.onRowUnselect.emit({originalEvent:e.originalEvent,data:n,type:"row"}),d&&delete this.selectionKeys[d]}else this._selection=this.selection?u(this.selection,[n]):[n],this.selectionChange.emit(this.selection),this.onRowSelect.emit({originalEvent:e.originalEvent,data:n,type:"row",index:e.rowIndex}),d&&(this.selectionKeys[d]=1)}this.tableService.onSelectionChange(),this.isStateful()&&this.saveState()}this.rowTouched=!1}},e.prototype.handleRowTouchEnd=function(e){this.rowTouched=!0},e.prototype.handleRowRightClick=function(e){if(this.contextMenu){var t=e.rowData;if("separate"===this.contextMenuSelectionMode)this.contextMenuSelection=t,this.contextMenuSelectionChange.emit(t),this.onContextMenuSelect.emit({originalEvent:e.originalEvent,data:t,index:e.rowIndex}),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(r.ObjectUtils.resolveFieldData(t,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,data:t,index:e.rowIndex})}}},e.prototype.selectRange=function(e,t){var i,o;this.anchorRowIndex>t?(i=t,o=this.anchorRowIndex):this.anchorRowIndex<t?(i=this.anchorRowIndex,o=t):(i=t,o=t),this.lazy&&this.paginator&&(i-=this.first,o-=this.first);for(var n=i;n<=o;n++){var l=this.filteredValue?this.filteredValue[n]:this.value[n];if(!this.isSelected(l)){this._selection=u(this.selection,[l]);var s=this.dataKey?String(r.ObjectUtils.resolveFieldData(l,this.dataKey)):null;s&&(this.selectionKeys[s]=1),this.onRowSelect.emit({originalEvent:e,data:l,type:"row"})}}this.selectionChange.emit(this.selection)},e.prototype.clearSelectionRange=function(e){var t,i;this.rangeRowIndex>this.anchorRowIndex?(t=this.anchorRowIndex,i=this.rangeRowIndex):this.rangeRowIndex<this.anchorRowIndex?(t=this.rangeRowIndex,i=this.anchorRowIndex):(t=this.rangeRowIndex,i=this.rangeRowIndex);for(var o=function(t){var i=n.value[t],o=n.findIndexInSelection(i);n._selection=n.selection.filter((function(e,t){return t!=o}));var l=n.dataKey?String(r.ObjectUtils.resolveFieldData(i,n.dataKey)):null;l&&delete n.selectionKeys[l],n.onRowUnselect.emit({originalEvent:e,data:i,type:"row"})},n=this,l=t;l<=i;l++)o(l)},e.prototype.isSelected=function(e){return!(!e||!this.selection)&&(this.dataKey?void 0!==this.selectionKeys[r.ObjectUtils.resolveFieldData(e,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.toggleRowWithRadio=function(e,t){this.preventSelectionSetterPropagation=!0,this.selection!=t?(this._selection=t,this.selectionChange.emit(this.selection),this.onRowSelect.emit({originalEvent:e.originalEvent,index:e.rowIndex,data:t,type:"radiobutton"}),this.dataKey&&(this.selectionKeys={},this.selectionKeys[String(r.ObjectUtils.resolveFieldData(t,this.dataKey))]=1)):(this._selection=null,this.selectionChange.emit(this.selection),this.onRowUnselect.emit({originalEvent:e.originalEvent,index:e.rowIndex,data:t,type:"radiobutton"})),this.tableService.onSelectionChange(),this.isStateful()&&this.saveState()},e.prototype.toggleRowWithCheckbox=function(e,t){this.selection=this.selection||[];var i=this.isSelected(t),o=this.dataKey?String(r.ObjectUtils.resolveFieldData(t,this.dataKey)):null;if(this.preventSelectionSetterPropagation=!0,i){var n=this.findIndexInSelection(t);this._selection=this.selection.filter((function(e,t){return t!=n})),this.selectionChange.emit(this.selection),this.onRowUnselect.emit({originalEvent:e.originalEvent,index:e.rowIndex,data:t,type:"checkbox"}),o&&delete this.selectionKeys[o]}else this._selection=this.selection?u(this.selection,[t]):[t],this.selectionChange.emit(this.selection),this.onRowSelect.emit({originalEvent:e.originalEvent,index:e.rowIndex,data:t,type:"checkbox"}),o&&(this.selectionKeys[o]=1);this.tableService.onSelectionChange(),this.isStateful()&&this.saveState()},e.prototype.toggleRowsWithCheckbox=function(e,t){this._selection=t?this.filteredValue?this.filteredValue.slice():this.value.slice():[],this.preventSelectionSetterPropagation=!0,this.updateSelectionKeys(),this.selectionChange.emit(this._selection),this.tableService.onSelectionChange(),this.onHeaderCheckboxToggle.emit({originalEvent:e,checked:t}),this.isStateful()&&this.saveState()},e.prototype.equals=function(e,t){return"equals"===this.compareSelectionBy?e===t:r.ObjectUtils.equals(e,t,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),this.anchorRowIndex=null},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(){if(this.restoringFilter||(this.first=0,this.firstChange.emit(this.first)),this.lazy)this.onLazyLoad.emit(this.createLazyLoadMetadata());else{if(!this.value)return;if(this.hasFilter()){var e=void 0;if(this.filters.global){if(!this.columns&&!this.globalFilterFields)throw new Error("Global filtering requires dynamic columns or globalFilterFields to be defined.");e=this.globalFilterFields||this.columns}this.filteredValue=[];for(var t=0;t<this.value.length;t++){var i=!0,o=!1,n=!1;for(var l in this.filters)if(this.filters.hasOwnProperty(l)&&"global"!==l){n=!0;var s=this.filters[l],a=l,d=s.value,h=s.matchMode||"startsWith",c=r.ObjectUtils.resolveFieldData(this.value[t],a);if((0,r.FilterUtils[h])(c,d)||(i=!1),!i)break}if(this.filters.global&&!o&&e)for(var u=0;u<e.length;u++){var p=e[u].field||e[u];if(o=r.FilterUtils[this.filters.global.matchMode](r.ObjectUtils.resolveFieldData(this.value[t],p),this.filters.global.value))break}(this.filters.global?n?n&&i&&o:o:n&&i)&&this.filteredValue.push(this.value[t])}this.filteredValue.length===this.value.length&&(this.filteredValue=null),this.paginator&&(this.totalRecords=this.filteredValue?this.filteredValue.length:this.value?this.value.length:0)}else this.filteredValue=null,this.paginator&&(this.totalRecords=this.value?this.value.length:0)}this.onFilter.emit({filters:this.filters,filteredValue:this.filteredValue||this.value}),this.tableService.onValueChange(this.value),this.isStateful()&&!this.restoringFilter&&this.saveState(),this.restoringFilter&&(this.restoringFilter=!1),this.cd.markForCheck()},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.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.reset=function(){this._sortField=null,this._sortOrder=this.defaultSortOrder,this._multiSortMeta=null,this.tableService.onSort(null),this.filteredValue=null,this.filters={},this.first=0,this.firstChange.emit(this.first),this.lazy?this.onLazyLoad.emit(this.createLazyLoadMetadata()):this.totalRecords=this._value?this._value.length:0},e.prototype.exportCSV=function(e){var t=this,i=this.filteredValue||this.value,o="";e&&e.selectionOnly&&(i=this.selection||[]);for(var n=0;n<this.columns.length;n++){var l=this.columns[n];!1!==l.exportable&&l.field&&(o+='"'+(l.header||l.field)+'"',n<this.columns.length-1&&(o+=this.csvSeparator))}i.forEach((function(e,i){o+="\n";for(var n=0;n<t.columns.length;n++){var l=t.columns[n];if(!1!==l.exportable&&l.field){var s=r.ObjectUtils.resolveFieldData(e,l.field);s=null!=s?t.exportFunction?t.exportFunction({data:s,field:l.field}):String(s).replace(/"/g,'""'):"",o+='"'+s+'"',n<t.columns.length-1&&(o+=t.csvSeparator)}}}));var s=new Blob([o],{type:"text/csv;charset=utf-8;"});if(window.navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(s,this.exportFilename+".csv");else{var a=document.createElement("a");a.style.display="none",document.body.appendChild(a),void 0!==a.download?(a.setAttribute("href",URL.createObjectURL(s)),a.setAttribute("download",this.exportFilename+".csv"),a.click()):(o="data:text/csv;charset=utf-8,"+o,window.open(encodeURI(o))),document.body.removeChild(a)}},e.prototype.updateEditingCell=function(e,t,i,o){this.editingCell=e,this.editingCellData=t,this.editingCellField=i,this.editingCellRowIndex=o,this.bindDocumentEditListener()},e.prototype.isEditingCellValid=function(){return this.editingCell&&0===l.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()&&(l.DomHandler.removeClass(e.editingCell,"ui-editing-cell"),e.editingCell=null,e.onEditComplete.emit({field:e.editingCellField,data:e.editingCellData,originalEvent:t,index:e.editingCellRowIndex}),e.editingCellField=null,e.editingCellData=null,e.editingCellRowIndex=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.initRowEdit=function(e){var t=String(r.ObjectUtils.resolveFieldData(e,this.dataKey));this.editingRowKeys[t]=!0},e.prototype.saveRowEdit=function(e,t){if(0===l.DomHandler.find(t,".ng-invalid.ng-dirty").length){var i=String(r.ObjectUtils.resolveFieldData(e,this.dataKey));delete this.editingRowKeys[i]}},e.prototype.cancelRowEdit=function(e){var t=String(r.ObjectUtils.resolveFieldData(e,this.dataKey));delete this.editingRowKeys[t]},e.prototype.toggleRow=function(e,t){if(!this.dataKey)throw new Error("dataKey must be defined to use row expansion");var i=String(r.ObjectUtils.resolveFieldData(e,this.dataKey));null!=this.expandedRowKeys[i]?(delete this.expandedRowKeys[i],this.onRowCollapse.emit({originalEvent:t,data:e})):("single"===this.rowExpandMode&&(this.expandedRowKeys={}),this.expandedRowKeys[i]=!0,this.onRowExpand.emit({originalEvent:t,data:e})),t&&t.preventDefault(),this.isStateful()&&this.saveState()},e.prototype.isRowExpanded=function(e){return!0===this.expandedRowKeys[String(r.ObjectUtils.resolveFieldData(e,this.dataKey))]},e.prototype.isRowEditing=function(e){return!0===this.editingRowKeys[String(r.ObjectUtils.resolveFieldData(e,this.dataKey))]},e.prototype.isSingleSelectionMode=function(){return"single"===this.selectionMode},e.prototype.isMultipleSelectionMode=function(){return"multiple"===this.selectionMode},e.prototype.onColumnResizeBegin=function(e){var t=l.DomHandler.getOffset(this.containerViewChild.nativeElement).left;this.lastResizerHelperX=e.pageX-t+this.containerViewChild.nativeElement.scrollLeft,this.onColumnResize(e),e.preventDefault()},e.prototype.onColumnResize=function(e){var t=l.DomHandler.getOffset(this.containerViewChild.nativeElement).left;l.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,n=parseInt(t.style.minWidth||15);o+i<n&&(i=n-o);var r=o+i;if(r>=n){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(r>15&&a>parseInt(d))if(this.scrollable){var h=this.findParentScrollableView(t),c=l.DomHandler.findSingle(h,"table.ui-table-scrollable-body-table"),u=l.DomHandler.findSingle(h,"table.ui-table-scrollable-header-table"),p=l.DomHandler.findSingle(h,"table.ui-table-scrollable-footer-table"),g=l.DomHandler.index(t);this.resizeColGroup(u,g,r,a),this.resizeColGroup(c,g,r,a),this.resizeColGroup(p,g,r,a)}else t.style.width=r+"px",s&&(s.style.width=a+"px")}}else if("expand"===this.columnResizeMode&&r>n)if(this.scrollable)this.setScrollableItemsWidthOnExpandResize(t,r,i);else{this.tableViewChild.nativeElement.style.width=this.tableViewChild.nativeElement.offsetWidth+i+"px",t.style.width=r+"px";var m=this.tableViewChild.nativeElement.style.width;this.containerViewChild.nativeElement.style.width=m+"px"}this.onColResize.emit({element:t,delta:i}),this.isStateful()&&this.saveState()}this.resizeHelperViewChild.nativeElement.style.display="none",l.DomHandler.removeClass(this.containerViewChild.nativeElement,"ui-unselectable-text")},e.prototype.setScrollableItemsWidthOnExpandResize=function(e,t,i){var o=e?this.findParentScrollableView(e):this.containerViewChild.nativeElement,n=l.DomHandler.findSingle(o,".ui-table-scrollable-body"),r=l.DomHandler.findSingle(o,".ui-table-scrollable-header"),s=l.DomHandler.findSingle(o,".ui-table-scrollable-footer"),a=l.DomHandler.findSingle(n,"table.ui-table-scrollable-body-table"),d=l.DomHandler.findSingle(r,"table.ui-table-scrollable-header-table"),h=l.DomHandler.findSingle(s,"table.ui-table-scrollable-footer-table"),c=e?a.offsetWidth+i:t,u=e?d.offsetWidth+i:t,p=this.containerViewChild.nativeElement.offsetWidth>=c,g=function(e,t,i,o){e&&t&&(e.style.width=o?i+l.DomHandler.calculateScrollbarWidth(n)+"px":"auto",t.style.width=i+"px")};if(g(n,a,c,p),g(r,d,u,p),g(s,h,u,p),e){var m=l.DomHandler.index(e);this.resizeColGroup(d,m,t,null),this.resizeColGroup(a,m,t,null),this.resizeColGroup(h,m,t,null)}},e.prototype.findParentScrollableView=function(e){if(e){for(var t=e.parentElement;t&&!l.DomHandler.hasClass(t,"ui-table-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=l.DomHandler.getHiddenElementOuterWidth(this.reorderIndicatorUpViewChild.nativeElement),this.reorderIconHeight=l.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=l.DomHandler.getOffset(this.containerViewChild.nativeElement),o=l.DomHandler.getOffset(t);if(this.draggedColumn!=t){var n=l.DomHandler.indexWithinGroup(this.draggedColumn,"preorderablecolumn"),r=l.DomHandler.indexWithinGroup(t,"preorderablecolumn"),s=o.left-i.left,a=(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>a?(this.reorderIndicatorUpViewChild.nativeElement.style.left=s+t.offsetWidth-Math.ceil(this.reorderIconWidth/2)+"px",this.reorderIndicatorDownViewChild.nativeElement.style.left=s+t.offsetWidth-Math.ceil(this.reorderIconWidth/2)+"px",this.dropPosition=1):(this.reorderIndicatorUpViewChild.nativeElement.style.left=s-Math.ceil(this.reorderIconWidth/2)+"px",this.reorderIndicatorDownViewChild.nativeElement.style.left=s-Math.ceil(this.reorderIconWidth/2)+"px",this.dropPosition=-1),r-n==1&&-1===this.dropPosition||r-n==-1&&1===this.dropPosition?(this.reorderIndicatorUpViewChild.nativeElement.style.display="none",this.reorderIndicatorDownViewChild.nativeElement.style.display="none"):(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){var i=this;if(e.preventDefault(),this.draggedColumn){var o=l.DomHandler.indexWithinGroup(this.draggedColumn,"preorderablecolumn"),n=l.DomHandler.indexWithinGroup(t,"preorderablecolumn"),s=o!=n;s&&(n-o==1&&-1===this.dropPosition||o-n==1&&1===this.dropPosition)&&(s=!1),s&&n<o&&1===this.dropPosition&&(n+=1),s&&n>o&&-1===this.dropPosition&&(n-=1),s&&(r.ObjectUtils.reorderArray(this.columns,o,n),this.onColReorder.emit({dragIndex:o,dropIndex:n,columns:this.columns}),this.isStateful()&&this.zone.runOutsideAngular((function(){setTimeout((function(){i.saveState()}))}))),this.reorderIndicatorUpViewChild.nativeElement.style.display="none",this.reorderIndicatorDownViewChild.nativeElement.style.display="none",this.draggedColumn.draggable=!1,this.draggedColumn=null,this.dropPosition=null}},e.prototype.onRowDragStart=function(e,t){this.rowDragging=!0,this.draggedRowIndex=t,e.dataTransfer.setData("text","b")},e.prototype.onRowDragOver=function(e,t,i){if(this.rowDragging&&this.draggedRowIndex!==t){var o=l.DomHandler.getOffset(i).top+l.DomHandler.getWindowScrollTop(),n=e.pageY,r=o+l.DomHandler.getOuterHeight(i)/2,s=i.previousElementSibling;n<r?(l.DomHandler.removeClass(i,"ui-table-dragpoint-bottom"),this.droppedRowIndex=t,s?l.DomHandler.addClass(s,"ui-table-dragpoint-bottom"):l.DomHandler.addClass(i,"ui-table-dragpoint-top")):(s?l.DomHandler.removeClass(s,"ui-table-dragpoint-bottom"):l.DomHandler.addClass(i,"ui-table-dragpoint-top"),this.droppedRowIndex=t+1,l.DomHandler.addClass(i,"ui-table-dragpoint-bottom"))}},e.prototype.onRowDragLeave=function(e,t){var i=t.previousElementSibling;i&&l.DomHandler.removeClass(i,"ui-table-dragpoint-bottom"),l.DomHandler.removeClass(t,"ui-table-dragpoint-bottom"),l.DomHandler.removeClass(t,"ui-table-dragpoint-top")},e.prototype.onRowDragEnd=function(e){this.rowDragging=!1,this.draggedRowIndex=null,this.droppedRowIndex=null},e.prototype.onRowDrop=function(e,t){if(null!=this.droppedRowIndex){var i=this.draggedRowIndex>this.droppedRowIndex?this.droppedRowIndex:0===this.droppedRowIndex?0:this.droppedRowIndex-1;r.ObjectUtils.reorderArray(this.value,this.draggedRowIndex,i),this.onRowReorder.emit({dragIndex:this.draggedRowIndex,dropIndex:i})}this.onRowDragLeave(e,t),this.onRowDragEnd(e)},e.prototype.handleVirtualScroll=function(e){var t=this;this.first=(e.page-1)*this.rows,this.firstChange.emit(this.first),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.filteredValue||this.value;return null==e||0==e.length},e.prototype.getBlockableElement=function(){return this.el.nativeElement.children[0]},e.prototype.getStorage=function(){switch(this.stateStorage){case"local":return window.localStorage;case"session":return window.sessionStorage;default:throw new Error(this.stateStorage+' is not a valid value for the state storage, supported values are "local" and "session".')}},e.prototype.isStateful=function(){return null!=this.stateKey},e.prototype.saveState=function(){var e=this.getStorage(),t={};this.paginator&&(t.first=this.first,t.rows=this.rows),this.sortField&&(t.sortField=this.sortField,t.sortOrder=this.sortOrder),this.multiSortMeta&&(t.multiSortMeta=this.multiSortMeta),this.hasFilter()&&(t.filters=this.filters),this.resizableColumns&&this.saveColumnWidths(t),this.reorderableColumns&&this.saveColumnOrder(t),this.selection&&(t.selection=this.selection),Object.keys(this.expandedRowKeys).length&&(t.expandedRowKeys=this.expandedRowKeys),Object.keys(t).length&&e.setItem(this.stateKey,JSON.stringify(t)),this.onStateSave.emit(t)},e.prototype.clearState=function(){var e=this.getStorage();this.stateKey&&e.removeItem(this.stateKey)},e.prototype.restoreState=function(){var e=this,t=this.getStorage().getItem(this.stateKey);if(t){var i=JSON.parse(t);this.paginator&&(this.first=i.first,this.rows=i.rows,this.firstChange.emit(this.first),this.rowsChange.emit(this.rows)),i.sortField&&(this.restoringSort=!0,this._sortField=i.sortField,this._sortOrder=i.sortOrder),i.multiSortMeta&&(this.restoringSort=!0,this._multiSortMeta=i.multiSortMeta),i.filters&&(this.restoringFilter=!0,this.filters=i.filters),this.resizableColumns&&(this.columnWidthsState=i.columnWidths,this.tableWidthState=i.tableWidth),i.expandedRowKeys&&(this.expandedRowKeys=i.expandedRowKeys),i.selection&&Promise.resolve(null).then((function(){return e.selectionChange.emit(i.selection)})),this.stateRestored=!0,this.onStateRestore.emit(i)}},e.prototype.saveColumnWidths=function(e){var t=[];l.DomHandler.find(this.containerViewChild.nativeElement,".ui-table-thead > tr:first-child > th").map((function(e){return t.push(l.DomHandler.getOuterWidth(e))})),e.columnWidths=t.join(","),"expand"===this.columnResizeMode&&(e.tableWidth=this.scrollable?l.DomHandler.findSingle(this.containerViewChild.nativeElement,".ui-table-scrollable-header-table").style.width:l.DomHandler.getOuterWidth(this.tableViewChild.nativeElement)+"px")},e.prototype.restoreColumnWidths=function(){if(this.columnWidthsState){var e=this.columnWidthsState.split(",");if("expand"===this.columnResizeMode&&this.tableWidthState&&(this.scrollable?this.setScrollableItemsWidthOnExpandResize(null,this.tableWidthState,0):(this.tableViewChild.nativeElement.style.width=this.tableWidthState,this.containerViewChild.nativeElement.style.width=this.tableWidthState)),this.scrollable){var t=l.DomHandler.find(this.containerViewChild.nativeElement,".ui-table-scrollable-header-table > colgroup > col"),i=l.DomHandler.find(this.containerViewChild.nativeElement,".ui-table-scrollable-body-table > colgroup > col");t.map((function(t,i){return t.style.width=e[i]+"px"})),i.map((function(t,i){return t.style.width=e[i]+"px"}))}else{l.DomHandler.find(this.tableViewChild.nativeElement,".ui-table-thead > tr:first-child > th").map((function(t,i){return t.style.width=e[i]+"px"}))}}},e.prototype.saveColumnOrder=function(e){if(this.columns){var t=[];this.columns.map((function(e){t.push(e.field||e.key)})),e.columnOrder=t}},e.prototype.restoreColumnOrder=function(){var e=this,t=this.getStorage().getItem(this.stateKey);if(t){var i=JSON.parse(t).columnOrder;if(i){var o=[];i.map((function(t){return o.push(e.findColumnByKey(t))})),this.columnOrderStateRestored=!0,this.columns=o}}},e.prototype.findColumnByKey=function(e){var t,i;if(!this.columns)return null;try{for(var o=h(this.columns),n=o.next();!n.done;n=o.next()){var l=n.value;if(l.key===e||l.field===e)return l}}catch(e){t={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}},e.prototype.ngOnDestroy=function(){this.unbindDocumentEditListener(),this.editingCell=null,this.initialized=null},e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.NgZone},{type:p},{type:t.ChangeDetectorRef}]},a([t.Input()],e.prototype,"frozenColumns",void 0),a([t.Input()],e.prototype,"frozenValue",void 0),a([t.Input()],e.prototype,"style",void 0),a([t.Input()],e.prototype,"styleClass",void 0),a([t.Input()],e.prototype,"tableStyle",void 0),a([t.Input()],e.prototype,"tableStyleClass",void 0),a([t.Input()],e.prototype,"paginator",void 0),a([t.Input()],e.prototype,"pageLinks",void 0),a([t.Input()],e.prototype,"rowsPerPageOptions",void 0),a([t.Input()],e.prototype,"alwaysShowPaginator",void 0),a([t.Input()],e.prototype,"paginatorPosition",void 0),a([t.Input()],e.prototype,"paginatorDropdownAppendTo",void 0),a([t.Input()],e.prototype,"paginatorDropdownScrollHeight",void 0),a([t.Input()],e.prototype,"currentPageReportTemplate",void 0),a([t.Input()],e.prototype,"showCurrentPageReport",void 0),a([t.Input()],e.prototype,"defaultSortOrder",void 0),a([t.Input()],e.prototype,"sortMode",void 0),a([t.Input()],e.prototype,"resetPageOnSort",void 0),a([t.Input()],e.prototype,"selectionMode",void 0),a([t.Output()],e.prototype,"selectionChange",void 0),a([t.Input()],e.prototype,"contextMenuSelection",void 0),a([t.Output()],e.prototype,"contextMenuSelectionChange",void 0),a([t.Input()],e.prototype,"contextMenuSelectionMode",void 0),a([t.Input()],e.prototype,"dataKey",void 0),a([t.Input()],e.prototype,"metaKeySelection",void 0),a([t.Input()],e.prototype,"rowTrackBy",void 0),a([t.Input()],e.prototype,"lazy",void 0),a([t.Input()],e.prototype,"lazyLoadOnInit",void 0),a([t.Input()],e.prototype,"compareSelectionBy",void 0),a([t.Input()],e.prototype,"csvSeparator",void 0),a([t.Input()],e.prototype,"exportFilename",void 0),a([t.Input()],e.prototype,"filters",void 0),a([t.Input()],e.prototype,"globalFilterFields",void 0),a([t.Input()],e.prototype,"filterDelay",void 0),a([t.Input()],e.prototype,"expandedRowKeys",void 0),a([t.Input()],e.prototype,"editingRowKeys",void 0),a([t.Input()],e.prototype,"rowExpandMode",void 0),a([t.Input()],e.prototype,"scrollable",void 0),a([t.Input()],e.prototype,"scrollHeight",void 0),a([t.Input()],e.prototype,"virtualScroll",void 0),a([t.Input()],e.prototype,"virtualScrollDelay",void 0),a([t.Input()],e.prototype,"virtualRowHeight",void 0),a([t.Input()],e.prototype,"frozenWidth",void 0),a([t.Input()],e.prototype,"responsive",void 0),a([t.Input()],e.prototype,"contextMenu",void 0),a([t.Input()],e.prototype,"resizableColumns",void 0),a([t.Input()],e.prototype,"columnResizeMode",void 0),a([t.Input()],e.prototype,"reorderableColumns",void 0),a([t.Input()],e.prototype,"loading",void 0),a([t.Input()],e.prototype,"loadingIcon",void 0),a([t.Input()],e.prototype,"showLoader",void 0),a([t.Input()],e.prototype,"rowHover",void 0),a([t.Input()],e.prototype,"customSort",void 0),a([t.Input()],e.prototype,"autoLayout",void 0),a([t.Input()],e.prototype,"exportFunction",void 0),a([t.Input()],e.prototype,"stateKey",void 0),a([t.Input()],e.prototype,"stateStorage",void 0),a([t.Input()],e.prototype,"editMode",void 0),a([t.Output()],e.prototype,"onRowSelect",void 0),a([t.Output()],e.prototype,"onRowUnselect",void 0),a([t.Output()],e.prototype,"onPage",void 0),a([t.Output()],e.prototype,"onSort",void 0),a([t.Output()],e.prototype,"onFilter",void 0),a([t.Output()],e.prototype,"onLazyLoad",void 0),a([t.Output()],e.prototype,"onRowExpand",void 0),a([t.Output()],e.prototype,"onRowCollapse",void 0),a([t.Output()],e.prototype,"onContextMenuSelect",void 0),a([t.Output()],e.prototype,"onColResize",void 0),a([t.Output()],e.prototype,"onColReorder",void 0),a([t.Output()],e.prototype,"onRowReorder",void 0),a([t.Output()],e.prototype,"onEditInit",void 0),a([t.Output()],e.prototype,"onEditComplete",void 0),a([t.Output()],e.prototype,"onEditCancel",void 0),a([t.Output()],e.prototype,"onHeaderCheckboxToggle",void 0),a([t.Output()],e.prototype,"sortFunction",void 0),a([t.Output()],e.prototype,"firstChange",void 0),a([t.Output()],e.prototype,"rowsChange",void 0),a([t.Output()],e.prototype,"onStateSave",void 0),a([t.Output()],e.prototype,"onStateRestore",void 0),a([t.ViewChild("container")],e.prototype,"containerViewChild",void 0),a([t.ViewChild("resizeHelper")],e.prototype,"resizeHelperViewChild",void 0),a([t.ViewChild("reorderIndicatorUp")],e.prototype,"reorderIndicatorUpViewChild",void 0),a([t.ViewChild("reorderIndicatorDown")],e.prototype,"reorderIndicatorDownViewChild",void 0),a([t.ViewChild("table")],e.prototype,"tableViewChild",void 0),a([t.ContentChildren(o.PrimeTemplate)],e.prototype,"templates",void 0),a([t.Input()],e.prototype,"value",null),a([t.Input()],e.prototype,"columns",null),a([t.Input()],e.prototype,"first",null),a([t.Input()],e.prototype,"rows",null),a([t.Input()],e.prototype,"totalRecords",null),a([t.Input()],e.prototype,"sortField",null),a([t.Input()],e.prototype,"sortOrder",null),a([t.Input()],e.prototype,"multiSortMeta",null),a([t.Input()],e.prototype,"selection",null),e=a([t.Component({selector:"p-table",template:'\n <div #container [ngStyle]="style" [class]="styleClass"\n [ngClass]="{\'ui-table ui-widget\': true, \'ui-table-responsive\': responsive, \'ui-table-resizable\': resizableColumns,\n \'ui-table-resizable-fit\': (resizableColumns && columnResizeMode === \'fit\'),\n \'ui-table-hoverable-rows\': (rowHover||selectionMode), \'ui-table-auto-layout\': autoLayout}">\n <div class="ui-table-loading ui-widget-overlay" *ngIf="loading && showLoader"></div>\n <div class="ui-table-loading-content" *ngIf="loading && showLoader">\n <i [class]="\'ui-table-loading-icon pi-spin \' + loadingIcon"></i>\n </div>\n <div *ngIf="captionTemplate" class="ui-table-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" [dropdownScrollHeight]="paginatorDropdownScrollHeight"\n [currentPageReportTemplate]="currentPageReportTemplate" [showCurrentPageReport]="showCurrentPageReport"></p-paginator>\n\n <div class="ui-table-wrapper" *ngIf="!scrollable">\n <table role="grid" #table [ngClass]="tableStyleClass" [ngStyle]="tableStyle">\n <ng-container *ngTemplateOutlet="colGroupTemplate; context {$implicit: columns}"></ng-container>\n <thead class="ui-table-thead">\n <ng-container *ngTemplateOutlet="headerTemplate; context: {$implicit: columns}"></ng-container>\n </thead>\n <tbody class="ui-table-tbody" [pTableBody]="columns" [pTableBodyTemplate]="bodyTemplate"></tbody>\n <tfoot *ngIf="footerTemplate" class="ui-table-tfoot">\n <ng-container *ngTemplateOutlet="footerTemplate; context {$implicit: columns}"></ng-container>\n </tfoot>\n </table>\n </div>\n\n <div class="ui-table-scrollable-wrapper" *ngIf="scrollable">\n <div class="ui-table-scrollable-view ui-table-frozen-view" *ngIf="frozenColumns||frozenBodyTemplate" [pScrollableView]="frozenColumns" [frozen]="true" [ngStyle]="{width: frozenWidth}" [scrollHeight]="scrollHeight"></div>\n <div class="ui-table-scrollable-view" [pScrollableView]="columns" [frozen]="false" [scrollHeight]="scrollHeight" [ngStyle]="{left: frozenWidth, width: \'calc(100% - \'+frozenWidth+\')\'}"></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" [dropdownScrollHeight]="paginatorDropdownScrollHeight"\n [currentPageReportTemplate]="currentPageReportTemplate" [showCurrentPageReport]="showCurrentPageReport"></p-paginator>\n\n <div *ngIf="summaryTemplate" class="ui-table-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" style="display:none" *ngIf="reorderableColumns"></span>\n <span #reorderIndicatorDown class="pi pi-arrow-up ui-table-reorder-indicator-down" style="display:none" *ngIf="reorderableColumns"></span>\n </div>\n ',providers:[p],changeDetection:t.ChangeDetectionStrategy.Default})],e)}(),m=function(){function e(e){this.dt=e}return e.ctorParameters=function(){return[{type:g}]},a([t.Input("pTableBody")],e.prototype,"columns",void 0),a([t.Input("pTableBodyTemplate")],e.prototype,"template",void 0),a([t.Input()],e.prototype,"frozen",void 0),e=a([t.Component({selector:"[pTableBody]",template:'\n <ng-container *ngIf="!dt.expandedRowTemplate">\n <ng-template ngFor let-rowData let-rowIndex="index" [ngForOf]="(dt.paginator && !dt.lazy) ? ((dt.filteredValue||dt.value) | slice:dt.first:(dt.first + dt.rows)) : (dt.filteredValue||dt.value)" [ngForTrackBy]="dt.rowTrackBy">\n <ng-container *ngTemplateOutlet="template; context: {$implicit: rowData, rowIndex: dt.paginator ? (dt.first + rowIndex) : rowIndex, columns: columns, editing: (dt.editMode === \'row\' && dt.isRowEditing(rowData))}"></ng-container>\n </ng-template>\n </ng-container>\n <ng-container *ngIf="dt.expandedRowTemplate">\n <ng-template ngFor let-rowData let-rowIndex="index" [ngForOf]="(dt.paginator && !dt.lazy) ? ((dt.filteredValue||dt.value) | slice:dt.first:(dt.first + dt.rows)) : (dt.filteredValue||dt.value)" [ngForTrackBy]="dt.rowTrackBy">\n <ng-container *ngTemplateOutlet="template; context: {$implicit: rowData, rowIndex: dt.paginator ? (dt.first + rowIndex) : rowIndex, columns: columns, expanded: dt.isRowExpanded(rowData), editing: (dt.editMode === \'row\' && dt.isRowEditing(rowData))}"></ng-container>\n <ng-container *ngIf="dt.isRowExpanded(rowData)">\n <ng-container *ngTemplateOutlet="dt.expandedRowTemplate; context: {$implicit: rowData, rowIndex: dt.paginator ? (dt.first + rowIndex) : rowIndex, columns: columns}"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n <ng-container *ngIf="dt.loading">\n <ng-container *ngTemplateOutlet="dt.loadingBodyTemplate; context: {$implicit: columns, frozen: frozen}"></ng-container>\n </ng-container>\n <ng-container *ngIf="dt.isEmpty() && !dt.loading">\n <ng-container *ngTemplateOutlet="dt.emptyMessageTemplate; context: {$implicit: columns, frozen: frozen}"></ng-container>\n </ng-container>\n '})],e)}(),v=functio