Skip to content

Commit b68ba4e

Browse files
committed
refactor(material/sort): remove deprecated APIs for v12
Cleans up the deprecated APIs that were marked for removal in v12. BREAKING CHANGES: * `MatSortHeaderIntl.sortButtonLabel` has been removed. * `MatSortHeaderHarness.getAriaLabel` has been removed.
1 parent b8d83cb commit b68ba4e

File tree

5 files changed

+11
-22
lines changed

5 files changed

+11
-22
lines changed

src/material/sort/sort-header-intl.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import {Subject} from 'rxjs';
1212
/**
1313
* To modify the labels and text displayed, create a new instance of MatSortHeaderIntl and
1414
* include it in a custom provider.
15+
* @deprecated No longer being used. To be removed.
16+
* @breaking-change 13.0.0
1517
*/
1618
@Injectable({providedIn: 'root'})
1719
export class MatSortHeaderIntl {
@@ -20,16 +22,8 @@ export class MatSortHeaderIntl {
2022
* components if the labels have changed after initialization.
2123
*/
2224
readonly changes: Subject<void> = new Subject<void>();
23-
24-
/**
25-
* ARIA label for the sorting button.
26-
* @deprecated Not used anymore. To be removed.
27-
* @breaking-change 8.0.0
28-
*/
29-
sortButtonLabel = (id: string) => {
30-
return `Change sorting for ${id}`;
31-
}
3225
}
26+
3327
/** @docs-private */
3428
export function MAT_SORT_HEADER_INTL_PROVIDER_FACTORY(parentIntl: MatSortHeaderIntl) {
3529
return parentIntl || new MatSortHeaderIntl();

src/material/sort/sort-header.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,12 @@ export class MatSortHeader extends _MatSortHeaderMixinBase
140140
set disableClear(v) { this._disableClear = coerceBooleanProperty(v); }
141141
private _disableClear: boolean;
142142

143-
constructor(public _intl: MatSortHeaderIntl,
143+
constructor(
144+
/**
145+
* @deprecated `_intl` parameter isn't being used anymore and it'll be removed.
146+
* @breaking-change 13.0.0
147+
*/
148+
public _intl: MatSortHeaderIntl,
144149
private _changeDetectorRef: ChangeDetectorRef,
145150
// `MatSort` is not optionally injected, but just asserted manually w/ better error.
146151
// tslint:disable-next-line: lightweight-tokens

src/material/sort/testing/sort-header-harness.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,6 @@ export class MatSortHeaderHarness extends ComponentHarness {
4747
return '';
4848
}
4949

50-
/**
51-
* Gets the aria-label of the sort header.
52-
* @deprecated The sort header no longer has an `aria-label`. This method will be removed.
53-
* @breaking-change 11.0.0
54-
*/
55-
async getAriaLabel(): Promise<string|null> {
56-
return (await this._container()).getAttribute('aria-label');
57-
}
58-
5950
/** Gets whether the sort header is currently being sorted by. */
6051
async isActive(): Promise<boolean> {
6152
return !!(await this.getSortDirection());

tools/public_api_guard/material/sort.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ export declare class MatSortHeader extends _MatSortHeaderMixinBase implements Ca
7171
set disableClear(v: boolean);
7272
id: string;
7373
start: 'asc' | 'desc';
74-
constructor(_intl: MatSortHeaderIntl, _changeDetectorRef: ChangeDetectorRef, _sort: MatSort, _columnDef: MatSortHeaderColumnDef, _focusMonitor: FocusMonitor, _elementRef: ElementRef<HTMLElement>);
74+
constructor(
75+
_intl: MatSortHeaderIntl, _changeDetectorRef: ChangeDetectorRef, _sort: MatSort, _columnDef: MatSortHeaderColumnDef, _focusMonitor: FocusMonitor, _elementRef: ElementRef<HTMLElement>);
7576
_getAriaSortAttribute(): "none" | "ascending" | "descending";
7677
_getArrowDirectionState(): string;
7778
_getArrowViewState(): string;
@@ -95,7 +96,6 @@ export declare class MatSortHeader extends _MatSortHeaderMixinBase implements Ca
9596

9697
export declare class MatSortHeaderIntl {
9798
readonly changes: Subject<void>;
98-
sortButtonLabel: (id: string) => string;
9999
static ɵfac: i0.ɵɵFactoryDef<MatSortHeaderIntl, never>;
100100
static ɵprov: i0.ɵɵInjectableDef<MatSortHeaderIntl>;
101101
}

tools/public_api_guard/material/sort/testing.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ export declare class MatSortHarness extends ComponentHarness {
77

88
export declare class MatSortHeaderHarness extends ComponentHarness {
99
click(): Promise<void>;
10-
getAriaLabel(): Promise<string | null>;
1110
getLabel(): Promise<string>;
1211
getSortDirection(): Promise<SortDirection>;
1312
isActive(): Promise<boolean>;

0 commit comments

Comments
 (0)