ng2-smart-table
Version:
Angular Smart Table
15 lines (13 loc) • 77.4 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("ng2-completer"),require("rxjs/operators"),require("rxjs"),require("lodash"),require("@angular/common/http")):"function"==typeof define&&define.amd?define("ng2-smart-table",["exports","@angular/core","@angular/common","@angular/forms","ng2-completer","rxjs/operators","rxjs","lodash","@angular/common/http"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["ng2-smart-table"]={},t.ng.core,t.ng.common,t.ng.forms,t.ng2Completer,t.rxjs.operators,t.rxjs,t.lodash,t.ng.common.http)}(this,(function(t,e,n,i,o,r,s,a,c){"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.
***************************************************************************** */var l=function(t,e){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function u(t,e){function n(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}Object.create;function p(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,o,r=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s}function d(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(p(arguments[e]));return t}Object.create;var g=function(){function t(){this.inputClass="",this.mode="inline",this.isInEditing=!1,this.edited=new e.EventEmitter}return t.prototype.onEdited=function(t){this.isNew?this.grid.create(this.grid.getNewRow(),this.createConfirm):this.grid.save(this.row,this.editConfirm)},t}();g.decorators=[{type:e.Component,args:[{selector:"ng2-smart-table-cell",template:'\n <table-cell-view-mode *ngIf="!isInEditing" [cell]="cell"></table-cell-view-mode>\n <table-cell-edit-mode *ngIf="isInEditing" [cell]="cell"\n [inputClass]="inputClass"\n (edited)="onEdited($event)">\n </table-cell-edit-mode>\n '}]}],g.propDecorators={grid:[{type:e.Input}],row:[{type:e.Input}],editConfirm:[{type:e.Input}],createConfirm:[{type:e.Input}],isNew:[{type:e.Input}],cell:[{type:e.Input}],inputClass:[{type:e.Input}],mode:[{type:e.Input}],isInEditing:[{type:e.Input}],edited:[{type:e.Output}]};var h=function(){function t(){this.inputClass="",this.edited=new e.EventEmitter}return t.prototype.onEdited=function(t){return this.edited.next(t),!1},t.prototype.onStopEditing=function(){return this.cell.getRow().isInEditing=!1,!1},t.prototype.onClick=function(t){t.stopPropagation()},t}();h.decorators=[{type:e.Component,args:[{template:""}]}],h.propDecorators={cell:[{type:e.Input}],inputClass:[{type:e.Input}],edited:[{type:e.Output}]};var f=function(t){function e(e){var n=t.call(this)||this;return n.resolver=e,n}return u(e,t),e.prototype.ngOnChanges=function(t){var e=this;if(this.cell&&!this.customComponent){var n=this.resolver.resolveComponentFactory(this.cell.getColumn().editor.component);this.customComponent=this.dynamicTarget.createComponent(n),this.customComponent.instance.cell=this.cell,this.customComponent.instance.inputClass=this.inputClass,this.customComponent.instance.onStopEditing.subscribe((function(){return e.onStopEditing()})),this.customComponent.instance.onEdited.subscribe((function(t){return e.onEdited(t)})),this.customComponent.instance.onClick.subscribe((function(t){return e.onClick(t)}))}},e.prototype.ngOnDestroy=function(){this.customComponent&&this.customComponent.destroy()},e}(h);f.decorators=[{type:e.Component,args:[{selector:"table-cell-custom-editor",template:"\n <ng-template #dynamicTarget></ng-template>\n "}]}],f.ctorParameters=function(){return[{type:e.ComponentFactoryResolver}]},f.propDecorators={dynamicTarget:[{type:e.ViewChild,args:["dynamicTarget",{read:e.ViewContainerRef,static:!0}]}]};var m=function(t){function e(){return t.call(this)||this}return u(e,t),e.prototype.getEditorType=function(){return this.cell.getColumn().editor&&this.cell.getColumn().editor.type},e}(h);m.decorators=[{type:e.Component,args:[{selector:"table-cell-default-editor",template:'<div [ngSwitch]="getEditorType()">\n <select-editor *ngSwitchCase="\'list\'"\n [cell]="cell"\n [inputClass]="inputClass"\n (onClick)="onClick($event)"\n (onEdited)="onEdited($event)"\n (onStopEditing)="onStopEditing()">\n </select-editor>\n\n <textarea-editor *ngSwitchCase="\'textarea\'"\n [cell]="cell"\n [inputClass]="inputClass"\n (onClick)="onClick($event)"\n (onEdited)="onEdited($event)"\n (onStopEditing)="onStopEditing()">\n </textarea-editor>\n\n <checkbox-editor *ngSwitchCase="\'checkbox\'"\n [cell]="cell"\n [inputClass]="inputClass"\n (onClick)="onClick($event)">\n </checkbox-editor>\n\n <completer-editor *ngSwitchCase="\'completer\'"\n [cell]="cell">\n </completer-editor>\n\n <input-editor *ngSwitchDefault\n [cell]="cell"\n [inputClass]="inputClass"\n (onClick)="onClick($event)"\n (onEdited)="onEdited($event)"\n (onStopEditing)="onStopEditing()">\n </input-editor>\n</div>'}]}],m.ctorParameters=function(){return[]};var y=function(){function t(){this.inputClass="",this.edited=new e.EventEmitter}return t.prototype.onEdited=function(t){return this.edited.next(t),!1},t.prototype.getEditorType=function(){return this.cell.getColumn().editor&&this.cell.getColumn().editor.type},t}();y.decorators=[{type:e.Component,args:[{selector:"table-cell-edit-mode",template:'\n <div [ngSwitch]="getEditorType()">\n <table-cell-custom-editor *ngSwitchCase="\'custom\'"\n [cell]="cell"\n [inputClass]="inputClass"\n (edited)="onEdited($event)">\n </table-cell-custom-editor>\n <table-cell-default-editor *ngSwitchDefault\n [cell]="cell"\n [inputClass]="inputClass"\n (edited)="onEdited($event)">\n </table-cell-default-editor>\n </div>\n '}]}],y.propDecorators={cell:[{type:e.Input}],inputClass:[{type:e.Input}],edited:[{type:e.Output}]};var C=function(){this.onStopEditing=new e.EventEmitter,this.onEdited=new e.EventEmitter,this.onClick=new e.EventEmitter};C.decorators=[{type:e.Component,args:[{template:""}]}],C.propDecorators={cell:[{type:e.Input}],inputClass:[{type:e.Input}],onStopEditing:[{type:e.Output}],onEdited:[{type:e.Output}],onClick:[{type:e.Output}]};var w=function(t){function e(){return t.call(this)||this}return u(e,t),e.prototype.onChange=function(t){var e=this.cell.getColumn().getConfig()&&this.cell.getColumn().getConfig().true||!0,n=this.cell.getColumn().getConfig()&&this.cell.getColumn().getConfig().false||!1;this.cell.newValue=t.target.checked?e:n},e}(C);w.decorators=[{type:e.Component,args:[{selector:"checkbox-editor",template:'\n <input [ngClass]="inputClass"\n type="checkbox"\n class="form-control"\n [name]="cell.getId()"\n [disabled]="!cell.isEditable()"\n [checked]="cell.getValue() == (cell.getColumn().getConfig()?.true || true)"\n (click)="onClick.emit($event)"\n (change)="onChange($event)">\n ',styles:[":host input,:host textarea{line-height:normal;padding:.375em .75em;width:100%}"]}]}],w.ctorParameters=function(){return[]};var v=function(t){function e(e){var n=t.call(this)||this;return n.completerService=e,n.completerStr="",n}return u(e,t),e.prototype.ngOnInit=function(){if(this.cell.getColumn().editor&&"completer"===this.cell.getColumn().editor.type){var t=this.cell.getColumn().getConfig().completer;t.dataService=this.completerService.local(t.data,t.searchFields,t.titleField),t.dataService.descriptionField(t.descriptionField)}},e.prototype.onEditedCompleter=function(t){return this.cell.newValue=t.title,!1},e}(C);v.decorators=[{type:e.Component,args:[{selector:"completer-editor",template:'\n <ng2-completer [(ngModel)]="completerStr"\n [dataService]="cell.getColumn().getConfig().completer.dataService"\n [minSearchLength]="cell.getColumn().getConfig().completer.minSearchLength || 0"\n [pause]="cell.getColumn().getConfig().completer.pause || 0"\n [placeholder]="cell.getColumn().getConfig().completer.placeholder || \'Start typing...\'"\n (selected)="onEditedCompleter($event)">\n </ng2-completer>\n '}]}],v.ctorParameters=function(){return[{type:o.CompleterService}]};var S=function(t){function e(){return t.call(this)||this}return u(e,t),e}(C);S.decorators=[{type:e.Component,args:[{selector:"input-editor",template:'\n <input [ngClass]="inputClass"\n class="form-control"\n [(ngModel)]="cell.newValue"\n [name]="cell.getId()"\n [placeholder]="cell.getTitle()"\n [disabled]="!cell.isEditable()"\n (click)="onClick.emit($event)"\n (keydown.enter)="onEdited.emit($event)"\n (keydown.esc)="onStopEditing.emit()">\n ',styles:[":host input,:host textarea{line-height:normal;padding:.375em .75em;width:100%}"]}]}],S.ctorParameters=function(){return[]};var b=function(t){function e(){return t.call(this)||this}return u(e,t),e}(C);b.decorators=[{type:e.Component,args:[{selector:"select-editor",template:'\n <select [ngClass]="inputClass"\n class="form-control"\n [(ngModel)]="cell.newValue"\n [name]="cell.getId()"\n [disabled]="!cell.isEditable()"\n (click)="onClick.emit($event)"\n (keydown.enter)="onEdited.emit($event)"\n (keydown.esc)="onStopEditing.emit()">\n\n <option *ngFor="let option of cell.getColumn().getConfig()?.list" [value]="option.value"\n [selected]="option.value === cell.getValue()">{{ option.title }}\n </option>\n </select>\n '}]}],b.ctorParameters=function(){return[]};var R=function(t){function e(){return t.call(this)||this}return u(e,t),e}(C);R.decorators=[{type:e.Component,args:[{selector:"textarea-editor",template:'\n <textarea [ngClass]="inputClass"\n class="form-control"\n [(ngModel)]="cell.newValue"\n [name]="cell.getId()"\n [disabled]="!cell.isEditable()"\n [placeholder]="cell.getTitle()"\n (click)="onClick.emit($event)"\n (keydown.enter)="onEdited.emit($event)"\n (keydown.esc)="onStopEditing.emit()">\n </textarea>\n ',styles:[":host input,:host textarea{line-height:normal;padding:.375em .75em;width:100%}"]}]}],R.ctorParameters=function(){return[]};var E=function(){function t(t){this.resolver=t}return t.prototype.ngOnInit=function(){this.cell&&!this.customComponent&&(this.createCustomComponent(),this.callOnComponentInit(),this.patchInstance())},t.prototype.ngOnDestroy=function(){this.customComponent&&this.customComponent.destroy()},t.prototype.createCustomComponent=function(){var t=this.resolver.resolveComponentFactory(this.cell.getColumn().renderComponent);this.customComponent=this.dynamicTarget.createComponent(t)},t.prototype.callOnComponentInit=function(){var t=this.cell.getColumn().getOnComponentInitFunction();t&&t(this.customComponent.instance)},t.prototype.patchInstance=function(){Object.assign(this.customComponent.instance,this.getPatch())},t.prototype.getPatch=function(){return{value:this.cell.getValue(),rowData:this.cell.getRow().getData()}},t}();E.decorators=[{type:e.Component,args:[{selector:"custom-view-component",template:"\n <ng-template #dynamicTarget></ng-template>\n "}]}],E.ctorParameters=function(){return[{type:e.ComponentFactoryResolver}]},E.propDecorators={cell:[{type:e.Input}],dynamicTarget:[{type:e.ViewChild,args:["dynamicTarget",{read:e.ViewContainerRef,static:!0}]}]};var P=function(){};P.decorators=[{type:e.Component,args:[{selector:"table-cell-view-mode",changeDetection:e.ChangeDetectionStrategy.OnPush,template:'\n <div [ngSwitch]="cell.getColumn().type">\n <custom-view-component *ngSwitchCase="\'custom\'" [cell]="cell"></custom-view-component>\n <div *ngSwitchCase="\'html\'" [innerHTML]="cell.getValue()"></div>\n <div *ngSwitchDefault>{{ cell.getValue() }}</div>\n </div>\n '}]}],P.propDecorators={cell:[{type:e.Input}]};var I=[g,h,C,f,m,y,w,v,S,b,R,E,P],D=function(){};D.decorators=[{type:e.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,o.Ng2CompleterModule],declarations:d(I),exports:d(I)}]}];var O=function(){function t(){this.inputClass="",this.filter=new e.EventEmitter,this.query=""}return t.prototype.onFilter=function(t){this.source.addFilter({field:this.column.id,search:t,filter:this.column.getFilterFunction()})},t}();O.decorators=[{type:e.Component,args:[{template:""}]}],O.propDecorators={column:[{type:e.Input}],source:[{type:e.Input}],inputClass:[{type:e.Input}],filter:[{type:e.Output}]};var F=function(t){function e(){var e=t.apply(this,d(arguments))||this;return e.query="",e}return u(e,t),e.prototype.ngOnChanges=function(t){var e=this;t.source&&(t.source.firstChange||this.dataChangedSub.unsubscribe(),this.dataChangedSub=this.source.onChanged().subscribe((function(t){var n=e.source.getFilter();n&&n.filters&&0===n.filters.length?e.query="":n&&n.filters&&n.filters.length>0&&n.filters.forEach((function(t,n){t.field==e.column.id&&(e.query=t.search)}))})))},e}(O);F.decorators=[{type:e.Component,args:[{selector:"ng2-smart-table-filter",template:'\n <div class="ng2-smart-filter" *ngIf="column.isFilterable" [ngSwitch]="column.getFilterType()">\n <custom-table-filter *ngSwitchCase="\'custom\'"\n [query]="query"\n [column]="column"\n [source]="source"\n [inputClass]="inputClass"\n (filter)="onFilter($event)">\n </custom-table-filter>\n <default-table-filter *ngSwitchDefault\n [query]="query"\n [column]="column"\n [source]="source"\n [inputClass]="inputClass"\n (filter)="onFilter($event)">\n </default-table-filter>\n </div>\n ',styles:[":host .ng2-smart-filter ::ng-deep input,:host .ng2-smart-filter ::ng-deep select{font-weight:400;line-height:normal;padding:.375em .75em;width:100%}:host .ng2-smart-filter ::ng-deep input[type=search]{box-sizing:inherit}:host .ng2-smart-filter ::ng-deep .completer-dropdown-holder,:host .ng2-smart-filter ::ng-deep a{font-weight:400}"]}]}];var A=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e}(O);A.decorators=[{type:e.Component,args:[{selector:"default-table-filter",template:'\n <ng-container [ngSwitch]="column.getFilterType()">\n <select-filter *ngSwitchCase="\'list\'"\n [query]="query"\n [ngClass]="inputClass"\n [column]="column"\n (filter)="onFilter($event)">\n </select-filter>\n <checkbox-filter *ngSwitchCase="\'checkbox\'"\n [query]="query"\n [ngClass]="inputClass"\n [column]="column"\n (filter)="onFilter($event)">\n </checkbox-filter>\n <completer-filter *ngSwitchCase="\'completer\'"\n [query]="query"\n [ngClass]="inputClass"\n [column]="column"\n (filter)="onFilter($event)">\n </completer-filter>\n <input-filter *ngSwitchDefault\n [query]="query"\n [ngClass]="inputClass"\n [column]="column"\n (filter)="onFilter($event)">\n </input-filter>\n </ng-container>\n '}]}],A.propDecorators={query:[{type:e.Input}]};var x=function(t){function e(e){var n=t.call(this)||this;return n.resolver=e,n}return u(e,t),e.prototype.ngOnChanges=function(t){var e=this;if(this.column&&!this.customComponent){var n=this.resolver.resolveComponentFactory(this.column.filter.component);this.customComponent=this.dynamicTarget.createComponent(n),this.customComponent.instance.query=this.query,this.customComponent.instance.column=this.column,this.customComponent.instance.source=this.source,this.customComponent.instance.inputClass=this.inputClass,this.customComponent.instance.filter.subscribe((function(t){return e.onFilter(t)}))}this.customComponent&&this.customComponent.instance.ngOnChanges(t)},e.prototype.ngOnDestroy=function(){this.customComponent&&this.customComponent.destroy()},e}(O);x.decorators=[{type:e.Component,args:[{selector:"custom-table-filter",template:"<ng-template #dynamicTarget></ng-template>"}]}],x.ctorParameters=function(){return[{type:e.ComponentFactoryResolver}]},x.propDecorators={query:[{type:e.Input}],dynamicTarget:[{type:e.ViewChild,args:["dynamicTarget",{read:e.ViewContainerRef,static:!0}]}]};var k=function(){function t(){this.delay=300,this.filter=new e.EventEmitter}return t.prototype.ngOnDestroy=function(){this.changesSubscription&&this.changesSubscription.unsubscribe()},t.prototype.setFilter=function(){this.filter.emit(this.query)},t}();k.decorators=[{type:e.Component,args:[{template:""}]}],k.propDecorators={query:[{type:e.Input}],inputClass:[{type:e.Input}],column:[{type:e.Input}],filter:[{type:e.Output}]};var T=function(t){function e(){var e=t.call(this)||this;return e.filterActive=!1,e.inputControl=new i.FormControl,e}return u(e,t),e.prototype.ngOnInit=function(){var t=this;this.changesSubscription=this.inputControl.valueChanges.pipe(r.debounceTime(this.delay)).subscribe((function(e){t.filterActive=!0;var n=t.column.getFilterConfig()&&t.column.getFilterConfig().true||!0,i=t.column.getFilterConfig()&&t.column.getFilterConfig().false||!1;t.query=e?n:i,t.setFilter()}))},e.prototype.resetFilter=function(t){t.preventDefault(),this.query="",this.inputControl.setValue(!1,{emitEvent:!1}),this.filterActive=!1,this.setFilter()},e}(k);T.decorators=[{type:e.Component,args:[{selector:"checkbox-filter",template:'\n <input type="checkbox" [formControl]="inputControl" [ngClass]="inputClass" class="form-control">\n <a href="#" *ngIf="filterActive"\n (click)="resetFilter($event)">{{column.getFilterConfig()?.resetText || \'reset\'}}</a>\n '}]}],T.ctorParameters=function(){return[]};var M=function(t){function e(e){var n=t.call(this)||this;return n.completerService=e,n.completerContent=new s.Subject,n}return u(e,t),e.prototype.ngOnInit=function(){var t=this,e=this.column.getFilterConfig().completer;e.dataService=this.completerService.local(e.data,e.searchFields,e.titleField),e.dataService.descriptionField(e.descriptionField),this.changesSubscription=this.completerContent.pipe(r.map((function(t){return t&&t.title||t||""})),r.distinctUntilChanged(),r.debounceTime(this.delay)).subscribe((function(e){t.query=e,t.setFilter()}))},e.prototype.inputTextChanged=function(t){""===t&&this.completerContent.next(t)},e}(k);M.decorators=[{type:e.Component,args:[{selector:"completer-filter",template:'\n <ng2-completer [(ngModel)]="query"\n (ngModelChange)="inputTextChanged($event)"\n [dataService]="column.getFilterConfig().completer.dataService"\n [minSearchLength]="column.getFilterConfig().completer.minSearchLength || 0"\n [pause]="column.getFilterConfig().completer.pause || 0"\n [placeholder]="column.getFilterConfig().completer.placeholder || \'Start typing...\'"\n (selected)="completerContent.next($event)">\n </ng2-completer>\n '}]}],M.ctorParameters=function(){return[{type:o.CompleterService}]};var $=function(t){function e(){var e=t.call(this)||this;return e.inputControl=new i.FormControl,e}return u(e,t),e.prototype.ngOnInit=function(){var t=this;this.query&&this.inputControl.setValue(this.query),this.inputControl.valueChanges.pipe(r.distinctUntilChanged(),r.debounceTime(this.delay)).subscribe((function(e){t.query=t.inputControl.value,t.setFilter()}))},e.prototype.ngOnChanges=function(t){t.query&&this.inputControl.setValue(this.query)},e}(k);$.decorators=[{type:e.Component,args:[{selector:"input-filter",template:'\n <input\n [ngClass]="inputClass"\n [formControl]="inputControl"\n class="form-control"\n type="text"\n placeholder="{{ column.title }}"/>\n '}]}],$.ctorParameters=function(){return[]};var L=function(t){function e(){return t.call(this)||this}return u(e,t),e.prototype.ngOnInit=function(){var t=this;this.inputControl.valueChanges.pipe(r.skip(1),r.distinctUntilChanged(),r.debounceTime(this.delay)).subscribe((function(e){return t.setFilter()}))},e}(k);L.decorators=[{type:e.Component,args:[{selector:"select-filter",template:'\n <select [ngClass]="inputClass"\n class="form-control"\n #inputControl\n [(ngModel)]="query">\n\n <option value="">{{ column.getFilterConfig().selectText }}</option>\n <option *ngFor="let option of column.getFilterConfig().list" [value]="option.value">\n {{ option.title }}\n </option>\n </select>\n '}]}],L.ctorParameters=function(){return[]},L.propDecorators={inputControl:[{type:e.ViewChild,args:["inputControl",{read:i.NgControl,static:!0}]}]};var q=[O,k,F,A,x,T,M,$,L],V=function(){};V.decorators=[{type:e.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,i.ReactiveFormsModule,o.Ng2CompleterModule],declarations:d(q),exports:d(q)}]}];var _=function(){function t(){this.perPageSelect=[],this.changePage=new e.EventEmitter,this.count=0}return t.prototype.ngOnChanges=function(t){var e=this;t.source&&(t.source.firstChange||this.dataChangedSub.unsubscribe(),this.dataChangedSub=this.source.onChanged().subscribe((function(t){e.page=e.source.getPaging().page,e.perPage=e.source.getPaging().perPage,e.currentPerPage=e.perPage,e.count=e.source.count(),e.isPageOutOfBounce()&&e.source.setPage(--e.page),e.processPageChange(t),e.initPages()})))},t.prototype.processPageChange=function(t){"prepend"===t.action&&this.source.setPage(1),"append"===t.action&&this.source.setPage(this.getLast())},t.prototype.shouldShow=function(){return this.source.count()>this.perPage},t.prototype.paginate=function(t){return this.source.setPage(t),this.page=t,this.changePage.emit({page:t}),!1},t.prototype.next=function(){return this.paginate(this.getPage()+1)},t.prototype.prev=function(){return this.paginate(this.getPage()-1)},t.prototype.getPage=function(){return this.page},t.prototype.getPages=function(){return this.pages},t.prototype.getLast=function(){return Math.ceil(this.count/this.perPage)},t.prototype.isPageOutOfBounce=function(){return this.page*this.perPage>=this.count+this.perPage&&this.page>1},t.prototype.initPages=function(){var t=this.getLast(),e=4;if(e=t<e?t:e,this.pages=[],this.shouldShow())for(var n=Math.ceil(e/2),i=(n=this.page>=n?this.page:n)+Math.floor(e/2),o=(i=i>=t?t:i)-e+1;o<=i;o++)this.pages.push(o)},t.prototype.onChangePerPage=function(t){this.currentPerPage&&("string"==typeof this.currentPerPage&&"all"===this.currentPerPage.toLowerCase()?this.source.getPaging().perPage=null:(this.source.getPaging().perPage=1*this.currentPerPage,this.source.refresh()),this.initPages())},t}();_.decorators=[{type:e.Component,args:[{selector:"ng2-smart-table-pager",template:'\n <nav *ngIf="shouldShow()" class="ng2-smart-pagination-nav">\n <ul class="ng2-smart-pagination pagination">\n <li class="ng2-smart-page-item page-item" [ngClass]="{disabled: getPage() == 1}">\n <a class="ng2-smart-page-link page-link" href="#"\n (click)="getPage() == 1 ? false : paginate(1)" aria-label="First">\n <span aria-hidden="true">«</span>\n <span class="sr-only">First</span>\n </a>\n </li>\n <li class="ng2-smart-page-item page-item" [ngClass]="{disabled: getPage() == 1}">\n <a class="ng2-smart-page-link page-link page-link-prev" href="#"\n (click)="getPage() == 1 ? false : prev()" aria-label="Prev">\n <span aria-hidden="true"><</span>\n <span class="sr-only">Prev</span>\n </a>\n </li>\n <li class="ng2-smart-page-item page-item"\n [ngClass]="{active: getPage() == page}" *ngFor="let page of getPages()">\n <span class="ng2-smart-page-link page-link"\n *ngIf="getPage() == page">{{ page }} <span class="sr-only">(current)</span></span>\n <a class="ng2-smart-page-link page-link" href="#"\n (click)="paginate(page)" *ngIf="getPage() != page">{{ page }}</a>\n </li>\n\n <li class="ng2-smart-page-item page-item"\n [ngClass]="{disabled: getPage() == getLast()}">\n <a class="ng2-smart-page-link page-link page-link-next" href="#"\n (click)="getPage() == getLast() ? false : next()" aria-label="Next">\n <span aria-hidden="true">></span>\n <span class="sr-only">Next</span>\n </a>\n </li>\n \n <li class="ng2-smart-page-item page-item"\n [ngClass]="{disabled: getPage() == getLast()}">\n <a class="ng2-smart-page-link page-link" href="#"\n (click)="getPage() == getLast() ? false : paginate(getLast())" aria-label="Last">\n <span aria-hidden="true">»</span>\n <span class="sr-only">Last</span>\n </a>\n </li>\n </ul>\n </nav>\n \n <nav *ngIf="perPageSelect && perPageSelect.length > 0" class="ng2-smart-pagination-per-page">\n <label for="per-page">\n Per Page:\n </label>\n <select (change)="onChangePerPage($event)" [(ngModel)]="currentPerPage" id="per-page">\n <option *ngFor="let item of perPageSelect" [value]="item">{{ item }}</option>\n </select>\n </nav>\n ',styles:[".ng2-smart-pagination{display:inline-flex;font-size:.875em;padding:0}.ng2-smart-pagination .sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ng2-smart-pagination .ng2-smart-page-item{display:inline}.ng2-smart-pagination .page-link-next,.ng2-smart-pagination .page-link-prev{font-size:10px}:host{display:flex;justify-content:space-between}:host label,:host select{margin:1rem 0 1rem 1rem}:host label{line-height:2.5rem}"]}]}],_.propDecorators={source:[{type:e.Input}],perPageSelect:[{type:e.Input}],changePage:[{type:e.Output}]};var H=function(){};H.decorators=[{type:e.NgModule,args:[{imports:[n.CommonModule,i.FormsModule],declarations:[_],exports:[_]}]}];var K=function(){function t(){this.save=new e.EventEmitter,this.cancel=new e.EventEmitter,this.edit=new e.EventEmitter,this.delete=new e.EventEmitter,this.custom=new e.EventEmitter,this.edited=new e.EventEmitter,this.userSelectRow=new e.EventEmitter,this.editRowSelect=new e.EventEmitter,this.multipleSelectRow=new e.EventEmitter,this.rowHover=new e.EventEmitter}return Object.defineProperty(t.prototype,"tableColumnsCount",{get:function(){var t=this.isActionAdd||this.isActionEdit||this.isActionDelete?1:0;return this.grid.getColumns().length+t},enumerable:!1,configurable:!0}),t.prototype.ngOnChanges=function(){this.isMultiSelectVisible=this.grid.isMultiSelectVisible(),this.showActionColumnLeft=this.grid.showActionColumn("left"),this.mode=this.grid.getSetting("mode"),this.editInputClass=this.grid.getSetting("edit.inputClass"),this.showActionColumnRight=this.grid.showActionColumn("right"),this.isActionAdd=this.grid.getSetting("actions.add"),this.isActionEdit=this.grid.getSetting("actions.edit"),this.isActionDelete=this.grid.getSetting("actions.delete"),this.noDataMessage=this.grid.getSetting("noDataMessage")},t.prototype.getVisibleCells=function(t){return(t||[]).filter((function(t){return!t.getColumn().hide}))},t}();K.decorators=[{type:e.Component,args:[{selector:"[ng2-st-tbody]",template:'<tr *ngFor="let row of grid.getRows()" (click)="userSelectRow.emit(row)" (mouseover)="rowHover.emit(row)" class="ng2-smart-row" [className]="rowClassFunction(row)" [ngClass]="{selected: row.isSelected}">\n <td *ngIf="isMultiSelectVisible" class="ng2-smart-actions ng2-smart-action-multiple-select" (click)="multipleSelectRow.emit(row)">\n <input type="checkbox" class="form-control" [ngModel]="row.isSelected">\n </td>\n <td *ngIf="!row.isInEditing && showActionColumnLeft" class="ng2-smart-actions">\n <ng2-st-tbody-custom [grid]="grid" (custom)="custom.emit($event)" [row]="row" [source]="source"></ng2-st-tbody-custom>\n\n <ng2-st-tbody-edit-delete [grid]="grid"\n [deleteConfirm]="deleteConfirm"\n [editConfirm]="editConfirm"\n (edit)="edit.emit(row)"\n (delete)="delete.emit(row)"\n (editRowSelect)="editRowSelect.emit($event)"\n [row]="row"\n [source]="source">\n </ng2-st-tbody-edit-delete>\n </td>\n <td *ngIf="row.isInEditing && showActionColumnLeft" class="ng2-smart-actions">\n <ng2-st-tbody-create-cancel [grid]="grid" [row]="row" [editConfirm]="editConfirm"></ng2-st-tbody-create-cancel>\n </td>\n <td *ngFor="let cell of getVisibleCells(row.cells)">\n <ng2-smart-table-cell [cell]="cell"\n [grid]="grid"\n [row]="row"\n [isNew]="false"\n [mode]="mode"\n [editConfirm]="editConfirm"\n [inputClass]="editInputClass"\n [isInEditing]="row.isInEditing">\n </ng2-smart-table-cell>\n </td>\n\n <td *ngIf="row.isInEditing && showActionColumnRight" class="ng2-smart-actions">\n <ng2-st-tbody-create-cancel [grid]="grid" [row]="row" [editConfirm]="editConfirm"></ng2-st-tbody-create-cancel>\n </td>\n\n <td *ngIf="!row.isInEditing && showActionColumnRight" class="ng2-smart-actions">\n <ng2-st-tbody-custom [grid]="grid" (custom)="custom.emit($event)" [row]="row" [source]="source"></ng2-st-tbody-custom>\n\n <ng2-st-tbody-edit-delete [grid]="grid"\n [deleteConfirm]="deleteConfirm"\n [editConfirm]="editConfirm"\n [row]="row"\n [source]="source"\n (edit)="edit.emit(row)"\n (delete)="delete.emit(row)"\n (editRowSelect)="editRowSelect.emit($event)">\n </ng2-st-tbody-edit-delete>\n </td>\n</tr>\n\n<tr *ngIf="grid.getRows().length == 0">\n <td [attr.colspan]="tableColumnsCount">\n {{ noDataMessage }}\n </td>\n</tr>\n',styles:[":host .ng2-smart-row.selected{background:rgba(0,0,0,.05)}:host .ng2-smart-row .ng2-smart-actions.ng2-smart-action-multiple-select{text-align:center}:host ::ng-deep ng2-st-tbody-create-cancel a:first-child,:host ::ng-deep ng2-st-tbody-edit-delete a:first-child{margin-right:.25rem}"]}]}],K.propDecorators={grid:[{type:e.Input}],source:[{type:e.Input}],deleteConfirm:[{type:e.Input}],editConfirm:[{type:e.Input}],rowClassFunction:[{type:e.Input}],save:[{type:e.Output}],cancel:[{type:e.Output}],edit:[{type:e.Output}],delete:[{type:e.Output}],custom:[{type:e.Output}],edited:[{type:e.Output}],userSelectRow:[{type:e.Output}],editRowSelect:[{type:e.Output}],multipleSelectRow:[{type:e.Output}],rowHover:[{type:e.Output}]};var N=function(){function t(){}return t.prototype.onSave=function(t){t.preventDefault(),t.stopPropagation(),this.grid.save(this.row,this.editConfirm)},t.prototype.onCancelEdit=function(t){t.preventDefault(),t.stopPropagation(),this.row.isInEditing=!1},t.prototype.ngOnChanges=function(){this.saveButtonContent=this.grid.getSetting("edit.saveButtonContent"),this.cancelButtonContent=this.grid.getSetting("edit.cancelButtonContent")},t}();N.decorators=[{type:e.Component,args:[{selector:"ng2-st-tbody-create-cancel",template:'\n <a href="#" class="ng2-smart-action ng2-smart-action-edit-save"\n [innerHTML]="saveButtonContent" (click)="onSave($event)"></a>\n <a href="#" class="ng2-smart-action ng2-smart-action-edit-cancel"\n [innerHTML]="cancelButtonContent" (click)="onCancelEdit($event)"></a>\n '}]}],N.propDecorators={grid:[{type:e.Input}],row:[{type:e.Input}],editConfirm:[{type:e.Input}]};var j=function(){function t(){this.edit=new e.EventEmitter,this.delete=new e.EventEmitter,this.editRowSelect=new e.EventEmitter}return t.prototype.onEdit=function(t){t.preventDefault(),t.stopPropagation(),this.editRowSelect.emit(this.row),"external"===this.grid.getSetting("mode")?this.edit.emit({data:this.row.getData(),source:this.source}):this.grid.edit(this.row)},t.prototype.onDelete=function(t){t.preventDefault(),t.stopPropagation(),"external"===this.grid.getSetting("mode")?this.delete.emit({data:this.row.getData(),source:this.source}):this.grid.delete(this.row,this.deleteConfirm)},t.prototype.ngOnChanges=function(){this.isActionEdit=this.grid.getSetting("actions.edit"),this.isActionDelete=this.grid.getSetting("actions.delete"),this.editRowButtonContent=this.grid.getSetting("edit.editButtonContent"),this.deleteRowButtonContent=this.grid.getSetting("delete.deleteButtonContent")},t}();j.decorators=[{type:e.Component,args:[{selector:"ng2-st-tbody-edit-delete",changeDetection:e.ChangeDetectionStrategy.OnPush,template:'\n <a href="#" *ngIf="isActionEdit" class="ng2-smart-action ng2-smart-action-edit-edit"\n [innerHTML]="editRowButtonContent" (click)="onEdit($event)"></a>\n <a href="#" *ngIf="isActionDelete" class="ng2-smart-action ng2-smart-action-delete-delete"\n [innerHTML]="deleteRowButtonContent" (click)="onDelete($event)"></a>\n '}]}],j.propDecorators={grid:[{type:e.Input}],row:[{type:e.Input}],source:[{type:e.Input}],deleteConfirm:[{type:e.Input}],editConfirm:[{type:e.Input}],edit:[{type:e.Output}],delete:[{type:e.Output}],editRowSelect:[{type:e.Output}]};var B=function(){function t(){this.custom=new e.EventEmitter}return t.prototype.onCustom=function(t,e){e.preventDefault(),e.stopPropagation(),this.custom.emit({action:t.name,data:this.row.getData(),source:this.source})},t}();B.decorators=[{type:e.Component,args:[{selector:"ng2-st-tbody-custom",changeDetection:e.ChangeDetectionStrategy.OnPush,template:'\n <a *ngFor="let action of grid.getSetting(\'actions.custom\')" href="#"\n class="ng2-smart-action ng2-smart-action-custom-custom" \n [innerHTML]="action.title"\n (click)="onCustom(action, $event)"></a>\n '}]}],B.propDecorators={grid:[{type:e.Input}],row:[{type:e.Input}],source:[{type:e.Input}],custom:[{type:e.Output}]};var U=[N,j,B,K],Y=function(){};Y.decorators=[{type:e.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,D],declarations:d(U),exports:d(U)}]}];var z=function(){function t(){this.sort=new e.EventEmitter,this.selectAllRows=new e.EventEmitter,this.create=new e.EventEmitter,this.filter=new e.EventEmitter}return t.prototype.ngOnChanges=function(){this.isHideHeader=this.grid.getSetting("hideHeader"),this.isHideSubHeader=this.grid.getSetting("hideSubHeader")},t}();z.decorators=[{type:e.Component,args:[{selector:"[ng2-st-thead]",template:'<tr ng2-st-thead-titles-row *ngIf="!isHideHeader"\n class="ng2-smart-titles"\n [grid]="grid"\n [isAllSelected]="isAllSelected"\n [source]="source"\n (sort)="sort.emit($event)"\n (selectAllRows)="selectAllRows.emit($event)">\n</tr>\n\n<tr ng2-st-thead-filters-row *ngIf="!isHideSubHeader"\n class="ng2-smart-filters"\n [grid]="grid"\n [source]="source"\n (create)="create.emit($event)"\n (filter)="filter.emit($event)">\n</tr>\n\n<tr ng2-st-thead-form-row *ngIf="grid.createFormShown"\n [grid]="grid"\n [createConfirm]="createConfirm">\n</tr>\n'}]}],z.propDecorators={grid:[{type:e.Input}],source:[{type:e.Input}],isAllSelected:[{type:e.Input}],createConfirm:[{type:e.Input}],sort:[{type:e.Output}],selectAllRows:[{type:e.Output}],create:[{type:e.Output}],filter:[{type:e.Output}]};var G=function(){function t(){this.create=new e.EventEmitter}return t.prototype.ngOnChanges=function(){this.createButtonContent=this.grid.getSetting("add.createButtonContent"),this.cancelButtonContent=this.grid.getSetting("add.cancelButtonContent")},t}();G.decorators=[{type:e.Component,args:[{selector:"ng2-st-actions",template:'\n <a href="#" class="ng2-smart-action ng2-smart-action-add-create"\n [innerHTML]="createButtonContent"\n (click)="$event.preventDefault();create.emit($event)"></a>\n <a href="#" class="ng2-smart-action ng2-smart-action-add-cancel"\n [innerHTML]="cancelButtonContent"\n (click)="$event.preventDefault();grid.createFormShown = false;"></a>\n '}]}],G.propDecorators={grid:[{type:e.Input}],create:[{type:e.Output}]};var J=function(){function t(t){this.ref=t}return t.prototype.ngAfterViewInit=function(){this.ref.nativeElement.classList.add("ng2-smart-actions")},t.prototype.ngOnChanges=function(){this.actionsColumnTitle=this.grid.getSetting("actions.columnTitle")},t}();J.decorators=[{type:e.Component,args:[{selector:"[ng2-st-actions-title]",template:'\n <div class="ng2-smart-title">{{ actionsColumnTitle }}</div>\n '}]}],J.ctorParameters=function(){return[{type:e.ElementRef}]},J.propDecorators={grid:[{type:e.Input}]};var Q=function(){function t(t){this.ref=t,this.create=new e.EventEmitter}return t.prototype.ngAfterViewInit=function(){this.ref.nativeElement.classList.add("ng2-smart-actions-title","ng2-smart-actions-title-add")},t.prototype.ngOnChanges=function(){this.isActionAdd=this.grid.getSetting("actions.add"),this.addNewButtonContent=this.grid.getSetting("add.addButtonContent")},t.prototype.onAdd=function(t){t.preventDefault(),t.stopPropagation(),"external"===this.grid.getSetting("mode")?this.create.emit({source:this.source}):this.grid.createFormShown=!0},t}();Q.decorators=[{type:e.Component,args:[{selector:"[ng2-st-add-button]",template:'\n <a *ngIf="isActionAdd" href="#" class="ng2-smart-action ng2-smart-action-add-add"\n [innerHTML]="addNewButtonContent" (click)="onAdd($event)"></a>\n '}]}],Q.ctorParameters=function(){return[{type:e.ElementRef}]},Q.propDecorators={grid:[{type:e.Input}],source:[{type:e.Input}],create:[{type:e.Output}]};var W=function(){};W.decorators=[{type:e.Component,args:[{selector:"[ng2-st-checkbox-select-all]",template:'\n <input type="checkbox" [ngModel]="isAllSelected">\n '}]}],W.propDecorators={grid:[{type:e.Input}],source:[{type:e.Input}],isAllSelected:[{type:e.Input}]};var X=function(){this.sort=new e.EventEmitter};X.decorators=[{type:e.Component,args:[{selector:"ng2-st-column-title",template:'\n <div class="ng2-smart-title">\n <ng2-smart-table-title [source]="source" [column]="column" (sort)="sort.emit($event)"></ng2-smart-table-title>\n </div>\n '}]}],X.propDecorators={column:[{type:e.Input}],source:[{type:e.Input}],sort:[{type:e.Output}]};var Z=function(){function t(){this.currentDirection="",this.sort=new e.EventEmitter}return t.prototype.ngOnChanges=function(t){var e=this;t.source&&(t.source.firstChange||this.dataChangedSub.unsubscribe(),this.dataChangedSub=this.source.onChanged().subscribe((function(t){var n=e.source.getSort();n.length>0&&n[0].field===e.column.id?e.currentDirection=n[0].direction:e.currentDirection="",n.forEach((function(t){}))})))},t.prototype._sort=function(t){t.preventDefault(),this.changeSortDirection(),this.source.setSort([{field:this.column.id,direction:this.currentDirection,compare:this.column.getCompareFunction()}]),this.sort.emit(null)},t.prototype.changeSortDirection=function(){if(this.currentDirection){var t="asc"===this.currentDirection?"desc":"asc";this.currentDirection=t}else this.currentDirection=this.column.sortDirection;return this.currentDirection},t}();Z.decorators=[{type:e.Component,args:[{selector:"ng2-smart-table-title",template:'\n <a href="#" *ngIf="column.isSortable"\n (click)="_sort($event)"\n class="ng2-smart-sort-link sort"\n [ngClass]="currentDirection">\n {{ column.title }}\n </a>\n <span class="ng2-smart-sort" *ngIf="!column.isSortable">{{ column.title }}</span>\n ',styles:['a.sort.asc,a.sort.desc{font-weight:700}a.sort.asc:after,a.sort.desc:after{border:4px solid transparent;border-bottom-color:rgba(0,0,0,.3);content:"";display:inline-block;height:0;margin-bottom:2px;width:0}a.sort.desc:after{margin-bottom:-2px;transform:rotate(-180deg)}']}]}],Z.propDecorators={column:[{type:e.Input}],source:[{type:e.Input}],sort:[{type:e.Output}]};var tt=function(){function t(){this.create=new e.EventEmitter,this.filter=new e.EventEmitter}return t.prototype.ngOnChanges=function(){this.isMultiSelectVisible=this.grid.isMultiSelectVisible(),this.showActionColumnLeft=this.grid.showActionColumn("left"),this.showActionColumnRight=this.grid.showActionColumn("right"),this.filterInputClass=this.grid.getSetting("filter.inputClass")},t.prototype.getVisibleColumns=function(t){return(t||[]).filter((function(t){return!t.hide}))},t}();tt.decorators=[{type:e.Component,args:[{selector:"[ng2-st-thead-filters-row]",template:'\n <th *ngIf="isMultiSelectVisible"></th>\n <th ng2-st-add-button *ngIf="showActionColumnLeft"\n [grid]="grid"\n (create)="create.emit($event)">\n </th>\n <th *ngFor="let column of getVisibleColumns(grid.getColumns())" class="ng2-smart-th {{ column.id }}">\n <ng2-smart-table-filter [source]="source"\n [column]="column"\n [inputClass]="filterInputClass"\n (filter)="filter.emit($event)">\n </ng2-smart-table-filter>\n </th>\n <th ng2-st-add-button *ngIf="showActionColumnRight"\n [grid]="grid"\n [source]="source"\n (create)="create.emit($event)">\n </th>\n '}]}],tt.propDecorators={grid:[{type:e.Input}],source:[{type:e.Input}],create:[{type:e.Output}],filter:[{type:e.Output}]};var et=function(){function t(){this.create=new e.EventEmitter}return t.prototype.onCreate=function(t){t.stopPropagation(),this.grid.create(this.grid.getNewRow(),this.createConfirm)},t.prototype.ngOnChanges=function(){this.isMultiSelectVisible=this.grid.isMultiSelectVisible(),this.showActionColumnLeft=this.grid.showActionColumn("left"),this.showActionColumnRight=this.grid.showActionColumn("right"),this.addInputClass=this.grid.getSetting("add.inputClass")},t.prototype.getVisibleCells=function(t){return(t||[]).filter((function(t){return!t.getColumn().hide}))},t}();et.decorators=[{type:e.Component,args:[{selector:"[ng2-st-thead-form-row]",template:'\n <td *ngIf=""></td>\n <td *ngIf="showActionColumnLeft" class="ng2-smart-actions">\n <ng2-st-actions [grid]="grid" (create)="onCreate($event)"></ng2-st-actions>\n </td>\n <td *ngFor="let cell of getVisibleCells(grid.getNewRow().getCells())">\n <ng2-smart-table-cell [cell]="cell"\n [grid]="grid"\n [isNew]="true"\n [createConfirm]="createConfirm"\n [inputClass]="addInputClass"\n [isInEditing]="grid.getNewRow().isInEditing"\n (edited)="onCreate($event)">\n </ng2-smart-table-cell>\n </td>\n <td *ngIf="showActionColumnRight" class="ng2-smart-actions">\n <ng2-st-actions [grid]="grid" (create)="onCreate($event)"></ng2-st-actions>\n </td>\n '}]}],et.propDecorators={grid:[{type:e.Input}],row:[{type:e.Input}],createConfirm:[{type:e.Input}],create:[{type:e.Output}]};var nt=function(){function t(){this.sort=new e.EventEmitter,this.selectAllRows=new e.EventEmitter}return t.prototype.ngOnChanges=function(){this.isMultiSelectVisible=this.grid.isMultiSelectVisible(),this.showActionColumnLeft=this.grid.showActionColumn("left"),this.showActionColumnRight=this.grid.showActionColumn("right")},t.prototype.getVisibleColumns=function(t){return(t||[]).filter((function(t){return!t.hide}))},t}();nt.decorators=[{type:e.Component,args:[{selector:"[ng2-st-thead-titles-row]",template:'\n <th ng2-st-checkbox-select-all *ngIf="isMultiSelectVisible"\n [grid]="grid"\n [source]="source"\n [isAllSelected]="isAllSelected"\n (click)="selectAllRows.emit($event)">\n </th>\n <th ng2-st-actions-title *ngIf="showActionColumnLeft" [grid]="grid"></th>\n <th *ngFor="let column of getVisibleColumns(grid.getColumns())"\n class="ng2-smart-th {{ column.id }}"\n [ngClass]="column.class"\n [style.width]="column.width">\n <ng2-st-column-title [source]="source" [column]="column" (sort)="sort.emit($event)"></ng2-st-column-title>\n </th>\n <th ng2-st-actions-title *ngIf="showActionColumnRight" [grid]="grid"></th>\n '}]}],nt.propDecorators={grid:[{type:e.Input}],isAllSelected:[{type:e.Input}],source:[{type:e.Input}],sort:[{type:e.Output}],selectAllRows:[{type:e.Output}]};var it=[G,J,Q,W,X,Z,tt,et,nt,z],ot=function(){};ot.decorators=[{type:e.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,V,D],declarations:d(it),exports:d(it)}]}];var rt=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var n,i,o=arguments[0],r=Array.prototype.slice.call(arguments,1);return r.forEach((function(t){"object"!=typeof t||Array.isArray(t)||Object.keys(t).forEach((function(e){return i=o[e],(n=t[e])===o?void 0:"object"!=typeof n||null===n?void(o[e]=n):Array.isArray(n)?void(o[e]=a.cloneDeep(n)):"object"!=typeof i||null===i||Array.isArray(i)?void(o[e]=rt({},n)):void(o[e]=rt(i,n))}))})),o},st=function(){var t=this;this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))};function at(t,e,n){void 0===t&&(t={});var i=e.split("."),o=rt({},t);return i.forEach((function(t){o&&void 0!==o[t]&&(o=o[t])})),void 0===o?n:o}function ct(t,e){return Math.floor(t/e)+1}var lt=function(){function t(t,e,n,i){this.value=t,this.row=e,this.column=n,this.dataSet=i,this.newValue="",this.newValue=t}return t.prototype.getColumn=function(){return this.column},t.prototype.getRow=function(){return this.row},t.prototype.getValue=function(){return(this.column.getValuePrepareFunction()instanceof Function?this.column.getValuePrepareFunction():t.PREPARE).call(null,this.value,this.row.getData(),this)},t.prototype.setValue=function(t){this.newValue=t},t.prototype.getId=function(){return this.getColumn().id},t.prototype.getTitle=function(){return this.getColumn().title},t.prototype.isEditable=function(){return-1===this.getRow().index?this.getColumn().isAddable:this.getColumn().isEditable},t}();lt.PREPARE=function(t){return t};var ut=function(){function t(t,e,n){this.index=t,this.data=e,this._dataSet=n,this.isSelected=!1,this.isInEditing=!1,this.cells=[],this.process()}return t.prototype.getCell=function(t){return this.cells.find((function(e){return e.getColumn()===t}))},t.prototype.getCells=function(){return this.cells},t.prototype.getData=function(){return this.data},t.prototype.getIsSelected=function(){return this.isSelected},t.prototype.getNewData=function(){var t=Object.assign({},this.data);return this.getCells().forEach((function(e){return t[e.getColumn().id]=e.newValue})),t},t.prototype.setData=function(t){this.data=t,this.process()},t.prototype.process=function(){var t=this;this.cells=[],this._dataSet.getColumns().forEach((function(e){var n=t.createCell(e);t.cells.push(n)}))},t.prototype.createCell=function(t){var e=t.settings.defaultValue?t.settings.defaultValue:"",n=void 0===this.data[t.id]?e:this.data[t.id];return new lt(n,this,t,this._dataSet)},t}(),pt=function(){function t(t,e,n){this.id=t,this.settings=e,this.dataSet=n,this.title="",this.type="",this.class="",this.width="",this.hide=!1,this.isSortable=!1,this.isEditable=!0,this.isAddable=!0,this.isFilterable=!1,this.sortDirection="",this.defaultSortDirection="",this.editor={type:"",config:{},component:null},this.filter={type:"",config:{},component:null},this.renderComponent=null,this.process()}