@angular/cdk 9.2.0-next.0 → 9.2.0
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/bundles/cdk-coercion.umd.js +0 -1
- package/bundles/cdk-coercion.umd.js.map +1 -1
- package/bundles/cdk-coercion.umd.min.js.map +1 -1
- package/bundles/cdk-table.umd.js +58 -27
- package/bundles/cdk-table.umd.js.map +1 -1
- package/bundles/cdk-table.umd.min.js +12 -5
- package/bundles/cdk-table.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/coercion/array.d.ts +1 -0
- package/esm2015/coercion/array.js +1 -2
- package/esm2015/table/cell.js +18 -8
- package/esm2015/table/public-api.js +3 -2
- package/esm2015/table/row.js +24 -8
- package/esm2015/table/table.js +26 -12
- package/esm2015/table/text-column.js +3 -26
- package/esm2015/table/tokens.js +44 -0
- package/esm2015/version.js +1 -1
- package/esm5/coercion/array.js +1 -2
- package/esm5/table/cell.js +13 -8
- package/esm5/table/public-api.js +2 -1
- package/esm5/table/row.js +21 -11
- package/esm5/table/table.js +16 -11
- package/esm5/table/text-column.js +3 -4
- package/esm5/table/tokens.js +16 -0
- package/esm5/version.js +1 -1
- package/fesm2015/cdk.js +1 -1
- package/fesm2015/cdk.js.map +1 -1
- package/fesm2015/coercion.js +0 -1
- package/fesm2015/coercion.js.map +1 -1
- package/fesm2015/table.js +98 -49
- package/fesm2015/table.js.map +1 -1
- package/fesm5/cdk.js +1 -1
- package/fesm5/cdk.js.map +1 -1
- package/fesm5/coercion.js +0 -1
- package/fesm5/coercion.js.map +1 -1
- package/fesm5/table.js +59 -29
- package/fesm5/table.js.map +1 -1
- package/package.json +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/table/cell.d.ts +2 -0
- package/table/index.metadata.json +1 -1
- package/table/public-api.d.ts +1 -0
- package/table/row.d.ts +6 -3
- package/table/table.d.ts +2 -0
- package/table/text-column.d.ts +2 -13
- package/table/tokens.d.ts +25 -0
|
@@ -27,7 +27,7 @@ function p(e){return function(e){function t(){for(var t=[],o=0;o<arguments.lengt
|
|
|
27
27
|
*
|
|
28
28
|
* Use of this source code is governed by an MIT-style license that can be
|
|
29
29
|
* found in the LICENSE file at https://angular.io/license
|
|
30
|
-
*/var y,_=function(){function e(e){this.template=e}return e.decorators=[{type:s.Directive,args:[{selector:"[cdkCellDef]"}]}],e.ctorParameters=function(){return[{type:s.TemplateRef}]},e}(),
|
|
30
|
+
*/var y,_=new s.InjectionToken("CDK_TABLE"),m=new s.InjectionToken("text-column-options"),w=function(){function e(e){this.template=e}return e.decorators=[{type:s.Directive,args:[{selector:"[cdkCellDef]"}]}],e.ctorParameters=function(){return[{type:s.TemplateRef}]},e}(),g=function(){function e(e){this.template=e}return e.decorators=[{type:s.Directive,args:[{selector:"[cdkHeaderCellDef]"}]}],e.ctorParameters=function(){return[{type:s.TemplateRef}]},e}(),D=function(){function e(e){this.template=e}return e.decorators=[{type:s.Directive,args:[{selector:"[cdkFooterCellDef]"}]}],e.ctorParameters=function(){return[{type:s.TemplateRef}]},e}(),R=function(e){function t(t){var o=e.call(this)||this;return o._table=t,o._stickyEnd=!1,o}return u(t,e),Object.defineProperty(t.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(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:!0,configurable:!0}),t.decorators=[{type:s.Directive,args:[{selector:"[cdkColumnDef]",inputs:["sticky"],providers:[{provide:"MAT_SORT_HEADER_COLUMN_DEF",useExisting:t}]}]}],t.ctorParameters=function(){return[{type:void 0,decorators:[{type:s.Inject,args:[_]},{type:s.Optional}]}]},t.propDecorators={name:[{type:s.Input,args:["cdkColumnDef"]}],stickyEnd:[{type:s.Input,args:["stickyEnd"]}],cell:[{type:s.ContentChild,args:[w]}],headerCell:[{type:s.ContentChild,args:[g]}],footerCell:[{type:s.ContentChild,args:[D]}]},t}(p((function C(){}))),k=function(e){function t(t,o){return e.call(this,t,o)||this}return u(t,e),t.decorators=[{type:s.Directive,args:[{selector:"cdk-header-cell, th[cdk-header-cell]",host:{class:"cdk-header-cell",role:"columnheader"}}]}],t.ctorParameters=function(){return[{type:R},{type:s.ElementRef}]},t}(y=function y(e,t){t.nativeElement.classList.add("cdk-column-"+e.cssClassFriendlyName)}),v=function(e){function t(t,o){return e.call(this,t,o)||this}return u(t,e),t.decorators=[{type:s.Directive,args:[{selector:"cdk-footer-cell, td[cdk-footer-cell]",host:{class:"cdk-footer-cell",role:"gridcell"}}]}],t.ctorParameters=function(){return[{type:R},{type:s.ElementRef}]},t}(y),S=function(e){function t(t,o){return e.call(this,t,o)||this}return u(t,e),t.decorators=[{type:s.Directive,args:[{selector:"cdk-cell, td[cdk-cell]",host:{class:"cdk-cell",role:"gridcell"}}]}],t.ctorParameters=function(){return[{type:R},{type:s.ElementRef}]},t}(y),b="<ng-container cdkCellOutlet></ng-container>",O=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 E?e.headerCell.template:this instanceof x?e.footerCell.template:e.cell.template},e}(),E=function(e){function t(t,o,r){var n=e.call(this,t,o)||this;return n._table=r,n}return u(t,e),t.prototype.ngOnChanges=function(t){e.prototype.ngOnChanges.call(this,t)},t.decorators=[{type:s.Directive,args:[{selector:"[cdkHeaderRowDef]",inputs:["columns: cdkHeaderRowDef","sticky: cdkHeaderRowDefSticky"]}]}],t.ctorParameters=function(){return[{type:s.TemplateRef},{type:s.IterableDiffers},{type:void 0,decorators:[{type:s.Inject,args:[_]},{type:s.Optional}]}]},t}(p(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t}(O))),x=function(e){function t(t,o,r){var n=e.call(this,t,o)||this;return n._table=r,n}return u(t,e),t.prototype.ngOnChanges=function(t){e.prototype.ngOnChanges.call(this,t)},t.decorators=[{type:s.Directive,args:[{selector:"[cdkFooterRowDef]",inputs:["columns: cdkFooterRowDef","sticky: cdkFooterRowDefSticky"]}]}],t.ctorParameters=function(){return[{type:s.TemplateRef},{type:s.IterableDiffers},{type:void 0,decorators:[{type:s.Inject,args:[_]},{type:s.Optional}]}]},t}(p(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t}(O))),T=function(e){function t(t,o,r){var n=e.call(this,t,o)||this;return n._table=r,n}return u(t,e),t.decorators=[{type:s.Directive,args:[{selector:"[cdkRowDef]",inputs:["columns: cdkRowDefColumns","when: cdkRowDefWhen"]}]}],t.ctorParameters=function(){return[{type:s.TemplateRef},{type:s.IterableDiffers},{type:void 0,decorators:[{type:s.Inject,args:[_]},{type:s.Optional}]}]},t}(O),I=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:s.Directive,args:[{selector:"[cdkCellOutlet]"}]}],e.ctorParameters=function(){return[{type:s.ViewContainerRef}]},e}(),P=function(){function e(){}return e.decorators=[{type:s.Component,args:[{selector:"cdk-header-row, tr[cdk-header-row]",template:b,host:{class:"cdk-header-row",role:"row"},changeDetection:s.ChangeDetectionStrategy.Default,encapsulation:s.ViewEncapsulation.None}]}],e}(),N=function(){function e(){}return e.decorators=[{type:s.Component,args:[{selector:"cdk-footer-row, tr[cdk-footer-row]",template:b,host:{class:"cdk-footer-row",role:"row"},changeDetection:s.ChangeDetectionStrategy.Default,encapsulation:s.ViewEncapsulation.None}]}],e}(),H=function(){function e(){}return e.decorators=[{type:s.Component,args:[{selector:"cdk-row, tr[cdk-row]",template:b,host:{class:"cdk-row",role:"row"},changeDetection:s.ChangeDetectionStrategy.Default,encapsulation:s.ViewEncapsulation.None}]}],e}(),F=["top","bottom","left","right"],j=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){var o,r;try{for(var n=f(e),i=n.next();!i.done;i=n.next()){var s=i.value;if(s.nodeType===s.ELEMENT_NODE){this._removeStickyStyle(s,t);for(var a=0;a<s.children.length;a++)this._removeStickyStyle(s.children[a],t)}}}catch(e){o={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}},e.prototype.updateStickyColumns=function(e,t,o){var r,n,i=t.some((function(e){return e}))||o.some((function(e){return e}));if(e.length&&i&&this._isBrowser){var s=e[0],a=s.children.length,c=this._getCellWidths(s),l=this._getStickyStartColumnPositions(c,t),u=this._getStickyEndColumnPositions(c,o),h="rtl"===this.direction;try{for(var d=f(e),p=d.next();!p.done;p=d.next())for(var y=p.value,_=0;_<a;_++){var m=y.children[_];t[_]&&this._addStickyStyle(m,h?"right":"left",l[_]),o[_]&&this._addStickyStyle(m,h?"left":"right",u[_])}}catch(e){r={error:e}}finally{try{p&&!p.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}}},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++)this._addStickyStyle(s.children[a],o,n);else this._addStickyStyle(s,o,n);if(i===r.length-1)return;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){var o,r;try{for(var n=f(t),i=n.next();!i.done;i=n.next())e.style[i.value]=""}catch(e){o={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}e.style.zIndex=this._getCalculatedZIndex(e),F.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){var t,o,r={top:100,bottom:10,left:1,right:1},n=0;try{for(var i=f(F),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){for(var t=[],o=e.children,r=0;r<o.length;r++)t.push(o[r].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}();
|
|
31
31
|
/**
|
|
32
32
|
* @license
|
|
33
33
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -35,7 +35,7 @@ function p(e){return function(e){function t(){for(var t=[],o=0;o<arguments.lengt
|
|
|
35
35
|
* Use of this source code is governed by an MIT-style license that can be
|
|
36
36
|
* found in the LICENSE file at https://angular.io/license
|
|
37
37
|
*/
|
|
38
|
-
function
|
|
38
|
+
function B(e){return Error('Could not find column with id "'+e+'".')}
|
|
39
39
|
/**
|
|
40
40
|
* @license
|
|
41
41
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -43,14 +43,14 @@ function F(e){return Error('Could not find column with id "'+e+'".')}
|
|
|
43
43
|
* Use of this source code is governed by an MIT-style license that can be
|
|
44
44
|
* found in the LICENSE file at https://angular.io/license
|
|
45
45
|
*/
|
|
46
|
-
var A,B=function(){function e(e,t){this.viewContainer=e,this.elementRef=t}return e.decorators=[{type:s.Directive,args:[{selector:"[rowOutlet]"}]}],e.ctorParameters=function(){return[{type:s.ViewContainerRef},{type:s.ElementRef}]},e}(),j=function(){function e(e,t){this.viewContainer=e,this.elementRef=t}return e.decorators=[{type:s.Directive,args:[{selector:"[headerRowOutlet]"}]}],e.ctorParameters=function(){return[{type:s.ViewContainerRef},{type:s.ElementRef}]},e}(),M=function(){function e(e,t){this.viewContainer=e,this.elementRef=t}return e.decorators=[{type:s.Directive,args:[{selector:"[footerRowOutlet]"}]}],e.ctorParameters=function(){return[{type:s.ViewContainerRef},{type:s.ElementRef}]},e}(),V='\n <ng-content select="caption"></ng-content>\n <ng-container headerRowOutlet></ng-container>\n <ng-container rowOutlet></ng-container>\n <ng-container footerRowOutlet></ng-container>\n',q=(u((function L(){return null!==A&&A.apply(this,arguments)||this}),A=s.EmbeddedViewRef),function(){function e(e,t,o,r,n,i,s){this._differs=e,this._changeDetectorRef=t,this._elementRef=o,this._dir=n,this._platform=s,this._onDestroy=new a.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 a.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){s.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=o.coerceBooleanProperty(e),this._rowOutlet&&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 function e(){return Error("Missing definitions for header, footer, and row; cannot determine which columns should be rendered.")}();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(),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;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),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._stickyStyler.clearStickyPositioning(d(t,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(),U(this._contentColumnDefs,this._customColumnDefs).forEach((function(t){if(e._columnDefsByName.has(t.name))throw function o(e){return Error('Duplicate column definition name provided: "'+e+'".')}(t.name);e._columnDefsByName.set(t.name,t)}))},e.prototype._cacheRowDefs=function(){this._headerRowDefs=U(this._contentHeaderRowDefs,this._customHeaderRowDefs),this._footerRowDefs=U(this._contentFooterRowDefs,this._customFooterRowDefs),this._rowDefs=U(this._contentRowDefs,this._customRowDefs);var e=this._rowDefs.filter((function(e){return!e.when}));if(!this.multiTemplateDataRows&&e.length>1)throw function t(){return Error("There can only be one default row without a when predicate function.")}();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=[],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=this;if(this.dataSource){var t;if(r.isDataSource(this.dataSource)?t=this.dataSource.connect(this):a.isObservable(this.dataSource)?t=this.dataSource:Array.isArray(this.dataSource)&&(t=a.of(this.dataSource)),void 0===t)throw function o(){return Error("Provided data source did not match an array, Observable, or DataSource")}();this._renderChangeSubscription=t.pipe(c.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){var t=o._columnDefsByName.get(e);if(!t)throw F(e);return t})),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 function n(e){return Error("Could not find a matching row definition for theprovided row data: "+JSON.stringify(e))}(e);return o},e.prototype._insertRow=function(e,t){this._renderRow(this._rowOutlet,e.rowDef,t,{$implicit:e.data})},e.prototype._renderRow=function(e,t,o,r){var n,i;void 0===r&&(r={}),e.viewContainer.createEmbeddedView(t.template,r,o);try{for(var s=f(this._getCellTemplates(t)),a=s.next();!a.done;a=s.next())x.mostRecentCellOutlet&&x.mostRecentCellOutlet._viewContainer.createEmbeddedView(a.value,r)}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.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);if(!r)throw F(o);return e.extractCellTemplate(r)})):[]},e.prototype._applyNativeTableSections=function(){var e,t,o=this._document.createDocumentFragment(),r=[{tag:"thead",outlet:this._headerRowOutlet},{tag:"tbody",outlet:this._rowOutlet},{tag:"tfoot",outlet:this._footerRowOutlet}];try{for(var n=f(r),i=n.next();!i.done;i=n.next()){var s=i.value,a=this._document.createElement(s.tag);a.setAttribute("role","rowgroup"),a.appendChild(s.outlet.elementRef.nativeElement),o.appendChild(a)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this._elementRef.nativeElement.appendChild(o)},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;this._stickyStyler=new H(this._isNativeHtmlTable,this.stickyCssClass,this._dir?this._dir.value:"ltr",this._platform.isBrowser),(this._dir?this._dir.change:a.of()).pipe(c.takeUntil(this._onDestroy)).subscribe((function(t){e._stickyStyler.direction=t,e.updateStickyColumnStyles()}))},e.decorators=[{type:s.Component,args:[{selector:"cdk-table, table[cdk-table]",exportAs:"cdkTable",template:V,host:{class:"cdk-table"},encapsulation:s.ViewEncapsulation.None,changeDetection:s.ChangeDetectionStrategy.Default}]}],e.ctorParameters=function(){return[{type:s.IterableDiffers},{type:s.ChangeDetectorRef},{type:s.ElementRef},{type:String,decorators:[{type:s.Attribute,args:["role"]}]},{type:t.Directionality,decorators:[{type:s.Optional}]},{type:void 0,decorators:[{type:s.Inject,args:[i.DOCUMENT]}]},{type:n.Platform}]},e.propDecorators={trackBy:[{type:s.Input}],dataSource:[{type:s.Input}],multiTemplateDataRows:[{type:s.Input}],_rowOutlet:[{type:s.ViewChild,args:[B,{static:!0}]}],_headerRowOutlet:[{type:s.ViewChild,args:[j,{static:!0}]}],_footerRowOutlet:[{type:s.ViewChild,args:[M,{static:!0}]}],_contentColumnDefs:[{type:s.ContentChildren,args:[g,{descendants:!0}]}],_contentRowDefs:[{type:s.ContentChildren,args:[E,{descendants:!0}]}],_contentHeaderRowDefs:[{type:s.ContentChildren,args:[b,{descendants:!0}]}],_contentFooterRowDefs:[{type:s.ContentChildren,args:[O,{descendants:!0}]}]},e}());function U(e,t){return e.toArray().concat(Array.from(t))}
|
|
46
|
+
var A,M=function(){function e(e,t){this.viewContainer=e,this.elementRef=t}return e.decorators=[{type:s.Directive,args:[{selector:"[rowOutlet]"}]}],e.ctorParameters=function(){return[{type:s.ViewContainerRef},{type:s.ElementRef}]},e}(),V=function(){function e(e,t){this.viewContainer=e,this.elementRef=t}return e.decorators=[{type:s.Directive,args:[{selector:"[headerRowOutlet]"}]}],e.ctorParameters=function(){return[{type:s.ViewContainerRef},{type:s.ElementRef}]},e}(),L=function(){function e(e,t){this.viewContainer=e,this.elementRef=t}return e.decorators=[{type:s.Directive,args:[{selector:"[footerRowOutlet]"}]}],e.ctorParameters=function(){return[{type:s.ViewContainerRef},{type:s.ElementRef}]},e}(),q='\n <ng-content select="caption"></ng-content>\n <ng-container headerRowOutlet></ng-container>\n <ng-container rowOutlet></ng-container>\n <ng-container footerRowOutlet></ng-container>\n',U=(u((function K(){return null!==A&&A.apply(this,arguments)||this}),A=s.EmbeddedViewRef),function(){function e(e,t,o,r,n,i,s){this._differs=e,this._changeDetectorRef=t,this._elementRef=o,this._dir=n,this._platform=s,this._onDestroy=new a.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 a.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){s.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=o.coerceBooleanProperty(e),this._rowOutlet&&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 function e(){return Error("Missing definitions for header, footer, and row; cannot determine which columns should be rendered.")}();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(),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;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),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._stickyStyler.clearStickyPositioning(d(t,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._getOwnDefs(this._contentColumnDefs),this._customColumnDefs).forEach((function(t){if(e._columnDefsByName.has(t.name))throw function o(e){return Error('Duplicate column definition name provided: "'+e+'".')}(t.name);e._columnDefsByName.set(t.name,t)}))},e.prototype._cacheRowDefs=function(){this._headerRowDefs=W(this._getOwnDefs(this._contentHeaderRowDefs),this._customHeaderRowDefs),this._footerRowDefs=W(this._getOwnDefs(this._contentFooterRowDefs),this._customFooterRowDefs),this._rowDefs=W(this._getOwnDefs(this._contentRowDefs),this._customRowDefs);var e=this._rowDefs.filter((function(e){return!e.when}));if(!this.multiTemplateDataRows&&e.length>1)throw function t(){return Error("There can only be one default row without a when predicate function.")}();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=[],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=this;if(this.dataSource){var t;if(r.isDataSource(this.dataSource)?t=this.dataSource.connect(this):a.isObservable(this.dataSource)?t=this.dataSource:Array.isArray(this.dataSource)&&(t=a.of(this.dataSource)),void 0===t)throw function o(){return Error("Provided data source did not match an array, Observable, or DataSource")}();this._renderChangeSubscription=t.pipe(c.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){var t=o._columnDefsByName.get(e);if(!t)throw B(e);return t})),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 function n(e){return Error("Could not find a matching row definition for theprovided row data: "+JSON.stringify(e))}(e);return o},e.prototype._insertRow=function(e,t){this._renderRow(this._rowOutlet,e.rowDef,t,{$implicit:e.data})},e.prototype._renderRow=function(e,t,o,r){var n,i;void 0===r&&(r={}),e.viewContainer.createEmbeddedView(t.template,r,o);try{for(var s=f(this._getCellTemplates(t)),a=s.next();!a.done;a=s.next())I.mostRecentCellOutlet&&I.mostRecentCellOutlet._viewContainer.createEmbeddedView(a.value,r)}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.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);if(!r)throw B(o);return e.extractCellTemplate(r)})):[]},e.prototype._applyNativeTableSections=function(){var e,t,o=this._document.createDocumentFragment(),r=[{tag:"thead",outlet:this._headerRowOutlet},{tag:"tbody",outlet:this._rowOutlet},{tag:"tfoot",outlet:this._footerRowOutlet}];try{for(var n=f(r),i=n.next();!i.done;i=n.next()){var s=i.value,a=this._document.createElement(s.tag);a.setAttribute("role","rowgroup"),a.appendChild(s.outlet.elementRef.nativeElement),o.appendChild(a)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this._elementRef.nativeElement.appendChild(o)},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;this._stickyStyler=new j(this._isNativeHtmlTable,this.stickyCssClass,this._dir?this._dir.value:"ltr",this._platform.isBrowser),(this._dir?this._dir.change:a.of()).pipe(c.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.decorators=[{type:s.Component,args:[{selector:"cdk-table, table[cdk-table]",exportAs:"cdkTable",template:q,host:{class:"cdk-table"},encapsulation:s.ViewEncapsulation.None,changeDetection:s.ChangeDetectionStrategy.Default,providers:[{provide:_,useExisting:e}]}]}],e.ctorParameters=function(){return[{type:s.IterableDiffers},{type:s.ChangeDetectorRef},{type:s.ElementRef},{type:String,decorators:[{type:s.Attribute,args:["role"]}]},{type:t.Directionality,decorators:[{type:s.Optional}]},{type:void 0,decorators:[{type:s.Inject,args:[i.DOCUMENT]}]},{type:n.Platform}]},e.propDecorators={trackBy:[{type:s.Input}],dataSource:[{type:s.Input}],multiTemplateDataRows:[{type:s.Input}],_rowOutlet:[{type:s.ViewChild,args:[M,{static:!0}]}],_headerRowOutlet:[{type:s.ViewChild,args:[V,{static:!0}]}],_footerRowOutlet:[{type:s.ViewChild,args:[L,{static:!0}]}],_contentColumnDefs:[{type:s.ContentChildren,args:[R,{descendants:!0}]}],_contentRowDefs:[{type:s.ContentChildren,args:[T,{descendants:!0}]}],_contentHeaderRowDefs:[{type:s.ContentChildren,args:[E,{descendants:!0}]}],_contentFooterRowDefs:[{type:s.ContentChildren,args:[x,{descendants:!0}]}]},e}());function W(e,t){return e.concat(Array.from(t))}
|
|
47
47
|
/**
|
|
48
48
|
* @license
|
|
49
49
|
* Copyright Google LLC All Rights Reserved.
|
|
50
50
|
*
|
|
51
51
|
* Use of this source code is governed by an MIT-style license that can be
|
|
52
52
|
* found in the LICENSE file at https://angular.io/license
|
|
53
|
-
*/var
|
|
53
|
+
*/var z=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:!0,configurable:!0}),e.prototype.ngOnInit=function(){if(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)throw function e(){return Error("Text column could not find a parent table for registration.")}();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;if(s.isDevMode()&&!e)throw function t(){return Error("Table text column must have a 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.decorators=[{type:s.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:s.ViewEncapsulation.None,changeDetection:s.ChangeDetectionStrategy.Default}]}],e.ctorParameters=function(){return[{type:U,decorators:[{type:s.Optional}]},{type:void 0,decorators:[{type:s.Optional},{type:s.Inject,args:[m]}]}]},e.propDecorators={name:[{type:s.Input}],headerText:[{type:s.Input}],dataAccessor:[{type:s.Input}],justify:[{type:s.Input}],columnDef:[{type:s.ViewChild,args:[R,{static:!0}]}],cell:[{type:s.ViewChild,args:[w,{static:!0}]}],headerCell:[{type:s.ViewChild,args:[g,{static:!0}]}]},e}(),Z=[U,T,w,I,g,D,R,S,H,k,v,P,E,N,x,M,V,L,z],J=function(){function e(){}return e.decorators=[{type:s.NgModule,args:[{exports:Z,declarations:Z}]}],e}();
|
|
54
54
|
/**
|
|
55
55
|
* @license
|
|
56
56
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -58,4 +58,11 @@ var A,B=function(){function e(e,t){this.viewContainer=e,this.elementRef=t}return
|
|
|
58
58
|
* Use of this source code is governed by an MIT-style license that can be
|
|
59
59
|
* found in the LICENSE file at https://angular.io/license
|
|
60
60
|
*/
|
|
61
|
-
|
|
61
|
+
/**
|
|
62
|
+
* @license
|
|
63
|
+
* Copyright Google LLC All Rights Reserved.
|
|
64
|
+
*
|
|
65
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
66
|
+
* found in the LICENSE file at https://angular.io/license
|
|
67
|
+
*/
|
|
68
|
+
Object.defineProperty(e,"DataSource",{enumerable:!0,get:function(){return r.DataSource}}),e.BaseCdkCell=y,e.BaseRowDef=O,e.CDK_ROW_TEMPLATE=b,e.CDK_TABLE=_,e.CDK_TABLE_TEMPLATE=q,e.CdkCell=S,e.CdkCellDef=w,e.CdkCellOutlet=I,e.CdkColumnDef=R,e.CdkFooterCell=v,e.CdkFooterCellDef=D,e.CdkFooterRow=N,e.CdkFooterRowDef=x,e.CdkHeaderCell=k,e.CdkHeaderCellDef=g,e.CdkHeaderRow=P,e.CdkHeaderRowDef=E,e.CdkRow=H,e.CdkRowDef=T,e.CdkTable=U,e.CdkTableModule=J,e.CdkTextColumn=z,e.DataRowOutlet=M,e.FooterRowOutlet=L,e.HeaderRowOutlet=V,e.STICKY_DIRECTIONS=F,e.StickyStyler=j,e.TEXT_COLUMN_OPTIONS=m,e.mixinHasStickyInput=p,Object.defineProperty(e,"__esModule",{value:!0})}));
|