UNPKG

ornamentum

Version:
1 lines 109 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("rxjs"),require("rxjs/operators"),require("@angular/common/http"),require("rxjs/webSocket")):"function"==typeof define&&define.amd?define("ornamentum",["exports","@angular/core","@angular/common","@angular/forms","rxjs","rxjs/operators","@angular/common/http","rxjs/webSocket"],t):t((e=e||self).ornamentum={},e.ng.core,e.ng.common,e.ng.forms,e.Rx,e.rxjs.operators,e.ng.common.http,e.rxjs.webSocket)}(this,function(e,t,n,i,o,r,a,c){"use strict";var s=function(){return(s=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function l(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function p(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function d(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(p(arguments[t]));return e}var u=new t.InjectionToken("dataTableConfig"),h=function(){function e(e){this.dataTableConfig=e,this.persistTableState=!1,this.storageMode="session",this.multiColumnSortable=!1,this.showHeader=!1,this.title="",this.width=void 0,this.minContentHeight=200,this.minContentWidth=void 0,this.contentHeight=void 0,this.pageable=!1,this.loadOnScroll=!1,this.loadViewDistanceRatio=1,this.showIndexColumn=!1,this.indexColumnTitle="#",this.rowSelectable=!1,this.selectMode="single",this.showRowSelectCheckbox=!0,this.showRowSelectAllCheckbox=!1,this.showSubstituteRows=!1,this.expandableRows=!1,this.selectOnRowClick=!1,this.expandOnRowClick=!1,this.autoFetch=!0,this.showLoadingSpinner=!0,this.selectTrackBy="id",this.filterDebounceTime=500,this.filterDebounce=!0,this.showRefreshButton=!1,this.showColumnSelector=!1,this.columnSelectorWidth=240,this.expanderColumnWidth=30,this.indexColumnWidth=30,this.selectionColumnWidth=30,this.showRowExpandLoadingSpinner=!1,this.offset=0,this.limit=10,this.maxLimit=100,this.stateKeyPrefix="grid_state_",this.baseTranslations={noDataMessage:{header:"Whoops!",body:"No data to display. Added data will appear here."},pagination:{limit:"Limit:",rangeKey:"Results:",rangeSeparator:"of",nextTooltip:"Next",previousTooltip:"Previous",lastTooltip:"Last",firstTooltip:"First"},columnSelector:{header:"Show/Hide Column"},dropdownFilter:{noDataMessage:"No Results Available",filterPlaceholder:"Search",selectedOptionWrapPlaceholder:"Options",selectPlaceholder:"Select"}},this.sortable=!1,this.sortOrder="",this.filterable=!1,this.filterPlaceholder="Search",this.columnResizable=!1,this.columnVisible=!0,this.showDropdownFilter=!1,this.showFilterClearButton=!0,this.dropdownFilterMenuPosition="bottom-left",this.dropdownFilterSelectMode="multi",this.dropdownFilterSearchable=!0,this.dropdownFilterSearchDebounceTime=500,this.dropdownFilterSearchDebounce=!0,this.dropdownFilterWrapDisplaySelectLimit=1,this.dropdownFilterGroupByField=void 0,this.dropdownFilterShowSelectedOptionRemoveButton=!1,this.dropdownFilterShowClearSelectionButton=!0,this.dropdownFilterMenuWidth=320,this.dropdownFilterMenuHeight=250,this.dropdownFilterMultiSelectOptionMaxWidth=135,this.dropdownFilterCloseMenuOnSelect=!0,this.dropdownFilterDynamicDimensionCalculation=!0,this.dropdownFilterDynamicWidthRatio=1.25,this.dropdownFilterDynamicHeightRatio=1.25,e&&Object.assign(this,e)}return Object.defineProperty(e.prototype,"translations",{get:function(){return this.baseTranslations},set:function(e){var t,n;if(e)try{for(var i=l(Object.entries(e)),o=i.next();!o.done;o=i.next()){var r=p(o.value,2),a=r[0],c=r[1];this.baseTranslations[a]=s({},this.baseTranslations[a],c)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"showRowSelectCheckboxColumn",{get:function(){return this.rowSelectable&&this.showRowSelectCheckbox},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[u]}]}]},e}();var f=function(){function e(){this.allRowSelectChangeStream=new t.EventEmitter,this.dataFetchStream=new t.EventEmitter,this.headerClickStream=new t.EventEmitter,this.rowBindStream=new t.EventEmitter,this.rowClickStream=new t.EventEmitter,this.rowDoubleClickStream=new t.EventEmitter,this.rowSelectChangeStream=new t.EventEmitter,this.cellBindStream=new t.EventEmitter,this.cellClickStream=new t.EventEmitter,this.initStream=new t.EventEmitter,this.dataBoundStream=new t.EventEmitter,this.columnBind=new t.EventEmitter,this.fetchFilterOptionsStream=new o.ReplaySubject(1),this.staticDataSourceStream=new o.ReplaySubject(1)}return e.decorators=[{type:t.Injectable}],e}();var g=function(){function e(){this.allRowSelected=!1,this.selectedRows=[],this.dataRows=[],this.dataLoading=!0,this.substituteRows=[],this.heardReload=!1,this.currentSortPriority=0,this.onDynamicRowSpanExtract=function(){return 1}}return Object.defineProperty(e.prototype,"showNoDataOverlay",{get:function(){return!this.dataRows.length&&!this.dataLoading},enumerable:!0,configurable:!0}),e.prototype.getUniqueId=function(e,t){return this.id+"-dt-"+e+"-"+t},e.decorators=[{type:t.Injectable}],e}();var S=function(){function e(e,t,n){this.dataTableConfigService=e,this.eventStateService=t,this.dataStateService=n,this.currentSortOrder="",this.baseSortOrder="",this.showInColumnSelector=!0,this.sortable=e.sortable,this.currentSortOrder=e.sortOrder,this.filterable=e.filterable,this.filterPlaceholder=e.filterPlaceholder,this.resizable=e.columnResizable,this.visible=e.columnVisible,this.showDropdownFilter=e.showDropdownFilter,this.showFilterClearButton=e.showFilterClearButton,this.dropdownFilterMenuPosition=e.dropdownFilterMenuPosition,this.dropdownFilterSelectMode=e.dropdownFilterSelectMode,this.dropdownFilterSearchable=e.dropdownFilterSearchable,this.dropdownFilterSearchDebounceTime=e.dropdownFilterSearchDebounceTime,this.dropdownFilterSearchDebounce=e.dropdownFilterSearchDebounce,this.dropdownFilterWrapDisplaySelectLimit=e.dropdownFilterWrapDisplaySelectLimit,this.dropdownFilterGroupByField=e.dropdownFilterGroupByField,this.dropdownFilterShowSelectedOptionRemoveButton=e.dropdownFilterShowSelectedOptionRemoveButton,this.dropdownFilterShowClearSelectionButton=e.dropdownFilterShowClearSelectionButton,this.dropdownFilterMenuWidth=e.dropdownFilterMenuWidth,this.dropdownFilterMenuHeight=e.dropdownFilterMenuHeight,this.dropdownFilterMultiSelectOptionMaxWidth=e.dropdownFilterMultiSelectOptionMaxWidth,this.dropdownFilterCloseMenuOnSelect=e.dropdownFilterCloseMenuOnSelect,this.dropdownFilterDynamicDimensionCalculation=e.dropdownFilterDynamicDimensionCalculation,this.dropdownFilterDynamicWidthRatio=e.dropdownFilterDynamicWidthRatio,this.dropdownFilterDynamicHeightRatio=e.dropdownFilterDynamicHeightRatio}return Object.defineProperty(e.prototype,"sortOrder",{get:function(){return this.currentSortOrder},set:function(e){this.currentSortOrder=e,this.baseSortOrder=e},enumerable:!0,configurable:!0}),e.prototype.resetSortOrder=function(){this.currentSortOrder=this.baseSortOrder},e.prototype.getCellColor=function(e){if(void 0!==this.onCellColorRender)return this.onCellColorRender(e,this)},e.prototype.getNewSortOrder=function(){var e;switch(this.sortOrder){case"asc":e="desc";break;case"desc":e="";break;case"":e="asc"}return e},e.prototype.getSortIconClass=function(){return{"sort-asc":"asc"===this.sortOrder,"sort-dsc":"desc"===this.sortOrder,"sort-reset":!this.sortOrder}},e.prototype.ngOnDestroy=function(){this.filterValueExtractorSubscription&&this.filterValueExtractorSubscription.unsubscribe()},e.prototype.ngOnInit=function(){if(!this.cssClass&&this.field&&(/^[a-zA-Z0-9_]+$/.test(this.field)?this.cssClass="column-"+this.field:this.cssClass="column-"+this.field.replace(/[^a-zA-Z0-9_]/g,"")),this.eventStateService.columnBind.emit(this),this.dataTableConfigService.multiColumnSortable&&this.sortable){if(""===this.sortOrder){if(void 0!==this.sortPriority)throw Error("[sortPriority] should be ignored when multi column sorting is enabled with natural sort order.")}else if(void 0===this.sortPriority)throw Error("[sortPriority] is required when multi column sorting is enabled with an explicit sort order.");if(this.sortPriority<1)throw Error("[sortPriority] must be greater than 1.");this.dataStateService.currentSortPriority<this.sortPriority&&(this.dataStateService.currentSortPriority=this.sortPriority)}},e.decorators=[{type:t.Component,args:[{selector:"ng-data-table-column",template:""}]}],e.ctorParameters=function(){return[{type:h},{type:f},{type:g}]},e.propDecorators={cellTemplate:[{type:t.ContentChild,args:["ngDataTableCell",{static:!0}]}],headerTemplate:[{type:t.ContentChild,args:["ngDataTableHeader",{static:!0}]}],filterTemplate:[{type:t.ContentChild,args:["ngDataTableFilter",{static:!0}]}],dropdownFilterLoadingSpinnerTemplate:[{type:t.ContentChild,args:["ngFilterDropdownLoadingSpinner",{static:!0}]}],dropdownFilterOptionTemplate:[{type:t.ContentChild,args:["ngFilterDropdownOption",{static:!0}]}],dropdownFilterOptionGroupHeaderTemplate:[{type:t.ContentChild,args:["ngFilterDropdownOptionGroupHeader",{static:!0}]}],filterExpression:[{type:t.Input}],filterFieldMapper:[{type:t.Input}],onCellColorRender:[{type:t.Input}],title:[{type:t.Input}],sortable:[{type:t.Input}],sortPriority:[{type:t.Input}],sortOrder:[{type:t.Input}],filterable:[{type:t.Input}],resizable:[{type:t.Input}],field:[{type:t.Input}],filterField:[{type:t.Input}],sortField:[{type:t.Input}],cssClass:[{type:t.Input}],width:[{type:t.Input}],visible:[{type:t.Input}],showInColumnSelector:[{type:t.Input}],filterPlaceholder:[{type:t.Input}],filter:[{type:t.Input}],showFilterClearButton:[{type:t.Input}],resizeMinLimit:[{type:t.Input}],showDropdownFilter:[{type:t.Input}],dropdownFilterMenuPosition:[{type:t.Input}],dropdownFilterSelectMode:[{type:t.Input}],dropdownFilterSearchable:[{type:t.Input}],dropdownFilterSearchDebounceTime:[{type:t.Input}],dropdownFilterSearchDebounce:[{type:t.Input}],dropDownFilterShowOptionSelectCheckbox:[{type:t.Input}],dropdownFilterWrapDisplaySelectLimit:[{type:t.Input}],dropdownFilterGroupByField:[{type:t.Input}],dropdownFilterShowSelectedOptionRemoveButton:[{type:t.Input}],dropdownFilterShowClearSelectionButton:[{type:t.Input}],dropdownFilterMenuWidth:[{type:t.Input}],dropdownFilterMenuHeight:[{type:t.Input}],dropdownFilterMultiSelectOptionMaxWidth:[{type:t.Input}],dropdownFilterCloseMenuOnSelect:[{type:t.Input}],dropdownFilterDynamicDimensionCalculation:[{type:t.Input}],dropdownFilterDynamicWidthRatio:[{type:t.Input}],dropdownFilterDynamicHeightRatio:[{type:t.Input}]},e}();var m={HARD_RELOAD:0,SOFT_RELOAD:1,SOFT_LOAD:2};m[m.HARD_RELOAD]="HARD_RELOAD",m[m.SOFT_RELOAD]="SOFT_RELOAD",m[m.SOFT_LOAD]="SOFT_LOAD";var b=function(){function e(e,n){this.config=e,this.eventStateService=n,this.columnFilterStream=new o.Subject,this.customFilterStream=new t.EventEmitter}return e.prototype.ngOnInit=function(){this.initCustomFilterEvent(),this.initDebounceDefaultFilterEvent()},e.prototype.ngOnDestroy=function(){this.customFilterSubscription&&this.customFilterSubscription.unsubscribe(),this.columnFilterSubscription&&this.columnFilterSubscription.unsubscribe()},e.prototype.initCustomFilterEvent=function(){var e=this;this.customFilterSubscription=this.customFilterStream.subscribe(function(t){t.column.filter=t.filter,e.onFilter()})},e.prototype.initDebounceDefaultFilterEvent=function(){var e=this;this.columnFilterSubscription=this.columnFilterStream.pipe(r.debounceTime(this.config.filterDebounceTime)).subscribe(function(){e.eventStateService.dataFetchStream.next(m.SOFT_LOAD)})},e.prototype.onFilter=function(){this.config.filterDebounce?this.columnFilterStream.next():this.eventStateService.dataFetchStream.next(m.SOFT_LOAD)},e.decorators=[{type:t.Component,args:[{exportAs:"ngDataTableColumnFilterHeader",selector:"[ngDataTableColumnFilterHeader]",template:'<th *ngIf="config.expandableRows" class="ng-data-table-expand-column-header"></th>\n<th *ngIf="config.showIndexColumn" class="ng-data-table-index-column-header"></th>\n<th *ngIf="config.showRowSelectCheckboxColumn" class="ng-data-table-select-column-header"></th>\n<ng-container *ngFor="let column of columns; index as i;">\n <th *ngIf="column.visible">\n <ng-data-table-column-filter-template [column]="column"\n [customFilterStream]="customFilterStream"\n [index]="i"\n (filter)="onFilter()">\n </ng-data-table-column-filter-template>\n </th>\n</ng-container>\n'}]}],e.ctorParameters=function(){return[{type:h},{type:f}]},e.propDecorators={columns:[{type:t.Input}]},e}();var y=function(){function e(){this.scrollPositionStream=new o.Subject}return e.decorators=[{type:t.Injectable}],e}();var v=function(){function e(e,n,i,r){this.config=e,this.dataStateService=n,this.eventStateService=i,this.scrollPositionService=r,this.filter=new t.EventEmitter,this.filterDataStream=new o.Subject}return e.prototype.ngOnInit=function(){var e=this;this.column.showDropdownFilter&&(this.scrollPositionStreamSubscription=this.scrollPositionService.scrollPositionStream.subscribe(function(t){t.isHorizontal&&e.filterDropdown.close()}),this.dataStateService.onFilterValueExtract&&(this.fetchFilterOptionsStreamSubscription=this.eventStateService.fetchFilterOptionsStream.pipe(r.switchMap(function(){return e.dataStateService.onFilterValueExtract(e.column)})).subscribe(function(t){setTimeout(function(){return e.filterDataStream.next(t)},0)})))},e.prototype.ngOnDestroy=function(){this.fetchFilterOptionsStreamSubscription&&this.fetchFilterOptionsStreamSubscription.unsubscribe(),this.scrollPositionStreamSubscription&&this.scrollPositionStreamSubscription.unsubscribe(),this.filterDataStream.complete()},e.prototype.onFilterDropdownInit=function(e){this.filterDropdown=e},e.prototype.clearFilter=function(){this.column.filter="",this.filter.emit()},e.decorators=[{type:t.Component,args:[{selector:"ng-data-table-column-filter-template",template:'<ng-container *ngIf="column.filterable">\n <ng-container\n *ngIf="column.filterTemplate"\n [ngTemplateOutlet]="column.filterTemplate"\n [ngTemplateOutletContext]="{ column: column, filter: customFilterStream }"\n >\n </ng-container>\n <ng-container *ngIf="!column.filterTemplate">\n <div class="ng-data-table-header-input-box" *ngIf="!column.showDropdownFilter">\n <input\n type="text"\n class="ng-data-table-header-input"\n [(ngModel)]="column.filter"\n [class.ng-data-table-clear-filter]="column.showFilterClearButton"\n (keyup)="filter.emit()"\n [placeholder]="column.filterPlaceholder"\n />\n <span class="ng-data-table-input-group-btn">\n <button\n *ngIf="column.showFilterClearButton"\n [hidden]="!column.filter"\n class="ng-data-table-delete-button"\n type="button"\n (click)="clearFilter()"\n ></button>\n </span>\n </div>\n <ng-dropdown\n *ngIf="column.showDropdownFilter"\n [id]="dataStateService.getUniqueId(\'col\', index)"\n [relativeParentElement]="dataStateService.relativeParentElement"\n [dataSource]="filterDataStream"\n [menuPosition]="column.dropdownFilterMenuPosition"\n [filterable]="column.dropdownFilterSearchable"\n [filterDebounceTime]="column.dropdownFilterSearchDebounceTime"\n [filterDebounce]="column.dropdownFilterSearchDebounce"\n [selectMode]="column.dropdownFilterSelectMode"\n [showSelectedOptionRemoveButton]="column.dropdownFilterShowSelectedOptionRemoveButton"\n [showClearSelectionButton]="column.dropdownFilterShowClearSelectionButton"\n [wrapDisplaySelectLimit]="column.dropdownFilterWrapDisplaySelectLimit"\n [groupByField]="column.dropdownFilterGroupByField"\n [showOptionSelectCheckbox]="column.dropDownFilterShowOptionSelectCheckbox"\n [menuHeight]="column.dropdownFilterMenuHeight"\n [menuWidth]="column.dropdownFilterMenuWidth"\n [multiSelectOptionMaxWidth]="column.dropdownFilterMultiSelectOptionMaxWidth"\n [closeMenuOnSelect]="column.dropdownFilterCloseMenuOnSelect"\n [dynamicDimensionCalculation]="column.dropdownFilterDynamicDimensionCalculation"\n [dynamicWidthRatio]="column.dropdownFilterDynamicWidthRatio"\n [dynamicHeightRatio]="column.dropdownFilterDynamicHeightRatio"\n [loadingSpinnerTemplateRef]="column.dropdownFilterLoadingSpinnerTemplate"\n [optionTemplateRef]="column.dropdownFilterOptionTemplate"\n [optionGroupHeaderTemplateRef]="column.dropdownFilterOptionGroupHeaderTemplate"\n [translations]="config.translations.dropdownFilter"\n [(ngModel)]="column.filter"\n (selectChange)="filter.emit()"\n (init)="onFilterDropdownInit($event)"\n >\n </ng-dropdown>\n </ng-container>\n</ng-container>\n'}]}],e.ctorParameters=function(){return[{type:h},{type:g},{type:f},{type:y}]},e.propDecorators={column:[{type:t.Input}],customFilterStream:[{type:t.Input}],index:[{type:t.Input}],filter:[{type:t.Output}]},e}();var w=/[,[\].]+?/;function O(e,t){return null==e?e:String.prototype.split.call(t,w).filter(Boolean).reduce(function(e,t){if(null!==e&&"object"==typeof e)return e[t]},e)}var C=function(){function e(){this.ngInit=new t.EventEmitter}return e.prototype.ngOnInit=function(){this.ngInit.emit()},e.decorators=[{type:t.Directive,args:[{selector:"[ngInit]"}]}],e.propDecorators={ngInit:[{type:t.Output}]},e}();var R=function(){function e(e){this.el=e}return e.prototype.ngOnInit=function(){this.el.nativeElement.focus()},e.decorators=[{type:t.Directive,args:[{selector:"[ngFocus]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e}();var I=function(){function e(){}return e.prototype.transform=function(e){if(void 0!==e)return"string"==typeof e?e:"number"==typeof e?e+"px":void 0},e.decorators=[{type:t.Pipe,args:[{name:"ngPx"}]}],e}(),x=function(){function e(){}return e.decorators=[{type:t.Injectable}],e}(),D=function(){function e(){}return e.prototype.drag=function(e,t){var n=t.move,i=t.up,o=e.pageX,r=e.pageY,a=o,c=r,s=!1,l=function(e){var t=e.pageX-a,i=e.pageY-c;a=e.pageX,c=e.pageY,(t||i)&&(s=!0),n(e,t,i,a,c),e.preventDefault()},p=function(e){a=e.pageX,c=e.pageY,document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",p),i&&i(e,a,c,s)};document.addEventListener("mousemove",l),document.addEventListener("mouseup",p)},e.decorators=[{type:t.Injectable}],e}(),P=function(){function e(){this.setScrollbarWidth()}return e.prototype.setScrollbarWidth=function(){if(void 0===this.scrollbarWidthValue&&this.isBrowser){var e=document.createElement("div");e.style.visibility="hidden",e.style.width="100px",e.style.msOverflowStyle="scrollbar",document.body.appendChild(e);var t=e.offsetWidth;e.style.overflow="scroll";var n=document.createElement("div");n.style.width="100%",e.appendChild(n);var i=n.offsetWidth;e.parentNode.removeChild(e),this.scrollbarWidthValue=t-i}},Object.defineProperty(e.prototype,"scrollbarWidth",{get:function(){return this.scrollbarWidthValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"window",{get:function(){return window},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isBrowser",{get:function(){return"undefined"!=typeof window},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[]},e}();var F=function(){function e(e){this.globalRefService=e,this.globalRefService.isBrowser?this.resize=o.fromEvent(this.globalRefService.window,"resize"):this.resize=new o.Subject}return e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:P}]},e}();var T=function(){function e(e,t,n,i,o){this.componentFactoryResolver=e,this.appRef=t,this.globalRefService=n,this.renderer=i,this.resizeService=o,this.isVisible=!1}return e.prototype.registerClickOutside=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=function(n){t.some(function(e){return e.contains(n.target)})||e.hide()};this.clickListener=this.renderer.listen("document","click",i),this.touchStartListener=this.renderer.listen("document","touchstart",i)},e.prototype.setPosition=function(e,t){var n=this,i=(t.relativeParentElement||e).getBoundingClientRect(),o=e.getBoundingClientRect(),a=0,c=0;t.position.includes("right")&&(a=e.offsetWidth),t.position.includes("bottom")&&(c=e.offsetHeight);var s=this.componentReference.location.nativeElement;s.style.top=o.top-i.top+c+t.floatTop+"px",s.style.left=o.left-i.left+a+t.floatLeft+"px",s.style.position="absolute",s.style.display="block";var l=s.firstElementChild;l&&(t.position.includes("right")&&(l.style.right="0px"),t.position.includes("top")&&(l.style.bottom="0px"),l.style.position="absolute"),this.resizeEventSubscription=this.resizeService.resize.pipe(r.take(1)).subscribe(function(){n.hide()})},e.prototype.show=function(e,t,n,i){if(i=Object.assign({closeOnOutsideClick:!0,floatLeft:0,floatTop:0,position:"bottom-left"},i),this.componentReference)return this.setPosition(t,i),void(this.isVisible=!0);this.componentReference=this.componentFactoryResolver.resolveComponentFactory(e).create(n),i.context&&Object.assign(this.componentReference.instance,i.context),this.appRef.attachView(this.componentReference.hostView);var o=this.componentReference.hostView.rootNodes[0];return this.setPosition(t,i),(i.relativeParentElement||t).appendChild(o),this.componentReference.changeDetectorRef.markForCheck(),this.componentReference.changeDetectorRef.detectChanges(),this.isVisible=!0,i.closeOnOutsideClick&&this.registerClickOutside(t,this.componentReference.location.nativeElement),this.componentReference.instance},e.prototype.hide=function(){if(this.componentReference)return this.componentReference.location.nativeElement.style.display="none",this.isVisible=!1,this.componentReference.instance},e.prototype.toggle=function(e,t,n,i){return this.isVisible?this.hide():this.show(e,t,n,i)},e.prototype.dispose=function(){this.resizeEventSubscription&&this.resizeEventSubscription.unsubscribe(),this.componentReference&&(this.appRef.detachView(this.componentReference.hostView),this.componentReference.destroy()),this.clickListener&&(this.clickListener(),this.clickListener=null),this.touchStartListener&&(this.touchStartListener(),this.touchStartListener=null),this.componentReference=null},e}();var k=function(){function e(e,t,n,i){this.componentFactoryResolver=e,this.appRef=t,this.globalRefService=n,this.resizeService=i}return e.prototype.createLoader=function(e){return new T(this.componentFactoryResolver,this.appRef,this.globalRefService,e,this.resizeService)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:t.ComponentFactoryResolver},{type:t.ApplicationRef},{type:P},{type:F}]},e}();var E=function(){function e(){}return e.idPatternValidatorExpression=new RegExp("^[A-Za-z]+[\\w\\-]*$"),e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e}();var j=[C,R],M=[I],B=[D,P,k,F,E],L=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[x]}},e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:d(j,M),providers:d(B),exports:d(j,M)}]}],e}(),W=function(){function e(e,t,n,i){this.dragAndDropService=e,this.eventStateService=t,this.dataStateService=n,this.config=i,this.resizeInProgress=!1}return e.prototype.onHeaderClick=function(e,t){this.resizeInProgress?this.resizeInProgress=!1:(this.sortData(e),this.eventStateService.headerClickStream.emit({column:e,event:t}))},e.prototype.sortData=function(e){if(e.sortable){var t=e.sortOrder;if(e.sortOrder)e.sortOrder=e.getNewSortOrder();else{if(!this.config.multiColumnSortable)this.columns.filter(function(e){return e.sortable}).forEach(function(t){t!==e&&(t.sortOrder="")});e.sortOrder="asc"}if(this.config.multiColumnSortable)if(""===e.sortOrder)this.columns.filter(function(e){return e.sortable}).forEach(function(t){t!==e&&t.sortPriority>e.sortPriority&&--t.sortPriority}),e.sortPriority=void 0,--this.dataStateService.currentSortPriority;else t||(e.sortPriority=++this.dataStateService.currentSortPriority);this.eventStateService.dataFetchStream.next(m.SOFT_LOAD)}},e.prototype.setColumnWidth=function(e,t){t.actualWidth=e},e.prototype.onColumnResize=function(e,t,n){var i=this;this.resizeInProgress=!0,this.dragAndDropService.drag(e,{move:function(e,o){var r=n.offsetWidth+o;if(!(void 0!==t.resizeMinLimit&&r<t.resizeMinLimit)){t.actualWidth=r;var a=0;i.columns.forEach(function(e){e.width=e.actualWidth,a+=e.width}),i.dataStateService.tableWidth=a}}})},Object.defineProperty(e.prototype,"allRowSelected",{get:function(){return this.dataStateService.allRowSelected},set:function(e){this.dataStateService.allRowSelected=e,this.allRowSelectedChanged(this.dataStateService.allRowSelected),this.eventStateService.allRowSelectChangeStream.emit(this.dataStateService.allRowSelected)},enumerable:!0,configurable:!0}),e.prototype.allRowSelectedChanged=function(e){var t=this;this.dataStateService.dataRows.forEach(function(n){var i=O(n.item,t.config.selectTrackBy),o=t.dataStateService.selectedRows.indexOf(i);e&&o<0?t.dataStateService.selectedRows.push(i):!e&&o>-1&&t.dataStateService.selectedRows.splice(o,1),n.selected=e}),this.eventStateService.rowSelectChangeStream.emit(this.dataStateService.selectedRows)},Object.defineProperty(e.prototype,"showAllRowSelectCheckbox",{get:function(){return"multi"===this.config.selectMode&&this.config.showRowSelectAllCheckbox},enumerable:!0,configurable:!0}),e.prototype.showSortPriorityLabel=function(e){return!!(this.config.multiColumnSortable&&this.dataStateService.currentSortPriority>1&&e.sortPriority)},e.decorators=[{type:t.Component,args:[{exportAs:"ngDataTableColumnTitleHeader",selector:"[ngDataTableColumnTitleHeader]",template:'<th class="ng-data-table-expand-column-header" *ngIf="config.expandableRows"></th>\n<th class="ng-data-table-index-column-header" *ngIf="config.showIndexColumn">\n <span [textContent]="config.indexColumnTitle"></span>\n</th>\n<th class="ng-data-table-select-column-header" *ngIf="config.showRowSelectCheckboxColumn">\n <div class="ng-data-table-checkbox-container" *ngIf="showAllRowSelectCheckbox">\n <input class="ng-data-table-checkbox-input" type="checkbox"\n [id]="dataStateService.getUniqueId(\'rsa\', 0)" [(ngModel)]="allRowSelected"/>\n <label [for]="dataStateService.getUniqueId(\'rsa\', 0)"></label>\n </div>\n</th>\n<ng-container *ngFor="let column of columns">\n <th class="ng-data-table-column-header"\n #columnHeader\n *ngIf="column.visible"\n (click)="onHeaderClick(column, $event)"\n (ngElementWidth)="setColumnWidth($event, column)"\n [class.sortable]="column.sortable"\n [class.resizable]="column.resizable"\n [ngClass]="column.cssClass">\n <span class="ng-data-table-column-sort-priority" *ngIf="showSortPriorityLabel(column)"><small>{{column.sortPriority}}</small></span>\n <span *ngIf="!column.headerTemplate" [textContent]="column.title" class="ng-data-table-column-header-label"></span>\n <ng-container *ngIf="column.headerTemplate" [ngTemplateOutlet]="column.headerTemplate" [ngTemplateOutletContext]="{ column: column }">\n </ng-container>\n <span class="ng-data-table-column-sort-icon" [hidden]="!column.sortable" [ngClass]="column.getSortIconClass()"></span>\n <span class="ng-data-table-column-resize-handle" *ngIf="column.resizable" (mousedown)="onColumnResize($event, column, columnHeader)"> </span>\n </th>\n</ng-container>\n'}]}],e.ctorParameters=function(){return[{type:D},{type:f},{type:g},{type:h}]},e.propDecorators={columns:[{type:t.Input}]},e}();var H=function(){function e(e,t){this.dataStateService=e,this.config=t}return e.decorators=[{type:t.Component,args:[{selector:"ng-data-table-column-selector",template:'<div class="ng-data-table-column-selector-wrapper" [style.width]="width | ngPx">\n <div class="ng-data-table-column-selector-box-heading">{{ config.translations.columnSelector.header }}</div>\n <div class="ng-data-table-column-selector-box">\n <ng-container *ngFor="let column of columns; index as i;">\n <div class="ng-data-table-column-selector-column ng-data-table-column-selector-checkbox" *ngIf="column.showInColumnSelector">\n <div class="ng-data-table-checkbox-container">\n <input class="ng-data-table-checkbox-input" type="checkbox"\n [id]="dataStateService.getUniqueId(\'cs\', i)" [(ngModel)]="column.visible"/>\n <label [for]="dataStateService.getUniqueId(\'cs\', i)"><span [textContent]="column.title"></span></label>\n </div>\n </div>\n </ng-container>\n </div>\n</div>\n'}]}],e.ctorParameters=function(){return[{type:g},{type:h}]},e.propDecorators={columns:[{type:t.Input}],width:[{type:t.Input}]},e}();var A=function(){function e(e,t,n,i,o,r){this.componentLoaderFactory=e,this.injector=t,this.eventStateService=n,this.renderer=i,this.dataStateService=o,this.config=r,this.componentLoader=this.componentLoaderFactory.createLoader(this.renderer)}return e.prototype.toggleColumnSelector=function(e){this.componentLoader.toggle(H,e,this.injector,{context:{columns:this.columns,width:this.config.columnSelectorWidth},position:"bottom-right"})},e.prototype.onReload=function(){this.eventStateService.dataFetchStream.next(m.HARD_RELOAD)},e.prototype.ngOnDestroy=function(){this.componentLoader.dispose()},e.decorators=[{type:t.Component,args:[{selector:"ng-data-table-header",template:'<div class="ng-data-table-top-header-container" #header>\n <h4 class="ng-data-table-top-header-title" [textContent]="config.title"></h4>\n <div class="ng-data-table-top-header-button-container">\n <button\n title="Refresh"\n type="button"\n class="ng-data-table-action-button ng-data-table-refresh-button"\n (click)="onReload()"\n *ngIf="config.showRefreshButton"\n [disabled]="dataStateService.dataLoading"></button>\n <button\n title="Select Column"\n type="button"\n class="ng-data-table-action-button ng-data-table-column-selector-button"\n (click)="toggleColumnSelector(header)"\n *ngIf="config.showColumnSelector"></button>\n </div>\n</div>\n'}]}],e.ctorParameters=function(){return[{type:k},{type:t.Injector},{type:f},{type:t.Renderer2},{type:g},{type:h}]},e.propDecorators={columns:[{type:t.Input}]},e}();var V=function(){function e(e){this.config=e}return e.decorators=[{type:t.Component,args:[{exportAs:"ngDataTableColGroup",selector:"[ngDataTableColGroup]",template:'<col *ngIf="config.expandableRows" [style.width]="config.expanderColumnWidth | ngPx" />\n<col *ngIf="config.showIndexColumn" [style.width]="config.indexColumnWidth | ngPx" />\n<col *ngIf="config.showRowSelectCheckboxColumn" [style.width]="config.selectionColumnWidth | ngPx" />\n<ng-container *ngFor="let column of columns">\n <col [style.width]="column.width | ngPx" *ngIf="column.visible" />\n</ng-container>\n'}]}],e.ctorParameters=function(){return[{type:h}]},e.propDecorators={columns:[{type:t.Input}]},e}();var q=function(){function e(e,t,n,i){this.config=e,this.dataStateService=t,this.eventStateService=n,this.resizeService=i,this.isMobile=!1}return e.prototype.setMobileModeState=function(){this.isMobile=this.paginationContainer.nativeElement.clientWidth<767},e.prototype.firstPageClick=function(){this.config.offset=0,this.eventStateService.dataFetchStream.emit(m.SOFT_LOAD)},e.prototype.previousPageClick=function(){this.config.offset=this.config.offset-Math.min(this.config.limit,this.config.offset),this.eventStateService.dataFetchStream.emit(m.SOFT_LOAD)},e.prototype.nextPageClick=function(){this.config.offset=this.config.offset+this.config.limit,this.eventStateService.dataFetchStream.emit(m.SOFT_LOAD)},e.prototype.lastPageClick=function(){this.config.offset=(this.maxPage-1)*this.config.limit,this.eventStateService.dataFetchStream.emit(m.SOFT_LOAD)},Object.defineProperty(e.prototype,"maxPage",{get:function(){return Math.ceil(this.dataStateService.itemCount/this.config.limit)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return Math.floor(this.config.offset/this.config.limit)+1},enumerable:!0,configurable:!0}),e.prototype.isInvalidLimit=function(e){var t=Number(e.value);return""===e.value||t>this.config.maxLimit||t<1},e.prototype.onPageSizeChange=function(e){if(this.isInvalidLimit(e))e.value=String(this.config.limit);else{var t=Number(e.value);this.config.limit!==t&&(this.config.offset=0,this.config.limit=t,this.eventStateService.dataFetchStream.emit(m.SOFT_LOAD))}},e.prototype.onPageSizeRevert=function(e){e.value=String(this.config.limit)},e.prototype.isInvalidPageIndex=function(e){var t=Number(e.value);return""===e.value||t>this.maxPage||t<1},e.prototype.onPageIndexChange=function(e){if(this.isInvalidPageIndex(e))e.value=String(this.page);else{var t=Number(e.value);this.page!==t&&(this.config.offset=(t-1)*this.config.limit,this.eventStateService.dataFetchStream.emit(m.SOFT_LOAD))}},e.prototype.onPageIndexRevert=function(e){e.value=String(this.page)},Object.defineProperty(e.prototype,"hasPrevious",{get:function(){return this.config.offset<=0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasNext",{get:function(){return this.config.offset+this.config.limit>=this.dataStateService.itemCount},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"startRowIndex",{get:function(){return this.config.offset+1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"endRowIndex",{get:function(){return Math.min(this.config.offset+this.config.limit,this.dataStateService.itemCount)},enumerable:!0,configurable:!0}),e.prototype.preventInvalidKeyPress=function(e){e.key>="0"&&e.key<="9"||"ArrowLeft"===e.key||"ArrowRight"===e.key||"Delete"===e.key||"Backspace"===e.key||"Escape"===e.key||"Enter"===e.key||e.preventDefault()},e.prototype.ngOnInit=function(){var e=this;this.setMobileModeState(),this.resizeService.resize.pipe(r.debounceTime(200)).subscribe(function(){e.setMobileModeState()})},e.decorators=[{type:t.Component,args:[{selector:"ng-data-table-pagination",template:'<div class="ng-data-table-pagination-container" #paginationContainer>\n <div class="ng-data-table-pagination-range" [hidden]="isMobile">\n {{ config.translations.pagination.rangeKey }} <span [textContent]="startRowIndex"></span>\n -<span [textContent]="endRowIndex"></span>\n {{ config.translations.pagination.rangeSeparator }}\n <span [textContent]="dataStateService.itemCount"></span>\n </div>\n <div class="ng-data-table-pagination-controllers" [class.sm-controllers]="isMobile">\n <div class="ng-data-table-pagination-limit">\n <div class="ng-data-table-pagination-input-container">\n <label class="ng-data-table-pagination-input-label">{{ config.translations.pagination.limit }}</label>\n <input\n #limitInput\n type="number"\n class="ng-data-table-pagination-input"\n min="1"\n step="1"\n [attr.max]="config.maxLimit"\n [class.ng-data-table-input-error]="isInvalidLimit(limitInput)"\n [ngModel]="config.limit"\n required\n (keypress)="preventInvalidKeyPress($event)"\n (keyup.enter)="onPageSizeChange(limitInput)"\n (keyup.esc)="onPageSizeRevert(limitInput)"\n />\n </div>\n </div>\n <div class="ng-data-table-pagination-pages">\n <button\n [disabled]="hasPrevious"\n (click)="firstPageClick()"\n [title]="config.translations.pagination.firstTooltip"\n class="ng-data-table-action-button ng-data-table-pagination-firstpage"\n ></button>\n <button\n [disabled]="hasPrevious"\n (click)="previousPageClick()"\n [title]="config.translations.pagination.previousTooltip"\n class="ng-data-table-action-button ng-data-table-pagination-prevpage"\n ></button>\n <div class="ng-data-table-pagination-page">\n <div class="ng-data-table-pagination-input-container">\n <input\n #pageInput\n type="number"\n class="ng-data-table-pagination-input"\n min="1"\n step="1"\n [attr.max]="maxPage"\n [class.ng-data-table-input-error]="isInvalidPageIndex(pageInput)"\n [ngModel]="page"\n required\n (keypress)="preventInvalidKeyPress($event)"\n (keyup.enter)="onPageIndexChange(pageInput)"\n (keyup.esc)="onPageIndexRevert(pageInput)"\n />\n <div class="ng-data-table-pagination-input-label">\n <span>/ </span>\n <span [textContent]="maxPage"></span>\n </div>\n </div>\n </div>\n <button\n [disabled]="hasNext"\n (click)="nextPageClick()"\n [title]="config.translations.pagination.nextTooltip"\n class="ng-data-table-action-button ng-data-table-pagination-nextpage"\n ></button>\n <button\n [disabled]="hasNext"\n (click)="lastPageClick()"\n [title]="config.translations.pagination.lastTooltip"\n class="ng-data-table-action-button ng-data-table-pagination-lastpage"\n ></button>\n </div>\n </div>\n</div>\n'}]}],e.ctorParameters=function(){return[{type:h},{type:g},{type:f},{type:F}]},e.propDecorators={paginationContainer:[{type:t.ViewChild,args:["paginationContainer",{static:!0}]}]},e}();var z=function(){function e(e,t){this.globalRefService=e,this.config=t}return Object.defineProperty(e.prototype,"storageMode",{set:function(e){this.globalRefService.isBrowser&&(this.storage="local"===e?this.globalRefService.window.localStorage:this.globalRefService.window.sessionStorage)},enumerable:!0,configurable:!0}),e.prototype.setState=function(e,t,n){if(void 0===n&&(n="v1"),this.globalRefService.isBrowser){var i={ver:n,val:t};this.storage.setItem(""+this.config.stateKeyPrefix+e,JSON.stringify(i))}},e.prototype.getState=function(e,t){if(void 0===t&&(t="v1"),this.globalRefService.isBrowser){var n=JSON.parse(this.storage.getItem(""+this.config.stateKeyPrefix+e));if(n&&n.ver===t)return n.val}return null},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:P},{type:h}]},e}();var _=function(){function e(){}return e.prototype.setDataSource=function(e){var t=this;this.dispose(),this.itemDataStream&&!this.itemDataStream.closed&&this.itemDataStream.complete(),this.itemDataStream=new o.ReplaySubject(1),this.dataSourceSubscription=e.subscribe(function(e){t.itemDataStream.next(e)})},e.prototype.query=function(e){return this.itemDataStream.pipe(r.switchMap(function(t){var n,i,r,a=t.length,c=t.slice();if(e.fields.length){var s=e.fields.filter(function(e){return e.filterable});s.length&&(a=(c=t.filter(function(e){return s.every(function(t){if(t.filterExpression)return t.filterExpression(e,t.field,t.filterValue);if(void 0===t.filterValue||""===t.filterValue)return!0;var n=O(e,t.field);if(void 0===n)return!0;if(Array.isArray(t.filterValue))return 0===t.filterValue.length||t.filterValue.includes(n);var i=String(n).toLowerCase(),o=String(t.filterValue).toLowerCase();return i.includes(o)})})).length);var l=e.fields.filter(function(e){return e.sortable&&""!==e.sortOrder});if(l.length){var p=l;l.length>1&&(p=l.concat().sort(function(e,t){return e.sortPriority-t.sortPriority}));var d=p.reduce(function(e,t){return e&&(e.fields.push(t.field),e.orders.push(t.sortOrder)),e},{fields:[],orders:[]});n=c,i=d.fields,r=d.orders,console.log(i),c=n.concat().sort(function(e,t){for(var n=0;n<i.length;n++){var o=i[n],a=r[n];if(e[o]>t[o])return"asc"===a?1:-1;if(e[o]<t[o])return"asc"===a?-1:1}return 0})}}if(void 0!==e.offset){var u=e.offset+1>c.length?0:e.offset;c=void 0===e.limit?c.slice(u,c.length):c.slice(u,u+e.limit)}return o.of({items:c,count:a})}))},e.prototype.extractFilterOptions=function(e){return this.itemDataStream.pipe(r.switchMap(function(t){var n=t.reduce(function(t,n,i){if(e.filterFieldMapper)return t.concat(e.filterFieldMapper(n,i));var o=O(n,e.filterField||e.field);return t.push({key:o,value:o}),t},[]).filter(function(e,t,n){return n.findIndex(function(t){return t.key===e.key})===t});return o.of(n)}))},e.prototype.dispose=function(){this.dataSourceSubscription&&(this.dataSourceSubscription.unsubscribe(),this.dataSourceSubscription=null),this.itemDataStream&&!this.itemDataStream.closed&&this.itemDataStream.complete()},e.decorators=[{type:t.Injectable}],e}();var N=function(){function e(e,t,n,i,o,r,a,c,s){this.dragAndDropService=e,this.dataTableStateService=t,this.globalRefService=n,this.eventStateService=i,this.dataTableResourceService=o,this.zone=r,this.dataStateService=a,this.scrollPositionService=c,this.config=s,this.storageMode=s.storageMode,this.headerClick=this.eventStateService.headerClickStream,this.allRowSelectChange=this.eventStateService.allRowSelectChangeStream,this.rowBind=this.eventStateService.rowBindStream,this.rowClick=this.eventStateService.rowClickStream,this.rowDoubleClick=this.eventStateService.rowDoubleClickStream,this.rowSelectChange=this.eventStateService.rowSelectChangeStream,this.cellBind=this.eventStateService.cellBindStream,this.cellClick=this.eventStateService.cellClickStream,this.init=this.eventStateService.initStream,this.dataBound=this.eventStateService.dataBoundStream,this.columnBind=this.eventStateService.columnBind}return Object.defineProperty(e.prototype,"onDataBind",{set:function(e){this.dataStateService.onDataBind=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onFilterValueExtract",{set:function(e){this.dataStateService.onFilterValueExtract=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onDynamicRowSpanExtract",{set:function(e){this.dataStateService.onDynamicRowSpanExtract=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"items",{set:function(e){e&&this.eventStateService.staticDataSourceStream.next(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataSource",{set:function(e){this.initDataSource(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{set:function(e){if(!E.idPatternValidatorExpression.test(e))throw Error('Invalid [id] input value. Unique identifier parameter only accept string begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_").');this.dataStateService.id=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"persistTableState",{set:function(e){this.config.persistTableState=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"storageMode",{set:function(e){this.dataTableStateService.storageMode=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"multiColumnSortable",{set:function(e){this.config.multiColumnSortable=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"showHeader",{set:function(e){this.config.showHeader=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{set:function(e){this.config.title=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{set:function(e){this.config.width=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minContentHeight",{set:function(e){this.config.minContentHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minContentWidth",{set:function(e){this.config.minContentWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentHeight",{set:function(e){this.config.contentHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageable",{set:function(e){this.config.pageable=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loadOnScroll",{set:function(e){this.config.loadOnScroll=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loadViewDistanceRatio",{set:function(e){this.config.loadViewDistanceRatio=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"showIndexColumn",{set:function(e){this.config.showIndexColumn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"indexColumnTitle",{set:function(e){this.config.indexColumnTitle=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowSelectable",{set:function(e){this.config.rowSelectable=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectMode",{set:function(e){this.config.selectMode=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"showRowSelectCheckbox",{set:function(e){this.config.showRowSelectCheckbox=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"showRowSelectAllCheckbox",{set:function(e){this.config.showRowSelectAllCheckbox=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"showSubstituteRows",{set:function(e){this.config.showSubstituteRows=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"expandableRows",{set:function(e){this.config.expandableRows=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectOnRowClick",{set:function(e){this.config.selectOnRowClick=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"expandOnRowClick",{set:function(e){this.config.expandOnRowClick=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"autoFetch",{set:function(e){this.config.autoFetch=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"showLoadingSpinner",{set:function(e){this.config.showLoadingSpinner=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectTrackBy",{set:function(e){this.config.selectTrackBy=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedRow",{set:function(e){this.dataStateService.selectedRow=e,this.eventStateService.rowSelectChangeStream.emit(this.dataStateService.selectedRow)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedRows",{set:function(e){this.dataStateService.selectedRows=e||[],this.eventStateService.rowSelectChangeStream.emit(this.dataStateService.selectedRows)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"filterDebounceTime",{set:function(e){this.config.filterDebounceTime=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"filterDebounce",{set:function(e){this.config.filterDebounce=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"showRefreshButton",{set:function(e){this.config.showRefreshButton=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"showColumnSelector",{set:function(e){this.config.showColumnSelector=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnSelectorWidth",{set:function(e){this.config.columnSelectorWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"expanderColumnWidth",{set:function(e){this.config.expanderColumnWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"indexColumnWidth",{set:function(e){this.config.indexColumnWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionColumnWidth",{set:function(e){this.config.selectionColumnWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"translations",{set:function(e){this.config.translations=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"showRowExpandLoadingSpinner",{set:function(e){this.config.showRowExpandLoadingSpinner=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"offset",{set:function(e){this.config.offset=e,this.eventStateService.dataFetchStream.next(m.SOFT_LOAD)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"limit",{set:function(e){this.config.limit=e,this.eventStateService.dataFetchStream.next(m.SOFT_LOAD)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return Math.floor(this.config.offset/this.config.limit)+1},set:function(e){this.offset=(e-1)*this.config.limit},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"headerPadding",{get:function(){return this.config.contentHeight?this.globalRefService.scrollbarWidth:0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isLoading",{get:function(){return!(this.config.loadOnScroll&&this.dataStateService.dataRows.length)&&this.config.showLoadingSpinner&&this.dataStateService.dataLoading},enumerable:!0,configurable:!0}),e.prototype.onAfterDataBind=function(e){this.dataStateService.itemCount=e.count,this.setDataRows(e.items),this.dataStateService.heardReload&&(this.eventStateService.fetchFilterOptionsStream.next(!1),this.dataStateService.heardReload=!1),this.dataStateService.dataLoading=!1,this.eventStateService.dataBoundStream.emit()},e.prototype.getSelectedState=function(e){var t=O(e,this.config.selectTrackBy);return void 0!==t&&("multi"===this.config.selectMode?this.dataStateService.selectedRows.indexOf(t)>-1:this.dataStateService.selectedRow===t)},e.prototype.setDataRows=function(e){var t=this,n=e.map(function(e,n){return{dataLoaded:!1,expanded:!1,disabled:!1,color:"",cssClass:"",tooltip:"",index:t.config.loadOnScroll||t.config.pageable?t.config.offset+n+1:n+1,item:e,selected:t.getSelectedState(e)}});if(this.config.loadOnScroll?this.dataStateService.dataRows=d(this.dataStateService.dataRows,n):this.dataStateService.dataRows=