-
Notifications
You must be signed in to change notification settings - Fork 6.7k
/
cell.ts
107 lines (97 loc) · 2.98 KB
/
cell.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/**
* @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
*/
import {BooleanInput} from '@angular/cdk/coercion';
import {Directive, Input} from '@angular/core';
import {
CdkCell,
CdkCellDef,
CdkColumnDef, CdkFooterCell, CdkFooterCellDef,
CdkHeaderCell,
CdkHeaderCellDef,
} from '@angular/cdk/table';
/**
* Cell definition for the mat-table.
* Captures the template of a column's data row cell as well as cell-specific properties.
*/
@Directive({
selector: '[matCellDef]',
providers: [{provide: CdkCellDef, useExisting: MatCellDef}]
})
export class MatCellDef extends CdkCellDef {}
/**
* Header cell definition for the mat-table.
* Captures the template of a column's header cell and as well as cell-specific properties.
*/
@Directive({
selector: '[matHeaderCellDef]',
providers: [{provide: CdkHeaderCellDef, useExisting: MatHeaderCellDef}]
})
export class MatHeaderCellDef extends CdkHeaderCellDef {}
/**
* Footer cell definition for the mat-table.
* Captures the template of a column's footer cell and as well as cell-specific properties.
*/
@Directive({
selector: '[matFooterCellDef]',
providers: [{provide: CdkFooterCellDef, useExisting: MatFooterCellDef}]
})
export class MatFooterCellDef extends CdkFooterCellDef {}
/**
* Column definition for the mat-table.
* Defines a set of cells available for a table column.
*/
@Directive({
selector: '[matColumnDef]',
inputs: ['sticky'],
providers: [
{provide: CdkColumnDef, useExisting: MatColumnDef},
{provide: 'MAT_SORT_HEADER_COLUMN_DEF', useExisting: MatColumnDef}
],
})
export class MatColumnDef extends CdkColumnDef {
/** Unique name for this column. */
@Input('matColumnDef') name: string;
/**
* Add "mat-column-" prefix in addition to "cdk-column-" prefix.
* In the future, this will only add "mat-column-" and columnCssClassName
* will change from type string[] to string.
* @docs-private
*/
protected _updateColumnCssClassName() {
super._updateColumnCssClassName();
this._columnCssClassName!.push(`mat-column-${this.cssClassFriendlyName}`);
}
static ngAcceptInputType_sticky: BooleanInput;
}
/** Header cell template container that adds the right classes and role. */
@Directive({
selector: 'mat-header-cell, th[mat-header-cell]',
host: {
'class': 'mat-header-cell',
'role': 'columnheader',
},
})
export class MatHeaderCell extends CdkHeaderCell {}
/** Footer cell template container that adds the right classes and role. */
@Directive({
selector: 'mat-footer-cell, td[mat-footer-cell]',
host: {
'class': 'mat-footer-cell',
'role': 'gridcell',
},
})
export class MatFooterCell extends CdkFooterCell {}
/** Cell template container that adds the right classes and role. */
@Directive({
selector: 'mat-cell, td[mat-cell]',
host: {
'class': 'mat-cell',
'role': 'gridcell',
},
})
export class MatCell extends CdkCell {}