diff --git a/src/cdk/table/can-stick.ts b/src/cdk/table/can-stick.ts index 0e2333a62098..d949f1143d8d 100644 --- a/src/cdk/table/can-stick.ts +++ b/src/cdk/table/can-stick.ts @@ -36,6 +36,8 @@ export type CanStickCtor = Constructor; * changed since the last time the function was called. Essentially adds a dirty-check to the * sticky value. * @docs-private + * @deprecated Implement the `CanStick` interface instead. + * @breaking-change 19.0.0 */ export function mixinHasStickyInput>(base: T): CanStickCtor & T { return class extends base { diff --git a/src/material/core/common-behaviors/color.ts b/src/material/core/common-behaviors/color.ts index f0b7a8a2461c..a4b657a27f71 100644 --- a/src/material/core/common-behaviors/color.ts +++ b/src/material/core/common-behaviors/color.ts @@ -9,7 +9,11 @@ import {AbstractConstructor, Constructor} from './constructor'; import {ElementRef} from '@angular/core'; -/** @docs-private */ +/** + * @docs-private + * @deprecated Will be removed together with `mixinColor`. + * @breaking-change 19.0.0 + */ export interface CanColor { /** Theme color palette for the component. */ color: ThemePalette; @@ -21,14 +25,18 @@ export interface CanColor { type CanColorCtor = Constructor & AbstractConstructor; /** @docs-private */ -export interface HasElementRef { +interface HasElementRef { _elementRef: ElementRef; } /** Possible color palette values. */ export type ThemePalette = 'primary' | 'accent' | 'warn' | undefined; -/** Mixin to augment a directive with a `color` property. */ +/** + * Mixin to augment a directive with a `color` property. + * @deprecated Use a plain input and host bindings instead. + * @breaking-change 19.0.0 + */ export function mixinColor>( base: T, defaultColor?: ThemePalette, diff --git a/src/material/core/common-behaviors/disable-ripple.ts b/src/material/core/common-behaviors/disable-ripple.ts index 8b55bc6376cf..e53cdd8a8d49 100644 --- a/src/material/core/common-behaviors/disable-ripple.ts +++ b/src/material/core/common-behaviors/disable-ripple.ts @@ -9,7 +9,11 @@ import {coerceBooleanProperty} from '@angular/cdk/coercion'; import {AbstractConstructor, Constructor} from './constructor'; -/** @docs-private */ +/** + * @docs-private + * @deprecated Will be removed together with `mixinDisableRipple`. + * @breaking-change 19.0.0 + */ export interface CanDisableRipple { /** Whether ripples are disabled. */ disableRipple: boolean; @@ -17,7 +21,11 @@ export interface CanDisableRipple { type CanDisableRippleCtor = Constructor & AbstractConstructor; -/** Mixin to augment a directive with a `disableRipple` property. */ +/** + * Mixin to augment a directive with a `disableRipple` property. + * @deprecated Use an input with a transform instead. + * @breaking-change 19.0.0 + */ export function mixinDisableRipple>( base: T, ): CanDisableRippleCtor & T; diff --git a/src/material/core/common-behaviors/disabled.ts b/src/material/core/common-behaviors/disabled.ts index 59eaf071f41c..a60e8db83b81 100644 --- a/src/material/core/common-behaviors/disabled.ts +++ b/src/material/core/common-behaviors/disabled.ts @@ -9,7 +9,11 @@ import {coerceBooleanProperty} from '@angular/cdk/coercion'; import {AbstractConstructor, Constructor} from './constructor'; -/** @docs-private */ +/** + * @docs-private + * @deprecated Will be removed together with `mixinDisabled`. + * @breaking-change 19.0.0 + */ export interface CanDisable { /** Whether the component is disabled. */ disabled: boolean; @@ -17,7 +21,11 @@ export interface CanDisable { type CanDisableCtor = Constructor & AbstractConstructor; -/** Mixin to augment a directive with a `disabled` property. */ +/** + * Mixin to augment a directive with a `disabled` property. + * @deprecated Use an input with a transform instead. + * @breaking-change 19.0.0 + */ export function mixinDisabled>(base: T): CanDisableCtor & T; export function mixinDisabled>(base: T): CanDisableCtor & T { return class extends base { diff --git a/src/material/core/common-behaviors/error-state.ts b/src/material/core/common-behaviors/error-state.ts index 508702290a4b..88aeb448b4f3 100644 --- a/src/material/core/common-behaviors/error-state.ts +++ b/src/material/core/common-behaviors/error-state.ts @@ -14,7 +14,11 @@ import {AbstractConstructor, Constructor} from './constructor'; // Declare ErrorStateMatcher as an interface to have compatibility with Closure Compiler. interface ErrorStateMatcher extends _ErrorStateMatcher {} -/** @docs-private */ +/** + * @docs-private + * @deprecated Will be removed together with `mixinErrorState`. + * @breaking-change 19.0.0 + */ export interface CanUpdateErrorState { /** Updates the error state based on the provided error state matcher. */ updateErrorState(): void; @@ -28,7 +32,7 @@ type CanUpdateErrorStateCtor = Constructor & AbstractConstructor; /** @docs-private */ -export interface HasErrorState { +interface HasErrorState { _parentFormGroup: FormGroupDirective; _parentForm: NgForm; _defaultErrorStateMatcher: ErrorStateMatcher; @@ -77,6 +81,8 @@ export class _ErrorStateTracker { /** * Mixin to augment a directive with updateErrorState method. * For component with `errorState` and need to update `errorState`. + * @deprecated Implement the `updateErrorState` method directly. + * @breaking-change 19.0.0 */ export function mixinErrorState>( base: T, diff --git a/src/material/core/common-behaviors/initialized.ts b/src/material/core/common-behaviors/initialized.ts index 5d9b225ef7a3..e62f77db673b 100644 --- a/src/material/core/common-behaviors/initialized.ts +++ b/src/material/core/common-behaviors/initialized.ts @@ -15,6 +15,8 @@ import {Constructor} from './constructor'; * If the subscription is made after it has already been marked as initialized, then it will trigger * an emit immediately. * @docs-private + * @deprecated Will be removed together with `mixinInitializer`. + * @breaking-change 19.0.0 */ export interface HasInitialized { /** Stream that emits once during the directive/component's ngOnInit. */ @@ -30,7 +32,11 @@ export interface HasInitialized { type HasInitializedCtor = Constructor; -/** Mixin to augment a directive with an initialized property that will emits when ngOnInit ends. */ +/** + * Mixin to augment a directive with an initialized property that will emits when ngOnInit ends. + * @deprecated Track the initialized state manually. + * @breaking-change 19.0.0 + */ export function mixinInitialized>(base: T): HasInitializedCtor & T { return class extends base { /** Whether this directive has been marked as initialized. */ diff --git a/src/material/core/common-behaviors/tabindex.ts b/src/material/core/common-behaviors/tabindex.ts index b4a5c0c8ba90..79c36a3c4be5 100644 --- a/src/material/core/common-behaviors/tabindex.ts +++ b/src/material/core/common-behaviors/tabindex.ts @@ -10,7 +10,11 @@ import {coerceNumberProperty} from '@angular/cdk/coercion'; import {Constructor, AbstractConstructor} from './constructor'; import {CanDisable} from './disabled'; -/** @docs-private */ +/** + * @docs-private + * @deprecated Will be removed together with `mixinTabIndex`. + * @breaking-change 19.0.0 + */ export interface HasTabIndex { /** Tabindex of the component. */ tabIndex: number; @@ -21,7 +25,11 @@ export interface HasTabIndex { type HasTabIndexCtor = Constructor & AbstractConstructor; -/** Mixin to augment a directive with a `tabIndex` property. */ +/** + * Mixin to augment a directive with a `tabIndex` property. + * @deprecated Use an input with a transform instead. + * @breaking-change 19.0.0 + */ export function mixinTabIndex>( base: T, defaultTabIndex?: number, diff --git a/tools/public_api_guard/cdk/table.md b/tools/public_api_guard/cdk/table.md index eeb39e1f507f..3b56a2bfc97a 100644 --- a/tools/public_api_guard/cdk/table.md +++ b/tools/public_api_guard/cdk/table.md @@ -496,7 +496,7 @@ export class HeaderRowOutlet implements RowOutlet { static ɵfac: i0.ɵɵFactoryDeclaration; } -// @public +// @public @deprecated export function mixinHasStickyInput>(base: T): CanStickCtor & T; // @public diff --git a/tools/public_api_guard/material/core.md b/tools/public_api_guard/material/core.md index f381958109b1..c32d69cc9765 100644 --- a/tools/public_api_guard/material/core.md +++ b/tools/public_api_guard/material/core.md @@ -53,23 +53,23 @@ export class AnimationDurations { static EXITING: string; } -// @public +// @public @deprecated export interface CanColor { color: ThemePalette; defaultColor: ThemePalette | undefined; } -// @public +// @public @deprecated export interface CanDisable { disabled: boolean; } -// @public +// @public @deprecated export interface CanDisableRipple { disableRipple: boolean; } -// @public +// @public @deprecated export interface CanUpdateErrorState { errorState: boolean; errorStateMatcher: ErrorStateMatcher_2; @@ -157,13 +157,13 @@ export interface GranularSanityChecks { version: boolean; } -// @public +// @public @deprecated export interface HasInitialized { initialized: Observable; _markInitialized: () => void; } -// @public +// @public @deprecated export interface HasTabIndex { defaultTabIndex: number; tabIndex: number; @@ -431,22 +431,22 @@ export class MatRippleModule { static ɵmod: i0.ɵɵNgModuleDeclaration; } -// @public +// @public @deprecated export function mixinColor>(base: T, defaultColor?: ThemePalette): CanColorCtor & T; -// @public +// @public @deprecated export function mixinDisabled>(base: T): CanDisableCtor & T; -// @public +// @public @deprecated export function mixinDisableRipple>(base: T): CanDisableRippleCtor & T; -// @public +// @public @deprecated export function mixinErrorState>(base: T): CanUpdateErrorStateCtor & T; -// @public +// @public @deprecated export function mixinInitialized>(base: T): HasInitializedCtor & T; -// @public +// @public @deprecated export function mixinTabIndex>(base: T, defaultTabIndex?: number): HasTabIndexCtor & T; // @public