/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { Directionality } from '@angular/cdk/bidi'; import { coerceBooleanProperty } from '@angular/cdk/coercion'; import { _DisposeViewRepeaterStrategy, _RecycleViewRepeaterStrategy, isDataSource, _VIEW_REPEATER_STRATEGY, } from '@angular/cdk/collections'; import { Platform } from '@angular/cdk/platform'; import { ViewportRuler } from '@angular/cdk/scrolling'; import { DOCUMENT } from '@angular/common'; import { Attribute, ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, ContentChildren, Directive, ElementRef, EmbeddedViewRef, EventEmitter, Inject, Input, IterableDiffers, NgZone, Optional, Output, QueryList, SkipSelf, ViewChild, ViewContainerRef, ViewEncapsulation, } from '@angular/core'; import { BehaviorSubject, isObservable, of as observableOf, Subject, } from 'rxjs'; import { take, takeUntil } from 'rxjs/operators'; import { CdkColumnDef } from './cell'; import { _CoalescedStyleScheduler, _COALESCED_STYLE_SCHEDULER } from './coalesced-style-scheduler'; import { CdkCellOutlet, CdkFooterRowDef, CdkHeaderRowDef, CdkNoDataRow, CdkRowDef, } from './row'; import { StickyStyler } from './sticky-styler'; import { getTableDuplicateColumnNameError, getTableMissingMatchingRowDefError, getTableMissingRowDefsError, getTableMultipleDefaultRowDefsError, getTableUnknownColumnError, getTableUnknownDataSourceError, } from './table-errors'; import { STICKY_POSITIONING_LISTENER } from './sticky-position-listener'; import { CDK_TABLE } from './tokens'; import * as i0 from "@angular/core"; import * as i1 from "@angular/cdk/bidi"; import * as i2 from "@angular/cdk/platform"; import * as i3 from "@angular/cdk/scrolling"; import * as i4 from "./coalesced-style-scheduler"; /** * Enables the recycle view repeater strategy, which reduces rendering latency. Not compatible with * tables that animate rows. */ export class CdkRecycleRows { static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: CdkRecycleRows, deps: [], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: CdkRecycleRows, selector: "cdk-table[recycleRows], table[cdk-table][recycleRows]", providers: [{ provide: _VIEW_REPEATER_STRATEGY, useClass: _RecycleViewRepeaterStrategy }], ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: CdkRecycleRows, decorators: [{ type: Directive, args: [{ selector: 'cdk-table[recycleRows], table[cdk-table][recycleRows]', providers: [{ provide: _VIEW_REPEATER_STRATEGY, useClass: _RecycleViewRepeaterStrategy }], }] }] }); /** * Provides a handle for the table to grab the view container's ng-container to insert data rows. * @docs-private */ export class DataRowOutlet { constructor(viewContainer, elementRef) { this.viewContainer = viewContainer; this.elementRef = elementRef; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: DataRowOutlet, deps: [{ token: i0.ViewContainerRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: DataRowOutlet, selector: "[rowOutlet]", ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: DataRowOutlet, decorators: [{ type: Directive, args: [{ selector: '[rowOutlet]' }] }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.ElementRef }]; } }); /** * Provides a handle for the table to grab the view container's ng-container to insert the header. * @docs-private */ export class HeaderRowOutlet { constructor(viewContainer, elementRef) { this.viewContainer = viewContainer; this.elementRef = elementRef; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: HeaderRowOutlet, deps: [{ token: i0.ViewContainerRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: HeaderRowOutlet, selector: "[headerRowOutlet]", ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: HeaderRowOutlet, decorators: [{ type: Directive, args: [{ selector: '[headerRowOutlet]' }] }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.ElementRef }]; } }); /** * Provides a handle for the table to grab the view container's ng-container to insert the footer. * @docs-private */ export class FooterRowOutlet { constructor(viewContainer, elementRef) { this.viewContainer = viewContainer; this.elementRef = elementRef; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FooterRowOutlet, deps: [{ token: i0.ViewContainerRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: FooterRowOutlet, selector: "[footerRowOutlet]", ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FooterRowOutlet, decorators: [{ type: Directive, args: [{ selector: '[footerRowOutlet]' }] }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.ElementRef }]; } }); /** * Provides a handle for the table to grab the view * container's ng-container to insert the no data row. * @docs-private */ export class NoDataRowOutlet { constructor(viewContainer, elementRef) { this.viewContainer = viewContainer; this.elementRef = elementRef; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: NoDataRowOutlet, deps: [{ token: i0.ViewContainerRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: NoDataRowOutlet, selector: "[noDataRowOutlet]", ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: NoDataRowOutlet, decorators: [{ type: Directive, args: [{ selector: '[noDataRowOutlet]' }] }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.ElementRef }]; } }); /** * The table template that can be used by the mat-table. Should not be used outside of the * material library. * @docs-private */ export const CDK_TABLE_TEMPLATE = // Note that according to MDN, the `caption` element has to be projected as the **first** // element in the table. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/caption ` `; /** * Class used to conveniently type the embedded view ref for rows with a context. * @docs-private */ class RowViewRef extends EmbeddedViewRef { } /** * A data table that can render a header row, data rows, and a footer row. * Uses the dataSource input to determine the data to be rendered. The data can be provided either * as a data array, an Observable stream that emits the data array to render, or a DataSource with a * connect function that will return an Observable stream that emits the data array to render. */ export class CdkTable { /** * Tracking function that will be used to check the differences in data changes. Used similarly * to `ngFor` `trackBy` function. Optimize row operations by identifying a row based on its data * relative to the function to know if a row should be added/removed/moved. * Accepts a function that takes two parameters, `index` and `item`. */ get trackBy() { return this._trackByFn; } set trackBy(fn) { if ((typeof ngDevMode === 'undefined' || ngDevMode) && fn != null && typeof fn !== 'function') { console.warn(`trackBy must be a function, but received ${JSON.stringify(fn)}.`); } this._trackByFn = fn; } /** * The table's source of data, which can be provided in three ways (in order of complexity): * - Simple data array (each object represents one table row) * - Stream that emits a data array each time the array changes * - `DataSource` object that implements the connect/disconnect interface. * * If a data array is provided, the table must be notified when the array's objects are * added, removed, or moved. This can be done by calling the `renderRows()` function which will * render the diff since the last table render. If the data array reference is changed, the table * will automatically trigger an update to the rows. * * When providing an Observable stream, the table will trigger an update automatically when the * stream emits a new array of data. * * Finally, when providing a `DataSource` object, the table will use the Observable stream * provided by the connect function and trigger updates when that stream emits new data array * values. During the table's ngOnDestroy or when the data source is removed from the table, the * table will call the DataSource's `disconnect` function (may be useful for cleaning up any * subscriptions registered during the connect process). */ get dataSource() { return this._dataSource; } set dataSource(dataSource) { if (this._dataSource !== dataSource) { this._switchDataSource(dataSource); } } /** * Whether to allow multiple rows per data object by evaluating which rows evaluate their 'when' * predicate to true. If `multiTemplateDataRows` is false, which is the default value, then each * dataobject will render the first row that evaluates its when predicate to true, in the order * defined in the table, or otherwise the default row which does not have a when predicate. */ get multiTemplateDataRows() { return this._multiTemplateDataRows; } set multiTemplateDataRows(v) { this._multiTemplateDataRows = coerceBooleanProperty(v); // In Ivy if this value is set via a static attribute (e.g. ), // this setter will be invoked before the row outlet has been defined hence the null check. if (this._rowOutlet && this._rowOutlet.viewContainer.length) { this._forceRenderDataRows(); this.updateStickyColumnStyles(); } } /** * Whether to use a fixed table layout. Enabling this option will enforce consistent column widths * and optimize rendering sticky styles for native tables. No-op for flex tables. */ get fixedLayout() { return this._fixedLayout; } set fixedLayout(v) { this._fixedLayout = coerceBooleanProperty(v); // Toggling `fixedLayout` may change column widths. Sticky column styles should be recalculated. this._forceRecalculateCellWidths = true; this._stickyColumnStylesNeedReset = true; } constructor(_differs, _changeDetectorRef, _elementRef, role, _dir, _document, _platform, _viewRepeater, _coalescedStyleScheduler, _viewportRuler, /** * @deprecated `_stickyPositioningListener` parameter to become required. * @breaking-change 13.0.0 */ _stickyPositioningListener, /** * @deprecated `_ngZone` parameter to become required. * @breaking-change 14.0.0 */ _ngZone) { this._differs = _differs; this._changeDetectorRef = _changeDetectorRef; this._elementRef = _elementRef; this._dir = _dir; this._platform = _platform; this._viewRepeater = _viewRepeater; this._coalescedStyleScheduler = _coalescedStyleScheduler; this._viewportRuler = _viewportRuler; this._stickyPositioningListener = _stickyPositioningListener; this._ngZone = _ngZone; /** Subject that emits when the component has been destroyed. */ this._onDestroy = new Subject(); /** * Map of all the user's defined columns (header, data, and footer cell template) identified by * name. Collection populated by the column definitions gathered by `ContentChildren` as well as * any custom column definitions added to `_customColumnDefs`. */ this._columnDefsByName = new Map(); /** * Column definitions that were defined outside of the direct content children of the table. * These will be defined when, e.g., creating a wrapper around the cdkTable that has * column definitions as *its* content child. */ this._customColumnDefs = new Set(); /** * Data row definitions that were defined outside of the direct content children of the table. * These will be defined when, e.g., creating a wrapper around the cdkTable that has * built-in data rows as *its* content child. */ this._customRowDefs = new Set(); /** * Header row definitions that were defined outside of the direct content children of the table. * These will be defined when, e.g., creating a wrapper around the cdkTable that has * built-in header rows as *its* content child. */ this._customHeaderRowDefs = new Set(); /** * Footer row definitions that were defined outside of the direct content children of the table. * These will be defined when, e.g., creating a wrapper around the cdkTable that has a * built-in footer row as *its* content child. */ this._customFooterRowDefs = new Set(); /** * Whether the header row definition has been changed. Triggers an update to the header row after * content is checked. Initialized as true so that the table renders the initial set of rows. */ this._headerRowDefChanged = true; /** * Whether the footer row definition has been changed. Triggers an update to the footer row after * content is checked. Initialized as true so that the table renders the initial set of rows. */ this._footerRowDefChanged = true; /** * Whether the sticky column styles need to be updated. Set to `true` when the visible columns * change. */ this._stickyColumnStylesNeedReset = true; /** * Whether the sticky styler should recalculate cell widths when applying sticky styles. If * `false`, cached values will be used instead. This is only applicable to tables with * {@link fixedLayout} enabled. For other tables, cell widths will always be recalculated. */ this._forceRecalculateCellWidths = true; /** * Cache of the latest rendered `RenderRow` objects as a map for easy retrieval when constructing * a new list of `RenderRow` objects for rendering rows. Since the new list is constructed with * the cached `RenderRow` objects when possible, the row identity is preserved when the data * and row template matches, which allows the `IterableDiffer` to check rows by reference * and understand which rows are added/moved/removed. * * Implemented as a map of maps where the first key is the `data: T` object and the second is the * `CdkRowDef` object. With the two keys, the cache points to a `RenderRow` object that * contains an array of created pairs. The array is necessary to handle cases where the data * array contains multiple duplicate data objects and each instantiated `RenderRow` must be * stored. */ this._cachedRenderRowsMap = new Map(); /** * CSS class added to any row or cell that has sticky positioning applied. May be overridden by * table subclasses. */ this.stickyCssClass = 'cdk-table-sticky'; /** * Whether to manually add position: sticky to all sticky cell elements. Not needed if * the position is set in a selector associated with the value of stickyCssClass. May be * overridden by table subclasses */ this.needsPositionStickyOnElement = true; /** Whether the no data row is currently showing anything. */ this._isShowingNoDataRow = false; this._multiTemplateDataRows = false; this._fixedLayout = false; /** * Emits when the table completes rendering a set of data rows based on the latest data from the * data source, even if the set of rows is empty. */ this.contentChanged = new EventEmitter(); // TODO(andrewseguin): Remove max value as the end index // and instead calculate the view on init and scroll. /** * Stream containing the latest information on what rows are being displayed on screen. * Can be used by the data source to as a heuristic of what data should be provided. * * @docs-private */ this.viewChange = new BehaviorSubject({ start: 0, end: Number.MAX_VALUE, }); if (!role) { this._elementRef.nativeElement.setAttribute('role', 'table'); } this._document = _document; this._isNativeHtmlTable = this._elementRef.nativeElement.nodeName === 'TABLE'; } ngOnInit() { this._setupStickyStyler(); if (this._isNativeHtmlTable) { this._applyNativeTableSections(); } // Set up the trackBy function so that it uses the `RenderRow` as its identity by default. If // the user has provided a custom trackBy, return the result of that function as evaluated // with the values of the `RenderRow`'s data and index. this._dataDiffer = this._differs.find([]).create((_i, dataRow) => { return this.trackBy ? this.trackBy(dataRow.dataIndex, dataRow.data) : dataRow; }); this._viewportRuler .change() .pipe(takeUntil(this._onDestroy)) .subscribe(() => { this._forceRecalculateCellWidths = true; }); } ngAfterContentChecked() { // Cache the row and column definitions gathered by ContentChildren and programmatic injection. this._cacheRowDefs(); this._cacheColumnDefs(); // Make sure that the user has at least added header, footer, or data row def. if (!this._headerRowDefs.length && !this._footerRowDefs.length && !this._rowDefs.length && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw getTableMissingRowDefsError(); } // Render updates if the list of columns have been changed for the header, row, or footer defs. const columnsChanged = this._renderUpdatedColumns(); const rowDefsChanged = columnsChanged || this._headerRowDefChanged || this._footerRowDefChanged; // Ensure sticky column styles are reset if set to `true` elsewhere. this._stickyColumnStylesNeedReset = this._stickyColumnStylesNeedReset || rowDefsChanged; this._forceRecalculateCellWidths = rowDefsChanged; // If the header row definition has been changed, trigger a render to the header row. if (this._headerRowDefChanged) { this._forceRenderHeaderRows(); this._headerRowDefChanged = false; } // If the footer row definition has been changed, trigger a render to the footer row. if (this._footerRowDefChanged) { this._forceRenderFooterRows(); this._footerRowDefChanged = false; } // If there is a data source and row definitions, connect to the data source unless a // connection has already been made. if (this.dataSource && this._rowDefs.length > 0 && !this._renderChangeSubscription) { this._observeRenderChanges(); } else if (this._stickyColumnStylesNeedReset) { // In the above case, _observeRenderChanges will result in updateStickyColumnStyles being // called when it row data arrives. Otherwise, we need to call it proactively. this.updateStickyColumnStyles(); } this._checkStickyStates(); } ngOnDestroy() { [ this._rowOutlet.viewContainer, this._headerRowOutlet.viewContainer, this._footerRowOutlet.viewContainer, this._cachedRenderRowsMap, this._customColumnDefs, this._customRowDefs, this._customHeaderRowDefs, this._customFooterRowDefs, this._columnDefsByName, ].forEach(def => { def.clear(); }); this._headerRowDefs = []; this._footerRowDefs = []; this._defaultRowDef = null; this._onDestroy.next(); this._onDestroy.complete(); if (isDataSource(this.dataSource)) { this.dataSource.disconnect(this); } } /** * Renders rows based on the table's latest set of data, which was either provided directly as an * input or retrieved through an Observable stream (directly or from a DataSource). * Checks for differences in the data since the last diff to perform only the necessary * changes (add/remove/move rows). * * If the table's data source is a DataSource or Observable, this will be invoked automatically * each time the provided Observable stream emits a new data array. Otherwise if your data is * an array, this function will need to be called to render any changes. */ renderRows() { this._renderRows = this._getAllRenderRows(); const changes = this._dataDiffer.diff(this._renderRows); if (!changes) { this._updateNoDataRow(); this.contentChanged.next(); return; } const viewContainer = this._rowOutlet.viewContainer; this._viewRepeater.applyChanges(changes, viewContainer, (record, _adjustedPreviousIndex, currentIndex) => this._getEmbeddedViewArgs(record.item, currentIndex), record => record.item.data, (change) => { if (change.operation === 1 /* _ViewRepeaterOperation.INSERTED */ && change.context) { this._renderCellTemplateForItem(change.record.item.rowDef, change.context); } }); // Update the meta context of a row's context data (index, count, first, last, ...) this._updateRowIndexContext(); // Update rows that did not get added/removed/moved but may have had their identity changed, // e.g. if trackBy matched data on some property but the actual data reference changed. changes.forEachIdentityChange((record) => { const rowView = viewContainer.get(record.currentIndex); rowView.context.$implicit = record.item.data; }); this._updateNoDataRow(); // Allow the new row data to render before measuring it. // @breaking-change 14.0.0 Remove undefined check once _ngZone is required. if (this._ngZone && NgZone.isInAngularZone()) { this._ngZone.onStable.pipe(take(1), takeUntil(this._onDestroy)).subscribe(() => { this.updateStickyColumnStyles(); }); } else { this.updateStickyColumnStyles(); } this.contentChanged.next(); } /** Adds a column definition that was not included as part of the content children. */ addColumnDef(columnDef) { this._customColumnDefs.add(columnDef); } /** Removes a column definition that was not included as part of the content children. */ removeColumnDef(columnDef) { this._customColumnDefs.delete(columnDef); } /** Adds a row definition that was not included as part of the content children. */ addRowDef(rowDef) { this._customRowDefs.add(rowDef); } /** Removes a row definition that was not included as part of the content children. */ removeRowDef(rowDef) { this._customRowDefs.delete(rowDef); } /** Adds a header row definition that was not included as part of the content children. */ addHeaderRowDef(headerRowDef) { this._customHeaderRowDefs.add(headerRowDef); this._headerRowDefChanged = true; } /** Removes a header row definition that was not included as part of the content children. */ removeHeaderRowDef(headerRowDef) { this._customHeaderRowDefs.delete(headerRowDef); this._headerRowDefChanged = true; } /** Adds a footer row definition that was not included as part of the content children. */ addFooterRowDef(footerRowDef) { this._customFooterRowDefs.add(footerRowDef); this._footerRowDefChanged = true; } /** Removes a footer row definition that was not included as part of the content children. */ removeFooterRowDef(footerRowDef) { this._customFooterRowDefs.delete(footerRowDef); this._footerRowDefChanged = true; } /** Sets a no data row definition that was not included as a part of the content children. */ setNoDataRow(noDataRow) { this._customNoDataRow = noDataRow; } /** * Updates the header sticky styles. First resets all applied styles with respect to the cells * sticking to the top. Then, evaluating which cells need to be stuck to the top. This is * automatically called when the header row changes its displayed set of columns, or if its * sticky input changes. May be called manually for cases where the cell content changes outside * of these events. */ updateStickyHeaderRowStyles() { const headerRows = this._getRenderedRows(this._headerRowOutlet); const tableElement = this._elementRef.nativeElement; // Hide the thead element if there are no header rows. This is necessary to satisfy // overzealous a11y checkers that fail because the `rowgroup` element does not contain // required child `row`. const thead = tableElement.querySelector('thead'); if (thead) { thead.style.display = headerRows.length ? '' : 'none'; } const stickyStates = this._headerRowDefs.map(def => def.sticky); this._stickyStyler.clearStickyPositioning(headerRows, ['top']); this._stickyStyler.stickRows(headerRows, stickyStates, 'top'); // Reset the dirty state of the sticky input change since it has been used. this._headerRowDefs.forEach(def => def.resetStickyChanged()); } /** * Updates the footer sticky styles. First resets all applied styles with respect to the cells * sticking to the bottom. Then, evaluating which cells need to be stuck to the bottom. This is * automatically called when the footer row changes its displayed set of columns, or if its * sticky input changes. May be called manually for cases where the cell content changes outside * of these events. */ updateStickyFooterRowStyles() { const footerRows = this._getRenderedRows(this._footerRowOutlet); const tableElement = this._elementRef.nativeElement; // Hide the tfoot element if there are no footer rows. This is necessary to satisfy // overzealous a11y checkers that fail because the `rowgroup` element does not contain // required child `row`. const tfoot = tableElement.querySelector('tfoot'); if (tfoot) { tfoot.style.display = footerRows.length ? '' : 'none'; } const stickyStates = this._footerRowDefs.map(def => def.sticky); this._stickyStyler.clearStickyPositioning(footerRows, ['bottom']); this._stickyStyler.stickRows(footerRows, stickyStates, 'bottom'); this._stickyStyler.updateStickyFooterContainer(this._elementRef.nativeElement, stickyStates); // Reset the dirty state of the sticky input change since it has been used. this._footerRowDefs.forEach(def => def.resetStickyChanged()); } /** * Updates the column sticky styles. First resets all applied styles with respect to the cells * sticking to the left and right. Then sticky styles are added for the left and right according * to the column definitions for each cell in each row. This is automatically called when * the data source provides a new set of data or when a column definition changes its sticky * input. May be called manually for cases where the cell content changes outside of these events. */ updateStickyColumnStyles() { const headerRows = this._getRenderedRows(this._headerRowOutlet); const dataRows = this._getRenderedRows(this._rowOutlet); const footerRows = this._getRenderedRows(this._footerRowOutlet); // For tables not using a fixed layout, the column widths may change when new rows are rendered. // In a table using a fixed layout, row content won't affect column width, so sticky styles // don't need to be cleared unless either the sticky column config changes or one of the row // defs change. if ((this._isNativeHtmlTable && !this._fixedLayout) || this._stickyColumnStylesNeedReset) { // Clear the left and right positioning from all columns in the table across all rows since // sticky columns span across all table sections (header, data, footer) this._stickyStyler.clearStickyPositioning([...headerRows, ...dataRows, ...footerRows], ['left', 'right']); this._stickyColumnStylesNeedReset = false; } // Update the sticky styles for each header row depending on the def's sticky state headerRows.forEach((headerRow, i) => { this._addStickyColumnStyles([headerRow], this._headerRowDefs[i]); }); // Update the sticky styles for each data row depending on its def's sticky state this._rowDefs.forEach(rowDef => { // Collect all the rows rendered with this row definition. const rows = []; for (let i = 0; i < dataRows.length; i++) { if (this._renderRows[i].rowDef === rowDef) { rows.push(dataRows[i]); } } this._addStickyColumnStyles(rows, rowDef); }); // Update the sticky styles for each footer row depending on the def's sticky state footerRows.forEach((footerRow, i) => { this._addStickyColumnStyles([footerRow], this._footerRowDefs[i]); }); // Reset the dirty state of the sticky input change since it has been used. Array.from(this._columnDefsByName.values()).forEach(def => def.resetStickyChanged()); } /** * Get the list of RenderRow objects to render according to the current list of data and defined * row definitions. If the previous list already contained a particular pair, it should be reused * so that the differ equates their references. */ _getAllRenderRows() { const renderRows = []; // Store the cache and create a new one. Any re-used RenderRow objects will be moved into the // new cache while unused ones can be picked up by garbage collection. const prevCachedRenderRows = this._cachedRenderRowsMap; this._cachedRenderRowsMap = new Map(); // For each data object, get the list of rows that should be rendered, represented by the // respective `RenderRow` object which is the pair of `data` and `CdkRowDef`. for (let i = 0; i < this._data.length; i++) { let data = this._data[i]; const renderRowsForData = this._getRenderRowsForData(data, i, prevCachedRenderRows.get(data)); if (!this._cachedRenderRowsMap.has(data)) { this._cachedRenderRowsMap.set(data, new WeakMap()); } for (let j = 0; j < renderRowsForData.length; j++) { let renderRow = renderRowsForData[j]; const cache = this._cachedRenderRowsMap.get(renderRow.data); if (cache.has(renderRow.rowDef)) { cache.get(renderRow.rowDef).push(renderRow); } else { cache.set(renderRow.rowDef, [renderRow]); } renderRows.push(renderRow); } } return renderRows; } /** * Gets a list of `RenderRow` for the provided data object and any `CdkRowDef` objects that * should be rendered for this data. Reuses the cached RenderRow objects if they match the same * `(T, CdkRowDef)` pair. */ _getRenderRowsForData(data, dataIndex, cache) { const rowDefs = this._getRowDefs(data, dataIndex); return rowDefs.map(rowDef => { const cachedRenderRows = cache && cache.has(rowDef) ? cache.get(rowDef) : []; if (cachedRenderRows.length) { const dataRow = cachedRenderRows.shift(); dataRow.dataIndex = dataIndex; return dataRow; } else { return { data, rowDef, dataIndex }; } }); } /** Update the map containing the content's column definitions. */ _cacheColumnDefs() { this._columnDefsByName.clear(); const columnDefs = mergeArrayAndSet(this._getOwnDefs(this._contentColumnDefs), this._customColumnDefs); columnDefs.forEach(columnDef => { if (this._columnDefsByName.has(columnDef.name) && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw getTableDuplicateColumnNameError(columnDef.name); } this._columnDefsByName.set(columnDef.name, columnDef); }); } /** Update the list of all available row definitions that can be used. */ _cacheRowDefs() { this._headerRowDefs = mergeArrayAndSet(this._getOwnDefs(this._contentHeaderRowDefs), this._customHeaderRowDefs); this._footerRowDefs = mergeArrayAndSet(this._getOwnDefs(this._contentFooterRowDefs), this._customFooterRowDefs); this._rowDefs = mergeArrayAndSet(this._getOwnDefs(this._contentRowDefs), this._customRowDefs); // After all row definitions are determined, find the row definition to be considered default. const defaultRowDefs = this._rowDefs.filter(def => !def.when); if (!this.multiTemplateDataRows && defaultRowDefs.length > 1 && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw getTableMultipleDefaultRowDefsError(); } this._defaultRowDef = defaultRowDefs[0]; } /** * Check if the header, data, or footer rows have changed what columns they want to display or * whether the sticky states have changed for the header or footer. If there is a diff, then * re-render that section. */ _renderUpdatedColumns() { const columnsDiffReducer = (acc, def) => acc || !!def.getColumnsDiff(); // Force re-render data rows if the list of column definitions have changed. const dataColumnsChanged = this._rowDefs.reduce(columnsDiffReducer, false); if (dataColumnsChanged) { this._forceRenderDataRows(); } // Force re-render header/footer rows if the list of column definitions have changed. const headerColumnsChanged = this._headerRowDefs.reduce(columnsDiffReducer, false); if (headerColumnsChanged) { this._forceRenderHeaderRows(); } const footerColumnsChanged = this._footerRowDefs.reduce(columnsDiffReducer, false); if (footerColumnsChanged) { this._forceRenderFooterRows(); } return dataColumnsChanged || headerColumnsChanged || footerColumnsChanged; } /** * Switch to the provided data source by resetting the data and unsubscribing from the current * render change subscription if one exists. If the data source is null, interpret this by * clearing the row outlet. Otherwise start listening for new data. */ _switchDataSource(dataSource) { this._data = []; if (isDataSource(this.dataSource)) { this.dataSource.disconnect(this); } // Stop listening for data from the previous data source. if (this._renderChangeSubscription) { this._renderChangeSubscription.unsubscribe(); this._renderChangeSubscription = null; } if (!dataSource) { if (this._dataDiffer) { this._dataDiffer.diff([]); } this._rowOutlet.viewContainer.clear(); } this._dataSource = dataSource; } /** Set up a subscription for the data provided by the data source. */ _observeRenderChanges() { // If no data source has been set, there is nothing to observe for changes. if (!this.dataSource) { return; } let dataStream; if (isDataSource(this.dataSource)) { dataStream = this.dataSource.connect(this); } else if (isObservable(this.dataSource)) { dataStream = this.dataSource; } else if (Array.isArray(this.dataSource)) { dataStream = observableOf(this.dataSource); } if (dataStream === undefined && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw getTableUnknownDataSourceError(); } this._renderChangeSubscription = dataStream .pipe(takeUntil(this._onDestroy)) .subscribe(data => { this._data = data || []; this.renderRows(); }); } /** * Clears any existing content in the header row outlet and creates a new embedded view * in the outlet using the header row definition. */ _forceRenderHeaderRows() { // Clear the header row outlet if any content exists. if (this._headerRowOutlet.viewContainer.length > 0) { this._headerRowOutlet.viewContainer.clear(); } this._headerRowDefs.forEach((def, i) => this._renderRow(this._headerRowOutlet, def, i)); this.updateStickyHeaderRowStyles(); } /** * Clears any existing content in the footer row outlet and creates a new embedded view * in the outlet using the footer row definition. */ _forceRenderFooterRows() { // Clear the footer row outlet if any content exists. if (this._footerRowOutlet.viewContainer.length > 0) { this._footerRowOutlet.viewContainer.clear(); } this._footerRowDefs.forEach((def, i) => this._renderRow(this._footerRowOutlet, def, i)); this.updateStickyFooterRowStyles(); } /** Adds the sticky column styles for the rows according to the columns' stick states. */ _addStickyColumnStyles(rows, rowDef) { const columnDefs = Array.from(rowDef.columns || []).map(columnName => { const columnDef = this._columnDefsByName.get(columnName); if (!columnDef && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw getTableUnknownColumnError(columnName); } return columnDef; }); const stickyStartStates = columnDefs.map(columnDef => columnDef.sticky); const stickyEndStates = columnDefs.map(columnDef => columnDef.stickyEnd); this._stickyStyler.updateStickyColumns(rows, stickyStartStates, stickyEndStates, !this._fixedLayout || this._forceRecalculateCellWidths); } /** Gets the list of rows that have been rendered in the row outlet. */ _getRenderedRows(rowOutlet) { const renderedRows = []; for (let i = 0; i < rowOutlet.viewContainer.length; i++) { const viewRef = rowOutlet.viewContainer.get(i); renderedRows.push(viewRef.rootNodes[0]); } return renderedRows; } /** * Get the matching row definitions that should be used for this row data. If there is only * one row definition, it is returned. Otherwise, find the row definitions that has a when * predicate that returns true with the data. If none return true, return the default row * definition. */ _getRowDefs(data, dataIndex) { if (this._rowDefs.length == 1) { return [this._rowDefs[0]]; } let rowDefs = []; if (this.multiTemplateDataRows) { rowDefs = this._rowDefs.filter(def => !def.when || def.when(dataIndex, data)); } else { let rowDef = this._rowDefs.find(def => def.when && def.when(dataIndex, data)) || this._defaultRowDef; if (rowDef) { rowDefs.push(rowDef); } } if (!rowDefs.length && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw getTableMissingMatchingRowDefError(data); } return rowDefs; } _getEmbeddedViewArgs(renderRow, index) { const rowDef = renderRow.rowDef; const context = { $implicit: renderRow.data }; return { templateRef: rowDef.template, context, index, }; } /** * Creates a new row template in the outlet and fills it with the set of cell templates. * Optionally takes a context to provide to the row and cells, as well as an optional index * of where to place the new row template in the outlet. */ _renderRow(outlet, rowDef, index, context = {}) { // TODO(andrewseguin): enforce that one outlet was instantiated from createEmbeddedView const view = outlet.viewContainer.createEmbeddedView(rowDef.template, context, index); this._renderCellTemplateForItem(rowDef, context); return view; } _renderCellTemplateForItem(rowDef, context) { for (let cellTemplate of this._getCellTemplates(rowDef)) { if (CdkCellOutlet.mostRecentCellOutlet) { CdkCellOutlet.mostRecentCellOutlet._viewContainer.createEmbeddedView(cellTemplate, context); } } this._changeDetectorRef.markForCheck(); } /** * Updates the index-related context for each row to reflect any changes in the index of the rows, * e.g. first/last/even/odd. */ _updateRowIndexContext() { const viewContainer = this._rowOutlet.viewContainer; for (let renderIndex = 0, count = viewContainer.length; renderIndex < count; renderIndex++) { const viewRef = viewContainer.get(renderIndex); const context = viewRef.context; context.count = count; context.first = renderIndex === 0; context.last = renderIndex === count - 1; context.even = renderIndex % 2 === 0; context.odd = !context.even; if (this.multiTemplateDataRows) { context.dataIndex = this._renderRows[renderIndex].dataIndex; context.renderIndex = renderIndex; } else { context.index = this._renderRows[renderIndex].dataIndex; } } } /** Gets the column definitions for the provided row def. */ _getCellTemplates(rowDef) { if (!rowDef || !rowDef.columns) { return []; } return Array.from(rowDef.columns, columnId => { const column = this._columnDefsByName.get(columnId); if (!column && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw getTableUnknownColumnError(columnId); } return rowDef.extractCellTemplate(column); }); } /** Adds native table sections (e.g. tbody) and moves the row outlets into them. */ _applyNativeTableSections() { const documentFragment = this._document.createDocumentFragment(); const sections = [ { tag: 'thead', outlets: [this._headerRowOutlet] }, { tag: 'tbody', outlets: [this._rowOutlet, this._noDataRowOutlet] }, { tag: 'tfoot', outlets: [this._footerRowOutlet] }, ]; for (const section of sections) { const element = this._document.createElement(section.tag); element.setAttribute('role', 'rowgroup'); for (const outlet of section.outlets) { element.appendChild(outlet.elementRef.nativeElement); } documentFragment.appendChild(element); } // Use a DocumentFragment so we don't hit the DOM on each iteration. this._elementRef.nativeElement.appendChild(documentFragment); } /** * Forces a re-render of the data rows. Should be called in cases where there has been an input * change that affects the evaluation of which rows should be rendered, e.g. toggling * `multiTemplateDataRows` or adding/removing row definitions. */ _forceRenderDataRows() { this._dataDiffer.diff([]); this._rowOutlet.viewContainer.clear(); this.renderRows(); } /** * Checks if there has been a change in sticky states since last check and applies the correct * sticky styles. Since checking resets the "dirty" state, this should only be performed once * during a change detection and after the inputs are settled (after content check). */ _checkStickyStates() { const stickyCheckReducer = (acc, d) => { return acc || d.hasStickyChanged(); }; // Note that the check needs to occur for every definition since it notifies the definition // that it can reset its dirty state. Using another operator like `some` may short-circuit // remaining definitions and leave them in an unchecked state. if (this._headerRowDefs.reduce(stickyCheckReducer, false)) { this.updateStickyHeaderRowStyles(); } if (this._footerRowDefs.reduce(stickyCheckReducer, false)) { this.updateStickyFooterRowStyles(); } if (Array.from(this._columnDefsByName.values()).reduce(stickyCheckReducer, false)) { this._stickyColumnStylesNeedReset = true; this.updateStickyColumnStyles(); } } /** * Creates the sticky styler that will be used for sticky rows and columns. Listens * for directionality changes and provides the latest direction to the styler. Re-applies column * stickiness when directionality changes. */ _setupStickyStyler() { const direction = this._dir ? this._dir.value : 'ltr'; this._stickyStyler = new StickyStyler(this._isNativeHtmlTable, this.stickyCssClass, direction, this._coalescedStyleScheduler, this._platform.isBrowser, this.needsPositionStickyOnElement, this._stickyPositioningListener); (this._dir ? this._dir.change : observableOf()) .pipe(takeUntil(this._onDestroy)) .subscribe(value => { this._stickyStyler.direction = value; this.updateStickyColumnStyles(); }); } /** Filters definitions that belong to this table from a QueryList. */ _getOwnDefs(items) { return items.filter(item => !item._table || item._table === this); } /** Creates or removes the no data row, depending on whether any data is being shown. */ _updateNoDataRow() { const noDataRow = this._customNoDataRow || this._noDataRow; if (!noDataRow) { return; } const shouldShow = this._rowOutlet.viewContainer.length === 0; if (shouldShow === this._isShowingNoDataRow) { return; } const container = this._noDataRowOutlet.viewContainer; if (shouldShow) { const view = container.createEmbeddedView(noDataRow.templateRef); const rootNode = view.rootNodes[0]; // Only add the attributes if we have a single root node since it's hard // to figure out which one to add it to when there are multiple. if (view.rootNodes.length === 1 && rootNode?.nodeType === this._document.ELEMENT_NODE) { rootNode.setAttribute('role', 'row'); rootNode.classList.add(noDataRow._contentClassName); } } else { container.clear(); } this._isShowingNoDataRow = shouldShow; this._changeDetectorRef.markForCheck(); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", 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 }); } static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.1", type: CdkTable, selector: "cdk-table, table[cdk-table]", inputs: { trackBy: "trackBy", dataSource: "dataSource", multiTemplateDataRows: "multiTemplateDataRows", fixedLayout: "fixedLayout" }, outputs: { contentChanged: "contentChanged" }, host: { attributes: { "ngSkipHydration": "" }, properties: { "class.cdk-table-fixed-layout": "fixedLayout" }, classAttribute: "cdk-table" }, providers: [ { provide: CDK_TABLE, useExisting: CdkTable }, { provide: _VIEW_REPEATER_STRATEGY, useClass: _DisposeViewRepeaterStrategy }, { provide: _COALESCED_STYLE_SCHEDULER, useClass: _CoalescedStyleScheduler }, // Prevent nested tables from seeing this table's StickyPositioningListener. { provide: STICKY_POSITIONING_LISTENER, useValue: null }, ], 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 }], viewQueries: [{ propertyName: "_rowOutlet", first: true, predicate: DataRowOutlet, descendants: true, static: true }, { propertyName: "_headerRowOutlet", first: true, predicate: HeaderRowOutlet, descendants: true, static: true }, { propertyName: "_footerRowOutlet", first: true, predicate: FooterRowOutlet, descendants: true, static: true }, { propertyName: "_noDataRowOutlet", first: true, predicate: NoDataRowOutlet, descendants: true, static: true }], exportAs: ["cdkTable"], ngImport: i0, template: "\n \n \n \n \n \n \n", isInline: true, styles: [".cdk-table-fixed-layout{table-layout:fixed}"], dependencies: [{ kind: "directive", type: DataRowOutlet, selector: "[rowOutlet]" }, { kind: "directive", type: HeaderRowOutlet, selector: "[headerRowOutlet]" }, { kind: "directive", type: FooterRowOutlet, selector: "[footerRowOutlet]" }, { kind: "directive", type: NoDataRowOutlet, selector: "[noDataRowOutlet]" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: CdkTable, decorators: [{ type: Component, args: [{ selector: 'cdk-table, table[cdk-table]', exportAs: 'cdkTable', template: CDK_TABLE_TEMPLATE, host: { 'class': 'cdk-table', '[class.cdk-table-fixed-layout]': 'fixedLayout', 'ngSkipHydration': '', }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.Default, providers: [ { provide: CDK_TABLE, useExisting: CdkTable }, { provide: _VIEW_REPEATER_STRATEGY, useClass: _DisposeViewRepeaterStrategy }, { provide: _COALESCED_STYLE_SCHEDULER, useClass: _CoalescedStyleScheduler }, // Prevent nested tables from seeing this table's StickyPositioningListener. { provide: STICKY_POSITIONING_LISTENER, useValue: null }, ], styles: [".cdk-table-fixed-layout{table-layout:fixed}"] }] }], ctorParameters: function () { return [{ type: i0.IterableDiffers }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: undefined, decorators: [{ type: Attribute, args: ['role'] }] }, { type: i1.Directionality, decorators: [{ type: Optional }] }, { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT] }] }, { type: i2.Platform }, { type: undefined, decorators: [{ type: Inject, args: [_VIEW_REPEATER_STRATEGY] }] }, { type: i4._CoalescedStyleScheduler, decorators: [{ type: Inject, args: [_COALESCED_STYLE_SCHEDULER] }] }, { type: i3.ViewportRuler }, { type: undefined, decorators: [{ type: Optional }, { type: SkipSelf }, { type: Inject, args: [STICKY_POSITIONING_LISTENER] }] }, { type: i0.NgZone, decorators: [{ type: Optional }] }]; }, propDecorators: { trackBy: [{ type: Input }], dataSource: [{ type: Input }], multiTemplateDataRows: [{ type: Input }], fixedLayout: [{ type: Input }], contentChanged: [{ type: Output }], _rowOutlet: [{ type: ViewChild, args: [DataRowOutlet, { static: true }] }], _headerRowOutlet: [{ type: ViewChild, args: [HeaderRowOutlet, { static: true }] }], _footerRowOutlet: [{ type: ViewChild, args: [FooterRowOutlet, { static: true }] }], _noDataRowOutlet: [{ type: ViewChild, args: [NoDataRowOutlet, { static: true }] }], _contentColumnDefs: [{ type: ContentChildren, args: [CdkColumnDef, { descendants: true }] }], _contentRowDefs: [{ type: ContentChildren, args: [CdkRowDef, { descendants: true }] }], _contentHeaderRowDefs: [{ type: ContentChildren, args: [CdkHeaderRowDef, { descendants: true, }] }], _contentFooterRowDefs: [{ type: ContentChildren, args: [CdkFooterRowDef, { descendants: true, }] }], _noDataRow: [{ type: ContentChild, args: [CdkNoDataRow] }] } }); /** Utility function that gets a merged list of the entries in an array and values of a Set. */ function mergeArrayAndSet(array, set) { return array.concat(Array.from(set)); } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFibGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvY2RrL3RhYmxlL3RhYmxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQUVILE9BQU8sRUFBWSxjQUFjLEVBQUMsTUFBTSxtQkFBbUIsQ0FBQztBQUM1RCxPQUFPLEVBQWUscUJBQXFCLEVBQUMsTUFBTSx1QkFBdUIsQ0FBQztBQUMxRSxPQUFPLEVBR0wsNEJBQTRCLEVBQzVCLDRCQUE0QixFQUM1Qix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