@angular/cdk-experimental 14.0.0-next.0 → 14.0.0-next.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/combobox/combobox-module.d.ts +3 -4
- package/combobox/combobox-popup.d.ts +6 -8
- package/combobox/combobox.d.ts +15 -18
- package/combobox/public-api.d.ts +0 -1
- package/dialog/dialog-config.d.ts +74 -40
- package/dialog/dialog-container.d.ts +47 -51
- package/dialog/dialog-injectors.d.ts +6 -12
- package/dialog/dialog-ref.d.ts +45 -38
- package/dialog/dialog.d.ts +59 -56
- package/esm2020/column-resize/column-resize-directives/column-resize-flex.mjs +4 -4
- package/esm2020/column-resize/column-resize-directives/column-resize.mjs +4 -4
- package/esm2020/column-resize/column-resize-directives/default-enabled-column-resize-flex.mjs +4 -4
- package/esm2020/column-resize/column-resize-directives/default-enabled-column-resize.mjs +4 -4
- package/esm2020/column-resize/column-resize-module.mjs +9 -9
- package/esm2020/column-resize/column-resize-notifier.mjs +7 -7
- package/esm2020/column-resize/column-resize.mjs +6 -6
- package/esm2020/column-resize/column-size-store.mjs +4 -4
- package/esm2020/column-resize/event-dispatcher.mjs +4 -4
- package/esm2020/column-resize/overlay-handle.mjs +4 -4
- package/esm2020/column-resize/resizable.mjs +4 -4
- package/esm2020/column-resize/resize-strategy.mjs +10 -10
- package/esm2020/combobox/combobox-module.mjs +6 -7
- package/esm2020/combobox/combobox-popup.mjs +12 -23
- package/esm2020/combobox/combobox.mjs +50 -34
- package/esm2020/combobox/public-api.mjs +1 -2
- package/esm2020/dialog/dialog-config.mjs +33 -22
- package/esm2020/dialog/dialog-container.mjs +114 -142
- package/esm2020/dialog/dialog-injectors.mjs +6 -10
- package/esm2020/dialog/dialog-module.mjs +7 -21
- package/esm2020/dialog/dialog-ref.mjs +49 -88
- package/esm2020/dialog/dialog.mjs +188 -155
- package/esm2020/listbox/listbox-module.mjs +5 -5
- package/esm2020/listbox/listbox.mjs +26 -44
- package/esm2020/menu/context-menu-trigger.mjs +227 -0
- package/esm2020/menu/menu-aim.mjs +24 -19
- package/esm2020/menu/menu-bar.mjs +72 -165
- package/esm2020/menu/menu-base.mjs +203 -0
- package/esm2020/menu/menu-errors.mjs +1 -9
- package/esm2020/menu/menu-group.mjs +7 -45
- package/esm2020/menu/menu-interface.mjs +1 -1
- package/esm2020/menu/menu-item-checkbox.mjs +11 -11
- package/esm2020/menu/menu-item-radio.mjs +50 -26
- package/esm2020/menu/menu-item-selectable.mjs +18 -33
- package/esm2020/menu/menu-item.mjs +133 -88
- package/esm2020/menu/menu-module.mjs +12 -14
- package/esm2020/menu/menu-stack.mjs +69 -19
- package/esm2020/menu/menu-trigger-base.mjs +114 -0
- package/esm2020/menu/menu-trigger.mjs +302 -0
- package/esm2020/menu/menu.mjs +75 -208
- package/esm2020/menu/pointer-focus-tracker.mjs +11 -9
- package/esm2020/menu/public-api.mjs +10 -7
- package/esm2020/popover-edit/edit-event-dispatcher.mjs +4 -4
- package/esm2020/popover-edit/edit-ref.mjs +4 -4
- package/esm2020/popover-edit/edit-services.mjs +4 -4
- package/esm2020/popover-edit/focus-dispatcher.mjs +4 -4
- package/esm2020/popover-edit/focus-escape-notifier.mjs +4 -4
- package/esm2020/popover-edit/lens-directives.mjs +10 -10
- package/esm2020/popover-edit/polyfill.mjs +3 -21
- package/esm2020/popover-edit/popover-edit-module.mjs +5 -5
- package/esm2020/popover-edit/popover-edit-position-strategy-factory.mjs +7 -7
- package/esm2020/popover-edit/public-api.mjs +2 -2
- package/esm2020/popover-edit/table-directives.mjs +16 -16
- package/esm2020/scrolling/auto-size-virtual-scroll.mjs +4 -4
- package/esm2020/scrolling/scrolling-module.mjs +5 -5
- package/esm2020/selection/row-selection.mjs +4 -4
- package/esm2020/selection/select-all.mjs +4 -4
- package/esm2020/selection/selection-column.mjs +4 -4
- package/esm2020/selection/selection-module.mjs +5 -5
- package/esm2020/selection/selection-toggle.mjs +4 -4
- package/esm2020/selection/selection.mjs +4 -4
- package/esm2020/table-scroll-container/table-scroll-container-module.mjs +5 -5
- package/esm2020/table-scroll-container/table-scroll-container.mjs +4 -4
- package/esm2020/version.mjs +1 -1
- package/fesm2015/cdk-experimental.mjs +1 -1
- package/fesm2015/cdk-experimental.mjs.map +1 -1
- package/fesm2015/column-resize.mjs +52 -52
- package/fesm2015/column-resize.mjs.map +1 -1
- package/fesm2015/combobox.mjs +63 -106
- package/fesm2015/combobox.mjs.map +1 -1
- package/fesm2015/dialog.mjs +385 -434
- package/fesm2015/dialog.mjs.map +1 -1
- package/fesm2015/listbox.mjs +31 -47
- package/fesm2015/listbox.mjs.map +1 -1
- package/fesm2015/menu.mjs +1118 -1142
- package/fesm2015/menu.mjs.map +1 -1
- package/fesm2015/popover-edit.mjs +53 -70
- package/fesm2015/popover-edit.mjs.map +1 -1
- package/fesm2015/scrolling.mjs +7 -7
- package/fesm2015/scrolling.mjs.map +1 -1
- package/fesm2015/selection.mjs +19 -19
- package/fesm2015/selection.mjs.map +1 -1
- package/fesm2015/table-scroll-container.mjs +7 -7
- package/fesm2015/table-scroll-container.mjs.map +1 -1
- package/fesm2020/cdk-experimental.mjs +1 -1
- package/fesm2020/cdk-experimental.mjs.map +1 -1
- package/fesm2020/column-resize.mjs +52 -52
- package/fesm2020/column-resize.mjs.map +1 -1
- package/fesm2020/combobox.mjs +62 -103
- package/fesm2020/combobox.mjs.map +1 -1
- package/fesm2020/dialog.mjs +386 -426
- package/fesm2020/dialog.mjs.map +1 -1
- package/fesm2020/listbox.mjs +29 -46
- package/fesm2020/listbox.mjs.map +1 -1
- package/fesm2020/menu.mjs +1045 -1061
- package/fesm2020/menu.mjs.map +1 -1
- package/fesm2020/popover-edit.mjs +52 -70
- package/fesm2020/popover-edit.mjs.map +1 -1
- package/fesm2020/scrolling.mjs +7 -7
- package/fesm2020/scrolling.mjs.map +1 -1
- package/fesm2020/selection.mjs +19 -19
- package/fesm2020/selection.mjs.map +1 -1
- package/fesm2020/table-scroll-container.mjs +7 -7
- package/fesm2020/table-scroll-container.mjs.map +1 -1
- package/listbox/listbox.d.ts +16 -13
- package/menu/context-menu-trigger.d.ts +98 -0
- package/menu/menu-aim.d.ts +20 -9
- package/menu/menu-bar.d.ts +24 -60
- package/menu/menu-base.d.ts +104 -0
- package/menu/menu-errors.d.ts +0 -5
- package/menu/menu-group.d.ts +3 -28
- package/menu/menu-interface.d.ts +7 -5
- package/menu/menu-item-checkbox.d.ts +8 -2
- package/menu/menu-item-radio.d.ts +32 -8
- package/menu/menu-item-selectable.d.ts +4 -14
- package/menu/menu-item.d.ts +64 -24
- package/menu/menu-module.d.ts +10 -10
- package/menu/menu-stack.d.ts +64 -20
- package/menu/menu-trigger-base.d.ts +77 -0
- package/menu/menu-trigger.d.ts +104 -0
- package/menu/menu.d.ts +34 -87
- package/menu/pointer-focus-tracker.d.ts +7 -4
- package/menu/public-api.d.ts +9 -6
- package/package.json +3 -3
- package/popover-edit/polyfill.d.ts +1 -3
- package/popover-edit/public-api.d.ts +1 -1
- package/combobox/combobox-panel.d.ts +0 -27
- package/esm2020/combobox/combobox-panel.mjs +0 -48
- package/esm2020/menu/context-menu.mjs +0 -287
- package/esm2020/menu/menu-item-trigger.mjs +0 -361
- package/esm2020/menu/menu-panel.mjs +0 -37
- package/menu/context-menu.d.ts +0 -122
- package/menu/menu-item-trigger.d.ts +0 -119
- package/menu/menu-panel.d.ts +0 -30
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import * as i1 from "./combobox";
|
|
3
|
-
import * as i2 from "./combobox-
|
|
4
|
-
import * as i3 from "
|
|
5
|
-
import * as i4 from "@angular/cdk/overlay";
|
|
3
|
+
import * as i2 from "./combobox-popup";
|
|
4
|
+
import * as i3 from "@angular/cdk/overlay";
|
|
6
5
|
export declare class CdkComboboxModule {
|
|
7
6
|
static ɵfac: i0.ɵɵFactoryDeclaration<CdkComboboxModule, never>;
|
|
8
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<CdkComboboxModule, [typeof i1.CdkCombobox, typeof i2.
|
|
7
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<CdkComboboxModule, [typeof i1.CdkCombobox, typeof i2.CdkComboboxPopup], [typeof i3.OverlayModule], [typeof i1.CdkCombobox, typeof i2.CdkComboboxPopup]>;
|
|
9
8
|
static ɵinj: i0.ɵɵInjectorDeclaration<CdkComboboxModule>;
|
|
10
9
|
}
|
|
@@ -5,13 +5,12 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
import { ElementRef,
|
|
9
|
-
import { AriaHasPopupValue,
|
|
8
|
+
import { ElementRef, OnInit } from '@angular/core';
|
|
9
|
+
import { AriaHasPopupValue, CdkCombobox } from './combobox';
|
|
10
10
|
import * as i0 from "@angular/core";
|
|
11
|
-
export declare const PANEL: InjectionToken<CdkComboboxPanel<unknown>>;
|
|
12
11
|
export declare class CdkComboboxPopup<T = unknown> implements OnInit {
|
|
13
12
|
private readonly _elementRef;
|
|
14
|
-
readonly
|
|
13
|
+
private readonly _combobox;
|
|
15
14
|
get role(): AriaHasPopupValue;
|
|
16
15
|
set role(value: AriaHasPopupValue);
|
|
17
16
|
private _role;
|
|
@@ -19,11 +18,10 @@ export declare class CdkComboboxPopup<T = unknown> implements OnInit {
|
|
|
19
18
|
set firstFocus(id: HTMLElement);
|
|
20
19
|
private _firstFocusElement;
|
|
21
20
|
id: string;
|
|
22
|
-
|
|
23
|
-
constructor(_elementRef: ElementRef<HTMLElement>, _parentPanel?: CdkComboboxPanel<T> | undefined);
|
|
21
|
+
constructor(_elementRef: ElementRef<HTMLElement>, _combobox: CdkCombobox);
|
|
24
22
|
ngOnInit(): void;
|
|
25
23
|
registerWithPanel(): void;
|
|
26
24
|
focusFirstElement(): void;
|
|
27
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CdkComboboxPopup<any>,
|
|
28
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<CdkComboboxPopup<any>, "[cdkComboboxPopup]", ["cdkComboboxPopup"], { "role": "role"; "firstFocus": "firstFocus"; "id": "id";
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CdkComboboxPopup<any>, never>;
|
|
26
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CdkComboboxPopup<any>, "[cdkComboboxPopup]", ["cdkComboboxPopup"], { "role": "role"; "firstFocus": "firstFocus"; "id": "id"; }, {}, never>;
|
|
29
27
|
}
|
package/combobox/combobox.d.ts
CHANGED
|
@@ -1,26 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CdkComboboxPanel, AriaHasPopupValue } from './combobox-panel';
|
|
1
|
+
import { ElementRef, EventEmitter, InjectionToken, Injector, OnDestroy, TemplateRef, ViewContainerRef } from '@angular/core';
|
|
3
2
|
import { Overlay } from '@angular/cdk/overlay';
|
|
4
3
|
import { Directionality } from '@angular/cdk/bidi';
|
|
5
4
|
import { BooleanInput } from '@angular/cdk/coercion';
|
|
6
5
|
import * as i0 from "@angular/core";
|
|
7
|
-
|
|
8
|
-
* @license
|
|
9
|
-
* Copyright Google LLC All Rights Reserved.
|
|
10
|
-
*
|
|
11
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
12
|
-
* found in the LICENSE file at https://angular.io/license
|
|
13
|
-
*/
|
|
6
|
+
export declare type AriaHasPopupValue = 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
|
|
14
7
|
export declare type OpenAction = 'focus' | 'click' | 'downKey' | 'toggle';
|
|
15
8
|
export declare type OpenActionInput = OpenAction | OpenAction[] | string | null | undefined;
|
|
16
|
-
export declare
|
|
9
|
+
export declare const CDK_COMBOBOX: InjectionToken<CdkCombobox<unknown>>;
|
|
10
|
+
export declare class CdkCombobox<T = unknown> implements OnDestroy {
|
|
17
11
|
private readonly _elementRef;
|
|
18
12
|
private readonly _overlay;
|
|
19
13
|
protected readonly _viewContainerRef: ViewContainerRef;
|
|
14
|
+
private readonly _injector;
|
|
15
|
+
private readonly _doc;
|
|
20
16
|
private readonly _directionality?;
|
|
21
|
-
|
|
22
|
-
set panel(panel: CdkComboboxPanel<T> | undefined);
|
|
23
|
-
private _panel;
|
|
17
|
+
_panelTemplateRef: TemplateRef<unknown>;
|
|
24
18
|
value: T | T[];
|
|
25
19
|
get disabled(): boolean;
|
|
26
20
|
set disabled(value: BooleanInput);
|
|
@@ -36,11 +30,10 @@ export declare class CdkCombobox<T = unknown> implements OnDestroy, AfterContent
|
|
|
36
30
|
readonly closed: EventEmitter<void>;
|
|
37
31
|
readonly panelValueChanged: EventEmitter<T[]>;
|
|
38
32
|
private _overlayRef;
|
|
39
|
-
private
|
|
33
|
+
private _panelPortal;
|
|
40
34
|
contentId: string;
|
|
41
35
|
contentType: AriaHasPopupValue;
|
|
42
|
-
constructor(_elementRef: ElementRef<HTMLElement>, _overlay: Overlay, _viewContainerRef: ViewContainerRef, _directionality?: Directionality | undefined);
|
|
43
|
-
ngAfterContentInit(): void;
|
|
36
|
+
constructor(_elementRef: ElementRef<HTMLElement>, _overlay: Overlay, _viewContainerRef: ViewContainerRef, _injector: Injector, _doc: any, _directionality?: Directionality | undefined);
|
|
44
37
|
ngOnDestroy(): void;
|
|
45
38
|
_keydown(event: KeyboardEvent): void;
|
|
46
39
|
/** Handles click or focus interactions. */
|
|
@@ -59,13 +52,17 @@ export declare class CdkCombobox<T = unknown> implements OnDestroy, AfterContent
|
|
|
59
52
|
hasPanel(): boolean;
|
|
60
53
|
_getTabIndex(): string | null;
|
|
61
54
|
private _setComboboxValue;
|
|
55
|
+
updateAndClose(value: T | T[]): void;
|
|
62
56
|
private _setTextContent;
|
|
63
57
|
private _isTextTrigger;
|
|
64
58
|
private _getOverlayConfig;
|
|
65
59
|
private _getOverlayPositionStrategy;
|
|
66
60
|
private _getOverlayPositions;
|
|
61
|
+
private _getPanelInjector;
|
|
67
62
|
private _getPanelContent;
|
|
68
63
|
private _coerceOpenActionProperty;
|
|
69
|
-
|
|
70
|
-
|
|
64
|
+
/** Registers the content's id and the content type with the panel. */
|
|
65
|
+
_registerContent(contentId: string, contentType: AriaHasPopupValue): void;
|
|
66
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CdkCombobox<any>, [null, null, null, null, null, { optional: true; }]>;
|
|
67
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CdkCombobox<any>, "[cdkCombobox]", ["cdkCombobox"], { "_panelTemplateRef": "cdkComboboxTriggerFor"; "value": "value"; "disabled": "disabled"; "openActions": "openActions"; "autoSetText": "autoSetText"; }, { "opened": "comboboxPanelOpened"; "closed": "comboboxPanelClosed"; "panelValueChanged": "panelValueChanged"; }, never>;
|
|
71
68
|
}
|
package/combobox/public-api.d.ts
CHANGED
|
@@ -5,24 +5,16 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
import { ViewContainerRef } from '@angular/core';
|
|
8
|
+
import { ViewContainerRef, ComponentFactoryResolver, Injector, StaticProvider, Type } from '@angular/core';
|
|
9
9
|
import { Direction } from '@angular/cdk/bidi';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { PositionStrategy, ScrollStrategy } from '@angular/cdk/overlay';
|
|
11
|
+
import { BasePortalOutlet } from '@angular/cdk/portal';
|
|
12
12
|
/** Options for where to set focus to automatically on dialog open */
|
|
13
13
|
export declare type AutoFocusTarget = 'dialog' | 'first-tabbable' | 'first-heading';
|
|
14
|
-
/** Valid ARIA roles for a dialog
|
|
14
|
+
/** Valid ARIA roles for a dialog. */
|
|
15
15
|
export declare type DialogRole = 'dialog' | 'alertdialog';
|
|
16
|
-
/**
|
|
17
|
-
export
|
|
18
|
-
top?: string;
|
|
19
|
-
bottom?: string;
|
|
20
|
-
left?: string;
|
|
21
|
-
right?: string;
|
|
22
|
-
}
|
|
23
|
-
export declare class DialogConfig<D = any> {
|
|
24
|
-
/** Component to use as the container for the dialog. */
|
|
25
|
-
containerComponent?: ComponentType<CdkDialogContainer>;
|
|
16
|
+
/** Configuration for opening a modal dialog. */
|
|
17
|
+
export declare class DialogConfig<D = unknown, R = unknown, C extends BasePortalOutlet = BasePortalOutlet> {
|
|
26
18
|
/**
|
|
27
19
|
* Where the attached component should live in Angular's *logical* component tree.
|
|
28
20
|
* This affects what is available for injection and the change detection order for the
|
|
@@ -30,48 +22,90 @@ export declare class DialogConfig<D = any> {
|
|
|
30
22
|
* content will be rendered.
|
|
31
23
|
*/
|
|
32
24
|
viewContainerRef?: ViewContainerRef;
|
|
33
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Injector used for the instantiation of the component to be attached. If provided,
|
|
27
|
+
* takes precedence over the injector indirectly provided by `ViewContainerRef`.
|
|
28
|
+
*/
|
|
29
|
+
injector?: Injector;
|
|
30
|
+
/** ID for the dialog. If omitted, a unique one will be generated. */
|
|
34
31
|
id?: string;
|
|
35
|
-
/** The ARIA role of the dialog. */
|
|
32
|
+
/** The ARIA role of the dialog element. */
|
|
36
33
|
role?: DialogRole;
|
|
37
|
-
/**
|
|
34
|
+
/** Optional CSS class or classes applied to the overlay panel. */
|
|
38
35
|
panelClass?: string | string[];
|
|
39
|
-
/** Whether the dialog has a
|
|
36
|
+
/** Whether the dialog has a backdrop. */
|
|
40
37
|
hasBackdrop?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
backdropClass?: string |
|
|
43
|
-
/** Whether the dialog
|
|
38
|
+
/** Optional CSS class or classes applied to the overlay backdrop. */
|
|
39
|
+
backdropClass?: string | string[];
|
|
40
|
+
/** Whether the dialog closes with the escape key or pointer events outside the panel element. */
|
|
44
41
|
disableClose?: boolean;
|
|
45
|
-
/**
|
|
42
|
+
/** Width of the dialog. */
|
|
46
43
|
width?: string;
|
|
47
|
-
/**
|
|
44
|
+
/** Height of the dialog. */
|
|
48
45
|
height?: string;
|
|
49
|
-
/**
|
|
50
|
-
minWidth?:
|
|
51
|
-
/**
|
|
52
|
-
minHeight?:
|
|
53
|
-
/**
|
|
54
|
-
maxWidth?:
|
|
55
|
-
/**
|
|
56
|
-
maxHeight?:
|
|
57
|
-
/**
|
|
58
|
-
|
|
59
|
-
/** Data
|
|
46
|
+
/** Min-width of the dialog. If a number is provided, assumes pixel units. */
|
|
47
|
+
minWidth?: number | string;
|
|
48
|
+
/** Min-height of the dialog. If a number is provided, assumes pixel units. */
|
|
49
|
+
minHeight?: number | string;
|
|
50
|
+
/** Max-width of the dialog. If a number is provided, assumes pixel units. Defaults to 80vw. */
|
|
51
|
+
maxWidth?: number | string;
|
|
52
|
+
/** Max-height of the dialog. If a number is provided, assumes pixel units. */
|
|
53
|
+
maxHeight?: number | string;
|
|
54
|
+
/** Strategy to use when positioning the dialog. Defaults to centering it on the page. */
|
|
55
|
+
positionStrategy?: PositionStrategy;
|
|
56
|
+
/** Data being injected into the child component. */
|
|
60
57
|
data?: D | null;
|
|
61
|
-
/**
|
|
58
|
+
/** Layout direction for the dialog's content. */
|
|
62
59
|
direction?: Direction;
|
|
63
60
|
/** ID of the element that describes the dialog. */
|
|
64
61
|
ariaDescribedBy?: string | null;
|
|
65
|
-
/**
|
|
62
|
+
/** ID of the element that labels the dialog. */
|
|
63
|
+
ariaLabelledBy?: string | null;
|
|
64
|
+
/** Dialog label applied via `aria-label` */
|
|
66
65
|
ariaLabel?: string | null;
|
|
66
|
+
/** Whether this a modal dialog. Used to set the `aria-modal` attribute. */
|
|
67
|
+
ariaModal?: boolean;
|
|
67
68
|
/**
|
|
68
69
|
* Where the dialog should focus on open.
|
|
69
70
|
* @breaking-change 14.0.0 Remove boolean option from autoFocus. Use string or
|
|
70
71
|
* AutoFocusTarget instead.
|
|
71
72
|
*/
|
|
72
73
|
autoFocus?: AutoFocusTarget | string | boolean;
|
|
73
|
-
/**
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
/**
|
|
75
|
+
* Whether the dialog should restore focus to the
|
|
76
|
+
* previously-focused element upon closing.
|
|
77
|
+
*/
|
|
78
|
+
restoreFocus?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Scroll strategy to be used for the dialog. This determines how
|
|
81
|
+
* the dialog responds to scrolling underneath the panel element.
|
|
82
|
+
*/
|
|
83
|
+
scrollStrategy?: ScrollStrategy;
|
|
84
|
+
/**
|
|
85
|
+
* Whether the dialog should close when the user navigates backwards or forwards through browser
|
|
86
|
+
* history. This does not apply to navigation via anchor element unless using URL-hash based
|
|
87
|
+
* routing (`HashLocationStrategy` in the Angular router).
|
|
88
|
+
*/
|
|
89
|
+
closeOnNavigation?: boolean;
|
|
90
|
+
/** Alternate `ComponentFactoryResolver` to use when resolving the associated component. */
|
|
91
|
+
componentFactoryResolver?: ComponentFactoryResolver;
|
|
92
|
+
/**
|
|
93
|
+
* Providers that will be exposed to the contents of the dialog. Can also
|
|
94
|
+
* be provided as a function in order to generate the providers lazily.
|
|
95
|
+
*/
|
|
96
|
+
providers?: StaticProvider[] | ((dialogRef: R, config: DialogConfig<D, R, C>, container: C) => StaticProvider[]);
|
|
97
|
+
/**
|
|
98
|
+
* Component into which the dialog content will be rendered. Defaults to `CdkDialogContainer`.
|
|
99
|
+
* A configuration object can be passed in to customize the providers that will be exposed
|
|
100
|
+
* to the dialog container.
|
|
101
|
+
*/
|
|
102
|
+
container?: Type<C> | {
|
|
103
|
+
type: Type<C>;
|
|
104
|
+
providers: (config: DialogConfig<D, R, C>) => StaticProvider[];
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Context that will be passed to template-based dialogs.
|
|
108
|
+
* A function can be passed in to resolve the context lazily.
|
|
109
|
+
*/
|
|
110
|
+
templateContext?: Record<string, any> | (() => Record<string, any>);
|
|
77
111
|
}
|
|
@@ -5,11 +5,10 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { FocusMonitor, FocusOrigin, FocusTrapFactory, InteractivityChecker } from '@angular/cdk/a11y';
|
|
9
|
+
import { OverlayRef } from '@angular/cdk/overlay';
|
|
10
10
|
import { BasePortalOutlet, CdkPortalOutlet, ComponentPortal, DomPortal, TemplatePortal } from '@angular/cdk/portal';
|
|
11
|
-
import {
|
|
12
|
-
import { Subject } from 'rxjs';
|
|
11
|
+
import { AfterViewInit, ComponentRef, ElementRef, EmbeddedViewRef, NgZone, OnDestroy } from '@angular/core';
|
|
13
12
|
import { DialogConfig } from './dialog-config';
|
|
14
13
|
import * as i0 from "@angular/core";
|
|
15
14
|
export declare function throwDialogContentAlreadyAttachedError(): void;
|
|
@@ -17,39 +16,36 @@ export declare function throwDialogContentAlreadyAttachedError(): void;
|
|
|
17
16
|
* Internal component that wraps user-provided dialog content.
|
|
18
17
|
* @docs-private
|
|
19
18
|
*/
|
|
20
|
-
export declare class CdkDialogContainer extends BasePortalOutlet implements OnDestroy {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
private
|
|
25
|
-
private
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
/** Element that was focused before the dialog was opened. Save this to restore upon close. */
|
|
32
|
-
private _elementFocusedBeforeDialogWasOpened;
|
|
19
|
+
export declare class CdkDialogContainer<C extends DialogConfig = DialogConfig> extends BasePortalOutlet implements AfterViewInit, OnDestroy {
|
|
20
|
+
protected _elementRef: ElementRef;
|
|
21
|
+
protected _focusTrapFactory: FocusTrapFactory;
|
|
22
|
+
readonly _config: C;
|
|
23
|
+
private _interactivityChecker;
|
|
24
|
+
private _ngZone;
|
|
25
|
+
private _overlayRef;
|
|
26
|
+
private _focusMonitor?;
|
|
27
|
+
protected _document: Document;
|
|
28
|
+
/** The portal outlet inside of this container into which the dialog content will be loaded. */
|
|
29
|
+
_portalOutlet: CdkPortalOutlet;
|
|
33
30
|
/** The class that traps and manages focus within the dialog. */
|
|
34
31
|
private _focusTrap;
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
/** Destroy focus trap to place focus back to the element focused before the dialog opened. */
|
|
32
|
+
/** Element that was focused before the dialog was opened. Save this to restore upon close. */
|
|
33
|
+
private _elementFocusedBeforeDialogWasOpened;
|
|
34
|
+
/**
|
|
35
|
+
* Type of interaction that led to the dialog being closed. This is used to determine
|
|
36
|
+
* whether the focus style will be applied when returning focus to its original location
|
|
37
|
+
* after the dialog is closed.
|
|
38
|
+
*/
|
|
39
|
+
_closeInteractionType: FocusOrigin | null;
|
|
40
|
+
/** ID of the element that should be considered as the dialog's label. */
|
|
41
|
+
_ariaLabelledBy: string | null;
|
|
42
|
+
constructor(_elementRef: ElementRef, _focusTrapFactory: FocusTrapFactory, _document: any, _config: C, _interactivityChecker: InteractivityChecker, _ngZone: NgZone, _overlayRef: OverlayRef, _focusMonitor?: FocusMonitor | undefined);
|
|
43
|
+
ngAfterViewInit(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Can be used by child classes to customize the initial focus
|
|
46
|
+
* capturing behavior (e.g. if it's tied to an animation).
|
|
47
|
+
*/
|
|
48
|
+
protected _captureInitialFocus(): void;
|
|
53
49
|
ngOnDestroy(): void;
|
|
54
50
|
/**
|
|
55
51
|
* Attach a ComponentPortal as content to this dialog container.
|
|
@@ -60,7 +56,7 @@ export declare class CdkDialogContainer extends BasePortalOutlet implements OnDe
|
|
|
60
56
|
* Attach a TemplatePortal as content to this dialog container.
|
|
61
57
|
* @param portal Portal to be attached as the dialog content.
|
|
62
58
|
*/
|
|
63
|
-
attachTemplatePortal<
|
|
59
|
+
attachTemplatePortal<T>(portal: TemplatePortal<T>): EmbeddedViewRef<T>;
|
|
64
60
|
/**
|
|
65
61
|
* Attaches a DOM portal to the dialog container.
|
|
66
62
|
* @param portal Portal to be attached.
|
|
@@ -68,14 +64,6 @@ export declare class CdkDialogContainer extends BasePortalOutlet implements OnDe
|
|
|
68
64
|
* @breaking-change 10.0.0
|
|
69
65
|
*/
|
|
70
66
|
attachDomPortal: (portal: DomPortal) => void;
|
|
71
|
-
/** Emit lifecycle events based on animation `start` callback. */
|
|
72
|
-
_onAnimationStart(event: AnimationEvent): void;
|
|
73
|
-
/** Starts the dialog exit animation. */
|
|
74
|
-
_startExiting(): void;
|
|
75
|
-
/** Saves a reference to the element that was focused before the dialog was opened. */
|
|
76
|
-
private _savePreviouslyFocusedElement;
|
|
77
|
-
/** Focuses the dialog container. */
|
|
78
|
-
private _focusDialogContainer;
|
|
79
67
|
/**
|
|
80
68
|
* Focuses the provided element. If the element is not focusable, it will add a tabIndex
|
|
81
69
|
* attribute to forcefully focus it. The attribute is removed after focus is moved.
|
|
@@ -88,12 +76,20 @@ export declare class CdkDialogContainer extends BasePortalOutlet implements OnDe
|
|
|
88
76
|
*/
|
|
89
77
|
private _focusByCssSelector;
|
|
90
78
|
/**
|
|
91
|
-
*
|
|
92
|
-
*
|
|
79
|
+
* Moves the focus inside the focus trap. When autoFocus is not set to 'dialog', if focus
|
|
80
|
+
* cannot be moved then focus will go to the dialog container.
|
|
93
81
|
*/
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
private
|
|
97
|
-
|
|
98
|
-
|
|
82
|
+
protected _trapFocus(): void;
|
|
83
|
+
/** Restores focus to the element that was focused before the dialog opened. */
|
|
84
|
+
private _restoreFocus;
|
|
85
|
+
/** Focuses the dialog container. */
|
|
86
|
+
private _focusDialogContainer;
|
|
87
|
+
/** Returns whether focus is inside the dialog. */
|
|
88
|
+
private _containsFocus;
|
|
89
|
+
/** Sets up the focus trap. */
|
|
90
|
+
private _initializeFocusTrap;
|
|
91
|
+
/** Sets up the listener that handles clicks on the dialog backdrop. */
|
|
92
|
+
private _handleBackdropClicks;
|
|
93
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CdkDialogContainer<any>, [null, null, { optional: true; }, null, null, null, null, null]>;
|
|
94
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CdkDialogContainer<any>, "cdk-dialog-container", never, {}, {}, never, never>;
|
|
99
95
|
}
|
|
@@ -6,25 +6,19 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
8
|
import { InjectionToken } from '@angular/core';
|
|
9
|
-
import {
|
|
10
|
-
import { DialogRef } from './dialog-ref';
|
|
11
|
-
import { CdkDialogContainer } from './dialog-container';
|
|
9
|
+
import { Overlay, ScrollStrategy } from '@angular/cdk/overlay';
|
|
12
10
|
import { DialogConfig } from './dialog-config';
|
|
13
11
|
/** Injection token for the Dialog's ScrollStrategy. */
|
|
14
12
|
export declare const DIALOG_SCROLL_STRATEGY: InjectionToken<() => ScrollStrategy>;
|
|
15
13
|
/** Injection token for the Dialog's Data. */
|
|
16
14
|
export declare const DIALOG_DATA: InjectionToken<any>;
|
|
17
|
-
/** Injection token for the
|
|
18
|
-
export declare const
|
|
19
|
-
/** Injection token for the DialogConfig. */
|
|
20
|
-
export declare const DIALOG_CONFIG: InjectionToken<DialogConfig<any>>;
|
|
21
|
-
/** Injection token for the Dialog's DialogContainer component. */
|
|
22
|
-
export declare const DIALOG_CONTAINER: InjectionToken<ComponentType<CdkDialogContainer>>;
|
|
15
|
+
/** Injection token that can be used to provide default options for the dialog module. */
|
|
16
|
+
export declare const DEFAULT_DIALOG_CONFIG: InjectionToken<DialogConfig<unknown, unknown, import("@angular/cdk/portal").BasePortalOutlet>>;
|
|
23
17
|
/** @docs-private */
|
|
24
|
-
export declare function
|
|
18
|
+
export declare function DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay: Overlay): () => ScrollStrategy;
|
|
25
19
|
/** @docs-private */
|
|
26
|
-
export declare const
|
|
20
|
+
export declare const DIALOG_SCROLL_STRATEGY_PROVIDER: {
|
|
27
21
|
provide: InjectionToken<() => ScrollStrategy>;
|
|
28
22
|
deps: (typeof Overlay)[];
|
|
29
|
-
useFactory: typeof
|
|
23
|
+
useFactory: typeof DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY;
|
|
30
24
|
};
|
package/dialog/dialog-ref.d.ts
CHANGED
|
@@ -5,53 +5,60 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
import { OverlayRef
|
|
8
|
+
import { OverlayRef } from '@angular/cdk/overlay';
|
|
9
9
|
import { Observable } from 'rxjs';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { DialogConfig } from './dialog-config';
|
|
11
|
+
import { FocusOrigin } from '@angular/cdk/a11y';
|
|
12
|
+
import { BasePortalOutlet } from '@angular/cdk/portal';
|
|
13
|
+
/** Additional options that can be passed in when closing a dialog. */
|
|
14
|
+
export interface DialogCloseOptions {
|
|
15
|
+
/** Focus original to use when restoring focus. */
|
|
16
|
+
focusOrigin?: FocusOrigin;
|
|
17
|
+
}
|
|
12
18
|
/**
|
|
13
19
|
* Reference to a dialog opened via the Dialog service.
|
|
14
20
|
*/
|
|
15
|
-
export declare class DialogRef<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
export declare class DialogRef<R = unknown, C = unknown> {
|
|
22
|
+
readonly overlayRef: OverlayRef;
|
|
23
|
+
readonly config: DialogConfig<any, DialogRef<R, C>, BasePortalOutlet>;
|
|
24
|
+
/**
|
|
25
|
+
* Instance of component opened into the dialog. Will be
|
|
26
|
+
* null when the dialog is opened using a `TemplateRef`.
|
|
27
|
+
*/
|
|
28
|
+
componentInstance: C | null;
|
|
29
|
+
/** Instance of the container that is rendering out the dialog content. */
|
|
30
|
+
containerInstance: BasePortalOutlet & {
|
|
31
|
+
_closeInteractionType?: FocusOrigin;
|
|
32
|
+
};
|
|
21
33
|
/** Whether the user is allowed to close the dialog. */
|
|
22
34
|
disableClose: boolean | undefined;
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
35
|
+
/** Emits when the dialog has been closed. */
|
|
36
|
+
readonly closed: Observable<R | undefined>;
|
|
37
|
+
/** Emits when the backdrop of the dialog is clicked. */
|
|
38
|
+
readonly backdropClick: Observable<MouseEvent>;
|
|
39
|
+
/** Emits when on keyboard events within the dialog. */
|
|
40
|
+
readonly keydownEvents: Observable<KeyboardEvent>;
|
|
41
|
+
/** Emits on pointer events that happen outside of the dialog. */
|
|
42
|
+
readonly outsidePointerEvents: Observable<MouseEvent>;
|
|
43
|
+
/** Unique ID for the dialog. */
|
|
44
|
+
readonly id: string;
|
|
45
|
+
constructor(overlayRef: OverlayRef, config: DialogConfig<any, DialogRef<R, C>, BasePortalOutlet>);
|
|
28
46
|
/**
|
|
29
47
|
* Close the dialog.
|
|
30
|
-
* @param
|
|
31
|
-
|
|
32
|
-
close(dialogResult?: R): void;
|
|
33
|
-
/**
|
|
34
|
-
* Updates the dialog's position.
|
|
35
|
-
* @param position New dialog position.
|
|
36
|
-
*/
|
|
37
|
-
updatePosition(position?: DialogPosition): this;
|
|
38
|
-
/**
|
|
39
|
-
* Gets an observable that emits when keydown events are targeted on the overlay.
|
|
48
|
+
* @param result Optional result to return to the dialog opener.
|
|
49
|
+
* @param options Additional options to customize the closing behavior.
|
|
40
50
|
*/
|
|
41
|
-
|
|
51
|
+
close(result?: R, options?: DialogCloseOptions): void;
|
|
52
|
+
/** Updates the dialog's position. */
|
|
53
|
+
updatePosition(): this;
|
|
42
54
|
/**
|
|
43
|
-
* Updates the dialog's width and height
|
|
44
|
-
* @param
|
|
55
|
+
* Updates the dialog's width and height.
|
|
56
|
+
* @param width New width of the dialog.
|
|
57
|
+
* @param height New height of the dialog.
|
|
45
58
|
*/
|
|
46
|
-
updateSize(
|
|
47
|
-
/**
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
|
|
51
|
-
/** Gets an observable that emits when dialog is finished opening. */
|
|
52
|
-
afterOpened(): Observable<void>;
|
|
53
|
-
/** Gets an observable that emits when dialog begins closing. */
|
|
54
|
-
beforeClosed(): Observable<R | undefined>;
|
|
55
|
-
/** Gets an observable that emits when dialog is finished closing. */
|
|
56
|
-
afterClosed(): Observable<R | undefined>;
|
|
59
|
+
updateSize(width?: string, height?: string): this;
|
|
60
|
+
/** Add a CSS class or an array of classes to the overlay pane. */
|
|
61
|
+
addPanelClass(classes: string | string[]): this;
|
|
62
|
+
/** Remove a CSS class or an array of classes from the overlay pane. */
|
|
63
|
+
removePanelClass(classes: string | string[]): this;
|
|
57
64
|
}
|