@angular/cdk 17.1.0-next.3 → 17.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/dialog/index.d.ts +5 -0
- package/drag-drop/index.d.ts +5 -5
- package/esm2022/a11y/a11y-module.mjs +4 -4
- package/esm2022/a11y/aria-describer/aria-describer.mjs +3 -3
- package/esm2022/a11y/aria-describer/aria-reference.mjs +8 -5
- package/esm2022/a11y/focus-monitor/focus-monitor.mjs +6 -6
- package/esm2022/a11y/focus-trap/configurable-focus-trap-factory.mjs +3 -3
- package/esm2022/a11y/focus-trap/focus-trap-manager.mjs +3 -3
- package/esm2022/a11y/focus-trap/focus-trap.mjs +22 -17
- package/esm2022/a11y/high-contrast-mode/high-contrast-mode-detector.mjs +3 -3
- package/esm2022/a11y/input-modality/input-modality-detector.mjs +3 -3
- package/esm2022/a11y/interactivity-checker/interactivity-checker.mjs +3 -3
- package/esm2022/a11y/live-announcer/live-announcer.mjs +6 -6
- package/esm2022/accordion/accordion-item.mjs +3 -3
- package/esm2022/accordion/accordion-module.mjs +4 -4
- package/esm2022/accordion/accordion.mjs +3 -3
- package/esm2022/bidi/bidi-module.mjs +4 -4
- package/esm2022/bidi/dir.mjs +3 -3
- package/esm2022/bidi/directionality.mjs +3 -3
- package/esm2022/clipboard/clipboard-module.mjs +4 -4
- package/esm2022/clipboard/clipboard.mjs +3 -3
- package/esm2022/clipboard/copy-to-clipboard.mjs +3 -3
- package/esm2022/collections/selection-model.mjs +5 -4
- package/esm2022/collections/unique-selection-dispatcher.mjs +3 -3
- package/esm2022/dialog/dialog-container.mjs +29 -12
- package/esm2022/dialog/dialog-module.mjs +4 -4
- package/esm2022/dialog/dialog.mjs +3 -3
- package/esm2022/drag-drop/directives/drag-handle.mjs +3 -3
- package/esm2022/drag-drop/directives/drag-placeholder.mjs +3 -3
- package/esm2022/drag-drop/directives/drag-preview.mjs +3 -3
- package/esm2022/drag-drop/directives/drag.mjs +4 -4
- package/esm2022/drag-drop/directives/drop-list-group.mjs +3 -3
- package/esm2022/drag-drop/directives/drop-list.mjs +3 -3
- package/esm2022/drag-drop/dom/dom-rect.mjs +64 -0
- package/esm2022/drag-drop/dom/parent-position-tracker.mjs +3 -3
- package/esm2022/drag-drop/drag-drop-module.mjs +4 -4
- package/esm2022/drag-drop/drag-drop-registry.mjs +3 -3
- package/esm2022/drag-drop/drag-drop.mjs +3 -3
- package/esm2022/drag-drop/drag-ref.mjs +13 -13
- package/esm2022/drag-drop/drop-list-ref.mjs +34 -20
- package/esm2022/drag-drop/sorting/single-axis-sort-strategy.mjs +5 -5
- package/esm2022/layout/breakpoints-observer.mjs +3 -3
- package/esm2022/layout/layout-module.mjs +4 -4
- package/esm2022/layout/media-matcher.mjs +3 -3
- package/esm2022/listbox/listbox-module.mjs +4 -4
- package/esm2022/listbox/listbox.mjs +6 -6
- package/esm2022/menu/context-menu-trigger.mjs +6 -6
- package/esm2022/menu/menu-aim.mjs +6 -6
- package/esm2022/menu/menu-bar.mjs +3 -3
- package/esm2022/menu/menu-base.mjs +3 -3
- package/esm2022/menu/menu-group.mjs +3 -3
- package/esm2022/menu/menu-item-checkbox.mjs +3 -3
- package/esm2022/menu/menu-item-radio.mjs +3 -3
- package/esm2022/menu/menu-item-selectable.mjs +3 -3
- package/esm2022/menu/menu-item.mjs +3 -3
- package/esm2022/menu/menu-module.mjs +4 -4
- package/esm2022/menu/menu-stack.mjs +3 -3
- package/esm2022/menu/menu-trigger-base.mjs +3 -3
- package/esm2022/menu/menu-trigger.mjs +3 -3
- package/esm2022/menu/menu.mjs +3 -3
- package/esm2022/observers/observe-content.mjs +13 -13
- package/esm2022/observers/private/shared-resize-observer.mjs +3 -3
- package/esm2022/overlay/dispatchers/base-overlay-dispatcher.mjs +3 -3
- package/esm2022/overlay/dispatchers/overlay-keyboard-dispatcher.mjs +3 -3
- package/esm2022/overlay/dispatchers/overlay-outside-click-dispatcher.mjs +3 -3
- package/esm2022/overlay/fullscreen-overlay-container.mjs +3 -3
- package/esm2022/overlay/overlay-container.mjs +3 -3
- package/esm2022/overlay/overlay-directives.mjs +6 -6
- package/esm2022/overlay/overlay-module.mjs +4 -4
- package/esm2022/overlay/overlay.mjs +3 -3
- package/esm2022/overlay/position/flexible-connected-position-strategy.mjs +5 -5
- package/esm2022/overlay/position/overlay-position-builder.mjs +3 -3
- package/esm2022/overlay/position/scroll-clip.mjs +1 -1
- package/esm2022/overlay/scroll/scroll-strategy-options.mjs +3 -3
- package/esm2022/platform/platform-module.mjs +4 -4
- package/esm2022/platform/platform.mjs +3 -3
- package/esm2022/portal/portal-directives.mjs +16 -16
- package/esm2022/scrolling/fixed-size-virtual-scroll.mjs +3 -3
- package/esm2022/scrolling/scroll-dispatcher.mjs +3 -3
- package/esm2022/scrolling/scrollable.mjs +3 -3
- package/esm2022/scrolling/scrolling-module.mjs +8 -8
- package/esm2022/scrolling/viewport-ruler.mjs +5 -5
- package/esm2022/scrolling/virtual-for-of.mjs +3 -3
- package/esm2022/scrolling/virtual-scroll-viewport.mjs +3 -3
- package/esm2022/scrolling/virtual-scrollable-element.mjs +3 -3
- package/esm2022/scrolling/virtual-scrollable-window.mjs +3 -3
- package/esm2022/scrolling/virtual-scrollable.mjs +4 -4
- package/esm2022/stepper/step-header.mjs +3 -3
- package/esm2022/stepper/step-label.mjs +3 -3
- package/esm2022/stepper/stepper-button.mjs +6 -6
- package/esm2022/stepper/stepper-module.mjs +4 -4
- package/esm2022/stepper/stepper.mjs +6 -6
- package/esm2022/table/cell.mjs +26 -28
- package/esm2022/table/coalesced-style-scheduler.mjs +3 -3
- package/esm2022/table/row.mjs +27 -27
- package/esm2022/table/sticky-styler.mjs +32 -32
- package/esm2022/table/table-module.mjs +4 -4
- package/esm2022/table/table.mjs +175 -114
- package/esm2022/table/text-column.mjs +3 -3
- package/esm2022/text-field/autofill.mjs +6 -6
- package/esm2022/text-field/autosize.mjs +3 -3
- package/esm2022/text-field/text-field-module.mjs +4 -4
- package/esm2022/tree/nested-node.mjs +3 -3
- package/esm2022/tree/node.mjs +3 -3
- package/esm2022/tree/outlet.mjs +3 -3
- package/esm2022/tree/padding.mjs +3 -3
- package/esm2022/tree/toggle.mjs +3 -3
- package/esm2022/tree/tree-module.mjs +4 -4
- package/esm2022/tree/tree.mjs +6 -6
- package/esm2022/version.mjs +1 -1
- package/fesm2022/a11y.mjs +61 -53
- package/fesm2022/a11y.mjs.map +1 -1
- package/fesm2022/accordion.mjs +10 -10
- package/fesm2022/bidi.mjs +10 -10
- package/fesm2022/cdk.mjs +1 -1
- package/fesm2022/cdk.mjs.map +1 -1
- package/fesm2022/clipboard.mjs +10 -10
- package/fesm2022/collections.mjs +7 -6
- package/fesm2022/collections.mjs.map +1 -1
- package/fesm2022/dialog.mjs +35 -18
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/drag-drop.mjs +99 -85
- package/fesm2022/drag-drop.mjs.map +1 -1
- package/fesm2022/layout.mjs +10 -10
- package/fesm2022/listbox.mjs +10 -10
- package/fesm2022/menu.mjs +49 -49
- package/fesm2022/observers/private.mjs +3 -3
- package/fesm2022/observers.mjs +13 -13
- package/fesm2022/overlay.mjs +38 -38
- package/fesm2022/overlay.mjs.map +1 -1
- package/fesm2022/platform.mjs +7 -7
- package/fesm2022/portal.mjs +16 -16
- package/fesm2022/scrolling.mjs +36 -36
- package/fesm2022/scrolling.mjs.map +1 -1
- package/fesm2022/stepper.mjs +22 -22
- package/fesm2022/table.mjs +267 -208
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/text-field.mjs +13 -13
- package/fesm2022/tree.mjs +25 -25
- package/overlay/index.d.ts +1 -1
- package/package.json +3 -3
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +3 -3
- package/scrolling/index.d.ts +2 -2
- package/table/index.d.ts +13 -4
- package/esm2022/drag-drop/dom/client-rect.mjs +0 -64
package/fesm2022/table.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import * as i3 from '@angular/cdk/scrolling';
|
|
|
6
6
|
import { ScrollingModule } from '@angular/cdk/scrolling';
|
|
7
7
|
import { DOCUMENT } from '@angular/common';
|
|
8
8
|
import * as i0 from '@angular/core';
|
|
9
|
-
import { InjectionToken, Directive, booleanAttribute, Inject, Optional, Input, ContentChild, Injectable, Component, ChangeDetectionStrategy, ViewEncapsulation, EmbeddedViewRef, EventEmitter, NgZone, Attribute, SkipSelf, Output,
|
|
9
|
+
import { InjectionToken, Directive, booleanAttribute, Inject, Optional, Input, ContentChild, Injectable, Component, ChangeDetectionStrategy, ViewEncapsulation, inject, EmbeddedViewRef, EventEmitter, NgZone, Attribute, SkipSelf, Output, ContentChildren, ViewChild, NgModule } from '@angular/core';
|
|
10
10
|
import { Subject, from, BehaviorSubject, isObservable, of } from 'rxjs';
|
|
11
11
|
import { takeUntil, take } from 'rxjs/operators';
|
|
12
12
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
@@ -63,10 +63,10 @@ class CdkCellDef {
|
|
|
63
63
|
constructor(/** @docs-private */ template) {
|
|
64
64
|
this.template = template;
|
|
65
65
|
}
|
|
66
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
67
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.
|
|
66
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkCellDef, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
67
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.5", type: CdkCellDef, isStandalone: true, selector: "[cdkCellDef]", ngImport: i0 }); }
|
|
68
68
|
}
|
|
69
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
69
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkCellDef, decorators: [{
|
|
70
70
|
type: Directive,
|
|
71
71
|
args: [{
|
|
72
72
|
selector: '[cdkCellDef]',
|
|
@@ -81,10 +81,10 @@ class CdkHeaderCellDef {
|
|
|
81
81
|
constructor(/** @docs-private */ template) {
|
|
82
82
|
this.template = template;
|
|
83
83
|
}
|
|
84
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
85
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.
|
|
84
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkHeaderCellDef, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
85
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.5", type: CdkHeaderCellDef, isStandalone: true, selector: "[cdkHeaderCellDef]", ngImport: i0 }); }
|
|
86
86
|
}
|
|
87
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
87
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkHeaderCellDef, decorators: [{
|
|
88
88
|
type: Directive,
|
|
89
89
|
args: [{
|
|
90
90
|
selector: '[cdkHeaderCellDef]',
|
|
@@ -99,10 +99,10 @@ class CdkFooterCellDef {
|
|
|
99
99
|
constructor(/** @docs-private */ template) {
|
|
100
100
|
this.template = template;
|
|
101
101
|
}
|
|
102
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
103
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.
|
|
102
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkFooterCellDef, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
103
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.5", type: CdkFooterCellDef, isStandalone: true, selector: "[cdkFooterCellDef]", ngImport: i0 }); }
|
|
104
104
|
}
|
|
105
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
105
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkFooterCellDef, decorators: [{
|
|
106
106
|
type: Directive,
|
|
107
107
|
args: [{
|
|
108
108
|
selector: '[cdkFooterCellDef]',
|
|
@@ -170,10 +170,10 @@ class CdkColumnDef extends _CdkColumnDefBase {
|
|
|
170
170
|
this._updateColumnCssClassName();
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
174
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.1.0-next.
|
|
173
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkColumnDef, deps: [{ token: CDK_TABLE, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
174
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.1.0-next.5", type: CdkColumnDef, isStandalone: true, selector: "[cdkColumnDef]", inputs: { sticky: "sticky", name: ["cdkColumnDef", "name"], 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 }], usesInheritance: true, ngImport: i0 }); }
|
|
175
175
|
}
|
|
176
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
176
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkColumnDef, decorators: [{
|
|
177
177
|
type: Directive,
|
|
178
178
|
args: [{
|
|
179
179
|
selector: '[cdkColumnDef]',
|
|
@@ -213,10 +213,10 @@ class CdkHeaderCell extends BaseCdkCell {
|
|
|
213
213
|
constructor(columnDef, elementRef) {
|
|
214
214
|
super(columnDef, elementRef);
|
|
215
215
|
}
|
|
216
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
217
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.
|
|
216
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkHeaderCell, deps: [{ token: CdkColumnDef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
217
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.5", type: CdkHeaderCell, isStandalone: true, selector: "cdk-header-cell, th[cdk-header-cell]", host: { attributes: { "role": "columnheader" }, classAttribute: "cdk-header-cell" }, usesInheritance: true, ngImport: i0 }); }
|
|
218
218
|
}
|
|
219
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
219
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkHeaderCell, decorators: [{
|
|
220
220
|
type: Directive,
|
|
221
221
|
args: [{
|
|
222
222
|
selector: 'cdk-header-cell, th[cdk-header-cell]',
|
|
@@ -231,16 +231,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.2",
|
|
|
231
231
|
class CdkFooterCell extends BaseCdkCell {
|
|
232
232
|
constructor(columnDef, elementRef) {
|
|
233
233
|
super(columnDef, elementRef);
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
const role = tableRole === 'grid' || tableRole === 'treegrid' ? 'gridcell' : 'cell';
|
|
234
|
+
const role = columnDef._table?._getCellRole();
|
|
235
|
+
if (role) {
|
|
237
236
|
elementRef.nativeElement.setAttribute('role', role);
|
|
238
237
|
}
|
|
239
238
|
}
|
|
240
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
241
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.
|
|
239
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkFooterCell, deps: [{ token: CdkColumnDef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
240
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.5", type: CdkFooterCell, isStandalone: true, selector: "cdk-footer-cell, td[cdk-footer-cell]", host: { classAttribute: "cdk-footer-cell" }, usesInheritance: true, ngImport: i0 }); }
|
|
242
241
|
}
|
|
243
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
242
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkFooterCell, decorators: [{
|
|
244
243
|
type: Directive,
|
|
245
244
|
args: [{
|
|
246
245
|
selector: 'cdk-footer-cell, td[cdk-footer-cell]',
|
|
@@ -254,16 +253,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.2",
|
|
|
254
253
|
class CdkCell extends BaseCdkCell {
|
|
255
254
|
constructor(columnDef, elementRef) {
|
|
256
255
|
super(columnDef, elementRef);
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
const role = tableRole === 'grid' || tableRole === 'treegrid' ? 'gridcell' : 'cell';
|
|
256
|
+
const role = columnDef._table?._getCellRole();
|
|
257
|
+
if (role) {
|
|
260
258
|
elementRef.nativeElement.setAttribute('role', role);
|
|
261
259
|
}
|
|
262
260
|
}
|
|
263
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
264
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.
|
|
261
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkCell, deps: [{ token: CdkColumnDef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
262
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.5", type: CdkCell, isStandalone: true, selector: "cdk-cell, td[cdk-cell]", host: { classAttribute: "cdk-cell" }, usesInheritance: true, ngImport: i0 }); }
|
|
265
263
|
}
|
|
266
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
264
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkCell, decorators: [{
|
|
267
265
|
type: Directive,
|
|
268
266
|
args: [{
|
|
269
267
|
selector: 'cdk-cell, td[cdk-cell]',
|
|
@@ -347,10 +345,10 @@ class _CoalescedStyleScheduler {
|
|
|
347
345
|
? from(Promise.resolve(undefined))
|
|
348
346
|
: this._ngZone.onStable.pipe(take(1));
|
|
349
347
|
}
|
|
350
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
351
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
348
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: _CoalescedStyleScheduler, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
349
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: _CoalescedStyleScheduler }); }
|
|
352
350
|
}
|
|
353
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
351
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: _CoalescedStyleScheduler, decorators: [{
|
|
354
352
|
type: Injectable
|
|
355
353
|
}], ctorParameters: () => [{ type: i0.NgZone }] });
|
|
356
354
|
|
|
@@ -397,10 +395,10 @@ class BaseRowDef {
|
|
|
397
395
|
return column.cell.template;
|
|
398
396
|
}
|
|
399
397
|
}
|
|
400
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
401
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.
|
|
398
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: BaseRowDef, deps: [{ token: i0.TemplateRef }, { token: i0.IterableDiffers }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
399
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.5", type: BaseRowDef, usesOnChanges: true, ngImport: i0 }); }
|
|
402
400
|
}
|
|
403
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
401
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: BaseRowDef, decorators: [{
|
|
404
402
|
type: Directive
|
|
405
403
|
}], ctorParameters: () => [{ type: i0.TemplateRef }, { type: i0.IterableDiffers }] });
|
|
406
404
|
// Boilerplate for applying mixins to CdkHeaderRowDef.
|
|
@@ -422,10 +420,10 @@ class CdkHeaderRowDef extends _CdkHeaderRowDefBase {
|
|
|
422
420
|
ngOnChanges(changes) {
|
|
423
421
|
super.ngOnChanges(changes);
|
|
424
422
|
}
|
|
425
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
426
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.
|
|
423
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkHeaderRowDef, deps: [{ token: i0.TemplateRef }, { token: i0.IterableDiffers }, { token: CDK_TABLE, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
424
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.5", type: CdkHeaderRowDef, isStandalone: true, selector: "[cdkHeaderRowDef]", inputs: { columns: ["cdkHeaderRowDef", "columns"], sticky: ["cdkHeaderRowDefSticky", "sticky"] }, usesInheritance: true, usesOnChanges: true, ngImport: i0 }); }
|
|
427
425
|
}
|
|
428
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
426
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkHeaderRowDef, decorators: [{
|
|
429
427
|
type: Directive,
|
|
430
428
|
args: [{
|
|
431
429
|
selector: '[cdkHeaderRowDef]',
|
|
@@ -457,10 +455,10 @@ class CdkFooterRowDef extends _CdkFooterRowDefBase {
|
|
|
457
455
|
ngOnChanges(changes) {
|
|
458
456
|
super.ngOnChanges(changes);
|
|
459
457
|
}
|
|
460
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
461
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.
|
|
458
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkFooterRowDef, deps: [{ token: i0.TemplateRef }, { token: i0.IterableDiffers }, { token: CDK_TABLE, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
459
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.5", type: CdkFooterRowDef, isStandalone: true, selector: "[cdkFooterRowDef]", inputs: { columns: ["cdkFooterRowDef", "columns"], sticky: ["cdkFooterRowDefSticky", "sticky"] }, usesInheritance: true, usesOnChanges: true, ngImport: i0 }); }
|
|
462
460
|
}
|
|
463
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
461
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkFooterRowDef, decorators: [{
|
|
464
462
|
type: Directive,
|
|
465
463
|
args: [{
|
|
466
464
|
selector: '[cdkFooterRowDef]',
|
|
@@ -485,10 +483,10 @@ class CdkRowDef extends BaseRowDef {
|
|
|
485
483
|
super(template, _differs);
|
|
486
484
|
this._table = _table;
|
|
487
485
|
}
|
|
488
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
489
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.
|
|
486
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkRowDef, deps: [{ token: i0.TemplateRef }, { token: i0.IterableDiffers }, { token: CDK_TABLE, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
487
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.5", type: CdkRowDef, isStandalone: true, selector: "[cdkRowDef]", inputs: { columns: ["cdkRowDefColumns", "columns"], when: ["cdkRowDefWhen", "when"] }, usesInheritance: true, ngImport: i0 }); }
|
|
490
488
|
}
|
|
491
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
489
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkRowDef, decorators: [{
|
|
492
490
|
type: Directive,
|
|
493
491
|
args: [{
|
|
494
492
|
selector: '[cdkRowDef]',
|
|
@@ -525,10 +523,10 @@ class CdkCellOutlet {
|
|
|
525
523
|
CdkCellOutlet.mostRecentCellOutlet = null;
|
|
526
524
|
}
|
|
527
525
|
}
|
|
528
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
529
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.
|
|
526
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkCellOutlet, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
527
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.5", type: CdkCellOutlet, isStandalone: true, selector: "[cdkCellOutlet]", ngImport: i0 }); }
|
|
530
528
|
}
|
|
531
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
529
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkCellOutlet, decorators: [{
|
|
532
530
|
type: Directive,
|
|
533
531
|
args: [{
|
|
534
532
|
selector: '[cdkCellOutlet]',
|
|
@@ -537,10 +535,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.2",
|
|
|
537
535
|
}], ctorParameters: () => [{ type: i0.ViewContainerRef }] });
|
|
538
536
|
/** Header template container that contains the cell outlet. Adds the right class and role. */
|
|
539
537
|
class CdkHeaderRow {
|
|
540
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
541
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.0-next.
|
|
538
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkHeaderRow, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
539
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.0-next.5", 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 }); }
|
|
542
540
|
}
|
|
543
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
541
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkHeaderRow, decorators: [{
|
|
544
542
|
type: Component,
|
|
545
543
|
args: [{
|
|
546
544
|
selector: 'cdk-header-row, tr[cdk-header-row]',
|
|
@@ -559,10 +557,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.2",
|
|
|
559
557
|
}] });
|
|
560
558
|
/** Footer template container that contains the cell outlet. Adds the right class and role. */
|
|
561
559
|
class CdkFooterRow {
|
|
562
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
563
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.0-next.
|
|
560
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkFooterRow, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
561
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.0-next.5", 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 }); }
|
|
564
562
|
}
|
|
565
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
563
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkFooterRow, decorators: [{
|
|
566
564
|
type: Component,
|
|
567
565
|
args: [{
|
|
568
566
|
selector: 'cdk-footer-row, tr[cdk-footer-row]',
|
|
@@ -581,10 +579,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.2",
|
|
|
581
579
|
}] });
|
|
582
580
|
/** Data row template container that contains the cell outlet. Adds the right class and role. */
|
|
583
581
|
class CdkRow {
|
|
584
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
585
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.0-next.
|
|
582
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkRow, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
583
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.0-next.5", 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 }); }
|
|
586
584
|
}
|
|
587
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
585
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkRow, decorators: [{
|
|
588
586
|
type: Component,
|
|
589
587
|
args: [{
|
|
590
588
|
selector: 'cdk-row, tr[cdk-row]',
|
|
@@ -607,10 +605,10 @@ class CdkNoDataRow {
|
|
|
607
605
|
this.templateRef = templateRef;
|
|
608
606
|
this._contentClassName = 'cdk-no-data-row';
|
|
609
607
|
}
|
|
610
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
611
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.
|
|
608
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkNoDataRow, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
609
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.5", type: CdkNoDataRow, isStandalone: true, selector: "ng-template[cdkNoDataRow]", ngImport: i0 }); }
|
|
612
610
|
}
|
|
613
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
611
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkNoDataRow, decorators: [{
|
|
614
612
|
type: Directive,
|
|
615
613
|
args: [{
|
|
616
614
|
selector: 'ng-template[cdkNoDataRow]',
|
|
@@ -705,15 +703,15 @@ class StickyStyler {
|
|
|
705
703
|
}
|
|
706
704
|
return;
|
|
707
705
|
}
|
|
708
|
-
const firstRow = rows[0];
|
|
709
|
-
const numCells = firstRow.children.length;
|
|
710
|
-
const cellWidths = this._getCellWidths(firstRow, recalculateCellWidths);
|
|
711
|
-
const startPositions = this._getStickyStartColumnPositions(cellWidths, stickyStartStates);
|
|
712
|
-
const endPositions = this._getStickyEndColumnPositions(cellWidths, stickyEndStates);
|
|
713
|
-
const lastStickyStart = stickyStartStates.lastIndexOf(true);
|
|
714
|
-
const firstStickyEnd = stickyEndStates.indexOf(true);
|
|
715
706
|
// Coalesce with sticky row updates (and potentially other changes like column resize).
|
|
716
707
|
this._coalescedStyleScheduler.schedule(() => {
|
|
708
|
+
const firstRow = rows[0];
|
|
709
|
+
const numCells = firstRow.children.length;
|
|
710
|
+
const cellWidths = this._getCellWidths(firstRow, recalculateCellWidths);
|
|
711
|
+
const startPositions = this._getStickyStartColumnPositions(cellWidths, stickyStartStates);
|
|
712
|
+
const endPositions = this._getStickyEndColumnPositions(cellWidths, stickyEndStates);
|
|
713
|
+
const lastStickyStart = stickyStartStates.lastIndexOf(true);
|
|
714
|
+
const firstStickyEnd = stickyEndStates.indexOf(true);
|
|
717
715
|
const isRtl = this.direction === 'rtl';
|
|
718
716
|
const start = isRtl ? 'right' : 'left';
|
|
719
717
|
const end = isRtl ? 'left' : 'right';
|
|
@@ -763,32 +761,32 @@ class StickyStyler {
|
|
|
763
761
|
if (!this._isBrowser) {
|
|
764
762
|
return;
|
|
765
763
|
}
|
|
766
|
-
// If positioning the rows to the bottom, reverse their order when evaluating the sticky
|
|
767
|
-
// position such that the last row stuck will be "bottom: 0px" and so on. Note that the
|
|
768
|
-
// sticky states need to be reversed as well.
|
|
769
|
-
const rows = position === 'bottom' ? rowsToStick.slice().reverse() : rowsToStick;
|
|
770
|
-
const states = position === 'bottom' ? stickyStates.slice().reverse() : stickyStates;
|
|
771
|
-
// Measure row heights all at once before adding sticky styles to reduce layout thrashing.
|
|
772
|
-
const stickyOffsets = [];
|
|
773
|
-
const stickyCellHeights = [];
|
|
774
|
-
const elementsToStick = [];
|
|
775
|
-
for (let rowIndex = 0, stickyOffset = 0; rowIndex < rows.length; rowIndex++) {
|
|
776
|
-
if (!states[rowIndex]) {
|
|
777
|
-
continue;
|
|
778
|
-
}
|
|
779
|
-
stickyOffsets[rowIndex] = stickyOffset;
|
|
780
|
-
const row = rows[rowIndex];
|
|
781
|
-
elementsToStick[rowIndex] = this._isNativeHtmlTable
|
|
782
|
-
? Array.from(row.children)
|
|
783
|
-
: [row];
|
|
784
|
-
const height = row.getBoundingClientRect().height;
|
|
785
|
-
stickyOffset += height;
|
|
786
|
-
stickyCellHeights[rowIndex] = height;
|
|
787
|
-
}
|
|
788
|
-
const borderedRowIndex = states.lastIndexOf(true);
|
|
789
764
|
// Coalesce with other sticky row updates (top/bottom), sticky columns updates
|
|
790
765
|
// (and potentially other changes like column resize).
|
|
791
766
|
this._coalescedStyleScheduler.schedule(() => {
|
|
767
|
+
// If positioning the rows to the bottom, reverse their order when evaluating the sticky
|
|
768
|
+
// position such that the last row stuck will be "bottom: 0px" and so on. Note that the
|
|
769
|
+
// sticky states need to be reversed as well.
|
|
770
|
+
const rows = position === 'bottom' ? rowsToStick.slice().reverse() : rowsToStick;
|
|
771
|
+
const states = position === 'bottom' ? stickyStates.slice().reverse() : stickyStates;
|
|
772
|
+
// Measure row heights all at once before adding sticky styles to reduce layout thrashing.
|
|
773
|
+
const stickyOffsets = [];
|
|
774
|
+
const stickyCellHeights = [];
|
|
775
|
+
const elementsToStick = [];
|
|
776
|
+
for (let rowIndex = 0, stickyOffset = 0; rowIndex < rows.length; rowIndex++) {
|
|
777
|
+
if (!states[rowIndex]) {
|
|
778
|
+
continue;
|
|
779
|
+
}
|
|
780
|
+
stickyOffsets[rowIndex] = stickyOffset;
|
|
781
|
+
const row = rows[rowIndex];
|
|
782
|
+
elementsToStick[rowIndex] = this._isNativeHtmlTable
|
|
783
|
+
? Array.from(row.children)
|
|
784
|
+
: [row];
|
|
785
|
+
const height = row.getBoundingClientRect().height;
|
|
786
|
+
stickyOffset += height;
|
|
787
|
+
stickyCellHeights[rowIndex] = height;
|
|
788
|
+
}
|
|
789
|
+
const borderedRowIndex = states.lastIndexOf(true);
|
|
792
790
|
for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) {
|
|
793
791
|
if (!states[rowIndex]) {
|
|
794
792
|
continue;
|
|
@@ -825,9 +823,9 @@ class StickyStyler {
|
|
|
825
823
|
if (!this._isNativeHtmlTable) {
|
|
826
824
|
return;
|
|
827
825
|
}
|
|
828
|
-
const tfoot = tableElement.querySelector('tfoot');
|
|
829
826
|
// Coalesce with other sticky updates (and potentially other changes like column resize).
|
|
830
827
|
this._coalescedStyleScheduler.schedule(() => {
|
|
828
|
+
const tfoot = tableElement.querySelector('tfoot');
|
|
831
829
|
if (stickyStates.some(state => !state)) {
|
|
832
830
|
this._removeStickyStyle(tfoot, ['bottom']);
|
|
833
831
|
}
|
|
@@ -1024,10 +1022,10 @@ const STICKY_POSITIONING_LISTENER = new InjectionToken('CDK_SPL');
|
|
|
1024
1022
|
* tables that animate rows.
|
|
1025
1023
|
*/
|
|
1026
1024
|
class CdkRecycleRows {
|
|
1027
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
1028
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.
|
|
1025
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkRecycleRows, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1026
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.5", type: CdkRecycleRows, isStandalone: true, selector: "cdk-table[recycleRows], table[cdk-table][recycleRows]", providers: [{ provide: _VIEW_REPEATER_STRATEGY, useClass: _RecycleViewRepeaterStrategy }], ngImport: i0 }); }
|
|
1029
1027
|
}
|
|
1030
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
1028
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkRecycleRows, decorators: [{
|
|
1031
1029
|
type: Directive,
|
|
1032
1030
|
args: [{
|
|
1033
1031
|
selector: 'cdk-table[recycleRows], table[cdk-table][recycleRows]',
|
|
@@ -1043,11 +1041,14 @@ class DataRowOutlet {
|
|
|
1043
1041
|
constructor(viewContainer, elementRef) {
|
|
1044
1042
|
this.viewContainer = viewContainer;
|
|
1045
1043
|
this.elementRef = elementRef;
|
|
1044
|
+
const table = inject(CDK_TABLE);
|
|
1045
|
+
table._rowOutlet = this;
|
|
1046
|
+
table._outletAssigned();
|
|
1046
1047
|
}
|
|
1047
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
1048
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.
|
|
1048
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: DataRowOutlet, deps: [{ token: i0.ViewContainerRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1049
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.5", type: DataRowOutlet, isStandalone: true, selector: "[rowOutlet]", ngImport: i0 }); }
|
|
1049
1050
|
}
|
|
1050
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
1051
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: DataRowOutlet, decorators: [{
|
|
1051
1052
|
type: Directive,
|
|
1052
1053
|
args: [{
|
|
1053
1054
|
selector: '[rowOutlet]',
|
|
@@ -1062,11 +1063,14 @@ class HeaderRowOutlet {
|
|
|
1062
1063
|
constructor(viewContainer, elementRef) {
|
|
1063
1064
|
this.viewContainer = viewContainer;
|
|
1064
1065
|
this.elementRef = elementRef;
|
|
1066
|
+
const table = inject(CDK_TABLE);
|
|
1067
|
+
table._headerRowOutlet = this;
|
|
1068
|
+
table._outletAssigned();
|
|
1065
1069
|
}
|
|
1066
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
1067
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.
|
|
1070
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: HeaderRowOutlet, deps: [{ token: i0.ViewContainerRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1071
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.5", type: HeaderRowOutlet, isStandalone: true, selector: "[headerRowOutlet]", ngImport: i0 }); }
|
|
1068
1072
|
}
|
|
1069
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
1073
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: HeaderRowOutlet, decorators: [{
|
|
1070
1074
|
type: Directive,
|
|
1071
1075
|
args: [{
|
|
1072
1076
|
selector: '[headerRowOutlet]',
|
|
@@ -1081,11 +1085,14 @@ class FooterRowOutlet {
|
|
|
1081
1085
|
constructor(viewContainer, elementRef) {
|
|
1082
1086
|
this.viewContainer = viewContainer;
|
|
1083
1087
|
this.elementRef = elementRef;
|
|
1088
|
+
const table = inject(CDK_TABLE);
|
|
1089
|
+
table._footerRowOutlet = this;
|
|
1090
|
+
table._outletAssigned();
|
|
1084
1091
|
}
|
|
1085
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
1086
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.
|
|
1092
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: FooterRowOutlet, deps: [{ token: i0.ViewContainerRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1093
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.5", type: FooterRowOutlet, isStandalone: true, selector: "[footerRowOutlet]", ngImport: i0 }); }
|
|
1087
1094
|
}
|
|
1088
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
1095
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: FooterRowOutlet, decorators: [{
|
|
1089
1096
|
type: Directive,
|
|
1090
1097
|
args: [{
|
|
1091
1098
|
selector: '[footerRowOutlet]',
|
|
@@ -1101,11 +1108,14 @@ class NoDataRowOutlet {
|
|
|
1101
1108
|
constructor(viewContainer, elementRef) {
|
|
1102
1109
|
this.viewContainer = viewContainer;
|
|
1103
1110
|
this.elementRef = elementRef;
|
|
1111
|
+
const table = inject(CDK_TABLE);
|
|
1112
|
+
table._noDataRowOutlet = this;
|
|
1113
|
+
table._outletAssigned();
|
|
1104
1114
|
}
|
|
1105
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
1106
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.
|
|
1115
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: NoDataRowOutlet, deps: [{ token: i0.ViewContainerRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1116
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.0-next.5", type: NoDataRowOutlet, isStandalone: true, selector: "[noDataRowOutlet]", ngImport: i0 }); }
|
|
1107
1117
|
}
|
|
1108
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
1118
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: NoDataRowOutlet, decorators: [{
|
|
1109
1119
|
type: Directive,
|
|
1110
1120
|
args: [{
|
|
1111
1121
|
selector: '[noDataRowOutlet]',
|
|
@@ -1121,12 +1131,34 @@ const CDK_TABLE_TEMPLATE =
|
|
|
1121
1131
|
// Note that according to MDN, the `caption` element has to be projected as the **first**
|
|
1122
1132
|
// element in the table. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/caption
|
|
1123
1133
|
`
|
|
1124
|
-
<ng-content select="caption"
|
|
1125
|
-
<ng-content select="colgroup, col"
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1134
|
+
<ng-content select="caption"/>
|
|
1135
|
+
<ng-content select="colgroup, col"/>
|
|
1136
|
+
|
|
1137
|
+
<!--
|
|
1138
|
+
Unprojected content throws a hydration error so we need this to capture it.
|
|
1139
|
+
It gets removed on the client so it doesn't affect the layout.
|
|
1140
|
+
-->
|
|
1141
|
+
@if (_isServer) {
|
|
1142
|
+
<ng-content/>
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
@if (_isNativeHtmlTable) {
|
|
1146
|
+
<thead role="rowgroup">
|
|
1147
|
+
<ng-container headerRowOutlet/>
|
|
1148
|
+
</thead>
|
|
1149
|
+
<tbody role="rowgroup">
|
|
1150
|
+
<ng-container rowOutlet/>
|
|
1151
|
+
<ng-container noDataRowOutlet/>
|
|
1152
|
+
</tbody>
|
|
1153
|
+
<tfoot role="rowgroup">
|
|
1154
|
+
<ng-container footerRowOutlet/>
|
|
1155
|
+
</tfoot>
|
|
1156
|
+
} @else {
|
|
1157
|
+
<ng-container headerRowOutlet/>
|
|
1158
|
+
<ng-container rowOutlet/>
|
|
1159
|
+
<ng-container noDataRowOutlet/>
|
|
1160
|
+
<ng-container footerRowOutlet/>
|
|
1161
|
+
}
|
|
1130
1162
|
`;
|
|
1131
1163
|
/**
|
|
1132
1164
|
* Class used to conveniently type the embedded view ref for rows with a context.
|
|
@@ -1141,6 +1173,16 @@ class RowViewRef extends EmbeddedViewRef {
|
|
|
1141
1173
|
* connect function that will return an Observable stream that emits the data array to render.
|
|
1142
1174
|
*/
|
|
1143
1175
|
class CdkTable {
|
|
1176
|
+
/** Aria role to apply to the table's cells based on the table's own role. */
|
|
1177
|
+
_getCellRole() {
|
|
1178
|
+
if (this._cellRoleInternal === undefined) {
|
|
1179
|
+
// Perform this lazily in case the table's role was updated by a directive after construction.
|
|
1180
|
+
const role = this._elementRef.nativeElement.getAttribute('role');
|
|
1181
|
+
const cellRole = role === 'grid' || role === 'treegrid' ? 'gridcell' : 'cell';
|
|
1182
|
+
this._cellRoleInternal = this._isNativeHtmlTable && cellRole === 'cell' ? null : cellRole;
|
|
1183
|
+
}
|
|
1184
|
+
return this._cellRoleInternal;
|
|
1185
|
+
}
|
|
1144
1186
|
/**
|
|
1145
1187
|
* Tracking function that will be used to check the differences in data changes. Used similarly
|
|
1146
1188
|
* to `ngFor` `trackBy` function. Optimize row operations by identifying a row based on its data
|
|
@@ -1316,6 +1358,9 @@ class CdkTable {
|
|
|
1316
1358
|
this.needsPositionStickyOnElement = true;
|
|
1317
1359
|
/** Whether the no data row is currently showing anything. */
|
|
1318
1360
|
this._isShowingNoDataRow = false;
|
|
1361
|
+
/** Whether the table has rendered out all the outlets for the first time. */
|
|
1362
|
+
this._hasRendered = false;
|
|
1363
|
+
this._cellRoleInternal = undefined;
|
|
1319
1364
|
this._multiTemplateDataRows = false;
|
|
1320
1365
|
this._fixedLayout = false;
|
|
1321
1366
|
/**
|
|
@@ -1336,16 +1381,14 @@ class CdkTable {
|
|
|
1336
1381
|
end: Number.MAX_VALUE,
|
|
1337
1382
|
});
|
|
1338
1383
|
if (!role) {
|
|
1339
|
-
|
|
1384
|
+
_elementRef.nativeElement.setAttribute('role', 'table');
|
|
1340
1385
|
}
|
|
1341
1386
|
this._document = _document;
|
|
1342
|
-
this.
|
|
1387
|
+
this._isServer = !_platform.isBrowser;
|
|
1388
|
+
this._isNativeHtmlTable = _elementRef.nativeElement.nodeName === 'TABLE';
|
|
1343
1389
|
}
|
|
1344
1390
|
ngOnInit() {
|
|
1345
1391
|
this._setupStickyStyler();
|
|
1346
|
-
if (this._isNativeHtmlTable) {
|
|
1347
|
-
this._applyNativeTableSections();
|
|
1348
|
-
}
|
|
1349
1392
|
// Set up the trackBy function so that it uses the `RenderRow` as its identity by default. If
|
|
1350
1393
|
// the user has provided a custom trackBy, return the result of that function as evaluated
|
|
1351
1394
|
// with the values of the `RenderRow`'s data and index.
|
|
@@ -1360,57 +1403,24 @@ class CdkTable {
|
|
|
1360
1403
|
});
|
|
1361
1404
|
}
|
|
1362
1405
|
ngAfterContentChecked() {
|
|
1363
|
-
//
|
|
1364
|
-
this.
|
|
1365
|
-
|
|
1366
|
-
// Make sure that the user has at least added header, footer, or data row def.
|
|
1367
|
-
if (!this._headerRowDefs.length &&
|
|
1368
|
-
!this._footerRowDefs.length &&
|
|
1369
|
-
!this._rowDefs.length &&
|
|
1370
|
-
(typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
1371
|
-
throw getTableMissingRowDefsError();
|
|
1406
|
+
// Only start re-rendering in `ngAfterContentChecked` after the first render.
|
|
1407
|
+
if (this._hasRendered) {
|
|
1408
|
+
this._render();
|
|
1372
1409
|
}
|
|
1373
|
-
// Render updates if the list of columns have been changed for the header, row, or footer defs.
|
|
1374
|
-
const columnsChanged = this._renderUpdatedColumns();
|
|
1375
|
-
const rowDefsChanged = columnsChanged || this._headerRowDefChanged || this._footerRowDefChanged;
|
|
1376
|
-
// Ensure sticky column styles are reset if set to `true` elsewhere.
|
|
1377
|
-
this._stickyColumnStylesNeedReset = this._stickyColumnStylesNeedReset || rowDefsChanged;
|
|
1378
|
-
this._forceRecalculateCellWidths = rowDefsChanged;
|
|
1379
|
-
// If the header row definition has been changed, trigger a render to the header row.
|
|
1380
|
-
if (this._headerRowDefChanged) {
|
|
1381
|
-
this._forceRenderHeaderRows();
|
|
1382
|
-
this._headerRowDefChanged = false;
|
|
1383
|
-
}
|
|
1384
|
-
// If the footer row definition has been changed, trigger a render to the footer row.
|
|
1385
|
-
if (this._footerRowDefChanged) {
|
|
1386
|
-
this._forceRenderFooterRows();
|
|
1387
|
-
this._footerRowDefChanged = false;
|
|
1388
|
-
}
|
|
1389
|
-
// If there is a data source and row definitions, connect to the data source unless a
|
|
1390
|
-
// connection has already been made.
|
|
1391
|
-
if (this.dataSource && this._rowDefs.length > 0 && !this._renderChangeSubscription) {
|
|
1392
|
-
this._observeRenderChanges();
|
|
1393
|
-
}
|
|
1394
|
-
else if (this._stickyColumnStylesNeedReset) {
|
|
1395
|
-
// In the above case, _observeRenderChanges will result in updateStickyColumnStyles being
|
|
1396
|
-
// called when it row data arrives. Otherwise, we need to call it proactively.
|
|
1397
|
-
this.updateStickyColumnStyles();
|
|
1398
|
-
}
|
|
1399
|
-
this._checkStickyStates();
|
|
1400
1410
|
}
|
|
1401
1411
|
ngOnDestroy() {
|
|
1402
1412
|
[
|
|
1403
|
-
this._rowOutlet
|
|
1404
|
-
this._headerRowOutlet
|
|
1405
|
-
this._footerRowOutlet
|
|
1413
|
+
this._rowOutlet?.viewContainer,
|
|
1414
|
+
this._headerRowOutlet?.viewContainer,
|
|
1415
|
+
this._footerRowOutlet?.viewContainer,
|
|
1406
1416
|
this._cachedRenderRowsMap,
|
|
1407
1417
|
this._customColumnDefs,
|
|
1408
1418
|
this._customRowDefs,
|
|
1409
1419
|
this._customHeaderRowDefs,
|
|
1410
1420
|
this._customFooterRowDefs,
|
|
1411
1421
|
this._columnDefsByName,
|
|
1412
|
-
].forEach(def => {
|
|
1413
|
-
def
|
|
1422
|
+
].forEach((def) => {
|
|
1423
|
+
def?.clear();
|
|
1414
1424
|
});
|
|
1415
1425
|
this._headerRowDefs = [];
|
|
1416
1426
|
this._footerRowDefs = [];
|
|
@@ -1515,13 +1525,14 @@ class CdkTable {
|
|
|
1515
1525
|
*/
|
|
1516
1526
|
updateStickyHeaderRowStyles() {
|
|
1517
1527
|
const headerRows = this._getRenderedRows(this._headerRowOutlet);
|
|
1518
|
-
const tableElement = this._elementRef.nativeElement;
|
|
1519
1528
|
// Hide the thead element if there are no header rows. This is necessary to satisfy
|
|
1520
1529
|
// overzealous a11y checkers that fail because the `rowgroup` element does not contain
|
|
1521
1530
|
// required child `row`.
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
thead
|
|
1531
|
+
if (this._isNativeHtmlTable) {
|
|
1532
|
+
const thead = closestTableSection(this._headerRowOutlet, 'thead');
|
|
1533
|
+
if (thead) {
|
|
1534
|
+
thead.style.display = headerRows.length ? '' : 'none';
|
|
1535
|
+
}
|
|
1525
1536
|
}
|
|
1526
1537
|
const stickyStates = this._headerRowDefs.map(def => def.sticky);
|
|
1527
1538
|
this._stickyStyler.clearStickyPositioning(headerRows, ['top']);
|
|
@@ -1538,13 +1549,14 @@ class CdkTable {
|
|
|
1538
1549
|
*/
|
|
1539
1550
|
updateStickyFooterRowStyles() {
|
|
1540
1551
|
const footerRows = this._getRenderedRows(this._footerRowOutlet);
|
|
1541
|
-
const tableElement = this._elementRef.nativeElement;
|
|
1542
1552
|
// Hide the tfoot element if there are no footer rows. This is necessary to satisfy
|
|
1543
1553
|
// overzealous a11y checkers that fail because the `rowgroup` element does not contain
|
|
1544
1554
|
// required child `row`.
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
tfoot
|
|
1555
|
+
if (this._isNativeHtmlTable) {
|
|
1556
|
+
const tfoot = closestTableSection(this._footerRowOutlet, 'tfoot');
|
|
1557
|
+
if (tfoot) {
|
|
1558
|
+
tfoot.style.display = footerRows.length ? '' : 'none';
|
|
1559
|
+
}
|
|
1548
1560
|
}
|
|
1549
1561
|
const stickyStates = this._footerRowDefs.map(def => def.sticky);
|
|
1550
1562
|
this._stickyStyler.clearStickyPositioning(footerRows, ['bottom']);
|
|
@@ -1596,6 +1608,62 @@ class CdkTable {
|
|
|
1596
1608
|
// Reset the dirty state of the sticky input change since it has been used.
|
|
1597
1609
|
Array.from(this._columnDefsByName.values()).forEach(def => def.resetStickyChanged());
|
|
1598
1610
|
}
|
|
1611
|
+
/** Invoked whenever an outlet is created and has been assigned to the table. */
|
|
1612
|
+
_outletAssigned() {
|
|
1613
|
+
// Trigger the first render once all outlets have been assigned. We do it this way, as
|
|
1614
|
+
// opposed to waiting for the next `ngAfterContentChecked`, because we don't know when
|
|
1615
|
+
// the next change detection will happen.
|
|
1616
|
+
// Also we can't use queries to resolve the outlets, because they're wrapped in a
|
|
1617
|
+
// conditional, so we have to rely on them being assigned via DI.
|
|
1618
|
+
if (!this._hasRendered &&
|
|
1619
|
+
this._rowOutlet &&
|
|
1620
|
+
this._headerRowOutlet &&
|
|
1621
|
+
this._footerRowOutlet &&
|
|
1622
|
+
this._noDataRowOutlet) {
|
|
1623
|
+
this._hasRendered = true;
|
|
1624
|
+
this._render();
|
|
1625
|
+
}
|
|
1626
|
+
}
|
|
1627
|
+
/** Renders the table if its state has changed. */
|
|
1628
|
+
_render() {
|
|
1629
|
+
// Cache the row and column definitions gathered by ContentChildren and programmatic injection.
|
|
1630
|
+
this._cacheRowDefs();
|
|
1631
|
+
this._cacheColumnDefs();
|
|
1632
|
+
// Make sure that the user has at least added header, footer, or data row def.
|
|
1633
|
+
if (!this._headerRowDefs.length &&
|
|
1634
|
+
!this._footerRowDefs.length &&
|
|
1635
|
+
!this._rowDefs.length &&
|
|
1636
|
+
(typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
1637
|
+
throw getTableMissingRowDefsError();
|
|
1638
|
+
}
|
|
1639
|
+
// Render updates if the list of columns have been changed for the header, row, or footer defs.
|
|
1640
|
+
const columnsChanged = this._renderUpdatedColumns();
|
|
1641
|
+
const rowDefsChanged = columnsChanged || this._headerRowDefChanged || this._footerRowDefChanged;
|
|
1642
|
+
// Ensure sticky column styles are reset if set to `true` elsewhere.
|
|
1643
|
+
this._stickyColumnStylesNeedReset = this._stickyColumnStylesNeedReset || rowDefsChanged;
|
|
1644
|
+
this._forceRecalculateCellWidths = rowDefsChanged;
|
|
1645
|
+
// If the header row definition has been changed, trigger a render to the header row.
|
|
1646
|
+
if (this._headerRowDefChanged) {
|
|
1647
|
+
this._forceRenderHeaderRows();
|
|
1648
|
+
this._headerRowDefChanged = false;
|
|
1649
|
+
}
|
|
1650
|
+
// If the footer row definition has been changed, trigger a render to the footer row.
|
|
1651
|
+
if (this._footerRowDefChanged) {
|
|
1652
|
+
this._forceRenderFooterRows();
|
|
1653
|
+
this._footerRowDefChanged = false;
|
|
1654
|
+
}
|
|
1655
|
+
// If there is a data source and row definitions, connect to the data source unless a
|
|
1656
|
+
// connection has already been made.
|
|
1657
|
+
if (this.dataSource && this._rowDefs.length > 0 && !this._renderChangeSubscription) {
|
|
1658
|
+
this._observeRenderChanges();
|
|
1659
|
+
}
|
|
1660
|
+
else if (this._stickyColumnStylesNeedReset) {
|
|
1661
|
+
// In the above case, _observeRenderChanges will result in updateStickyColumnStyles being
|
|
1662
|
+
// called when it row data arrives. Otherwise, we need to call it proactively.
|
|
1663
|
+
this.updateStickyColumnStyles();
|
|
1664
|
+
}
|
|
1665
|
+
this._checkStickyStates();
|
|
1666
|
+
}
|
|
1599
1667
|
/**
|
|
1600
1668
|
* Get the list of RenderRow objects to render according to the current list of data and defined
|
|
1601
1669
|
* row definitions. If the previous list already contained a particular pair, it should be reused
|
|
@@ -1716,7 +1784,9 @@ class CdkTable {
|
|
|
1716
1784
|
if (this._dataDiffer) {
|
|
1717
1785
|
this._dataDiffer.diff([]);
|
|
1718
1786
|
}
|
|
1719
|
-
this._rowOutlet
|
|
1787
|
+
if (this._rowOutlet) {
|
|
1788
|
+
this._rowOutlet.viewContainer.clear();
|
|
1789
|
+
}
|
|
1720
1790
|
}
|
|
1721
1791
|
this._dataSource = dataSource;
|
|
1722
1792
|
}
|
|
@@ -1881,25 +1951,6 @@ class CdkTable {
|
|
|
1881
1951
|
return rowDef.extractCellTemplate(column);
|
|
1882
1952
|
});
|
|
1883
1953
|
}
|
|
1884
|
-
/** Adds native table sections (e.g. tbody) and moves the row outlets into them. */
|
|
1885
|
-
_applyNativeTableSections() {
|
|
1886
|
-
const documentFragment = this._document.createDocumentFragment();
|
|
1887
|
-
const sections = [
|
|
1888
|
-
{ tag: 'thead', outlets: [this._headerRowOutlet] },
|
|
1889
|
-
{ tag: 'tbody', outlets: [this._rowOutlet, this._noDataRowOutlet] },
|
|
1890
|
-
{ tag: 'tfoot', outlets: [this._footerRowOutlet] },
|
|
1891
|
-
];
|
|
1892
|
-
for (const section of sections) {
|
|
1893
|
-
const element = this._document.createElement(section.tag);
|
|
1894
|
-
element.setAttribute('role', 'rowgroup');
|
|
1895
|
-
for (const outlet of section.outlets) {
|
|
1896
|
-
element.appendChild(outlet.elementRef.nativeElement);
|
|
1897
|
-
}
|
|
1898
|
-
documentFragment.appendChild(element);
|
|
1899
|
-
}
|
|
1900
|
-
// Use a DocumentFragment so we don't hit the DOM on each iteration.
|
|
1901
|
-
this._elementRef.nativeElement.appendChild(documentFragment);
|
|
1902
|
-
}
|
|
1903
1954
|
/**
|
|
1904
1955
|
* Forces a re-render of the data rows. Should be called in cases where there has been an input
|
|
1905
1956
|
* change that affects the evaluation of which rows should be rendered, e.g. toggling
|
|
@@ -1979,21 +2030,20 @@ class CdkTable {
|
|
|
1979
2030
|
this._isShowingNoDataRow = shouldShow;
|
|
1980
2031
|
this._changeDetectorRef.markForCheck();
|
|
1981
2032
|
}
|
|
1982
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
1983
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
2033
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkTable, deps: [{ token: i0.IterableDiffers }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: 'role', attribute: true }, { token: i1.Directionality, optional: true }, { token: DOCUMENT }, { token: i2.Platform }, { token: _VIEW_REPEATER_STRATEGY }, { token: _COALESCED_STYLE_SCHEDULER }, { token: i3.ViewportRuler }, { token: STICKY_POSITIONING_LISTENER, optional: true, skipSelf: true }, { token: i0.NgZone, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2034
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.0-next.5", 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: [
|
|
1984
2035
|
{ provide: CDK_TABLE, useExisting: CdkTable },
|
|
1985
2036
|
{ provide: _VIEW_REPEATER_STRATEGY, useClass: _DisposeViewRepeaterStrategy },
|
|
1986
2037
|
{ provide: _COALESCED_STYLE_SCHEDULER, useClass: _CoalescedStyleScheduler },
|
|
1987
2038
|
// Prevent nested tables from seeing this table's StickyPositioningListener.
|
|
1988
2039
|
{ provide: STICKY_POSITIONING_LISTENER, useValue: null },
|
|
1989
|
-
], 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 }],
|
|
2040
|
+
], 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 }); }
|
|
1990
2041
|
}
|
|
1991
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
2042
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkTable, decorators: [{
|
|
1992
2043
|
type: Component,
|
|
1993
2044
|
args: [{ selector: 'cdk-table, table[cdk-table]', exportAs: 'cdkTable', template: CDK_TABLE_TEMPLATE, host: {
|
|
1994
2045
|
'class': 'cdk-table',
|
|
1995
2046
|
'[class.cdk-table-fixed-layout]': 'fixedLayout',
|
|
1996
|
-
'ngSkipHydration': '',
|
|
1997
2047
|
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.Default, providers: [
|
|
1998
2048
|
{ provide: CDK_TABLE, useExisting: CdkTable },
|
|
1999
2049
|
{ provide: _VIEW_REPEATER_STRATEGY, useClass: _DisposeViewRepeaterStrategy },
|
|
@@ -2036,18 +2086,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.2",
|
|
|
2036
2086
|
args: [{ transform: booleanAttribute }]
|
|
2037
2087
|
}], contentChanged: [{
|
|
2038
2088
|
type: Output
|
|
2039
|
-
}], _rowOutlet: [{
|
|
2040
|
-
type: ViewChild,
|
|
2041
|
-
args: [DataRowOutlet, { static: true }]
|
|
2042
|
-
}], _headerRowOutlet: [{
|
|
2043
|
-
type: ViewChild,
|
|
2044
|
-
args: [HeaderRowOutlet, { static: true }]
|
|
2045
|
-
}], _footerRowOutlet: [{
|
|
2046
|
-
type: ViewChild,
|
|
2047
|
-
args: [FooterRowOutlet, { static: true }]
|
|
2048
|
-
}], _noDataRowOutlet: [{
|
|
2049
|
-
type: ViewChild,
|
|
2050
|
-
args: [NoDataRowOutlet, { static: true }]
|
|
2051
2089
|
}], _contentColumnDefs: [{
|
|
2052
2090
|
type: ContentChildren,
|
|
2053
2091
|
args: [CdkColumnDef, { descendants: true }]
|
|
@@ -2072,6 +2110,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.2",
|
|
|
2072
2110
|
function mergeArrayAndSet(array, set) {
|
|
2073
2111
|
return array.concat(Array.from(set));
|
|
2074
2112
|
}
|
|
2113
|
+
/**
|
|
2114
|
+
* Finds the closest table section to an outlet. We can't use `HTMLElement.closest` for this,
|
|
2115
|
+
* because the node representing the outlet is a comment.
|
|
2116
|
+
*/
|
|
2117
|
+
function closestTableSection(outlet, section) {
|
|
2118
|
+
const uppercaseSection = section.toUpperCase();
|
|
2119
|
+
let current = outlet.viewContainer.element.nativeElement;
|
|
2120
|
+
while (current) {
|
|
2121
|
+
// 1 is an element node.
|
|
2122
|
+
const nodeName = current.nodeType === 1 ? current.nodeName : null;
|
|
2123
|
+
if (nodeName === uppercaseSection) {
|
|
2124
|
+
return current;
|
|
2125
|
+
}
|
|
2126
|
+
else if (nodeName === 'TABLE') {
|
|
2127
|
+
// Stop traversing past the `table` node.
|
|
2128
|
+
break;
|
|
2129
|
+
}
|
|
2130
|
+
current = current.parentNode;
|
|
2131
|
+
}
|
|
2132
|
+
return null;
|
|
2133
|
+
}
|
|
2075
2134
|
|
|
2076
2135
|
/**
|
|
2077
2136
|
* Column that simply shows text content for the header and row cells. Assumes that the table
|
|
@@ -2150,8 +2209,8 @@ class CdkTextColumn {
|
|
|
2150
2209
|
this.columnDef.name = this.name;
|
|
2151
2210
|
}
|
|
2152
2211
|
}
|
|
2153
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
2154
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.0-next.
|
|
2212
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkTextColumn, deps: [{ token: CdkTable, optional: true }, { token: TEXT_COLUMN_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2213
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.0-next.5", 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: `
|
|
2155
2214
|
<ng-container cdkColumnDef>
|
|
2156
2215
|
<th cdk-header-cell *cdkHeaderCellDef [style.text-align]="justify">
|
|
2157
2216
|
{{headerText}}
|
|
@@ -2162,7 +2221,7 @@ class CdkTextColumn {
|
|
|
2162
2221
|
</ng-container>
|
|
2163
2222
|
`, isInline: true, dependencies: [{ kind: "directive", type: CdkColumnDef, selector: "[cdkColumnDef]", inputs: ["sticky", "cdkColumnDef", "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 }); }
|
|
2164
2223
|
}
|
|
2165
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
2224
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkTextColumn, decorators: [{
|
|
2166
2225
|
type: Component,
|
|
2167
2226
|
args: [{
|
|
2168
2227
|
selector: 'cdk-text-column',
|
|
@@ -2238,8 +2297,8 @@ const EXPORTED_DECLARATIONS = [
|
|
|
2238
2297
|
NoDataRowOutlet,
|
|
2239
2298
|
];
|
|
2240
2299
|
class CdkTableModule {
|
|
2241
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
2242
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.0-next.
|
|
2300
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkTableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2301
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkTableModule, imports: [ScrollingModule, CdkTable,
|
|
2243
2302
|
CdkRowDef,
|
|
2244
2303
|
CdkCellDef,
|
|
2245
2304
|
CdkCellOutlet,
|
|
@@ -2282,9 +2341,9 @@ class CdkTableModule {
|
|
|
2282
2341
|
CdkNoDataRow,
|
|
2283
2342
|
CdkRecycleRows,
|
|
2284
2343
|
NoDataRowOutlet] }); }
|
|
2285
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
2344
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkTableModule, imports: [ScrollingModule] }); }
|
|
2286
2345
|
}
|
|
2287
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.
|
|
2346
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.5", ngImport: i0, type: CdkTableModule, decorators: [{
|
|
2288
2347
|
type: NgModule,
|
|
2289
2348
|
args: [{
|
|
2290
2349
|
exports: EXPORTED_DECLARATIONS,
|