UNPKG

57.3 kBTypeScriptView Raw
1import { AfterContentChecked } from '@angular/core';
2import { BehaviorSubject } from 'rxjs';
3import { BooleanInput } from '@angular/cdk/coercion';
4import { ChangeDetectorRef } from '@angular/core';
5import { CollectionViewer } from '@angular/cdk/collections';
6import { DataSource } from '@angular/cdk/collections';
7import { Direction } from '@angular/cdk/bidi';
8import { Directionality } from '@angular/cdk/bidi';
9import { ElementRef } from '@angular/core';
10import { EventEmitter } from '@angular/core';
11import * as i0 from '@angular/core';
12import * as i5 from '@angular/cdk/scrolling';
13import { InjectionToken } from '@angular/core';
14import { IterableChanges } from '@angular/core';
15import { IterableDiffer } from '@angular/core';
16import { IterableDiffers } from '@angular/core';
17import { NgZone } from '@angular/core';
18import { Observable } from 'rxjs';
19import { OnChanges } from '@angular/core';
20import { OnDestroy } from '@angular/core';
21import { OnInit } from '@angular/core';
22import { Platform } from '@angular/cdk/platform';
23import { QueryList } from '@angular/core';
24import { SimpleChanges } from '@angular/core';
25import { TemplateRef } from '@angular/core';
26import { TrackByFunction } from '@angular/core';
27import { ViewContainerRef } from '@angular/core';
28import { ViewportRuler } from '@angular/cdk/scrolling';
29import { _ViewRepeater } from '@angular/cdk/collections';
30
31/** Base class for the cells. Adds a CSS classname that identifies the column it renders in. */
32export declare class BaseCdkCell {
33 constructor(columnDef: CdkColumnDef, elementRef: ElementRef);
34}
35
36/**
37 * Base class for the CdkHeaderRowDef and CdkRowDef that handles checking their columns inputs
38 * for changes and notifying the table.
39 */
40export declare abstract class BaseRowDef implements OnChanges {
41 /** @docs-private */ template: TemplateRef<any>;
42 protected _differs: IterableDiffers;
43 /** The columns to be displayed on this row. */
44 columns: Iterable<string>;
45 /** Differ used to check if any changes were made to the columns. */
46 protected _columnsDiffer: IterableDiffer<any>;
47 constructor(
48 /** @docs-private */ template: TemplateRef<any>, _differs: IterableDiffers);
49 ngOnChanges(changes: SimpleChanges): void;
50 /**
51 * Returns the difference between the current columns and the columns from the last diff, or null
52 * if there is no difference.
53 */
54 getColumnsDiff(): IterableChanges<any> | null;
55 /** Gets this row def's relevant cell template from the provided column def. */
56 extractCellTemplate(column: CdkColumnDef): TemplateRef<any>;
57 static ɵfac: i0.ɵɵFactoryDeclaration<BaseRowDef, never>;
58 static ɵdir: i0.ɵɵDirectiveDeclaration<BaseRowDef, never, never, {}, {}, never, never, false, never>;
59}
60
61/**
62 * Interface for a mixin to provide a directive with a function that checks if the sticky input has
63 * been changed since the last time the function was called. Essentially adds a dirty-check to the
64 * sticky value.
65 * @docs-private
66 */
67export declare interface CanStick {
68 /** Whether sticky positioning should be applied. */
69 sticky: boolean;
70 /** Whether the sticky input has changed since it was last checked. */
71 _hasStickyChanged: boolean;
72 /** Whether the sticky value has changed since this was last called. */
73 hasStickyChanged(): boolean;
74 /** Resets the dirty check for cases where the sticky state has been used without checking. */
75 resetStickyChanged(): void;
76}
77
78/** @docs-private */
79export declare type CanStickCtor = Constructor<CanStick>;
80
81/**
82 * The row template that can be used by the mat-table. Should not be used outside of the
83 * material library.
84 */
85export declare const CDK_ROW_TEMPLATE = "<ng-container cdkCellOutlet></ng-container>";
86
87/**
88 * Used to provide a table to some of the sub-components without causing a circular dependency.
89 * @docs-private
90 */
91export declare const CDK_TABLE: InjectionToken<any>;
92
93/**
94 * The table template that can be used by the mat-table. Should not be used outside of the
95 * material library.
96 * @docs-private
97 */
98export declare const CDK_TABLE_TEMPLATE = "\n <ng-content select=\"caption\"></ng-content>\n <ng-content select=\"colgroup, col\"></ng-content>\n <ng-container headerRowOutlet></ng-container>\n <ng-container rowOutlet></ng-container>\n <ng-container noDataRowOutlet></ng-container>\n <ng-container footerRowOutlet></ng-container>\n";
99
100/** Cell template container that adds the right classes and role. */
101export declare class CdkCell extends BaseCdkCell {
102 constructor(columnDef: CdkColumnDef, elementRef: ElementRef);
103 static ɵfac: i0.ɵɵFactoryDeclaration<CdkCell, never>;
104 static ɵdir: i0.ɵɵDirectiveDeclaration<CdkCell, "cdk-cell, td[cdk-cell]", never, {}, {}, never, never, false, never>;
105}
106
107/**
108 * Cell definition for a CDK table.
109 * Captures the template of a column's data row cell as well as cell-specific properties.
110 */
111export declare class CdkCellDef implements CellDef {
112 template: TemplateRef<any>;
113 constructor(/** @docs-private */ template: TemplateRef<any>);
114 static ɵfac: i0.ɵɵFactoryDeclaration<CdkCellDef, never>;
115 static ɵdir: i0.ɵɵDirectiveDeclaration<CdkCellDef, "[cdkCellDef]", never, {}, {}, never, never, false, never>;
116}
117
118/**
119 * Outlet for rendering cells inside of a row or header row.
120 * @docs-private
121 */
122export declare class CdkCellOutlet implements OnDestroy {
123 _viewContainer: ViewContainerRef;
124 /** The ordered list of cells to render within this outlet's view container */
125 cells: CdkCellDef[];
126 /** The data context to be provided to each cell */
127 context: any;
128 /**
129 * Static property containing the latest constructed instance of this class.
130 * Used by the CDK table when each CdkHeaderRow and CdkRow component is created using
131 * createEmbeddedView. After one of these components are created, this property will provide
132 * a handle to provide that component's cells and context. After init, the CdkCellOutlet will
133 * construct the cells with the provided context.
134 */
135 static mostRecentCellOutlet: CdkCellOutlet | null;
136 constructor(_viewContainer: ViewContainerRef);
137 ngOnDestroy(): void;
138 static ɵfac: i0.ɵɵFactoryDeclaration<CdkCellOutlet, never>;
139 static ɵdir: i0.ɵɵDirectiveDeclaration<CdkCellOutlet, "[cdkCellOutlet]", never, {}, {}, never, never, false, never>;
140}
141
142/**
143 * Context provided to the row cells when `multiTemplateDataRows` is true. This context is the same
144 * as CdkCellOutletRowContext except that the single `index` value is replaced by `dataIndex` and
145 * `renderIndex`.
146 */
147export declare interface CdkCellOutletMultiRowContext<T> {
148 /** Data for the row that this cell is located within. */
149 $implicit?: T;
150 /** Index of the data object in the provided data array. */
151 dataIndex?: number;
152 /** Index location of the rendered row that this cell is located within. */
153 renderIndex?: number;
154 /** Length of the number of total rows. */
155 count?: number;
156 /** True if this cell is contained in the first row. */
157 first?: boolean;
158 /** True if this cell is contained in the last row. */
159 last?: boolean;
160 /** True if this cell is contained in a row with an even-numbered index. */
161 even?: boolean;
162 /** True if this cell is contained in a row with an odd-numbered index. */
163 odd?: boolean;
164}
165
166/** Context provided to the row cells when `multiTemplateDataRows` is false */
167export declare interface CdkCellOutletRowContext<T> {
168 /** Data for the row that this cell is located within. */
169 $implicit?: T;
170 /** Index of the data object in the provided data array. */
171 index?: number;
172 /** Length of the number of total rows. */
173 count?: number;
174 /** True if this cell is contained in the first row. */
175 first?: boolean;
176 /** True if this cell is contained in the last row. */
177 last?: boolean;
178 /** True if this cell is contained in a row with an even-numbered index. */
179 even?: boolean;
180 /** True if this cell is contained in a row with an odd-numbered index. */
181 odd?: boolean;
182}
183
184/**
185 * Column definition for the CDK table.
186 * Defines a set of cells available for a table column.
187 */
188export declare class CdkColumnDef extends _CdkColumnDefBase implements CanStick {
189 _table?: any;
190 /** Unique name for this column. */
191 get name(): string;
192 set name(name: string);
193 protected _name: string;
194 /**
195 * Whether this column should be sticky positioned on the end of the row. Should make sure
196 * that it mimics the `CanStick` mixin such that `_hasStickyChanged` is set to true if the value
197 * has been changed.
198 */
199 get stickyEnd(): boolean;
200 set stickyEnd(v: BooleanInput);
201 _stickyEnd: boolean;
202 /** @docs-private */
203 cell: CdkCellDef;
204 /** @docs-private */
205 headerCell: CdkHeaderCellDef;
206 /** @docs-private */
207 footerCell: CdkFooterCellDef;
208 /**
209 * Transformed version of the column name that can be used as part of a CSS classname. Excludes
210 * all non-alphanumeric characters and the special characters '-' and '_'. Any characters that
211 * do not match are replaced by the '-' character.
212 */
213 cssClassFriendlyName: string;
214 /**
215 * Class name for cells in this column.
216 * @docs-private
217 */
218 _columnCssClassName: string[];
219 constructor(_table?: any);
220 /**
221 * Overridable method that sets the css classes that will be added to every cell in this
222 * column.
223 * In the future, columnCssClassName will change from type string[] to string and this
224 * will set a single string value.
225 * @docs-private
226 */
227 protected _updateColumnCssClassName(): void;
228 /**
229 * This has been extracted to a util because of TS 4 and VE.
230 * View Engine doesn't support property rename inheritance.
231 * TS 4.0 doesn't allow properties to override accessors or vice-versa.
232 * @docs-private
233 */
234 protected _setNameInput(value: string): void;
235 static ɵfac: i0.ɵɵFactoryDeclaration<CdkColumnDef, [{ optional: true; }]>;
236 static ɵdir: i0.ɵɵDirectiveDeclaration<CdkColumnDef, "[cdkColumnDef]", never, { "sticky": { "alias": "sticky"; "required": false; }; "name": { "alias": "cdkColumnDef"; "required": false; }; "stickyEnd": { "alias": "stickyEnd"; "required": false; }; }, {}, ["cell", "headerCell", "footerCell"], never, false, never>;
237}
238
239/** @docs-private */
240declare class CdkColumnDefBase {
241}
242
243declare const _CdkColumnDefBase: CanStickCtor & typeof CdkColumnDefBase;
244
245/** Footer cell template container that adds the right classes and role. */
246export declare class CdkFooterCell extends BaseCdkCell {
247 constructor(columnDef: CdkColumnDef, elementRef: ElementRef);
248 static ɵfac: i0.ɵɵFactoryDeclaration<CdkFooterCell, never>;
249 static ɵdir: i0.ɵɵDirectiveDeclaration<CdkFooterCell, "cdk-footer-cell, td[cdk-footer-cell]", never, {}, {}, never, never, false, never>;
250}
251
252/**
253 * Footer cell definition for a CDK table.
254 * Captures the template of a column's footer cell and as well as cell-specific properties.
255 */
256export declare class CdkFooterCellDef implements CellDef {
257 template: TemplateRef<any>;
258 constructor(/** @docs-private */ template: TemplateRef<any>);
259 static ɵfac: i0.ɵɵFactoryDeclaration<CdkFooterCellDef, never>;
260 static ɵdir: i0.ɵɵDirectiveDeclaration<CdkFooterCellDef, "[cdkFooterCellDef]", never, {}, {}, never, never, false, never>;
261}
262
263/** Footer template container that contains the cell outlet. Adds the right class and role. */
264export declare class CdkFooterRow {
265 static ɵfac: i0.ɵɵFactoryDeclaration<CdkFooterRow, never>;
266 static ɵcmp: i0.ɵɵComponentDeclaration<CdkFooterRow, "cdk-footer-row, tr[cdk-footer-row]", never, {}, {}, never, never, false, never>;
267}
268
269/**
270 * Footer row definition for the CDK table.
271 * Captures the footer row's template and other footer properties such as the columns to display.
272 */
273export declare class CdkFooterRowDef extends _CdkFooterRowDefBase implements CanStick, OnChanges {
274 _table?: any;
275 constructor(template: TemplateRef<any>, _differs: IterableDiffers, _table?: any);
276 ngOnChanges(changes: SimpleChanges): void;
277 static ɵfac: i0.ɵɵFactoryDeclaration<CdkFooterRowDef, [null, null, { optional: true; }]>;
278 static ɵdir: i0.ɵɵDirectiveDeclaration<CdkFooterRowDef, "[cdkFooterRowDef]", never, { "columns": { "alias": "cdkFooterRowDef"; "required": false; }; "sticky": { "alias": "cdkFooterRowDefSticky"; "required": false; }; }, {}, never, never, false, never>;
279}
280
281/** @docs-private */
282declare class CdkFooterRowDefBase extends BaseRowDef {
283}
284
285declare const _CdkFooterRowDefBase: CanStickCtor & typeof CdkFooterRowDefBase;
286
287/** Header cell template container that adds the right classes and role. */
288export declare class CdkHeaderCell extends BaseCdkCell {
289 constructor(columnDef: CdkColumnDef, elementRef: ElementRef);
290 static ɵfac: i0.ɵɵFactoryDeclaration<CdkHeaderCell, never>;
291 static ɵdir: i0.ɵɵDirectiveDeclaration<CdkHeaderCell, "cdk-header-cell, th[cdk-header-cell]", never, {}, {}, never, never, false, never>;
292}
293
294/**
295 * Header cell definition for a CDK table.
296 * Captures the template of a column's header cell and as well as cell-specific properties.
297 */
298export declare class CdkHeaderCellDef implements CellDef {
299 template: TemplateRef<any>;
300 constructor(/** @docs-private */ template: TemplateRef<any>);
301 static ɵfac: i0.ɵɵFactoryDeclaration<CdkHeaderCellDef, never>;
302 static ɵdir: i0.ɵɵDirectiveDeclaration<CdkHeaderCellDef, "[cdkHeaderCellDef]", never, {}, {}, never, never, false, never>;
303}
304
305/** Header template container that contains the cell outlet. Adds the right class and role. */
306export declare class CdkHeaderRow {
307 static ɵfac: i0.ɵɵFactoryDeclaration<CdkHeaderRow, never>;
308 static ɵcmp: i0.ɵɵComponentDeclaration<CdkHeaderRow, "cdk-header-row, tr[cdk-header-row]", never, {}, {}, never, never, false, never>;
309}
310
311/**
312 * Header row definition for the CDK table.
313 * Captures the header row's template and other header properties such as the columns to display.
314 */
315export declare class CdkHeaderRowDef extends _CdkHeaderRowDefBase implements CanStick, OnChanges {
316 _table?: any;
317 constructor(template: TemplateRef<any>, _differs: IterableDiffers, _table?: any);
318 ngOnChanges(changes: SimpleChanges): void;
319 static ɵfac: i0.ɵɵFactoryDeclaration<CdkHeaderRowDef, [null, null, { optional: true; }]>;
320 static ɵdir: i0.ɵɵDirectiveDeclaration<CdkHeaderRowDef, "[cdkHeaderRowDef]", never, { "columns": { "alias": "cdkHeaderRowDef"; "required": false; }; "sticky": { "alias": "cdkHeaderRowDefSticky"; "required": false; }; }, {}, never, never, false, never>;
321}
322
323/** @docs-private */
324declare class CdkHeaderRowDefBase extends BaseRowDef {
325}
326
327declare const _CdkHeaderRowDefBase: CanStickCtor & typeof CdkHeaderRowDefBase;
328
329/** Row that can be used to display a message when no data is shown in the table. */
330export declare class CdkNoDataRow {
331 templateRef: TemplateRef<any>;
332 _contentClassName: string;
333 constructor(templateRef: TemplateRef<any>);
334 static ɵfac: i0.ɵɵFactoryDeclaration<CdkNoDataRow, never>;
335 static ɵdir: i0.ɵɵDirectiveDeclaration<CdkNoDataRow, "ng-template[cdkNoDataRow]", never, {}, {}, never, never, false, never>;
336}
337
338/**
339 * Enables the recycle view repeater strategy, which reduces rendering latency. Not compatible with
340 * tables that animate rows.
341 */
342export declare class CdkRecycleRows {
343 static ɵfac: i0.ɵɵFactoryDeclaration<CdkRecycleRows, never>;
344 static ɵdir: i0.ɵɵDirectiveDeclaration<CdkRecycleRows, "cdk-table[recycleRows], table[cdk-table][recycleRows]", never, {}, {}, never, never, false, never>;
345}
346
347/** Data row template container that contains the cell outlet. Adds the right class and role. */
348export declare class CdkRow {
349 static ɵfac: i0.ɵɵFactoryDeclaration<CdkRow, never>;
350 static ɵcmp: i0.ɵɵComponentDeclaration<CdkRow, "cdk-row, tr[cdk-row]", never, {}, {}, never, never, false, never>;
351}
352
353/**
354 * Data row definition for the CDK table.
355 * Captures the header row's template and other row properties such as the columns to display and
356 * a when predicate that describes when this row should be used.
357 */
358export declare class CdkRowDef<T> extends BaseRowDef {
359 _table?: any;
360 /**
361 * Function that should return true if this row template should be used for the provided index
362 * and row data. If left undefined, this row will be considered the default row template to use
363 * when no other when functions return true for the data.
364 * For every row, there must be at least one when function that passes or an undefined to default.
365 */
366 when: (index: number, rowData: T) => boolean;
367 constructor(template: TemplateRef<any>, _differs: IterableDiffers, _table?: any);
368 static ɵfac: i0.ɵɵFactoryDeclaration<CdkRowDef<any>, [null, null, { optional: true; }]>;
369 static ɵdir: i0.ɵɵDirectiveDeclaration<CdkRowDef<any>, "[cdkRowDef]", never, { "columns": { "alias": "cdkRowDefColumns"; "required": false; }; "when": { "alias": "cdkRowDefWhen"; "required": false; }; }, {}, never, never, false, never>;
370}
371
372/**
373 * A data table that can render a header row, data rows, and a footer row.
374 * Uses the dataSource input to determine the data to be rendered. The data can be provided either
375 * as a data array, an Observable stream that emits the data array to render, or a DataSource with a
376 * connect function that will return an Observable stream that emits the data array to render.
377 */
378export declare class CdkTable<T> implements AfterContentChecked, CollectionViewer, OnDestroy, OnInit {
379 protected readonly _differs: IterableDiffers;
380 protected readonly _changeDetectorRef: ChangeDetectorRef;
381 protected readonly _elementRef: ElementRef;
382 protected readonly _dir: Directionality;
383 private _platform;
384 protected readonly _viewRepeater: _ViewRepeater<T, RenderRow<T>, RowContext<T>>;
385 protected readonly _coalescedStyleScheduler: _CoalescedStyleScheduler;
386 private readonly _viewportRuler;
387 /**
388 * @deprecated `_stickyPositioningListener` parameter to become required.
389 * @breaking-change 13.0.0
390 */
391 protected readonly _stickyPositioningListener: StickyPositioningListener;
392 /**
393 * @deprecated `_ngZone` parameter to become required.
394 * @breaking-change 14.0.0
395 */
396 protected readonly _ngZone?: NgZone | undefined;
397 private _document;
398 /** Latest data provided by the data source. */
399 protected _data: readonly T[];
400 /** Subject that emits when the component has been destroyed. */
401 private readonly _onDestroy;
402 /** List of the rendered rows as identified by their `RenderRow` object. */
403 private _renderRows;
404 /** Subscription that listens for the data provided by the data source. */
405 private _renderChangeSubscription;
406 /**
407 * Map of all the user's defined columns (header, data, and footer cell template) identified by
408 * name. Collection populated by the column definitions gathered by `ContentChildren` as well as
409 * any custom column definitions added to `_customColumnDefs`.
410 */
411 private _columnDefsByName;
412 /**
413 * Set of all row definitions that can be used by this table. Populated by the rows gathered by
414 * using `ContentChildren` as well as any custom row definitions added to `_customRowDefs`.
415 */
416 private _rowDefs;
417 /**
418 * Set of all header row definitions that can be used by this table. Populated by the rows
419 * gathered by using `ContentChildren` as well as any custom row definitions added to
420 * `_customHeaderRowDefs`.
421 */
422 private _headerRowDefs;
423 /**
424 * Set of all row definitions that can be used by this table. Populated by the rows gathered by
425 * using `ContentChildren` as well as any custom row definitions added to
426 * `_customFooterRowDefs`.
427 */
428 private _footerRowDefs;
429 /** Differ used to find the changes in the data provided by the data source. */
430 private _dataDiffer;
431 /** Stores the row definition that does not have a when predicate. */
432 private _defaultRowDef;
433 /**
434 * Column definitions that were defined outside of the direct content children of the table.
435 * These will be defined when, e.g., creating a wrapper around the cdkTable that has
436 * column definitions as *its* content child.
437 */
438 private _customColumnDefs;
439 /**
440 * Data row definitions that were defined outside of the direct content children of the table.
441 * These will be defined when, e.g., creating a wrapper around the cdkTable that has
442 * built-in data rows as *its* content child.
443 */
444 private _customRowDefs;
445 /**
446 * Header row definitions that were defined outside of the direct content children of the table.
447 * These will be defined when, e.g., creating a wrapper around the cdkTable that has
448 * built-in header rows as *its* content child.
449 */
450 private _customHeaderRowDefs;
451 /**
452 * Footer row definitions that were defined outside of the direct content children of the table.
453 * These will be defined when, e.g., creating a wrapper around the cdkTable that has a
454 * built-in footer row as *its* content child.
455 */
456 private _customFooterRowDefs;
457 /** No data row that was defined outside of the direct content children of the table. */
458 private _customNoDataRow;
459 /**
460 * Whether the header row definition has been changed. Triggers an update to the header row after
461 * content is checked. Initialized as true so that the table renders the initial set of rows.
462 */
463 private _headerRowDefChanged;
464 /**
465 * Whether the footer row definition has been changed. Triggers an update to the footer row after
466 * content is checked. Initialized as true so that the table renders the initial set of rows.
467 */
468 private _footerRowDefChanged;
469 /**
470 * Whether the sticky column styles need to be updated. Set to `true` when the visible columns
471 * change.
472 */
473 private _stickyColumnStylesNeedReset;
474 /**
475 * Whether the sticky styler should recalculate cell widths when applying sticky styles. If
476 * `false`, cached values will be used instead. This is only applicable to tables with
477 * {@link fixedLayout} enabled. For other tables, cell widths will always be recalculated.
478 */
479 private _forceRecalculateCellWidths;
480 /**
481 * Cache of the latest rendered `RenderRow` objects as a map for easy retrieval when constructing
482 * a new list of `RenderRow` objects for rendering rows. Since the new list is constructed with
483 * the cached `RenderRow` objects when possible, the row identity is preserved when the data
484 * and row template matches, which allows the `IterableDiffer` to check rows by reference
485 * and understand which rows are added/moved/removed.
486 *
487 * Implemented as a map of maps where the first key is the `data: T` object and the second is the
488 * `CdkRowDef<T>` object. With the two keys, the cache points to a `RenderRow<T>` object that
489 * contains an array of created pairs. The array is necessary to handle cases where the data
490 * array contains multiple duplicate data objects and each instantiated `RenderRow` must be
491 * stored.
492 */
493 private _cachedRenderRowsMap;
494 /** Whether the table is applied to a native `<table>`. */
495 protected _isNativeHtmlTable: boolean;
496 /**
497 * Utility class that is responsible for applying the appropriate sticky positioning styles to
498 * the table's rows and cells.
499 */
500 private _stickyStyler;
501 /**
502 * CSS class added to any row or cell that has sticky positioning applied. May be overridden by
503 * table subclasses.
504 */
505 protected stickyCssClass: string;
506 /**
507 * Whether to manually add position: sticky to all sticky cell elements. Not needed if
508 * the position is set in a selector associated with the value of stickyCssClass. May be
509 * overridden by table subclasses
510 */
511 protected needsPositionStickyOnElement: boolean;
512 /** Whether the no data row is currently showing anything. */
513 private _isShowingNoDataRow;
514 /**
515 * Tracking function that will be used to check the differences in data changes. Used similarly
516 * to `ngFor` `trackBy` function. Optimize row operations by identifying a row based on its data
517 * relative to the function to know if a row should be added/removed/moved.
518 * Accepts a function that takes two parameters, `index` and `item`.
519 */
520 get trackBy(): TrackByFunction<T>;
521 set trackBy(fn: TrackByFunction<T>);
522 private _trackByFn;
523 /**
524 * The table's source of data, which can be provided in three ways (in order of complexity):
525 * - Simple data array (each object represents one table row)
526 * - Stream that emits a data array each time the array changes
527 * - `DataSource` object that implements the connect/disconnect interface.
528 *
529 * If a data array is provided, the table must be notified when the array's objects are
530 * added, removed, or moved. This can be done by calling the `renderRows()` function which will
531 * render the diff since the last table render. If the data array reference is changed, the table
532 * will automatically trigger an update to the rows.
533 *
534 * When providing an Observable stream, the table will trigger an update automatically when the
535 * stream emits a new array of data.
536 *
537 * Finally, when providing a `DataSource` object, the table will use the Observable stream
538 * provided by the connect function and trigger updates when that stream emits new data array
539 * values. During the table's ngOnDestroy or when the data source is removed from the table, the
540 * table will call the DataSource's `disconnect` function (may be useful for cleaning up any
541 * subscriptions registered during the connect process).
542 */
543 get dataSource(): CdkTableDataSourceInput<T>;
544 set dataSource(dataSource: CdkTableDataSourceInput<T>);
545 private _dataSource;
546 /**
547 * Whether to allow multiple rows per data object by evaluating which rows evaluate their 'when'
548 * predicate to true. If `multiTemplateDataRows` is false, which is the default value, then each
549 * dataobject will render the first row that evaluates its when predicate to true, in the order
550 * defined in the table, or otherwise the default row which does not have a when predicate.
551 */
552 get multiTemplateDataRows(): boolean;
553 set multiTemplateDataRows(v: BooleanInput);
554 _multiTemplateDataRows: boolean;
555 /**
556 * Whether to use a fixed table layout. Enabling this option will enforce consistent column widths
557 * and optimize rendering sticky styles for native tables. No-op for flex tables.
558 */
559 get fixedLayout(): boolean;
560 set fixedLayout(v: BooleanInput);
561 private _fixedLayout;
562 /**
563 * Emits when the table completes rendering a set of data rows based on the latest data from the
564 * data source, even if the set of rows is empty.
565 */
566 readonly contentChanged: EventEmitter<void>;
567 /**
568 * Stream containing the latest information on what rows are being displayed on screen.
569 * Can be used by the data source to as a heuristic of what data should be provided.
570 *
571 * @docs-private
572 */
573 readonly viewChange: BehaviorSubject<{
574 start: number;
575 end: number;
576 }>;
577 _rowOutlet: DataRowOutlet;
578 _headerRowOutlet: HeaderRowOutlet;
579 _footerRowOutlet: FooterRowOutlet;
580 _noDataRowOutlet: NoDataRowOutlet;
581 /**
582 * The column definitions provided by the user that contain what the header, data, and footer
583 * cells should render for each column.
584 */
585 _contentColumnDefs: QueryList<CdkColumnDef>;
586 /** Set of data row definitions that were provided to the table as content children. */
587 _contentRowDefs: QueryList<CdkRowDef<T>>;
588 /** Set of header row definitions that were provided to the table as content children. */
589 _contentHeaderRowDefs: QueryList<CdkHeaderRowDef>;
590 /** Set of footer row definitions that were provided to the table as content children. */
591 _contentFooterRowDefs: QueryList<CdkFooterRowDef>;
592 /** Row definition that will only be rendered if there's no data in the table. */
593 _noDataRow: CdkNoDataRow;
594 constructor(_differs: IterableDiffers, _changeDetectorRef: ChangeDetectorRef, _elementRef: ElementRef, role: string, _dir: Directionality, _document: any, _platform: Platform, _viewRepeater: _ViewRepeater<T, RenderRow<T>, RowContext<T>>, _coalescedStyleScheduler: _CoalescedStyleScheduler, _viewportRuler: ViewportRuler,
595 /**
596 * @deprecated `_stickyPositioningListener` parameter to become required.
597 * @breaking-change 13.0.0
598 */
599 _stickyPositioningListener: StickyPositioningListener,
600 /**
601 * @deprecated `_ngZone` parameter to become required.
602 * @breaking-change 14.0.0
603 */
604 _ngZone?: NgZone | undefined);
605 ngOnInit(): void;
606 ngAfterContentChecked(): void;
607 ngOnDestroy(): void;
608 /**
609 * Renders rows based on the table's latest set of data, which was either provided directly as an
610 * input or retrieved through an Observable stream (directly or from a DataSource).
611 * Checks for differences in the data since the last diff to perform only the necessary
612 * changes (add/remove/move rows).
613 *
614 * If the table's data source is a DataSource or Observable, this will be invoked automatically
615 * each time the provided Observable stream emits a new data array. Otherwise if your data is
616 * an array, this function will need to be called to render any changes.
617 */
618 renderRows(): void;
619 /** Adds a column definition that was not included as part of the content children. */
620 addColumnDef(columnDef: CdkColumnDef): void;
621 /** Removes a column definition that was not included as part of the content children. */
622 removeColumnDef(columnDef: CdkColumnDef): void;
623 /** Adds a row definition that was not included as part of the content children. */
624 addRowDef(rowDef: CdkRowDef<T>): void;
625 /** Removes a row definition that was not included as part of the content children. */
626 removeRowDef(rowDef: CdkRowDef<T>): void;
627 /** Adds a header row definition that was not included as part of the content children. */
628 addHeaderRowDef(headerRowDef: CdkHeaderRowDef): void;
629 /** Removes a header row definition that was not included as part of the content children. */
630 removeHeaderRowDef(headerRowDef: CdkHeaderRowDef): void;
631 /** Adds a footer row definition that was not included as part of the content children. */
632 addFooterRowDef(footerRowDef: CdkFooterRowDef): void;
633 /** Removes a footer row definition that was not included as part of the content children. */
634 removeFooterRowDef(footerRowDef: CdkFooterRowDef): void;
635 /** Sets a no data row definition that was not included as a part of the content children. */
636 setNoDataRow(noDataRow: CdkNoDataRow | null): void;
637 /**
638 * Updates the header sticky styles. First resets all applied styles with respect to the cells
639 * sticking to the top. Then, evaluating which cells need to be stuck to the top. This is
640 * automatically called when the header row changes its displayed set of columns, or if its
641 * sticky input changes. May be called manually for cases where the cell content changes outside
642 * of these events.
643 */
644 updateStickyHeaderRowStyles(): void;
645 /**
646 * Updates the footer sticky styles. First resets all applied styles with respect to the cells
647 * sticking to the bottom. Then, evaluating which cells need to be stuck to the bottom. This is
648 * automatically called when the footer row changes its displayed set of columns, or if its
649 * sticky input changes. May be called manually for cases where the cell content changes outside
650 * of these events.
651 */
652 updateStickyFooterRowStyles(): void;
653 /**
654 * Updates the column sticky styles. First resets all applied styles with respect to the cells
655 * sticking to the left and right. Then sticky styles are added for the left and right according
656 * to the column definitions for each cell in each row. This is automatically called when
657 * the data source provides a new set of data or when a column definition changes its sticky
658 * input. May be called manually for cases where the cell content changes outside of these events.
659 */
660 updateStickyColumnStyles(): void;
661 /**
662 * Get the list of RenderRow objects to render according to the current list of data and defined
663 * row definitions. If the previous list already contained a particular pair, it should be reused
664 * so that the differ equates their references.
665 */
666 private _getAllRenderRows;
667 /**
668 * Gets a list of `RenderRow<T>` for the provided data object and any `CdkRowDef` objects that
669 * should be rendered for this data. Reuses the cached RenderRow objects if they match the same
670 * `(T, CdkRowDef)` pair.
671 */
672 private _getRenderRowsForData;
673 /** Update the map containing the content's column definitions. */
674 private _cacheColumnDefs;
675 /** Update the list of all available row definitions that can be used. */
676 private _cacheRowDefs;
677 /**
678 * Check if the header, data, or footer rows have changed what columns they want to display or
679 * whether the sticky states have changed for the header or footer. If there is a diff, then
680 * re-render that section.
681 */
682 private _renderUpdatedColumns;
683 /**
684 * Switch to the provided data source by resetting the data and unsubscribing from the current
685 * render change subscription if one exists. If the data source is null, interpret this by
686 * clearing the row outlet. Otherwise start listening for new data.
687 */
688 private _switchDataSource;
689 /** Set up a subscription for the data provided by the data source. */
690 private _observeRenderChanges;
691 /**
692 * Clears any existing content in the header row outlet and creates a new embedded view
693 * in the outlet using the header row definition.
694 */
695 private _forceRenderHeaderRows;
696 /**
697 * Clears any existing content in the footer row outlet and creates a new embedded view
698 * in the outlet using the footer row definition.
699 */
700 private _forceRenderFooterRows;
701 /** Adds the sticky column styles for the rows according to the columns' stick states. */
702 private _addStickyColumnStyles;
703 /** Gets the list of rows that have been rendered in the row outlet. */
704 _getRenderedRows(rowOutlet: RowOutlet): HTMLElement[];
705 /**
706 * Get the matching row definitions that should be used for this row data. If there is only
707 * one row definition, it is returned. Otherwise, find the row definitions that has a when
708 * predicate that returns true with the data. If none return true, return the default row
709 * definition.
710 */
711 _getRowDefs(data: T, dataIndex: number): CdkRowDef<T>[];
712 private _getEmbeddedViewArgs;
713 /**
714 * Creates a new row template in the outlet and fills it with the set of cell templates.
715 * Optionally takes a context to provide to the row and cells, as well as an optional index
716 * of where to place the new row template in the outlet.
717 */
718 private _renderRow;
719 private _renderCellTemplateForItem;
720 /**
721 * Updates the index-related context for each row to reflect any changes in the index of the rows,
722 * e.g. first/last/even/odd.
723 */
724 private _updateRowIndexContext;
725 /** Gets the column definitions for the provided row def. */
726 private _getCellTemplates;
727 /** Adds native table sections (e.g. tbody) and moves the row outlets into them. */
728 private _applyNativeTableSections;
729 /**
730 * Forces a re-render of the data rows. Should be called in cases where there has been an input
731 * change that affects the evaluation of which rows should be rendered, e.g. toggling
732 * `multiTemplateDataRows` or adding/removing row definitions.
733 */
734 private _forceRenderDataRows;
735 /**
736 * Checks if there has been a change in sticky states since last check and applies the correct
737 * sticky styles. Since checking resets the "dirty" state, this should only be performed once
738 * during a change detection and after the inputs are settled (after content check).
739 */
740 private _checkStickyStates;
741 /**
742 * Creates the sticky styler that will be used for sticky rows and columns. Listens
743 * for directionality changes and provides the latest direction to the styler. Re-applies column
744 * stickiness when directionality changes.
745 */
746 private _setupStickyStyler;
747 /** Filters definitions that belong to this table from a QueryList. */
748 private _getOwnDefs;
749 /** Creates or removes the no data row, depending on whether any data is being shown. */
750 private _updateNoDataRow;
751 static ɵfac: i0.ɵɵFactoryDeclaration<CdkTable<any>, [null, null, null, { attribute: "role"; }, { optional: true; }, null, null, null, null, null, { optional: true; skipSelf: true; }, { optional: true; }]>;
752 static ɵcmp: i0.ɵɵComponentDeclaration<CdkTable<any>, "cdk-table, table[cdk-table]", ["cdkTable"], { "trackBy": { "alias": "trackBy"; "required": false; }; "dataSource": { "alias": "dataSource"; "required": false; }; "multiTemplateDataRows": { "alias": "multiTemplateDataRows"; "required": false; }; "fixedLayout": { "alias": "fixedLayout"; "required": false; }; }, { "contentChanged": "contentChanged"; }, ["_noDataRow", "_contentColumnDefs", "_contentRowDefs", "_contentHeaderRowDefs", "_contentFooterRowDefs"], ["caption", "colgroup, col"], false, never>;
753}
754
755/** Possible types that can be set as the data source for a `CdkTable`. */
756export declare type CdkTableDataSourceInput<T> = readonly T[] | DataSource<T> | Observable<readonly T[]>;
757
758export declare class CdkTableModule {
759 static ɵfac: i0.ɵɵFactoryDeclaration<CdkTableModule, never>;
760 static ɵmod: i0.ɵɵNgModuleDeclaration<CdkTableModule, [typeof i1.CdkTable, typeof i2.CdkRowDef, typeof i3.CdkCellDef, typeof i2.CdkCellOutlet, typeof i3.CdkHeaderCellDef, typeof i3.CdkFooterCellDef, typeof i3.CdkColumnDef, typeof i3.CdkCell, typeof i2.CdkRow, typeof i3.CdkHeaderCell, typeof i3.CdkFooterCell, typeof i2.CdkHeaderRow, typeof i2.CdkHeaderRowDef, typeof i2.CdkFooterRow, typeof i2.CdkFooterRowDef, typeof i1.DataRowOutlet, typeof i1.HeaderRowOutlet, typeof i1.FooterRowOutlet, typeof i4.CdkTextColumn, typeof i2.CdkNoDataRow, typeof i1.CdkRecycleRows, typeof i1.NoDataRowOutlet], [typeof i5.ScrollingModule], [typeof i1.CdkTable, typeof i2.CdkRowDef, typeof i3.CdkCellDef, typeof i2.CdkCellOutlet, typeof i3.CdkHeaderCellDef, typeof i3.CdkFooterCellDef, typeof i3.CdkColumnDef, typeof i3.CdkCell, typeof i2.CdkRow, typeof i3.CdkHeaderCell, typeof i3.CdkFooterCell, typeof i2.CdkHeaderRow, typeof i2.CdkHeaderRowDef, typeof i2.CdkFooterRow, typeof i2.CdkFooterRowDef, typeof i1.DataRowOutlet, typeof i1.HeaderRowOutlet, typeof i1.FooterRowOutlet, typeof i4.CdkTextColumn, typeof i2.CdkNoDataRow, typeof i1.CdkRecycleRows, typeof i1.NoDataRowOutlet]>;
761 static ɵinj: i0.ɵɵInjectorDeclaration<CdkTableModule>;
762}
763
764/**
765 * Column that simply shows text content for the header and row cells. Assumes that the table
766 * is using the native table implementation (`<table>`).
767 *
768 * By default, the name of this column will be the header text and data property accessor.
769 * The header text can be overridden with the `headerText` input. Cell values can be overridden with
770 * the `dataAccessor` input. Change the text justification to the start or end using the `justify`
771 * input.
772 */
773export declare class CdkTextColumn<T> implements OnDestroy, OnInit {
774 private _table;
775 private _options;
776 /** Column name that should be used to reference this column. */
777 get name(): string;
778 set name(name: string);
779 _name: string;
780 /**
781 * Text label that should be used for the column header. If this property is not
782 * set, the header text will default to the column name with its first letter capitalized.
783 */
784 headerText: string;
785 /**
786 * Accessor function to retrieve the data rendered for each cell. If this
787 * property is not set, the data cells will render the value found in the data's property matching
788 * the column's name. For example, if the column is named `id`, then the rendered value will be
789 * value defined by the data's `id` property.
790 */
791 dataAccessor: (data: T, name: string) => string;
792 /** Alignment of the cell values. */
793 justify: 'start' | 'end' | 'center';
794 /** @docs-private */
795 columnDef: CdkColumnDef;
796 /**
797 * The column cell is provided to the column during `ngOnInit` with a static query.
798 * Normally, this will be retrieved by the column using `ContentChild`, but that assumes the
799 * column definition was provided in the same view as the table, which is not the case with this
800 * component.
801 * @docs-private
802 */
803 cell: CdkCellDef;
804 /**
805 * The column headerCell is provided to the column during `ngOnInit` with a static query.
806 * Normally, this will be retrieved by the column using `ContentChild`, but that assumes the
807 * column definition was provided in the same view as the table, which is not the case with this
808 * component.
809 * @docs-private
810 */
811 headerCell: CdkHeaderCellDef;
812 constructor(_table: CdkTable<T>, _options: TextColumnOptions<T>);
813 ngOnInit(): void;
814 ngOnDestroy(): void;
815 /**
816 * Creates a default header text. Use the options' header text transformation function if one
817 * has been provided. Otherwise simply capitalize the column name.
818 */
819 _createDefaultHeaderText(): string;
820 /** Synchronizes the column definition name with the text column name. */
821 private _syncColumnDefName;
822 static ɵfac: i0.ɵɵFactoryDeclaration<CdkTextColumn<any>, [{ optional: true; }, { optional: true; }]>;
823 static ɵcmp: i0.ɵɵComponentDeclaration<CdkTextColumn<any>, "cdk-text-column", never, { "name": { "alias": "name"; "required": false; }; "headerText": { "alias": "headerText"; "required": false; }; "dataAccessor": { "alias": "dataAccessor"; "required": false; }; "justify": { "alias": "justify"; "required": false; }; }, {}, never, never, false, never>;
824}
825
826/** Base interface for a cell definition. Captures a column's cell template definition. */
827export declare interface CellDef {
828 template: TemplateRef<any>;
829}
830
831/** Injection token used to provide a coalesced style scheduler. */
832export declare const _COALESCED_STYLE_SCHEDULER: InjectionToken<_CoalescedStyleScheduler>;
833
834/**
835 * Allows grouping up CSSDom mutations after the current execution context.
836 * This can significantly improve performance when separate consecutive functions are
837 * reading from the CSSDom and then mutating it.
838 *
839 * @docs-private
840 */
841export declare class _CoalescedStyleScheduler implements OnDestroy {
842 private readonly _ngZone;
843 private _currentSchedule;
844 private readonly _destroyed;
845 constructor(_ngZone: NgZone);
846 /**
847 * Schedules the specified task to run at the end of the current VM turn.
848 */
849 schedule(task: () => unknown): void;
850 /**
851 * Schedules the specified task to run after other scheduled tasks at the end of the current
852 * VM turn.
853 */
854 scheduleEnd(task: () => unknown): void;
855 /** Prevent any further tasks from running. */
856 ngOnDestroy(): void;
857 private _createScheduleIfNeeded;
858 private _getScheduleObservable;
859 static ɵfac: i0.ɵɵFactoryDeclaration<_CoalescedStyleScheduler, never>;
860 static ɵprov: i0.ɵɵInjectableDeclaration<_CoalescedStyleScheduler>;
861}
862
863
864/** @docs-private */
865export declare type Constructor<T> = new (...args: any[]) => T;
866
867/**
868 * Provides a handle for the table to grab the view container's ng-container to insert data rows.
869 * @docs-private
870 */
871export declare class DataRowOutlet implements RowOutlet {
872 viewContainer: ViewContainerRef;
873 elementRef: ElementRef;
874 constructor(viewContainer: ViewContainerRef, elementRef: ElementRef);
875 static ɵfac: i0.ɵɵFactoryDeclaration<DataRowOutlet, never>;
876 static ɵdir: i0.ɵɵDirectiveDeclaration<DataRowOutlet, "[rowOutlet]", never, {}, {}, never, never, false, never>;
877}
878
879export { DataSource }
880
881/**
882 * Provides a handle for the table to grab the view container's ng-container to insert the footer.
883 * @docs-private
884 */
885export declare class FooterRowOutlet implements RowOutlet {
886 viewContainer: ViewContainerRef;
887 elementRef: ElementRef;
888 constructor(viewContainer: ViewContainerRef, elementRef: ElementRef);
889 static ɵfac: i0.ɵɵFactoryDeclaration<FooterRowOutlet, never>;
890 static ɵdir: i0.ɵɵDirectiveDeclaration<FooterRowOutlet, "[footerRowOutlet]", never, {}, {}, never, never, false, never>;
891}
892
893/**
894 * Provides a handle for the table to grab the view container's ng-container to insert the header.
895 * @docs-private
896 */
897export declare class HeaderRowOutlet implements RowOutlet {
898 viewContainer: ViewContainerRef;
899 elementRef: ElementRef;
900 constructor(viewContainer: ViewContainerRef, elementRef: ElementRef);
901 static ɵfac: i0.ɵɵFactoryDeclaration<HeaderRowOutlet, never>;
902 static ɵdir: i0.ɵɵDirectiveDeclaration<HeaderRowOutlet, "[headerRowOutlet]", never, {}, {}, never, never, false, never>;
903}
904
905declare namespace i1 {
906 export {
907 CdkRecycleRows,
908 RowOutlet,
909 CdkTableDataSourceInput,
910 DataRowOutlet,
911 HeaderRowOutlet,
912 FooterRowOutlet,
913 NoDataRowOutlet,
914 CDK_TABLE_TEMPLATE,
915 RowContext,
916 RenderRow,
917 CdkTable
918 }
919}
920
921declare namespace i2 {
922 export {
923 CDK_ROW_TEMPLATE,
924 BaseRowDef,
925 CdkHeaderRowDef,
926 CdkFooterRowDef,
927 CdkRowDef,
928 CdkCellOutletRowContext,
929 CdkCellOutletMultiRowContext,
930 CdkCellOutlet,
931 CdkHeaderRow,
932 CdkFooterRow,
933 CdkRow,
934 CdkNoDataRow
935 }
936}
937
938declare namespace i3 {
939 export {
940 CellDef,
941 CdkCellDef,
942 CdkHeaderCellDef,
943 CdkFooterCellDef,
944 CdkColumnDef,
945 BaseCdkCell,
946 CdkHeaderCell,
947 CdkFooterCell,
948 CdkCell
949 }
950}
951
952declare namespace i4 {
953 export {
954 CdkTextColumn
955 }
956}
957
958/**
959 * Mixin to provide a directive with a function that checks if the sticky input has been
960 * changed since the last time the function was called. Essentially adds a dirty-check to the
961 * sticky value.
962 * @docs-private
963 */
964export declare function mixinHasStickyInput<T extends Constructor<{}>>(base: T): CanStickCtor & T;
965
966/**
967 * Provides a handle for the table to grab the view
968 * container's ng-container to insert the no data row.
969 * @docs-private
970 */
971export declare class NoDataRowOutlet implements RowOutlet {
972 viewContainer: ViewContainerRef;
973 elementRef: ElementRef;
974 constructor(viewContainer: ViewContainerRef, elementRef: ElementRef);
975 static ɵfac: i0.ɵɵFactoryDeclaration<NoDataRowOutlet, never>;
976 static ɵdir: i0.ɵɵDirectiveDeclaration<NoDataRowOutlet, "[noDataRowOutlet]", never, {}, {}, never, never, false, never>;
977}
978
979/**
980 * Set of properties that represents the identity of a single rendered row.
981 *
982 * When the table needs to determine the list of rows to render, it will do so by iterating through
983 * each data object and evaluating its list of row templates to display (when multiTemplateDataRows
984 * is false, there is only one template per data object). For each pair of data object and row
985 * template, a `RenderRow` is added to the list of rows to render. If the data object and row
986 * template pair has already been rendered, the previously used `RenderRow` is added; else a new
987 * `RenderRow` is * created. Once the list is complete and all data objects have been iterated
988 * through, a diff is performed to determine the changes that need to be made to the rendered rows.
989 *
990 * @docs-private
991 */
992export declare interface RenderRow<T> {
993 data: T;
994 dataIndex: number;
995 rowDef: CdkRowDef<T>;
996}
997
998/**
999 * Interface used to conveniently type the possible context interfaces for the render row.
1000 * @docs-private
1001 */
1002export declare interface RowContext<T> extends CdkCellOutletMultiRowContext<T>, CdkCellOutletRowContext<T> {
1003}
1004
1005/** Interface used to provide an outlet for rows to be inserted into. */
1006export declare interface RowOutlet {
1007 viewContainer: ViewContainerRef;
1008}
1009
1010/**
1011 * @docs-private
1012 */
1013export declare class _Schedule {
1014 tasks: (() => unknown)[];
1015 endTasks: (() => unknown)[];
1016}
1017
1018/**
1019 * List of all possible directions that can be used for sticky positioning.
1020 * @docs-private
1021 */
1022export declare const STICKY_DIRECTIONS: StickyDirection[];
1023
1024/** The injection token used to specify the StickyPositioningListener. */
1025export declare const STICKY_POSITIONING_LISTENER: InjectionToken<StickyPositioningListener>;
1026
1027export declare type StickyDirection = 'top' | 'bottom' | 'left' | 'right';
1028
1029export declare type StickyOffset = number | null | undefined;
1030
1031/**
1032 * If provided, CdkTable will call the methods below when it updates the size/
1033 * position/etc of its sticky rows and columns.
1034 */
1035export declare interface StickyPositioningListener {
1036 /** Called when CdkTable updates its sticky start columns. */
1037 stickyColumnsUpdated(update: StickyUpdate): void;
1038 /** Called when CdkTable updates its sticky end columns. */
1039 stickyEndColumnsUpdated(update: StickyUpdate): void;
1040 /** Called when CdkTable updates its sticky header rows. */
1041 stickyHeaderRowsUpdated(update: StickyUpdate): void;
1042 /** Called when CdkTable updates its sticky footer rows. */
1043 stickyFooterRowsUpdated(update: StickyUpdate): void;
1044}
1045
1046export declare type StickySize = number | null | undefined;
1047
1048/**
1049 * Applies and removes sticky positioning styles to the `CdkTable` rows and columns cells.
1050 * @docs-private
1051 */
1052export declare class StickyStyler {
1053 private _isNativeHtmlTable;
1054 private _stickCellCss;
1055 direction: Direction;
1056 private _coalescedStyleScheduler;
1057 private _isBrowser;
1058 private readonly _needsPositionStickyOnElement;
1059 private readonly _positionListener?;
1060 private _cachedCellWidths;
1061 private readonly _borderCellCss;
1062 /**
1063 * @param _isNativeHtmlTable Whether the sticky logic should be based on a table
1064 * that uses the native `<table>` element.
1065 * @param _stickCellCss The CSS class that will be applied to every row/cell that has
1066 * sticky positioning applied.
1067 * @param direction The directionality context of the table (ltr/rtl); affects column positioning
1068 * by reversing left/right positions.
1069 * @param _isBrowser Whether the table is currently being rendered on the server or the client.
1070 * @param _needsPositionStickyOnElement Whether we need to specify position: sticky on cells
1071 * using inline styles. If false, it is assumed that position: sticky is included in
1072 * the component stylesheet for _stickCellCss.
1073 * @param _positionListener A listener that is notified of changes to sticky rows/columns
1074 * and their dimensions.
1075 */
1076 constructor(_isNativeHtmlTable: boolean, _stickCellCss: string, direction: Direction, _coalescedStyleScheduler: _CoalescedStyleScheduler, _isBrowser?: boolean, _needsPositionStickyOnElement?: boolean, _positionListener?: StickyPositioningListener | undefined);
1077 /**
1078 * Clears the sticky positioning styles from the row and its cells by resetting the `position`
1079 * style, setting the zIndex to 0, and unsetting each provided sticky direction.
1080 * @param rows The list of rows that should be cleared from sticking in the provided directions
1081 * @param stickyDirections The directions that should no longer be set as sticky on the rows.
1082 */
1083 clearStickyPositioning(rows: HTMLElement[], stickyDirections: StickyDirection[]): void;
1084 /**
1085 * Applies sticky left and right positions to the cells of each row according to the sticky
1086 * states of the rendered column definitions.
1087 * @param rows The rows that should have its set of cells stuck according to the sticky states.
1088 * @param stickyStartStates A list of boolean states where each state represents whether the cell
1089 * in this index position should be stuck to the start of the row.
1090 * @param stickyEndStates A list of boolean states where each state represents whether the cell
1091 * in this index position should be stuck to the end of the row.
1092 * @param recalculateCellWidths Whether the sticky styler should recalculate the width of each
1093 * column cell. If `false` cached widths will be used instead.
1094 */
1095 updateStickyColumns(rows: HTMLElement[], stickyStartStates: boolean[], stickyEndStates: boolean[], recalculateCellWidths?: boolean): void;
1096 /**
1097 * Applies sticky positioning to the row's cells if using the native table layout, and to the
1098 * row itself otherwise.
1099 * @param rowsToStick The list of rows that should be stuck according to their corresponding
1100 * sticky state and to the provided top or bottom position.
1101 * @param stickyStates A list of boolean states where each state represents whether the row
1102 * should be stuck in the particular top or bottom position.
1103 * @param position The position direction in which the row should be stuck if that row should be
1104 * sticky.
1105 *
1106 */
1107 stickRows(rowsToStick: HTMLElement[], stickyStates: boolean[], position: 'top' | 'bottom'): void;
1108 /**
1109 * When using the native table in Safari, sticky footer cells do not stick. The only way to stick
1110 * footer rows is to apply sticky styling to the tfoot container. This should only be done if
1111 * all footer rows are sticky. If not all footer rows are sticky, remove sticky positioning from
1112 * the tfoot element.
1113 */
1114 updateStickyFooterContainer(tableElement: Element, stickyStates: boolean[]): void;
1115 /**
1116 * Removes the sticky style on the element by removing the sticky cell CSS class, re-evaluating
1117 * the zIndex, removing each of the provided sticky directions, and removing the
1118 * sticky position if there are no more directions.
1119 */
1120 _removeStickyStyle(element: HTMLElement, stickyDirections: StickyDirection[]): void;
1121 /**
1122 * Adds the sticky styling to the element by adding the sticky style class, changing position
1123 * to be sticky (and -webkit-sticky), setting the appropriate zIndex, and adding a sticky
1124 * direction and value.
1125 */
1126 _addStickyStyle(element: HTMLElement, dir: StickyDirection, dirValue: number, isBorderElement: boolean): void;
1127 /**
1128 * Calculate what the z-index should be for the element, depending on what directions (top,
1129 * bottom, left, right) have been set. It should be true that elements with a top direction
1130 * should have the highest index since these are elements like a table header. If any of those
1131 * elements are also sticky in another direction, then they should appear above other elements
1132 * that are only sticky top (e.g. a sticky column on a sticky header). Bottom-sticky elements
1133 * (e.g. footer rows) should then be next in the ordering such that they are below the header
1134 * but above any non-sticky elements. Finally, left/right sticky elements (e.g. sticky columns)
1135 * should minimally increment so that they are above non-sticky elements but below top and bottom
1136 * elements.
1137 */
1138 _getCalculatedZIndex(element: HTMLElement): string;
1139 /** Gets the widths for each cell in the provided row. */
1140 _getCellWidths(row: HTMLElement, recalculateCellWidths?: boolean): number[];
1141 /**
1142 * Determines the left and right positions of each sticky column cell, which will be the
1143 * accumulation of all sticky column cell widths to the left and right, respectively.
1144 * Non-sticky cells do not need to have a value set since their positions will not be applied.
1145 */
1146 _getStickyStartColumnPositions(widths: number[], stickyStates: boolean[]): number[];
1147 /**
1148 * Determines the left and right positions of each sticky column cell, which will be the
1149 * accumulation of all sticky column cell widths to the left and right, respectively.
1150 * Non-sticky cells do not need to have a value set since their positions will not be applied.
1151 */
1152 _getStickyEndColumnPositions(widths: number[], stickyStates: boolean[]): number[];
1153}
1154
1155export declare interface StickyUpdate {
1156 elements?: readonly (HTMLElement[] | undefined)[];
1157 offsets?: StickyOffset[];
1158 sizes: StickySize[];
1159}
1160
1161/** Injection token that can be used to specify the text column options. */
1162export declare const TEXT_COLUMN_OPTIONS: InjectionToken<TextColumnOptions<any>>;
1163
1164/** Configurable options for `CdkTextColumn`. */
1165export declare interface TextColumnOptions<T> {
1166 /**
1167 * Default function that provides the header text based on the column name if a header
1168 * text is not provided.
1169 */
1170 defaultHeaderTextTransform?: (name: string) => string;
1171 /** Default data accessor to use if one is not provided. */
1172 defaultDataAccessor?: (data: T, name: string) => string;
1173}
1174
1175export { }