@angular/cdk 6.4.6 → 6.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/a11y/typings/focus-monitor/focus-monitor.d.ts +1 -1
- package/a11y/typings/focus-trap/focus-trap.d.ts +1 -1
- package/a11y/typings/index.metadata.json +1 -1
- package/accordion/typings/accordion.d.ts +6 -1
- package/accordion/typings/index.metadata.json +1 -1
- package/bundles/cdk-a11y.umd.js +9 -7
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-a11y.umd.min.js +1 -1
- package/bundles/cdk-a11y.umd.min.js.map +1 -1
- package/bundles/cdk-accordion.umd.js +28 -4
- package/bundles/cdk-accordion.umd.js.map +1 -1
- package/bundles/cdk-accordion.umd.min.js +1 -1
- package/bundles/cdk-accordion.umd.min.js.map +1 -1
- package/bundles/cdk-collections.umd.js +9 -3
- package/bundles/cdk-collections.umd.js.map +1 -1
- package/bundles/cdk-collections.umd.min.js +1 -1
- package/bundles/cdk-collections.umd.min.js.map +1 -1
- package/bundles/cdk-observers.umd.js +5 -10
- package/bundles/cdk-observers.umd.js.map +1 -1
- package/bundles/cdk-observers.umd.min.js +1 -1
- package/bundles/cdk-observers.umd.min.js.map +1 -1
- package/bundles/cdk-overlay.umd.js.map +1 -1
- package/bundles/cdk-overlay.umd.min.js.map +1 -1
- package/bundles/cdk-scrolling.umd.js +1 -1
- package/bundles/cdk-scrolling.umd.js.map +1 -1
- package/bundles/cdk-scrolling.umd.min.js.map +1 -1
- package/bundles/cdk-stepper.umd.js +36 -6
- package/bundles/cdk-stepper.umd.js.map +1 -1
- package/bundles/cdk-stepper.umd.min.js +1 -1
- package/bundles/cdk-stepper.umd.min.js.map +1 -1
- package/bundles/cdk-table.umd.js +29 -9
- package/bundles/cdk-table.umd.js.map +1 -1
- package/bundles/cdk-table.umd.min.js +1 -1
- package/bundles/cdk-table.umd.min.js.map +1 -1
- package/bundles/cdk-text-field.umd.js +12 -23
- package/bundles/cdk-text-field.umd.js.map +1 -1
- package/bundles/cdk-text-field.umd.min.js +1 -1
- package/bundles/cdk-text-field.umd.min.js.map +1 -1
- package/bundles/cdk-tree.umd.js.map +1 -1
- package/bundles/cdk-tree.umd.min.js.map +1 -1
- package/bundles/cdk.umd.js +1 -1
- package/bundles/cdk.umd.js.map +1 -1
- package/bundles/cdk.umd.min.js +1 -1
- package/bundles/cdk.umd.min.js.map +1 -1
- package/collections/typings/index.metadata.json +1 -1
- package/collections/typings/selection.d.ts +6 -0
- package/esm2015/a11y.js +10 -4
- package/esm2015/a11y.js.map +1 -1
- package/esm2015/accordion.js +18 -1
- package/esm2015/accordion.js.map +1 -1
- package/esm2015/cdk.js +1 -1
- package/esm2015/cdk.js.map +1 -1
- package/esm2015/collections.js +9 -3
- package/esm2015/collections.js.map +1 -1
- package/esm2015/observers.js +4 -4
- package/esm2015/observers.js.map +1 -1
- package/esm2015/overlay.js.map +1 -1
- package/esm2015/scrolling.js +1 -1
- package/esm2015/scrolling.js.map +1 -1
- package/esm2015/stepper.js +32 -4
- package/esm2015/stepper.js.map +1 -1
- package/esm2015/table.js +30 -8
- package/esm2015/table.js.map +1 -1
- package/esm2015/text-field.js +9 -9
- package/esm2015/text-field.js.map +1 -1
- package/esm2015/tree.js.map +1 -1
- package/esm5/a11y.es5.js +9 -7
- package/esm5/a11y.es5.js.map +1 -1
- package/esm5/accordion.es5.js +25 -1
- package/esm5/accordion.es5.js.map +1 -1
- package/esm5/cdk.es5.js +1 -1
- package/esm5/cdk.es5.js.map +1 -1
- package/esm5/collections.es5.js +9 -3
- package/esm5/collections.es5.js.map +1 -1
- package/esm5/observers.es5.js +5 -10
- package/esm5/observers.es5.js.map +1 -1
- package/esm5/overlay.es5.js.map +1 -1
- package/esm5/scrolling.es5.js +1 -1
- package/esm5/scrolling.es5.js.map +1 -1
- package/esm5/stepper.es5.js +34 -4
- package/esm5/stepper.es5.js.map +1 -1
- package/esm5/table.es5.js +28 -7
- package/esm5/table.es5.js.map +1 -1
- package/esm5/text-field.es5.js +12 -23
- package/esm5/text-field.es5.js.map +1 -1
- package/esm5/tree.es5.js.map +1 -1
- package/observers/typings/index.metadata.json +1 -1
- package/observers/typings/observe-content.d.ts +6 -1
- package/overlay/typings/index.metadata.json +1 -1
- package/overlay/typings/position/connected-position-strategy.d.ts +1 -1
- package/package.json +3 -3
- package/stepper/typings/index.metadata.json +1 -1
- package/stepper/typings/stepper.d.ts +10 -2
- package/table/typings/index.metadata.json +1 -1
- package/table/typings/sticky-styler.d.ts +3 -1
- package/table/typings/table.d.ts +10 -1
- package/text-field/typings/autofill.d.ts +13 -2
- package/text-field/typings/autosize.d.ts +1 -1
- package/text-field/typings/index.metadata.json +1 -1
- package/tree/typings/index.metadata.json +1 -1
- package/tree/typings/nested-node.d.ts +2 -2
- package/tree/typings/padding.d.ts +1 -1
- package/tree/typings/tree.d.ts +2 -2
- package/typings/a11y/focus-monitor/focus-monitor.d.ts +1 -1
- package/typings/a11y/focus-trap/focus-trap.d.ts +1 -1
- package/typings/a11y/index.metadata.json +1 -1
- package/typings/accordion/accordion.d.ts +6 -1
- package/typings/accordion/index.metadata.json +1 -1
- package/typings/collections/index.metadata.json +1 -1
- package/typings/collections/selection.d.ts +6 -0
- package/typings/esm5/a11y/focus-monitor/focus-monitor.d.ts +1 -1
- package/typings/esm5/a11y/focus-trap/focus-trap.d.ts +1 -1
- package/typings/esm5/a11y/index.metadata.json +1 -1
- package/typings/esm5/accordion/accordion.d.ts +6 -1
- package/typings/esm5/accordion/index.metadata.json +1 -1
- package/typings/esm5/collections/index.metadata.json +1 -1
- package/typings/esm5/collections/selection.d.ts +6 -0
- package/typings/esm5/index.metadata.json +1 -1
- package/typings/esm5/observers/index.metadata.json +1 -1
- package/typings/esm5/observers/observe-content.d.ts +6 -1
- package/typings/esm5/overlay/index.metadata.json +1 -1
- package/typings/esm5/overlay/position/connected-position-strategy.d.ts +1 -1
- package/typings/esm5/stepper/index.metadata.json +1 -1
- package/typings/esm5/stepper/stepper.d.ts +10 -2
- package/typings/esm5/table/index.metadata.json +1 -1
- package/typings/esm5/table/sticky-styler.d.ts +3 -1
- package/typings/esm5/table/table.d.ts +10 -1
- package/typings/esm5/text-field/autofill.d.ts +13 -2
- package/typings/esm5/text-field/autosize.d.ts +1 -1
- package/typings/esm5/text-field/index.metadata.json +1 -1
- package/typings/esm5/tree/index.metadata.json +1 -1
- package/typings/esm5/tree/nested-node.d.ts +2 -2
- package/typings/esm5/tree/padding.d.ts +1 -1
- package/typings/esm5/tree/tree.d.ts +2 -2
- package/typings/index.metadata.json +1 -1
- package/typings/observers/index.metadata.json +1 -1
- package/typings/observers/observe-content.d.ts +6 -1
- package/typings/overlay/index.metadata.json +1 -1
- package/typings/overlay/position/connected-position-strategy.d.ts +1 -1
- package/typings/stepper/index.metadata.json +1 -1
- package/typings/stepper/stepper.d.ts +10 -2
- package/typings/table/index.metadata.json +1 -1
- package/typings/table/sticky-styler.d.ts +3 -1
- package/typings/table/table.d.ts +10 -1
- package/typings/text-field/autofill.d.ts +13 -2
- package/typings/text-field/autosize.d.ts +1 -1
- package/typings/text-field/index.metadata.json +1 -1
- package/typings/tree/index.metadata.json +1 -1
- package/typings/tree/nested-node.d.ts +2 -2
- package/typings/tree/padding.d.ts +1 -1
- package/typings/tree/tree.d.ts +2 -2
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/coercion"),require("@angular/core"),require("@angular/cdk/collections"),require("rxjs"),require("rxjs/operators"),require("@angular/cdk/bidi"),require("@angular/common")):"function"==typeof define&&define.amd?define("@angular/cdk/table",["exports","@angular/cdk/coercion","@angular/core","@angular/cdk/collections","rxjs","rxjs/operators","@angular/cdk/bidi","@angular/common"],t):t((e.ng=e.ng||{},e.ng.cdk=e.ng.cdk||{},e.ng.cdk.table={}),e.ng.cdk.coercion,e.ng.core,e.ng.cdk.collections,e.rxjs,e.rxjs.operators,e.ng.cdk.bidi,e.ng.common)}(this,function(e,t,o,r,n,i,s,a){"use strict";function c(e,t){function o(){this.constructor=e}w(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}function u(e){return function(e){function o(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];var r=e.apply(this,t)||this;return r._sticky=!1,r._hasStickyChanged=!1,r}return c(o,e),Object.defineProperty(o.prototype,"sticky",{get:function(){return this._sticky},set:function(e){var o=this._sticky;this._sticky=t.coerceBooleanProperty(e),this._hasStickyChanged=o!==this._sticky},enumerable:!0,configurable:!0}),o.prototype.hasStickyChanged=function(){var e=this._hasStickyChanged;return this._hasStickyChanged=!1,e},o.prototype.resetStickyChanged=function(){this._hasStickyChanged=!1},o}(e)}function l(e){return Error('Could not find column with id "'+e+'".')}function f(e){return Error('Duplicate column definition name provided: "'+e+'".')}function h(){return Error("There can only be one default row without a when predicate function.")}function d(e){return Error("Could not find a matching row definition for theprovided row data: "+JSON.stringify(e))}function p(){return Error("Missing definitions for header, footer, and row; cannot determine which columns should be rendered.")}function y(){return Error("Provided data source did not match an array, Observable, or DataSource")}function _(e,t){return e.toArray().concat(Array.from(t))}var w=function(e,t){return(w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(e,t)},m=function(){function e(e){this.template=e}return e.decorators=[{type:o.Directive,args:[{selector:"[cdkCellDef]"}]}],e.ctorParameters=function(){return[{type:o.TemplateRef}]},e}(),R=function(){function e(e){this.template=e}return e.decorators=[{type:o.Directive,args:[{selector:"[cdkHeaderCellDef]"}]}],e.ctorParameters=function(){return[{type:o.TemplateRef}]},e}(),g=function(){function e(e){this.template=e}return e.decorators=[{type:o.Directive,args:[{selector:"[cdkFooterCellDef]"}]}],e.ctorParameters=function(){return[{type:o.TemplateRef}]},e}(),C=function(){function e(){}return e}(),D=u(C),k=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t._stickyEnd=!1,t}return c(r,e),Object.defineProperty(r.prototype,"name",{get:function(){return this._name},set:function(e){e&&(this._name=e,this.cssClassFriendlyName=e.replace(/[^a-z0-9_-]/gi,"-"))},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"stickyEnd",{get:function(){return this._stickyEnd},set:function(e){var o=this._stickyEnd;this._stickyEnd=t.coerceBooleanProperty(e),this._hasStickyChanged=o!==this._stickyEnd},enumerable:!0,configurable:!0}),r.decorators=[{type:o.Directive,args:[{selector:"[cdkColumnDef]",inputs:["sticky"]}]}],r.propDecorators={name:[{type:o.Input,args:["cdkColumnDef"]}],stickyEnd:[{type:o.Input,args:["stickyEnd"]}],cell:[{type:o.ContentChild,args:[m]}],headerCell:[{type:o.ContentChild,args:[R]}],footerCell:[{type:o.ContentChild,args:[g]}]},r}(D),v=function(){function e(e,t){var o="cdk-column-"+e.cssClassFriendlyName;t.nativeElement.classList.add(o)}return e}(),S=function(e){function t(t,o){return e.call(this,t,o)||this}return c(t,e),t.decorators=[{type:o.Directive,args:[{selector:"cdk-header-cell, th[cdk-header-cell]",host:{class:"cdk-header-cell",role:"columnheader"}}]}],t.ctorParameters=function(){return[{type:k},{type:o.ElementRef}]},t}(v),b=function(e){function t(t,o){return e.call(this,t,o)||this}return c(t,e),t.decorators=[{type:o.Directive,args:[{selector:"cdk-footer-cell, td[cdk-footer-cell]",host:{class:"cdk-footer-cell",role:"gridcell"}}]}],t.ctorParameters=function(){return[{type:k},{type:o.ElementRef}]},t}(v),O=function(e){function t(t,o){return e.call(this,t,o)||this}return c(t,e),t.decorators=[{type:o.Directive,args:[{selector:"cdk-cell, td[cdk-cell]",host:{class:"cdk-cell",role:"gridcell"}}]}],t.ctorParameters=function(){return[{type:k},{type:o.ElementRef}]},t}(v),E="<ng-container cdkCellOutlet></ng-container>",P=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 F?e.headerCell.template:this instanceof I?e.footerCell.template:e.cell.template},e}(),T=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return c(t,e),t}(P),x=u(T),F=function(e){function t(t,o){return e.call(this,t,o)||this}return c(t,e),t.prototype.ngOnChanges=function(t){e.prototype.ngOnChanges.call(this,t)},t.decorators=[{type:o.Directive,args:[{selector:"[cdkHeaderRowDef]",inputs:["columns: cdkHeaderRowDef","sticky: cdkHeaderRowDefSticky"]}]}],t.ctorParameters=function(){return[{type:o.TemplateRef},{type:o.IterableDiffers}]},t}(x),H=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return c(t,e),t}(P),B=u(H),I=function(e){function t(t,o){return e.call(this,t,o)||this}return c(t,e),t.prototype.ngOnChanges=function(t){e.prototype.ngOnChanges.call(this,t)},t.decorators=[{type:o.Directive,args:[{selector:"[cdkFooterRowDef]",inputs:["columns: cdkFooterRowDef","sticky: cdkFooterRowDefSticky"]}]}],t.ctorParameters=function(){return[{type:o.TemplateRef},{type:o.IterableDiffers}]},t}(B),N=function(e){function t(t,o){return e.call(this,t,o)||this}return c(t,e),t.decorators=[{type:o.Directive,args:[{selector:"[cdkRowDef]",inputs:["columns: cdkRowDefColumns","when: cdkRowDefWhen"]}]}],t.ctorParameters=function(){return[{type:o.TemplateRef},{type:o.IterableDiffers}]},t}(P),A=function(){function e(t){this._viewContainer=t,e.mostRecentCellOutlet=this}return e.prototype.ngOnDestroy=function(){e.mostRecentCellOutlet===this&&(e.mostRecentCellOutlet=null)},e.mostRecentCellOutlet=null,e.decorators=[{type:o.Directive,args:[{selector:"[cdkCellOutlet]"}]}],e.ctorParameters=function(){return[{type:o.ViewContainerRef}]},e}(),M=function(){function e(){}return e.decorators=[{type:o.Component,args:[{selector:"cdk-header-row, tr[cdk-header-row]",template:E,host:{class:"cdk-header-row",role:"row"},changeDetection:o.ChangeDetectionStrategy.OnPush,encapsulation:o.ViewEncapsulation.None}]}],e}(),j=function(){function e(){}return e.decorators=[{type:o.Component,args:[{selector:"cdk-footer-row, tr[cdk-footer-row]",template:E,host:{class:"cdk-footer-row",role:"row"},changeDetection:o.ChangeDetectionStrategy.OnPush,encapsulation:o.ViewEncapsulation.None}]}],e}(),V=function(){function e(){}return e.decorators=[{type:o.Component,args:[{selector:"cdk-row, tr[cdk-row]",template:E,host:{class:"cdk-row",role:"row"},changeDetection:o.ChangeDetectionStrategy.OnPush,encapsulation:o.ViewEncapsulation.None}]}],e}(),L=["top","bottom","left","right"],q=function(){function e(e,t,o){this.isNativeHtmlTable=e,this.stickCellCss=t,this.direction=o}return e.prototype.clearStickyPositioning=function(e,t){for(var o=0,r=e;o<r.length;o++){var n=r[o];if(n.nodeType===n.ELEMENT_NODE){this._removeStickyStyle(n,t);for(var i=0;i<n.children.length;i++){var s=n.children[i];this._removeStickyStyle(s,t)}}}},e.prototype.updateStickyColumns=function(e,t,o){var r=t.some(function(e){return e})||o.some(function(e){return e});if(e.length&&r)for(var n=e[0],i=n.children.length,s=this._getCellWidths(n),a=this._getStickyStartColumnPositions(s,t),c=this._getStickyEndColumnPositions(s,o),u="rtl"===this.direction,l=0,f=e;l<f.length;l++)for(var h=f[l],d=0;d<i;d++){var p=h.children[d];t[d]&&this._addStickyStyle(p,u?"right":"left",a[d]),o[d]&&this._addStickyStyle(p,u?"left":"right",c[d])}},e.prototype.stickRows=function(e,t,o){for(var r="bottom"===o?e.reverse():e,n=0,i=0;i<r.length;i++)if(t[i]){var s=r[i];if(this.isNativeHtmlTable)for(var a=0;a<s.children.length;a++){var c=s.children[a];this._addStickyStyle(c,o,n)}else this._addStickyStyle(s,o,n);n+=s.getBoundingClientRect().height}},e.prototype.updateStickyFooterContainer=function(e,t){if(this.isNativeHtmlTable){var o=e.querySelector("tfoot");t.some(function(e){return!e})?this._removeStickyStyle(o,["bottom"]):this._addStickyStyle(o,"bottom",0)}},e.prototype._removeStickyStyle=function(e,t){for(var o=0,r=t;o<r.length;o++){var n=r[o];e.style[n]=""}e.style.zIndex=this._getCalculatedZIndex(e),L.some(function(t){return!!e.style[t]})||(e.style.position="",e.classList.remove(this.stickCellCss))},e.prototype._addStickyStyle=function(e,t,o){e.classList.add(this.stickCellCss),e.style[t]=o+"px",e.style.cssText+="position: -webkit-sticky; position: sticky; ",e.style.zIndex=this._getCalculatedZIndex(e)},e.prototype._getCalculatedZIndex=function(e){for(var t={top:100,bottom:10,left:1,right:1},o=0,r=0,n=L;r<n.length;r++){var i=n[r];e.style[i]&&(o+=t[i])}return o?""+o:""},e.prototype._getCellWidths=function(e){for(var t=[],o=e.children,r=0;r<o.length;r++){var n=o[r];t.push(n.getBoundingClientRect().width)}return t},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}(),U=function(){function e(e,t){this.viewContainer=e,this.elementRef=t}return e.decorators=[{type:o.Directive,args:[{selector:"[rowOutlet]"}]}],e.ctorParameters=function(){return[{type:o.ViewContainerRef},{type:o.ElementRef}]},e}(),W=function(){function e(e,t){this.viewContainer=e,this.elementRef=t}return e.decorators=[{type:o.Directive,args:[{selector:"[headerRowOutlet]"}]}],e.ctorParameters=function(){return[{type:o.ViewContainerRef},{type:o.ElementRef}]},e}(),z=function(){function e(e,t){this.viewContainer=e,this.elementRef=t}return e.decorators=[{type:o.Directive,args:[{selector:"[footerRowOutlet]"}]}],e.ctorParameters=function(){return[{type:o.ViewContainerRef},{type:o.ElementRef}]},e}(),K="\n <ng-container headerRowOutlet></ng-container>\n <ng-container rowOutlet></ng-container>\n <ng-container footerRowOutlet></ng-container>",Z=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}c(t,e)}(o.EmbeddedViewRef),function(){function e(e,t,o,r,i){this._differs=e,this._changeDetectorRef=t,this._elementRef=o,this._dir=i,this._onDestroy=new n.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._cachedRenderRowsMap=new Map,this.stickyCssClass="cdk-table-sticky",this._multiTemplateDataRows=!1,this.viewChange=new n.BehaviorSubject({start:0,end:Number.MAX_VALUE}),r||this._elementRef.nativeElement.setAttribute("role","grid"),this._isNativeHtmlTable="TABLE"===this._elementRef.nativeElement.nodeName}return Object.defineProperty(e.prototype,"trackBy",{get:function(){return this._trackByFn},set:function(e){o.isDevMode()&&null!=e&&"function"!=typeof e&&console&&console.warn&&console.warn("trackBy must be a function, but received "+JSON.stringify(e)+"."),this._trackByFn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataSource",{get:function(){return this._dataSource},set:function(e){this._dataSource!==e&&this._switchDataSource(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"multiTemplateDataRows",{get:function(){return this._multiTemplateDataRows},set:function(e){this._multiTemplateDataRows=t.coerceBooleanProperty(e),this._rowOutlet.viewContainer.length&&this._forceRenderDataRows()},enumerable:!0,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})},e.prototype.ngAfterContentChecked=function(){if(this._cacheRowDefs(),this._cacheColumnDefs(),!this._headerRowDefs.length&&!this._footerRowDefs.length&&!this._rowDefs.length)throw p();this._renderUpdatedColumns(),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._checkStickyStates()},e.prototype.ngOnDestroy=function(){this._rowOutlet.viewContainer.clear(),this._headerRowOutlet.viewContainer.clear(),this._footerRowOutlet.viewContainer.clear(),this._cachedRenderRowsMap.clear(),this._onDestroy.next(),this._onDestroy.complete(),this.dataSource instanceof r.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;t.forEachOperation(function(t,r,n){if(null==t.previousIndex)e._insertRow(t.item,n);else if(null==n)o.remove(r);else{var i=o.get(r);o.move(i,n)}}),this._updateRowIndexContext(),t.forEachIdentityChange(function(e){o.get(e.currentIndex).context.$implicit=e.item.data}),this.updateStickyColumnStyles()}},e.prototype.setHeaderRowDef=function(e){this._customHeaderRowDefs=new Set([e]),this._headerRowDefChanged=!0},e.prototype.setFooterRowDef=function(e){this._customFooterRowDefs=new Set([e]),this._footerRowDefChanged=!0},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.updateStickyHeaderRowStyles=function(){var e=this._getRenderedRows(this._headerRowOutlet);this._stickyStyler.clearStickyPositioning(e,["top"]);var t=this._headerRowDefs.map(function(e){return e.sticky});this._stickyStyler.stickRows(e,t,"top"),this._headerRowDefs.forEach(function(e){return e.resetStickyChanged()})},e.prototype.updateStickyFooterRowStyles=function(){var e=this._getRenderedRows(this._footerRowOutlet);this._stickyStyler.clearStickyPositioning(e,["bottom"]);var t=this._footerRowDefs.map(function(e){return e.sticky});this._stickyStyler.stickRows(e,t,"bottom"),this._stickyStyler.updateStickyFooterContainer(this._elementRef.nativeElement,t),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._stickyStyler.clearStickyPositioning(t.concat(o,r),["left","right"]),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(),_(this._contentColumnDefs,this._customColumnDefs).forEach(function(t){if(e._columnDefsByName.has(t.name))throw f(t.name);e._columnDefsByName.set(t.name,t)})},e.prototype._cacheRowDefs=function(){this._headerRowDefs=_(this._contentHeaderRowDefs,this._customHeaderRowDefs),this._footerRowDefs=_(this._contentFooterRowDefs,this._customFooterRowDefs),this._rowDefs=_(this._contentRowDefs,this._customRowDefs);var e=this._rowDefs.filter(function(e){return!e.when});if(!this.multiTemplateDataRows&&e.length>1)throw h();this._defaultRowDef=e[0]},e.prototype._renderUpdatedColumns=function(){var e=function(e,t){return e||!!t.getColumnsDiff()};this._rowDefs.reduce(e,!1)&&this._forceRenderDataRows(),this._headerRowDefs.reduce(e,!1)&&this._forceRenderHeaderRows(),this._footerRowDefs.reduce(e,!1)&&this._forceRenderFooterRows()},e.prototype._switchDataSource=function(e){this._data=[],this.dataSource instanceof r.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=this;if(this.dataSource){var t;if(this.dataSource.connect instanceof Function?t=this.dataSource.connect(this):this.dataSource instanceof n.Observable?t=this.dataSource:Array.isArray(this.dataSource)&&(t=n.of(this.dataSource)),void 0===t)throw y();this._renderChangeSubscription=t.pipe(i.takeUntil(this._onDestroy)).subscribe(function(t){e._data=t||[],e.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(),this.updateStickyColumnStyles()},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(),this.updateStickyColumnStyles()},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)},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)}if(!o.length)throw d(e);return o},e.prototype._insertRow=function(e,t){var o=e.rowDef,r={$implicit:e.data};this._renderRow(this._rowOutlet,o,t,r)},e.prototype._renderRow=function(e,t,o,r){void 0===r&&(r={}),e.viewContainer.createEmbeddedView(t.template,r,o);for(var n=0,i=this._getCellTemplates(t);n<i.length;n++){var s=i[n];A.mostRecentCellOutlet&&A.mostRecentCellOutlet._viewContainer.createEmbeddedView(s,r)}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),n=r.context;n.count=o,n.first=0===t,n.last=t===o-1,n.even=t%2==0,n.odd=!n.even,this.multiTemplateDataRows?(n.dataIndex=this._renderRows[t].dataIndex,n.renderIndex=t):n.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);if(!r)throw l(o);return e.extractCellTemplate(r)}):[]},e.prototype._applyNativeTableSections=function(){for(var e=[{tag:"thead",outlet:this._headerRowOutlet},{tag:"tbody",outlet:this._rowOutlet},{tag:"tfoot",outlet:this._footerRowOutlet}],t=0,o=e;t<o.length;t++){var r=o[t],n=document.createElement(r.tag);n.appendChild(r.outlet.elementRef.nativeElement),this._elementRef.nativeElement.appendChild(n)}},e.prototype._forceRenderDataRows=function(){this._dataDiffer.diff([]),this._rowOutlet.viewContainer.clear(),this.renderRows(),this.updateStickyColumnStyles()},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.updateStickyColumnStyles()},e.prototype._setupStickyStyler=function(){var e=this,t=this._dir?this._dir.value:"ltr";this._stickyStyler=new q(this._isNativeHtmlTable,this.stickyCssClass,t),(this._dir?this._dir.change:n.of()).pipe(i.takeUntil(this._onDestroy)).subscribe(function(t){e._stickyStyler.direction=t,e.updateStickyColumnStyles()})},e.decorators=[{type:o.Component,args:[{selector:"cdk-table, table[cdk-table]",exportAs:"cdkTable",template:K,host:{class:"cdk-table"},encapsulation:o.ViewEncapsulation.None,changeDetection:o.ChangeDetectionStrategy.OnPush}]}],e.ctorParameters=function(){return[{type:o.IterableDiffers},{type:o.ChangeDetectorRef},{type:o.ElementRef},{type:void 0,decorators:[{type:o.Attribute,args:["role"]}]},{type:s.Directionality,decorators:[{type:o.Optional}]}]},e.propDecorators={trackBy:[{type:o.Input}],dataSource:[{type:o.Input}],multiTemplateDataRows:[{type:o.Input}],_rowOutlet:[{type:o.ViewChild,args:[U]}],_headerRowOutlet:[{type:o.ViewChild,args:[W]}],_footerRowOutlet:[{type:o.ViewChild,args:[z]}],_contentColumnDefs:[{type:o.ContentChildren,args:[k]}],_contentRowDefs:[{type:o.ContentChildren,args:[N]}],_contentHeaderRowDefs:[{type:o.ContentChildren,args:[F]}],_contentFooterRowDefs:[{type:o.ContentChildren,args:[I]}]},e}()),J=[Z,N,m,A,R,g,k,O,V,S,b,M,F,j,I,U,W,z],$=function(){function e(){}return e.decorators=[{type:o.NgModule,args:[{imports:[a.CommonModule],exports:J,declarations:J}]}],e}();e.DataSource=r.DataSource,e.DataRowOutlet=U,e.HeaderRowOutlet=W,e.FooterRowOutlet=z,e.CDK_TABLE_TEMPLATE=K,e.CdkTable=Z,e.CdkCellDef=m,e.CdkHeaderCellDef=R,e.CdkFooterCellDef=g,e.CdkColumnDefBase=C,e._CdkColumnDefBase=D,e.CdkColumnDef=k,e.BaseCdkCell=v,e.CdkHeaderCell=S,e.CdkFooterCell=b,e.CdkCell=O,e.CDK_ROW_TEMPLATE=E,e.BaseRowDef=P,e.CdkHeaderRowDefBase=T,e._CdkHeaderRowDefBase=x,e.CdkHeaderRowDef=F,e.CdkFooterRowDefBase=H,e._CdkFooterRowDefBase=B,e.CdkFooterRowDef=I,e.CdkRowDef=N,e.CdkCellOutlet=A,e.CdkHeaderRow=M,e.CdkFooterRow=j,e.CdkRow=V,e.CdkTableModule=$,e.STICKY_DIRECTIONS=L,e.StickyStyler=q,e.mixinHasStickyInput=u,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
8
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/coercion"),require("@angular/core"),require("@angular/cdk/collections"),require("@angular/common"),require("rxjs"),require("rxjs/operators"),require("@angular/cdk/bidi"),require("@angular/cdk/platform")):"function"==typeof define&&define.amd?define("@angular/cdk/table",["exports","@angular/cdk/coercion","@angular/core","@angular/cdk/collections","@angular/common","rxjs","rxjs/operators","@angular/cdk/bidi","@angular/cdk/platform"],t):t((e.ng=e.ng||{},e.ng.cdk=e.ng.cdk||{},e.ng.cdk.table={}),e.ng.cdk.coercion,e.ng.core,e.ng.cdk.collections,e.ng.common,e.rxjs,e.rxjs.operators,e.ng.cdk.bidi,e.ng.cdk.platform)}(this,function(e,t,o,r,n,i,s,a,c){"use strict";function l(e,t){function o(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}function u(e){return function(e){function o(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];var r=e.apply(this,t)||this;return r._sticky=!1,r._hasStickyChanged=!1,r}return l(o,e),Object.defineProperty(o.prototype,"sticky",{get:function(){return this._sticky},set:function(e){var o=this._sticky;this._sticky=t.coerceBooleanProperty(e),this._hasStickyChanged=o!==this._sticky},enumerable:!0,configurable:!0}),o.prototype.hasStickyChanged=function(){var e=this._hasStickyChanged;return this._hasStickyChanged=!1,e},o.prototype.resetStickyChanged=function(){this._hasStickyChanged=!1},o}(e)}function f(e){return Error('Could not find column with id "'+e+'".')}function h(e){return Error('Duplicate column definition name provided: "'+e+'".')}function d(){return Error("There can only be one default row without a when predicate function.")}function p(e){return Error("Could not find a matching row definition for theprovided row data: "+JSON.stringify(e))}function y(){return Error("Missing definitions for header, footer, and row; cannot determine which columns should be rendered.")}function _(){return Error("Provided data source did not match an array, Observable, or DataSource")}function w(e,t){return e.toArray().concat(Array.from(t))}var m=function(e,t){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(e,t)},g=function(){function e(e){this.template=e}return e.decorators=[{type:o.Directive,args:[{selector:"[cdkCellDef]"}]}],e.ctorParameters=function(){return[{type:o.TemplateRef}]},e}(),R=function(){function e(e){this.template=e}return e.decorators=[{type:o.Directive,args:[{selector:"[cdkHeaderCellDef]"}]}],e.ctorParameters=function(){return[{type:o.TemplateRef}]},e}(),C=function(){function e(e){this.template=e}return e.decorators=[{type:o.Directive,args:[{selector:"[cdkFooterCellDef]"}]}],e.ctorParameters=function(){return[{type:o.TemplateRef}]},e}(),D=function(){function e(){}return e}(),k=u(D),v=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t._stickyEnd=!1,t}return l(r,e),Object.defineProperty(r.prototype,"name",{get:function(){return this._name},set:function(e){e&&(this._name=e,this.cssClassFriendlyName=e.replace(/[^a-z0-9_-]/gi,"-"))},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"stickyEnd",{get:function(){return this._stickyEnd},set:function(e){var o=this._stickyEnd;this._stickyEnd=t.coerceBooleanProperty(e),this._hasStickyChanged=o!==this._stickyEnd},enumerable:!0,configurable:!0}),r.decorators=[{type:o.Directive,args:[{selector:"[cdkColumnDef]",inputs:["sticky"]}]}],r.propDecorators={name:[{type:o.Input,args:["cdkColumnDef"]}],stickyEnd:[{type:o.Input,args:["stickyEnd"]}],cell:[{type:o.ContentChild,args:[g]}],headerCell:[{type:o.ContentChild,args:[R]}],footerCell:[{type:o.ContentChild,args:[C]}]},r}(k),S=function(){function e(e,t){var o="cdk-column-"+e.cssClassFriendlyName;t.nativeElement.classList.add(o)}return e}(),b=function(e){function t(t,o){return e.call(this,t,o)||this}return l(t,e),t.decorators=[{type:o.Directive,args:[{selector:"cdk-header-cell, th[cdk-header-cell]",host:{class:"cdk-header-cell",role:"columnheader"}}]}],t.ctorParameters=function(){return[{type:v},{type:o.ElementRef}]},t}(S),O=function(e){function t(t,o){return e.call(this,t,o)||this}return l(t,e),t.decorators=[{type:o.Directive,args:[{selector:"cdk-footer-cell, td[cdk-footer-cell]",host:{class:"cdk-footer-cell",role:"gridcell"}}]}],t.ctorParameters=function(){return[{type:v},{type:o.ElementRef}]},t}(S),E=function(e){function t(t,o){return e.call(this,t,o)||this}return l(t,e),t.decorators=[{type:o.Directive,args:[{selector:"cdk-cell, td[cdk-cell]",host:{class:"cdk-cell",role:"gridcell"}}]}],t.ctorParameters=function(){return[{type:v},{type:o.ElementRef}]},t}(S),P="<ng-container cdkCellOutlet></ng-container>",T=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 B?e.headerCell.template:this instanceof N?e.footerCell.template:e.cell.template},e}(),x=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t}(T),F=u(x),B=function(e){function t(t,o){return e.call(this,t,o)||this}return l(t,e),t.prototype.ngOnChanges=function(t){e.prototype.ngOnChanges.call(this,t)},t.decorators=[{type:o.Directive,args:[{selector:"[cdkHeaderRowDef]",inputs:["columns: cdkHeaderRowDef","sticky: cdkHeaderRowDefSticky"]}]}],t.ctorParameters=function(){return[{type:o.TemplateRef},{type:o.IterableDiffers}]},t}(F),H=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t}(T),I=u(H),N=function(e){function t(t,o){return e.call(this,t,o)||this}return l(t,e),t.prototype.ngOnChanges=function(t){e.prototype.ngOnChanges.call(this,t)},t.decorators=[{type:o.Directive,args:[{selector:"[cdkFooterRowDef]",inputs:["columns: cdkFooterRowDef","sticky: cdkFooterRowDefSticky"]}]}],t.ctorParameters=function(){return[{type:o.TemplateRef},{type:o.IterableDiffers}]},t}(I),M=function(e){function t(t,o){return e.call(this,t,o)||this}return l(t,e),t.decorators=[{type:o.Directive,args:[{selector:"[cdkRowDef]",inputs:["columns: cdkRowDefColumns","when: cdkRowDefWhen"]}]}],t.ctorParameters=function(){return[{type:o.TemplateRef},{type:o.IterableDiffers}]},t}(T),A=function(){function e(t){this._viewContainer=t,e.mostRecentCellOutlet=this}return e.prototype.ngOnDestroy=function(){e.mostRecentCellOutlet===this&&(e.mostRecentCellOutlet=null)},e.mostRecentCellOutlet=null,e.decorators=[{type:o.Directive,args:[{selector:"[cdkCellOutlet]"}]}],e.ctorParameters=function(){return[{type:o.ViewContainerRef}]},e}(),j=function(){function e(){}return e.decorators=[{type:o.Component,args:[{selector:"cdk-header-row, tr[cdk-header-row]",template:P,host:{class:"cdk-header-row",role:"row"},changeDetection:o.ChangeDetectionStrategy.OnPush,encapsulation:o.ViewEncapsulation.None}]}],e}(),V=function(){function e(){}return e.decorators=[{type:o.Component,args:[{selector:"cdk-footer-row, tr[cdk-footer-row]",template:P,host:{class:"cdk-footer-row",role:"row"},changeDetection:o.ChangeDetectionStrategy.OnPush,encapsulation:o.ViewEncapsulation.None}]}],e}(),q=function(){function e(){}return e.decorators=[{type:o.Component,args:[{selector:"cdk-row, tr[cdk-row]",template:P,host:{class:"cdk-row",role:"row"},changeDetection:o.ChangeDetectionStrategy.OnPush,encapsulation:o.ViewEncapsulation.None}]}],e}(),L=["top","bottom","left","right"],U=function(){function e(e,t,o,r){void 0===r&&(r=!0),this.isNativeHtmlTable=e,this.stickCellCss=t,this.direction=o,this._isBrowser=r}return e.prototype.clearStickyPositioning=function(e,t){for(var o=0,r=e;o<r.length;o++){var n=r[o];if(n.nodeType===n.ELEMENT_NODE){this._removeStickyStyle(n,t);for(var i=0;i<n.children.length;i++){var s=n.children[i];this._removeStickyStyle(s,t)}}}},e.prototype.updateStickyColumns=function(e,t,o){var r=t.some(function(e){return e})||o.some(function(e){return e});if(e.length&&r&&this._isBrowser)for(var n=e[0],i=n.children.length,s=this._getCellWidths(n),a=this._getStickyStartColumnPositions(s,t),c=this._getStickyEndColumnPositions(s,o),l="rtl"===this.direction,u=0,f=e;u<f.length;u++)for(var h=f[u],d=0;d<i;d++){var p=h.children[d];t[d]&&this._addStickyStyle(p,l?"right":"left",a[d]),o[d]&&this._addStickyStyle(p,l?"left":"right",c[d])}},e.prototype.stickRows=function(e,t,o){if(this._isBrowser)for(var r="bottom"===o?e.reverse():e,n=0,i=0;i<r.length;i++)if(t[i]){var s=r[i];if(this.isNativeHtmlTable)for(var a=0;a<s.children.length;a++){var c=s.children[a];this._addStickyStyle(c,o,n)}else this._addStickyStyle(s,o,n);n+=s.getBoundingClientRect().height}},e.prototype.updateStickyFooterContainer=function(e,t){if(this.isNativeHtmlTable){var o=e.querySelector("tfoot");t.some(function(e){return!e})?this._removeStickyStyle(o,["bottom"]):this._addStickyStyle(o,"bottom",0)}},e.prototype._removeStickyStyle=function(e,t){for(var o=0,r=t;o<r.length;o++){var n=r[o];e.style[n]=""}e.style.zIndex=this._getCalculatedZIndex(e),L.some(function(t){return!!e.style[t]})||(e.style.position="",e.classList.remove(this.stickCellCss))},e.prototype._addStickyStyle=function(e,t,o){e.classList.add(this.stickCellCss),e.style[t]=o+"px",e.style.cssText+="position: -webkit-sticky; position: sticky; ",e.style.zIndex=this._getCalculatedZIndex(e)},e.prototype._getCalculatedZIndex=function(e){for(var t={top:100,bottom:10,left:1,right:1},o=0,r=0,n=L;r<n.length;r++){var i=n[r];e.style[i]&&(o+=t[i])}return o?""+o:""},e.prototype._getCellWidths=function(e){for(var t=[],o=e.children,r=0;r<o.length;r++){var n=o[r];t.push(n.getBoundingClientRect().width)}return t},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}(),W=function(){function e(e,t){this.viewContainer=e,this.elementRef=t}return e.decorators=[{type:o.Directive,args:[{selector:"[rowOutlet]"}]}],e.ctorParameters=function(){return[{type:o.ViewContainerRef},{type:o.ElementRef}]},e}(),z=function(){function e(e,t){this.viewContainer=e,this.elementRef=t}return e.decorators=[{type:o.Directive,args:[{selector:"[headerRowOutlet]"}]}],e.ctorParameters=function(){return[{type:o.ViewContainerRef},{type:o.ElementRef}]},e}(),K=function(){function e(e,t){this.viewContainer=e,this.elementRef=t}return e.decorators=[{type:o.Directive,args:[{selector:"[footerRowOutlet]"}]}],e.ctorParameters=function(){return[{type:o.ViewContainerRef},{type:o.ElementRef}]},e}(),Z="\n <ng-container headerRowOutlet></ng-container>\n <ng-container rowOutlet></ng-container>\n <ng-container footerRowOutlet></ng-container>",J=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}l(t,e)}(o.EmbeddedViewRef),function(){function e(e,t,o,r,n,s,a){this._differs=e,this._changeDetectorRef=t,this._elementRef=o,this._dir=n,this._platform=a,this._onDestroy=new i.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._cachedRenderRowsMap=new Map,this.stickyCssClass="cdk-table-sticky",this._multiTemplateDataRows=!1,this.viewChange=new i.BehaviorSubject({start:0,end:Number.MAX_VALUE}),r||this._elementRef.nativeElement.setAttribute("role","grid"),this._document=s,this._isNativeHtmlTable="TABLE"===this._elementRef.nativeElement.nodeName}return Object.defineProperty(e.prototype,"trackBy",{get:function(){return this._trackByFn},set:function(e){o.isDevMode()&&null!=e&&"function"!=typeof e&&console&&console.warn&&console.warn("trackBy must be a function, but received "+JSON.stringify(e)+"."),this._trackByFn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataSource",{get:function(){return this._dataSource},set:function(e){this._dataSource!==e&&this._switchDataSource(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"multiTemplateDataRows",{get:function(){return this._multiTemplateDataRows},set:function(e){this._multiTemplateDataRows=t.coerceBooleanProperty(e),this._rowOutlet.viewContainer.length&&this._forceRenderDataRows()},enumerable:!0,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})},e.prototype.ngAfterContentChecked=function(){if(this._cacheRowDefs(),this._cacheColumnDefs(),!this._headerRowDefs.length&&!this._footerRowDefs.length&&!this._rowDefs.length)throw y();this._renderUpdatedColumns(),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._checkStickyStates()},e.prototype.ngOnDestroy=function(){this._rowOutlet.viewContainer.clear(),this._headerRowOutlet.viewContainer.clear(),this._footerRowOutlet.viewContainer.clear(),this._cachedRenderRowsMap.clear(),this._onDestroy.next(),this._onDestroy.complete(),this.dataSource instanceof r.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;t.forEachOperation(function(t,r,n){if(null==t.previousIndex)e._insertRow(t.item,n);else if(null==n)o.remove(r);else{var i=o.get(r);o.move(i,n)}}),this._updateRowIndexContext(),t.forEachIdentityChange(function(e){o.get(e.currentIndex).context.$implicit=e.item.data}),this.updateStickyColumnStyles()}},e.prototype.setHeaderRowDef=function(e){this._customHeaderRowDefs=new Set([e]),this._headerRowDefChanged=!0},e.prototype.setFooterRowDef=function(e){this._customFooterRowDefs=new Set([e]),this._footerRowDefChanged=!0},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.updateStickyHeaderRowStyles=function(){var e=this._getRenderedRows(this._headerRowOutlet);this._stickyStyler.clearStickyPositioning(e,["top"]);var t=this._headerRowDefs.map(function(e){return e.sticky});this._stickyStyler.stickRows(e,t,"top"),this._headerRowDefs.forEach(function(e){return e.resetStickyChanged()})},e.prototype.updateStickyFooterRowStyles=function(){var e=this._getRenderedRows(this._footerRowOutlet);this._stickyStyler.clearStickyPositioning(e,["bottom"]);var t=this._footerRowDefs.map(function(e){return e.sticky});this._stickyStyler.stickRows(e,t,"bottom"),this._stickyStyler.updateStickyFooterContainer(this._elementRef.nativeElement,t),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._stickyStyler.clearStickyPositioning(t.concat(o,r),["left","right"]),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(),w(this._contentColumnDefs,this._customColumnDefs).forEach(function(t){if(e._columnDefsByName.has(t.name))throw h(t.name);e._columnDefsByName.set(t.name,t)})},e.prototype._cacheRowDefs=function(){this._headerRowDefs=w(this._contentHeaderRowDefs,this._customHeaderRowDefs),this._footerRowDefs=w(this._contentFooterRowDefs,this._customFooterRowDefs),this._rowDefs=w(this._contentRowDefs,this._customRowDefs);var e=this._rowDefs.filter(function(e){return!e.when});if(!this.multiTemplateDataRows&&e.length>1)throw d();this._defaultRowDef=e[0]},e.prototype._renderUpdatedColumns=function(){var e=function(e,t){return e||!!t.getColumnsDiff()};this._rowDefs.reduce(e,!1)&&this._forceRenderDataRows(),this._headerRowDefs.reduce(e,!1)&&this._forceRenderHeaderRows(),this._footerRowDefs.reduce(e,!1)&&this._forceRenderFooterRows()},e.prototype._switchDataSource=function(e){this._data=[],this.dataSource instanceof r.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=this;if(this.dataSource){var t;if(this.dataSource.connect instanceof Function?t=this.dataSource.connect(this):this.dataSource instanceof i.Observable?t=this.dataSource:Array.isArray(this.dataSource)&&(t=i.of(this.dataSource)),void 0===t)throw _();this._renderChangeSubscription=t.pipe(s.takeUntil(this._onDestroy)).subscribe(function(t){e._data=t||[],e.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(),this.updateStickyColumnStyles()},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(),this.updateStickyColumnStyles()},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)},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)}if(!o.length)throw p(e);return o},e.prototype._insertRow=function(e,t){var o=e.rowDef,r={$implicit:e.data};this._renderRow(this._rowOutlet,o,t,r)},e.prototype._renderRow=function(e,t,o,r){void 0===r&&(r={}),e.viewContainer.createEmbeddedView(t.template,r,o);for(var n=0,i=this._getCellTemplates(t);n<i.length;n++){var s=i[n];A.mostRecentCellOutlet&&A.mostRecentCellOutlet._viewContainer.createEmbeddedView(s,r)}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),n=r.context;n.count=o,n.first=0===t,n.last=t===o-1,n.even=t%2==0,n.odd=!n.even,this.multiTemplateDataRows?(n.dataIndex=this._renderRows[t].dataIndex,n.renderIndex=t):n.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);if(!r)throw f(o);return e.extractCellTemplate(r)}):[]},e.prototype._applyNativeTableSections=function(){for(var e=[{tag:"thead",outlet:this._headerRowOutlet},{tag:"tbody",outlet:this._rowOutlet},{tag:"tfoot",outlet:this._footerRowOutlet}],t=0,o=e;t<o.length;t++){var r=o[t],n=this._document||document,i=n.createElement(r.tag);i.appendChild(r.outlet.elementRef.nativeElement),this._elementRef.nativeElement.appendChild(i)}},e.prototype._forceRenderDataRows=function(){this._dataDiffer.diff([]),this._rowOutlet.viewContainer.clear(),this.renderRows(),this.updateStickyColumnStyles()},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.updateStickyColumnStyles()},e.prototype._setupStickyStyler=function(){var e=this,t=this._dir?this._dir.value:"ltr";this._stickyStyler=new U(this._isNativeHtmlTable,this.stickyCssClass,t,!this._platform||this._platform.isBrowser),(this._dir?this._dir.change:i.of()).pipe(s.takeUntil(this._onDestroy)).subscribe(function(t){e._stickyStyler.direction=t,e.updateStickyColumnStyles()})},e.decorators=[{type:o.Component,args:[{selector:"cdk-table, table[cdk-table]",exportAs:"cdkTable",template:Z,host:{class:"cdk-table"},encapsulation:o.ViewEncapsulation.None,changeDetection:o.ChangeDetectionStrategy.OnPush}]}],e.ctorParameters=function(){return[{type:o.IterableDiffers},{type:o.ChangeDetectorRef},{type:o.ElementRef},{type:void 0,decorators:[{type:o.Attribute,args:["role"]}]},{type:a.Directionality,decorators:[{type:o.Optional}]},{type:void 0,decorators:[{type:o.Inject,args:[n.DOCUMENT]}]},{type:c.Platform}]},e.propDecorators={trackBy:[{type:o.Input}],dataSource:[{type:o.Input}],multiTemplateDataRows:[{type:o.Input}],_rowOutlet:[{type:o.ViewChild,args:[W]}],_headerRowOutlet:[{type:o.ViewChild,args:[z]}],_footerRowOutlet:[{type:o.ViewChild,args:[K]}],_contentColumnDefs:[{type:o.ContentChildren,args:[v]}],_contentRowDefs:[{type:o.ContentChildren,args:[M]}],_contentHeaderRowDefs:[{type:o.ContentChildren,args:[B]}],_contentFooterRowDefs:[{type:o.ContentChildren,args:[N]}]},e}()),$=[J,M,g,A,R,C,v,E,q,b,O,j,B,V,N,W,z,K],X=function(){function e(){}return e.decorators=[{type:o.NgModule,args:[{imports:[n.CommonModule],exports:$,declarations:$}]}],e}();e.DataSource=r.DataSource,e.DataRowOutlet=W,e.HeaderRowOutlet=z,e.FooterRowOutlet=K,e.CDK_TABLE_TEMPLATE=Z,e.CdkTable=J,e.CdkCellDef=g,e.CdkHeaderCellDef=R,e.CdkFooterCellDef=C,e.CdkColumnDefBase=D,e._CdkColumnDefBase=k,e.CdkColumnDef=v,e.BaseCdkCell=S,e.CdkHeaderCell=b,e.CdkFooterCell=O,e.CdkCell=E,e.CDK_ROW_TEMPLATE=P,e.BaseRowDef=T,e.CdkHeaderRowDefBase=x,e._CdkHeaderRowDefBase=F,e.CdkHeaderRowDef=B,e.CdkFooterRowDefBase=H,e._CdkFooterRowDefBase=I,e.CdkFooterRowDef=N,e.CdkRowDef=M,e.CdkCellOutlet=A,e.CdkHeaderRow=j,e.CdkFooterRow=V,e.CdkRow=q,e.CdkTableModule=X,e.STICKY_DIRECTIONS=L,e.StickyStyler=U,e.mixinHasStickyInput=u,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
9
9
|
//# sourceMappingURL=cdk-table.umd.min.js.map
|