| 88 | inputs: [{name: 'columns', alias: 'cdkHeaderRowDef'}], |
| 89 | }) |
| 90 | export class CdkHeaderRowDef extends BaseRowDef implements CanStick, OnChanges { |
| 91 | _table? = inject(CDK_TABLE, {optional: true}); |
| 92 | |
| 93 | private _hasStickyChanged = false; |
| 94 | |
| 95 | /** Whether the row is sticky. */ |
| 96 | @Input({alias: 'cdkHeaderRowDefSticky', transform: booleanAttribute}) |
| 97 | get sticky(): boolean { |
| 98 | return this._sticky; |
| 99 | } |
| 100 | set sticky(value: boolean) { |
| 101 | if (value !== this._sticky) { |
| 102 | this._sticky = value; |
| 103 | this._hasStickyChanged = true; |
| 104 | } |
| 105 | } |
| 106 | private _sticky = false; |
| 107 | |
| 108 | // Prerender fails to recognize that ngOnChanges in a part of this class through inheritance. |
| 109 | // Explicitly define it so that the method is called as part of the Angular lifecycle. |
| 110 | override ngOnChanges(changes: SimpleChanges<this>): void { |
| 111 | super.ngOnChanges(changes); |
| 112 | } |
| 113 | |
| 114 | /** Whether the sticky state has changed. */ |
| 115 | hasStickyChanged(): boolean { |
| 116 | const hasStickyChanged = this._hasStickyChanged; |
| 117 | this.resetStickyChanged(); |
| 118 | return hasStickyChanged; |
| 119 | } |
| 120 | |
| 121 | /** Resets the sticky changed state. */ |
| 122 | resetStickyChanged(): void { |
| 123 | this._hasStickyChanged = false; |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | /** |
| 128 | * Footer row definition for the CDK table. |
nothing calls this directly
no outgoing calls
no test coverage detected