@angular/cdk 21.0.0-next.8 → 21.0.0-rc.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/_adev_assets/cdk_drag_drop.json +13 -12
- package/_adev_assets/cdk_testing.json +15 -25
- package/_adev_assets/cdk_testing_protractor.json +1 -1
- package/_adev_assets/cdk_testing_selenium_webdriver.json +1 -1
- package/_adev_assets/cdk_testing_testbed.json +1 -1
- package/fesm2022/_a11y-module-chunk.mjs +755 -869
- package/fesm2022/_a11y-module-chunk.mjs.map +1 -1
- package/fesm2022/_activedescendant-key-manager-chunk.mjs +8 -8
- package/fesm2022/_activedescendant-key-manager-chunk.mjs.map +1 -1
- package/fesm2022/_array-chunk.mjs +1 -1
- package/fesm2022/_array-chunk.mjs.map +1 -1
- package/fesm2022/_breakpoints-observer-chunk.mjs +149 -152
- package/fesm2022/_breakpoints-observer-chunk.mjs.map +1 -1
- package/fesm2022/_css-pixel-value-chunk.mjs +4 -5
- package/fesm2022/_css-pixel-value-chunk.mjs.map +1 -1
- package/fesm2022/_data-source-chunk.mjs +2 -8
- package/fesm2022/_data-source-chunk.mjs.map +1 -1
- package/fesm2022/_directionality-chunk.mjs +54 -54
- package/fesm2022/_directionality-chunk.mjs.map +1 -1
- package/fesm2022/_dispose-view-repeater-strategy-chunk.mjs +25 -36
- package/fesm2022/_dispose-view-repeater-strategy-chunk.mjs.map +1 -1
- package/fesm2022/_element-chunk.mjs +6 -17
- package/fesm2022/_element-chunk.mjs.map +1 -1
- package/fesm2022/_fake-event-detection-chunk.mjs +3 -17
- package/fesm2022/_fake-event-detection-chunk.mjs.map +1 -1
- package/fesm2022/_focus-key-manager-chunk.mjs +10 -14
- package/fesm2022/_focus-key-manager-chunk.mjs.map +1 -1
- package/fesm2022/_focus-monitor-chunk.mjs +376 -566
- package/fesm2022/_focus-monitor-chunk.mjs.map +1 -1
- package/fesm2022/_id-generator-chunk.mjs +36 -27
- package/fesm2022/_id-generator-chunk.mjs.map +1 -1
- package/fesm2022/_keycodes-chunk.mjs +9 -9
- package/fesm2022/_keycodes-chunk.mjs.map +1 -1
- package/fesm2022/_list-key-manager-chunk.mjs +248 -336
- package/fesm2022/_list-key-manager-chunk.mjs.map +1 -1
- package/fesm2022/_overlay-module-chunk.mjs +2534 -2948
- package/fesm2022/_overlay-module-chunk.mjs.map +1 -1
- package/fesm2022/_passive-listeners-chunk.mjs +10 -22
- package/fesm2022/_passive-listeners-chunk.mjs.map +1 -1
- package/fesm2022/_platform-chunk.mjs +42 -65
- package/fesm2022/_platform-chunk.mjs.map +1 -1
- package/fesm2022/_recycle-view-repeater-strategy-chunk.mjs +78 -134
- package/fesm2022/_recycle-view-repeater-strategy-chunk.mjs.map +1 -1
- package/fesm2022/_scrolling-chunk.mjs +44 -85
- package/fesm2022/_scrolling-chunk.mjs.map +1 -1
- package/fesm2022/_selection-model-chunk.mjs +138 -209
- package/fesm2022/_selection-model-chunk.mjs.map +1 -1
- package/fesm2022/_shadow-dom-chunk.mjs +21 -35
- package/fesm2022/_shadow-dom-chunk.mjs.map +1 -1
- package/fesm2022/_style-loader-chunk.mjs +50 -37
- package/fesm2022/_style-loader-chunk.mjs.map +1 -1
- package/fesm2022/_test-environment-chunk.mjs +2 -14
- package/fesm2022/_test-environment-chunk.mjs.map +1 -1
- package/fesm2022/_tree-key-manager-chunk.mjs +229 -308
- package/fesm2022/_tree-key-manager-chunk.mjs.map +1 -1
- package/fesm2022/_typeahead-chunk.mjs +52 -74
- package/fesm2022/_typeahead-chunk.mjs.map +1 -1
- package/fesm2022/_unique-selection-dispatcher-chunk.mjs +43 -40
- package/fesm2022/_unique-selection-dispatcher-chunk.mjs.map +1 -1
- package/fesm2022/a11y.mjs +351 -449
- package/fesm2022/a11y.mjs.map +1 -1
- package/fesm2022/accordion.mjs +254 -192
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/bidi.mjs +121 -64
- package/fesm2022/bidi.mjs.map +1 -1
- package/fesm2022/cdk.mjs +1 -2
- package/fesm2022/cdk.mjs.map +1 -1
- package/fesm2022/clipboard.mjs +208 -186
- package/fesm2022/clipboard.mjs.map +1 -1
- package/fesm2022/coercion-private.mjs +4 -8
- package/fesm2022/coercion-private.mjs.map +1 -1
- package/fesm2022/coercion.mjs +11 -29
- package/fesm2022/coercion.mjs.map +1 -1
- package/fesm2022/dialog.mjs +660 -808
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/drag-drop.mjs +3347 -4286
- package/fesm2022/drag-drop.mjs.map +1 -1
- package/fesm2022/keycodes.mjs +4 -8
- package/fesm2022/keycodes.mjs.map +1 -1
- package/fesm2022/layout.mjs +44 -26
- package/fesm2022/layout.mjs.map +1 -1
- package/fesm2022/listbox.mjs +841 -895
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu.mjs +1942 -1858
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/observers-private.mjs +88 -106
- package/fesm2022/observers-private.mjs.map +1 -1
- package/fesm2022/observers.mjs +262 -184
- package/fesm2022/observers.mjs.map +1 -1
- package/fesm2022/overlay.mjs +72 -68
- package/fesm2022/overlay.mjs.map +1 -1
- package/fesm2022/platform.mjs +43 -54
- package/fesm2022/platform.mjs.map +1 -1
- package/fesm2022/portal.mjs +402 -560
- package/fesm2022/portal.mjs.map +1 -1
- package/fesm2022/private.mjs +38 -10
- package/fesm2022/private.mjs.map +1 -1
- package/fesm2022/scrolling.mjs +1323 -1400
- package/fesm2022/scrolling.mjs.map +1 -1
- package/fesm2022/stepper.mjs +758 -590
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table.mjs +2327 -2319
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/testing-selenium-webdriver.mjs +252 -325
- package/fesm2022/testing-selenium-webdriver.mjs.map +1 -1
- package/fesm2022/testing-testbed.mjs +592 -709
- package/fesm2022/testing-testbed.mjs.map +1 -1
- package/fesm2022/testing.mjs +368 -889
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/text-field.mjs +459 -388
- package/fesm2022/text-field.mjs.map +1 -1
- package/fesm2022/tree.mjs +1483 -1731
- package/fesm2022/tree.mjs.map +1 -1
- package/overlay/_index.scss +28 -0
- package/overlay-prebuilt.css +1 -1
- package/package.json +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/types/_harness-environment-chunk.d.ts +1 -2
- package/types/_overlay-module-chunk.d.ts +59 -7
- package/types/_portal-directives-chunk.d.ts +2 -18
- package/types/accordion.d.ts +3 -1
- package/types/dialog.d.ts +1 -1
- package/types/overlay.d.ts +6 -2
- package/types/portal.d.ts +1 -1
package/fesm2022/table.mjs
CHANGED
|
@@ -14,2133 +14,2088 @@ import './_element-chunk.mjs';
|
|
|
14
14
|
import './_scrolling-chunk.mjs';
|
|
15
15
|
import './bidi.mjs';
|
|
16
16
|
|
|
17
|
-
/**
|
|
18
|
-
* Used to provide a table to some of the sub-components without causing a circular dependency.
|
|
19
|
-
* @docs-private
|
|
20
|
-
*/
|
|
21
17
|
const CDK_TABLE = new InjectionToken('CDK_TABLE');
|
|
22
|
-
/** Injection token that can be used to specify the text column options. */
|
|
23
18
|
const TEXT_COLUMN_OPTIONS = new InjectionToken('text-column-options');
|
|
24
19
|
|
|
25
|
-
/**
|
|
26
|
-
* Cell definition for a CDK table.
|
|
27
|
-
* Captures the template of a column's data row cell as well as cell-specific properties.
|
|
28
|
-
*/
|
|
29
20
|
class CdkCellDef {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
template = inject(TemplateRef);
|
|
22
|
+
constructor() {}
|
|
23
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
24
|
+
minVersion: "12.0.0",
|
|
25
|
+
version: "20.2.0-next.2",
|
|
26
|
+
ngImport: i0,
|
|
27
|
+
type: CdkCellDef,
|
|
28
|
+
deps: [],
|
|
29
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
30
|
+
});
|
|
31
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
32
|
+
minVersion: "14.0.0",
|
|
33
|
+
version: "20.2.0-next.2",
|
|
34
|
+
type: CdkCellDef,
|
|
35
|
+
isStandalone: true,
|
|
36
|
+
selector: "[cdkCellDef]",
|
|
37
|
+
ngImport: i0
|
|
38
|
+
});
|
|
35
39
|
}
|
|
36
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
41
|
+
minVersion: "12.0.0",
|
|
42
|
+
version: "20.2.0-next.2",
|
|
43
|
+
ngImport: i0,
|
|
44
|
+
type: CdkCellDef,
|
|
45
|
+
decorators: [{
|
|
46
|
+
type: Directive,
|
|
47
|
+
args: [{
|
|
48
|
+
selector: '[cdkCellDef]'
|
|
49
|
+
}]
|
|
50
|
+
}],
|
|
51
|
+
ctorParameters: () => []
|
|
52
|
+
});
|
|
46
53
|
class CdkHeaderCellDef {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
template = inject(TemplateRef);
|
|
55
|
+
constructor() {}
|
|
56
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
57
|
+
minVersion: "12.0.0",
|
|
58
|
+
version: "20.2.0-next.2",
|
|
59
|
+
ngImport: i0,
|
|
60
|
+
type: CdkHeaderCellDef,
|
|
61
|
+
deps: [],
|
|
62
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
63
|
+
});
|
|
64
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
65
|
+
minVersion: "14.0.0",
|
|
66
|
+
version: "20.2.0-next.2",
|
|
67
|
+
type: CdkHeaderCellDef,
|
|
68
|
+
isStandalone: true,
|
|
69
|
+
selector: "[cdkHeaderCellDef]",
|
|
70
|
+
ngImport: i0
|
|
71
|
+
});
|
|
52
72
|
}
|
|
53
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
73
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
74
|
+
minVersion: "12.0.0",
|
|
75
|
+
version: "20.2.0-next.2",
|
|
76
|
+
ngImport: i0,
|
|
77
|
+
type: CdkHeaderCellDef,
|
|
78
|
+
decorators: [{
|
|
79
|
+
type: Directive,
|
|
80
|
+
args: [{
|
|
81
|
+
selector: '[cdkHeaderCellDef]'
|
|
82
|
+
}]
|
|
83
|
+
}],
|
|
84
|
+
ctorParameters: () => []
|
|
85
|
+
});
|
|
63
86
|
class CdkFooterCellDef {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
87
|
+
template = inject(TemplateRef);
|
|
88
|
+
constructor() {}
|
|
89
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
90
|
+
minVersion: "12.0.0",
|
|
91
|
+
version: "20.2.0-next.2",
|
|
92
|
+
ngImport: i0,
|
|
93
|
+
type: CdkFooterCellDef,
|
|
94
|
+
deps: [],
|
|
95
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
96
|
+
});
|
|
97
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
98
|
+
minVersion: "14.0.0",
|
|
99
|
+
version: "20.2.0-next.2",
|
|
100
|
+
type: CdkFooterCellDef,
|
|
101
|
+
isStandalone: true,
|
|
102
|
+
selector: "[cdkFooterCellDef]",
|
|
103
|
+
ngImport: i0
|
|
104
|
+
});
|
|
69
105
|
}
|
|
70
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
106
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
107
|
+
minVersion: "12.0.0",
|
|
108
|
+
version: "20.2.0-next.2",
|
|
109
|
+
ngImport: i0,
|
|
110
|
+
type: CdkFooterCellDef,
|
|
111
|
+
decorators: [{
|
|
112
|
+
type: Directive,
|
|
113
|
+
args: [{
|
|
114
|
+
selector: '[cdkFooterCellDef]'
|
|
115
|
+
}]
|
|
116
|
+
}],
|
|
117
|
+
ctorParameters: () => []
|
|
118
|
+
});
|
|
80
119
|
class CdkColumnDef {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
120
|
+
_table = inject(CDK_TABLE, {
|
|
121
|
+
optional: true
|
|
122
|
+
});
|
|
123
|
+
_hasStickyChanged = false;
|
|
124
|
+
get name() {
|
|
125
|
+
return this._name;
|
|
126
|
+
}
|
|
127
|
+
set name(name) {
|
|
128
|
+
this._setNameInput(name);
|
|
129
|
+
}
|
|
130
|
+
_name;
|
|
131
|
+
get sticky() {
|
|
132
|
+
return this._sticky;
|
|
133
|
+
}
|
|
134
|
+
set sticky(value) {
|
|
135
|
+
if (value !== this._sticky) {
|
|
136
|
+
this._sticky = value;
|
|
137
|
+
this._hasStickyChanged = true;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
_sticky = false;
|
|
141
|
+
get stickyEnd() {
|
|
142
|
+
return this._stickyEnd;
|
|
143
|
+
}
|
|
144
|
+
set stickyEnd(value) {
|
|
145
|
+
if (value !== this._stickyEnd) {
|
|
146
|
+
this._stickyEnd = value;
|
|
147
|
+
this._hasStickyChanged = true;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
_stickyEnd = false;
|
|
151
|
+
cell;
|
|
152
|
+
headerCell;
|
|
153
|
+
footerCell;
|
|
154
|
+
cssClassFriendlyName;
|
|
155
|
+
_columnCssClassName;
|
|
156
|
+
constructor() {}
|
|
157
|
+
hasStickyChanged() {
|
|
158
|
+
const hasStickyChanged = this._hasStickyChanged;
|
|
159
|
+
this.resetStickyChanged();
|
|
160
|
+
return hasStickyChanged;
|
|
161
|
+
}
|
|
162
|
+
resetStickyChanged() {
|
|
163
|
+
this._hasStickyChanged = false;
|
|
164
|
+
}
|
|
165
|
+
_updateColumnCssClassName() {
|
|
166
|
+
this._columnCssClassName = [`cdk-column-${this.cssClassFriendlyName}`];
|
|
167
|
+
}
|
|
168
|
+
_setNameInput(value) {
|
|
169
|
+
if (value) {
|
|
170
|
+
this._name = value;
|
|
171
|
+
this.cssClassFriendlyName = value.replace(/[^a-z0-9_-]/gi, '-');
|
|
172
|
+
this._updateColumnCssClassName();
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
176
|
+
minVersion: "12.0.0",
|
|
177
|
+
version: "20.2.0-next.2",
|
|
178
|
+
ngImport: i0,
|
|
179
|
+
type: CdkColumnDef,
|
|
180
|
+
deps: [],
|
|
181
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
182
|
+
});
|
|
183
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
184
|
+
minVersion: "16.1.0",
|
|
185
|
+
version: "20.2.0-next.2",
|
|
186
|
+
type: CdkColumnDef,
|
|
187
|
+
isStandalone: true,
|
|
188
|
+
selector: "[cdkColumnDef]",
|
|
189
|
+
inputs: {
|
|
190
|
+
name: ["cdkColumnDef", "name"],
|
|
191
|
+
sticky: ["sticky", "sticky", booleanAttribute],
|
|
192
|
+
stickyEnd: ["stickyEnd", "stickyEnd", booleanAttribute]
|
|
193
|
+
},
|
|
194
|
+
providers: [{
|
|
195
|
+
provide: 'MAT_SORT_HEADER_COLUMN_DEF',
|
|
196
|
+
useExisting: CdkColumnDef
|
|
197
|
+
}],
|
|
198
|
+
queries: [{
|
|
199
|
+
propertyName: "cell",
|
|
200
|
+
first: true,
|
|
201
|
+
predicate: CdkCellDef,
|
|
202
|
+
descendants: true
|
|
203
|
+
}, {
|
|
204
|
+
propertyName: "headerCell",
|
|
205
|
+
first: true,
|
|
206
|
+
predicate: CdkHeaderCellDef,
|
|
207
|
+
descendants: true
|
|
208
|
+
}, {
|
|
209
|
+
propertyName: "footerCell",
|
|
210
|
+
first: true,
|
|
211
|
+
predicate: CdkFooterCellDef,
|
|
212
|
+
descendants: true
|
|
213
|
+
}],
|
|
214
|
+
ngImport: i0
|
|
215
|
+
});
|
|
172
216
|
}
|
|
173
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
217
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
218
|
+
minVersion: "12.0.0",
|
|
219
|
+
version: "20.2.0-next.2",
|
|
220
|
+
ngImport: i0,
|
|
221
|
+
type: CdkColumnDef,
|
|
222
|
+
decorators: [{
|
|
223
|
+
type: Directive,
|
|
224
|
+
args: [{
|
|
225
|
+
selector: '[cdkColumnDef]',
|
|
226
|
+
providers: [{
|
|
227
|
+
provide: 'MAT_SORT_HEADER_COLUMN_DEF',
|
|
228
|
+
useExisting: CdkColumnDef
|
|
229
|
+
}]
|
|
230
|
+
}]
|
|
231
|
+
}],
|
|
232
|
+
ctorParameters: () => [],
|
|
233
|
+
propDecorators: {
|
|
234
|
+
name: [{
|
|
235
|
+
type: Input,
|
|
236
|
+
args: ['cdkColumnDef']
|
|
237
|
+
}],
|
|
238
|
+
sticky: [{
|
|
239
|
+
type: Input,
|
|
240
|
+
args: [{
|
|
241
|
+
transform: booleanAttribute
|
|
242
|
+
}]
|
|
243
|
+
}],
|
|
244
|
+
stickyEnd: [{
|
|
245
|
+
type: Input,
|
|
246
|
+
args: [{
|
|
247
|
+
transform: booleanAttribute
|
|
248
|
+
}]
|
|
249
|
+
}],
|
|
250
|
+
cell: [{
|
|
251
|
+
type: ContentChild,
|
|
252
|
+
args: [CdkCellDef]
|
|
253
|
+
}],
|
|
254
|
+
headerCell: [{
|
|
255
|
+
type: ContentChild,
|
|
256
|
+
args: [CdkHeaderCellDef]
|
|
257
|
+
}],
|
|
258
|
+
footerCell: [{
|
|
259
|
+
type: ContentChild,
|
|
260
|
+
args: [CdkFooterCellDef]
|
|
261
|
+
}]
|
|
262
|
+
}
|
|
263
|
+
});
|
|
199
264
|
class BaseCdkCell {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
265
|
+
constructor(columnDef, elementRef) {
|
|
266
|
+
elementRef.nativeElement.classList.add(...columnDef._columnCssClassName);
|
|
267
|
+
}
|
|
203
268
|
}
|
|
204
|
-
/** Header cell template container that adds the right classes and role. */
|
|
205
269
|
class CdkHeaderCell extends BaseCdkCell {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
270
|
+
constructor() {
|
|
271
|
+
super(inject(CdkColumnDef), inject(ElementRef));
|
|
272
|
+
}
|
|
273
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
274
|
+
minVersion: "12.0.0",
|
|
275
|
+
version: "20.2.0-next.2",
|
|
276
|
+
ngImport: i0,
|
|
277
|
+
type: CdkHeaderCell,
|
|
278
|
+
deps: [],
|
|
279
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
280
|
+
});
|
|
281
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
282
|
+
minVersion: "14.0.0",
|
|
283
|
+
version: "20.2.0-next.2",
|
|
284
|
+
type: CdkHeaderCell,
|
|
285
|
+
isStandalone: true,
|
|
286
|
+
selector: "cdk-header-cell, th[cdk-header-cell]",
|
|
287
|
+
host: {
|
|
288
|
+
attributes: {
|
|
289
|
+
"role": "columnheader"
|
|
290
|
+
},
|
|
291
|
+
classAttribute: "cdk-header-cell"
|
|
292
|
+
},
|
|
293
|
+
usesInheritance: true,
|
|
294
|
+
ngImport: i0
|
|
295
|
+
});
|
|
211
296
|
}
|
|
212
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
297
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
298
|
+
minVersion: "12.0.0",
|
|
299
|
+
version: "20.2.0-next.2",
|
|
300
|
+
ngImport: i0,
|
|
301
|
+
type: CdkHeaderCell,
|
|
302
|
+
decorators: [{
|
|
303
|
+
type: Directive,
|
|
304
|
+
args: [{
|
|
305
|
+
selector: 'cdk-header-cell, th[cdk-header-cell]',
|
|
306
|
+
host: {
|
|
307
|
+
'class': 'cdk-header-cell',
|
|
308
|
+
'role': 'columnheader'
|
|
309
|
+
}
|
|
310
|
+
}]
|
|
311
|
+
}],
|
|
312
|
+
ctorParameters: () => []
|
|
313
|
+
});
|
|
223
314
|
class CdkFooterCell extends BaseCdkCell {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
315
|
+
constructor() {
|
|
316
|
+
const columnDef = inject(CdkColumnDef);
|
|
317
|
+
const elementRef = inject(ElementRef);
|
|
318
|
+
super(columnDef, elementRef);
|
|
319
|
+
const role = columnDef._table?._getCellRole();
|
|
320
|
+
if (role) {
|
|
321
|
+
elementRef.nativeElement.setAttribute('role', role);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
325
|
+
minVersion: "12.0.0",
|
|
326
|
+
version: "20.2.0-next.2",
|
|
327
|
+
ngImport: i0,
|
|
328
|
+
type: CdkFooterCell,
|
|
329
|
+
deps: [],
|
|
330
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
331
|
+
});
|
|
332
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
333
|
+
minVersion: "14.0.0",
|
|
334
|
+
version: "20.2.0-next.2",
|
|
335
|
+
type: CdkFooterCell,
|
|
336
|
+
isStandalone: true,
|
|
337
|
+
selector: "cdk-footer-cell, td[cdk-footer-cell]",
|
|
338
|
+
host: {
|
|
339
|
+
classAttribute: "cdk-footer-cell"
|
|
340
|
+
},
|
|
341
|
+
usesInheritance: true,
|
|
342
|
+
ngImport: i0
|
|
343
|
+
});
|
|
235
344
|
}
|
|
236
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
345
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
346
|
+
minVersion: "12.0.0",
|
|
347
|
+
version: "20.2.0-next.2",
|
|
348
|
+
ngImport: i0,
|
|
349
|
+
type: CdkFooterCell,
|
|
350
|
+
decorators: [{
|
|
351
|
+
type: Directive,
|
|
352
|
+
args: [{
|
|
353
|
+
selector: 'cdk-footer-cell, td[cdk-footer-cell]',
|
|
354
|
+
host: {
|
|
355
|
+
'class': 'cdk-footer-cell'
|
|
356
|
+
}
|
|
357
|
+
}]
|
|
358
|
+
}],
|
|
359
|
+
ctorParameters: () => []
|
|
360
|
+
});
|
|
246
361
|
class CdkCell extends BaseCdkCell {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
362
|
+
constructor() {
|
|
363
|
+
const columnDef = inject(CdkColumnDef);
|
|
364
|
+
const elementRef = inject(ElementRef);
|
|
365
|
+
super(columnDef, elementRef);
|
|
366
|
+
const role = columnDef._table?._getCellRole();
|
|
367
|
+
if (role) {
|
|
368
|
+
elementRef.nativeElement.setAttribute('role', role);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
372
|
+
minVersion: "12.0.0",
|
|
373
|
+
version: "20.2.0-next.2",
|
|
374
|
+
ngImport: i0,
|
|
375
|
+
type: CdkCell,
|
|
376
|
+
deps: [],
|
|
377
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
378
|
+
});
|
|
379
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
380
|
+
minVersion: "14.0.0",
|
|
381
|
+
version: "20.2.0-next.2",
|
|
382
|
+
type: CdkCell,
|
|
383
|
+
isStandalone: true,
|
|
384
|
+
selector: "cdk-cell, td[cdk-cell]",
|
|
385
|
+
host: {
|
|
386
|
+
classAttribute: "cdk-cell"
|
|
387
|
+
},
|
|
388
|
+
usesInheritance: true,
|
|
389
|
+
ngImport: i0
|
|
390
|
+
});
|
|
258
391
|
}
|
|
259
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
392
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
393
|
+
minVersion: "12.0.0",
|
|
394
|
+
version: "20.2.0-next.2",
|
|
395
|
+
ngImport: i0,
|
|
396
|
+
type: CdkCell,
|
|
397
|
+
decorators: [{
|
|
398
|
+
type: Directive,
|
|
399
|
+
args: [{
|
|
400
|
+
selector: 'cdk-cell, td[cdk-cell]',
|
|
401
|
+
host: {
|
|
402
|
+
'class': 'cdk-cell'
|
|
403
|
+
}
|
|
404
|
+
}]
|
|
405
|
+
}],
|
|
406
|
+
ctorParameters: () => []
|
|
407
|
+
});
|
|
268
408
|
|
|
269
|
-
/**
|
|
270
|
-
* The row template that can be used by the mat-table. Should not be used outside of the
|
|
271
|
-
* material library.
|
|
272
|
-
*/
|
|
273
409
|
const CDK_ROW_TEMPLATE = `<ng-container cdkCellOutlet></ng-container>`;
|
|
274
|
-
/**
|
|
275
|
-
* Base class for the CdkHeaderRowDef and CdkRowDef that handles checking their columns inputs
|
|
276
|
-
* for changes and notifying the table.
|
|
277
|
-
*/
|
|
278
410
|
class BaseRowDef {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
411
|
+
template = inject(TemplateRef);
|
|
412
|
+
_differs = inject(IterableDiffers);
|
|
413
|
+
columns;
|
|
414
|
+
_columnsDiffer;
|
|
415
|
+
constructor() {}
|
|
416
|
+
ngOnChanges(changes) {
|
|
417
|
+
if (!this._columnsDiffer) {
|
|
418
|
+
const columns = changes['columns'] && changes['columns'].currentValue || [];
|
|
419
|
+
this._columnsDiffer = this._differs.find(columns).create();
|
|
420
|
+
this._columnsDiffer.diff(columns);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
getColumnsDiff() {
|
|
424
|
+
return this._columnsDiffer.diff(this.columns);
|
|
425
|
+
}
|
|
426
|
+
extractCellTemplate(column) {
|
|
427
|
+
if (this instanceof CdkHeaderRowDef) {
|
|
428
|
+
return column.headerCell.template;
|
|
429
|
+
}
|
|
430
|
+
if (this instanceof CdkFooterRowDef) {
|
|
431
|
+
return column.footerCell.template;
|
|
432
|
+
} else {
|
|
433
|
+
return column.cell.template;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
437
|
+
minVersion: "12.0.0",
|
|
438
|
+
version: "20.2.0-next.2",
|
|
439
|
+
ngImport: i0,
|
|
440
|
+
type: BaseRowDef,
|
|
441
|
+
deps: [],
|
|
442
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
443
|
+
});
|
|
444
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
445
|
+
minVersion: "14.0.0",
|
|
446
|
+
version: "20.2.0-next.2",
|
|
447
|
+
type: BaseRowDef,
|
|
448
|
+
isStandalone: true,
|
|
449
|
+
usesOnChanges: true,
|
|
450
|
+
ngImport: i0
|
|
451
|
+
});
|
|
316
452
|
}
|
|
317
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
453
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
454
|
+
minVersion: "12.0.0",
|
|
455
|
+
version: "20.2.0-next.2",
|
|
456
|
+
ngImport: i0,
|
|
457
|
+
type: BaseRowDef,
|
|
458
|
+
decorators: [{
|
|
459
|
+
type: Directive
|
|
460
|
+
}],
|
|
461
|
+
ctorParameters: () => []
|
|
462
|
+
});
|
|
324
463
|
class CdkHeaderRowDef extends BaseRowDef {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
ngOnChanges(changes)
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
464
|
+
_table = inject(CDK_TABLE, {
|
|
465
|
+
optional: true
|
|
466
|
+
});
|
|
467
|
+
_hasStickyChanged = false;
|
|
468
|
+
get sticky() {
|
|
469
|
+
return this._sticky;
|
|
470
|
+
}
|
|
471
|
+
set sticky(value) {
|
|
472
|
+
if (value !== this._sticky) {
|
|
473
|
+
this._sticky = value;
|
|
474
|
+
this._hasStickyChanged = true;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
_sticky = false;
|
|
478
|
+
constructor() {
|
|
479
|
+
super(inject(TemplateRef), inject(IterableDiffers));
|
|
480
|
+
}
|
|
481
|
+
ngOnChanges(changes) {
|
|
482
|
+
super.ngOnChanges(changes);
|
|
483
|
+
}
|
|
484
|
+
hasStickyChanged() {
|
|
485
|
+
const hasStickyChanged = this._hasStickyChanged;
|
|
486
|
+
this.resetStickyChanged();
|
|
487
|
+
return hasStickyChanged;
|
|
488
|
+
}
|
|
489
|
+
resetStickyChanged() {
|
|
490
|
+
this._hasStickyChanged = false;
|
|
491
|
+
}
|
|
492
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
493
|
+
minVersion: "12.0.0",
|
|
494
|
+
version: "20.2.0-next.2",
|
|
495
|
+
ngImport: i0,
|
|
496
|
+
type: CdkHeaderRowDef,
|
|
497
|
+
deps: [],
|
|
498
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
499
|
+
});
|
|
500
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
501
|
+
minVersion: "16.1.0",
|
|
502
|
+
version: "20.2.0-next.2",
|
|
503
|
+
type: CdkHeaderRowDef,
|
|
504
|
+
isStandalone: true,
|
|
505
|
+
selector: "[cdkHeaderRowDef]",
|
|
506
|
+
inputs: {
|
|
507
|
+
columns: ["cdkHeaderRowDef", "columns"],
|
|
508
|
+
sticky: ["cdkHeaderRowDefSticky", "sticky", booleanAttribute]
|
|
509
|
+
},
|
|
510
|
+
usesInheritance: true,
|
|
511
|
+
usesOnChanges: true,
|
|
512
|
+
ngImport: i0
|
|
513
|
+
});
|
|
358
514
|
}
|
|
359
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
515
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
516
|
+
minVersion: "12.0.0",
|
|
517
|
+
version: "20.2.0-next.2",
|
|
518
|
+
ngImport: i0,
|
|
519
|
+
type: CdkHeaderRowDef,
|
|
520
|
+
decorators: [{
|
|
521
|
+
type: Directive,
|
|
522
|
+
args: [{
|
|
523
|
+
selector: '[cdkHeaderRowDef]',
|
|
524
|
+
inputs: [{
|
|
525
|
+
name: 'columns',
|
|
526
|
+
alias: 'cdkHeaderRowDef'
|
|
527
|
+
}]
|
|
528
|
+
}]
|
|
529
|
+
}],
|
|
530
|
+
ctorParameters: () => [],
|
|
531
|
+
propDecorators: {
|
|
532
|
+
sticky: [{
|
|
533
|
+
type: Input,
|
|
534
|
+
args: [{
|
|
535
|
+
alias: 'cdkHeaderRowDefSticky',
|
|
536
|
+
transform: booleanAttribute
|
|
537
|
+
}]
|
|
538
|
+
}]
|
|
539
|
+
}
|
|
540
|
+
});
|
|
373
541
|
class CdkFooterRowDef extends BaseRowDef {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
ngOnChanges(changes)
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
542
|
+
_table = inject(CDK_TABLE, {
|
|
543
|
+
optional: true
|
|
544
|
+
});
|
|
545
|
+
_hasStickyChanged = false;
|
|
546
|
+
get sticky() {
|
|
547
|
+
return this._sticky;
|
|
548
|
+
}
|
|
549
|
+
set sticky(value) {
|
|
550
|
+
if (value !== this._sticky) {
|
|
551
|
+
this._sticky = value;
|
|
552
|
+
this._hasStickyChanged = true;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
_sticky = false;
|
|
556
|
+
constructor() {
|
|
557
|
+
super(inject(TemplateRef), inject(IterableDiffers));
|
|
558
|
+
}
|
|
559
|
+
ngOnChanges(changes) {
|
|
560
|
+
super.ngOnChanges(changes);
|
|
561
|
+
}
|
|
562
|
+
hasStickyChanged() {
|
|
563
|
+
const hasStickyChanged = this._hasStickyChanged;
|
|
564
|
+
this.resetStickyChanged();
|
|
565
|
+
return hasStickyChanged;
|
|
566
|
+
}
|
|
567
|
+
resetStickyChanged() {
|
|
568
|
+
this._hasStickyChanged = false;
|
|
569
|
+
}
|
|
570
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
571
|
+
minVersion: "12.0.0",
|
|
572
|
+
version: "20.2.0-next.2",
|
|
573
|
+
ngImport: i0,
|
|
574
|
+
type: CdkFooterRowDef,
|
|
575
|
+
deps: [],
|
|
576
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
577
|
+
});
|
|
578
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
579
|
+
minVersion: "16.1.0",
|
|
580
|
+
version: "20.2.0-next.2",
|
|
581
|
+
type: CdkFooterRowDef,
|
|
582
|
+
isStandalone: true,
|
|
583
|
+
selector: "[cdkFooterRowDef]",
|
|
584
|
+
inputs: {
|
|
585
|
+
columns: ["cdkFooterRowDef", "columns"],
|
|
586
|
+
sticky: ["cdkFooterRowDefSticky", "sticky", booleanAttribute]
|
|
587
|
+
},
|
|
588
|
+
usesInheritance: true,
|
|
589
|
+
usesOnChanges: true,
|
|
590
|
+
ngImport: i0
|
|
591
|
+
});
|
|
407
592
|
}
|
|
408
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
593
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
594
|
+
minVersion: "12.0.0",
|
|
595
|
+
version: "20.2.0-next.2",
|
|
596
|
+
ngImport: i0,
|
|
597
|
+
type: CdkFooterRowDef,
|
|
598
|
+
decorators: [{
|
|
599
|
+
type: Directive,
|
|
600
|
+
args: [{
|
|
601
|
+
selector: '[cdkFooterRowDef]',
|
|
602
|
+
inputs: [{
|
|
603
|
+
name: 'columns',
|
|
604
|
+
alias: 'cdkFooterRowDef'
|
|
605
|
+
}]
|
|
606
|
+
}]
|
|
607
|
+
}],
|
|
608
|
+
ctorParameters: () => [],
|
|
609
|
+
propDecorators: {
|
|
610
|
+
sticky: [{
|
|
611
|
+
type: Input,
|
|
612
|
+
args: [{
|
|
613
|
+
alias: 'cdkFooterRowDefSticky',
|
|
614
|
+
transform: booleanAttribute
|
|
615
|
+
}]
|
|
616
|
+
}]
|
|
617
|
+
}
|
|
618
|
+
});
|
|
423
619
|
class CdkRowDef extends BaseRowDef {
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
620
|
+
_table = inject(CDK_TABLE, {
|
|
621
|
+
optional: true
|
|
622
|
+
});
|
|
623
|
+
when;
|
|
624
|
+
constructor() {
|
|
625
|
+
super(inject(TemplateRef), inject(IterableDiffers));
|
|
626
|
+
}
|
|
627
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
628
|
+
minVersion: "12.0.0",
|
|
629
|
+
version: "20.2.0-next.2",
|
|
630
|
+
ngImport: i0,
|
|
631
|
+
type: CdkRowDef,
|
|
632
|
+
deps: [],
|
|
633
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
634
|
+
});
|
|
635
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
636
|
+
minVersion: "14.0.0",
|
|
637
|
+
version: "20.2.0-next.2",
|
|
638
|
+
type: CdkRowDef,
|
|
639
|
+
isStandalone: true,
|
|
640
|
+
selector: "[cdkRowDef]",
|
|
641
|
+
inputs: {
|
|
642
|
+
columns: ["cdkRowDefColumns", "columns"],
|
|
643
|
+
when: ["cdkRowDefWhen", "when"]
|
|
644
|
+
},
|
|
645
|
+
usesInheritance: true,
|
|
646
|
+
ngImport: i0
|
|
647
|
+
});
|
|
439
648
|
}
|
|
440
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
649
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
650
|
+
minVersion: "12.0.0",
|
|
651
|
+
version: "20.2.0-next.2",
|
|
652
|
+
ngImport: i0,
|
|
653
|
+
type: CdkRowDef,
|
|
654
|
+
decorators: [{
|
|
655
|
+
type: Directive,
|
|
656
|
+
args: [{
|
|
657
|
+
selector: '[cdkRowDef]',
|
|
658
|
+
inputs: [{
|
|
659
|
+
name: 'columns',
|
|
660
|
+
alias: 'cdkRowDefColumns'
|
|
661
|
+
}, {
|
|
662
|
+
name: 'when',
|
|
663
|
+
alias: 'cdkRowDefWhen'
|
|
664
|
+
}]
|
|
665
|
+
}]
|
|
666
|
+
}],
|
|
667
|
+
ctorParameters: () => []
|
|
668
|
+
});
|
|
454
669
|
class CdkCellOutlet {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
670
|
+
_viewContainer = inject(ViewContainerRef);
|
|
671
|
+
cells;
|
|
672
|
+
context;
|
|
673
|
+
static mostRecentCellOutlet = null;
|
|
674
|
+
constructor() {
|
|
675
|
+
CdkCellOutlet.mostRecentCellOutlet = this;
|
|
676
|
+
}
|
|
677
|
+
ngOnDestroy() {
|
|
678
|
+
if (CdkCellOutlet.mostRecentCellOutlet === this) {
|
|
679
|
+
CdkCellOutlet.mostRecentCellOutlet = null;
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
683
|
+
minVersion: "12.0.0",
|
|
684
|
+
version: "20.2.0-next.2",
|
|
685
|
+
ngImport: i0,
|
|
686
|
+
type: CdkCellOutlet,
|
|
687
|
+
deps: [],
|
|
688
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
689
|
+
});
|
|
690
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
691
|
+
minVersion: "14.0.0",
|
|
692
|
+
version: "20.2.0-next.2",
|
|
693
|
+
type: CdkCellOutlet,
|
|
694
|
+
isStandalone: true,
|
|
695
|
+
selector: "[cdkCellOutlet]",
|
|
696
|
+
ngImport: i0
|
|
697
|
+
});
|
|
480
698
|
}
|
|
481
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
699
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
700
|
+
minVersion: "12.0.0",
|
|
701
|
+
version: "20.2.0-next.2",
|
|
702
|
+
ngImport: i0,
|
|
703
|
+
type: CdkCellOutlet,
|
|
704
|
+
decorators: [{
|
|
705
|
+
type: Directive,
|
|
706
|
+
args: [{
|
|
707
|
+
selector: '[cdkCellOutlet]'
|
|
708
|
+
}]
|
|
709
|
+
}],
|
|
710
|
+
ctorParameters: () => []
|
|
711
|
+
});
|
|
488
712
|
class CdkHeaderRow {
|
|
489
|
-
|
|
490
|
-
|
|
713
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
714
|
+
minVersion: "12.0.0",
|
|
715
|
+
version: "20.2.0-next.2",
|
|
716
|
+
ngImport: i0,
|
|
717
|
+
type: CdkHeaderRow,
|
|
718
|
+
deps: [],
|
|
719
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
720
|
+
});
|
|
721
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
722
|
+
minVersion: "14.0.0",
|
|
723
|
+
version: "20.2.0-next.2",
|
|
724
|
+
type: CdkHeaderRow,
|
|
725
|
+
isStandalone: true,
|
|
726
|
+
selector: "cdk-header-row, tr[cdk-header-row]",
|
|
727
|
+
host: {
|
|
728
|
+
attributes: {
|
|
729
|
+
"role": "row"
|
|
730
|
+
},
|
|
731
|
+
classAttribute: "cdk-header-row"
|
|
732
|
+
},
|
|
733
|
+
ngImport: i0,
|
|
734
|
+
template: "<ng-container cdkCellOutlet></ng-container>",
|
|
735
|
+
isInline: true,
|
|
736
|
+
dependencies: [{
|
|
737
|
+
kind: "directive",
|
|
738
|
+
type: CdkCellOutlet,
|
|
739
|
+
selector: "[cdkCellOutlet]"
|
|
740
|
+
}],
|
|
741
|
+
changeDetection: i0.ChangeDetectionStrategy.Default,
|
|
742
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
743
|
+
});
|
|
491
744
|
}
|
|
492
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
745
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
746
|
+
minVersion: "12.0.0",
|
|
747
|
+
version: "20.2.0-next.2",
|
|
748
|
+
ngImport: i0,
|
|
749
|
+
type: CdkHeaderRow,
|
|
750
|
+
decorators: [{
|
|
751
|
+
type: Component,
|
|
752
|
+
args: [{
|
|
753
|
+
selector: 'cdk-header-row, tr[cdk-header-row]',
|
|
754
|
+
template: CDK_ROW_TEMPLATE,
|
|
755
|
+
host: {
|
|
756
|
+
'class': 'cdk-header-row',
|
|
757
|
+
'role': 'row'
|
|
758
|
+
},
|
|
759
|
+
changeDetection: ChangeDetectionStrategy.Default,
|
|
760
|
+
encapsulation: ViewEncapsulation.None,
|
|
761
|
+
imports: [CdkCellOutlet]
|
|
762
|
+
}]
|
|
763
|
+
}]
|
|
764
|
+
});
|
|
509
765
|
class CdkFooterRow {
|
|
510
|
-
|
|
511
|
-
|
|
766
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
767
|
+
minVersion: "12.0.0",
|
|
768
|
+
version: "20.2.0-next.2",
|
|
769
|
+
ngImport: i0,
|
|
770
|
+
type: CdkFooterRow,
|
|
771
|
+
deps: [],
|
|
772
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
773
|
+
});
|
|
774
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
775
|
+
minVersion: "14.0.0",
|
|
776
|
+
version: "20.2.0-next.2",
|
|
777
|
+
type: CdkFooterRow,
|
|
778
|
+
isStandalone: true,
|
|
779
|
+
selector: "cdk-footer-row, tr[cdk-footer-row]",
|
|
780
|
+
host: {
|
|
781
|
+
attributes: {
|
|
782
|
+
"role": "row"
|
|
783
|
+
},
|
|
784
|
+
classAttribute: "cdk-footer-row"
|
|
785
|
+
},
|
|
786
|
+
ngImport: i0,
|
|
787
|
+
template: "<ng-container cdkCellOutlet></ng-container>",
|
|
788
|
+
isInline: true,
|
|
789
|
+
dependencies: [{
|
|
790
|
+
kind: "directive",
|
|
791
|
+
type: CdkCellOutlet,
|
|
792
|
+
selector: "[cdkCellOutlet]"
|
|
793
|
+
}],
|
|
794
|
+
changeDetection: i0.ChangeDetectionStrategy.Default,
|
|
795
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
796
|
+
});
|
|
512
797
|
}
|
|
513
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
798
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
799
|
+
minVersion: "12.0.0",
|
|
800
|
+
version: "20.2.0-next.2",
|
|
801
|
+
ngImport: i0,
|
|
802
|
+
type: CdkFooterRow,
|
|
803
|
+
decorators: [{
|
|
804
|
+
type: Component,
|
|
805
|
+
args: [{
|
|
806
|
+
selector: 'cdk-footer-row, tr[cdk-footer-row]',
|
|
807
|
+
template: CDK_ROW_TEMPLATE,
|
|
808
|
+
host: {
|
|
809
|
+
'class': 'cdk-footer-row',
|
|
810
|
+
'role': 'row'
|
|
811
|
+
},
|
|
812
|
+
changeDetection: ChangeDetectionStrategy.Default,
|
|
813
|
+
encapsulation: ViewEncapsulation.None,
|
|
814
|
+
imports: [CdkCellOutlet]
|
|
815
|
+
}]
|
|
816
|
+
}]
|
|
817
|
+
});
|
|
530
818
|
class CdkRow {
|
|
531
|
-
|
|
532
|
-
|
|
819
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
820
|
+
minVersion: "12.0.0",
|
|
821
|
+
version: "20.2.0-next.2",
|
|
822
|
+
ngImport: i0,
|
|
823
|
+
type: CdkRow,
|
|
824
|
+
deps: [],
|
|
825
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
826
|
+
});
|
|
827
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
828
|
+
minVersion: "14.0.0",
|
|
829
|
+
version: "20.2.0-next.2",
|
|
830
|
+
type: CdkRow,
|
|
831
|
+
isStandalone: true,
|
|
832
|
+
selector: "cdk-row, tr[cdk-row]",
|
|
833
|
+
host: {
|
|
834
|
+
attributes: {
|
|
835
|
+
"role": "row"
|
|
836
|
+
},
|
|
837
|
+
classAttribute: "cdk-row"
|
|
838
|
+
},
|
|
839
|
+
ngImport: i0,
|
|
840
|
+
template: "<ng-container cdkCellOutlet></ng-container>",
|
|
841
|
+
isInline: true,
|
|
842
|
+
dependencies: [{
|
|
843
|
+
kind: "directive",
|
|
844
|
+
type: CdkCellOutlet,
|
|
845
|
+
selector: "[cdkCellOutlet]"
|
|
846
|
+
}],
|
|
847
|
+
changeDetection: i0.ChangeDetectionStrategy.Default,
|
|
848
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
849
|
+
});
|
|
533
850
|
}
|
|
534
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
851
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
852
|
+
minVersion: "12.0.0",
|
|
853
|
+
version: "20.2.0-next.2",
|
|
854
|
+
ngImport: i0,
|
|
855
|
+
type: CdkRow,
|
|
856
|
+
decorators: [{
|
|
857
|
+
type: Component,
|
|
858
|
+
args: [{
|
|
859
|
+
selector: 'cdk-row, tr[cdk-row]',
|
|
860
|
+
template: CDK_ROW_TEMPLATE,
|
|
861
|
+
host: {
|
|
862
|
+
'class': 'cdk-row',
|
|
863
|
+
'role': 'row'
|
|
864
|
+
},
|
|
865
|
+
changeDetection: ChangeDetectionStrategy.Default,
|
|
866
|
+
encapsulation: ViewEncapsulation.None,
|
|
867
|
+
imports: [CdkCellOutlet]
|
|
868
|
+
}]
|
|
869
|
+
}]
|
|
870
|
+
});
|
|
551
871
|
class CdkNoDataRow {
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
872
|
+
templateRef = inject(TemplateRef);
|
|
873
|
+
_contentClassNames = ['cdk-no-data-row', 'cdk-row'];
|
|
874
|
+
_cellClassNames = ['cdk-cell', 'cdk-no-data-cell'];
|
|
875
|
+
_cellSelector = 'td, cdk-cell, [cdk-cell], .cdk-cell';
|
|
876
|
+
constructor() {}
|
|
877
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
878
|
+
minVersion: "12.0.0",
|
|
879
|
+
version: "20.2.0-next.2",
|
|
880
|
+
ngImport: i0,
|
|
881
|
+
type: CdkNoDataRow,
|
|
882
|
+
deps: [],
|
|
883
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
884
|
+
});
|
|
885
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
886
|
+
minVersion: "14.0.0",
|
|
887
|
+
version: "20.2.0-next.2",
|
|
888
|
+
type: CdkNoDataRow,
|
|
889
|
+
isStandalone: true,
|
|
890
|
+
selector: "ng-template[cdkNoDataRow]",
|
|
891
|
+
ngImport: i0
|
|
892
|
+
});
|
|
559
893
|
}
|
|
560
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
894
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
895
|
+
minVersion: "12.0.0",
|
|
896
|
+
version: "20.2.0-next.2",
|
|
897
|
+
ngImport: i0,
|
|
898
|
+
type: CdkNoDataRow,
|
|
899
|
+
decorators: [{
|
|
900
|
+
type: Directive,
|
|
901
|
+
args: [{
|
|
902
|
+
selector: 'ng-template[cdkNoDataRow]'
|
|
903
|
+
}]
|
|
904
|
+
}],
|
|
905
|
+
ctorParameters: () => []
|
|
906
|
+
});
|
|
566
907
|
|
|
567
|
-
/**
|
|
568
|
-
* Directions that can be used when setting sticky positioning.
|
|
569
|
-
* @docs-private
|
|
570
|
-
*/
|
|
571
|
-
/**
|
|
572
|
-
* List of all possible directions that can be used for sticky positioning.
|
|
573
|
-
* @docs-private
|
|
574
|
-
*/
|
|
575
908
|
const STICKY_DIRECTIONS = ['top', 'bottom', 'left', 'right'];
|
|
576
|
-
/**
|
|
577
|
-
* Applies and removes sticky positioning styles to the `CdkTable` rows and columns cells.
|
|
578
|
-
* @docs-private
|
|
579
|
-
*/
|
|
580
909
|
class StickyStyler {
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
910
|
+
_isNativeHtmlTable;
|
|
911
|
+
_stickCellCss;
|
|
912
|
+
_isBrowser;
|
|
913
|
+
_needsPositionStickyOnElement;
|
|
914
|
+
direction;
|
|
915
|
+
_positionListener;
|
|
916
|
+
_tableInjector;
|
|
917
|
+
_elemSizeCache = new WeakMap();
|
|
918
|
+
_resizeObserver = globalThis?.ResizeObserver ? new globalThis.ResizeObserver(entries => this._updateCachedSizes(entries)) : null;
|
|
919
|
+
_updatedStickyColumnsParamsToReplay = [];
|
|
920
|
+
_stickyColumnsReplayTimeout = null;
|
|
921
|
+
_cachedCellWidths = [];
|
|
922
|
+
_borderCellCss;
|
|
923
|
+
_destroyed = false;
|
|
924
|
+
constructor(_isNativeHtmlTable, _stickCellCss, _isBrowser = true, _needsPositionStickyOnElement = true, direction, _positionListener, _tableInjector) {
|
|
925
|
+
this._isNativeHtmlTable = _isNativeHtmlTable;
|
|
926
|
+
this._stickCellCss = _stickCellCss;
|
|
927
|
+
this._isBrowser = _isBrowser;
|
|
928
|
+
this._needsPositionStickyOnElement = _needsPositionStickyOnElement;
|
|
929
|
+
this.direction = direction;
|
|
930
|
+
this._positionListener = _positionListener;
|
|
931
|
+
this._tableInjector = _tableInjector;
|
|
932
|
+
this._borderCellCss = {
|
|
933
|
+
'top': `${_stickCellCss}-border-elem-top`,
|
|
934
|
+
'bottom': `${_stickCellCss}-border-elem-bottom`,
|
|
935
|
+
'left': `${_stickCellCss}-border-elem-left`,
|
|
936
|
+
'right': `${_stickCellCss}-border-elem-right`
|
|
937
|
+
};
|
|
938
|
+
}
|
|
939
|
+
clearStickyPositioning(rows, stickyDirections) {
|
|
940
|
+
if (stickyDirections.includes('left') || stickyDirections.includes('right')) {
|
|
941
|
+
this._removeFromStickyColumnReplayQueue(rows);
|
|
942
|
+
}
|
|
943
|
+
const elementsToClear = [];
|
|
944
|
+
for (const row of rows) {
|
|
945
|
+
if (row.nodeType !== row.ELEMENT_NODE) {
|
|
946
|
+
continue;
|
|
947
|
+
}
|
|
948
|
+
elementsToClear.push(row, ...Array.from(row.children));
|
|
949
|
+
}
|
|
950
|
+
afterNextRender({
|
|
951
|
+
write: () => {
|
|
952
|
+
for (const element of elementsToClear) {
|
|
953
|
+
this._removeStickyStyle(element, stickyDirections);
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
}, {
|
|
957
|
+
injector: this._tableInjector
|
|
958
|
+
});
|
|
959
|
+
}
|
|
960
|
+
updateStickyColumns(rows, stickyStartStates, stickyEndStates, recalculateCellWidths = true, replay = true) {
|
|
961
|
+
if (!rows.length || !this._isBrowser || !(stickyStartStates.some(state => state) || stickyEndStates.some(state => state))) {
|
|
962
|
+
this._positionListener?.stickyColumnsUpdated({
|
|
963
|
+
sizes: []
|
|
964
|
+
});
|
|
965
|
+
this._positionListener?.stickyEndColumnsUpdated({
|
|
966
|
+
sizes: []
|
|
967
|
+
});
|
|
968
|
+
return;
|
|
969
|
+
}
|
|
970
|
+
const firstRow = rows[0];
|
|
971
|
+
const numCells = firstRow.children.length;
|
|
972
|
+
const isRtl = this.direction === 'rtl';
|
|
973
|
+
const start = isRtl ? 'right' : 'left';
|
|
974
|
+
const end = isRtl ? 'left' : 'right';
|
|
975
|
+
const lastStickyStart = stickyStartStates.lastIndexOf(true);
|
|
976
|
+
const firstStickyEnd = stickyEndStates.indexOf(true);
|
|
977
|
+
let cellWidths;
|
|
978
|
+
let startPositions;
|
|
979
|
+
let endPositions;
|
|
980
|
+
if (replay) {
|
|
981
|
+
this._updateStickyColumnReplayQueue({
|
|
982
|
+
rows: [...rows],
|
|
983
|
+
stickyStartStates: [...stickyStartStates],
|
|
984
|
+
stickyEndStates: [...stickyEndStates]
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
afterNextRender({
|
|
988
|
+
earlyRead: () => {
|
|
989
|
+
cellWidths = this._getCellWidths(firstRow, recalculateCellWidths);
|
|
990
|
+
startPositions = this._getStickyStartColumnPositions(cellWidths, stickyStartStates);
|
|
991
|
+
endPositions = this._getStickyEndColumnPositions(cellWidths, stickyEndStates);
|
|
992
|
+
},
|
|
993
|
+
write: () => {
|
|
638
994
|
for (const row of rows) {
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
if (
|
|
642
|
-
|
|
995
|
+
for (let i = 0; i < numCells; i++) {
|
|
996
|
+
const cell = row.children[i];
|
|
997
|
+
if (stickyStartStates[i]) {
|
|
998
|
+
this._addStickyStyle(cell, start, startPositions[i], i === lastStickyStart);
|
|
643
999
|
}
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
// Coalesce with sticky row/column updates (and potentially other changes like column resize).
|
|
647
|
-
afterNextRender({
|
|
648
|
-
write: () => {
|
|
649
|
-
for (const element of elementsToClear) {
|
|
650
|
-
this._removeStickyStyle(element, stickyDirections);
|
|
651
|
-
}
|
|
652
|
-
},
|
|
653
|
-
}, {
|
|
654
|
-
injector: this._tableInjector,
|
|
655
|
-
});
|
|
656
|
-
}
|
|
657
|
-
/**
|
|
658
|
-
* Applies sticky left and right positions to the cells of each row according to the sticky
|
|
659
|
-
* states of the rendered column definitions.
|
|
660
|
-
* @param rows The rows that should have its set of cells stuck according to the sticky states.
|
|
661
|
-
* @param stickyStartStates A list of boolean states where each state represents whether the cell
|
|
662
|
-
* in this index position should be stuck to the start of the row.
|
|
663
|
-
* @param stickyEndStates A list of boolean states where each state represents whether the cell
|
|
664
|
-
* in this index position should be stuck to the end of the row.
|
|
665
|
-
* @param recalculateCellWidths Whether the sticky styler should recalculate the width of each
|
|
666
|
-
* column cell. If `false` cached widths will be used instead.
|
|
667
|
-
* @param replay Whether to enqueue this call for replay after a ResizeObserver update.
|
|
668
|
-
*/
|
|
669
|
-
updateStickyColumns(rows, stickyStartStates, stickyEndStates, recalculateCellWidths = true, replay = true) {
|
|
670
|
-
// Don't cache any state if none of the columns are sticky.
|
|
671
|
-
if (!rows.length ||
|
|
672
|
-
!this._isBrowser ||
|
|
673
|
-
!(stickyStartStates.some(state => state) || stickyEndStates.some(state => state))) {
|
|
674
|
-
this._positionListener?.stickyColumnsUpdated({ sizes: [] });
|
|
675
|
-
this._positionListener?.stickyEndColumnsUpdated({ sizes: [] });
|
|
676
|
-
return;
|
|
677
|
-
}
|
|
678
|
-
// Coalesce with sticky row updates (and potentially other changes like column resize).
|
|
679
|
-
const firstRow = rows[0];
|
|
680
|
-
const numCells = firstRow.children.length;
|
|
681
|
-
const isRtl = this.direction === 'rtl';
|
|
682
|
-
const start = isRtl ? 'right' : 'left';
|
|
683
|
-
const end = isRtl ? 'left' : 'right';
|
|
684
|
-
const lastStickyStart = stickyStartStates.lastIndexOf(true);
|
|
685
|
-
const firstStickyEnd = stickyEndStates.indexOf(true);
|
|
686
|
-
let cellWidths;
|
|
687
|
-
let startPositions;
|
|
688
|
-
let endPositions;
|
|
689
|
-
if (replay) {
|
|
690
|
-
this._updateStickyColumnReplayQueue({
|
|
691
|
-
rows: [...rows],
|
|
692
|
-
stickyStartStates: [...stickyStartStates],
|
|
693
|
-
stickyEndStates: [...stickyEndStates],
|
|
694
|
-
});
|
|
695
|
-
}
|
|
696
|
-
afterNextRender({
|
|
697
|
-
earlyRead: () => {
|
|
698
|
-
cellWidths = this._getCellWidths(firstRow, recalculateCellWidths);
|
|
699
|
-
startPositions = this._getStickyStartColumnPositions(cellWidths, stickyStartStates);
|
|
700
|
-
endPositions = this._getStickyEndColumnPositions(cellWidths, stickyEndStates);
|
|
701
|
-
},
|
|
702
|
-
write: () => {
|
|
703
|
-
for (const row of rows) {
|
|
704
|
-
for (let i = 0; i < numCells; i++) {
|
|
705
|
-
const cell = row.children[i];
|
|
706
|
-
if (stickyStartStates[i]) {
|
|
707
|
-
this._addStickyStyle(cell, start, startPositions[i], i === lastStickyStart);
|
|
708
|
-
}
|
|
709
|
-
if (stickyEndStates[i]) {
|
|
710
|
-
this._addStickyStyle(cell, end, endPositions[i], i === firstStickyEnd);
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
if (this._positionListener && cellWidths.some(w => !!w)) {
|
|
715
|
-
this._positionListener.stickyColumnsUpdated({
|
|
716
|
-
sizes: lastStickyStart === -1
|
|
717
|
-
? []
|
|
718
|
-
: cellWidths
|
|
719
|
-
.slice(0, lastStickyStart + 1)
|
|
720
|
-
.map((width, index) => (stickyStartStates[index] ? width : null)),
|
|
721
|
-
});
|
|
722
|
-
this._positionListener.stickyEndColumnsUpdated({
|
|
723
|
-
sizes: firstStickyEnd === -1
|
|
724
|
-
? []
|
|
725
|
-
: cellWidths
|
|
726
|
-
.slice(firstStickyEnd)
|
|
727
|
-
.map((width, index) => stickyEndStates[index + firstStickyEnd] ? width : null)
|
|
728
|
-
.reverse(),
|
|
729
|
-
});
|
|
730
|
-
}
|
|
731
|
-
},
|
|
732
|
-
}, {
|
|
733
|
-
injector: this._tableInjector,
|
|
734
|
-
});
|
|
735
|
-
}
|
|
736
|
-
/**
|
|
737
|
-
* Applies sticky positioning to the row's cells if using the native table layout, and to the
|
|
738
|
-
* row itself otherwise.
|
|
739
|
-
* @param rowsToStick The list of rows that should be stuck according to their corresponding
|
|
740
|
-
* sticky state and to the provided top or bottom position.
|
|
741
|
-
* @param stickyStates A list of boolean states where each state represents whether the row
|
|
742
|
-
* should be stuck in the particular top or bottom position.
|
|
743
|
-
* @param position The position direction in which the row should be stuck if that row should be
|
|
744
|
-
* sticky.
|
|
745
|
-
*
|
|
746
|
-
*/
|
|
747
|
-
stickRows(rowsToStick, stickyStates, position) {
|
|
748
|
-
// Since we can't measure the rows on the server, we can't stick the rows properly.
|
|
749
|
-
if (!this._isBrowser) {
|
|
750
|
-
return;
|
|
751
|
-
}
|
|
752
|
-
// If positioning the rows to the bottom, reverse their order when evaluating the sticky
|
|
753
|
-
// position such that the last row stuck will be "bottom: 0px" and so on. Note that the
|
|
754
|
-
// sticky states need to be reversed as well.
|
|
755
|
-
const rows = position === 'bottom' ? rowsToStick.slice().reverse() : rowsToStick;
|
|
756
|
-
const states = position === 'bottom' ? stickyStates.slice().reverse() : stickyStates;
|
|
757
|
-
// Measure row heights all at once before adding sticky styles to reduce layout thrashing.
|
|
758
|
-
const stickyOffsets = [];
|
|
759
|
-
const stickyCellHeights = [];
|
|
760
|
-
const elementsToStick = [];
|
|
761
|
-
// Coalesce with other sticky row updates (top/bottom), sticky columns updates
|
|
762
|
-
// (and potentially other changes like column resize).
|
|
763
|
-
afterNextRender({
|
|
764
|
-
earlyRead: () => {
|
|
765
|
-
for (let rowIndex = 0, stickyOffset = 0; rowIndex < rows.length; rowIndex++) {
|
|
766
|
-
if (!states[rowIndex]) {
|
|
767
|
-
continue;
|
|
768
|
-
}
|
|
769
|
-
stickyOffsets[rowIndex] = stickyOffset;
|
|
770
|
-
const row = rows[rowIndex];
|
|
771
|
-
elementsToStick[rowIndex] = this._isNativeHtmlTable
|
|
772
|
-
? Array.from(row.children)
|
|
773
|
-
: [row];
|
|
774
|
-
const height = this._retrieveElementSize(row).height;
|
|
775
|
-
stickyOffset += height;
|
|
776
|
-
stickyCellHeights[rowIndex] = height;
|
|
777
|
-
}
|
|
778
|
-
},
|
|
779
|
-
write: () => {
|
|
780
|
-
const borderedRowIndex = states.lastIndexOf(true);
|
|
781
|
-
for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) {
|
|
782
|
-
if (!states[rowIndex]) {
|
|
783
|
-
continue;
|
|
784
|
-
}
|
|
785
|
-
const offset = stickyOffsets[rowIndex];
|
|
786
|
-
const isBorderedRowIndex = rowIndex === borderedRowIndex;
|
|
787
|
-
for (const element of elementsToStick[rowIndex]) {
|
|
788
|
-
this._addStickyStyle(element, position, offset, isBorderedRowIndex);
|
|
789
|
-
}
|
|
790
|
-
}
|
|
791
|
-
if (position === 'top') {
|
|
792
|
-
this._positionListener?.stickyHeaderRowsUpdated({
|
|
793
|
-
sizes: stickyCellHeights,
|
|
794
|
-
offsets: stickyOffsets,
|
|
795
|
-
elements: elementsToStick,
|
|
796
|
-
});
|
|
797
|
-
}
|
|
798
|
-
else {
|
|
799
|
-
this._positionListener?.stickyFooterRowsUpdated({
|
|
800
|
-
sizes: stickyCellHeights,
|
|
801
|
-
offsets: stickyOffsets,
|
|
802
|
-
elements: elementsToStick,
|
|
803
|
-
});
|
|
804
|
-
}
|
|
805
|
-
},
|
|
806
|
-
}, {
|
|
807
|
-
injector: this._tableInjector,
|
|
808
|
-
});
|
|
809
|
-
}
|
|
810
|
-
/**
|
|
811
|
-
* When using the native table in Safari, sticky footer cells do not stick. The only way to stick
|
|
812
|
-
* footer rows is to apply sticky styling to the tfoot container. This should only be done if
|
|
813
|
-
* all footer rows are sticky. If not all footer rows are sticky, remove sticky positioning from
|
|
814
|
-
* the tfoot element.
|
|
815
|
-
*/
|
|
816
|
-
updateStickyFooterContainer(tableElement, stickyStates) {
|
|
817
|
-
if (!this._isNativeHtmlTable) {
|
|
818
|
-
return;
|
|
819
|
-
}
|
|
820
|
-
// Coalesce with other sticky updates (and potentially other changes like column resize).
|
|
821
|
-
afterNextRender({
|
|
822
|
-
write: () => {
|
|
823
|
-
const tfoot = tableElement.querySelector('tfoot');
|
|
824
|
-
if (tfoot) {
|
|
825
|
-
if (stickyStates.some(state => !state)) {
|
|
826
|
-
this._removeStickyStyle(tfoot, ['bottom']);
|
|
827
|
-
}
|
|
828
|
-
else {
|
|
829
|
-
this._addStickyStyle(tfoot, 'bottom', 0, false);
|
|
830
|
-
}
|
|
831
|
-
}
|
|
832
|
-
},
|
|
833
|
-
}, {
|
|
834
|
-
injector: this._tableInjector,
|
|
835
|
-
});
|
|
836
|
-
}
|
|
837
|
-
/** Triggered by the table's OnDestroy hook. */
|
|
838
|
-
destroy() {
|
|
839
|
-
if (this._stickyColumnsReplayTimeout) {
|
|
840
|
-
clearTimeout(this._stickyColumnsReplayTimeout);
|
|
841
|
-
}
|
|
842
|
-
this._resizeObserver?.disconnect();
|
|
843
|
-
this._destroyed = true;
|
|
844
|
-
}
|
|
845
|
-
/**
|
|
846
|
-
* Removes the sticky style on the element by removing the sticky cell CSS class, re-evaluating
|
|
847
|
-
* the zIndex, removing each of the provided sticky directions, and removing the
|
|
848
|
-
* sticky position if there are no more directions.
|
|
849
|
-
*/
|
|
850
|
-
_removeStickyStyle(element, stickyDirections) {
|
|
851
|
-
if (!element.classList.contains(this._stickCellCss)) {
|
|
852
|
-
return;
|
|
853
|
-
}
|
|
854
|
-
for (const dir of stickyDirections) {
|
|
855
|
-
element.style[dir] = '';
|
|
856
|
-
element.classList.remove(this._borderCellCss[dir]);
|
|
857
|
-
}
|
|
858
|
-
// If the element no longer has any more sticky directions, remove sticky positioning and
|
|
859
|
-
// the sticky CSS class.
|
|
860
|
-
// Short-circuit checking element.style[dir] for stickyDirections as they
|
|
861
|
-
// were already removed above.
|
|
862
|
-
const hasDirection = STICKY_DIRECTIONS.some(dir => stickyDirections.indexOf(dir) === -1 && element.style[dir]);
|
|
863
|
-
if (hasDirection) {
|
|
864
|
-
element.style.zIndex = this._getCalculatedZIndex(element);
|
|
865
|
-
}
|
|
866
|
-
else {
|
|
867
|
-
// When not hasDirection, _getCalculatedZIndex will always return ''.
|
|
868
|
-
element.style.zIndex = '';
|
|
869
|
-
if (this._needsPositionStickyOnElement) {
|
|
870
|
-
element.style.position = '';
|
|
1000
|
+
if (stickyEndStates[i]) {
|
|
1001
|
+
this._addStickyStyle(cell, end, endPositions[i], i === firstStickyEnd);
|
|
871
1002
|
}
|
|
872
|
-
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
}
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
}
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
if (
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
}
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
if (this._positionListener && cellWidths.some(w => !!w)) {
|
|
1006
|
+
this._positionListener.stickyColumnsUpdated({
|
|
1007
|
+
sizes: lastStickyStart === -1 ? [] : cellWidths.slice(0, lastStickyStart + 1).map((width, index) => stickyStartStates[index] ? width : null)
|
|
1008
|
+
});
|
|
1009
|
+
this._positionListener.stickyEndColumnsUpdated({
|
|
1010
|
+
sizes: firstStickyEnd === -1 ? [] : cellWidths.slice(firstStickyEnd).map((width, index) => stickyEndStates[index + firstStickyEnd] ? width : null).reverse()
|
|
1011
|
+
});
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
}, {
|
|
1015
|
+
injector: this._tableInjector
|
|
1016
|
+
});
|
|
1017
|
+
}
|
|
1018
|
+
stickRows(rowsToStick, stickyStates, position) {
|
|
1019
|
+
if (!this._isBrowser) {
|
|
1020
|
+
return;
|
|
1021
|
+
}
|
|
1022
|
+
const rows = position === 'bottom' ? rowsToStick.slice().reverse() : rowsToStick;
|
|
1023
|
+
const states = position === 'bottom' ? stickyStates.slice().reverse() : stickyStates;
|
|
1024
|
+
const stickyOffsets = [];
|
|
1025
|
+
const stickyCellHeights = [];
|
|
1026
|
+
const elementsToStick = [];
|
|
1027
|
+
afterNextRender({
|
|
1028
|
+
earlyRead: () => {
|
|
1029
|
+
for (let rowIndex = 0, stickyOffset = 0; rowIndex < rows.length; rowIndex++) {
|
|
1030
|
+
if (!states[rowIndex]) {
|
|
1031
|
+
continue;
|
|
1032
|
+
}
|
|
1033
|
+
stickyOffsets[rowIndex] = stickyOffset;
|
|
1034
|
+
const row = rows[rowIndex];
|
|
1035
|
+
elementsToStick[rowIndex] = this._isNativeHtmlTable ? Array.from(row.children) : [row];
|
|
1036
|
+
const height = this._retrieveElementSize(row).height;
|
|
1037
|
+
stickyOffset += height;
|
|
1038
|
+
stickyCellHeights[rowIndex] = height;
|
|
1039
|
+
}
|
|
1040
|
+
},
|
|
1041
|
+
write: () => {
|
|
1042
|
+
const borderedRowIndex = states.lastIndexOf(true);
|
|
1043
|
+
for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) {
|
|
1044
|
+
if (!states[rowIndex]) {
|
|
1045
|
+
continue;
|
|
1046
|
+
}
|
|
1047
|
+
const offset = stickyOffsets[rowIndex];
|
|
1048
|
+
const isBorderedRowIndex = rowIndex === borderedRowIndex;
|
|
1049
|
+
for (const element of elementsToStick[rowIndex]) {
|
|
1050
|
+
this._addStickyStyle(element, position, offset, isBorderedRowIndex);
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
if (position === 'top') {
|
|
1054
|
+
this._positionListener?.stickyHeaderRowsUpdated({
|
|
1055
|
+
sizes: stickyCellHeights,
|
|
1056
|
+
offsets: stickyOffsets,
|
|
1057
|
+
elements: elementsToStick
|
|
1058
|
+
});
|
|
1059
|
+
} else {
|
|
1060
|
+
this._positionListener?.stickyFooterRowsUpdated({
|
|
1061
|
+
sizes: stickyCellHeights,
|
|
1062
|
+
offsets: stickyOffsets,
|
|
1063
|
+
elements: elementsToStick
|
|
1064
|
+
});
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
}, {
|
|
1068
|
+
injector: this._tableInjector
|
|
1069
|
+
});
|
|
1070
|
+
}
|
|
1071
|
+
updateStickyFooterContainer(tableElement, stickyStates) {
|
|
1072
|
+
if (!this._isNativeHtmlTable) {
|
|
1073
|
+
return;
|
|
1074
|
+
}
|
|
1075
|
+
afterNextRender({
|
|
1076
|
+
write: () => {
|
|
1077
|
+
const tfoot = tableElement.querySelector('tfoot');
|
|
1078
|
+
if (tfoot) {
|
|
1079
|
+
if (stickyStates.some(state => !state)) {
|
|
1080
|
+
this._removeStickyStyle(tfoot, ['bottom']);
|
|
1081
|
+
} else {
|
|
1082
|
+
this._addStickyStyle(tfoot, 'bottom', 0, false);
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
}, {
|
|
1087
|
+
injector: this._tableInjector
|
|
1088
|
+
});
|
|
1089
|
+
}
|
|
1090
|
+
destroy() {
|
|
1091
|
+
if (this._stickyColumnsReplayTimeout) {
|
|
1092
|
+
clearTimeout(this._stickyColumnsReplayTimeout);
|
|
1093
|
+
}
|
|
1094
|
+
this._resizeObserver?.disconnect();
|
|
1095
|
+
this._destroyed = true;
|
|
1096
|
+
}
|
|
1097
|
+
_removeStickyStyle(element, stickyDirections) {
|
|
1098
|
+
if (!element.classList.contains(this._stickCellCss)) {
|
|
1099
|
+
return;
|
|
1100
|
+
}
|
|
1101
|
+
for (const dir of stickyDirections) {
|
|
1102
|
+
element.style[dir] = '';
|
|
1103
|
+
element.classList.remove(this._borderCellCss[dir]);
|
|
1104
|
+
}
|
|
1105
|
+
const hasDirection = STICKY_DIRECTIONS.some(dir => stickyDirections.indexOf(dir) === -1 && element.style[dir]);
|
|
1106
|
+
if (hasDirection) {
|
|
1107
|
+
element.style.zIndex = this._getCalculatedZIndex(element);
|
|
1108
|
+
} else {
|
|
1109
|
+
element.style.zIndex = '';
|
|
1110
|
+
if (this._needsPositionStickyOnElement) {
|
|
1111
|
+
element.style.position = '';
|
|
1112
|
+
}
|
|
1113
|
+
element.classList.remove(this._stickCellCss);
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
_addStickyStyle(element, dir, dirValue, isBorderElement) {
|
|
1117
|
+
element.classList.add(this._stickCellCss);
|
|
1118
|
+
if (isBorderElement) {
|
|
1119
|
+
element.classList.add(this._borderCellCss[dir]);
|
|
1120
|
+
}
|
|
1121
|
+
element.style[dir] = `${dirValue}px`;
|
|
1122
|
+
element.style.zIndex = this._getCalculatedZIndex(element);
|
|
1123
|
+
if (this._needsPositionStickyOnElement) {
|
|
1124
|
+
element.style.cssText += 'position: -webkit-sticky; position: sticky; ';
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
_getCalculatedZIndex(element) {
|
|
1128
|
+
const zIndexIncrements = {
|
|
1129
|
+
top: 100,
|
|
1130
|
+
bottom: 10,
|
|
1131
|
+
left: 1,
|
|
1132
|
+
right: 1
|
|
1133
|
+
};
|
|
1134
|
+
let zIndex = 0;
|
|
1135
|
+
for (const dir of STICKY_DIRECTIONS) {
|
|
1136
|
+
if (element.style[dir]) {
|
|
1137
|
+
zIndex += zIndexIncrements[dir];
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
return zIndex ? `${zIndex}` : '';
|
|
1141
|
+
}
|
|
1142
|
+
_getCellWidths(row, recalculateCellWidths = true) {
|
|
1143
|
+
if (!recalculateCellWidths && this._cachedCellWidths.length) {
|
|
1144
|
+
return this._cachedCellWidths;
|
|
1145
|
+
}
|
|
1146
|
+
const cellWidths = [];
|
|
1147
|
+
const firstRowCells = row.children;
|
|
1148
|
+
for (let i = 0; i < firstRowCells.length; i++) {
|
|
1149
|
+
const cell = firstRowCells[i];
|
|
1150
|
+
cellWidths.push(this._retrieveElementSize(cell).width);
|
|
1151
|
+
}
|
|
1152
|
+
this._cachedCellWidths = cellWidths;
|
|
1153
|
+
return cellWidths;
|
|
1154
|
+
}
|
|
1155
|
+
_getStickyStartColumnPositions(widths, stickyStates) {
|
|
1156
|
+
const positions = [];
|
|
1157
|
+
let nextPosition = 0;
|
|
1158
|
+
for (let i = 0; i < widths.length; i++) {
|
|
1159
|
+
if (stickyStates[i]) {
|
|
1160
|
+
positions[i] = nextPosition;
|
|
1161
|
+
nextPosition += widths[i];
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
return positions;
|
|
1165
|
+
}
|
|
1166
|
+
_getStickyEndColumnPositions(widths, stickyStates) {
|
|
1167
|
+
const positions = [];
|
|
1168
|
+
let nextPosition = 0;
|
|
1169
|
+
for (let i = widths.length; i > 0; i--) {
|
|
1170
|
+
if (stickyStates[i]) {
|
|
1171
|
+
positions[i] = nextPosition;
|
|
1172
|
+
nextPosition += widths[i];
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
return positions;
|
|
1176
|
+
}
|
|
1177
|
+
_retrieveElementSize(element) {
|
|
1178
|
+
const cachedSize = this._elemSizeCache.get(element);
|
|
1179
|
+
if (cachedSize) {
|
|
1180
|
+
return cachedSize;
|
|
1181
|
+
}
|
|
1182
|
+
const clientRect = element.getBoundingClientRect();
|
|
1183
|
+
const size = {
|
|
1184
|
+
width: clientRect.width,
|
|
1185
|
+
height: clientRect.height
|
|
1186
|
+
};
|
|
1187
|
+
if (!this._resizeObserver) {
|
|
1188
|
+
return size;
|
|
1189
|
+
}
|
|
1190
|
+
this._elemSizeCache.set(element, size);
|
|
1191
|
+
this._resizeObserver.observe(element, {
|
|
1192
|
+
box: 'border-box'
|
|
1193
|
+
});
|
|
1194
|
+
return size;
|
|
1195
|
+
}
|
|
1196
|
+
_updateStickyColumnReplayQueue(params) {
|
|
1197
|
+
this._removeFromStickyColumnReplayQueue(params.rows);
|
|
1198
|
+
if (!this._stickyColumnsReplayTimeout) {
|
|
1199
|
+
this._updatedStickyColumnsParamsToReplay.push(params);
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
_removeFromStickyColumnReplayQueue(rows) {
|
|
1203
|
+
const rowsSet = new Set(rows);
|
|
1204
|
+
for (const update of this._updatedStickyColumnsParamsToReplay) {
|
|
1205
|
+
update.rows = update.rows.filter(row => !rowsSet.has(row));
|
|
1206
|
+
}
|
|
1207
|
+
this._updatedStickyColumnsParamsToReplay = this._updatedStickyColumnsParamsToReplay.filter(update => !!update.rows.length);
|
|
1208
|
+
}
|
|
1209
|
+
_updateCachedSizes(entries) {
|
|
1210
|
+
let needsColumnUpdate = false;
|
|
1211
|
+
for (const entry of entries) {
|
|
1212
|
+
const newEntry = entry.borderBoxSize?.length ? {
|
|
1213
|
+
width: entry.borderBoxSize[0].inlineSize,
|
|
1214
|
+
height: entry.borderBoxSize[0].blockSize
|
|
1215
|
+
} : {
|
|
1216
|
+
width: entry.contentRect.width,
|
|
1217
|
+
height: entry.contentRect.height
|
|
1218
|
+
};
|
|
1219
|
+
if (newEntry.width !== this._elemSizeCache.get(entry.target)?.width && isCell(entry.target)) {
|
|
1220
|
+
needsColumnUpdate = true;
|
|
1221
|
+
}
|
|
1222
|
+
this._elemSizeCache.set(entry.target, newEntry);
|
|
1223
|
+
}
|
|
1224
|
+
if (needsColumnUpdate && this._updatedStickyColumnsParamsToReplay.length) {
|
|
1225
|
+
if (this._stickyColumnsReplayTimeout) {
|
|
1226
|
+
clearTimeout(this._stickyColumnsReplayTimeout);
|
|
1227
|
+
}
|
|
1228
|
+
this._stickyColumnsReplayTimeout = setTimeout(() => {
|
|
1229
|
+
if (this._destroyed) {
|
|
1230
|
+
return;
|
|
993
1231
|
}
|
|
994
|
-
}
|
|
995
|
-
/** Remove updates for the specified rows from the queue. */
|
|
996
|
-
_removeFromStickyColumnReplayQueue(rows) {
|
|
997
|
-
const rowsSet = new Set(rows);
|
|
998
1232
|
for (const update of this._updatedStickyColumnsParamsToReplay) {
|
|
999
|
-
|
|
1000
|
-
}
|
|
1001
|
-
this._updatedStickyColumnsParamsToReplay = this._updatedStickyColumnsParamsToReplay.filter(update => !!update.rows.length);
|
|
1002
|
-
}
|
|
1003
|
-
/** Update _elemSizeCache with the observed sizes. */
|
|
1004
|
-
_updateCachedSizes(entries) {
|
|
1005
|
-
let needsColumnUpdate = false;
|
|
1006
|
-
for (const entry of entries) {
|
|
1007
|
-
const newEntry = entry.borderBoxSize?.length
|
|
1008
|
-
? {
|
|
1009
|
-
width: entry.borderBoxSize[0].inlineSize,
|
|
1010
|
-
height: entry.borderBoxSize[0].blockSize,
|
|
1011
|
-
}
|
|
1012
|
-
: {
|
|
1013
|
-
width: entry.contentRect.width,
|
|
1014
|
-
height: entry.contentRect.height,
|
|
1015
|
-
};
|
|
1016
|
-
if (newEntry.width !== this._elemSizeCache.get(entry.target)?.width &&
|
|
1017
|
-
isCell(entry.target)) {
|
|
1018
|
-
needsColumnUpdate = true;
|
|
1019
|
-
}
|
|
1020
|
-
this._elemSizeCache.set(entry.target, newEntry);
|
|
1021
|
-
}
|
|
1022
|
-
if (needsColumnUpdate && this._updatedStickyColumnsParamsToReplay.length) {
|
|
1023
|
-
if (this._stickyColumnsReplayTimeout) {
|
|
1024
|
-
clearTimeout(this._stickyColumnsReplayTimeout);
|
|
1025
|
-
}
|
|
1026
|
-
this._stickyColumnsReplayTimeout = setTimeout(() => {
|
|
1027
|
-
if (this._destroyed) {
|
|
1028
|
-
return;
|
|
1029
|
-
}
|
|
1030
|
-
for (const update of this._updatedStickyColumnsParamsToReplay) {
|
|
1031
|
-
this.updateStickyColumns(update.rows, update.stickyStartStates, update.stickyEndStates, true, false);
|
|
1032
|
-
}
|
|
1033
|
-
this._updatedStickyColumnsParamsToReplay = [];
|
|
1034
|
-
this._stickyColumnsReplayTimeout = null;
|
|
1035
|
-
}, 0);
|
|
1233
|
+
this.updateStickyColumns(update.rows, update.stickyStartStates, update.stickyEndStates, true, false);
|
|
1036
1234
|
}
|
|
1235
|
+
this._updatedStickyColumnsParamsToReplay = [];
|
|
1236
|
+
this._stickyColumnsReplayTimeout = null;
|
|
1237
|
+
}, 0);
|
|
1037
1238
|
}
|
|
1239
|
+
}
|
|
1038
1240
|
}
|
|
1039
1241
|
function isCell(element) {
|
|
1040
|
-
|
|
1242
|
+
return ['cdk-cell', 'cdk-header-cell', 'cdk-footer-cell'].some(klass => element.classList.contains(klass));
|
|
1041
1243
|
}
|
|
1042
1244
|
|
|
1043
|
-
/**
|
|
1044
|
-
* Returns an error to be thrown when attempting to find an nonexistent column.
|
|
1045
|
-
* @param id Id whose lookup failed.
|
|
1046
|
-
* @docs-private
|
|
1047
|
-
*/
|
|
1048
1245
|
function getTableUnknownColumnError(id) {
|
|
1049
|
-
|
|
1246
|
+
return Error(`Could not find column with id "${id}".`);
|
|
1050
1247
|
}
|
|
1051
|
-
/**
|
|
1052
|
-
* Returns an error to be thrown when two column definitions have the same name.
|
|
1053
|
-
* @docs-private
|
|
1054
|
-
*/
|
|
1055
1248
|
function getTableDuplicateColumnNameError(name) {
|
|
1056
|
-
|
|
1249
|
+
return Error(`Duplicate column definition name provided: "${name}".`);
|
|
1057
1250
|
}
|
|
1058
|
-
/**
|
|
1059
|
-
* Returns an error to be thrown when there are multiple rows that are missing a when function.
|
|
1060
|
-
* @docs-private
|
|
1061
|
-
*/
|
|
1062
1251
|
function getTableMultipleDefaultRowDefsError() {
|
|
1063
|
-
|
|
1064
|
-
'Or set `multiTemplateDataRows`.');
|
|
1252
|
+
return Error(`There can only be one default row without a when predicate function. ` + 'Or set `multiTemplateDataRows`.');
|
|
1065
1253
|
}
|
|
1066
|
-
/**
|
|
1067
|
-
* Returns an error to be thrown when there are no matching row defs for a particular set of data.
|
|
1068
|
-
* @docs-private
|
|
1069
|
-
*/
|
|
1070
1254
|
function getTableMissingMatchingRowDefError(data) {
|
|
1071
|
-
|
|
1072
|
-
`provided row data: ${JSON.stringify(data)}`);
|
|
1255
|
+
return Error(`Could not find a matching row definition for the ` + `provided row data: ${JSON.stringify(data)}`);
|
|
1073
1256
|
}
|
|
1074
|
-
/**
|
|
1075
|
-
* Returns an error to be thrown when there is no row definitions present in the content.
|
|
1076
|
-
* @docs-private
|
|
1077
|
-
*/
|
|
1078
1257
|
function getTableMissingRowDefsError() {
|
|
1079
|
-
|
|
1080
|
-
'cannot determine which columns should be rendered.');
|
|
1258
|
+
return Error('Missing definitions for header, footer, and row; ' + 'cannot determine which columns should be rendered.');
|
|
1081
1259
|
}
|
|
1082
|
-
/**
|
|
1083
|
-
* Returns an error to be thrown when the data source does not match the compatible types.
|
|
1084
|
-
* @docs-private
|
|
1085
|
-
*/
|
|
1086
1260
|
function getTableUnknownDataSourceError() {
|
|
1087
|
-
|
|
1261
|
+
return Error(`Provided data source did not match an array, Observable, or DataSource`);
|
|
1088
1262
|
}
|
|
1089
|
-
/**
|
|
1090
|
-
* Returns an error to be thrown when the text column cannot find a parent table to inject.
|
|
1091
|
-
* @docs-private
|
|
1092
|
-
*/
|
|
1093
1263
|
function getTableTextColumnMissingParentTableError() {
|
|
1094
|
-
|
|
1264
|
+
return Error(`Text column could not find a parent table for registration.`);
|
|
1095
1265
|
}
|
|
1096
|
-
/**
|
|
1097
|
-
* Returns an error to be thrown when a table text column doesn't have a name.
|
|
1098
|
-
* @docs-private
|
|
1099
|
-
*/
|
|
1100
1266
|
function getTableTextColumnMissingNameError() {
|
|
1101
|
-
|
|
1267
|
+
return Error(`Table text column must have a name.`);
|
|
1102
1268
|
}
|
|
1103
1269
|
|
|
1104
|
-
/** The injection token used to specify the StickyPositioningListener. */
|
|
1105
1270
|
const STICKY_POSITIONING_LISTENER = new InjectionToken('CDK_SPL');
|
|
1106
1271
|
|
|
1107
|
-
/**
|
|
1108
|
-
* Enables the recycle view repeater strategy, which reduces rendering latency. Not compatible with
|
|
1109
|
-
* tables that animate rows.
|
|
1110
|
-
*/
|
|
1111
1272
|
class CdkRecycleRows {
|
|
1112
|
-
|
|
1113
|
-
|
|
1273
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1274
|
+
minVersion: "12.0.0",
|
|
1275
|
+
version: "20.2.0-next.2",
|
|
1276
|
+
ngImport: i0,
|
|
1277
|
+
type: CdkRecycleRows,
|
|
1278
|
+
deps: [],
|
|
1279
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1280
|
+
});
|
|
1281
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
1282
|
+
minVersion: "14.0.0",
|
|
1283
|
+
version: "20.2.0-next.2",
|
|
1284
|
+
type: CdkRecycleRows,
|
|
1285
|
+
isStandalone: true,
|
|
1286
|
+
selector: "cdk-table[recycleRows], table[cdk-table][recycleRows]",
|
|
1287
|
+
providers: [{
|
|
1288
|
+
provide: _VIEW_REPEATER_STRATEGY,
|
|
1289
|
+
useClass: _RecycleViewRepeaterStrategy
|
|
1290
|
+
}],
|
|
1291
|
+
ngImport: i0
|
|
1292
|
+
});
|
|
1114
1293
|
}
|
|
1115
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1294
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1295
|
+
minVersion: "12.0.0",
|
|
1296
|
+
version: "20.2.0-next.2",
|
|
1297
|
+
ngImport: i0,
|
|
1298
|
+
type: CdkRecycleRows,
|
|
1299
|
+
decorators: [{
|
|
1300
|
+
type: Directive,
|
|
1301
|
+
args: [{
|
|
1302
|
+
selector: 'cdk-table[recycleRows], table[cdk-table][recycleRows]',
|
|
1303
|
+
providers: [{
|
|
1304
|
+
provide: _VIEW_REPEATER_STRATEGY,
|
|
1305
|
+
useClass: _RecycleViewRepeaterStrategy
|
|
1306
|
+
}]
|
|
1307
|
+
}]
|
|
1308
|
+
}]
|
|
1309
|
+
});
|
|
1126
1310
|
class DataRowOutlet {
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1311
|
+
viewContainer = inject(ViewContainerRef);
|
|
1312
|
+
elementRef = inject(ElementRef);
|
|
1313
|
+
constructor() {
|
|
1314
|
+
const table = inject(CDK_TABLE);
|
|
1315
|
+
table._rowOutlet = this;
|
|
1316
|
+
table._outletAssigned();
|
|
1317
|
+
}
|
|
1318
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1319
|
+
minVersion: "12.0.0",
|
|
1320
|
+
version: "20.2.0-next.2",
|
|
1321
|
+
ngImport: i0,
|
|
1322
|
+
type: DataRowOutlet,
|
|
1323
|
+
deps: [],
|
|
1324
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1325
|
+
});
|
|
1326
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
1327
|
+
minVersion: "14.0.0",
|
|
1328
|
+
version: "20.2.0-next.2",
|
|
1329
|
+
type: DataRowOutlet,
|
|
1330
|
+
isStandalone: true,
|
|
1331
|
+
selector: "[rowOutlet]",
|
|
1332
|
+
ngImport: i0
|
|
1333
|
+
});
|
|
1136
1334
|
}
|
|
1137
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1335
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1336
|
+
minVersion: "12.0.0",
|
|
1337
|
+
version: "20.2.0-next.2",
|
|
1338
|
+
ngImport: i0,
|
|
1339
|
+
type: DataRowOutlet,
|
|
1340
|
+
decorators: [{
|
|
1341
|
+
type: Directive,
|
|
1342
|
+
args: [{
|
|
1343
|
+
selector: '[rowOutlet]'
|
|
1344
|
+
}]
|
|
1345
|
+
}],
|
|
1346
|
+
ctorParameters: () => []
|
|
1347
|
+
});
|
|
1147
1348
|
class HeaderRowOutlet {
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1349
|
+
viewContainer = inject(ViewContainerRef);
|
|
1350
|
+
elementRef = inject(ElementRef);
|
|
1351
|
+
constructor() {
|
|
1352
|
+
const table = inject(CDK_TABLE);
|
|
1353
|
+
table._headerRowOutlet = this;
|
|
1354
|
+
table._outletAssigned();
|
|
1355
|
+
}
|
|
1356
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1357
|
+
minVersion: "12.0.0",
|
|
1358
|
+
version: "20.2.0-next.2",
|
|
1359
|
+
ngImport: i0,
|
|
1360
|
+
type: HeaderRowOutlet,
|
|
1361
|
+
deps: [],
|
|
1362
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1363
|
+
});
|
|
1364
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
1365
|
+
minVersion: "14.0.0",
|
|
1366
|
+
version: "20.2.0-next.2",
|
|
1367
|
+
type: HeaderRowOutlet,
|
|
1368
|
+
isStandalone: true,
|
|
1369
|
+
selector: "[headerRowOutlet]",
|
|
1370
|
+
ngImport: i0
|
|
1371
|
+
});
|
|
1157
1372
|
}
|
|
1158
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1373
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1374
|
+
minVersion: "12.0.0",
|
|
1375
|
+
version: "20.2.0-next.2",
|
|
1376
|
+
ngImport: i0,
|
|
1377
|
+
type: HeaderRowOutlet,
|
|
1378
|
+
decorators: [{
|
|
1379
|
+
type: Directive,
|
|
1380
|
+
args: [{
|
|
1381
|
+
selector: '[headerRowOutlet]'
|
|
1382
|
+
}]
|
|
1383
|
+
}],
|
|
1384
|
+
ctorParameters: () => []
|
|
1385
|
+
});
|
|
1168
1386
|
class FooterRowOutlet {
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1387
|
+
viewContainer = inject(ViewContainerRef);
|
|
1388
|
+
elementRef = inject(ElementRef);
|
|
1389
|
+
constructor() {
|
|
1390
|
+
const table = inject(CDK_TABLE);
|
|
1391
|
+
table._footerRowOutlet = this;
|
|
1392
|
+
table._outletAssigned();
|
|
1393
|
+
}
|
|
1394
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1395
|
+
minVersion: "12.0.0",
|
|
1396
|
+
version: "20.2.0-next.2",
|
|
1397
|
+
ngImport: i0,
|
|
1398
|
+
type: FooterRowOutlet,
|
|
1399
|
+
deps: [],
|
|
1400
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1401
|
+
});
|
|
1402
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
1403
|
+
minVersion: "14.0.0",
|
|
1404
|
+
version: "20.2.0-next.2",
|
|
1405
|
+
type: FooterRowOutlet,
|
|
1406
|
+
isStandalone: true,
|
|
1407
|
+
selector: "[footerRowOutlet]",
|
|
1408
|
+
ngImport: i0
|
|
1409
|
+
});
|
|
1178
1410
|
}
|
|
1179
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1411
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1412
|
+
minVersion: "12.0.0",
|
|
1413
|
+
version: "20.2.0-next.2",
|
|
1414
|
+
ngImport: i0,
|
|
1415
|
+
type: FooterRowOutlet,
|
|
1416
|
+
decorators: [{
|
|
1417
|
+
type: Directive,
|
|
1418
|
+
args: [{
|
|
1419
|
+
selector: '[footerRowOutlet]'
|
|
1420
|
+
}]
|
|
1421
|
+
}],
|
|
1422
|
+
ctorParameters: () => []
|
|
1423
|
+
});
|
|
1190
1424
|
class NoDataRowOutlet {
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1425
|
+
viewContainer = inject(ViewContainerRef);
|
|
1426
|
+
elementRef = inject(ElementRef);
|
|
1427
|
+
constructor() {
|
|
1428
|
+
const table = inject(CDK_TABLE);
|
|
1429
|
+
table._noDataRowOutlet = this;
|
|
1430
|
+
table._outletAssigned();
|
|
1431
|
+
}
|
|
1432
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1433
|
+
minVersion: "12.0.0",
|
|
1434
|
+
version: "20.2.0-next.2",
|
|
1435
|
+
ngImport: i0,
|
|
1436
|
+
type: NoDataRowOutlet,
|
|
1437
|
+
deps: [],
|
|
1438
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1439
|
+
});
|
|
1440
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
1441
|
+
minVersion: "14.0.0",
|
|
1442
|
+
version: "20.2.0-next.2",
|
|
1443
|
+
type: NoDataRowOutlet,
|
|
1444
|
+
isStandalone: true,
|
|
1445
|
+
selector: "[noDataRowOutlet]",
|
|
1446
|
+
ngImport: i0
|
|
1447
|
+
});
|
|
1200
1448
|
}
|
|
1201
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1449
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1450
|
+
minVersion: "12.0.0",
|
|
1451
|
+
version: "20.2.0-next.2",
|
|
1452
|
+
ngImport: i0,
|
|
1453
|
+
type: NoDataRowOutlet,
|
|
1454
|
+
decorators: [{
|
|
1455
|
+
type: Directive,
|
|
1456
|
+
args: [{
|
|
1457
|
+
selector: '[noDataRowOutlet]'
|
|
1458
|
+
}]
|
|
1459
|
+
}],
|
|
1460
|
+
ctorParameters: () => []
|
|
1461
|
+
});
|
|
1213
1462
|
class CdkTable {
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
/**
|
|
1322
|
-
* Utility class that is responsible for applying the appropriate sticky positioning styles to
|
|
1323
|
-
* the table's rows and cells.
|
|
1324
|
-
*/
|
|
1325
|
-
_stickyStyler;
|
|
1326
|
-
/**
|
|
1327
|
-
* CSS class added to any row or cell that has sticky positioning applied. May be overridden by
|
|
1328
|
-
* table subclasses.
|
|
1329
|
-
*/
|
|
1330
|
-
stickyCssClass = 'cdk-table-sticky';
|
|
1331
|
-
/**
|
|
1332
|
-
* Whether to manually add position: sticky to all sticky cell elements. Not needed if
|
|
1333
|
-
* the position is set in a selector associated with the value of stickyCssClass. May be
|
|
1334
|
-
* overridden by table subclasses
|
|
1335
|
-
*/
|
|
1336
|
-
needsPositionStickyOnElement = true;
|
|
1337
|
-
/** Whether the component is being rendered on the server. */
|
|
1338
|
-
_isServer;
|
|
1339
|
-
/** Whether the no data row is currently showing anything. */
|
|
1340
|
-
_isShowingNoDataRow = false;
|
|
1341
|
-
/** Whether the table has rendered out all the outlets for the first time. */
|
|
1342
|
-
_hasAllOutlets = false;
|
|
1343
|
-
/** Whether the table is done initializing. */
|
|
1344
|
-
_hasInitialized = false;
|
|
1345
|
-
/** Aria role to apply to the table's cells based on the table's own role. */
|
|
1346
|
-
_getCellRole() {
|
|
1347
|
-
// Perform this lazily in case the table's role was updated by a directive after construction.
|
|
1348
|
-
if (this._cellRoleInternal === undefined) {
|
|
1349
|
-
// Note that we set `role="cell"` even on native `td` elements,
|
|
1350
|
-
// because some browsers seem to require it. See #29784.
|
|
1351
|
-
const tableRole = this._elementRef.nativeElement.getAttribute('role');
|
|
1352
|
-
return tableRole === 'grid' || tableRole === 'treegrid' ? 'gridcell' : 'cell';
|
|
1353
|
-
}
|
|
1354
|
-
return this._cellRoleInternal;
|
|
1355
|
-
}
|
|
1356
|
-
_cellRoleInternal = undefined;
|
|
1357
|
-
/**
|
|
1358
|
-
* Tracking function that will be used to check the differences in data changes. Used similarly
|
|
1359
|
-
* to `ngFor` `trackBy` function. Optimize row operations by identifying a row based on its data
|
|
1360
|
-
* relative to the function to know if a row should be added/removed/moved.
|
|
1361
|
-
* Accepts a function that takes two parameters, `index` and `item`.
|
|
1362
|
-
*/
|
|
1363
|
-
get trackBy() {
|
|
1364
|
-
return this._trackByFn;
|
|
1365
|
-
}
|
|
1366
|
-
set trackBy(fn) {
|
|
1367
|
-
if ((typeof ngDevMode === 'undefined' || ngDevMode) && fn != null && typeof fn !== 'function') {
|
|
1368
|
-
console.warn(`trackBy must be a function, but received ${JSON.stringify(fn)}.`);
|
|
1369
|
-
}
|
|
1370
|
-
this._trackByFn = fn;
|
|
1371
|
-
}
|
|
1372
|
-
_trackByFn;
|
|
1373
|
-
/**
|
|
1374
|
-
* The table's source of data, which can be provided in three ways (in order of complexity):
|
|
1375
|
-
* - Simple data array (each object represents one table row)
|
|
1376
|
-
* - Stream that emits a data array each time the array changes
|
|
1377
|
-
* - `DataSource` object that implements the connect/disconnect interface.
|
|
1378
|
-
*
|
|
1379
|
-
* If a data array is provided, the table must be notified when the array's objects are
|
|
1380
|
-
* added, removed, or moved. This can be done by calling the `renderRows()` function which will
|
|
1381
|
-
* render the diff since the last table render. If the data array reference is changed, the table
|
|
1382
|
-
* will automatically trigger an update to the rows.
|
|
1383
|
-
*
|
|
1384
|
-
* When providing an Observable stream, the table will trigger an update automatically when the
|
|
1385
|
-
* stream emits a new array of data.
|
|
1386
|
-
*
|
|
1387
|
-
* Finally, when providing a `DataSource` object, the table will use the Observable stream
|
|
1388
|
-
* provided by the connect function and trigger updates when that stream emits new data array
|
|
1389
|
-
* values. During the table's ngOnDestroy or when the data source is removed from the table, the
|
|
1390
|
-
* table will call the DataSource's `disconnect` function (may be useful for cleaning up any
|
|
1391
|
-
* subscriptions registered during the connect process).
|
|
1392
|
-
*/
|
|
1393
|
-
get dataSource() {
|
|
1394
|
-
return this._dataSource;
|
|
1395
|
-
}
|
|
1396
|
-
set dataSource(dataSource) {
|
|
1397
|
-
if (this._dataSource !== dataSource) {
|
|
1398
|
-
this._switchDataSource(dataSource);
|
|
1399
|
-
}
|
|
1400
|
-
}
|
|
1401
|
-
_dataSource;
|
|
1402
|
-
/**
|
|
1403
|
-
* Whether to allow multiple rows per data object by evaluating which rows evaluate their 'when'
|
|
1404
|
-
* predicate to true. If `multiTemplateDataRows` is false, which is the default value, then each
|
|
1405
|
-
* dataobject will render the first row that evaluates its when predicate to true, in the order
|
|
1406
|
-
* defined in the table, or otherwise the default row which does not have a when predicate.
|
|
1407
|
-
*/
|
|
1408
|
-
get multiTemplateDataRows() {
|
|
1409
|
-
return this._multiTemplateDataRows;
|
|
1410
|
-
}
|
|
1411
|
-
set multiTemplateDataRows(value) {
|
|
1412
|
-
this._multiTemplateDataRows = value;
|
|
1413
|
-
// In Ivy if this value is set via a static attribute (e.g. <table multiTemplateDataRows>),
|
|
1414
|
-
// this setter will be invoked before the row outlet has been defined hence the null check.
|
|
1415
|
-
if (this._rowOutlet && this._rowOutlet.viewContainer.length) {
|
|
1416
|
-
this._forceRenderDataRows();
|
|
1417
|
-
this.updateStickyColumnStyles();
|
|
1418
|
-
}
|
|
1419
|
-
}
|
|
1420
|
-
_multiTemplateDataRows = false;
|
|
1421
|
-
/**
|
|
1422
|
-
* Whether to use a fixed table layout. Enabling this option will enforce consistent column widths
|
|
1423
|
-
* and optimize rendering sticky styles for native tables. No-op for flex tables.
|
|
1424
|
-
*/
|
|
1425
|
-
get fixedLayout() {
|
|
1426
|
-
return this._fixedLayout;
|
|
1427
|
-
}
|
|
1428
|
-
set fixedLayout(value) {
|
|
1429
|
-
this._fixedLayout = value;
|
|
1430
|
-
// Toggling `fixedLayout` may change column widths. Sticky column styles should be recalculated.
|
|
1431
|
-
this._forceRecalculateCellWidths = true;
|
|
1432
|
-
this._stickyColumnStylesNeedReset = true;
|
|
1433
|
-
}
|
|
1434
|
-
_fixedLayout = false;
|
|
1435
|
-
/**
|
|
1436
|
-
* Emits when the table completes rendering a set of data rows based on the latest data from the
|
|
1437
|
-
* data source, even if the set of rows is empty.
|
|
1438
|
-
*/
|
|
1439
|
-
contentChanged = new EventEmitter();
|
|
1440
|
-
// TODO(andrewseguin): Remove max value as the end index
|
|
1441
|
-
// and instead calculate the view on init and scroll.
|
|
1442
|
-
/**
|
|
1443
|
-
* Stream containing the latest information on what rows are being displayed on screen.
|
|
1444
|
-
* Can be used by the data source to as a heuristic of what data should be provided.
|
|
1445
|
-
*
|
|
1446
|
-
* @docs-private
|
|
1447
|
-
*/
|
|
1448
|
-
viewChange = new BehaviorSubject({
|
|
1449
|
-
start: 0,
|
|
1450
|
-
end: Number.MAX_VALUE,
|
|
1463
|
+
_differs = inject(IterableDiffers);
|
|
1464
|
+
_changeDetectorRef = inject(ChangeDetectorRef);
|
|
1465
|
+
_elementRef = inject(ElementRef);
|
|
1466
|
+
_dir = inject(Directionality, {
|
|
1467
|
+
optional: true
|
|
1468
|
+
});
|
|
1469
|
+
_platform = inject(Platform);
|
|
1470
|
+
_viewRepeater = inject(_VIEW_REPEATER_STRATEGY);
|
|
1471
|
+
_viewportRuler = inject(ViewportRuler);
|
|
1472
|
+
_stickyPositioningListener = inject(STICKY_POSITIONING_LISTENER, {
|
|
1473
|
+
optional: true,
|
|
1474
|
+
skipSelf: true
|
|
1475
|
+
});
|
|
1476
|
+
_document = inject(DOCUMENT);
|
|
1477
|
+
_data;
|
|
1478
|
+
_onDestroy = new Subject();
|
|
1479
|
+
_renderRows;
|
|
1480
|
+
_renderChangeSubscription;
|
|
1481
|
+
_columnDefsByName = new Map();
|
|
1482
|
+
_rowDefs;
|
|
1483
|
+
_headerRowDefs;
|
|
1484
|
+
_footerRowDefs;
|
|
1485
|
+
_dataDiffer;
|
|
1486
|
+
_defaultRowDef;
|
|
1487
|
+
_customColumnDefs = new Set();
|
|
1488
|
+
_customRowDefs = new Set();
|
|
1489
|
+
_customHeaderRowDefs = new Set();
|
|
1490
|
+
_customFooterRowDefs = new Set();
|
|
1491
|
+
_customNoDataRow;
|
|
1492
|
+
_headerRowDefChanged = true;
|
|
1493
|
+
_footerRowDefChanged = true;
|
|
1494
|
+
_stickyColumnStylesNeedReset = true;
|
|
1495
|
+
_forceRecalculateCellWidths = true;
|
|
1496
|
+
_cachedRenderRowsMap = new Map();
|
|
1497
|
+
_isNativeHtmlTable;
|
|
1498
|
+
_stickyStyler;
|
|
1499
|
+
stickyCssClass = 'cdk-table-sticky';
|
|
1500
|
+
needsPositionStickyOnElement = true;
|
|
1501
|
+
_isServer;
|
|
1502
|
+
_isShowingNoDataRow = false;
|
|
1503
|
+
_hasAllOutlets = false;
|
|
1504
|
+
_hasInitialized = false;
|
|
1505
|
+
_getCellRole() {
|
|
1506
|
+
if (this._cellRoleInternal === undefined) {
|
|
1507
|
+
const tableRole = this._elementRef.nativeElement.getAttribute('role');
|
|
1508
|
+
return tableRole === 'grid' || tableRole === 'treegrid' ? 'gridcell' : 'cell';
|
|
1509
|
+
}
|
|
1510
|
+
return this._cellRoleInternal;
|
|
1511
|
+
}
|
|
1512
|
+
_cellRoleInternal = undefined;
|
|
1513
|
+
get trackBy() {
|
|
1514
|
+
return this._trackByFn;
|
|
1515
|
+
}
|
|
1516
|
+
set trackBy(fn) {
|
|
1517
|
+
if ((typeof ngDevMode === 'undefined' || ngDevMode) && fn != null && typeof fn !== 'function') {
|
|
1518
|
+
console.warn(`trackBy must be a function, but received ${JSON.stringify(fn)}.`);
|
|
1519
|
+
}
|
|
1520
|
+
this._trackByFn = fn;
|
|
1521
|
+
}
|
|
1522
|
+
_trackByFn;
|
|
1523
|
+
get dataSource() {
|
|
1524
|
+
return this._dataSource;
|
|
1525
|
+
}
|
|
1526
|
+
set dataSource(dataSource) {
|
|
1527
|
+
if (this._dataSource !== dataSource) {
|
|
1528
|
+
this._switchDataSource(dataSource);
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
_dataSource;
|
|
1532
|
+
get multiTemplateDataRows() {
|
|
1533
|
+
return this._multiTemplateDataRows;
|
|
1534
|
+
}
|
|
1535
|
+
set multiTemplateDataRows(value) {
|
|
1536
|
+
this._multiTemplateDataRows = value;
|
|
1537
|
+
if (this._rowOutlet && this._rowOutlet.viewContainer.length) {
|
|
1538
|
+
this._forceRenderDataRows();
|
|
1539
|
+
this.updateStickyColumnStyles();
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
_multiTemplateDataRows = false;
|
|
1543
|
+
get fixedLayout() {
|
|
1544
|
+
return this._fixedLayout;
|
|
1545
|
+
}
|
|
1546
|
+
set fixedLayout(value) {
|
|
1547
|
+
this._fixedLayout = value;
|
|
1548
|
+
this._forceRecalculateCellWidths = true;
|
|
1549
|
+
this._stickyColumnStylesNeedReset = true;
|
|
1550
|
+
}
|
|
1551
|
+
_fixedLayout = false;
|
|
1552
|
+
contentChanged = new EventEmitter();
|
|
1553
|
+
viewChange = new BehaviorSubject({
|
|
1554
|
+
start: 0,
|
|
1555
|
+
end: Number.MAX_VALUE
|
|
1556
|
+
});
|
|
1557
|
+
_rowOutlet;
|
|
1558
|
+
_headerRowOutlet;
|
|
1559
|
+
_footerRowOutlet;
|
|
1560
|
+
_noDataRowOutlet;
|
|
1561
|
+
_contentColumnDefs;
|
|
1562
|
+
_contentRowDefs;
|
|
1563
|
+
_contentHeaderRowDefs;
|
|
1564
|
+
_contentFooterRowDefs;
|
|
1565
|
+
_noDataRow;
|
|
1566
|
+
_injector = inject(Injector);
|
|
1567
|
+
constructor() {
|
|
1568
|
+
const role = inject(new HostAttributeToken('role'), {
|
|
1569
|
+
optional: true
|
|
1451
1570
|
});
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
_headerRowOutlet;
|
|
1455
|
-
_footerRowOutlet;
|
|
1456
|
-
_noDataRowOutlet;
|
|
1457
|
-
/**
|
|
1458
|
-
* The column definitions provided by the user that contain what the header, data, and footer
|
|
1459
|
-
* cells should render for each column.
|
|
1460
|
-
*/
|
|
1461
|
-
_contentColumnDefs;
|
|
1462
|
-
/** Set of data row definitions that were provided to the table as content children. */
|
|
1463
|
-
_contentRowDefs;
|
|
1464
|
-
/** Set of header row definitions that were provided to the table as content children. */
|
|
1465
|
-
_contentHeaderRowDefs;
|
|
1466
|
-
/** Set of footer row definitions that were provided to the table as content children. */
|
|
1467
|
-
_contentFooterRowDefs;
|
|
1468
|
-
/** Row definition that will only be rendered if there's no data in the table. */
|
|
1469
|
-
_noDataRow;
|
|
1470
|
-
_injector = inject(Injector);
|
|
1471
|
-
constructor() {
|
|
1472
|
-
const role = inject(new HostAttributeToken('role'), { optional: true });
|
|
1473
|
-
if (!role) {
|
|
1474
|
-
this._elementRef.nativeElement.setAttribute('role', 'table');
|
|
1475
|
-
}
|
|
1476
|
-
this._isServer = !this._platform.isBrowser;
|
|
1477
|
-
this._isNativeHtmlTable = this._elementRef.nativeElement.nodeName === 'TABLE';
|
|
1478
|
-
// Set up the trackBy function so that it uses the `RenderRow` as its identity by default. If
|
|
1479
|
-
// the user has provided a custom trackBy, return the result of that function as evaluated
|
|
1480
|
-
// with the values of the `RenderRow`'s data and index.
|
|
1481
|
-
this._dataDiffer = this._differs.find([]).create((_i, dataRow) => {
|
|
1482
|
-
return this.trackBy ? this.trackBy(dataRow.dataIndex, dataRow.data) : dataRow;
|
|
1483
|
-
});
|
|
1484
|
-
}
|
|
1485
|
-
ngOnInit() {
|
|
1486
|
-
this._setupStickyStyler();
|
|
1487
|
-
this._viewportRuler
|
|
1488
|
-
.change()
|
|
1489
|
-
.pipe(takeUntil(this._onDestroy))
|
|
1490
|
-
.subscribe(() => {
|
|
1491
|
-
this._forceRecalculateCellWidths = true;
|
|
1492
|
-
});
|
|
1493
|
-
}
|
|
1494
|
-
ngAfterContentInit() {
|
|
1495
|
-
this._hasInitialized = true;
|
|
1496
|
-
}
|
|
1497
|
-
ngAfterContentChecked() {
|
|
1498
|
-
// Only start re-rendering in `ngAfterContentChecked` after the first render.
|
|
1499
|
-
if (this._canRender()) {
|
|
1500
|
-
this._render();
|
|
1501
|
-
}
|
|
1502
|
-
}
|
|
1503
|
-
ngOnDestroy() {
|
|
1504
|
-
this._stickyStyler?.destroy();
|
|
1505
|
-
[
|
|
1506
|
-
this._rowOutlet?.viewContainer,
|
|
1507
|
-
this._headerRowOutlet?.viewContainer,
|
|
1508
|
-
this._footerRowOutlet?.viewContainer,
|
|
1509
|
-
this._cachedRenderRowsMap,
|
|
1510
|
-
this._customColumnDefs,
|
|
1511
|
-
this._customRowDefs,
|
|
1512
|
-
this._customHeaderRowDefs,
|
|
1513
|
-
this._customFooterRowDefs,
|
|
1514
|
-
this._columnDefsByName,
|
|
1515
|
-
].forEach((def) => {
|
|
1516
|
-
def?.clear();
|
|
1517
|
-
});
|
|
1518
|
-
this._headerRowDefs = [];
|
|
1519
|
-
this._footerRowDefs = [];
|
|
1520
|
-
this._defaultRowDef = null;
|
|
1521
|
-
this._onDestroy.next();
|
|
1522
|
-
this._onDestroy.complete();
|
|
1523
|
-
if (isDataSource(this.dataSource)) {
|
|
1524
|
-
this.dataSource.disconnect(this);
|
|
1525
|
-
}
|
|
1571
|
+
if (!role) {
|
|
1572
|
+
this._elementRef.nativeElement.setAttribute('role', 'table');
|
|
1526
1573
|
}
|
|
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
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
}
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
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
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
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
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
if (this._headerRowDefChanged) {
|
|
1739
|
-
this._forceRenderHeaderRows();
|
|
1740
|
-
this._headerRowDefChanged = false;
|
|
1741
|
-
}
|
|
1742
|
-
// If the footer row definition has been changed, trigger a render to the footer row.
|
|
1743
|
-
if (this._footerRowDefChanged) {
|
|
1744
|
-
this._forceRenderFooterRows();
|
|
1745
|
-
this._footerRowDefChanged = false;
|
|
1746
|
-
}
|
|
1747
|
-
// If there is a data source and row definitions, connect to the data source unless a
|
|
1748
|
-
// connection has already been made.
|
|
1749
|
-
if (this.dataSource && this._rowDefs.length > 0 && !this._renderChangeSubscription) {
|
|
1750
|
-
this._observeRenderChanges();
|
|
1751
|
-
}
|
|
1752
|
-
else if (this._stickyColumnStylesNeedReset) {
|
|
1753
|
-
// In the above case, _observeRenderChanges will result in updateStickyColumnStyles being
|
|
1754
|
-
// called when it row data arrives. Otherwise, we need to call it proactively.
|
|
1755
|
-
this.updateStickyColumnStyles();
|
|
1756
|
-
}
|
|
1757
|
-
this._checkStickyStates();
|
|
1758
|
-
}
|
|
1759
|
-
/**
|
|
1760
|
-
* Get the list of RenderRow objects to render according to the current list of data and defined
|
|
1761
|
-
* row definitions. If the previous list already contained a particular pair, it should be reused
|
|
1762
|
-
* so that the differ equates their references.
|
|
1763
|
-
*/
|
|
1764
|
-
_getAllRenderRows() {
|
|
1765
|
-
const renderRows = [];
|
|
1766
|
-
// Store the cache and create a new one. Any re-used RenderRow objects will be moved into the
|
|
1767
|
-
// new cache while unused ones can be picked up by garbage collection.
|
|
1768
|
-
const prevCachedRenderRows = this._cachedRenderRowsMap;
|
|
1769
|
-
this._cachedRenderRowsMap = new Map();
|
|
1770
|
-
if (!this._data) {
|
|
1771
|
-
return renderRows;
|
|
1772
|
-
}
|
|
1773
|
-
// For each data object, get the list of rows that should be rendered, represented by the
|
|
1774
|
-
// respective `RenderRow` object which is the pair of `data` and `CdkRowDef`.
|
|
1775
|
-
for (let i = 0; i < this._data.length; i++) {
|
|
1776
|
-
let data = this._data[i];
|
|
1777
|
-
const renderRowsForData = this._getRenderRowsForData(data, i, prevCachedRenderRows.get(data));
|
|
1778
|
-
if (!this._cachedRenderRowsMap.has(data)) {
|
|
1779
|
-
this._cachedRenderRowsMap.set(data, new WeakMap());
|
|
1780
|
-
}
|
|
1781
|
-
for (let j = 0; j < renderRowsForData.length; j++) {
|
|
1782
|
-
let renderRow = renderRowsForData[j];
|
|
1783
|
-
const cache = this._cachedRenderRowsMap.get(renderRow.data);
|
|
1784
|
-
if (cache.has(renderRow.rowDef)) {
|
|
1785
|
-
cache.get(renderRow.rowDef).push(renderRow);
|
|
1786
|
-
}
|
|
1787
|
-
else {
|
|
1788
|
-
cache.set(renderRow.rowDef, [renderRow]);
|
|
1789
|
-
}
|
|
1790
|
-
renderRows.push(renderRow);
|
|
1791
|
-
}
|
|
1792
|
-
}
|
|
1793
|
-
return renderRows;
|
|
1794
|
-
}
|
|
1795
|
-
/**
|
|
1796
|
-
* Gets a list of `RenderRow<T>` for the provided data object and any `CdkRowDef` objects that
|
|
1797
|
-
* should be rendered for this data. Reuses the cached RenderRow objects if they match the same
|
|
1798
|
-
* `(T, CdkRowDef)` pair.
|
|
1799
|
-
*/
|
|
1800
|
-
_getRenderRowsForData(data, dataIndex, cache) {
|
|
1801
|
-
const rowDefs = this._getRowDefs(data, dataIndex);
|
|
1802
|
-
return rowDefs.map(rowDef => {
|
|
1803
|
-
const cachedRenderRows = cache && cache.has(rowDef) ? cache.get(rowDef) : [];
|
|
1804
|
-
if (cachedRenderRows.length) {
|
|
1805
|
-
const dataRow = cachedRenderRows.shift();
|
|
1806
|
-
dataRow.dataIndex = dataIndex;
|
|
1807
|
-
return dataRow;
|
|
1808
|
-
}
|
|
1809
|
-
else {
|
|
1810
|
-
return { data, rowDef, dataIndex };
|
|
1811
|
-
}
|
|
1812
|
-
});
|
|
1813
|
-
}
|
|
1814
|
-
/** Update the map containing the content's column definitions. */
|
|
1815
|
-
_cacheColumnDefs() {
|
|
1816
|
-
this._columnDefsByName.clear();
|
|
1817
|
-
const columnDefs = mergeArrayAndSet(this._getOwnDefs(this._contentColumnDefs), this._customColumnDefs);
|
|
1818
|
-
columnDefs.forEach(columnDef => {
|
|
1819
|
-
if (this._columnDefsByName.has(columnDef.name) &&
|
|
1820
|
-
(typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
1821
|
-
throw getTableDuplicateColumnNameError(columnDef.name);
|
|
1822
|
-
}
|
|
1823
|
-
this._columnDefsByName.set(columnDef.name, columnDef);
|
|
1824
|
-
});
|
|
1825
|
-
}
|
|
1826
|
-
/** Update the list of all available row definitions that can be used. */
|
|
1827
|
-
_cacheRowDefs() {
|
|
1828
|
-
this._headerRowDefs = mergeArrayAndSet(this._getOwnDefs(this._contentHeaderRowDefs), this._customHeaderRowDefs);
|
|
1829
|
-
this._footerRowDefs = mergeArrayAndSet(this._getOwnDefs(this._contentFooterRowDefs), this._customFooterRowDefs);
|
|
1830
|
-
this._rowDefs = mergeArrayAndSet(this._getOwnDefs(this._contentRowDefs), this._customRowDefs);
|
|
1831
|
-
// After all row definitions are determined, find the row definition to be considered default.
|
|
1832
|
-
const defaultRowDefs = this._rowDefs.filter(def => !def.when);
|
|
1833
|
-
if (!this.multiTemplateDataRows &&
|
|
1834
|
-
defaultRowDefs.length > 1 &&
|
|
1835
|
-
(typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
1836
|
-
throw getTableMultipleDefaultRowDefsError();
|
|
1837
|
-
}
|
|
1838
|
-
this._defaultRowDef = defaultRowDefs[0];
|
|
1839
|
-
}
|
|
1840
|
-
/**
|
|
1841
|
-
* Check if the header, data, or footer rows have changed what columns they want to display or
|
|
1842
|
-
* whether the sticky states have changed for the header or footer. If there is a diff, then
|
|
1843
|
-
* re-render that section.
|
|
1844
|
-
*/
|
|
1845
|
-
_renderUpdatedColumns() {
|
|
1846
|
-
const columnsDiffReducer = (acc, def) => {
|
|
1847
|
-
// The differ should be run for every column, even if `acc` is already
|
|
1848
|
-
// true (see #29922)
|
|
1849
|
-
const diff = !!def.getColumnsDiff();
|
|
1850
|
-
return acc || diff;
|
|
1851
|
-
};
|
|
1852
|
-
// Force re-render data rows if the list of column definitions have changed.
|
|
1853
|
-
const dataColumnsChanged = this._rowDefs.reduce(columnsDiffReducer, false);
|
|
1854
|
-
if (dataColumnsChanged) {
|
|
1855
|
-
this._forceRenderDataRows();
|
|
1856
|
-
}
|
|
1857
|
-
// Force re-render header/footer rows if the list of column definitions have changed.
|
|
1858
|
-
const headerColumnsChanged = this._headerRowDefs.reduce(columnsDiffReducer, false);
|
|
1859
|
-
if (headerColumnsChanged) {
|
|
1860
|
-
this._forceRenderHeaderRows();
|
|
1861
|
-
}
|
|
1862
|
-
const footerColumnsChanged = this._footerRowDefs.reduce(columnsDiffReducer, false);
|
|
1863
|
-
if (footerColumnsChanged) {
|
|
1864
|
-
this._forceRenderFooterRows();
|
|
1865
|
-
}
|
|
1866
|
-
return dataColumnsChanged || headerColumnsChanged || footerColumnsChanged;
|
|
1867
|
-
}
|
|
1868
|
-
/**
|
|
1869
|
-
* Switch to the provided data source by resetting the data and unsubscribing from the current
|
|
1870
|
-
* render change subscription if one exists. If the data source is null, interpret this by
|
|
1871
|
-
* clearing the row outlet. Otherwise start listening for new data.
|
|
1872
|
-
*/
|
|
1873
|
-
_switchDataSource(dataSource) {
|
|
1874
|
-
this._data = [];
|
|
1875
|
-
if (isDataSource(this.dataSource)) {
|
|
1876
|
-
this.dataSource.disconnect(this);
|
|
1877
|
-
}
|
|
1878
|
-
// Stop listening for data from the previous data source.
|
|
1879
|
-
if (this._renderChangeSubscription) {
|
|
1880
|
-
this._renderChangeSubscription.unsubscribe();
|
|
1881
|
-
this._renderChangeSubscription = null;
|
|
1882
|
-
}
|
|
1883
|
-
if (!dataSource) {
|
|
1884
|
-
if (this._dataDiffer) {
|
|
1885
|
-
this._dataDiffer.diff([]);
|
|
1886
|
-
}
|
|
1887
|
-
if (this._rowOutlet) {
|
|
1888
|
-
this._rowOutlet.viewContainer.clear();
|
|
1889
|
-
}
|
|
1890
|
-
}
|
|
1891
|
-
this._dataSource = dataSource;
|
|
1892
|
-
}
|
|
1893
|
-
/** Set up a subscription for the data provided by the data source. */
|
|
1894
|
-
_observeRenderChanges() {
|
|
1895
|
-
// If no data source has been set, there is nothing to observe for changes.
|
|
1896
|
-
if (!this.dataSource) {
|
|
1897
|
-
return;
|
|
1898
|
-
}
|
|
1899
|
-
let dataStream;
|
|
1900
|
-
if (isDataSource(this.dataSource)) {
|
|
1901
|
-
dataStream = this.dataSource.connect(this);
|
|
1902
|
-
}
|
|
1903
|
-
else if (isObservable(this.dataSource)) {
|
|
1904
|
-
dataStream = this.dataSource;
|
|
1905
|
-
}
|
|
1906
|
-
else if (Array.isArray(this.dataSource)) {
|
|
1907
|
-
dataStream = of(this.dataSource);
|
|
1908
|
-
}
|
|
1909
|
-
if (dataStream === undefined && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
1910
|
-
throw getTableUnknownDataSourceError();
|
|
1911
|
-
}
|
|
1912
|
-
this._renderChangeSubscription = dataStream
|
|
1913
|
-
.pipe(takeUntil(this._onDestroy))
|
|
1914
|
-
.subscribe(data => {
|
|
1915
|
-
this._data = data || [];
|
|
1916
|
-
this.renderRows();
|
|
1917
|
-
});
|
|
1918
|
-
}
|
|
1919
|
-
/**
|
|
1920
|
-
* Clears any existing content in the header row outlet and creates a new embedded view
|
|
1921
|
-
* in the outlet using the header row definition.
|
|
1922
|
-
*/
|
|
1923
|
-
_forceRenderHeaderRows() {
|
|
1924
|
-
// Clear the header row outlet if any content exists.
|
|
1925
|
-
if (this._headerRowOutlet.viewContainer.length > 0) {
|
|
1926
|
-
this._headerRowOutlet.viewContainer.clear();
|
|
1927
|
-
}
|
|
1928
|
-
this._headerRowDefs.forEach((def, i) => this._renderRow(this._headerRowOutlet, def, i));
|
|
1929
|
-
this.updateStickyHeaderRowStyles();
|
|
1930
|
-
}
|
|
1931
|
-
/**
|
|
1932
|
-
* Clears any existing content in the footer row outlet and creates a new embedded view
|
|
1933
|
-
* in the outlet using the footer row definition.
|
|
1934
|
-
*/
|
|
1935
|
-
_forceRenderFooterRows() {
|
|
1936
|
-
// Clear the footer row outlet if any content exists.
|
|
1937
|
-
if (this._footerRowOutlet.viewContainer.length > 0) {
|
|
1938
|
-
this._footerRowOutlet.viewContainer.clear();
|
|
1939
|
-
}
|
|
1940
|
-
this._footerRowDefs.forEach((def, i) => this._renderRow(this._footerRowOutlet, def, i));
|
|
1941
|
-
this.updateStickyFooterRowStyles();
|
|
1942
|
-
}
|
|
1943
|
-
/** Adds the sticky column styles for the rows according to the columns' stick states. */
|
|
1944
|
-
_addStickyColumnStyles(rows, rowDef) {
|
|
1945
|
-
const columnDefs = Array.from(rowDef?.columns || []).map(columnName => {
|
|
1946
|
-
const columnDef = this._columnDefsByName.get(columnName);
|
|
1947
|
-
if (!columnDef && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
1948
|
-
throw getTableUnknownColumnError(columnName);
|
|
1949
|
-
}
|
|
1950
|
-
return columnDef;
|
|
1951
|
-
});
|
|
1952
|
-
const stickyStartStates = columnDefs.map(columnDef => columnDef.sticky);
|
|
1953
|
-
const stickyEndStates = columnDefs.map(columnDef => columnDef.stickyEnd);
|
|
1954
|
-
this._stickyStyler.updateStickyColumns(rows, stickyStartStates, stickyEndStates, !this._fixedLayout || this._forceRecalculateCellWidths);
|
|
1955
|
-
}
|
|
1956
|
-
/** Gets the list of rows that have been rendered in the row outlet. */
|
|
1957
|
-
_getRenderedRows(rowOutlet) {
|
|
1958
|
-
const renderedRows = [];
|
|
1959
|
-
for (let i = 0; i < rowOutlet.viewContainer.length; i++) {
|
|
1960
|
-
const viewRef = rowOutlet.viewContainer.get(i);
|
|
1961
|
-
renderedRows.push(viewRef.rootNodes[0]);
|
|
1962
|
-
}
|
|
1963
|
-
return renderedRows;
|
|
1964
|
-
}
|
|
1965
|
-
/**
|
|
1966
|
-
* Get the matching row definitions that should be used for this row data. If there is only
|
|
1967
|
-
* one row definition, it is returned. Otherwise, find the row definitions that has a when
|
|
1968
|
-
* predicate that returns true with the data. If none return true, return the default row
|
|
1969
|
-
* definition.
|
|
1970
|
-
*/
|
|
1971
|
-
_getRowDefs(data, dataIndex) {
|
|
1972
|
-
if (this._rowDefs.length == 1) {
|
|
1973
|
-
return [this._rowDefs[0]];
|
|
1974
|
-
}
|
|
1975
|
-
let rowDefs = [];
|
|
1976
|
-
if (this.multiTemplateDataRows) {
|
|
1977
|
-
rowDefs = this._rowDefs.filter(def => !def.when || def.when(dataIndex, data));
|
|
1978
|
-
}
|
|
1979
|
-
else {
|
|
1980
|
-
let rowDef = this._rowDefs.find(def => def.when && def.when(dataIndex, data)) || this._defaultRowDef;
|
|
1981
|
-
if (rowDef) {
|
|
1982
|
-
rowDefs.push(rowDef);
|
|
1983
|
-
}
|
|
1984
|
-
}
|
|
1985
|
-
if (!rowDefs.length && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
1986
|
-
throw getTableMissingMatchingRowDefError(data);
|
|
1987
|
-
}
|
|
1988
|
-
return rowDefs;
|
|
1989
|
-
}
|
|
1990
|
-
_getEmbeddedViewArgs(renderRow, index) {
|
|
1991
|
-
const rowDef = renderRow.rowDef;
|
|
1992
|
-
const context = { $implicit: renderRow.data };
|
|
1574
|
+
this._isServer = !this._platform.isBrowser;
|
|
1575
|
+
this._isNativeHtmlTable = this._elementRef.nativeElement.nodeName === 'TABLE';
|
|
1576
|
+
this._dataDiffer = this._differs.find([]).create((_i, dataRow) => {
|
|
1577
|
+
return this.trackBy ? this.trackBy(dataRow.dataIndex, dataRow.data) : dataRow;
|
|
1578
|
+
});
|
|
1579
|
+
}
|
|
1580
|
+
ngOnInit() {
|
|
1581
|
+
this._setupStickyStyler();
|
|
1582
|
+
this._viewportRuler.change().pipe(takeUntil(this._onDestroy)).subscribe(() => {
|
|
1583
|
+
this._forceRecalculateCellWidths = true;
|
|
1584
|
+
});
|
|
1585
|
+
}
|
|
1586
|
+
ngAfterContentInit() {
|
|
1587
|
+
this._hasInitialized = true;
|
|
1588
|
+
}
|
|
1589
|
+
ngAfterContentChecked() {
|
|
1590
|
+
if (this._canRender()) {
|
|
1591
|
+
this._render();
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
ngOnDestroy() {
|
|
1595
|
+
this._stickyStyler?.destroy();
|
|
1596
|
+
[this._rowOutlet?.viewContainer, this._headerRowOutlet?.viewContainer, this._footerRowOutlet?.viewContainer, this._cachedRenderRowsMap, this._customColumnDefs, this._customRowDefs, this._customHeaderRowDefs, this._customFooterRowDefs, this._columnDefsByName].forEach(def => {
|
|
1597
|
+
def?.clear();
|
|
1598
|
+
});
|
|
1599
|
+
this._headerRowDefs = [];
|
|
1600
|
+
this._footerRowDefs = [];
|
|
1601
|
+
this._defaultRowDef = null;
|
|
1602
|
+
this._onDestroy.next();
|
|
1603
|
+
this._onDestroy.complete();
|
|
1604
|
+
if (isDataSource(this.dataSource)) {
|
|
1605
|
+
this.dataSource.disconnect(this);
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
renderRows() {
|
|
1609
|
+
this._renderRows = this._getAllRenderRows();
|
|
1610
|
+
const changes = this._dataDiffer.diff(this._renderRows);
|
|
1611
|
+
if (!changes) {
|
|
1612
|
+
this._updateNoDataRow();
|
|
1613
|
+
this.contentChanged.next();
|
|
1614
|
+
return;
|
|
1615
|
+
}
|
|
1616
|
+
const viewContainer = this._rowOutlet.viewContainer;
|
|
1617
|
+
this._viewRepeater.applyChanges(changes, viewContainer, (record, _adjustedPreviousIndex, currentIndex) => this._getEmbeddedViewArgs(record.item, currentIndex), record => record.item.data, change => {
|
|
1618
|
+
if (change.operation === _ViewRepeaterOperation.INSERTED && change.context) {
|
|
1619
|
+
this._renderCellTemplateForItem(change.record.item.rowDef, change.context);
|
|
1620
|
+
}
|
|
1621
|
+
});
|
|
1622
|
+
this._updateRowIndexContext();
|
|
1623
|
+
changes.forEachIdentityChange(record => {
|
|
1624
|
+
const rowView = viewContainer.get(record.currentIndex);
|
|
1625
|
+
rowView.context.$implicit = record.item.data;
|
|
1626
|
+
});
|
|
1627
|
+
this._updateNoDataRow();
|
|
1628
|
+
this.contentChanged.next();
|
|
1629
|
+
this.updateStickyColumnStyles();
|
|
1630
|
+
}
|
|
1631
|
+
addColumnDef(columnDef) {
|
|
1632
|
+
this._customColumnDefs.add(columnDef);
|
|
1633
|
+
}
|
|
1634
|
+
removeColumnDef(columnDef) {
|
|
1635
|
+
this._customColumnDefs.delete(columnDef);
|
|
1636
|
+
}
|
|
1637
|
+
addRowDef(rowDef) {
|
|
1638
|
+
this._customRowDefs.add(rowDef);
|
|
1639
|
+
}
|
|
1640
|
+
removeRowDef(rowDef) {
|
|
1641
|
+
this._customRowDefs.delete(rowDef);
|
|
1642
|
+
}
|
|
1643
|
+
addHeaderRowDef(headerRowDef) {
|
|
1644
|
+
this._customHeaderRowDefs.add(headerRowDef);
|
|
1645
|
+
this._headerRowDefChanged = true;
|
|
1646
|
+
}
|
|
1647
|
+
removeHeaderRowDef(headerRowDef) {
|
|
1648
|
+
this._customHeaderRowDefs.delete(headerRowDef);
|
|
1649
|
+
this._headerRowDefChanged = true;
|
|
1650
|
+
}
|
|
1651
|
+
addFooterRowDef(footerRowDef) {
|
|
1652
|
+
this._customFooterRowDefs.add(footerRowDef);
|
|
1653
|
+
this._footerRowDefChanged = true;
|
|
1654
|
+
}
|
|
1655
|
+
removeFooterRowDef(footerRowDef) {
|
|
1656
|
+
this._customFooterRowDefs.delete(footerRowDef);
|
|
1657
|
+
this._footerRowDefChanged = true;
|
|
1658
|
+
}
|
|
1659
|
+
setNoDataRow(noDataRow) {
|
|
1660
|
+
this._customNoDataRow = noDataRow;
|
|
1661
|
+
}
|
|
1662
|
+
updateStickyHeaderRowStyles() {
|
|
1663
|
+
const headerRows = this._getRenderedRows(this._headerRowOutlet);
|
|
1664
|
+
if (this._isNativeHtmlTable) {
|
|
1665
|
+
const thead = closestTableSection(this._headerRowOutlet, 'thead');
|
|
1666
|
+
if (thead) {
|
|
1667
|
+
thead.style.display = headerRows.length ? '' : 'none';
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
const stickyStates = this._headerRowDefs.map(def => def.sticky);
|
|
1671
|
+
this._stickyStyler.clearStickyPositioning(headerRows, ['top']);
|
|
1672
|
+
this._stickyStyler.stickRows(headerRows, stickyStates, 'top');
|
|
1673
|
+
this._headerRowDefs.forEach(def => def.resetStickyChanged());
|
|
1674
|
+
}
|
|
1675
|
+
updateStickyFooterRowStyles() {
|
|
1676
|
+
const footerRows = this._getRenderedRows(this._footerRowOutlet);
|
|
1677
|
+
if (this._isNativeHtmlTable) {
|
|
1678
|
+
const tfoot = closestTableSection(this._footerRowOutlet, 'tfoot');
|
|
1679
|
+
if (tfoot) {
|
|
1680
|
+
tfoot.style.display = footerRows.length ? '' : 'none';
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
const stickyStates = this._footerRowDefs.map(def => def.sticky);
|
|
1684
|
+
this._stickyStyler.clearStickyPositioning(footerRows, ['bottom']);
|
|
1685
|
+
this._stickyStyler.stickRows(footerRows, stickyStates, 'bottom');
|
|
1686
|
+
this._stickyStyler.updateStickyFooterContainer(this._elementRef.nativeElement, stickyStates);
|
|
1687
|
+
this._footerRowDefs.forEach(def => def.resetStickyChanged());
|
|
1688
|
+
}
|
|
1689
|
+
updateStickyColumnStyles() {
|
|
1690
|
+
const headerRows = this._getRenderedRows(this._headerRowOutlet);
|
|
1691
|
+
const dataRows = this._getRenderedRows(this._rowOutlet);
|
|
1692
|
+
const footerRows = this._getRenderedRows(this._footerRowOutlet);
|
|
1693
|
+
if (this._isNativeHtmlTable && !this._fixedLayout || this._stickyColumnStylesNeedReset) {
|
|
1694
|
+
this._stickyStyler.clearStickyPositioning([...headerRows, ...dataRows, ...footerRows], ['left', 'right']);
|
|
1695
|
+
this._stickyColumnStylesNeedReset = false;
|
|
1696
|
+
}
|
|
1697
|
+
headerRows.forEach((headerRow, i) => {
|
|
1698
|
+
this._addStickyColumnStyles([headerRow], this._headerRowDefs[i]);
|
|
1699
|
+
});
|
|
1700
|
+
this._rowDefs.forEach(rowDef => {
|
|
1701
|
+
const rows = [];
|
|
1702
|
+
for (let i = 0; i < dataRows.length; i++) {
|
|
1703
|
+
if (this._renderRows[i].rowDef === rowDef) {
|
|
1704
|
+
rows.push(dataRows[i]);
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
this._addStickyColumnStyles(rows, rowDef);
|
|
1708
|
+
});
|
|
1709
|
+
footerRows.forEach((footerRow, i) => {
|
|
1710
|
+
this._addStickyColumnStyles([footerRow], this._footerRowDefs[i]);
|
|
1711
|
+
});
|
|
1712
|
+
Array.from(this._columnDefsByName.values()).forEach(def => def.resetStickyChanged());
|
|
1713
|
+
}
|
|
1714
|
+
_outletAssigned() {
|
|
1715
|
+
if (!this._hasAllOutlets && this._rowOutlet && this._headerRowOutlet && this._footerRowOutlet && this._noDataRowOutlet) {
|
|
1716
|
+
this._hasAllOutlets = true;
|
|
1717
|
+
if (this._canRender()) {
|
|
1718
|
+
this._render();
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
_canRender() {
|
|
1723
|
+
return this._hasAllOutlets && this._hasInitialized;
|
|
1724
|
+
}
|
|
1725
|
+
_render() {
|
|
1726
|
+
this._cacheRowDefs();
|
|
1727
|
+
this._cacheColumnDefs();
|
|
1728
|
+
if (!this._headerRowDefs.length && !this._footerRowDefs.length && !this._rowDefs.length && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
1729
|
+
throw getTableMissingRowDefsError();
|
|
1730
|
+
}
|
|
1731
|
+
const columnsChanged = this._renderUpdatedColumns();
|
|
1732
|
+
const rowDefsChanged = columnsChanged || this._headerRowDefChanged || this._footerRowDefChanged;
|
|
1733
|
+
this._stickyColumnStylesNeedReset = this._stickyColumnStylesNeedReset || rowDefsChanged;
|
|
1734
|
+
this._forceRecalculateCellWidths = rowDefsChanged;
|
|
1735
|
+
if (this._headerRowDefChanged) {
|
|
1736
|
+
this._forceRenderHeaderRows();
|
|
1737
|
+
this._headerRowDefChanged = false;
|
|
1738
|
+
}
|
|
1739
|
+
if (this._footerRowDefChanged) {
|
|
1740
|
+
this._forceRenderFooterRows();
|
|
1741
|
+
this._footerRowDefChanged = false;
|
|
1742
|
+
}
|
|
1743
|
+
if (this.dataSource && this._rowDefs.length > 0 && !this._renderChangeSubscription) {
|
|
1744
|
+
this._observeRenderChanges();
|
|
1745
|
+
} else if (this._stickyColumnStylesNeedReset) {
|
|
1746
|
+
this.updateStickyColumnStyles();
|
|
1747
|
+
}
|
|
1748
|
+
this._checkStickyStates();
|
|
1749
|
+
}
|
|
1750
|
+
_getAllRenderRows() {
|
|
1751
|
+
const renderRows = [];
|
|
1752
|
+
const prevCachedRenderRows = this._cachedRenderRowsMap;
|
|
1753
|
+
this._cachedRenderRowsMap = new Map();
|
|
1754
|
+
if (!this._data) {
|
|
1755
|
+
return renderRows;
|
|
1756
|
+
}
|
|
1757
|
+
for (let i = 0; i < this._data.length; i++) {
|
|
1758
|
+
let data = this._data[i];
|
|
1759
|
+
const renderRowsForData = this._getRenderRowsForData(data, i, prevCachedRenderRows.get(data));
|
|
1760
|
+
if (!this._cachedRenderRowsMap.has(data)) {
|
|
1761
|
+
this._cachedRenderRowsMap.set(data, new WeakMap());
|
|
1762
|
+
}
|
|
1763
|
+
for (let j = 0; j < renderRowsForData.length; j++) {
|
|
1764
|
+
let renderRow = renderRowsForData[j];
|
|
1765
|
+
const cache = this._cachedRenderRowsMap.get(renderRow.data);
|
|
1766
|
+
if (cache.has(renderRow.rowDef)) {
|
|
1767
|
+
cache.get(renderRow.rowDef).push(renderRow);
|
|
1768
|
+
} else {
|
|
1769
|
+
cache.set(renderRow.rowDef, [renderRow]);
|
|
1770
|
+
}
|
|
1771
|
+
renderRows.push(renderRow);
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
return renderRows;
|
|
1775
|
+
}
|
|
1776
|
+
_getRenderRowsForData(data, dataIndex, cache) {
|
|
1777
|
+
const rowDefs = this._getRowDefs(data, dataIndex);
|
|
1778
|
+
return rowDefs.map(rowDef => {
|
|
1779
|
+
const cachedRenderRows = cache && cache.has(rowDef) ? cache.get(rowDef) : [];
|
|
1780
|
+
if (cachedRenderRows.length) {
|
|
1781
|
+
const dataRow = cachedRenderRows.shift();
|
|
1782
|
+
dataRow.dataIndex = dataIndex;
|
|
1783
|
+
return dataRow;
|
|
1784
|
+
} else {
|
|
1993
1785
|
return {
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1786
|
+
data,
|
|
1787
|
+
rowDef,
|
|
1788
|
+
dataIndex
|
|
1997
1789
|
};
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
}
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
return rowDef.extractCellTemplate(column);
|
|
2052
|
-
});
|
|
2053
|
-
}
|
|
2054
|
-
/**
|
|
2055
|
-
* Forces a re-render of the data rows. Should be called in cases where there has been an input
|
|
2056
|
-
* change that affects the evaluation of which rows should be rendered, e.g. toggling
|
|
2057
|
-
* `multiTemplateDataRows` or adding/removing row definitions.
|
|
2058
|
-
*/
|
|
2059
|
-
_forceRenderDataRows() {
|
|
1790
|
+
}
|
|
1791
|
+
});
|
|
1792
|
+
}
|
|
1793
|
+
_cacheColumnDefs() {
|
|
1794
|
+
this._columnDefsByName.clear();
|
|
1795
|
+
const columnDefs = mergeArrayAndSet(this._getOwnDefs(this._contentColumnDefs), this._customColumnDefs);
|
|
1796
|
+
columnDefs.forEach(columnDef => {
|
|
1797
|
+
if (this._columnDefsByName.has(columnDef.name) && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
1798
|
+
throw getTableDuplicateColumnNameError(columnDef.name);
|
|
1799
|
+
}
|
|
1800
|
+
this._columnDefsByName.set(columnDef.name, columnDef);
|
|
1801
|
+
});
|
|
1802
|
+
}
|
|
1803
|
+
_cacheRowDefs() {
|
|
1804
|
+
this._headerRowDefs = mergeArrayAndSet(this._getOwnDefs(this._contentHeaderRowDefs), this._customHeaderRowDefs);
|
|
1805
|
+
this._footerRowDefs = mergeArrayAndSet(this._getOwnDefs(this._contentFooterRowDefs), this._customFooterRowDefs);
|
|
1806
|
+
this._rowDefs = mergeArrayAndSet(this._getOwnDefs(this._contentRowDefs), this._customRowDefs);
|
|
1807
|
+
const defaultRowDefs = this._rowDefs.filter(def => !def.when);
|
|
1808
|
+
if (!this.multiTemplateDataRows && defaultRowDefs.length > 1 && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
1809
|
+
throw getTableMultipleDefaultRowDefsError();
|
|
1810
|
+
}
|
|
1811
|
+
this._defaultRowDef = defaultRowDefs[0];
|
|
1812
|
+
}
|
|
1813
|
+
_renderUpdatedColumns() {
|
|
1814
|
+
const columnsDiffReducer = (acc, def) => {
|
|
1815
|
+
const diff = !!def.getColumnsDiff();
|
|
1816
|
+
return acc || diff;
|
|
1817
|
+
};
|
|
1818
|
+
const dataColumnsChanged = this._rowDefs.reduce(columnsDiffReducer, false);
|
|
1819
|
+
if (dataColumnsChanged) {
|
|
1820
|
+
this._forceRenderDataRows();
|
|
1821
|
+
}
|
|
1822
|
+
const headerColumnsChanged = this._headerRowDefs.reduce(columnsDiffReducer, false);
|
|
1823
|
+
if (headerColumnsChanged) {
|
|
1824
|
+
this._forceRenderHeaderRows();
|
|
1825
|
+
}
|
|
1826
|
+
const footerColumnsChanged = this._footerRowDefs.reduce(columnsDiffReducer, false);
|
|
1827
|
+
if (footerColumnsChanged) {
|
|
1828
|
+
this._forceRenderFooterRows();
|
|
1829
|
+
}
|
|
1830
|
+
return dataColumnsChanged || headerColumnsChanged || footerColumnsChanged;
|
|
1831
|
+
}
|
|
1832
|
+
_switchDataSource(dataSource) {
|
|
1833
|
+
this._data = [];
|
|
1834
|
+
if (isDataSource(this.dataSource)) {
|
|
1835
|
+
this.dataSource.disconnect(this);
|
|
1836
|
+
}
|
|
1837
|
+
if (this._renderChangeSubscription) {
|
|
1838
|
+
this._renderChangeSubscription.unsubscribe();
|
|
1839
|
+
this._renderChangeSubscription = null;
|
|
1840
|
+
}
|
|
1841
|
+
if (!dataSource) {
|
|
1842
|
+
if (this._dataDiffer) {
|
|
2060
1843
|
this._dataDiffer.diff([]);
|
|
1844
|
+
}
|
|
1845
|
+
if (this._rowOutlet) {
|
|
2061
1846
|
this._rowOutlet.viewContainer.clear();
|
|
2062
|
-
|
|
2063
|
-
}
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
this._dataSource = dataSource;
|
|
1850
|
+
}
|
|
1851
|
+
_observeRenderChanges() {
|
|
1852
|
+
if (!this.dataSource) {
|
|
1853
|
+
return;
|
|
1854
|
+
}
|
|
1855
|
+
let dataStream;
|
|
1856
|
+
if (isDataSource(this.dataSource)) {
|
|
1857
|
+
dataStream = this.dataSource.connect(this);
|
|
1858
|
+
} else if (isObservable(this.dataSource)) {
|
|
1859
|
+
dataStream = this.dataSource;
|
|
1860
|
+
} else if (Array.isArray(this.dataSource)) {
|
|
1861
|
+
dataStream = of(this.dataSource);
|
|
1862
|
+
}
|
|
1863
|
+
if (dataStream === undefined && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
1864
|
+
throw getTableUnknownDataSourceError();
|
|
1865
|
+
}
|
|
1866
|
+
this._renderChangeSubscription = dataStream.pipe(takeUntil(this._onDestroy)).subscribe(data => {
|
|
1867
|
+
this._data = data || [];
|
|
1868
|
+
this.renderRows();
|
|
1869
|
+
});
|
|
1870
|
+
}
|
|
1871
|
+
_forceRenderHeaderRows() {
|
|
1872
|
+
if (this._headerRowOutlet.viewContainer.length > 0) {
|
|
1873
|
+
this._headerRowOutlet.viewContainer.clear();
|
|
1874
|
+
}
|
|
1875
|
+
this._headerRowDefs.forEach((def, i) => this._renderRow(this._headerRowOutlet, def, i));
|
|
1876
|
+
this.updateStickyHeaderRowStyles();
|
|
1877
|
+
}
|
|
1878
|
+
_forceRenderFooterRows() {
|
|
1879
|
+
if (this._footerRowOutlet.viewContainer.length > 0) {
|
|
1880
|
+
this._footerRowOutlet.viewContainer.clear();
|
|
1881
|
+
}
|
|
1882
|
+
this._footerRowDefs.forEach((def, i) => this._renderRow(this._footerRowOutlet, def, i));
|
|
1883
|
+
this.updateStickyFooterRowStyles();
|
|
1884
|
+
}
|
|
1885
|
+
_addStickyColumnStyles(rows, rowDef) {
|
|
1886
|
+
const columnDefs = Array.from(rowDef?.columns || []).map(columnName => {
|
|
1887
|
+
const columnDef = this._columnDefsByName.get(columnName);
|
|
1888
|
+
if (!columnDef && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
1889
|
+
throw getTableUnknownColumnError(columnName);
|
|
1890
|
+
}
|
|
1891
|
+
return columnDef;
|
|
1892
|
+
});
|
|
1893
|
+
const stickyStartStates = columnDefs.map(columnDef => columnDef.sticky);
|
|
1894
|
+
const stickyEndStates = columnDefs.map(columnDef => columnDef.stickyEnd);
|
|
1895
|
+
this._stickyStyler.updateStickyColumns(rows, stickyStartStates, stickyEndStates, !this._fixedLayout || this._forceRecalculateCellWidths);
|
|
1896
|
+
}
|
|
1897
|
+
_getRenderedRows(rowOutlet) {
|
|
1898
|
+
const renderedRows = [];
|
|
1899
|
+
for (let i = 0; i < rowOutlet.viewContainer.length; i++) {
|
|
1900
|
+
const viewRef = rowOutlet.viewContainer.get(i);
|
|
1901
|
+
renderedRows.push(viewRef.rootNodes[0]);
|
|
1902
|
+
}
|
|
1903
|
+
return renderedRows;
|
|
1904
|
+
}
|
|
1905
|
+
_getRowDefs(data, dataIndex) {
|
|
1906
|
+
if (this._rowDefs.length == 1) {
|
|
1907
|
+
return [this._rowDefs[0]];
|
|
1908
|
+
}
|
|
1909
|
+
let rowDefs = [];
|
|
1910
|
+
if (this.multiTemplateDataRows) {
|
|
1911
|
+
rowDefs = this._rowDefs.filter(def => !def.when || def.when(dataIndex, data));
|
|
1912
|
+
} else {
|
|
1913
|
+
let rowDef = this._rowDefs.find(def => def.when && def.when(dataIndex, data)) || this._defaultRowDef;
|
|
1914
|
+
if (rowDef) {
|
|
1915
|
+
rowDefs.push(rowDef);
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
if (!rowDefs.length && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
1919
|
+
throw getTableMissingMatchingRowDefError(data);
|
|
1920
|
+
}
|
|
1921
|
+
return rowDefs;
|
|
1922
|
+
}
|
|
1923
|
+
_getEmbeddedViewArgs(renderRow, index) {
|
|
1924
|
+
const rowDef = renderRow.rowDef;
|
|
1925
|
+
const context = {
|
|
1926
|
+
$implicit: renderRow.data
|
|
1927
|
+
};
|
|
1928
|
+
return {
|
|
1929
|
+
templateRef: rowDef.template,
|
|
1930
|
+
context,
|
|
1931
|
+
index
|
|
1932
|
+
};
|
|
1933
|
+
}
|
|
1934
|
+
_renderRow(outlet, rowDef, index, context = {}) {
|
|
1935
|
+
const view = outlet.viewContainer.createEmbeddedView(rowDef.template, context, index);
|
|
1936
|
+
this._renderCellTemplateForItem(rowDef, context);
|
|
1937
|
+
return view;
|
|
1938
|
+
}
|
|
1939
|
+
_renderCellTemplateForItem(rowDef, context) {
|
|
1940
|
+
for (let cellTemplate of this._getCellTemplates(rowDef)) {
|
|
1941
|
+
if (CdkCellOutlet.mostRecentCellOutlet) {
|
|
1942
|
+
CdkCellOutlet.mostRecentCellOutlet._viewContainer.createEmbeddedView(cellTemplate, context);
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1945
|
+
this._changeDetectorRef.markForCheck();
|
|
1946
|
+
}
|
|
1947
|
+
_updateRowIndexContext() {
|
|
1948
|
+
const viewContainer = this._rowOutlet.viewContainer;
|
|
1949
|
+
for (let renderIndex = 0, count = viewContainer.length; renderIndex < count; renderIndex++) {
|
|
1950
|
+
const viewRef = viewContainer.get(renderIndex);
|
|
1951
|
+
const context = viewRef.context;
|
|
1952
|
+
context.count = count;
|
|
1953
|
+
context.first = renderIndex === 0;
|
|
1954
|
+
context.last = renderIndex === count - 1;
|
|
1955
|
+
context.even = renderIndex % 2 === 0;
|
|
1956
|
+
context.odd = !context.even;
|
|
1957
|
+
if (this.multiTemplateDataRows) {
|
|
1958
|
+
context.dataIndex = this._renderRows[renderIndex].dataIndex;
|
|
1959
|
+
context.renderIndex = renderIndex;
|
|
1960
|
+
} else {
|
|
1961
|
+
context.index = this._renderRows[renderIndex].dataIndex;
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
_getCellTemplates(rowDef) {
|
|
1966
|
+
if (!rowDef || !rowDef.columns) {
|
|
1967
|
+
return [];
|
|
1968
|
+
}
|
|
1969
|
+
return Array.from(rowDef.columns, columnId => {
|
|
1970
|
+
const column = this._columnDefsByName.get(columnId);
|
|
1971
|
+
if (!column && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
1972
|
+
throw getTableUnknownColumnError(columnId);
|
|
1973
|
+
}
|
|
1974
|
+
return rowDef.extractCellTemplate(column);
|
|
1975
|
+
});
|
|
1976
|
+
}
|
|
1977
|
+
_forceRenderDataRows() {
|
|
1978
|
+
this._dataDiffer.diff([]);
|
|
1979
|
+
this._rowOutlet.viewContainer.clear();
|
|
1980
|
+
this.renderRows();
|
|
1981
|
+
}
|
|
1982
|
+
_checkStickyStates() {
|
|
1983
|
+
const stickyCheckReducer = (acc, d) => {
|
|
1984
|
+
return acc || d.hasStickyChanged();
|
|
1985
|
+
};
|
|
1986
|
+
if (this._headerRowDefs.reduce(stickyCheckReducer, false)) {
|
|
1987
|
+
this.updateStickyHeaderRowStyles();
|
|
1988
|
+
}
|
|
1989
|
+
if (this._footerRowDefs.reduce(stickyCheckReducer, false)) {
|
|
1990
|
+
this.updateStickyFooterRowStyles();
|
|
1991
|
+
}
|
|
1992
|
+
if (Array.from(this._columnDefsByName.values()).reduce(stickyCheckReducer, false)) {
|
|
1993
|
+
this._stickyColumnStylesNeedReset = true;
|
|
1994
|
+
this.updateStickyColumnStyles();
|
|
1995
|
+
}
|
|
1996
|
+
}
|
|
1997
|
+
_setupStickyStyler() {
|
|
1998
|
+
const direction = this._dir ? this._dir.value : 'ltr';
|
|
1999
|
+
this._stickyStyler = new StickyStyler(this._isNativeHtmlTable, this.stickyCssClass, this._platform.isBrowser, this.needsPositionStickyOnElement, direction, this._stickyPositioningListener, this._injector);
|
|
2000
|
+
(this._dir ? this._dir.change : of()).pipe(takeUntil(this._onDestroy)).subscribe(value => {
|
|
2001
|
+
this._stickyStyler.direction = value;
|
|
2002
|
+
this.updateStickyColumnStyles();
|
|
2003
|
+
});
|
|
2004
|
+
}
|
|
2005
|
+
_getOwnDefs(items) {
|
|
2006
|
+
return items.filter(item => !item._table || item._table === this);
|
|
2007
|
+
}
|
|
2008
|
+
_updateNoDataRow() {
|
|
2009
|
+
const noDataRow = this._customNoDataRow || this._noDataRow;
|
|
2010
|
+
if (!noDataRow) {
|
|
2011
|
+
return;
|
|
2012
|
+
}
|
|
2013
|
+
const shouldShow = this._rowOutlet.viewContainer.length === 0;
|
|
2014
|
+
if (shouldShow === this._isShowingNoDataRow) {
|
|
2015
|
+
return;
|
|
2016
|
+
}
|
|
2017
|
+
const container = this._noDataRowOutlet.viewContainer;
|
|
2018
|
+
if (shouldShow) {
|
|
2019
|
+
const view = container.createEmbeddedView(noDataRow.templateRef);
|
|
2020
|
+
const rootNode = view.rootNodes[0];
|
|
2021
|
+
if (view.rootNodes.length === 1 && rootNode?.nodeType === this._document.ELEMENT_NODE) {
|
|
2022
|
+
rootNode.setAttribute('role', 'row');
|
|
2023
|
+
rootNode.classList.add(...noDataRow._contentClassNames);
|
|
2024
|
+
const cells = rootNode.querySelectorAll(noDataRow._cellSelector);
|
|
2025
|
+
for (let i = 0; i < cells.length; i++) {
|
|
2026
|
+
cells[i].classList.add(...noDataRow._cellClassNames);
|
|
2027
|
+
}
|
|
2028
|
+
}
|
|
2029
|
+
} else {
|
|
2030
|
+
container.clear();
|
|
2031
|
+
}
|
|
2032
|
+
this._isShowingNoDataRow = shouldShow;
|
|
2033
|
+
this._changeDetectorRef.markForCheck();
|
|
2034
|
+
}
|
|
2035
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2036
|
+
minVersion: "12.0.0",
|
|
2037
|
+
version: "20.2.0-next.2",
|
|
2038
|
+
ngImport: i0,
|
|
2039
|
+
type: CdkTable,
|
|
2040
|
+
deps: [],
|
|
2041
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
2042
|
+
});
|
|
2043
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
2044
|
+
minVersion: "17.0.0",
|
|
2045
|
+
version: "20.2.0-next.2",
|
|
2046
|
+
type: CdkTable,
|
|
2047
|
+
isStandalone: true,
|
|
2048
|
+
selector: "cdk-table, table[cdk-table]",
|
|
2049
|
+
inputs: {
|
|
2050
|
+
trackBy: "trackBy",
|
|
2051
|
+
dataSource: "dataSource",
|
|
2052
|
+
multiTemplateDataRows: ["multiTemplateDataRows", "multiTemplateDataRows", booleanAttribute],
|
|
2053
|
+
fixedLayout: ["fixedLayout", "fixedLayout", booleanAttribute]
|
|
2054
|
+
},
|
|
2055
|
+
outputs: {
|
|
2056
|
+
contentChanged: "contentChanged"
|
|
2057
|
+
},
|
|
2058
|
+
host: {
|
|
2059
|
+
properties: {
|
|
2060
|
+
"class.cdk-table-fixed-layout": "fixedLayout"
|
|
2061
|
+
},
|
|
2062
|
+
classAttribute: "cdk-table"
|
|
2063
|
+
},
|
|
2064
|
+
providers: [{
|
|
2065
|
+
provide: CDK_TABLE,
|
|
2066
|
+
useExisting: CdkTable
|
|
2067
|
+
}, {
|
|
2068
|
+
provide: _VIEW_REPEATER_STRATEGY,
|
|
2069
|
+
useClass: _DisposeViewRepeaterStrategy
|
|
2070
|
+
}, {
|
|
2071
|
+
provide: STICKY_POSITIONING_LISTENER,
|
|
2072
|
+
useValue: null
|
|
2073
|
+
}],
|
|
2074
|
+
queries: [{
|
|
2075
|
+
propertyName: "_noDataRow",
|
|
2076
|
+
first: true,
|
|
2077
|
+
predicate: CdkNoDataRow,
|
|
2078
|
+
descendants: true
|
|
2079
|
+
}, {
|
|
2080
|
+
propertyName: "_contentColumnDefs",
|
|
2081
|
+
predicate: CdkColumnDef,
|
|
2082
|
+
descendants: true
|
|
2083
|
+
}, {
|
|
2084
|
+
propertyName: "_contentRowDefs",
|
|
2085
|
+
predicate: CdkRowDef,
|
|
2086
|
+
descendants: true
|
|
2087
|
+
}, {
|
|
2088
|
+
propertyName: "_contentHeaderRowDefs",
|
|
2089
|
+
predicate: CdkHeaderRowDef,
|
|
2090
|
+
descendants: true
|
|
2091
|
+
}, {
|
|
2092
|
+
propertyName: "_contentFooterRowDefs",
|
|
2093
|
+
predicate: CdkFooterRowDef,
|
|
2094
|
+
descendants: true
|
|
2095
|
+
}],
|
|
2096
|
+
exportAs: ["cdkTable"],
|
|
2097
|
+
ngImport: i0,
|
|
2098
|
+
template: `
|
|
2144
2099
|
<ng-content select="caption"/>
|
|
2145
2100
|
<ng-content select="colgroup, col"/>
|
|
2146
2101
|
|
|
@@ -2169,11 +2124,41 @@ class CdkTable {
|
|
|
2169
2124
|
<ng-container noDataRowOutlet/>
|
|
2170
2125
|
<ng-container footerRowOutlet/>
|
|
2171
2126
|
}
|
|
2172
|
-
`,
|
|
2127
|
+
`,
|
|
2128
|
+
isInline: true,
|
|
2129
|
+
styles: [".cdk-table-fixed-layout{table-layout:fixed}\n"],
|
|
2130
|
+
dependencies: [{
|
|
2131
|
+
kind: "directive",
|
|
2132
|
+
type: HeaderRowOutlet,
|
|
2133
|
+
selector: "[headerRowOutlet]"
|
|
2134
|
+
}, {
|
|
2135
|
+
kind: "directive",
|
|
2136
|
+
type: DataRowOutlet,
|
|
2137
|
+
selector: "[rowOutlet]"
|
|
2138
|
+
}, {
|
|
2139
|
+
kind: "directive",
|
|
2140
|
+
type: NoDataRowOutlet,
|
|
2141
|
+
selector: "[noDataRowOutlet]"
|
|
2142
|
+
}, {
|
|
2143
|
+
kind: "directive",
|
|
2144
|
+
type: FooterRowOutlet,
|
|
2145
|
+
selector: "[footerRowOutlet]"
|
|
2146
|
+
}],
|
|
2147
|
+
changeDetection: i0.ChangeDetectionStrategy.Default,
|
|
2148
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
2149
|
+
});
|
|
2173
2150
|
}
|
|
2174
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
2175
|
-
|
|
2176
|
-
|
|
2151
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2152
|
+
minVersion: "12.0.0",
|
|
2153
|
+
version: "20.2.0-next.2",
|
|
2154
|
+
ngImport: i0,
|
|
2155
|
+
type: CdkTable,
|
|
2156
|
+
decorators: [{
|
|
2157
|
+
type: Component,
|
|
2158
|
+
args: [{
|
|
2159
|
+
selector: 'cdk-table, table[cdk-table]',
|
|
2160
|
+
exportAs: 'cdkTable',
|
|
2161
|
+
template: `
|
|
2177
2162
|
<ng-content select="caption"/>
|
|
2178
2163
|
<ng-content select="colgroup, col"/>
|
|
2179
2164
|
|
|
@@ -2202,179 +2187,199 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2",
|
|
|
2202
2187
|
<ng-container noDataRowOutlet/>
|
|
2203
2188
|
<ng-container footerRowOutlet/>
|
|
2204
2189
|
}
|
|
2205
|
-
`,
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2190
|
+
`,
|
|
2191
|
+
host: {
|
|
2192
|
+
'class': 'cdk-table',
|
|
2193
|
+
'[class.cdk-table-fixed-layout]': 'fixedLayout'
|
|
2194
|
+
},
|
|
2195
|
+
encapsulation: ViewEncapsulation.None,
|
|
2196
|
+
changeDetection: ChangeDetectionStrategy.Default,
|
|
2197
|
+
providers: [{
|
|
2198
|
+
provide: CDK_TABLE,
|
|
2199
|
+
useExisting: CdkTable
|
|
2200
|
+
}, {
|
|
2201
|
+
provide: _VIEW_REPEATER_STRATEGY,
|
|
2202
|
+
useClass: _DisposeViewRepeaterStrategy
|
|
2203
|
+
}, {
|
|
2204
|
+
provide: STICKY_POSITIONING_LISTENER,
|
|
2205
|
+
useValue: null
|
|
2206
|
+
}],
|
|
2207
|
+
imports: [HeaderRowOutlet, DataRowOutlet, NoDataRowOutlet, FooterRowOutlet],
|
|
2208
|
+
styles: [".cdk-table-fixed-layout{table-layout:fixed}\n"]
|
|
2209
|
+
}]
|
|
2210
|
+
}],
|
|
2211
|
+
ctorParameters: () => [],
|
|
2212
|
+
propDecorators: {
|
|
2213
|
+
trackBy: [{
|
|
2214
|
+
type: Input
|
|
2215
|
+
}],
|
|
2216
|
+
dataSource: [{
|
|
2217
|
+
type: Input
|
|
2218
|
+
}],
|
|
2219
|
+
multiTemplateDataRows: [{
|
|
2220
|
+
type: Input,
|
|
2221
|
+
args: [{
|
|
2222
|
+
transform: booleanAttribute
|
|
2223
|
+
}]
|
|
2224
|
+
}],
|
|
2225
|
+
fixedLayout: [{
|
|
2226
|
+
type: Input,
|
|
2227
|
+
args: [{
|
|
2228
|
+
transform: booleanAttribute
|
|
2229
|
+
}]
|
|
2230
|
+
}],
|
|
2231
|
+
contentChanged: [{
|
|
2232
|
+
type: Output
|
|
2233
|
+
}],
|
|
2234
|
+
_contentColumnDefs: [{
|
|
2235
|
+
type: ContentChildren,
|
|
2236
|
+
args: [CdkColumnDef, {
|
|
2237
|
+
descendants: true
|
|
2238
|
+
}]
|
|
2239
|
+
}],
|
|
2240
|
+
_contentRowDefs: [{
|
|
2241
|
+
type: ContentChildren,
|
|
2242
|
+
args: [CdkRowDef, {
|
|
2243
|
+
descendants: true
|
|
2244
|
+
}]
|
|
2245
|
+
}],
|
|
2246
|
+
_contentHeaderRowDefs: [{
|
|
2247
|
+
type: ContentChildren,
|
|
2248
|
+
args: [CdkHeaderRowDef, {
|
|
2249
|
+
descendants: true
|
|
2250
|
+
}]
|
|
2251
|
+
}],
|
|
2252
|
+
_contentFooterRowDefs: [{
|
|
2253
|
+
type: ContentChildren,
|
|
2254
|
+
args: [CdkFooterRowDef, {
|
|
2255
|
+
descendants: true
|
|
2256
|
+
}]
|
|
2257
|
+
}],
|
|
2258
|
+
_noDataRow: [{
|
|
2259
|
+
type: ContentChild,
|
|
2260
|
+
args: [CdkNoDataRow]
|
|
2261
|
+
}]
|
|
2262
|
+
}
|
|
2263
|
+
});
|
|
2247
2264
|
function mergeArrayAndSet(array, set) {
|
|
2248
|
-
|
|
2265
|
+
return array.concat(Array.from(set));
|
|
2249
2266
|
}
|
|
2250
|
-
/**
|
|
2251
|
-
* Finds the closest table section to an outlet. We can't use `HTMLElement.closest` for this,
|
|
2252
|
-
* because the node representing the outlet is a comment.
|
|
2253
|
-
*/
|
|
2254
2267
|
function closestTableSection(outlet, section) {
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
current = current.parentNode;
|
|
2268
|
-
}
|
|
2269
|
-
return null;
|
|
2268
|
+
const uppercaseSection = section.toUpperCase();
|
|
2269
|
+
let current = outlet.viewContainer.element.nativeElement;
|
|
2270
|
+
while (current) {
|
|
2271
|
+
const nodeName = current.nodeType === 1 ? current.nodeName : null;
|
|
2272
|
+
if (nodeName === uppercaseSection) {
|
|
2273
|
+
return current;
|
|
2274
|
+
} else if (nodeName === 'TABLE') {
|
|
2275
|
+
break;
|
|
2276
|
+
}
|
|
2277
|
+
current = current.parentNode;
|
|
2278
|
+
}
|
|
2279
|
+
return null;
|
|
2270
2280
|
}
|
|
2271
2281
|
|
|
2272
|
-
/**
|
|
2273
|
-
* Column that simply shows text content for the header and row cells. Assumes that the table
|
|
2274
|
-
* is using the native table implementation (`<table>`).
|
|
2275
|
-
*
|
|
2276
|
-
* By default, the name of this column will be the header text and data property accessor.
|
|
2277
|
-
* The header text can be overridden with the `headerText` input. Cell values can be overridden with
|
|
2278
|
-
* the `dataAccessor` input. Change the text justification to the start or end using the `justify`
|
|
2279
|
-
* input.
|
|
2280
|
-
*/
|
|
2281
2282
|
class CdkTextColumn {
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2283
|
+
_table = inject(CdkTable, {
|
|
2284
|
+
optional: true
|
|
2285
|
+
});
|
|
2286
|
+
_options = inject(TEXT_COLUMN_OPTIONS, {
|
|
2287
|
+
optional: true
|
|
2288
|
+
});
|
|
2289
|
+
get name() {
|
|
2290
|
+
return this._name;
|
|
2291
|
+
}
|
|
2292
|
+
set name(name) {
|
|
2293
|
+
this._name = name;
|
|
2294
|
+
this._syncColumnDefName();
|
|
2295
|
+
}
|
|
2296
|
+
_name;
|
|
2297
|
+
headerText;
|
|
2298
|
+
dataAccessor;
|
|
2299
|
+
justify = 'start';
|
|
2300
|
+
columnDef;
|
|
2301
|
+
cell;
|
|
2302
|
+
headerCell;
|
|
2303
|
+
constructor() {
|
|
2304
|
+
this._options = this._options || {};
|
|
2305
|
+
}
|
|
2306
|
+
ngOnInit() {
|
|
2307
|
+
this._syncColumnDefName();
|
|
2308
|
+
if (this.headerText === undefined) {
|
|
2309
|
+
this.headerText = this._createDefaultHeaderText();
|
|
2310
|
+
}
|
|
2311
|
+
if (!this.dataAccessor) {
|
|
2312
|
+
this.dataAccessor = this._options.defaultDataAccessor || ((data, name) => data[name]);
|
|
2313
|
+
}
|
|
2314
|
+
if (this._table) {
|
|
2315
|
+
this.columnDef.cell = this.cell;
|
|
2316
|
+
this.columnDef.headerCell = this.headerCell;
|
|
2317
|
+
this._table.addColumnDef(this.columnDef);
|
|
2318
|
+
} else if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
2319
|
+
throw getTableTextColumnMissingParentTableError();
|
|
2320
|
+
}
|
|
2321
|
+
}
|
|
2322
|
+
ngOnDestroy() {
|
|
2323
|
+
if (this._table) {
|
|
2324
|
+
this._table.removeColumnDef(this.columnDef);
|
|
2325
|
+
}
|
|
2326
|
+
}
|
|
2327
|
+
_createDefaultHeaderText() {
|
|
2328
|
+
const name = this.name;
|
|
2329
|
+
if (!name && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
2330
|
+
throw getTableTextColumnMissingNameError();
|
|
2331
|
+
}
|
|
2332
|
+
if (this._options && this._options.defaultHeaderTextTransform) {
|
|
2333
|
+
return this._options.defaultHeaderTextTransform(name);
|
|
2334
|
+
}
|
|
2335
|
+
return name[0].toUpperCase() + name.slice(1);
|
|
2336
|
+
}
|
|
2337
|
+
_syncColumnDefName() {
|
|
2338
|
+
if (this.columnDef) {
|
|
2339
|
+
this.columnDef.name = this.name;
|
|
2340
|
+
}
|
|
2341
|
+
}
|
|
2342
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2343
|
+
minVersion: "12.0.0",
|
|
2344
|
+
version: "20.2.0-next.2",
|
|
2345
|
+
ngImport: i0,
|
|
2346
|
+
type: CdkTextColumn,
|
|
2347
|
+
deps: [],
|
|
2348
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
2349
|
+
});
|
|
2350
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
2351
|
+
minVersion: "14.0.0",
|
|
2352
|
+
version: "20.2.0-next.2",
|
|
2353
|
+
type: CdkTextColumn,
|
|
2354
|
+
isStandalone: true,
|
|
2355
|
+
selector: "cdk-text-column",
|
|
2356
|
+
inputs: {
|
|
2357
|
+
name: "name",
|
|
2358
|
+
headerText: "headerText",
|
|
2359
|
+
dataAccessor: "dataAccessor",
|
|
2360
|
+
justify: "justify"
|
|
2361
|
+
},
|
|
2362
|
+
viewQueries: [{
|
|
2363
|
+
propertyName: "columnDef",
|
|
2364
|
+
first: true,
|
|
2365
|
+
predicate: CdkColumnDef,
|
|
2366
|
+
descendants: true,
|
|
2367
|
+
static: true
|
|
2368
|
+
}, {
|
|
2369
|
+
propertyName: "cell",
|
|
2370
|
+
first: true,
|
|
2371
|
+
predicate: CdkCellDef,
|
|
2372
|
+
descendants: true,
|
|
2373
|
+
static: true
|
|
2374
|
+
}, {
|
|
2375
|
+
propertyName: "headerCell",
|
|
2376
|
+
first: true,
|
|
2377
|
+
predicate: CdkHeaderCellDef,
|
|
2378
|
+
descendants: true,
|
|
2379
|
+
static: true
|
|
2380
|
+
}],
|
|
2381
|
+
ngImport: i0,
|
|
2382
|
+
template: `
|
|
2378
2383
|
<ng-container cdkColumnDef>
|
|
2379
2384
|
<th cdk-header-cell *cdkHeaderCellDef [style.text-align]="justify">
|
|
2380
2385
|
{{headerText}}
|
|
@@ -2383,13 +2388,44 @@ class CdkTextColumn {
|
|
|
2383
2388
|
{{dataAccessor(data, name)}}
|
|
2384
2389
|
</td>
|
|
2385
2390
|
</ng-container>
|
|
2386
|
-
`,
|
|
2391
|
+
`,
|
|
2392
|
+
isInline: true,
|
|
2393
|
+
dependencies: [{
|
|
2394
|
+
kind: "directive",
|
|
2395
|
+
type: CdkColumnDef,
|
|
2396
|
+
selector: "[cdkColumnDef]",
|
|
2397
|
+
inputs: ["cdkColumnDef", "sticky", "stickyEnd"]
|
|
2398
|
+
}, {
|
|
2399
|
+
kind: "directive",
|
|
2400
|
+
type: CdkHeaderCellDef,
|
|
2401
|
+
selector: "[cdkHeaderCellDef]"
|
|
2402
|
+
}, {
|
|
2403
|
+
kind: "directive",
|
|
2404
|
+
type: CdkHeaderCell,
|
|
2405
|
+
selector: "cdk-header-cell, th[cdk-header-cell]"
|
|
2406
|
+
}, {
|
|
2407
|
+
kind: "directive",
|
|
2408
|
+
type: CdkCellDef,
|
|
2409
|
+
selector: "[cdkCellDef]"
|
|
2410
|
+
}, {
|
|
2411
|
+
kind: "directive",
|
|
2412
|
+
type: CdkCell,
|
|
2413
|
+
selector: "cdk-cell, td[cdk-cell]"
|
|
2414
|
+
}],
|
|
2415
|
+
changeDetection: i0.ChangeDetectionStrategy.Default,
|
|
2416
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
2417
|
+
});
|
|
2387
2418
|
}
|
|
2388
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2419
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2420
|
+
minVersion: "12.0.0",
|
|
2421
|
+
version: "20.2.0-next.2",
|
|
2422
|
+
ngImport: i0,
|
|
2423
|
+
type: CdkTextColumn,
|
|
2424
|
+
decorators: [{
|
|
2425
|
+
type: Component,
|
|
2426
|
+
args: [{
|
|
2427
|
+
selector: 'cdk-text-column',
|
|
2428
|
+
template: `
|
|
2393
2429
|
<ng-container cdkColumnDef>
|
|
2394
2430
|
<th cdk-header-cell *cdkHeaderCellDef [style.text-align]="justify">
|
|
2395
2431
|
{{headerText}}
|
|
@@ -2399,113 +2435,85 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2",
|
|
|
2399
2435
|
</td>
|
|
2400
2436
|
</ng-container>
|
|
2401
2437
|
`,
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2438
|
+
encapsulation: ViewEncapsulation.None,
|
|
2439
|
+
changeDetection: ChangeDetectionStrategy.Default,
|
|
2440
|
+
imports: [CdkColumnDef, CdkHeaderCellDef, CdkHeaderCell, CdkCellDef, CdkCell]
|
|
2441
|
+
}]
|
|
2442
|
+
}],
|
|
2443
|
+
ctorParameters: () => [],
|
|
2444
|
+
propDecorators: {
|
|
2445
|
+
name: [{
|
|
2446
|
+
type: Input
|
|
2447
|
+
}],
|
|
2448
|
+
headerText: [{
|
|
2449
|
+
type: Input
|
|
2450
|
+
}],
|
|
2451
|
+
dataAccessor: [{
|
|
2452
|
+
type: Input
|
|
2453
|
+
}],
|
|
2454
|
+
justify: [{
|
|
2455
|
+
type: Input
|
|
2456
|
+
}],
|
|
2457
|
+
columnDef: [{
|
|
2458
|
+
type: ViewChild,
|
|
2459
|
+
args: [CdkColumnDef, {
|
|
2460
|
+
static: true
|
|
2461
|
+
}]
|
|
2462
|
+
}],
|
|
2463
|
+
cell: [{
|
|
2464
|
+
type: ViewChild,
|
|
2465
|
+
args: [CdkCellDef, {
|
|
2466
|
+
static: true
|
|
2467
|
+
}]
|
|
2468
|
+
}],
|
|
2469
|
+
headerCell: [{
|
|
2470
|
+
type: ViewChild,
|
|
2471
|
+
args: [CdkHeaderCellDef, {
|
|
2472
|
+
static: true
|
|
2473
|
+
}]
|
|
2474
|
+
}]
|
|
2475
|
+
}
|
|
2476
|
+
});
|
|
2430
2477
|
|
|
2431
|
-
const EXPORTED_DECLARATIONS = [
|
|
2432
|
-
CdkTable,
|
|
2433
|
-
CdkRowDef,
|
|
2434
|
-
CdkCellDef,
|
|
2435
|
-
CdkCellOutlet,
|
|
2436
|
-
CdkHeaderCellDef,
|
|
2437
|
-
CdkFooterCellDef,
|
|
2438
|
-
CdkColumnDef,
|
|
2439
|
-
CdkCell,
|
|
2440
|
-
CdkRow,
|
|
2441
|
-
CdkHeaderCell,
|
|
2442
|
-
CdkFooterCell,
|
|
2443
|
-
CdkHeaderRow,
|
|
2444
|
-
CdkHeaderRowDef,
|
|
2445
|
-
CdkFooterRow,
|
|
2446
|
-
CdkFooterRowDef,
|
|
2447
|
-
DataRowOutlet,
|
|
2448
|
-
HeaderRowOutlet,
|
|
2449
|
-
FooterRowOutlet,
|
|
2450
|
-
CdkTextColumn,
|
|
2451
|
-
CdkNoDataRow,
|
|
2452
|
-
CdkRecycleRows,
|
|
2453
|
-
NoDataRowOutlet,
|
|
2454
|
-
];
|
|
2478
|
+
const EXPORTED_DECLARATIONS = [CdkTable, CdkRowDef, CdkCellDef, CdkCellOutlet, CdkHeaderCellDef, CdkFooterCellDef, CdkColumnDef, CdkCell, CdkRow, CdkHeaderCell, CdkFooterCell, CdkHeaderRow, CdkHeaderRowDef, CdkFooterRow, CdkFooterRowDef, DataRowOutlet, HeaderRowOutlet, FooterRowOutlet, CdkTextColumn, CdkNoDataRow, CdkRecycleRows, NoDataRowOutlet];
|
|
2455
2479
|
class CdkTableModule {
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
CdkRowDef,
|
|
2480
|
-
CdkCellDef,
|
|
2481
|
-
CdkCellOutlet,
|
|
2482
|
-
CdkHeaderCellDef,
|
|
2483
|
-
CdkFooterCellDef,
|
|
2484
|
-
CdkColumnDef,
|
|
2485
|
-
CdkCell,
|
|
2486
|
-
CdkRow,
|
|
2487
|
-
CdkHeaderCell,
|
|
2488
|
-
CdkFooterCell,
|
|
2489
|
-
CdkHeaderRow,
|
|
2490
|
-
CdkHeaderRowDef,
|
|
2491
|
-
CdkFooterRow,
|
|
2492
|
-
CdkFooterRowDef,
|
|
2493
|
-
DataRowOutlet,
|
|
2494
|
-
HeaderRowOutlet,
|
|
2495
|
-
FooterRowOutlet,
|
|
2496
|
-
CdkTextColumn,
|
|
2497
|
-
CdkNoDataRow,
|
|
2498
|
-
CdkRecycleRows,
|
|
2499
|
-
NoDataRowOutlet] });
|
|
2500
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkTableModule, imports: [ScrollingModule] });
|
|
2480
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2481
|
+
minVersion: "12.0.0",
|
|
2482
|
+
version: "20.2.0-next.2",
|
|
2483
|
+
ngImport: i0,
|
|
2484
|
+
type: CdkTableModule,
|
|
2485
|
+
deps: [],
|
|
2486
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
2487
|
+
});
|
|
2488
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({
|
|
2489
|
+
minVersion: "14.0.0",
|
|
2490
|
+
version: "20.2.0-next.2",
|
|
2491
|
+
ngImport: i0,
|
|
2492
|
+
type: CdkTableModule,
|
|
2493
|
+
imports: [ScrollingModule, CdkTable, CdkRowDef, CdkCellDef, CdkCellOutlet, CdkHeaderCellDef, CdkFooterCellDef, CdkColumnDef, CdkCell, CdkRow, CdkHeaderCell, CdkFooterCell, CdkHeaderRow, CdkHeaderRowDef, CdkFooterRow, CdkFooterRowDef, DataRowOutlet, HeaderRowOutlet, FooterRowOutlet, CdkTextColumn, CdkNoDataRow, CdkRecycleRows, NoDataRowOutlet],
|
|
2494
|
+
exports: [CdkTable, CdkRowDef, CdkCellDef, CdkCellOutlet, CdkHeaderCellDef, CdkFooterCellDef, CdkColumnDef, CdkCell, CdkRow, CdkHeaderCell, CdkFooterCell, CdkHeaderRow, CdkHeaderRowDef, CdkFooterRow, CdkFooterRowDef, DataRowOutlet, HeaderRowOutlet, FooterRowOutlet, CdkTextColumn, CdkNoDataRow, CdkRecycleRows, NoDataRowOutlet]
|
|
2495
|
+
});
|
|
2496
|
+
static ɵinj = i0.ɵɵngDeclareInjector({
|
|
2497
|
+
minVersion: "12.0.0",
|
|
2498
|
+
version: "20.2.0-next.2",
|
|
2499
|
+
ngImport: i0,
|
|
2500
|
+
type: CdkTableModule,
|
|
2501
|
+
imports: [ScrollingModule]
|
|
2502
|
+
});
|
|
2501
2503
|
}
|
|
2502
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2504
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2505
|
+
minVersion: "12.0.0",
|
|
2506
|
+
version: "20.2.0-next.2",
|
|
2507
|
+
ngImport: i0,
|
|
2508
|
+
type: CdkTableModule,
|
|
2509
|
+
decorators: [{
|
|
2510
|
+
type: NgModule,
|
|
2511
|
+
args: [{
|
|
2512
|
+
exports: EXPORTED_DECLARATIONS,
|
|
2513
|
+
imports: [ScrollingModule, ...EXPORTED_DECLARATIONS]
|
|
2514
|
+
}]
|
|
2515
|
+
}]
|
|
2516
|
+
});
|
|
2509
2517
|
|
|
2510
2518
|
export { BaseCdkCell, BaseRowDef, CDK_ROW_TEMPLATE, CDK_TABLE, CdkCell, CdkCellDef, CdkCellOutlet, CdkColumnDef, CdkFooterCell, CdkFooterCellDef, CdkFooterRow, CdkFooterRowDef, CdkHeaderCell, CdkHeaderCellDef, CdkHeaderRow, CdkHeaderRowDef, CdkNoDataRow, CdkRecycleRows, CdkRow, CdkRowDef, CdkTable, CdkTableModule, CdkTextColumn, DataRowOutlet, FooterRowOutlet, HeaderRowOutlet, NoDataRowOutlet, STICKY_POSITIONING_LISTENER, TEXT_COLUMN_OPTIONS };
|
|
2511
2519
|
//# sourceMappingURL=table.mjs.map
|