| 60 | encapsulation: ViewEncapsulation.None, |
| 61 | }) |
| 62 | export class MatSortHeader implements MatSortable, OnDestroy, OnInit, AfterViewInit { |
| 63 | protected _sort = inject(MatSort, {optional: true})!; |
| 64 | private _columnDef = inject(CdkColumnDef, {optional: true}); |
| 65 | private _changeDetectorRef = inject(ChangeDetectorRef); |
| 66 | private _focusMonitor = inject(FocusMonitor); |
| 67 | private _elementRef = inject<ElementRef<HTMLElement>>(ElementRef); |
| 68 | private _ariaDescriber = inject(AriaDescriber, {optional: true}); |
| 69 | private _renderChanges: Subscription | undefined; |
| 70 | protected _animationsDisabled = _animationsDisabled(); |
| 71 | |
| 72 | /** |
| 73 | * Indicates which state was just cleared from the sort header. |
| 74 | * Will be reset on the next interaction. Used for coordinating animations. |
| 75 | */ |
| 76 | protected _recentlyCleared = signal<SortDirection | null>(null); |
| 77 | |
| 78 | /** |
| 79 | * The element with role="button" inside this component's view. We need this |
| 80 | * in order to apply a description with AriaDescriber. |
| 81 | */ |
| 82 | private _sortButton!: HTMLElement; |
| 83 | |
| 84 | /** |
| 85 | * ID of this sort header. If used within the context of a CdkColumnDef, this will default to |
| 86 | * the column's name. |
| 87 | */ |
| 88 | @Input('mat-sort-header') id!: string; |
| 89 | |
| 90 | /** Sets the position of the arrow that displays when sorted. */ |
| 91 | @Input() arrowPosition: SortHeaderArrowPosition = 'after'; |
| 92 | |
| 93 | /** Overrides the sort start value of the containing MatSort for this MatSortable. */ |
| 94 | @Input() start!: SortDirection; |
| 95 | |
| 96 | /** whether the sort header is disabled. */ |
| 97 | @Input({transform: booleanAttribute}) |
| 98 | disabled: boolean = false; |
| 99 | |
| 100 | /** |
| 101 | * Description applied to MatSortHeader's button element with aria-describedby. This text should |
| 102 | * describe the action that will occur when the user clicks the sort header. |
| 103 | */ |
| 104 | @Input() |
| 105 | get sortActionDescription(): string { |
| 106 | return this._sortActionDescription; |
| 107 | } |
| 108 | set sortActionDescription(value: string) { |
| 109 | this._updateSortActionDescription(value); |
| 110 | } |
| 111 | // Default the action description to "Sort" because it's better than nothing. |
| 112 | // Without a description, the button's label comes from the sort header text content, |
| 113 | // which doesn't give any indication that it performs a sorting operation. |
| 114 | private _sortActionDescription: string = 'Sort'; |
| 115 | |
| 116 | /** Overrides the disable clear value of the containing MatSort for this MatSortable. */ |
| 117 | @Input({transform: booleanAttribute}) |
| 118 | disableClear!: boolean; |
| 119 |
nothing calls this directly
no test coverage detected