1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | import { CDK_TABLE_TEMPLATE, CdkTable, CDK_TABLE, _CoalescedStyleScheduler, _COALESCED_STYLE_SCHEDULER, STICKY_POSITIONING_LISTENER } from '@angular/cdk/table';
|
---|
9 | import { ChangeDetectionStrategy, Component, Directive, ViewEncapsulation } from '@angular/core';
|
---|
10 | import { _DisposeViewRepeaterStrategy, _RecycleViewRepeaterStrategy, _VIEW_REPEATER_STRATEGY } from '@angular/cdk/collections';
|
---|
11 | /**
|
---|
12 | * Enables the recycle view repeater strategy, which reduces rendering latency. Not compatible with
|
---|
13 | * tables that animate rows.
|
---|
14 | */
|
---|
15 | export class MatRecycleRows {
|
---|
16 | }
|
---|
17 | MatRecycleRows.decorators = [
|
---|
18 | { type: Directive, args: [{
|
---|
19 | selector: 'mat-table[recycleRows], table[mat-table][recycleRows]',
|
---|
20 | providers: [
|
---|
21 | { provide: _VIEW_REPEATER_STRATEGY, useClass: _RecycleViewRepeaterStrategy },
|
---|
22 | ],
|
---|
23 | },] }
|
---|
24 | ];
|
---|
25 | /**
|
---|
26 | * Wrapper for the CdkTable with Material design styles.
|
---|
27 | */
|
---|
28 | export class MatTable extends CdkTable {
|
---|
29 | constructor() {
|
---|
30 | super(...arguments);
|
---|
31 | /** Overrides the sticky CSS class set by the `CdkTable`. */
|
---|
32 | this.stickyCssClass = 'mat-table-sticky';
|
---|
33 | /** Overrides the need to add position: sticky on every sticky cell element in `CdkTable`. */
|
---|
34 | this.needsPositionStickyOnElement = false;
|
---|
35 | }
|
---|
36 | }
|
---|
37 | MatTable.decorators = [
|
---|
38 | { type: Component, args: [{
|
---|
39 | selector: 'mat-table, table[mat-table]',
|
---|
40 | exportAs: 'matTable',
|
---|
41 | template: CDK_TABLE_TEMPLATE,
|
---|
42 | host: {
|
---|
43 | 'class': 'mat-table',
|
---|
44 | '[class.mat-table-fixed-layout]': 'fixedLayout',
|
---|
45 | },
|
---|
46 | providers: [
|
---|
47 | // TODO(michaeljamesparsons) Abstract the view repeater strategy to a directive API so this code
|
---|
48 | // is only included in the build if used.
|
---|
49 | { provide: _VIEW_REPEATER_STRATEGY, useClass: _DisposeViewRepeaterStrategy },
|
---|
50 | { provide: CdkTable, useExisting: MatTable },
|
---|
51 | { provide: CDK_TABLE, useExisting: MatTable },
|
---|
52 | { provide: _COALESCED_STYLE_SCHEDULER, useClass: _CoalescedStyleScheduler },
|
---|
53 | // Prevent nested tables from seeing this table's StickyPositioningListener.
|
---|
54 | { provide: STICKY_POSITIONING_LISTENER, useValue: null },
|
---|
55 | ],
|
---|
56 | encapsulation: ViewEncapsulation.None,
|
---|
57 | // See note on CdkTable for explanation on why this uses the default change detection strategy.
|
---|
58 | // tslint:disable-next-line:validate-decorators
|
---|
59 | changeDetection: ChangeDetectionStrategy.Default,
|
---|
60 | styles: ["mat-table{display:block}mat-header-row{min-height:56px}mat-row,mat-footer-row{min-height:48px}mat-row,mat-header-row,mat-footer-row{display:flex;border-width:0;border-bottom-width:1px;border-style:solid;align-items:center;box-sizing:border-box}mat-row::after,mat-header-row::after,mat-footer-row::after{display:inline-block;min-height:inherit;content:\"\"}mat-cell:first-of-type,mat-header-cell:first-of-type,mat-footer-cell:first-of-type{padding-left:24px}[dir=rtl] mat-cell:first-of-type:not(:only-of-type),[dir=rtl] mat-header-cell:first-of-type:not(:only-of-type),[dir=rtl] mat-footer-cell:first-of-type:not(:only-of-type){padding-left:0;padding-right:24px}mat-cell:last-of-type,mat-header-cell:last-of-type,mat-footer-cell:last-of-type{padding-right:24px}[dir=rtl] mat-cell:last-of-type:not(:only-of-type),[dir=rtl] mat-header-cell:last-of-type:not(:only-of-type),[dir=rtl] mat-footer-cell:last-of-type:not(:only-of-type){padding-right:0;padding-left:24px}mat-cell,mat-header-cell,mat-footer-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-row,tr.mat-footer-row{height:48px}th.mat-header-cell{text-align:left}[dir=rtl] th.mat-header-cell{text-align:right}th.mat-header-cell,td.mat-cell,td.mat-footer-cell{padding:0;border-bottom-width:1px;border-bottom-style:solid}th.mat-header-cell:first-of-type,td.mat-cell:first-of-type,td.mat-footer-cell:first-of-type{padding-left:24px}[dir=rtl] th.mat-header-cell:first-of-type:not(:only-of-type),[dir=rtl] td.mat-cell:first-of-type:not(:only-of-type),[dir=rtl] td.mat-footer-cell:first-of-type:not(:only-of-type){padding-left:0;padding-right:24px}th.mat-header-cell:last-of-type,td.mat-cell:last-of-type,td.mat-footer-cell:last-of-type{padding-right:24px}[dir=rtl] th.mat-header-cell:last-of-type:not(:only-of-type),[dir=rtl] td.mat-cell:last-of-type:not(:only-of-type),[dir=rtl] td.mat-footer-cell:last-of-type:not(:only-of-type){padding-right:0;padding-left:24px}.mat-table-sticky{position:-webkit-sticky !important;position:sticky !important}.mat-table-fixed-layout{table-layout:fixed}\n"]
|
---|
61 | },] }
|
---|
62 | ];
|
---|
63 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFibGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbWF0ZXJpYWwvdGFibGUvdGFibGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUNMLGtCQUFrQixFQUNsQixRQUFRLEVBQ1IsU0FBUyxFQUNULHdCQUF3QixFQUFFLDBCQUEwQixFQUFFLDJCQUEyQixFQUNsRixNQUFNLG9CQUFvQixDQUFDO0FBQzVCLE9BQU8sRUFBQyx1QkFBdUIsRUFBRSxTQUFTLEVBQUUsU0FBUyxFQUFFLGlCQUFpQixFQUFDLE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