index.d.ts 56 KB

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