@angular/cdk 19.0.0-next.9 → 19.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.
Files changed (54) hide show
  1. package/fesm2022/a11y.mjs +313 -266
  2. package/fesm2022/a11y.mjs.map +1 -1
  3. package/fesm2022/accordion.mjs +41 -44
  4. package/fesm2022/accordion.mjs.map +1 -1
  5. package/fesm2022/bidi.mjs +19 -19
  6. package/fesm2022/bidi.mjs.map +1 -1
  7. package/fesm2022/cdk.mjs +1 -1
  8. package/fesm2022/cdk.mjs.map +1 -1
  9. package/fesm2022/clipboard.mjs +31 -26
  10. package/fesm2022/clipboard.mjs.map +1 -1
  11. package/fesm2022/collections.mjs +30 -28
  12. package/fesm2022/collections.mjs.map +1 -1
  13. package/fesm2022/dialog.mjs +210 -131
  14. package/fesm2022/dialog.mjs.map +1 -1
  15. package/fesm2022/drag-drop.mjs +721 -477
  16. package/fesm2022/drag-drop.mjs.map +1 -1
  17. package/fesm2022/layout.mjs +18 -17
  18. package/fesm2022/layout.mjs.map +1 -1
  19. package/fesm2022/listbox.mjs +76 -62
  20. package/fesm2022/listbox.mjs.map +1 -1
  21. package/fesm2022/menu.mjs +231 -203
  22. package/fesm2022/menu.mjs.map +1 -1
  23. package/fesm2022/observers/private.mjs +15 -12
  24. package/fesm2022/observers/private.mjs.map +1 -1
  25. package/fesm2022/observers.mjs +22 -23
  26. package/fesm2022/observers.mjs.map +1 -1
  27. package/fesm2022/overlay.mjs +410 -278
  28. package/fesm2022/overlay.mjs.map +1 -1
  29. package/fesm2022/platform.mjs +49 -50
  30. package/fesm2022/platform.mjs.map +1 -1
  31. package/fesm2022/portal.mjs +110 -74
  32. package/fesm2022/portal.mjs.map +1 -1
  33. package/fesm2022/private.mjs +7 -8
  34. package/fesm2022/private.mjs.map +1 -1
  35. package/fesm2022/scrolling.mjs +179 -158
  36. package/fesm2022/scrolling.mjs.map +1 -1
  37. package/fesm2022/stepper.mjs +97 -65
  38. package/fesm2022/stepper.mjs.map +1 -1
  39. package/fesm2022/table.mjs +443 -232
  40. package/fesm2022/table.mjs.map +1 -1
  41. package/fesm2022/testing/selenium-webdriver.mjs +6 -0
  42. package/fesm2022/testing/selenium-webdriver.mjs.map +1 -1
  43. package/fesm2022/testing/testbed.mjs +16 -7
  44. package/fesm2022/testing/testbed.mjs.map +1 -1
  45. package/fesm2022/testing.mjs +7 -2
  46. package/fesm2022/testing.mjs.map +1 -1
  47. package/fesm2022/text-field.mjs +50 -41
  48. package/fesm2022/text-field.mjs.map +1 -1
  49. package/fesm2022/tree.mjs +220 -118
  50. package/fesm2022/tree.mjs.map +1 -1
  51. package/package.json +1 -1
  52. package/schematics/ng-add/index.js +1 -1
  53. package/schematics/ng-add/index.mjs +1 -1
  54. package/table/index.d.ts +20 -1
@@ -23,12 +23,11 @@ const TEXT_COLUMN_OPTIONS = new InjectionToken('text-column-options');
23
23
  * Captures the template of a column's data row cell as well as cell-specific properties.
24
24
  */
25
25
  class CdkCellDef {
26
- constructor() {
27
- /** @docs-private */
28
- this.template = inject(TemplateRef);
29
- }
30
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkCellDef, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
31
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkCellDef, isStandalone: true, selector: "[cdkCellDef]", ngImport: i0 }); }
26
+ /** @docs-private */
27
+ template = inject(TemplateRef);
28
+ constructor() { }
29
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkCellDef, deps: [], target: i0.ɵɵFactoryTarget.Directive });
30
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkCellDef, isStandalone: true, selector: "[cdkCellDef]", ngImport: i0 });
32
31
  }
33
32
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkCellDef, decorators: [{
34
33
  type: Directive,
@@ -41,12 +40,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
41
40
  * Captures the template of a column's header cell and as well as cell-specific properties.
42
41
  */
43
42
  class CdkHeaderCellDef {
44
- constructor() {
45
- /** @docs-private */
46
- this.template = inject(TemplateRef);
47
- }
48
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkHeaderCellDef, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
49
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkHeaderCellDef, isStandalone: true, selector: "[cdkHeaderCellDef]", ngImport: i0 }); }
43
+ /** @docs-private */
44
+ template = inject(TemplateRef);
45
+ constructor() { }
46
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkHeaderCellDef, deps: [], target: i0.ɵɵFactoryTarget.Directive });
47
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkHeaderCellDef, isStandalone: true, selector: "[cdkHeaderCellDef]", ngImport: i0 });
50
48
  }
51
49
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkHeaderCellDef, decorators: [{
52
50
  type: Directive,
@@ -59,12 +57,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
59
57
  * Captures the template of a column's footer cell and as well as cell-specific properties.
60
58
  */
61
59
  class CdkFooterCellDef {
62
- constructor() {
63
- /** @docs-private */
64
- this.template = inject(TemplateRef);
65
- }
66
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkFooterCellDef, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
67
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkFooterCellDef, isStandalone: true, selector: "[cdkFooterCellDef]", ngImport: i0 }); }
60
+ /** @docs-private */
61
+ template = inject(TemplateRef);
62
+ constructor() { }
63
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkFooterCellDef, deps: [], target: i0.ɵɵFactoryTarget.Directive });
64
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkFooterCellDef, isStandalone: true, selector: "[cdkFooterCellDef]", ngImport: i0 });
68
65
  }
69
66
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkFooterCellDef, decorators: [{
70
67
  type: Directive,
@@ -77,6 +74,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
77
74
  * Defines a set of cells available for a table column.
78
75
  */
79
76
  class CdkColumnDef {
77
+ _table = inject(CDK_TABLE, { optional: true });
78
+ _hasStickyChanged = false;
80
79
  /** Unique name for this column. */
81
80
  get name() {
82
81
  return this._name;
@@ -84,6 +83,7 @@ class CdkColumnDef {
84
83
  set name(name) {
85
84
  this._setNameInput(name);
86
85
  }
86
+ _name;
87
87
  /** Whether the cell is sticky. */
88
88
  get sticky() {
89
89
  return this._sticky;
@@ -94,6 +94,7 @@ class CdkColumnDef {
94
94
  this._hasStickyChanged = true;
95
95
  }
96
96
  }
97
+ _sticky = false;
97
98
  /**
98
99
  * Whether this column should be sticky positioned on the end of the row. Should make sure
99
100
  * that it mimics the `CanStick` mixin such that `_hasStickyChanged` is set to true if the value
@@ -108,12 +109,25 @@ class CdkColumnDef {
108
109
  this._hasStickyChanged = true;
109
110
  }
110
111
  }
111
- constructor() {
112
- this._table = inject(CDK_TABLE, { optional: true });
113
- this._hasStickyChanged = false;
114
- this._sticky = false;
115
- this._stickyEnd = false;
116
- }
112
+ _stickyEnd = false;
113
+ /** @docs-private */
114
+ cell;
115
+ /** @docs-private */
116
+ headerCell;
117
+ /** @docs-private */
118
+ footerCell;
119
+ /**
120
+ * Transformed version of the column name that can be used as part of a CSS classname. Excludes
121
+ * all non-alphanumeric characters and the special characters '-' and '_'. Any characters that
122
+ * do not match are replaced by the '-' character.
123
+ */
124
+ cssClassFriendlyName;
125
+ /**
126
+ * Class name for cells in this column.
127
+ * @docs-private
128
+ */
129
+ _columnCssClassName;
130
+ constructor() { }
117
131
  /** Whether the sticky state has changed. */
118
132
  hasStickyChanged() {
119
133
  const hasStickyChanged = this._hasStickyChanged;
@@ -149,8 +163,8 @@ class CdkColumnDef {
149
163
  this._updateColumnCssClassName();
150
164
  }
151
165
  }
152
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkColumnDef, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
153
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.0.0-next.10", type: CdkColumnDef, isStandalone: true, selector: "[cdkColumnDef]", inputs: { name: ["cdkColumnDef", "name"], sticky: ["sticky", "sticky", booleanAttribute], stickyEnd: ["stickyEnd", "stickyEnd", booleanAttribute] }, providers: [{ provide: 'MAT_SORT_HEADER_COLUMN_DEF', useExisting: CdkColumnDef }], queries: [{ propertyName: "cell", first: true, predicate: CdkCellDef, descendants: true }, { propertyName: "headerCell", first: true, predicate: CdkHeaderCellDef, descendants: true }, { propertyName: "footerCell", first: true, predicate: CdkFooterCellDef, descendants: true }], ngImport: i0 }); }
166
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkColumnDef, deps: [], target: i0.ɵɵFactoryTarget.Directive });
167
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.0.0-next.10", type: CdkColumnDef, isStandalone: true, selector: "[cdkColumnDef]", inputs: { name: ["cdkColumnDef", "name"], sticky: ["sticky", "sticky", booleanAttribute], stickyEnd: ["stickyEnd", "stickyEnd", booleanAttribute] }, providers: [{ provide: 'MAT_SORT_HEADER_COLUMN_DEF', useExisting: CdkColumnDef }], queries: [{ propertyName: "cell", first: true, predicate: CdkCellDef, descendants: true }, { propertyName: "headerCell", first: true, predicate: CdkHeaderCellDef, descendants: true }, { propertyName: "footerCell", first: true, predicate: CdkFooterCellDef, descendants: true }], ngImport: i0 });
154
168
  }
155
169
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkColumnDef, decorators: [{
156
170
  type: Directive,
@@ -188,8 +202,8 @@ class CdkHeaderCell extends BaseCdkCell {
188
202
  constructor() {
189
203
  super(inject(CdkColumnDef), inject(ElementRef));
190
204
  }
191
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkHeaderCell, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
192
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkHeaderCell, isStandalone: true, selector: "cdk-header-cell, th[cdk-header-cell]", host: { attributes: { "role": "columnheader" }, classAttribute: "cdk-header-cell" }, usesInheritance: true, ngImport: i0 }); }
205
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkHeaderCell, deps: [], target: i0.ɵɵFactoryTarget.Directive });
206
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkHeaderCell, isStandalone: true, selector: "cdk-header-cell, th[cdk-header-cell]", host: { attributes: { "role": "columnheader" }, classAttribute: "cdk-header-cell" }, usesInheritance: true, ngImport: i0 });
193
207
  }
194
208
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkHeaderCell, decorators: [{
195
209
  type: Directive,
@@ -212,8 +226,8 @@ class CdkFooterCell extends BaseCdkCell {
212
226
  elementRef.nativeElement.setAttribute('role', role);
213
227
  }
214
228
  }
215
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkFooterCell, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
216
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkFooterCell, isStandalone: true, selector: "cdk-footer-cell, td[cdk-footer-cell]", host: { classAttribute: "cdk-footer-cell" }, usesInheritance: true, ngImport: i0 }); }
229
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkFooterCell, deps: [], target: i0.ɵɵFactoryTarget.Directive });
230
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkFooterCell, isStandalone: true, selector: "cdk-footer-cell, td[cdk-footer-cell]", host: { classAttribute: "cdk-footer-cell" }, usesInheritance: true, ngImport: i0 });
217
231
  }
218
232
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkFooterCell, decorators: [{
219
233
  type: Directive,
@@ -235,8 +249,8 @@ class CdkCell extends BaseCdkCell {
235
249
  elementRef.nativeElement.setAttribute('role', role);
236
250
  }
237
251
  }
238
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkCell, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
239
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkCell, isStandalone: true, selector: "cdk-cell, td[cdk-cell]", host: { classAttribute: "cdk-cell" }, usesInheritance: true, ngImport: i0 }); }
252
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkCell, deps: [], target: i0.ɵɵFactoryTarget.Directive });
253
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkCell, isStandalone: true, selector: "cdk-cell, td[cdk-cell]", host: { classAttribute: "cdk-cell" }, usesInheritance: true, ngImport: i0 });
240
254
  }
241
255
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkCell, decorators: [{
242
256
  type: Directive,
@@ -252,10 +266,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
252
266
  * @docs-private
253
267
  */
254
268
  class _Schedule {
255
- constructor() {
256
- this.tasks = [];
257
- this.endTasks = [];
258
- }
269
+ tasks = [];
270
+ endTasks = [];
259
271
  }
260
272
  /** Injection token used to provide a coalesced style scheduler. */
261
273
  const _COALESCED_STYLE_SCHEDULER = new InjectionToken('_COALESCED_STYLE_SCHEDULER');
@@ -267,10 +279,9 @@ const _COALESCED_STYLE_SCHEDULER = new InjectionToken('_COALESCED_STYLE_SCHEDULE
267
279
  * @docs-private
268
280
  */
269
281
  class _CoalescedStyleScheduler {
270
- constructor() {
271
- this._currentSchedule = null;
272
- this._ngZone = inject(NgZone);
273
- }
282
+ _currentSchedule = null;
283
+ _ngZone = inject(NgZone);
284
+ constructor() { }
274
285
  /**
275
286
  * Schedules the specified task to run at the end of the current VM turn.
276
287
  */
@@ -311,8 +322,8 @@ class _CoalescedStyleScheduler {
311
322
  this._currentSchedule = null;
312
323
  }));
313
324
  }
314
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: _CoalescedStyleScheduler, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
315
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: _CoalescedStyleScheduler }); }
325
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: _CoalescedStyleScheduler, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
326
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: _CoalescedStyleScheduler });
316
327
  }
317
328
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: _CoalescedStyleScheduler, decorators: [{
318
329
  type: Injectable
@@ -328,10 +339,13 @@ const CDK_ROW_TEMPLATE = `<ng-container cdkCellOutlet></ng-container>`;
328
339
  * for changes and notifying the table.
329
340
  */
330
341
  class BaseRowDef {
331
- constructor() {
332
- this.template = inject(TemplateRef);
333
- this._differs = inject(IterableDiffers);
334
- }
342
+ template = inject(TemplateRef);
343
+ _differs = inject(IterableDiffers);
344
+ /** The columns to be displayed on this row. */
345
+ columns;
346
+ /** Differ used to check if any changes were made to the columns. */
347
+ _columnsDiffer;
348
+ constructor() { }
335
349
  ngOnChanges(changes) {
336
350
  // Create a new columns differ if one does not yet exist. Initialize it based on initial value
337
351
  // of the columns property or an empty array if none is provided.
@@ -360,8 +374,8 @@ class BaseRowDef {
360
374
  return column.cell.template;
361
375
  }
362
376
  }
363
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: BaseRowDef, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
364
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: BaseRowDef, isStandalone: true, usesOnChanges: true, ngImport: i0 }); }
377
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: BaseRowDef, deps: [], target: i0.ɵɵFactoryTarget.Directive });
378
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: BaseRowDef, isStandalone: true, usesOnChanges: true, ngImport: i0 });
365
379
  }
366
380
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: BaseRowDef, decorators: [{
367
381
  type: Directive
@@ -371,6 +385,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
371
385
  * Captures the header row's template and other header properties such as the columns to display.
372
386
  */
373
387
  class CdkHeaderRowDef extends BaseRowDef {
388
+ _table = inject(CDK_TABLE, { optional: true });
389
+ _hasStickyChanged = false;
374
390
  /** Whether the row is sticky. */
375
391
  get sticky() {
376
392
  return this._sticky;
@@ -381,11 +397,9 @@ class CdkHeaderRowDef extends BaseRowDef {
381
397
  this._hasStickyChanged = true;
382
398
  }
383
399
  }
400
+ _sticky = false;
384
401
  constructor() {
385
402
  super(inject(TemplateRef), inject(IterableDiffers));
386
- this._table = inject(CDK_TABLE, { optional: true });
387
- this._hasStickyChanged = false;
388
- this._sticky = false;
389
403
  }
390
404
  // Prerender fails to recognize that ngOnChanges in a part of this class through inheritance.
391
405
  // Explicitly define it so that the method is called as part of the Angular lifecycle.
@@ -402,8 +416,8 @@ class CdkHeaderRowDef extends BaseRowDef {
402
416
  resetStickyChanged() {
403
417
  this._hasStickyChanged = false;
404
418
  }
405
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkHeaderRowDef, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
406
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.0.0-next.10", type: CdkHeaderRowDef, isStandalone: true, selector: "[cdkHeaderRowDef]", inputs: { columns: ["cdkHeaderRowDef", "columns"], sticky: ["cdkHeaderRowDefSticky", "sticky", booleanAttribute] }, usesInheritance: true, usesOnChanges: true, ngImport: i0 }); }
419
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkHeaderRowDef, deps: [], target: i0.ɵɵFactoryTarget.Directive });
420
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.0.0-next.10", type: CdkHeaderRowDef, isStandalone: true, selector: "[cdkHeaderRowDef]", inputs: { columns: ["cdkHeaderRowDef", "columns"], sticky: ["cdkHeaderRowDefSticky", "sticky", booleanAttribute] }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
407
421
  }
408
422
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkHeaderRowDef, decorators: [{
409
423
  type: Directive,
@@ -420,6 +434,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
420
434
  * Captures the footer row's template and other footer properties such as the columns to display.
421
435
  */
422
436
  class CdkFooterRowDef extends BaseRowDef {
437
+ _table = inject(CDK_TABLE, { optional: true });
438
+ _hasStickyChanged = false;
423
439
  /** Whether the row is sticky. */
424
440
  get sticky() {
425
441
  return this._sticky;
@@ -430,11 +446,9 @@ class CdkFooterRowDef extends BaseRowDef {
430
446
  this._hasStickyChanged = true;
431
447
  }
432
448
  }
449
+ _sticky = false;
433
450
  constructor() {
434
451
  super(inject(TemplateRef), inject(IterableDiffers));
435
- this._table = inject(CDK_TABLE, { optional: true });
436
- this._hasStickyChanged = false;
437
- this._sticky = false;
438
452
  }
439
453
  // Prerender fails to recognize that ngOnChanges in a part of this class through inheritance.
440
454
  // Explicitly define it so that the method is called as part of the Angular lifecycle.
@@ -451,8 +465,8 @@ class CdkFooterRowDef extends BaseRowDef {
451
465
  resetStickyChanged() {
452
466
  this._hasStickyChanged = false;
453
467
  }
454
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkFooterRowDef, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
455
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.0.0-next.10", type: CdkFooterRowDef, isStandalone: true, selector: "[cdkFooterRowDef]", inputs: { columns: ["cdkFooterRowDef", "columns"], sticky: ["cdkFooterRowDefSticky", "sticky", booleanAttribute] }, usesInheritance: true, usesOnChanges: true, ngImport: i0 }); }
468
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkFooterRowDef, deps: [], target: i0.ɵɵFactoryTarget.Directive });
469
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.0.0-next.10", type: CdkFooterRowDef, isStandalone: true, selector: "[cdkFooterRowDef]", inputs: { columns: ["cdkFooterRowDef", "columns"], sticky: ["cdkFooterRowDefSticky", "sticky", booleanAttribute] }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
456
470
  }
457
471
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkFooterRowDef, decorators: [{
458
472
  type: Directive,
@@ -470,14 +484,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
470
484
  * a when predicate that describes when this row should be used.
471
485
  */
472
486
  class CdkRowDef extends BaseRowDef {
487
+ _table = inject(CDK_TABLE, { optional: true });
488
+ /**
489
+ * Function that should return true if this row template should be used for the provided index
490
+ * and row data. If left undefined, this row will be considered the default row template to use
491
+ * when no other when functions return true for the data.
492
+ * For every row, there must be at least one when function that passes or an undefined to default.
493
+ */
494
+ when;
473
495
  constructor() {
474
496
  // TODO(andrewseguin): Add an input for providing a switch function to determine
475
497
  // if this template should be used.
476
498
  super(inject(TemplateRef), inject(IterableDiffers));
477
- this._table = inject(CDK_TABLE, { optional: true });
478
499
  }
479
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkRowDef, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
480
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkRowDef, isStandalone: true, selector: "[cdkRowDef]", inputs: { columns: ["cdkRowDefColumns", "columns"], when: ["cdkRowDefWhen", "when"] }, usesInheritance: true, ngImport: i0 }); }
500
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkRowDef, deps: [], target: i0.ɵɵFactoryTarget.Directive });
501
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkRowDef, isStandalone: true, selector: "[cdkRowDef]", inputs: { columns: ["cdkRowDefColumns", "columns"], when: ["cdkRowDefWhen", "when"] }, usesInheritance: true, ngImport: i0 });
481
502
  }
482
503
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkRowDef, decorators: [{
483
504
  type: Directive,
@@ -494,6 +515,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
494
515
  * @docs-private
495
516
  */
496
517
  class CdkCellOutlet {
518
+ _viewContainer = inject(ViewContainerRef);
519
+ /** The ordered list of cells to render within this outlet's view container */
520
+ cells;
521
+ /** The data context to be provided to each cell */
522
+ context;
497
523
  /**
498
524
  * Static property containing the latest constructed instance of this class.
499
525
  * Used by the CDK table when each CdkHeaderRow and CdkRow component is created using
@@ -501,9 +527,8 @@ class CdkCellOutlet {
501
527
  * a handle to provide that component's cells and context. After init, the CdkCellOutlet will
502
528
  * construct the cells with the provided context.
503
529
  */
504
- static { this.mostRecentCellOutlet = null; }
530
+ static mostRecentCellOutlet = null;
505
531
  constructor() {
506
- this._viewContainer = inject(ViewContainerRef);
507
532
  CdkCellOutlet.mostRecentCellOutlet = this;
508
533
  }
509
534
  ngOnDestroy() {
@@ -513,8 +538,8 @@ class CdkCellOutlet {
513
538
  CdkCellOutlet.mostRecentCellOutlet = null;
514
539
  }
515
540
  }
516
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkCellOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
517
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkCellOutlet, isStandalone: true, selector: "[cdkCellOutlet]", ngImport: i0 }); }
541
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkCellOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive });
542
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkCellOutlet, isStandalone: true, selector: "[cdkCellOutlet]", ngImport: i0 });
518
543
  }
519
544
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkCellOutlet, decorators: [{
520
545
  type: Directive,
@@ -524,8 +549,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
524
549
  }], ctorParameters: () => [] });
525
550
  /** Header template container that contains the cell outlet. Adds the right class and role. */
526
551
  class CdkHeaderRow {
527
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkHeaderRow, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
528
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkHeaderRow, isStandalone: true, selector: "cdk-header-row, tr[cdk-header-row]", host: { attributes: { "role": "row" }, classAttribute: "cdk-header-row" }, ngImport: i0, template: "<ng-container cdkCellOutlet></ng-container>", isInline: true, dependencies: [{ kind: "directive", type: CdkCellOutlet, selector: "[cdkCellOutlet]" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None }); }
552
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkHeaderRow, deps: [], target: i0.ɵɵFactoryTarget.Component });
553
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkHeaderRow, isStandalone: true, selector: "cdk-header-row, tr[cdk-header-row]", host: { attributes: { "role": "row" }, classAttribute: "cdk-header-row" }, ngImport: i0, template: "<ng-container cdkCellOutlet></ng-container>", isInline: true, dependencies: [{ kind: "directive", type: CdkCellOutlet, selector: "[cdkCellOutlet]" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
529
554
  }
530
555
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkHeaderRow, decorators: [{
531
556
  type: Component,
@@ -545,8 +570,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
545
570
  }] });
546
571
  /** Footer template container that contains the cell outlet. Adds the right class and role. */
547
572
  class CdkFooterRow {
548
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkFooterRow, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
549
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkFooterRow, isStandalone: true, selector: "cdk-footer-row, tr[cdk-footer-row]", host: { attributes: { "role": "row" }, classAttribute: "cdk-footer-row" }, ngImport: i0, template: "<ng-container cdkCellOutlet></ng-container>", isInline: true, dependencies: [{ kind: "directive", type: CdkCellOutlet, selector: "[cdkCellOutlet]" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None }); }
573
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkFooterRow, deps: [], target: i0.ɵɵFactoryTarget.Component });
574
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkFooterRow, isStandalone: true, selector: "cdk-footer-row, tr[cdk-footer-row]", host: { attributes: { "role": "row" }, classAttribute: "cdk-footer-row" }, ngImport: i0, template: "<ng-container cdkCellOutlet></ng-container>", isInline: true, dependencies: [{ kind: "directive", type: CdkCellOutlet, selector: "[cdkCellOutlet]" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
550
575
  }
551
576
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkFooterRow, decorators: [{
552
577
  type: Component,
@@ -566,8 +591,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
566
591
  }] });
567
592
  /** Data row template container that contains the cell outlet. Adds the right class and role. */
568
593
  class CdkRow {
569
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkRow, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
570
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkRow, isStandalone: true, selector: "cdk-row, tr[cdk-row]", host: { attributes: { "role": "row" }, classAttribute: "cdk-row" }, ngImport: i0, template: "<ng-container cdkCellOutlet></ng-container>", isInline: true, dependencies: [{ kind: "directive", type: CdkCellOutlet, selector: "[cdkCellOutlet]" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None }); }
594
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkRow, deps: [], target: i0.ɵɵFactoryTarget.Component });
595
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkRow, isStandalone: true, selector: "cdk-row, tr[cdk-row]", host: { attributes: { "role": "row" }, classAttribute: "cdk-row" }, ngImport: i0, template: "<ng-container cdkCellOutlet></ng-container>", isInline: true, dependencies: [{ kind: "directive", type: CdkCellOutlet, selector: "[cdkCellOutlet]" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
571
596
  }
572
597
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkRow, decorators: [{
573
598
  type: Component,
@@ -587,12 +612,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
587
612
  }] });
588
613
  /** Row that can be used to display a message when no data is shown in the table. */
589
614
  class CdkNoDataRow {
590
- constructor() {
591
- this.templateRef = inject(TemplateRef);
592
- this._contentClassName = 'cdk-no-data-row';
593
- }
594
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkNoDataRow, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
595
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkNoDataRow, isStandalone: true, selector: "ng-template[cdkNoDataRow]", ngImport: i0 }); }
615
+ templateRef = inject(TemplateRef);
616
+ _contentClassName = 'cdk-no-data-row';
617
+ constructor() { }
618
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkNoDataRow, deps: [], target: i0.ɵɵFactoryTarget.Directive });
619
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkNoDataRow, isStandalone: true, selector: "ng-template[cdkNoDataRow]", ngImport: i0 });
596
620
  }
597
621
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkNoDataRow, decorators: [{
598
622
  type: Directive,
@@ -611,6 +635,21 @@ const STICKY_DIRECTIONS = ['top', 'bottom', 'left', 'right'];
611
635
  * @docs-private
612
636
  */
613
637
  class StickyStyler {
638
+ _isNativeHtmlTable;
639
+ _stickCellCss;
640
+ direction;
641
+ _coalescedStyleScheduler;
642
+ _isBrowser;
643
+ _needsPositionStickyOnElement;
644
+ _positionListener;
645
+ _elemSizeCache = new WeakMap();
646
+ _resizeObserver = globalThis?.ResizeObserver
647
+ ? new globalThis.ResizeObserver(entries => this._updateCachedSizes(entries))
648
+ : null;
649
+ _updatedStickyColumnsParamsToReplay = [];
650
+ _stickyColumnsReplayTimeout = null;
651
+ _cachedCellWidths = [];
652
+ _borderCellCss;
614
653
  /**
615
654
  * @param _isNativeHtmlTable Whether the sticky logic should be based on a table
616
655
  * that uses the native `<table>` element.
@@ -633,7 +672,6 @@ class StickyStyler {
633
672
  this._isBrowser = _isBrowser;
634
673
  this._needsPositionStickyOnElement = _needsPositionStickyOnElement;
635
674
  this._positionListener = _positionListener;
636
- this._cachedCellWidths = [];
637
675
  this._borderCellCss = {
638
676
  'top': `${_stickCellCss}-border-elem-top`,
639
677
  'bottom': `${_stickCellCss}-border-elem-bottom`,
@@ -648,6 +686,9 @@ class StickyStyler {
648
686
  * @param stickyDirections The directions that should no longer be set as sticky on the rows.
649
687
  */
650
688
  clearStickyPositioning(rows, stickyDirections) {
689
+ if (stickyDirections.includes('left') || stickyDirections.includes('right')) {
690
+ this._removeFromStickyColumnReplayQueue(rows);
691
+ }
651
692
  const elementsToClear = [];
652
693
  for (const row of rows) {
653
694
  // If the row isn't an element (e.g. if it's an `ng-container`),
@@ -677,8 +718,16 @@ class StickyStyler {
677
718
  * in this index position should be stuck to the end of the row.
678
719
  * @param recalculateCellWidths Whether the sticky styler should recalculate the width of each
679
720
  * column cell. If `false` cached widths will be used instead.
721
+ * @param replay Whether to enqueue this call for replay after a ResizeObserver update.
680
722
  */
681
- updateStickyColumns(rows, stickyStartStates, stickyEndStates, recalculateCellWidths = true) {
723
+ updateStickyColumns(rows, stickyStartStates, stickyEndStates, recalculateCellWidths = true, replay = true) {
724
+ if (replay) {
725
+ this._updateStickyColumnReplayQueue({
726
+ rows: [...rows],
727
+ stickyStartStates: [...stickyStartStates],
728
+ stickyEndStates: [...stickyEndStates],
729
+ });
730
+ }
682
731
  if (!rows.length ||
683
732
  !this._isBrowser ||
684
733
  !(stickyStartStates.some(state => state) || stickyEndStates.some(state => state))) {
@@ -767,7 +816,7 @@ class StickyStyler {
767
816
  elementsToStick[rowIndex] = this._isNativeHtmlTable
768
817
  ? Array.from(row.children)
769
818
  : [row];
770
- const height = row.getBoundingClientRect().height;
819
+ const height = this._retrieveElementSize(row).height;
771
820
  stickyOffset += height;
772
821
  stickyCellHeights[rowIndex] = height;
773
822
  }
@@ -901,8 +950,8 @@ class StickyStyler {
901
950
  const cellWidths = [];
902
951
  const firstRowCells = row.children;
903
952
  for (let i = 0; i < firstRowCells.length; i++) {
904
- let cell = firstRowCells[i];
905
- cellWidths.push(cell.getBoundingClientRect().width);
953
+ const cell = firstRowCells[i];
954
+ cellWidths.push(this._retrieveElementSize(cell).width);
906
955
  }
907
956
  this._cachedCellWidths = cellWidths;
908
957
  return cellWidths;
@@ -939,6 +988,79 @@ class StickyStyler {
939
988
  }
940
989
  return positions;
941
990
  }
991
+ /**
992
+ * Retreives the most recently observed size of the specified element from the cache, or
993
+ * meaures it directly if not yet cached.
994
+ */
995
+ _retrieveElementSize(element) {
996
+ const cachedSize = this._elemSizeCache.get(element);
997
+ if (cachedSize) {
998
+ return cachedSize;
999
+ }
1000
+ const clientRect = element.getBoundingClientRect();
1001
+ const size = { width: clientRect.width, height: clientRect.height };
1002
+ if (!this._resizeObserver) {
1003
+ return size;
1004
+ }
1005
+ this._elemSizeCache.set(element, size);
1006
+ this._resizeObserver.observe(element, { box: 'border-box' });
1007
+ return size;
1008
+ }
1009
+ /**
1010
+ * Conditionally enqueue the requested sticky update and clear previously queued updates
1011
+ * for the same rows.
1012
+ */
1013
+ _updateStickyColumnReplayQueue(params) {
1014
+ this._removeFromStickyColumnReplayQueue(params.rows);
1015
+ // No need to replay if a flush is pending.
1016
+ if (this._stickyColumnsReplayTimeout) {
1017
+ return;
1018
+ }
1019
+ this._updatedStickyColumnsParamsToReplay.push(params);
1020
+ }
1021
+ /** Remove updates for the specified rows from the queue. */
1022
+ _removeFromStickyColumnReplayQueue(rows) {
1023
+ const rowsSet = new Set(rows);
1024
+ for (const update of this._updatedStickyColumnsParamsToReplay) {
1025
+ update.rows = update.rows.filter(row => !rowsSet.has(row));
1026
+ }
1027
+ this._updatedStickyColumnsParamsToReplay = this._updatedStickyColumnsParamsToReplay.filter(update => !!update.rows.length);
1028
+ }
1029
+ /** Update _elemSizeCache with the observed sizes. */
1030
+ _updateCachedSizes(entries) {
1031
+ let needsColumnUpdate = false;
1032
+ for (const entry of entries) {
1033
+ const newEntry = entry.borderBoxSize?.length
1034
+ ? {
1035
+ width: entry.borderBoxSize[0].inlineSize,
1036
+ height: entry.borderBoxSize[0].blockSize,
1037
+ }
1038
+ : {
1039
+ width: entry.contentRect.width,
1040
+ height: entry.contentRect.height,
1041
+ };
1042
+ if (newEntry.width !== this._elemSizeCache.get(entry.target)?.width &&
1043
+ isCell(entry.target)) {
1044
+ needsColumnUpdate = true;
1045
+ }
1046
+ this._elemSizeCache.set(entry.target, newEntry);
1047
+ }
1048
+ if (needsColumnUpdate && this._updatedStickyColumnsParamsToReplay.length) {
1049
+ if (this._stickyColumnsReplayTimeout) {
1050
+ clearTimeout(this._stickyColumnsReplayTimeout);
1051
+ }
1052
+ this._stickyColumnsReplayTimeout = setTimeout(() => {
1053
+ for (const update of this._updatedStickyColumnsParamsToReplay) {
1054
+ this.updateStickyColumns(update.rows, update.stickyStartStates, update.stickyEndStates, true, false);
1055
+ }
1056
+ this._updatedStickyColumnsParamsToReplay = [];
1057
+ this._stickyColumnsReplayTimeout = null;
1058
+ }, 0);
1059
+ }
1060
+ }
1061
+ }
1062
+ function isCell(element) {
1063
+ return ['cdk-cell', 'cdk-header-cell', 'cdk-footer-cell'].some(klass => element.classList.contains(klass));
942
1064
  }
943
1065
 
944
1066
  /**
@@ -1009,8 +1131,8 @@ const STICKY_POSITIONING_LISTENER = new InjectionToken('CDK_SPL');
1009
1131
  * tables that animate rows.
1010
1132
  */
1011
1133
  class CdkRecycleRows {
1012
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkRecycleRows, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1013
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkRecycleRows, isStandalone: true, selector: "cdk-table[recycleRows], table[cdk-table][recycleRows]", providers: [{ provide: _VIEW_REPEATER_STRATEGY, useClass: _RecycleViewRepeaterStrategy }], ngImport: i0 }); }
1134
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkRecycleRows, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1135
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkRecycleRows, isStandalone: true, selector: "cdk-table[recycleRows], table[cdk-table][recycleRows]", providers: [{ provide: _VIEW_REPEATER_STRATEGY, useClass: _RecycleViewRepeaterStrategy }], ngImport: i0 });
1014
1136
  }
1015
1137
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkRecycleRows, decorators: [{
1016
1138
  type: Directive,
@@ -1024,15 +1146,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
1024
1146
  * @docs-private
1025
1147
  */
1026
1148
  class DataRowOutlet {
1149
+ viewContainer = inject(ViewContainerRef);
1150
+ elementRef = inject(ElementRef);
1027
1151
  constructor() {
1028
- this.viewContainer = inject(ViewContainerRef);
1029
- this.elementRef = inject(ElementRef);
1030
1152
  const table = inject(CDK_TABLE);
1031
1153
  table._rowOutlet = this;
1032
1154
  table._outletAssigned();
1033
1155
  }
1034
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: DataRowOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1035
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: DataRowOutlet, isStandalone: true, selector: "[rowOutlet]", ngImport: i0 }); }
1156
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: DataRowOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1157
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: DataRowOutlet, isStandalone: true, selector: "[rowOutlet]", ngImport: i0 });
1036
1158
  }
1037
1159
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: DataRowOutlet, decorators: [{
1038
1160
  type: Directive,
@@ -1045,15 +1167,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
1045
1167
  * @docs-private
1046
1168
  */
1047
1169
  class HeaderRowOutlet {
1170
+ viewContainer = inject(ViewContainerRef);
1171
+ elementRef = inject(ElementRef);
1048
1172
  constructor() {
1049
- this.viewContainer = inject(ViewContainerRef);
1050
- this.elementRef = inject(ElementRef);
1051
1173
  const table = inject(CDK_TABLE);
1052
1174
  table._headerRowOutlet = this;
1053
1175
  table._outletAssigned();
1054
1176
  }
1055
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: HeaderRowOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1056
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: HeaderRowOutlet, isStandalone: true, selector: "[headerRowOutlet]", ngImport: i0 }); }
1177
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: HeaderRowOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1178
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: HeaderRowOutlet, isStandalone: true, selector: "[headerRowOutlet]", ngImport: i0 });
1057
1179
  }
1058
1180
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: HeaderRowOutlet, decorators: [{
1059
1181
  type: Directive,
@@ -1066,15 +1188,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
1066
1188
  * @docs-private
1067
1189
  */
1068
1190
  class FooterRowOutlet {
1191
+ viewContainer = inject(ViewContainerRef);
1192
+ elementRef = inject(ElementRef);
1069
1193
  constructor() {
1070
- this.viewContainer = inject(ViewContainerRef);
1071
- this.elementRef = inject(ElementRef);
1072
1194
  const table = inject(CDK_TABLE);
1073
1195
  table._footerRowOutlet = this;
1074
1196
  table._outletAssigned();
1075
1197
  }
1076
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: FooterRowOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1077
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: FooterRowOutlet, isStandalone: true, selector: "[footerRowOutlet]", ngImport: i0 }); }
1198
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: FooterRowOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1199
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: FooterRowOutlet, isStandalone: true, selector: "[footerRowOutlet]", ngImport: i0 });
1078
1200
  }
1079
1201
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: FooterRowOutlet, decorators: [{
1080
1202
  type: Directive,
@@ -1088,15 +1210,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
1088
1210
  * @docs-private
1089
1211
  */
1090
1212
  class NoDataRowOutlet {
1213
+ viewContainer = inject(ViewContainerRef);
1214
+ elementRef = inject(ElementRef);
1091
1215
  constructor() {
1092
- this.viewContainer = inject(ViewContainerRef);
1093
- this.elementRef = inject(ElementRef);
1094
1216
  const table = inject(CDK_TABLE);
1095
1217
  table._noDataRowOutlet = this;
1096
1218
  table._outletAssigned();
1097
1219
  }
1098
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: NoDataRowOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1099
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: NoDataRowOutlet, isStandalone: true, selector: "[noDataRowOutlet]", ngImport: i0 }); }
1220
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: NoDataRowOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1221
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: NoDataRowOutlet, isStandalone: true, selector: "[noDataRowOutlet]", ngImport: i0 });
1100
1222
  }
1101
1223
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: NoDataRowOutlet, decorators: [{
1102
1224
  type: Directive,
@@ -1155,6 +1277,138 @@ class RowViewRef extends EmbeddedViewRef {
1155
1277
  * connect function that will return an Observable stream that emits the data array to render.
1156
1278
  */
1157
1279
  class CdkTable {
1280
+ _differs = inject(IterableDiffers);
1281
+ _changeDetectorRef = inject(ChangeDetectorRef);
1282
+ _elementRef = inject(ElementRef);
1283
+ _dir = inject(Directionality, { optional: true });
1284
+ _platform = inject(Platform);
1285
+ _viewRepeater = inject(_VIEW_REPEATER_STRATEGY);
1286
+ _coalescedStyleScheduler = inject(_COALESCED_STYLE_SCHEDULER);
1287
+ _viewportRuler = inject(ViewportRuler);
1288
+ _stickyPositioningListener = inject(STICKY_POSITIONING_LISTENER, { optional: true, skipSelf: true });
1289
+ _document = inject(DOCUMENT);
1290
+ /** Latest data provided by the data source. */
1291
+ _data;
1292
+ /** Subject that emits when the component has been destroyed. */
1293
+ _onDestroy = new Subject();
1294
+ /** List of the rendered rows as identified by their `RenderRow` object. */
1295
+ _renderRows;
1296
+ /** Subscription that listens for the data provided by the data source. */
1297
+ _renderChangeSubscription;
1298
+ /**
1299
+ * Map of all the user's defined columns (header, data, and footer cell template) identified by
1300
+ * name. Collection populated by the column definitions gathered by `ContentChildren` as well as
1301
+ * any custom column definitions added to `_customColumnDefs`.
1302
+ */
1303
+ _columnDefsByName = new Map();
1304
+ /**
1305
+ * Set of all row definitions that can be used by this table. Populated by the rows gathered by
1306
+ * using `ContentChildren` as well as any custom row definitions added to `_customRowDefs`.
1307
+ */
1308
+ _rowDefs;
1309
+ /**
1310
+ * Set of all header row definitions that can be used by this table. Populated by the rows
1311
+ * gathered by using `ContentChildren` as well as any custom row definitions added to
1312
+ * `_customHeaderRowDefs`.
1313
+ */
1314
+ _headerRowDefs;
1315
+ /**
1316
+ * Set of all row definitions that can be used by this table. Populated by the rows gathered by
1317
+ * using `ContentChildren` as well as any custom row definitions added to
1318
+ * `_customFooterRowDefs`.
1319
+ */
1320
+ _footerRowDefs;
1321
+ /** Differ used to find the changes in the data provided by the data source. */
1322
+ _dataDiffer;
1323
+ /** Stores the row definition that does not have a when predicate. */
1324
+ _defaultRowDef;
1325
+ /**
1326
+ * Column definitions that were defined outside of the direct content children of the table.
1327
+ * These will be defined when, e.g., creating a wrapper around the cdkTable that has
1328
+ * column definitions as *its* content child.
1329
+ */
1330
+ _customColumnDefs = new Set();
1331
+ /**
1332
+ * Data row definitions that were defined outside of the direct content children of the table.
1333
+ * These will be defined when, e.g., creating a wrapper around the cdkTable that has
1334
+ * built-in data rows as *its* content child.
1335
+ */
1336
+ _customRowDefs = new Set();
1337
+ /**
1338
+ * Header row definitions that were defined outside of the direct content children of the table.
1339
+ * These will be defined when, e.g., creating a wrapper around the cdkTable that has
1340
+ * built-in header rows as *its* content child.
1341
+ */
1342
+ _customHeaderRowDefs = new Set();
1343
+ /**
1344
+ * Footer row definitions that were defined outside of the direct content children of the table.
1345
+ * These will be defined when, e.g., creating a wrapper around the cdkTable that has a
1346
+ * built-in footer row as *its* content child.
1347
+ */
1348
+ _customFooterRowDefs = new Set();
1349
+ /** No data row that was defined outside of the direct content children of the table. */
1350
+ _customNoDataRow;
1351
+ /**
1352
+ * Whether the header row definition has been changed. Triggers an update to the header row after
1353
+ * content is checked. Initialized as true so that the table renders the initial set of rows.
1354
+ */
1355
+ _headerRowDefChanged = true;
1356
+ /**
1357
+ * Whether the footer row definition has been changed. Triggers an update to the footer row after
1358
+ * content is checked. Initialized as true so that the table renders the initial set of rows.
1359
+ */
1360
+ _footerRowDefChanged = true;
1361
+ /**
1362
+ * Whether the sticky column styles need to be updated. Set to `true` when the visible columns
1363
+ * change.
1364
+ */
1365
+ _stickyColumnStylesNeedReset = true;
1366
+ /**
1367
+ * Whether the sticky styler should recalculate cell widths when applying sticky styles. If
1368
+ * `false`, cached values will be used instead. This is only applicable to tables with
1369
+ * {@link fixedLayout} enabled. For other tables, cell widths will always be recalculated.
1370
+ */
1371
+ _forceRecalculateCellWidths = true;
1372
+ /**
1373
+ * Cache of the latest rendered `RenderRow` objects as a map for easy retrieval when constructing
1374
+ * a new list of `RenderRow` objects for rendering rows. Since the new list is constructed with
1375
+ * the cached `RenderRow` objects when possible, the row identity is preserved when the data
1376
+ * and row template matches, which allows the `IterableDiffer` to check rows by reference
1377
+ * and understand which rows are added/moved/removed.
1378
+ *
1379
+ * Implemented as a map of maps where the first key is the `data: T` object and the second is the
1380
+ * `CdkRowDef<T>` object. With the two keys, the cache points to a `RenderRow<T>` object that
1381
+ * contains an array of created pairs. The array is necessary to handle cases where the data
1382
+ * array contains multiple duplicate data objects and each instantiated `RenderRow` must be
1383
+ * stored.
1384
+ */
1385
+ _cachedRenderRowsMap = new Map();
1386
+ /** Whether the table is applied to a native `<table>`. */
1387
+ _isNativeHtmlTable;
1388
+ /**
1389
+ * Utility class that is responsible for applying the appropriate sticky positioning styles to
1390
+ * the table's rows and cells.
1391
+ */
1392
+ _stickyStyler;
1393
+ /**
1394
+ * CSS class added to any row or cell that has sticky positioning applied. May be overridden by
1395
+ * table subclasses.
1396
+ */
1397
+ stickyCssClass = 'cdk-table-sticky';
1398
+ /**
1399
+ * Whether to manually add position: sticky to all sticky cell elements. Not needed if
1400
+ * the position is set in a selector associated with the value of stickyCssClass. May be
1401
+ * overridden by table subclasses
1402
+ */
1403
+ needsPositionStickyOnElement = true;
1404
+ /** Whether the component is being rendered on the server. */
1405
+ _isServer;
1406
+ /** Whether the no data row is currently showing anything. */
1407
+ _isShowingNoDataRow = false;
1408
+ /** Whether the table has rendered out all the outlets for the first time. */
1409
+ _hasAllOutlets = false;
1410
+ /** Whether the table is done initializing. */
1411
+ _hasInitialized = false;
1158
1412
  /** Aria role to apply to the table's cells based on the table's own role. */
1159
1413
  _getCellRole() {
1160
1414
  if (this._cellRoleInternal === undefined) {
@@ -1165,6 +1419,7 @@ class CdkTable {
1165
1419
  }
1166
1420
  return this._cellRoleInternal;
1167
1421
  }
1422
+ _cellRoleInternal = undefined;
1168
1423
  /**
1169
1424
  * Tracking function that will be used to check the differences in data changes. Used similarly
1170
1425
  * to `ngFor` `trackBy` function. Optimize row operations by identifying a row based on its data
@@ -1180,6 +1435,7 @@ class CdkTable {
1180
1435
  }
1181
1436
  this._trackByFn = fn;
1182
1437
  }
1438
+ _trackByFn;
1183
1439
  /**
1184
1440
  * The table's source of data, which can be provided in three ways (in order of complexity):
1185
1441
  * - Simple data array (each object represents one table row)
@@ -1208,6 +1464,7 @@ class CdkTable {
1208
1464
  this._switchDataSource(dataSource);
1209
1465
  }
1210
1466
  }
1467
+ _dataSource;
1211
1468
  /**
1212
1469
  * Whether to allow multiple rows per data object by evaluating which rows evaluate their 'when'
1213
1470
  * predicate to true. If `multiTemplateDataRows` is false, which is the default value, then each
@@ -1226,6 +1483,7 @@ class CdkTable {
1226
1483
  this.updateStickyColumnStyles();
1227
1484
  }
1228
1485
  }
1486
+ _multiTemplateDataRows = false;
1229
1487
  /**
1230
1488
  * Whether to use a fixed table layout. Enabling this option will enforce consistent column widths
1231
1489
  * and optimize rendering sticky styles for native tables. No-op for flex tables.
@@ -1239,122 +1497,44 @@ class CdkTable {
1239
1497
  this._forceRecalculateCellWidths = true;
1240
1498
  this._stickyColumnStylesNeedReset = true;
1241
1499
  }
1500
+ _fixedLayout = false;
1501
+ /**
1502
+ * Emits when the table completes rendering a set of data rows based on the latest data from the
1503
+ * data source, even if the set of rows is empty.
1504
+ */
1505
+ contentChanged = new EventEmitter();
1506
+ // TODO(andrewseguin): Remove max value as the end index
1507
+ // and instead calculate the view on init and scroll.
1508
+ /**
1509
+ * Stream containing the latest information on what rows are being displayed on screen.
1510
+ * Can be used by the data source to as a heuristic of what data should be provided.
1511
+ *
1512
+ * @docs-private
1513
+ */
1514
+ viewChange = new BehaviorSubject({
1515
+ start: 0,
1516
+ end: Number.MAX_VALUE,
1517
+ });
1518
+ // Outlets in the table's template where the header, data rows, and footer will be inserted.
1519
+ _rowOutlet;
1520
+ _headerRowOutlet;
1521
+ _footerRowOutlet;
1522
+ _noDataRowOutlet;
1523
+ /**
1524
+ * The column definitions provided by the user that contain what the header, data, and footer
1525
+ * cells should render for each column.
1526
+ */
1527
+ _contentColumnDefs;
1528
+ /** Set of data row definitions that were provided to the table as content children. */
1529
+ _contentRowDefs;
1530
+ /** Set of header row definitions that were provided to the table as content children. */
1531
+ _contentHeaderRowDefs;
1532
+ /** Set of footer row definitions that were provided to the table as content children. */
1533
+ _contentFooterRowDefs;
1534
+ /** Row definition that will only be rendered if there's no data in the table. */
1535
+ _noDataRow;
1536
+ _injector = inject(Injector);
1242
1537
  constructor() {
1243
- this._differs = inject(IterableDiffers);
1244
- this._changeDetectorRef = inject(ChangeDetectorRef);
1245
- this._elementRef = inject(ElementRef);
1246
- this._dir = inject(Directionality, { optional: true });
1247
- this._platform = inject(Platform);
1248
- this._viewRepeater = inject(_VIEW_REPEATER_STRATEGY);
1249
- this._coalescedStyleScheduler = inject(_COALESCED_STYLE_SCHEDULER);
1250
- this._viewportRuler = inject(ViewportRuler);
1251
- this._stickyPositioningListener = inject(STICKY_POSITIONING_LISTENER, { optional: true, skipSelf: true });
1252
- this._document = inject(DOCUMENT);
1253
- /** Subject that emits when the component has been destroyed. */
1254
- this._onDestroy = new Subject();
1255
- /**
1256
- * Map of all the user's defined columns (header, data, and footer cell template) identified by
1257
- * name. Collection populated by the column definitions gathered by `ContentChildren` as well as
1258
- * any custom column definitions added to `_customColumnDefs`.
1259
- */
1260
- this._columnDefsByName = new Map();
1261
- /**
1262
- * Column definitions that were defined outside of the direct content children of the table.
1263
- * These will be defined when, e.g., creating a wrapper around the cdkTable that has
1264
- * column definitions as *its* content child.
1265
- */
1266
- this._customColumnDefs = new Set();
1267
- /**
1268
- * Data row definitions that were defined outside of the direct content children of the table.
1269
- * These will be defined when, e.g., creating a wrapper around the cdkTable that has
1270
- * built-in data rows as *its* content child.
1271
- */
1272
- this._customRowDefs = new Set();
1273
- /**
1274
- * Header row definitions that were defined outside of the direct content children of the table.
1275
- * These will be defined when, e.g., creating a wrapper around the cdkTable that has
1276
- * built-in header rows as *its* content child.
1277
- */
1278
- this._customHeaderRowDefs = new Set();
1279
- /**
1280
- * Footer row definitions that were defined outside of the direct content children of the table.
1281
- * These will be defined when, e.g., creating a wrapper around the cdkTable that has a
1282
- * built-in footer row as *its* content child.
1283
- */
1284
- this._customFooterRowDefs = new Set();
1285
- /**
1286
- * Whether the header row definition has been changed. Triggers an update to the header row after
1287
- * content is checked. Initialized as true so that the table renders the initial set of rows.
1288
- */
1289
- this._headerRowDefChanged = true;
1290
- /**
1291
- * Whether the footer row definition has been changed. Triggers an update to the footer row after
1292
- * content is checked. Initialized as true so that the table renders the initial set of rows.
1293
- */
1294
- this._footerRowDefChanged = true;
1295
- /**
1296
- * Whether the sticky column styles need to be updated. Set to `true` when the visible columns
1297
- * change.
1298
- */
1299
- this._stickyColumnStylesNeedReset = true;
1300
- /**
1301
- * Whether the sticky styler should recalculate cell widths when applying sticky styles. If
1302
- * `false`, cached values will be used instead. This is only applicable to tables with
1303
- * {@link fixedLayout} enabled. For other tables, cell widths will always be recalculated.
1304
- */
1305
- this._forceRecalculateCellWidths = true;
1306
- /**
1307
- * Cache of the latest rendered `RenderRow` objects as a map for easy retrieval when constructing
1308
- * a new list of `RenderRow` objects for rendering rows. Since the new list is constructed with
1309
- * the cached `RenderRow` objects when possible, the row identity is preserved when the data
1310
- * and row template matches, which allows the `IterableDiffer` to check rows by reference
1311
- * and understand which rows are added/moved/removed.
1312
- *
1313
- * Implemented as a map of maps where the first key is the `data: T` object and the second is the
1314
- * `CdkRowDef<T>` object. With the two keys, the cache points to a `RenderRow<T>` object that
1315
- * contains an array of created pairs. The array is necessary to handle cases where the data
1316
- * array contains multiple duplicate data objects and each instantiated `RenderRow` must be
1317
- * stored.
1318
- */
1319
- this._cachedRenderRowsMap = new Map();
1320
- /**
1321
- * CSS class added to any row or cell that has sticky positioning applied. May be overridden by
1322
- * table subclasses.
1323
- */
1324
- this.stickyCssClass = 'cdk-table-sticky';
1325
- /**
1326
- * Whether to manually add position: sticky to all sticky cell elements. Not needed if
1327
- * the position is set in a selector associated with the value of stickyCssClass. May be
1328
- * overridden by table subclasses
1329
- */
1330
- this.needsPositionStickyOnElement = true;
1331
- /** Whether the no data row is currently showing anything. */
1332
- this._isShowingNoDataRow = false;
1333
- /** Whether the table has rendered out all the outlets for the first time. */
1334
- this._hasAllOutlets = false;
1335
- /** Whether the table is done initializing. */
1336
- this._hasInitialized = false;
1337
- this._cellRoleInternal = undefined;
1338
- this._multiTemplateDataRows = false;
1339
- this._fixedLayout = false;
1340
- /**
1341
- * Emits when the table completes rendering a set of data rows based on the latest data from the
1342
- * data source, even if the set of rows is empty.
1343
- */
1344
- this.contentChanged = new EventEmitter();
1345
- // TODO(andrewseguin): Remove max value as the end index
1346
- // and instead calculate the view on init and scroll.
1347
- /**
1348
- * Stream containing the latest information on what rows are being displayed on screen.
1349
- * Can be used by the data source to as a heuristic of what data should be provided.
1350
- *
1351
- * @docs-private
1352
- */
1353
- this.viewChange = new BehaviorSubject({
1354
- start: 0,
1355
- end: Number.MAX_VALUE,
1356
- });
1357
- this._injector = inject(Injector);
1358
1538
  const role = inject(new HostAttributeToken('role'), { optional: true });
1359
1539
  if (!role) {
1360
1540
  this._elementRef.nativeElement.setAttribute('role', 'table');
@@ -2009,14 +2189,14 @@ class CdkTable {
2009
2189
  this._isShowingNoDataRow = shouldShow;
2010
2190
  this._changeDetectorRef.markForCheck();
2011
2191
  }
2012
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkTable, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2013
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0-next.10", type: CdkTable, isStandalone: true, selector: "cdk-table, table[cdk-table]", inputs: { trackBy: "trackBy", dataSource: "dataSource", multiTemplateDataRows: ["multiTemplateDataRows", "multiTemplateDataRows", booleanAttribute], fixedLayout: ["fixedLayout", "fixedLayout", booleanAttribute] }, outputs: { contentChanged: "contentChanged" }, host: { properties: { "class.cdk-table-fixed-layout": "fixedLayout" }, classAttribute: "cdk-table" }, providers: [
2192
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkTable, deps: [], target: i0.ɵɵFactoryTarget.Component });
2193
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0-next.10", type: CdkTable, isStandalone: true, selector: "cdk-table, table[cdk-table]", inputs: { trackBy: "trackBy", dataSource: "dataSource", multiTemplateDataRows: ["multiTemplateDataRows", "multiTemplateDataRows", booleanAttribute], fixedLayout: ["fixedLayout", "fixedLayout", booleanAttribute] }, outputs: { contentChanged: "contentChanged" }, host: { properties: { "class.cdk-table-fixed-layout": "fixedLayout" }, classAttribute: "cdk-table" }, providers: [
2014
2194
  { provide: CDK_TABLE, useExisting: CdkTable },
2015
2195
  { provide: _VIEW_REPEATER_STRATEGY, useClass: _DisposeViewRepeaterStrategy },
2016
2196
  { provide: _COALESCED_STYLE_SCHEDULER, useClass: _CoalescedStyleScheduler },
2017
2197
  // Prevent nested tables from seeing this table's StickyPositioningListener.
2018
2198
  { provide: STICKY_POSITIONING_LISTENER, useValue: null },
2019
- ], queries: [{ propertyName: "_noDataRow", first: true, predicate: CdkNoDataRow, descendants: true }, { propertyName: "_contentColumnDefs", predicate: CdkColumnDef, descendants: true }, { propertyName: "_contentRowDefs", predicate: CdkRowDef, descendants: true }, { propertyName: "_contentHeaderRowDefs", predicate: CdkHeaderRowDef, descendants: true }, { propertyName: "_contentFooterRowDefs", predicate: CdkFooterRowDef, descendants: true }], exportAs: ["cdkTable"], ngImport: i0, template: "\n <ng-content select=\"caption\"/>\n <ng-content select=\"colgroup, col\"/>\n\n <!--\n Unprojected content throws a hydration error so we need this to capture it.\n It gets removed on the client so it doesn't affect the layout.\n -->\n @if (_isServer) {\n <ng-content/>\n }\n\n @if (_isNativeHtmlTable) {\n <thead role=\"rowgroup\">\n <ng-container headerRowOutlet/>\n </thead>\n <tbody role=\"rowgroup\">\n <ng-container rowOutlet/>\n <ng-container noDataRowOutlet/>\n </tbody>\n <tfoot role=\"rowgroup\">\n <ng-container footerRowOutlet/>\n </tfoot>\n } @else {\n <ng-container headerRowOutlet/>\n <ng-container rowOutlet/>\n <ng-container noDataRowOutlet/>\n <ng-container footerRowOutlet/>\n }\n", isInline: true, styles: [".cdk-table-fixed-layout{table-layout:fixed}"], dependencies: [{ kind: "directive", type: HeaderRowOutlet, selector: "[headerRowOutlet]" }, { kind: "directive", type: DataRowOutlet, selector: "[rowOutlet]" }, { kind: "directive", type: NoDataRowOutlet, selector: "[noDataRowOutlet]" }, { kind: "directive", type: FooterRowOutlet, selector: "[footerRowOutlet]" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None }); }
2199
+ ], queries: [{ propertyName: "_noDataRow", first: true, predicate: CdkNoDataRow, descendants: true }, { propertyName: "_contentColumnDefs", predicate: CdkColumnDef, descendants: true }, { propertyName: "_contentRowDefs", predicate: CdkRowDef, descendants: true }, { propertyName: "_contentHeaderRowDefs", predicate: CdkHeaderRowDef, descendants: true }, { propertyName: "_contentFooterRowDefs", predicate: CdkFooterRowDef, descendants: true }], exportAs: ["cdkTable"], ngImport: i0, template: "\n <ng-content select=\"caption\"/>\n <ng-content select=\"colgroup, col\"/>\n\n <!--\n Unprojected content throws a hydration error so we need this to capture it.\n It gets removed on the client so it doesn't affect the layout.\n -->\n @if (_isServer) {\n <ng-content/>\n }\n\n @if (_isNativeHtmlTable) {\n <thead role=\"rowgroup\">\n <ng-container headerRowOutlet/>\n </thead>\n <tbody role=\"rowgroup\">\n <ng-container rowOutlet/>\n <ng-container noDataRowOutlet/>\n </tbody>\n <tfoot role=\"rowgroup\">\n <ng-container footerRowOutlet/>\n </tfoot>\n } @else {\n <ng-container headerRowOutlet/>\n <ng-container rowOutlet/>\n <ng-container noDataRowOutlet/>\n <ng-container footerRowOutlet/>\n }\n", isInline: true, styles: [".cdk-table-fixed-layout{table-layout:fixed}"], dependencies: [{ kind: "directive", type: HeaderRowOutlet, selector: "[headerRowOutlet]" }, { kind: "directive", type: DataRowOutlet, selector: "[rowOutlet]" }, { kind: "directive", type: NoDataRowOutlet, selector: "[noDataRowOutlet]" }, { kind: "directive", type: FooterRowOutlet, selector: "[footerRowOutlet]" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
2020
2200
  }
2021
2201
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkTable, decorators: [{
2022
2202
  type: Component,
@@ -2098,6 +2278,8 @@ function closestTableSection(outlet, section) {
2098
2278
  * input.
2099
2279
  */
2100
2280
  class CdkTextColumn {
2281
+ _table = inject(CdkTable, { optional: true });
2282
+ _options = inject(TEXT_COLUMN_OPTIONS, { optional: true });
2101
2283
  /** Column name that should be used to reference this column. */
2102
2284
  get name() {
2103
2285
  return this._name;
@@ -2108,11 +2290,40 @@ class CdkTextColumn {
2108
2290
  // available. In that case, we defer the synchronization until "ngOnInit" fires.
2109
2291
  this._syncColumnDefName();
2110
2292
  }
2293
+ _name;
2294
+ /**
2295
+ * Text label that should be used for the column header. If this property is not
2296
+ * set, the header text will default to the column name with its first letter capitalized.
2297
+ */
2298
+ headerText;
2299
+ /**
2300
+ * Accessor function to retrieve the data rendered for each cell. If this
2301
+ * property is not set, the data cells will render the value found in the data's property matching
2302
+ * the column's name. For example, if the column is named `id`, then the rendered value will be
2303
+ * value defined by the data's `id` property.
2304
+ */
2305
+ dataAccessor;
2306
+ /** Alignment of the cell values. */
2307
+ justify = 'start';
2308
+ /** @docs-private */
2309
+ columnDef;
2310
+ /**
2311
+ * The column cell is provided to the column during `ngOnInit` with a static query.
2312
+ * Normally, this will be retrieved by the column using `ContentChild`, but that assumes the
2313
+ * column definition was provided in the same view as the table, which is not the case with this
2314
+ * component.
2315
+ * @docs-private
2316
+ */
2317
+ cell;
2318
+ /**
2319
+ * The column headerCell is provided to the column during `ngOnInit` with a static query.
2320
+ * Normally, this will be retrieved by the column using `ContentChild`, but that assumes the
2321
+ * column definition was provided in the same view as the table, which is not the case with this
2322
+ * component.
2323
+ * @docs-private
2324
+ */
2325
+ headerCell;
2111
2326
  constructor() {
2112
- this._table = inject(CdkTable, { optional: true });
2113
- this._options = inject(TEXT_COLUMN_OPTIONS, { optional: true });
2114
- /** Alignment of the cell values. */
2115
- this.justify = 'start';
2116
2327
  this._options = this._options || {};
2117
2328
  }
2118
2329
  ngOnInit() {
@@ -2161,8 +2372,8 @@ class CdkTextColumn {
2161
2372
  this.columnDef.name = this.name;
2162
2373
  }
2163
2374
  }
2164
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkTextColumn, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2165
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkTextColumn, isStandalone: true, selector: "cdk-text-column", inputs: { name: "name", headerText: "headerText", dataAccessor: "dataAccessor", justify: "justify" }, viewQueries: [{ propertyName: "columnDef", first: true, predicate: CdkColumnDef, descendants: true, static: true }, { propertyName: "cell", first: true, predicate: CdkCellDef, descendants: true, static: true }, { propertyName: "headerCell", first: true, predicate: CdkHeaderCellDef, descendants: true, static: true }], ngImport: i0, template: `
2375
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkTextColumn, deps: [], target: i0.ɵɵFactoryTarget.Component });
2376
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkTextColumn, isStandalone: true, selector: "cdk-text-column", inputs: { name: "name", headerText: "headerText", dataAccessor: "dataAccessor", justify: "justify" }, viewQueries: [{ propertyName: "columnDef", first: true, predicate: CdkColumnDef, descendants: true, static: true }, { propertyName: "cell", first: true, predicate: CdkCellDef, descendants: true, static: true }, { propertyName: "headerCell", first: true, predicate: CdkHeaderCellDef, descendants: true, static: true }], ngImport: i0, template: `
2166
2377
  <ng-container cdkColumnDef>
2167
2378
  <th cdk-header-cell *cdkHeaderCellDef [style.text-align]="justify">
2168
2379
  {{headerText}}
@@ -2171,7 +2382,7 @@ class CdkTextColumn {
2171
2382
  {{dataAccessor(data, name)}}
2172
2383
  </td>
2173
2384
  </ng-container>
2174
- `, isInline: true, dependencies: [{ kind: "directive", type: CdkColumnDef, selector: "[cdkColumnDef]", inputs: ["cdkColumnDef", "sticky", "stickyEnd"] }, { kind: "directive", type: CdkHeaderCellDef, selector: "[cdkHeaderCellDef]" }, { kind: "directive", type: CdkHeaderCell, selector: "cdk-header-cell, th[cdk-header-cell]" }, { kind: "directive", type: CdkCellDef, selector: "[cdkCellDef]" }, { kind: "directive", type: CdkCell, selector: "cdk-cell, td[cdk-cell]" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None }); }
2385
+ `, isInline: true, dependencies: [{ kind: "directive", type: CdkColumnDef, selector: "[cdkColumnDef]", inputs: ["cdkColumnDef", "sticky", "stickyEnd"] }, { kind: "directive", type: CdkHeaderCellDef, selector: "[cdkHeaderCellDef]" }, { kind: "directive", type: CdkHeaderCell, selector: "cdk-header-cell, th[cdk-header-cell]" }, { kind: "directive", type: CdkCellDef, selector: "[cdkCellDef]" }, { kind: "directive", type: CdkCell, selector: "cdk-cell, td[cdk-cell]" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
2175
2386
  }
2176
2387
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkTextColumn, decorators: [{
2177
2388
  type: Component,
@@ -2241,8 +2452,8 @@ const EXPORTED_DECLARATIONS = [
2241
2452
  NoDataRowOutlet,
2242
2453
  ];
2243
2454
  class CdkTableModule {
2244
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkTableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2245
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkTableModule, imports: [ScrollingModule, CdkTable,
2455
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkTableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2456
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkTableModule, imports: [ScrollingModule, CdkTable,
2246
2457
  CdkRowDef,
2247
2458
  CdkCellDef,
2248
2459
  CdkCellOutlet,
@@ -2284,8 +2495,8 @@ class CdkTableModule {
2284
2495
  CdkTextColumn,
2285
2496
  CdkNoDataRow,
2286
2497
  CdkRecycleRows,
2287
- NoDataRowOutlet] }); }
2288
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkTableModule, imports: [ScrollingModule] }); }
2498
+ NoDataRowOutlet] });
2499
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkTableModule, imports: [ScrollingModule] });
2289
2500
  }
2290
2501
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkTableModule, decorators: [{
2291
2502
  type: NgModule,
@@ -2314,6 +2525,9 @@ function mixinHasStickyInput(base) {
2314
2525
  this._sticky = coerceBooleanProperty(v);
2315
2526
  this._hasStickyChanged = prevValue !== this._sticky;
2316
2527
  }
2528
+ _sticky = false;
2529
+ /** Whether the sticky input has changed since it was last checked. */
2530
+ _hasStickyChanged = false;
2317
2531
  /** Whether the sticky value has changed since this was last called. */
2318
2532
  hasStickyChanged() {
2319
2533
  const hasStickyChanged = this._hasStickyChanged;
@@ -2326,9 +2540,6 @@ function mixinHasStickyInput(base) {
2326
2540
  }
2327
2541
  constructor(...args) {
2328
2542
  super(...args);
2329
- this._sticky = false;
2330
- /** Whether the sticky input has changed since it was last checked. */
2331
- this._hasStickyChanged = false;
2332
2543
  }
2333
2544
  };
2334
2545
  }