@angular/cdk 19.2.2 → 19.2.3

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.
Files changed (84) hide show
  1. package/a11y/index.d.ts +926 -999
  2. package/accordion/index.d.ts +8 -27
  3. package/bidi/index.d.ts +38 -48
  4. package/clipboard/index.d.ts +61 -75
  5. package/coercion/index.d.ts +22 -32
  6. package/coercion/private/index.d.ts +2 -2
  7. package/collections/index.d.ts +139 -158
  8. package/dialog/index.d.ts +210 -246
  9. package/drag-drop/index.d.ts +1084 -1160
  10. package/fesm2022/a11y.mjs +19 -11
  11. package/fesm2022/a11y.mjs.map +1 -1
  12. package/fesm2022/accordion.mjs +0 -4
  13. package/fesm2022/accordion.mjs.map +1 -1
  14. package/fesm2022/bidi.mjs +5 -5
  15. package/fesm2022/bidi.mjs.map +1 -1
  16. package/fesm2022/cdk.mjs +1 -1
  17. package/fesm2022/cdk.mjs.map +1 -1
  18. package/fesm2022/clipboard.mjs +0 -4
  19. package/fesm2022/clipboard.mjs.map +1 -1
  20. package/fesm2022/coercion/private.mjs +0 -4
  21. package/fesm2022/coercion/private.mjs.map +1 -1
  22. package/fesm2022/coercion.mjs.map +1 -1
  23. package/fesm2022/collections.mjs +1 -5
  24. package/fesm2022/collections.mjs.map +1 -1
  25. package/fesm2022/dialog.mjs +0 -4
  26. package/fesm2022/dialog.mjs.map +1 -1
  27. package/fesm2022/drag-drop.mjs +0 -4
  28. package/fesm2022/drag-drop.mjs.map +1 -1
  29. package/fesm2022/keycodes.mjs +0 -4
  30. package/fesm2022/keycodes.mjs.map +1 -1
  31. package/fesm2022/layout.mjs +0 -4
  32. package/fesm2022/layout.mjs.map +1 -1
  33. package/fesm2022/listbox.mjs +0 -4
  34. package/fesm2022/listbox.mjs.map +1 -1
  35. package/fesm2022/menu.mjs +0 -4
  36. package/fesm2022/menu.mjs.map +1 -1
  37. package/fesm2022/observers/private.mjs +0 -4
  38. package/fesm2022/observers/private.mjs.map +1 -1
  39. package/fesm2022/observers.mjs +0 -4
  40. package/fesm2022/observers.mjs.map +1 -1
  41. package/fesm2022/overlay.mjs +17 -13
  42. package/fesm2022/overlay.mjs.map +1 -1
  43. package/fesm2022/platform.mjs +0 -4
  44. package/fesm2022/platform.mjs.map +1 -1
  45. package/fesm2022/portal.mjs +9 -10
  46. package/fesm2022/portal.mjs.map +1 -1
  47. package/fesm2022/private.mjs +0 -4
  48. package/fesm2022/private.mjs.map +1 -1
  49. package/fesm2022/scrolling.mjs +1 -5
  50. package/fesm2022/scrolling.mjs.map +1 -1
  51. package/fesm2022/stepper.mjs +0 -4
  52. package/fesm2022/stepper.mjs.map +1 -1
  53. package/fesm2022/table.mjs +2 -12
  54. package/fesm2022/table.mjs.map +1 -1
  55. package/fesm2022/testing/selenium-webdriver.mjs.map +1 -1
  56. package/fesm2022/testing/testbed.mjs +1 -41
  57. package/fesm2022/testing/testbed.mjs.map +1 -1
  58. package/fesm2022/testing.mjs.map +1 -1
  59. package/fesm2022/text-field.mjs +0 -4
  60. package/fesm2022/text-field.mjs.map +1 -1
  61. package/fesm2022/tree.mjs +0 -4
  62. package/fesm2022/tree.mjs.map +1 -1
  63. package/index.d.ts +2 -2
  64. package/keycodes/index.d.ts +123 -244
  65. package/layout/index.d.ts +23 -25
  66. package/listbox/index.d.ts +90 -107
  67. package/menu/index.d.ts +593 -687
  68. package/observers/index.d.ts +38 -44
  69. package/observers/private/index.d.ts +3 -3
  70. package/overlay/index.d.ts +921 -986
  71. package/package.json +1 -1
  72. package/platform/index.d.ts +50 -62
  73. package/portal/index.d.ts +172 -195
  74. package/private/index.d.ts +3 -3
  75. package/schematics/ng-add/index.js +1 -1
  76. package/schematics/ng-add/index.mjs +1 -1
  77. package/scrolling/index.d.ts +268 -351
  78. package/stepper/index.d.ts +72 -124
  79. package/table/index.d.ts +336 -449
  80. package/testing/index.d.ts +490 -517
  81. package/testing/selenium-webdriver/index.d.ts +30 -20
  82. package/testing/testbed/index.d.ts +9 -19
  83. package/text-field/index.d.ts +9 -30
  84. package/tree/index.d.ts +204 -271
package/menu/index.d.ts CHANGED
@@ -1,241 +1,420 @@
1
- import { AfterContentInit } from '@angular/core';
2
- import { ConnectedPosition } from '@angular/cdk/overlay';
3
- import { Directionality } from '@angular/cdk/bidi';
4
- import { ElementRef } from '@angular/core';
5
- import { EventEmitter } from '@angular/core';
6
- import { FocusableOption } from '@angular/cdk/a11y';
7
- import { FocusKeyManager } from '@angular/cdk/a11y';
8
- import { FocusOrigin } from '@angular/cdk/a11y';
9
1
  import * as i0 from '@angular/core';
2
+ import { ElementRef, Renderer2, QueryList, InjectionToken, Optional, OnDestroy, Injector, ViewContainerRef, EventEmitter, TemplateRef, OnChanges, SimpleChanges, NgZone, AfterContentInit } from '@angular/core';
10
3
  import * as i1 from '@angular/cdk/overlay';
11
- import { InjectionToken } from '@angular/core';
12
- import { Injector } from '@angular/core';
13
- import { NgZone } from '@angular/core';
14
- import { Observable } from 'rxjs';
15
- import { OnChanges } from '@angular/core';
16
- import { OnDestroy } from '@angular/core';
17
- import { Optional } from '@angular/core';
18
- import { OverlayRef } from '@angular/cdk/overlay';
19
- import { QueryList } from '@angular/core';
20
- import { Renderer2 } from '@angular/core';
21
- import { ScrollStrategy } from '@angular/cdk/overlay';
22
- import { SimpleChanges } from '@angular/core';
23
- import { Subject } from 'rxjs';
4
+ import { ScrollStrategy, ConnectedPosition, OverlayRef } from '@angular/cdk/overlay';
5
+ import * as rxjs from 'rxjs';
6
+ import { Observable, Subject } from 'rxjs';
7
+ import { FocusOrigin, FocusableOption, FocusKeyManager } from '@angular/cdk/a11y';
8
+ import { Directionality } from '@angular/cdk/bidi';
24
9
  import { TemplatePortal } from '@angular/cdk/portal';
25
- import { TemplateRef } from '@angular/core';
26
- import { ViewContainerRef } from '@angular/core';
27
10
 
28
- /** Injection token used to return classes implementing the Menu interface */
29
- export declare const CDK_MENU: InjectionToken<Menu>;
11
+ /** Item to track for mouse focus events. */
12
+ interface FocusableElement {
13
+ /** A reference to the element to be tracked. */
14
+ _elementRef: ElementRef<HTMLElement>;
15
+ }
16
+ /**
17
+ * PointerFocusTracker keeps track of the currently active item under mouse focus. It also has
18
+ * observables which emit when the users mouse enters and leaves a tracked element.
19
+ */
20
+ declare class PointerFocusTracker<T extends FocusableElement> {
21
+ private _renderer;
22
+ private readonly _items;
23
+ private _eventCleanups;
24
+ private _itemsSubscription;
25
+ /** Emits when an element is moused into. */
26
+ readonly entered: Observable<T>;
27
+ /** Emits when an element is moused out. */
28
+ readonly exited: Observable<T>;
29
+ /** The element currently under mouse focus. */
30
+ activeElement?: T;
31
+ /** The element previously under mouse focus. */
32
+ previousElement?: T;
33
+ constructor(_renderer: Renderer2, _items: QueryList<T>);
34
+ /** Stop the managers listeners. */
35
+ destroy(): void;
36
+ /** Binds the enter/exit events on all the items. */
37
+ private _bindEvents;
38
+ /** Cleans up the currently-bound events. */
39
+ private _cleanupEvents;
40
+ }
30
41
 
42
+ /** The relative item in the inline menu to focus after closing all popup menus. */
43
+ declare enum FocusNext {
44
+ nextItem = 0,
45
+ previousItem = 1,
46
+ currentItem = 2
47
+ }
48
+ /** A single item (menu) in the menu stack. */
49
+ interface MenuStackItem {
50
+ /** A reference to the menu stack this menu stack item belongs to. */
51
+ menuStack?: MenuStack;
52
+ }
53
+ /** Injection token used for an implementation of MenuStack. */
54
+ declare const MENU_STACK: InjectionToken<MenuStack>;
55
+ /** Provider that provides the parent menu stack, or a new menu stack if there is no parent one. */
56
+ declare const PARENT_OR_NEW_MENU_STACK_PROVIDER: {
57
+ provide: InjectionToken<MenuStack>;
58
+ deps: Optional[][];
59
+ useFactory: (parentMenuStack?: MenuStack) => MenuStack;
60
+ };
61
+ /** Provider that provides the parent menu stack, or a new inline menu stack if there is no parent one. */
62
+ declare const PARENT_OR_NEW_INLINE_MENU_STACK_PROVIDER: (orientation: "vertical" | "horizontal") => {
63
+ provide: InjectionToken<MenuStack>;
64
+ deps: Optional[][];
65
+ useFactory: (parentMenuStack?: MenuStack) => MenuStack;
66
+ };
67
+ /** Options that can be provided to the close or closeAll methods. */
68
+ interface CloseOptions {
69
+ /** The element to focus next if the close operation causes the menu stack to become empty. */
70
+ focusNextOnEmpty?: FocusNext;
71
+ /** Whether to focus the parent trigger after closing the menu. */
72
+ focusParentTrigger?: boolean;
73
+ }
74
+ /** Event dispatched when a menu is closed. */
75
+ interface MenuStackCloseEvent {
76
+ /** The menu being closed. */
77
+ item: MenuStackItem;
78
+ /** Whether to focus the parent trigger after closing the menu. */
79
+ focusParentTrigger?: boolean;
80
+ }
31
81
  /**
32
- * A directive that opens a menu when a user right-clicks within its host element.
33
- * It is aware of nested context menus and will trigger only the lowest level non-disabled context menu.
82
+ * MenuStack allows subscribers to listen for close events (when a MenuStackItem is popped off
83
+ * of the stack) in order to perform closing actions. Upon the MenuStack being empty it emits
84
+ * from the `empty` observable specifying the next focus action which the listener should perform
85
+ * as requested by the closer.
34
86
  */
35
- export declare class CdkContextMenuTrigger extends CdkMenuTriggerBase implements OnDestroy {
36
- /** The CDK overlay service. */
37
- private readonly _overlay;
38
- /** The directionality of the page. */
39
- private readonly _directionality;
40
- /** The app's context menu tracking registry */
41
- private readonly _contextMenuTracker;
42
- private readonly _changeDetectorRef;
43
- /** Whether the context menu is disabled. */
44
- disabled: boolean;
45
- constructor();
87
+ declare class MenuStack {
88
+ /** The ID of this menu stack. */
89
+ readonly id: string;
90
+ /** All MenuStackItems tracked by this MenuStack. */
91
+ private readonly _elements;
92
+ /** Emits the element which was popped off of the stack when requested by a closer. */
93
+ private readonly _close;
94
+ /** Emits once the MenuStack has become empty after popping off elements. */
95
+ private readonly _empty;
96
+ /** Emits whether any menu in the menu stack has focus. */
97
+ private readonly _hasFocus;
98
+ /** Observable which emits the MenuStackItem which has been requested to close. */
99
+ readonly closed: Observable<MenuStackCloseEvent>;
100
+ /** Observable which emits whether any menu in the menu stack has focus. */
101
+ readonly hasFocus: Observable<boolean>;
46
102
  /**
47
- * Open the attached menu at the specified location.
48
- * @param coordinates where to open the context menu
103
+ * Observable which emits when the MenuStack is empty after popping off the last element. It
104
+ * emits a FocusNext event which specifies the action the closer has requested the listener
105
+ * perform.
49
106
  */
50
- open(coordinates: ContextMenuCoordinates): void;
51
- /** Close the currently opened context menu. */
52
- close(): void;
107
+ readonly emptied: Observable<FocusNext | undefined>;
53
108
  /**
54
- * Open the context menu and closes any previously open menus.
55
- * @param event the mouse event which opens the context menu.
109
+ * Whether the inline menu associated with this menu stack is vertical or horizontal.
110
+ * `null` indicates there is no inline menu associated with this menu stack.
56
111
  */
57
- _openOnContextMenu(event: MouseEvent): void;
112
+ private _inlineMenuOrientation;
113
+ /** Creates a menu stack that originates from an inline menu. */
114
+ static inline(orientation: 'vertical' | 'horizontal'): MenuStack;
58
115
  /**
59
- * Get the configuration object used to create the overlay.
60
- * @param coordinates the location to place the opened menu
116
+ * Adds an item to the menu stack.
117
+ * @param menu the MenuStackItem to put on the stack.
61
118
  */
62
- private _getOverlayConfig;
119
+ push(menu: MenuStackItem): void;
63
120
  /**
64
- * Get the position strategy for the overlay which specifies where to place the menu.
65
- * @param coordinates the location to place the opened menu
121
+ * Pop items off of the stack up to and including `lastItem` and emit each on the close
122
+ * observable. If the stack is empty or `lastItem` is not on the stack it does nothing.
123
+ * @param lastItem the last item to pop off the stack.
124
+ * @param options Options that configure behavior on close.
66
125
  */
67
- private _getOverlayPositionStrategy;
68
- /** Subscribe to the menu stack close events and close this menu when requested. */
69
- private _setMenuStackCloseListener;
126
+ close(lastItem: MenuStackItem, options?: CloseOptions): void;
70
127
  /**
71
- * Subscribe to the overlays outside pointer events stream and handle closing out the stack if a
72
- * click occurs outside the menus.
73
- * @param userEvent User-generated event that opened the menu.
128
+ * Pop items off of the stack up to but excluding `lastItem` and emit each on the close
129
+ * observable. If the stack is empty or `lastItem` is not on the stack it does nothing.
130
+ * @param lastItem the element which should be left on the stack
131
+ * @return whether or not an item was removed from the stack
74
132
  */
75
- private _subscribeToOutsideClicks;
133
+ closeSubMenuOf(lastItem: MenuStackItem): boolean;
76
134
  /**
77
- * Open the attached menu at the specified location.
78
- * @param userEvent User-generated event that opened the menu
79
- * @param coordinates where to open the context menu
135
+ * Pop off all MenuStackItems and emit each one on the `close` observable one by one.
136
+ * @param options Options that configure behavior on close.
80
137
  */
81
- private _open;
82
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkContextMenuTrigger, never>;
83
- static ɵdir: i0.ɵɵDirectiveDeclaration<CdkContextMenuTrigger, "[cdkContextMenuTriggerFor]", ["cdkContextMenuTriggerFor"], { "menuTemplateRef": { "alias": "cdkContextMenuTriggerFor"; "required": false; }; "menuPosition": { "alias": "cdkContextMenuPosition"; "required": false; }; "menuData": { "alias": "cdkContextMenuTriggerData"; "required": false; }; "disabled": { "alias": "cdkContextMenuDisabled"; "required": false; }; }, { "opened": "cdkContextMenuOpened"; "closed": "cdkContextMenuClosed"; }, never, never, true, never>;
84
- static ngAcceptInputType_disabled: unknown;
138
+ closeAll(options?: CloseOptions): void;
139
+ /** Return true if this stack is empty. */
140
+ isEmpty(): boolean;
141
+ /** Return the length of the stack. */
142
+ length(): number;
143
+ /** Get the top most element on the stack. */
144
+ peek(): MenuStackItem | undefined;
145
+ /** Whether the menu stack is associated with an inline menu. */
146
+ hasInlineMenu(): boolean;
147
+ /** The orientation of the associated inline menu. */
148
+ inlineMenuOrientation(): "vertical" | "horizontal" | null;
149
+ /** Sets whether the menu stack contains the focused element. */
150
+ setHasFocus(hasFocus: boolean): void;
151
+ static ɵfac: i0.ɵɵFactoryDeclaration<MenuStack, never>;
152
+ static ɵprov: i0.ɵɵInjectableDeclaration<MenuStack>;
153
+ }
154
+
155
+ /** Injection token used to return classes implementing the Menu interface */
156
+ declare const CDK_MENU: InjectionToken<Menu>;
157
+ /** Interface which specifies Menu operations and used to break circular dependency issues */
158
+ interface Menu extends MenuStackItem {
159
+ /** The id of the menu's host element. */
160
+ id: string;
161
+ /** The menu's native DOM host element. */
162
+ nativeElement: HTMLElement;
163
+ /** The direction items in the menu flow. */
164
+ readonly orientation: 'horizontal' | 'vertical';
165
+ /** Place focus on the first MenuItem in the menu. */
166
+ focusFirstItem(focusOrigin: FocusOrigin): void;
167
+ /** Place focus on the last MenuItem in the menu. */
168
+ focusLastItem(focusOrigin: FocusOrigin): void;
85
169
  }
86
170
 
87
171
  /**
88
- * Directive which configures the element as a Menu which should contain child elements marked as
89
- * CdkMenuItem or CdkMenuGroup. Sets the appropriate role and aria-attributes for a menu and
90
- * contains accessible keyboard and mouse handling logic.
91
- *
92
- * It also acts as a RadioGroup for elements marked with role `menuitemradio`.
172
+ * MenuAim is responsible for determining if a sibling menuitem's menu should be closed when a
173
+ * Toggler item is hovered into. It is up to the hovered in item to call the MenuAim service in
174
+ * order to determine if it may perform its close actions.
93
175
  */
94
- export declare class CdkMenu extends CdkMenuBase implements AfterContentInit, OnDestroy {
95
- private _parentTrigger;
96
- /** Event emitted when the menu is closed. */
97
- readonly closed: EventEmitter<void>;
98
- /** The direction items in the menu flow. */
99
- readonly orientation = "vertical";
100
- /** Whether the menu is displayed inline (i.e. always present vs a conditional popup that the user triggers with a trigger element). */
101
- readonly isInline: boolean;
102
- constructor();
103
- ngAfterContentInit(): void;
104
- ngOnDestroy(): void;
176
+ interface MenuAim {
105
177
  /**
106
- * Handle keyboard events for the Menu.
107
- * @param event The keyboard event to be handled.
178
+ * Set the Menu and its PointerFocusTracker.
179
+ * @param menu The menu that this menu aim service controls.
180
+ * @param pointerTracker The `PointerFocusTracker` for the given menu.
108
181
  */
109
- _handleKeyEvent(event: KeyboardEvent): void;
182
+ initialize(menu: Menu, pointerTracker: PointerFocusTracker<FocusableElement & Toggler>): void;
110
183
  /**
111
- * Set focus the either the current, previous or next item based on the FocusNext event.
112
- * @param focusNext The element to focus.
184
+ * Calls the `doToggle` callback when it is deemed that the user is not moving towards
185
+ * the submenu.
186
+ * @param doToggle the function called when the user is not moving towards the submenu.
113
187
  */
114
- private _toggleMenuFocus;
115
- /** Subscribe to the MenuStack emptied events. */
116
- private _subscribeToMenuStackEmptied;
117
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenu, never>;
118
- static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenu, "[cdkMenu]", ["cdkMenu"], {}, { "closed": "closed"; }, never, never, true, never>;
188
+ toggle(doToggle: () => void): void;
189
+ }
190
+ /** Injection token used for an implementation of MenuAim. */
191
+ declare const MENU_AIM: InjectionToken<MenuAim>;
192
+ /** An element which when hovered over may open or close a menu. */
193
+ interface Toggler {
194
+ /** Gets the open menu, or undefined if no menu is open. */
195
+ getMenu(): Menu | undefined;
119
196
  }
120
-
121
197
  /**
122
- * Directive applied to an element which configures it as a MenuBar by setting the appropriate
123
- * role, aria attributes, and accessible keyboard and mouse handling logic. The component that
124
- * this directive is applied to should contain components marked with CdkMenuItem.
198
+ * TargetMenuAim predicts if a user is moving into a submenu. It calculates the
199
+ * trajectory of the user's mouse movement in the current menu to determine if the
200
+ * mouse is moving towards an open submenu.
125
201
  *
202
+ * The determination is made by calculating the slope of the users last NUM_POINTS moves where each
203
+ * pair of points determines if the trajectory line points into the submenu. It uses consensus
204
+ * approach by checking if at least NUM_POINTS / 2 pairs determine that the user is moving towards
205
+ * to submenu.
126
206
  */
127
- export declare class CdkMenuBar extends CdkMenuBase implements AfterContentInit {
128
- /** The direction items in the menu flow. */
129
- readonly orientation = "horizontal";
130
- /** Whether the menu is displayed inline (i.e. always present vs a conditional popup that the user triggers with a trigger element). */
131
- readonly isInline = true;
132
- ngAfterContentInit(): void;
207
+ declare class TargetMenuAim implements MenuAim, OnDestroy {
208
+ private readonly _ngZone;
209
+ private readonly _renderer;
210
+ private _cleanupMousemove;
211
+ /** The last NUM_POINTS mouse move events. */
212
+ private readonly _points;
213
+ /** Reference to the root menu in which we are tracking mouse moves. */
214
+ private _menu;
215
+ /** Reference to the root menu's mouse manager. */
216
+ private _pointerTracker;
217
+ /** The id associated with the current timeout call waiting to resolve. */
218
+ private _timeoutId;
219
+ /** Emits when this service is destroyed. */
220
+ private readonly _destroyed;
221
+ ngOnDestroy(): void;
133
222
  /**
134
- * Handle keyboard events for the Menu.
135
- * @param event The keyboard event to be handled.
223
+ * Set the Menu and its PointerFocusTracker.
224
+ * @param menu The menu that this menu aim service controls.
225
+ * @param pointerTracker The `PointerFocusTracker` for the given menu.
136
226
  */
137
- _handleKeyEvent(event: KeyboardEvent): void;
227
+ initialize(menu: Menu, pointerTracker: PointerFocusTracker<FocusableElement & Toggler>): void;
138
228
  /**
139
- * Set focus to either the current, previous or next item based on the FocusNext event, then
140
- * open the previous or next item.
141
- * @param focusNext The element to focus.
142
- */
143
- private _toggleOpenMenu;
144
- /** Subscribe to the MenuStack emptied events. */
145
- private _subscribeToMenuStackEmptied;
146
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuBar, never>;
147
- static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuBar, "[cdkMenuBar]", ["cdkMenuBar"], {}, {}, never, never, true, never>;
229
+ * Calls the `doToggle` callback when it is deemed that the user is not moving towards
230
+ * the submenu.
231
+ * @param doToggle the function called when the user is not moving towards the submenu.
232
+ */
233
+ toggle(doToggle: () => void): void;
234
+ /**
235
+ * Start the delayed toggle handler if one isn't running already.
236
+ *
237
+ * The delayed toggle handler executes the `doToggle` callback after some period of time iff the
238
+ * users mouse is on an item in the current menu.
239
+ *
240
+ * @param doToggle the function called when the user is not moving towards the submenu.
241
+ */
242
+ private _startTimeout;
243
+ /** Whether the user is heading towards the open submenu. */
244
+ private _isMovingToSubmenu;
245
+ /** Get the bounding DOMRect for the open submenu. */
246
+ private _getSubmenuBounds;
247
+ /**
248
+ * Check if a reference to the PointerFocusTracker and menu element is provided.
249
+ * @throws an error if neither reference is provided.
250
+ */
251
+ private _checkConfigured;
252
+ /** Subscribe to the root menus mouse move events and update the tracked mouse points. */
253
+ private _subscribeToMouseMoves;
254
+ static ɵfac: i0.ɵɵFactoryDeclaration<TargetMenuAim, never>;
255
+ static ɵprov: i0.ɵɵInjectableDeclaration<TargetMenuAim>;
256
+ }
257
+ /**
258
+ * CdkTargetMenuAim is a provider for the TargetMenuAim service. It can be added to an
259
+ * element with either the `cdkMenu` or `cdkMenuBar` directive and child menu items.
260
+ */
261
+ declare class CdkTargetMenuAim {
262
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkTargetMenuAim, never>;
263
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkTargetMenuAim, "[cdkTargetMenuAim]", ["cdkTargetMenuAim"], {}, {}, never, never, true, never>;
148
264
  }
149
265
 
150
266
  /**
151
- * Abstract directive that implements shared logic common to all menus.
152
- * This class can be extended to create custom menu types.
267
+ * A grouping container for `CdkMenuItemRadio` instances, similar to a `role="radiogroup"` element.
153
268
  */
154
- export declare abstract class CdkMenuBase extends CdkMenuGroup implements Menu, AfterContentInit, OnDestroy {
155
- private _focusMonitor;
156
- protected ngZone: NgZone;
157
- private _renderer;
158
- /** The menu's native DOM host element. */
159
- readonly nativeElement: HTMLElement;
160
- /** The stack of menus this menu belongs to. */
161
- readonly menuStack: MenuStack;
162
- /** The menu aim service used by this menu. */
163
- protected readonly menuAim: MenuAim | null;
164
- /** The directionality (text direction) of the current page. */
165
- protected readonly dir: Directionality | null;
166
- /** The id of the menu's host element. */
167
- id: string;
168
- /** All child MenuItem elements nested in this Menu. */
169
- readonly items: QueryList<CdkMenuItem>;
170
- /** The direction items in the menu flow. */
171
- orientation: 'horizontal' | 'vertical';
269
+ declare class CdkMenuGroup {
270
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuGroup, never>;
271
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuGroup, "[cdkMenuGroup]", ["cdkMenuGroup"], {}, {}, never, never, true, never>;
272
+ }
273
+
274
+ /** Injection token used for an implementation of MenuStack. */
275
+ declare const MENU_TRIGGER: InjectionToken<CdkMenuTriggerBase>;
276
+ /** Injection token used to configure the behavior of the menu when the page is scrolled. */
277
+ declare const MENU_SCROLL_STRATEGY: InjectionToken<() => ScrollStrategy>;
278
+ /**
279
+ * Abstract directive that implements shared logic common to all menu triggers.
280
+ * This class can be extended to create custom menu trigger types.
281
+ */
282
+ declare abstract class CdkMenuTriggerBase implements OnDestroy {
283
+ /** The DI injector for this component. */
284
+ readonly injector: Injector;
285
+ /** The view container ref for this component */
286
+ protected readonly viewContainerRef: ViewContainerRef;
287
+ /** The menu stack in which this menu resides. */
288
+ protected readonly menuStack: MenuStack;
289
+ /** Function used to configure the scroll strategy for the menu. */
290
+ protected readonly menuScrollStrategy: () => ScrollStrategy;
172
291
  /**
173
- * Whether the menu is displayed inline (i.e. always present vs a conditional popup that the
174
- * user triggers with a trigger element).
292
+ * A list of preferred menu positions to be used when constructing the
293
+ * `FlexibleConnectedPositionStrategy` for this trigger's menu.
175
294
  */
176
- isInline: boolean;
177
- /** Handles keyboard events for the menu. */
178
- protected keyManager: FocusKeyManager<CdkMenuItem>;
179
- /** Emits when the MenuBar is destroyed. */
295
+ menuPosition: ConnectedPosition[];
296
+ /** Emits when the attached menu is requested to open */
297
+ readonly opened: EventEmitter<void>;
298
+ /** Emits when the attached menu is requested to close */
299
+ readonly closed: EventEmitter<void>;
300
+ /** Template reference variable to the menu this trigger opens */
301
+ menuTemplateRef: TemplateRef<unknown> | null;
302
+ /** Context data to be passed along to the menu template */
303
+ menuData: unknown;
304
+ /** A reference to the overlay which manages the triggered menu */
305
+ protected overlayRef: OverlayRef | null;
306
+ /** Emits when this trigger is destroyed. */
180
307
  protected readonly destroyed: Subject<void>;
181
- /** The Menu Item which triggered the open submenu. */
182
- protected triggerItem?: CdkMenuItem;
183
- /** Tracks the users mouse movements over the menu. */
184
- protected pointerTracker?: PointerFocusTracker<CdkMenuItem>;
185
- /** Whether this menu's menu stack has focus. */
186
- private _menuStackHasFocus;
187
- private _tabIndexSignal;
188
- ngAfterContentInit(): void;
308
+ /** Emits when the outside pointer events listener on the overlay should be stopped. */
309
+ protected readonly stopOutsideClicksListener: rxjs.Observable<void>;
310
+ /** The child menu opened by this trigger. */
311
+ protected childMenu?: Menu;
312
+ /** The content of the menu panel opened by this trigger. */
313
+ private _menuPortal;
314
+ /** The injector to use for the child menu opened by this trigger. */
315
+ private _childMenuInjector?;
189
316
  ngOnDestroy(): void;
317
+ /** Whether the attached menu is open. */
318
+ isOpen(): boolean;
319
+ /** Registers a child menu as having been opened by this trigger. */
320
+ registerChildMenu(child: Menu): void;
190
321
  /**
191
- * Place focus on the first MenuItem in the menu and set the focus origin.
192
- * @param focusOrigin The origin input mode of the focus event.
322
+ * Get the portal to be attached to the overlay which contains the menu. Allows for the menu
323
+ * content to change dynamically and be reflected in the application.
193
324
  */
194
- focusFirstItem(focusOrigin?: FocusOrigin): void;
325
+ protected getMenuContentPortal(): TemplatePortal<any>;
195
326
  /**
196
- * Place focus on the last MenuItem in the menu and set the focus origin.
197
- * @param focusOrigin The origin input mode of the focus event.
327
+ * Whether the given element is inside the scope of this trigger's menu stack.
328
+ * @param element The element to check.
329
+ * @return Whether the element is inside the scope of this trigger's menu stack.
198
330
  */
199
- focusLastItem(focusOrigin?: FocusOrigin): void;
200
- /** Gets the tabindex for this menu. */
201
- _getTabIndex(): 0 | -1 | null;
331
+ protected isElementInsideMenuStack(element: Element): boolean;
332
+ /** Destroy and unset the overlay reference it if exists */
333
+ private _destroyOverlay;
334
+ /** Gets the injector to use when creating a child menu. */
335
+ private _getChildMenuInjector;
336
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuTriggerBase, never>;
337
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuTriggerBase, never, never, {}, {}, never, never, true, never>;
338
+ }
339
+
340
+ /**
341
+ * A directive that turns its host element into a trigger for a popup menu.
342
+ * It can be combined with cdkMenuItem to create sub-menus. If the element is in a top level
343
+ * MenuBar it will open the menu on click, or if a sibling is already opened it will open on hover.
344
+ * If it is inside of a Menu it will open the attached Submenu on hover regardless of its sibling
345
+ * state.
346
+ */
347
+ declare class CdkMenuTrigger extends CdkMenuTriggerBase implements OnChanges, OnDestroy {
348
+ private readonly _elementRef;
349
+ private readonly _overlay;
350
+ private readonly _ngZone;
351
+ private readonly _changeDetectorRef;
352
+ private readonly _inputModalityDetector;
353
+ private readonly _directionality;
354
+ private readonly _renderer;
355
+ private _cleanupMouseenter;
356
+ /** The parent menu this trigger belongs to. */
357
+ private readonly _parentMenu;
358
+ /** The menu aim service used by this menu. */
359
+ private readonly _menuAim;
360
+ constructor();
361
+ /** Toggle the attached menu. */
362
+ toggle(): void;
363
+ /** Open the attached menu. */
364
+ open(): void;
365
+ /** Close the opened menu. */
366
+ close(): void;
202
367
  /**
203
- * Close the open menu if the current active item opened the requested MenuStackItem.
204
- * @param menu The menu requested to be closed.
205
- * @param options Options to configure the behavior on close.
206
- * - `focusParentTrigger` Whether to focus the parent trigger after closing the menu.
368
+ * Get a reference to the rendered Menu if the Menu is open and rendered in the DOM.
207
369
  */
208
- protected closeOpenMenu(menu: MenuStackItem, options?: {
209
- focusParentTrigger?: boolean;
210
- }): void;
211
- /** Setup the FocusKeyManager with the correct orientation for the menu. */
212
- private _setKeyManager;
370
+ getMenu(): Menu | undefined;
371
+ ngOnChanges(changes: SimpleChanges): void;
372
+ ngOnDestroy(): void;
213
373
  /**
214
- * Subscribe to the menu trigger's open events in order to track the trigger which opened the menu
215
- * and stop tracking it when the menu is closed.
374
+ * Handles keyboard events for the menu item.
375
+ * @param event The keyboard event to handle
216
376
  */
217
- private _subscribeToMenuOpen;
218
- /** Subscribe to the MenuStack close events. */
219
- private _subscribeToMenuStackClosed;
220
- /** Subscribe to the MenuStack hasFocus events. */
221
- private _subscribeToMenuStackHasFocus;
377
+ _toggleOnKeydown(event: KeyboardEvent): void;
378
+ /** Handles clicks on the menu trigger. */
379
+ _handleClick(): void;
222
380
  /**
223
- * Set the PointerFocusTracker and ensure that when mouse focus changes the key manager is updated
224
- * with the latest menu item under mouse focus.
381
+ * Sets whether the trigger's menu stack has focus.
382
+ * @param hasFocus Whether the menu stack has focus.
225
383
  */
226
- private _setUpPointerTracker;
227
- /** Handles focus landing on the host element of the menu. */
228
- private _handleFocus;
229
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuBase, never>;
230
- static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuBase, never, never, { "id": { "alias": "id"; "required": false; }; }, {}, ["items"], never, true, never>;
231
- }
232
-
233
- /**
234
- * A grouping container for `CdkMenuItemRadio` instances, similar to a `role="radiogroup"` element.
235
- */
236
- export declare class CdkMenuGroup {
237
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuGroup, never>;
238
- static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuGroup, "[cdkMenuGroup]", ["cdkMenuGroup"], {}, {}, never, never, true, never>;
384
+ _setHasFocus(hasFocus: boolean): void;
385
+ /**
386
+ * Subscribe to the mouseenter events and close any sibling menu items if this element is moused
387
+ * into.
388
+ */
389
+ private _subscribeToMouseEnter;
390
+ /** Close out any sibling menu trigger menus. */
391
+ private _closeSiblingTriggers;
392
+ /** Get the configuration object used to create the overlay. */
393
+ private _getOverlayConfig;
394
+ /** Build the position strategy for the overlay which specifies where to place the menu. */
395
+ private _getOverlayPositionStrategy;
396
+ /** Get the preferred positions for the opened menu relative to the menu item. */
397
+ private _getOverlayPositions;
398
+ /**
399
+ * Subscribe to the MenuStack close events if this is a standalone trigger and close out the menu
400
+ * this triggers when requested.
401
+ */
402
+ private _registerCloseHandler;
403
+ /**
404
+ * Subscribe to the overlays outside pointer events stream and handle closing out the stack if a
405
+ * click occurs outside the menus.
406
+ */
407
+ private _subscribeToOutsideClicks;
408
+ /** Subscribe to the MenuStack hasFocus events. */
409
+ private _subscribeToMenuStackHasFocus;
410
+ /** Subscribe to the MenuStack closed events. */
411
+ private _subscribeToMenuStackClosed;
412
+ /** Sets the role attribute for this trigger if needed. */
413
+ private _setRole;
414
+ /** Sets thte `type` attribute of the trigger. */
415
+ private _setType;
416
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuTrigger, never>;
417
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuTrigger, "[cdkMenuTriggerFor]", ["cdkMenuTriggerFor"], { "menuTemplateRef": { "alias": "cdkMenuTriggerFor"; "required": false; }; "menuPosition": { "alias": "cdkMenuPosition"; "required": false; }; "menuData": { "alias": "cdkMenuTriggerData"; "required": false; }; }, { "opened": "cdkMenuOpened"; "closed": "cdkMenuClosed"; }, never, never, true, never>;
239
418
  }
240
419
 
241
420
  /**
@@ -243,7 +422,7 @@ export declare class CdkMenuGroup {
243
422
  * keyboard when residing in a CdkMenu, CdkMenuBar, or CdkMenuGroup. It performs user defined
244
423
  * behavior when clicked.
245
424
  */
246
- export declare class CdkMenuItem implements FocusableOption, FocusableElement, Toggler, OnDestroy {
425
+ declare class CdkMenuItem implements FocusableOption, FocusableElement, Toggler, OnDestroy {
247
426
  protected readonly _dir: Directionality | null;
248
427
  readonly _elementRef: ElementRef<HTMLElement>;
249
428
  protected _ngZone: NgZone;
@@ -349,28 +528,168 @@ export declare class CdkMenuItem implements FocusableOption, FocusableElement, T
349
528
  }
350
529
 
351
530
  /**
352
- * A directive providing behavior for the "menuitemcheckbox" ARIA role, which behaves similarly to a
353
- * conventional checkbox.
531
+ * Abstract directive that implements shared logic common to all menus.
532
+ * This class can be extended to create custom menu types.
354
533
  */
355
- export declare class CdkMenuItemCheckbox extends CdkMenuItemSelectable {
356
- /**
357
- * Toggle the checked state of the checkbox.
358
- * @param options Options the configure how the item is triggered
359
- * - keepOpen: specifies that the menu should be kept open after triggering the item.
360
- */
361
- trigger(options?: {
362
- keepOpen: boolean;
363
- }): void;
364
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuItemCheckbox, never>;
365
- static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuItemCheckbox, "[cdkMenuItemCheckbox]", ["cdkMenuItemCheckbox"], {}, {}, never, never, true, never>;
366
- }
367
-
368
- /**
534
+ declare abstract class CdkMenuBase extends CdkMenuGroup implements Menu, AfterContentInit, OnDestroy {
535
+ private _focusMonitor;
536
+ protected ngZone: NgZone;
537
+ private _renderer;
538
+ /** The menu's native DOM host element. */
539
+ readonly nativeElement: HTMLElement;
540
+ /** The stack of menus this menu belongs to. */
541
+ readonly menuStack: MenuStack;
542
+ /** The menu aim service used by this menu. */
543
+ protected readonly menuAim: MenuAim | null;
544
+ /** The directionality (text direction) of the current page. */
545
+ protected readonly dir: Directionality | null;
546
+ /** The id of the menu's host element. */
547
+ id: string;
548
+ /** All child MenuItem elements nested in this Menu. */
549
+ readonly items: QueryList<CdkMenuItem>;
550
+ /** The direction items in the menu flow. */
551
+ orientation: 'horizontal' | 'vertical';
552
+ /**
553
+ * Whether the menu is displayed inline (i.e. always present vs a conditional popup that the
554
+ * user triggers with a trigger element).
555
+ */
556
+ isInline: boolean;
557
+ /** Handles keyboard events for the menu. */
558
+ protected keyManager: FocusKeyManager<CdkMenuItem>;
559
+ /** Emits when the MenuBar is destroyed. */
560
+ protected readonly destroyed: Subject<void>;
561
+ /** The Menu Item which triggered the open submenu. */
562
+ protected triggerItem?: CdkMenuItem;
563
+ /** Tracks the users mouse movements over the menu. */
564
+ protected pointerTracker?: PointerFocusTracker<CdkMenuItem>;
565
+ /** Whether this menu's menu stack has focus. */
566
+ private _menuStackHasFocus;
567
+ private _tabIndexSignal;
568
+ ngAfterContentInit(): void;
569
+ ngOnDestroy(): void;
570
+ /**
571
+ * Place focus on the first MenuItem in the menu and set the focus origin.
572
+ * @param focusOrigin The origin input mode of the focus event.
573
+ */
574
+ focusFirstItem(focusOrigin?: FocusOrigin): void;
575
+ /**
576
+ * Place focus on the last MenuItem in the menu and set the focus origin.
577
+ * @param focusOrigin The origin input mode of the focus event.
578
+ */
579
+ focusLastItem(focusOrigin?: FocusOrigin): void;
580
+ /** Gets the tabindex for this menu. */
581
+ _getTabIndex(): 0 | -1 | null;
582
+ /**
583
+ * Close the open menu if the current active item opened the requested MenuStackItem.
584
+ * @param menu The menu requested to be closed.
585
+ * @param options Options to configure the behavior on close.
586
+ * - `focusParentTrigger` Whether to focus the parent trigger after closing the menu.
587
+ */
588
+ protected closeOpenMenu(menu: MenuStackItem, options?: {
589
+ focusParentTrigger?: boolean;
590
+ }): void;
591
+ /** Setup the FocusKeyManager with the correct orientation for the menu. */
592
+ private _setKeyManager;
593
+ /**
594
+ * Subscribe to the menu trigger's open events in order to track the trigger which opened the menu
595
+ * and stop tracking it when the menu is closed.
596
+ */
597
+ private _subscribeToMenuOpen;
598
+ /** Subscribe to the MenuStack close events. */
599
+ private _subscribeToMenuStackClosed;
600
+ /** Subscribe to the MenuStack hasFocus events. */
601
+ private _subscribeToMenuStackHasFocus;
602
+ /**
603
+ * Set the PointerFocusTracker and ensure that when mouse focus changes the key manager is updated
604
+ * with the latest menu item under mouse focus.
605
+ */
606
+ private _setUpPointerTracker;
607
+ /** Handles focus landing on the host element of the menu. */
608
+ private _handleFocus;
609
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuBase, never>;
610
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuBase, never, never, { "id": { "alias": "id"; "required": false; }; }, {}, ["items"], never, true, never>;
611
+ }
612
+
613
+ /**
614
+ * Directive applied to an element which configures it as a MenuBar by setting the appropriate
615
+ * role, aria attributes, and accessible keyboard and mouse handling logic. The component that
616
+ * this directive is applied to should contain components marked with CdkMenuItem.
617
+ *
618
+ */
619
+ declare class CdkMenuBar extends CdkMenuBase implements AfterContentInit {
620
+ /** The direction items in the menu flow. */
621
+ readonly orientation = "horizontal";
622
+ /** Whether the menu is displayed inline (i.e. always present vs a conditional popup that the user triggers with a trigger element). */
623
+ readonly isInline = true;
624
+ ngAfterContentInit(): void;
625
+ /**
626
+ * Handle keyboard events for the Menu.
627
+ * @param event The keyboard event to be handled.
628
+ */
629
+ _handleKeyEvent(event: KeyboardEvent): void;
630
+ /**
631
+ * Set focus to either the current, previous or next item based on the FocusNext event, then
632
+ * open the previous or next item.
633
+ * @param focusNext The element to focus.
634
+ */
635
+ private _toggleOpenMenu;
636
+ /** Subscribe to the MenuStack emptied events. */
637
+ private _subscribeToMenuStackEmptied;
638
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuBar, never>;
639
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuBar, "[cdkMenuBar]", ["cdkMenuBar"], {}, {}, never, never, true, never>;
640
+ }
641
+
642
+ /**
643
+ * Directive which configures the element as a Menu which should contain child elements marked as
644
+ * CdkMenuItem or CdkMenuGroup. Sets the appropriate role and aria-attributes for a menu and
645
+ * contains accessible keyboard and mouse handling logic.
646
+ *
647
+ * It also acts as a RadioGroup for elements marked with role `menuitemradio`.
648
+ */
649
+ declare class CdkMenu extends CdkMenuBase implements AfterContentInit, OnDestroy {
650
+ private _parentTrigger;
651
+ /** Event emitted when the menu is closed. */
652
+ readonly closed: EventEmitter<void>;
653
+ /** The direction items in the menu flow. */
654
+ readonly orientation = "vertical";
655
+ /** Whether the menu is displayed inline (i.e. always present vs a conditional popup that the user triggers with a trigger element). */
656
+ readonly isInline: boolean;
657
+ constructor();
658
+ ngAfterContentInit(): void;
659
+ ngOnDestroy(): void;
660
+ /**
661
+ * Handle keyboard events for the Menu.
662
+ * @param event The keyboard event to be handled.
663
+ */
664
+ _handleKeyEvent(event: KeyboardEvent): void;
665
+ /**
666
+ * Set focus the either the current, previous or next item based on the FocusNext event.
667
+ * @param focusNext The element to focus.
668
+ */
669
+ private _toggleMenuFocus;
670
+ /** Subscribe to the MenuStack emptied events. */
671
+ private _subscribeToMenuStackEmptied;
672
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenu, never>;
673
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenu, "[cdkMenu]", ["cdkMenu"], {}, { "closed": "closed"; }, never, never, true, never>;
674
+ }
675
+
676
+ /** Base class providing checked state for selectable MenuItems. */
677
+ declare abstract class CdkMenuItemSelectable extends CdkMenuItem {
678
+ /** Whether the element is checked */
679
+ checked: boolean;
680
+ /** Whether the item should close the menu if triggered by the spacebar. */
681
+ protected closeOnSpacebarTrigger: boolean;
682
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuItemSelectable, never>;
683
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuItemSelectable, never, never, { "checked": { "alias": "cdkMenuItemChecked"; "required": false; }; }, {}, never, never, true, never>;
684
+ static ngAcceptInputType_checked: unknown;
685
+ }
686
+
687
+ /**
369
688
  * A directive providing behavior for the "menuitemradio" ARIA role, which behaves similarly to
370
689
  * a conventional radio-button. Any sibling `CdkMenuItemRadio` instances within the same `CdkMenu`
371
690
  * or `CdkMenuGroup` comprise a radio group with unique selection enforced.
372
691
  */
373
- export declare class CdkMenuItemRadio extends CdkMenuItemSelectable implements OnDestroy {
692
+ declare class CdkMenuItemRadio extends CdkMenuItemSelectable implements OnDestroy {
374
693
  /** The unique selection dispatcher for this radio's `CdkMenuGroup`. */
375
694
  private readonly _selectionDispatcher;
376
695
  /** An ID to identify this radio item to the `UniqueSelectionDispatcher`. */
@@ -393,514 +712,101 @@ export declare class CdkMenuItemRadio extends CdkMenuItemSelectable implements O
393
712
  static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuItemRadio, "[cdkMenuItemRadio]", ["cdkMenuItemRadio"], {}, {}, never, never, true, never>;
394
713
  }
395
714
 
396
- /** Base class providing checked state for selectable MenuItems. */
397
- export declare abstract class CdkMenuItemSelectable extends CdkMenuItem {
398
- /** Whether the element is checked */
399
- checked: boolean;
400
- /** Whether the item should close the menu if triggered by the spacebar. */
401
- protected closeOnSpacebarTrigger: boolean;
402
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuItemSelectable, never>;
403
- static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuItemSelectable, never, never, { "checked": { "alias": "cdkMenuItemChecked"; "required": false; }; }, {}, never, never, true, never>;
404
- static ngAcceptInputType_checked: unknown;
715
+ /**
716
+ * A directive providing behavior for the "menuitemcheckbox" ARIA role, which behaves similarly to a
717
+ * conventional checkbox.
718
+ */
719
+ declare class CdkMenuItemCheckbox extends CdkMenuItemSelectable {
720
+ /**
721
+ * Toggle the checked state of the checkbox.
722
+ * @param options Options the configure how the item is triggered
723
+ * - keepOpen: specifies that the menu should be kept open after triggering the item.
724
+ */
725
+ trigger(options?: {
726
+ keepOpen: boolean;
727
+ }): void;
728
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuItemCheckbox, never>;
729
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuItemCheckbox, "[cdkMenuItemCheckbox]", ["cdkMenuItemCheckbox"], {}, {}, never, never, true, never>;
405
730
  }
406
731
 
407
- /** Module that declares components and directives for the CDK menu. */
408
- export declare class CdkMenuModule {
409
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuModule, never>;
410
- static ɵmod: i0.ɵɵNgModuleDeclaration<CdkMenuModule, never, [typeof i1.OverlayModule, typeof i2.CdkMenuBar, typeof i3.CdkMenu, typeof i4.CdkMenuItem, typeof i5.CdkMenuItemRadio, typeof i6.CdkMenuItemCheckbox, typeof i7.CdkMenuTrigger, typeof i8.CdkMenuGroup, typeof i9.CdkContextMenuTrigger, typeof i10.CdkTargetMenuAim], [typeof i2.CdkMenuBar, typeof i3.CdkMenu, typeof i4.CdkMenuItem, typeof i5.CdkMenuItemRadio, typeof i6.CdkMenuItemCheckbox, typeof i7.CdkMenuTrigger, typeof i8.CdkMenuGroup, typeof i9.CdkContextMenuTrigger, typeof i10.CdkTargetMenuAim]>;
411
- static ɵinj: i0.ɵɵInjectorDeclaration<CdkMenuModule>;
732
+ /** Tracks the last open context menu trigger across the entire application. */
733
+ declare class ContextMenuTracker {
734
+ /** The last open context menu trigger. */
735
+ private static _openContextMenuTrigger?;
736
+ /**
737
+ * Close the previous open context menu and set the given one as being open.
738
+ * @param trigger The trigger for the currently open Context Menu.
739
+ */
740
+ update(trigger: CdkContextMenuTrigger): void;
741
+ static ɵfac: i0.ɵɵFactoryDeclaration<ContextMenuTracker, never>;
742
+ static ɵprov: i0.ɵɵInjectableDeclaration<ContextMenuTracker>;
412
743
  }
413
-
744
+ /** The coordinates where the context menu should open. */
745
+ type ContextMenuCoordinates = {
746
+ x: number;
747
+ y: number;
748
+ };
414
749
  /**
415
- * A directive that turns its host element into a trigger for a popup menu.
416
- * It can be combined with cdkMenuItem to create sub-menus. If the element is in a top level
417
- * MenuBar it will open the menu on click, or if a sibling is already opened it will open on hover.
418
- * If it is inside of a Menu it will open the attached Submenu on hover regardless of its sibling
419
- * state.
750
+ * A directive that opens a menu when a user right-clicks within its host element.
751
+ * It is aware of nested context menus and will trigger only the lowest level non-disabled context menu.
420
752
  */
421
- export declare class CdkMenuTrigger extends CdkMenuTriggerBase implements OnChanges, OnDestroy {
422
- private readonly _elementRef;
753
+ declare class CdkContextMenuTrigger extends CdkMenuTriggerBase implements OnDestroy {
754
+ /** The CDK overlay service. */
423
755
  private readonly _overlay;
424
- private readonly _ngZone;
425
- private readonly _changeDetectorRef;
426
- private readonly _inputModalityDetector;
756
+ /** The directionality of the page. */
427
757
  private readonly _directionality;
428
- private readonly _renderer;
429
- private _cleanupMouseenter;
430
- /** The parent menu this trigger belongs to. */
431
- private readonly _parentMenu;
432
- /** The menu aim service used by this menu. */
433
- private readonly _menuAim;
758
+ /** The app's context menu tracking registry */
759
+ private readonly _contextMenuTracker;
760
+ private readonly _changeDetectorRef;
761
+ /** Whether the context menu is disabled. */
762
+ disabled: boolean;
434
763
  constructor();
435
- /** Toggle the attached menu. */
436
- toggle(): void;
437
- /** Open the attached menu. */
438
- open(): void;
439
- /** Close the opened menu. */
440
- close(): void;
441
764
  /**
442
- * Get a reference to the rendered Menu if the Menu is open and rendered in the DOM.
765
+ * Open the attached menu at the specified location.
766
+ * @param coordinates where to open the context menu
443
767
  */
444
- getMenu(): Menu | undefined;
445
- ngOnChanges(changes: SimpleChanges): void;
446
- ngOnDestroy(): void;
768
+ open(coordinates: ContextMenuCoordinates): void;
769
+ /** Close the currently opened context menu. */
770
+ close(): void;
447
771
  /**
448
- * Handles keyboard events for the menu item.
449
- * @param event The keyboard event to handle
772
+ * Open the context menu and closes any previously open menus.
773
+ * @param event the mouse event which opens the context menu.
450
774
  */
451
- _toggleOnKeydown(event: KeyboardEvent): void;
452
- /** Handles clicks on the menu trigger. */
453
- _handleClick(): void;
775
+ _openOnContextMenu(event: MouseEvent): void;
454
776
  /**
455
- * Sets whether the trigger's menu stack has focus.
456
- * @param hasFocus Whether the menu stack has focus.
777
+ * Get the configuration object used to create the overlay.
778
+ * @param coordinates the location to place the opened menu
457
779
  */
458
- _setHasFocus(hasFocus: boolean): void;
780
+ private _getOverlayConfig;
459
781
  /**
460
- * Subscribe to the mouseenter events and close any sibling menu items if this element is moused
461
- * into.
782
+ * Get the position strategy for the overlay which specifies where to place the menu.
783
+ * @param coordinates the location to place the opened menu
462
784
  */
463
- private _subscribeToMouseEnter;
464
- /** Close out any sibling menu trigger menus. */
465
- private _closeSiblingTriggers;
466
- /** Get the configuration object used to create the overlay. */
467
- private _getOverlayConfig;
468
- /** Build the position strategy for the overlay which specifies where to place the menu. */
469
785
  private _getOverlayPositionStrategy;
470
- /** Get the preferred positions for the opened menu relative to the menu item. */
471
- private _getOverlayPositions;
472
- /**
473
- * Subscribe to the MenuStack close events if this is a standalone trigger and close out the menu
474
- * this triggers when requested.
475
- */
476
- private _registerCloseHandler;
786
+ /** Subscribe to the menu stack close events and close this menu when requested. */
787
+ private _setMenuStackCloseListener;
477
788
  /**
478
789
  * Subscribe to the overlays outside pointer events stream and handle closing out the stack if a
479
790
  * click occurs outside the menus.
791
+ * @param userEvent User-generated event that opened the menu.
480
792
  */
481
793
  private _subscribeToOutsideClicks;
482
- /** Subscribe to the MenuStack hasFocus events. */
483
- private _subscribeToMenuStackHasFocus;
484
- /** Subscribe to the MenuStack closed events. */
485
- private _subscribeToMenuStackClosed;
486
- /** Sets the role attribute for this trigger if needed. */
487
- private _setRole;
488
- /** Sets thte `type` attribute of the trigger. */
489
- private _setType;
490
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuTrigger, never>;
491
- static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuTrigger, "[cdkMenuTriggerFor]", ["cdkMenuTriggerFor"], { "menuTemplateRef": { "alias": "cdkMenuTriggerFor"; "required": false; }; "menuPosition": { "alias": "cdkMenuPosition"; "required": false; }; "menuData": { "alias": "cdkMenuTriggerData"; "required": false; }; }, { "opened": "cdkMenuOpened"; "closed": "cdkMenuClosed"; }, never, never, true, never>;
492
- }
493
-
494
- /**
495
- * Abstract directive that implements shared logic common to all menu triggers.
496
- * This class can be extended to create custom menu trigger types.
497
- */
498
- export declare abstract class CdkMenuTriggerBase implements OnDestroy {
499
- /** The DI injector for this component. */
500
- readonly injector: Injector;
501
- /** The view container ref for this component */
502
- protected readonly viewContainerRef: ViewContainerRef;
503
- /** The menu stack in which this menu resides. */
504
- protected readonly menuStack: MenuStack;
505
- /** Function used to configure the scroll strategy for the menu. */
506
- protected readonly menuScrollStrategy: () => ScrollStrategy;
507
- /**
508
- * A list of preferred menu positions to be used when constructing the
509
- * `FlexibleConnectedPositionStrategy` for this trigger's menu.
510
- */
511
- menuPosition: ConnectedPosition[];
512
- /** Emits when the attached menu is requested to open */
513
- readonly opened: EventEmitter<void>;
514
- /** Emits when the attached menu is requested to close */
515
- readonly closed: EventEmitter<void>;
516
- /** Template reference variable to the menu this trigger opens */
517
- menuTemplateRef: TemplateRef<unknown> | null;
518
- /** Context data to be passed along to the menu template */
519
- menuData: unknown;
520
- /** A reference to the overlay which manages the triggered menu */
521
- protected overlayRef: OverlayRef | null;
522
- /** Emits when this trigger is destroyed. */
523
- protected readonly destroyed: Subject<void>;
524
- /** Emits when the outside pointer events listener on the overlay should be stopped. */
525
- protected readonly stopOutsideClicksListener: Observable<void>;
526
- /** The child menu opened by this trigger. */
527
- protected childMenu?: Menu;
528
- /** The content of the menu panel opened by this trigger. */
529
- private _menuPortal;
530
- /** The injector to use for the child menu opened by this trigger. */
531
- private _childMenuInjector?;
532
- ngOnDestroy(): void;
533
- /** Whether the attached menu is open. */
534
- isOpen(): boolean;
535
- /** Registers a child menu as having been opened by this trigger. */
536
- registerChildMenu(child: Menu): void;
537
- /**
538
- * Get the portal to be attached to the overlay which contains the menu. Allows for the menu
539
- * content to change dynamically and be reflected in the application.
540
- */
541
- protected getMenuContentPortal(): TemplatePortal<any>;
542
- /**
543
- * Whether the given element is inside the scope of this trigger's menu stack.
544
- * @param element The element to check.
545
- * @return Whether the element is inside the scope of this trigger's menu stack.
546
- */
547
- protected isElementInsideMenuStack(element: Element): boolean;
548
- /** Destroy and unset the overlay reference it if exists */
549
- private _destroyOverlay;
550
- /** Gets the injector to use when creating a child menu. */
551
- private _getChildMenuInjector;
552
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuTriggerBase, never>;
553
- static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuTriggerBase, never, never, {}, {}, never, never, true, never>;
554
- }
555
-
556
- /**
557
- * CdkTargetMenuAim is a provider for the TargetMenuAim service. It can be added to an
558
- * element with either the `cdkMenu` or `cdkMenuBar` directive and child menu items.
559
- */
560
- export declare class CdkTargetMenuAim {
561
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkTargetMenuAim, never>;
562
- static ɵdir: i0.ɵɵDirectiveDeclaration<CdkTargetMenuAim, "[cdkTargetMenuAim]", ["cdkTargetMenuAim"], {}, {}, never, never, true, never>;
563
- }
564
-
565
- /** Options that can be provided to the close or closeAll methods. */
566
- export declare interface CloseOptions {
567
- /** The element to focus next if the close operation causes the menu stack to become empty. */
568
- focusNextOnEmpty?: FocusNext;
569
- /** Whether to focus the parent trigger after closing the menu. */
570
- focusParentTrigger?: boolean;
571
- }
572
-
573
- /** The coordinates where the context menu should open. */
574
- export declare type ContextMenuCoordinates = {
575
- x: number;
576
- y: number;
577
- };
578
-
579
- /** Tracks the last open context menu trigger across the entire application. */
580
- export declare class ContextMenuTracker {
581
- /** The last open context menu trigger. */
582
- private static _openContextMenuTrigger?;
583
794
  /**
584
- * Close the previous open context menu and set the given one as being open.
585
- * @param trigger The trigger for the currently open Context Menu.
586
- */
587
- update(trigger: CdkContextMenuTrigger): void;
588
- static ɵfac: i0.ɵɵFactoryDeclaration<ContextMenuTracker, never>;
589
- static ɵprov: i0.ɵɵInjectableDeclaration<ContextMenuTracker>;
590
- }
591
-
592
- /** Item to track for mouse focus events. */
593
- export declare interface FocusableElement {
594
- /** A reference to the element to be tracked. */
595
- _elementRef: ElementRef<HTMLElement>;
596
- }
597
-
598
- /** The relative item in the inline menu to focus after closing all popup menus. */
599
- export declare enum FocusNext {
600
- nextItem = 0,
601
- previousItem = 1,
602
- currentItem = 2
603
- }
604
-
605
- declare namespace i10 {
606
- export {
607
- MenuAim,
608
- MENU_AIM,
609
- Toggler,
610
- TargetMenuAim,
611
- CdkTargetMenuAim
612
- }
613
- }
614
-
615
- declare namespace i2 {
616
- export {
617
- CdkMenuBar
618
- }
619
- }
620
-
621
- declare namespace i3 {
622
- export {
623
- CdkMenu
624
- }
625
- }
626
-
627
- declare namespace i4 {
628
- export {
629
- CdkMenuItem
630
- }
631
- }
632
-
633
- declare namespace i5 {
634
- export {
635
- CdkMenuItemRadio
636
- }
637
- }
638
-
639
- declare namespace i6 {
640
- export {
641
- CdkMenuItemCheckbox
642
- }
643
- }
644
-
645
- declare namespace i7 {
646
- export {
647
- CdkMenuTrigger
648
- }
649
- }
650
-
651
- declare namespace i8 {
652
- export {
653
- CdkMenuGroup
654
- }
655
- }
656
-
657
- declare namespace i9 {
658
- export {
659
- ContextMenuTracker,
660
- ContextMenuCoordinates,
661
- CdkContextMenuTrigger
662
- }
663
- }
664
-
665
- /** Interface which specifies Menu operations and used to break circular dependency issues */
666
- export declare interface Menu extends MenuStackItem {
667
- /** The id of the menu's host element. */
668
- id: string;
669
- /** The menu's native DOM host element. */
670
- nativeElement: HTMLElement;
671
- /** The direction items in the menu flow. */
672
- readonly orientation: 'horizontal' | 'vertical';
673
- /** Place focus on the first MenuItem in the menu. */
674
- focusFirstItem(focusOrigin: FocusOrigin): void;
675
- /** Place focus on the last MenuItem in the menu. */
676
- focusLastItem(focusOrigin: FocusOrigin): void;
677
- }
678
-
679
- /** Injection token used for an implementation of MenuAim. */
680
- export declare const MENU_AIM: InjectionToken<MenuAim>;
681
-
682
- /** Injection token used to configure the behavior of the menu when the page is scrolled. */
683
- export declare const MENU_SCROLL_STRATEGY: InjectionToken<() => ScrollStrategy>;
684
-
685
- /** Injection token used for an implementation of MenuStack. */
686
- export declare const MENU_STACK: InjectionToken<MenuStack>;
687
-
688
- /** Injection token used for an implementation of MenuStack. */
689
- export declare const MENU_TRIGGER: InjectionToken<CdkMenuTriggerBase>;
690
-
691
- /**
692
- * MenuAim is responsible for determining if a sibling menuitem's menu should be closed when a
693
- * Toggler item is hovered into. It is up to the hovered in item to call the MenuAim service in
694
- * order to determine if it may perform its close actions.
695
- */
696
- export declare interface MenuAim {
697
- /**
698
- * Set the Menu and its PointerFocusTracker.
699
- * @param menu The menu that this menu aim service controls.
700
- * @param pointerTracker The `PointerFocusTracker` for the given menu.
701
- */
702
- initialize(menu: Menu, pointerTracker: PointerFocusTracker<FocusableElement & Toggler>): void;
703
- /**
704
- * Calls the `doToggle` callback when it is deemed that the user is not moving towards
705
- * the submenu.
706
- * @param doToggle the function called when the user is not moving towards the submenu.
707
- */
708
- toggle(doToggle: () => void): void;
709
- }
710
-
711
- /**
712
- * MenuStack allows subscribers to listen for close events (when a MenuStackItem is popped off
713
- * of the stack) in order to perform closing actions. Upon the MenuStack being empty it emits
714
- * from the `empty` observable specifying the next focus action which the listener should perform
715
- * as requested by the closer.
716
- */
717
- export declare class MenuStack {
718
- /** The ID of this menu stack. */
719
- readonly id: string;
720
- /** All MenuStackItems tracked by this MenuStack. */
721
- private readonly _elements;
722
- /** Emits the element which was popped off of the stack when requested by a closer. */
723
- private readonly _close;
724
- /** Emits once the MenuStack has become empty after popping off elements. */
725
- private readonly _empty;
726
- /** Emits whether any menu in the menu stack has focus. */
727
- private readonly _hasFocus;
728
- /** Observable which emits the MenuStackItem which has been requested to close. */
729
- readonly closed: Observable<MenuStackCloseEvent>;
730
- /** Observable which emits whether any menu in the menu stack has focus. */
731
- readonly hasFocus: Observable<boolean>;
732
- /**
733
- * Observable which emits when the MenuStack is empty after popping off the last element. It
734
- * emits a FocusNext event which specifies the action the closer has requested the listener
735
- * perform.
736
- */
737
- readonly emptied: Observable<FocusNext | undefined>;
738
- /**
739
- * Whether the inline menu associated with this menu stack is vertical or horizontal.
740
- * `null` indicates there is no inline menu associated with this menu stack.
741
- */
742
- private _inlineMenuOrientation;
743
- /** Creates a menu stack that originates from an inline menu. */
744
- static inline(orientation: 'vertical' | 'horizontal'): MenuStack;
745
- /**
746
- * Adds an item to the menu stack.
747
- * @param menu the MenuStackItem to put on the stack.
748
- */
749
- push(menu: MenuStackItem): void;
750
- /**
751
- * Pop items off of the stack up to and including `lastItem` and emit each on the close
752
- * observable. If the stack is empty or `lastItem` is not on the stack it does nothing.
753
- * @param lastItem the last item to pop off the stack.
754
- * @param options Options that configure behavior on close.
755
- */
756
- close(lastItem: MenuStackItem, options?: CloseOptions): void;
757
- /**
758
- * Pop items off of the stack up to but excluding `lastItem` and emit each on the close
759
- * observable. If the stack is empty or `lastItem` is not on the stack it does nothing.
760
- * @param lastItem the element which should be left on the stack
761
- * @return whether or not an item was removed from the stack
762
- */
763
- closeSubMenuOf(lastItem: MenuStackItem): boolean;
764
- /**
765
- * Pop off all MenuStackItems and emit each one on the `close` observable one by one.
766
- * @param options Options that configure behavior on close.
767
- */
768
- closeAll(options?: CloseOptions): void;
769
- /** Return true if this stack is empty. */
770
- isEmpty(): boolean;
771
- /** Return the length of the stack. */
772
- length(): number;
773
- /** Get the top most element on the stack. */
774
- peek(): MenuStackItem | undefined;
775
- /** Whether the menu stack is associated with an inline menu. */
776
- hasInlineMenu(): boolean;
777
- /** The orientation of the associated inline menu. */
778
- inlineMenuOrientation(): "vertical" | "horizontal" | null;
779
- /** Sets whether the menu stack contains the focused element. */
780
- setHasFocus(hasFocus: boolean): void;
781
- static ɵfac: i0.ɵɵFactoryDeclaration<MenuStack, never>;
782
- static ɵprov: i0.ɵɵInjectableDeclaration<MenuStack>;
783
- }
784
-
785
- /** Event dispatched when a menu is closed. */
786
- export declare interface MenuStackCloseEvent {
787
- /** The menu being closed. */
788
- item: MenuStackItem;
789
- /** Whether to focus the parent trigger after closing the menu. */
790
- focusParentTrigger?: boolean;
791
- }
792
-
793
- /** A single item (menu) in the menu stack. */
794
- export declare interface MenuStackItem {
795
- /** A reference to the menu stack this menu stack item belongs to. */
796
- menuStack?: MenuStack;
797
- }
798
-
799
- /** Provider that provides the parent menu stack, or a new inline menu stack if there is no parent one. */
800
- export declare const PARENT_OR_NEW_INLINE_MENU_STACK_PROVIDER: (orientation: "vertical" | "horizontal") => {
801
- provide: InjectionToken<MenuStack>;
802
- deps: Optional[][];
803
- useFactory: (parentMenuStack?: MenuStack) => MenuStack;
804
- };
805
-
806
- /** Provider that provides the parent menu stack, or a new menu stack if there is no parent one. */
807
- export declare const PARENT_OR_NEW_MENU_STACK_PROVIDER: {
808
- provide: InjectionToken<MenuStack>;
809
- deps: Optional[][];
810
- useFactory: (parentMenuStack?: MenuStack) => MenuStack;
811
- };
812
-
813
- /**
814
- * PointerFocusTracker keeps track of the currently active item under mouse focus. It also has
815
- * observables which emit when the users mouse enters and leaves a tracked element.
816
- */
817
- export declare class PointerFocusTracker<T extends FocusableElement> {
818
- private _renderer;
819
- private readonly _items;
820
- private _eventCleanups;
821
- private _itemsSubscription;
822
- /** Emits when an element is moused into. */
823
- readonly entered: Observable<T>;
824
- /** Emits when an element is moused out. */
825
- readonly exited: Observable<T>;
826
- /** The element currently under mouse focus. */
827
- activeElement?: T;
828
- /** The element previously under mouse focus. */
829
- previousElement?: T;
830
- constructor(_renderer: Renderer2, _items: QueryList<T>);
831
- /** Stop the managers listeners. */
832
- destroy(): void;
833
- /** Binds the enter/exit events on all the items. */
834
- private _bindEvents;
835
- /** Cleans up the currently-bound events. */
836
- private _cleanupEvents;
837
- }
838
-
839
- /**
840
- * TargetMenuAim predicts if a user is moving into a submenu. It calculates the
841
- * trajectory of the user's mouse movement in the current menu to determine if the
842
- * mouse is moving towards an open submenu.
843
- *
844
- * The determination is made by calculating the slope of the users last NUM_POINTS moves where each
845
- * pair of points determines if the trajectory line points into the submenu. It uses consensus
846
- * approach by checking if at least NUM_POINTS / 2 pairs determine that the user is moving towards
847
- * to submenu.
848
- */
849
- export declare class TargetMenuAim implements MenuAim, OnDestroy {
850
- private readonly _ngZone;
851
- private readonly _renderer;
852
- private _cleanupMousemove;
853
- /** The last NUM_POINTS mouse move events. */
854
- private readonly _points;
855
- /** Reference to the root menu in which we are tracking mouse moves. */
856
- private _menu;
857
- /** Reference to the root menu's mouse manager. */
858
- private _pointerTracker;
859
- /** The id associated with the current timeout call waiting to resolve. */
860
- private _timeoutId;
861
- /** Emits when this service is destroyed. */
862
- private readonly _destroyed;
863
- ngOnDestroy(): void;
864
- /**
865
- * Set the Menu and its PointerFocusTracker.
866
- * @param menu The menu that this menu aim service controls.
867
- * @param pointerTracker The `PointerFocusTracker` for the given menu.
868
- */
869
- initialize(menu: Menu, pointerTracker: PointerFocusTracker<FocusableElement & Toggler>): void;
870
- /**
871
- * Calls the `doToggle` callback when it is deemed that the user is not moving towards
872
- * the submenu.
873
- * @param doToggle the function called when the user is not moving towards the submenu.
874
- */
875
- toggle(doToggle: () => void): void;
876
- /**
877
- * Start the delayed toggle handler if one isn't running already.
878
- *
879
- * The delayed toggle handler executes the `doToggle` callback after some period of time iff the
880
- * users mouse is on an item in the current menu.
881
- *
882
- * @param doToggle the function called when the user is not moving towards the submenu.
883
- */
884
- private _startTimeout;
885
- /** Whether the user is heading towards the open submenu. */
886
- private _isMovingToSubmenu;
887
- /** Get the bounding DOMRect for the open submenu. */
888
- private _getSubmenuBounds;
889
- /**
890
- * Check if a reference to the PointerFocusTracker and menu element is provided.
891
- * @throws an error if neither reference is provided.
795
+ * Open the attached menu at the specified location.
796
+ * @param userEvent User-generated event that opened the menu
797
+ * @param coordinates where to open the context menu
892
798
  */
893
- private _checkConfigured;
894
- /** Subscribe to the root menus mouse move events and update the tracked mouse points. */
895
- private _subscribeToMouseMoves;
896
- static ɵfac: i0.ɵɵFactoryDeclaration<TargetMenuAim, never>;
897
- static ɵprov: i0.ɵɵInjectableDeclaration<TargetMenuAim>;
799
+ private _open;
800
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkContextMenuTrigger, never>;
801
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkContextMenuTrigger, "[cdkContextMenuTriggerFor]", ["cdkContextMenuTriggerFor"], { "menuTemplateRef": { "alias": "cdkContextMenuTriggerFor"; "required": false; }; "menuPosition": { "alias": "cdkContextMenuPosition"; "required": false; }; "menuData": { "alias": "cdkContextMenuTriggerData"; "required": false; }; "disabled": { "alias": "cdkContextMenuDisabled"; "required": false; }; }, { "opened": "cdkContextMenuOpened"; "closed": "cdkContextMenuClosed"; }, never, never, true, never>;
802
+ static ngAcceptInputType_disabled: unknown;
898
803
  }
899
804
 
900
- /** An element which when hovered over may open or close a menu. */
901
- export declare interface Toggler {
902
- /** Gets the open menu, or undefined if no menu is open. */
903
- getMenu(): Menu | undefined;
805
+ /** Module that declares components and directives for the CDK menu. */
806
+ declare class CdkMenuModule {
807
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuModule, never>;
808
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CdkMenuModule, never, [typeof i1.OverlayModule, typeof CdkMenuBar, typeof CdkMenu, typeof CdkMenuItem, typeof CdkMenuItemRadio, typeof CdkMenuItemCheckbox, typeof CdkMenuTrigger, typeof CdkMenuGroup, typeof CdkContextMenuTrigger, typeof CdkTargetMenuAim], [typeof CdkMenuBar, typeof CdkMenu, typeof CdkMenuItem, typeof CdkMenuItemRadio, typeof CdkMenuItemCheckbox, typeof CdkMenuTrigger, typeof CdkMenuGroup, typeof CdkContextMenuTrigger, typeof CdkTargetMenuAim]>;
809
+ static ɵinj: i0.ɵɵInjectorDeclaration<CdkMenuModule>;
904
810
  }
905
811
 
906
- export { }
812
+ export { CDK_MENU, CdkContextMenuTrigger, CdkMenu, CdkMenuBar, CdkMenuBase, CdkMenuGroup, CdkMenuItem, CdkMenuItemCheckbox, CdkMenuItemRadio, CdkMenuItemSelectable, CdkMenuModule, CdkMenuTrigger, CdkMenuTriggerBase, CdkTargetMenuAim, type CloseOptions, type ContextMenuCoordinates, ContextMenuTracker, FocusNext, type FocusableElement, MENU_AIM, MENU_SCROLL_STRATEGY, MENU_STACK, MENU_TRIGGER, type Menu, type MenuAim, MenuStack, type MenuStackCloseEvent, type MenuStackItem, PARENT_OR_NEW_INLINE_MENU_STACK_PROVIDER, PARENT_OR_NEW_MENU_STACK_PROVIDER, PointerFocusTracker, TargetMenuAim, type Toggler };