Skip to content

Commit

Permalink
refactor(material/core): remove deprecated APIs for v13 (#23529)
Browse files Browse the repository at this point in the history
Cleans up the APIs that were marked for removal in v13.

BREAKING CHANGE:
* `CanColorCtor` is no longer necessary and has been removed.
* `CanDisableRippleCtor` is no longer necessary and has been removed.
* `CanDisableCtor` is no longer necessary and has been removed.
* `CanUpdateErrorStateCtor` is no longer necessary and has been removed.
* `HasInitializedCtor` is no longer necessary and has been removed.
* `HasTabIndexCtor` is no longer necessary and has been removed.
  • Loading branch information
crisbeto committed Sep 13, 2021
1 parent 81b6b6b commit 7bc9bfb
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 83 deletions.
4 changes: 1 addition & 3 deletions src/material-experimental/mdc-chips/chip-grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import {
} from '@angular/forms';
import {
CanUpdateErrorState,
CanUpdateErrorStateCtor,
ErrorStateMatcher,
mixinErrorState,
} from '@angular/material-experimental/mdc-core';
Expand Down Expand Up @@ -74,8 +73,7 @@ class MatChipGridBase extends MatChipSet {
super(_elementRef, _changeDetectorRef, _dir);
}
}
const _MatChipGridMixinBase: CanUpdateErrorStateCtor & typeof MatChipGridBase =
mixinErrorState(MatChipGridBase);
const _MatChipGridMixinBase = mixinErrorState(MatChipGridBase);

/**
* An extension of the MatChipSet component used with MatChipRow chips and
Expand Down
8 changes: 1 addition & 7 deletions src/material-experimental/mdc-chips/chip-icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ import {BooleanInput, NumberInput} from '@angular/cdk/coercion';
import {ChangeDetectorRef, Directive, ElementRef, InjectionToken, OnDestroy} from '@angular/core';
import {
CanDisable,
CanDisableCtor,
HasTabIndex,
HasTabIndexCtor,
mixinDisabled,
mixinTabIndex,
} from '@angular/material-experimental/mdc-core';
Expand Down Expand Up @@ -143,11 +141,7 @@ class MatChipRemoveBase extends MatChipTrailingIcon {
}
}

const _MatChipRemoveMixinBase:
CanDisableCtor &
HasTabIndexCtor &
typeof MatChipRemoveBase =
mixinTabIndex(mixinDisabled(MatChipRemoveBase), 0);
const _MatChipRemoveMixinBase = mixinTabIndex(mixinDisabled(MatChipRemoveBase), 0);

/**
* Directive to remove the parent chip when the trailing icon is clicked or
Expand Down
5 changes: 2 additions & 3 deletions src/material-experimental/mdc-chips/chip-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
QueryList,
ViewEncapsulation
} from '@angular/core';
import {HasTabIndex, HasTabIndexCtor, mixinTabIndex} from '@angular/material-experimental/mdc-core';
import {HasTabIndex, mixinTabIndex} from '@angular/material-experimental/mdc-core';
import {deprecated} from '@material/chips';
import {merge, Observable, Subject, Subscription} from 'rxjs';
import {startWith, takeUntil} from 'rxjs/operators';
Expand All @@ -40,8 +40,7 @@ abstract class MatChipSetBase {
abstract disabled: boolean;
constructor(_elementRef: ElementRef) {}
}
const _MatChipSetMixinBase: HasTabIndexCtor & typeof MatChipSetBase =
mixinTabIndex(MatChipSetBase);
const _MatChipSetMixinBase = mixinTabIndex(MatChipSetBase);

/**
* Basic container component for the MatChip component.
Expand Down
6 changes: 0 additions & 6 deletions src/material-experimental/mdc-core/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,15 @@ export {
AnimationCurves,
AnimationDurations,
CanColor,
CanColorCtor,
CanDisable,
CanDisableCtor,
CanDisableRipple,
CanDisableRippleCtor,
CanUpdateErrorState,
CanUpdateErrorStateCtor,
DateAdapter,
defaultRippleAnimationConfig,
ErrorStateMatcher,
GranularSanityChecks,
HasInitialized,
HasInitializedCtor,
HasTabIndex,
HasTabIndexCtor,
MAT_DATE_FORMATS,
MAT_DATE_LOCALE,
MAT_DATE_LOCALE_FACTORY,
Expand Down
7 changes: 1 addition & 6 deletions src/material/core/common-behaviors/color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ export interface CanColor {
defaultColor: ThemePalette | undefined;
}

/**
* @docs-private
* @deprecated No longer necessary to apply to mixin classes. To be made private.
* @breaking-change 13.0.0
*/
export type CanColorCtor = Constructor<CanColor> & AbstractConstructor<CanColor>;
type CanColorCtor = Constructor<CanColor> & AbstractConstructor<CanColor>;

/** @docs-private */
export interface HasElementRef {
Expand Down
8 changes: 1 addition & 7 deletions src/material/core/common-behaviors/disable-ripple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@ export interface CanDisableRipple {
disableRipple: boolean;
}

/**
* @docs-private
* @deprecated No longer necessary to apply to mixin classes. To be made private.
* @breaking-change 13.0.0
*/
export type CanDisableRippleCtor = Constructor<CanDisableRipple> &
AbstractConstructor<CanDisableRipple>;
type CanDisableRippleCtor = Constructor<CanDisableRipple> & AbstractConstructor<CanDisableRipple>;

/** Mixin to augment a directive with a `disableRipple` property. */
export function mixinDisableRipple<T extends AbstractConstructor<{}>>(base: T):
Expand Down
7 changes: 1 addition & 6 deletions src/material/core/common-behaviors/disabled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,7 @@ export interface CanDisable {
disabled: boolean;
}

/**
* @docs-private
* @deprecated No longer necessary to apply to mixin classes. To be made private.
* @breaking-change 13.0.0
*/
export type CanDisableCtor = Constructor<CanDisable> & AbstractConstructor<CanDisable>;
type CanDisableCtor = Constructor<CanDisable> & AbstractConstructor<CanDisable>;

/** Mixin to augment a directive with a `disabled` property. */
export function mixinDisabled<T extends AbstractConstructor<{}>>(base: T): CanDisableCtor & T;
Expand Down
9 changes: 2 additions & 7 deletions src/material/core/common-behaviors/error-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,8 @@ export interface CanUpdateErrorState {
errorStateMatcher: ErrorStateMatcher;
}

/**
* @docs-private
* @deprecated No longer necessary to apply to mixin classes. To be made private.
* @breaking-change 13.0.0
*/
export type CanUpdateErrorStateCtor = Constructor<CanUpdateErrorState> &
AbstractConstructor<CanUpdateErrorState>;
type CanUpdateErrorStateCtor = Constructor<CanUpdateErrorState> &
AbstractConstructor<CanUpdateErrorState>;

/** @docs-private */
export interface HasErrorState {
Expand Down
12 changes: 6 additions & 6 deletions src/material/core/common-behaviors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ export {
SanityChecks,
GranularSanityChecks,
} from './common-module';
export {CanDisable, CanDisableCtor, mixinDisabled} from './disabled';
export {CanColor, CanColorCtor, mixinColor, ThemePalette} from './color';
export {CanDisableRipple, CanDisableRippleCtor, mixinDisableRipple} from './disable-ripple';
export {HasTabIndex, HasTabIndexCtor, mixinTabIndex} from './tabindex';
export {CanUpdateErrorState, CanUpdateErrorStateCtor, mixinErrorState} from './error-state';
export {HasInitialized, HasInitializedCtor, mixinInitialized} from './initialized';
export {CanDisable, mixinDisabled} from './disabled';
export {CanColor, mixinColor, ThemePalette} from './color';
export {CanDisableRipple, mixinDisableRipple} from './disable-ripple';
export {HasTabIndex, mixinTabIndex} from './tabindex';
export {CanUpdateErrorState, mixinErrorState} from './error-state';
export {HasInitialized, mixinInitialized} from './initialized';
7 changes: 1 addition & 6 deletions src/material/core/common-behaviors/initialized.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@ export interface HasInitialized {
_markInitialized: () => void;
}

/**
* @docs-private
* @deprecated No longer necessary to apply to mixin classes. To be made private.
* @breaking-change 13.0.0
*/
export type HasInitializedCtor = Constructor<HasInitialized>;
type HasInitializedCtor = Constructor<HasInitialized>;

/** Mixin to augment a directive with an initialized property that will emits when ngOnInit ends. */
export function mixinInitialized<T extends Constructor<{}>>(base: T):
Expand Down
7 changes: 1 addition & 6 deletions src/material/core/common-behaviors/tabindex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,7 @@ export interface HasTabIndex {
defaultTabIndex: number;
}

/**
* @docs-private
* @deprecated No longer necessary to apply to mixin classes. To be made private.
* @breaking-change 13.0.0
*/
export type HasTabIndexCtor = Constructor<HasTabIndex> & AbstractConstructor<HasTabIndex>;
type HasTabIndexCtor = Constructor<HasTabIndex> & AbstractConstructor<HasTabIndex>;

/** Mixin to augment a directive with a `tabIndex` property. */
export function mixinTabIndex<T extends AbstractConstructor<CanDisable>>(base: T,
Expand Down
18 changes: 0 additions & 18 deletions tools/public_api_guard/material/core.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,16 @@ export interface CanColor {
defaultColor: ThemePalette | undefined;
}

// @public @deprecated
export type CanColorCtor = Constructor<CanColor> & AbstractConstructor<CanColor>;

// @public
export interface CanDisable {
disabled: boolean;
}

// @public @deprecated
export type CanDisableCtor = Constructor<CanDisable> & AbstractConstructor<CanDisable>;

// @public
export interface CanDisableRipple {
disableRipple: boolean;
}

// @public @deprecated
export type CanDisableRippleCtor = Constructor<CanDisableRipple> & AbstractConstructor<CanDisableRipple>;

// @public
export interface CanUpdateErrorState {
errorState: boolean;
Expand All @@ -88,9 +79,6 @@ export interface CanUpdateErrorState {
updateErrorState(): void;
}

// @public @deprecated
export type CanUpdateErrorStateCtor = Constructor<CanUpdateErrorState> & AbstractConstructor<CanUpdateErrorState>;

// @public
export function _countGroupLabelsBeforeOption(optionIndex: number, options: QueryList<MatOption>, optionGroups: QueryList<MatOptgroup>): number;

Expand Down Expand Up @@ -165,18 +153,12 @@ export interface HasInitialized {
_markInitialized: () => void;
}

// @public @deprecated
export type HasInitializedCtor = Constructor<HasInitialized>;

// @public
export interface HasTabIndex {
defaultTabIndex: number;
tabIndex: number;
}

// @public @deprecated
export type HasTabIndexCtor = Constructor<HasTabIndex> & AbstractConstructor<HasTabIndex>;

// @public (undocumented)
export const MAT_DATE_FORMATS: InjectionToken<MatDateFormats>;

Expand Down
1 change: 0 additions & 1 deletion tools/public_api_guard/material/paginator.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { ChangeDetectorRef } from '@angular/core';
import { Constructor } from '@angular/material/core/common-behaviors/constructor';
import { EventEmitter } from '@angular/core';
import { HasInitialized } from '@angular/material/core';
import { HasInitializedCtor } from '@angular/material/core';
import * as i0 from '@angular/core';
import * as i2 from '@angular/common';
import * as i3 from '@angular/material/button';
Expand Down
1 change: 0 additions & 1 deletion tools/public_api_guard/material/sort.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { ElementRef } from '@angular/core';
import { EventEmitter } from '@angular/core';
import { FocusMonitor } from '@angular/cdk/a11y';
import { HasInitialized } from '@angular/material/core';
import { HasInitializedCtor } from '@angular/material/core';
import * as i0 from '@angular/core';
import * as i3 from '@angular/common';
import * as i4 from '@angular/material/core';
Expand Down

0 comments on commit 7bc9bfb

Please sign in to comment.