UNPKG

angular2-data-table

Version:

angular2-data-table is a Angular2 component for presenting large and complex data.

2 lines 90.7 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@angular/core"),require("rxjs/Rx"),require("@angular/common")):"function"==typeof define&&define.amd?define("angular2-data-table",["@angular/core","rxjs/Rx","@angular/common"],t):"object"==typeof exports?exports["angular2-data-table"]=t(require("@angular/core"),require("rxjs/Rx"),require("@angular/common")):e["angular2-data-table"]=t(e["@angular/core"],e["rxjs/Rx"],e["@angular/common"])}(this,function(e,t,n){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s="./src/index.ts")}({"./src/components/body/body-cell.component.ts":function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var i,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(r<3?i(s):r>3?i(t,n,s):i(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(0),s=n("./src/utils/index.ts"),a=n("./src/types/index.ts"),c=function(){function e(e){this.activate=new r.EventEmitter,this.isFocused=!1,this.element=e.nativeElement}return Object.defineProperty(e.prototype,"sorts",{get:function(){return this._sorts},set:function(e){this._sorts=e,this.calcSortDir=this.calcSortDir(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSortActive",{get:function(){return!this.sortDir},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSortAscending",{get:function(){return this.sortDir===a.SortDirection.asc},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSortDescending",{get:function(){return this.sortDir===a.SortDirection.desc},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.column.width},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var e=this.rowHeight;return isNaN(e)?e:e+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){if(!this.row||!this.column||!this.column.prop)return"";var e=s.deepValueGetter(this.row,this.column.prop),t=this.column.pipe;return t?t.transform(e):void 0!==e?e:""},enumerable:!0,configurable:!0}),e.prototype.onFocus=function(){this.isFocused=!0},e.prototype.onBlur=function(){this.isFocused=!1},e.prototype.onClick=function(e){this.activate.emit({type:"click",event:e,row:this.row,column:this.column,value:this.value,cellElement:this.element})},e.prototype.onDblClick=function(e){this.activate.emit({type:"dblclick",event:e,row:this.row,column:this.column,value:this.value,cellElement:this.element})},e.prototype.onKeyDown=function(e){var t=e.keyCode,n=e.target===this.element,o=t===s.Keys.return||t===s.Keys.down||t===s.Keys.up||t===s.Keys.left||t===s.Keys.right;o&&n&&(e.preventDefault(),e.stopPropagation(),this.activate.emit({type:"keydown",event:e,row:this.row,column:this.column,value:this.value,cellElement:this.element}))},e.prototype.onCheckboxChange=function(e){this.activate.emit({type:"checkbox",event:e,row:this.row,column:this.column,value:this.value,cellElement:this.element})},e.prototype.calcSortDir=function(e){var t=this;if(e){var n=e.find(function(e){return e.prop===t.column.prop});return n?n.dir:void 0}},o([r.Input(),i("design:type",Object)],e.prototype,"row",void 0),o([r.Input(),i("design:type",Object)],e.prototype,"column",void 0),o([r.Input(),i("design:type",Number)],e.prototype,"rowHeight",void 0),o([r.Input(),i("design:type",Boolean)],e.prototype,"isSelected",void 0),o([r.Input(),i("design:type",Array),i("design:paramtypes",[Array])],e.prototype,"sorts",null),o([r.Output(),i("design:type",r.EventEmitter)],e.prototype,"activate",void 0),o([r.HostBinding("class.active"),i("design:type",Boolean)],e.prototype,"isFocused",void 0),o([r.HostBinding("class.sort-active"),i("design:type",Boolean)],e.prototype,"isSortActive",null),o([r.HostBinding("class.sort-asc"),i("design:type",Boolean)],e.prototype,"isSortAscending",null),o([r.HostBinding("class.sort-desc"),i("design:type",Boolean)],e.prototype,"isSortDescending",null),o([r.HostBinding("style.width.px"),i("design:type",Number)],e.prototype,"width",null),o([r.HostBinding("style.height"),i("design:type",Object)],e.prototype,"height",null),o([r.HostListener("focus"),i("design:type",Function),i("design:paramtypes",[]),i("design:returntype",void 0)],e.prototype,"onFocus",null),o([r.HostListener("blur"),i("design:type",Function),i("design:paramtypes",[]),i("design:returntype",void 0)],e.prototype,"onBlur",null),o([r.HostListener("click",["$event"]),i("design:type",Function),i("design:paramtypes",[MouseEvent]),i("design:returntype",void 0)],e.prototype,"onClick",null),o([r.HostListener("dblclick",["$event"]),i("design:type",Function),i("design:paramtypes",[MouseEvent]),i("design:returntype",void 0)],e.prototype,"onDblClick",null),o([r.HostListener("keydown",["$event"]),i("design:type",Function),i("design:paramtypes",[KeyboardEvent]),i("design:returntype",void 0)],e.prototype,"onKeyDown",null),e=o([r.Component({selector:"datatable-body-cell",template:'\n <div class="datatable-body-cell-label">\n <label\n *ngIf="column.checkboxable" \n class="datatable-checkbox">\n <input \n type="checkbox"\n [checked]="isSelected"\n (click)="onCheckboxChange($event)" \n />\n </label>\n <span\n *ngIf="!column.cellTemplate"\n [innerHTML]="value">\n </span>\n <template\n *ngIf="column.cellTemplate"\n [ngTemplateOutlet]="column.cellTemplate"\n [ngOutletContext]="{ value: value, row: row, column: column }">\n </template>\n </div>\n ',host:{class:"datatable-body-cell"}}),i("design:paramtypes",[r.ElementRef])],e)}();t.DataTableBodyCellComponent=c},"./src/components/body/body-row-wrapper.component.ts":function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var i,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(r<3?i(s):r>3?i(t,n,s):i(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(0),s=function(){function e(){this.expanded=!1,this.rowContextmenu=new r.EventEmitter(!1)}return e.prototype.onContextmenu=function(e){this.rowContextmenu.emit({event:e,row:this.row})},o([r.Input(),i("design:type",Object)],e.prototype,"rowDetailTemplate",void 0),o([r.Input(),i("design:type",Object)],e.prototype,"detailRowHeight",void 0),o([r.Input(),i("design:type",Boolean)],e.prototype,"expanded",void 0),o([r.Input(),i("design:type",Object)],e.prototype,"row",void 0),o([r.Output(),i("design:type",Object)],e.prototype,"rowContextmenu",void 0),o([r.HostListener("contextmenu",["$event"]),i("design:type",Function),i("design:paramtypes",[MouseEvent]),i("design:returntype",void 0)],e.prototype,"onContextmenu",null),e=o([r.Component({selector:"datatable-row-wrapper",template:'\n <ng-content></ng-content>\n <div \n *ngIf="expanded"\n [style.height.px]="detailRowHeight" \n class="datatable-row-detail">\n <template\n *ngIf="rowDetailTemplate"\n [ngTemplateOutlet]="rowDetailTemplate"\n [ngOutletContext]="{ row: row }">\n </template>\n </div>\n ',host:{class:"datatable-row-wrapper"}}),i("design:paramtypes",[])],e)}();t.DataTableRowWrapperComponent=s},"./src/components/body/body-row.component.ts":function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var i,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(r<3?i(s):r>3?i(t,n,s):i(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(0),s=n("./src/utils/index.ts"),a=function(){function e(e){this.activate=new r.EventEmitter,this.element=e.nativeElement}return Object.defineProperty(e.prototype,"columns",{get:function(){return this._columns},set:function(e){this._columns=e,this.recalculateColumns(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"innerWidth",{get:function(){return this._innerWidth},set:function(e){this._innerWidth=e,this.recalculateColumns()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEvenRow",{get:function(){return this.row.$$index%2===0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isOddRow",{get:function(){return this.row.$$index%2!==0},enumerable:!0,configurable:!0}),e.prototype.trackByGroups=function(e,t){return t.type},e.prototype.stylesByGroup=function(e){var t=this.columnGroupWidths,n=this.offsetX,o={width:t[e]+"px"};if("left"===e)s.translateXY(o,n,0);else if("right"===e){var i=parseInt(this.innerWidth+"",0),r=t.total-i,a=r-n,c=(a+s.scrollbarWidth)*-1;s.translateXY(o,c,0)}return o},e.prototype.onActivate=function(e,t){e.cellIndex=t,e.rowElement=this.element,this.activate.emit(e)},e.prototype.onKeyDown=function(e){var t=e.keyCode,n=e.target===this.element,o=t===s.Keys.return||t===s.Keys.down||t===s.Keys.up||t===s.Keys.left||t===s.Keys.right;o&&n&&(e.preventDefault(),e.stopPropagation(),this.activate.emit({type:"keydown",event:e,row:this.row,rowElement:this.element}))},e.prototype.recalculateColumns=function(e){void 0===e&&(e=this.columns);var t=s.columnsByPin(e);this.columnsByPin=s.columnsByPinArr(e),this.columnGroupWidths=s.columnGroupWidths(t,e)},o([r.Input(),i("design:type",Array),i("design:paramtypes",[Array])],e.prototype,"columns",null),o([r.Input(),i("design:type",Number),i("design:paramtypes",[Number])],e.prototype,"innerWidth",null),o([r.Input(),i("design:type",Object)],e.prototype,"row",void 0),o([r.Input(),i("design:type",Number)],e.prototype,"offsetX",void 0),o([r.HostBinding("style.height.px"),r.Input(),i("design:type",Number)],e.prototype,"rowHeight",void 0),o([r.HostBinding("class.active"),r.Input(),i("design:type",Boolean)],e.prototype,"isSelected",void 0),o([r.HostBinding("class.datatable-row-even"),i("design:type",Boolean)],e.prototype,"isEvenRow",null),o([r.HostBinding("class.datatable-row-odd"),i("design:type",Boolean)],e.prototype,"isOddRow",null),o([r.Output(),i("design:type",r.EventEmitter)],e.prototype,"activate",void 0),o([r.HostListener("keydown",["$event"]),i("design:type",Function),i("design:paramtypes",[KeyboardEvent]),i("design:returntype",void 0)],e.prototype,"onKeyDown",null),e=o([r.Component({selector:"datatable-body-row",template:'\n <div\n *ngFor="let colGroup of columnsByPin; let i = index; trackBy: trackByGroups"\n class="datatable-row-{{colGroup.type}} datatable-row-group"\n [ngStyle]="stylesByGroup(colGroup.type)">\n <datatable-body-cell\n *ngFor="let column of colGroup.columns; let ii = index; trackBy: column?.$$id"\n tabindex="-1"\n [row]="row"\n [isSelected]="isSelected"\n [column]="column"\n [rowHeight]="rowHeight"\n (activate)="onActivate($event, ii)">\n </datatable-body-cell>\n </div>\n ',host:{class:"datatable-body-row"}}),i("design:paramtypes",[r.ElementRef])],e)}();t.DataTableBodyRowComponent=a},"./src/components/body/body.component.ts":function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var i,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(r<3?i(s):r>3?i(t,n,s):i(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(0),s=n("./src/utils/index.ts"),a=(n("./src/types/index.ts"),n("./src/components/body/scroller.component.ts")),c=function(){function e(){this.selected=[],this.scroll=new r.EventEmitter,this.page=new r.EventEmitter,this.activate=new r.EventEmitter,this.select=new r.EventEmitter,this.detailToggle=new r.EventEmitter,this.rowContextmenu=new r.EventEmitter(!1),this.rowHeightsCache=new s.RowHeightCache,this.temp=[],this.offsetY=0,this.indexes={},this.rowTrackingFn=function(e,t){return this.trackByProp?t.$$index+"-"+this.trackByProp:t.$$index}.bind(this)}return Object.defineProperty(e.prototype,"pageSize",{get:function(){return this._pageSize},set:function(e){this._pageSize=e,this.recalcLayout()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rows",{get:function(){return this._rows},set:function(e){this._rows=e,this.recalcLayout()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columns",{get:function(){return this._columns},set:function(e){this._columns=e;var t=s.columnsByPin(e);this.columnGroupWidths=s.columnGroupWidths(t,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"offset",{get:function(){return this._offset},set:function(e){this._offset=e,this.recalcLayout()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowCount",{get:function(){return this._rowCount},set:function(e){this._rowCount=e,this.recalcLayout()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bodyWidth",{get:function(){return this.scrollbarH?this.innerWidth+"px":"100%"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bodyHeight",{get:function(){return this._bodyHeight},set:function(e){this.scrollbarV?this._bodyHeight=e+"px":this._bodyHeight="auto",this.recalcLayout()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectEnabled",{get:function(){return!!this.selectionType},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scrollHeight",{get:function(){if(this.scrollbarV)return this.rowHeightsCache.query(this.rowCount-1)},enumerable:!0,configurable:!0}),e.prototype.updateOffsetY=function(e){if(this.scrollbarV&&e){var t=this.pageSize*e;e=this.rowHeightsCache.query(t-1)}this.scroller.setOffset(e||0)},e.prototype.onBodyScroll=function(e){var t=e.scrollYPos,n=e.scrollXPos;this.offsetY===t&&this.offsetX===n||this.scroll.emit({offsetY:t,offsetX:n}),this.offsetY=t,this.offsetX=n,this.updateIndexes(),this.updatePage(e.direction),this.updateRows()},e.prototype.updatePage=function(e){var t=this.indexes.first/this.pageSize;"up"===e?t=Math.floor(t):"down"===e&&(t=Math.ceil(t)),void 0===e||isNaN(t)||this.page.emit({offset:t})},e.prototype.updateRows=function(){for(var e=this.indexes,t=e.first,n=e.last,o=t,i=0,r=[];o<n&&o<this.rowCount;){var s=this.rows[o];s&&(s.$$index=o,r[i]=s),i++,o++}this.temp=r},e.prototype.getRowHeight=function(e){return this.rowHeight+(1===e.$$expanded?this.detailRowHeight:0)},e.prototype.getRowsStyles=function(e){var t=this.getRowHeight(e),n={height:t+"px"};if(this.scrollbarV){var o=e?e.$$index:0,i=this.rowHeightsCache.query(o-1);s.translateXY(n,0,i)}return n},e.prototype.hideIndicator=function(){var e=this;setTimeout(function(){return e.loadingIndicator=!1},500)},e.prototype.updateIndexes=function(){var e=0,t=0;if(this.scrollbarV){var n=parseInt(this.bodyHeight,0);e=this.rowHeightsCache.getRowIndex(this.offsetY),t=this.rowHeightsCache.getRowIndex(n+this.offsetY)+1}else e=Math.max(this.offset*this.pageSize,0),t=Math.min(e+this.pageSize,this.rowCount);this.indexes={first:e,last:t}},e.prototype.refreshRowHeightCache=function(){this.scrollbarV&&(this.rowHeightsCache.clearCache(),this.rows&&this.rows.length&&this.rowHeightsCache.initCache(this.rows,this.rowHeight,this.detailRowHeight))},e.prototype.getAdjustedViewPortIndex=function(){var e=this.indexes.first;if(this.scrollbarV){var t=this.rowHeightsCache.query(e-1);return t<=this.offsetY?e-1:e}return e},e.prototype.toggleRowExpansion=function(e){var t=this.getAdjustedViewPortIndex();if(this.scrollbarV){var n=this.detailRowHeight*(e.$$expanded?-1:1);this.rowHeightsCache.update(e.$$index,n)}e.$$expanded^=1,this.detailToggle.emit({rows:[e],currentIndex:t})},e.prototype.toggleAllRows=function(e){for(var t=e?1:0,n=this.getAdjustedViewPortIndex(),o=0,i=this.rows;o<i.length;o++){var r=i[o];r.$$expanded=t}this.scrollbarV&&this.refreshRowHeightCache(),this.detailToggle.emit({rows:this.rows,currentIndex:n})},e.prototype.recalcLayout=function(){this.refreshRowHeightCache(),this.updateIndexes(),this.updateRows()},o([r.Input(),i("design:type",Boolean)],e.prototype,"scrollbarV",void 0),o([r.Input(),i("design:type",Boolean)],e.prototype,"scrollbarH",void 0),o([r.Input(),i("design:type",Boolean)],e.prototype,"loadingIndicator",void 0),o([r.Input(),i("design:type",Number)],e.prototype,"rowHeight",void 0),o([r.Input(),i("design:type",Number)],e.prototype,"offsetX",void 0),o([r.Input(),i("design:type",Object)],e.prototype,"detailRowHeight",void 0),o([r.Input(),i("design:type",String)],e.prototype,"emptyMessage",void 0),o([r.Input(),i("design:type",Number)],e.prototype,"selectionType",void 0),o([r.Input(),i("design:type",Array)],e.prototype,"selected",void 0),o([r.Input(),i("design:type",Object)],e.prototype,"rowIdentity",void 0),o([r.Input(),i("design:type",Object)],e.prototype,"rowDetailTemplate",void 0),o([r.Input(),i("design:type",Object)],e.prototype,"selectCheck",void 0),o([r.Input(),i("design:type",String)],e.prototype,"trackByProp",void 0),o([r.Input(),i("design:type",Number),i("design:paramtypes",[Number])],e.prototype,"pageSize",null),o([r.Input(),i("design:type",Array),i("design:paramtypes",[Array])],e.prototype,"rows",null),o([r.Input(),i("design:type",Array),i("design:paramtypes",[Array])],e.prototype,"columns",null),o([r.Input(),i("design:type",Number),i("design:paramtypes",[Number])],e.prototype,"offset",null),o([r.Input(),i("design:type",Number),i("design:paramtypes",[Number])],e.prototype,"rowCount",null),o([r.Input(),i("design:type",Number)],e.prototype,"innerWidth",void 0),o([r.HostBinding("style.width"),i("design:type",String)],e.prototype,"bodyWidth",null),o([r.Input(),r.HostBinding("style.height"),i("design:type",Object),i("design:paramtypes",[Object])],e.prototype,"bodyHeight",null),o([r.Output(),i("design:type",r.EventEmitter)],e.prototype,"scroll",void 0),o([r.Output(),i("design:type",r.EventEmitter)],e.prototype,"page",void 0),o([r.Output(),i("design:type",r.EventEmitter)],e.prototype,"activate",void 0),o([r.Output(),i("design:type",r.EventEmitter)],e.prototype,"select",void 0),o([r.Output(),i("design:type",r.EventEmitter)],e.prototype,"detailToggle",void 0),o([r.Output(),i("design:type",Object)],e.prototype,"rowContextmenu",void 0),o([r.ViewChild(a.ScrollerComponent),i("design:type",a.ScrollerComponent)],e.prototype,"scroller",void 0),e=o([r.Component({selector:"datatable-body",template:'\n <datatable-selection\n #selector\n [selected]="selected"\n [rows]="temp"\n [selectCheck]="selectCheck"\n [selectEnabled]="selectEnabled"\n [selectionType]="selectionType"\n [rowIdentity]="rowIdentity"\n (select)="select.emit($event)"\n (activate)="activate.emit($event)">\n <datatable-progress\n *ngIf="loadingIndicator">\n </datatable-progress>\n <datatable-scroller\n *ngIf="rows?.length"\n [scrollbarV]="scrollbarV"\n [scrollbarH]="scrollbarH"\n [scrollHeight]="scrollHeight"\n [scrollWidth]="columnGroupWidths.total"\n (scroll)="onBodyScroll($event)">\n <datatable-row-wrapper\n *ngFor="let row of temp; let i = index; trackBy: rowTrackingFn;"\n [ngStyle]="getRowsStyles(row)"\n [rowDetailTemplate]="rowDetailTemplate"\n [detailRowHeight]="detailRowHeight"\n [row]="row"\n [expanded]="row.$$expanded === 1"\n (rowContextmenu)="rowContextmenu.emit($event)">\n <datatable-body-row\n tabindex="-1"\n [isSelected]="selector.getRowSelected(row)"\n [innerWidth]="innerWidth"\n [offsetX]="offsetX"\n [columns]="columns"\n [rowHeight]="rowHeight"\n [row]="row"\n (activate)="selector.onActivate($event, i)">\n </datatable-body-row>\n </datatable-row-wrapper>\n </datatable-scroller>\n <div\n class="empty-row"\n *ngIf="!rows?.length"\n [innerHTML]="emptyMessage">\n </div>\n </datatable-selection>\n ',host:{class:"datatable-body"}}),i("design:paramtypes",[])],e)}();t.DataTableBodyComponent=c},"./src/components/body/index.ts":function(e,t,n){"use strict";function o(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}o(n("./src/components/body/body.component.ts")),o(n("./src/components/body/body-cell.component.ts")),o(n("./src/components/body/body-row.component.ts")),o(n("./src/components/body/progress-bar.component.ts")),o(n("./src/components/body/scroller.component.ts")),o(n("./src/components/body/body-row-wrapper.component.ts")),o(n("./src/components/body/selection.component.ts"))},"./src/components/body/progress-bar.component.ts":function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var i,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(r<3?i(s):r>3?i(t,n,s):i(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(0),s=function(){function e(){}return e=o([r.Component({selector:"datatable-progress",template:'\n <div class="progress-linear" role="progressbar">\n <div class="container">\n <div class="bar"></div>\n </div>\n </div>\n ',changeDetection:r.ChangeDetectionStrategy.OnPush}),i("design:paramtypes",[])],e)}();t.ProgressBarComponent=s},"./src/components/body/scroller.component.ts":function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var i,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(r<3?i(s):r>3?i(t,n,s):i(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(0),s=function(){function e(e,t){this.renderer=t,this.scrollbarV=!1,this.scrollbarH=!1,this.scroll=new r.EventEmitter,this.scrollYPos=0,this.scrollXPos=0,this.prevScrollYPos=0,this.prevScrollXPos=0,this.element=e.nativeElement}return e.prototype.ngOnInit=function(){(this.scrollbarV||this.scrollbarH)&&(this.parentElement=this.element.parentElement.parentElement,this.onScrollListener=this.renderer.listen(this.parentElement,"scroll",this.onScrolled.bind(this)))},e.prototype.ngOnDestroy=function(){(this.scrollbarV||this.scrollbarH)&&this.onScrollListener()},e.prototype.setOffset=function(e){this.parentElement&&(this.parentElement.scrollTop=e)},e.prototype.onScrolled=function(e){var t=e.currentTarget;this.scrollYPos=t.scrollTop,this.scrollXPos=t.scrollLeft,requestAnimationFrame(this.updateOffset.bind(this))},e.prototype.updateOffset=function(){var e;this.scrollYPos<this.prevScrollYPos?e="down":this.scrollYPos>this.prevScrollYPos&&(e="up"),this.scroll.emit({direction:e,scrollYPos:this.scrollYPos,scrollXPos:this.scrollXPos}),this.prevScrollYPos=this.scrollYPos,this.prevScrollXPos=this.scrollXPos},o([r.Input(),i("design:type",Boolean)],e.prototype,"scrollbarV",void 0),o([r.Input(),i("design:type",Boolean)],e.prototype,"scrollbarH",void 0),o([r.HostBinding("style.height.px"),r.Input(),i("design:type",Number)],e.prototype,"scrollHeight",void 0),o([r.HostBinding("style.width.px"),r.Input(),i("design:type",Number)],e.prototype,"scrollWidth",void 0),o([r.Output(),i("design:type",r.EventEmitter)],e.prototype,"scroll",void 0),e=o([r.Component({selector:"datatable-scroller",template:"\n <ng-content></ng-content>\n ",host:{class:"datatable-scroll"}}),i("design:paramtypes",[r.ElementRef,r.Renderer])],e)}();t.ScrollerComponent=s},"./src/components/body/selection.component.ts":function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var i,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(r<3?i(s):r>3?i(t,n,s):i(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(0),s=n("./src/utils/index.ts"),a=n("./src/types/index.ts"),c=function(){function e(){this.activate=new r.EventEmitter,this.select=new r.EventEmitter}return e.prototype.selectRow=function(e,t,n){if(this.selectEnabled){var o=this.selectionType===a.SelectionType.checkbox,i=this.selectionType===a.SelectionType.multi,r=[];if(i||o)if(e.shiftKey){var c=this.selected.slice();r=s.selectRowsBetween(c,this.rows,t,this.prevIndex,this.getRowSelectedIdx.bind(this))}else if(e.shiftKey){var c=this.selected.slice();r=s.selectRows(c,n,this.getRowSelectedIdx.bind(this))}else r.push(n);else r.push(n);this.selectCheck&&(r=r.filter(this.selectCheck.bind(this))),this.selected.splice(0,this.selected.length),(l=this.selected).push.apply(l,r),this.prevIndex=t,this.select.emit({selected:r});var l}},e.prototype.onActivate=function(e,t){var n=e.type,o=e.event,i=e.row,r=this.selectionType===a.SelectionType.checkbox,c=!r&&("click"===n||"dblclick"===n)||r&&"checkbox"===n;c?this.selectRow(o,t,i):"keydown"===n&&(o.keyCode===s.Keys.return?this.selectRow(o,t,i):this.onKeyboardFocus(e)),this.activate.emit(e)},e.prototype.onKeyboardFocus=function(e){var t=e.event.keyCode,n=t===s.Keys.up||t===s.Keys.down||t===s.Keys.right||t===s.Keys.left;if(n){var o=this.selectionType===a.SelectionType.cell;e.cellElement&&o?o&&this.focusCell(e.cellElement,e.rowElement,t,e.cellIndex):this.focusRow(e.rowElement,t)}},e.prototype.focusRow=function(e,t){var n=this.getPrevNextRow(e,t);n&&n.focus()},e.prototype.getPrevNextRow=function(e,t){var n=e.parentElement;if(n){var o=void 0;if(t===s.Keys.up?o=n.previousElementSibling:t===s.Keys.down&&(o=n.nextElementSibling),o&&o.children.length)return o.children[0]}},e.prototype.focusCell=function(e,t,n,o){var i;if(n===s.Keys.left)i=e.previousElementSibling;else if(n===s.Keys.right)i=e.nextElementSibling;else if(n===s.Keys.up||n===s.Keys.down){var r=this.getPrevNextRow(t,n);if(r){var a=r.getElementsByClassName("datatable-body-cell");a.length&&(i=a[o])}}i&&i.focus()},e.prototype.getRowSelected=function(e){return this.getRowSelectedIdx(e,this.selected)>-1},e.prototype.getRowSelectedIdx=function(e,t){var n=this;if(!t||!t.length)return-1;var o=this.rowIdentity(e);return t.findIndex(function(e){var t=n.rowIdentity(e);return t===o})},o([r.Input(),i("design:type",Array)],e.prototype,"rows",void 0),o([r.Input(),i("design:type",Array)],e.prototype,"selected",void 0),o([r.Input(),i("design:type",Boolean)],e.prototype,"selectEnabled",void 0),o([r.Input(),i("design:type",Number)],e.prototype,"selectionType",void 0),o([r.Input(),i("design:type",Object)],e.prototype,"rowIdentity",void 0),o([r.Input(),i("design:type",Object)],e.prototype,"selectCheck",void 0),o([r.Output(),i("design:type",r.EventEmitter)],e.prototype,"activate",void 0),o([r.Output(),i("design:type",r.EventEmitter)],e.prototype,"select",void 0),e=o([r.Component({selector:"datatable-selection",template:"\n <ng-content></ng-content>\n "}),i("design:paramtypes",[])],e)}();t.DataTableSelectionComponent=c},"./src/components/columns/column-cell.directive.ts":function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var i,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(r<3?i(s):r>3?i(t,n,s):i(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(0),s=function(){function e(e){this.template=e}return e=o([r.Directive({selector:"[swui-datatable-cell-template]"}),i("design:paramtypes",[r.TemplateRef])],e)}();t.DataTableColumnCellDirective=s},"./src/components/columns/column-header.directive.ts":function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var i,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(r<3?i(s):r>3?i(t,n,s):i(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(0),s=function(){function e(e){this.template=e}return e=o([r.Directive({selector:"[swui-datatable-header-template]"}),i("design:paramtypes",[r.TemplateRef])],e)}();t.DataTableColumnHeaderDirective=s},"./src/components/columns/column.directive.ts":function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var i,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(r<3?i(s):r>3?i(t,n,s):i(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(0),s=n("./src/components/columns/column-header.directive.ts"),a=n("./src/components/columns/column-cell.directive.ts"),c=function(){function e(){}return o([r.Input(),i("design:type",String)],e.prototype,"name",void 0),o([r.Input(),i("design:type",String)],e.prototype,"prop",void 0),o([r.Input(),i("design:type",Object)],e.prototype,"frozenLeft",void 0),o([r.Input(),i("design:type",Object)],e.prototype,"frozenRight",void 0),o([r.Input(),i("design:type",Number)],e.prototype,"flexGrow",void 0),o([r.Input(),i("design:type",Boolean)],e.prototype,"resizeable",void 0),o([r.Input(),i("design:type",Function)],e.prototype,"comparator",void 0),o([r.Input(),i("design:type",Object)],e.prototype,"pipe",void 0),o([r.Input(),i("design:type",Boolean)],e.prototype,"sortable",void 0),o([r.Input(),i("design:type",Boolean)],e.prototype,"draggable",void 0),o([r.Input(),i("design:type",Boolean)],e.prototype,"canAutoResize",void 0),o([r.Input(),i("design:type",Number)],e.prototype,"minWidth",void 0),o([r.Input(),i("design:type",Number)],e.prototype,"width",void 0),o([r.Input(),i("design:type",Number)],e.prototype,"maxWidth",void 0),o([r.Input(),i("design:type",Boolean)],e.prototype,"checkboxable",void 0),o([r.Input(),i("design:type",Boolean)],e.prototype,"headerCheckboxable",void 0),o([r.Input(),r.ContentChild(a.DataTableColumnCellDirective,{ read:r.TemplateRef}),i("design:type",r.TemplateRef)],e.prototype,"cellTemplate",void 0),o([r.Input(),r.ContentChild(s.DataTableColumnHeaderDirective,{read:r.TemplateRef}),i("design:type",r.TemplateRef)],e.prototype,"headerTemplate",void 0),e=o([r.Directive({selector:"swui-datatable-column"}),i("design:paramtypes",[])],e)}();t.DataTableColumnDirective=c},"./src/components/columns/index.ts":function(e,t,n){"use strict";function o(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}o(n("./src/components/columns/column.directive.ts")),o(n("./src/components/columns/column-header.directive.ts")),o(n("./src/components/columns/column-cell.directive.ts"))},"./src/components/datatable.component.ts":function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var i,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(r<3?i(s):r>3?i(t,n,s):i(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(0),s=n("./src/utils/index.ts"),a=n("./src/types/index.ts"),c=n("./src/components/body/index.ts"),l=n("./src/components/columns/index.ts"),p=n("./src/components/row-detail/index.ts"),u=n("./src/utils/index.ts"),d=function(){function e(e,t){this.selected=[],this.scrollbarV=!1,this.scrollbarH=!1,this.rowHeight=30,this.detailRowHeight=0,this.columnMode=a.ColumnMode.standard,this.headerHeight=30,this.footerHeight=0,this.externalPaging=!1,this.externalSorting=!1,this.limit=void 0,this.offset=0,this.loadingIndicator=!1,this.reorderable=!0,this.sortType=a.SortType.single,this.sorts=[],this.cssClasses={sortAscending:"icon-down",sortDescending:"icon-up",pagerLeftArrow:"icon-left",pagerRightArrow:"icon-right",pagerPrevious:"icon-prev",pagerNext:"icon-skip"},this.messages={emptyMessage:"No data to display",totalMessage:"total"},this.rowIdentity=function(e){return e},this.scroll=new r.EventEmitter,this.activate=new r.EventEmitter,this.select=new r.EventEmitter,this.sort=new r.EventEmitter,this.page=new r.EventEmitter,this.detailToggle=new r.EventEmitter,this.reorder=new r.EventEmitter,this.resize=new r.EventEmitter,this.rowContextmenu=new r.EventEmitter(!1),this.offsetX=0,this._count=0,this.element=e.nativeElement,this.rowDiffer=t.find({}).create(null)}return Object.defineProperty(e.prototype,"rows",{get:function(){return this._rows},set:function(e){this.externalSorting||(e=s.sortRows(e,this.columns,this.sorts)),this._rows=e,this.recalculate()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columns",{get:function(){return this._columns},set:function(e){e&&(u.setColumnDefaults(e),this.recalculateColumns(e)),this._columns=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"count",{get:function(){return this._count},set:function(e){this._count=e,this.recalculate()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isFixedHeader",{get:function(){var e=this.headerHeight;return"string"!=typeof e||"auto"!==e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isFixedRow",{get:function(){var e=this.rowHeight;return"string"!=typeof e||"auto"!==e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVertScroll",{get:function(){return this.scrollbarV},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isHorScroll",{get:function(){return this.scrollbarH},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSelectable",{get:function(){return void 0!==this.selectionType},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isCheckboxSelection",{get:function(){return this.selectionType===a.SelectionType.checkbox},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isCellSelection",{get:function(){return this.selectionType===a.SelectionType.cell},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSingleSelection",{get:function(){return this.selectionType===a.SelectionType.single},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isMultiSelection",{get:function(){return this.selectionType===a.SelectionType.multi},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnTemplates",{get:function(){return this._columnTemplates},set:function(e){if(this._columnTemplates=e,e){var t=e.toArray();t.length&&(this.columns=u.translateTemplates(t))}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowDetailTemplateChild",{get:function(){return this._rowDetailTemplateChild},set:function(e){this._rowDetailTemplateChild=e,e&&(this.rowDetailTemplate=e.rowDetailTemplate)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allRowsSelected",{get:function(){return this.selected&&this.rows&&this.selected.length===this.rows.length},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.recalculate()},e.prototype.ngAfterViewInit=function(){var e=this;setTimeout(function(){return e.recalculate()})},e.prototype.ngDoCheck=function(){this.rowDiffer.diff(this.rows)&&this.recalculatePages()},e.prototype.toggleExpandRow=function(e){this.bodyComponent.toggleRowExpansion(e)},e.prototype.expandAllRows=function(){this.bodyComponent.toggleAllRows(!0)},e.prototype.collapseAllRows=function(){this.bodyComponent.toggleAllRows(!1)},e.prototype.recalculate=function(){this.recalculateDims(),this.recalculateColumns()},e.prototype.onWindowResize=function(){this.recalculate()},e.prototype.recalculateColumns=function(e,t,n){if(void 0===e&&(e=this.columns),void 0===t&&(t=-1),void 0===n&&(n=this.scrollbarH),e){var o=this.innerWidth;return this.scrollbarV&&(o-=u.scrollbarWidth),this.columnMode===a.ColumnMode.force?s.forceFillColumnWidths(e,o,t,n):this.columnMode===a.ColumnMode.flex&&s.adjustColumnWidths(e,o),e}},e.prototype.recalculateDims=function(){var e=this.element.getBoundingClientRect(),t=e.height,n=e.width;this.innerWidth=Math.floor(n),this.scrollbarV&&(this.headerHeight&&(t-=this.headerHeight),this.footerHeight&&(t-=this.footerHeight),this.bodyHeight=t),this.recalculatePages()},e.prototype.recalculatePages=function(){this.pageSize=this.calcPageSize(),this.rowCount=this.calcRowCount()},e.prototype.onBodyPage=function(e){var t=e.offset;this.offset=t,this.page.emit({count:this.count,pageSize:this.pageSize,limit:this.limit,offset:this.offset})},e.prototype.onBodyScroll=function(e){this.offsetX=e.offsetX,this.scroll.emit(e)},e.prototype.onFooterPage=function(e){this.offset=e.page-1,this.bodyComponent.updateOffsetY(this.offset),this.page.emit({count:this.count,pageSize:this.pageSize,limit:this.limit,offset:this.offset})},e.prototype.calcPageSize=function(e){if(void 0===e&&(e=this.rows),this.scrollbarV){var t=Math.ceil(this.bodyHeight/this.rowHeight);return Math.max(t,0)}return void 0!==this.limit?this.limit:e?e.length:0},e.prototype.calcRowCount=function(e){return void 0===e&&(e=this.rows),this.externalPaging?this.count:e?e.length:0},e.prototype.onColumnResize=function(e){var t,n=e.column,o=e.newValue,i=this.columns.map(function(e,i){return e=Object.assign({},e),e.$$id===n.$$id&&(t=i,e.width=o,e.$$oldWidth=o),e});this.recalculateColumns(i,t),this._columns=i,this.resize.emit({column:n,newValue:o})},e.prototype.onColumnReorder=function(e){var t=e.column,n=e.newValue,o=e.prevValue,i=this.columns.map(function(e){return Object.assign({},e)});i.splice(o,1),i.splice(n,0,t),this.columns=i,this.reorder.emit({column:t,newValue:n,prevValue:o})},e.prototype.onColumnSort=function(e){var t=e.sorts;this.externalSorting===!1&&(this._rows=s.sortRows(this.rows,this.columns,t)),this.sorts=t,this.bodyComponent.updateOffsetY(0),this.sort.emit(e)},e.prototype.onHeaderSelect=function(e){var t=this.selected.length===this.rows.length;this.selected.splice(0,this.selected.length),t||(n=this.selected).push.apply(n,this.rows),this.select.emit({selected:this.selected});var n},e.prototype.onBodySelect=function(e){this.select.emit(e)},o([r.Input(),i("design:type",Object),i("design:paramtypes",[Object])],e.prototype,"rows",null),o([r.Input(),i("design:type",Array),i("design:paramtypes",[Array])],e.prototype,"columns",null),o([r.Input(),i("design:type",Array)],e.prototype,"selected",void 0),o([r.Input(),i("design:type",Boolean)],e.prototype,"scrollbarV",void 0),o([r.Input(),i("design:type",Boolean)],e.prototype,"scrollbarH",void 0),o([r.Input(),i("design:type",Number)],e.prototype,"rowHeight",void 0),o([r.Input(),i("design:type",Number)],e.prototype,"detailRowHeight",void 0),o([r.Input(),i("design:type",Number)],e.prototype,"columnMode",void 0),o([r.Input(),i("design:type",Object)],e.prototype,"headerHeight",void 0),o([r.Input(),i("design:type",Number)],e.prototype,"footerHeight",void 0),o([r.Input(),i("design:type",Boolean)],e.prototype,"externalPaging",void 0),o([r.Input(),i("design:type",Boolean)],e.prototype,"externalSorting",void 0),o([r.Input(),i("design:type",Number)],e.prototype,"limit",void 0),o([r.Input(),i("design:type",Number),i("design:paramtypes",[Number])],e.prototype,"count",null),o([r.Input(),i("design:type",Number)],e.prototype,"offset",void 0),o([r.Input(),i("design:type",Boolean)],e.prototype,"loadingIndicator",void 0),o([r.Input(),i("design:type",Number)],e.prototype,"selectionType",void 0),o([r.Input(),i("design:type",Boolean)],e.prototype,"reorderable",void 0),o([r.Input(),i("design:type",Number)],e.prototype,"sortType",void 0),o([r.Input(),i("design:type",Array)],e.prototype,"sorts",void 0),o([r.Input(),i("design:type",r.TemplateRef)],e.prototype,"rowDetailTemplate",void 0),o([r.Input(),i("design:type",Object)],e.prototype,"cssClasses",void 0),o([r.Input(),i("design:type",Object)],e.prototype,"messages",void 0),o([r.Input(),i("design:type",Function)],e.prototype,"rowIdentity",void 0),o([r.Input(),i("design:type",Object)],e.prototype,"selectCheck",void 0),o([r.Input(),i("design:type",String)],e.prototype,"trackByProp",void 0),o([r.Output(),i("design:type",r.EventEmitter)],e.prototype,"scroll",void 0),o([r.Output(),i("design:type",r.EventEmitter)],e.prototype,"activate",void 0),o([r.Output(),i("design:type",r.EventEmitter)],e.prototype,"select",void 0),o([r.Output(),i("design:type",r.EventEmitter)],e.prototype,"sort",void 0),o([r.Output(),i("design:type",r.EventEmitter)],e.prototype,"page",void 0),o([r.Output(),i("design:type",r.EventEmitter)],e.prototype,"detailToggle",void 0),o([r.Output(),i("design:type",r.EventEmitter)],e.prototype,"reorder",void 0),o([r.Output(),i("design:type",r.EventEmitter)],e.prototype,"resize",void 0),o([r.Output(),i("design:type",Object)],e.prototype,"rowContextmenu",void 0),o([r.HostBinding("class.fixed-header"),i("design:type",Boolean)],e.prototype,"isFixedHeader",null),o([r.HostBinding("class.fixed-row"),i("design:type",Boolean)],e.prototype,"isFixedRow",null),o([r.HostBinding("class.scroll-vertical"),i("design:type",Boolean)],e.prototype,"isVertScroll",null),o([r.HostBinding("class.scroll-horz"),i("design:type",Boolean)],e.prototype,"isHorScroll",null),o([r.HostBinding("class.selectable"),i("design:type",Boolean)],e.prototype,"isSelectable",null),o([r.HostBinding("class.checkbox-selection"),i("design:type",Boolean)],e.prototype,"isCheckboxSelection",null),o([r.HostBinding("class.cell-selection"),i("design:type",Boolean)],e.prototype,"isCellSelection",null),o([r.HostBinding("class.single-selection"),i("design:type",Boolean)],e.prototype,"isSingleSelection",null),o([r.HostBinding("class.multi-selection"),i("design:type",Boolean)],e.prototype,"isMultiSelection",null),o([r.ContentChildren(l.DataTableColumnDirective),i("design:type",r.QueryList),i("design:paramtypes",[r.QueryList])],e.prototype,"columnTemplates",null),o([r.ContentChild(p.DatatableRowDetailDirective),i("design:type",p.DatatableRowDetailDirective),i("design:paramtypes",[p.DatatableRowDetailDirective])],e.prototype,"rowDetailTemplateChild",null),o([r.ViewChild(c.DataTableBodyComponent),i("design:type",c.DataTableBodyComponent)],e.prototype,"bodyComponent",void 0),o([r.HostListener("window:resize"),u.throttleable(5),i("design:type",Function),i("design:paramtypes",[]),i("design:returntype",void 0)],e.prototype,"onWindowResize",null),e=o([r.Component({selector:"swui-datatable",template:'\n <div\n visibility-observer\n (visible)="recalculate()">\n <datatable-header\n *ngIf="headerHeight"\n [sorts]="sorts"\n [sortType]="sortType"\n [scrollbarH]="scrollbarH"\n [innerWidth]="innerWidth"\n [offsetX]="offsetX"\n [columns]="columns"\n [headerHeight]="headerHeight"\n [sortAscendingIcon]="cssClasses.sortAscending"\n [sortDescendingIcon]="cssClasses.sortDescending"\n [allRowsSelected]="allRowsSelected"\n [selectionType]="selectionType"\n (sort)="onColumnSort($event)"\n (resize)="onColumnResize($event)"\n (reorder)="onColumnReorder($event)"\n (select)="onHeaderSelect($event)">\n </datatable-header>\n <datatable-body\n [rows]="rows"\n [scrollbarV]="scrollbarV"\n [scrollbarH]="scrollbarH"\n [loadingIndicator]="loadingIndicator"\n [rowHeight]="rowHeight"\n [rowCount]="rowCount"\n [offset]="offset"\n [trackByProp]="trackByProp"\n [columns]="columns"\n [pageSize]="pageSize"\n [offsetX]="offsetX"\n [rowDetailTemplate]="rowDetailTemplate"\n [detailRowHeight]="detailRowHeight"\n [selected]="selected"\n [innerWidth]="innerWidth"\n [bodyHeight]="bodyHeight"\n [selectionType]="selectionType"\n [emptyMessage]="messages.emptyMessage"\n [rowIdentity]="rowIdentity"\n [selectCheck]="selectCheck"\n (page)="onBodyPage($event)"\n (activate)="activate.emit($event)"\n (rowContextmenu)="rowContextmenu.emit($event)"\n (select)="onBodySelect($event)"\n (detailToggle)="detailToggle.emit($event)"\n (scroll)="onBodyScroll($event)">\n </datatable-body>\n <datatable-footer\n *ngIf="footerHeight"\n [rowCount]="rowCount"\n [pageSize]="pageSize"\n [offset]="offset"\n [footerHeight]="footerHeight"\n [totalMessage]="messages.totalMessage"\n [pagerLeftArrowIcon]="cssClasses.pagerLeftArrow"\n [pagerRightArrowIcon]="cssClasses.pagerRightArrow"\n [pagerPreviousIcon]="cssClasses.pagerPrevious"\n [pagerNextIcon]="cssClasses.pagerNext"\n (page)="onFooterPage($event)">\n </datatable-footer>\n </div>\n ',host:{class:"datatable"}}),i("design:paramtypes",[r.ElementRef,r.KeyValueDiffers])],e)}();t.DatatableComponent=d},"./src/components/footer/footer.component.ts":function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var i,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(r<3?i(s):r>3?i(t,n,s):i(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(0),s=function(){function e(){this.page=new r.EventEmitter}return Object.defineProperty(e.prototype,"isVisible",{get:function(){return this.rowCount/this.pageSize>1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"curPage",{get:function(){return this.offset+1},enumerable:!0,configurable:!0}),o([r.Input(),i("design:type",Number)],e.prototype,"footerHeight",void 0),o([r.Input(),i("design:type",Number)],e.prototype,"rowCount",void 0),o([r.Input(),i("design:type",Number)],e.prototype,"pageSize",void 0),o([r.Input(),i("design:type",Number)],e.prototype,"offset",void 0),o([r.Input(),i("design:type",String)],e.prototype,"pagerLeftArrowIcon",void 0),o([r.Input(),i("design:type",String)],e.prototype,"pagerRightArrowIcon",void 0),o([r.Input(),i("design:type",String)],e.prototype,"pagerPreviousIcon",void 0),o([r.Input(),i("design:type",String)],e.prototype,"pagerNextIcon",void 0),o([r.Input(),i("design:type",String)],e.prototype,"totalMessage",void 0),o([r.Output(),i("design:type",r.EventEmitter)],e.prototype,"page",void 0),e=o([r.Component({selector:"datatable-footer",template:'\n <div\n [style.height.px]="footerHeight">\n <div class="page-count">{{rowCount.toLocaleString()}} {{totalMessage}}</div>\n <datatable-pager\n [pagerLeftArrowIcon]="pagerLeftArrowIcon"\n [pagerRightArrowIcon]="pagerRightArrowIcon"\n [pagerPreviousIcon]="pagerPreviousIcon"\n [pagerNextIcon]="pagerNextIcon"\n [page]="curPage"\n [size]="pageSize"\n [count]="rowCount"\n [hidden]="!isVisible"\n (change)="page.emit($event)">\n </datatable-pager>\n </div>\n ',host:{class:"datatable-footer"},changeDetection:r.ChangeDetectionStrategy.OnPush}),i("design:paramtypes",[])],e)}();t.DataTableFooterComponent=s},"./src/components/footer/index.ts":function(e,t,n){"use strict";function o(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}o(n("./src/components/footer/footer.component.ts")),o(n("./src/components/footer/pager.component.ts"))},"./src/components/footer/pager.component.ts":function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var i,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(r<3?i(s):r>3?i(t,n,s):i(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(0),s=functio