Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions goldens/material/sort/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,13 @@ export class MatSortHeader implements MatSortable, OnDestroy, OnInit, AfterViewI
// (undocumented)
protected _animationsDisabled: boolean;
arrowPosition: SortHeaderArrowPosition;
// (undocumented)
_columnDef: MatSortHeaderColumnDef | null;
disableClear: boolean;
disabled: boolean;
_getAriaSortAttribute(): "none" | "ascending" | "descending";
// (undocumented)
_handleKeydown(event: KeyboardEvent): void;
id: string;
// (undocumented)
_intl: MatSortHeaderIntl;
// (undocumented)
_isDisabled(): boolean;
_isSorted(): boolean;
// (undocumented)
Expand All @@ -107,7 +103,7 @@ export class MatSortHeader implements MatSortable, OnDestroy, OnInit, AfterViewI
protected _recentlyCleared: i0.WritableSignal<SortDirection | null>;
_renderArrow(): boolean;
// (undocumented)
_sort: MatSort;
protected _sort: MatSort;
get sortActionDescription(): string;
set sortActionDescription(value: string);
start: SortDirection;
Expand Down
5 changes: 1 addition & 4 deletions src/cdk/table/cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,7 @@ export class CdkFooterCellDef implements CellDef {
* Column definition for the CDK table.
* Defines a set of cells available for a table column.
*/
@Directive({
selector: '[cdkColumnDef]',
providers: [{provide: 'MAT_SORT_HEADER_COLUMN_DEF', useExisting: CdkColumnDef}],
})
@Directive({selector: '[cdkColumnDef]'})
export class CdkColumnDef implements CanStick {
_table? = inject(CDK_TABLE, {optional: true});

Expand Down
1 change: 1 addition & 0 deletions src/material/sort/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ ng_project(
"//src:dev_mode_types",
"//src/cdk/a11y",
"//src/cdk/keycodes",
"//src/cdk/table",
"//src/material/core",
],
)
Expand Down
16 changes: 4 additions & 12 deletions src/material/sort/sort-header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import {
signal,
ChangeDetectorRef,
} from '@angular/core';
import {_CdkPrivateStyleLoader} from '@angular/cdk/private';
import {CdkColumnDef} from '@angular/cdk/table';
import {merge, Subscription} from 'rxjs';
import {
MAT_SORT_DEFAULT_OPTIONS,
Expand All @@ -32,8 +34,6 @@ import {
} from './sort';
import {SortDirection} from './sort-direction';
import {getSortHeaderNotContainedWithinSortError} from './sort-errors';
import {MatSortHeaderIntl} from './sort-header-intl';
import {_CdkPrivateStyleLoader} from '@angular/cdk/private';
import {_animationsDisabled, _StructuralStylesLoader} from '../core';

/**
Expand All @@ -60,11 +60,6 @@ export interface ArrowViewStateTransition {
toState?: ArrowViewState;
}

/** Column definition associated with a `MatSortHeader`. */
interface MatSortHeaderColumnDef {
name: string;
}

/**
* Applies sorting behavior (click to change sort) and styles to an element, including an
* arrow to display the current sort direction.
Expand All @@ -91,11 +86,8 @@ interface MatSortHeaderColumnDef {
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class MatSortHeader implements MatSortable, OnDestroy, OnInit, AfterViewInit {
_intl = inject(MatSortHeaderIntl);
_sort = inject(MatSort, {optional: true})!;
_columnDef = inject<MatSortHeaderColumnDef>('MAT_SORT_HEADER_COLUMN_DEF' as any, {
optional: true,
});
protected _sort = inject(MatSort, {optional: true})!;
private _columnDef = inject(CdkColumnDef, {optional: true});
private _changeDetectorRef = inject(ChangeDetectorRef);
private _focusMonitor = inject(FocusMonitor);
private _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);
Expand Down
5 changes: 1 addition & 4 deletions src/material/table/cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ export class MatFooterCellDef extends CdkFooterCellDef {}
*/
@Directive({
selector: '[matColumnDef]',
providers: [
{provide: CdkColumnDef, useExisting: MatColumnDef},
{provide: 'MAT_SORT_HEADER_COLUMN_DEF', useExisting: MatColumnDef},
],
providers: [{provide: CdkColumnDef, useExisting: MatColumnDef}],
})
export class MatColumnDef extends CdkColumnDef {
/** Unique name for this column. */
Expand Down
Loading