blob: 6651984b460bd804c30ccb257fa6717fbad8360b [file] [log] [blame]
{"version":3,"file":"cdk-table.umd.min.js","sources":["../../node_modules/tslib/tslib.es6.js","../../src/cdk/table/can-stick.ts","../../src/cdk/table/table-errors.ts","../../src/cdk/table/cell.ts","../../src/cdk/table/row.ts","../../src/cdk/table/sticky-styler.ts","../../src/cdk/table/table.ts","../../src/cdk/table/text-column.ts","../../src/cdk/table/table-module.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\n\n/** @docs-private */\nexport type Constructor<T> = new(...args: any[]) => T;\n\n/**\n * Interface for a mixin to provide a directive with a function that checks if the sticky input has\n * been changed since the last time the function was called. Essentially adds a dirty-check to the\n * sticky value.\n * @docs-private\n */\nexport interface CanStick {\n /** Whether sticky positioning should be applied. */\n sticky: boolean;\n\n /** Whether the sticky input has changed since it was last checked. */\n _hasStickyChanged: boolean;\n\n /** Whether the sticky value has changed since this was last called. */\n hasStickyChanged(): boolean;\n\n /** Resets the dirty check for cases where the sticky state has been used without checking. */\n resetStickyChanged(): void;\n}\n\n/** @docs-private */\nexport type CanStickCtor = Constructor<CanStick>;\n\n/**\n * Mixin to provide a directive with a function that checks if the sticky input has been\n * changed since the last time the function was called. Essentially adds a dirty-check to the\n * sticky value.\n * @docs-private\n */\nexport function mixinHasStickyInput<T extends Constructor<{}>>(base: T): CanStickCtor & T {\n return class extends base {\n /** Whether sticky positioning should be applied. */\n get sticky(): boolean { return this._sticky; }\n set sticky(v: boolean) {\n const prevValue = this._sticky;\n this._sticky = coerceBooleanProperty(v);\n this._hasStickyChanged = prevValue !== this._sticky;\n }\n _sticky: boolean = false;\n\n /** Whether the sticky input has changed since it was last checked. */\n _hasStickyChanged: boolean = false;\n\n /** Whether the sticky value has changed since this was last called. */\n hasStickyChanged(): boolean {\n const hasStickyChanged = this._hasStickyChanged;\n this._hasStickyChanged = false;\n return hasStickyChanged;\n }\n\n /** Resets the dirty check for cases where the sticky state has been used without checking. */\n resetStickyChanged() {\n this._hasStickyChanged = false;\n }\n\n constructor(...args: any[]) { super(...args); }\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Returns an error to be thrown when attempting to find an unexisting column.\n * @param id Id whose lookup failed.\n * @docs-private\n */\nexport function getTableUnknownColumnError(id: string) {\n return Error(`Could not find column with id \"${id}\".`);\n}\n\n/**\n * Returns an error to be thrown when two column definitions have the same name.\n * @docs-private\n */\nexport function getTableDuplicateColumnNameError(name: string) {\n return Error(`Duplicate column definition name provided: \"${name}\".`);\n}\n\n/**\n * Returns an error to be thrown when there are multiple rows that are missing a when function.\n * @docs-private\n */\nexport function getTableMultipleDefaultRowDefsError() {\n return Error(`There can only be one default row without a when predicate function.`);\n}\n\n/**\n * Returns an error to be thrown when there are no matching row defs for a particular set of data.\n * @docs-private\n */\nexport function getTableMissingMatchingRowDefError(data: any) {\n return Error(`Could not find a matching row definition for the` +\n `provided row data: ${JSON.stringify(data)}`);\n}\n\n/**\n * Returns an error to be thrown when there is no row definitions present in the content.\n * @docs-private\n */\nexport function getTableMissingRowDefsError() {\n return Error('Missing definitions for header, footer, and row; ' +\n 'cannot determine which columns should be rendered.');\n}\n\n/**\n * Returns an error to be thrown when the data source does not match the compatible types.\n * @docs-private\n */\nexport function getTableUnknownDataSourceError() {\n return Error(`Provided data source did not match an array, Observable, or DataSource`);\n}\n\n/**\n * Returns an error to be thrown when the text column cannot find a parent table to inject.\n * @docs-private\n */\nexport function getTableTextColumnMissingParentTableError() {\n return Error(`Text column could not find a parent table for registration.`);\n}\n\n/**\n * Returns an error to be thrown when a table text column doesn't have a name.\n * @docs-private\n */\nexport function getTableTextColumnMissingNameError() {\n return Error(`Table text column must have a name.`);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {ContentChild, Directive, ElementRef, Input, TemplateRef} from '@angular/core';\nimport {CanStick, CanStickCtor, mixinHasStickyInput} from './can-stick';\n\n\n/** Base interface for a cell definition. Captures a column's cell template definition. */\nexport interface CellDef {\n template: TemplateRef<any>;\n}\n\n/**\n * Cell definition for a CDK table.\n * Captures the template of a column's data row cell as well as cell-specific properties.\n */\n@Directive({selector: '[cdkCellDef]'})\nexport class CdkCellDef implements CellDef {\n constructor(/** @docs-private */ public template: TemplateRef<any>) {}\n}\n\n/**\n * Header cell definition for a CDK table.\n * Captures the template of a column's header cell and as well as cell-specific properties.\n */\n@Directive({selector: '[cdkHeaderCellDef]'})\nexport class CdkHeaderCellDef implements CellDef {\n constructor(/** @docs-private */ public template: TemplateRef<any>) {}\n}\n\n/**\n * Footer cell definition for a CDK table.\n * Captures the template of a column's footer cell and as well as cell-specific properties.\n */\n@Directive({selector: '[cdkFooterCellDef]'})\nexport class CdkFooterCellDef implements CellDef {\n constructor(/** @docs-private */ public template: TemplateRef<any>) {}\n}\n\n// Boilerplate for applying mixins to CdkColumnDef.\n/** @docs-private */\nclass CdkColumnDefBase {}\nconst _CdkColumnDefBase: CanStickCtor&typeof CdkColumnDefBase =\n mixinHasStickyInput(CdkColumnDefBase);\n\n/**\n * Column definition for the CDK table.\n * Defines a set of cells available for a table column.\n */\n@Directive({\n selector: '[cdkColumnDef]',\n inputs: ['sticky'],\n providers: [{provide: 'MAT_SORT_HEADER_COLUMN_DEF', useExisting: CdkColumnDef}],\n})\nexport class CdkColumnDef extends _CdkColumnDefBase implements CanStick {\n /** Unique name for this column. */\n @Input('cdkColumnDef')\n get name(): string {\n return this._name;\n }\n set name(name: string) {\n // If the directive is set without a name (updated programatically), then this setter will\n // trigger with an empty string and should not overwrite the programatically set value.\n if (!name) {\n return;\n }\n\n this._name = name;\n this.cssClassFriendlyName = name.replace(/[^a-z0-9_-]/ig, '-');\n }\n _name: string;\n\n /**\n * Whether this column should be sticky positioned on the end of the row. Should make sure\n * that it mimics the `CanStick` mixin such that `_hasStickyChanged` is set to true if the value\n * has been changed.\n */\n @Input('stickyEnd')\n get stickyEnd(): boolean {\n return this._stickyEnd;\n }\n set stickyEnd(v: boolean) {\n const prevValue = this._stickyEnd;\n this._stickyEnd = coerceBooleanProperty(v);\n this._hasStickyChanged = prevValue !== this._stickyEnd;\n }\n _stickyEnd: boolean = false;\n\n /** @docs-private */\n @ContentChild(CdkCellDef, {static: false}) cell: CdkCellDef;\n\n /** @docs-private */\n @ContentChild(CdkHeaderCellDef, {static: false}) headerCell: CdkHeaderCellDef;\n\n /** @docs-private */\n @ContentChild(CdkFooterCellDef, {static: false}) footerCell: CdkFooterCellDef;\n\n /**\n * Transformed version of the column name that can be used as part of a CSS classname. Excludes\n * all non-alphanumeric characters and the special characters '-' and '_'. Any characters that\n * do not match are replaced by the '-' character.\n */\n cssClassFriendlyName: string;\n}\n\n/** Base class for the cells. Adds a CSS classname that identifies the column it renders in. */\nexport class BaseCdkCell {\n constructor(columnDef: CdkColumnDef, elementRef: ElementRef) {\n const columnClassName = `cdk-column-${columnDef.cssClassFriendlyName}`;\n elementRef.nativeElement.classList.add(columnClassName);\n }\n}\n\n/** Header cell template container that adds the right classes and role. */\n@Directive({\n selector: 'cdk-header-cell, th[cdk-header-cell]',\n host: {\n 'class': 'cdk-header-cell',\n 'role': 'columnheader',\n },\n})\nexport class CdkHeaderCell extends BaseCdkCell {\n constructor(columnDef: CdkColumnDef, elementRef: ElementRef) {\n super(columnDef, elementRef);\n }\n}\n\n/** Footer cell template container that adds the right classes and role. */\n@Directive({\n selector: 'cdk-footer-cell, td[cdk-footer-cell]',\n host: {\n 'class': 'cdk-footer-cell',\n 'role': 'gridcell',\n },\n})\nexport class CdkFooterCell extends BaseCdkCell {\n constructor(columnDef: CdkColumnDef, elementRef: ElementRef) {\n super(columnDef, elementRef);\n }\n}\n\n/** Cell template container that adds the right classes and role. */\n@Directive({\n selector: 'cdk-cell, td[cdk-cell]',\n host: {\n 'class': 'cdk-cell',\n 'role': 'gridcell',\n },\n})\nexport class CdkCell extends BaseCdkCell {\n constructor(columnDef: CdkColumnDef, elementRef: ElementRef) {\n super(columnDef, elementRef);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n ChangeDetectionStrategy,\n Component,\n Directive,\n IterableChanges,\n IterableDiffer,\n IterableDiffers,\n OnChanges,\n OnDestroy,\n SimpleChanges,\n TemplateRef,\n ViewContainerRef,\n ViewEncapsulation\n} from '@angular/core';\nimport {CanStick, CanStickCtor, mixinHasStickyInput} from './can-stick';\nimport {CdkCellDef, CdkColumnDef} from './cell';\n\n/**\n * The row template that can be used by the mat-table. Should not be used outside of the\n * material library.\n */\nexport const CDK_ROW_TEMPLATE = `<ng-container cdkCellOutlet></ng-container>`;\n\n/**\n * Base class for the CdkHeaderRowDef and CdkRowDef that handles checking their columns inputs\n * for changes and notifying the table.\n */\nexport abstract class BaseRowDef implements OnChanges {\n /** The columns to be displayed on this row. */\n columns: Iterable<string>;\n\n /** Differ used to check if any changes were made to the columns. */\n protected _columnsDiffer: IterableDiffer<any>;\n\n constructor(\n /** @docs-private */ public template: TemplateRef<any>, protected _differs: IterableDiffers) {\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n // Create a new columns differ if one does not yet exist. Initialize it based on initial value\n // of the columns property or an empty array if none is provided.\n if (!this._columnsDiffer) {\n const columns = (changes['columns'] && changes['columns'].currentValue) || [];\n this._columnsDiffer = this._differs.find(columns).create();\n this._columnsDiffer.diff(columns);\n }\n }\n\n /**\n * Returns the difference between the current columns and the columns from the last diff, or null\n * if there is no difference.\n */\n getColumnsDiff(): IterableChanges<any>|null {\n return this._columnsDiffer.diff(this.columns);\n }\n\n /** Gets this row def's relevant cell template from the provided column def. */\n extractCellTemplate(column: CdkColumnDef): TemplateRef<any> {\n if (this instanceof CdkHeaderRowDef) {\n return column.headerCell.template;\n }\n if (this instanceof CdkFooterRowDef) {\n return column.footerCell.template;\n } else {\n return column.cell.template;\n }\n }\n}\n\n// Boilerplate for applying mixins to CdkHeaderRowDef.\n/** @docs-private */\nclass CdkHeaderRowDefBase extends BaseRowDef {}\nconst _CdkHeaderRowDefBase: CanStickCtor&typeof CdkHeaderRowDefBase =\n mixinHasStickyInput(CdkHeaderRowDefBase);\n\n/**\n * Header row definition for the CDK table.\n * Captures the header row's template and other header properties such as the columns to display.\n */\n@Directive({\n selector: '[cdkHeaderRowDef]',\n inputs: ['columns: cdkHeaderRowDef', 'sticky: cdkHeaderRowDefSticky'],\n})\nexport class CdkHeaderRowDef extends _CdkHeaderRowDefBase implements CanStick, OnChanges {\n constructor(template: TemplateRef<any>, _differs: IterableDiffers) {\n super(template, _differs);\n }\n\n // Prerender fails to recognize that ngOnChanges in a part of this class through inheritance.\n // Explicitly define it so that the method is called as part of the Angular lifecycle.\n ngOnChanges(changes: SimpleChanges): void {\n super.ngOnChanges(changes);\n }\n}\n\n// Boilerplate for applying mixins to CdkFooterRowDef.\n/** @docs-private */\nclass CdkFooterRowDefBase extends BaseRowDef {}\nconst _CdkFooterRowDefBase: CanStickCtor&typeof CdkFooterRowDefBase =\n mixinHasStickyInput(CdkFooterRowDefBase);\n\n/**\n * Footer row definition for the CDK table.\n * Captures the footer row's template and other footer properties such as the columns to display.\n */\n@Directive({\n selector: '[cdkFooterRowDef]',\n inputs: ['columns: cdkFooterRowDef', 'sticky: cdkFooterRowDefSticky'],\n})\nexport class CdkFooterRowDef extends _CdkFooterRowDefBase implements CanStick, OnChanges {\n constructor(template: TemplateRef<any>, _differs: IterableDiffers) {\n super(template, _differs);\n }\n\n // Prerender fails to recognize that ngOnChanges in a part of this class through inheritance.\n // Explicitly define it so that the method is called as part of the Angular lifecycle.\n ngOnChanges(changes: SimpleChanges): void {\n super.ngOnChanges(changes);\n }\n}\n\n/**\n * Data row definition for the CDK table.\n * Captures the header row's template and other row properties such as the columns to display and\n * a when predicate that describes when this row should be used.\n */\n@Directive({\n selector: '[cdkRowDef]',\n inputs: ['columns: cdkRowDefColumns', 'when: cdkRowDefWhen'],\n})\nexport class CdkRowDef<T> extends BaseRowDef {\n /**\n * Function that should return true if this row template should be used for the provided index\n * and row data. If left undefined, this row will be considered the default row template to use\n * when no other when functions return true for the data.\n * For every row, there must be at least one when function that passes or an undefined to default.\n */\n when: (index: number, rowData: T) => boolean;\n\n // TODO(andrewseguin): Add an input for providing a switch function to determine\n // if this template should be used.\n constructor(template: TemplateRef<any>, _differs: IterableDiffers) {\n super(template, _differs);\n }\n}\n\n/** Context provided to the row cells when `multiTemplateDataRows` is false */\nexport interface CdkCellOutletRowContext<T> {\n /** Data for the row that this cell is located within. */\n $implicit?: T;\n\n /** Index of the data object in the provided data array. */\n index?: number;\n\n /** Length of the number of total rows. */\n count?: number;\n\n /** True if this cell is contained in the first row. */\n first?: boolean;\n\n /** True if this cell is contained in the last row. */\n last?: boolean;\n\n /** True if this cell is contained in a row with an even-numbered index. */\n even?: boolean;\n\n /** True if this cell is contained in a row with an odd-numbered index. */\n odd?: boolean;\n}\n\n/**\n * Context provided to the row cells when `multiTemplateDataRows` is true. This context is the same\n * as CdkCellOutletRowContext except that the single `index` value is replaced by `dataIndex` and\n * `renderIndex`.\n */\nexport interface CdkCellOutletMultiRowContext<T> {\n /** Data for the row that this cell is located within. */\n $implicit?: T;\n\n /** Index of the data object in the provided data array. */\n dataIndex?: number;\n\n /** Index location of the rendered row that this cell is located within. */\n renderIndex?: number;\n\n /** Length of the number of total rows. */\n count?: number;\n\n /** True if this cell is contained in the first row. */\n first?: boolean;\n\n /** True if this cell is contained in the last row. */\n last?: boolean;\n\n /** True if this cell is contained in a row with an even-numbered index. */\n even?: boolean;\n\n /** True if this cell is contained in a row with an odd-numbered index. */\n odd?: boolean;\n}\n\n/**\n * Outlet for rendering cells inside of a row or header row.\n * @docs-private\n */\n@Directive({selector: '[cdkCellOutlet]'})\nexport class CdkCellOutlet implements OnDestroy {\n /** The ordered list of cells to render within this outlet's view container */\n cells: CdkCellDef[];\n\n /** The data context to be provided to each cell */\n context: any;\n\n /**\n * Static property containing the latest constructed instance of this class.\n * Used by the CDK table when each CdkHeaderRow and CdkRow component is created using\n * createEmbeddedView. After one of these components are created, this property will provide\n * a handle to provide that component's cells and context. After init, the CdkCellOutlet will\n * construct the cells with the provided context.\n */\n static mostRecentCellOutlet: CdkCellOutlet|null = null;\n\n constructor(public _viewContainer: ViewContainerRef) {\n CdkCellOutlet.mostRecentCellOutlet = this;\n }\n\n ngOnDestroy() {\n // If this was the last outlet being rendered in the view, remove the reference\n // from the static property after it has been destroyed to avoid leaking memory.\n if (CdkCellOutlet.mostRecentCellOutlet === this) {\n CdkCellOutlet.mostRecentCellOutlet = null;\n }\n }\n}\n\n/** Header template container that contains the cell outlet. Adds the right class and role. */\n@Component({\n moduleId: module.id,\n selector: 'cdk-header-row, tr[cdk-header-row]',\n template: CDK_ROW_TEMPLATE,\n host: {\n 'class': 'cdk-header-row',\n 'role': 'row',\n },\n // See note on CdkTable for explanation on why this uses the default change detection strategy.\n // tslint:disable-next-line:validate-decorators\n changeDetection: ChangeDetectionStrategy.Default,\n encapsulation: ViewEncapsulation.None,\n})\nexport class CdkHeaderRow {\n}\n\n\n/** Footer template container that contains the cell outlet. Adds the right class and role. */\n@Component({\n moduleId: module.id,\n selector: 'cdk-footer-row, tr[cdk-footer-row]',\n template: CDK_ROW_TEMPLATE,\n host: {\n 'class': 'cdk-footer-row',\n 'role': 'row',\n },\n // See note on CdkTable for explanation on why this uses the default change detection strategy.\n // tslint:disable-next-line:validate-decorators\n changeDetection: ChangeDetectionStrategy.Default,\n encapsulation: ViewEncapsulation.None,\n})\nexport class CdkFooterRow {\n}\n\n/** Data row template container that contains the cell outlet. Adds the right class and role. */\n@Component({\n moduleId: module.id,\n selector: 'cdk-row, tr[cdk-row]',\n template: CDK_ROW_TEMPLATE,\n host: {\n 'class': 'cdk-row',\n 'role': 'row',\n },\n // See note on CdkTable for explanation on why this uses the default change detection strategy.\n // tslint:disable-next-line:validate-decorators\n changeDetection: ChangeDetectionStrategy.Default,\n encapsulation: ViewEncapsulation.None,\n})\nexport class CdkRow {\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Directions that can be used when setting sticky positioning.\n * @docs-private\n */\nimport {Direction} from '@angular/cdk/bidi';\n\nexport type StickyDirection = 'top' | 'bottom' | 'left' | 'right';\n\n/**\n * List of all possible directions that can be used for sticky positioning.\n * @docs-private\n */\nexport const STICKY_DIRECTIONS: StickyDirection[] = ['top', 'bottom', 'left', 'right'];\n\n/**\n * Applies and removes sticky positioning styles to the `CdkTable` rows and columns cells.\n * @docs-private\n */\nexport class StickyStyler {\n /**\n * @param _isNativeHtmlTable Whether the sticky logic should be based on a table\n * that uses the native `<table>` element.\n * @param _stickCellCss The CSS class that will be applied to every row/cell that has\n * sticky positioning applied.\n * @param direction The directionality context of the table (ltr/rtl); affects column positioning\n * by reversing left/right positions.\n * @param _isBrowser Whether the table is currently being rendered on the server or the client.\n */\n constructor(private _isNativeHtmlTable: boolean,\n private _stickCellCss: string,\n public direction: Direction,\n private _isBrowser = true) { }\n\n /**\n * Clears the sticky positioning styles from the row and its cells by resetting the `position`\n * style, setting the zIndex to 0, and unsetting each provided sticky direction.\n * @param rows The list of rows that should be cleared from sticking in the provided directions\n * @param stickyDirections The directions that should no longer be set as sticky on the rows.\n */\n clearStickyPositioning(rows: HTMLElement[], stickyDirections: StickyDirection[]) {\n for (const row of rows) {\n // If the row isn't an element (e.g. if it's an `ng-container`),\n // it won't have inline styles or `children` so we skip it.\n if (row.nodeType !== row.ELEMENT_NODE) {\n continue;\n }\n\n this._removeStickyStyle(row, stickyDirections);\n\n for (let i = 0; i < row.children.length; i++) {\n const cell = row.children[i] as HTMLElement;\n this._removeStickyStyle(cell, stickyDirections);\n }\n }\n }\n\n /**\n * Applies sticky left and right positions to the cells of each row according to the sticky\n * states of the rendered column definitions.\n * @param rows The rows that should have its set of cells stuck according to the sticky states.\n * @param stickyStartStates A list of boolean states where each state represents whether the cell\n * in this index position should be stuck to the start of the row.\n * @param stickyEndStates A list of boolean states where each state represents whether the cell\n * in this index position should be stuck to the end of the row.\n */\n updateStickyColumns(\n rows: HTMLElement[], stickyStartStates: boolean[], stickyEndStates: boolean[]) {\n const hasStickyColumns =\n stickyStartStates.some(state => state) || stickyEndStates.some(state => state);\n if (!rows.length || !hasStickyColumns || !this._isBrowser) {\n return;\n }\n\n const firstRow = rows[0];\n const numCells = firstRow.children.length;\n const cellWidths: number[] = this._getCellWidths(firstRow);\n\n const startPositions = this._getStickyStartColumnPositions(cellWidths, stickyStartStates);\n const endPositions = this._getStickyEndColumnPositions(cellWidths, stickyEndStates);\n const isRtl = this.direction === 'rtl';\n\n for (const row of rows) {\n for (let i = 0; i < numCells; i++) {\n const cell = row.children[i] as HTMLElement;\n if (stickyStartStates[i]) {\n this._addStickyStyle(cell, isRtl ? 'right' : 'left', startPositions[i]);\n }\n\n if (stickyEndStates[i]) {\n this._addStickyStyle(cell, isRtl ? 'left' : 'right', endPositions[i]);\n }\n }\n }\n }\n\n /**\n * Applies sticky positioning to the row's cells if using the native table layout, and to the\n * row itself otherwise.\n * @param rowsToStick The list of rows that should be stuck according to their corresponding\n * sticky state and to the provided top or bottom position.\n * @param stickyStates A list of boolean states where each state represents whether the row\n * should be stuck in the particular top or bottom position.\n * @param position The position direction in which the row should be stuck if that row should be\n * sticky.\n *\n */\n stickRows(rowsToStick: HTMLElement[], stickyStates: boolean[], position: 'top' | 'bottom') {\n // Since we can't measure the rows on the server, we can't stick the rows properly.\n if (!this._isBrowser) {\n return;\n }\n\n // If positioning the rows to the bottom, reverse their order when evaluating the sticky\n // position such that the last row stuck will be \"bottom: 0px\" and so on.\n const rows = position === 'bottom' ? rowsToStick.reverse() : rowsToStick;\n\n let stickyHeight = 0;\n for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) {\n if (!stickyStates[rowIndex]) {\n continue;\n }\n\n const row = rows[rowIndex];\n if (this._isNativeHtmlTable) {\n for (let j = 0; j < row.children.length; j++) {\n const cell = row.children[j] as HTMLElement;\n this._addStickyStyle(cell, position, stickyHeight);\n }\n } else {\n // Flex does not respect the stick positioning on the cells, needs to be applied to the row.\n // If this is applied on a native table, Safari causes the header to fly in wrong direction.\n this._addStickyStyle(row, position, stickyHeight);\n }\n\n if (rowIndex === rows.length - 1) {\n // prevent unnecessary reflow from getBoundingClientRect()\n return;\n }\n stickyHeight += row.getBoundingClientRect().height;\n }\n }\n\n /**\n * When using the native table in Safari, sticky footer cells do not stick. The only way to stick\n * footer rows is to apply sticky styling to the tfoot container. This should only be done if\n * all footer rows are sticky. If not all footer rows are sticky, remove sticky positioning from\n * the tfoot element.\n */\n updateStickyFooterContainer(tableElement: Element, stickyStates: boolean[]) {\n if (!this._isNativeHtmlTable) {\n return;\n }\n\n const tfoot = tableElement.querySelector('tfoot')!;\n if (stickyStates.some(state => !state)) {\n this._removeStickyStyle(tfoot, ['bottom']);\n } else {\n this._addStickyStyle(tfoot, 'bottom', 0);\n }\n }\n\n /**\n * Removes the sticky style on the element by removing the sticky cell CSS class, re-evaluating\n * the zIndex, removing each of the provided sticky directions, and removing the\n * sticky position if there are no more directions.\n */\n _removeStickyStyle(element: HTMLElement, stickyDirections: StickyDirection[]) {\n for (const dir of stickyDirections) {\n element.style[dir] = '';\n }\n element.style.zIndex = this._getCalculatedZIndex(element);\n\n // If the element no longer has any more sticky directions, remove sticky positioning and\n // the sticky CSS class.\n const hasDirection = STICKY_DIRECTIONS.some(dir => !!element.style[dir]);\n if (!hasDirection) {\n element.style.position = '';\n element.classList.remove(this._stickCellCss);\n }\n }\n\n /**\n * Adds the sticky styling to the element by adding the sticky style class, changing position\n * to be sticky (and -webkit-sticky), setting the appropriate zIndex, and adding a sticky\n * direction and value.\n */\n _addStickyStyle(element: HTMLElement, dir: StickyDirection, dirValue: number) {\n element.classList.add(this._stickCellCss);\n element.style[dir] = `${dirValue}px`;\n element.style.cssText += 'position: -webkit-sticky; position: sticky; ';\n element.style.zIndex = this._getCalculatedZIndex(element);\n }\n\n /**\n * Calculate what the z-index should be for the element, depending on what directions (top,\n * bottom, left, right) have been set. It should be true that elements with a top direction\n * should have the highest index since these are elements like a table header. If any of those\n * elements are also sticky in another direction, then they should appear above other elements\n * that are only sticky top (e.g. a sticky column on a sticky header). Bottom-sticky elements\n * (e.g. footer rows) should then be next in the ordering such that they are below the header\n * but above any non-sticky elements. Finally, left/right sticky elements (e.g. sticky columns)\n * should minimally increment so that they are above non-sticky elements but below top and bottom\n * elements.\n */\n _getCalculatedZIndex(element: HTMLElement): string {\n const zIndexIncrements = {\n top: 100,\n bottom: 10,\n left: 1,\n right: 1,\n };\n\n let zIndex = 0;\n for (const dir of STICKY_DIRECTIONS) {\n if (element.style[dir]) {\n zIndex += zIndexIncrements[dir];\n }\n }\n\n return zIndex ? `${zIndex}` : '';\n }\n\n /** Gets the widths for each cell in the provided row. */\n _getCellWidths(row: HTMLElement): number[] {\n const cellWidths: number[] = [];\n const firstRowCells = row.children;\n for (let i = 0; i < firstRowCells.length; i++) {\n let cell: HTMLElement = firstRowCells[i] as HTMLElement;\n cellWidths.push(cell.getBoundingClientRect().width);\n }\n\n return cellWidths;\n }\n\n /**\n * Determines the left and right positions of each sticky column cell, which will be the\n * accumulation of all sticky column cell widths to the left and right, respectively.\n * Non-sticky cells do not need to have a value set since their positions will not be applied.\n */\n _getStickyStartColumnPositions(widths: number[], stickyStates: boolean[]): number[] {\n const positions: number[] = [];\n let nextPosition = 0;\n\n for (let i = 0; i < widths.length; i++) {\n if (stickyStates[i]) {\n positions[i] = nextPosition;\n nextPosition += widths[i];\n }\n }\n\n return positions;\n }\n\n /**\n * Determines the left and right positions of each sticky column cell, which will be the\n * accumulation of all sticky column cell widths to the left and right, respectively.\n * Non-sticky cells do not need to have a value set since their positions will not be applied.\n */\n _getStickyEndColumnPositions(widths: number[], stickyStates: boolean[]): number[] {\n const positions: number[] = [];\n let nextPosition = 0;\n\n for (let i = widths.length; i > 0; i--) {\n if (stickyStates[i]) {\n positions[i] = nextPosition;\n nextPosition += widths[i];\n }\n }\n\n return positions;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Direction, Directionality} from '@angular/cdk/bidi';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {CollectionViewer, DataSource, isDataSource} from '@angular/cdk/collections';\nimport {Platform} from '@angular/cdk/platform';\nimport {DOCUMENT} from '@angular/common';\nimport {\n AfterContentChecked,\n Attribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n Directive,\n ElementRef,\n EmbeddedViewRef,\n Inject,\n Input,\n isDevMode,\n IterableChangeRecord,\n IterableDiffer,\n IterableDiffers,\n OnDestroy,\n OnInit,\n Optional,\n QueryList,\n TemplateRef,\n TrackByFunction,\n ViewChild,\n ViewContainerRef,\n ViewEncapsulation\n} from '@angular/core';\nimport {BehaviorSubject, Observable, of as observableOf, Subject, Subscription} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\nimport {CdkColumnDef} from './cell';\nimport {\n BaseRowDef,\n CdkCellOutlet,\n CdkCellOutletMultiRowContext,\n CdkCellOutletRowContext,\n CdkFooterRowDef,\n CdkHeaderRowDef,\n CdkRowDef\n} from './row';\nimport {StickyStyler} from './sticky-styler';\nimport {\n getTableDuplicateColumnNameError,\n getTableMissingMatchingRowDefError,\n getTableMissingRowDefsError,\n getTableMultipleDefaultRowDefsError,\n getTableUnknownColumnError,\n getTableUnknownDataSourceError\n} from './table-errors';\n\n/** Interface used to provide an outlet for rows to be inserted into. */\nexport interface RowOutlet {\n viewContainer: ViewContainerRef;\n}\n\n/**\n * Union of the types that can be set as the data source for a `CdkTable`.\n * @docs-private\n */\ntype CdkTableDataSourceInput<T> =\n DataSource<T>|Observable<ReadonlyArray<T>|T[]>|ReadonlyArray<T>|T[];\n\n/**\n * Provides a handle for the table to grab the view container's ng-container to insert data rows.\n * @docs-private\n */\n@Directive({selector: '[rowOutlet]'})\nexport class DataRowOutlet implements RowOutlet {\n constructor(public viewContainer: ViewContainerRef, public elementRef: ElementRef) {}\n}\n\n/**\n * Provides a handle for the table to grab the view container's ng-container to insert the header.\n * @docs-private\n */\n@Directive({selector: '[headerRowOutlet]'})\nexport class HeaderRowOutlet implements RowOutlet {\n constructor(public viewContainer: ViewContainerRef, public elementRef: ElementRef) {}\n}\n\n/**\n * Provides a handle for the table to grab the view container's ng-container to insert the footer.\n * @docs-private\n */\n@Directive({selector: '[footerRowOutlet]'})\nexport class FooterRowOutlet implements RowOutlet {\n constructor(public viewContainer: ViewContainerRef, public elementRef: ElementRef) {}\n}\n\n/**\n * The table template that can be used by the mat-table. Should not be used outside of the\n * material library.\n * @docs-private\n */\nexport const CDK_TABLE_TEMPLATE =\n // Note that according to MDN, the `caption` element has to be projected as the **first**\n // element in the table. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/caption\n `\n <ng-content select=\"caption\"></ng-content>\n <ng-container headerRowOutlet></ng-container>\n <ng-container rowOutlet></ng-container>\n <ng-container footerRowOutlet></ng-container>\n`;\n\n/**\n * Interface used to conveniently type the possible context interfaces for the render row.\n * @docs-private\n */\nexport interface RowContext<T> extends CdkCellOutletMultiRowContext<T>,\n CdkCellOutletRowContext<T> {}\n\n/**\n * Class used to conveniently type the embedded view ref for rows with a context.\n * @docs-private\n */\nabstract class RowViewRef<T> extends EmbeddedViewRef<RowContext<T>> {}\n\n/**\n * Set of properties that represents the identity of a single rendered row.\n *\n * When the table needs to determine the list of rows to render, it will do so by iterating through\n * each data object and evaluating its list of row templates to display (when multiTemplateDataRows\n * is false, there is only one template per data object). For each pair of data object and row\n * template, a `RenderRow` is added to the list of rows to render. If the data object and row\n * template pair has already been rendered, the previously used `RenderRow` is added; else a new\n * `RenderRow` is * created. Once the list is complete and all data objects have been itereated\n * through, a diff is performed to determine the changes that need to be made to the rendered rows.\n *\n * @docs-private\n */\nexport interface RenderRow<T> {\n data: T;\n dataIndex: number;\n rowDef: CdkRowDef<T>;\n}\n\n/**\n * A data table that can render a header row, data rows, and a footer row.\n * Uses the dataSource input to determine the data to be rendered. The data can be provided either\n * as a data array, an Observable stream that emits the data array to render, or a DataSource with a\n * connect function that will return an Observable stream that emits the data array to render.\n */\n@Component({\n moduleId: module.id,\n selector: 'cdk-table, table[cdk-table]',\n exportAs: 'cdkTable',\n template: CDK_TABLE_TEMPLATE,\n host: {\n 'class': 'cdk-table',\n },\n encapsulation: ViewEncapsulation.None,\n // The \"OnPush\" status for the `MatTable` component is effectively a noop, so we are removing it.\n // The view for `MatTable` consists entirely of templates declared in other views. As they are\n // declared elsewhere, they are checked when their declaration points are checked.\n // tslint:disable-next-line:validate-decorators\n changeDetection: ChangeDetectionStrategy.Default,\n})\nexport class CdkTable<T> implements AfterContentChecked, CollectionViewer, OnDestroy, OnInit {\n private _document: Document;\n\n /** Latest data provided by the data source. */\n protected _data: T[]|ReadonlyArray<T>;\n\n /** Subject that emits when the component has been destroyed. */\n private _onDestroy = new Subject<void>();\n\n /** List of the rendered rows as identified by their `RenderRow` object. */\n private _renderRows: RenderRow<T>[];\n\n /** Subscription that listens for the data provided by the data source. */\n private _renderChangeSubscription: Subscription|null;\n\n /**\n * Map of all the user's defined columns (header, data, and footer cell template) identified by\n * name. Collection populated by the column definitions gathered by `ContentChildren` as well as\n * any custom column definitions added to `_customColumnDefs`.\n */\n private _columnDefsByName = new Map<string, CdkColumnDef>();\n\n /**\n * Set of all row definitions that can be used by this table. Populated by the rows gathered by\n * using `ContentChildren` as well as any custom row definitions added to `_customRowDefs`.\n */\n private _rowDefs: CdkRowDef<T>[];\n\n /**\n * Set of all header row definitions that can be used by this table. Populated by the rows\n * gathered by using `ContentChildren` as well as any custom row definitions added to\n * `_customHeaderRowDefs`.\n */\n private _headerRowDefs: CdkHeaderRowDef[];\n\n /**\n * Set of all row definitions that can be used by this table. Populated by the rows gathered by\n * using `ContentChildren` as well as any custom row definitions added to\n * `_customFooterRowDefs`.\n */\n private _footerRowDefs: CdkFooterRowDef[];\n\n /** Differ used to find the changes in the data provided by the data source. */\n private _dataDiffer: IterableDiffer<RenderRow<T>>;\n\n /** Stores the row definition that does not have a when predicate. */\n private _defaultRowDef: CdkRowDef<T>|null;\n\n /**\n * Column definitions that were defined outside of the direct content children of the table.\n * These will be defined when, e.g., creating a wrapper around the cdkTable that has\n * column definitions as *it's* content child.\n */\n private _customColumnDefs = new Set<CdkColumnDef>();\n\n /**\n * Data row definitions that were defined outside of the direct content children of the table.\n * These will be defined when, e.g., creating a wrapper around the cdkTable that has\n * built-in data rows as *it's* content child.\n */\n private _customRowDefs = new Set<CdkRowDef<T>>();\n\n /**\n * Header row definitions that were defined outside of the direct content children of the table.\n * These will be defined when, e.g., creating a wrapper around the cdkTable that has\n * built-in header rows as *it's* content child.\n */\n private _customHeaderRowDefs = new Set<CdkHeaderRowDef>();\n\n /**\n * Footer row definitions that were defined outside of the direct content children of the table.\n * These will be defined when, e.g., creating a wrapper around the cdkTable that has a\n * built-in footer row as *it's* content child.\n */\n private _customFooterRowDefs = new Set<CdkFooterRowDef>();\n\n /**\n * Whether the header row definition has been changed. Triggers an update to the header row after\n * content is checked. Initialized as true so that the table renders the initial set of rows.\n */\n private _headerRowDefChanged = true;\n\n /**\n * Whether the footer row definition has been changed. Triggers an update to the footer row after\n * content is checked. Initialized as true so that the table renders the initial set of rows.\n */\n private _footerRowDefChanged = true;\n\n /**\n * Cache of the latest rendered `RenderRow` objects as a map for easy retrieval when constructing\n * a new list of `RenderRow` objects for rendering rows. Since the new list is constructed with\n * the cached `RenderRow` objects when possible, the row identity is preserved when the data\n * and row template matches, which allows the `IterableDiffer` to check rows by reference\n * and understand which rows are added/moved/removed.\n *\n * Implemented as a map of maps where the first key is the `data: T` object and the second is the\n * `CdkRowDef<T>` object. With the two keys, the cache points to a `RenderRow<T>` object that\n * contains an array of created pairs. The array is necessary to handle cases where the data\n * array contains multiple duplicate data objects and each instantiated `RenderRow` must be\n * stored.\n */\n private _cachedRenderRowsMap = new Map<T, WeakMap<CdkRowDef<T>, RenderRow<T>[]>>();\n\n /** Whether the table is applied to a native `<table>`. */\n private _isNativeHtmlTable: boolean;\n\n /**\n * Utility class that is responsible for applying the appropriate sticky positioning styles to\n * the table's rows and cells.\n */\n private _stickyStyler: StickyStyler;\n\n /**\n * CSS class added to any row or cell that has sticky positioning applied. May be overriden by\n * table subclasses.\n */\n protected stickyCssClass: string = 'cdk-table-sticky';\n\n /**\n * Tracking function that will be used to check the differences in data changes. Used similarly\n * to `ngFor` `trackBy` function. Optimize row operations by identifying a row based on its data\n * relative to the function to know if a row should be added/removed/moved.\n * Accepts a function that takes two parameters, `index` and `item`.\n */\n @Input()\n get trackBy(): TrackByFunction<T> {\n return this._trackByFn;\n }\n set trackBy(fn: TrackByFunction<T>) {\n if (isDevMode() && fn != null && typeof fn !== 'function' && <any>console &&\n <any>console.warn) {\n console.warn(`trackBy must be a function, but received ${JSON.stringify(fn)}.`);\n }\n this._trackByFn = fn;\n }\n private _trackByFn: TrackByFunction<T>;\n\n /**\n * The table's source of data, which can be provided in three ways (in order of complexity):\n * - Simple data array (each object represents one table row)\n * - Stream that emits a data array each time the array changes\n * - `DataSource` object that implements the connect/disconnect interface.\n *\n * If a data array is provided, the table must be notified when the array's objects are\n * added, removed, or moved. This can be done by calling the `renderRows()` function which will\n * render the diff since the last table render. If the data array reference is changed, the table\n * will automatically trigger an update to the rows.\n *\n * When providing an Observable stream, the table will trigger an update automatically when the\n * stream emits a new array of data.\n *\n * Finally, when providing a `DataSource` object, the table will use the Observable stream\n * provided by the connect function and trigger updates when that stream emits new data array\n * values. During the table's ngOnDestroy or when the data source is removed from the table, the\n * table will call the DataSource's `disconnect` function (may be useful for cleaning up any\n * subscriptions registered during the connect process).\n */\n @Input()\n get dataSource(): CdkTableDataSourceInput<T> {\n return this._dataSource;\n }\n set dataSource(dataSource: CdkTableDataSourceInput<T>) {\n if (this._dataSource !== dataSource) {\n this._switchDataSource(dataSource);\n }\n }\n private _dataSource: CdkTableDataSourceInput<T>;\n\n /**\n * Whether to allow multiple rows per data object by evaluating which rows evaluate their 'when'\n * predicate to true. If `multiTemplateDataRows` is false, which is the default value, then each\n * dataobject will render the first row that evaluates its when predicate to true, in the order\n * defined in the table, or otherwise the default row which does not have a when predicate.\n */\n @Input()\n get multiTemplateDataRows(): boolean {\n return this._multiTemplateDataRows;\n }\n set multiTemplateDataRows(v: boolean) {\n this._multiTemplateDataRows = coerceBooleanProperty(v);\n\n // In Ivy if this value is set via a static attribute (e.g. <table multiTemplateDataRows>),\n // this setter will be invoked before the row outlet has been defined hence the null check.\n if (this._rowOutlet && this._rowOutlet.viewContainer.length) {\n this._forceRenderDataRows();\n }\n }\n _multiTemplateDataRows: boolean = false;\n\n // TODO(andrewseguin): Remove max value as the end index\n // and instead calculate the view on init and scroll.\n /**\n * Stream containing the latest information on what rows are being displayed on screen.\n * Can be used by the data source to as a heuristic of what data should be provided.\n *\n * @docs-private\n */\n viewChange: BehaviorSubject<{start: number, end: number}> =\n new BehaviorSubject<{start: number, end: number}>({start: 0, end: Number.MAX_VALUE});\n\n // Outlets in the table's template where the header, data rows, and footer will be inserted.\n @ViewChild(DataRowOutlet, {static: true}) _rowOutlet: DataRowOutlet;\n @ViewChild(HeaderRowOutlet, {static: true}) _headerRowOutlet: HeaderRowOutlet;\n @ViewChild(FooterRowOutlet, {static: true}) _footerRowOutlet: FooterRowOutlet;\n\n /**\n * The column definitions provided by the user that contain what the header, data, and footer\n * cells should render for each column.\n */\n @ContentChildren(CdkColumnDef) _contentColumnDefs: QueryList<CdkColumnDef>;\n\n /** Set of data row definitions that were provided to the table as content children. */\n @ContentChildren(CdkRowDef) _contentRowDefs: QueryList<CdkRowDef<T>>;\n\n /** Set of header row definitions that were provided to the table as content children. */\n @ContentChildren(CdkHeaderRowDef) _contentHeaderRowDefs: QueryList<CdkHeaderRowDef>;\n\n /** Set of footer row definitions that were provided to the table as content children. */\n @ContentChildren(CdkFooterRowDef) _contentFooterRowDefs: QueryList<CdkFooterRowDef>;\n\n constructor(\n protected readonly _differs: IterableDiffers,\n protected readonly _changeDetectorRef: ChangeDetectorRef,\n protected readonly _elementRef: ElementRef, @Attribute('role') role: string,\n @Optional() protected readonly _dir: Directionality, @Inject(DOCUMENT) _document: any,\n private _platform: Platform) {\n if (!role) {\n this._elementRef.nativeElement.setAttribute('role', 'grid');\n }\n\n this._document = _document;\n this._isNativeHtmlTable = this._elementRef.nativeElement.nodeName === 'TABLE';\n }\n\n ngOnInit() {\n this._setupStickyStyler();\n\n if (this._isNativeHtmlTable) {\n this._applyNativeTableSections();\n }\n\n // Set up the trackBy function so that it uses the `RenderRow` as its identity by default. If\n // the user has provided a custom trackBy, return the result of that function as evaluated\n // with the values of the `RenderRow`'s data and index.\n this._dataDiffer = this._differs.find([]).create((_i: number, dataRow: RenderRow<T>) => {\n return this.trackBy ? this.trackBy(dataRow.dataIndex, dataRow.data) : dataRow;\n });\n }\n\n ngAfterContentChecked() {\n // Cache the row and column definitions gathered by ContentChildren and programmatic injection.\n this._cacheRowDefs();\n this._cacheColumnDefs();\n\n // Make sure that the user has at least added header, footer, or data row def.\n if (!this._headerRowDefs.length && !this._footerRowDefs.length && !this._rowDefs.length) {\n throw getTableMissingRowDefsError();\n }\n\n // Render updates if the list of columns have been changed for the header, row, or footer defs.\n this._renderUpdatedColumns();\n\n // If the header row definition has been changed, trigger a render to the header row.\n if (this._headerRowDefChanged) {\n this._forceRenderHeaderRows();\n this._headerRowDefChanged = false;\n }\n\n // If the footer row definition has been changed, trigger a render to the footer row.\n if (this._footerRowDefChanged) {\n this._forceRenderFooterRows();\n this._footerRowDefChanged = false;\n }\n\n // If there is a data source and row definitions, connect to the data source unless a\n // connection has already been made.\n if (this.dataSource && this._rowDefs.length > 0 && !this._renderChangeSubscription) {\n this._observeRenderChanges();\n }\n\n this._checkStickyStates();\n }\n\n ngOnDestroy() {\n this._rowOutlet.viewContainer.clear();\n this._headerRowOutlet.viewContainer.clear();\n this._footerRowOutlet.viewContainer.clear();\n\n this._cachedRenderRowsMap.clear();\n\n this._onDestroy.next();\n this._onDestroy.complete();\n\n if (isDataSource(this.dataSource)) {\n this.dataSource.disconnect(this);\n }\n }\n\n /**\n * Renders rows based on the table's latest set of data, which was either provided directly as an\n * input or retrieved through an Observable stream (directly or from a DataSource).\n * Checks for differences in the data since the last diff to perform only the necessary\n * changes (add/remove/move rows).\n *\n * If the table's data source is a DataSource or Observable, this will be invoked automatically\n * each time the provided Observable stream emits a new data array. Otherwise if your data is\n * an array, this function will need to be called to render any changes.\n */\n renderRows() {\n this._renderRows = this._getAllRenderRows();\n const changes = this._dataDiffer.diff(this._renderRows);\n if (!changes) {\n return;\n }\n\n const viewContainer = this._rowOutlet.viewContainer;\n\n changes.forEachOperation(\n (record: IterableChangeRecord<RenderRow<T>>, prevIndex: number|null,\n currentIndex: number|null) => {\n if (record.previousIndex == null) {\n this._insertRow(record.item, currentIndex!);\n } else if (currentIndex == null) {\n viewContainer.remove(prevIndex!);\n } else {\n const view = <RowViewRef<T>>viewContainer.get(prevIndex!);\n viewContainer.move(view!, currentIndex);\n }\n });\n\n // Update the meta context of a row's context data (index, count, first, last, ...)\n this._updateRowIndexContext();\n\n // Update rows that did not get added/removed/moved but may have had their identity changed,\n // e.g. if trackBy matched data on some property but the actual data reference changed.\n changes.forEachIdentityChange((record: IterableChangeRecord<RenderRow<T>>) => {\n const rowView = <RowViewRef<T>>viewContainer.get(record.currentIndex!);\n rowView.context.$implicit = record.item.data;\n });\n\n this.updateStickyColumnStyles();\n }\n\n /**\n * Sets the header row definition to be used. Overrides the header row definition gathered by\n * using `ContentChild`, if one exists. Sets a flag that will re-render the header row after the\n * table's content is checked.\n * @docs-private\n * @deprecated Use `addHeaderRowDef` and `removeHeaderRowDef` instead\n * @breaking-change 8.0.0\n */\n setHeaderRowDef(headerRowDef: CdkHeaderRowDef) {\n this._customHeaderRowDefs = new Set([headerRowDef]);\n this._headerRowDefChanged = true;\n }\n\n /**\n * Sets the footer row definition to be used. Overrides the footer row definition gathered by\n * using `ContentChild`, if one exists. Sets a flag that will re-render the footer row after the\n * table's content is checked.\n * @docs-private\n * @deprecated Use `addFooterRowDef` and `removeFooterRowDef` instead\n * @breaking-change 8.0.0\n */\n setFooterRowDef(footerRowDef: CdkFooterRowDef) {\n this._customFooterRowDefs = new Set([footerRowDef]);\n this._footerRowDefChanged = true;\n }\n\n /** Adds a column definition that was not included as part of the content children. */\n addColumnDef(columnDef: CdkColumnDef) {\n this._customColumnDefs.add(columnDef);\n }\n\n /** Removes a column definition that was not included as part of the content children. */\n removeColumnDef(columnDef: CdkColumnDef) {\n this._customColumnDefs.delete(columnDef);\n }\n\n /** Adds a row definition that was not included as part of the content children. */\n addRowDef(rowDef: CdkRowDef<T>) {\n this._customRowDefs.add(rowDef);\n }\n\n /** Removes a row definition that was not included as part of the content children. */\n removeRowDef(rowDef: CdkRowDef<T>) {\n this._customRowDefs.delete(rowDef);\n }\n\n /** Adds a header row definition that was not included as part of the content children. */\n addHeaderRowDef(headerRowDef: CdkHeaderRowDef) {\n this._customHeaderRowDefs.add(headerRowDef);\n this._headerRowDefChanged = true;\n }\n\n /** Removes a header row definition that was not included as part of the content children. */\n removeHeaderRowDef(headerRowDef: CdkHeaderRowDef) {\n this._customHeaderRowDefs.delete(headerRowDef);\n this._headerRowDefChanged = true;\n }\n\n /** Adds a footer row definition that was not included as part of the content children. */\n addFooterRowDef(footerRowDef: CdkFooterRowDef) {\n this._customFooterRowDefs.add(footerRowDef);\n this._footerRowDefChanged = true;\n }\n\n /** Removes a footer row definition that was not included as part of the content children. */\n removeFooterRowDef(footerRowDef: CdkFooterRowDef) {\n this._customFooterRowDefs.delete(footerRowDef);\n this._footerRowDefChanged = true;\n }\n\n /**\n * Updates the header sticky styles. First resets all applied styles with respect to the cells\n * sticking to the top. Then, evaluating which cells need to be stuck to the top. This is\n * automatically called when the header row changes its displayed set of columns, or if its\n * sticky input changes. May be called manually for cases where the cell content changes outside\n * of these events.\n */\n updateStickyHeaderRowStyles(): void {\n const headerRows = this._getRenderedRows(this._headerRowOutlet);\n const tableElement = this._elementRef.nativeElement as HTMLElement;\n\n // Hide the thead element if there are no header rows. This is necessary to satisfy\n // overzealous a11y checkers that fail because the `rowgroup` element does not contain\n // required child `row`.\n const thead = tableElement.querySelector('thead');\n if (thead) {\n thead.style.display = headerRows.length ? '' : 'none';\n }\n\n const stickyStates = this._headerRowDefs.map(def => def.sticky);\n this._stickyStyler.clearStickyPositioning(headerRows, ['top']);\n this._stickyStyler.stickRows(headerRows, stickyStates, 'top');\n\n // Reset the dirty state of the sticky input change since it has been used.\n this._headerRowDefs.forEach(def => def.resetStickyChanged());\n }\n\n /**\n * Updates the footer sticky styles. First resets all applied styles with respect to the cells\n * sticking to the bottom. Then, evaluating which cells need to be stuck to the bottom. This is\n * automatically called when the footer row changes its displayed set of columns, or if its\n * sticky input changes. May be called manually for cases where the cell content changes outside\n * of these events.\n */\n updateStickyFooterRowStyles(): void {\n const footerRows = this._getRenderedRows(this._footerRowOutlet);\n const tableElement = this._elementRef.nativeElement as HTMLElement;\n\n // Hide the tfoot element if there are no footer rows. This is necessary to satisfy\n // overzealous a11y checkers that fail because the `rowgroup` element does not contain\n // required child `row`.\n const tfoot = tableElement.querySelector('tfoot');\n if (tfoot) {\n tfoot.style.display = footerRows.length ? '' : 'none';\n }\n\n const stickyStates = this._footerRowDefs.map(def => def.sticky);\n this._stickyStyler.clearStickyPositioning(footerRows, ['bottom']);\n this._stickyStyler.stickRows(footerRows, stickyStates, 'bottom');\n this._stickyStyler.updateStickyFooterContainer(this._elementRef.nativeElement, stickyStates);\n\n // Reset the dirty state of the sticky input change since it has been used.\n this._footerRowDefs.forEach(def => def.resetStickyChanged());\n }\n\n /**\n * Updates the column sticky styles. First resets all applied styles with respect to the cells\n * sticking to the left and right. Then sticky styles are added for the left and right according\n * to the column definitions for each cell in each row. This is automatically called when\n * the data source provides a new set of data or when a column definition changes its sticky\n * input. May be called manually for cases where the cell content changes outside of these events.\n */\n updateStickyColumnStyles() {\n const headerRows = this._getRenderedRows(this._headerRowOutlet);\n const dataRows = this._getRenderedRows(this._rowOutlet);\n const footerRows = this._getRenderedRows(this._footerRowOutlet);\n\n // Clear the left and right positioning from all columns in the table across all rows since\n // sticky columns span across all table sections (header, data, footer)\n this._stickyStyler.clearStickyPositioning(\n [...headerRows, ...dataRows, ...footerRows], ['left', 'right']);\n\n // Update the sticky styles for each header row depending on the def's sticky state\n headerRows.forEach((headerRow, i) => {\n this._addStickyColumnStyles([headerRow], this._headerRowDefs[i]);\n });\n\n // Update the sticky styles for each data row depending on its def's sticky state\n this._rowDefs.forEach(rowDef => {\n // Collect all the rows rendered with this row definition.\n const rows: HTMLElement[] = [];\n for (let i = 0; i < dataRows.length; i++) {\n if (this._renderRows[i].rowDef === rowDef) {\n rows.push(dataRows[i]);\n }\n }\n\n this._addStickyColumnStyles(rows, rowDef);\n });\n\n // Update the sticky styles for each footer row depending on the def's sticky state\n footerRows.forEach((footerRow, i) => {\n this._addStickyColumnStyles([footerRow], this._footerRowDefs[i]);\n });\n\n // Reset the dirty state of the sticky input change since it has been used.\n Array.from(this._columnDefsByName.values()).forEach(def => def.resetStickyChanged());\n }\n\n /**\n * Get the list of RenderRow objects to render according to the current list of data and defined\n * row definitions. If the previous list already contained a particular pair, it should be reused\n * so that the differ equates their references.\n */\n private _getAllRenderRows(): RenderRow<T>[] {\n const renderRows: RenderRow<T>[] = [];\n\n // Store the cache and create a new one. Any re-used RenderRow objects will be moved into the\n // new cache while unused ones can be picked up by garbage collection.\n const prevCachedRenderRows = this._cachedRenderRowsMap;\n this._cachedRenderRowsMap = new Map();\n\n // For each data object, get the list of rows that should be rendered, represented by the\n // respective `RenderRow` object which is the pair of `data` and `CdkRowDef`.\n for (let i = 0; i < this._data.length; i++) {\n let data = this._data[i];\n const renderRowsForData = this._getRenderRowsForData(data, i, prevCachedRenderRows.get(data));\n\n if (!this._cachedRenderRowsMap.has(data)) {\n this._cachedRenderRowsMap.set(data, new WeakMap());\n }\n\n for (let j = 0; j < renderRowsForData.length; j++) {\n let renderRow = renderRowsForData[j];\n\n const cache = this._cachedRenderRowsMap.get(renderRow.data)!;\n if (cache.has(renderRow.rowDef)) {\n cache.get(renderRow.rowDef)!.push(renderRow);\n } else {\n cache.set(renderRow.rowDef, [renderRow]);\n }\n renderRows.push(renderRow);\n }\n }\n\n return renderRows;\n }\n\n /**\n * Gets a list of `RenderRow<T>` for the provided data object and any `CdkRowDef` objects that\n * should be rendered for this data. Reuses the cached RenderRow objects if they match the same\n * `(T, CdkRowDef)` pair.\n */\n private _getRenderRowsForData(\n data: T, dataIndex: number, cache?: WeakMap<CdkRowDef<T>, RenderRow<T>[]>): RenderRow<T>[] {\n const rowDefs = this._getRowDefs(data, dataIndex);\n\n return rowDefs.map(rowDef => {\n const cachedRenderRows = (cache && cache.has(rowDef)) ? cache.get(rowDef)! : [];\n if (cachedRenderRows.length) {\n const dataRow = cachedRenderRows.shift()!;\n dataRow.dataIndex = dataIndex;\n return dataRow;\n } else {\n return {data, rowDef, dataIndex};\n }\n });\n }\n\n /** Update the map containing the content's column definitions. */\n private _cacheColumnDefs() {\n this._columnDefsByName.clear();\n\n const columnDefs = mergeQueryListAndSet(this._contentColumnDefs, this._customColumnDefs);\n columnDefs.forEach(columnDef => {\n if (this._columnDefsByName.has(columnDef.name)) {\n throw getTableDuplicateColumnNameError(columnDef.name);\n }\n this._columnDefsByName.set(columnDef.name, columnDef);\n });\n }\n\n /** Update the list of all available row definitions that can be used. */\n private _cacheRowDefs() {\n this._headerRowDefs =\n mergeQueryListAndSet(this._contentHeaderRowDefs, this._customHeaderRowDefs);\n this._footerRowDefs =\n mergeQueryListAndSet(this._contentFooterRowDefs, this._customFooterRowDefs);\n this._rowDefs = mergeQueryListAndSet(this._contentRowDefs, this._customRowDefs);\n\n // After all row definitions are determined, find the row definition to be considered default.\n const defaultRowDefs = this._rowDefs.filter(def => !def.when);\n if (!this.multiTemplateDataRows && defaultRowDefs.length > 1) {\n throw getTableMultipleDefaultRowDefsError();\n }\n this._defaultRowDef = defaultRowDefs[0];\n }\n\n /**\n * Check if the header, data, or footer rows have changed what columns they want to display or\n * whether the sticky states have changed for the header or footer. If there is a diff, then\n * re-render that section.\n */\n private _renderUpdatedColumns() {\n const columnsDiffReducer = (acc: boolean, def: BaseRowDef) => acc || !!def.getColumnsDiff();\n\n // Force re-render data rows if the list of column definitions have changed.\n if (this._rowDefs.reduce(columnsDiffReducer, false)) {\n this._forceRenderDataRows();\n }\n\n // Force re-render header/footer rows if the list of column definitions have changed..\n if (this._headerRowDefs.reduce(columnsDiffReducer, false)) {\n this._forceRenderHeaderRows();\n }\n\n if (this._footerRowDefs.reduce(columnsDiffReducer, false)) {\n this._forceRenderFooterRows();\n }\n }\n\n /**\n * Switch to the provided data source by resetting the data and unsubscribing from the current\n * render change subscription if one exists. If the data source is null, interpret this by\n * clearing the row outlet. Otherwise start listening for new data.\n */\n private _switchDataSource(dataSource: CdkTableDataSourceInput<T>) {\n this._data = [];\n\n if (isDataSource(this.dataSource)) {\n this.dataSource.disconnect(this);\n }\n\n // Stop listening for data from the previous data source.\n if (this._renderChangeSubscription) {\n this._renderChangeSubscription.unsubscribe();\n this._renderChangeSubscription = null;\n }\n\n if (!dataSource) {\n if (this._dataDiffer) {\n this._dataDiffer.diff([]);\n }\n this._rowOutlet.viewContainer.clear();\n }\n\n this._dataSource = dataSource;\n }\n\n /** Set up a subscription for the data provided by the data source. */\n private _observeRenderChanges() {\n // If no data source has been set, there is nothing to observe for changes.\n if (!this.dataSource) {\n return;\n }\n\n let dataStream: Observable<T[]|ReadonlyArray<T>>|undefined;\n\n if (isDataSource(this.dataSource)) {\n dataStream = this.dataSource.connect(this);\n } else if (this.dataSource instanceof Observable) {\n dataStream = this.dataSource;\n } else if (Array.isArray(this.dataSource)) {\n dataStream = observableOf(this.dataSource);\n }\n\n if (dataStream === undefined) {\n throw getTableUnknownDataSourceError();\n }\n\n this._renderChangeSubscription = dataStream.pipe(takeUntil(this._onDestroy)).subscribe(data => {\n this._data = data || [];\n this.renderRows();\n });\n }\n\n /**\n * Clears any existing content in the header row outlet and creates a new embedded view\n * in the outlet using the header row definition.\n */\n private _forceRenderHeaderRows() {\n // Clear the header row outlet if any content exists.\n if (this._headerRowOutlet.viewContainer.length > 0) {\n this._headerRowOutlet.viewContainer.clear();\n }\n\n this._headerRowDefs.forEach((def, i) => this._renderRow(this._headerRowOutlet, def, i));\n this.updateStickyHeaderRowStyles();\n this.updateStickyColumnStyles();\n }\n /**\n * Clears any existing content in the footer row outlet and creates a new embedded view\n * in the outlet using the footer row definition.\n */\n private _forceRenderFooterRows() {\n // Clear the footer row outlet if any content exists.\n if (this._footerRowOutlet.viewContainer.length > 0) {\n this._footerRowOutlet.viewContainer.clear();\n }\n\n this._footerRowDefs.forEach((def, i) => this._renderRow(this._footerRowOutlet, def, i));\n this.updateStickyFooterRowStyles();\n this.updateStickyColumnStyles();\n }\n\n /** Adds the sticky column styles for the rows according to the columns' stick states. */\n private _addStickyColumnStyles(rows: HTMLElement[], rowDef: BaseRowDef) {\n const columnDefs = Array.from(rowDef.columns || []).map(columnName => {\n const columnDef = this._columnDefsByName.get(columnName);\n if (!columnDef) {\n throw getTableUnknownColumnError(columnName);\n }\n return columnDef!;\n });\n const stickyStartStates = columnDefs.map(columnDef => columnDef.sticky);\n const stickyEndStates = columnDefs.map(columnDef => columnDef.stickyEnd);\n this._stickyStyler.updateStickyColumns(rows, stickyStartStates, stickyEndStates);\n }\n\n /** Gets the list of rows that have been rendered in the row outlet. */\n _getRenderedRows(rowOutlet: RowOutlet): HTMLElement[] {\n const renderedRows: HTMLElement[] = [];\n\n for (let i = 0; i < rowOutlet.viewContainer.length; i++) {\n const viewRef = (rowOutlet.viewContainer.get(i)! as EmbeddedViewRef<any>);\n renderedRows.push(viewRef.rootNodes[0]);\n }\n\n return renderedRows;\n }\n\n /**\n * Get the matching row definitions that should be used for this row data. If there is only\n * one row definition, it is returned. Otherwise, find the row definitions that has a when\n * predicate that returns true with the data. If none return true, return the default row\n * definition.\n */\n _getRowDefs(data: T, dataIndex: number): CdkRowDef<T>[] {\n if (this._rowDefs.length == 1) {\n return [this._rowDefs[0]];\n }\n\n let rowDefs: CdkRowDef<T>[] = [];\n if (this.multiTemplateDataRows) {\n rowDefs = this._rowDefs.filter(def => !def.when || def.when(dataIndex, data));\n } else {\n let rowDef =\n this._rowDefs.find(def => def.when && def.when(dataIndex, data)) || this._defaultRowDef;\n if (rowDef) {\n rowDefs.push(rowDef);\n }\n }\n\n if (!rowDefs.length) {\n throw getTableMissingMatchingRowDefError(data);\n }\n\n return rowDefs;\n }\n\n /**\n * Create the embedded view for the data row template and place it in the correct index location\n * within the data row view container.\n */\n private _insertRow(renderRow: RenderRow<T>, renderIndex: number) {\n const rowDef = renderRow.rowDef;\n const context: RowContext<T> = {$implicit: renderRow.data};\n this._renderRow(this._rowOutlet, rowDef, renderIndex, context);\n }\n\n /**\n * Creates a new row template in the outlet and fills it with the set of cell templates.\n * Optionally takes a context to provide to the row and cells, as well as an optional index\n * of where to place the new row template in the outlet.\n */\n private _renderRow(\n outlet: RowOutlet, rowDef: BaseRowDef, index: number, context: RowContext<T> = {}) {\n // TODO(andrewseguin): enforce that one outlet was instantiated from createEmbeddedView\n outlet.viewContainer.createEmbeddedView(rowDef.template, context, index);\n\n for (let cellTemplate of this._getCellTemplates(rowDef)) {\n if (CdkCellOutlet.mostRecentCellOutlet) {\n CdkCellOutlet.mostRecentCellOutlet._viewContainer.createEmbeddedView(cellTemplate, context);\n }\n }\n\n this._changeDetectorRef.markForCheck();\n }\n\n /**\n * Updates the index-related context for each row to reflect any changes in the index of the rows,\n * e.g. first/last/even/odd.\n */\n private _updateRowIndexContext() {\n const viewContainer = this._rowOutlet.viewContainer;\n for (let renderIndex = 0, count = viewContainer.length; renderIndex < count; renderIndex++) {\n const viewRef = viewContainer.get(renderIndex) as RowViewRef<T>;\n const context = viewRef.context as RowContext<T>;\n context.count = count;\n context.first = renderIndex === 0;\n context.last = renderIndex === count - 1;\n context.even = renderIndex % 2 === 0;\n context.odd = !context.even;\n\n if (this.multiTemplateDataRows) {\n context.dataIndex = this._renderRows[renderIndex].dataIndex;\n context.renderIndex = renderIndex;\n } else {\n context.index = this._renderRows[renderIndex].dataIndex;\n }\n }\n }\n\n /** Gets the column definitions for the provided row def. */\n private _getCellTemplates(rowDef: BaseRowDef): TemplateRef<any>[] {\n if (!rowDef || !rowDef.columns) {\n return [];\n }\n return Array.from(rowDef.columns, columnId => {\n const column = this._columnDefsByName.get(columnId);\n\n if (!column) {\n throw getTableUnknownColumnError(columnId);\n }\n\n return rowDef.extractCellTemplate(column);\n });\n }\n\n /** Adds native table sections (e.g. tbody) and moves the row outlets into them. */\n private _applyNativeTableSections() {\n const documentFragment = this._document.createDocumentFragment();\n const sections = [\n {tag: 'thead', outlet: this._headerRowOutlet},\n {tag: 'tbody', outlet: this._rowOutlet},\n {tag: 'tfoot', outlet: this._footerRowOutlet},\n ];\n\n for (const section of sections) {\n const element = this._document.createElement(section.tag);\n element.setAttribute('role', 'rowgroup');\n element.appendChild(section.outlet.elementRef.nativeElement);\n documentFragment.appendChild(element);\n }\n\n // Use a DocumentFragment so we don't hit the DOM on each iteration.\n this._elementRef.nativeElement.appendChild(documentFragment);\n }\n\n /**\n * Forces a re-render of the data rows. Should be called in cases where there has been an input\n * change that affects the evaluation of which rows should be rendered, e.g. toggling\n * `multiTemplateDataRows` or adding/removing row definitions.\n */\n private _forceRenderDataRows() {\n this._dataDiffer.diff([]);\n this._rowOutlet.viewContainer.clear();\n this.renderRows();\n this.updateStickyColumnStyles();\n }\n\n /**\n * Checks if there has been a change in sticky states since last check and applies the correct\n * sticky styles. Since checking resets the \"dirty\" state, this should only be performed once\n * during a change detection and after the inputs are settled (after content check).\n */\n private _checkStickyStates() {\n const stickyCheckReducer = (acc: boolean, d: CdkHeaderRowDef|CdkFooterRowDef|CdkColumnDef) => {\n return acc || d.hasStickyChanged();\n };\n\n // Note that the check needs to occur for every definition since it notifies the definition\n // that it can reset its dirty state. Using another operator like `some` may short-circuit\n // remaining definitions and leave them in an unchecked state.\n\n if (this._headerRowDefs.reduce(stickyCheckReducer, false)) {\n this.updateStickyHeaderRowStyles();\n }\n\n if (this._footerRowDefs.reduce(stickyCheckReducer, false)) {\n this.updateStickyFooterRowStyles();\n }\n\n if (Array.from(this._columnDefsByName.values()).reduce(stickyCheckReducer, false)) {\n this.updateStickyColumnStyles();\n }\n }\n\n /**\n * Creates the sticky styler that will be used for sticky rows and columns. Listens\n * for directionality changes and provides the latest direction to the styler. Re-applies column\n * stickiness when directionality changes.\n */\n private _setupStickyStyler() {\n const direction: Direction = this._dir ? this._dir.value : 'ltr';\n this._stickyStyler = new StickyStyler(\n this._isNativeHtmlTable, this.stickyCssClass, direction, this._platform.isBrowser);\n (this._dir ? this._dir.change : observableOf<Direction>())\n .pipe(takeUntil(this._onDestroy))\n .subscribe(value => {\n this._stickyStyler.direction = value;\n this.updateStickyColumnStyles();\n });\n }\n}\n\n/** Utility function that gets a merged list of the entries in a QueryList and values of a Set. */\nfunction mergeQueryListAndSet<T>(queryList: QueryList<T>, set: Set<T>): T[] {\n return queryList.toArray().concat(Array.from(set));\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n ChangeDetectionStrategy,\n Component,\n Inject,\n InjectionToken,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n ViewChild,\n ViewEncapsulation,\n isDevMode,\n} from '@angular/core';\nimport {CdkCellDef, CdkColumnDef, CdkHeaderCellDef} from './cell';\nimport {CdkTable} from './table';\nimport {\n getTableTextColumnMissingParentTableError,\n getTableTextColumnMissingNameError,\n} from './table-errors';\n\n\n/** Configurable options for `CdkTextColumn`. */\nexport interface TextColumnOptions<T> {\n /**\n * Default function that provides the header text based on the column name if a header\n * text is not provided.\n */\n defaultHeaderTextTransform?: (name: string) => string;\n\n /** Default data accessor to use if one is not provided. */\n defaultDataAccessor?: (data: T, name: string) => string;\n}\n\n/** Injection token that can be used to specify the text column options. */\nexport const TEXT_COLUMN_OPTIONS =\n new InjectionToken<TextColumnOptions<any>>('text-column-options');\n\n/**\n * Column that simply shows text content for the header and row cells. Assumes that the table\n * is using the native table implementation (`<table>`).\n *\n * By default, the name of this column will be the header text and data property accessor.\n * The header text can be overridden with the `headerText` input. Cell values can be overridden with\n * the `dataAccessor` input. Change the text justification to the start or end using the `justify`\n * input.\n */\n@Component({\n moduleId: module.id,\n selector: 'cdk-text-column',\n template: `\n <ng-container cdkColumnDef>\n <th cdk-header-cell *cdkHeaderCellDef [style.text-align]=\"justify\">\n {{headerText}}\n </th>\n <td cdk-cell *cdkCellDef=\"let data\" [style.text-align]=\"justify\">\n {{dataAccessor(data, name)}}\n </td>\n </ng-container>\n `,\n encapsulation: ViewEncapsulation.None,\n // Change detection is intentionally not set to OnPush. This component's template will be provided\n // to the table to be inserted into its view. This is problematic when change detection runs since\n // the bindings in this template will be evaluated _after_ the table's view is evaluated, which\n // mean's the template in the table's view will not have the updated value (and in fact will cause\n // an ExpressionChangedAfterItHasBeenCheckedError).\n // tslint:disable-next-line:validate-decorators\n changeDetection: ChangeDetectionStrategy.Default,\n})\nexport class CdkTextColumn<T> implements OnDestroy, OnInit {\n /** Column name that should be used to reference this column. */\n @Input()\n get name(): string {\n return this._name;\n }\n set name(name: string) {\n this._name = name;\n\n // With Ivy, inputs can be initialized before static query results are\n // available. In that case, we defer the synchronization until \"ngOnInit\" fires.\n this._syncColumnDefName();\n }\n _name: string;\n\n /**\n * Text label that should be used for the column header. If this property is not\n * set, the header text will default to the column name with its first letter capitalized.\n */\n @Input() headerText: string;\n\n /**\n * Accessor function to retrieve the data rendered for each cell. If this\n * property is not set, the data cells will render the value found in the data's property matching\n * the column's name. For example, if the column is named `id`, then the rendered value will be\n * value defined by the data's `id` property.\n */\n @Input() dataAccessor: (data: T, name: string) => string;\n\n /** Alignment of the cell values. */\n @Input() justify: 'start'|'end' = 'start';\n\n /** @docs-private */\n @ViewChild(CdkColumnDef, {static: true}) columnDef: CdkColumnDef;\n\n /**\n * The column cell is provided to the column during `ngOnInit` with a static query.\n * Normally, this will be retrieved by the column using `ContentChild`, but that assumes the\n * column definition was provided in the same view as the table, which is not the case with this\n * component.\n * @docs-private\n */\n @ViewChild(CdkCellDef, {static: true}) cell: CdkCellDef;\n\n /**\n * The column headerCell is provided to the column during `ngOnInit` with a static query.\n * Normally, this will be retrieved by the column using `ContentChild`, but that assumes the\n * column definition was provided in the same view as the table, which is not the case with this\n * component.\n * @docs-private\n */\n @ViewChild(CdkHeaderCellDef, {static: true}) headerCell: CdkHeaderCellDef;\n\n constructor(\n @Optional() private _table: CdkTable<T>,\n @Optional() @Inject(TEXT_COLUMN_OPTIONS) private _options: TextColumnOptions<T>) {\n this._options = _options || {};\n }\n\n ngOnInit() {\n this._syncColumnDefName();\n\n if (this.headerText === undefined) {\n this.headerText = this._createDefaultHeaderText();\n }\n\n if (!this.dataAccessor) {\n this.dataAccessor =\n this._options.defaultDataAccessor || ((data: T, name: string) => (data as any)[name]);\n }\n\n if (this._table) {\n // Provide the cell and headerCell directly to the table with the static `ViewChild` query,\n // since the columnDef will not pick up its content by the time the table finishes checking\n // its content and initializing the rows.\n this.columnDef.cell = this.cell;\n this.columnDef.headerCell = this.headerCell;\n this._table.addColumnDef(this.columnDef);\n } else {\n throw getTableTextColumnMissingParentTableError();\n }\n }\n\n ngOnDestroy() {\n if (this._table) {\n this._table.removeColumnDef(this.columnDef);\n }\n }\n\n /**\n * Creates a default header text. Use the options' header text transformation function if one\n * has been provided. Otherwise simply capitalize the column name.\n */\n _createDefaultHeaderText() {\n const name = this.name;\n\n if (isDevMode() && !name) {\n throw getTableTextColumnMissingNameError();\n }\n\n if (this._options && this._options.defaultHeaderTextTransform) {\n return this._options.defaultHeaderTextTransform(name);\n }\n\n return name[0].toUpperCase() + name.slice(1);\n }\n\n /** Synchronizes the column definition name with the text column name. */\n private _syncColumnDefName() {\n if (this.columnDef) {\n this.columnDef.name = this.name;\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {HeaderRowOutlet, DataRowOutlet, CdkTable, FooterRowOutlet} from './table';\nimport {\n CdkCellOutlet, CdkFooterRow, CdkFooterRowDef, CdkHeaderRow, CdkHeaderRowDef, CdkRow,\n CdkRowDef\n} from './row';\nimport {\n CdkColumnDef, CdkHeaderCellDef, CdkHeaderCell, CdkCell, CdkCellDef,\n CdkFooterCellDef, CdkFooterCell\n} from './cell';\nimport {CdkTextColumn} from './text-column';\n\nconst EXPORTED_DECLARATIONS = [\n CdkTable,\n CdkRowDef,\n CdkCellDef,\n CdkCellOutlet,\n CdkHeaderCellDef,\n CdkFooterCellDef,\n CdkColumnDef,\n CdkCell,\n CdkRow,\n CdkHeaderCell,\n CdkFooterCell,\n CdkHeaderRow,\n CdkHeaderRowDef,\n CdkFooterRow,\n CdkFooterRowDef,\n DataRowOutlet,\n HeaderRowOutlet,\n FooterRowOutlet,\n CdkTextColumn,\n];\n\n@NgModule({\n imports: [CommonModule],\n exports: EXPORTED_DECLARATIONS,\n declarations: EXPORTED_DECLARATIONS\n\n})\nexport class CdkTableModule { }\n"],"names":["__extends","d","b","__","this","constructor","extendStatics","prototype","Object","create","mixinHasStickyInput","base","_super","class_1","args","_i","arguments","length","_this","apply","_sticky","_hasStickyChanged","tslib_1.__extends","defineProperty","v","prevValue","coerceBooleanProperty","hasStickyChanged","resetStickyChanged","getTableUnknownColumnError","id","Error","getTableDuplicateColumnNameError","name","getTableMultipleDefaultRowDefsError","getTableMissingMatchingRowDefError","data","JSON","stringify","getTableMissingRowDefsError","getTableUnknownDataSourceError","getTableTextColumnMissingParentTableError","getTableTextColumnMissingNameError","setPrototypeOf","__proto__","Array","p","hasOwnProperty","CdkCellDef","template","type","Directive","selector","TemplateRef","CdkHeaderCellDef","CdkFooterCellDef","CdkColumnDefBase","_CdkColumnDefBase","CdkColumnDef","_stickyEnd","_name","cssClassFriendlyName","replace","inputs","providers","provide","useExisting","Input","stickyEnd","cell","ContentChild","static","headerCell","footerCell","BaseCdkCell","columnDef","elementRef","columnClassName","nativeElement","classList","add","CdkHeaderCell","call","host","class","role","ElementRef","CdkFooterCell","CdkCell","CDK_ROW_TEMPLATE","BaseRowDef","_differs","ngOnChanges","changes","_columnsDiffer","columns","currentValue","find","diff","getColumnsDiff","extractCellTemplate","column","CdkHeaderRowDef","CdkFooterRowDef","CdkHeaderRowDefBase","_CdkHeaderRowDefBase","IterableDiffers","CdkFooterRowDefBase","_CdkFooterRowDefBase","CdkRowDef","CdkCellOutlet","_viewContainer","mostRecentCellOutlet","ngOnDestroy","ViewContainerRef","CdkHeaderRow","Component","CdkFooterRow","decorators","changeDetection","ChangeDetectionStrategy","Default","encapsulation","ViewEncapsulation","None","CdkRow","STICKY_DIRECTIONS","StickyStyler","_isNativeHtmlTable","_stickCellCss","direction","_isBrowser","clearStickyPositioning","rows","stickyDirections","rows_1","row","nodeType","ELEMENT_NODE","_removeStickyStyle","i","children","updateStickyColumns","stickyStartStates","stickyEndStates","hasStickyColumns","some","state","firstRow","numCells","cellWidths","_getCellWidths","startPositions","_getStickyStartColumnPositions","endPositions","_getStickyEndColumnPositions","isRtl","rows_2","_addStickyStyle","stickRows","rowsToStick","stickyStates","position","reverse","stickyHeight","rowIndex","j","getBoundingClientRect","height","updateStickyFooterContainer","tableElement","tfoot","querySelector","element","stickyDirections_1","dir","style","zIndex","_getCalculatedZIndex","remove","dirValue","cssText","zIndexIncrements","top","bottom","left","right","STICKY_DIRECTIONS_1","firstRowCells","push","width","widths","positions","nextPosition","DataRowOutlet","viewContainer","HeaderRowOutlet","FooterRowOutlet","CDK_TABLE_TEMPLATE","CdkTable","RowViewRef","EmbeddedViewRef","_changeDetectorRef","_elementRef","_dir","_document","_platform","_onDestroy","Subject","_columnDefsByName","Map","_customColumnDefs","Set","_customRowDefs","_customHeaderRowDefs","_customFooterRowDefs","_headerRowDefChanged","_footerRowDefChanged","_cachedRenderRowsMap","stickyCssClass","_multiTemplateDataRows","viewChange","BehaviorSubject","start","end","Number","MAX_VALUE","setAttribute","nodeName","_trackByFn","fn","isDevMode","console","warn","_dataSource","dataSource","_switchDataSource","_rowOutlet","_forceRenderDataRows","ngOnInit","_setupStickyStyler","_applyNativeTableSections","_dataDiffer","dataRow","trackBy","dataIndex","ngAfterContentChecked","_cacheRowDefs","_cacheColumnDefs","_headerRowDefs","_footerRowDefs","_rowDefs","_renderUpdatedColumns","_forceRenderHeaderRows","_forceRenderFooterRows","_renderChangeSubscription","_observeRenderChanges","_checkStickyStates","clear","_headerRowOutlet","_footerRowOutlet","next","complete","isDataSource","disconnect","renderRows","_renderRows","_getAllRenderRows","forEachOperation","record","prevIndex","currentIndex","previousIndex","_insertRow","item","view","get","move","_updateRowIndexContext","forEachIdentityChange","context","$implicit","updateStickyColumnStyles","setHeaderRowDef","headerRowDef","setFooterRowDef","footerRowDef","addColumnDef","removeColumnDef","delete","addRowDef","rowDef","removeRowDef","addHeaderRowDef","removeHeaderRowDef","addFooterRowDef","removeFooterRowDef","updateStickyHeaderRowStyles","headerRows","_getRenderedRows","thead","display","map","def","sticky","_stickyStyler","forEach","updateStickyFooterRowStyles","footerRows","dataRows","concat","headerRow","_addStickyColumnStyles","footerRow","from","values","prevCachedRenderRows","_data","renderRowsForData","_getRenderRowsForData","has","set","WeakMap","renderRow","cache","_getRowDefs","cachedRenderRows","shift","mergeQueryListAndSet","_contentColumnDefs","_contentHeaderRowDefs","_contentFooterRowDefs","_contentRowDefs","defaultRowDefs","filter","when","multiTemplateDataRows","_defaultRowDef","columnsDiffReducer","acc","reduce","unsubscribe","dataStream","connect","Observable","isArray","observableOf","undefined","pipe","takeUntil","subscribe","_renderRow","columnDefs","columnName","rowOutlet","renderedRows","viewRef","rootNodes","rowDefs","renderIndex","outlet","index","createEmbeddedView","_a","_b","_getCellTemplates","cellTemplate","markForCheck","count","first","last","even","odd","columnId","documentFragment","createDocumentFragment","sections","tag","sections_1","section","createElement","appendChild","stickyCheckReducer","value","isBrowser","change","exportAs","String","Attribute","Directionality","Optional","Inject","DOCUMENT","Platform","propDecorators","ViewChild","ContentChildren","TEXT_COLUMN_OPTIONS","InjectionToken","CdkTextColumn","_table","_options","justify","_syncColumnDefName","headerText","_createDefaultHeaderText","dataAccessor","defaultDataAccessor","defaultHeaderTextTransform","toUpperCase","slice","EXPORTED_DECLARATIONS","CdkTableModule","NgModule","imports","CommonModule","exports","declarations"],"mappings":";;;;;;;wvBAuBA,SAAgBA,GAAUC,EAAGC,GAEzB,QAASC,KAAOC,KAAKC,YAAcJ,EADnCK,EAAcL,EAAGC,GAEjBD,EAAEM,UAAkB,OAANL,EAAaM,OAAOC,OAAOP,IAAMC,EAAGI,UAAYL,EAAEK,UAAW,GAAIJ,ICgBnF,QAAgBO,GAA+CC,GAC7D,MAAF,U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