blob: a50ffe53e3ca2cb1cf798681944b8555538b2003 [file] [log] [blame]
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/cdk/table"),require("@angular/cdk/collections"),require("@angular/material/core"),require("@angular/cdk/coercion"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@angular/material/table",["exports","@angular/core","@angular/cdk/table","@angular/cdk/collections","@angular/material/core","@angular/cdk/coercion","rxjs","rxjs/operators"],e):e(((t=t||self).ng=t.ng||{},t.ng.material=t.ng.material||{},t.ng.material.table={}),t.ng.core,t.ng.cdk.table,t.ng.cdk.collections,t.ng.material.core,t.ng.cdk.coercion,t.rxjs,t.rxjs.operators)}(this,(function(t,e,r,o,a,n,i,l){"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 s=function(t,e){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)};function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function u(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var o,a,n=r.call(t),i=[];try{for(;(void 0===e||e-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(t){a={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i}function p(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(u(arguments[e]));return t}var d=function(t){function e(){var e=t.apply(this,p(arguments))||this;return e.stickyCssClass="mat-table-sticky",e.needsPositionStickyOnElement=!1,e}return c(e,t),e}(r.CdkTable);d.decorators=[{type:e.Component,args:[{selector:"mat-table, table[mat-table]",exportAs:"matTable",template:r.CDK_TABLE_TEMPLATE,host:{class:"mat-table","[class.mat-table-fixed-layout]":"fixedLayout"},providers:[{provide:o._VIEW_REPEATER_STRATEGY,useClass:o._DisposeViewRepeaterStrategy},{provide:r.CdkTable,useExisting:d},{provide:r.CDK_TABLE,useExisting:d},{provide:r._COALESCED_STYLE_SCHEDULER,useClass:r._CoalescedStyleScheduler}],encapsulation:e.ViewEncapsulation.None,changeDetection:e.ChangeDetectionStrategy.Default,styles:['mat-table{display:block}mat-header-row{min-height:56px}mat-row,mat-footer-row{min-height:48px}mat-row,mat-header-row,mat-footer-row{display:flex;border-width:0;border-bottom-width:1px;border-style:solid;align-items:center;box-sizing:border-box}mat-row::after,mat-header-row::after,mat-footer-row::after{display:inline-block;min-height:inherit;content:""}mat-cell:first-of-type,mat-header-cell:first-of-type,mat-footer-cell:first-of-type{padding-left:24px}[dir=rtl] mat-cell:first-of-type:not(:only-of-type),[dir=rtl] mat-header-cell:first-of-type:not(:only-of-type),[dir=rtl] mat-footer-cell:first-of-type:not(:only-of-type){padding-left:0;padding-right:24px}mat-cell:last-of-type,mat-header-cell:last-of-type,mat-footer-cell:last-of-type{padding-right:24px}[dir=rtl] mat-cell:last-of-type:not(:only-of-type),[dir=rtl] mat-header-cell:last-of-type:not(:only-of-type),[dir=rtl] mat-footer-cell:last-of-type:not(:only-of-type){padding-right:0;padding-left:24px}mat-cell,mat-header-cell,mat-footer-cell{flex:1;display:flex;align-items:center;overflow:hidden;word-wrap:break-word;min-height:inherit}table.mat-table{border-spacing:0}tr.mat-header-row{height:56px}tr.mat-row,tr.mat-footer-row{height:48px}th.mat-header-cell{text-align:left}[dir=rtl] th.mat-header-cell{text-align:right}th.mat-header-cell,td.mat-cell,td.mat-footer-cell{padding:0;border-bottom-width:1px;border-bottom-style:solid}th.mat-header-cell:first-of-type,td.mat-cell:first-of-type,td.mat-footer-cell:first-of-type{padding-left:24px}[dir=rtl] th.mat-header-cell:first-of-type:not(:only-of-type),[dir=rtl] td.mat-cell:first-of-type:not(:only-of-type),[dir=rtl] td.mat-footer-cell:first-of-type:not(:only-of-type){padding-left:0;padding-right:24px}th.mat-header-cell:last-of-type,td.mat-cell:last-of-type,td.mat-footer-cell:last-of-type{padding-right:24px}[dir=rtl] th.mat-header-cell:last-of-type:not(:only-of-type),[dir=rtl] td.mat-cell:last-of-type:not(:only-of-type),[dir=rtl] td.mat-footer-cell:last-of-type:not(:only-of-type){padding-right:0;padding-left:24px}.mat-table-sticky{position:-webkit-sticky !important;position:sticky !important}.mat-table-fixed-layout{table-layout:fixed}\n']}]}];var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e}(r.CdkCellDef);f.decorators=[{type:e.Directive,args:[{selector:"[matCellDef]",providers:[{provide:r.CdkCellDef,useExisting:f}]}]}];var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e}(r.CdkHeaderCellDef);h.decorators=[{type:e.Directive,args:[{selector:"[matHeaderCellDef]",providers:[{provide:r.CdkHeaderCellDef,useExisting:h}]}]}];var m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e}(r.CdkFooterCellDef);m.decorators=[{type:e.Directive,args:[{selector:"[matFooterCellDef]",providers:[{provide:r.CdkFooterCellDef,useExisting:m}]}]}];var g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(t){this._setNameInput(t)},enumerable:!1,configurable:!0}),e.prototype._updateColumnCssClassName=function(){t.prototype._updateColumnCssClassName.call(this),this._columnCssClassName.push("mat-column-"+this.cssClassFriendlyName)},e}(r.CdkColumnDef);g.decorators=[{type:e.Directive,args:[{selector:"[matColumnDef]",inputs:["sticky"],providers:[{provide:r.CdkColumnDef,useExisting:g},{provide:"MAT_SORT_HEADER_COLUMN_DEF",useExisting:g}]}]}],g.propDecorators={name:[{type:e.Input,args:["matColumnDef"]}]};var y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e}(r.CdkHeaderCell);y.decorators=[{type:e.Directive,args:[{selector:"mat-header-cell, th[mat-header-cell]",host:{class:"mat-header-cell",role:"columnheader"}}]}];var C=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e}(r.CdkFooterCell);C.decorators=[{type:e.Directive,args:[{selector:"mat-footer-cell, td[mat-footer-cell]",host:{class:"mat-footer-cell",role:"gridcell"}}]}];var D=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e}(r.CdkCell);D.decorators=[{type:e.Directive,args:[{selector:"mat-cell, td[mat-cell]",host:{class:"mat-cell",role:"gridcell"}}]}];var v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e}(r.CdkHeaderRowDef);v.decorators=[{type:e.Directive,args:[{selector:"[matHeaderRowDef]",providers:[{provide:r.CdkHeaderRowDef,useExisting:v}],inputs:["columns: matHeaderRowDef","sticky: matHeaderRowDefSticky"]}]}];var b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e}(r.CdkFooterRowDef);b.decorators=[{type:e.Directive,args:[{selector:"[matFooterRowDef]",providers:[{provide:r.CdkFooterRowDef,useExisting:b}],inputs:["columns: matFooterRowDef","sticky: matFooterRowDefSticky"]}]}];var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e}(r.CdkRowDef);_.decorators=[{type:e.Directive,args:[{selector:"[matRowDef]",providers:[{provide:r.CdkRowDef,useExisting:_}],inputs:["columns: matRowDefColumns","when: matRowDefWhen"]}]}];var w=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e}(r.CdkHeaderRow);w.decorators=[{type:e.Component,args:[{selector:"mat-header-row, tr[mat-header-row]",template:r.CDK_ROW_TEMPLATE,host:{class:"mat-header-row",role:"row"},changeDetection:e.ChangeDetectionStrategy.Default,encapsulation:e.ViewEncapsulation.None,exportAs:"matHeaderRow",providers:[{provide:r.CdkHeaderRow,useExisting:w}]}]}];var x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e}(r.CdkFooterRow);x.decorators=[{type:e.Component,args:[{selector:"mat-footer-row, tr[mat-footer-row]",template:r.CDK_ROW_TEMPLATE,host:{class:"mat-footer-row",role:"row"},changeDetection:e.ChangeDetectionStrategy.Default,encapsulation:e.ViewEncapsulation.None,exportAs:"matFooterRow",providers:[{provide:r.CdkFooterRow,useExisting:x}]}]}];var k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e}(r.CdkRow);k.decorators=[{type:e.Component,args:[{selector:"mat-row, tr[mat-row]",template:r.CDK_ROW_TEMPLATE,host:{class:"mat-row",role:"row"},changeDetection:e.ChangeDetectionStrategy.Default,encapsulation:e.ViewEncapsulation.None,exportAs:"matRow",providers:[{provide:r.CdkRow,useExisting:k}]}]}];var E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e}(r.CdkNoDataRow);E.decorators=[{type:e.Directive,args:[{selector:"ng-template[matNoDataRow]",providers:[{provide:r.CdkNoDataRow,useExisting:E}]}]}];var R=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e}(r.CdkTextColumn);R.decorators=[{type:e.Component,args:[{selector:"mat-text-column",template:'\n <ng-container matColumnDef>\n <th mat-header-cell *matHeaderCellDef [style.text-align]="justify">\n {{headerText}}\n </th>\n <td mat-cell *matCellDef="let data" [style.text-align]="justify">\n {{dataAccessor(data, name)}}\n </td>\n </ng-container>\n ',encapsulation:e.ViewEncapsulation.None,changeDetection:e.ChangeDetectionStrategy.Default}]}];
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var S,M=[d,h,v,g,f,_,m,b,y,D,C,w,k,x,E,R];(S=function S(){}).decorators=[{type:e.NgModule,args:[{imports:[r.CdkTableModule,a.MatCommonModule],exports:[a.MatCommonModule,M],declarations:M}]}];var T=function(t){function e(e){void 0===e&&(e=[]);var r=t.call(this)||this;return r._renderData=new i.BehaviorSubject([]),r._filter=new i.BehaviorSubject(""),r._internalPageChanges=new i.Subject,r._renderChangesSubscription=null,r.sortingDataAccessor=function(t,e){var r=t[e];if(n._isNumberValue(r)){var o=Number(r);return o<9007199254740991?o:r}return r},r.sortData=function(t,e){var o=e.active,a=e.direction;return o&&""!=a?t.sort((function(t,e){var n=r.sortingDataAccessor(t,o),i=r.sortingDataAccessor(e,o),l=typeof n,s=typeof i;l!==s&&("number"===l&&(n+=""),"number"===s&&(i+=""));var c=0;return null!=n&&null!=i?n>i?c=1:n<i&&(c=-1):null!=n?c=1:null!=i&&(c=-1),c*("asc"==a?1:-1)})):t},r.filterPredicate=function(t,e){var r=Object.keys(t).reduce((function(e,r){return e+t[r]+"◬"}),"").toLowerCase(),o=e.trim().toLowerCase();return-1!=r.indexOf(o)},r._data=new i.BehaviorSubject(e),r._updateChangeSubscription(),r}return c(e,t),Object.defineProperty(e.prototype,"data",{get:function(){return this._data.value},set:function(t){this._data.next(t),this._renderChangesSubscription||this._filterData(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"filter",{get:function(){return this._filter.value},set:function(t){this._filter.next(t),this._renderChangesSubscription||this._filterData(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sort",{get:function(){return this._sort},set:function(t){this._sort=t,this._updateChangeSubscription()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paginator",{get:function(){return this._paginator},set:function(t){this._paginator=t,this._updateChangeSubscription()},enumerable:!1,configurable:!0}),e.prototype._updateChangeSubscription=function(){var t,e=this,r=this._sort?i.merge(this._sort.sortChange,this._sort.initialized):i.of(null),o=this._paginator?i.merge(this._paginator.page,this._internalPageChanges,this._paginator.initialized):i.of(null),a=i.combineLatest([this._data,this._filter]).pipe(l.map((function(t){var r=u(t,1);return e._filterData(r[0])}))),n=i.combineLatest([a,r]).pipe(l.map((function(t){var r=u(t,1);return e._orderData(r[0])}))),s=i.combineLatest([n,o]).pipe(l.map((function(t){var r=u(t,1);return e._pageData(r[0])})));null===(t=this._renderChangesSubscription)||void 0===t||t.unsubscribe(),this._renderChangesSubscription=s.subscribe((function(t){return e._renderData.next(t)}))},e.prototype._filterData=function(t){var e=this;return this.filteredData=null==this.filter||""===this.filter?t:t.filter((function(t){return e.filterPredicate(t,e.filter)})),this.paginator&&this._updatePaginator(this.filteredData.length),this.filteredData},e.prototype._orderData=function(t){return this.sort?this.sortData(t.slice(),this.sort):t},e.prototype._pageData=function(t){if(!this.paginator)return t;var e=this.paginator.pageIndex*this.paginator.pageSize;return t.slice(e,e+this.paginator.pageSize)},e.prototype._updatePaginator=function(t){var e=this;Promise.resolve().then((function(){var r=e.paginator;if(r&&(r.length=t,r.pageIndex>0)){var o=Math.ceil(r.length/r.pageSize)-1||0,a=Math.min(r.pageIndex,o);a!==r.pageIndex&&(r.pageIndex=a,e._internalPageChanges.next())}}))},e.prototype.connect=function(){return this._renderChangesSubscription||this._updateChangeSubscription(),this._renderData},e.prototype.disconnect=function(){var t;null===(t=this._renderChangesSubscription)||void 0===t||t.unsubscribe(),this._renderChangesSubscription=null},e}(r.DataSource),j=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e}(T);
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
t.MatCell=D,t.MatCellDef=f,t.MatColumnDef=g,t.MatFooterCell=C,t.MatFooterCellDef=m,t.MatFooterRow=x,t.MatFooterRowDef=b,t.MatHeaderCell=y,t.MatHeaderCellDef=h,t.MatHeaderRow=w,t.MatHeaderRowDef=v,t.MatNoDataRow=E,t.MatRow=k,t.MatRowDef=_,t.MatTable=d,t.MatTableDataSource=j,t.MatTableModule=S,t.MatTextColumn=R,t._MatTableDataSource=T,Object.defineProperty(t,"__esModule",{value:!0})}));