@angular/cdk 2.0.0-beta.11 → 2.0.0-beta.12
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.scss +23 -0
- package/_overlay.scss +93 -0
- package/a11y/index.metadata.json +2 -1
- package/a11y/typings/a11y-module.d.ts +2 -0
- package/a11y/typings/focus-monitor.d.ts +1 -1
- package/a11y/typings/index.d.ts +1 -1
- package/a11y/typings/index.metadata.json +1 -1
- package/a11y/typings/{public_api.d.ts → public-api.d.ts} +8 -2
- package/a11y-prebuilt.css +1 -0
- package/a11y.metadata.json +2 -1
- package/bidi/index.metadata.json +2 -1
- package/bidi/typings/bidi-module.d.ts +2 -0
- package/bidi/typings/index.d.ts +1 -1
- package/bidi/typings/index.metadata.json +1 -1
- package/bidi/typings/public-api.d.ts +10 -0
- package/bidi.metadata.json +2 -1
- package/bundles/cdk-a11y.umd.js +1368 -1357
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-a11y.umd.min.js +2 -2
- package/bundles/cdk-a11y.umd.min.js.map +1 -1
- package/bundles/cdk-bidi.umd.js +42 -40
- package/bundles/cdk-bidi.umd.js.map +1 -1
- package/bundles/cdk-bidi.umd.min.js +2 -2
- package/bundles/cdk-bidi.umd.min.js.map +1 -1
- package/bundles/cdk-coercion.umd.js +12 -0
- package/bundles/cdk-coercion.umd.js.map +1 -1
- package/bundles/cdk-coercion.umd.min.js +2 -2
- package/bundles/cdk-coercion.umd.min.js.map +1 -1
- package/bundles/cdk-collections.umd.js +113 -11
- package/bundles/cdk-collections.umd.js.map +1 -1
- package/bundles/cdk-collections.umd.min.js +2 -2
- package/bundles/cdk-collections.umd.min.js.map +1 -1
- package/bundles/cdk-keycodes.umd.js.map +1 -1
- package/bundles/cdk-keycodes.umd.min.js +1 -1
- package/bundles/cdk-keycodes.umd.min.js.map +1 -1
- package/bundles/cdk-layout.umd.js +235 -0
- package/bundles/cdk-layout.umd.js.map +1 -0
- package/bundles/cdk-layout.umd.min.js +9 -0
- package/bundles/cdk-layout.umd.min.js.map +1 -0
- package/bundles/cdk-observers.umd.js +41 -40
- package/bundles/cdk-observers.umd.js.map +1 -1
- package/bundles/cdk-observers.umd.min.js +2 -2
- package/bundles/cdk-observers.umd.min.js.map +1 -1
- package/bundles/cdk-overlay.umd.js +306 -265
- package/bundles/cdk-overlay.umd.js.map +1 -1
- package/bundles/cdk-overlay.umd.min.js +2 -2
- package/bundles/cdk-overlay.umd.min.js.map +1 -1
- package/bundles/cdk-platform.umd.js +19 -17
- package/bundles/cdk-platform.umd.js.map +1 -1
- package/bundles/cdk-platform.umd.min.js +2 -2
- package/bundles/cdk-platform.umd.min.js.map +1 -1
- package/bundles/cdk-portal.umd.js +71 -37
- package/bundles/cdk-portal.umd.js.map +1 -1
- package/bundles/cdk-portal.umd.min.js +2 -2
- package/bundles/cdk-portal.umd.min.js.map +1 -1
- package/bundles/cdk-rxjs.umd.js +13 -4
- package/bundles/cdk-rxjs.umd.js.map +1 -1
- package/bundles/cdk-rxjs.umd.min.js +2 -2
- package/bundles/cdk-rxjs.umd.min.js.map +1 -1
- package/bundles/cdk-scrolling.umd.js +89 -54
- package/bundles/cdk-scrolling.umd.js.map +1 -1
- package/bundles/cdk-scrolling.umd.min.js +2 -2
- package/bundles/cdk-scrolling.umd.min.js.map +1 -1
- package/bundles/cdk-stepper.umd.js +115 -90
- package/bundles/cdk-stepper.umd.js.map +1 -1
- package/bundles/cdk-stepper.umd.min.js +2 -2
- package/bundles/cdk-stepper.umd.min.js.map +1 -1
- package/bundles/cdk-table.umd.js +261 -218
- package/bundles/cdk-table.umd.js.map +1 -1
- package/bundles/cdk-table.umd.min.js +2 -2
- 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 +2 -2
- package/bundles/cdk.umd.min.js.map +1 -1
- package/cdk.metadata.json +2 -1
- package/coercion/index.metadata.json +2 -1
- package/coercion/typings/array.d.ts +9 -0
- package/coercion/typings/index.d.ts +1 -1
- package/coercion/typings/index.metadata.json +1 -1
- package/{typings/coercion/public_api.d.ts → coercion/typings/public-api.d.ts} +1 -0
- package/coercion.metadata.json +2 -1
- package/collections/index.metadata.json +2 -1
- package/collections/typings/index.d.ts +2 -1
- package/collections/typings/index.metadata.json +1 -1
- package/{typings/collections/public_api.d.ts → collections/typings/public-api.d.ts} +1 -0
- package/collections/typings/selection.d.ts +13 -3
- package/collections/typings/unique-selection-dispatcher.d.ts +40 -0
- package/collections.metadata.json +2 -1
- package/esm2015/a11y.js +1252 -1250
- package/esm2015/a11y.js.map +1 -1
- package/esm2015/bidi.js +1 -1
- package/esm2015/bidi.js.map +1 -1
- package/esm2015/cdk.js +1 -1
- package/esm2015/cdk.js.map +1 -1
- package/esm2015/coercion.js +11 -1
- package/esm2015/coercion.js.map +1 -1
- package/esm2015/collections.js +93 -8
- package/esm2015/collections.js.map +1 -1
- package/esm2015/keycodes.js.map +1 -1
- package/esm2015/layout.js +226 -0
- package/esm2015/layout.js.map +1 -0
- package/esm2015/observers.js +8 -7
- package/esm2015/observers.js.map +1 -1
- package/esm2015/overlay.js +157 -136
- package/esm2015/overlay.js.map +1 -1
- package/esm2015/platform.js +1 -1
- package/esm2015/platform.js.map +1 -1
- package/esm2015/portal.js +30 -1
- package/esm2015/portal.js.map +1 -1
- package/esm2015/rxjs.js +5 -1
- package/esm2015/rxjs.js.map +1 -1
- package/esm2015/scrolling.js +39 -8
- package/esm2015/scrolling.js.map +1 -1
- package/esm2015/stepper.js +27 -5
- package/esm2015/stepper.js.map +1 -1
- package/esm2015/table.js +68 -29
- package/esm2015/table.js.map +1 -1
- package/esm5/a11y.es5.js +1372 -1357
- package/esm5/a11y.es5.js.map +1 -1
- package/esm5/bidi.es5.js +45 -40
- package/esm5/bidi.es5.js.map +1 -1
- package/esm5/cdk.es5.js +4 -1
- package/esm5/cdk.es5.js.map +1 -1
- package/esm5/coercion.es5.js +14 -1
- package/esm5/coercion.es5.js.map +1 -1
- package/esm5/collections.es5.js +110 -8
- package/esm5/collections.es5.js.map +1 -1
- package/esm5/keycodes.es5.js +2 -0
- package/esm5/keycodes.es5.js.map +1 -1
- package/esm5/layout.es5.js +234 -0
- package/esm5/layout.es5.js.map +1 -0
- package/esm5/observers.es5.js +44 -40
- package/esm5/observers.es5.js.map +1 -1
- package/esm5/overlay.es5.js +304 -259
- package/esm5/overlay.es5.js.map +1 -1
- package/esm5/platform.es5.js +22 -17
- package/esm5/platform.es5.js.map +1 -1
- package/esm5/portal.es5.js +81 -44
- package/esm5/portal.es5.js.map +1 -1
- package/esm5/rxjs.es5.js +12 -1
- package/esm5/rxjs.es5.js.map +1 -1
- package/esm5/scrolling.es5.js +89 -51
- package/esm5/scrolling.es5.js.map +1 -1
- package/esm5/stepper.es5.js +119 -91
- package/esm5/stepper.es5.js.map +1 -1
- package/esm5/table.es5.js +265 -218
- package/esm5/table.es5.js.map +1 -1
- package/keycodes/index.metadata.json +2 -1
- package/keycodes/typings/index.d.ts +1 -1
- package/keycodes/typings/{public_api.d.ts → public-api.d.ts} +0 -0
- package/keycodes.metadata.json +2 -1
- package/layout/index.d.ts +8 -0
- package/layout/index.metadata.json +12 -0
- package/layout/package.json +7 -0
- package/layout/typings/breakpoints-observer.d.ts +37 -0
- package/layout/typings/breakpoints.d.ts +18 -0
- package/layout/typings/index.d.ts +4 -0
- package/layout/typings/index.metadata.json +1 -0
- package/layout/typings/media-matcher.d.ts +15 -0
- package/layout/typings/public-api.d.ts +5 -0
- package/layout.d.ts +8 -0
- package/layout.metadata.json +12 -0
- package/observers/index.metadata.json +2 -1
- package/observers/typings/index.d.ts +1 -1
- package/observers/typings/index.metadata.json +1 -1
- package/observers/typings/observe-content.d.ts +3 -3
- package/observers/typings/{public_api.d.ts → public-api.d.ts} +0 -0
- package/observers.metadata.json +2 -1
- package/overlay/index.metadata.json +2 -1
- package/overlay/typings/index.d.ts +2 -2
- package/overlay/typings/index.metadata.json +1 -1
- package/overlay/typings/overlay-config.d.ts +1 -1
- package/overlay/typings/overlay-directives.d.ts +3 -3
- package/overlay/typings/overlay-module.d.ts +11 -0
- package/overlay/typings/overlay-ref.d.ts +6 -6
- package/overlay/typings/overlay.d.ts +2 -2
- package/overlay/typings/position/connected-position-strategy.d.ts +5 -0
- package/overlay/typings/position/position-strategy.d.ts +2 -0
- package/overlay/typings/{public_api.d.ts → public-api.d.ts} +1 -4
- package/overlay/typings/scroll/scroll-strategy.d.ts +1 -1
- package/overlay-prebuilt.css +1 -0
- package/overlay.metadata.json +2 -1
- package/package.json +3 -3
- package/platform/index.metadata.json +2 -1
- package/platform/typings/index.d.ts +1 -1
- package/platform/typings/index.metadata.json +1 -1
- package/platform/typings/platform-module.d.ts +2 -0
- package/platform/typings/public-api.d.ts +10 -0
- package/platform.metadata.json +2 -1
- package/portal/index.metadata.json +2 -1
- package/portal/typings/index.d.ts +1 -1
- package/portal/typings/index.metadata.json +1 -1
- package/portal/typings/{public_api.d.ts → public-api.d.ts} +1 -0
- package/portal.metadata.json +2 -1
- package/rxjs/index.metadata.json +2 -1
- package/rxjs/typings/index.d.ts +1 -1
- package/rxjs/typings/index.metadata.json +1 -1
- package/rxjs/typings/{public_api.d.ts → public-api.d.ts} +0 -0
- package/rxjs/typings/rx-operators.d.ts +7 -0
- package/rxjs.metadata.json +2 -1
- package/scrolling/index.metadata.json +2 -1
- package/scrolling/typings/index.d.ts +1 -1
- package/scrolling/typings/index.metadata.json +1 -1
- package/scrolling/typings/public-api.d.ts +11 -0
- package/scrolling/typings/scrolling-module.d.ts +2 -0
- package/scrolling/typings/viewport-ruler.d.ts +20 -6
- package/scrolling.metadata.json +2 -1
- package/stepper/index.metadata.json +2 -1
- package/stepper/typings/index.d.ts +1 -1
- package/stepper/typings/index.metadata.json +1 -1
- package/stepper/typings/public-api.d.ts +11 -0
- package/stepper/typings/stepper-module.d.ts +2 -0
- package/stepper/typings/stepper.d.ts +8 -4
- package/stepper.metadata.json +2 -1
- package/table/index.metadata.json +2 -1
- package/table/typings/index.d.ts +1 -1
- package/table/typings/index.metadata.json +1 -1
- package/table/typings/public-api.d.ts +13 -0
- package/table/typings/row.d.ts +11 -3
- package/table/typings/table-errors.d.ts +10 -0
- package/table/typings/table-module.d.ts +2 -0
- package/table/typings/table.d.ts +17 -8
- package/table.metadata.json +2 -1
- package/typings/a11y/a11y-module.d.ts +2 -0
- package/typings/a11y/focus-monitor.d.ts +1 -1
- package/typings/a11y/index.d.ts +1 -1
- package/typings/a11y/index.metadata.json +1 -1
- package/typings/a11y/{public_api.d.ts → public-api.d.ts} +8 -2
- package/typings/bidi/bidi-module.d.ts +2 -0
- package/typings/bidi/index.d.ts +1 -1
- package/typings/bidi/index.metadata.json +1 -1
- package/typings/bidi/public-api.d.ts +10 -0
- package/typings/coercion/array.d.ts +9 -0
- package/typings/coercion/index.d.ts +1 -1
- package/typings/coercion/index.metadata.json +1 -1
- package/{coercion/typings/public_api.d.ts → typings/coercion/public-api.d.ts} +1 -0
- package/typings/collections/index.d.ts +2 -1
- package/typings/collections/index.metadata.json +1 -1
- package/{collections/typings/public_api.d.ts → typings/collections/public-api.d.ts} +1 -0
- package/typings/collections/selection.d.ts +13 -3
- package/typings/collections/unique-selection-dispatcher.d.ts +40 -0
- package/typings/index.d.ts +1 -1
- package/typings/index.metadata.json +1 -1
- package/typings/keycodes/index.d.ts +1 -1
- package/typings/keycodes/{public_api.d.ts → public-api.d.ts} +0 -0
- package/typings/layout/breakpoints-observer.d.ts +37 -0
- package/typings/layout/breakpoints.d.ts +18 -0
- package/typings/layout/index.d.ts +4 -0
- package/typings/layout/index.metadata.json +1 -0
- package/typings/layout/media-matcher.d.ts +15 -0
- package/typings/layout/public-api.d.ts +5 -0
- package/typings/observers/index.d.ts +1 -1
- package/typings/observers/index.metadata.json +1 -1
- package/typings/observers/observe-content.d.ts +3 -3
- package/typings/observers/{public_api.d.ts → public-api.d.ts} +0 -0
- package/typings/overlay/index.d.ts +2 -2
- package/typings/overlay/index.metadata.json +1 -1
- package/typings/overlay/overlay-config.d.ts +1 -1
- package/typings/overlay/overlay-directives.d.ts +3 -3
- package/typings/overlay/overlay-module.d.ts +11 -0
- package/typings/overlay/overlay-ref.d.ts +6 -6
- package/typings/overlay/overlay.d.ts +2 -2
- package/typings/overlay/position/connected-position-strategy.d.ts +5 -0
- package/typings/overlay/position/position-strategy.d.ts +2 -0
- package/typings/overlay/{public_api.d.ts → public-api.d.ts} +1 -4
- package/typings/overlay/scroll/scroll-strategy.d.ts +1 -1
- package/typings/platform/index.d.ts +1 -1
- package/typings/platform/index.metadata.json +1 -1
- package/typings/platform/platform-module.d.ts +2 -0
- package/typings/platform/public-api.d.ts +10 -0
- package/typings/portal/index.d.ts +1 -1
- package/typings/portal/index.metadata.json +1 -1
- package/typings/portal/{public_api.d.ts → public-api.d.ts} +1 -0
- package/typings/{public_api.d.ts → public-api.d.ts} +0 -0
- package/typings/rxjs/index.d.ts +1 -1
- package/typings/rxjs/index.metadata.json +1 -1
- package/typings/rxjs/{public_api.d.ts → public-api.d.ts} +0 -0
- package/typings/rxjs/rx-operators.d.ts +7 -0
- package/typings/scrolling/index.d.ts +1 -1
- package/typings/scrolling/index.metadata.json +1 -1
- package/typings/scrolling/public-api.d.ts +11 -0
- package/typings/scrolling/scrolling-module.d.ts +2 -0
- package/typings/scrolling/viewport-ruler.d.ts +20 -6
- package/typings/stepper/index.d.ts +1 -1
- package/typings/stepper/index.metadata.json +1 -1
- package/typings/stepper/public-api.d.ts +11 -0
- package/typings/stepper/stepper-module.d.ts +2 -0
- package/typings/stepper/stepper.d.ts +8 -4
- package/typings/table/index.d.ts +1 -1
- package/typings/table/index.metadata.json +1 -1
- package/typings/table/public-api.d.ts +13 -0
- package/typings/table/row.d.ts +11 -3
- package/typings/table/table-errors.d.ts +10 -0
- package/typings/table/table-module.d.ts +2 -0
- package/typings/table/table.d.ts +17 -8
- package/bidi/typings/public_api.d.ts +0 -4
- package/platform/typings/public_api.d.ts +0 -4
- package/scrolling/typings/public_api.d.ts +0 -5
- package/stepper/typings/public_api.d.ts +0 -5
- package/table/typings/public_api.d.ts +0 -7
- package/typings/bidi/public_api.d.ts +0 -4
- package/typings/platform/public_api.d.ts +0 -4
- package/typings/scrolling/public_api.d.ts +0 -5
- package/typings/stepper/public_api.d.ts +0 -5
- package/typings/table/public_api.d.ts +0 -7
package/bundles/cdk-table.umd.js
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
8
|
(function (global, factory) {
|
|
9
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/
|
|
10
|
-
typeof define === 'function' && define.amd ? define(['exports', '@angular/
|
|
11
|
-
(factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.table = global.ng.cdk.table || {}),global.ng.
|
|
12
|
-
}(this, (function (exports,
|
|
9
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs/operator/takeUntil'), require('rxjs/BehaviorSubject'), require('rxjs/Subject'), require('@angular/common'), require('@angular/cdk/collections')) :
|
|
10
|
+
typeof define === 'function' && define.amd ? define(['exports', '@angular/core', 'rxjs/operator/takeUntil', 'rxjs/BehaviorSubject', 'rxjs/Subject', '@angular/common', '@angular/cdk/collections'], factory) :
|
|
11
|
+
(factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.table = global.ng.cdk.table || {}),global.ng.core,global.Rx.Observable.prototype,global.Rx,global.Rx,global.ng.common,global.ng.cdk.collections));
|
|
12
|
+
}(this, (function (exports,_angular_core,rxjs_operator_takeUntil,rxjs_BehaviorSubject,rxjs_Subject,_angular_common,_angular_cdk_collections) { 'use strict';
|
|
13
13
|
|
|
14
14
|
/*! *****************************************************************************
|
|
15
15
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -38,7 +38,7 @@ function __extends(d, b) {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
|
-
* The row template that can be used by the
|
|
41
|
+
* The row template that can be used by the mat-table. Should not be used outside of the
|
|
42
42
|
* material library.
|
|
43
43
|
*/
|
|
44
44
|
var CDK_ROW_TEMPLATE = "<ng-container cdkCellOutlet></ng-container>";
|
|
@@ -64,7 +64,7 @@ var BaseRowDef = (function () {
|
|
|
64
64
|
// Create a new columns differ if one does not yet exist. Initialize it based on initial value
|
|
65
65
|
// of the columns property or an empty array if none is provided.
|
|
66
66
|
var /** @type {?} */ columns = changes['columns'].currentValue || [];
|
|
67
|
-
if (!this._columnsDiffer
|
|
67
|
+
if (!this._columnsDiffer) {
|
|
68
68
|
this._columnsDiffer = this._differs.find(columns).create();
|
|
69
69
|
this._columnsDiffer.diff(columns);
|
|
70
70
|
}
|
|
@@ -92,24 +92,25 @@ var CdkHeaderRowDef = (function (_super) {
|
|
|
92
92
|
function CdkHeaderRowDef(template, _differs) {
|
|
93
93
|
return _super.call(this, template, _differs) || this;
|
|
94
94
|
}
|
|
95
|
+
CdkHeaderRowDef.decorators = [
|
|
96
|
+
{ type: _angular_core.Directive, args: [{
|
|
97
|
+
selector: '[cdkHeaderRowDef]',
|
|
98
|
+
inputs: ['columns: cdkHeaderRowDef'],
|
|
99
|
+
},] },
|
|
100
|
+
];
|
|
101
|
+
/**
|
|
102
|
+
* @nocollapse
|
|
103
|
+
*/
|
|
104
|
+
CdkHeaderRowDef.ctorParameters = function () { return [
|
|
105
|
+
{ type: _angular_core.TemplateRef, },
|
|
106
|
+
{ type: _angular_core.IterableDiffers, },
|
|
107
|
+
]; };
|
|
95
108
|
return CdkHeaderRowDef;
|
|
96
109
|
}(BaseRowDef));
|
|
97
|
-
CdkHeaderRowDef.decorators = [
|
|
98
|
-
{ type: _angular_core.Directive, args: [{
|
|
99
|
-
selector: '[cdkHeaderRowDef]',
|
|
100
|
-
inputs: ['columns: cdkHeaderRowDef'],
|
|
101
|
-
},] },
|
|
102
|
-
];
|
|
103
|
-
/**
|
|
104
|
-
* @nocollapse
|
|
105
|
-
*/
|
|
106
|
-
CdkHeaderRowDef.ctorParameters = function () { return [
|
|
107
|
-
{ type: _angular_core.TemplateRef, },
|
|
108
|
-
{ type: _angular_core.IterableDiffers, },
|
|
109
|
-
]; };
|
|
110
110
|
/**
|
|
111
111
|
* Data row definition for the CDK table.
|
|
112
|
-
* Captures the header row's template and other row properties such as the columns to display
|
|
112
|
+
* Captures the header row's template and other row properties such as the columns to display and
|
|
113
|
+
* a when predicate that describes when this row should be used.
|
|
113
114
|
*/
|
|
114
115
|
var CdkRowDef = (function (_super) {
|
|
115
116
|
__extends(CdkRowDef, _super);
|
|
@@ -120,21 +121,21 @@ var CdkRowDef = (function (_super) {
|
|
|
120
121
|
function CdkRowDef(template, _differs) {
|
|
121
122
|
return _super.call(this, template, _differs) || this;
|
|
122
123
|
}
|
|
124
|
+
CdkRowDef.decorators = [
|
|
125
|
+
{ type: _angular_core.Directive, args: [{
|
|
126
|
+
selector: '[cdkRowDef]',
|
|
127
|
+
inputs: ['columns: cdkRowDefColumns', 'when: cdkRowDefWhen'],
|
|
128
|
+
},] },
|
|
129
|
+
];
|
|
130
|
+
/**
|
|
131
|
+
* @nocollapse
|
|
132
|
+
*/
|
|
133
|
+
CdkRowDef.ctorParameters = function () { return [
|
|
134
|
+
{ type: _angular_core.TemplateRef, },
|
|
135
|
+
{ type: _angular_core.IterableDiffers, },
|
|
136
|
+
]; };
|
|
123
137
|
return CdkRowDef;
|
|
124
138
|
}(BaseRowDef));
|
|
125
|
-
CdkRowDef.decorators = [
|
|
126
|
-
{ type: _angular_core.Directive, args: [{
|
|
127
|
-
selector: '[cdkRowDef]',
|
|
128
|
-
inputs: ['columns: cdkRowDefColumns'],
|
|
129
|
-
},] },
|
|
130
|
-
];
|
|
131
|
-
/**
|
|
132
|
-
* @nocollapse
|
|
133
|
-
*/
|
|
134
|
-
CdkRowDef.ctorParameters = function () { return [
|
|
135
|
-
{ type: _angular_core.TemplateRef, },
|
|
136
|
-
{ type: _angular_core.IterableDiffers, },
|
|
137
|
-
]; };
|
|
138
139
|
/**
|
|
139
140
|
* Outlet for rendering cells inside of a row or header row.
|
|
140
141
|
* \@docs-private
|
|
@@ -147,65 +148,66 @@ var CdkCellOutlet = (function () {
|
|
|
147
148
|
this._viewContainer = _viewContainer;
|
|
148
149
|
CdkCellOutlet.mostRecentCellOutlet = this;
|
|
149
150
|
}
|
|
151
|
+
CdkCellOutlet.decorators = [
|
|
152
|
+
{ type: _angular_core.Directive, args: [{ selector: '[cdkCellOutlet]' },] },
|
|
153
|
+
];
|
|
154
|
+
/**
|
|
155
|
+
* @nocollapse
|
|
156
|
+
*/
|
|
157
|
+
CdkCellOutlet.ctorParameters = function () { return [
|
|
158
|
+
{ type: _angular_core.ViewContainerRef, },
|
|
159
|
+
]; };
|
|
150
160
|
return CdkCellOutlet;
|
|
151
161
|
}());
|
|
152
|
-
CdkCellOutlet.decorators = [
|
|
153
|
-
{ type: _angular_core.Directive, args: [{ selector: '[cdkCellOutlet]' },] },
|
|
154
|
-
];
|
|
155
|
-
/**
|
|
156
|
-
* @nocollapse
|
|
157
|
-
*/
|
|
158
|
-
CdkCellOutlet.ctorParameters = function () { return [
|
|
159
|
-
{ type: _angular_core.ViewContainerRef, },
|
|
160
|
-
]; };
|
|
161
162
|
/**
|
|
162
163
|
* Header template container that contains the cell outlet. Adds the right class and role.
|
|
163
164
|
*/
|
|
164
165
|
var CdkHeaderRow = (function () {
|
|
165
166
|
function CdkHeaderRow() {
|
|
166
167
|
}
|
|
168
|
+
CdkHeaderRow.decorators = [
|
|
169
|
+
{ type: _angular_core.Component, args: [{selector: 'cdk-header-row',
|
|
170
|
+
template: CDK_ROW_TEMPLATE,
|
|
171
|
+
host: {
|
|
172
|
+
'class': 'cdk-header-row',
|
|
173
|
+
'role': 'row',
|
|
174
|
+
},
|
|
175
|
+
changeDetection: _angular_core.ChangeDetectionStrategy.OnPush,
|
|
176
|
+
encapsulation: _angular_core.ViewEncapsulation.None,
|
|
177
|
+
preserveWhitespaces: false,
|
|
178
|
+
},] },
|
|
179
|
+
];
|
|
180
|
+
/**
|
|
181
|
+
* @nocollapse
|
|
182
|
+
*/
|
|
183
|
+
CdkHeaderRow.ctorParameters = function () { return []; };
|
|
167
184
|
return CdkHeaderRow;
|
|
168
185
|
}());
|
|
169
|
-
CdkHeaderRow.decorators = [
|
|
170
|
-
{ type: _angular_core.Component, args: [{ selector: 'cdk-header-row',
|
|
171
|
-
template: CDK_ROW_TEMPLATE,
|
|
172
|
-
host: {
|
|
173
|
-
'class': 'cdk-header-row',
|
|
174
|
-
'role': 'row',
|
|
175
|
-
},
|
|
176
|
-
changeDetection: _angular_core.ChangeDetectionStrategy.OnPush,
|
|
177
|
-
encapsulation: _angular_core.ViewEncapsulation.None,
|
|
178
|
-
preserveWhitespaces: false,
|
|
179
|
-
},] },
|
|
180
|
-
];
|
|
181
|
-
/**
|
|
182
|
-
* @nocollapse
|
|
183
|
-
*/
|
|
184
|
-
CdkHeaderRow.ctorParameters = function () { return []; };
|
|
185
186
|
/**
|
|
186
187
|
* Data row template container that contains the cell outlet. Adds the right class and role.
|
|
187
188
|
*/
|
|
188
189
|
var CdkRow = (function () {
|
|
189
190
|
function CdkRow() {
|
|
190
191
|
}
|
|
192
|
+
CdkRow.decorators = [
|
|
193
|
+
{ type: _angular_core.Component, args: [{selector: 'cdk-row',
|
|
194
|
+
template: CDK_ROW_TEMPLATE,
|
|
195
|
+
host: {
|
|
196
|
+
'class': 'cdk-row',
|
|
197
|
+
'role': 'row',
|
|
198
|
+
},
|
|
199
|
+
changeDetection: _angular_core.ChangeDetectionStrategy.OnPush,
|
|
200
|
+
encapsulation: _angular_core.ViewEncapsulation.None,
|
|
201
|
+
preserveWhitespaces: false,
|
|
202
|
+
},] },
|
|
203
|
+
];
|
|
204
|
+
/**
|
|
205
|
+
* @nocollapse
|
|
206
|
+
*/
|
|
207
|
+
CdkRow.ctorParameters = function () { return []; };
|
|
191
208
|
return CdkRow;
|
|
192
209
|
}());
|
|
193
|
-
|
|
194
|
-
{ type: _angular_core.Component, args: [{ selector: 'cdk-row',
|
|
195
|
-
template: CDK_ROW_TEMPLATE,
|
|
196
|
-
host: {
|
|
197
|
-
'class': 'cdk-row',
|
|
198
|
-
'role': 'row',
|
|
199
|
-
},
|
|
200
|
-
changeDetection: _angular_core.ChangeDetectionStrategy.OnPush,
|
|
201
|
-
encapsulation: _angular_core.ViewEncapsulation.None,
|
|
202
|
-
preserveWhitespaces: false,
|
|
203
|
-
},] },
|
|
204
|
-
];
|
|
205
|
-
/**
|
|
206
|
-
* @nocollapse
|
|
207
|
-
*/
|
|
208
|
-
CdkRow.ctorParameters = function () { return []; };
|
|
210
|
+
|
|
209
211
|
/**
|
|
210
212
|
* Cell definition for a CDK table.
|
|
211
213
|
* Captures the template of a column's data row cell as well as cell-specific properties.
|
|
@@ -217,17 +219,17 @@ var CdkCellDef = (function () {
|
|
|
217
219
|
function CdkCellDef(template) {
|
|
218
220
|
this.template = template;
|
|
219
221
|
}
|
|
222
|
+
CdkCellDef.decorators = [
|
|
223
|
+
{ type: _angular_core.Directive, args: [{ selector: '[cdkCellDef]' },] },
|
|
224
|
+
];
|
|
225
|
+
/**
|
|
226
|
+
* @nocollapse
|
|
227
|
+
*/
|
|
228
|
+
CdkCellDef.ctorParameters = function () { return [
|
|
229
|
+
{ type: _angular_core.TemplateRef, },
|
|
230
|
+
]; };
|
|
220
231
|
return CdkCellDef;
|
|
221
232
|
}());
|
|
222
|
-
CdkCellDef.decorators = [
|
|
223
|
-
{ type: _angular_core.Directive, args: [{ selector: '[cdkCellDef]' },] },
|
|
224
|
-
];
|
|
225
|
-
/**
|
|
226
|
-
* @nocollapse
|
|
227
|
-
*/
|
|
228
|
-
CdkCellDef.ctorParameters = function () { return [
|
|
229
|
-
{ type: _angular_core.TemplateRef, },
|
|
230
|
-
]; };
|
|
231
233
|
/**
|
|
232
234
|
* Header cell definition for a CDK table.
|
|
233
235
|
* Captures the template of a column's header cell and as well as cell-specific properties.
|
|
@@ -239,17 +241,17 @@ var CdkHeaderCellDef = (function () {
|
|
|
239
241
|
function CdkHeaderCellDef(template) {
|
|
240
242
|
this.template = template;
|
|
241
243
|
}
|
|
244
|
+
CdkHeaderCellDef.decorators = [
|
|
245
|
+
{ type: _angular_core.Directive, args: [{ selector: '[cdkHeaderCellDef]' },] },
|
|
246
|
+
];
|
|
247
|
+
/**
|
|
248
|
+
* @nocollapse
|
|
249
|
+
*/
|
|
250
|
+
CdkHeaderCellDef.ctorParameters = function () { return [
|
|
251
|
+
{ type: _angular_core.TemplateRef, },
|
|
252
|
+
]; };
|
|
242
253
|
return CdkHeaderCellDef;
|
|
243
254
|
}());
|
|
244
|
-
CdkHeaderCellDef.decorators = [
|
|
245
|
-
{ type: _angular_core.Directive, args: [{ selector: '[cdkHeaderCellDef]' },] },
|
|
246
|
-
];
|
|
247
|
-
/**
|
|
248
|
-
* @nocollapse
|
|
249
|
-
*/
|
|
250
|
-
CdkHeaderCellDef.ctorParameters = function () { return [
|
|
251
|
-
{ type: _angular_core.TemplateRef, },
|
|
252
|
-
]; };
|
|
253
255
|
/**
|
|
254
256
|
* Column definition for the CDK table.
|
|
255
257
|
* Defines a set of cells available for a table column.
|
|
@@ -274,20 +276,20 @@ var CdkColumnDef = (function () {
|
|
|
274
276
|
enumerable: true,
|
|
275
277
|
configurable: true
|
|
276
278
|
});
|
|
279
|
+
CdkColumnDef.decorators = [
|
|
280
|
+
{ type: _angular_core.Directive, args: [{ selector: '[cdkColumnDef]' },] },
|
|
281
|
+
];
|
|
282
|
+
/**
|
|
283
|
+
* @nocollapse
|
|
284
|
+
*/
|
|
285
|
+
CdkColumnDef.ctorParameters = function () { return []; };
|
|
286
|
+
CdkColumnDef.propDecorators = {
|
|
287
|
+
'name': [{ type: _angular_core.Input, args: ['cdkColumnDef',] },],
|
|
288
|
+
'cell': [{ type: _angular_core.ContentChild, args: [CdkCellDef,] },],
|
|
289
|
+
'headerCell': [{ type: _angular_core.ContentChild, args: [CdkHeaderCellDef,] },],
|
|
290
|
+
};
|
|
277
291
|
return CdkColumnDef;
|
|
278
292
|
}());
|
|
279
|
-
CdkColumnDef.decorators = [
|
|
280
|
-
{ type: _angular_core.Directive, args: [{ selector: '[cdkColumnDef]' },] },
|
|
281
|
-
];
|
|
282
|
-
/**
|
|
283
|
-
* @nocollapse
|
|
284
|
-
*/
|
|
285
|
-
CdkColumnDef.ctorParameters = function () { return []; };
|
|
286
|
-
CdkColumnDef.propDecorators = {
|
|
287
|
-
'name': [{ type: _angular_core.Input, args: ['cdkColumnDef',] },],
|
|
288
|
-
'cell': [{ type: _angular_core.ContentChild, args: [CdkCellDef,] },],
|
|
289
|
-
'headerCell': [{ type: _angular_core.ContentChild, args: [CdkHeaderCellDef,] },],
|
|
290
|
-
};
|
|
291
293
|
/**
|
|
292
294
|
* Header cell template container that adds the right classes and role.
|
|
293
295
|
*/
|
|
@@ -300,25 +302,25 @@ var CdkHeaderCell = (function () {
|
|
|
300
302
|
function CdkHeaderCell(columnDef, elementRef, renderer) {
|
|
301
303
|
renderer.addClass(elementRef.nativeElement, "cdk-column-" + columnDef.cssClassFriendlyName);
|
|
302
304
|
}
|
|
305
|
+
CdkHeaderCell.decorators = [
|
|
306
|
+
{ type: _angular_core.Directive, args: [{
|
|
307
|
+
selector: 'cdk-header-cell',
|
|
308
|
+
host: {
|
|
309
|
+
'class': 'cdk-header-cell',
|
|
310
|
+
'role': 'columnheader',
|
|
311
|
+
},
|
|
312
|
+
},] },
|
|
313
|
+
];
|
|
314
|
+
/**
|
|
315
|
+
* @nocollapse
|
|
316
|
+
*/
|
|
317
|
+
CdkHeaderCell.ctorParameters = function () { return [
|
|
318
|
+
{ type: CdkColumnDef, },
|
|
319
|
+
{ type: _angular_core.ElementRef, },
|
|
320
|
+
{ type: _angular_core.Renderer2, },
|
|
321
|
+
]; };
|
|
303
322
|
return CdkHeaderCell;
|
|
304
323
|
}());
|
|
305
|
-
CdkHeaderCell.decorators = [
|
|
306
|
-
{ type: _angular_core.Directive, args: [{
|
|
307
|
-
selector: 'cdk-header-cell',
|
|
308
|
-
host: {
|
|
309
|
-
'class': 'cdk-header-cell',
|
|
310
|
-
'role': 'columnheader',
|
|
311
|
-
},
|
|
312
|
-
},] },
|
|
313
|
-
];
|
|
314
|
-
/**
|
|
315
|
-
* @nocollapse
|
|
316
|
-
*/
|
|
317
|
-
CdkHeaderCell.ctorParameters = function () { return [
|
|
318
|
-
{ type: CdkColumnDef, },
|
|
319
|
-
{ type: _angular_core.ElementRef, },
|
|
320
|
-
{ type: _angular_core.Renderer2, },
|
|
321
|
-
]; };
|
|
322
324
|
/**
|
|
323
325
|
* Cell template container that adds the right classes and role.
|
|
324
326
|
*/
|
|
@@ -331,25 +333,26 @@ var CdkCell = (function () {
|
|
|
331
333
|
function CdkCell(columnDef, elementRef, renderer) {
|
|
332
334
|
renderer.addClass(elementRef.nativeElement, "cdk-column-" + columnDef.cssClassFriendlyName);
|
|
333
335
|
}
|
|
336
|
+
CdkCell.decorators = [
|
|
337
|
+
{ type: _angular_core.Directive, args: [{
|
|
338
|
+
selector: 'cdk-cell',
|
|
339
|
+
host: {
|
|
340
|
+
'class': 'cdk-cell',
|
|
341
|
+
'role': 'gridcell',
|
|
342
|
+
},
|
|
343
|
+
},] },
|
|
344
|
+
];
|
|
345
|
+
/**
|
|
346
|
+
* @nocollapse
|
|
347
|
+
*/
|
|
348
|
+
CdkCell.ctorParameters = function () { return [
|
|
349
|
+
{ type: CdkColumnDef, },
|
|
350
|
+
{ type: _angular_core.ElementRef, },
|
|
351
|
+
{ type: _angular_core.Renderer2, },
|
|
352
|
+
]; };
|
|
334
353
|
return CdkCell;
|
|
335
354
|
}());
|
|
336
|
-
|
|
337
|
-
{ type: _angular_core.Directive, args: [{
|
|
338
|
-
selector: 'cdk-cell',
|
|
339
|
-
host: {
|
|
340
|
-
'class': 'cdk-cell',
|
|
341
|
-
'role': 'gridcell',
|
|
342
|
-
},
|
|
343
|
-
},] },
|
|
344
|
-
];
|
|
345
|
-
/**
|
|
346
|
-
* @nocollapse
|
|
347
|
-
*/
|
|
348
|
-
CdkCell.ctorParameters = function () { return [
|
|
349
|
-
{ type: CdkColumnDef, },
|
|
350
|
-
{ type: _angular_core.ElementRef, },
|
|
351
|
-
{ type: _angular_core.Renderer2, },
|
|
352
|
-
]; };
|
|
355
|
+
|
|
353
356
|
/**
|
|
354
357
|
* Returns an error to be thrown when attempting to find an unexisting column.
|
|
355
358
|
* \@docs-private
|
|
@@ -368,6 +371,23 @@ function getTableUnknownColumnError(id) {
|
|
|
368
371
|
function getTableDuplicateColumnNameError(name) {
|
|
369
372
|
return Error("cdk-table: Duplicate column definition name provided: \"" + name + "\".");
|
|
370
373
|
}
|
|
374
|
+
/**
|
|
375
|
+
* Returns an error to be thrown when there are multiple rows that are missing a when function.
|
|
376
|
+
* \@docs-private
|
|
377
|
+
* @return {?}
|
|
378
|
+
*/
|
|
379
|
+
function getTableMultipleDefaultRowDefsError() {
|
|
380
|
+
return Error("cdk-table: There can only be one default row without a when predicate function.");
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Returns an error to be thrown when there are no matching row defs for a particular set of data.
|
|
384
|
+
* \@docs-private
|
|
385
|
+
* @return {?}
|
|
386
|
+
*/
|
|
387
|
+
function getTableMissingMatchingRowDefError() {
|
|
388
|
+
return Error("cdk-table: Could not find a matching row definition for the provided row data.");
|
|
389
|
+
}
|
|
390
|
+
|
|
371
391
|
/**
|
|
372
392
|
* Provides a handle for the table to grab the view container's ng-container to insert data rows.
|
|
373
393
|
* \@docs-private
|
|
@@ -379,17 +399,17 @@ var RowPlaceholder = (function () {
|
|
|
379
399
|
function RowPlaceholder(viewContainer) {
|
|
380
400
|
this.viewContainer = viewContainer;
|
|
381
401
|
}
|
|
402
|
+
RowPlaceholder.decorators = [
|
|
403
|
+
{ type: _angular_core.Directive, args: [{ selector: '[rowPlaceholder]' },] },
|
|
404
|
+
];
|
|
405
|
+
/**
|
|
406
|
+
* @nocollapse
|
|
407
|
+
*/
|
|
408
|
+
RowPlaceholder.ctorParameters = function () { return [
|
|
409
|
+
{ type: _angular_core.ViewContainerRef, },
|
|
410
|
+
]; };
|
|
382
411
|
return RowPlaceholder;
|
|
383
412
|
}());
|
|
384
|
-
RowPlaceholder.decorators = [
|
|
385
|
-
{ type: _angular_core.Directive, args: [{ selector: '[rowPlaceholder]' },] },
|
|
386
|
-
];
|
|
387
|
-
/**
|
|
388
|
-
* @nocollapse
|
|
389
|
-
*/
|
|
390
|
-
RowPlaceholder.ctorParameters = function () { return [
|
|
391
|
-
{ type: _angular_core.ViewContainerRef, },
|
|
392
|
-
]; };
|
|
393
413
|
/**
|
|
394
414
|
* Provides a handle for the table to grab the view container's ng-container to insert the header.
|
|
395
415
|
* \@docs-private
|
|
@@ -401,19 +421,19 @@ var HeaderRowPlaceholder = (function () {
|
|
|
401
421
|
function HeaderRowPlaceholder(viewContainer) {
|
|
402
422
|
this.viewContainer = viewContainer;
|
|
403
423
|
}
|
|
424
|
+
HeaderRowPlaceholder.decorators = [
|
|
425
|
+
{ type: _angular_core.Directive, args: [{ selector: '[headerRowPlaceholder]' },] },
|
|
426
|
+
];
|
|
427
|
+
/**
|
|
428
|
+
* @nocollapse
|
|
429
|
+
*/
|
|
430
|
+
HeaderRowPlaceholder.ctorParameters = function () { return [
|
|
431
|
+
{ type: _angular_core.ViewContainerRef, },
|
|
432
|
+
]; };
|
|
404
433
|
return HeaderRowPlaceholder;
|
|
405
434
|
}());
|
|
406
|
-
HeaderRowPlaceholder.decorators = [
|
|
407
|
-
{ type: _angular_core.Directive, args: [{ selector: '[headerRowPlaceholder]' },] },
|
|
408
|
-
];
|
|
409
435
|
/**
|
|
410
|
-
*
|
|
411
|
-
*/
|
|
412
|
-
HeaderRowPlaceholder.ctorParameters = function () { return [
|
|
413
|
-
{ type: _angular_core.ViewContainerRef, },
|
|
414
|
-
]; };
|
|
415
|
-
/**
|
|
416
|
-
* The table template that can be used by the md-table. Should not be used outside of the
|
|
436
|
+
* The table template that can be used by the mat-table. Should not be used outside of the
|
|
417
437
|
* material library.
|
|
418
438
|
*/
|
|
419
439
|
var CDK_TABLE_TEMPLATE = "\n <ng-container headerRowPlaceholder></ng-container>\n <ng-container rowPlaceholder></ng-container>";
|
|
@@ -443,7 +463,7 @@ var CdkTable = (function () {
|
|
|
443
463
|
/**
|
|
444
464
|
* Map of all the user's defined columns (header and data cell template) identified by name.
|
|
445
465
|
*/
|
|
446
|
-
this.
|
|
466
|
+
this._columnDefsByName = new Map();
|
|
447
467
|
/**
|
|
448
468
|
* Stream containing the latest information on what rows are being displayed on screen.
|
|
449
469
|
* Can be used by the data source to as a heuristic of what data should be provided.
|
|
@@ -507,8 +527,8 @@ var CdkTable = (function () {
|
|
|
507
527
|
*/
|
|
508
528
|
CdkTable.prototype.ngAfterContentInit = function () {
|
|
509
529
|
var _this = this;
|
|
510
|
-
this.
|
|
511
|
-
this.
|
|
530
|
+
this._cacheColumnDefsByName();
|
|
531
|
+
this._columnDefs.changes.subscribe(function () { return _this._cacheColumnDefsByName(); });
|
|
512
532
|
this._renderHeaderRow();
|
|
513
533
|
};
|
|
514
534
|
/**
|
|
@@ -516,6 +536,11 @@ var CdkTable = (function () {
|
|
|
516
536
|
*/
|
|
517
537
|
CdkTable.prototype.ngAfterContentChecked = function () {
|
|
518
538
|
this._renderUpdatedColumns();
|
|
539
|
+
var /** @type {?} */ defaultRowDefs = this._rowDefs.filter(function (def) { return !def.when; });
|
|
540
|
+
if (defaultRowDefs.length > 1) {
|
|
541
|
+
throw getTableMultipleDefaultRowDefsError();
|
|
542
|
+
}
|
|
543
|
+
this._defaultRowDef = defaultRowDefs[0];
|
|
519
544
|
if (this.dataSource && !this._renderChangeSubscription) {
|
|
520
545
|
this._observeRenderChanges();
|
|
521
546
|
}
|
|
@@ -536,14 +561,14 @@ var CdkTable = (function () {
|
|
|
536
561
|
* Update the map containing the content's column definitions.
|
|
537
562
|
* @return {?}
|
|
538
563
|
*/
|
|
539
|
-
CdkTable.prototype.
|
|
564
|
+
CdkTable.prototype._cacheColumnDefsByName = function () {
|
|
540
565
|
var _this = this;
|
|
541
|
-
this.
|
|
542
|
-
this.
|
|
543
|
-
if (_this.
|
|
566
|
+
this._columnDefsByName.clear();
|
|
567
|
+
this._columnDefs.forEach(function (columnDef) {
|
|
568
|
+
if (_this._columnDefsByName.has(columnDef.name)) {
|
|
544
569
|
throw getTableDuplicateColumnNameError(columnDef.name);
|
|
545
570
|
}
|
|
546
|
-
_this.
|
|
571
|
+
_this._columnDefsByName.set(columnDef.name, columnDef);
|
|
547
572
|
});
|
|
548
573
|
};
|
|
549
574
|
/**
|
|
@@ -554,8 +579,8 @@ var CdkTable = (function () {
|
|
|
554
579
|
CdkTable.prototype._renderUpdatedColumns = function () {
|
|
555
580
|
var _this = this;
|
|
556
581
|
// Re-render the rows when the row definition columns change.
|
|
557
|
-
this.
|
|
558
|
-
if (!!
|
|
582
|
+
this._rowDefs.forEach(function (def) {
|
|
583
|
+
if (!!def.getColumnsDiff()) {
|
|
559
584
|
// Reset the data to an empty array so that renderRowChanges will re-render all new rows.
|
|
560
585
|
_this._dataDiffer.diff([]);
|
|
561
586
|
_this._rowPlaceholder.viewContainer.clear();
|
|
@@ -563,7 +588,7 @@ var CdkTable = (function () {
|
|
|
563
588
|
}
|
|
564
589
|
});
|
|
565
590
|
// Re-render the header row if there is a difference in its columns.
|
|
566
|
-
if (this.
|
|
591
|
+
if (this._headerDef.getColumnsDiff()) {
|
|
567
592
|
this._headerRowPlaceholder.viewContainer.clear();
|
|
568
593
|
this._renderHeaderRow();
|
|
569
594
|
}
|
|
@@ -608,7 +633,7 @@ var CdkTable = (function () {
|
|
|
608
633
|
* @return {?}
|
|
609
634
|
*/
|
|
610
635
|
CdkTable.prototype._renderHeaderRow = function () {
|
|
611
|
-
var /** @type {?} */ cells = this._getHeaderCellTemplatesForRow(this.
|
|
636
|
+
var /** @type {?} */ cells = this._getHeaderCellTemplatesForRow(this._headerDef);
|
|
612
637
|
if (!cells.length) {
|
|
613
638
|
return;
|
|
614
639
|
}
|
|
@@ -616,7 +641,7 @@ var CdkTable = (function () {
|
|
|
616
641
|
// one CdkCellOutlet was instantiated as a result
|
|
617
642
|
// of `createEmbeddedView`.
|
|
618
643
|
this._headerRowPlaceholder.viewContainer
|
|
619
|
-
.createEmbeddedView(this.
|
|
644
|
+
.createEmbeddedView(this._headerDef.template, { cells: cells });
|
|
620
645
|
cells.forEach(function (cell) {
|
|
621
646
|
CdkCellOutlet.mostRecentCellOutlet._viewContainer.createEmbeddedView(cell.template, {});
|
|
622
647
|
});
|
|
@@ -647,6 +672,25 @@ var CdkTable = (function () {
|
|
|
647
672
|
});
|
|
648
673
|
this._updateRowContext();
|
|
649
674
|
};
|
|
675
|
+
/**
|
|
676
|
+
* Finds the matching row definition that should be used for this row data. If there is only
|
|
677
|
+
* one row definition, it is returned. Otherwise, find the row definition that has a when
|
|
678
|
+
* predicate that returns true with the data. If none return true, return the default row
|
|
679
|
+
* definition.
|
|
680
|
+
* @param {?} data
|
|
681
|
+
* @param {?} i
|
|
682
|
+
* @return {?}
|
|
683
|
+
*/
|
|
684
|
+
CdkTable.prototype._getRowDef = function (data, i) {
|
|
685
|
+
if (this._rowDefs.length == 1) {
|
|
686
|
+
return this._rowDefs.first;
|
|
687
|
+
}
|
|
688
|
+
var /** @type {?} */ rowDef = this._rowDefs.find(function (def) { return def.when && def.when(data, i); }) || this._defaultRowDef;
|
|
689
|
+
if (!rowDef) {
|
|
690
|
+
throw getTableMissingMatchingRowDefError();
|
|
691
|
+
}
|
|
692
|
+
return rowDef;
|
|
693
|
+
};
|
|
650
694
|
/**
|
|
651
695
|
* Create the embedded view for the data row template and place it in the correct index location
|
|
652
696
|
* within the data row view container.
|
|
@@ -655,10 +699,7 @@ var CdkTable = (function () {
|
|
|
655
699
|
* @return {?}
|
|
656
700
|
*/
|
|
657
701
|
CdkTable.prototype._insertRow = function (rowData, index) {
|
|
658
|
-
|
|
659
|
-
// to find the right template to used based on
|
|
660
|
-
// the data rather than choosing the first row definition.
|
|
661
|
-
var /** @type {?} */ row = this._rowDefinitions.first;
|
|
702
|
+
var /** @type {?} */ row = this._getRowDef(rowData, index);
|
|
662
703
|
// Row context that will be provided to both the created embedded row view and its cells.
|
|
663
704
|
var /** @type {?} */ context = { $implicit: rowData };
|
|
664
705
|
// TODO(andrewseguin): add some code to enforce that exactly one
|
|
@@ -701,7 +742,7 @@ var CdkTable = (function () {
|
|
|
701
742
|
return [];
|
|
702
743
|
}
|
|
703
744
|
return headerDef.columns.map(function (columnId) {
|
|
704
|
-
var /** @type {?} */ column = _this.
|
|
745
|
+
var /** @type {?} */ column = _this._columnDefsByName.get(columnId);
|
|
705
746
|
if (!column) {
|
|
706
747
|
throw getTableUnknownColumnError(columnId);
|
|
707
748
|
}
|
|
@@ -720,45 +761,47 @@ var CdkTable = (function () {
|
|
|
720
761
|
return [];
|
|
721
762
|
}
|
|
722
763
|
return rowDef.columns.map(function (columnId) {
|
|
723
|
-
var /** @type {?} */ column = _this.
|
|
764
|
+
var /** @type {?} */ column = _this._columnDefsByName.get(columnId);
|
|
724
765
|
if (!column) {
|
|
725
766
|
throw getTableUnknownColumnError(columnId);
|
|
726
767
|
}
|
|
727
768
|
return column.cell;
|
|
728
769
|
});
|
|
729
770
|
};
|
|
771
|
+
CdkTable.decorators = [
|
|
772
|
+
{ type: _angular_core.Component, args: [{selector: 'cdk-table',
|
|
773
|
+
exportAs: 'cdkTable',
|
|
774
|
+
template: CDK_TABLE_TEMPLATE,
|
|
775
|
+
host: {
|
|
776
|
+
'class': 'cdk-table',
|
|
777
|
+
},
|
|
778
|
+
encapsulation: _angular_core.ViewEncapsulation.None,
|
|
779
|
+
preserveWhitespaces: false,
|
|
780
|
+
changeDetection: _angular_core.ChangeDetectionStrategy.OnPush,
|
|
781
|
+
},] },
|
|
782
|
+
];
|
|
783
|
+
/**
|
|
784
|
+
* @nocollapse
|
|
785
|
+
*/
|
|
786
|
+
CdkTable.ctorParameters = function () { return [
|
|
787
|
+
{ type: _angular_core.IterableDiffers, },
|
|
788
|
+
{ type: _angular_core.ChangeDetectorRef, },
|
|
789
|
+
{ type: _angular_core.ElementRef, },
|
|
790
|
+
{ type: _angular_core.Renderer2, },
|
|
791
|
+
{ type: undefined, decorators: [{ type: _angular_core.Attribute, args: ['role',] },] },
|
|
792
|
+
]; };
|
|
793
|
+
CdkTable.propDecorators = {
|
|
794
|
+
'trackBy': [{ type: _angular_core.Input },],
|
|
795
|
+
'dataSource': [{ type: _angular_core.Input },],
|
|
796
|
+
'_rowPlaceholder': [{ type: _angular_core.ViewChild, args: [RowPlaceholder,] },],
|
|
797
|
+
'_headerRowPlaceholder': [{ type: _angular_core.ViewChild, args: [HeaderRowPlaceholder,] },],
|
|
798
|
+
'_columnDefs': [{ type: _angular_core.ContentChildren, args: [CdkColumnDef,] },],
|
|
799
|
+
'_headerDef': [{ type: _angular_core.ContentChild, args: [CdkHeaderRowDef,] },],
|
|
800
|
+
'_rowDefs': [{ type: _angular_core.ContentChildren, args: [CdkRowDef,] },],
|
|
801
|
+
};
|
|
730
802
|
return CdkTable;
|
|
731
803
|
}());
|
|
732
|
-
|
|
733
|
-
{ type: _angular_core.Component, args: [{ selector: 'cdk-table',
|
|
734
|
-
template: CDK_TABLE_TEMPLATE,
|
|
735
|
-
host: {
|
|
736
|
-
'class': 'cdk-table',
|
|
737
|
-
},
|
|
738
|
-
encapsulation: _angular_core.ViewEncapsulation.None,
|
|
739
|
-
preserveWhitespaces: false,
|
|
740
|
-
changeDetection: _angular_core.ChangeDetectionStrategy.OnPush,
|
|
741
|
-
},] },
|
|
742
|
-
];
|
|
743
|
-
/**
|
|
744
|
-
* @nocollapse
|
|
745
|
-
*/
|
|
746
|
-
CdkTable.ctorParameters = function () { return [
|
|
747
|
-
{ type: _angular_core.IterableDiffers, },
|
|
748
|
-
{ type: _angular_core.ChangeDetectorRef, },
|
|
749
|
-
{ type: _angular_core.ElementRef, },
|
|
750
|
-
{ type: _angular_core.Renderer2, },
|
|
751
|
-
{ type: undefined, decorators: [{ type: _angular_core.Attribute, args: ['role',] },] },
|
|
752
|
-
]; };
|
|
753
|
-
CdkTable.propDecorators = {
|
|
754
|
-
'trackBy': [{ type: _angular_core.Input },],
|
|
755
|
-
'dataSource': [{ type: _angular_core.Input },],
|
|
756
|
-
'_rowPlaceholder': [{ type: _angular_core.ViewChild, args: [RowPlaceholder,] },],
|
|
757
|
-
'_headerRowPlaceholder': [{ type: _angular_core.ViewChild, args: [HeaderRowPlaceholder,] },],
|
|
758
|
-
'_columnDefinitions': [{ type: _angular_core.ContentChildren, args: [CdkColumnDef,] },],
|
|
759
|
-
'_headerDefinition': [{ type: _angular_core.ContentChild, args: [CdkHeaderRowDef,] },],
|
|
760
|
-
'_rowDefinitions': [{ type: _angular_core.ContentChildren, args: [CdkRowDef,] },],
|
|
761
|
-
};
|
|
804
|
+
|
|
762
805
|
var EXPORTED_DECLARATIONS = [
|
|
763
806
|
CdkTable,
|
|
764
807
|
CdkRowDef,
|
|
@@ -777,22 +820,21 @@ var EXPORTED_DECLARATIONS = [
|
|
|
777
820
|
var CdkTableModule = (function () {
|
|
778
821
|
function CdkTableModule() {
|
|
779
822
|
}
|
|
823
|
+
CdkTableModule.decorators = [
|
|
824
|
+
{ type: _angular_core.NgModule, args: [{
|
|
825
|
+
imports: [_angular_common.CommonModule],
|
|
826
|
+
exports: [EXPORTED_DECLARATIONS],
|
|
827
|
+
declarations: [EXPORTED_DECLARATIONS]
|
|
828
|
+
},] },
|
|
829
|
+
];
|
|
830
|
+
/**
|
|
831
|
+
* @nocollapse
|
|
832
|
+
*/
|
|
833
|
+
CdkTableModule.ctorParameters = function () { return []; };
|
|
780
834
|
return CdkTableModule;
|
|
781
835
|
}());
|
|
782
|
-
CdkTableModule.decorators = [
|
|
783
|
-
{ type: _angular_core.NgModule, args: [{
|
|
784
|
-
imports: [_angular_common.CommonModule],
|
|
785
|
-
exports: [EXPORTED_DECLARATIONS],
|
|
786
|
-
declarations: [EXPORTED_DECLARATIONS]
|
|
787
|
-
},] },
|
|
788
|
-
];
|
|
789
|
-
/**
|
|
790
|
-
* @nocollapse
|
|
791
|
-
*/
|
|
792
|
-
CdkTableModule.ctorParameters = function () { return []; };
|
|
793
836
|
|
|
794
837
|
exports.DataSource = _angular_cdk_collections.DataSource;
|
|
795
|
-
exports.CdkTableModule = CdkTableModule;
|
|
796
838
|
exports.RowPlaceholder = RowPlaceholder;
|
|
797
839
|
exports.HeaderRowPlaceholder = HeaderRowPlaceholder;
|
|
798
840
|
exports.CDK_TABLE_TEMPLATE = CDK_TABLE_TEMPLATE;
|
|
@@ -809,6 +851,7 @@ exports.CdkRowDef = CdkRowDef;
|
|
|
809
851
|
exports.CdkCellOutlet = CdkCellOutlet;
|
|
810
852
|
exports.CdkHeaderRow = CdkHeaderRow;
|
|
811
853
|
exports.CdkRow = CdkRow;
|
|
854
|
+
exports.CdkTableModule = CdkTableModule;
|
|
812
855
|
|
|
813
856
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
814
857
|
|