Mr.Combet Webshell
Your IP :
216.73.216.136
Server IP :
103.233.58.157
Server :
Windows NT WIN-4PGF72KEHKB 10.0 build 17763 (Windows Server 2016) AMD64
Server Software :
Microsoft-IIS/10.0
PHP Version :
7.3.25
Add File :
Submit
Add Directory :
Submit
Dir :
C:
/
inetpub
/
wwwroot
/
ActionAidWeb
/
Edit File Name :
0-es2015.3bc07ee852594bab7671.js
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[0],{ /***/ "./node_modules/@angular/cdk/esm2015/table.js": /*!****************************************************!*\ !*** ./node_modules/@angular/cdk/esm2015/table.js ***! \****************************************************/ /*! exports provided: DataSource, DataRowOutlet, HeaderRowOutlet, FooterRowOutlet, CDK_TABLE_TEMPLATE, CdkTable, CdkCellDef, CdkHeaderCellDef, CdkFooterCellDef, CdkColumnDef, BaseCdkCell, CdkHeaderCell, CdkFooterCell, CdkCell, CDK_ROW_TEMPLATE, BaseRowDef, CdkHeaderRowDef, CdkFooterRowDef, CdkRowDef, CdkCellOutlet, CdkHeaderRow, CdkFooterRow, CdkRow, CdkTableModule, STICKY_DIRECTIONS, StickyStyler, mixinHasStickyInput, TEXT_COLUMN_OPTIONS, CdkTextColumn */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DataRowOutlet", function() { return DataRowOutlet; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderRowOutlet", function() { return HeaderRowOutlet; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FooterRowOutlet", function() { return FooterRowOutlet; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CDK_TABLE_TEMPLATE", function() { return CDK_TABLE_TEMPLATE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkTable", function() { return CdkTable; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkCellDef", function() { return CdkCellDef; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkHeaderCellDef", function() { return CdkHeaderCellDef; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkFooterCellDef", function() { return CdkFooterCellDef; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkColumnDef", function() { return CdkColumnDef; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseCdkCell", function() { return BaseCdkCell; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkHeaderCell", function() { return CdkHeaderCell; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkFooterCell", function() { return CdkFooterCell; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkCell", function() { return CdkCell; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CDK_ROW_TEMPLATE", function() { return CDK_ROW_TEMPLATE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseRowDef", function() { return BaseRowDef; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkHeaderRowDef", function() { return CdkHeaderRowDef; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkFooterRowDef", function() { return CdkFooterRowDef; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkRowDef", function() { return CdkRowDef; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkCellOutlet", function() { return CdkCellOutlet; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkHeaderRow", function() { return CdkHeaderRow; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkFooterRow", function() { return CdkFooterRow; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkRow", function() { return CdkRow; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkTableModule", function() { return CdkTableModule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "STICKY_DIRECTIONS", function() { return STICKY_DIRECTIONS; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StickyStyler", function() { return StickyStyler; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mixinHasStickyInput", function() { return mixinHasStickyInput; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TEXT_COLUMN_OPTIONS", function() { return TEXT_COLUMN_OPTIONS; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkTextColumn", function() { return CdkTextColumn; }); /* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm2015/coercion.js"); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm2015/core.js"); /* harmony import */ var _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/cdk/bidi */ "./node_modules/@angular/cdk/esm2015/bidi.js"); /* harmony import */ var _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/cdk/collections */ "./node_modules/@angular/cdk/esm2015/collections.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DataSource", function() { return _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_3__["DataSource"]; }); /* harmony import */ var _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/cdk/platform */ "./node_modules/@angular/cdk/esm2015/platform.js"); /* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm2015/common.js"); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm2015/index.js"); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm2015/operators/index.js"); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Mixin to provide a directive with a function that checks if the sticky input has been * changed since the last time the function was called. Essentially adds a dirty-check to the * sticky value. * \@docs-private * @template T * @param {?} base * @return {?} */ function mixinHasStickyInput(base) { return class extends base { /** * @param {...?} args */ constructor(...args) { super(...args); this._sticky = false; /** * Whether the sticky input has changed since it was last checked. */ this._hasStickyChanged = false; } /** * Whether sticky positioning should be applied. * @return {?} */ get sticky() { return this._sticky; } /** * @param {?} v * @return {?} */ set sticky(v) { /** @type {?} */ const prevValue = this._sticky; this._sticky = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_0__["coerceBooleanProperty"])(v); this._hasStickyChanged = prevValue !== this._sticky; } /** * Whether the sticky value has changed since this was last called. * @return {?} */ hasStickyChanged() { /** @type {?} */ const hasStickyChanged = this._hasStickyChanged; this._hasStickyChanged = false; return hasStickyChanged; } /** * Resets the dirty check for cases where the sticky state has been used without checking. * @return {?} */ resetStickyChanged() { this._hasStickyChanged = false; } }; } /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Cell definition for a CDK table. * Captures the template of a column's data row cell as well as cell-specific properties. */ class CdkCellDef { /** * @param {?} template */ constructor(/** @docs-private */ template) { this.template = template; } } CdkCellDef.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[cdkCellDef]' },] }, ]; /** @nocollapse */ CdkCellDef.ctorParameters = () => [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"] } ]; /** * Header cell definition for a CDK table. * Captures the template of a column's header cell and as well as cell-specific properties. */ class CdkHeaderCellDef { /** * @param {?} template */ constructor(/** @docs-private */ template) { this.template = template; } } CdkHeaderCellDef.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[cdkHeaderCellDef]' },] }, ]; /** @nocollapse */ CdkHeaderCellDef.ctorParameters = () => [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"] } ]; /** * Footer cell definition for a CDK table. * Captures the template of a column's footer cell and as well as cell-specific properties. */ class CdkFooterCellDef { /** * @param {?} template */ constructor(/** @docs-private */ template) { this.template = template; } } CdkFooterCellDef.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[cdkFooterCellDef]' },] }, ]; /** @nocollapse */ CdkFooterCellDef.ctorParameters = () => [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"] } ]; // Boilerplate for applying mixins to CdkColumnDef. /** * \@docs-private */ class CdkColumnDefBase { } /** @type {?} */ const _CdkColumnDefBase = mixinHasStickyInput(CdkColumnDefBase); /** * Column definition for the CDK table. * Defines a set of cells available for a table column. */ class CdkColumnDef extends _CdkColumnDefBase { constructor() { super(...arguments); this._stickyEnd = false; } /** * Unique name for this column. * @return {?} */ get name() { return this._name; } /** * @param {?} name * @return {?} */ set name(name) { // If the directive is set without a name (updated programatically), then this setter will // trigger with an empty string and should not overwrite the programatically set value. if (!name) { return; } this._name = name; this.cssClassFriendlyName = name.replace(/[^a-z0-9_-]/ig, '-'); } /** * Whether this column should be sticky positioned on the end of the row. Should make sure * that it mimics the `CanStick` mixin such that `_hasStickyChanged` is set to true if the value * has been changed. * @return {?} */ get stickyEnd() { return this._stickyEnd; } /** * @param {?} v * @return {?} */ set stickyEnd(v) { /** @type {?} */ const prevValue = this._stickyEnd; this._stickyEnd = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_0__["coerceBooleanProperty"])(v); this._hasStickyChanged = prevValue !== this._stickyEnd; } } CdkColumnDef.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[cdkColumnDef]', inputs: ['sticky'], providers: [{ provide: 'MAT_SORT_HEADER_COLUMN_DEF', useExisting: CdkColumnDef }], },] }, ]; CdkColumnDef.propDecorators = { name: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['cdkColumnDef',] }], stickyEnd: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['stickyEnd',] }], cell: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChild"], args: [CdkCellDef, { static: false },] }], headerCell: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChild"], args: [CdkHeaderCellDef, { static: false },] }], footerCell: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChild"], args: [CdkFooterCellDef, { static: false },] }] }; /** * Base class for the cells. Adds a CSS classname that identifies the column it renders in. */ class BaseCdkCell { /** * @param {?} columnDef * @param {?} elementRef */ constructor(columnDef, elementRef) { /** @type {?} */ const columnClassName = `cdk-column-${columnDef.cssClassFriendlyName}`; elementRef.nativeElement.classList.add(columnClassName); } } /** * Header cell template container that adds the right classes and role. */ class CdkHeaderCell extends BaseCdkCell { /** * @param {?} columnDef * @param {?} elementRef */ constructor(columnDef, elementRef) { super(columnDef, elementRef); } } CdkHeaderCell.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: 'cdk-header-cell, th[cdk-header-cell]', host: { 'class': 'cdk-header-cell', 'role': 'columnheader', }, },] }, ]; /** @nocollapse */ CdkHeaderCell.ctorParameters = () => [ { type: CdkColumnDef }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] } ]; /** * Footer cell template container that adds the right classes and role. */ class CdkFooterCell extends BaseCdkCell { /** * @param {?} columnDef * @param {?} elementRef */ constructor(columnDef, elementRef) { super(columnDef, elementRef); } } CdkFooterCell.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: 'cdk-footer-cell, td[cdk-footer-cell]', host: { 'class': 'cdk-footer-cell', 'role': 'gridcell', }, },] }, ]; /** @nocollapse */ CdkFooterCell.ctorParameters = () => [ { type: CdkColumnDef }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] } ]; /** * Cell template container that adds the right classes and role. */ class CdkCell extends BaseCdkCell { /** * @param {?} columnDef * @param {?} elementRef */ constructor(columnDef, elementRef) { super(columnDef, elementRef); } } CdkCell.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: 'cdk-cell, td[cdk-cell]', host: { 'class': 'cdk-cell', 'role': 'gridcell', }, },] }, ]; /** @nocollapse */ CdkCell.ctorParameters = () => [ { type: CdkColumnDef }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] } ]; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * The row template that can be used by the mat-table. Should not be used outside of the * material library. * @type {?} */ const CDK_ROW_TEMPLATE = `<ng-container cdkCellOutlet></ng-container>`; /** * Base class for the CdkHeaderRowDef and CdkRowDef that handles checking their columns inputs * for changes and notifying the table. * @abstract */ class BaseRowDef { /** * @param {?} template * @param {?} _differs */ constructor(template, _differs) { this.template = template; this._differs = _differs; } /** * @param {?} changes * @return {?} */ ngOnChanges(changes) { // Create a new columns differ if one does not yet exist. Initialize it based on initial value // of the columns property or an empty array if none is provided. if (!this._columnsDiffer) { /** @type {?} */ const columns = (changes['columns'] && changes['columns'].currentValue) || []; this._columnsDiffer = this._differs.find(columns).create(); this._columnsDiffer.diff(columns); } } /** * Returns the difference between the current columns and the columns from the last diff, or null * if there is no difference. * @return {?} */ getColumnsDiff() { return this._columnsDiffer.diff(this.columns); } /** * Gets this row def's relevant cell template from the provided column def. * @param {?} column * @return {?} */ extractCellTemplate(column) { if (this instanceof CdkHeaderRowDef) { return column.headerCell.template; } if (this instanceof CdkFooterRowDef) { return column.footerCell.template; } else { return column.cell.template; } } } // Boilerplate for applying mixins to CdkHeaderRowDef. /** * \@docs-private */ class CdkHeaderRowDefBase extends BaseRowDef { } /** @type {?} */ const _CdkHeaderRowDefBase = mixinHasStickyInput(CdkHeaderRowDefBase); /** * Header row definition for the CDK table. * Captures the header row's template and other header properties such as the columns to display. */ class CdkHeaderRowDef extends _CdkHeaderRowDefBase { /** * @param {?} template * @param {?} _differs */ constructor(template, _differs) { super(template, _differs); } // Prerender fails to recognize that ngOnChanges in a part of this class through inheritance. // Explicitly define it so that the method is called as part of the Angular lifecycle. /** * @param {?} changes * @return {?} */ ngOnChanges(changes) { super.ngOnChanges(changes); } } CdkHeaderRowDef.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[cdkHeaderRowDef]', inputs: ['columns: cdkHeaderRowDef', 'sticky: cdkHeaderRowDefSticky'], },] }, ]; /** @nocollapse */ CdkHeaderRowDef.ctorParameters = () => [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["IterableDiffers"] } ]; // Boilerplate for applying mixins to CdkFooterRowDef. /** * \@docs-private */ class CdkFooterRowDefBase extends BaseRowDef { } /** @type {?} */ const _CdkFooterRowDefBase = mixinHasStickyInput(CdkFooterRowDefBase); /** * Footer row definition for the CDK table. * Captures the footer row's template and other footer properties such as the columns to display. */ class CdkFooterRowDef extends _CdkFooterRowDefBase { /** * @param {?} template * @param {?} _differs */ constructor(template, _differs) { super(template, _differs); } // Prerender fails to recognize that ngOnChanges in a part of this class through inheritance. // Explicitly define it so that the method is called as part of the Angular lifecycle. /** * @param {?} changes * @return {?} */ ngOnChanges(changes) { super.ngOnChanges(changes); } } CdkFooterRowDef.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[cdkFooterRowDef]', inputs: ['columns: cdkFooterRowDef', 'sticky: cdkFooterRowDefSticky'], },] }, ]; /** @nocollapse */ CdkFooterRowDef.ctorParameters = () => [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["IterableDiffers"] } ]; /** * Data row definition for the CDK table. * Captures the header row's template and other row properties such as the columns to display and * a when predicate that describes when this row should be used. * @template T */ class CdkRowDef extends BaseRowDef { // TODO(andrewseguin): Add an input for providing a switch function to determine // if this template should be used. /** * @param {?} template * @param {?} _differs */ constructor(template, _differs) { super(template, _differs); } } CdkRowDef.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[cdkRowDef]', inputs: ['columns: cdkRowDefColumns', 'when: cdkRowDefWhen'], },] }, ]; /** @nocollapse */ CdkRowDef.ctorParameters = () => [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["TemplateRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["IterableDiffers"] } ]; /** * Outlet for rendering cells inside of a row or header row. * \@docs-private */ class CdkCellOutlet { /** * @param {?} _viewContainer */ constructor(_viewContainer) { this._viewContainer = _viewContainer; CdkCellOutlet.mostRecentCellOutlet = this; } /** * @return {?} */ ngOnDestroy() { // If this was the last outlet being rendered in the view, remove the reference // from the static property after it has been destroyed to avoid leaking memory. if (CdkCellOutlet.mostRecentCellOutlet === this) { CdkCellOutlet.mostRecentCellOutlet = null; } } } /** * Static property containing the latest constructed instance of this class. * Used by the CDK table when each CdkHeaderRow and CdkRow component is created using * createEmbeddedView. After one of these components are created, this property will provide * a handle to provide that component's cells and context. After init, the CdkCellOutlet will * construct the cells with the provided context. */ CdkCellOutlet.mostRecentCellOutlet = null; CdkCellOutlet.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[cdkCellOutlet]' },] }, ]; /** @nocollapse */ CdkCellOutlet.ctorParameters = () => [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewContainerRef"] } ]; /** * Header template container that contains the cell outlet. Adds the right class and role. */ class CdkHeaderRow { } CdkHeaderRow.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'cdk-header-row, tr[cdk-header-row]', template: CDK_ROW_TEMPLATE, host: { 'class': 'cdk-header-row', 'role': 'row', }, // See note on CdkTable for explanation on why this uses the default change detection strategy. // tslint:disable-next-line:validate-decorators changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].Default, encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None, },] }, ]; /** * Footer template container that contains the cell outlet. Adds the right class and role. */ class CdkFooterRow { } CdkFooterRow.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'cdk-footer-row, tr[cdk-footer-row]', template: CDK_ROW_TEMPLATE, host: { 'class': 'cdk-footer-row', 'role': 'row', }, // See note on CdkTable for explanation on why this uses the default change detection strategy. // tslint:disable-next-line:validate-decorators changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].Default, encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None, },] }, ]; /** * Data row template container that contains the cell outlet. Adds the right class and role. */ class CdkRow { } CdkRow.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'cdk-row, tr[cdk-row]', template: CDK_ROW_TEMPLATE, host: { 'class': 'cdk-row', 'role': 'row', }, // See note on CdkTable for explanation on why this uses the default change detection strategy. // tslint:disable-next-line:validate-decorators changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].Default, encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None, },] }, ]; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * List of all possible directions that can be used for sticky positioning. * \@docs-private * @type {?} */ const STICKY_DIRECTIONS = ['top', 'bottom', 'left', 'right']; /** * Applies and removes sticky positioning styles to the `CdkTable` rows and columns cells. * \@docs-private */ class StickyStyler { /** * @param {?} _isNativeHtmlTable Whether the sticky logic should be based on a table * that uses the native `<table>` element. * @param {?} _stickCellCss The CSS class that will be applied to every row/cell that has * sticky positioning applied. * @param {?} direction The directionality context of the table (ltr/rtl); affects column positioning * by reversing left/right positions. * @param {?=} _isBrowser Whether the table is currently being rendered on the server or the client. */ constructor(_isNativeHtmlTable, _stickCellCss, direction, _isBrowser = true) { this._isNativeHtmlTable = _isNativeHtmlTable; this._stickCellCss = _stickCellCss; this.direction = direction; this._isBrowser = _isBrowser; } /** * Clears the sticky positioning styles from the row and its cells by resetting the `position` * style, setting the zIndex to 0, and unsetting each provided sticky direction. * @param {?} rows The list of rows that should be cleared from sticking in the provided directions * @param {?} stickyDirections The directions that should no longer be set as sticky on the rows. * @return {?} */ clearStickyPositioning(rows, stickyDirections) { for (const row of rows) { // If the row isn't an element (e.g. if it's an `ng-container`), // it won't have inline styles or `children` so we skip it. if (row.nodeType !== row.ELEMENT_NODE) { continue; } this._removeStickyStyle(row, stickyDirections); for (let i = 0; i < row.children.length; i++) { /** @type {?} */ const cell = (/** @type {?} */ (row.children[i])); this._removeStickyStyle(cell, stickyDirections); } } } /** * Applies sticky left and right positions to the cells of each row according to the sticky * states of the rendered column definitions. * @param {?} rows The rows that should have its set of cells stuck according to the sticky states. * @param {?} stickyStartStates A list of boolean states where each state represents whether the cell * in this index position should be stuck to the start of the row. * @param {?} stickyEndStates A list of boolean states where each state represents whether the cell * in this index position should be stuck to the end of the row. * @return {?} */ updateStickyColumns(rows, stickyStartStates, stickyEndStates) { /** @type {?} */ const hasStickyColumns = stickyStartStates.some((/** * @param {?} state * @return {?} */ state => state)) || stickyEndStates.some((/** * @param {?} state * @return {?} */ state => state)); if (!rows.length || !hasStickyColumns || !this._isBrowser) { return; } /** @type {?} */ const firstRow = rows[0]; /** @type {?} */ const numCells = firstRow.children.length; /** @type {?} */ const cellWidths = this._getCellWidths(firstRow); /** @type {?} */ const startPositions = this._getStickyStartColumnPositions(cellWidths, stickyStartStates); /** @type {?} */ const endPositions = this._getStickyEndColumnPositions(cellWidths, stickyEndStates); /** @type {?} */ const isRtl = this.direction === 'rtl'; for (const row of rows) { for (let i = 0; i < numCells; i++) { /** @type {?} */ const cell = (/** @type {?} */ (row.children[i])); if (stickyStartStates[i]) { this._addStickyStyle(cell, isRtl ? 'right' : 'left', startPositions[i]); } if (stickyEndStates[i]) { this._addStickyStyle(cell, isRtl ? 'left' : 'right', endPositions[i]); } } } } /** * Applies sticky positioning to the row's cells if using the native table layout, and to the * row itself otherwise. * @param {?} rowsToStick The list of rows that should be stuck according to their corresponding * sticky state and to the provided top or bottom position. * @param {?} stickyStates A list of boolean states where each state represents whether the row * should be stuck in the particular top or bottom position. * @param {?} position The position direction in which the row should be stuck if that row should be * sticky. * * @return {?} */ stickRows(rowsToStick, stickyStates, position) { // Since we can't measure the rows on the server, we can't stick the rows properly. if (!this._isBrowser) { return; } // If positioning the rows to the bottom, reverse their order when evaluating the sticky // position such that the last row stuck will be "bottom: 0px" and so on. /** @type {?} */ const rows = position === 'bottom' ? rowsToStick.reverse() : rowsToStick; /** @type {?} */ let stickyHeight = 0; for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) { if (!stickyStates[rowIndex]) { continue; } /** @type {?} */ const row = rows[rowIndex]; if (this._isNativeHtmlTable) { for (let j = 0; j < row.children.length; j++) { /** @type {?} */ const cell = (/** @type {?} */ (row.children[j])); this._addStickyStyle(cell, position, stickyHeight); } } else { // Flex does not respect the stick positioning on the cells, needs to be applied to the row. // If this is applied on a native table, Safari causes the header to fly in wrong direction. this._addStickyStyle(row, position, stickyHeight); } if (rowIndex === rows.length - 1) { // prevent unnecessary reflow from getBoundingClientRect() return; } stickyHeight += row.getBoundingClientRect().height; } } /** * When using the native table in Safari, sticky footer cells do not stick. The only way to stick * footer rows is to apply sticky styling to the tfoot container. This should only be done if * all footer rows are sticky. If not all footer rows are sticky, remove sticky positioning from * the tfoot element. * @param {?} tableElement * @param {?} stickyStates * @return {?} */ updateStickyFooterContainer(tableElement, stickyStates) { if (!this._isNativeHtmlTable) { return; } /** @type {?} */ const tfoot = (/** @type {?} */ (tableElement.querySelector('tfoot'))); if (stickyStates.some((/** * @param {?} state * @return {?} */ state => !state))) { this._removeStickyStyle(tfoot, ['bottom']); } else { this._addStickyStyle(tfoot, 'bottom', 0); } } /** * Removes the sticky style on the element by removing the sticky cell CSS class, re-evaluating * the zIndex, removing each of the provided sticky directions, and removing the * sticky position if there are no more directions. * @param {?} element * @param {?} stickyDirections * @return {?} */ _removeStickyStyle(element, stickyDirections) { for (const dir of stickyDirections) { element.style[dir] = ''; } element.style.zIndex = this._getCalculatedZIndex(element); // If the element no longer has any more sticky directions, remove sticky positioning and // the sticky CSS class. /** @type {?} */ const hasDirection = STICKY_DIRECTIONS.some((/** * @param {?} dir * @return {?} */ dir => !!element.style[dir])); if (!hasDirection) { element.style.position = ''; element.classList.remove(this._stickCellCss); } } /** * Adds the sticky styling to the element by adding the sticky style class, changing position * to be sticky (and -webkit-sticky), setting the appropriate zIndex, and adding a sticky * direction and value. * @param {?} element * @param {?} dir * @param {?} dirValue * @return {?} */ _addStickyStyle(element, dir, dirValue) { element.classList.add(this._stickCellCss); element.style[dir] = `${dirValue}px`; element.style.cssText += 'position: -webkit-sticky; position: sticky; '; element.style.zIndex = this._getCalculatedZIndex(element); } /** * Calculate what the z-index should be for the element, depending on what directions (top, * bottom, left, right) have been set. It should be true that elements with a top direction * should have the highest index since these are elements like a table header. If any of those * elements are also sticky in another direction, then they should appear above other elements * that are only sticky top (e.g. a sticky column on a sticky header). Bottom-sticky elements * (e.g. footer rows) should then be next in the ordering such that they are below the header * but above any non-sticky elements. Finally, left/right sticky elements (e.g. sticky columns) * should minimally increment so that they are above non-sticky elements but below top and bottom * elements. * @param {?} element * @return {?} */ _getCalculatedZIndex(element) { /** @type {?} */ const zIndexIncrements = { top: 100, bottom: 10, left: 1, right: 1, }; /** @type {?} */ let zIndex = 0; for (const dir of STICKY_DIRECTIONS) { if (element.style[dir]) { zIndex += zIndexIncrements[dir]; } } return zIndex ? `${zIndex}` : ''; } /** * Gets the widths for each cell in the provided row. * @param {?} row * @return {?} */ _getCellWidths(row) { /** @type {?} */ const cellWidths = []; /** @type {?} */ const firstRowCells = row.children; for (let i = 0; i < firstRowCells.length; i++) { /** @type {?} */ let cell = (/** @type {?} */ (firstRowCells[i])); cellWidths.push(cell.getBoundingClientRect().width); } return cellWidths; } /** * Determines the left and right positions of each sticky column cell, which will be the * accumulation of all sticky column cell widths to the left and right, respectively. * Non-sticky cells do not need to have a value set since their positions will not be applied. * @param {?} widths * @param {?} stickyStates * @return {?} */ _getStickyStartColumnPositions(widths, stickyStates) { /** @type {?} */ const positions = []; /** @type {?} */ let nextPosition = 0; for (let i = 0; i < widths.length; i++) { if (stickyStates[i]) { positions[i] = nextPosition; nextPosition += widths[i]; } } return positions; } /** * Determines the left and right positions of each sticky column cell, which will be the * accumulation of all sticky column cell widths to the left and right, respectively. * Non-sticky cells do not need to have a value set since their positions will not be applied. * @param {?} widths * @param {?} stickyStates * @return {?} */ _getStickyEndColumnPositions(widths, stickyStates) { /** @type {?} */ const positions = []; /** @type {?} */ let nextPosition = 0; for (let i = widths.length; i > 0; i--) { if (stickyStates[i]) { positions[i] = nextPosition; nextPosition += widths[i]; } } return positions; } } /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Returns an error to be thrown when attempting to find an unexisting column. * \@docs-private * @param {?} id Id whose lookup failed. * @return {?} */ function getTableUnknownColumnError(id) { return Error(`Could not find column with id "${id}".`); } /** * Returns an error to be thrown when two column definitions have the same name. * \@docs-private * @param {?} name * @return {?} */ function getTableDuplicateColumnNameError(name) { return Error(`Duplicate column definition name provided: "${name}".`); } /** * Returns an error to be thrown when there are multiple rows that are missing a when function. * \@docs-private * @return {?} */ function getTableMultipleDefaultRowDefsError() { return Error(`There can only be one default row without a when predicate function.`); } /** * Returns an error to be thrown when there are no matching row defs for a particular set of data. * \@docs-private * @param {?} data * @return {?} */ function getTableMissingMatchingRowDefError(data) { return Error(`Could not find a matching row definition for the` + `provided row data: ${JSON.stringify(data)}`); } /** * Returns an error to be thrown when there is no row definitions present in the content. * \@docs-private * @return {?} */ function getTableMissingRowDefsError() { return Error('Missing definitions for header, footer, and row; ' + 'cannot determine which columns should be rendered.'); } /** * Returns an error to be thrown when the data source does not match the compatible types. * \@docs-private * @return {?} */ function getTableUnknownDataSourceError() { return Error(`Provided data source did not match an array, Observable, or DataSource`); } /** * Returns an error to be thrown when the text column cannot find a parent table to inject. * \@docs-private * @return {?} */ function getTableTextColumnMissingParentTableError() { return Error(`Text column could not find a parent table for registration.`); } /** * Returns an error to be thrown when a table text column doesn't have a name. * \@docs-private * @return {?} */ function getTableTextColumnMissingNameError() { return Error(`Table text column must have a name.`); } /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Provides a handle for the table to grab the view container's ng-container to insert data rows. * \@docs-private */ class DataRowOutlet { /** * @param {?} viewContainer * @param {?} elementRef */ constructor(viewContainer, elementRef) { this.viewContainer = viewContainer; this.elementRef = elementRef; } } DataRowOutlet.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[rowOutlet]' },] }, ]; /** @nocollapse */ DataRowOutlet.ctorParameters = () => [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewContainerRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] } ]; /** * Provides a handle for the table to grab the view container's ng-container to insert the header. * \@docs-private */ class HeaderRowOutlet { /** * @param {?} viewContainer * @param {?} elementRef */ constructor(viewContainer, elementRef) { this.viewContainer = viewContainer; this.elementRef = elementRef; } } HeaderRowOutlet.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[headerRowOutlet]' },] }, ]; /** @nocollapse */ HeaderRowOutlet.ctorParameters = () => [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewContainerRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] } ]; /** * Provides a handle for the table to grab the view container's ng-container to insert the footer. * \@docs-private */ class FooterRowOutlet { /** * @param {?} viewContainer * @param {?} elementRef */ constructor(viewContainer, elementRef) { this.viewContainer = viewContainer; this.elementRef = elementRef; } } FooterRowOutlet.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[footerRowOutlet]' },] }, ]; /** @nocollapse */ FooterRowOutlet.ctorParameters = () => [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewContainerRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] } ]; /** * The table template that can be used by the mat-table. Should not be used outside of the * material library. * \@docs-private * @type {?} */ const CDK_TABLE_TEMPLATE = // Note that according to MDN, the `caption` element has to be projected as the **first** // element in the table. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/caption ` <ng-content select="caption"></ng-content> <ng-container headerRowOutlet></ng-container> <ng-container rowOutlet></ng-container> <ng-container footerRowOutlet></ng-container> `; /** * A data table that can render a header row, data rows, and a footer row. * Uses the dataSource input to determine the data to be rendered. The data can be provided either * as a data array, an Observable stream that emits the data array to render, or a DataSource with a * connect function that will return an Observable stream that emits the data array to render. * @template T */ class CdkTable { /** * @param {?} _differs * @param {?} _changeDetectorRef * @param {?} _elementRef * @param {?} role * @param {?} _dir * @param {?} _document * @param {?} _platform */ constructor(_differs, _changeDetectorRef, _elementRef, role, _dir, _document, _platform) { this._differs = _differs; this._changeDetectorRef = _changeDetectorRef; this._elementRef = _elementRef; this._dir = _dir; this._platform = _platform; /** * Subject that emits when the component has been destroyed. */ this._onDestroy = new rxjs__WEBPACK_IMPORTED_MODULE_6__["Subject"](); /** * Map of all the user's defined columns (header, data, and footer cell template) identified by * name. Collection populated by the column definitions gathered by `ContentChildren` as well as * any custom column definitions added to `_customColumnDefs`. */ this._columnDefsByName = new Map(); /** * Column definitions that were defined outside of the direct content children of the table. * These will be defined when, e.g., creating a wrapper around the cdkTable that has * column definitions as *it's* content child. */ this._customColumnDefs = new Set(); /** * Data row definitions that were defined outside of the direct content children of the table. * These will be defined when, e.g., creating a wrapper around the cdkTable that has * built-in data rows as *it's* content child. */ this._customRowDefs = new Set(); /** * Header row definitions that were defined outside of the direct content children of the table. * These will be defined when, e.g., creating a wrapper around the cdkTable that has * built-in header rows as *it's* content child. */ this._customHeaderRowDefs = new Set(); /** * Footer row definitions that were defined outside of the direct content children of the table. * These will be defined when, e.g., creating a wrapper around the cdkTable that has a * built-in footer row as *it's* content child. */ this._customFooterRowDefs = new Set(); /** * Whether the header row definition has been changed. Triggers an update to the header row after * content is checked. Initialized as true so that the table renders the initial set of rows. */ this._headerRowDefChanged = true; /** * Whether the footer row definition has been changed. Triggers an update to the footer row after * content is checked. Initialized as true so that the table renders the initial set of rows. */ this._footerRowDefChanged = true; /** * Cache of the latest rendered `RenderRow` objects as a map for easy retrieval when constructing * a new list of `RenderRow` objects for rendering rows. Since the new list is constructed with * the cached `RenderRow` objects when possible, the row identity is preserved when the data * and row template matches, which allows the `IterableDiffer` to check rows by reference * and understand which rows are added/moved/removed. * * Implemented as a map of maps where the first key is the `data: T` object and the second is the * `CdkRowDef<T>` object. With the two keys, the cache points to a `RenderRow<T>` object that * contains an array of created pairs. The array is necessary to handle cases where the data * array contains multiple duplicate data objects and each instantiated `RenderRow` must be * stored. */ this._cachedRenderRowsMap = new Map(); /** * CSS class added to any row or cell that has sticky positioning applied. May be overriden by * table subclasses. */ this.stickyCssClass = 'cdk-table-sticky'; this._multiTemplateDataRows = false; // TODO(andrewseguin): Remove max value as the end index // and instead calculate the view on init and scroll. /** * Stream containing the latest information on what rows are being displayed on screen. * Can be used by the data source to as a heuristic of what data should be provided. * * \@docs-private */ this.viewChange = new rxjs__WEBPACK_IMPORTED_MODULE_6__["BehaviorSubject"]({ start: 0, end: Number.MAX_VALUE }); if (!role) { this._elementRef.nativeElement.setAttribute('role', 'grid'); } this._document = _document; this._isNativeHtmlTable = this._elementRef.nativeElement.nodeName === 'TABLE'; } /** * Tracking function that will be used to check the differences in data changes. Used similarly * to `ngFor` `trackBy` function. Optimize row operations by identifying a row based on its data * relative to the function to know if a row should be added/removed/moved. * Accepts a function that takes two parameters, `index` and `item`. * @return {?} */ get trackBy() { return this._trackByFn; } /** * @param {?} fn * @return {?} */ set trackBy(fn) { if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["isDevMode"])() && fn != null && typeof fn !== 'function' && (/** @type {?} */ (console)) && (/** @type {?} */ (console.warn))) { console.warn(`trackBy must be a function, but received ${JSON.stringify(fn)}.`); } this._trackByFn = fn; } /** * The table's source of data, which can be provided in three ways (in order of complexity): * - Simple data array (each object represents one table row) * - Stream that emits a data array each time the array changes * - `DataSource` object that implements the connect/disconnect interface. * * If a data array is provided, the table must be notified when the array's objects are * added, removed, or moved. This can be done by calling the `renderRows()` function which will * render the diff since the last table render. If the data array reference is changed, the table * will automatically trigger an update to the rows. * * When providing an Observable stream, the table will trigger an update automatically when the * stream emits a new array of data. * * Finally, when providing a `DataSource` object, the table will use the Observable stream * provided by the connect function and trigger updates when that stream emits new data array * values. During the table's ngOnDestroy or when the data source is removed from the table, the * table will call the DataSource's `disconnect` function (may be useful for cleaning up any * subscriptions registered during the connect process). * @return {?} */ get dataSource() { return this._dataSource; } /** * @param {?} dataSource * @return {?} */ set dataSource(dataSource) { if (this._dataSource !== dataSource) { this._switchDataSource(dataSource); } } /** * Whether to allow multiple rows per data object by evaluating which rows evaluate their 'when' * predicate to true. If `multiTemplateDataRows` is false, which is the default value, then each * dataobject will render the first row that evaluates its when predicate to true, in the order * defined in the table, or otherwise the default row which does not have a when predicate. * @return {?} */ get multiTemplateDataRows() { return this._multiTemplateDataRows; } /** * @param {?} v * @return {?} */ set multiTemplateDataRows(v) { this._multiTemplateDataRows = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_0__["coerceBooleanProperty"])(v); // In Ivy if this value is set via a static attribute (e.g. <table multiTemplateDataRows>), // this setter will be invoked before the row outlet has been defined hence the null check. if (this._rowOutlet && this._rowOutlet.viewContainer.length) { this._forceRenderDataRows(); } } /** * @return {?} */ ngOnInit() { this._setupStickyStyler(); if (this._isNativeHtmlTable) { this._applyNativeTableSections(); } // Set up the trackBy function so that it uses the `RenderRow` as its identity by default. If // the user has provided a custom trackBy, return the result of that function as evaluated // with the values of the `RenderRow`'s data and index. this._dataDiffer = this._differs.find([]).create((/** * @param {?} _i * @param {?} dataRow * @return {?} */ (_i, dataRow) => { return this.trackBy ? this.trackBy(dataRow.dataIndex, dataRow.data) : dataRow; })); } /** * @return {?} */ ngAfterContentChecked() { // Cache the row and column definitions gathered by ContentChildren and programmatic injection. this._cacheRowDefs(); this._cacheColumnDefs(); // Make sure that the user has at least added header, footer, or data row def. if (!this._headerRowDefs.length && !this._footerRowDefs.length && !this._rowDefs.length) { throw getTableMissingRowDefsError(); } // Render updates if the list of columns have been changed for the header, row, or footer defs. this._renderUpdatedColumns(); // If the header row definition has been changed, trigger a render to the header row. if (this._headerRowDefChanged) { this._forceRenderHeaderRows(); this._headerRowDefChanged = false; } // If the footer row definition has been changed, trigger a render to the footer row. if (this._footerRowDefChanged) { this._forceRenderFooterRows(); this._footerRowDefChanged = false; } // If there is a data source and row definitions, connect to the data source unless a // connection has already been made. if (this.dataSource && this._rowDefs.length > 0 && !this._renderChangeSubscription) { this._observeRenderChanges(); } this._checkStickyStates(); } /** * @return {?} */ ngOnDestroy() { this._rowOutlet.viewContainer.clear(); this._headerRowOutlet.viewContainer.clear(); this._footerRowOutlet.viewContainer.clear(); this._cachedRenderRowsMap.clear(); this._onDestroy.next(); this._onDestroy.complete(); if (Object(_angular_cdk_collections__WEBPACK_IMPORTED_MODULE_3__["isDataSource"])(this.dataSource)) { this.dataSource.disconnect(this); } } /** * Renders rows based on the table's latest set of data, which was either provided directly as an * input or retrieved through an Observable stream (directly or from a DataSource). * Checks for differences in the data since the last diff to perform only the necessary * changes (add/remove/move rows). * * If the table's data source is a DataSource or Observable, this will be invoked automatically * each time the provided Observable stream emits a new data array. Otherwise if your data is * an array, this function will need to be called to render any changes. * @return {?} */ renderRows() { this._renderRows = this._getAllRenderRows(); /** @type {?} */ const changes = this._dataDiffer.diff(this._renderRows); if (!changes) { return; } /** @type {?} */ const viewContainer = this._rowOutlet.viewContainer; changes.forEachOperation((/** * @param {?} record * @param {?} prevIndex * @param {?} currentIndex * @return {?} */ (record, prevIndex, currentIndex) => { if (record.previousIndex == null) { this._insertRow(record.item, (/** @type {?} */ (currentIndex))); } else if (currentIndex == null) { viewContainer.remove((/** @type {?} */ (prevIndex))); } else { /** @type {?} */ const view = (/** @type {?} */ (viewContainer.get((/** @type {?} */ (prevIndex))))); viewContainer.move((/** @type {?} */ (view)), currentIndex); } })); // Update the meta context of a row's context data (index, count, first, last, ...) this._updateRowIndexContext(); // Update rows that did not get added/removed/moved but may have had their identity changed, // e.g. if trackBy matched data on some property but the actual data reference changed. changes.forEachIdentityChange((/** * @param {?} record * @return {?} */ (record) => { /** @type {?} */ const rowView = (/** @type {?} */ (viewContainer.get((/** @type {?} */ (record.currentIndex))))); rowView.context.$implicit = record.item.data; })); this.updateStickyColumnStyles(); } /** * Sets the header row definition to be used. Overrides the header row definition gathered by * using `ContentChild`, if one exists. Sets a flag that will re-render the header row after the * table's content is checked. * \@docs-private * @deprecated Use `addHeaderRowDef` and `removeHeaderRowDef` instead * \@breaking-change 8.0.0 * @param {?} headerRowDef * @return {?} */ setHeaderRowDef(headerRowDef) { this._customHeaderRowDefs = new Set([headerRowDef]); this._headerRowDefChanged = true; } /** * Sets the footer row definition to be used. Overrides the footer row definition gathered by * using `ContentChild`, if one exists. Sets a flag that will re-render the footer row after the * table's content is checked. * \@docs-private * @deprecated Use `addFooterRowDef` and `removeFooterRowDef` instead * \@breaking-change 8.0.0 * @param {?} footerRowDef * @return {?} */ setFooterRowDef(footerRowDef) { this._customFooterRowDefs = new Set([footerRowDef]); this._footerRowDefChanged = true; } /** * Adds a column definition that was not included as part of the content children. * @param {?} columnDef * @return {?} */ addColumnDef(columnDef) { this._customColumnDefs.add(columnDef); } /** * Removes a column definition that was not included as part of the content children. * @param {?} columnDef * @return {?} */ removeColumnDef(columnDef) { this._customColumnDefs.delete(columnDef); } /** * Adds a row definition that was not included as part of the content children. * @param {?} rowDef * @return {?} */ addRowDef(rowDef) { this._customRowDefs.add(rowDef); } /** * Removes a row definition that was not included as part of the content children. * @param {?} rowDef * @return {?} */ removeRowDef(rowDef) { this._customRowDefs.delete(rowDef); } /** * Adds a header row definition that was not included as part of the content children. * @param {?} headerRowDef * @return {?} */ addHeaderRowDef(headerRowDef) { this._customHeaderRowDefs.add(headerRowDef); this._headerRowDefChanged = true; } /** * Removes a header row definition that was not included as part of the content children. * @param {?} headerRowDef * @return {?} */ removeHeaderRowDef(headerRowDef) { this._customHeaderRowDefs.delete(headerRowDef); this._headerRowDefChanged = true; } /** * Adds a footer row definition that was not included as part of the content children. * @param {?} footerRowDef * @return {?} */ addFooterRowDef(footerRowDef) { this._customFooterRowDefs.add(footerRowDef); this._footerRowDefChanged = true; } /** * Removes a footer row definition that was not included as part of the content children. * @param {?} footerRowDef * @return {?} */ removeFooterRowDef(footerRowDef) { this._customFooterRowDefs.delete(footerRowDef); this._footerRowDefChanged = true; } /** * Updates the header sticky styles. First resets all applied styles with respect to the cells * sticking to the top. Then, evaluating which cells need to be stuck to the top. This is * automatically called when the header row changes its displayed set of columns, or if its * sticky input changes. May be called manually for cases where the cell content changes outside * of these events. * @return {?} */ updateStickyHeaderRowStyles() { /** @type {?} */ const headerRows = this._getRenderedRows(this._headerRowOutlet); /** @type {?} */ const tableElement = (/** @type {?} */ (this._elementRef.nativeElement)); // Hide the thead element if there are no header rows. This is necessary to satisfy // overzealous a11y checkers that fail because the `rowgroup` element does not contain // required child `row`. /** @type {?} */ const thead = tableElement.querySelector('thead'); if (thead) { thead.style.display = headerRows.length ? '' : 'none'; } /** @type {?} */ const stickyStates = this._headerRowDefs.map((/** * @param {?} def * @return {?} */ def => def.sticky)); this._stickyStyler.clearStickyPositioning(headerRows, ['top']); this._stickyStyler.stickRows(headerRows, stickyStates, 'top'); // Reset the dirty state of the sticky input change since it has been used. this._headerRowDefs.forEach((/** * @param {?} def * @return {?} */ def => def.resetStickyChanged())); } /** * Updates the footer sticky styles. First resets all applied styles with respect to the cells * sticking to the bottom. Then, evaluating which cells need to be stuck to the bottom. This is * automatically called when the footer row changes its displayed set of columns, or if its * sticky input changes. May be called manually for cases where the cell content changes outside * of these events. * @return {?} */ updateStickyFooterRowStyles() { /** @type {?} */ const footerRows = this._getRenderedRows(this._footerRowOutlet); /** @type {?} */ const tableElement = (/** @type {?} */ (this._elementRef.nativeElement)); // Hide the tfoot element if there are no footer rows. This is necessary to satisfy // overzealous a11y checkers that fail because the `rowgroup` element does not contain // required child `row`. /** @type {?} */ const tfoot = tableElement.querySelector('tfoot'); if (tfoot) { tfoot.style.display = footerRows.length ? '' : 'none'; } /** @type {?} */ const stickyStates = this._footerRowDefs.map((/** * @param {?} def * @return {?} */ def => def.sticky)); this._stickyStyler.clearStickyPositioning(footerRows, ['bottom']); this._stickyStyler.stickRows(footerRows, stickyStates, 'bottom'); this._stickyStyler.updateStickyFooterContainer(this._elementRef.nativeElement, stickyStates); // Reset the dirty state of the sticky input change since it has been used. this._footerRowDefs.forEach((/** * @param {?} def * @return {?} */ def => def.resetStickyChanged())); } /** * Updates the column sticky styles. First resets all applied styles with respect to the cells * sticking to the left and right. Then sticky styles are added for the left and right according * to the column definitions for each cell in each row. This is automatically called when * the data source provides a new set of data or when a column definition changes its sticky * input. May be called manually for cases where the cell content changes outside of these events. * @return {?} */ updateStickyColumnStyles() { /** @type {?} */ const headerRows = this._getRenderedRows(this._headerRowOutlet); /** @type {?} */ const dataRows = this._getRenderedRows(this._rowOutlet); /** @type {?} */ const footerRows = this._getRenderedRows(this._footerRowOutlet); // Clear the left and right positioning from all columns in the table across all rows since // sticky columns span across all table sections (header, data, footer) this._stickyStyler.clearStickyPositioning([...headerRows, ...dataRows, ...footerRows], ['left', 'right']); // Update the sticky styles for each header row depending on the def's sticky state headerRows.forEach((/** * @param {?} headerRow * @param {?} i * @return {?} */ (headerRow, i) => { this._addStickyColumnStyles([headerRow], this._headerRowDefs[i]); })); // Update the sticky styles for each data row depending on its def's sticky state this._rowDefs.forEach((/** * @param {?} rowDef * @return {?} */ rowDef => { // Collect all the rows rendered with this row definition. /** @type {?} */ const rows = []; for (let i = 0; i < dataRows.length; i++) { if (this._renderRows[i].rowDef === rowDef) { rows.push(dataRows[i]); } } this._addStickyColumnStyles(rows, rowDef); })); // Update the sticky styles for each footer row depending on the def's sticky state footerRows.forEach((/** * @param {?} footerRow * @param {?} i * @return {?} */ (footerRow, i) => { this._addStickyColumnStyles([footerRow], this._footerRowDefs[i]); })); // Reset the dirty state of the sticky input change since it has been used. Array.from(this._columnDefsByName.values()).forEach((/** * @param {?} def * @return {?} */ def => def.resetStickyChanged())); } /** * Get the list of RenderRow objects to render according to the current list of data and defined * row definitions. If the previous list already contained a particular pair, it should be reused * so that the differ equates their references. * @private * @return {?} */ _getAllRenderRows() { /** @type {?} */ const renderRows = []; // Store the cache and create a new one. Any re-used RenderRow objects will be moved into the // new cache while unused ones can be picked up by garbage collection. /** @type {?} */ const prevCachedRenderRows = this._cachedRenderRowsMap; this._cachedRenderRowsMap = new Map(); // For each data object, get the list of rows that should be rendered, represented by the // respective `RenderRow` object which is the pair of `data` and `CdkRowDef`. for (let i = 0; i < this._data.length; i++) { /** @type {?} */ let data = this._data[i]; /** @type {?} */ const renderRowsForData = this._getRenderRowsForData(data, i, prevCachedRenderRows.get(data)); if (!this._cachedRenderRowsMap.has(data)) { this._cachedRenderRowsMap.set(data, new WeakMap()); } for (let j = 0; j < renderRowsForData.length; j++) { /** @type {?} */ let renderRow = renderRowsForData[j]; /** @type {?} */ const cache = (/** @type {?} */ (this._cachedRenderRowsMap.get(renderRow.data))); if (cache.has(renderRow.rowDef)) { (/** @type {?} */ (cache.get(renderRow.rowDef))).push(renderRow); } else { cache.set(renderRow.rowDef, [renderRow]); } renderRows.push(renderRow); } } return renderRows; } /** * Gets a list of `RenderRow<T>` for the provided data object and any `CdkRowDef` objects that * should be rendered for this data. Reuses the cached RenderRow objects if they match the same * `(T, CdkRowDef)` pair. * @private * @param {?} data * @param {?} dataIndex * @param {?=} cache * @return {?} */ _getRenderRowsForData(data, dataIndex, cache) { /** @type {?} */ const rowDefs = this._getRowDefs(data, dataIndex); return rowDefs.map((/** * @param {?} rowDef * @return {?} */ rowDef => { /** @type {?} */ const cachedRenderRows = (cache && cache.has(rowDef)) ? (/** @type {?} */ (cache.get(rowDef))) : []; if (cachedRenderRows.length) { /** @type {?} */ const dataRow = (/** @type {?} */ (cachedRenderRows.shift())); dataRow.dataIndex = dataIndex; return dataRow; } else { return { data, rowDef, dataIndex }; } })); } /** * Update the map containing the content's column definitions. * @private * @return {?} */ _cacheColumnDefs() { this._columnDefsByName.clear(); /** @type {?} */ const columnDefs = mergeQueryListAndSet(this._contentColumnDefs, this._customColumnDefs); columnDefs.forEach((/** * @param {?} columnDef * @return {?} */ columnDef => { if (this._columnDefsByName.has(columnDef.name)) { throw getTableDuplicateColumnNameError(columnDef.name); } this._columnDefsByName.set(columnDef.name, columnDef); })); } /** * Update the list of all available row definitions that can be used. * @private * @return {?} */ _cacheRowDefs() { this._headerRowDefs = mergeQueryListAndSet(this._contentHeaderRowDefs, this._customHeaderRowDefs); this._footerRowDefs = mergeQueryListAndSet(this._contentFooterRowDefs, this._customFooterRowDefs); this._rowDefs = mergeQueryListAndSet(this._contentRowDefs, this._customRowDefs); // After all row definitions are determined, find the row definition to be considered default. /** @type {?} */ const defaultRowDefs = this._rowDefs.filter((/** * @param {?} def * @return {?} */ def => !def.when)); if (!this.multiTemplateDataRows && defaultRowDefs.length > 1) { throw getTableMultipleDefaultRowDefsError(); } this._defaultRowDef = defaultRowDefs[0]; } /** * Check if the header, data, or footer rows have changed what columns they want to display or * whether the sticky states have changed for the header or footer. If there is a diff, then * re-render that section. * @private * @return {?} */ _renderUpdatedColumns() { /** @type {?} */ const columnsDiffReducer = (/** * @param {?} acc * @param {?} def * @return {?} */ (acc, def) => acc || !!def.getColumnsDiff()); // Force re-render data rows if the list of column definitions have changed. if (this._rowDefs.reduce(columnsDiffReducer, false)) { this._forceRenderDataRows(); } // Force re-render header/footer rows if the list of column definitions have changed.. if (this._headerRowDefs.reduce(columnsDiffReducer, false)) { this._forceRenderHeaderRows(); } if (this._footerRowDefs.reduce(columnsDiffReducer, false)) { this._forceRenderFooterRows(); } } /** * Switch to the provided data source by resetting the data and unsubscribing from the current * render change subscription if one exists. If the data source is null, interpret this by * clearing the row outlet. Otherwise start listening for new data. * @private * @param {?} dataSource * @return {?} */ _switchDataSource(dataSource) { this._data = []; if (Object(_angular_cdk_collections__WEBPACK_IMPORTED_MODULE_3__["isDataSource"])(this.dataSource)) { this.dataSource.disconnect(this); } // Stop listening for data from the previous data source. if (this._renderChangeSubscription) { this._renderChangeSubscription.unsubscribe(); this._renderChangeSubscription = null; } if (!dataSource) { if (this._dataDiffer) { this._dataDiffer.diff([]); } this._rowOutlet.viewContainer.clear(); } this._dataSource = dataSource; } /** * Set up a subscription for the data provided by the data source. * @private * @return {?} */ _observeRenderChanges() { // If no data source has been set, there is nothing to observe for changes. if (!this.dataSource) { return; } /** @type {?} */ let dataStream; if (Object(_angular_cdk_collections__WEBPACK_IMPORTED_MODULE_3__["isDataSource"])(this.dataSource)) { dataStream = this.dataSource.connect(this); } else if (this.dataSource instanceof rxjs__WEBPACK_IMPORTED_MODULE_6__["Observable"]) { dataStream = this.dataSource; } else if (Array.isArray(this.dataSource)) { dataStream = Object(rxjs__WEBPACK_IMPORTED_MODULE_6__["of"])(this.dataSource); } if (dataStream === undefined) { throw getTableUnknownDataSourceError(); } this._renderChangeSubscription = dataStream.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["takeUntil"])(this._onDestroy)).subscribe((/** * @param {?} data * @return {?} */ data => { this._data = data || []; this.renderRows(); })); } /** * Clears any existing content in the header row outlet and creates a new embedded view * in the outlet using the header row definition. * @private * @return {?} */ _forceRenderHeaderRows() { // Clear the header row outlet if any content exists. if (this._headerRowOutlet.viewContainer.length > 0) { this._headerRowOutlet.viewContainer.clear(); } this._headerRowDefs.forEach((/** * @param {?} def * @param {?} i * @return {?} */ (def, i) => this._renderRow(this._headerRowOutlet, def, i))); this.updateStickyHeaderRowStyles(); this.updateStickyColumnStyles(); } /** * Clears any existing content in the footer row outlet and creates a new embedded view * in the outlet using the footer row definition. * @private * @return {?} */ _forceRenderFooterRows() { // Clear the footer row outlet if any content exists. if (this._footerRowOutlet.viewContainer.length > 0) { this._footerRowOutlet.viewContainer.clear(); } this._footerRowDefs.forEach((/** * @param {?} def * @param {?} i * @return {?} */ (def, i) => this._renderRow(this._footerRowOutlet, def, i))); this.updateStickyFooterRowStyles(); this.updateStickyColumnStyles(); } /** * Adds the sticky column styles for the rows according to the columns' stick states. * @private * @param {?} rows * @param {?} rowDef * @return {?} */ _addStickyColumnStyles(rows, rowDef) { /** @type {?} */ const columnDefs = Array.from(rowDef.columns || []).map((/** * @param {?} columnName * @return {?} */ columnName => { /** @type {?} */ const columnDef = this._columnDefsByName.get(columnName); if (!columnDef) { throw getTableUnknownColumnError(columnName); } return (/** @type {?} */ (columnDef)); })); /** @type {?} */ const stickyStartStates = columnDefs.map((/** * @param {?} columnDef * @return {?} */ columnDef => columnDef.sticky)); /** @type {?} */ const stickyEndStates = columnDefs.map((/** * @param {?} columnDef * @return {?} */ columnDef => columnDef.stickyEnd)); this._stickyStyler.updateStickyColumns(rows, stickyStartStates, stickyEndStates); } /** * Gets the list of rows that have been rendered in the row outlet. * @param {?} rowOutlet * @return {?} */ _getRenderedRows(rowOutlet) { /** @type {?} */ const renderedRows = []; for (let i = 0; i < rowOutlet.viewContainer.length; i++) { /** @type {?} */ const viewRef = ((/** @type {?} */ ((/** @type {?} */ (rowOutlet.viewContainer.get(i)))))); renderedRows.push(viewRef.rootNodes[0]); } return renderedRows; } /** * Get the matching row definitions that should be used for this row data. If there is only * one row definition, it is returned. Otherwise, find the row definitions that has a when * predicate that returns true with the data. If none return true, return the default row * definition. * @param {?} data * @param {?} dataIndex * @return {?} */ _getRowDefs(data, dataIndex) { if (this._rowDefs.length == 1) { return [this._rowDefs[0]]; } /** @type {?} */ let rowDefs = []; if (this.multiTemplateDataRows) { rowDefs = this._rowDefs.filter((/** * @param {?} def * @return {?} */ def => !def.when || def.when(dataIndex, data))); } else { /** @type {?} */ let rowDef = this._rowDefs.find((/** * @param {?} def * @return {?} */ def => def.when && def.when(dataIndex, data))) || this._defaultRowDef; if (rowDef) { rowDefs.push(rowDef); } } if (!rowDefs.length) { throw getTableMissingMatchingRowDefError(data); } return rowDefs; } /** * Create the embedded view for the data row template and place it in the correct index location * within the data row view container. * @private * @param {?} renderRow * @param {?} renderIndex * @return {?} */ _insertRow(renderRow, renderIndex) { /** @type {?} */ const rowDef = renderRow.rowDef; /** @type {?} */ const context = { $implicit: renderRow.data }; this._renderRow(this._rowOutlet, rowDef, renderIndex, context); } /** * Creates a new row template in the outlet and fills it with the set of cell templates. * Optionally takes a context to provide to the row and cells, as well as an optional index * of where to place the new row template in the outlet. * @private * @param {?} outlet * @param {?} rowDef * @param {?} index * @param {?=} context * @return {?} */ _renderRow(outlet, rowDef, index, context = {}) { // TODO(andrewseguin): enforce that one outlet was instantiated from createEmbeddedView outlet.viewContainer.createEmbeddedView(rowDef.template, context, index); for (let cellTemplate of this._getCellTemplates(rowDef)) { if (CdkCellOutlet.mostRecentCellOutlet) { CdkCellOutlet.mostRecentCellOutlet._viewContainer.createEmbeddedView(cellTemplate, context); } } this._changeDetectorRef.markForCheck(); } /** * Updates the index-related context for each row to reflect any changes in the index of the rows, * e.g. first/last/even/odd. * @private * @return {?} */ _updateRowIndexContext() { /** @type {?} */ const viewContainer = this._rowOutlet.viewContainer; for (let renderIndex = 0, count = viewContainer.length; renderIndex < count; renderIndex++) { /** @type {?} */ const viewRef = (/** @type {?} */ (viewContainer.get(renderIndex))); /** @type {?} */ const context = (/** @type {?} */ (viewRef.context)); context.count = count; context.first = renderIndex === 0; context.last = renderIndex === count - 1; context.even = renderIndex % 2 === 0; context.odd = !context.even; if (this.multiTemplateDataRows) { context.dataIndex = this._renderRows[renderIndex].dataIndex; context.renderIndex = renderIndex; } else { context.index = this._renderRows[renderIndex].dataIndex; } } } /** * Gets the column definitions for the provided row def. * @private * @param {?} rowDef * @return {?} */ _getCellTemplates(rowDef) { if (!rowDef || !rowDef.columns) { return []; } return Array.from(rowDef.columns, (/** * @param {?} columnId * @return {?} */ columnId => { /** @type {?} */ const column = this._columnDefsByName.get(columnId); if (!column) { throw getTableUnknownColumnError(columnId); } return rowDef.extractCellTemplate(column); })); } /** * Adds native table sections (e.g. tbody) and moves the row outlets into them. * @private * @return {?} */ _applyNativeTableSections() { /** @type {?} */ const documentFragment = this._document.createDocumentFragment(); /** @type {?} */ const sections = [ { tag: 'thead', outlet: this._headerRowOutlet }, { tag: 'tbody', outlet: this._rowOutlet }, { tag: 'tfoot', outlet: this._footerRowOutlet }, ]; for (const section of sections) { /** @type {?} */ const element = this._document.createElement(section.tag); element.setAttribute('role', 'rowgroup'); element.appendChild(section.outlet.elementRef.nativeElement); documentFragment.appendChild(element); } // Use a DocumentFragment so we don't hit the DOM on each iteration. this._elementRef.nativeElement.appendChild(documentFragment); } /** * Forces a re-render of the data rows. Should be called in cases where there has been an input * change that affects the evaluation of which rows should be rendered, e.g. toggling * `multiTemplateDataRows` or adding/removing row definitions. * @private * @return {?} */ _forceRenderDataRows() { this._dataDiffer.diff([]); this._rowOutlet.viewContainer.clear(); this.renderRows(); this.updateStickyColumnStyles(); } /** * Checks if there has been a change in sticky states since last check and applies the correct * sticky styles. Since checking resets the "dirty" state, this should only be performed once * during a change detection and after the inputs are settled (after content check). * @private * @return {?} */ _checkStickyStates() { /** @type {?} */ const stickyCheckReducer = (/** * @param {?} acc * @param {?} d * @return {?} */ (acc, d) => { return acc || d.hasStickyChanged(); }); // Note that the check needs to occur for every definition since it notifies the definition // that it can reset its dirty state. Using another operator like `some` may short-circuit // remaining definitions and leave them in an unchecked state. if (this._headerRowDefs.reduce(stickyCheckReducer, false)) { this.updateStickyHeaderRowStyles(); } if (this._footerRowDefs.reduce(stickyCheckReducer, false)) { this.updateStickyFooterRowStyles(); } if (Array.from(this._columnDefsByName.values()).reduce(stickyCheckReducer, false)) { this.updateStickyColumnStyles(); } } /** * Creates the sticky styler that will be used for sticky rows and columns. Listens * for directionality changes and provides the latest direction to the styler. Re-applies column * stickiness when directionality changes. * @private * @return {?} */ _setupStickyStyler() { /** @type {?} */ const direction = this._dir ? this._dir.value : 'ltr'; this._stickyStyler = new StickyStyler(this._isNativeHtmlTable, this.stickyCssClass, direction, this._platform.isBrowser); (this._dir ? this._dir.change : Object(rxjs__WEBPACK_IMPORTED_MODULE_6__["of"])()) .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["takeUntil"])(this._onDestroy)) .subscribe((/** * @param {?} value * @return {?} */ value => { this._stickyStyler.direction = value; this.updateStickyColumnStyles(); })); } } CdkTable.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'cdk-table, table[cdk-table]', exportAs: 'cdkTable', template: CDK_TABLE_TEMPLATE, host: { 'class': 'cdk-table', }, encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None, // The "OnPush" status for the `MatTable` component is effectively a noop, so we are removing it. // The view for `MatTable` consists entirely of templates declared in other views. As they are // declared elsewhere, they are checked when their declaration points are checked. // tslint:disable-next-line:validate-decorators changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].Default, },] }, ]; /** @nocollapse */ CdkTable.ctorParameters = () => [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["IterableDiffers"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectorRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] }, { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Attribute"], args: ['role',] }] }, { type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_2__["Directionality"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }] }, { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_5__["DOCUMENT"],] }] }, { type: _angular_cdk_platform__WEBPACK_IMPORTED_MODULE_4__["Platform"] } ]; CdkTable.propDecorators = { trackBy: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }], dataSource: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }], multiTemplateDataRows: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }], _rowOutlet: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"], args: [DataRowOutlet, { static: true },] }], _headerRowOutlet: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"], args: [HeaderRowOutlet, { static: true },] }], _footerRowOutlet: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"], args: [FooterRowOutlet, { static: true },] }], _contentColumnDefs: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChildren"], args: [CdkColumnDef,] }], _contentRowDefs: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChildren"], args: [CdkRowDef,] }], _contentHeaderRowDefs: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChildren"], args: [CdkHeaderRowDef,] }], _contentFooterRowDefs: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChildren"], args: [CdkFooterRowDef,] }] }; /** * Utility function that gets a merged list of the entries in a QueryList and values of a Set. * @template T * @param {?} queryList * @param {?} set * @return {?} */ function mergeQueryListAndSet(queryList, set) { return queryList.toArray().concat(Array.from(set)); } /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Injection token that can be used to specify the text column options. * @type {?} */ const TEXT_COLUMN_OPTIONS = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('text-column-options'); /** * Column that simply shows text content for the header and row cells. Assumes that the table * is using the native table implementation (`<table>`). * * By default, the name of this column will be the header text and data property accessor. * The header text can be overridden with the `headerText` input. Cell values can be overridden with * the `dataAccessor` input. Change the text justification to the start or end using the `justify` * input. * @template T */ class CdkTextColumn { /** * @param {?} _table * @param {?} _options */ constructor(_table, _options) { this._table = _table; this._options = _options; /** * Alignment of the cell values. */ this.justify = 'start'; this._options = _options || {}; } /** * Column name that should be used to reference this column. * @return {?} */ get name() { return this._name; } /** * @param {?} name * @return {?} */ set name(name) { this._name = name; // With Ivy, inputs can be initialized before static query results are // available. In that case, we defer the synchronization until "ngOnInit" fires. this._syncColumnDefName(); } /** * @return {?} */ ngOnInit() { this._syncColumnDefName(); if (this.headerText === undefined) { this.headerText = this._createDefaultHeaderText(); } if (!this.dataAccessor) { this.dataAccessor = this._options.defaultDataAccessor || ((/** * @param {?} data * @param {?} name * @return {?} */ (data, name) => ((/** @type {?} */ (data)))[name])); } if (this._table) { // Provide the cell and headerCell directly to the table with the static `ViewChild` query, // since the columnDef will not pick up its content by the time the table finishes checking // its content and initializing the rows. this.columnDef.cell = this.cell; this.columnDef.headerCell = this.headerCell; this._table.addColumnDef(this.columnDef); } else { throw getTableTextColumnMissingParentTableError(); } } /** * @return {?} */ ngOnDestroy() { if (this._table) { this._table.removeColumnDef(this.columnDef); } } /** * Creates a default header text. Use the options' header text transformation function if one * has been provided. Otherwise simply capitalize the column name. * @return {?} */ _createDefaultHeaderText() { /** @type {?} */ const name = this.name; if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["isDevMode"])() && !name) { throw getTableTextColumnMissingNameError(); } if (this._options && this._options.defaultHeaderTextTransform) { return this._options.defaultHeaderTextTransform(name); } return name[0].toUpperCase() + name.slice(1); } /** * Synchronizes the column definition name with the text column name. * @private * @return {?} */ _syncColumnDefName() { if (this.columnDef) { this.columnDef.name = this.name; } } } CdkTextColumn.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'cdk-text-column', template: ` <ng-container cdkColumnDef> <th cdk-header-cell *cdkHeaderCellDef [style.text-align]="justify"> {{headerText}} </th> <td cdk-cell *cdkCellDef="let data" [style.text-align]="justify"> {{dataAccessor(data, name)}} </td> </ng-container> `, encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None, // Change detection is intentionally not set to OnPush. This component's template will be provided // to the table to be inserted into its view. This is problematic when change detection runs since // the bindings in this template will be evaluated _after_ the table's view is evaluated, which // mean's the template in the table's view will not have the updated value (and in fact will cause // an ExpressionChangedAfterItHasBeenCheckedError). // tslint:disable-next-line:validate-decorators changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].Default, },] }, ]; /** @nocollapse */ CdkTextColumn.ctorParameters = () => [ { type: CdkTable, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }] }, { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [TEXT_COLUMN_OPTIONS,] }] } ]; CdkTextColumn.propDecorators = { name: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }], headerText: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }], dataAccessor: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }], justify: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }], columnDef: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"], args: [CdkColumnDef, { static: true },] }], cell: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"], args: [CdkCellDef, { static: true },] }], headerCell: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"], args: [CdkHeaderCellDef, { static: true },] }] }; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** @type {?} */ const EXPORTED_DECLARATIONS = [ CdkTable, CdkRowDef, CdkCellDef, CdkCellOutlet, CdkHeaderCellDef, CdkFooterCellDef, CdkColumnDef, CdkCell, CdkRow, CdkHeaderCell, CdkFooterCell, CdkHeaderRow, CdkHeaderRowDef, CdkFooterRow, CdkFooterRowDef, DataRowOutlet, HeaderRowOutlet, FooterRowOutlet, CdkTextColumn, ]; class CdkTableModule { } CdkTableModule.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{ imports: [_angular_common__WEBPACK_IMPORTED_MODULE_5__["CommonModule"]], exports: EXPORTED_DECLARATIONS, declarations: EXPORTED_DECLARATIONS },] }, ]; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ //# sourceMappingURL=table.js.map /***/ }), /***/ "./node_modules/@angular/material/esm2015/paginator.js": /*!*************************************************************!*\ !*** ./node_modules/@angular/material/esm2015/paginator.js ***! \*************************************************************/ /*! exports provided: MatPaginatorModule, PageEvent, MatPaginator, MAT_PAGINATOR_INTL_PROVIDER_FACTORY, MatPaginatorIntl, MAT_PAGINATOR_INTL_PROVIDER */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatPaginatorModule", function() { return MatPaginatorModule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PageEvent", function() { return PageEvent; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatPaginator", function() { return MatPaginator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_PAGINATOR_INTL_PROVIDER_FACTORY", function() { return MAT_PAGINATOR_INTL_PROVIDER_FACTORY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatPaginatorIntl", function() { return MatPaginatorIntl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_PAGINATOR_INTL_PROVIDER", function() { return MAT_PAGINATOR_INTL_PROVIDER; }); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm2015/core.js"); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm2015/index.js"); /* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm2015/coercion.js"); /* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm2015/core.js"); /* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm2015/common.js"); /* harmony import */ var _angular_material_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/material/button */ "./node_modules/@angular/material/esm2015/button.js"); /* harmony import */ var _angular_material_select__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/material/select */ "./node_modules/@angular/material/esm2015/select.js"); /* harmony import */ var _angular_material_tooltip__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/material/tooltip */ "./node_modules/@angular/material/esm2015/tooltip.js"); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * To modify the labels and text displayed, create a new instance of MatPaginatorIntl and * include it in a custom provider */ class MatPaginatorIntl { constructor() { /** * Stream to emit from when labels are changed. Use this to notify components when the labels have * changed after initialization. */ this.changes = new rxjs__WEBPACK_IMPORTED_MODULE_1__["Subject"](); /** * A label for the page size selector. */ this.itemsPerPageLabel = 'Items per page:'; /** * A label for the button that increments the current page. */ this.nextPageLabel = 'Next page'; /** * A label for the button that decrements the current page. */ this.previousPageLabel = 'Previous page'; /** * A label for the button that moves to the first page. */ this.firstPageLabel = 'First page'; /** * A label for the button that moves to the last page. */ this.lastPageLabel = 'Last page'; /** * A label for the range of items within the current page and the length of the whole list. */ this.getRangeLabel = (/** * @param {?} page * @param {?} pageSize * @param {?} length * @return {?} */ (page, pageSize, length) => { if (length == 0 || pageSize == 0) { return `0 of ${length}`; } length = Math.max(length, 0); /** @type {?} */ const startIndex = page * pageSize; // If the start index exceeds the list length, do not try and fix the end index to the end. /** @type {?} */ const endIndex = startIndex < length ? Math.min(startIndex + pageSize, length) : startIndex + pageSize; return `${startIndex + 1} - ${endIndex} of ${length}`; }); } } MatPaginatorIntl.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"], args: [{ providedIn: 'root' },] }, ]; /** @nocollapse */ MatPaginatorIntl.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"])({ factory: function MatPaginatorIntl_Factory() { return new MatPaginatorIntl(); }, token: MatPaginatorIntl, providedIn: "root" }); /** * \@docs-private * @param {?} parentIntl * @return {?} */ function MAT_PAGINATOR_INTL_PROVIDER_FACTORY(parentIntl) { return parentIntl || new MatPaginatorIntl(); } /** * \@docs-private * @type {?} */ const MAT_PAGINATOR_INTL_PROVIDER = { // If there is already an MatPaginatorIntl available, use that. Otherwise, provide a new one. provide: MatPaginatorIntl, deps: [[new _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"](), new _angular_core__WEBPACK_IMPORTED_MODULE_0__["SkipSelf"](), MatPaginatorIntl]], useFactory: MAT_PAGINATOR_INTL_PROVIDER_FACTORY }; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * The default page size if there is no page size and there are no provided page size options. * @type {?} */ const DEFAULT_PAGE_SIZE = 50; /** * Change event object that is emitted when the user selects a * different page size or navigates to another page. */ class PageEvent { } // Boilerplate for applying mixins to MatPaginator. /** * \@docs-private */ class MatPaginatorBase { } /** @type {?} */ const _MatPaginatorBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["mixinDisabled"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["mixinInitialized"])(MatPaginatorBase)); /** * Component to provide navigation between paged information. Displays the size of the current * page, user-selectable options to change that size, what items are being shown, and * navigational button to go to the previous or next page. */ class MatPaginator extends _MatPaginatorBase { /** * @param {?} _intl * @param {?} _changeDetectorRef */ constructor(_intl, _changeDetectorRef) { super(); this._intl = _intl; this._changeDetectorRef = _changeDetectorRef; this._pageIndex = 0; this._length = 0; this._pageSizeOptions = []; this._hidePageSize = false; this._showFirstLastButtons = false; /** * Event emitted when the paginator changes the page size or page index. */ this.page = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"](); this._intlChanges = _intl.changes.subscribe((/** * @return {?} */ () => this._changeDetectorRef.markForCheck())); } /** * The zero-based page index of the displayed list of items. Defaulted to 0. * @return {?} */ get pageIndex() { return this._pageIndex; } /** * @param {?} value * @return {?} */ set pageIndex(value) { this._pageIndex = Math.max(Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__["coerceNumberProperty"])(value), 0); this._changeDetectorRef.markForCheck(); } /** * The length of the total number of items that are being paginated. Defaulted to 0. * @return {?} */ get length() { return this._length; } /** * @param {?} value * @return {?} */ set length(value) { this._length = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__["coerceNumberProperty"])(value); this._changeDetectorRef.markForCheck(); } /** * Number of items to display on a page. By default set to 50. * @return {?} */ get pageSize() { return this._pageSize; } /** * @param {?} value * @return {?} */ set pageSize(value) { this._pageSize = Math.max(Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__["coerceNumberProperty"])(value), 0); this._updateDisplayedPageSizeOptions(); } /** * The set of provided page size options to display to the user. * @return {?} */ get pageSizeOptions() { return this._pageSizeOptions; } /** * @param {?} value * @return {?} */ set pageSizeOptions(value) { this._pageSizeOptions = (value || []).map((/** * @param {?} p * @return {?} */ p => Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__["coerceNumberProperty"])(p))); this._updateDisplayedPageSizeOptions(); } /** * Whether to hide the page size selection UI from the user. * @return {?} */ get hidePageSize() { return this._hidePageSize; } /** * @param {?} value * @return {?} */ set hidePageSize(value) { this._hidePageSize = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__["coerceBooleanProperty"])(value); } /** * Whether to show the first/last buttons UI to the user. * @return {?} */ get showFirstLastButtons() { return this._showFirstLastButtons; } /** * @param {?} value * @return {?} */ set showFirstLastButtons(value) { this._showFirstLastButtons = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_2__["coerceBooleanProperty"])(value); } /** * @return {?} */ ngOnInit() { this._initialized = true; this._updateDisplayedPageSizeOptions(); this._markInitialized(); } /** * @return {?} */ ngOnDestroy() { this._intlChanges.unsubscribe(); } /** * Advances to the next page if it exists. * @return {?} */ nextPage() { if (!this.hasNextPage()) { return; } /** @type {?} */ const previousPageIndex = this.pageIndex; this.pageIndex++; this._emitPageEvent(previousPageIndex); } /** * Move back to the previous page if it exists. * @return {?} */ previousPage() { if (!this.hasPreviousPage()) { return; } /** @type {?} */ const previousPageIndex = this.pageIndex; this.pageIndex--; this._emitPageEvent(previousPageIndex); } /** * Move to the first page if not already there. * @return {?} */ firstPage() { // hasPreviousPage being false implies at the start if (!this.hasPreviousPage()) { return; } /** @type {?} */ const previousPageIndex = this.pageIndex; this.pageIndex = 0; this._emitPageEvent(previousPageIndex); } /** * Move to the last page if not already there. * @return {?} */ lastPage() { // hasNextPage being false implies at the end if (!this.hasNextPage()) { return; } /** @type {?} */ const previousPageIndex = this.pageIndex; this.pageIndex = this.getNumberOfPages() - 1; this._emitPageEvent(previousPageIndex); } /** * Whether there is a previous page. * @return {?} */ hasPreviousPage() { return this.pageIndex >= 1 && this.pageSize != 0; } /** * Whether there is a next page. * @return {?} */ hasNextPage() { /** @type {?} */ const maxPageIndex = this.getNumberOfPages() - 1; return this.pageIndex < maxPageIndex && this.pageSize != 0; } /** * Calculate the number of pages * @return {?} */ getNumberOfPages() { if (!this.pageSize) { return 0; } return Math.ceil(this.length / this.pageSize); } /** * Changes the page size so that the first item displayed on the page will still be * displayed using the new page size. * * For example, if the page size is 10 and on the second page (items indexed 10-19) then * switching so that the page size is 5 will set the third page as the current page so * that the 10th item will still be displayed. * @param {?} pageSize * @return {?} */ _changePageSize(pageSize) { // Current page needs to be updated to reflect the new page size. Navigate to the page // containing the previous page's first item. /** @type {?} */ const startIndex = this.pageIndex * this.pageSize; /** @type {?} */ const previousPageIndex = this.pageIndex; this.pageIndex = Math.floor(startIndex / pageSize) || 0; this.pageSize = pageSize; this._emitPageEvent(previousPageIndex); } /** * Checks whether the buttons for going forwards should be disabled. * @return {?} */ _nextButtonsDisabled() { return this.disabled || !this.hasNextPage(); } /** * Checks whether the buttons for going backwards should be disabled. * @return {?} */ _previousButtonsDisabled() { return this.disabled || !this.hasPreviousPage(); } /** * Updates the list of page size options to display to the user. Includes making sure that * the page size is an option and that the list is sorted. * @private * @return {?} */ _updateDisplayedPageSizeOptions() { if (!this._initialized) { return; } // If no page size is provided, use the first page size option or the default page size. if (!this.pageSize) { this._pageSize = this.pageSizeOptions.length != 0 ? this.pageSizeOptions[0] : DEFAULT_PAGE_SIZE; } this._displayedPageSizeOptions = this.pageSizeOptions.slice(); if (this._displayedPageSizeOptions.indexOf(this.pageSize) === -1) { this._displayedPageSizeOptions.push(this.pageSize); } // Sort the numbers using a number-specific sort function. this._displayedPageSizeOptions.sort((/** * @param {?} a * @param {?} b * @return {?} */ (a, b) => a - b)); this._changeDetectorRef.markForCheck(); } /** * Emits an event notifying that a change of the paginator's properties has been triggered. * @private * @param {?} previousPageIndex * @return {?} */ _emitPageEvent(previousPageIndex) { this.page.emit({ previousPageIndex, pageIndex: this.pageIndex, pageSize: this.pageSize, length: this.length }); } } MatPaginator.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"], args: [{selector: 'mat-paginator', exportAs: 'matPaginator', template: "<div class=\"mat-paginator-outer-container\"><div class=\"mat-paginator-container\"><div class=\"mat-paginator-page-size\" *ngIf=\"!hidePageSize\"><div class=\"mat-paginator-page-size-label\">{{_intl.itemsPerPageLabel}}</div><mat-form-field *ngIf=\"_displayedPageSizeOptions.length > 1\" [color]=\"color\" class=\"mat-paginator-page-size-select\"><mat-select [value]=\"pageSize\" [disabled]=\"disabled\" [aria-label]=\"_intl.itemsPerPageLabel\" (selectionChange)=\"_changePageSize($event.value)\"><mat-option *ngFor=\"let pageSizeOption of _displayedPageSizeOptions\" [value]=\"pageSizeOption\">{{pageSizeOption}}</mat-option></mat-select></mat-form-field><div *ngIf=\"_displayedPageSizeOptions.length <= 1\">{{pageSize}}</div></div><div class=\"mat-paginator-range-actions\"><div class=\"mat-paginator-range-label\">{{_intl.getRangeLabel(pageIndex, pageSize, length)}}</div><button mat-icon-button type=\"button\" class=\"mat-paginator-navigation-first\" (click)=\"firstPage()\" [attr.aria-label]=\"_intl.firstPageLabel\" [matTooltip]=\"_intl.firstPageLabel\" [matTooltipDisabled]=\"_previousButtonsDisabled()\" [matTooltipPosition]=\"'above'\" [disabled]=\"_previousButtonsDisabled()\" *ngIf=\"showFirstLastButtons\"><svg class=\"mat-paginator-icon\" viewBox=\"0 0 24 24\" focusable=\"false\"><path d=\"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z\"/></svg></button> <button mat-icon-button type=\"button\" class=\"mat-paginator-navigation-previous\" (click)=\"previousPage()\" [attr.aria-label]=\"_intl.previousPageLabel\" [matTooltip]=\"_intl.previousPageLabel\" [matTooltipDisabled]=\"_previousButtonsDisabled()\" [matTooltipPosition]=\"'above'\" [disabled]=\"_previousButtonsDisabled()\"><svg class=\"mat-paginator-icon\" viewBox=\"0 0 24 24\" focusable=\"false\"><path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"/></svg></button> <button mat-icon-button type=\"button\" class=\"mat-paginator-navigation-next\" (click)=\"nextPage()\" [attr.aria-label]=\"_intl.nextPageLabel\" [matTooltip]=\"_intl.nextPageLabel\" [matTooltipDisabled]=\"_nextButtonsDisabled()\" [matTooltipPosition]=\"'above'\" [disabled]=\"_nextButtonsDisabled()\"><svg class=\"mat-paginator-icon\" viewBox=\"0 0 24 24\" focusable=\"false\"><path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"/></svg></button> <button mat-icon-button type=\"button\" class=\"mat-paginator-navigation-last\" (click)=\"lastPage()\" [attr.aria-label]=\"_intl.lastPageLabel\" [matTooltip]=\"_intl.lastPageLabel\" [matTooltipDisabled]=\"_nextButtonsDisabled()\" [matTooltipPosition]=\"'above'\" [disabled]=\"_nextButtonsDisabled()\" *ngIf=\"showFirstLastButtons\"><svg class=\"mat-paginator-icon\" viewBox=\"0 0 24 24\" focusable=\"false\"><path d=\"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z\"/></svg></button></div></div></div>", styles: [".mat-paginator{display:block}.mat-paginator-outer-container{display:flex}.mat-paginator-container{display:flex;align-items:center;justify-content:flex-end;min-height:56px;padding:0 8px;flex-wrap:wrap-reverse;width:100%}.mat-paginator-page-size{display:flex;align-items:baseline;margin-right:8px}[dir=rtl] .mat-paginator-page-size{margin-right:0;margin-left:8px}.mat-paginator-page-size-label{margin:0 4px}.mat-paginator-page-size-select{margin:6px 4px 0 4px;width:56px}.mat-paginator-page-size-select.mat-form-field-appearance-outline{width:64px}.mat-paginator-page-size-select.mat-form-field-appearance-fill{width:64px}.mat-paginator-range-label{margin:0 32px 0 24px}.mat-paginator-range-actions{display:flex;align-items:center}.mat-paginator-icon{width:28px;fill:currentColor}[dir=rtl] .mat-paginator-icon{transform:rotate(180deg)}"], inputs: ['disabled'], host: { 'class': 'mat-paginator', }, changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectionStrategy"].OnPush, encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None, },] }, ]; /** @nocollapse */ MatPaginator.ctorParameters = () => [ { type: MatPaginatorIntl }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectorRef"] } ]; MatPaginator.propDecorators = { color: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }], pageIndex: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }], length: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }], pageSize: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }], pageSizeOptions: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }], hidePageSize: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }], showFirstLastButtons: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }], page: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"] }] }; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class MatPaginatorModule { } MatPaginatorModule.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"], args: [{ imports: [ _angular_common__WEBPACK_IMPORTED_MODULE_4__["CommonModule"], _angular_material_button__WEBPACK_IMPORTED_MODULE_5__["MatButtonModule"], _angular_material_select__WEBPACK_IMPORTED_MODULE_6__["MatSelectModule"], _angular_material_tooltip__WEBPACK_IMPORTED_MODULE_7__["MatTooltipModule"], ], exports: [MatPaginator], declarations: [MatPaginator], providers: [MAT_PAGINATOR_INTL_PROVIDER], },] }, ]; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ //# sourceMappingURL=paginator.js.map /***/ }), /***/ "./node_modules/@angular/material/esm2015/sort.js": /*!********************************************************!*\ !*** ./node_modules/@angular/material/esm2015/sort.js ***! \********************************************************/ /*! exports provided: MatSortModule, MatSortHeader, MAT_SORT_HEADER_INTL_PROVIDER_FACTORY, MatSortHeaderIntl, MAT_SORT_HEADER_INTL_PROVIDER, MatSort, matSortAnimations */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSortModule", function() { return MatSortModule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSortHeader", function() { return MatSortHeader; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_SORT_HEADER_INTL_PROVIDER_FACTORY", function() { return MAT_SORT_HEADER_INTL_PROVIDER_FACTORY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSortHeaderIntl", function() { return MatSortHeaderIntl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAT_SORT_HEADER_INTL_PROVIDER", function() { return MAT_SORT_HEADER_INTL_PROVIDER; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatSort", function() { return MatSort; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matSortAnimations", function() { return matSortAnimations; }); /* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm2015/coercion.js"); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm2015/core.js"); /* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm2015/core.js"); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm2015/index.js"); /* harmony import */ var _angular_animations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/animations */ "./node_modules/@angular/animations/fesm2015/animations.js"); /* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm2015/common.js"); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * \@docs-private * @param {?} id * @return {?} */ function getSortDuplicateSortableIdError(id) { return Error(`Cannot have two MatSortables with the same id (${id}).`); } /** * \@docs-private * @return {?} */ function getSortHeaderNotContainedWithinSortError() { return Error(`MatSortHeader must be placed within a parent element with the MatSort directive.`); } /** * \@docs-private * @return {?} */ function getSortHeaderMissingIdError() { return Error(`MatSortHeader must be provided with a unique id.`); } /** * \@docs-private * @param {?} direction * @return {?} */ function getSortInvalidDirectionError(direction) { return Error(`${direction} is not a valid sort direction ('asc' or 'desc').`); } /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ // Boilerplate for applying mixins to MatSort. /** * \@docs-private */ class MatSortBase { } /** @type {?} */ const _MatSortMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["mixinInitialized"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["mixinDisabled"])(MatSortBase)); /** * Container for MatSortables to manage the sort state and provide default sort parameters. */ class MatSort extends _MatSortMixinBase { constructor() { super(...arguments); /** * Collection of all registered sortables that this directive manages. */ this.sortables = new Map(); /** * Used to notify any child components listening to state changes. */ this._stateChanges = new rxjs__WEBPACK_IMPORTED_MODULE_3__["Subject"](); /** * The direction to set when an MatSortable is initially sorted. * May be overriden by the MatSortable's sort start. */ this.start = 'asc'; this._direction = ''; /** * Event emitted when the user changes either the active sort or sort direction. */ this.sortChange = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"](); } /** * The sort direction of the currently active MatSortable. * @return {?} */ get direction() { return this._direction; } /** * @param {?} direction * @return {?} */ set direction(direction) { if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["isDevMode"])() && direction && direction !== 'asc' && direction !== 'desc') { throw getSortInvalidDirectionError(direction); } this._direction = direction; } /** * Whether to disable the user from clearing the sort by finishing the sort direction cycle. * May be overriden by the MatSortable's disable clear input. * @return {?} */ get disableClear() { return this._disableClear; } /** * @param {?} v * @return {?} */ set disableClear(v) { this._disableClear = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_0__["coerceBooleanProperty"])(v); } /** * Register function to be used by the contained MatSortables. Adds the MatSortable to the * collection of MatSortables. * @param {?} sortable * @return {?} */ register(sortable) { if (!sortable.id) { throw getSortHeaderMissingIdError(); } if (this.sortables.has(sortable.id)) { throw getSortDuplicateSortableIdError(sortable.id); } this.sortables.set(sortable.id, sortable); } /** * Unregister function to be used by the contained MatSortables. Removes the MatSortable from the * collection of contained MatSortables. * @param {?} sortable * @return {?} */ deregister(sortable) { this.sortables.delete(sortable.id); } /** * Sets the active sort id and determines the new sort direction. * @param {?} sortable * @return {?} */ sort(sortable) { if (this.active != sortable.id) { this.active = sortable.id; this.direction = sortable.start ? sortable.start : this.start; } else { this.direction = this.getNextSortDirection(sortable); } this.sortChange.emit({ active: this.active, direction: this.direction }); } /** * Returns the next sort direction of the active sortable, checking for potential overrides. * @param {?} sortable * @return {?} */ getNextSortDirection(sortable) { if (!sortable) { return ''; } // Get the sort direction cycle with the potential sortable overrides. /** @type {?} */ const disableClear = sortable.disableClear != null ? sortable.disableClear : this.disableClear; /** @type {?} */ let sortDirectionCycle = getSortDirectionCycle(sortable.start || this.start, disableClear); // Get and return the next direction in the cycle /** @type {?} */ let nextDirectionIndex = sortDirectionCycle.indexOf(this.direction) + 1; if (nextDirectionIndex >= sortDirectionCycle.length) { nextDirectionIndex = 0; } return sortDirectionCycle[nextDirectionIndex]; } /** * @return {?} */ ngOnInit() { this._markInitialized(); } /** * @return {?} */ ngOnChanges() { this._stateChanges.next(); } /** * @return {?} */ ngOnDestroy() { this._stateChanges.complete(); } } MatSort.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[matSort]', exportAs: 'matSort', inputs: ['disabled: matSortDisabled'] },] }, ]; MatSort.propDecorators = { active: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['matSortActive',] }], start: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['matSortStart',] }], direction: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['matSortDirection',] }], disableClear: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['matSortDisableClear',] }], sortChange: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"], args: ['matSortChange',] }] }; /** * Returns the sort direction cycle to use given the provided parameters of order and clear. * @param {?} start * @param {?} disableClear * @return {?} */ function getSortDirectionCycle(start, disableClear) { /** @type {?} */ let sortOrder = ['asc', 'desc']; if (start == 'desc') { sortOrder.reverse(); } if (!disableClear) { sortOrder.push(''); } return sortOrder; } /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** @type {?} */ const SORT_ANIMATION_TRANSITION = _angular_material_core__WEBPACK_IMPORTED_MODULE_2__["AnimationDurations"].ENTERING + ' ' + _angular_material_core__WEBPACK_IMPORTED_MODULE_2__["AnimationCurves"].STANDARD_CURVE; /** * Animations used by MatSort. * \@docs-private * @type {?} */ const matSortAnimations = { /** * Animation that moves the sort indicator. */ indicator: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["trigger"])('indicator', [ Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["state"])('active-asc, asc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ transform: 'translateY(0px)' })), // 10px is the height of the sort indicator, minus the width of the pointers Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["state"])('active-desc, desc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ transform: 'translateY(10px)' })), Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["transition"])('active-asc <=> active-desc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["animate"])(SORT_ANIMATION_TRANSITION)) ]), /** * Animation that rotates the left pointer of the indicator based on the sorting direction. */ leftPointer: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["trigger"])('leftPointer', [ Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["state"])('active-asc, asc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ transform: 'rotate(-45deg)' })), Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["state"])('active-desc, desc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ transform: 'rotate(45deg)' })), Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["transition"])('active-asc <=> active-desc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["animate"])(SORT_ANIMATION_TRANSITION)) ]), /** * Animation that rotates the right pointer of the indicator based on the sorting direction. */ rightPointer: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["trigger"])('rightPointer', [ Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["state"])('active-asc, asc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ transform: 'rotate(45deg)' })), Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["state"])('active-desc, desc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ transform: 'rotate(-45deg)' })), Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["transition"])('active-asc <=> active-desc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["animate"])(SORT_ANIMATION_TRANSITION)) ]), /** * Animation that controls the arrow opacity. */ arrowOpacity: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["trigger"])('arrowOpacity', [ Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["state"])('desc-to-active, asc-to-active, active', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ opacity: 1 })), Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["state"])('desc-to-hint, asc-to-hint, hint', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ opacity: .54 })), Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["state"])('hint-to-desc, active-to-desc, desc, hint-to-asc, active-to-asc, asc, void', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ opacity: 0 })), // Transition between all states except for immediate transitions Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["transition"])('* => asc, * => desc, * => active, * => hint, * => void', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["animate"])('0ms')), Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["transition"])('* <=> *', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["animate"])(SORT_ANIMATION_TRANSITION)), ]), /** * Animation for the translation of the arrow as a whole. States are separated into two * groups: ones with animations and others that are immediate. Immediate states are asc, desc, * peek, and active. The other states define a specific animation (source-to-destination) * and are determined as a function of their prev user-perceived state and what the next state * should be. */ arrowPosition: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["trigger"])('arrowPosition', [ // Hidden Above => Hint Center Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["transition"])('* => desc-to-hint, * => desc-to-active', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["animate"])(SORT_ANIMATION_TRANSITION, Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["keyframes"])([ Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ transform: 'translateY(-25%)' }), Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ transform: 'translateY(0)' }) ]))), // Hint Center => Hidden Below Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["transition"])('* => hint-to-desc, * => active-to-desc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["animate"])(SORT_ANIMATION_TRANSITION, Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["keyframes"])([ Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ transform: 'translateY(0)' }), Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ transform: 'translateY(25%)' }) ]))), // Hidden Below => Hint Center Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["transition"])('* => asc-to-hint, * => asc-to-active', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["animate"])(SORT_ANIMATION_TRANSITION, Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["keyframes"])([ Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ transform: 'translateY(25%)' }), Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ transform: 'translateY(0)' }) ]))), // Hint Center => Hidden Above Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["transition"])('* => hint-to-asc, * => active-to-asc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["animate"])(SORT_ANIMATION_TRANSITION, Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["keyframes"])([ Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ transform: 'translateY(0)' }), Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ transform: 'translateY(-25%)' }) ]))), Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["state"])('desc-to-hint, asc-to-hint, hint, desc-to-active, asc-to-active, active', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ transform: 'translateY(0)' })), Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["state"])('hint-to-desc, active-to-desc, desc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ transform: 'translateY(-25%)' })), Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["state"])('hint-to-asc, active-to-asc, asc', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["style"])({ transform: 'translateY(25%)' })), ]), /** * Necessary trigger that calls animate on children animations. */ allowChildren: Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["trigger"])('allowChildren', [ Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["transition"])('* <=> *', [ Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["query"])('@*', Object(_angular_animations__WEBPACK_IMPORTED_MODULE_4__["animateChild"])(), { optional: true }) ]) ]), }; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * To modify the labels and text displayed, create a new instance of MatSortHeaderIntl and * include it in a custom provider. */ class MatSortHeaderIntl { constructor() { /** * Stream that emits whenever the labels here are changed. Use this to notify * components if the labels have changed after initialization. */ this.changes = new rxjs__WEBPACK_IMPORTED_MODULE_3__["Subject"](); /** * ARIA label for the sorting button. */ this.sortButtonLabel = (/** * @param {?} id * @return {?} */ (id) => { return `Change sorting for ${id}`; }); } } MatSortHeaderIntl.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"], args: [{ providedIn: 'root' },] }, ]; /** @nocollapse */ MatSortHeaderIntl.ngInjectableDef = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"])({ factory: function MatSortHeaderIntl_Factory() { return new MatSortHeaderIntl(); }, token: MatSortHeaderIntl, providedIn: "root" }); /** * \@docs-private * @param {?} parentIntl * @return {?} */ function MAT_SORT_HEADER_INTL_PROVIDER_FACTORY(parentIntl) { return parentIntl || new MatSortHeaderIntl(); } /** * \@docs-private * @type {?} */ const MAT_SORT_HEADER_INTL_PROVIDER = { // If there is already an MatSortHeaderIntl available, use that. Otherwise, provide a new one. provide: MatSortHeaderIntl, deps: [[new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"](), new _angular_core__WEBPACK_IMPORTED_MODULE_1__["SkipSelf"](), MatSortHeaderIntl]], useFactory: MAT_SORT_HEADER_INTL_PROVIDER_FACTORY }; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ // Boilerplate for applying mixins to the sort header. /** * \@docs-private */ class MatSortHeaderBase { } /** @type {?} */ const _MatSortHeaderMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_2__["mixinDisabled"])(MatSortHeaderBase); /** * Applies sorting behavior (click to change sort) and styles to an element, including an * arrow to display the current sort direction. * * Must be provided with an id and contained within a parent MatSort directive. * * If used on header cells in a CdkTable, it will automatically default its id from its containing * column definition. */ class MatSortHeader extends _MatSortHeaderMixinBase { /** * @param {?} _intl * @param {?} changeDetectorRef * @param {?} _sort * @param {?} _columnDef */ constructor(_intl, changeDetectorRef, _sort, _columnDef) { // Note that we use a string token for the `_columnDef`, because the value is provided both by // `material/table` and `cdk/table` and we can't have the CDK depending on Material, // and we want to avoid having the sort header depending on the CDK table because // of this single reference. super(); this._intl = _intl; this._sort = _sort; this._columnDef = _columnDef; /** * Flag set to true when the indicator should be displayed while the sort is not active. Used to * provide an affordance that the header is sortable by showing on focus and hover. */ this._showIndicatorHint = false; /** * The direction the arrow should be facing according to the current state. */ this._arrowDirection = ''; /** * Whether the view state animation should show the transition between the `from` and `to` states. */ this._disableViewStateAnimation = false; /** * Sets the position of the arrow that displays when sorted. */ this.arrowPosition = 'after'; if (!_sort) { throw getSortHeaderNotContainedWithinSortError(); } this._rerenderSubscription = Object(rxjs__WEBPACK_IMPORTED_MODULE_3__["merge"])(_sort.sortChange, _sort._stateChanges, _intl.changes) .subscribe((/** * @return {?} */ () => { if (this._isSorted()) { this._updateArrowDirection(); } // If this header was recently active and now no longer sorted, animate away the arrow. if (!this._isSorted() && this._viewState && this._viewState.toState === 'active') { this._disableViewStateAnimation = false; this._setAnimationTransitionState({ fromState: 'active', toState: this._arrowDirection }); } changeDetectorRef.markForCheck(); })); } /** * Overrides the disable clear value of the containing MatSort for this MatSortable. * @return {?} */ get disableClear() { return this._disableClear; } /** * @param {?} v * @return {?} */ set disableClear(v) { this._disableClear = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_0__["coerceBooleanProperty"])(v); } /** * @return {?} */ ngOnInit() { if (!this.id && this._columnDef) { this.id = this._columnDef.name; } // Initialize the direction of the arrow and set the view state to be immediately that state. this._updateArrowDirection(); this._setAnimationTransitionState({ toState: this._isSorted() ? 'active' : this._arrowDirection }); this._sort.register(this); } /** * @return {?} */ ngOnDestroy() { this._sort.deregister(this); this._rerenderSubscription.unsubscribe(); } /** * Sets the "hint" state such that the arrow will be semi-transparently displayed as a hint to the * user showing what the active sort will become. If set to false, the arrow will fade away. * @param {?} visible * @return {?} */ _setIndicatorHintVisible(visible) { // No-op if the sort header is disabled - should not make the hint visible. if (this._isDisabled() && visible) { return; } this._showIndicatorHint = visible; if (!this._isSorted()) { this._updateArrowDirection(); if (this._showIndicatorHint) { this._setAnimationTransitionState({ fromState: this._arrowDirection, toState: 'hint' }); } else { this._setAnimationTransitionState({ fromState: 'hint', toState: this._arrowDirection }); } } } /** * Sets the animation transition view state for the arrow's position and opacity. If the * `disableViewStateAnimation` flag is set to true, the `fromState` will be ignored so that * no animation appears. * @param {?} viewState * @return {?} */ _setAnimationTransitionState(viewState) { this._viewState = viewState; // If the animation for arrow position state (opacity/translation) should be disabled, // remove the fromState so that it jumps right to the toState. if (this._disableViewStateAnimation) { this._viewState = { toState: viewState.toState }; } } /** * Triggers the sort on this sort header and removes the indicator hint. * @return {?} */ _handleClick() { if (this._isDisabled()) { return; } this._sort.sort(this); // Do not show the animation if the header was already shown in the right position. if (this._viewState.toState === 'hint' || this._viewState.toState === 'active') { this._disableViewStateAnimation = true; } // If the arrow is now sorted, animate the arrow into place. Otherwise, animate it away into // the direction it is facing. /** @type {?} */ const viewState = this._isSorted() ? { fromState: this._arrowDirection, toState: 'active' } : { fromState: 'active', toState: this._arrowDirection }; this._setAnimationTransitionState(viewState); this._showIndicatorHint = false; } /** * Whether this MatSortHeader is currently sorted in either ascending or descending order. * @return {?} */ _isSorted() { return this._sort.active == this.id && (this._sort.direction === 'asc' || this._sort.direction === 'desc'); } /** * Returns the animation state for the arrow direction (indicator and pointers). * @return {?} */ _getArrowDirectionState() { return `${this._isSorted() ? 'active-' : ''}${this._arrowDirection}`; } /** * Returns the arrow position state (opacity, translation). * @return {?} */ _getArrowViewState() { /** @type {?} */ const fromState = this._viewState.fromState; return (fromState ? `${fromState}-to-` : '') + this._viewState.toState; } /** * Updates the direction the arrow should be pointing. If it is not sorted, the arrow should be * facing the start direction. Otherwise if it is sorted, the arrow should point in the currently * active sorted direction. The reason this is updated through a function is because the direction * should only be changed at specific times - when deactivated but the hint is displayed and when * the sort is active and the direction changes. Otherwise the arrow's direction should linger * in cases such as the sort becoming deactivated but we want to animate the arrow away while * preserving its direction, even though the next sort direction is actually different and should * only be changed once the arrow displays again (hint or activation). * @return {?} */ _updateArrowDirection() { this._arrowDirection = this._isSorted() ? this._sort.direction : (this.start || this._sort.start); } /** * @return {?} */ _isDisabled() { return this._sort.disabled || this.disabled; } /** * Gets the aria-sort attribute that should be applied to this sort header. If this header * is not sorted, returns null so that the attribute is removed from the host element. Aria spec * says that the aria-sort property should only be present on one header at a time, so removing * ensures this is true. * @return {?} */ _getAriaSortAttribute() { if (!this._isSorted()) { return null; } return this._sort.direction == 'asc' ? 'ascending' : 'descending'; } /** * Whether the arrow inside the sort header should be rendered. * @return {?} */ _renderArrow() { return !this._isDisabled() || this._isSorted(); } } MatSortHeader.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: '[mat-sort-header]', exportAs: 'matSortHeader', template: "<div class=\"mat-sort-header-container\" [class.mat-sort-header-sorted]=\"_isSorted()\" [class.mat-sort-header-position-before]=\"arrowPosition == 'before'\"><button class=\"mat-sort-header-button\" type=\"button\" [attr.disabled]=\"_isDisabled() || null\" [attr.aria-label]=\"_intl.sortButtonLabel(id)\" (focus)=\"_setIndicatorHintVisible(true)\" (blur)=\"_setIndicatorHintVisible(false)\"><ng-content></ng-content></button><div class=\"mat-sort-header-arrow\" *ngIf=\"_renderArrow()\" [@arrowOpacity]=\"_getArrowViewState()\" [@arrowPosition]=\"_getArrowViewState()\" [@allowChildren]=\"_getArrowDirectionState()\" (@arrowPosition.start)=\"_disableViewStateAnimation = true\" (@arrowPosition.done)=\"_disableViewStateAnimation = false\"><div class=\"mat-sort-header-stem\"></div><div class=\"mat-sort-header-indicator\" [@indicator]=\"_getArrowDirectionState()\"><div class=\"mat-sort-header-pointer-left\" [@leftPointer]=\"_getArrowDirectionState()\"></div><div class=\"mat-sort-header-pointer-right\" [@rightPointer]=\"_getArrowDirectionState()\"></div><div class=\"mat-sort-header-pointer-middle\"></div></div></div></div>", styles: [".mat-sort-header-container{display:flex;cursor:pointer;align-items:center}.mat-sort-header-disabled .mat-sort-header-container{cursor:default}.mat-sort-header-position-before{flex-direction:row-reverse}.mat-sort-header-button{border:none;background:0 0;display:flex;align-items:center;padding:0;cursor:inherit;outline:0;font:inherit;color:currentColor}.mat-sort-header-button::-moz-focus-inner{border:0}.mat-sort-header-arrow{height:12px;width:12px;min-width:12px;position:relative;display:flex;opacity:0}.mat-sort-header-arrow,[dir=rtl] .mat-sort-header-position-before .mat-sort-header-arrow{margin:0 0 0 6px}.mat-sort-header-position-before .mat-sort-header-arrow,[dir=rtl] .mat-sort-header-arrow{margin:0 6px 0 0}.mat-sort-header-stem{background:currentColor;height:10px;width:2px;margin:auto;display:flex;align-items:center}@media (-ms-high-contrast:active){.mat-sort-header-stem{width:0;border-left:solid 2px}}.mat-sort-header-indicator{width:100%;height:2px;display:flex;align-items:center;position:absolute;top:0;left:0}.mat-sort-header-pointer-middle{margin:auto;height:2px;width:2px;background:currentColor;transform:rotate(45deg)}@media (-ms-high-contrast:active){.mat-sort-header-pointer-middle{width:0;height:0;border-top:solid 2px;border-left:solid 2px}}.mat-sort-header-pointer-left,.mat-sort-header-pointer-right{background:currentColor;width:6px;height:2px;position:absolute;top:0}@media (-ms-high-contrast:active){.mat-sort-header-pointer-left,.mat-sort-header-pointer-right{width:0;height:0;border-left:solid 6px;border-top:solid 2px}}.mat-sort-header-pointer-left{transform-origin:right;left:0}.mat-sort-header-pointer-right{transform-origin:left;right:0}"], host: { '(click)': '_handleClick()', '(mouseenter)': '_setIndicatorHintVisible(true)', '(longpress)': '_setIndicatorHintVisible(true)', '(mouseleave)': '_setIndicatorHintVisible(false)', '[attr.aria-sort]': '_getAriaSortAttribute()', '[class.mat-sort-header-disabled]': '_isDisabled()', }, encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None, changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].OnPush, inputs: ['disabled'], animations: [ matSortAnimations.indicator, matSortAnimations.leftPointer, matSortAnimations.rightPointer, matSortAnimations.arrowOpacity, matSortAnimations.arrowPosition, matSortAnimations.allowChildren, ] },] }, ]; /** @nocollapse */ MatSortHeader.ctorParameters = () => [ { type: MatSortHeaderIntl }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectorRef"] }, { type: MatSort, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }] }, { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: ['MAT_SORT_HEADER_COLUMN_DEF',] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }] } ]; MatSortHeader.propDecorators = { id: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['mat-sort-header',] }], arrowPosition: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }], start: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }], disableClear: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }] }; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class MatSortModule { } MatSortModule.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{ imports: [_angular_common__WEBPACK_IMPORTED_MODULE_5__["CommonModule"]], exports: [MatSort, MatSortHeader], declarations: [MatSort, MatSortHeader], providers: [MAT_SORT_HEADER_INTL_PROVIDER] },] }, ]; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ //# sourceMappingURL=sort.js.map /***/ }), /***/ "./node_modules/@angular/material/esm2015/table.js": /*!*********************************************************!*\ !*** ./node_modules/@angular/material/esm2015/table.js ***! \*********************************************************/ /*! exports provided: MatTableModule, MatCellDef, MatHeaderCellDef, MatFooterCellDef, MatColumnDef, MatHeaderCell, MatFooterCell, MatCell, MatTable, MatHeaderRowDef, MatFooterRowDef, MatRowDef, MatHeaderRow, MatFooterRow, MatRow, MatTableDataSource, MatTextColumn */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTableModule", function() { return MatTableModule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCellDef", function() { return MatCellDef; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatHeaderCellDef", function() { return MatHeaderCellDef; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatFooterCellDef", function() { return MatFooterCellDef; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatColumnDef", function() { return MatColumnDef; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatHeaderCell", function() { return MatHeaderCell; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatFooterCell", function() { return MatFooterCell; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatCell", function() { return MatCell; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTable", function() { return MatTable; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatHeaderRowDef", function() { return MatHeaderRowDef; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatFooterRowDef", function() { return MatFooterRowDef; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatRowDef", function() { return MatRowDef; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatHeaderRow", function() { return MatHeaderRow; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatFooterRow", function() { return MatFooterRow; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatRow", function() { return MatRow; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTableDataSource", function() { return MatTableDataSource; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTextColumn", function() { return MatTextColumn; }); /* harmony import */ var _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/cdk/table */ "./node_modules/@angular/cdk/esm2015/table.js"); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm2015/core.js"); /* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm2015/common.js"); /* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm2015/core.js"); /* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm2015/coercion.js"); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm2015/index.js"); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm2015/operators/index.js"); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Wrapper for the CdkTable with Material design styles. * @template T */ class MatTable extends _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkTable"] { constructor() { super(...arguments); /** * Overrides the sticky CSS class set by the `CdkTable`. */ this.stickyCssClass = 'mat-table-sticky'; } } MatTable.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'mat-table, table[mat-table]', exportAs: 'matTable', template: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CDK_TABLE_TEMPLATE"], styles: ["mat-table{display:block}mat-header-row{min-height:56px}mat-footer-row,mat-row{min-height:48px}mat-footer-row,mat-header-row,mat-row{display:flex;border-width:0;border-bottom-width:1px;border-style:solid;align-items:center;box-sizing:border-box}mat-footer-row::after,mat-header-row::after,mat-row::after{display:inline-block;min-height:inherit;content:''}mat-cell:first-of-type,mat-footer-cell:first-of-type,mat-header-cell:first-of-type{padding-left:24px}[dir=rtl] mat-cell:first-of-type,[dir=rtl] mat-footer-cell:first-of-type,[dir=rtl] mat-header-cell:first-of-type{padding-left:0;padding-right:24px}mat-cell:last-of-type,mat-footer-cell:last-of-type,mat-header-cell:last-of-type{padding-right:24px}[dir=rtl] mat-cell:last-of-type,[dir=rtl] mat-footer-cell:last-of-type,[dir=rtl] mat-header-cell:last-of-type{padding-right:0;padding-left:24px}mat-cell,mat-footer-cell,mat-header-cell{flex:1;display:flex;align-items:center;overflow:hidden;word-wrap:break-word;min-height:inherit}table.mat-table{border-spacing:0}tr.mat-header-row{height:56px}tr.mat-footer-row,tr.mat-row{height:48px}th.mat-header-cell{text-align:left}[dir=rtl] th.mat-header-cell{text-align:right}td.mat-cell,td.mat-footer-cell,th.mat-header-cell{padding:0;border-bottom-width:1px;border-bottom-style:solid}td.mat-cell:first-of-type,td.mat-footer-cell:first-of-type,th.mat-header-cell:first-of-type{padding-left:24px}[dir=rtl] td.mat-cell:first-of-type,[dir=rtl] td.mat-footer-cell:first-of-type,[dir=rtl] th.mat-header-cell:first-of-type{padding-left:0;padding-right:24px}td.mat-cell:last-of-type,td.mat-footer-cell:last-of-type,th.mat-header-cell:last-of-type{padding-right:24px}[dir=rtl] td.mat-cell:last-of-type,[dir=rtl] td.mat-footer-cell:last-of-type,[dir=rtl] th.mat-header-cell:last-of-type{padding-right:0;padding-left:24px}"], host: { 'class': 'mat-table', }, providers: [{ provide: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkTable"], useExisting: MatTable }], encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None, // See note on CdkTable for explanation on why this uses the default change detection strategy. // tslint:disable-next-line:validate-decorators changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].Default, },] }, ]; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Cell definition for the mat-table. * Captures the template of a column's data row cell as well as cell-specific properties. */ class MatCellDef extends _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkCellDef"] { } MatCellDef.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[matCellDef]', providers: [{ provide: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkCellDef"], useExisting: MatCellDef }] },] }, ]; /** * Header cell definition for the mat-table. * Captures the template of a column's header cell and as well as cell-specific properties. */ class MatHeaderCellDef extends _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkHeaderCellDef"] { } MatHeaderCellDef.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[matHeaderCellDef]', providers: [{ provide: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkHeaderCellDef"], useExisting: MatHeaderCellDef }] },] }, ]; /** * Footer cell definition for the mat-table. * Captures the template of a column's footer cell and as well as cell-specific properties. */ class MatFooterCellDef extends _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkFooterCellDef"] { } MatFooterCellDef.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[matFooterCellDef]', providers: [{ provide: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkFooterCellDef"], useExisting: MatFooterCellDef }] },] }, ]; /** * Column definition for the mat-table. * Defines a set of cells available for a table column. */ class MatColumnDef extends _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkColumnDef"] { } MatColumnDef.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[matColumnDef]', providers: [ { provide: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkColumnDef"], useExisting: MatColumnDef }, { provide: 'MAT_SORT_HEADER_COLUMN_DEF', useExisting: MatColumnDef } ], },] }, ]; MatColumnDef.propDecorators = { name: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['matColumnDef',] }], sticky: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }], stickyEnd: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }] }; /** * Header cell template container that adds the right classes and role. */ class MatHeaderCell extends _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkHeaderCell"] { /** * @param {?} columnDef * @param {?} elementRef */ constructor(columnDef, elementRef) { super(columnDef, elementRef); elementRef.nativeElement.classList.add(`mat-column-${columnDef.cssClassFriendlyName}`); } } MatHeaderCell.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: 'mat-header-cell, th[mat-header-cell]', host: { 'class': 'mat-header-cell', 'role': 'columnheader', }, },] }, ]; /** @nocollapse */ MatHeaderCell.ctorParameters = () => [ { type: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkColumnDef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] } ]; /** * Footer cell template container that adds the right classes and role. */ class MatFooterCell extends _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkFooterCell"] { /** * @param {?} columnDef * @param {?} elementRef */ constructor(columnDef, elementRef) { super(columnDef, elementRef); elementRef.nativeElement.classList.add(`mat-column-${columnDef.cssClassFriendlyName}`); } } MatFooterCell.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: 'mat-footer-cell, td[mat-footer-cell]', host: { 'class': 'mat-footer-cell', 'role': 'gridcell', }, },] }, ]; /** @nocollapse */ MatFooterCell.ctorParameters = () => [ { type: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkColumnDef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] } ]; /** * Cell template container that adds the right classes and role. */ class MatCell extends _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkCell"] { /** * @param {?} columnDef * @param {?} elementRef */ constructor(columnDef, elementRef) { super(columnDef, elementRef); elementRef.nativeElement.classList.add(`mat-column-${columnDef.cssClassFriendlyName}`); } } MatCell.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: 'mat-cell, td[mat-cell]', host: { 'class': 'mat-cell', 'role': 'gridcell', }, },] }, ]; /** @nocollapse */ MatCell.ctorParameters = () => [ { type: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkColumnDef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] } ]; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Header row definition for the mat-table. * Captures the header row's template and other header properties such as the columns to display. */ class MatHeaderRowDef extends _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkHeaderRowDef"] { } MatHeaderRowDef.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[matHeaderRowDef]', providers: [{ provide: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkHeaderRowDef"], useExisting: MatHeaderRowDef }], inputs: ['columns: matHeaderRowDef', 'sticky: matHeaderRowDefSticky'], },] }, ]; /** * Footer row definition for the mat-table. * Captures the footer row's template and other footer properties such as the columns to display. */ class MatFooterRowDef extends _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkFooterRowDef"] { } MatFooterRowDef.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[matFooterRowDef]', providers: [{ provide: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkFooterRowDef"], useExisting: MatFooterRowDef }], inputs: ['columns: matFooterRowDef', 'sticky: matFooterRowDefSticky'], },] }, ]; /** * Data row definition for the mat-table. * Captures the data row's template and other properties such as the columns to display and * a when predicate that describes when this row should be used. * @template T */ class MatRowDef extends _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkRowDef"] { } MatRowDef.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[matRowDef]', providers: [{ provide: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkRowDef"], useExisting: MatRowDef }], inputs: ['columns: matRowDefColumns', 'when: matRowDefWhen'], },] }, ]; /** * Footer template container that contains the cell outlet. Adds the right class and role. */ class MatHeaderRow extends _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkHeaderRow"] { } MatHeaderRow.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'mat-header-row, tr[mat-header-row]', template: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CDK_ROW_TEMPLATE"], host: { 'class': 'mat-header-row', 'role': 'row', }, // See note on CdkTable for explanation on why this uses the default change detection strategy. // tslint:disable-next-line:validate-decorators changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].Default, encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None, exportAs: 'matHeaderRow', providers: [{ provide: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkHeaderRow"], useExisting: MatHeaderRow }], },] }, ]; /** * Footer template container that contains the cell outlet. Adds the right class and role. */ class MatFooterRow extends _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkFooterRow"] { } MatFooterRow.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'mat-footer-row, tr[mat-footer-row]', template: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CDK_ROW_TEMPLATE"], host: { 'class': 'mat-footer-row', 'role': 'row', }, // See note on CdkTable for explanation on why this uses the default change detection strategy. // tslint:disable-next-line:validate-decorators changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].Default, encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None, exportAs: 'matFooterRow', providers: [{ provide: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkFooterRow"], useExisting: MatFooterRow }], },] }, ]; /** * Data row template container that contains the cell outlet. Adds the right class and role. */ class MatRow extends _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkRow"] { } MatRow.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'mat-row, tr[mat-row]', template: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CDK_ROW_TEMPLATE"], host: { 'class': 'mat-row', 'role': 'row', }, // See note on CdkTable for explanation on why this uses the default change detection strategy. // tslint:disable-next-line:validate-decorators changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].Default, encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None, exportAs: 'matRow', providers: [{ provide: _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkRow"], useExisting: MatRow }], },] }, ]; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Column that simply shows text content for the header and row cells. Assumes that the table * is using the native table implementation (`<table>`). * * By default, the name of this column will be the header text and data property accessor. * The header text can be overridden with the `headerText` input. Cell values can be overridden with * the `dataAccessor` input. Change the text justification to the start or end using the `justify` * input. * @template T */ class MatTextColumn extends _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkTextColumn"] { } MatTextColumn.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'mat-text-column', template: ` <ng-container matColumnDef> <th mat-header-cell *matHeaderCellDef [style.text-align]="justify"> {{headerText}} </th> <td mat-cell *matCellDef="let data" [style.text-align]="justify"> {{dataAccessor(data, name)}} </td> </ng-container> `, encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None, // Change detection is intentionally not set to OnPush. This component's template will be provided // to the table to be inserted into its view. This is problematic when change detection runs since // the bindings in this template will be evaluated _after_ the table's view is evaluated, which // mean's the template in the table's view will not have the updated value (and in fact will cause // an ExpressionChangedAfterItHasBeenCheckedError). // tslint:disable-next-line:validate-decorators changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].Default, },] }, ]; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** @type {?} */ const EXPORTED_DECLARATIONS = [ // Table MatTable, // Template defs MatHeaderCellDef, MatHeaderRowDef, MatColumnDef, MatCellDef, MatRowDef, MatFooterCellDef, MatFooterRowDef, // Cell directives MatHeaderCell, MatCell, MatFooterCell, // Row directives MatHeaderRow, MatRow, MatFooterRow, MatTextColumn, ]; class MatTableModule { } MatTableModule.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{ imports: [ _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["CdkTableModule"], _angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"], _angular_material_core__WEBPACK_IMPORTED_MODULE_3__["MatCommonModule"], ], exports: EXPORTED_DECLARATIONS, declarations: EXPORTED_DECLARATIONS, },] }, ]; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Corresponds to `Number.MAX_SAFE_INTEGER`. Moved out into a variable here due to * flaky browser support and the value not being defined in Closure's typings. * @type {?} */ const MAX_SAFE_INTEGER = 9007199254740991; /** * Data source that accepts a client-side data array and includes native support of filtering, * sorting (using MatSort), and pagination (using MatPaginator). * * Allows for sort customization by overriding sortingDataAccessor, which defines how data * properties are accessed. Also allows for filter customization by overriding filterTermAccessor, * which defines how row data is converted to a string for filter matching. * @template T */ class MatTableDataSource extends _angular_cdk_table__WEBPACK_IMPORTED_MODULE_0__["DataSource"] { /** * @param {?=} initialData */ constructor(initialData = []) { super(); /** * Stream emitting render data to the table (depends on ordered data changes). */ this._renderData = new rxjs__WEBPACK_IMPORTED_MODULE_5__["BehaviorSubject"]([]); /** * Stream that emits when a new filter string is set on the data source. */ this._filter = new rxjs__WEBPACK_IMPORTED_MODULE_5__["BehaviorSubject"](''); /** * Used to react to internal changes of the paginator that are made by the data source itself. */ this._internalPageChanges = new rxjs__WEBPACK_IMPORTED_MODULE_5__["Subject"](); /** * Subscription to the changes that should trigger an update to the table's rendered rows, such * as filtering, sorting, pagination, or base data changes. */ this._renderChangesSubscription = rxjs__WEBPACK_IMPORTED_MODULE_5__["Subscription"].EMPTY; /** * Data accessor function that is used for accessing data properties for sorting through * the default sortData function. * This default function assumes that the sort header IDs (which defaults to the column name) * matches the data's properties (e.g. column Xyz represents data['Xyz']). * May be set to a custom function for different behavior. * @param data Data object that is being accessed. * @param sortHeaderId The name of the column that represents the data. */ this.sortingDataAccessor = (/** * @param {?} data * @param {?} sortHeaderId * @return {?} */ (data, sortHeaderId) => { /** @type {?} */ const value = ((/** @type {?} */ (data)))[sortHeaderId]; if (Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_4__["_isNumberValue"])(value)) { /** @type {?} */ const numberValue = Number(value); // Numbers beyond `MAX_SAFE_INTEGER` can't be compared reliably so we // leave them as strings. For more info: https://goo.gl/y5vbSg return numberValue < MAX_SAFE_INTEGER ? numberValue : value; } return value; }); /** * Gets a sorted copy of the data array based on the state of the MatSort. Called * after changes are made to the filtered data or when sort changes are emitted from MatSort. * By default, the function retrieves the active sort and its direction and compares data * by retrieving data using the sortingDataAccessor. May be overridden for a custom implementation * of data ordering. * @param data The array of data that should be sorted. * @param sort The connected MatSort that holds the current sort state. */ this.sortData = (/** * @param {?} data * @param {?} sort * @return {?} */ (data, sort) => { /** @type {?} */ const active = sort.active; /** @type {?} */ const direction = sort.direction; if (!active || direction == '') { return data; } return data.sort((/** * @param {?} a * @param {?} b * @return {?} */ (a, b) => { /** @type {?} */ let valueA = this.sortingDataAccessor(a, active); /** @type {?} */ let valueB = this.sortingDataAccessor(b, active); // If both valueA and valueB exist (truthy), then compare the two. Otherwise, check if // one value exists while the other doesn't. In this case, existing value should come first. // This avoids inconsistent results when comparing values to undefined/null. // If neither value exists, return 0 (equal). /** @type {?} */ let comparatorResult = 0; if (valueA != null && valueB != null) { // Check if one value is greater than the other; if equal, comparatorResult should remain 0. if (valueA > valueB) { comparatorResult = 1; } else if (valueA < valueB) { comparatorResult = -1; } } else if (valueA != null) { comparatorResult = 1; } else if (valueB != null) { comparatorResult = -1; } return comparatorResult * (direction == 'asc' ? 1 : -1); })); }); /** * Checks if a data object matches the data source's filter string. By default, each data object * is converted to a string of its properties and returns true if the filter has * at least one occurrence in that string. By default, the filter string has its whitespace * trimmed and the match is case-insensitive. May be overridden for a custom implementation of * filter matching. * @param data Data object used to check against the filter. * @param filter Filter string that has been set on the data source. * @return Whether the filter matches against the data */ this.filterPredicate = (/** * @param {?} data * @param {?} filter * @return {?} */ (data, filter) => { // Transform the data into a lowercase string of all property values. /** @type {?} */ const dataStr = Object.keys(data).reduce((/** * @param {?} currentTerm * @param {?} key * @return {?} */ (currentTerm, key) => { // Use an obscure Unicode character to delimit the words in the concatenated string. // This avoids matches where the values of two columns combined will match the user's query // (e.g. `Flute` and `Stop` will match `Test`). The character is intended to be something // that has a very low chance of being typed in by somebody in a text field. This one in // particular is "White up-pointing triangle with dot" from // https://en.wikipedia.org/wiki/List_of_Unicode_characters return currentTerm + ((/** @type {?} */ (data)))[key] + '◬'; }), '').toLowerCase(); // Transform the filter by converting it to lowercase and removing whitespace. /** @type {?} */ const transformedFilter = filter.trim().toLowerCase(); return dataStr.indexOf(transformedFilter) != -1; }); this._data = new rxjs__WEBPACK_IMPORTED_MODULE_5__["BehaviorSubject"](initialData); this._updateChangeSubscription(); } /** * Array of data that should be rendered by the table, where each object represents one row. * @return {?} */ get data() { return this._data.value; } /** * @param {?} data * @return {?} */ set data(data) { this._data.next(data); } /** * Filter term that should be used to filter out objects from the data array. To override how * data objects match to this filter string, provide a custom function for filterPredicate. * @return {?} */ get filter() { return this._filter.value; } /** * @param {?} filter * @return {?} */ set filter(filter) { this._filter.next(filter); } /** * Instance of the MatSort directive used by the table to control its sorting. Sort changes * emitted by the MatSort will trigger an update to the table's rendered data. * @return {?} */ get sort() { return this._sort; } /** * @param {?} sort * @return {?} */ set sort(sort) { this._sort = sort; this._updateChangeSubscription(); } /** * Instance of the MatPaginator component used by the table to control what page of the data is * displayed. Page changes emitted by the MatPaginator will trigger an update to the * table's rendered data. * * Note that the data source uses the paginator's properties to calculate which page of data * should be displayed. If the paginator receives its properties as template inputs, * e.g. `[pageLength]=100` or `[pageIndex]=1`, then be sure that the paginator's view has been * initialized before assigning it to this data source. * @return {?} */ get paginator() { return this._paginator; } /** * @param {?} paginator * @return {?} */ set paginator(paginator) { this._paginator = paginator; this._updateChangeSubscription(); } /** * Subscribe to changes that should trigger an update to the table's rendered rows. When the * changes occur, process the current state of the filter, sort, and pagination along with * the provided base data and send it to the table for rendering. * @return {?} */ _updateChangeSubscription() { // Sorting and/or pagination should be watched if MatSort and/or MatPaginator are provided. // The events should emit whenever the component emits a change or initializes, or if no // component is provided, a stream with just a null event should be provided. // The `sortChange` and `pageChange` acts as a signal to the combineLatests below so that the // pipeline can progress to the next step. Note that the value from these streams are not used, // they purely act as a signal to progress in the pipeline. /** @type {?} */ const sortChange = this._sort ? (/** @type {?} */ (Object(rxjs__WEBPACK_IMPORTED_MODULE_5__["merge"])(this._sort.sortChange, this._sort.initialized))) : Object(rxjs__WEBPACK_IMPORTED_MODULE_5__["of"])(null); /** @type {?} */ const pageChange = this._paginator ? (/** @type {?} */ (Object(rxjs__WEBPACK_IMPORTED_MODULE_5__["merge"])(this._paginator.page, this._internalPageChanges, this._paginator.initialized))) : Object(rxjs__WEBPACK_IMPORTED_MODULE_5__["of"])(null); /** @type {?} */ const dataStream = this._data; // Watch for base data or filter changes to provide a filtered set of data. /** @type {?} */ const filteredData = Object(rxjs__WEBPACK_IMPORTED_MODULE_5__["combineLatest"])(dataStream, this._filter) .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["map"])((/** * @param {?} __0 * @return {?} */ ([data]) => this._filterData(data)))); // Watch for filtered data or sort changes to provide an ordered set of data. /** @type {?} */ const orderedData = Object(rxjs__WEBPACK_IMPORTED_MODULE_5__["combineLatest"])(filteredData, sortChange) .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["map"])((/** * @param {?} __0 * @return {?} */ ([data]) => this._orderData(data)))); // Watch for ordered data or page changes to provide a paged set of data. /** @type {?} */ const paginatedData = Object(rxjs__WEBPACK_IMPORTED_MODULE_5__["combineLatest"])(orderedData, pageChange) .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["map"])((/** * @param {?} __0 * @return {?} */ ([data]) => this._pageData(data)))); // Watched for paged data changes and send the result to the table to render. this._renderChangesSubscription.unsubscribe(); this._renderChangesSubscription = paginatedData.subscribe((/** * @param {?} data * @return {?} */ data => this._renderData.next(data))); } /** * Returns a filtered data array where each filter object contains the filter string within * the result of the filterTermAccessor function. If no filter is set, returns the data array * as provided. * @param {?} data * @return {?} */ _filterData(data) { // If there is a filter string, filter out data that does not contain it. // Each data object is converted to a string using the function defined by filterTermAccessor. // May be overridden for customization. this.filteredData = !this.filter ? data : data.filter((/** * @param {?} obj * @return {?} */ obj => this.filterPredicate(obj, this.filter))); if (this.paginator) { this._updatePaginator(this.filteredData.length); } return this.filteredData; } /** * Returns a sorted copy of the data if MatSort has a sort applied, otherwise just returns the * data array as provided. Uses the default data accessor for data lookup, unless a * sortDataAccessor function is defined. * @param {?} data * @return {?} */ _orderData(data) { // If there is no active sort or direction, return the data without trying to sort. if (!this.sort) { return data; } return this.sortData(data.slice(), this.sort); } /** * Returns a paged splice of the provided data array according to the provided MatPaginator's page * index and length. If there is no paginator provided, returns the data array as provided. * @param {?} data * @return {?} */ _pageData(data) { if (!this.paginator) { return data; } /** @type {?} */ const startIndex = this.paginator.pageIndex * this.paginator.pageSize; return data.slice().splice(startIndex, this.paginator.pageSize); } /** * Updates the paginator to reflect the length of the filtered data, and makes sure that the page * index does not exceed the paginator's last page. Values are changed in a resolved promise to * guard against making property changes within a round of change detection. * @param {?} filteredDataLength * @return {?} */ _updatePaginator(filteredDataLength) { Promise.resolve().then((/** * @return {?} */ () => { /** @type {?} */ const paginator = this.paginator; if (!paginator) { return; } paginator.length = filteredDataLength; // If the page index is set beyond the page, reduce it to the last page. if (paginator.pageIndex > 0) { /** @type {?} */ const lastPageIndex = Math.ceil(paginator.length / paginator.pageSize) - 1 || 0; /** @type {?} */ const newPageIndex = Math.min(paginator.pageIndex, lastPageIndex); if (newPageIndex !== paginator.pageIndex) { paginator.pageIndex = newPageIndex; // Since the paginator only emits after user-generated changes, // we need our own stream so we know to should re-render the data. this._internalPageChanges.next(); } } })); } /** * Used by the MatTable. Called when it connects to the data source. * \@docs-private * @return {?} */ connect() { return this._renderData; } /** * Used by the MatTable. Called when it is destroyed. No-op. * \@docs-private * @return {?} */ disconnect() { } } /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ //# sourceMappingURL=table.js.map /***/ }) }]);
Save