@angular/cdk 10.0.0-rc.3 → 10.1.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/a11y/aria-describer/aria-describer.d.ts +10 -1
- package/a11y/focus-trap/focus-trap.d.ts +4 -2
- package/a11y/index.metadata.json +1 -1
- package/a11y/interactivity-checker/interactivity-checker.d.ts +11 -1
- package/a11y/key-manager/list-key-manager.d.ts +6 -0
- package/accordion/accordion.d.ts +7 -1
- package/accordion/index.d.ts +1 -0
- package/accordion/index.metadata.json +1 -1
- package/bundles/cdk-a11y.umd.js +78 -15
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-a11y.umd.min.js +11 -11
- package/bundles/cdk-a11y.umd.min.js.map +1 -1
- package/bundles/cdk-accordion.umd.js +12 -4
- package/bundles/cdk-accordion.umd.js.map +1 -1
- package/bundles/cdk-accordion.umd.min.js +2 -2
- package/bundles/cdk-accordion.umd.min.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.js +717 -641
- package/bundles/cdk-drag-drop.umd.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.min.js +8 -16
- package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
- package/bundles/cdk-overlay.umd.js +199 -42
- package/bundles/cdk-overlay.umd.js.map +1 -1
- package/bundles/cdk-overlay.umd.min.js +11 -18
- package/bundles/cdk-overlay.umd.min.js.map +1 -1
- package/bundles/cdk-platform.umd.js +0 -1
- 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-scrolling.umd.js +26 -4
- package/bundles/cdk-scrolling.umd.js.map +1 -1
- package/bundles/cdk-scrolling.umd.min.js +11 -4
- package/bundles/cdk-scrolling.umd.min.js.map +1 -1
- package/bundles/cdk-testing-protractor.umd.min.js +1 -1
- package/bundles/cdk-testing-protractor.umd.min.js.map +1 -1
- package/bundles/cdk-testing-testbed.umd.min.js +8 -8
- package/bundles/cdk-testing-testbed.umd.min.js.map +1 -1
- package/bundles/cdk-testing.umd.js +32 -0
- package/bundles/cdk-testing.umd.js.map +1 -1
- package/bundles/cdk-testing.umd.min.js +5 -5
- package/bundles/cdk-testing.umd.min.js.map +1 -1
- package/bundles/cdk-tree.umd.js +6 -2
- package/bundles/cdk-tree.umd.js.map +1 -1
- package/bundles/cdk-tree.umd.min.js +3 -3
- package/bundles/cdk-tree.umd.min.js.map +1 -1
- package/bundles/cdk.umd.js +1 -1
- package/bundles/cdk.umd.js.map +1 -1
- package/bundles/cdk.umd.min.js +1 -1
- package/bundles/cdk.umd.min.js.map +1 -1
- package/drag-drop/directives/drag-handle.d.ts +7 -1
- package/drag-drop/directives/drag-placeholder.d.ts +7 -1
- package/drag-drop/directives/drag-preview.d.ts +7 -1
- package/drag-drop/directives/drag.d.ts +4 -14
- package/drag-drop/directives/drop-list-group.d.ts +7 -1
- package/drag-drop/directives/drop-list.d.ts +7 -1
- package/drag-drop/drag-ref.d.ts +6 -0
- package/drag-drop/drop-list-ref.d.ts +3 -2
- package/drag-drop/index.d.ts +2 -2
- package/drag-drop/index.metadata.json +1 -1
- package/esm2015/a11y/a11y-module.js +15 -19
- package/esm2015/a11y/aria-describer/aria-describer.js +177 -167
- package/esm2015/a11y/focus-monitor/focus-monitor.js +337 -345
- package/esm2015/a11y/focus-trap/configurable-focus-trap-factory.js +30 -34
- package/esm2015/a11y/focus-trap/focus-trap-manager.js +36 -40
- package/esm2015/a11y/focus-trap/focus-trap.js +85 -82
- package/esm2015/a11y/high-contrast-mode/high-contrast-mode-detector.js +56 -60
- package/esm2015/a11y/interactivity-checker/interactivity-checker.js +113 -104
- package/esm2015/a11y/key-manager/list-key-manager.js +29 -4
- package/esm2015/a11y/live-announcer/live-announcer.js +138 -146
- package/esm2015/accordion/accordion-item.js +119 -123
- package/esm2015/accordion/accordion-module.js +9 -13
- package/esm2015/accordion/accordion.js +49 -46
- package/esm2015/accordion/index.js +2 -1
- package/esm2015/bidi/bidi-module.js +9 -13
- package/esm2015/bidi/dir.js +41 -45
- package/esm2015/bidi/directionality.js +27 -31
- package/esm2015/clipboard/clipboard-module.js +9 -13
- package/esm2015/clipboard/clipboard.js +36 -40
- package/esm2015/clipboard/copy-to-clipboard.js +71 -75
- package/esm2015/collections/unique-selection-dispatcher.js +33 -37
- package/esm2015/drag-drop/directives/drag-handle.js +42 -39
- package/esm2015/drag-drop/directives/drag-placeholder.js +24 -21
- package/esm2015/drag-drop/directives/drag-preview.js +29 -26
- package/esm2015/drag-drop/directives/drag.js +313 -319
- package/esm2015/drag-drop/directives/drop-list-group.js +32 -29
- package/esm2015/drag-drop/directives/drop-list.js +251 -250
- package/esm2015/drag-drop/drag-drop-module.js +27 -31
- package/esm2015/drag-drop/drag-drop-registry.js +139 -143
- package/esm2015/drag-drop/drag-drop.js +33 -37
- package/esm2015/drag-drop/drag-ref.js +59 -25
- package/esm2015/drag-drop/drop-list-ref.js +15 -9
- package/esm2015/drag-drop/index.js +3 -2
- package/esm2015/layout/breakpoints-observer.js +81 -85
- package/esm2015/layout/layout-module.js +6 -10
- package/esm2015/layout/media-matcher.js +28 -32
- package/esm2015/observers/observe-content.js +147 -163
- package/esm2015/overlay/dispatchers/base-overlay-dispatcher.js +51 -0
- package/esm2015/overlay/dispatchers/index.js +10 -0
- package/esm2015/overlay/dispatchers/overlay-keyboard-dispatcher.js +79 -0
- package/esm2015/overlay/dispatchers/overlay-outside-click-dispatcher.js +94 -0
- package/esm2015/overlay/fullscreen-overlay-container.js +70 -74
- package/esm2015/overlay/index.js +5 -4
- package/esm2015/overlay/overlay-config.js +5 -1
- package/esm2015/overlay/overlay-container.js +69 -73
- package/esm2015/overlay/overlay-directives.js +245 -243
- package/esm2015/overlay/overlay-module.js +15 -19
- package/esm2015/overlay/overlay-ref.js +24 -2
- package/esm2015/overlay/overlay-reference.js +1 -1
- package/esm2015/overlay/overlay.js +93 -92
- package/esm2015/overlay/position/connected-position.js +14 -18
- package/esm2015/overlay/position/overlay-position-builder.js +43 -47
- package/esm2015/overlay/public-api.js +2 -2
- package/esm2015/overlay/scroll/scroll-strategy-options.js +33 -37
- package/esm2015/platform/features/scrolling.js +1 -2
- package/esm2015/platform/platform-module.js +6 -10
- package/esm2015/platform/platform.js +48 -52
- package/esm2015/portal/portal-directives.js +181 -201
- package/esm2015/scrolling/fixed-size-virtual-scroll.js +57 -47
- package/esm2015/scrolling/public-api.js +2 -1
- package/esm2015/scrolling/scroll-dispatcher.js +139 -143
- package/esm2015/scrolling/scrollable.js +135 -139
- package/esm2015/scrolling/scrolling-module.js +32 -40
- package/esm2015/scrolling/viewport-ruler.js +105 -109
- package/esm2015/scrolling/virtual-for-of.js +264 -268
- package/esm2015/scrolling/virtual-scroll-repeater.js +8 -0
- package/esm2015/scrolling/virtual-scroll-viewport.js +318 -322
- package/esm2015/stepper/step-header.js +20 -24
- package/esm2015/stepper/step-label.js +13 -17
- package/esm2015/stepper/stepper-button.js +59 -67
- package/esm2015/stepper/stepper-module.js +24 -28
- package/esm2015/stepper/stepper.js +313 -321
- package/esm2015/table/cell.js +129 -157
- package/esm2015/table/row.js +183 -219
- package/esm2015/table/table-module.js +9 -13
- package/esm2015/table/table.js +765 -785
- package/esm2015/table/text-column.js +85 -89
- package/esm2015/testing/component-harness.js +19 -1
- package/esm2015/testing/harness-environment.js +7 -1
- package/esm2015/text-field/autofill.js +89 -97
- package/esm2015/text-field/autosize.js +225 -229
- package/esm2015/text-field/text-field-module.js +10 -14
- package/esm2015/tree/control/nested-tree-control.js +7 -3
- package/esm2015/tree/nested-node.js +79 -83
- package/esm2015/tree/node.js +17 -21
- package/esm2015/tree/outlet.js +15 -19
- package/esm2015/tree/padding.js +88 -92
- package/esm2015/tree/toggle.js +32 -36
- package/esm2015/tree/tree-module.js +10 -14
- package/esm2015/tree/tree.js +266 -274
- package/esm2015/version.js +1 -1
- package/fesm2015/a11y.js +1021 -996
- package/fesm2015/a11y.js.map +1 -1
- package/fesm2015/accordion.js +173 -175
- package/fesm2015/accordion.js.map +1 -1
- package/fesm2015/bidi.js +74 -83
- package/fesm2015/bidi.js.map +1 -1
- package/fesm2015/cdk.js +1 -1
- package/fesm2015/cdk.js.map +1 -1
- package/fesm2015/clipboard.js +113 -122
- package/fesm2015/clipboard.js.map +1 -1
- package/fesm2015/collections.js +32 -35
- package/fesm2015/collections.js.map +1 -1
- package/fesm2015/drag-drop.js +1005 -961
- package/fesm2015/drag-drop.js.map +1 -1
- package/fesm2015/layout.js +111 -120
- package/fesm2015/layout.js.map +1 -1
- package/fesm2015/observers.js +146 -158
- package/fesm2015/observers.js.map +1 -1
- package/fesm2015/overlay.js +793 -659
- package/fesm2015/overlay.js.map +1 -1
- package/fesm2015/platform.js +52 -59
- package/fesm2015/platform.js.map +1 -1
- package/fesm2015/portal.js +180 -195
- package/fesm2015/portal.js.map +1 -1
- package/fesm2015/scrolling.js +1058 -1060
- package/fesm2015/scrolling.js.map +1 -1
- package/fesm2015/stepper.js +424 -445
- package/fesm2015/stepper.js.map +1 -1
- package/fesm2015/table.js +1178 -1247
- package/fesm2015/table.js.map +1 -1
- package/fesm2015/testing.js +25 -1
- package/fesm2015/testing.js.map +1 -1
- package/fesm2015/text-field.js +318 -330
- package/fesm2015/text-field.js.map +1 -1
- package/fesm2015/tree.js +517 -537
- package/fesm2015/tree.js.map +1 -1
- package/overlay/dispatchers/base-overlay-dispatcher.d.ts +28 -0
- package/overlay/dispatchers/index.d.ts +9 -0
- package/overlay/{keyboard → dispatchers}/overlay-keyboard-dispatcher.d.ts +4 -10
- package/overlay/dispatchers/overlay-outside-click-dispatcher.d.ts +27 -0
- package/overlay/index.d.ts +4 -3
- package/overlay/index.metadata.json +1 -1
- package/overlay/overlay-config.d.ts +4 -0
- package/overlay/overlay-directives.d.ts +4 -0
- package/overlay/overlay-ref.d.ts +8 -2
- package/overlay/overlay-reference.d.ts +1 -0
- package/overlay/overlay.d.ts +4 -2
- package/overlay/public-api.d.ts +1 -1
- package/package.json +3 -3
- package/schematics/index.js +1 -1
- package/schematics/migration.json +5 -0
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-update/data/index.js +1 -1
- package/schematics/ng-update/devkit-file-system.d.ts +5 -5
- package/schematics/ng-update/devkit-file-system.js +21 -16
- package/schematics/ng-update/devkit-migration-rule.js +13 -20
- package/schematics/ng-update/devkit-migration.d.ts +0 -2
- package/schematics/ng-update/devkit-migration.js +1 -1
- package/schematics/ng-update/find-stylesheets.d.ts +10 -0
- package/schematics/ng-update/find-stylesheets.js +31 -0
- package/schematics/ng-update/index.d.ts +2 -0
- package/schematics/ng-update/index.js +7 -2
- package/schematics/ng-update/migrations/attribute-selectors.js +3 -3
- package/schematics/ng-update/migrations/css-selectors.js +3 -3
- package/schematics/ng-update/migrations/element-selectors.js +3 -3
- package/schematics/ng-update/public-api.js +1 -1
- package/schematics/update-tool/component-resource-collector.d.ts +1 -1
- package/schematics/update-tool/component-resource-collector.js +18 -14
- package/schematics/update-tool/file-system.d.ts +19 -14
- package/schematics/update-tool/file-system.js +1 -1
- package/schematics/update-tool/index.d.ts +21 -3
- package/schematics/update-tool/index.js +29 -23
- package/schematics/update-tool/public-api.js +1 -1
- package/schematics/update-tool/target-version.d.ts +2 -1
- package/schematics/update-tool/target-version.js +5 -3
- package/schematics/update-tool/utils/parse-tsconfig.d.ts +2 -1
- package/schematics/update-tool/utils/parse-tsconfig.js +6 -10
- package/schematics/update-tool/utils/virtual-host.d.ts +34 -0
- package/schematics/update-tool/utils/virtual-host.js +62 -0
- package/schematics/update-tool/version-changes.js +4 -6
- package/schematics/utils/index.js +1 -1
- package/schematics/utils/project-tsconfig-paths.d.ts +2 -1
- package/schematics/utils/project-tsconfig-paths.js +1 -1
- package/scrolling/index.metadata.json +1 -1
- package/scrolling/public-api.d.ts +1 -0
- package/scrolling/virtual-for-of.d.ts +2 -1
- package/scrolling/virtual-scroll-repeater.d.ts +16 -0
- package/scrolling/virtual-scroll-viewport.d.ts +4 -4
- package/testing/component-harness.d.ts +12 -0
- package/testing/harness-environment.d.ts +1 -0
- package/tree/control/nested-tree-control.d.ts +7 -2
- package/tree/index.metadata.json +1 -1
- package/esm2015/overlay/keyboard/overlay-keyboard-dispatcher.js +0 -100
package/fesm2015/table.js
CHANGED
|
@@ -75,56 +75,47 @@ const TEXT_COLUMN_OPTIONS = new InjectionToken('text-column-options');
|
|
|
75
75
|
* Cell definition for a CDK table.
|
|
76
76
|
* Captures the template of a column's data row cell as well as cell-specific properties.
|
|
77
77
|
*/
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
];
|
|
90
|
-
return CdkCellDef;
|
|
91
|
-
})();
|
|
78
|
+
class CdkCellDef {
|
|
79
|
+
constructor(/** @docs-private */ template) {
|
|
80
|
+
this.template = template;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
CdkCellDef.decorators = [
|
|
84
|
+
{ type: Directive, args: [{ selector: '[cdkCellDef]' },] }
|
|
85
|
+
];
|
|
86
|
+
CdkCellDef.ctorParameters = () => [
|
|
87
|
+
{ type: TemplateRef }
|
|
88
|
+
];
|
|
92
89
|
/**
|
|
93
90
|
* Header cell definition for a CDK table.
|
|
94
91
|
* Captures the template of a column's header cell and as well as cell-specific properties.
|
|
95
92
|
*/
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
];
|
|
108
|
-
return CdkHeaderCellDef;
|
|
109
|
-
})();
|
|
93
|
+
class CdkHeaderCellDef {
|
|
94
|
+
constructor(/** @docs-private */ template) {
|
|
95
|
+
this.template = template;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
CdkHeaderCellDef.decorators = [
|
|
99
|
+
{ type: Directive, args: [{ selector: '[cdkHeaderCellDef]' },] }
|
|
100
|
+
];
|
|
101
|
+
CdkHeaderCellDef.ctorParameters = () => [
|
|
102
|
+
{ type: TemplateRef }
|
|
103
|
+
];
|
|
110
104
|
/**
|
|
111
105
|
* Footer cell definition for a CDK table.
|
|
112
106
|
* Captures the template of a column's footer cell and as well as cell-specific properties.
|
|
113
107
|
*/
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
];
|
|
126
|
-
return CdkFooterCellDef;
|
|
127
|
-
})();
|
|
108
|
+
class CdkFooterCellDef {
|
|
109
|
+
constructor(/** @docs-private */ template) {
|
|
110
|
+
this.template = template;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
CdkFooterCellDef.decorators = [
|
|
114
|
+
{ type: Directive, args: [{ selector: '[cdkFooterCellDef]' },] }
|
|
115
|
+
];
|
|
116
|
+
CdkFooterCellDef.ctorParameters = () => [
|
|
117
|
+
{ type: TemplateRef }
|
|
118
|
+
];
|
|
128
119
|
// Boilerplate for applying mixins to CdkColumnDef.
|
|
129
120
|
/** @docs-private */
|
|
130
121
|
class CdkColumnDefBase {
|
|
@@ -134,58 +125,55 @@ const _CdkColumnDefBase = mixinHasStickyInput(CdkColumnDefBase);
|
|
|
134
125
|
* Column definition for the CDK table.
|
|
135
126
|
* Defines a set of cells available for a table column.
|
|
136
127
|
*/
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
set name(
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
this.cssClassFriendlyName = name.replace(/[^a-z0-9_-]/ig, '-');
|
|
154
|
-
}
|
|
128
|
+
class CdkColumnDef extends _CdkColumnDefBase {
|
|
129
|
+
constructor(_table) {
|
|
130
|
+
super();
|
|
131
|
+
this._table = _table;
|
|
132
|
+
this._stickyEnd = false;
|
|
133
|
+
}
|
|
134
|
+
/** Unique name for this column. */
|
|
135
|
+
get name() {
|
|
136
|
+
return this._name;
|
|
137
|
+
}
|
|
138
|
+
set name(name) {
|
|
139
|
+
// If the directive is set without a name (updated programatically), then this setter will
|
|
140
|
+
// trigger with an empty string and should not overwrite the programatically set value.
|
|
141
|
+
if (name) {
|
|
142
|
+
this._name = name;
|
|
143
|
+
this.cssClassFriendlyName = name.replace(/[^a-z0-9_-]/ig, '-');
|
|
155
144
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
]
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
})();
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Whether this column should be sticky positioned on the end of the row. Should make sure
|
|
148
|
+
* that it mimics the `CanStick` mixin such that `_hasStickyChanged` is set to true if the value
|
|
149
|
+
* has been changed.
|
|
150
|
+
*/
|
|
151
|
+
get stickyEnd() {
|
|
152
|
+
return this._stickyEnd;
|
|
153
|
+
}
|
|
154
|
+
set stickyEnd(v) {
|
|
155
|
+
const prevValue = this._stickyEnd;
|
|
156
|
+
this._stickyEnd = coerceBooleanProperty(v);
|
|
157
|
+
this._hasStickyChanged = prevValue !== this._stickyEnd;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
CdkColumnDef.decorators = [
|
|
161
|
+
{ type: Directive, args: [{
|
|
162
|
+
selector: '[cdkColumnDef]',
|
|
163
|
+
inputs: ['sticky'],
|
|
164
|
+
providers: [{ provide: 'MAT_SORT_HEADER_COLUMN_DEF', useExisting: CdkColumnDef }],
|
|
165
|
+
},] }
|
|
166
|
+
];
|
|
167
|
+
CdkColumnDef.ctorParameters = () => [
|
|
168
|
+
{ type: undefined, decorators: [{ type: Inject, args: [CDK_TABLE,] }, { type: Optional }] }
|
|
169
|
+
];
|
|
170
|
+
CdkColumnDef.propDecorators = {
|
|
171
|
+
name: [{ type: Input, args: ['cdkColumnDef',] }],
|
|
172
|
+
stickyEnd: [{ type: Input, args: ['stickyEnd',] }],
|
|
173
|
+
cell: [{ type: ContentChild, args: [CdkCellDef,] }],
|
|
174
|
+
headerCell: [{ type: ContentChild, args: [CdkHeaderCellDef,] }],
|
|
175
|
+
footerCell: [{ type: ContentChild, args: [CdkFooterCellDef,] }]
|
|
176
|
+
};
|
|
189
177
|
/** Base class for the cells. Adds a CSS classname that identifies the column it renders in. */
|
|
190
178
|
class BaseCdkCell {
|
|
191
179
|
constructor(columnDef, elementRef) {
|
|
@@ -194,71 +182,62 @@ class BaseCdkCell {
|
|
|
194
182
|
}
|
|
195
183
|
}
|
|
196
184
|
/** Header cell template container that adds the right classes and role. */
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
];
|
|
216
|
-
return CdkHeaderCell;
|
|
217
|
-
})();
|
|
185
|
+
class CdkHeaderCell extends BaseCdkCell {
|
|
186
|
+
constructor(columnDef, elementRef) {
|
|
187
|
+
super(columnDef, elementRef);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
CdkHeaderCell.decorators = [
|
|
191
|
+
{ type: Directive, args: [{
|
|
192
|
+
selector: 'cdk-header-cell, th[cdk-header-cell]',
|
|
193
|
+
host: {
|
|
194
|
+
'class': 'cdk-header-cell',
|
|
195
|
+
'role': 'columnheader',
|
|
196
|
+
},
|
|
197
|
+
},] }
|
|
198
|
+
];
|
|
199
|
+
CdkHeaderCell.ctorParameters = () => [
|
|
200
|
+
{ type: CdkColumnDef },
|
|
201
|
+
{ type: ElementRef }
|
|
202
|
+
];
|
|
218
203
|
/** Footer cell template container that adds the right classes and role. */
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
];
|
|
238
|
-
return CdkFooterCell;
|
|
239
|
-
})();
|
|
204
|
+
class CdkFooterCell extends BaseCdkCell {
|
|
205
|
+
constructor(columnDef, elementRef) {
|
|
206
|
+
super(columnDef, elementRef);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
CdkFooterCell.decorators = [
|
|
210
|
+
{ type: Directive, args: [{
|
|
211
|
+
selector: 'cdk-footer-cell, td[cdk-footer-cell]',
|
|
212
|
+
host: {
|
|
213
|
+
'class': 'cdk-footer-cell',
|
|
214
|
+
'role': 'gridcell',
|
|
215
|
+
},
|
|
216
|
+
},] }
|
|
217
|
+
];
|
|
218
|
+
CdkFooterCell.ctorParameters = () => [
|
|
219
|
+
{ type: CdkColumnDef },
|
|
220
|
+
{ type: ElementRef }
|
|
221
|
+
];
|
|
240
222
|
/** Cell template container that adds the right classes and role. */
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
];
|
|
260
|
-
return CdkCell;
|
|
261
|
-
})();
|
|
223
|
+
class CdkCell extends BaseCdkCell {
|
|
224
|
+
constructor(columnDef, elementRef) {
|
|
225
|
+
super(columnDef, elementRef);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
CdkCell.decorators = [
|
|
229
|
+
{ type: Directive, args: [{
|
|
230
|
+
selector: 'cdk-cell, td[cdk-cell]',
|
|
231
|
+
host: {
|
|
232
|
+
'class': 'cdk-cell',
|
|
233
|
+
'role': 'gridcell',
|
|
234
|
+
},
|
|
235
|
+
},] }
|
|
236
|
+
];
|
|
237
|
+
CdkCell.ctorParameters = () => [
|
|
238
|
+
{ type: CdkColumnDef },
|
|
239
|
+
{ type: ElementRef }
|
|
240
|
+
];
|
|
262
241
|
|
|
263
242
|
/**
|
|
264
243
|
* @license
|
|
@@ -276,51 +255,48 @@ const CDK_ROW_TEMPLATE = `<ng-container cdkCellOutlet></ng-container>`;
|
|
|
276
255
|
* Base class for the CdkHeaderRowDef and CdkRowDef that handles checking their columns inputs
|
|
277
256
|
* for changes and notifying the table.
|
|
278
257
|
*/
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
this._columnsDiffer.diff(columns);
|
|
293
|
-
}
|
|
258
|
+
class BaseRowDef {
|
|
259
|
+
constructor(
|
|
260
|
+
/** @docs-private */ template, _differs) {
|
|
261
|
+
this.template = template;
|
|
262
|
+
this._differs = _differs;
|
|
263
|
+
}
|
|
264
|
+
ngOnChanges(changes) {
|
|
265
|
+
// Create a new columns differ if one does not yet exist. Initialize it based on initial value
|
|
266
|
+
// of the columns property or an empty array if none is provided.
|
|
267
|
+
if (!this._columnsDiffer) {
|
|
268
|
+
const columns = (changes['columns'] && changes['columns'].currentValue) || [];
|
|
269
|
+
this._columnsDiffer = this._differs.find(columns).create();
|
|
270
|
+
this._columnsDiffer.diff(columns);
|
|
294
271
|
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Returns the difference between the current columns and the columns from the last diff, or null
|
|
275
|
+
* if there is no difference.
|
|
276
|
+
*/
|
|
277
|
+
getColumnsDiff() {
|
|
278
|
+
return this._columnsDiffer.diff(this.columns);
|
|
279
|
+
}
|
|
280
|
+
/** Gets this row def's relevant cell template from the provided column def. */
|
|
281
|
+
extractCellTemplate(column) {
|
|
282
|
+
if (this instanceof CdkHeaderRowDef) {
|
|
283
|
+
return column.headerCell.template;
|
|
301
284
|
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
if (this instanceof CdkFooterRowDef) {
|
|
308
|
-
return column.footerCell.template;
|
|
309
|
-
}
|
|
310
|
-
else {
|
|
311
|
-
return column.cell.template;
|
|
312
|
-
}
|
|
285
|
+
if (this instanceof CdkFooterRowDef) {
|
|
286
|
+
return column.footerCell.template;
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
return column.cell.template;
|
|
313
290
|
}
|
|
314
291
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
})();
|
|
292
|
+
}
|
|
293
|
+
BaseRowDef.decorators = [
|
|
294
|
+
{ type: Directive }
|
|
295
|
+
];
|
|
296
|
+
BaseRowDef.ctorParameters = () => [
|
|
297
|
+
{ type: TemplateRef },
|
|
298
|
+
{ type: IterableDiffers }
|
|
299
|
+
];
|
|
324
300
|
// Boilerplate for applying mixins to CdkHeaderRowDef.
|
|
325
301
|
/** @docs-private */
|
|
326
302
|
class CdkHeaderRowDefBase extends BaseRowDef {
|
|
@@ -330,31 +306,28 @@ const _CdkHeaderRowDefBase = mixinHasStickyInput(CdkHeaderRowDefBase);
|
|
|
330
306
|
* Header row definition for the CDK table.
|
|
331
307
|
* Captures the header row's template and other header properties such as the columns to display.
|
|
332
308
|
*/
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
ngOnChanges(changes)
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
];
|
|
356
|
-
return CdkHeaderRowDef;
|
|
357
|
-
})();
|
|
309
|
+
class CdkHeaderRowDef extends _CdkHeaderRowDefBase {
|
|
310
|
+
constructor(template, _differs, _table) {
|
|
311
|
+
super(template, _differs);
|
|
312
|
+
this._table = _table;
|
|
313
|
+
}
|
|
314
|
+
// Prerender fails to recognize that ngOnChanges in a part of this class through inheritance.
|
|
315
|
+
// Explicitly define it so that the method is called as part of the Angular lifecycle.
|
|
316
|
+
ngOnChanges(changes) {
|
|
317
|
+
super.ngOnChanges(changes);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
CdkHeaderRowDef.decorators = [
|
|
321
|
+
{ type: Directive, args: [{
|
|
322
|
+
selector: '[cdkHeaderRowDef]',
|
|
323
|
+
inputs: ['columns: cdkHeaderRowDef', 'sticky: cdkHeaderRowDefSticky'],
|
|
324
|
+
},] }
|
|
325
|
+
];
|
|
326
|
+
CdkHeaderRowDef.ctorParameters = () => [
|
|
327
|
+
{ type: TemplateRef },
|
|
328
|
+
{ type: IterableDiffers },
|
|
329
|
+
{ type: undefined, decorators: [{ type: Inject, args: [CDK_TABLE,] }, { type: Optional }] }
|
|
330
|
+
];
|
|
358
331
|
// Boilerplate for applying mixins to CdkFooterRowDef.
|
|
359
332
|
/** @docs-private */
|
|
360
333
|
class CdkFooterRowDefBase extends BaseRowDef {
|
|
@@ -364,169 +337,148 @@ const _CdkFooterRowDefBase = mixinHasStickyInput(CdkFooterRowDefBase);
|
|
|
364
337
|
* Footer row definition for the CDK table.
|
|
365
338
|
* Captures the footer row's template and other footer properties such as the columns to display.
|
|
366
339
|
*/
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
ngOnChanges(changes)
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
];
|
|
390
|
-
return CdkFooterRowDef;
|
|
391
|
-
})();
|
|
340
|
+
class CdkFooterRowDef extends _CdkFooterRowDefBase {
|
|
341
|
+
constructor(template, _differs, _table) {
|
|
342
|
+
super(template, _differs);
|
|
343
|
+
this._table = _table;
|
|
344
|
+
}
|
|
345
|
+
// Prerender fails to recognize that ngOnChanges in a part of this class through inheritance.
|
|
346
|
+
// Explicitly define it so that the method is called as part of the Angular lifecycle.
|
|
347
|
+
ngOnChanges(changes) {
|
|
348
|
+
super.ngOnChanges(changes);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
CdkFooterRowDef.decorators = [
|
|
352
|
+
{ type: Directive, args: [{
|
|
353
|
+
selector: '[cdkFooterRowDef]',
|
|
354
|
+
inputs: ['columns: cdkFooterRowDef', 'sticky: cdkFooterRowDefSticky'],
|
|
355
|
+
},] }
|
|
356
|
+
];
|
|
357
|
+
CdkFooterRowDef.ctorParameters = () => [
|
|
358
|
+
{ type: TemplateRef },
|
|
359
|
+
{ type: IterableDiffers },
|
|
360
|
+
{ type: undefined, decorators: [{ type: Inject, args: [CDK_TABLE,] }, { type: Optional }] }
|
|
361
|
+
];
|
|
392
362
|
/**
|
|
393
363
|
* Data row definition for the CDK table.
|
|
394
364
|
* Captures the header row's template and other row properties such as the columns to display and
|
|
395
365
|
* a when predicate that describes when this row should be used.
|
|
396
366
|
*/
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
];
|
|
417
|
-
return CdkRowDef;
|
|
418
|
-
})();
|
|
367
|
+
class CdkRowDef extends BaseRowDef {
|
|
368
|
+
// TODO(andrewseguin): Add an input for providing a switch function to determine
|
|
369
|
+
// if this template should be used.
|
|
370
|
+
constructor(template, _differs, _table) {
|
|
371
|
+
super(template, _differs);
|
|
372
|
+
this._table = _table;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
CdkRowDef.decorators = [
|
|
376
|
+
{ type: Directive, args: [{
|
|
377
|
+
selector: '[cdkRowDef]',
|
|
378
|
+
inputs: ['columns: cdkRowDefColumns', 'when: cdkRowDefWhen'],
|
|
379
|
+
},] }
|
|
380
|
+
];
|
|
381
|
+
CdkRowDef.ctorParameters = () => [
|
|
382
|
+
{ type: TemplateRef },
|
|
383
|
+
{ type: IterableDiffers },
|
|
384
|
+
{ type: undefined, decorators: [{ type: Inject, args: [CDK_TABLE,] }, { type: Optional }] }
|
|
385
|
+
];
|
|
419
386
|
/**
|
|
420
387
|
* Outlet for rendering cells inside of a row or header row.
|
|
421
388
|
* @docs-private
|
|
422
389
|
*/
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
CdkCellOutlet.mostRecentCellOutlet = null;
|
|
434
|
-
}
|
|
390
|
+
class CdkCellOutlet {
|
|
391
|
+
constructor(_viewContainer) {
|
|
392
|
+
this._viewContainer = _viewContainer;
|
|
393
|
+
CdkCellOutlet.mostRecentCellOutlet = this;
|
|
394
|
+
}
|
|
395
|
+
ngOnDestroy() {
|
|
396
|
+
// If this was the last outlet being rendered in the view, remove the reference
|
|
397
|
+
// from the static property after it has been destroyed to avoid leaking memory.
|
|
398
|
+
if (CdkCellOutlet.mostRecentCellOutlet === this) {
|
|
399
|
+
CdkCellOutlet.mostRecentCellOutlet = null;
|
|
435
400
|
}
|
|
436
401
|
}
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
]
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
})();
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Static property containing the latest constructed instance of this class.
|
|
405
|
+
* Used by the CDK table when each CdkHeaderRow and CdkRow component is created using
|
|
406
|
+
* createEmbeddedView. After one of these components are created, this property will provide
|
|
407
|
+
* a handle to provide that component's cells and context. After init, the CdkCellOutlet will
|
|
408
|
+
* construct the cells with the provided context.
|
|
409
|
+
*/
|
|
410
|
+
CdkCellOutlet.mostRecentCellOutlet = null;
|
|
411
|
+
CdkCellOutlet.decorators = [
|
|
412
|
+
{ type: Directive, args: [{ selector: '[cdkCellOutlet]' },] }
|
|
413
|
+
];
|
|
414
|
+
CdkCellOutlet.ctorParameters = () => [
|
|
415
|
+
{ type: ViewContainerRef }
|
|
416
|
+
];
|
|
453
417
|
/** Header template container that contains the cell outlet. Adds the right class and role. */
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
];
|
|
471
|
-
return CdkHeaderRow;
|
|
472
|
-
})();
|
|
418
|
+
class CdkHeaderRow {
|
|
419
|
+
}
|
|
420
|
+
CdkHeaderRow.decorators = [
|
|
421
|
+
{ type: Component, args: [{
|
|
422
|
+
selector: 'cdk-header-row, tr[cdk-header-row]',
|
|
423
|
+
template: CDK_ROW_TEMPLATE,
|
|
424
|
+
host: {
|
|
425
|
+
'class': 'cdk-header-row',
|
|
426
|
+
'role': 'row',
|
|
427
|
+
},
|
|
428
|
+
// See note on CdkTable for explanation on why this uses the default change detection strategy.
|
|
429
|
+
// tslint:disable-next-line:validate-decorators
|
|
430
|
+
changeDetection: ChangeDetectionStrategy.Default,
|
|
431
|
+
encapsulation: ViewEncapsulation.None
|
|
432
|
+
},] }
|
|
433
|
+
];
|
|
473
434
|
/** Footer template container that contains the cell outlet. Adds the right class and role. */
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
];
|
|
491
|
-
return CdkFooterRow;
|
|
492
|
-
})();
|
|
435
|
+
class CdkFooterRow {
|
|
436
|
+
}
|
|
437
|
+
CdkFooterRow.decorators = [
|
|
438
|
+
{ type: Component, args: [{
|
|
439
|
+
selector: 'cdk-footer-row, tr[cdk-footer-row]',
|
|
440
|
+
template: CDK_ROW_TEMPLATE,
|
|
441
|
+
host: {
|
|
442
|
+
'class': 'cdk-footer-row',
|
|
443
|
+
'role': 'row',
|
|
444
|
+
},
|
|
445
|
+
// See note on CdkTable for explanation on why this uses the default change detection strategy.
|
|
446
|
+
// tslint:disable-next-line:validate-decorators
|
|
447
|
+
changeDetection: ChangeDetectionStrategy.Default,
|
|
448
|
+
encapsulation: ViewEncapsulation.None
|
|
449
|
+
},] }
|
|
450
|
+
];
|
|
493
451
|
/** Data row template container that contains the cell outlet. Adds the right class and role. */
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
];
|
|
511
|
-
return CdkRow;
|
|
512
|
-
})();
|
|
452
|
+
class CdkRow {
|
|
453
|
+
}
|
|
454
|
+
CdkRow.decorators = [
|
|
455
|
+
{ type: Component, args: [{
|
|
456
|
+
selector: 'cdk-row, tr[cdk-row]',
|
|
457
|
+
template: CDK_ROW_TEMPLATE,
|
|
458
|
+
host: {
|
|
459
|
+
'class': 'cdk-row',
|
|
460
|
+
'role': 'row',
|
|
461
|
+
},
|
|
462
|
+
// See note on CdkTable for explanation on why this uses the default change detection strategy.
|
|
463
|
+
// tslint:disable-next-line:validate-decorators
|
|
464
|
+
changeDetection: ChangeDetectionStrategy.Default,
|
|
465
|
+
encapsulation: ViewEncapsulation.None
|
|
466
|
+
},] }
|
|
467
|
+
];
|
|
513
468
|
/** Row that can be used to display a message when no data is shown in the table. */
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
];
|
|
528
|
-
return CdkNoDataRow;
|
|
529
|
-
})();
|
|
469
|
+
class CdkNoDataRow {
|
|
470
|
+
constructor(templateRef) {
|
|
471
|
+
this.templateRef = templateRef;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
CdkNoDataRow.decorators = [
|
|
475
|
+
{ type: Directive, args: [{
|
|
476
|
+
selector: 'ng-template[cdkNoDataRow]'
|
|
477
|
+
},] }
|
|
478
|
+
];
|
|
479
|
+
CdkNoDataRow.ctorParameters = () => [
|
|
480
|
+
{ type: TemplateRef }
|
|
481
|
+
];
|
|
530
482
|
|
|
531
483
|
/**
|
|
532
484
|
* @license
|
|
@@ -855,83 +807,71 @@ function getTableTextColumnMissingNameError() {
|
|
|
855
807
|
* Provides a handle for the table to grab the view container's ng-container to insert data rows.
|
|
856
808
|
* @docs-private
|
|
857
809
|
*/
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
];
|
|
872
|
-
return DataRowOutlet;
|
|
873
|
-
})();
|
|
810
|
+
class DataRowOutlet {
|
|
811
|
+
constructor(viewContainer, elementRef) {
|
|
812
|
+
this.viewContainer = viewContainer;
|
|
813
|
+
this.elementRef = elementRef;
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
DataRowOutlet.decorators = [
|
|
817
|
+
{ type: Directive, args: [{ selector: '[rowOutlet]' },] }
|
|
818
|
+
];
|
|
819
|
+
DataRowOutlet.ctorParameters = () => [
|
|
820
|
+
{ type: ViewContainerRef },
|
|
821
|
+
{ type: ElementRef }
|
|
822
|
+
];
|
|
874
823
|
/**
|
|
875
824
|
* Provides a handle for the table to grab the view container's ng-container to insert the header.
|
|
876
825
|
* @docs-private
|
|
877
826
|
*/
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
];
|
|
892
|
-
return HeaderRowOutlet;
|
|
893
|
-
})();
|
|
827
|
+
class HeaderRowOutlet {
|
|
828
|
+
constructor(viewContainer, elementRef) {
|
|
829
|
+
this.viewContainer = viewContainer;
|
|
830
|
+
this.elementRef = elementRef;
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
HeaderRowOutlet.decorators = [
|
|
834
|
+
{ type: Directive, args: [{ selector: '[headerRowOutlet]' },] }
|
|
835
|
+
];
|
|
836
|
+
HeaderRowOutlet.ctorParameters = () => [
|
|
837
|
+
{ type: ViewContainerRef },
|
|
838
|
+
{ type: ElementRef }
|
|
839
|
+
];
|
|
894
840
|
/**
|
|
895
841
|
* Provides a handle for the table to grab the view container's ng-container to insert the footer.
|
|
896
842
|
* @docs-private
|
|
897
843
|
*/
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
];
|
|
912
|
-
return FooterRowOutlet;
|
|
913
|
-
})();
|
|
844
|
+
class FooterRowOutlet {
|
|
845
|
+
constructor(viewContainer, elementRef) {
|
|
846
|
+
this.viewContainer = viewContainer;
|
|
847
|
+
this.elementRef = elementRef;
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
FooterRowOutlet.decorators = [
|
|
851
|
+
{ type: Directive, args: [{ selector: '[footerRowOutlet]' },] }
|
|
852
|
+
];
|
|
853
|
+
FooterRowOutlet.ctorParameters = () => [
|
|
854
|
+
{ type: ViewContainerRef },
|
|
855
|
+
{ type: ElementRef }
|
|
856
|
+
];
|
|
914
857
|
/**
|
|
915
858
|
* Provides a handle for the table to grab the view
|
|
916
859
|
* container's ng-container to insert the no data row.
|
|
917
860
|
* @docs-private
|
|
918
861
|
*/
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
];
|
|
933
|
-
return NoDataRowOutlet;
|
|
934
|
-
})();
|
|
862
|
+
class NoDataRowOutlet {
|
|
863
|
+
constructor(viewContainer, elementRef) {
|
|
864
|
+
this.viewContainer = viewContainer;
|
|
865
|
+
this.elementRef = elementRef;
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
NoDataRowOutlet.decorators = [
|
|
869
|
+
{ type: Directive, args: [{ selector: '[noDataRowOutlet]' },] }
|
|
870
|
+
];
|
|
871
|
+
NoDataRowOutlet.ctorParameters = () => [
|
|
872
|
+
{ type: ViewContainerRef },
|
|
873
|
+
{ type: ElementRef }
|
|
874
|
+
];
|
|
935
875
|
/**
|
|
936
876
|
* The table template that can be used by the mat-table. Should not be used outside of the
|
|
937
877
|
* material library.
|
|
@@ -960,767 +900,764 @@ class RowViewRef extends EmbeddedViewRef {
|
|
|
960
900
|
* as a data array, an Observable stream that emits the data array to render, or a DataSource with a
|
|
961
901
|
* connect function that will return an Observable stream that emits the data array to render.
|
|
962
902
|
*/
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
this._onDestroy = new Subject();
|
|
973
|
-
/**
|
|
974
|
-
* Map of all the user's defined columns (header, data, and footer cell template) identified by
|
|
975
|
-
* name. Collection populated by the column definitions gathered by `ContentChildren` as well as
|
|
976
|
-
* any custom column definitions added to `_customColumnDefs`.
|
|
977
|
-
*/
|
|
978
|
-
this._columnDefsByName = new Map();
|
|
979
|
-
/**
|
|
980
|
-
* Column definitions that were defined outside of the direct content children of the table.
|
|
981
|
-
* These will be defined when, e.g., creating a wrapper around the cdkTable that has
|
|
982
|
-
* column definitions as *its* content child.
|
|
983
|
-
*/
|
|
984
|
-
this._customColumnDefs = new Set();
|
|
985
|
-
/**
|
|
986
|
-
* Data row definitions that were defined outside of the direct content children of the table.
|
|
987
|
-
* These will be defined when, e.g., creating a wrapper around the cdkTable that has
|
|
988
|
-
* built-in data rows as *its* content child.
|
|
989
|
-
*/
|
|
990
|
-
this._customRowDefs = new Set();
|
|
991
|
-
/**
|
|
992
|
-
* Header row definitions that were defined outside of the direct content children of the table.
|
|
993
|
-
* These will be defined when, e.g., creating a wrapper around the cdkTable that has
|
|
994
|
-
* built-in header rows as *its* content child.
|
|
995
|
-
*/
|
|
996
|
-
this._customHeaderRowDefs = new Set();
|
|
997
|
-
/**
|
|
998
|
-
* Footer row definitions that were defined outside of the direct content children of the table.
|
|
999
|
-
* These will be defined when, e.g., creating a wrapper around the cdkTable that has a
|
|
1000
|
-
* built-in footer row as *its* content child.
|
|
1001
|
-
*/
|
|
1002
|
-
this._customFooterRowDefs = new Set();
|
|
1003
|
-
/**
|
|
1004
|
-
* Whether the header row definition has been changed. Triggers an update to the header row after
|
|
1005
|
-
* content is checked. Initialized as true so that the table renders the initial set of rows.
|
|
1006
|
-
*/
|
|
1007
|
-
this._headerRowDefChanged = true;
|
|
1008
|
-
/**
|
|
1009
|
-
* Whether the footer row definition has been changed. Triggers an update to the footer row after
|
|
1010
|
-
* content is checked. Initialized as true so that the table renders the initial set of rows.
|
|
1011
|
-
*/
|
|
1012
|
-
this._footerRowDefChanged = true;
|
|
1013
|
-
/**
|
|
1014
|
-
* Cache of the latest rendered `RenderRow` objects as a map for easy retrieval when constructing
|
|
1015
|
-
* a new list of `RenderRow` objects for rendering rows. Since the new list is constructed with
|
|
1016
|
-
* the cached `RenderRow` objects when possible, the row identity is preserved when the data
|
|
1017
|
-
* and row template matches, which allows the `IterableDiffer` to check rows by reference
|
|
1018
|
-
* and understand which rows are added/moved/removed.
|
|
1019
|
-
*
|
|
1020
|
-
* Implemented as a map of maps where the first key is the `data: T` object and the second is the
|
|
1021
|
-
* `CdkRowDef<T>` object. With the two keys, the cache points to a `RenderRow<T>` object that
|
|
1022
|
-
* contains an array of created pairs. The array is necessary to handle cases where the data
|
|
1023
|
-
* array contains multiple duplicate data objects and each instantiated `RenderRow` must be
|
|
1024
|
-
* stored.
|
|
1025
|
-
*/
|
|
1026
|
-
this._cachedRenderRowsMap = new Map();
|
|
1027
|
-
/**
|
|
1028
|
-
* CSS class added to any row or cell that has sticky positioning applied. May be overriden by
|
|
1029
|
-
* table subclasses.
|
|
1030
|
-
*/
|
|
1031
|
-
this.stickyCssClass = 'cdk-table-sticky';
|
|
1032
|
-
/** Whether the no data row is currently showing anything. */
|
|
1033
|
-
this._isShowingNoDataRow = false;
|
|
1034
|
-
this._multiTemplateDataRows = false;
|
|
1035
|
-
// TODO(andrewseguin): Remove max value as the end index
|
|
1036
|
-
// and instead calculate the view on init and scroll.
|
|
1037
|
-
/**
|
|
1038
|
-
* Stream containing the latest information on what rows are being displayed on screen.
|
|
1039
|
-
* Can be used by the data source to as a heuristic of what data should be provided.
|
|
1040
|
-
*
|
|
1041
|
-
* @docs-private
|
|
1042
|
-
*/
|
|
1043
|
-
this.viewChange = new BehaviorSubject({ start: 0, end: Number.MAX_VALUE });
|
|
1044
|
-
if (!role) {
|
|
1045
|
-
this._elementRef.nativeElement.setAttribute('role', 'grid');
|
|
1046
|
-
}
|
|
1047
|
-
this._document = _document;
|
|
1048
|
-
this._isNativeHtmlTable = this._elementRef.nativeElement.nodeName === 'TABLE';
|
|
1049
|
-
}
|
|
903
|
+
class CdkTable {
|
|
904
|
+
constructor(_differs, _changeDetectorRef, _elementRef, role, _dir, _document, _platform) {
|
|
905
|
+
this._differs = _differs;
|
|
906
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
907
|
+
this._elementRef = _elementRef;
|
|
908
|
+
this._dir = _dir;
|
|
909
|
+
this._platform = _platform;
|
|
910
|
+
/** Subject that emits when the component has been destroyed. */
|
|
911
|
+
this._onDestroy = new Subject();
|
|
1050
912
|
/**
|
|
1051
|
-
*
|
|
1052
|
-
*
|
|
1053
|
-
*
|
|
1054
|
-
* Accepts a function that takes two parameters, `index` and `item`.
|
|
913
|
+
* Map of all the user's defined columns (header, data, and footer cell template) identified by
|
|
914
|
+
* name. Collection populated by the column definitions gathered by `ContentChildren` as well as
|
|
915
|
+
* any custom column definitions added to `_customColumnDefs`.
|
|
1055
916
|
*/
|
|
1056
|
-
|
|
1057
|
-
return this._trackByFn;
|
|
1058
|
-
}
|
|
1059
|
-
set trackBy(fn) {
|
|
1060
|
-
if (isDevMode() && fn != null && typeof fn !== 'function' && console &&
|
|
1061
|
-
console.warn) {
|
|
1062
|
-
console.warn(`trackBy must be a function, but received ${JSON.stringify(fn)}.`);
|
|
1063
|
-
}
|
|
1064
|
-
this._trackByFn = fn;
|
|
1065
|
-
}
|
|
917
|
+
this._columnDefsByName = new Map();
|
|
1066
918
|
/**
|
|
1067
|
-
*
|
|
1068
|
-
*
|
|
1069
|
-
*
|
|
1070
|
-
* - `DataSource` object that implements the connect/disconnect interface.
|
|
1071
|
-
*
|
|
1072
|
-
* If a data array is provided, the table must be notified when the array's objects are
|
|
1073
|
-
* added, removed, or moved. This can be done by calling the `renderRows()` function which will
|
|
1074
|
-
* render the diff since the last table render. If the data array reference is changed, the table
|
|
1075
|
-
* will automatically trigger an update to the rows.
|
|
1076
|
-
*
|
|
1077
|
-
* When providing an Observable stream, the table will trigger an update automatically when the
|
|
1078
|
-
* stream emits a new array of data.
|
|
1079
|
-
*
|
|
1080
|
-
* Finally, when providing a `DataSource` object, the table will use the Observable stream
|
|
1081
|
-
* provided by the connect function and trigger updates when that stream emits new data array
|
|
1082
|
-
* values. During the table's ngOnDestroy or when the data source is removed from the table, the
|
|
1083
|
-
* table will call the DataSource's `disconnect` function (may be useful for cleaning up any
|
|
1084
|
-
* subscriptions registered during the connect process).
|
|
919
|
+
* Column definitions that were defined outside of the direct content children of the table.
|
|
920
|
+
* These will be defined when, e.g., creating a wrapper around the cdkTable that has
|
|
921
|
+
* column definitions as *its* content child.
|
|
1085
922
|
*/
|
|
1086
|
-
|
|
1087
|
-
return this._dataSource;
|
|
1088
|
-
}
|
|
1089
|
-
set dataSource(dataSource) {
|
|
1090
|
-
if (this._dataSource !== dataSource) {
|
|
1091
|
-
this._switchDataSource(dataSource);
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
923
|
+
this._customColumnDefs = new Set();
|
|
1094
924
|
/**
|
|
1095
|
-
*
|
|
1096
|
-
*
|
|
1097
|
-
*
|
|
1098
|
-
* defined in the table, or otherwise the default row which does not have a when predicate.
|
|
925
|
+
* Data row definitions that were defined outside of the direct content children of the table.
|
|
926
|
+
* These will be defined when, e.g., creating a wrapper around the cdkTable that has
|
|
927
|
+
* built-in data rows as *its* content child.
|
|
1099
928
|
*/
|
|
1100
|
-
|
|
1101
|
-
return this._multiTemplateDataRows;
|
|
1102
|
-
}
|
|
1103
|
-
set multiTemplateDataRows(v) {
|
|
1104
|
-
this._multiTemplateDataRows = coerceBooleanProperty(v);
|
|
1105
|
-
// In Ivy if this value is set via a static attribute (e.g. <table multiTemplateDataRows>),
|
|
1106
|
-
// this setter will be invoked before the row outlet has been defined hence the null check.
|
|
1107
|
-
if (this._rowOutlet && this._rowOutlet.viewContainer.length) {
|
|
1108
|
-
this._forceRenderDataRows();
|
|
1109
|
-
}
|
|
1110
|
-
}
|
|
1111
|
-
ngOnInit() {
|
|
1112
|
-
this._setupStickyStyler();
|
|
1113
|
-
if (this._isNativeHtmlTable) {
|
|
1114
|
-
this._applyNativeTableSections();
|
|
1115
|
-
}
|
|
1116
|
-
// Set up the trackBy function so that it uses the `RenderRow` as its identity by default. If
|
|
1117
|
-
// the user has provided a custom trackBy, return the result of that function as evaluated
|
|
1118
|
-
// with the values of the `RenderRow`'s data and index.
|
|
1119
|
-
this._dataDiffer = this._differs.find([]).create((_i, dataRow) => {
|
|
1120
|
-
return this.trackBy ? this.trackBy(dataRow.dataIndex, dataRow.data) : dataRow;
|
|
1121
|
-
});
|
|
1122
|
-
}
|
|
1123
|
-
ngAfterContentChecked() {
|
|
1124
|
-
// Cache the row and column definitions gathered by ContentChildren and programmatic injection.
|
|
1125
|
-
this._cacheRowDefs();
|
|
1126
|
-
this._cacheColumnDefs();
|
|
1127
|
-
// Make sure that the user has at least added header, footer, or data row def.
|
|
1128
|
-
if (!this._headerRowDefs.length && !this._footerRowDefs.length && !this._rowDefs.length) {
|
|
1129
|
-
throw getTableMissingRowDefsError();
|
|
1130
|
-
}
|
|
1131
|
-
// Render updates if the list of columns have been changed for the header, row, or footer defs.
|
|
1132
|
-
this._renderUpdatedColumns();
|
|
1133
|
-
// If the header row definition has been changed, trigger a render to the header row.
|
|
1134
|
-
if (this._headerRowDefChanged) {
|
|
1135
|
-
this._forceRenderHeaderRows();
|
|
1136
|
-
this._headerRowDefChanged = false;
|
|
1137
|
-
}
|
|
1138
|
-
// If the footer row definition has been changed, trigger a render to the footer row.
|
|
1139
|
-
if (this._footerRowDefChanged) {
|
|
1140
|
-
this._forceRenderFooterRows();
|
|
1141
|
-
this._footerRowDefChanged = false;
|
|
1142
|
-
}
|
|
1143
|
-
// If there is a data source and row definitions, connect to the data source unless a
|
|
1144
|
-
// connection has already been made.
|
|
1145
|
-
if (this.dataSource && this._rowDefs.length > 0 && !this._renderChangeSubscription) {
|
|
1146
|
-
this._observeRenderChanges();
|
|
1147
|
-
}
|
|
1148
|
-
this._checkStickyStates();
|
|
1149
|
-
}
|
|
1150
|
-
ngOnDestroy() {
|
|
1151
|
-
this._rowOutlet.viewContainer.clear();
|
|
1152
|
-
this._noDataRowOutlet.viewContainer.clear();
|
|
1153
|
-
this._headerRowOutlet.viewContainer.clear();
|
|
1154
|
-
this._footerRowOutlet.viewContainer.clear();
|
|
1155
|
-
this._cachedRenderRowsMap.clear();
|
|
1156
|
-
this._onDestroy.next();
|
|
1157
|
-
this._onDestroy.complete();
|
|
1158
|
-
if (isDataSource(this.dataSource)) {
|
|
1159
|
-
this.dataSource.disconnect(this);
|
|
1160
|
-
}
|
|
1161
|
-
}
|
|
929
|
+
this._customRowDefs = new Set();
|
|
1162
930
|
/**
|
|
1163
|
-
*
|
|
1164
|
-
*
|
|
1165
|
-
*
|
|
1166
|
-
* changes (add/remove/move rows).
|
|
1167
|
-
*
|
|
1168
|
-
* If the table's data source is a DataSource or Observable, this will be invoked automatically
|
|
1169
|
-
* each time the provided Observable stream emits a new data array. Otherwise if your data is
|
|
1170
|
-
* an array, this function will need to be called to render any changes.
|
|
931
|
+
* Header row definitions that were defined outside of the direct content children of the table.
|
|
932
|
+
* These will be defined when, e.g., creating a wrapper around the cdkTable that has
|
|
933
|
+
* built-in header rows as *its* content child.
|
|
1171
934
|
*/
|
|
1172
|
-
|
|
1173
|
-
this._renderRows = this._getAllRenderRows();
|
|
1174
|
-
const changes = this._dataDiffer.diff(this._renderRows);
|
|
1175
|
-
if (!changes) {
|
|
1176
|
-
return;
|
|
1177
|
-
}
|
|
1178
|
-
const viewContainer = this._rowOutlet.viewContainer;
|
|
1179
|
-
changes.forEachOperation((record, prevIndex, currentIndex) => {
|
|
1180
|
-
if (record.previousIndex == null) {
|
|
1181
|
-
this._insertRow(record.item, currentIndex);
|
|
1182
|
-
}
|
|
1183
|
-
else if (currentIndex == null) {
|
|
1184
|
-
viewContainer.remove(prevIndex);
|
|
1185
|
-
}
|
|
1186
|
-
else {
|
|
1187
|
-
const view = viewContainer.get(prevIndex);
|
|
1188
|
-
viewContainer.move(view, currentIndex);
|
|
1189
|
-
}
|
|
1190
|
-
});
|
|
1191
|
-
// Update the meta context of a row's context data (index, count, first, last, ...)
|
|
1192
|
-
this._updateRowIndexContext();
|
|
1193
|
-
// Update rows that did not get added/removed/moved but may have had their identity changed,
|
|
1194
|
-
// e.g. if trackBy matched data on some property but the actual data reference changed.
|
|
1195
|
-
changes.forEachIdentityChange((record) => {
|
|
1196
|
-
const rowView = viewContainer.get(record.currentIndex);
|
|
1197
|
-
rowView.context.$implicit = record.item.data;
|
|
1198
|
-
});
|
|
1199
|
-
this._updateNoDataRow();
|
|
1200
|
-
this.updateStickyColumnStyles();
|
|
1201
|
-
}
|
|
1202
|
-
/** Adds a column definition that was not included as part of the content children. */
|
|
1203
|
-
addColumnDef(columnDef) {
|
|
1204
|
-
this._customColumnDefs.add(columnDef);
|
|
1205
|
-
}
|
|
1206
|
-
/** Removes a column definition that was not included as part of the content children. */
|
|
1207
|
-
removeColumnDef(columnDef) {
|
|
1208
|
-
this._customColumnDefs.delete(columnDef);
|
|
1209
|
-
}
|
|
1210
|
-
/** Adds a row definition that was not included as part of the content children. */
|
|
1211
|
-
addRowDef(rowDef) {
|
|
1212
|
-
this._customRowDefs.add(rowDef);
|
|
1213
|
-
}
|
|
1214
|
-
/** Removes a row definition that was not included as part of the content children. */
|
|
1215
|
-
removeRowDef(rowDef) {
|
|
1216
|
-
this._customRowDefs.delete(rowDef);
|
|
1217
|
-
}
|
|
1218
|
-
/** Adds a header row definition that was not included as part of the content children. */
|
|
1219
|
-
addHeaderRowDef(headerRowDef) {
|
|
1220
|
-
this._customHeaderRowDefs.add(headerRowDef);
|
|
1221
|
-
this._headerRowDefChanged = true;
|
|
1222
|
-
}
|
|
1223
|
-
/** Removes a header row definition that was not included as part of the content children. */
|
|
1224
|
-
removeHeaderRowDef(headerRowDef) {
|
|
1225
|
-
this._customHeaderRowDefs.delete(headerRowDef);
|
|
1226
|
-
this._headerRowDefChanged = true;
|
|
1227
|
-
}
|
|
1228
|
-
/** Adds a footer row definition that was not included as part of the content children. */
|
|
1229
|
-
addFooterRowDef(footerRowDef) {
|
|
1230
|
-
this._customFooterRowDefs.add(footerRowDef);
|
|
1231
|
-
this._footerRowDefChanged = true;
|
|
1232
|
-
}
|
|
1233
|
-
/** Removes a footer row definition that was not included as part of the content children. */
|
|
1234
|
-
removeFooterRowDef(footerRowDef) {
|
|
1235
|
-
this._customFooterRowDefs.delete(footerRowDef);
|
|
1236
|
-
this._footerRowDefChanged = true;
|
|
1237
|
-
}
|
|
935
|
+
this._customHeaderRowDefs = new Set();
|
|
1238
936
|
/**
|
|
1239
|
-
*
|
|
1240
|
-
*
|
|
1241
|
-
*
|
|
1242
|
-
* sticky input changes. May be called manually for cases where the cell content changes outside
|
|
1243
|
-
* of these events.
|
|
937
|
+
* Footer row definitions that were defined outside of the direct content children of the table.
|
|
938
|
+
* These will be defined when, e.g., creating a wrapper around the cdkTable that has a
|
|
939
|
+
* built-in footer row as *its* content child.
|
|
1244
940
|
*/
|
|
1245
|
-
|
|
1246
|
-
const headerRows = this._getRenderedRows(this._headerRowOutlet);
|
|
1247
|
-
const tableElement = this._elementRef.nativeElement;
|
|
1248
|
-
// Hide the thead element if there are no header rows. This is necessary to satisfy
|
|
1249
|
-
// overzealous a11y checkers that fail because the `rowgroup` element does not contain
|
|
1250
|
-
// required child `row`.
|
|
1251
|
-
const thead = tableElement.querySelector('thead');
|
|
1252
|
-
if (thead) {
|
|
1253
|
-
thead.style.display = headerRows.length ? '' : 'none';
|
|
1254
|
-
}
|
|
1255
|
-
const stickyStates = this._headerRowDefs.map(def => def.sticky);
|
|
1256
|
-
this._stickyStyler.clearStickyPositioning(headerRows, ['top']);
|
|
1257
|
-
this._stickyStyler.stickRows(headerRows, stickyStates, 'top');
|
|
1258
|
-
// Reset the dirty state of the sticky input change since it has been used.
|
|
1259
|
-
this._headerRowDefs.forEach(def => def.resetStickyChanged());
|
|
1260
|
-
}
|
|
941
|
+
this._customFooterRowDefs = new Set();
|
|
1261
942
|
/**
|
|
1262
|
-
*
|
|
1263
|
-
*
|
|
1264
|
-
* automatically called when the footer row changes its displayed set of columns, or if its
|
|
1265
|
-
* sticky input changes. May be called manually for cases where the cell content changes outside
|
|
1266
|
-
* of these events.
|
|
943
|
+
* Whether the header row definition has been changed. Triggers an update to the header row after
|
|
944
|
+
* content is checked. Initialized as true so that the table renders the initial set of rows.
|
|
1267
945
|
*/
|
|
1268
|
-
|
|
1269
|
-
const footerRows = this._getRenderedRows(this._footerRowOutlet);
|
|
1270
|
-
const tableElement = this._elementRef.nativeElement;
|
|
1271
|
-
// Hide the tfoot element if there are no footer rows. This is necessary to satisfy
|
|
1272
|
-
// overzealous a11y checkers that fail because the `rowgroup` element does not contain
|
|
1273
|
-
// required child `row`.
|
|
1274
|
-
const tfoot = tableElement.querySelector('tfoot');
|
|
1275
|
-
if (tfoot) {
|
|
1276
|
-
tfoot.style.display = footerRows.length ? '' : 'none';
|
|
1277
|
-
}
|
|
1278
|
-
const stickyStates = this._footerRowDefs.map(def => def.sticky);
|
|
1279
|
-
this._stickyStyler.clearStickyPositioning(footerRows, ['bottom']);
|
|
1280
|
-
this._stickyStyler.stickRows(footerRows, stickyStates, 'bottom');
|
|
1281
|
-
this._stickyStyler.updateStickyFooterContainer(this._elementRef.nativeElement, stickyStates);
|
|
1282
|
-
// Reset the dirty state of the sticky input change since it has been used.
|
|
1283
|
-
this._footerRowDefs.forEach(def => def.resetStickyChanged());
|
|
1284
|
-
}
|
|
946
|
+
this._headerRowDefChanged = true;
|
|
1285
947
|
/**
|
|
1286
|
-
*
|
|
1287
|
-
*
|
|
1288
|
-
* to the column definitions for each cell in each row. This is automatically called when
|
|
1289
|
-
* the data source provides a new set of data or when a column definition changes its sticky
|
|
1290
|
-
* input. May be called manually for cases where the cell content changes outside of these events.
|
|
948
|
+
* Whether the footer row definition has been changed. Triggers an update to the footer row after
|
|
949
|
+
* content is checked. Initialized as true so that the table renders the initial set of rows.
|
|
1291
950
|
*/
|
|
1292
|
-
|
|
1293
|
-
const headerRows = this._getRenderedRows(this._headerRowOutlet);
|
|
1294
|
-
const dataRows = this._getRenderedRows(this._rowOutlet);
|
|
1295
|
-
const footerRows = this._getRenderedRows(this._footerRowOutlet);
|
|
1296
|
-
// Clear the left and right positioning from all columns in the table across all rows since
|
|
1297
|
-
// sticky columns span across all table sections (header, data, footer)
|
|
1298
|
-
this._stickyStyler.clearStickyPositioning([...headerRows, ...dataRows, ...footerRows], ['left', 'right']);
|
|
1299
|
-
// Update the sticky styles for each header row depending on the def's sticky state
|
|
1300
|
-
headerRows.forEach((headerRow, i) => {
|
|
1301
|
-
this._addStickyColumnStyles([headerRow], this._headerRowDefs[i]);
|
|
1302
|
-
});
|
|
1303
|
-
// Update the sticky styles for each data row depending on its def's sticky state
|
|
1304
|
-
this._rowDefs.forEach(rowDef => {
|
|
1305
|
-
// Collect all the rows rendered with this row definition.
|
|
1306
|
-
const rows = [];
|
|
1307
|
-
for (let i = 0; i < dataRows.length; i++) {
|
|
1308
|
-
if (this._renderRows[i].rowDef === rowDef) {
|
|
1309
|
-
rows.push(dataRows[i]);
|
|
1310
|
-
}
|
|
1311
|
-
}
|
|
1312
|
-
this._addStickyColumnStyles(rows, rowDef);
|
|
1313
|
-
});
|
|
1314
|
-
// Update the sticky styles for each footer row depending on the def's sticky state
|
|
1315
|
-
footerRows.forEach((footerRow, i) => {
|
|
1316
|
-
this._addStickyColumnStyles([footerRow], this._footerRowDefs[i]);
|
|
1317
|
-
});
|
|
1318
|
-
// Reset the dirty state of the sticky input change since it has been used.
|
|
1319
|
-
Array.from(this._columnDefsByName.values()).forEach(def => def.resetStickyChanged());
|
|
1320
|
-
}
|
|
951
|
+
this._footerRowDefChanged = true;
|
|
1321
952
|
/**
|
|
1322
|
-
*
|
|
1323
|
-
*
|
|
1324
|
-
*
|
|
953
|
+
* Cache of the latest rendered `RenderRow` objects as a map for easy retrieval when constructing
|
|
954
|
+
* a new list of `RenderRow` objects for rendering rows. Since the new list is constructed with
|
|
955
|
+
* the cached `RenderRow` objects when possible, the row identity is preserved when the data
|
|
956
|
+
* and row template matches, which allows the `IterableDiffer` to check rows by reference
|
|
957
|
+
* and understand which rows are added/moved/removed.
|
|
958
|
+
*
|
|
959
|
+
* Implemented as a map of maps where the first key is the `data: T` object and the second is the
|
|
960
|
+
* `CdkRowDef<T>` object. With the two keys, the cache points to a `RenderRow<T>` object that
|
|
961
|
+
* contains an array of created pairs. The array is necessary to handle cases where the data
|
|
962
|
+
* array contains multiple duplicate data objects and each instantiated `RenderRow` must be
|
|
963
|
+
* stored.
|
|
1325
964
|
*/
|
|
1326
|
-
|
|
1327
|
-
const renderRows = [];
|
|
1328
|
-
// Store the cache and create a new one. Any re-used RenderRow objects will be moved into the
|
|
1329
|
-
// new cache while unused ones can be picked up by garbage collection.
|
|
1330
|
-
const prevCachedRenderRows = this._cachedRenderRowsMap;
|
|
1331
|
-
this._cachedRenderRowsMap = new Map();
|
|
1332
|
-
// For each data object, get the list of rows that should be rendered, represented by the
|
|
1333
|
-
// respective `RenderRow` object which is the pair of `data` and `CdkRowDef`.
|
|
1334
|
-
for (let i = 0; i < this._data.length; i++) {
|
|
1335
|
-
let data = this._data[i];
|
|
1336
|
-
const renderRowsForData = this._getRenderRowsForData(data, i, prevCachedRenderRows.get(data));
|
|
1337
|
-
if (!this._cachedRenderRowsMap.has(data)) {
|
|
1338
|
-
this._cachedRenderRowsMap.set(data, new WeakMap());
|
|
1339
|
-
}
|
|
1340
|
-
for (let j = 0; j < renderRowsForData.length; j++) {
|
|
1341
|
-
let renderRow = renderRowsForData[j];
|
|
1342
|
-
const cache = this._cachedRenderRowsMap.get(renderRow.data);
|
|
1343
|
-
if (cache.has(renderRow.rowDef)) {
|
|
1344
|
-
cache.get(renderRow.rowDef).push(renderRow);
|
|
1345
|
-
}
|
|
1346
|
-
else {
|
|
1347
|
-
cache.set(renderRow.rowDef, [renderRow]);
|
|
1348
|
-
}
|
|
1349
|
-
renderRows.push(renderRow);
|
|
1350
|
-
}
|
|
1351
|
-
}
|
|
1352
|
-
return renderRows;
|
|
1353
|
-
}
|
|
965
|
+
this._cachedRenderRowsMap = new Map();
|
|
1354
966
|
/**
|
|
1355
|
-
*
|
|
1356
|
-
*
|
|
1357
|
-
* `(T, CdkRowDef)` pair.
|
|
967
|
+
* CSS class added to any row or cell that has sticky positioning applied. May be overriden by
|
|
968
|
+
* table subclasses.
|
|
1358
969
|
*/
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
dataRow.dataIndex = dataIndex;
|
|
1366
|
-
return dataRow;
|
|
1367
|
-
}
|
|
1368
|
-
else {
|
|
1369
|
-
return { data, rowDef, dataIndex };
|
|
1370
|
-
}
|
|
1371
|
-
});
|
|
1372
|
-
}
|
|
1373
|
-
/** Update the map containing the content's column definitions. */
|
|
1374
|
-
_cacheColumnDefs() {
|
|
1375
|
-
this._columnDefsByName.clear();
|
|
1376
|
-
const columnDefs = mergeArrayAndSet(this._getOwnDefs(this._contentColumnDefs), this._customColumnDefs);
|
|
1377
|
-
columnDefs.forEach(columnDef => {
|
|
1378
|
-
if (this._columnDefsByName.has(columnDef.name)) {
|
|
1379
|
-
throw getTableDuplicateColumnNameError(columnDef.name);
|
|
1380
|
-
}
|
|
1381
|
-
this._columnDefsByName.set(columnDef.name, columnDef);
|
|
1382
|
-
});
|
|
1383
|
-
}
|
|
1384
|
-
/** Update the list of all available row definitions that can be used. */
|
|
1385
|
-
_cacheRowDefs() {
|
|
1386
|
-
this._headerRowDefs = mergeArrayAndSet(this._getOwnDefs(this._contentHeaderRowDefs), this._customHeaderRowDefs);
|
|
1387
|
-
this._footerRowDefs = mergeArrayAndSet(this._getOwnDefs(this._contentFooterRowDefs), this._customFooterRowDefs);
|
|
1388
|
-
this._rowDefs = mergeArrayAndSet(this._getOwnDefs(this._contentRowDefs), this._customRowDefs);
|
|
1389
|
-
// After all row definitions are determined, find the row definition to be considered default.
|
|
1390
|
-
const defaultRowDefs = this._rowDefs.filter(def => !def.when);
|
|
1391
|
-
if (!this.multiTemplateDataRows && defaultRowDefs.length > 1) {
|
|
1392
|
-
throw getTableMultipleDefaultRowDefsError();
|
|
1393
|
-
}
|
|
1394
|
-
this._defaultRowDef = defaultRowDefs[0];
|
|
1395
|
-
}
|
|
970
|
+
this.stickyCssClass = 'cdk-table-sticky';
|
|
971
|
+
/** Whether the no data row is currently showing anything. */
|
|
972
|
+
this._isShowingNoDataRow = false;
|
|
973
|
+
this._multiTemplateDataRows = false;
|
|
974
|
+
// TODO(andrewseguin): Remove max value as the end index
|
|
975
|
+
// and instead calculate the view on init and scroll.
|
|
1396
976
|
/**
|
|
1397
|
-
*
|
|
1398
|
-
*
|
|
1399
|
-
*
|
|
977
|
+
* Stream containing the latest information on what rows are being displayed on screen.
|
|
978
|
+
* Can be used by the data source to as a heuristic of what data should be provided.
|
|
979
|
+
*
|
|
980
|
+
* @docs-private
|
|
1400
981
|
*/
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
if (this._rowDefs.reduce(columnsDiffReducer, false)) {
|
|
1405
|
-
this._forceRenderDataRows();
|
|
1406
|
-
}
|
|
1407
|
-
// Force re-render header/footer rows if the list of column definitions have changed..
|
|
1408
|
-
if (this._headerRowDefs.reduce(columnsDiffReducer, false)) {
|
|
1409
|
-
this._forceRenderHeaderRows();
|
|
1410
|
-
}
|
|
1411
|
-
if (this._footerRowDefs.reduce(columnsDiffReducer, false)) {
|
|
1412
|
-
this._forceRenderFooterRows();
|
|
1413
|
-
}
|
|
982
|
+
this.viewChange = new BehaviorSubject({ start: 0, end: Number.MAX_VALUE });
|
|
983
|
+
if (!role) {
|
|
984
|
+
this._elementRef.nativeElement.setAttribute('role', 'grid');
|
|
1414
985
|
}
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
if (this._dataDiffer) {
|
|
1432
|
-
this._dataDiffer.diff([]);
|
|
1433
|
-
}
|
|
1434
|
-
this._rowOutlet.viewContainer.clear();
|
|
1435
|
-
}
|
|
1436
|
-
this._dataSource = dataSource;
|
|
986
|
+
this._document = _document;
|
|
987
|
+
this._isNativeHtmlTable = this._elementRef.nativeElement.nodeName === 'TABLE';
|
|
988
|
+
}
|
|
989
|
+
/**
|
|
990
|
+
* Tracking function that will be used to check the differences in data changes. Used similarly
|
|
991
|
+
* to `ngFor` `trackBy` function. Optimize row operations by identifying a row based on its data
|
|
992
|
+
* relative to the function to know if a row should be added/removed/moved.
|
|
993
|
+
* Accepts a function that takes two parameters, `index` and `item`.
|
|
994
|
+
*/
|
|
995
|
+
get trackBy() {
|
|
996
|
+
return this._trackByFn;
|
|
997
|
+
}
|
|
998
|
+
set trackBy(fn) {
|
|
999
|
+
if (isDevMode() && fn != null && typeof fn !== 'function' && console &&
|
|
1000
|
+
console.warn) {
|
|
1001
|
+
console.warn(`trackBy must be a function, but received ${JSON.stringify(fn)}.`);
|
|
1437
1002
|
}
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1003
|
+
this._trackByFn = fn;
|
|
1004
|
+
}
|
|
1005
|
+
/**
|
|
1006
|
+
* The table's source of data, which can be provided in three ways (in order of complexity):
|
|
1007
|
+
* - Simple data array (each object represents one table row)
|
|
1008
|
+
* - Stream that emits a data array each time the array changes
|
|
1009
|
+
* - `DataSource` object that implements the connect/disconnect interface.
|
|
1010
|
+
*
|
|
1011
|
+
* If a data array is provided, the table must be notified when the array's objects are
|
|
1012
|
+
* added, removed, or moved. This can be done by calling the `renderRows()` function which will
|
|
1013
|
+
* render the diff since the last table render. If the data array reference is changed, the table
|
|
1014
|
+
* will automatically trigger an update to the rows.
|
|
1015
|
+
*
|
|
1016
|
+
* When providing an Observable stream, the table will trigger an update automatically when the
|
|
1017
|
+
* stream emits a new array of data.
|
|
1018
|
+
*
|
|
1019
|
+
* Finally, when providing a `DataSource` object, the table will use the Observable stream
|
|
1020
|
+
* provided by the connect function and trigger updates when that stream emits new data array
|
|
1021
|
+
* values. During the table's ngOnDestroy or when the data source is removed from the table, the
|
|
1022
|
+
* table will call the DataSource's `disconnect` function (may be useful for cleaning up any
|
|
1023
|
+
* subscriptions registered during the connect process).
|
|
1024
|
+
*/
|
|
1025
|
+
get dataSource() {
|
|
1026
|
+
return this._dataSource;
|
|
1027
|
+
}
|
|
1028
|
+
set dataSource(dataSource) {
|
|
1029
|
+
if (this._dataSource !== dataSource) {
|
|
1030
|
+
this._switchDataSource(dataSource);
|
|
1461
1031
|
}
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1032
|
+
}
|
|
1033
|
+
/**
|
|
1034
|
+
* Whether to allow multiple rows per data object by evaluating which rows evaluate their 'when'
|
|
1035
|
+
* predicate to true. If `multiTemplateDataRows` is false, which is the default value, then each
|
|
1036
|
+
* dataobject will render the first row that evaluates its when predicate to true, in the order
|
|
1037
|
+
* defined in the table, or otherwise the default row which does not have a when predicate.
|
|
1038
|
+
*/
|
|
1039
|
+
get multiTemplateDataRows() {
|
|
1040
|
+
return this._multiTemplateDataRows;
|
|
1041
|
+
}
|
|
1042
|
+
set multiTemplateDataRows(v) {
|
|
1043
|
+
this._multiTemplateDataRows = coerceBooleanProperty(v);
|
|
1044
|
+
// In Ivy if this value is set via a static attribute (e.g. <table multiTemplateDataRows>),
|
|
1045
|
+
// this setter will be invoked before the row outlet has been defined hence the null check.
|
|
1046
|
+
if (this._rowOutlet && this._rowOutlet.viewContainer.length) {
|
|
1047
|
+
this._forceRenderDataRows();
|
|
1474
1048
|
}
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
this.
|
|
1486
|
-
|
|
1049
|
+
}
|
|
1050
|
+
ngOnInit() {
|
|
1051
|
+
this._setupStickyStyler();
|
|
1052
|
+
if (this._isNativeHtmlTable) {
|
|
1053
|
+
this._applyNativeTableSections();
|
|
1054
|
+
}
|
|
1055
|
+
// Set up the trackBy function so that it uses the `RenderRow` as its identity by default. If
|
|
1056
|
+
// the user has provided a custom trackBy, return the result of that function as evaluated
|
|
1057
|
+
// with the values of the `RenderRow`'s data and index.
|
|
1058
|
+
this._dataDiffer = this._differs.find([]).create((_i, dataRow) => {
|
|
1059
|
+
return this.trackBy ? this.trackBy(dataRow.dataIndex, dataRow.data) : dataRow;
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1062
|
+
ngAfterContentChecked() {
|
|
1063
|
+
// Cache the row and column definitions gathered by ContentChildren and programmatic injection.
|
|
1064
|
+
this._cacheRowDefs();
|
|
1065
|
+
this._cacheColumnDefs();
|
|
1066
|
+
// Make sure that the user has at least added header, footer, or data row def.
|
|
1067
|
+
if (!this._headerRowDefs.length && !this._footerRowDefs.length && !this._rowDefs.length) {
|
|
1068
|
+
throw getTableMissingRowDefsError();
|
|
1069
|
+
}
|
|
1070
|
+
// Render updates if the list of columns have been changed for the header, row, or footer defs.
|
|
1071
|
+
this._renderUpdatedColumns();
|
|
1072
|
+
// If the header row definition has been changed, trigger a render to the header row.
|
|
1073
|
+
if (this._headerRowDefChanged) {
|
|
1074
|
+
this._forceRenderHeaderRows();
|
|
1075
|
+
this._headerRowDefChanged = false;
|
|
1076
|
+
}
|
|
1077
|
+
// If the footer row definition has been changed, trigger a render to the footer row.
|
|
1078
|
+
if (this._footerRowDefChanged) {
|
|
1079
|
+
this._forceRenderFooterRows();
|
|
1080
|
+
this._footerRowDefChanged = false;
|
|
1081
|
+
}
|
|
1082
|
+
// If there is a data source and row definitions, connect to the data source unless a
|
|
1083
|
+
// connection has already been made.
|
|
1084
|
+
if (this.dataSource && this._rowDefs.length > 0 && !this._renderChangeSubscription) {
|
|
1085
|
+
this._observeRenderChanges();
|
|
1086
|
+
}
|
|
1087
|
+
this._checkStickyStates();
|
|
1088
|
+
}
|
|
1089
|
+
ngOnDestroy() {
|
|
1090
|
+
this._rowOutlet.viewContainer.clear();
|
|
1091
|
+
this._noDataRowOutlet.viewContainer.clear();
|
|
1092
|
+
this._headerRowOutlet.viewContainer.clear();
|
|
1093
|
+
this._footerRowOutlet.viewContainer.clear();
|
|
1094
|
+
this._cachedRenderRowsMap.clear();
|
|
1095
|
+
this._onDestroy.next();
|
|
1096
|
+
this._onDestroy.complete();
|
|
1097
|
+
if (isDataSource(this.dataSource)) {
|
|
1098
|
+
this.dataSource.disconnect(this);
|
|
1487
1099
|
}
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
for (let i = 0; i < rowOutlet.viewContainer.length; i++) {
|
|
1505
|
-
const viewRef = rowOutlet.viewContainer.get(i);
|
|
1506
|
-
renderedRows.push(viewRef.rootNodes[0]);
|
|
1507
|
-
}
|
|
1508
|
-
return renderedRows;
|
|
1100
|
+
}
|
|
1101
|
+
/**
|
|
1102
|
+
* Renders rows based on the table's latest set of data, which was either provided directly as an
|
|
1103
|
+
* input or retrieved through an Observable stream (directly or from a DataSource).
|
|
1104
|
+
* Checks for differences in the data since the last diff to perform only the necessary
|
|
1105
|
+
* changes (add/remove/move rows).
|
|
1106
|
+
*
|
|
1107
|
+
* If the table's data source is a DataSource or Observable, this will be invoked automatically
|
|
1108
|
+
* each time the provided Observable stream emits a new data array. Otherwise if your data is
|
|
1109
|
+
* an array, this function will need to be called to render any changes.
|
|
1110
|
+
*/
|
|
1111
|
+
renderRows() {
|
|
1112
|
+
this._renderRows = this._getAllRenderRows();
|
|
1113
|
+
const changes = this._dataDiffer.diff(this._renderRows);
|
|
1114
|
+
if (!changes) {
|
|
1115
|
+
return;
|
|
1509
1116
|
}
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
* definition.
|
|
1515
|
-
*/
|
|
1516
|
-
_getRowDefs(data, dataIndex) {
|
|
1517
|
-
if (this._rowDefs.length == 1) {
|
|
1518
|
-
return [this._rowDefs[0]];
|
|
1117
|
+
const viewContainer = this._rowOutlet.viewContainer;
|
|
1118
|
+
changes.forEachOperation((record, prevIndex, currentIndex) => {
|
|
1119
|
+
if (record.previousIndex == null) {
|
|
1120
|
+
this._insertRow(record.item, currentIndex);
|
|
1519
1121
|
}
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
rowDefs = this._rowDefs.filter(def => !def.when || def.when(dataIndex, data));
|
|
1122
|
+
else if (currentIndex == null) {
|
|
1123
|
+
viewContainer.remove(prevIndex);
|
|
1523
1124
|
}
|
|
1524
1125
|
else {
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1126
|
+
const view = viewContainer.get(prevIndex);
|
|
1127
|
+
viewContainer.move(view, currentIndex);
|
|
1128
|
+
}
|
|
1129
|
+
});
|
|
1130
|
+
// Update the meta context of a row's context data (index, count, first, last, ...)
|
|
1131
|
+
this._updateRowIndexContext();
|
|
1132
|
+
// Update rows that did not get added/removed/moved but may have had their identity changed,
|
|
1133
|
+
// e.g. if trackBy matched data on some property but the actual data reference changed.
|
|
1134
|
+
changes.forEachIdentityChange((record) => {
|
|
1135
|
+
const rowView = viewContainer.get(record.currentIndex);
|
|
1136
|
+
rowView.context.$implicit = record.item.data;
|
|
1137
|
+
});
|
|
1138
|
+
this._updateNoDataRow();
|
|
1139
|
+
this.updateStickyColumnStyles();
|
|
1140
|
+
}
|
|
1141
|
+
/** Adds a column definition that was not included as part of the content children. */
|
|
1142
|
+
addColumnDef(columnDef) {
|
|
1143
|
+
this._customColumnDefs.add(columnDef);
|
|
1144
|
+
}
|
|
1145
|
+
/** Removes a column definition that was not included as part of the content children. */
|
|
1146
|
+
removeColumnDef(columnDef) {
|
|
1147
|
+
this._customColumnDefs.delete(columnDef);
|
|
1148
|
+
}
|
|
1149
|
+
/** Adds a row definition that was not included as part of the content children. */
|
|
1150
|
+
addRowDef(rowDef) {
|
|
1151
|
+
this._customRowDefs.add(rowDef);
|
|
1152
|
+
}
|
|
1153
|
+
/** Removes a row definition that was not included as part of the content children. */
|
|
1154
|
+
removeRowDef(rowDef) {
|
|
1155
|
+
this._customRowDefs.delete(rowDef);
|
|
1156
|
+
}
|
|
1157
|
+
/** Adds a header row definition that was not included as part of the content children. */
|
|
1158
|
+
addHeaderRowDef(headerRowDef) {
|
|
1159
|
+
this._customHeaderRowDefs.add(headerRowDef);
|
|
1160
|
+
this._headerRowDefChanged = true;
|
|
1161
|
+
}
|
|
1162
|
+
/** Removes a header row definition that was not included as part of the content children. */
|
|
1163
|
+
removeHeaderRowDef(headerRowDef) {
|
|
1164
|
+
this._customHeaderRowDefs.delete(headerRowDef);
|
|
1165
|
+
this._headerRowDefChanged = true;
|
|
1166
|
+
}
|
|
1167
|
+
/** Adds a footer row definition that was not included as part of the content children. */
|
|
1168
|
+
addFooterRowDef(footerRowDef) {
|
|
1169
|
+
this._customFooterRowDefs.add(footerRowDef);
|
|
1170
|
+
this._footerRowDefChanged = true;
|
|
1171
|
+
}
|
|
1172
|
+
/** Removes a footer row definition that was not included as part of the content children. */
|
|
1173
|
+
removeFooterRowDef(footerRowDef) {
|
|
1174
|
+
this._customFooterRowDefs.delete(footerRowDef);
|
|
1175
|
+
this._footerRowDefChanged = true;
|
|
1176
|
+
}
|
|
1177
|
+
/**
|
|
1178
|
+
* Updates the header sticky styles. First resets all applied styles with respect to the cells
|
|
1179
|
+
* sticking to the top. Then, evaluating which cells need to be stuck to the top. This is
|
|
1180
|
+
* automatically called when the header row changes its displayed set of columns, or if its
|
|
1181
|
+
* sticky input changes. May be called manually for cases where the cell content changes outside
|
|
1182
|
+
* of these events.
|
|
1183
|
+
*/
|
|
1184
|
+
updateStickyHeaderRowStyles() {
|
|
1185
|
+
const headerRows = this._getRenderedRows(this._headerRowOutlet);
|
|
1186
|
+
const tableElement = this._elementRef.nativeElement;
|
|
1187
|
+
// Hide the thead element if there are no header rows. This is necessary to satisfy
|
|
1188
|
+
// overzealous a11y checkers that fail because the `rowgroup` element does not contain
|
|
1189
|
+
// required child `row`.
|
|
1190
|
+
const thead = tableElement.querySelector('thead');
|
|
1191
|
+
if (thead) {
|
|
1192
|
+
thead.style.display = headerRows.length ? '' : 'none';
|
|
1193
|
+
}
|
|
1194
|
+
const stickyStates = this._headerRowDefs.map(def => def.sticky);
|
|
1195
|
+
this._stickyStyler.clearStickyPositioning(headerRows, ['top']);
|
|
1196
|
+
this._stickyStyler.stickRows(headerRows, stickyStates, 'top');
|
|
1197
|
+
// Reset the dirty state of the sticky input change since it has been used.
|
|
1198
|
+
this._headerRowDefs.forEach(def => def.resetStickyChanged());
|
|
1199
|
+
}
|
|
1200
|
+
/**
|
|
1201
|
+
* Updates the footer sticky styles. First resets all applied styles with respect to the cells
|
|
1202
|
+
* sticking to the bottom. Then, evaluating which cells need to be stuck to the bottom. This is
|
|
1203
|
+
* automatically called when the footer row changes its displayed set of columns, or if its
|
|
1204
|
+
* sticky input changes. May be called manually for cases where the cell content changes outside
|
|
1205
|
+
* of these events.
|
|
1206
|
+
*/
|
|
1207
|
+
updateStickyFooterRowStyles() {
|
|
1208
|
+
const footerRows = this._getRenderedRows(this._footerRowOutlet);
|
|
1209
|
+
const tableElement = this._elementRef.nativeElement;
|
|
1210
|
+
// Hide the tfoot element if there are no footer rows. This is necessary to satisfy
|
|
1211
|
+
// overzealous a11y checkers that fail because the `rowgroup` element does not contain
|
|
1212
|
+
// required child `row`.
|
|
1213
|
+
const tfoot = tableElement.querySelector('tfoot');
|
|
1214
|
+
if (tfoot) {
|
|
1215
|
+
tfoot.style.display = footerRows.length ? '' : 'none';
|
|
1216
|
+
}
|
|
1217
|
+
const stickyStates = this._footerRowDefs.map(def => def.sticky);
|
|
1218
|
+
this._stickyStyler.clearStickyPositioning(footerRows, ['bottom']);
|
|
1219
|
+
this._stickyStyler.stickRows(footerRows, stickyStates, 'bottom');
|
|
1220
|
+
this._stickyStyler.updateStickyFooterContainer(this._elementRef.nativeElement, stickyStates);
|
|
1221
|
+
// Reset the dirty state of the sticky input change since it has been used.
|
|
1222
|
+
this._footerRowDefs.forEach(def => def.resetStickyChanged());
|
|
1223
|
+
}
|
|
1224
|
+
/**
|
|
1225
|
+
* Updates the column sticky styles. First resets all applied styles with respect to the cells
|
|
1226
|
+
* sticking to the left and right. Then sticky styles are added for the left and right according
|
|
1227
|
+
* to the column definitions for each cell in each row. This is automatically called when
|
|
1228
|
+
* the data source provides a new set of data or when a column definition changes its sticky
|
|
1229
|
+
* input. May be called manually for cases where the cell content changes outside of these events.
|
|
1230
|
+
*/
|
|
1231
|
+
updateStickyColumnStyles() {
|
|
1232
|
+
const headerRows = this._getRenderedRows(this._headerRowOutlet);
|
|
1233
|
+
const dataRows = this._getRenderedRows(this._rowOutlet);
|
|
1234
|
+
const footerRows = this._getRenderedRows(this._footerRowOutlet);
|
|
1235
|
+
// Clear the left and right positioning from all columns in the table across all rows since
|
|
1236
|
+
// sticky columns span across all table sections (header, data, footer)
|
|
1237
|
+
this._stickyStyler.clearStickyPositioning([...headerRows, ...dataRows, ...footerRows], ['left', 'right']);
|
|
1238
|
+
// Update the sticky styles for each header row depending on the def's sticky state
|
|
1239
|
+
headerRows.forEach((headerRow, i) => {
|
|
1240
|
+
this._addStickyColumnStyles([headerRow], this._headerRowDefs[i]);
|
|
1241
|
+
});
|
|
1242
|
+
// Update the sticky styles for each data row depending on its def's sticky state
|
|
1243
|
+
this._rowDefs.forEach(rowDef => {
|
|
1244
|
+
// Collect all the rows rendered with this row definition.
|
|
1245
|
+
const rows = [];
|
|
1246
|
+
for (let i = 0; i < dataRows.length; i++) {
|
|
1247
|
+
if (this._renderRows[i].rowDef === rowDef) {
|
|
1248
|
+
rows.push(dataRows[i]);
|
|
1555
1249
|
}
|
|
1556
1250
|
}
|
|
1557
|
-
this.
|
|
1558
|
-
}
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1251
|
+
this._addStickyColumnStyles(rows, rowDef);
|
|
1252
|
+
});
|
|
1253
|
+
// Update the sticky styles for each footer row depending on the def's sticky state
|
|
1254
|
+
footerRows.forEach((footerRow, i) => {
|
|
1255
|
+
this._addStickyColumnStyles([footerRow], this._footerRowDefs[i]);
|
|
1256
|
+
});
|
|
1257
|
+
// Reset the dirty state of the sticky input change since it has been used.
|
|
1258
|
+
Array.from(this._columnDefsByName.values()).forEach(def => def.resetStickyChanged());
|
|
1259
|
+
}
|
|
1260
|
+
/**
|
|
1261
|
+
* Get the list of RenderRow objects to render according to the current list of data and defined
|
|
1262
|
+
* row definitions. If the previous list already contained a particular pair, it should be reused
|
|
1263
|
+
* so that the differ equates their references.
|
|
1264
|
+
*/
|
|
1265
|
+
_getAllRenderRows() {
|
|
1266
|
+
const renderRows = [];
|
|
1267
|
+
// Store the cache and create a new one. Any re-used RenderRow objects will be moved into the
|
|
1268
|
+
// new cache while unused ones can be picked up by garbage collection.
|
|
1269
|
+
const prevCachedRenderRows = this._cachedRenderRowsMap;
|
|
1270
|
+
this._cachedRenderRowsMap = new Map();
|
|
1271
|
+
// For each data object, get the list of rows that should be rendered, represented by the
|
|
1272
|
+
// respective `RenderRow` object which is the pair of `data` and `CdkRowDef`.
|
|
1273
|
+
for (let i = 0; i < this._data.length; i++) {
|
|
1274
|
+
let data = this._data[i];
|
|
1275
|
+
const renderRowsForData = this._getRenderRowsForData(data, i, prevCachedRenderRows.get(data));
|
|
1276
|
+
if (!this._cachedRenderRowsMap.has(data)) {
|
|
1277
|
+
this._cachedRenderRowsMap.set(data, new WeakMap());
|
|
1278
|
+
}
|
|
1279
|
+
for (let j = 0; j < renderRowsForData.length; j++) {
|
|
1280
|
+
let renderRow = renderRowsForData[j];
|
|
1281
|
+
const cache = this._cachedRenderRowsMap.get(renderRow.data);
|
|
1282
|
+
if (cache.has(renderRow.rowDef)) {
|
|
1283
|
+
cache.get(renderRow.rowDef).push(renderRow);
|
|
1576
1284
|
}
|
|
1577
1285
|
else {
|
|
1578
|
-
|
|
1286
|
+
cache.set(renderRow.rowDef, [renderRow]);
|
|
1579
1287
|
}
|
|
1288
|
+
renderRows.push(renderRow);
|
|
1580
1289
|
}
|
|
1581
1290
|
}
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1291
|
+
return renderRows;
|
|
1292
|
+
}
|
|
1293
|
+
/**
|
|
1294
|
+
* Gets a list of `RenderRow<T>` for the provided data object and any `CdkRowDef` objects that
|
|
1295
|
+
* should be rendered for this data. Reuses the cached RenderRow objects if they match the same
|
|
1296
|
+
* `(T, CdkRowDef)` pair.
|
|
1297
|
+
*/
|
|
1298
|
+
_getRenderRowsForData(data, dataIndex, cache) {
|
|
1299
|
+
const rowDefs = this._getRowDefs(data, dataIndex);
|
|
1300
|
+
return rowDefs.map(rowDef => {
|
|
1301
|
+
const cachedRenderRows = (cache && cache.has(rowDef)) ? cache.get(rowDef) : [];
|
|
1302
|
+
if (cachedRenderRows.length) {
|
|
1303
|
+
const dataRow = cachedRenderRows.shift();
|
|
1304
|
+
dataRow.dataIndex = dataIndex;
|
|
1305
|
+
return dataRow;
|
|
1586
1306
|
}
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
if (!column) {
|
|
1590
|
-
throw getTableUnknownColumnError(columnId);
|
|
1591
|
-
}
|
|
1592
|
-
return rowDef.extractCellTemplate(column);
|
|
1593
|
-
});
|
|
1594
|
-
}
|
|
1595
|
-
/** Adds native table sections (e.g. tbody) and moves the row outlets into them. */
|
|
1596
|
-
_applyNativeTableSections() {
|
|
1597
|
-
const documentFragment = this._document.createDocumentFragment();
|
|
1598
|
-
const sections = [
|
|
1599
|
-
{ tag: 'thead', outlets: [this._headerRowOutlet] },
|
|
1600
|
-
{ tag: 'tbody', outlets: [this._rowOutlet, this._noDataRowOutlet] },
|
|
1601
|
-
{ tag: 'tfoot', outlets: [this._footerRowOutlet] },
|
|
1602
|
-
];
|
|
1603
|
-
for (const section of sections) {
|
|
1604
|
-
const element = this._document.createElement(section.tag);
|
|
1605
|
-
element.setAttribute('role', 'rowgroup');
|
|
1606
|
-
for (const outlet of section.outlets) {
|
|
1607
|
-
element.appendChild(outlet.elementRef.nativeElement);
|
|
1608
|
-
}
|
|
1609
|
-
documentFragment.appendChild(element);
|
|
1307
|
+
else {
|
|
1308
|
+
return { data, rowDef, dataIndex };
|
|
1610
1309
|
}
|
|
1611
|
-
|
|
1612
|
-
|
|
1310
|
+
});
|
|
1311
|
+
}
|
|
1312
|
+
/** Update the map containing the content's column definitions. */
|
|
1313
|
+
_cacheColumnDefs() {
|
|
1314
|
+
this._columnDefsByName.clear();
|
|
1315
|
+
const columnDefs = mergeArrayAndSet(this._getOwnDefs(this._contentColumnDefs), this._customColumnDefs);
|
|
1316
|
+
columnDefs.forEach(columnDef => {
|
|
1317
|
+
if (this._columnDefsByName.has(columnDef.name)) {
|
|
1318
|
+
throw getTableDuplicateColumnNameError(columnDef.name);
|
|
1319
|
+
}
|
|
1320
|
+
this._columnDefsByName.set(columnDef.name, columnDef);
|
|
1321
|
+
});
|
|
1322
|
+
}
|
|
1323
|
+
/** Update the list of all available row definitions that can be used. */
|
|
1324
|
+
_cacheRowDefs() {
|
|
1325
|
+
this._headerRowDefs = mergeArrayAndSet(this._getOwnDefs(this._contentHeaderRowDefs), this._customHeaderRowDefs);
|
|
1326
|
+
this._footerRowDefs = mergeArrayAndSet(this._getOwnDefs(this._contentFooterRowDefs), this._customFooterRowDefs);
|
|
1327
|
+
this._rowDefs = mergeArrayAndSet(this._getOwnDefs(this._contentRowDefs), this._customRowDefs);
|
|
1328
|
+
// After all row definitions are determined, find the row definition to be considered default.
|
|
1329
|
+
const defaultRowDefs = this._rowDefs.filter(def => !def.when);
|
|
1330
|
+
if (!this.multiTemplateDataRows && defaultRowDefs.length > 1) {
|
|
1331
|
+
throw getTableMultipleDefaultRowDefsError();
|
|
1332
|
+
}
|
|
1333
|
+
this._defaultRowDef = defaultRowDefs[0];
|
|
1334
|
+
}
|
|
1335
|
+
/**
|
|
1336
|
+
* Check if the header, data, or footer rows have changed what columns they want to display or
|
|
1337
|
+
* whether the sticky states have changed for the header or footer. If there is a diff, then
|
|
1338
|
+
* re-render that section.
|
|
1339
|
+
*/
|
|
1340
|
+
_renderUpdatedColumns() {
|
|
1341
|
+
const columnsDiffReducer = (acc, def) => acc || !!def.getColumnsDiff();
|
|
1342
|
+
// Force re-render data rows if the list of column definitions have changed.
|
|
1343
|
+
if (this._rowDefs.reduce(columnsDiffReducer, false)) {
|
|
1344
|
+
this._forceRenderDataRows();
|
|
1613
1345
|
}
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1346
|
+
// Force re-render header/footer rows if the list of column definitions have changed..
|
|
1347
|
+
if (this._headerRowDefs.reduce(columnsDiffReducer, false)) {
|
|
1348
|
+
this._forceRenderHeaderRows();
|
|
1349
|
+
}
|
|
1350
|
+
if (this._footerRowDefs.reduce(columnsDiffReducer, false)) {
|
|
1351
|
+
this._forceRenderFooterRows();
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
/**
|
|
1355
|
+
* Switch to the provided data source by resetting the data and unsubscribing from the current
|
|
1356
|
+
* render change subscription if one exists. If the data source is null, interpret this by
|
|
1357
|
+
* clearing the row outlet. Otherwise start listening for new data.
|
|
1358
|
+
*/
|
|
1359
|
+
_switchDataSource(dataSource) {
|
|
1360
|
+
this._data = [];
|
|
1361
|
+
if (isDataSource(this.dataSource)) {
|
|
1362
|
+
this.dataSource.disconnect(this);
|
|
1363
|
+
}
|
|
1364
|
+
// Stop listening for data from the previous data source.
|
|
1365
|
+
if (this._renderChangeSubscription) {
|
|
1366
|
+
this._renderChangeSubscription.unsubscribe();
|
|
1367
|
+
this._renderChangeSubscription = null;
|
|
1368
|
+
}
|
|
1369
|
+
if (!dataSource) {
|
|
1370
|
+
if (this._dataDiffer) {
|
|
1371
|
+
this._dataDiffer.diff([]);
|
|
1372
|
+
}
|
|
1621
1373
|
this._rowOutlet.viewContainer.clear();
|
|
1374
|
+
}
|
|
1375
|
+
this._dataSource = dataSource;
|
|
1376
|
+
}
|
|
1377
|
+
/** Set up a subscription for the data provided by the data source. */
|
|
1378
|
+
_observeRenderChanges() {
|
|
1379
|
+
// If no data source has been set, there is nothing to observe for changes.
|
|
1380
|
+
if (!this.dataSource) {
|
|
1381
|
+
return;
|
|
1382
|
+
}
|
|
1383
|
+
let dataStream;
|
|
1384
|
+
if (isDataSource(this.dataSource)) {
|
|
1385
|
+
dataStream = this.dataSource.connect(this);
|
|
1386
|
+
}
|
|
1387
|
+
else if (isObservable(this.dataSource)) {
|
|
1388
|
+
dataStream = this.dataSource;
|
|
1389
|
+
}
|
|
1390
|
+
else if (Array.isArray(this.dataSource)) {
|
|
1391
|
+
dataStream = of(this.dataSource);
|
|
1392
|
+
}
|
|
1393
|
+
if (dataStream === undefined) {
|
|
1394
|
+
throw getTableUnknownDataSourceError();
|
|
1395
|
+
}
|
|
1396
|
+
this._renderChangeSubscription = dataStream.pipe(takeUntil(this._onDestroy)).subscribe(data => {
|
|
1397
|
+
this._data = data || [];
|
|
1622
1398
|
this.renderRows();
|
|
1623
|
-
|
|
1399
|
+
});
|
|
1400
|
+
}
|
|
1401
|
+
/**
|
|
1402
|
+
* Clears any existing content in the header row outlet and creates a new embedded view
|
|
1403
|
+
* in the outlet using the header row definition.
|
|
1404
|
+
*/
|
|
1405
|
+
_forceRenderHeaderRows() {
|
|
1406
|
+
// Clear the header row outlet if any content exists.
|
|
1407
|
+
if (this._headerRowOutlet.viewContainer.length > 0) {
|
|
1408
|
+
this._headerRowOutlet.viewContainer.clear();
|
|
1624
1409
|
}
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1410
|
+
this._headerRowDefs.forEach((def, i) => this._renderRow(this._headerRowOutlet, def, i));
|
|
1411
|
+
this.updateStickyHeaderRowStyles();
|
|
1412
|
+
this.updateStickyColumnStyles();
|
|
1413
|
+
}
|
|
1414
|
+
/**
|
|
1415
|
+
* Clears any existing content in the footer row outlet and creates a new embedded view
|
|
1416
|
+
* in the outlet using the footer row definition.
|
|
1417
|
+
*/
|
|
1418
|
+
_forceRenderFooterRows() {
|
|
1419
|
+
// Clear the footer row outlet if any content exists.
|
|
1420
|
+
if (this._footerRowOutlet.viewContainer.length > 0) {
|
|
1421
|
+
this._footerRowOutlet.viewContainer.clear();
|
|
1422
|
+
}
|
|
1423
|
+
this._footerRowDefs.forEach((def, i) => this._renderRow(this._footerRowOutlet, def, i));
|
|
1424
|
+
this.updateStickyFooterRowStyles();
|
|
1425
|
+
this.updateStickyColumnStyles();
|
|
1426
|
+
}
|
|
1427
|
+
/** Adds the sticky column styles for the rows according to the columns' stick states. */
|
|
1428
|
+
_addStickyColumnStyles(rows, rowDef) {
|
|
1429
|
+
const columnDefs = Array.from(rowDef.columns || []).map(columnName => {
|
|
1430
|
+
const columnDef = this._columnDefsByName.get(columnName);
|
|
1431
|
+
if (!columnDef) {
|
|
1432
|
+
throw getTableUnknownColumnError(columnName);
|
|
1433
|
+
}
|
|
1434
|
+
return columnDef;
|
|
1435
|
+
});
|
|
1436
|
+
const stickyStartStates = columnDefs.map(columnDef => columnDef.sticky);
|
|
1437
|
+
const stickyEndStates = columnDefs.map(columnDef => columnDef.stickyEnd);
|
|
1438
|
+
this._stickyStyler.updateStickyColumns(rows, stickyStartStates, stickyEndStates);
|
|
1439
|
+
}
|
|
1440
|
+
/** Gets the list of rows that have been rendered in the row outlet. */
|
|
1441
|
+
_getRenderedRows(rowOutlet) {
|
|
1442
|
+
const renderedRows = [];
|
|
1443
|
+
for (let i = 0; i < rowOutlet.viewContainer.length; i++) {
|
|
1444
|
+
const viewRef = rowOutlet.viewContainer.get(i);
|
|
1445
|
+
renderedRows.push(viewRef.rootNodes[0]);
|
|
1446
|
+
}
|
|
1447
|
+
return renderedRows;
|
|
1448
|
+
}
|
|
1449
|
+
/**
|
|
1450
|
+
* Get the matching row definitions that should be used for this row data. If there is only
|
|
1451
|
+
* one row definition, it is returned. Otherwise, find the row definitions that has a when
|
|
1452
|
+
* predicate that returns true with the data. If none return true, return the default row
|
|
1453
|
+
* definition.
|
|
1454
|
+
*/
|
|
1455
|
+
_getRowDefs(data, dataIndex) {
|
|
1456
|
+
if (this._rowDefs.length == 1) {
|
|
1457
|
+
return [this._rowDefs[0]];
|
|
1458
|
+
}
|
|
1459
|
+
let rowDefs = [];
|
|
1460
|
+
if (this.multiTemplateDataRows) {
|
|
1461
|
+
rowDefs = this._rowDefs.filter(def => !def.when || def.when(dataIndex, data));
|
|
1462
|
+
}
|
|
1463
|
+
else {
|
|
1464
|
+
let rowDef = this._rowDefs.find(def => def.when && def.when(dataIndex, data)) || this._defaultRowDef;
|
|
1465
|
+
if (rowDef) {
|
|
1466
|
+
rowDefs.push(rowDef);
|
|
1639
1467
|
}
|
|
1640
|
-
|
|
1641
|
-
|
|
1468
|
+
}
|
|
1469
|
+
if (!rowDefs.length) {
|
|
1470
|
+
throw getTableMissingMatchingRowDefError(data);
|
|
1471
|
+
}
|
|
1472
|
+
return rowDefs;
|
|
1473
|
+
}
|
|
1474
|
+
/**
|
|
1475
|
+
* Create the embedded view for the data row template and place it in the correct index location
|
|
1476
|
+
* within the data row view container.
|
|
1477
|
+
*/
|
|
1478
|
+
_insertRow(renderRow, renderIndex) {
|
|
1479
|
+
const rowDef = renderRow.rowDef;
|
|
1480
|
+
const context = { $implicit: renderRow.data };
|
|
1481
|
+
this._renderRow(this._rowOutlet, rowDef, renderIndex, context);
|
|
1482
|
+
}
|
|
1483
|
+
/**
|
|
1484
|
+
* Creates a new row template in the outlet and fills it with the set of cell templates.
|
|
1485
|
+
* Optionally takes a context to provide to the row and cells, as well as an optional index
|
|
1486
|
+
* of where to place the new row template in the outlet.
|
|
1487
|
+
*/
|
|
1488
|
+
_renderRow(outlet, rowDef, index, context = {}) {
|
|
1489
|
+
// TODO(andrewseguin): enforce that one outlet was instantiated from createEmbeddedView
|
|
1490
|
+
outlet.viewContainer.createEmbeddedView(rowDef.template, context, index);
|
|
1491
|
+
for (let cellTemplate of this._getCellTemplates(rowDef)) {
|
|
1492
|
+
if (CdkCellOutlet.mostRecentCellOutlet) {
|
|
1493
|
+
CdkCellOutlet.mostRecentCellOutlet._viewContainer.createEmbeddedView(cellTemplate, context);
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
this._changeDetectorRef.markForCheck();
|
|
1497
|
+
}
|
|
1498
|
+
/**
|
|
1499
|
+
* Updates the index-related context for each row to reflect any changes in the index of the rows,
|
|
1500
|
+
* e.g. first/last/even/odd.
|
|
1501
|
+
*/
|
|
1502
|
+
_updateRowIndexContext() {
|
|
1503
|
+
const viewContainer = this._rowOutlet.viewContainer;
|
|
1504
|
+
for (let renderIndex = 0, count = viewContainer.length; renderIndex < count; renderIndex++) {
|
|
1505
|
+
const viewRef = viewContainer.get(renderIndex);
|
|
1506
|
+
const context = viewRef.context;
|
|
1507
|
+
context.count = count;
|
|
1508
|
+
context.first = renderIndex === 0;
|
|
1509
|
+
context.last = renderIndex === count - 1;
|
|
1510
|
+
context.even = renderIndex % 2 === 0;
|
|
1511
|
+
context.odd = !context.even;
|
|
1512
|
+
if (this.multiTemplateDataRows) {
|
|
1513
|
+
context.dataIndex = this._renderRows[renderIndex].dataIndex;
|
|
1514
|
+
context.renderIndex = renderIndex;
|
|
1642
1515
|
}
|
|
1643
|
-
|
|
1644
|
-
this.
|
|
1516
|
+
else {
|
|
1517
|
+
context.index = this._renderRows[renderIndex].dataIndex;
|
|
1645
1518
|
}
|
|
1646
1519
|
}
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1520
|
+
}
|
|
1521
|
+
/** Gets the column definitions for the provided row def. */
|
|
1522
|
+
_getCellTemplates(rowDef) {
|
|
1523
|
+
if (!rowDef || !rowDef.columns) {
|
|
1524
|
+
return [];
|
|
1525
|
+
}
|
|
1526
|
+
return Array.from(rowDef.columns, columnId => {
|
|
1527
|
+
const column = this._columnDefsByName.get(columnId);
|
|
1528
|
+
if (!column) {
|
|
1529
|
+
throw getTableUnknownColumnError(columnId);
|
|
1530
|
+
}
|
|
1531
|
+
return rowDef.extractCellTemplate(column);
|
|
1532
|
+
});
|
|
1533
|
+
}
|
|
1534
|
+
/** Adds native table sections (e.g. tbody) and moves the row outlets into them. */
|
|
1535
|
+
_applyNativeTableSections() {
|
|
1536
|
+
const documentFragment = this._document.createDocumentFragment();
|
|
1537
|
+
const sections = [
|
|
1538
|
+
{ tag: 'thead', outlets: [this._headerRowOutlet] },
|
|
1539
|
+
{ tag: 'tbody', outlets: [this._rowOutlet, this._noDataRowOutlet] },
|
|
1540
|
+
{ tag: 'tfoot', outlets: [this._footerRowOutlet] },
|
|
1541
|
+
];
|
|
1542
|
+
for (const section of sections) {
|
|
1543
|
+
const element = this._document.createElement(section.tag);
|
|
1544
|
+
element.setAttribute('role', 'rowgroup');
|
|
1545
|
+
for (const outlet of section.outlets) {
|
|
1546
|
+
element.appendChild(outlet.elementRef.nativeElement);
|
|
1547
|
+
}
|
|
1548
|
+
documentFragment.appendChild(element);
|
|
1549
|
+
}
|
|
1550
|
+
// Use a DocumentFragment so we don't hit the DOM on each iteration.
|
|
1551
|
+
this._elementRef.nativeElement.appendChild(documentFragment);
|
|
1552
|
+
}
|
|
1553
|
+
/**
|
|
1554
|
+
* Forces a re-render of the data rows. Should be called in cases where there has been an input
|
|
1555
|
+
* change that affects the evaluation of which rows should be rendered, e.g. toggling
|
|
1556
|
+
* `multiTemplateDataRows` or adding/removing row definitions.
|
|
1557
|
+
*/
|
|
1558
|
+
_forceRenderDataRows() {
|
|
1559
|
+
this._dataDiffer.diff([]);
|
|
1560
|
+
this._rowOutlet.viewContainer.clear();
|
|
1561
|
+
this.renderRows();
|
|
1562
|
+
this.updateStickyColumnStyles();
|
|
1563
|
+
}
|
|
1564
|
+
/**
|
|
1565
|
+
* Checks if there has been a change in sticky states since last check and applies the correct
|
|
1566
|
+
* sticky styles. Since checking resets the "dirty" state, this should only be performed once
|
|
1567
|
+
* during a change detection and after the inputs are settled (after content check).
|
|
1568
|
+
*/
|
|
1569
|
+
_checkStickyStates() {
|
|
1570
|
+
const stickyCheckReducer = (acc, d) => {
|
|
1571
|
+
return acc || d.hasStickyChanged();
|
|
1572
|
+
};
|
|
1573
|
+
// Note that the check needs to occur for every definition since it notifies the definition
|
|
1574
|
+
// that it can reset its dirty state. Using another operator like `some` may short-circuit
|
|
1575
|
+
// remaining definitions and leave them in an unchecked state.
|
|
1576
|
+
if (this._headerRowDefs.reduce(stickyCheckReducer, false)) {
|
|
1577
|
+
this.updateStickyHeaderRowStyles();
|
|
1578
|
+
}
|
|
1579
|
+
if (this._footerRowDefs.reduce(stickyCheckReducer, false)) {
|
|
1580
|
+
this.updateStickyFooterRowStyles();
|
|
1581
|
+
}
|
|
1582
|
+
if (Array.from(this._columnDefsByName.values()).reduce(stickyCheckReducer, false)) {
|
|
1583
|
+
this.updateStickyColumnStyles();
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
/**
|
|
1587
|
+
* Creates the sticky styler that will be used for sticky rows and columns. Listens
|
|
1588
|
+
* for directionality changes and provides the latest direction to the styler. Re-applies column
|
|
1589
|
+
* stickiness when directionality changes.
|
|
1590
|
+
*/
|
|
1591
|
+
_setupStickyStyler() {
|
|
1592
|
+
const direction = this._dir ? this._dir.value : 'ltr';
|
|
1593
|
+
this._stickyStyler = new StickyStyler(this._isNativeHtmlTable, this.stickyCssClass, direction, this._platform.isBrowser);
|
|
1594
|
+
(this._dir ? this._dir.change : of())
|
|
1595
|
+
.pipe(takeUntil(this._onDestroy))
|
|
1596
|
+
.subscribe(value => {
|
|
1597
|
+
this._stickyStyler.direction = value;
|
|
1598
|
+
this.updateStickyColumnStyles();
|
|
1599
|
+
});
|
|
1600
|
+
}
|
|
1601
|
+
/** Filters definitions that belong to this table from a QueryList. */
|
|
1602
|
+
_getOwnDefs(items) {
|
|
1603
|
+
return items.filter(item => !item._table || item._table === this);
|
|
1604
|
+
}
|
|
1605
|
+
/** Creates or removes the no data row, depending on whether any data is being shown. */
|
|
1606
|
+
_updateNoDataRow() {
|
|
1607
|
+
if (this._noDataRow) {
|
|
1608
|
+
const shouldShow = this._rowOutlet.viewContainer.length === 0;
|
|
1609
|
+
if (shouldShow !== this._isShowingNoDataRow) {
|
|
1610
|
+
const container = this._noDataRowOutlet.viewContainer;
|
|
1611
|
+
shouldShow ? container.createEmbeddedView(this._noDataRow.templateRef) : container.clear();
|
|
1612
|
+
this._isShowingNoDataRow = shouldShow;
|
|
1675
1613
|
}
|
|
1676
1614
|
}
|
|
1677
1615
|
}
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
}
|
|
1722
|
-
|
|
1723
|
-
})();
|
|
1616
|
+
}
|
|
1617
|
+
CdkTable.decorators = [
|
|
1618
|
+
{ type: Component, args: [{
|
|
1619
|
+
selector: 'cdk-table, table[cdk-table]',
|
|
1620
|
+
exportAs: 'cdkTable',
|
|
1621
|
+
template: CDK_TABLE_TEMPLATE,
|
|
1622
|
+
host: {
|
|
1623
|
+
'class': 'cdk-table',
|
|
1624
|
+
},
|
|
1625
|
+
encapsulation: ViewEncapsulation.None,
|
|
1626
|
+
// The "OnPush" status for the `MatTable` component is effectively a noop, so we are removing it.
|
|
1627
|
+
// The view for `MatTable` consists entirely of templates declared in other views. As they are
|
|
1628
|
+
// declared elsewhere, they are checked when their declaration points are checked.
|
|
1629
|
+
// tslint:disable-next-line:validate-decorators
|
|
1630
|
+
changeDetection: ChangeDetectionStrategy.Default,
|
|
1631
|
+
providers: [{ provide: CDK_TABLE, useExisting: CdkTable }]
|
|
1632
|
+
},] }
|
|
1633
|
+
];
|
|
1634
|
+
CdkTable.ctorParameters = () => [
|
|
1635
|
+
{ type: IterableDiffers },
|
|
1636
|
+
{ type: ChangeDetectorRef },
|
|
1637
|
+
{ type: ElementRef },
|
|
1638
|
+
{ type: String, decorators: [{ type: Attribute, args: ['role',] }] },
|
|
1639
|
+
{ type: Directionality, decorators: [{ type: Optional }] },
|
|
1640
|
+
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
|
|
1641
|
+
{ type: Platform }
|
|
1642
|
+
];
|
|
1643
|
+
CdkTable.propDecorators = {
|
|
1644
|
+
trackBy: [{ type: Input }],
|
|
1645
|
+
dataSource: [{ type: Input }],
|
|
1646
|
+
multiTemplateDataRows: [{ type: Input }],
|
|
1647
|
+
_rowOutlet: [{ type: ViewChild, args: [DataRowOutlet, { static: true },] }],
|
|
1648
|
+
_headerRowOutlet: [{ type: ViewChild, args: [HeaderRowOutlet, { static: true },] }],
|
|
1649
|
+
_footerRowOutlet: [{ type: ViewChild, args: [FooterRowOutlet, { static: true },] }],
|
|
1650
|
+
_noDataRowOutlet: [{ type: ViewChild, args: [NoDataRowOutlet, { static: true },] }],
|
|
1651
|
+
_contentColumnDefs: [{ type: ContentChildren, args: [CdkColumnDef, { descendants: true },] }],
|
|
1652
|
+
_contentRowDefs: [{ type: ContentChildren, args: [CdkRowDef, { descendants: true },] }],
|
|
1653
|
+
_contentHeaderRowDefs: [{ type: ContentChildren, args: [CdkHeaderRowDef, {
|
|
1654
|
+
descendants: true
|
|
1655
|
+
},] }],
|
|
1656
|
+
_contentFooterRowDefs: [{ type: ContentChildren, args: [CdkFooterRowDef, {
|
|
1657
|
+
descendants: true
|
|
1658
|
+
},] }],
|
|
1659
|
+
_noDataRow: [{ type: ContentChild, args: [CdkNoDataRow,] }]
|
|
1660
|
+
};
|
|
1724
1661
|
/** Utility function that gets a merged list of the entries in an array and values of a Set. */
|
|
1725
1662
|
function mergeArrayAndSet(array, set) {
|
|
1726
1663
|
return array.concat(Array.from(set));
|
|
@@ -1742,76 +1679,75 @@ function mergeArrayAndSet(array, set) {
|
|
|
1742
1679
|
* the `dataAccessor` input. Change the text justification to the start or end using the `justify`
|
|
1743
1680
|
* input.
|
|
1744
1681
|
*/
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
this.
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
this._table.addColumnDef(this.columnDef);
|
|
1780
|
-
}
|
|
1781
|
-
else {
|
|
1782
|
-
throw getTableTextColumnMissingParentTableError();
|
|
1783
|
-
}
|
|
1682
|
+
class CdkTextColumn {
|
|
1683
|
+
constructor(_table, _options) {
|
|
1684
|
+
this._table = _table;
|
|
1685
|
+
this._options = _options;
|
|
1686
|
+
/** Alignment of the cell values. */
|
|
1687
|
+
this.justify = 'start';
|
|
1688
|
+
this._options = _options || {};
|
|
1689
|
+
}
|
|
1690
|
+
/** Column name that should be used to reference this column. */
|
|
1691
|
+
get name() {
|
|
1692
|
+
return this._name;
|
|
1693
|
+
}
|
|
1694
|
+
set name(name) {
|
|
1695
|
+
this._name = name;
|
|
1696
|
+
// With Ivy, inputs can be initialized before static query results are
|
|
1697
|
+
// available. In that case, we defer the synchronization until "ngOnInit" fires.
|
|
1698
|
+
this._syncColumnDefName();
|
|
1699
|
+
}
|
|
1700
|
+
ngOnInit() {
|
|
1701
|
+
this._syncColumnDefName();
|
|
1702
|
+
if (this.headerText === undefined) {
|
|
1703
|
+
this.headerText = this._createDefaultHeaderText();
|
|
1704
|
+
}
|
|
1705
|
+
if (!this.dataAccessor) {
|
|
1706
|
+
this.dataAccessor =
|
|
1707
|
+
this._options.defaultDataAccessor || ((data, name) => data[name]);
|
|
1708
|
+
}
|
|
1709
|
+
if (this._table) {
|
|
1710
|
+
// Provide the cell and headerCell directly to the table with the static `ViewChild` query,
|
|
1711
|
+
// since the columnDef will not pick up its content by the time the table finishes checking
|
|
1712
|
+
// its content and initializing the rows.
|
|
1713
|
+
this.columnDef.cell = this.cell;
|
|
1714
|
+
this.columnDef.headerCell = this.headerCell;
|
|
1715
|
+
this._table.addColumnDef(this.columnDef);
|
|
1784
1716
|
}
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
this._table.removeColumnDef(this.columnDef);
|
|
1788
|
-
}
|
|
1717
|
+
else {
|
|
1718
|
+
throw getTableTextColumnMissingParentTableError();
|
|
1789
1719
|
}
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
_createDefaultHeaderText() {
|
|
1795
|
-
const name = this.name;
|
|
1796
|
-
if (isDevMode() && !name) {
|
|
1797
|
-
throw getTableTextColumnMissingNameError();
|
|
1798
|
-
}
|
|
1799
|
-
if (this._options && this._options.defaultHeaderTextTransform) {
|
|
1800
|
-
return this._options.defaultHeaderTextTransform(name);
|
|
1801
|
-
}
|
|
1802
|
-
return name[0].toUpperCase() + name.slice(1);
|
|
1720
|
+
}
|
|
1721
|
+
ngOnDestroy() {
|
|
1722
|
+
if (this._table) {
|
|
1723
|
+
this._table.removeColumnDef(this.columnDef);
|
|
1803
1724
|
}
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1725
|
+
}
|
|
1726
|
+
/**
|
|
1727
|
+
* Creates a default header text. Use the options' header text transformation function if one
|
|
1728
|
+
* has been provided. Otherwise simply capitalize the column name.
|
|
1729
|
+
*/
|
|
1730
|
+
_createDefaultHeaderText() {
|
|
1731
|
+
const name = this.name;
|
|
1732
|
+
if (isDevMode() && !name) {
|
|
1733
|
+
throw getTableTextColumnMissingNameError();
|
|
1734
|
+
}
|
|
1735
|
+
if (this._options && this._options.defaultHeaderTextTransform) {
|
|
1736
|
+
return this._options.defaultHeaderTextTransform(name);
|
|
1809
1737
|
}
|
|
1738
|
+
return name[0].toUpperCase() + name.slice(1);
|
|
1810
1739
|
}
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1740
|
+
/** Synchronizes the column definition name with the text column name. */
|
|
1741
|
+
_syncColumnDefName() {
|
|
1742
|
+
if (this.columnDef) {
|
|
1743
|
+
this.columnDef.name = this.name;
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
}
|
|
1747
|
+
CdkTextColumn.decorators = [
|
|
1748
|
+
{ type: Component, args: [{
|
|
1749
|
+
selector: 'cdk-text-column',
|
|
1750
|
+
template: `
|
|
1815
1751
|
<ng-container cdkColumnDef>
|
|
1816
1752
|
<th cdk-header-cell *cdkHeaderCellDef [style.text-align]="justify">
|
|
1817
1753
|
{{headerText}}
|
|
@@ -1821,31 +1757,29 @@ let CdkTextColumn = /** @class */ (() => {
|
|
|
1821
1757
|
</td>
|
|
1822
1758
|
</ng-container>
|
|
1823
1759
|
`,
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
return CdkTextColumn;
|
|
1848
|
-
})();
|
|
1760
|
+
encapsulation: ViewEncapsulation.None,
|
|
1761
|
+
// Change detection is intentionally not set to OnPush. This component's template will be provided
|
|
1762
|
+
// to the table to be inserted into its view. This is problematic when change detection runs since
|
|
1763
|
+
// the bindings in this template will be evaluated _after_ the table's view is evaluated, which
|
|
1764
|
+
// mean's the template in the table's view will not have the updated value (and in fact will cause
|
|
1765
|
+
// an ExpressionChangedAfterItHasBeenCheckedError).
|
|
1766
|
+
// tslint:disable-next-line:validate-decorators
|
|
1767
|
+
changeDetection: ChangeDetectionStrategy.Default
|
|
1768
|
+
},] }
|
|
1769
|
+
];
|
|
1770
|
+
CdkTextColumn.ctorParameters = () => [
|
|
1771
|
+
{ type: CdkTable, decorators: [{ type: Optional }] },
|
|
1772
|
+
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [TEXT_COLUMN_OPTIONS,] }] }
|
|
1773
|
+
];
|
|
1774
|
+
CdkTextColumn.propDecorators = {
|
|
1775
|
+
name: [{ type: Input }],
|
|
1776
|
+
headerText: [{ type: Input }],
|
|
1777
|
+
dataAccessor: [{ type: Input }],
|
|
1778
|
+
justify: [{ type: Input }],
|
|
1779
|
+
columnDef: [{ type: ViewChild, args: [CdkColumnDef, { static: true },] }],
|
|
1780
|
+
cell: [{ type: ViewChild, args: [CdkCellDef, { static: true },] }],
|
|
1781
|
+
headerCell: [{ type: ViewChild, args: [CdkHeaderCellDef, { static: true },] }]
|
|
1782
|
+
};
|
|
1849
1783
|
|
|
1850
1784
|
/**
|
|
1851
1785
|
* @license
|
|
@@ -1877,17 +1811,14 @@ const EXPORTED_DECLARATIONS = [
|
|
|
1877
1811
|
CdkNoDataRow,
|
|
1878
1812
|
NoDataRowOutlet,
|
|
1879
1813
|
];
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
];
|
|
1889
|
-
return CdkTableModule;
|
|
1890
|
-
})();
|
|
1814
|
+
class CdkTableModule {
|
|
1815
|
+
}
|
|
1816
|
+
CdkTableModule.decorators = [
|
|
1817
|
+
{ type: NgModule, args: [{
|
|
1818
|
+
exports: EXPORTED_DECLARATIONS,
|
|
1819
|
+
declarations: EXPORTED_DECLARATIONS
|
|
1820
|
+
},] }
|
|
1821
|
+
];
|
|
1891
1822
|
|
|
1892
1823
|
/**
|
|
1893
1824
|
* @license
|