primeng
Version:
[](https://opensource.org/licenses/MIT) [](https://badge.fury.io/js/primeng) [ • 118 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("primeng/api"),require("primeng/paginator"),require("primeng/inputtext"),require("primeng/button"),require("primeng/selectbutton"),require("primeng/tristatecheckbox"),require("primeng/calendar"),require("primeng/inputnumber"),require("primeng/dropdown"),require("primeng/dom"),require("primeng/utils"),require("rxjs"),require("@angular/cdk/scrolling"),require("@angular/animations")):"function"==typeof define&&define.amd?define("primeng/table",["exports","@angular/core","@angular/common","@angular/forms","primeng/api","primeng/paginator","primeng/inputtext","primeng/button","primeng/selectbutton","primeng/tristatecheckbox","primeng/calendar","primeng/inputnumber","primeng/dropdown","primeng/dom","primeng/utils","rxjs","@angular/cdk/scrolling","@angular/animations"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).primeng=e.primeng||{},e.primeng.table={}),e.ng.core,e.ng.common,e.ng.forms,e.primeng.api,e.primeng.paginator,e.primeng.inputtext,e.primeng.button,e.primeng.selectbutton,e.primeng.tristatecheckbox,e.primeng.calendar,e.primeng.inputnumber,e.primeng.dropdown,e.primeng.dom,e.primeng.utils,e.rxjs,e.ng.cdk.scrolling,e.ng.animations)}(this,(function(e,t,i,n,o,r,l,a,s,d,c,p,u,h,m,f,g,y){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */Object.create;function b(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,o,r=i.call(e),l=[];try{for(;(void 0===t||t-- >0)&&!(n=r.next()).done;)l.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(i=r.return)&&i.call(r)}finally{if(o)throw o.error}}return l}function w(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(v(arguments[t]));return e}Object.create;var C=function(){function e(){this.sortSource=new f.Subject,this.selectionSource=new f.Subject,this.contextMenuSource=new f.Subject,this.valueSource=new f.Subject,this.totalRecordsSource=new f.Subject,this.columnsSource=new f.Subject,this.resetSource=new f.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(),this.resetSource$=this.resetSource.asObservable()}return e.prototype.onSort=function(e){this.sortSource.next(e)},e.prototype.onSelectionChange=function(){this.selectionSource.next()},e.prototype.onResetChange=function(){this.resetSource.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}();C.decorators=[{type:t.Injectable}];var S=function(){function e(e,i,n,o,r){this.el=e,this.zone=i,this.tableService=n,this.cd=o,this.filterService=r,this.pageLinks=5,this.alwaysShowPaginator=!0,this.paginatorPosition="bottom",this.paginatorDropdownScrollHeight="200px",this.currentPageReportTemplate="{currentPage} of {totalPages}",this.showFirstLastIcon=!0,this.showPageLinks=!0,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=250,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.virtualScroll||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"frozenrowexpansion":e.frozenExpandedRowTemplate=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"paginatordropdownitem":e.paginatorDropdownItemTemplate=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.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.initialized&&(this.lazy||this.virtualScroll)||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:!1,configurable:!0}),Object.defineProperty(e.prototype,"columns",{get:function(){return this._columns},set:function(e){this._columns=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"first",{get:function(){return this._first},set:function(e){this._first=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rows",{get:function(){return this._rows},set:function(e){this._rows=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"totalRecords",{get:function(){return this._totalRecords},set:function(e){this._totalRecords=e,this.tableService.onTotalRecordsChange(this._totalRecords)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sortField",{get:function(){return this._sortField},set:function(e){this._sortField=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sortOrder",{get:function(){return this._sortOrder},set:function(e){this._sortOrder=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"multiSortMeta",{get:function(){return this._multiSortMeta},set:function(e){this._multiSortMeta=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){return this._selection},set:function(e){this._selection=e},enumerable:!1,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=b(this._selection),n=i.next();!n.done;n=i.next()){var o=n.value;this.selectionKeys[String(m.ObjectUtils.resolveFieldData(o,this.dataKey))]=1}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}else this.selectionKeys[String(m.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,this.scrollable&&this.resetScrollTop()},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.resetPageOnSort&&(this._first=0,this.firstChange.emit(this._first),this.scrollable&&this.resetScrollTop()),this.sortSingle()),"multiple"===this.sortMode){var i=t.metaKey||t.ctrlKey,n=this.getSortMeta(e.field);n?i?n.order=-1*n.order:(this._multiSortMeta=[{field:e.field,order:-1*n.order}],this.resetPageOnSort&&(this._first=0,this.firstChange.emit(this._first),this.scrollable&&this.resetScrollTop())):(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 n=m.ObjectUtils.resolveFieldData(t,e.sortField),o=m.ObjectUtils.resolveFieldData(i,e.sortField),r=null;return r=null==n&&null!=o?-1:null!=n&&null==o?1:null==n&&null==o?0:"string"==typeof n&&"string"==typeof o?n.localeCompare(o):n<o?-1:n>o?1:0,e.sortOrder*r})),this._value=w(this.value)),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._value=w(this.value)),this.hasFilter()&&this._filter()),this.onSort.emit({multisortmeta:this.multiSortMeta}),this.tableService.onSort(this.multiSortMeta))},e.prototype.multisortField=function(e,t,i,n){var o=m.ObjectUtils.resolveFieldData(e,i[n].field),r=m.ObjectUtils.resolveFieldData(t,i[n].field),l=null;if(null==o&&null!=r)l=-1;else if(null!=o&&null==r)l=1;else if(null==o&&null==r)l=0;else if("string"==typeof o||o instanceof String){if(o.localeCompare&&o!=r)return i[n].order*o.localeCompare(r)}else l=o<r?-1:1;return o==r?i.length-1>n?this.multisortField(e,t,i,n+1):0:i[n].order*l},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,n=t.parentElement&&t.parentElement.nodeName;if("INPUT"!=i&&"BUTTON"!=i&&"A"!=i&&"INPUT"!=n&&"BUTTON"!=n&&"A"!=n&&!h.DomHandler.hasClass(e.originalEvent.target,"p-clickable")){if(this.selectionMode){if(this.preventSelectionSetterPropagation=!0,this.isMultipleSelectionMode()&&e.originalEvent.shiftKey&&null!=this.anchorRowIndex)h.DomHandler.clearSelection(),null!=this.rangeRowIndex&&this.clearSelectionRange(e.originalEvent),this.rangeRowIndex=e.rowIndex,this.selectRange(e.originalEvent,e.rowIndex);else{var o=e.rowData,r=this.isSelected(o),l=!this.rowTouched&&this.metaKeySelection,a=this.dataKey?String(m.ObjectUtils.resolveFieldData(o,this.dataKey)):null;if(this.anchorRowIndex=e.rowIndex,this.rangeRowIndex=e.rowIndex,l){var s=e.originalEvent.metaKey||e.originalEvent.ctrlKey;if(r&&s){if(this.isSingleSelectionMode())this._selection=null,this.selectionKeys={},this.selectionChange.emit(null);else{var d=this.findIndexInSelection(o);this._selection=this.selection.filter((function(e,t){return t!=d})),this.selectionChange.emit(this.selection),a&&delete this.selectionKeys[a]}this.onRowUnselect.emit({originalEvent:e.originalEvent,data:o,type:"row"})}else this.isSingleSelectionMode()?(this._selection=o,this.selectionChange.emit(o),a&&(this.selectionKeys={},this.selectionKeys[a]=1)):this.isMultipleSelectionMode()&&(s?this._selection=this.selection||[]:(this._selection=[],this.selectionKeys={}),this._selection=w(this.selection,[o]),this.selectionChange.emit(this.selection),a&&(this.selectionKeys[a]=1)),this.onRowSelect.emit({originalEvent:e.originalEvent,data:o,type:"row",index:e.rowIndex})}else if("single"===this.selectionMode)r?(this._selection=null,this.selectionKeys={},this.selectionChange.emit(this.selection),this.onRowUnselect.emit({originalEvent:e.originalEvent,data:o,type:"row",index:e.rowIndex})):(this._selection=o,this.selectionChange.emit(this.selection),this.onRowSelect.emit({originalEvent:e.originalEvent,data:o,type:"row",index:e.rowIndex}),a&&(this.selectionKeys={},this.selectionKeys[a]=1));else if("multiple"===this.selectionMode)if(r){var c=this.findIndexInSelection(o);this._selection=this.selection.filter((function(e,t){return t!=c})),this.selectionChange.emit(this.selection),this.onRowUnselect.emit({originalEvent:e.originalEvent,data:o,type:"row",index:e.rowIndex}),a&&delete this.selectionKeys[a]}else this._selection=this.selection?w(this.selection,[o]):[o],this.selectionChange.emit(this.selection),this.onRowSelect.emit({originalEvent:e.originalEvent,data:o,type:"row",index:e.rowIndex}),a&&(this.selectionKeys[a]=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),n=this.dataKey?String(m.ObjectUtils.resolveFieldData(t,this.dataKey)):null;i||(this.isSingleSelectionMode()?(this.selection=t,this.selectionChange.emit(t),n&&(this.selectionKeys={},this.selectionKeys[n]=1)):this.isMultipleSelectionMode()&&(this._selection=this.selection?w(this.selection,[t]):[t],this.selectionChange.emit(this.selection),n&&(this.selectionKeys[n]=1))),this.tableService.onSelectionChange(),this.contextMenu.show(e.originalEvent),this.onContextMenuSelect.emit({originalEvent:e,data:t,index:e.rowIndex})}}},e.prototype.selectRange=function(e,t){var i,n;this.anchorRowIndex>t?(i=t,n=this.anchorRowIndex):this.anchorRowIndex<t?(i=this.anchorRowIndex,n=t):(i=t,n=t),this.lazy&&this.paginator&&(i-=this.first,n-=this.first);for(var o=[],r=i;r<=n;r++){var l=this.filteredValue?this.filteredValue[r]:this.value[r];if(!this.isSelected(l)){o.push(l),this._selection=w(this.selection,[l]);var a=this.dataKey?String(m.ObjectUtils.resolveFieldData(l,this.dataKey)):null;a&&(this.selectionKeys[a]=1)}}this.selectionChange.emit(this.selection),this.onRowSelect.emit({originalEvent:e,data:o,type:"row"})},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 n=function(t){var i=o.value[t],n=o.findIndexInSelection(i);o._selection=o.selection.filter((function(e,t){return t!=n}));var r=o.dataKey?String(m.ObjectUtils.resolveFieldData(i,o.dataKey)):null;r&&delete o.selectionKeys[r],o.onRowUnselect.emit({originalEvent:e,data:i,type:"row"})},o=this,r=t;r<=i;r++)n(r)},e.prototype.isSelected=function(e){return!(!e||!this.selection)&&(this.dataKey?void 0!==this.selectionKeys[m.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(m.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),n=this.dataKey?String(m.ObjectUtils.resolveFieldData(t,this.dataKey)):null;if(this.preventSelectionSetterPropagation=!0,i){var o=this.findIndexInSelection(t);this._selection=this.selection.filter((function(e,t){return t!=o})),this.selectionChange.emit(this.selection),this.onRowUnselect.emit({originalEvent:e.originalEvent,index:e.rowIndex,data:t,type:"checkbox"}),n&&delete this.selectionKeys[n]}else this._selection=this.selection?w(this.selection,[t]):[t],this.selectionChange.emit(this.selection),this.onRowSelect.emit({originalEvent:e.originalEvent,index:e.rowIndex,data:t,type:"checkbox"}),n&&(this.selectionKeys[n]=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:m.ObjectUtils.equals(e,t,this.dataKey)},e.prototype.filter=function(e,t,i){var n=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(){n._filter(),n.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(){var e,t;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 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.filteredValue=[];for(var n=0;n<this.value.length;n++){var r=!0,l=!1,a=!1;for(var s in this.filters)if(this.filters.hasOwnProperty(s)&&"global"!==s){a=!0;var d=s,c=this.filters[d];if(Array.isArray(c))try{for(var p=(e=void 0,b(c)),u=p.next();!u.done;u=p.next()){var h=u.value;if(r=this.executeLocalFilter(d,this.value[n],h),h.operator===o.FilterOperator.OR&&r||h.operator===o.FilterOperator.AND&&!r)break}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=p.return)&&t.call(p)}finally{if(e)throw e.error}}else r=this.executeLocalFilter(d,this.value[n],c);if(!r)break}if(this.filters.global&&!l&&i)for(var f=0;f<i.length;f++){var g=i[f].field||i[f];if(l=this.filterService.filters[this.filters.global.matchMode](m.ObjectUtils.resolveFieldData(this.value[n],g),this.filters.global.value,this.filterLocale))break}(this.filters.global?a?a&&r&&l:l:a&&r)&&this.filteredValue.push(this.value[n])}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(),this.scrollable&&this.resetScrollTop()},e.prototype.executeLocalFilter=function(e,t,i){var n=i.value,r=i.matchMode||o.FilterMatchMode.STARTS_WITH,l=m.ObjectUtils.resolveFieldData(t,e);return(0,this.filterService.filters[r])(l,n,this.filterLocale)},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.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.clear=function(){this._sortField=null,this._sortOrder=this.defaultSortOrder,this._multiSortMeta=null,this.tableService.onSort(null),this.filteredValue=null,this.tableService.onResetChange(),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.reset=function(){this.clear()},e.prototype.exportCSV=function(e){var t,i=this,n="",o=this.frozenColumns?w(this.frozenColumns,this.columns):this.columns;e&&e.selectionOnly?t=this.selection||[]:(t=this.filteredValue||this.value,this.frozenValue&&(t=t?w(this.frozenValue,t):this.frozenValue));for(var r=0;r<o.length;r++){var l=o[r];!1!==l.exportable&&l.field&&(n+='"'+(l.header||l.field)+'"',r<o.length-1&&(n+=this.csvSeparator))}t.forEach((function(e,t){n+="\n";for(var r=0;r<o.length;r++){var l=o[r];if(!1!==l.exportable&&l.field){var a=m.ObjectUtils.resolveFieldData(e,l.field);a=null!=a?i.exportFunction?i.exportFunction({data:a,field:l.field}):String(a).replace(/"/g,'""'):"",n+='"'+a+'"',r<o.length-1&&(n+=i.csvSeparator)}}}));var a=new Blob([n],{type:"text/csv;charset=utf-8;"});if(window.navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(a,this.exportFilename+".csv");else{var s=document.createElement("a");s.style.display="none",document.body.appendChild(s),void 0!==s.download?(s.setAttribute("href",URL.createObjectURL(a)),s.setAttribute("download",this.exportFilename+".csv"),s.click()):(n="data:text/csv;charset=utf-8,"+n,window.open(encodeURI(n))),document.body.removeChild(s)}},e.prototype.resetScrollTop=function(){this.virtualScroll?this.scrollToVirtualIndex(0):this.scrollTo({top:0})},e.prototype.scrollToVirtualIndex=function(e){this.scrollableViewChild&&this.scrollableViewChild.scrollToVirtualIndex(e),this.scrollableFrozenViewChild&&this.scrollableFrozenViewChild.scrollToVirtualIndex(e)},e.prototype.scrollTo=function(e){this.scrollableViewChild&&this.scrollableViewChild.scrollTo(e),this.scrollableFrozenViewChild&&this.scrollableFrozenViewChild.scrollTo(e)},e.prototype.updateEditingCell=function(e,t,i,n){this.editingCell=e,this.editingCellData=t,this.editingCellField=i,this.editingCellRowIndex=n,this.bindDocumentEditListener()},e.prototype.isEditingCellValid=function(){return this.editingCell&&0===h.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()&&(h.DomHandler.removeClass(e.editingCell,"p-cell-editing"),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.cd.markForCheck()),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(m.ObjectUtils.resolveFieldData(e,this.dataKey));this.editingRowKeys[t]=!0},e.prototype.saveRowEdit=function(e,t){if(0===h.DomHandler.find(t,".ng-invalid.ng-dirty").length){var i=String(m.ObjectUtils.resolveFieldData(e,this.dataKey));delete this.editingRowKeys[i]}},e.prototype.cancelRowEdit=function(e){var t=String(m.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(m.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(m.ObjectUtils.resolveFieldData(e,this.dataKey))]},e.prototype.isRowEditing=function(e){return!0===this.editingRowKeys[String(m.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=h.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=h.DomHandler.getOffset(this.containerViewChild.nativeElement).left;h.DomHandler.addClass(this.containerViewChild.nativeElement,"p-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,n=t.offsetWidth,o=parseInt(t.style.minWidth||15);n+i<o&&(i=o-n);var r=n+i;if(r>=o){if("fit"===this.columnResizeMode){for(var l=t.nextElementSibling;!l.offsetParent;)l=l.nextElementSibling;if(l){var a=l.offsetWidth-i,s=l.style.minWidth||15;if(r>15&&a>parseInt(s))if(this.scrollable){var d=this.findParentScrollableView(t),c=h.DomHandler.findSingle(d,".p-datatable-scrollable-body table")||h.DomHandler.findSingle(d,".p-datatable-virtual-scrollable-body table"),p=h.DomHandler.findSingle(d,"table.p-datatable-scrollable-header-table"),u=h.DomHandler.findSingle(d,"table.p-datatable-scrollable-footer-table"),m=h.DomHandler.index(t);this.resizeColGroup(p,m,r,a),this.resizeColGroup(c,m,r,a),this.resizeColGroup(u,m,r,a)}else t.style.width=r+"px",l&&(l.style.width=a+"px")}}else if("expand"===this.columnResizeMode&&r>=o)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 f=this.tableViewChild.nativeElement.style.width;this.containerViewChild.nativeElement.style.width=f+"px"}this.onColResize.emit({element:t,delta:i}),this.isStateful()&&this.saveState()}this.resizeHelperViewChild.nativeElement.style.display="none",h.DomHandler.removeClass(this.containerViewChild.nativeElement,"p-unselectable-text")},e.prototype.setScrollableItemsWidthOnExpandResize=function(e,t,i){var n=e?this.findParentScrollableView(e):this.containerViewChild.nativeElement,o=h.DomHandler.findSingle(n,".p-datatable-scrollable-body")||h.DomHandler.findSingle(n,"cdk-virtual-scroll-viewport"),r=h.DomHandler.findSingle(n,".p-datatable-scrollable-header"),l=h.DomHandler.findSingle(n,".p-datatable-scrollable-footer"),a=h.DomHandler.findSingle(o,".p-datatable-scrollable-body table")||h.DomHandler.findSingle(n,"cdk-virtual-scroll-viewport table"),s=h.DomHandler.findSingle(r,"table.p-datatable-scrollable-header-table"),d=h.DomHandler.findSingle(l,"table.p-datatable-scrollable-footer-table"),c=e?a.offsetWidth+i:t,p=e?s.offsetWidth+i:t,u=this.containerViewChild.nativeElement.offsetWidth>=c,m=function(e,t,i,n){e&&t&&(e.style.width=n?i+h.DomHandler.calculateScrollbarWidth(o)+"px":"auto",t.style.width=i+"px")};if(m(o,a,c,u),m(r,s,p,u),m(l,d,p,u),e){var f=h.DomHandler.index(e);this.resizeColGroup(s,f,t,null),this.resizeColGroup(a,f,t,null),this.resizeColGroup(d,f,t,null)}},e.prototype.findParentScrollableView=function(e){if(e){for(var t=e.parentElement;t&&!h.DomHandler.hasClass(t,"p-datatable-scrollable-view");)t=t.parentElement;return t}return null},e.prototype.resizeColGroup=function(e,t,i,n){if(e){var o="COLGROUP"===e.children[0].nodeName?e.children[0]:null;if(!o)throw"Scrollable tables require a colgroup to support resizable columns";var r=o.children[t],l=r.nextElementSibling;r.style.width=i+"px",l&&n&&(l.style.width=n+"px")}},e.prototype.onColumnDragStart=function(e,t){this.reorderIconWidth=h.DomHandler.getHiddenElementOuterWidth(this.reorderIndicatorUpViewChild.nativeElement),this.reorderIconHeight=h.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=h.DomHandler.getOffset(this.containerViewChild.nativeElement),n=h.DomHandler.getOffset(t);if(this.draggedColumn!=t){var o=h.DomHandler.indexWithinGroup(this.draggedColumn,"preorderablecolumn"),r=h.DomHandler.indexWithinGroup(t,"preorderablecolumn"),l=n.left-i.left,a=(i.top,n.top,n.left+t.offsetWidth/2);this.reorderIndicatorUpViewChild.nativeElement.style.top=n.top-i.top-(this.reorderIconHeight-1)+"px",this.reorderIndicatorDownViewChild.nativeElement.style.top=n.top-i.top+t.offsetHeight+"px",e.pageX>a?(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),r-o==1&&-1===this.dropPosition||r-o==-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 n=h.DomHandler.indexWithinGroup(this.draggedColumn,"preorderablecolumn"),o=h.DomHandler.indexWithinGroup(t,"preorderablecolumn"),r=n!=o;r&&(o-n==1&&-1===this.dropPosition||n-o==1&&1===this.dropPosition)&&(r=!1),r&&o<n&&1===this.dropPosition&&(o+=1),r&&o>n&&-1===this.dropPosition&&(o-=1),r&&(m.ObjectUtils.reorderArray(this.columns,n,o),this.onColReorder.emit({dragIndex:n,dropIndex:o,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 n=h.DomHandler.getOffset(i).top+h.DomHandler.getWindowScrollTop(),o=e.pageY,r=n+h.DomHandler.getOuterHeight(i)/2,l=i.previousElementSibling;o<r?(h.DomHandler.removeClass(i,"p-datatable-dragpoint-bottom"),this.droppedRowIndex=t,l?h.DomHandler.addClass(l,"p-datatable-dragpoint-bottom"):h.DomHandler.addClass(i,"p-datatable-dragpoint-top")):(l?h.DomHandler.removeClass(l,"p-datatable-dragpoint-bottom"):h.DomHandler.addClass(i,"p-datatable-dragpoint-top"),this.droppedRowIndex=t+1,h.DomHandler.addClass(i,"p-datatable-dragpoint-bottom"))}},e.prototype.onRowDragLeave=function(e,t){var i=t.previousElementSibling;i&&h.DomHandler.removeClass(i,"p-datatable-dragpoint-bottom"),h.DomHandler.removeClass(t,"p-datatable-dragpoint-bottom"),h.DomHandler.removeClass(t,"p-datatable-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;m.ObjectUtils.reorderArray(this.value,this.draggedRowIndex,i),this.onRowReorder.emit({dragIndex:this.draggedRowIndex,dropIndex:i})}this.onRowDragLeave(e,t),this.onRowDragEnd(e)},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&&(void 0!==this.first&&(this.first=i.first,this.firstChange.emit(this.first)),void 0!==this.rows&&(this.rows=i.rows,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=[];h.DomHandler.find(this.containerViewChild.nativeElement,".p-datatable-thead > tr:first-child > th").map((function(e){return t.push(h.DomHandler.getOuterWidth(e))})),e.columnWidths=t.join(","),"expand"===this.columnResizeMode&&(e.tableWidth=this.scrollable?h.DomHandler.findSingle(this.containerViewChild.nativeElement,".p-datatable-scrollable-header-table").style.width:h.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=h.DomHandler.find(this.containerViewChild.nativeElement,".p-datatable-scrollable-header-table > colgroup > col"),i=this.virtualScroll?h.DomHandler.find(this.containerViewChild.nativeElement,"cdk-virtual-scroll-viewport table > colgroup > col"):h.DomHandler.find(this.containerViewChild.nativeElement,".p-datatable-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{h.DomHandler.find(this.tableViewChild.nativeElement,".p-datatable-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 n=[];i.map((function(t){var i=e.findColumnByKey(t);i&&n.push(i)})),this.columnOrderStateRestored=!0,this.columns=n}}},e.prototype.findColumnByKey=function(e){var t,i;if(!this.columns)return null;try{for(var n=b(this.columns),o=n.next();!o.done;o=n.next()){var r=o.value;if(r.key===e||r.field===e)return r}}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(t)throw t.error}}},e.prototype.ngOnDestroy=function(){this.unbindDocumentEditListener(),this.editingCell=null,this.initialized=null},e}();S.decorators=[{type:t.Component,args:[{selector:"p-table",template:'\n <div #container [ngStyle]="style" [class]="styleClass" data-scrollselectors=".p-datatable-scrollable-body, .p-datatable-unfrozen-view .p-datatable-scrollable-body"\n [ngClass]="{\'p-datatable p-component\': true,\n \'p-datatable-hoverable-rows\': (rowHover||selectionMode),\n \'p-datatable-auto-layout\': autoLayout,\n \'p-datatable-resizable\': resizableColumns,\n \'p-datatable-resizable-fit\': (resizableColumns && columnResizeMode === \'fit\'),\n \'p-datatable-scrollable\': scrollable,\n \'p-datatable-flex-scrollable\': (scrollable && scrollHeight === \'flex\'),\n \'p-datatable-responsive\': responsive}">\n <div class="p-datatable-loading-overlay p-component-overlay" *ngIf="loading && showLoader">\n <i [class]="\'p-datatable-loading-icon pi-spin \' + loadingIcon"></i>\n </div>\n <div *ngIf="captionTemplate" class="p-datatable-header">\n <ng-container *ngTemplateOutlet="captionTemplate"></ng-container>\n </div>\n <p-paginator [rows]="rows" [first]="first" [totalRecords]="totalRecords" [pageLinkSize]="pageLinks" styleClass="p-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" [showFirstLastIcon]="showFirstLastIcon" [dropdownItemTemplate]="paginatorDropdownItemTemplate" [showCurrentPageReport]="showCurrentPageReport" [showJumpToPageDropdown]="showJumpToPageDropdown" [showPageLinks]="showPageLinks"></p-paginator>\n\n <div class="p-datatable-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="p-datatable-thead">\n <ng-container *ngTemplateOutlet="headerTemplate; context: {$implicit: columns}"></ng-container>\n </thead>\n <tbody class="p-datatable-tbody" [pTableBody]="columns" [pTableBodyTemplate]="bodyTemplate"></tbody>\n <tfoot *ngIf="footerTemplate" class="p-datatable-tfoot">\n <ng-container *ngTemplateOutlet="footerTemplate; context {$implicit: columns}"></ng-container>\n </tfoot>\n </table>\n </div>\n\n <div class="p-datatable-scrollable-wrapper" *ngIf="scrollable">\n <div class="p-datatable-scrollable-view p-datatable-frozen-view" *ngIf="frozenColumns||frozenBodyTemplate" #scrollableFrozenView [pScrollableView]="frozenColumns" [frozen]="true" [ngStyle]="{width: frozenWidth}" [scrollHeight]="scrollHeight"></div>\n <div class="p-datatable-scrollable-view" #scrollableView [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="p-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" [showFirstLastIcon]="showFirstLastIcon" [dropdownItemTemplate]="paginatorDropdownItemTemplate" [showCurrentPageReport]="showCurrentPageReport" [showJumpToPageDropdown]="showJumpToPageDropdown" [showPageLinks]="showPageLinks"></p-paginator>\n\n <div *ngIf="summaryTemplate" class="p-datatable-footer">\n <ng-container *ngTemplateOutlet="summaryTemplate"></ng-container>\n </div>\n\n <div #resizeHelper class="p-column-resizer-helper" style="display:none" *ngIf="resizableColumns"></div>\n <span #reorderIndicatorUp class="pi pi-arrow-down p-datatable-reorder-indicator-up" style="display:none" *ngIf="reorderableColumns"></span>\n <span #reorderIndicatorDown class="pi pi-arrow-up p-datatable-reorder-indicator-down" style="display:none" *ngIf="reorderableColumns"></span>\n </div>\n ',providers:[C],changeDetection:t.ChangeDetectionStrategy.Default,encapsulation:t.ViewEncapsulation.None,styles:[".p-datatable{position:relative}.p-datatable table{border-collapse:collapse;table-layout:fixed;width:100%}.p-datatable .p-sortable-column{-ms-user-select:none;-webkit-user-select:none;cursor:pointer;user-select:none}.p-datatable .p-sortable-column .p-column-title,.p-datatable .p-sortable-column .p-sortable-column-badge,.p-datatable .p-sortable-column .p-sortable-column-icon{vertical-align:middle}.p-datatable .p-sortable-column .p-sortable-column-badge{align-items:center;display:inline-flex;justify-content:center}.p-datatable-auto-layout>.p-datatable-wrapper{overflow-x:auto}.p-datatable-auto-layout>.p-datatable-wrapper>table{table-layout:auto}.p-datatable-hoverable-rows .p-selectable-row{cursor:pointer}.p-datatable-scrollable-wrapper{position:relative}.p-datatable-scrollable-footer,.p-datatable-scrollable-header{overflow:hidden}.p-datatable-scrollable-body{overflow:auto;position:relative}.p-datatable-scrollable-body>table>.p-datatable-tbody>tr:first-child>td{border-top:0}.p-datatable-virtual-table{position:absolute}.p-datatable-frozen-view .p-datatable-scrollable-body{overflow:hidden}.p-datatable-frozen-view>.p-datatable-scrollable-body>table>.p-datatable-tbody>tr>td:last-child{border-right:0}.p-datatable-unfrozen-view{position:absolute;top:0}.p-datatable-flex-scrollable,.p-datatable-flex-scrollable .p-datatable-scrollable-view,.p-datatable-flex-scrollable .p-datatable-scrollable-wrapper{display:flex;flex:1;flex-direction:column;height:100%}.p-datatable-flex-scrollable .p-datatable-scrollable-body,.p-datatable-flex-scrollable .p-datatable-virtual-scrollable-body{flex:1}.p-datatable-resizable>.p-datatable-wrapper{overflow-x:auto}.p-datatable-resizable .p-datatable-tbody>tr>td,.p-datatable-resizable .p-datatable-tfoot>tr>td,.p-datatable-resizable .p-datatable-thead>tr>th{overflow:hidden;white-space:nowrap}.p-datatable-resizable .p-resizable-column{background-clip:padding-box;position:relative}.p-datatable-resizable-fit .p-resizable-column:last-child .p-column-resizer{display:none}.p-datatable .p-column-resizer{border:1px solid transparent;cursor:col-resize;display:block;height:100%;margin:0;padding:0;position:absolute!important;right:0;top:0;width:.5rem}.p-datatable .p-column-resizer-helper{display:none;position:absolute;width:1px;z-index:10}.p-datatable .p-row-editor-cancel,.p-datatable .p-row-editor-init,.p-datatable .p-row-editor-save,.p-datatable .p-row-toggler{align-items:center;display:inline-flex;justify-content:center;overflow:hidden;position:relative}.p-datatable-reorder-indicator-down,.p-datatable-reorder-indicator-up{display:none;position:absolute}.p-datatable-reorderablerow-handle,[pReorderableColumn]{cursor:move}.p-datatable .p-datatable-loading-overlay{align-items:center;display:flex;justify-content:center;position:absolute;z-index:2}.p-column-filter-row{align-items:center;display:flex;width:100%}.p-column-filter-menu{display:inline-flex}.p-column-filter-row p-columnfilterformelement{flex:1 1 auto;width:1%}.p-column-filter-clear-button,.p-column-filter-menu-button{align-items:center;cursor:pointer;display:inline-flex;justify-content:center;overflow:hidden;position:relative;text-decoration:none}.p-column-filter-overlay{position:absolute}.p-column-filter-row-items{list-style:none;margin:0;padding:0}.p-column-filter-row-item{cursor:pointer}.p-column-filter-add-button,.p-column-filter-remove-button{justify-content:center}.p-column-filter-add-button .p-butto