diff --git a/goldens/cdk/a11y/index.api.md b/goldens/cdk/a11y/index.api.md index 0219011a0edf..3459b6d58d38 100644 --- a/goldens/cdk/a11y/index.api.md +++ b/goldens/cdk/a11y/index.api.md @@ -61,12 +61,6 @@ export class AriaDescriber implements OnDestroy { // @public export type AriaLivePoliteness = 'off' | 'polite' | 'assertive'; -// @public @deprecated -export const CDK_DESCRIBEDBY_HOST_ATTRIBUTE = "cdk-describedby-host"; - -// @public @deprecated -export const CDK_DESCRIBEDBY_ID_PREFIX = "cdk-describedby-message"; - // @public export class CdkAriaLive implements OnDestroy { constructor(); @@ -124,7 +118,7 @@ export class CdkTrapFocus implements OnDestroy, AfterContentInit, OnChanges, DoC // @public export class ConfigurableFocusTrap extends FocusTrap implements ManagedFocusTrap { - constructor(_element: HTMLElement, _checker: InteractivityChecker, _ngZone: NgZone, _document: Document, _focusTrapManager: FocusTrapManager, _inertStrategy: FocusTrapInertStrategy, config: ConfigurableFocusTrapConfig, injector?: Injector); + constructor(_element: HTMLElement, _checker: InteractivityChecker, _ngZone: NgZone, _document: Document, _focusTrapManager: FocusTrapManager, _inertStrategy: FocusTrapInertStrategy, config: ConfigurableFocusTrapConfig, injector: Injector); destroy(): void; _disable(): void; _enable(): void; @@ -141,8 +135,6 @@ export interface ConfigurableFocusTrapConfig { export class ConfigurableFocusTrapFactory { constructor(); create(element: HTMLElement, config?: ConfigurableFocusTrapConfig): ConfigurableFocusTrap; - // @deprecated (undocumented) - create(element: HTMLElement, deferCaptureElements: boolean): ConfigurableFocusTrap; // (undocumented) static ɵfac: i0.ɵɵFactoryDeclaration; // (undocumented) @@ -216,8 +208,7 @@ export type FocusOrigin = 'touch' | 'mouse' | 'keyboard' | 'program' | null; // @public export class FocusTrap { - constructor(_element: HTMLElement, _checker: InteractivityChecker, _ngZone: NgZone, _document: Document, deferAnchors?: boolean, - _injector?: Injector | undefined); + constructor(_element: HTMLElement, _checker: InteractivityChecker, _ngZone: NgZone, _document: Document, deferAnchors: boolean | undefined, _injector: Injector); attachAnchors(): boolean; destroy(): void; // (undocumented) @@ -237,7 +228,8 @@ export class FocusTrap { focusLastTabbableElement(options?: FocusOptions): boolean; focusLastTabbableElementWhenReady(options?: FocusOptions): Promise; hasAttached(): boolean; - readonly _injector?: Injector | undefined; + // (undocumented) + readonly _injector: Injector; // (undocumented) readonly _ngZone: NgZone; // (undocumented) @@ -425,9 +417,6 @@ export interface LiveAnnouncerDefaultOptions { // @public export type LiveAnnouncerMessage = string | SafeHtml; -// @public @deprecated -export const MESSAGES_CONTAINER_ID = "cdk-describedby-message-container"; - // @public @deprecated export const NOOP_TREE_KEY_MANAGER_FACTORY_PROVIDER: Provider; diff --git a/goldens/cdk/drag-drop/index.api.md b/goldens/cdk/drag-drop/index.api.md index 447e3af988fd..3b20babae00d 100644 --- a/goldens/cdk/drag-drop/index.api.md +++ b/goldens/cdk/drag-drop/index.api.md @@ -497,7 +497,7 @@ export class DropListRef { data: T; disabled: boolean; dispose(): void; - drop(item: DragRef, currentIndex: number, previousIndex: number, previousContainer: DropListRef, isPointerOverContainer: boolean, distance: Point, dropPoint: Point, event?: MouseEvent | TouchEvent): void; + drop(item: DragRef, currentIndex: number, previousIndex: number, previousContainer: DropListRef, isPointerOverContainer: boolean, distance: Point, dropPoint: Point, event: MouseEvent | TouchEvent): void; readonly dropped: Subject<{ item: DragRef; currentIndex: number; diff --git a/goldens/cdk/menu/index.api.md b/goldens/cdk/menu/index.api.md index c9cb1c05cc24..0b43b2141e0a 100644 --- a/goldens/cdk/menu/index.api.md +++ b/goldens/cdk/menu/index.api.md @@ -356,15 +356,13 @@ export interface MenuStackItem { } // @public -class MenuTracker { +export class MenuTracker { update(trigger: CdkMenuTriggerBase): void; // (undocumented) static ɵfac: i0.ɵɵFactoryDeclaration; // (undocumented) static ɵprov: i0.ɵɵInjectableDeclaration; } -export { MenuTracker as ContextMenuTracker } -export { MenuTracker } // @public export const PARENT_OR_NEW_INLINE_MENU_STACK_PROVIDER: (orientation: "vertical" | "horizontal") => { diff --git a/goldens/material/list/index.api.md b/goldens/material/list/index.api.md index 4d2063b77e85..6d7e446fef81 100644 --- a/goldens/material/list/index.api.md +++ b/goldens/material/list/index.api.md @@ -161,9 +161,6 @@ export class MatListModule { // @public (undocumented) export class MatListOption extends MatListItemBase implements ListOption, OnInit, OnDestroy { - // @deprecated - get checkboxPosition(): MatListOptionTogglePosition; - set checkboxPosition(value: MatListOptionTogglePosition); get color(): ThemePalette; set color(newValue: ThemePalette); focus(): void; @@ -201,15 +198,13 @@ export class MatListOption extends MatListItemBase implements ListOption, OnInit get value(): any; set value(newValue: any); // (undocumented) - static ɵcmp: i0.ɵɵComponentDeclaration; + static ɵcmp: i0.ɵɵComponentDeclaration; // (undocumented) static ɵfac: i0.ɵɵFactoryDeclaration; } // @public -type MatListOptionTogglePosition = 'before' | 'after'; -export { MatListOptionTogglePosition as MatListOptionCheckboxPosition } -export { MatListOptionTogglePosition } +export type MatListOptionTogglePosition = 'before' | 'after'; // @public export class MatListSubheaderCssMatStyler { diff --git a/goldens/material/sort/index.api.md b/goldens/material/sort/index.api.md index 3dc256b01d5c..93bf0f87427d 100644 --- a/goldens/material/sort/index.api.md +++ b/goldens/material/sort/index.api.md @@ -15,17 +15,6 @@ import { OnDestroy } from '@angular/core'; import { OnInit } from '@angular/core'; import { Subject } from 'rxjs'; -// @public @deprecated -export type ArrowViewState = SortDirection | 'hint' | 'active'; - -// @public @deprecated -export interface ArrowViewStateTransition { - // (undocumented) - fromState?: ArrowViewState; - // (undocumented) - toState?: ArrowViewState; -} - // @public export const MAT_SORT_DEFAULT_OPTIONS: InjectionToken; diff --git a/src/cdk-experimental/popover-edit/focus-escape-notifier.ts b/src/cdk-experimental/popover-edit/focus-escape-notifier.ts index 37c29b3ae753..f6bf344f0ca0 100644 --- a/src/cdk-experimental/popover-edit/focus-escape-notifier.ts +++ b/src/cdk-experimental/popover-edit/focus-escape-notifier.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.dev/license */ -import {Service, NgZone, inject, DOCUMENT} from '@angular/core'; +import {Service, NgZone, inject, DOCUMENT, Injector} from '@angular/core'; import {FocusTrap, InteractivityChecker} from '@angular/cdk/a11y'; import {Observable, Subject} from 'rxjs'; @@ -29,8 +29,9 @@ export class FocusEscapeNotifier extends FocusTrap { checker: InteractivityChecker, ngZone: NgZone, document: Document, + injector: Injector, ) { - super(element, checker, ngZone, document, true /* deferAnchors */); + super(element, checker, ngZone, document, true /* deferAnchors */, injector); // The focus trap adds "anchors" at the beginning and end of a trapped region that redirect // focus. We override that redirect behavior here with simply emitting on a stream. @@ -57,6 +58,7 @@ export class FocusEscapeNotifierFactory { private _checker = inject(InteractivityChecker); private _ngZone = inject(NgZone); private _document = inject(DOCUMENT); + private _injector = inject(Injector); /** * Creates a focus escape notifier region around the given element. @@ -64,6 +66,12 @@ export class FocusEscapeNotifierFactory { * @returns The created focus escape notifier instance. */ create(element: HTMLElement): FocusEscapeNotifier { - return new FocusEscapeNotifier(element, this._checker, this._ngZone, this._document); + return new FocusEscapeNotifier( + element, + this._checker, + this._ngZone, + this._document, + this._injector, + ); } } diff --git a/src/cdk/a11y/aria-describer/aria-describer.spec.ts b/src/cdk/a11y/aria-describer/aria-describer.spec.ts index 56cf5212b69d..2dc7403287e8 100644 --- a/src/cdk/a11y/aria-describer/aria-describer.spec.ts +++ b/src/cdk/a11y/aria-describer/aria-describer.spec.ts @@ -1,5 +1,4 @@ -import {A11yModule, CDK_DESCRIBEDBY_HOST_ATTRIBUTE} from '../index'; -import {AriaDescriber} from './aria-describer'; +import {AriaDescriber, CDK_DESCRIBEDBY_HOST_ATTRIBUTE} from './aria-describer'; import {ComponentFixture, TestBed} from '@angular/core/testing'; import {Component, ElementRef, ViewChild, inject, ChangeDetectionStrategy} from '@angular/core'; @@ -395,7 +394,6 @@ function expectMessage(el: Element, message: string) {
Hello
Hey
`, - imports: [A11yModule], changeDetection: ChangeDetectionStrategy.Eager, }) class TestApp { diff --git a/src/cdk/a11y/aria-describer/aria-describer.ts b/src/cdk/a11y/aria-describer/aria-describer.ts index fa34bcff3315..82782cbb7c6b 100644 --- a/src/cdk/a11y/aria-describer/aria-describer.ts +++ b/src/cdk/a11y/aria-describer/aria-describer.ts @@ -23,25 +23,10 @@ export interface RegisteredMessage { referenceCount: number; } -/** - * ID used for the body container where all messages are appended. - * @deprecated No longer being used. To be removed. - * @breaking-change 14.0.0 - */ -export const MESSAGES_CONTAINER_ID = 'cdk-describedby-message-container'; +/** ID prefix used for each created message element. */ +const CDK_DESCRIBEDBY_ID_PREFIX = 'cdk-describedby-message'; -/** - * ID prefix used for each created message element. - * @deprecated To be turned into a private variable. - * @breaking-change 14.0.0 - */ -export const CDK_DESCRIBEDBY_ID_PREFIX = 'cdk-describedby-message'; - -/** - * Attribute given to each host element that is described by a message element. - * @deprecated To be turned into a private variable. - * @breaking-change 14.0.0 - */ +/** Attribute given to each host element that is described by a message element. */ export const CDK_DESCRIBEDBY_HOST_ATTRIBUTE = 'cdk-describedby-host'; /** Global incremental identifier for each registered message element. */ diff --git a/src/cdk/a11y/focus-trap/configurable-focus-trap-factory.ts b/src/cdk/a11y/focus-trap/configurable-focus-trap-factory.ts index c23a7582236f..b165956ef2ee 100644 --- a/src/cdk/a11y/focus-trap/configurable-focus-trap-factory.ts +++ b/src/cdk/a11y/focus-trap/configurable-focus-trap-factory.ts @@ -41,22 +41,10 @@ export class ConfigurableFocusTrapFactory { */ create(element: HTMLElement, config?: ConfigurableFocusTrapConfig): ConfigurableFocusTrap; - /** - * @deprecated Pass a config object instead of the `deferCaptureElements` flag. - * @breaking-change 11.0.0 - */ - create(element: HTMLElement, deferCaptureElements: boolean): ConfigurableFocusTrap; - create( element: HTMLElement, - config: ConfigurableFocusTrapConfig | boolean = {defer: false}, + config: ConfigurableFocusTrapConfig = {defer: false}, ): ConfigurableFocusTrap { - let configObject: ConfigurableFocusTrapConfig; - if (typeof config === 'boolean') { - configObject = {defer: config}; - } else { - configObject = config; - } return new ConfigurableFocusTrap( element, this._checker, @@ -64,7 +52,7 @@ export class ConfigurableFocusTrapFactory { this._document, this._focusTrapManager, this._inertStrategy, - configObject, + config, this._injector, ); } diff --git a/src/cdk/a11y/focus-trap/configurable-focus-trap.ts b/src/cdk/a11y/focus-trap/configurable-focus-trap.ts index e95a81b6a7dc..26b817879e4e 100644 --- a/src/cdk/a11y/focus-trap/configurable-focus-trap.ts +++ b/src/cdk/a11y/focus-trap/configurable-focus-trap.ts @@ -41,7 +41,7 @@ export class ConfigurableFocusTrap extends FocusTrap implements ManagedFocusTrap private _focusTrapManager: FocusTrapManager, private _inertStrategy: FocusTrapInertStrategy, config: ConfigurableFocusTrapConfig, - injector?: Injector, + injector: Injector, ) { super(_element, _checker, _ngZone, _document, config.defer, injector); this._focusTrapManager.register(this); diff --git a/src/cdk/a11y/focus-trap/focus-trap.ts b/src/cdk/a11y/focus-trap/focus-trap.ts index abe0dae50c02..18567653f3e6 100644 --- a/src/cdk/a11y/focus-trap/focus-trap.ts +++ b/src/cdk/a11y/focus-trap/focus-trap.ts @@ -64,8 +64,7 @@ export class FocusTrap { readonly _ngZone: NgZone, readonly _document: Document, deferAnchors = false, - /** @breaking-change 20.0.0 param to become required */ - readonly _injector?: Injector, + readonly _injector: Injector, ) { if (!deferAnchors) { this.attachAnchors(); @@ -359,12 +358,7 @@ export class FocusTrap { /** Executes a function when the zone is stable. */ private _executeOnStable(fn: () => any): void { - // TODO: remove this conditional when injector is required in the constructor. - if (this._injector) { - afterNextRender(fn, {injector: this._injector}); - } else { - setTimeout(fn); - } + afterNextRender(fn, {injector: this._injector}); } } diff --git a/src/cdk/a11y/public-api.ts b/src/cdk/a11y/public-api.ts index df192ec2c339..9b0534690742 100644 --- a/src/cdk/a11y/public-api.ts +++ b/src/cdk/a11y/public-api.ts @@ -5,7 +5,7 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ -export * from './aria-describer/aria-describer'; +export {AriaDescriber, RegisteredMessage} from './aria-describer/aria-describer'; export * from './aria-describer/aria-reference'; export * from './key-manager/activedescendant-key-manager'; export * from './key-manager/focus-key-manager'; diff --git a/src/cdk/drag-drop/drop-list-ref.ts b/src/cdk/drag-drop/drop-list-ref.ts index 000b3c188691..e37665a6442c 100644 --- a/src/cdk/drag-drop/drop-list-ref.ts +++ b/src/cdk/drag-drop/drop-list-ref.ts @@ -301,8 +301,6 @@ export class DropListRef { * container when the item was dropped. * @param distance Distance the user has dragged since the start of the dragging sequence. * @param event Event that triggered the dropping sequence. - * - * @breaking-change 15.0.0 `previousIndex` and `event` parameters to become required. */ drop( item: DragRef, @@ -312,7 +310,7 @@ export class DropListRef { isPointerOverContainer: boolean, distance: Point, dropPoint: Point, - event: MouseEvent | TouchEvent = {} as any, + event: MouseEvent | TouchEvent, ): void { this._reset(); this.dropped.next({ diff --git a/src/cdk/menu/context-menu-trigger.ts b/src/cdk/menu/context-menu-trigger.ts index bc6cac4f2798..0b719aa33c61 100644 --- a/src/cdk/menu/context-menu-trigger.ts +++ b/src/cdk/menu/context-menu-trigger.ts @@ -38,12 +38,6 @@ const CONTEXT_MENU_POSITIONS = STANDARD_DROPDOWN_BELOW_POSITIONS.map(position => return {...position, offsetX, offsetY}; }); -/** - * @deprecated Will be removed. Use `MenuTracker` instead. - * @breaking-change 22.0.0 - */ -export {MenuTracker as ContextMenuTracker}; - /** The coordinates where the context menu should open. */ export type ContextMenuCoordinates = {x: number; y: number}; diff --git a/src/material/list/list-option.ts b/src/material/list/list-option.ts index c8aa35ad7cde..91af343da26f 100644 --- a/src/material/list/list-option.ts +++ b/src/material/list/list-option.ts @@ -118,19 +118,6 @@ export class MatListOption extends MatListItemBase implements ListOption, OnInit /** Whether the label should appear before or after the checkbox/radio. Defaults to 'after' */ @Input() togglePosition: MatListOptionTogglePosition = 'after'; - /** - * Whether the label should appear before or after the checkbox/radio. Defaults to 'after' - * - * @deprecated Use `togglePosition` instead. - * @breaking-change 17.0.0 - */ - @Input() get checkboxPosition(): MatListOptionTogglePosition { - return this.togglePosition; - } - set checkboxPosition(value: MatListOptionTogglePosition) { - this.togglePosition = value; - } - /** * Theme color of the list option. This sets the color of the checkbox/radio. * This API is supported in M2 themes only, it has no effect in M3 themes. For color customization diff --git a/src/material/list/public-api.ts b/src/material/list/public-api.ts index bdab0ec6ac80..b7ae4be9751b 100644 --- a/src/material/list/public-api.ts +++ b/src/material/list/public-api.ts @@ -17,12 +17,4 @@ export * from './list-item-sections'; export * from './tokens'; export {MatListOption} from './list-option'; - -export { - MatListOptionTogglePosition, - /** - * @deprecated Use `MatListOptionTogglePosition` instead. - * @breaking-change 17.0.0 - */ - MatListOptionTogglePosition as MatListOptionCheckboxPosition, -} from './list-option-types'; +export {MatListOptionTogglePosition} from './list-option-types'; diff --git a/src/material/sort/sort-header.ts b/src/material/sort/sort-header.ts index 344369355fec..97488960b6e5 100644 --- a/src/material/sort/sort-header.ts +++ b/src/material/sort/sort-header.ts @@ -36,30 +36,6 @@ import {SortDirection} from './sort-direction'; import {getSortHeaderNotContainedWithinSortError} from './sort-errors'; import {_animationsDisabled, _StructuralStylesLoader} from '../core'; -/** - * Valid positions for the arrow to be in for its opacity and translation. If the state is a - * sort direction, the position of the arrow will be above/below and opacity 0. If the state is - * hint, the arrow will be in the center with a slight opacity. Active state means the arrow will - * be fully opaque in the center. - * - * @docs-private - * @deprecated No longer being used, to be removed. - * @breaking-change 21.0.0 - */ -export type ArrowViewState = SortDirection | 'hint' | 'active'; - -/** - * States describing the arrow's animated position (animating fromState to toState). - * If the fromState is not defined, there will be no animated transition to the toState. - * @docs-private - * @deprecated No longer being used, to be removed. - * @breaking-change 21.0.0 - */ -export interface ArrowViewStateTransition { - fromState?: ArrowViewState; - toState?: ArrowViewState; -} - /** * Applies sorting behavior (click to change sort) and styles to an element, including an * arrow to display the current sort direction.