| 65 | */ |
| 66 | @Directive({selector: '[cdkColumnDef]'}) |
| 67 | export class CdkColumnDef implements CanStick { |
| 68 | _table? = inject(CDK_TABLE, {optional: true}); |
| 69 | |
| 70 | private _hasStickyChanged = false; |
| 71 | |
| 72 | /** Unique name for this column. */ |
| 73 | @Input('cdkColumnDef') |
| 74 | get name(): string { |
| 75 | return this._name; |
| 76 | } |
| 77 | set name(name: string) { |
| 78 | this._setNameInput(name); |
| 79 | } |
| 80 | protected _name!: string; |
| 81 | |
| 82 | /** Whether the cell is sticky. */ |
| 83 | @Input({transform: booleanAttribute}) |
| 84 | get sticky(): boolean { |
| 85 | return this._sticky; |
| 86 | } |
| 87 | set sticky(value: boolean) { |
| 88 | if (value !== this._sticky) { |
| 89 | this._sticky = value; |
| 90 | this._hasStickyChanged = true; |
| 91 | } |
| 92 | } |
| 93 | private _sticky = false; |
| 94 | |
| 95 | /** |
| 96 | * Whether this column should be sticky positioned on the end of the row. Should make sure |
| 97 | * that it mimics the `CanStick` mixin such that `_hasStickyChanged` is set to true if the value |
| 98 | * has been changed. |
| 99 | */ |
| 100 | @Input({transform: booleanAttribute}) |
| 101 | get stickyEnd(): boolean { |
| 102 | return this._stickyEnd; |
| 103 | } |
| 104 | set stickyEnd(value: boolean) { |
| 105 | if (value !== this._stickyEnd) { |
| 106 | this._stickyEnd = value; |
| 107 | this._hasStickyChanged = true; |
| 108 | } |
| 109 | } |
| 110 | _stickyEnd: boolean = false; |
| 111 | |
| 112 | /** @docs-private */ |
| 113 | @ContentChild(CdkCellDef) cell!: CdkCellDef; |
| 114 | |
| 115 | /** @docs-private */ |
| 116 | @ContentChild(CdkHeaderCellDef) headerCell!: CdkHeaderCellDef; |
| 117 | |
| 118 | /** @docs-private */ |
| 119 | @ContentChild(CdkFooterCellDef) footerCell!: CdkFooterCellDef; |
| 120 | |
| 121 | /** |
| 122 | * Transformed version of the column name that can be used as part of a CSS classname. Excludes |
| 123 | * all non-alphanumeric characters and the special characters '-' and '_'. Any characters that |
| 124 | * do not match are replaced by the '-' character. |
nothing calls this directly
no outgoing calls
no test coverage detected