Skip to content
Open
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
19 changes: 4 additions & 15 deletions goldens/cdk/a11y/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand All @@ -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<ConfigurableFocusTrapFactory, never>;
// (undocumented)
Expand Down Expand Up @@ -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)
Expand All @@ -237,7 +228,8 @@ export class FocusTrap {
focusLastTabbableElement(options?: FocusOptions): boolean;
focusLastTabbableElementWhenReady(options?: FocusOptions): Promise<boolean>;
hasAttached(): boolean;
readonly _injector?: Injector | undefined;
// (undocumented)
readonly _injector: Injector;
// (undocumented)
readonly _ngZone: NgZone;
// (undocumented)
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion goldens/cdk/drag-drop/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ export class DropListRef<T = any> {
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;
Expand Down
4 changes: 1 addition & 3 deletions goldens/cdk/menu/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,15 +356,13 @@ export interface MenuStackItem {
}

// @public
class MenuTracker {
export class MenuTracker {
update(trigger: CdkMenuTriggerBase): void;
// (undocumented)
static ɵfac: i0.ɵɵFactoryDeclaration<MenuTracker, never>;
// (undocumented)
static ɵprov: i0.ɵɵInjectableDeclaration<MenuTracker>;
}
export { MenuTracker as ContextMenuTracker }
export { MenuTracker }

// @public
export const PARENT_OR_NEW_INLINE_MENU_STACK_PROVIDER: (orientation: "vertical" | "horizontal") => {
Expand Down
9 changes: 2 additions & 7 deletions goldens/material/list/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -201,15 +198,13 @@ export class MatListOption extends MatListItemBase implements ListOption, OnInit
get value(): any;
set value(newValue: any);
// (undocumented)
static ɵcmp: i0.ɵɵComponentDeclaration<MatListOption, "mat-list-option", ["matListOption"], { "togglePosition": { "alias": "togglePosition"; "required": false; }; "checkboxPosition": { "alias": "checkboxPosition"; "required": false; }; "color": { "alias": "color"; "required": false; }; "value": { "alias": "value"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; }, { "selectedChange": "selectedChange"; }, ["_lines", "_titles"], ["[matListItemAvatar],[matListItemIcon]", "[matListItemTitle]", "[matListItemLine]", "*", "mat-divider"], true, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<MatListOption, "mat-list-option", ["matListOption"], { "togglePosition": { "alias": "togglePosition"; "required": false; }; "color": { "alias": "color"; "required": false; }; "value": { "alias": "value"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; }, { "selectedChange": "selectedChange"; }, ["_lines", "_titles"], ["[matListItemAvatar],[matListItemIcon]", "[matListItemTitle]", "[matListItemLine]", "*", "mat-divider"], true, never>;
// (undocumented)
static ɵfac: i0.ɵɵFactoryDeclaration<MatListOption, never>;
}

// @public
type MatListOptionTogglePosition = 'before' | 'after';
export { MatListOptionTogglePosition as MatListOptionCheckboxPosition }
export { MatListOptionTogglePosition }
export type MatListOptionTogglePosition = 'before' | 'after';

// @public
export class MatListSubheaderCssMatStyler {
Expand Down
11 changes: 0 additions & 11 deletions goldens/material/sort/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<MatSortDefaultOptions>;

Expand Down
14 changes: 11 additions & 3 deletions src/cdk-experimental/popover-edit/focus-escape-notifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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.
Expand All @@ -57,13 +58,20 @@ 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.
* @param element The element around which focus will be monitored.
* @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,
);
}
}
4 changes: 1 addition & 3 deletions src/cdk/a11y/aria-describer/aria-describer.spec.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -395,7 +394,6 @@ function expectMessage(el: Element, message: string) {
<div id="description-with-existing-id">Hello</div>
<div description-without-id>Hey</div>
`,
imports: [A11yModule],
changeDetection: ChangeDetectionStrategy.Eager,
})
class TestApp {
Expand Down
21 changes: 3 additions & 18 deletions src/cdk/a11y/aria-describer/aria-describer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
16 changes: 2 additions & 14 deletions src/cdk/a11y/focus-trap/configurable-focus-trap-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,30 +41,18 @@ 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,
this._ngZone,
this._document,
this._focusTrapManager,
this._inertStrategy,
configObject,
config,
this._injector,
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/cdk/a11y/focus-trap/configurable-focus-trap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 2 additions & 8 deletions src/cdk/a11y/focus-trap/focus-trap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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});
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/cdk/a11y/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 1 addition & 3 deletions src/cdk/drag-drop/drop-list-ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,6 @@ export class DropListRef<T = any> {
* 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,
Expand All @@ -312,7 +310,7 @@ export class DropListRef<T = any> {
isPointerOverContainer: boolean,
distance: Point,
dropPoint: Point,
event: MouseEvent | TouchEvent = {} as any,
event: MouseEvent | TouchEvent,
): void {
this._reset();
this.dropped.next({
Expand Down
6 changes: 0 additions & 6 deletions src/cdk/menu/context-menu-trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
13 changes: 0 additions & 13 deletions src/material/list/list-option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 1 addition & 9 deletions src/material/list/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
24 changes: 0 additions & 24 deletions src/material/sort/sort-header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading