Skip to content

refactor(material/sort): remove deprecated APIs for v12 #21833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 6, 2021
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
12 changes: 3 additions & 9 deletions src/material/sort/sort-header-intl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {Subject} from 'rxjs';
/**
* To modify the labels and text displayed, create a new instance of MatSortHeaderIntl and
* include it in a custom provider.
* @deprecated No longer being used. To be removed.
* @breaking-change 13.0.0
*/
@Injectable({providedIn: 'root'})
export class MatSortHeaderIntl {
Expand All @@ -20,16 +22,8 @@ export class MatSortHeaderIntl {
* components if the labels have changed after initialization.
*/
readonly changes: Subject<void> = new Subject<void>();

/**
* ARIA label for the sorting button.
* @deprecated Not used anymore. To be removed.
* @breaking-change 8.0.0
*/
sortButtonLabel = (id: string) => {
return `Change sorting for ${id}`;
}
}

/** @docs-private */
export function MAT_SORT_HEADER_INTL_PROVIDER_FACTORY(parentIntl: MatSortHeaderIntl) {
return parentIntl || new MatSortHeaderIntl();
Expand Down
7 changes: 6 additions & 1 deletion src/material/sort/sort-header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,12 @@ export class MatSortHeader extends _MatSortHeaderMixinBase
set disableClear(v) { this._disableClear = coerceBooleanProperty(v); }
private _disableClear: boolean;

constructor(public _intl: MatSortHeaderIntl,
constructor(
/**
* @deprecated `_intl` parameter isn't being used anymore and it'll be removed.
* @breaking-change 13.0.0
*/
public _intl: MatSortHeaderIntl,
private _changeDetectorRef: ChangeDetectorRef,
// `MatSort` is not optionally injected, but just asserted manually w/ better error.
// tslint:disable-next-line: lightweight-tokens
Expand Down
9 changes: 0 additions & 9 deletions src/material/sort/testing/sort-header-harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,6 @@ export class MatSortHeaderHarness extends ComponentHarness {
return '';
}

/**
* Gets the aria-label of the sort header.
* @deprecated The sort header no longer has an `aria-label`. This method will be removed.
* @breaking-change 11.0.0
*/
async getAriaLabel(): Promise<string|null> {
return (await this._container()).getAttribute('aria-label');
}

/** Gets whether the sort header is currently being sorted by. */
async isActive(): Promise<boolean> {
return !!(await this.getSortDirection());
Expand Down
4 changes: 2 additions & 2 deletions tools/public_api_guard/material/sort.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ export declare class MatSortHeader extends _MatSortHeaderMixinBase implements Ca
set disableClear(v: boolean);
id: string;
start: 'asc' | 'desc';
constructor(_intl: MatSortHeaderIntl, _changeDetectorRef: ChangeDetectorRef, _sort: MatSort, _columnDef: MatSortHeaderColumnDef, _focusMonitor: FocusMonitor, _elementRef: ElementRef<HTMLElement>);
constructor(
_intl: MatSortHeaderIntl, _changeDetectorRef: ChangeDetectorRef, _sort: MatSort, _columnDef: MatSortHeaderColumnDef, _focusMonitor: FocusMonitor, _elementRef: ElementRef<HTMLElement>);
_getAriaSortAttribute(): "none" | "ascending" | "descending";
_getArrowDirectionState(): string;
_getArrowViewState(): string;
Expand All @@ -95,7 +96,6 @@ export declare class MatSortHeader extends _MatSortHeaderMixinBase implements Ca

export declare class MatSortHeaderIntl {
readonly changes: Subject<void>;
sortButtonLabel: (id: string) => string;
static ɵfac: i0.ɵɵFactoryDef<MatSortHeaderIntl, never>;
static ɵprov: i0.ɵɵInjectableDef<MatSortHeaderIntl>;
}
Expand Down
1 change: 0 additions & 1 deletion tools/public_api_guard/material/sort/testing.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export declare class MatSortHarness extends ComponentHarness {

export declare class MatSortHeaderHarness extends ComponentHarness {
click(): Promise<void>;
getAriaLabel(): Promise<string | null>;
getLabel(): Promise<string>;
getSortDirection(): Promise<SortDirection>;
isActive(): Promise<boolean>;
Expand Down