@angular/cdk 8.0.0-beta.2 → 8.0.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/README.md +2 -2
- package/_overlay.scss +4 -4
- package/bundles/cdk-a11y.umd.js +227 -79
- 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 +20 -8
- package/bundles/cdk-accordion.umd.js.map +1 -1
- package/bundles/cdk-accordion.umd.min.js.map +1 -1
- package/bundles/cdk-bidi.umd.js +5 -5
- package/bundles/cdk-bidi.umd.min.js +1 -1
- package/bundles/cdk-bidi.umd.min.js.map +1 -1
- package/bundles/cdk-coercion.umd.js +5 -5
- package/bundles/cdk-collections.umd.js +38 -15
- 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-drag-drop.umd.js +571 -180
- package/bundles/cdk-drag-drop.umd.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.min.js +2 -2
- package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
- package/bundles/cdk-keycodes.umd.js +7 -3
- package/bundles/cdk-keycodes.umd.js.map +1 -1
- package/bundles/cdk-keycodes.umd.min.js.map +1 -1
- package/bundles/cdk-layout.umd.js +83 -30
- package/bundles/cdk-layout.umd.js.map +1 -1
- package/bundles/cdk-layout.umd.min.js +1 -1
- package/bundles/cdk-layout.umd.min.js.map +1 -1
- package/bundles/cdk-observers.umd.js +30 -11
- 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 +229 -108
- 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 +17 -10
- package/bundles/cdk-platform.umd.js.map +1 -1
- package/bundles/cdk-platform.umd.min.js +1 -1
- package/bundles/cdk-platform.umd.min.js.map +1 -1
- package/bundles/cdk-portal.umd.js +32 -13
- package/bundles/cdk-portal.umd.js.map +1 -1
- package/bundles/cdk-portal.umd.min.js.map +1 -1
- package/bundles/cdk-scrolling.umd.js +184 -62
- package/bundles/cdk-scrolling.umd.js.map +1 -1
- package/bundles/cdk-scrolling.umd.min.js +1 -1
- package/bundles/cdk-scrolling.umd.min.js.map +1 -1
- package/bundles/cdk-stepper.umd.js +30 -12
- package/bundles/cdk-stepper.umd.js.map +1 -1
- package/bundles/cdk-stepper.umd.min.js.map +1 -1
- package/bundles/cdk-table.umd.js +384 -74
- 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 +61 -21
- 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 +85 -29
- package/bundles/cdk-tree.umd.js.map +1 -1
- package/bundles/cdk-tree.umd.min.js.map +1 -1
- package/bundles/cdk.umd.js +2 -2
- 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/drag-drop/typings/directives/drag.d.ts +11 -2
- package/drag-drop/typings/drag-events.d.ts +17 -0
- package/drag-drop/typings/drag-ref.d.ts +9 -5
- package/drag-drop/typings/drop-list-ref.d.ts +9 -3
- package/drag-drop/typings/index.metadata.json +1 -1
- package/esm2015/a11y.js +229 -81
- package/esm2015/a11y.js.map +1 -1
- package/esm2015/accordion.js +22 -10
- package/esm2015/accordion.js.map +1 -1
- package/esm2015/bidi.js +8 -8
- package/esm2015/cdk.js +4 -4
- package/esm2015/cdk.js.map +1 -1
- package/esm2015/coercion.js +7 -7
- package/esm2015/collections.js +41 -18
- package/esm2015/collections.js.map +1 -1
- package/esm2015/drag-drop.js +540 -181
- package/esm2015/drag-drop.js.map +1 -1
- package/esm2015/keycodes.js +9 -5
- package/esm2015/keycodes.js.map +1 -1
- package/esm2015/layout.js +89 -36
- package/esm2015/layout.js.map +1 -1
- package/esm2015/observers.js +33 -14
- package/esm2015/observers.js.map +1 -1
- package/esm2015/overlay.js +232 -110
- package/esm2015/overlay.js.map +1 -1
- package/esm2015/platform.js +20 -13
- package/esm2015/platform.js.map +1 -1
- package/esm2015/portal.js +34 -15
- package/esm2015/portal.js.map +1 -1
- package/esm2015/scrolling.js +180 -58
- package/esm2015/scrolling.js.map +1 -1
- package/esm2015/stepper.js +32 -14
- package/esm2015/stepper.js.map +1 -1
- package/esm2015/table.js +369 -69
- package/esm2015/table.js.map +1 -1
- package/esm2015/text-field.js +64 -24
- package/esm2015/text-field.js.map +1 -1
- package/esm2015/tree.js +86 -30
- package/esm2015/tree.js.map +1 -1
- package/esm5/a11y.es5.js +230 -82
- package/esm5/a11y.es5.js.map +1 -1
- package/esm5/accordion.es5.js +22 -10
- package/esm5/accordion.es5.js.map +1 -1
- package/esm5/bidi.es5.js +8 -8
- package/esm5/cdk.es5.js +4 -4
- package/esm5/cdk.es5.js.map +1 -1
- package/esm5/coercion.es5.js +7 -7
- package/esm5/collections.es5.js +42 -19
- package/esm5/collections.es5.js.map +1 -1
- package/esm5/drag-drop.es5.js +574 -183
- package/esm5/drag-drop.es5.js.map +1 -1
- package/esm5/keycodes.es5.js +9 -5
- package/esm5/keycodes.es5.js.map +1 -1
- package/esm5/layout.es5.js +86 -33
- package/esm5/layout.es5.js.map +1 -1
- package/esm5/observers.es5.js +33 -14
- package/esm5/observers.es5.js.map +1 -1
- package/esm5/overlay.es5.js +232 -111
- package/esm5/overlay.es5.js.map +1 -1
- package/esm5/platform.es5.js +20 -13
- package/esm5/platform.es5.js.map +1 -1
- package/esm5/portal.es5.js +34 -15
- package/esm5/portal.es5.js.map +1 -1
- package/esm5/scrolling.es5.js +187 -65
- package/esm5/scrolling.es5.js.map +1 -1
- package/esm5/stepper.es5.js +32 -14
- package/esm5/stepper.es5.js.map +1 -1
- package/esm5/table.es5.js +386 -72
- package/esm5/table.es5.js.map +1 -1
- package/esm5/text-field.es5.js +64 -24
- package/esm5/text-field.es5.js.map +1 -1
- package/esm5/tree.es5.js +87 -31
- package/esm5/tree.es5.js.map +1 -1
- package/layout/typings/breakpoints-observer.d.ts +3 -3
- package/layout/typings/index.metadata.json +1 -1
- package/layout/typings/media-matcher.d.ts +2 -2
- package/overlay/typings/index.metadata.json +1 -1
- package/overlay/typings/position/flexible-connected-position-strategy.d.ts +1 -3
- package/package.json +8 -8
- package/portal/typings/portal.d.ts +2 -2
- package/schematics/ng-update/data/attribute-selectors.js +1 -1
- package/schematics/ng-update/data/attribute-selectors.js.map +1 -1
- package/schematics/ng-update/data/class-names.js +3 -3
- package/schematics/ng-update/data/class-names.js.map +1 -1
- package/schematics/ng-update/data/constructor-checks.js +1 -1
- package/schematics/ng-update/data/constructor-checks.js.map +1 -1
- package/schematics/ng-update/data/input-names.js +1 -1
- package/schematics/ng-update/data/input-names.js.map +1 -1
- package/schematics/ng-update/data/method-call-checks.js +1 -1
- package/schematics/ng-update/data/method-call-checks.js.map +1 -1
- package/schematics/ng-update/data/property-names.js +4 -4
- package/schematics/ng-update/data/property-names.js.map +1 -1
- package/schematics/ng-update/upgrade-rules/signature-check/constructorSignatureCheckRule.js +1 -1
- package/schematics/ng-update/upgrade-rules/signature-check/constructorSignatureCheckRule.js.map +1 -1
- package/schematics/tsconfig.tsbuildinfo +5811 -0
- package/schematics/utils/ast.d.ts +1 -1
- package/schematics/utils/build-component.js +1 -1
- package/schematics/utils/build-component.js.map +1 -1
- package/schematics/utils/get-project.d.ts +1 -1
- package/schematics/utils/project-main-file.d.ts +1 -1
- package/schematics/utils/project-style-file.d.ts +1 -1
- package/schematics/utils/project-targets.d.ts +1 -1
- package/schematics/utils/schematic-options.d.ts +1 -1
- package/table/typings/cell.d.ts +3 -2
- package/table/typings/index.metadata.json +1 -1
- package/table/typings/public-api.d.ts +1 -0
- package/table/typings/row.d.ts +5 -4
- package/table/typings/sticky-styler.d.ts +5 -5
- package/table/typings/table-errors.d.ts +10 -0
- package/table/typings/text-column.d.ts +80 -0
- package/typings/drag-drop/directives/drag.d.ts +11 -2
- package/typings/drag-drop/drag-events.d.ts +17 -0
- package/typings/drag-drop/drag-ref.d.ts +9 -5
- package/typings/drag-drop/drop-list-ref.d.ts +9 -3
- package/typings/drag-drop/index.metadata.json +1 -1
- package/typings/esm5/drag-drop/directives/drag.d.ts +11 -2
- package/typings/esm5/drag-drop/drag-events.d.ts +17 -0
- package/typings/esm5/drag-drop/drag-ref.d.ts +9 -5
- package/typings/esm5/drag-drop/drop-list-ref.d.ts +9 -3
- package/typings/esm5/drag-drop/index.metadata.json +1 -1
- package/typings/esm5/index.metadata.json +1 -1
- package/typings/esm5/layout/breakpoints-observer.d.ts +3 -3
- package/typings/esm5/layout/index.metadata.json +1 -1
- package/typings/esm5/layout/media-matcher.d.ts +2 -2
- package/typings/esm5/overlay/index.metadata.json +1 -1
- package/typings/esm5/overlay/position/flexible-connected-position-strategy.d.ts +1 -3
- package/typings/esm5/portal/portal.d.ts +2 -2
- package/typings/esm5/table/cell.d.ts +3 -2
- package/typings/esm5/table/index.metadata.json +1 -1
- package/typings/esm5/table/public-api.d.ts +1 -0
- package/typings/esm5/table/row.d.ts +5 -4
- package/typings/esm5/table/sticky-styler.d.ts +5 -5
- package/typings/esm5/table/table-errors.d.ts +10 -0
- package/typings/esm5/table/text-column.d.ts +80 -0
- package/typings/index.metadata.json +1 -1
- package/typings/layout/breakpoints-observer.d.ts +3 -3
- package/typings/layout/index.metadata.json +1 -1
- package/typings/layout/media-matcher.d.ts +2 -2
- package/typings/overlay/index.metadata.json +1 -1
- package/typings/overlay/position/flexible-connected-position-strategy.d.ts +1 -3
- package/typings/portal/portal.d.ts +2 -2
- package/typings/schematics/utils/ast.d.ts +1 -1
- package/typings/schematics/utils/get-project.d.ts +1 -1
- package/typings/schematics/utils/project-main-file.d.ts +1 -1
- package/typings/schematics/utils/project-style-file.d.ts +1 -1
- package/typings/schematics/utils/project-targets.d.ts +1 -1
- package/typings/schematics/utils/schematic-options.d.ts +1 -1
- package/typings/table/cell.d.ts +3 -2
- package/typings/table/index.metadata.json +1 -1
- package/typings/table/public-api.d.ts +1 -0
- package/typings/table/row.d.ts +5 -4
- package/typings/table/sticky-styler.d.ts +5 -5
- package/typings/table/table-errors.d.ts +10 -0
- package/typings/table/text-column.d.ts +80 -0
package/bundles/cdk-table.umd.js
CHANGED
|
@@ -42,7 +42,7 @@ function __extends(d, b) {
|
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* @fileoverview added by tsickle
|
|
45
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
45
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
46
46
|
*/
|
|
47
47
|
/**
|
|
48
48
|
* Mixin to provide a directive with a function that checks if the sticky input has been
|
|
@@ -122,7 +122,7 @@ function mixinHasStickyInput(base) {
|
|
|
122
122
|
|
|
123
123
|
/**
|
|
124
124
|
* @fileoverview added by tsickle
|
|
125
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
125
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
126
126
|
*/
|
|
127
127
|
/**
|
|
128
128
|
* Cell definition for a CDK table.
|
|
@@ -179,7 +179,7 @@ var CdkFooterCellDef = /** @class */ (function () {
|
|
|
179
179
|
/**
|
|
180
180
|
* \@docs-private
|
|
181
181
|
*/
|
|
182
|
-
var
|
|
182
|
+
var
|
|
183
183
|
// Boilerplate for applying mixins to CdkColumnDef.
|
|
184
184
|
/**
|
|
185
185
|
* \@docs-private
|
|
@@ -208,7 +208,9 @@ var CdkColumnDef = /** @class */ (function (_super) {
|
|
|
208
208
|
* Unique name for this column.
|
|
209
209
|
* @return {?}
|
|
210
210
|
*/
|
|
211
|
-
function () {
|
|
211
|
+
function () {
|
|
212
|
+
return this._name;
|
|
213
|
+
},
|
|
212
214
|
set: /**
|
|
213
215
|
* @param {?} name
|
|
214
216
|
* @return {?}
|
|
@@ -237,7 +239,9 @@ var CdkColumnDef = /** @class */ (function (_super) {
|
|
|
237
239
|
* has been changed.
|
|
238
240
|
* @return {?}
|
|
239
241
|
*/
|
|
240
|
-
function () {
|
|
242
|
+
function () {
|
|
243
|
+
return this._stickyEnd;
|
|
244
|
+
},
|
|
241
245
|
set: /**
|
|
242
246
|
* @param {?} v
|
|
243
247
|
* @return {?}
|
|
@@ -255,10 +259,7 @@ var CdkColumnDef = /** @class */ (function (_super) {
|
|
|
255
259
|
{ type: core.Directive, args: [{
|
|
256
260
|
selector: '[cdkColumnDef]',
|
|
257
261
|
inputs: ['sticky'],
|
|
258
|
-
providers: [{
|
|
259
|
-
provide: 'MAT_SORT_HEADER_COLUMN_DEF',
|
|
260
|
-
useExisting: CdkColumnDef
|
|
261
|
-
}],
|
|
262
|
+
providers: [{ provide: 'MAT_SORT_HEADER_COLUMN_DEF', useExisting: CdkColumnDef }],
|
|
262
263
|
},] },
|
|
263
264
|
];
|
|
264
265
|
CdkColumnDef.propDecorators = {
|
|
@@ -359,7 +360,7 @@ var CdkCell = /** @class */ (function (_super) {
|
|
|
359
360
|
|
|
360
361
|
/**
|
|
361
362
|
* @fileoverview added by tsickle
|
|
362
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
363
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
363
364
|
*/
|
|
364
365
|
/**
|
|
365
366
|
* The row template that can be used by the mat-table. Should not be used outside of the
|
|
@@ -445,7 +446,7 @@ BaseRowDef = /** @class */ (function () {
|
|
|
445
446
|
/**
|
|
446
447
|
* \@docs-private
|
|
447
448
|
*/
|
|
448
|
-
var
|
|
449
|
+
var
|
|
449
450
|
// Boilerplate for applying mixins to CdkHeaderRowDef.
|
|
450
451
|
/**
|
|
451
452
|
* \@docs-private
|
|
@@ -503,7 +504,7 @@ var CdkHeaderRowDef = /** @class */ (function (_super) {
|
|
|
503
504
|
/**
|
|
504
505
|
* \@docs-private
|
|
505
506
|
*/
|
|
506
|
-
var
|
|
507
|
+
var
|
|
507
508
|
// Boilerplate for applying mixins to CdkFooterRowDef.
|
|
508
509
|
/**
|
|
509
510
|
* \@docs-private
|
|
@@ -688,7 +689,7 @@ var CdkRow = /** @class */ (function () {
|
|
|
688
689
|
|
|
689
690
|
/**
|
|
690
691
|
* @fileoverview added by tsickle
|
|
691
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
692
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
692
693
|
*/
|
|
693
694
|
|
|
694
695
|
/**
|
|
@@ -707,18 +708,18 @@ var /**
|
|
|
707
708
|
*/
|
|
708
709
|
StickyStyler = /** @class */ (function () {
|
|
709
710
|
/**
|
|
710
|
-
* @param
|
|
711
|
+
* @param _isNativeHtmlTable Whether the sticky logic should be based on a table
|
|
711
712
|
* that uses the native `<table>` element.
|
|
712
|
-
* @param
|
|
713
|
+
* @param _stickCellCss The CSS class that will be applied to every row/cell that has
|
|
713
714
|
* sticky positioning applied.
|
|
714
715
|
* @param direction The directionality context of the table (ltr/rtl); affects column positioning
|
|
715
716
|
* by reversing left/right positions.
|
|
716
717
|
* @param _isBrowser Whether the table is currently being rendered on the server or the client.
|
|
717
718
|
*/
|
|
718
|
-
function StickyStyler(
|
|
719
|
+
function StickyStyler(_isNativeHtmlTable, _stickCellCss, direction, _isBrowser) {
|
|
719
720
|
if (_isBrowser === void 0) { _isBrowser = true; }
|
|
720
|
-
this.
|
|
721
|
-
this.
|
|
721
|
+
this._isNativeHtmlTable = _isNativeHtmlTable;
|
|
722
|
+
this._stickCellCss = _stickCellCss;
|
|
722
723
|
this.direction = direction;
|
|
723
724
|
this._isBrowser = _isBrowser;
|
|
724
725
|
}
|
|
@@ -789,7 +790,15 @@ StickyStyler = /** @class */ (function () {
|
|
|
789
790
|
*/
|
|
790
791
|
function (rows, stickyStartStates, stickyEndStates) {
|
|
791
792
|
/** @type {?} */
|
|
792
|
-
var hasStickyColumns = stickyStartStates.some(
|
|
793
|
+
var hasStickyColumns = stickyStartStates.some((/**
|
|
794
|
+
* @param {?} state
|
|
795
|
+
* @return {?}
|
|
796
|
+
*/
|
|
797
|
+
function (state) { return state; })) || stickyEndStates.some((/**
|
|
798
|
+
* @param {?} state
|
|
799
|
+
* @return {?}
|
|
800
|
+
*/
|
|
801
|
+
function (state) { return state; }));
|
|
793
802
|
if (!rows.length || !hasStickyColumns || !this._isBrowser) {
|
|
794
803
|
return;
|
|
795
804
|
}
|
|
@@ -871,7 +880,7 @@ StickyStyler = /** @class */ (function () {
|
|
|
871
880
|
}
|
|
872
881
|
/** @type {?} */
|
|
873
882
|
var row = rows[rowIndex];
|
|
874
|
-
if (this.
|
|
883
|
+
if (this._isNativeHtmlTable) {
|
|
875
884
|
for (var j = 0; j < row.children.length; j++) {
|
|
876
885
|
/** @type {?} */
|
|
877
886
|
var cell = (/** @type {?} */ (row.children[j]));
|
|
@@ -915,12 +924,16 @@ StickyStyler = /** @class */ (function () {
|
|
|
915
924
|
* @return {?}
|
|
916
925
|
*/
|
|
917
926
|
function (tableElement, stickyStates) {
|
|
918
|
-
if (!this.
|
|
927
|
+
if (!this._isNativeHtmlTable) {
|
|
919
928
|
return;
|
|
920
929
|
}
|
|
921
930
|
/** @type {?} */
|
|
922
931
|
var tfoot = (/** @type {?} */ (tableElement.querySelector('tfoot')));
|
|
923
|
-
if (stickyStates.some(
|
|
932
|
+
if (stickyStates.some((/**
|
|
933
|
+
* @param {?} state
|
|
934
|
+
* @return {?}
|
|
935
|
+
*/
|
|
936
|
+
function (state) { return !state; }))) {
|
|
924
937
|
this._removeStickyStyle(tfoot, ['bottom']);
|
|
925
938
|
}
|
|
926
939
|
else {
|
|
@@ -957,10 +970,14 @@ StickyStyler = /** @class */ (function () {
|
|
|
957
970
|
// If the element no longer has any more sticky directions, remove sticky positioning and
|
|
958
971
|
// the sticky CSS class.
|
|
959
972
|
/** @type {?} */
|
|
960
|
-
var hasDirection = STICKY_DIRECTIONS.some(
|
|
973
|
+
var hasDirection = STICKY_DIRECTIONS.some((/**
|
|
974
|
+
* @param {?} dir
|
|
975
|
+
* @return {?}
|
|
976
|
+
*/
|
|
977
|
+
function (dir) { return !!element.style[dir]; }));
|
|
961
978
|
if (!hasDirection) {
|
|
962
979
|
element.style.position = '';
|
|
963
|
-
element.classList.remove(this.
|
|
980
|
+
element.classList.remove(this._stickCellCss);
|
|
964
981
|
}
|
|
965
982
|
};
|
|
966
983
|
/**
|
|
@@ -987,7 +1004,7 @@ StickyStyler = /** @class */ (function () {
|
|
|
987
1004
|
* @return {?}
|
|
988
1005
|
*/
|
|
989
1006
|
function (element, dir, dirValue) {
|
|
990
|
-
element.classList.add(this.
|
|
1007
|
+
element.classList.add(this._stickCellCss);
|
|
991
1008
|
element.style[dir] = dirValue + "px";
|
|
992
1009
|
element.style.cssText += 'position: -webkit-sticky; position: sticky; ';
|
|
993
1010
|
element.style.zIndex = this._getCalculatedZIndex(element);
|
|
@@ -1143,7 +1160,7 @@ StickyStyler = /** @class */ (function () {
|
|
|
1143
1160
|
|
|
1144
1161
|
/**
|
|
1145
1162
|
* @fileoverview added by tsickle
|
|
1146
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1163
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1147
1164
|
*/
|
|
1148
1165
|
|
|
1149
1166
|
/**
|
|
@@ -1199,10 +1216,26 @@ function getTableMissingRowDefsError() {
|
|
|
1199
1216
|
function getTableUnknownDataSourceError() {
|
|
1200
1217
|
return Error("Provided data source did not match an array, Observable, or DataSource");
|
|
1201
1218
|
}
|
|
1219
|
+
/**
|
|
1220
|
+
* Returns an error to be thrown when the text column cannot find a parent table to inject.
|
|
1221
|
+
* \@docs-private
|
|
1222
|
+
* @return {?}
|
|
1223
|
+
*/
|
|
1224
|
+
function getTableTextColumnMissingParentTableError() {
|
|
1225
|
+
return Error("Text column could not find a parent table for registration.");
|
|
1226
|
+
}
|
|
1227
|
+
/**
|
|
1228
|
+
* Returns an error to be thrown when a table text column doesn't have a name.
|
|
1229
|
+
* \@docs-private
|
|
1230
|
+
* @return {?}
|
|
1231
|
+
*/
|
|
1232
|
+
function getTableTextColumnMissingNameError() {
|
|
1233
|
+
return Error("Table text column must have a name.");
|
|
1234
|
+
}
|
|
1202
1235
|
|
|
1203
1236
|
/**
|
|
1204
1237
|
* @fileoverview added by tsickle
|
|
1205
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1238
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1206
1239
|
*/
|
|
1207
1240
|
/**
|
|
1208
1241
|
* Provides a handle for the table to grab the view container's ng-container to insert data rows.
|
|
@@ -1494,7 +1527,9 @@ var CdkTable = /** @class */ (function () {
|
|
|
1494
1527
|
*/
|
|
1495
1528
|
function (v) {
|
|
1496
1529
|
this._multiTemplateDataRows = coercion.coerceBooleanProperty(v);
|
|
1497
|
-
if (
|
|
1530
|
+
// In Ivy if this value is set via a static attribute (e.g. <table multiTemplateDataRows>),
|
|
1531
|
+
// this setter will be invoked before the row outlet has been defined hence the null check.
|
|
1532
|
+
if (this._rowOutlet && this._rowOutlet.viewContainer.length) {
|
|
1498
1533
|
this._forceRenderDataRows();
|
|
1499
1534
|
}
|
|
1500
1535
|
},
|
|
@@ -1516,9 +1551,14 @@ var CdkTable = /** @class */ (function () {
|
|
|
1516
1551
|
// Set up the trackBy function so that it uses the `RenderRow` as its identity by default. If
|
|
1517
1552
|
// the user has provided a custom trackBy, return the result of that function as evaluated
|
|
1518
1553
|
// with the values of the `RenderRow`'s data and index.
|
|
1519
|
-
this._dataDiffer = this._differs.find([]).create(
|
|
1554
|
+
this._dataDiffer = this._differs.find([]).create((/**
|
|
1555
|
+
* @param {?} _i
|
|
1556
|
+
* @param {?} dataRow
|
|
1557
|
+
* @return {?}
|
|
1558
|
+
*/
|
|
1559
|
+
function (_i, dataRow) {
|
|
1520
1560
|
return _this.trackBy ? _this.trackBy(dataRow.dataIndex, dataRow.data) : dataRow;
|
|
1521
|
-
});
|
|
1561
|
+
}));
|
|
1522
1562
|
};
|
|
1523
1563
|
/**
|
|
1524
1564
|
* @return {?}
|
|
@@ -1612,7 +1652,13 @@ var CdkTable = /** @class */ (function () {
|
|
|
1612
1652
|
}
|
|
1613
1653
|
/** @type {?} */
|
|
1614
1654
|
var viewContainer = this._rowOutlet.viewContainer;
|
|
1615
|
-
changes.forEachOperation(
|
|
1655
|
+
changes.forEachOperation((/**
|
|
1656
|
+
* @param {?} record
|
|
1657
|
+
* @param {?} prevIndex
|
|
1658
|
+
* @param {?} currentIndex
|
|
1659
|
+
* @return {?}
|
|
1660
|
+
*/
|
|
1661
|
+
function (record, prevIndex, currentIndex) {
|
|
1616
1662
|
if (record.previousIndex == null) {
|
|
1617
1663
|
_this._insertRow(record.item, (/** @type {?} */ (currentIndex)));
|
|
1618
1664
|
}
|
|
@@ -1624,16 +1670,20 @@ var CdkTable = /** @class */ (function () {
|
|
|
1624
1670
|
var view = (/** @type {?} */ (viewContainer.get((/** @type {?} */ (prevIndex)))));
|
|
1625
1671
|
viewContainer.move((/** @type {?} */ (view)), currentIndex);
|
|
1626
1672
|
}
|
|
1627
|
-
});
|
|
1673
|
+
}));
|
|
1628
1674
|
// Update the meta context of a row's context data (index, count, first, last, ...)
|
|
1629
1675
|
this._updateRowIndexContext();
|
|
1630
1676
|
// Update rows that did not get added/removed/moved but may have had their identity changed,
|
|
1631
1677
|
// e.g. if trackBy matched data on some property but the actual data reference changed.
|
|
1632
|
-
changes.forEachIdentityChange(
|
|
1678
|
+
changes.forEachIdentityChange((/**
|
|
1679
|
+
* @param {?} record
|
|
1680
|
+
* @return {?}
|
|
1681
|
+
*/
|
|
1682
|
+
function (record) {
|
|
1633
1683
|
/** @type {?} */
|
|
1634
1684
|
var rowView = (/** @type {?} */ (viewContainer.get((/** @type {?} */ (record.currentIndex)))));
|
|
1635
1685
|
rowView.context.$implicit = record.item.data;
|
|
1636
|
-
});
|
|
1686
|
+
}));
|
|
1637
1687
|
this.updateStickyColumnStyles();
|
|
1638
1688
|
};
|
|
1639
1689
|
/**
|
|
@@ -1853,11 +1903,19 @@ var CdkTable = /** @class */ (function () {
|
|
|
1853
1903
|
thead.style.display = headerRows.length ? '' : 'none';
|
|
1854
1904
|
}
|
|
1855
1905
|
/** @type {?} */
|
|
1856
|
-
var stickyStates = this._headerRowDefs.map(
|
|
1906
|
+
var stickyStates = this._headerRowDefs.map((/**
|
|
1907
|
+
* @param {?} def
|
|
1908
|
+
* @return {?}
|
|
1909
|
+
*/
|
|
1910
|
+
function (def) { return def.sticky; }));
|
|
1857
1911
|
this._stickyStyler.clearStickyPositioning(headerRows, ['top']);
|
|
1858
1912
|
this._stickyStyler.stickRows(headerRows, stickyStates, 'top');
|
|
1859
1913
|
// Reset the dirty state of the sticky input change since it has been used.
|
|
1860
|
-
this._headerRowDefs.forEach(
|
|
1914
|
+
this._headerRowDefs.forEach((/**
|
|
1915
|
+
* @param {?} def
|
|
1916
|
+
* @return {?}
|
|
1917
|
+
*/
|
|
1918
|
+
function (def) { return def.resetStickyChanged(); }));
|
|
1861
1919
|
};
|
|
1862
1920
|
/**
|
|
1863
1921
|
* Updates the footer sticky styles. First resets all applied styles with respect to the cells
|
|
@@ -1896,12 +1954,20 @@ var CdkTable = /** @class */ (function () {
|
|
|
1896
1954
|
tfoot.style.display = footerRows.length ? '' : 'none';
|
|
1897
1955
|
}
|
|
1898
1956
|
/** @type {?} */
|
|
1899
|
-
var stickyStates = this._footerRowDefs.map(
|
|
1957
|
+
var stickyStates = this._footerRowDefs.map((/**
|
|
1958
|
+
* @param {?} def
|
|
1959
|
+
* @return {?}
|
|
1960
|
+
*/
|
|
1961
|
+
function (def) { return def.sticky; }));
|
|
1900
1962
|
this._stickyStyler.clearStickyPositioning(footerRows, ['bottom']);
|
|
1901
1963
|
this._stickyStyler.stickRows(footerRows, stickyStates, 'bottom');
|
|
1902
1964
|
this._stickyStyler.updateStickyFooterContainer(this._elementRef.nativeElement, stickyStates);
|
|
1903
1965
|
// Reset the dirty state of the sticky input change since it has been used.
|
|
1904
|
-
this._footerRowDefs.forEach(
|
|
1966
|
+
this._footerRowDefs.forEach((/**
|
|
1967
|
+
* @param {?} def
|
|
1968
|
+
* @return {?}
|
|
1969
|
+
*/
|
|
1970
|
+
function (def) { return def.resetStickyChanged(); }));
|
|
1905
1971
|
};
|
|
1906
1972
|
/**
|
|
1907
1973
|
* Updates the column sticky styles. First resets all applied styles with respect to the cells
|
|
@@ -1938,11 +2004,20 @@ var CdkTable = /** @class */ (function () {
|
|
|
1938
2004
|
// sticky columns span across all table sections (header, data, footer)
|
|
1939
2005
|
this._stickyStyler.clearStickyPositioning(headerRows.concat(dataRows, footerRows), ['left', 'right']);
|
|
1940
2006
|
// Update the sticky styles for each header row depending on the def's sticky state
|
|
1941
|
-
headerRows.forEach(
|
|
2007
|
+
headerRows.forEach((/**
|
|
2008
|
+
* @param {?} headerRow
|
|
2009
|
+
* @param {?} i
|
|
2010
|
+
* @return {?}
|
|
2011
|
+
*/
|
|
2012
|
+
function (headerRow, i) {
|
|
1942
2013
|
_this._addStickyColumnStyles([headerRow], _this._headerRowDefs[i]);
|
|
1943
|
-
});
|
|
2014
|
+
}));
|
|
1944
2015
|
// Update the sticky styles for each data row depending on its def's sticky state
|
|
1945
|
-
this._rowDefs.forEach(
|
|
2016
|
+
this._rowDefs.forEach((/**
|
|
2017
|
+
* @param {?} rowDef
|
|
2018
|
+
* @return {?}
|
|
2019
|
+
*/
|
|
2020
|
+
function (rowDef) {
|
|
1946
2021
|
// Collect all the rows rendered with this row definition.
|
|
1947
2022
|
/** @type {?} */
|
|
1948
2023
|
var rows = [];
|
|
@@ -1952,13 +2027,22 @@ var CdkTable = /** @class */ (function () {
|
|
|
1952
2027
|
}
|
|
1953
2028
|
}
|
|
1954
2029
|
_this._addStickyColumnStyles(rows, rowDef);
|
|
1955
|
-
});
|
|
2030
|
+
}));
|
|
1956
2031
|
// Update the sticky styles for each footer row depending on the def's sticky state
|
|
1957
|
-
footerRows.forEach(
|
|
2032
|
+
footerRows.forEach((/**
|
|
2033
|
+
* @param {?} footerRow
|
|
2034
|
+
* @param {?} i
|
|
2035
|
+
* @return {?}
|
|
2036
|
+
*/
|
|
2037
|
+
function (footerRow, i) {
|
|
1958
2038
|
_this._addStickyColumnStyles([footerRow], _this._footerRowDefs[i]);
|
|
1959
|
-
});
|
|
2039
|
+
}));
|
|
1960
2040
|
// Reset the dirty state of the sticky input change since it has been used.
|
|
1961
|
-
Array.from(this._columnDefsByName.values()).forEach(
|
|
2041
|
+
Array.from(this._columnDefsByName.values()).forEach((/**
|
|
2042
|
+
* @param {?} def
|
|
2043
|
+
* @return {?}
|
|
2044
|
+
*/
|
|
2045
|
+
function (def) { return def.resetStickyChanged(); }));
|
|
1962
2046
|
};
|
|
1963
2047
|
/**
|
|
1964
2048
|
* Get the list of RenderRow objects to render according to the current list of data and defined
|
|
@@ -2041,7 +2125,11 @@ var CdkTable = /** @class */ (function () {
|
|
|
2041
2125
|
function (data, dataIndex, cache) {
|
|
2042
2126
|
/** @type {?} */
|
|
2043
2127
|
var rowDefs = this._getRowDefs(data, dataIndex);
|
|
2044
|
-
return rowDefs.map(
|
|
2128
|
+
return rowDefs.map((/**
|
|
2129
|
+
* @param {?} rowDef
|
|
2130
|
+
* @return {?}
|
|
2131
|
+
*/
|
|
2132
|
+
function (rowDef) {
|
|
2045
2133
|
/** @type {?} */
|
|
2046
2134
|
var cachedRenderRows = (cache && cache.has(rowDef)) ? (/** @type {?} */ (cache.get(rowDef))) : [];
|
|
2047
2135
|
if (cachedRenderRows.length) {
|
|
@@ -2053,7 +2141,7 @@ var CdkTable = /** @class */ (function () {
|
|
|
2053
2141
|
else {
|
|
2054
2142
|
return { data: data, rowDef: rowDef, dataIndex: dataIndex };
|
|
2055
2143
|
}
|
|
2056
|
-
});
|
|
2144
|
+
}));
|
|
2057
2145
|
};
|
|
2058
2146
|
/** Update the map containing the content's column definitions. */
|
|
2059
2147
|
/**
|
|
@@ -2071,12 +2159,16 @@ var CdkTable = /** @class */ (function () {
|
|
|
2071
2159
|
this._columnDefsByName.clear();
|
|
2072
2160
|
/** @type {?} */
|
|
2073
2161
|
var columnDefs = mergeQueryListAndSet(this._contentColumnDefs, this._customColumnDefs);
|
|
2074
|
-
columnDefs.forEach(
|
|
2162
|
+
columnDefs.forEach((/**
|
|
2163
|
+
* @param {?} columnDef
|
|
2164
|
+
* @return {?}
|
|
2165
|
+
*/
|
|
2166
|
+
function (columnDef) {
|
|
2075
2167
|
if (_this._columnDefsByName.has(columnDef.name)) {
|
|
2076
2168
|
throw getTableDuplicateColumnNameError(columnDef.name);
|
|
2077
2169
|
}
|
|
2078
2170
|
_this._columnDefsByName.set(columnDef.name, columnDef);
|
|
2079
|
-
});
|
|
2171
|
+
}));
|
|
2080
2172
|
};
|
|
2081
2173
|
/** Update the list of all available row definitions that can be used. */
|
|
2082
2174
|
/**
|
|
@@ -2097,7 +2189,11 @@ var CdkTable = /** @class */ (function () {
|
|
|
2097
2189
|
this._rowDefs = mergeQueryListAndSet(this._contentRowDefs, this._customRowDefs);
|
|
2098
2190
|
// After all row definitions are determined, find the row definition to be considered default.
|
|
2099
2191
|
/** @type {?} */
|
|
2100
|
-
var defaultRowDefs = this._rowDefs.filter(
|
|
2192
|
+
var defaultRowDefs = this._rowDefs.filter((/**
|
|
2193
|
+
* @param {?} def
|
|
2194
|
+
* @return {?}
|
|
2195
|
+
*/
|
|
2196
|
+
function (def) { return !def.when; }));
|
|
2101
2197
|
if (!this.multiTemplateDataRows && defaultRowDefs.length > 1) {
|
|
2102
2198
|
throw getTableMultipleDefaultRowDefsError();
|
|
2103
2199
|
}
|
|
@@ -2124,7 +2220,12 @@ var CdkTable = /** @class */ (function () {
|
|
|
2124
2220
|
*/
|
|
2125
2221
|
function () {
|
|
2126
2222
|
/** @type {?} */
|
|
2127
|
-
var columnsDiffReducer =
|
|
2223
|
+
var columnsDiffReducer = (/**
|
|
2224
|
+
* @param {?} acc
|
|
2225
|
+
* @param {?} def
|
|
2226
|
+
* @return {?}
|
|
2227
|
+
*/
|
|
2228
|
+
function (acc, def) { return acc || !!def.getColumnsDiff(); });
|
|
2128
2229
|
// Force re-render data rows if the list of column definitions have changed.
|
|
2129
2230
|
if (this._rowDefs.reduce(columnsDiffReducer, false)) {
|
|
2130
2231
|
this._forceRenderDataRows();
|
|
@@ -2207,10 +2308,14 @@ var CdkTable = /** @class */ (function () {
|
|
|
2207
2308
|
if (dataStream === undefined) {
|
|
2208
2309
|
throw getTableUnknownDataSourceError();
|
|
2209
2310
|
}
|
|
2210
|
-
this._renderChangeSubscription = dataStream.pipe(operators.takeUntil(this._onDestroy)).subscribe(
|
|
2311
|
+
this._renderChangeSubscription = dataStream.pipe(operators.takeUntil(this._onDestroy)).subscribe((/**
|
|
2312
|
+
* @param {?} data
|
|
2313
|
+
* @return {?}
|
|
2314
|
+
*/
|
|
2315
|
+
function (data) {
|
|
2211
2316
|
_this._data = data || [];
|
|
2212
2317
|
_this.renderRows();
|
|
2213
|
-
});
|
|
2318
|
+
}));
|
|
2214
2319
|
};
|
|
2215
2320
|
/**
|
|
2216
2321
|
* Clears any existing content in the header row outlet and creates a new embedded view
|
|
@@ -2234,7 +2339,12 @@ var CdkTable = /** @class */ (function () {
|
|
|
2234
2339
|
if (this._headerRowOutlet.viewContainer.length > 0) {
|
|
2235
2340
|
this._headerRowOutlet.viewContainer.clear();
|
|
2236
2341
|
}
|
|
2237
|
-
this._headerRowDefs.forEach(
|
|
2342
|
+
this._headerRowDefs.forEach((/**
|
|
2343
|
+
* @param {?} def
|
|
2344
|
+
* @param {?} i
|
|
2345
|
+
* @return {?}
|
|
2346
|
+
*/
|
|
2347
|
+
function (def, i) { return _this._renderRow(_this._headerRowOutlet, def, i); }));
|
|
2238
2348
|
this.updateStickyHeaderRowStyles();
|
|
2239
2349
|
this.updateStickyColumnStyles();
|
|
2240
2350
|
};
|
|
@@ -2260,7 +2370,12 @@ var CdkTable = /** @class */ (function () {
|
|
|
2260
2370
|
if (this._footerRowOutlet.viewContainer.length > 0) {
|
|
2261
2371
|
this._footerRowOutlet.viewContainer.clear();
|
|
2262
2372
|
}
|
|
2263
|
-
this._footerRowDefs.forEach(
|
|
2373
|
+
this._footerRowDefs.forEach((/**
|
|
2374
|
+
* @param {?} def
|
|
2375
|
+
* @param {?} i
|
|
2376
|
+
* @return {?}
|
|
2377
|
+
*/
|
|
2378
|
+
function (def, i) { return _this._renderRow(_this._footerRowOutlet, def, i); }));
|
|
2264
2379
|
this.updateStickyFooterRowStyles();
|
|
2265
2380
|
this.updateStickyColumnStyles();
|
|
2266
2381
|
};
|
|
@@ -2282,18 +2397,30 @@ var CdkTable = /** @class */ (function () {
|
|
|
2282
2397
|
function (rows, rowDef) {
|
|
2283
2398
|
var _this = this;
|
|
2284
2399
|
/** @type {?} */
|
|
2285
|
-
var columnDefs = Array.from(rowDef.columns || []).map(
|
|
2400
|
+
var columnDefs = Array.from(rowDef.columns || []).map((/**
|
|
2401
|
+
* @param {?} columnName
|
|
2402
|
+
* @return {?}
|
|
2403
|
+
*/
|
|
2404
|
+
function (columnName) {
|
|
2286
2405
|
/** @type {?} */
|
|
2287
2406
|
var columnDef = _this._columnDefsByName.get(columnName);
|
|
2288
2407
|
if (!columnDef) {
|
|
2289
2408
|
throw getTableUnknownColumnError(columnName);
|
|
2290
2409
|
}
|
|
2291
2410
|
return (/** @type {?} */ (columnDef));
|
|
2292
|
-
});
|
|
2411
|
+
}));
|
|
2293
2412
|
/** @type {?} */
|
|
2294
|
-
var stickyStartStates = columnDefs.map(
|
|
2413
|
+
var stickyStartStates = columnDefs.map((/**
|
|
2414
|
+
* @param {?} columnDef
|
|
2415
|
+
* @return {?}
|
|
2416
|
+
*/
|
|
2417
|
+
function (columnDef) { return columnDef.sticky; }));
|
|
2295
2418
|
/** @type {?} */
|
|
2296
|
-
var stickyEndStates = columnDefs.map(
|
|
2419
|
+
var stickyEndStates = columnDefs.map((/**
|
|
2420
|
+
* @param {?} columnDef
|
|
2421
|
+
* @return {?}
|
|
2422
|
+
*/
|
|
2423
|
+
function (columnDef) { return columnDef.stickyEnd; }));
|
|
2297
2424
|
this._stickyStyler.updateStickyColumns(rows, stickyStartStates, stickyEndStates);
|
|
2298
2425
|
};
|
|
2299
2426
|
/** Gets the list of rows that have been rendered in the row outlet. */
|
|
@@ -2348,11 +2475,19 @@ var CdkTable = /** @class */ (function () {
|
|
|
2348
2475
|
/** @type {?} */
|
|
2349
2476
|
var rowDefs = [];
|
|
2350
2477
|
if (this.multiTemplateDataRows) {
|
|
2351
|
-
rowDefs = this._rowDefs.filter(
|
|
2478
|
+
rowDefs = this._rowDefs.filter((/**
|
|
2479
|
+
* @param {?} def
|
|
2480
|
+
* @return {?}
|
|
2481
|
+
*/
|
|
2482
|
+
function (def) { return !def.when || def.when(dataIndex, data); }));
|
|
2352
2483
|
}
|
|
2353
2484
|
else {
|
|
2354
2485
|
/** @type {?} */
|
|
2355
|
-
var rowDef = this._rowDefs.find(
|
|
2486
|
+
var rowDef = this._rowDefs.find((/**
|
|
2487
|
+
* @param {?} def
|
|
2488
|
+
* @return {?}
|
|
2489
|
+
*/
|
|
2490
|
+
function (def) { return def.when && def.when(dataIndex, data); })) || this._defaultRowDef;
|
|
2356
2491
|
if (rowDef) {
|
|
2357
2492
|
rowDefs.push(rowDef);
|
|
2358
2493
|
}
|
|
@@ -2484,14 +2619,18 @@ var CdkTable = /** @class */ (function () {
|
|
|
2484
2619
|
if (!rowDef || !rowDef.columns) {
|
|
2485
2620
|
return [];
|
|
2486
2621
|
}
|
|
2487
|
-
return Array.from(rowDef.columns,
|
|
2622
|
+
return Array.from(rowDef.columns, (/**
|
|
2623
|
+
* @param {?} columnId
|
|
2624
|
+
* @return {?}
|
|
2625
|
+
*/
|
|
2626
|
+
function (columnId) {
|
|
2488
2627
|
/** @type {?} */
|
|
2489
2628
|
var column = _this._columnDefsByName.get(columnId);
|
|
2490
2629
|
if (!column) {
|
|
2491
2630
|
throw getTableUnknownColumnError(columnId);
|
|
2492
2631
|
}
|
|
2493
2632
|
return rowDef.extractCellTemplate(column);
|
|
2494
|
-
});
|
|
2633
|
+
}));
|
|
2495
2634
|
};
|
|
2496
2635
|
/** Adds native table sections (e.g. tbody) and moves the row outlets into them. */
|
|
2497
2636
|
/**
|
|
@@ -2570,9 +2709,14 @@ var CdkTable = /** @class */ (function () {
|
|
|
2570
2709
|
*/
|
|
2571
2710
|
function () {
|
|
2572
2711
|
/** @type {?} */
|
|
2573
|
-
var stickyCheckReducer =
|
|
2712
|
+
var stickyCheckReducer = (/**
|
|
2713
|
+
* @param {?} acc
|
|
2714
|
+
* @param {?} d
|
|
2715
|
+
* @return {?}
|
|
2716
|
+
*/
|
|
2717
|
+
function (acc, d) {
|
|
2574
2718
|
return acc || d.hasStickyChanged();
|
|
2575
|
-
};
|
|
2719
|
+
});
|
|
2576
2720
|
// Note that the check needs to occur for every definition since it notifies the definition
|
|
2577
2721
|
// that it can reset its dirty state. Using another operator like `some` may short-circuit
|
|
2578
2722
|
// remaining definitions and leave them in an unchecked state.
|
|
@@ -2612,10 +2756,14 @@ var CdkTable = /** @class */ (function () {
|
|
|
2612
2756
|
this._stickyStyler = new StickyStyler(this._isNativeHtmlTable, this.stickyCssClass, direction, this._platform.isBrowser);
|
|
2613
2757
|
(this._dir ? this._dir.change : rxjs.of())
|
|
2614
2758
|
.pipe(operators.takeUntil(this._onDestroy))
|
|
2615
|
-
.subscribe(
|
|
2759
|
+
.subscribe((/**
|
|
2760
|
+
* @param {?} value
|
|
2761
|
+
* @return {?}
|
|
2762
|
+
*/
|
|
2763
|
+
function (value) {
|
|
2616
2764
|
_this._stickyStyler.direction = value;
|
|
2617
2765
|
_this.updateStickyColumnStyles();
|
|
2618
|
-
});
|
|
2766
|
+
}));
|
|
2619
2767
|
};
|
|
2620
2768
|
CdkTable.decorators = [
|
|
2621
2769
|
{ type: core.Component, args: [{selector: 'cdk-table, table[cdk-table]',
|
|
@@ -2669,7 +2817,172 @@ function mergeQueryListAndSet(queryList, set) {
|
|
|
2669
2817
|
|
|
2670
2818
|
/**
|
|
2671
2819
|
* @fileoverview added by tsickle
|
|
2672
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2820
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2821
|
+
*/
|
|
2822
|
+
/**
|
|
2823
|
+
* Injection token that can be used to specify the text column options.
|
|
2824
|
+
* @type {?}
|
|
2825
|
+
*/
|
|
2826
|
+
var TEXT_COLUMN_OPTIONS = new core.InjectionToken('text-column-options');
|
|
2827
|
+
/**
|
|
2828
|
+
* Column that simply shows text content for the header and row cells. Assumes that the table
|
|
2829
|
+
* is using the native table implementation (`<table>`).
|
|
2830
|
+
*
|
|
2831
|
+
* By default, the name of this column will be the header text and data property accessor.
|
|
2832
|
+
* The header text can be overridden with the `headerText` input. Cell values can be overridden with
|
|
2833
|
+
* the `dataAccessor` input. Change the text justification to the start or end using the `justify`
|
|
2834
|
+
* input.
|
|
2835
|
+
* @template T
|
|
2836
|
+
*/
|
|
2837
|
+
var CdkTextColumn = /** @class */ (function () {
|
|
2838
|
+
function CdkTextColumn(_table, _options) {
|
|
2839
|
+
this._table = _table;
|
|
2840
|
+
this._options = _options;
|
|
2841
|
+
/**
|
|
2842
|
+
* Alignment of the cell values.
|
|
2843
|
+
*/
|
|
2844
|
+
this.justify = 'start';
|
|
2845
|
+
this._options = _options || {};
|
|
2846
|
+
}
|
|
2847
|
+
Object.defineProperty(CdkTextColumn.prototype, "name", {
|
|
2848
|
+
/** Column name that should be used to reference this column. */
|
|
2849
|
+
get: /**
|
|
2850
|
+
* Column name that should be used to reference this column.
|
|
2851
|
+
* @return {?}
|
|
2852
|
+
*/
|
|
2853
|
+
function () {
|
|
2854
|
+
return this._name;
|
|
2855
|
+
},
|
|
2856
|
+
set: /**
|
|
2857
|
+
* @param {?} name
|
|
2858
|
+
* @return {?}
|
|
2859
|
+
*/
|
|
2860
|
+
function (name) {
|
|
2861
|
+
this._name = name;
|
|
2862
|
+
// With Ivy, inputs can be initialized before static query results are
|
|
2863
|
+
// available. In that case, we defer the synchronization until "ngOnInit" fires.
|
|
2864
|
+
this._syncColumnDefName();
|
|
2865
|
+
},
|
|
2866
|
+
enumerable: true,
|
|
2867
|
+
configurable: true
|
|
2868
|
+
});
|
|
2869
|
+
/**
|
|
2870
|
+
* @return {?}
|
|
2871
|
+
*/
|
|
2872
|
+
CdkTextColumn.prototype.ngOnInit = /**
|
|
2873
|
+
* @return {?}
|
|
2874
|
+
*/
|
|
2875
|
+
function () {
|
|
2876
|
+
this._syncColumnDefName();
|
|
2877
|
+
if (this.headerText === undefined) {
|
|
2878
|
+
this.headerText = this._createDefaultHeaderText();
|
|
2879
|
+
}
|
|
2880
|
+
if (!this.dataAccessor) {
|
|
2881
|
+
this.dataAccessor =
|
|
2882
|
+
this._options.defaultDataAccessor || ((/**
|
|
2883
|
+
* @param {?} data
|
|
2884
|
+
* @param {?} name
|
|
2885
|
+
* @return {?}
|
|
2886
|
+
*/
|
|
2887
|
+
function (data, name) { return ((/** @type {?} */ (data)))[name]; }));
|
|
2888
|
+
}
|
|
2889
|
+
if (this._table) {
|
|
2890
|
+
// Provide the cell and headerCell directly to the table with the static `ViewChild` query,
|
|
2891
|
+
// since the columnDef will not pick up its content by the time the table finishes checking
|
|
2892
|
+
// its content and initializing the rows.
|
|
2893
|
+
this.columnDef.cell = this.cell;
|
|
2894
|
+
this.columnDef.headerCell = this.headerCell;
|
|
2895
|
+
this._table.addColumnDef(this.columnDef);
|
|
2896
|
+
}
|
|
2897
|
+
else {
|
|
2898
|
+
throw getTableTextColumnMissingParentTableError();
|
|
2899
|
+
}
|
|
2900
|
+
};
|
|
2901
|
+
/**
|
|
2902
|
+
* @return {?}
|
|
2903
|
+
*/
|
|
2904
|
+
CdkTextColumn.prototype.ngOnDestroy = /**
|
|
2905
|
+
* @return {?}
|
|
2906
|
+
*/
|
|
2907
|
+
function () {
|
|
2908
|
+
if (this._table) {
|
|
2909
|
+
this._table.removeColumnDef(this.columnDef);
|
|
2910
|
+
}
|
|
2911
|
+
};
|
|
2912
|
+
/**
|
|
2913
|
+
* Creates a default header text. Use the options' header text transformation function if one
|
|
2914
|
+
* has been provided. Otherwise simply capitalize the column name.
|
|
2915
|
+
*/
|
|
2916
|
+
/**
|
|
2917
|
+
* Creates a default header text. Use the options' header text transformation function if one
|
|
2918
|
+
* has been provided. Otherwise simply capitalize the column name.
|
|
2919
|
+
* @return {?}
|
|
2920
|
+
*/
|
|
2921
|
+
CdkTextColumn.prototype._createDefaultHeaderText = /**
|
|
2922
|
+
* Creates a default header text. Use the options' header text transformation function if one
|
|
2923
|
+
* has been provided. Otherwise simply capitalize the column name.
|
|
2924
|
+
* @return {?}
|
|
2925
|
+
*/
|
|
2926
|
+
function () {
|
|
2927
|
+
/** @type {?} */
|
|
2928
|
+
var name = this.name;
|
|
2929
|
+
if (core.isDevMode() && !name) {
|
|
2930
|
+
throw getTableTextColumnMissingNameError();
|
|
2931
|
+
}
|
|
2932
|
+
if (this._options && this._options.defaultHeaderTextTransform) {
|
|
2933
|
+
return this._options.defaultHeaderTextTransform(name);
|
|
2934
|
+
}
|
|
2935
|
+
return name[0].toUpperCase() + name.slice(1);
|
|
2936
|
+
};
|
|
2937
|
+
/** Synchronizes the column definition name with the text column name. */
|
|
2938
|
+
/**
|
|
2939
|
+
* Synchronizes the column definition name with the text column name.
|
|
2940
|
+
* @private
|
|
2941
|
+
* @return {?}
|
|
2942
|
+
*/
|
|
2943
|
+
CdkTextColumn.prototype._syncColumnDefName = /**
|
|
2944
|
+
* Synchronizes the column definition name with the text column name.
|
|
2945
|
+
* @private
|
|
2946
|
+
* @return {?}
|
|
2947
|
+
*/
|
|
2948
|
+
function () {
|
|
2949
|
+
if (this.columnDef) {
|
|
2950
|
+
this.columnDef.name = this.name;
|
|
2951
|
+
}
|
|
2952
|
+
};
|
|
2953
|
+
CdkTextColumn.decorators = [
|
|
2954
|
+
{ type: core.Component, args: [{selector: 'cdk-text-column',
|
|
2955
|
+
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 ",
|
|
2956
|
+
encapsulation: core.ViewEncapsulation.None,
|
|
2957
|
+
// Change detection is intentionally not set to OnPush. This component's template will be provided
|
|
2958
|
+
// to the table to be inserted into its view. This is problematic when change detection runs since
|
|
2959
|
+
// the bindings in this template will be evaluated _after_ the table's view is evaluated, which
|
|
2960
|
+
// mean's the template in the table's view will not have the updated value (and in fact will cause
|
|
2961
|
+
// an ExpressionChangedAfterItHasBeenCheckedError).
|
|
2962
|
+
// tslint:disable-next-line:validate-decorators
|
|
2963
|
+
changeDetection: core.ChangeDetectionStrategy.Default,
|
|
2964
|
+
},] },
|
|
2965
|
+
];
|
|
2966
|
+
/** @nocollapse */
|
|
2967
|
+
CdkTextColumn.ctorParameters = function () { return [
|
|
2968
|
+
{ type: CdkTable, decorators: [{ type: core.Optional }] },
|
|
2969
|
+
{ type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [TEXT_COLUMN_OPTIONS,] }] }
|
|
2970
|
+
]; };
|
|
2971
|
+
CdkTextColumn.propDecorators = {
|
|
2972
|
+
name: [{ type: core.Input }],
|
|
2973
|
+
headerText: [{ type: core.Input }],
|
|
2974
|
+
dataAccessor: [{ type: core.Input }],
|
|
2975
|
+
justify: [{ type: core.Input }],
|
|
2976
|
+
columnDef: [{ type: core.ViewChild, args: [CdkColumnDef, { static: true },] }],
|
|
2977
|
+
cell: [{ type: core.ViewChild, args: [CdkCellDef, { static: true },] }],
|
|
2978
|
+
headerCell: [{ type: core.ViewChild, args: [CdkHeaderCellDef, { static: true },] }]
|
|
2979
|
+
};
|
|
2980
|
+
return CdkTextColumn;
|
|
2981
|
+
}());
|
|
2982
|
+
|
|
2983
|
+
/**
|
|
2984
|
+
* @fileoverview added by tsickle
|
|
2985
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2673
2986
|
*/
|
|
2674
2987
|
/** @type {?} */
|
|
2675
2988
|
var EXPORTED_DECLARATIONS = [
|
|
@@ -2691,6 +3004,7 @@ var EXPORTED_DECLARATIONS = [
|
|
|
2691
3004
|
DataRowOutlet,
|
|
2692
3005
|
HeaderRowOutlet,
|
|
2693
3006
|
FooterRowOutlet,
|
|
3007
|
+
CdkTextColumn,
|
|
2694
3008
|
];
|
|
2695
3009
|
var CdkTableModule = /** @class */ (function () {
|
|
2696
3010
|
function CdkTableModule() {
|
|
@@ -2714,8 +3028,6 @@ exports.CdkTable = CdkTable;
|
|
|
2714
3028
|
exports.CdkCellDef = CdkCellDef;
|
|
2715
3029
|
exports.CdkHeaderCellDef = CdkHeaderCellDef;
|
|
2716
3030
|
exports.CdkFooterCellDef = CdkFooterCellDef;
|
|
2717
|
-
exports.CdkColumnDefBase = CdkColumnDefBase;
|
|
2718
|
-
exports._CdkColumnDefBase = _CdkColumnDefBase;
|
|
2719
3031
|
exports.CdkColumnDef = CdkColumnDef;
|
|
2720
3032
|
exports.BaseCdkCell = BaseCdkCell;
|
|
2721
3033
|
exports.CdkHeaderCell = CdkHeaderCell;
|
|
@@ -2723,11 +3035,7 @@ exports.CdkFooterCell = CdkFooterCell;
|
|
|
2723
3035
|
exports.CdkCell = CdkCell;
|
|
2724
3036
|
exports.CDK_ROW_TEMPLATE = CDK_ROW_TEMPLATE;
|
|
2725
3037
|
exports.BaseRowDef = BaseRowDef;
|
|
2726
|
-
exports.CdkHeaderRowDefBase = CdkHeaderRowDefBase;
|
|
2727
|
-
exports._CdkHeaderRowDefBase = _CdkHeaderRowDefBase;
|
|
2728
3038
|
exports.CdkHeaderRowDef = CdkHeaderRowDef;
|
|
2729
|
-
exports.CdkFooterRowDefBase = CdkFooterRowDefBase;
|
|
2730
|
-
exports._CdkFooterRowDefBase = _CdkFooterRowDefBase;
|
|
2731
3039
|
exports.CdkFooterRowDef = CdkFooterRowDef;
|
|
2732
3040
|
exports.CdkRowDef = CdkRowDef;
|
|
2733
3041
|
exports.CdkCellOutlet = CdkCellOutlet;
|
|
@@ -2738,6 +3046,8 @@ exports.CdkTableModule = CdkTableModule;
|
|
|
2738
3046
|
exports.STICKY_DIRECTIONS = STICKY_DIRECTIONS;
|
|
2739
3047
|
exports.StickyStyler = StickyStyler;
|
|
2740
3048
|
exports.mixinHasStickyInput = mixinHasStickyInput;
|
|
3049
|
+
exports.TEXT_COLUMN_OPTIONS = TEXT_COLUMN_OPTIONS;
|
|
3050
|
+
exports.CdkTextColumn = CdkTextColumn;
|
|
2741
3051
|
|
|
2742
3052
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2743
3053
|
|