blob: c20e2683a57c8522342d8e3cebbddc385ffdcfa2 [file] [log] [blame]
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/bidi"),require("@angular/cdk/coercion"),require("@angular/cdk/collections"),require("@angular/cdk/platform"),require("@angular/cdk/scrolling"),require("@angular/common"),require("@angular/core"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@angular/cdk/table",["exports","@angular/cdk/bidi","@angular/cdk/coercion","@angular/cdk/collections","@angular/cdk/platform","@angular/cdk/scrolling","@angular/common","@angular/core","rxjs","rxjs/operators"],t):t(((e=e||self).ng=e.ng||{},e.ng.cdk=e.ng.cdk||{},e.ng.cdk.table={}),e.ng.cdk.bidi,e.ng.cdk.coercion,e.ng.cdk.collections,e.ng.cdk.platform,e.ng.cdk.scrolling,e.ng.common,e.ng.core,e.rxjs,e.rxjs.operators)}(this,(function(e,t,o,r,n,i,s,a,c,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 u=function(e,t){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)};function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}function h(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return s}function p(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(f(arguments[t]));return e}function y(e){return function(e){function t(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];var r=e.apply(this,p(t))||this;return r._sticky=!1,r._hasStickyChanged=!1,r}return d(t,e),Object.defineProperty(t.prototype,"sticky",{get:function(){return this._sticky},set:function(e){var t=this._sticky;this._sticky=o.coerceBooleanProperty(e),this._hasStickyChanged=t!==this._sticky},enumerable:!1,configurable:!0}),t.prototype.hasStickyChanged=function(){var e=this._hasStickyChanged;return this._hasStickyChanged=!1,e},t.prototype.resetStickyChanged=function(){this._hasStickyChanged=!1},t}(e)}
/**
* @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 _,m,w,g=new a.InjectionToken("CDK_TABLE"),C=new a.InjectionToken("text-column-options");(_=function _(e){this.template=e}).decorators=[{type:a.Directive,args:[{selector:"[cdkCellDef]"}]}],_.ctorParameters=function(){return[{type:a.TemplateRef}]},(m=function m(e){this.template=e}).decorators=[{type:a.Directive,args:[{selector:"[cdkHeaderCellDef]"}]}],m.ctorParameters=function(){return[{type:a.TemplateRef}]},(w=function w(e){this.template=e}).decorators=[{type:a.Directive,args:[{selector:"[cdkFooterCellDef]"}]}],w.ctorParameters=function(){return[{type:a.TemplateRef}]};var R=function(e){function t(t){var o=e.call(this)||this;return o._table=t,o._stickyEnd=!1,o}return d(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},set:function(e){this._setNameInput(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stickyEnd",{get:function(){return this._stickyEnd},set:function(e){var t=this._stickyEnd;this._stickyEnd=o.coerceBooleanProperty(e),this._hasStickyChanged=t!==this._stickyEnd},enumerable:!1,configurable:!0}),t.prototype._updateColumnCssClassName=function(){this._columnCssClassName=["cdk-column-"+this.cssClassFriendlyName]},t.prototype._setNameInput=function(e){e&&(this._name=e,this.cssClassFriendlyName=e.replace(/[^a-z0-9_-]/gi,"-"),this._updateColumnCssClassName())},t}(y((function v(){})));R.decorators=[{type:a.Directive,args:[{selector:"[cdkColumnDef]",inputs:["sticky"],providers:[{provide:"MAT_SORT_HEADER_COLUMN_DEF",useExisting:R}]}]}],R.ctorParameters=function(){return[{type:void 0,decorators:[{type:a.Inject,args:[g]},{type:a.Optional}]}]},R.propDecorators={name:[{type:a.Input,args:["cdkColumnDef"]}],stickyEnd:[{type:a.Input,args:["stickyEnd"]}],cell:[{type:a.ContentChild,args:[_]}],headerCell:[{type:a.ContentChild,args:[m]}],footerCell:[{type:a.ContentChild,args:[w]}]};var D,k=function(e){function t(t,o){return e.call(this,t,o)||this}return d(t,e),t}(D=function D(e,t){var o,r,n=t.nativeElement.classList;try{for(var i=h(e._columnCssClassName),s=i.next();!s.done;s=i.next())n.add(s.value)}catch(e){o={error:e}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}});k.decorators=[{type:a.Directive,args:[{selector:"cdk-header-cell, th[cdk-header-cell]",host:{class:"cdk-header-cell",role:"columnheader"}}]}],k.ctorParameters=function(){return[{type:R},{type:a.ElementRef}]};var S=function(e){function t(t,o){return e.call(this,t,o)||this}return d(t,e),t}(D);S.decorators=[{type:a.Directive,args:[{selector:"cdk-footer-cell, td[cdk-footer-cell]",host:{class:"cdk-footer-cell",role:"gridcell"}}]}],S.ctorParameters=function(){return[{type:R},{type:a.ElementRef}]};var b=function(e){function t(t,o){return e.call(this,t,o)||this}return d(t,e),t}(D);b.decorators=[{type:a.Directive,args:[{selector:"cdk-cell, td[cdk-cell]",host:{class:"cdk-cell",role:"gridcell"}}]}],b.ctorParameters=function(){return[{type:R},{type:a.ElementRef}]};var O=function O(){this.tasks=[],this.endTasks=[]},E=new a.InjectionToken("_COALESCED_STYLE_SCHEDULER"),x=function(){function e(e){this._ngZone=e,this._currentSchedule=null,this._destroyed=new c.Subject}return e.prototype.schedule=function(e){this._createScheduleIfNeeded(),this._currentSchedule.tasks.push(e)},e.prototype.scheduleEnd=function(e){this._createScheduleIfNeeded(),this._currentSchedule.endTasks.push(e)},e.prototype.ngOnDestroy=function(){this._destroyed.next(),this._destroyed.complete()},e.prototype._createScheduleIfNeeded=function(){var e=this;this._currentSchedule||(this._currentSchedule=new O,this._getScheduleObservable().pipe(l.takeUntil(this._destroyed)).subscribe((function(){for(var t,o,r,n;e._currentSchedule.tasks.length||e._currentSchedule.endTasks.length;){var i=e._currentSchedule;e._currentSchedule=new O;try{for(var s=(t=void 0,h(i.tasks)),a=s.next();!a.done;a=s.next())(0,a.value)()}catch(e){t={error:e}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(t)throw t.error}}try{for(var c=(r=void 0,h(i.endTasks)),l=c.next();!l.done;l=c.next())(0,l.value)()}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}}e._currentSchedule=null})))},e.prototype._getScheduleObservable=function(){return this._ngZone.isStable?c.from(Promise.resolve(void 0)):this._ngZone.onStable.pipe(l.take(1))},e}();x.decorators=[{type:a.Injectable}],x.ctorParameters=function(){return[{type:a.NgZone}]};var T="<ng-container cdkCellOutlet></ng-container>",I=function(){function e(e,t){this.template=e,this._differs=t}return e.prototype.ngOnChanges=function(e){if(!this._columnsDiffer){var t=e.columns&&e.columns.currentValue||[];this._columnsDiffer=this._differs.find(t).create(),this._columnsDiffer.diff(t)}},e.prototype.getColumnsDiff=function(){return this._columnsDiffer.diff(this.columns)},e.prototype.extractCellTemplate=function(e){return this instanceof N?e.headerCell.template:this instanceof P?e.footerCell.template:e.cell.template},e}();I.decorators=[{type:a.Directive}],I.ctorParameters=function(){return[{type:a.TemplateRef},{type:a.IterableDiffers}]};var N=function(e){function t(t,o,r){var n=e.call(this,t,o)||this;return n._table=r,n}return d(t,e),t.prototype.ngOnChanges=function(t){e.prototype.ngOnChanges.call(this,t)},t}(y(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return d(t,e),t}(I)));N.decorators=[{type:a.Directive,args:[{selector:"[cdkHeaderRowDef]",inputs:["columns: cdkHeaderRowDef","sticky: cdkHeaderRowDefSticky"]}]}],N.ctorParameters=function(){return[{type:a.TemplateRef},{type:a.IterableDiffers},{type:void 0,decorators:[{type:a.Inject,args:[g]},{type:a.Optional}]}]};var P=function(e){function t(t,o,r){var n=e.call(this,t,o)||this;return n._table=r,n}return d(t,e),t.prototype.ngOnChanges=function(t){e.prototype.ngOnChanges.call(this,t)},t}(y(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return d(t,e),t}(I)));P.decorators=[{type:a.Directive,args:[{selector:"[cdkFooterRowDef]",inputs:["columns: cdkFooterRowDef","sticky: cdkFooterRowDefSticky"]}]}],P.ctorParameters=function(){return[{type:a.TemplateRef},{type:a.IterableDiffers},{type:void 0,decorators:[{type:a.Inject,args:[g]},{type:a.Optional}]}]};var j=function(e){function t(t,o,r){var n=e.call(this,t,o)||this;return n._table=r,n}return d(t,e),t}(I);j.decorators=[{type:a.Directive,args:[{selector:"[cdkRowDef]",inputs:["columns: cdkRowDefColumns","when: cdkRowDefWhen"]}]}],j.ctorParameters=function(){return[{type:a.TemplateRef},{type:a.IterableDiffers},{type:void 0,decorators:[{type:a.Inject,args:[g]},{type:a.Optional}]}]};var L,H,A,F,B=function(){function e(t){this._viewContainer=t,e.mostRecentCellOutlet=this}return e.prototype.ngOnDestroy=function(){e.mostRecentCellOutlet===this&&(e.mostRecentCellOutlet=null)},e}();B.mostRecentCellOutlet=null,B.decorators=[{type:a.Directive,args:[{selector:"[cdkCellOutlet]"}]}],B.ctorParameters=function(){return[{type:a.ViewContainerRef}]},(L=function L(){}).decorators=[{type:a.Component,args:[{selector:"cdk-header-row, tr[cdk-header-row]",template:T,host:{class:"cdk-header-row",role:"row"},changeDetection:a.ChangeDetectionStrategy.Default,encapsulation:a.ViewEncapsulation.None}]}],(H=function H(){}).decorators=[{type:a.Component,args:[{selector:"cdk-footer-row, tr[cdk-footer-row]",template:T,host:{class:"cdk-footer-row",role:"row"},changeDetection:a.ChangeDetectionStrategy.Default,encapsulation:a.ViewEncapsulation.None}]}],(A=function A(){}).decorators=[{type:a.Component,args:[{selector:"cdk-row, tr[cdk-row]",template:T,host:{class:"cdk-row",role:"row"},changeDetection:a.ChangeDetectionStrategy.Default,encapsulation:a.ViewEncapsulation.None}]}],(F=function F(e){this.templateRef=e}).decorators=[{type:a.Directive,args:[{selector:"ng-template[cdkNoDataRow]"}]}],F.ctorParameters=function(){return[{type:a.TemplateRef}]};
/**
* @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 V,M,U,W,q=["top","bottom","left","right"],z=function(){function e(e,t,o,r,n,i,s){void 0===n&&(n=!0),void 0===i&&(i=!0),this._isNativeHtmlTable=e,this._stickCellCss=t,this.direction=o,this._coalescedStyleScheduler=r,this._isBrowser=n,this._needsPositionStickyOnElement=i,this._positionListener=s,this._cachedCellWidths=[],this._borderCellCss={top:t+"-border-elem-top",bottom:t+"-border-elem-bottom",left:t+"-border-elem-left",right:t+"-border-elem-right"}}return e.prototype.clearStickyPositioning=function(e,t){var o,r,n=this,i=[];try{for(var s=h(e),a=s.next();!a.done;a=s.next()){var c=a.value;if(c.nodeType===c.ELEMENT_NODE){i.push(c);for(var l=0;l<c.children.length;l++)i.push(c.children[l])}}}catch(e){o={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}this._scheduleStyleChanges((function(){var e,o;try{for(var r=h(i),s=r.next();!s.done;s=r.next())n._removeStickyStyle(s.value,t)}catch(t){e={error:t}}finally{try{s&&!s.done&&(o=r.return)&&o.call(r)}finally{if(e)throw e.error}}}))},e.prototype.updateStickyColumns=function(e,t,o,r){var n=this;if(void 0===r&&(r=!0),e.length&&this._isBrowser&&(t.some((function(e){return e}))||o.some((function(e){return e})))){var i=e[0],s=i.children.length,a=this._getCellWidths(i,r),c=this._getStickyStartColumnPositions(a,t),l=this._getStickyEndColumnPositions(a,o),u=t.lastIndexOf(!0),d=o.indexOf(!0);this._scheduleStyleChanges((function(){var r,i,f="rtl"===n.direction,p=f?"right":"left",y=f?"left":"right";try{for(var _=h(e),m=_.next();!m.done;m=_.next())for(var w=m.value,g=0;g<s;g++){var C=w.children[g];t[g]&&n._addStickyStyle(C,p,c[g],g===u),o[g]&&n._addStickyStyle(C,y,l[g],g===d)}}catch(e){r={error:e}}finally{try{m&&!m.done&&(i=_.return)&&i.call(_)}finally{if(r)throw r.error}}n._positionListener&&(n._positionListener.stickyColumnsUpdated({sizes:-1===u?[]:a.slice(0,u+1).map((function(e,o){return t[o]?e:null}))}),n._positionListener.stickyEndColumnsUpdated({sizes:-1===d?[]:a.slice(d).map((function(e,t){return o[t+d]?e:null})).reverse()}))}))}else this._positionListener&&(this._positionListener.stickyColumnsUpdated({sizes:[]}),this._positionListener.stickyEndColumnsUpdated({sizes:[]}))},e.prototype.stickRows=function(e,t,o){var r=this;if(this._isBrowser){for(var n="bottom"===o?e.slice().reverse():e,i="bottom"===o?t.slice().reverse():t,s=[],a=[],c=[],l=0,u=0;l<n.length;l++)if(s[l]=u,i[l]){var d=n[l];c[l]=this._isNativeHtmlTable?Array.from(d.children):[d];var f=d.getBoundingClientRect().height;u+=f,a[l]=f}var p=i.lastIndexOf(!0);this._scheduleStyleChanges((function(){for(var e,t,l,u,d=0;d<n.length;d++)if(i[d]){var f=s[d],y=d===p;try{for(var _=(e=void 0,h(c[d])),m=_.next();!m.done;m=_.next())r._addStickyStyle(m.value,o,f,y)}catch(t){e={error:t}}finally{try{m&&!m.done&&(t=_.return)&&t.call(_)}finally{if(e)throw e.error}}}"top"===o?null===(l=r._positionListener)||void 0===l||l.stickyHeaderRowsUpdated({sizes:a,elements:c}):null===(u=r._positionListener)||void 0===u||u.stickyFooterRowsUpdated({sizes:a,elements:c})}))}},e.prototype.updateStickyFooterContainer=function(e,t){var o=this;if(this._isNativeHtmlTable){var r=e.querySelector("tfoot");this._scheduleStyleChanges((function(){t.some((function(e){return!e}))?o._removeStickyStyle(r,["bottom"]):o._addStickyStyle(r,"bottom",0,!1)}))}},e.prototype._removeStickyStyle=function(e,t){var o,r;try{for(var n=h(t),i=n.next();!i.done;i=n.next()){var s=i.value;e.style[s]="",e.classList.remove(this._borderCellCss[s])}}catch(e){o={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}q.some((function(o){return-1===t.indexOf(o)&&e.style[o]}))?e.style.zIndex=this._getCalculatedZIndex(e):(e.style.zIndex="",this._needsPositionStickyOnElement&&(e.style.position=""),e.classList.remove(this._stickCellCss))},e.prototype._addStickyStyle=function(e,t,o,r){e.classList.add(this._stickCellCss),r&&e.classList.add(this._borderCellCss[t]),e.style[t]=o+"px",e.style.zIndex=this._getCalculatedZIndex(e),this._needsPositionStickyOnElement&&(e.style.cssText+="position: -webkit-sticky; position: sticky; ")},e.prototype._getCalculatedZIndex=function(e){var t,o,r={top:100,bottom:10,left:1,right:1},n=0;try{for(var i=h(q),s=i.next();!s.done;s=i.next()){var a=s.value;e.style[a]&&(n+=r[a])}}catch(e){t={error:e}}finally{try{s&&!s.done&&(o=i.return)&&o.call(i)}finally{if(t)throw t.error}}return n?""+n:""},e.prototype._getCellWidths=function(e,t){if(void 0===t&&(t=!0),!t&&this._cachedCellWidths.length)return this._cachedCellWidths;for(var o=[],r=e.children,n=0;n<r.length;n++)o.push(r[n].getBoundingClientRect().width);return this._cachedCellWidths=o,o},e.prototype._getStickyStartColumnPositions=function(e,t){for(var o=[],r=0,n=0;n<e.length;n++)t[n]&&(o[n]=r,r+=e[n]);return o},e.prototype._getStickyEndColumnPositions=function(e,t){for(var o=[],r=0,n=e.length;n>0;n--)t[n]&&(o[n]=r,r+=e[n]);return o},e.prototype._scheduleStyleChanges=function(e){this._coalescedStyleScheduler?this._coalescedStyleScheduler.schedule(e):e()},e}(),K=new a.InjectionToken("CDK_SPL");(V=function V(e,t){this.viewContainer=e,this.elementRef=t}).decorators=[{type:a.Directive,args:[{selector:"[rowOutlet]"}]}],V.ctorParameters=function(){return[{type:a.ViewContainerRef},{type:a.ElementRef}]},(M=function M(e,t){this.viewContainer=e,this.elementRef=t}).decorators=[{type:a.Directive,args:[{selector:"[headerRowOutlet]"}]}],M.ctorParameters=function(){return[{type:a.ViewContainerRef},{type:a.ElementRef}]},(U=function U(e,t){this.viewContainer=e,this.elementRef=t}).decorators=[{type:a.Directive,args:[{selector:"[footerRowOutlet]"}]}],U.ctorParameters=function(){return[{type:a.ViewContainerRef},{type:a.ElementRef}]},(W=function W(e,t){this.viewContainer=e,this.elementRef=t}).decorators=[{type:a.Directive,args:[{selector:"[noDataRowOutlet]"}]}],W.ctorParameters=function(){return[{type:a.ViewContainerRef},{type:a.ElementRef}]};var Z,Y='\n <ng-content select="caption"></ng-content>\n <ng-content select="colgroup, col"></ng-content>\n <ng-container headerRowOutlet></ng-container>\n <ng-container rowOutlet></ng-container>\n <ng-container noDataRowOutlet></ng-container>\n <ng-container footerRowOutlet></ng-container>\n',G=(d((function $(){return null!==Z&&Z.apply(this,arguments)||this}),Z=a.EmbeddedViewRef),function(){function e(e,t,o,r,n,i,s,a,l,u,d){this._differs=e,this._changeDetectorRef=t,this._elementRef=o,this._dir=n,this._platform=s,this._viewRepeater=a,this._coalescedStyleScheduler=l,this._stickyPositioningListener=u,this._viewportRuler=d,this._onDestroy=new c.Subject,this._columnDefsByName=new Map,this._customColumnDefs=new Set,this._customRowDefs=new Set,this._customHeaderRowDefs=new Set,this._customFooterRowDefs=new Set,this._headerRowDefChanged=!0,this._footerRowDefChanged=!0,this._stickyColumnStylesNeedReset=!0,this._forceRecalculateCellWidths=!0,this._cachedRenderRowsMap=new Map,this.stickyCssClass="cdk-table-sticky",this.needsPositionStickyOnElement=!0,this._isShowingNoDataRow=!1,this._multiTemplateDataRows=!1,this._fixedLayout=!1,this.viewChange=new c.BehaviorSubject({start:0,end:Number.MAX_VALUE}),r||this._elementRef.nativeElement.setAttribute("role","grid"),this._document=i,this._isNativeHtmlTable="TABLE"===this._elementRef.nativeElement.nodeName}return Object.defineProperty(e.prototype,"trackBy",{get:function(){return this._trackByFn},set:function(e){this._trackByFn=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataSource",{get:function(){return this._dataSource},set:function(e){this._dataSource!==e&&this._switchDataSource(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"multiTemplateDataRows",{get:function(){return this._multiTemplateDataRows},set:function(e){this._multiTemplateDataRows=o.coerceBooleanProperty(e),this._rowOutlet&&this._rowOutlet.viewContainer.length&&(this._forceRenderDataRows(),this.updateStickyColumnStyles())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fixedLayout",{get:function(){return this._fixedLayout},set:function(e){this._fixedLayout=o.coerceBooleanProperty(e),this._forceRecalculateCellWidths=!0,this._stickyColumnStylesNeedReset=!0},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this._setupStickyStyler(),this._isNativeHtmlTable&&this._applyNativeTableSections(),this._dataDiffer=this._differs.find([]).create((function(t,o){return e.trackBy?e.trackBy(o.dataIndex,o.data):o})),this._viewportRuler&&this._viewportRuler.change().pipe(l.takeUntil(this._onDestroy)).subscribe((function(){e._forceRecalculateCellWidths=!0}))},e.prototype.ngAfterContentChecked=function(){this._cacheRowDefs(),this._cacheColumnDefs();var e=this._renderUpdatedColumns()||this._headerRowDefChanged||this._footerRowDefChanged;this._stickyColumnStylesNeedReset=this._stickyColumnStylesNeedReset||e,this._forceRecalculateCellWidths=e,this._headerRowDefChanged&&(this._forceRenderHeaderRows(),this._headerRowDefChanged=!1),this._footerRowDefChanged&&(this._forceRenderFooterRows(),this._footerRowDefChanged=!1),this.dataSource&&this._rowDefs.length>0&&!this._renderChangeSubscription?this._observeRenderChanges():this._stickyColumnStylesNeedReset&&this.updateStickyColumnStyles(),this._checkStickyStates()},e.prototype.ngOnDestroy=function(){this._rowOutlet.viewContainer.clear(),this._noDataRowOutlet.viewContainer.clear(),this._headerRowOutlet.viewContainer.clear(),this._footerRowOutlet.viewContainer.clear(),this._cachedRenderRowsMap.clear(),this._onDestroy.next(),this._onDestroy.complete(),r.isDataSource(this.dataSource)&&this.dataSource.disconnect(this)},e.prototype.renderRows=function(){var e=this;this._renderRows=this._getAllRenderRows();var t=this._dataDiffer.diff(this._renderRows);if(t){var o=this._rowOutlet.viewContainer;this._viewRepeater?this._viewRepeater.applyChanges(t,o,(function(t,o,r){return e._getEmbeddedViewArgs(t.item,r)}),(function(e){return e.item.data}),(function(t){1===t.operation&&t.context&&e._renderCellTemplateForItem(t.record.item.rowDef,t.context)})):t.forEachOperation((function(t,r,n){if(null==t.previousIndex){var i=t.item;e._renderRow(e._rowOutlet,i.rowDef,n,{$implicit:i.data})}else if(null==n)o.remove(r);else{var s=o.get(r);o.move(s,n)}})),this._updateRowIndexContext(),t.forEachIdentityChange((function(e){o.get(e.currentIndex).context.$implicit=e.item.data})),this._updateNoDataRow(),this.updateStickyColumnStyles()}else this._updateNoDataRow()},e.prototype.addColumnDef=function(e){this._customColumnDefs.add(e)},e.prototype.removeColumnDef=function(e){this._customColumnDefs.delete(e)},e.prototype.addRowDef=function(e){this._customRowDefs.add(e)},e.prototype.removeRowDef=function(e){this._customRowDefs.delete(e)},e.prototype.addHeaderRowDef=function(e){this._customHeaderRowDefs.add(e),this._headerRowDefChanged=!0},e.prototype.removeHeaderRowDef=function(e){this._customHeaderRowDefs.delete(e),this._headerRowDefChanged=!0},e.prototype.addFooterRowDef=function(e){this._customFooterRowDefs.add(e),this._footerRowDefChanged=!0},e.prototype.removeFooterRowDef=function(e){this._customFooterRowDefs.delete(e),this._footerRowDefChanged=!0},e.prototype.setNoDataRow=function(e){this._customNoDataRow=e},e.prototype.updateStickyHeaderRowStyles=function(){var e=this._getRenderedRows(this._headerRowOutlet),t=this._elementRef.nativeElement.querySelector("thead");t&&(t.style.display=e.length?"":"none");var o=this._headerRowDefs.map((function(e){return e.sticky}));this._stickyStyler.clearStickyPositioning(e,["top"]),this._stickyStyler.stickRows(e,o,"top"),this._headerRowDefs.forEach((function(e){return e.resetStickyChanged()}))},e.prototype.updateStickyFooterRowStyles=function(){var e=this._getRenderedRows(this._footerRowOutlet),t=this._elementRef.nativeElement.querySelector("tfoot");t&&(t.style.display=e.length?"":"none");var o=this._footerRowDefs.map((function(e){return e.sticky}));this._stickyStyler.clearStickyPositioning(e,["bottom"]),this._stickyStyler.stickRows(e,o,"bottom"),this._stickyStyler.updateStickyFooterContainer(this._elementRef.nativeElement,o),this._footerRowDefs.forEach((function(e){return e.resetStickyChanged()}))},e.prototype.updateStickyColumnStyles=function(){var e=this,t=this._getRenderedRows(this._headerRowOutlet),o=this._getRenderedRows(this._rowOutlet),r=this._getRenderedRows(this._footerRowOutlet);(this._isNativeHtmlTable&&!this._fixedLayout||this._stickyColumnStylesNeedReset)&&(this._stickyStyler.clearStickyPositioning(p(t,o,r),["left","right"]),this._stickyColumnStylesNeedReset=!1),t.forEach((function(t,o){e._addStickyColumnStyles([t],e._headerRowDefs[o])})),this._rowDefs.forEach((function(t){for(var r=[],n=0;n<o.length;n++)e._renderRows[n].rowDef===t&&r.push(o[n]);e._addStickyColumnStyles(r,t)})),r.forEach((function(t,o){e._addStickyColumnStyles([t],e._footerRowDefs[o])})),Array.from(this._columnDefsByName.values()).forEach((function(e){return e.resetStickyChanged()}))},e.prototype._getAllRenderRows=function(){var e=[],t=this._cachedRenderRowsMap;this._cachedRenderRowsMap=new Map;for(var o=0;o<this._data.length;o++){var r=this._data[o],n=this._getRenderRowsForData(r,o,t.get(r));this._cachedRenderRowsMap.has(r)||this._cachedRenderRowsMap.set(r,new WeakMap);for(var i=0;i<n.length;i++){var s=n[i],a=this._cachedRenderRowsMap.get(s.data);a.has(s.rowDef)?a.get(s.rowDef).push(s):a.set(s.rowDef,[s]),e.push(s)}}return e},e.prototype._getRenderRowsForData=function(e,t,o){return this._getRowDefs(e,t).map((function(r){var n=o&&o.has(r)?o.get(r):[];if(n.length){var i=n.shift();return i.dataIndex=t,i}return{data:e,rowDef:r,dataIndex:t}}))},e.prototype._cacheColumnDefs=function(){var e=this;this._columnDefsByName.clear(),X(this._getOwnDefs(this._contentColumnDefs),this._customColumnDefs).forEach((function(t){e._columnDefsByName.has(t.name),e._columnDefsByName.set(t.name,t)}))},e.prototype._cacheRowDefs=function(){this._headerRowDefs=X(this._getOwnDefs(this._contentHeaderRowDefs),this._customHeaderRowDefs),this._footerRowDefs=X(this._getOwnDefs(this._contentFooterRowDefs),this._customFooterRowDefs),this._rowDefs=X(this._getOwnDefs(this._contentRowDefs),this._customRowDefs);var e=this._rowDefs.filter((function(e){return!e.when}));this._defaultRowDef=e[0]},e.prototype._renderUpdatedColumns=function(){var e=function(e,t){return e||!!t.getColumnsDiff()},t=this._rowDefs.reduce(e,!1);t&&this._forceRenderDataRows();var o=this._headerRowDefs.reduce(e,!1);o&&this._forceRenderHeaderRows();var r=this._footerRowDefs.reduce(e,!1);return r&&this._forceRenderFooterRows(),t||o||r},e.prototype._switchDataSource=function(e){this._data=[],r.isDataSource(this.dataSource)&&this.dataSource.disconnect(this),this._renderChangeSubscription&&(this._renderChangeSubscription.unsubscribe(),this._renderChangeSubscription=null),e||(this._dataDiffer&&this._dataDiffer.diff([]),this._rowOutlet.viewContainer.clear()),this._dataSource=e},e.prototype._observeRenderChanges=function(){var e,t=this;this.dataSource&&(r.isDataSource(this.dataSource)?e=this.dataSource.connect(this):c.isObservable(this.dataSource)?e=this.dataSource:Array.isArray(this.dataSource)&&(e=c.of(this.dataSource)),this._renderChangeSubscription=e.pipe(l.takeUntil(this._onDestroy)).subscribe((function(e){t._data=e||[],t.renderRows()})))},e.prototype._forceRenderHeaderRows=function(){var e=this;this._headerRowOutlet.viewContainer.length>0&&this._headerRowOutlet.viewContainer.clear(),this._headerRowDefs.forEach((function(t,o){return e._renderRow(e._headerRowOutlet,t,o)})),this.updateStickyHeaderRowStyles()},e.prototype._forceRenderFooterRows=function(){var e=this;this._footerRowOutlet.viewContainer.length>0&&this._footerRowOutlet.viewContainer.clear(),this._footerRowDefs.forEach((function(t,o){return e._renderRow(e._footerRowOutlet,t,o)})),this.updateStickyFooterRowStyles()},e.prototype._addStickyColumnStyles=function(e,t){var o=this,r=Array.from(t.columns||[]).map((function(e){return o._columnDefsByName.get(e)})),n=r.map((function(e){return e.sticky})),i=r.map((function(e){return e.stickyEnd}));this._stickyStyler.updateStickyColumns(e,n,i,!this._fixedLayout||this._forceRecalculateCellWidths)},e.prototype._getRenderedRows=function(e){for(var t=[],o=0;o<e.viewContainer.length;o++){var r=e.viewContainer.get(o);t.push(r.rootNodes[0])}return t},e.prototype._getRowDefs=function(e,t){if(1==this._rowDefs.length)return[this._rowDefs[0]];var o=[];if(this.multiTemplateDataRows)o=this._rowDefs.filter((function(o){return!o.when||o.when(t,e)}));else{var r=this._rowDefs.find((function(o){return o.when&&o.when(t,e)}))||this._defaultRowDef;r&&o.push(r)}return o},e.prototype._getEmbeddedViewArgs=function(e,t){return{templateRef:e.rowDef.template,context:{$implicit:e.data},index:t}},e.prototype._renderRow=function(e,t,o,r){void 0===r&&(r={});var n=e.viewContainer.createEmbeddedView(t.template,r,o);return this._renderCellTemplateForItem(t,r),n},e.prototype._renderCellTemplateForItem=function(e,t){var o,r;try{for(var n=h(this._getCellTemplates(e)),i=n.next();!i.done;i=n.next())B.mostRecentCellOutlet&&B.mostRecentCellOutlet._viewContainer.createEmbeddedView(i.value,t)}catch(e){o={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}this._changeDetectorRef.markForCheck()},e.prototype._updateRowIndexContext=function(){for(var e=this._rowOutlet.viewContainer,t=0,o=e.length;t<o;t++){var r=e.get(t).context;r.count=o,r.first=0===t,r.last=t===o-1,r.even=t%2==0,r.odd=!r.even,this.multiTemplateDataRows?(r.dataIndex=this._renderRows[t].dataIndex,r.renderIndex=t):r.index=this._renderRows[t].dataIndex}},e.prototype._getCellTemplates=function(e){var t=this;return e&&e.columns?Array.from(e.columns,(function(o){var r=t._columnDefsByName.get(o);return e.extractCellTemplate(r)})):[]},e.prototype._applyNativeTableSections=function(){var e,t,o,r,n=this._document.createDocumentFragment(),i=[{tag:"thead",outlets:[this._headerRowOutlet]},{tag:"tbody",outlets:[this._rowOutlet,this._noDataRowOutlet]},{tag:"tfoot",outlets:[this._footerRowOutlet]}];try{for(var s=h(i),a=s.next();!a.done;a=s.next()){var c=a.value,l=this._document.createElement(c.tag);l.setAttribute("role","rowgroup");try{for(var u=(o=void 0,h(c.outlets)),d=u.next();!d.done;d=u.next())l.appendChild(d.value.elementRef.nativeElement)}catch(e){o={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(o)throw o.error}}n.appendChild(l)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}this._elementRef.nativeElement.appendChild(n)},e.prototype._forceRenderDataRows=function(){this._dataDiffer.diff([]),this._rowOutlet.viewContainer.clear(),this.renderRows()},e.prototype._checkStickyStates=function(){var e=function(e,t){return e||t.hasStickyChanged()};this._headerRowDefs.reduce(e,!1)&&this.updateStickyHeaderRowStyles(),this._footerRowDefs.reduce(e,!1)&&this.updateStickyFooterRowStyles(),Array.from(this._columnDefsByName.values()).reduce(e,!1)&&(this._stickyColumnStylesNeedReset=!0,this.updateStickyColumnStyles())},e.prototype._setupStickyStyler=function(){var e=this;this._stickyStyler=new z(this._isNativeHtmlTable,this.stickyCssClass,this._dir?this._dir.value:"ltr",this._coalescedStyleScheduler,this._platform.isBrowser,this.needsPositionStickyOnElement,this._stickyPositioningListener),(this._dir?this._dir.change:c.of()).pipe(l.takeUntil(this._onDestroy)).subscribe((function(t){e._stickyStyler.direction=t,e.updateStickyColumnStyles()}))},e.prototype._getOwnDefs=function(e){var t=this;return e.filter((function(e){return!e._table||e._table===t}))},e.prototype._updateNoDataRow=function(){var e=this._customNoDataRow||this._noDataRow;if(e){var t=0===this._rowOutlet.viewContainer.length;if(t!==this._isShowingNoDataRow){var o=this._noDataRowOutlet.viewContainer;t?o.createEmbeddedView(e.templateRef):o.clear(),this._isShowingNoDataRow=t}}},e}());function X(e,t){return e.concat(Array.from(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
*/G.decorators=[{type:a.Component,args:[{selector:"cdk-table, table[cdk-table]",exportAs:"cdkTable",template:Y,host:{class:"cdk-table","[class.cdk-table-fixed-layout]":"fixedLayout"},encapsulation:a.ViewEncapsulation.None,changeDetection:a.ChangeDetectionStrategy.Default,providers:[{provide:g,useExisting:G},{provide:r._VIEW_REPEATER_STRATEGY,useClass:r._DisposeViewRepeaterStrategy},{provide:E,useClass:x},{provide:K,useValue:null}],styles:[".cdk-table-fixed-layout{table-layout:fixed}\n"]}]}],G.ctorParameters=function(){return[{type:a.IterableDiffers},{type:a.ChangeDetectorRef},{type:a.ElementRef},{type:String,decorators:[{type:a.Attribute,args:["role"]}]},{type:t.Directionality,decorators:[{type:a.Optional}]},{type:void 0,decorators:[{type:a.Inject,args:[s.DOCUMENT]}]},{type:n.Platform},{type:void 0,decorators:[{type:a.Optional},{type:a.Inject,args:[r._VIEW_REPEATER_STRATEGY]}]},{type:x,decorators:[{type:a.Optional},{type:a.Inject,args:[E]}]},{type:void 0,decorators:[{type:a.Optional},{type:a.SkipSelf},{type:a.Inject,args:[K]}]},{type:i.ViewportRuler,decorators:[{type:a.Optional}]}]},G.propDecorators={trackBy:[{type:a.Input}],dataSource:[{type:a.Input}],multiTemplateDataRows:[{type:a.Input}],fixedLayout:[{type:a.Input}],_rowOutlet:[{type:a.ViewChild,args:[V,{static:!0}]}],_headerRowOutlet:[{type:a.ViewChild,args:[M,{static:!0}]}],_footerRowOutlet:[{type:a.ViewChild,args:[U,{static:!0}]}],_noDataRowOutlet:[{type:a.ViewChild,args:[W,{static:!0}]}],_contentColumnDefs:[{type:a.ContentChildren,args:[R,{descendants:!0}]}],_contentRowDefs:[{type:a.ContentChildren,args:[j,{descendants:!0}]}],_contentHeaderRowDefs:[{type:a.ContentChildren,args:[N,{descendants:!0}]}],_contentFooterRowDefs:[{type:a.ContentChildren,args:[P,{descendants:!0}]}],_noDataRow:[{type:a.ContentChild,args:[F]}]};var J=function(){function e(e,t){this._table=e,this._options=t,this.justify="start",this._options=t||{}}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(e){this._name=e,this._syncColumnDefName()},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){this._syncColumnDefName(),void 0===this.headerText&&(this.headerText=this._createDefaultHeaderText()),this.dataAccessor||(this.dataAccessor=this._options.defaultDataAccessor||function(e,t){return e[t]}),this._table&&(this.columnDef.cell=this.cell,this.columnDef.headerCell=this.headerCell,this._table.addColumnDef(this.columnDef))},e.prototype.ngOnDestroy=function(){this._table&&this._table.removeColumnDef(this.columnDef)},e.prototype._createDefaultHeaderText=function(){var e=this.name;return this._options&&this._options.defaultHeaderTextTransform?this._options.defaultHeaderTextTransform(e):e[0].toUpperCase()+e.slice(1)},e.prototype._syncColumnDefName=function(){this.columnDef&&(this.columnDef.name=this.name)},e}();J.decorators=[{type:a.Component,args:[{selector:"cdk-text-column",template:'\n <ng-container cdkColumnDef>\n <th cdk-header-cell *cdkHeaderCellDef [style.text-align]="justify">\n {{headerText}}\n </th>\n <td cdk-cell *cdkCellDef="let data" [style.text-align]="justify">\n {{dataAccessor(data, name)}}\n </td>\n </ng-container>\n ',encapsulation:a.ViewEncapsulation.None,changeDetection:a.ChangeDetectionStrategy.Default}]}],J.ctorParameters=function(){return[{type:G,decorators:[{type:a.Optional}]},{type:void 0,decorators:[{type:a.Optional},{type:a.Inject,args:[C]}]}]},J.propDecorators={name:[{type:a.Input}],headerText:[{type:a.Input}],dataAccessor:[{type:a.Input}],justify:[{type:a.Input}],columnDef:[{type:a.ViewChild,args:[R,{static:!0}]}],cell:[{type:a.ViewChild,args:[_,{static:!0}]}],headerCell:[{type:a.ViewChild,args:[m,{static:!0}]}]};
/**
* @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 Q,ee=[G,j,_,B,m,w,R,b,A,k,S,L,N,H,P,V,M,U,J,F,W];(Q=function Q(){}).decorators=[{type:a.NgModule,args:[{exports:ee,declarations:ee,imports:[i.ScrollingModule]}]}],
/**
* @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
*/
Object.defineProperty(e,"DataSource",{enumerable:!0,get:function(){return r.DataSource}}),e.BaseCdkCell=D,e.BaseRowDef=I,e.CDK_ROW_TEMPLATE=T,e.CDK_TABLE=g,e.CDK_TABLE_TEMPLATE=Y,e.CdkCell=b,e.CdkCellDef=_,e.CdkCellOutlet=B,e.CdkColumnDef=R,e.CdkFooterCell=S,e.CdkFooterCellDef=w,e.CdkFooterRow=H,e.CdkFooterRowDef=P,e.CdkHeaderCell=k,e.CdkHeaderCellDef=m,e.CdkHeaderRow=L,e.CdkHeaderRowDef=N,e.CdkNoDataRow=F,e.CdkRow=A,e.CdkRowDef=j,e.CdkTable=G,e.CdkTableModule=Q,e.CdkTextColumn=J,e.DataRowOutlet=V,e.FooterRowOutlet=U,e.HeaderRowOutlet=M,e.NoDataRowOutlet=W,e.STICKY_DIRECTIONS=q,e.STICKY_POSITIONING_LISTENER=K,e.StickyStyler=z,e.TEXT_COLUMN_OPTIONS=C,e._COALESCED_STYLE_SCHEDULER=E,e._CoalescedStyleScheduler=x,e._Schedule=O,e.mixinHasStickyInput=y,Object.defineProperty(e,"__esModule",{value:!0})}));