1 | import { AfterContentInit } from '@angular/core';
|
2 | import { BooleanInput } from '@angular/cdk/coercion';
|
3 | import { ConnectedPosition } from '@angular/cdk/overlay';
|
4 | import { Directionality } from '@angular/cdk/bidi';
|
5 | import { ElementRef } from '@angular/core';
|
6 | import { EventEmitter } from '@angular/core';
|
7 | import { FocusableOption } from '@angular/cdk/a11y';
|
8 | import { FocusKeyManager } from '@angular/cdk/a11y';
|
9 | import { FocusOrigin } from '@angular/cdk/a11y';
|
10 | import * as i0 from '@angular/core';
|
11 | import * as i1 from '@angular/cdk/overlay';
|
12 | import { InjectionToken } from '@angular/core';
|
13 | import { Injector } from '@angular/core';
|
14 | import { NgZone } from '@angular/core';
|
15 | import { Observable } from 'rxjs';
|
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 { Subject } from 'rxjs';
|
21 | import { TemplatePortal } from '@angular/cdk/portal';
|
22 | import { TemplateRef } from '@angular/core';
|
23 | import { ViewContainerRef } from '@angular/core';
|
24 |
|
25 |
|
26 | export declare const CDK_MENU: InjectionToken<Menu>;
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 | export declare class CdkContextMenuTrigger extends CdkMenuTriggerBase implements OnDestroy {
|
33 |
|
34 | private readonly _overlay;
|
35 |
|
36 | private readonly _directionality;
|
37 |
|
38 | private readonly _contextMenuTracker;
|
39 |
|
40 | get disabled(): boolean;
|
41 | set disabled(value: BooleanInput);
|
42 | private _disabled;
|
43 | constructor();
|
44 | /**
|
45 | * Open the attached menu at the specified location.
|
46 | * @param coordinates where to open the context menu
|
47 | */
|
48 | open(coordinates: ContextMenuCoordinates): void;
|
49 | /** Close the currently opened context menu. */
|
50 | close(): void;
|
51 | /**
|
52 | * Open the context menu and closes any previously open menus.
|
53 | * @param event the mouse event which opens the context menu.
|
54 | */
|
55 | _openOnContextMenu(event: MouseEvent): void;
|
56 | /**
|
57 | * Get the configuration object used to create the overlay.
|
58 | * @param coordinates the location to place the opened menu
|
59 | */
|
60 | private _getOverlayConfig;
|
61 | /**
|
62 | * Get the position strategy for the overlay which specifies where to place the menu.
|
63 | * @param coordinates the location to place the opened menu
|
64 | */
|
65 | private _getOverlayPositionStrategy;
|
66 | /** Subscribe to the menu stack close events and close this menu when requested. */
|
67 | private _setMenuStackCloseListener;
|
68 | /**
|
69 | * Subscribe to the overlays outside pointer events stream and handle closing out the stack if a
|
70 | * click occurs outside the menus.
|
71 | * @param ignoreFirstAuxClick Whether to ignore the first auxclick event outside the menu.
|
72 | */
|
73 | private _subscribeToOutsideClicks;
|
74 | /**
|
75 | * Open the attached menu at the specified location.
|
76 | * @param coordinates where to open the context menu
|
77 | * @param ignoreFirstOutsideAuxClick Whether to ignore the first auxclick outside the menu after opening.
|
78 | */
|
79 | private _open;
|
80 | static ɵfac: i0.ɵɵFactoryDeclaration<CdkContextMenuTrigger, never>;
|
81 | 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>;
|
82 | }
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 | export declare class CdkMenu extends CdkMenuBase implements AfterContentInit, OnDestroy {
|
92 | private _parentTrigger;
|
93 |
|
94 | readonly closed: EventEmitter<void>;
|
95 |
|
96 | readonly orientation = "vertical";
|
97 |
|
98 | readonly isInline: boolean;
|
99 | constructor();
|
100 | ngAfterContentInit(): void;
|
101 | ngOnDestroy(): void;
|
102 | /**
|
103 | * Handle keyboard events for the Menu.
|
104 | * @param event The keyboard event to be handled.
|
105 | */
|
106 | _handleKeyEvent(event: KeyboardEvent): void;
|
107 | /**
|
108 | * Set focus the either the current, previous or next item based on the FocusNext event.
|
109 | * @param focusNext The element to focus.
|
110 | */
|
111 | private _toggleMenuFocus;
|
112 | /** Subscribe to the MenuStack emptied events. */
|
113 | private _subscribeToMenuStackEmptied;
|
114 | static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenu, never>;
|
115 | static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenu, "[cdkMenu]", ["cdkMenu"], {}, { "closed": "closed"; }, never, never, true, never>;
|
116 | }
|
117 |
|
118 |
|
119 |
|
120 |
|
121 |
|
122 |
|
123 |
|
124 | export declare class CdkMenuBar extends CdkMenuBase implements AfterContentInit {
|
125 |
|
126 | readonly orientation = "horizontal";
|
127 |
|
128 | readonly isInline = true;
|
129 | ngAfterContentInit(): void;
|
130 | |
131 |
|
132 |
|
133 |
|
134 | _handleKeyEvent(event: KeyboardEvent): void;
|
135 | |
136 |
|
137 |
|
138 |
|
139 |
|
140 | private _toggleOpenMenu;
|
141 |
|
142 | private _subscribeToMenuStackEmptied;
|
143 | static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuBar, never>;
|
144 | static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuBar, "[cdkMenuBar]", ["cdkMenuBar"], {}, {}, never, never, true, never>;
|
145 | }
|
146 |
|
147 |
|
148 |
|
149 |
|
150 |
|
151 | export declare abstract class CdkMenuBase extends CdkMenuGroup implements Menu, AfterContentInit, OnDestroy {
|
152 |
|
153 | readonly nativeElement: HTMLElement;
|
154 |
|
155 | protected ngZone: NgZone;
|
156 |
|
157 | readonly menuStack: MenuStack;
|
158 |
|
159 | protected readonly menuAim: MenuAim | null;
|
160 |
|
161 | protected readonly dir: Directionality | null;
|
162 |
|
163 | id: string;
|
164 |
|
165 | readonly items: QueryList<CdkMenuItem>;
|
166 |
|
167 | orientation: 'horizontal' | 'vertical';
|
168 | |
169 |
|
170 |
|
171 |
|
172 | isInline: boolean;
|
173 |
|
174 | protected keyManager: FocusKeyManager<CdkMenuItem>;
|
175 |
|
176 | protected readonly destroyed: Subject<void>;
|
177 |
|
178 | protected triggerItem?: CdkMenuItem;
|
179 |
|
180 | protected pointerTracker?: PointerFocusTracker<CdkMenuItem>;
|
181 |
|
182 | private _menuStackHasFocus;
|
183 | ngAfterContentInit(): void;
|
184 | ngOnDestroy(): void;
|
185 | |
186 |
|
187 |
|
188 |
|
189 | focusFirstItem(focusOrigin?: FocusOrigin): void;
|
190 | |
191 |
|
192 |
|
193 |
|
194 | focusLastItem(focusOrigin?: FocusOrigin): void;
|
195 |
|
196 | _getTabIndex(): 0 | -1 | null;
|
197 | |
198 |
|
199 |
|
200 |
|
201 |
|
202 |
|
203 | protected closeOpenMenu(menu: MenuStackItem, options?: {
|
204 | focusParentTrigger?: boolean;
|
205 | }): void;
|
206 |
|
207 | private _setKeyManager;
|
208 | |
209 |
|
210 |
|
211 |
|
212 | private _subscribeToMenuOpen;
|
213 |
|
214 | private _subscribeToMenuStackClosed;
|
215 |
|
216 | private _subscribeToMenuStackHasFocus;
|
217 | |
218 |
|
219 |
|
220 |
|
221 | private _setUpPointerTracker;
|
222 | static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuBase, never>;
|
223 | static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuBase, never, never, { "id": { "alias": "id"; "required": false; }; }, {}, ["items"], never, false, never>;
|
224 | }
|
225 |
|
226 |
|
227 |
|
228 |
|
229 | export declare class CdkMenuGroup {
|
230 | static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuGroup, never>;
|
231 | static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuGroup, "[cdkMenuGroup]", ["cdkMenuGroup"], {}, {}, never, never, true, never>;
|
232 | }
|
233 |
|
234 |
|
235 |
|
236 |
|
237 |
|
238 |
|
239 | export declare class CdkMenuItem implements FocusableOption, FocusableElement, Toggler, OnDestroy {
|
240 | protected readonly _dir: Directionality | null;
|
241 | private readonly _inputModalityDetector;
|
242 | readonly _elementRef: ElementRef<HTMLElement>;
|
243 | protected _ngZone: NgZone;
|
244 |
|
245 | private readonly _menuAim;
|
246 |
|
247 | private readonly _menuStack;
|
248 |
|
249 | private readonly _parentMenu;
|
250 |
|
251 | private readonly _menuTrigger;
|
252 |
|
253 | get disabled(): boolean;
|
254 | set disabled(value: BooleanInput);
|
255 | private _disabled;
|
256 | |
257 |
|
258 |
|
259 |
|
260 | typeaheadLabel: string | null;
|
261 | |
262 |
|
263 |
|
264 |
|
265 | readonly triggered: EventEmitter<void>;
|
266 |
|
267 | get hasMenu(): boolean;
|
268 | |
269 |
|
270 |
|
271 |
|
272 | _tabindex: 0 | -1;
|
273 |
|
274 | protected closeOnSpacebarTrigger: boolean;
|
275 |
|
276 | protected readonly destroyed: Subject<void>;
|
277 | constructor();
|
278 | ngOnDestroy(): void;
|
279 | /** Place focus on the element. */
|
280 | focus(): void;
|
281 | /**
|
282 | * If the menu item is not disabled and the element does not have a menu trigger attached, emit
|
283 | * on the cdkMenuItemTriggered emitter and close all open menus.
|
284 | * @param options Options the configure how the item is triggered
|
285 | * - keepOpen: specifies that the menu should be kept open after triggering the item.
|
286 | */
|
287 | trigger(options?: {
|
288 | keepOpen: boolean;
|
289 | }): void;
|
290 | /** Return true if this MenuItem has an attached menu and it is open. */
|
291 | isMenuOpen(): boolean;
|
292 | /**
|
293 | * Get a reference to the rendered Menu if the Menu is open and it is visible in the DOM.
|
294 | * @return the menu if it is open, otherwise undefined.
|
295 | */
|
296 | getMenu(): Menu | undefined;
|
297 | /** Get the CdkMenuTrigger associated with this element. */
|
298 | getMenuTrigger(): CdkMenuTrigger | null;
|
299 | /** Get the label for this element which is required by the FocusableOption interface. */
|
300 | getLabel(): string;
|
301 | /** Reset the tabindex to -1. */
|
302 | _resetTabIndex(): void;
|
303 | /**
|
304 | * Set the tab index to 0 if not disabled and it's a focus event, or a mouse enter if this element
|
305 | * is not in a menu bar.
|
306 | */
|
307 | _setTabIndex(event?: MouseEvent): void;
|
308 | /**
|
309 | * Handles keyboard events for the menu item, specifically either triggering the user defined
|
310 | * callback or opening/closing the current menu based on whether the left or right arrow key was
|
311 | * pressed.
|
312 | * @param event the keyboard event to handle
|
313 | */
|
314 | _onKeydown(event: KeyboardEvent): void;
|
315 | /** Handles clicks on the menu item. */
|
316 | _handleClick(): void;
|
317 | /** Whether this menu item is standalone or within a menu or menu bar. */
|
318 | private _isStandaloneItem;
|
319 | /**
|
320 | * Handles the user pressing the back arrow key.
|
321 | * @param event The keyboard event.
|
322 | */
|
323 | private _backArrowPressed;
|
324 | /**
|
325 | * Handles the user pressing the forward arrow key.
|
326 | * @param event The keyboard event.
|
327 | */
|
328 | private _forwardArrowPressed;
|
329 | /**
|
330 | * Subscribe to the mouseenter events and close any sibling menu items if this element is moused
|
331 | * into.
|
332 | */
|
333 | private _setupMouseEnter;
|
334 | /**
|
335 | * Return true if the enclosing parent menu is configured in a horizontal orientation, false
|
336 | * otherwise or if no parent.
|
337 | */
|
338 | private _isParentVertical;
|
339 | /** Sets the `type` attribute of the menu item. */
|
340 | private _setType;
|
341 | static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuItem, never>;
|
342 | static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuItem, "[cdkMenuItem]", ["cdkMenuItem"], { "disabled": { "alias": "cdkMenuItemDisabled"; "required": false; }; "typeaheadLabel": { "alias": "cdkMenuitemTypeaheadLabel"; "required": false; }; }, { "triggered": "cdkMenuItemTriggered"; }, never, never, true, never>;
|
343 | }
|
344 |
|
345 |
|
346 |
|
347 |
|
348 |
|
349 | export declare class CdkMenuItemCheckbox extends CdkMenuItemSelectable {
|
350 | |
351 |
|
352 |
|
353 |
|
354 |
|
355 | trigger(options?: {
|
356 | keepOpen: boolean;
|
357 | }): void;
|
358 | static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuItemCheckbox, never>;
|
359 | static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuItemCheckbox, "[cdkMenuItemCheckbox]", ["cdkMenuItemCheckbox"], {}, {}, never, never, true, never>;
|
360 | }
|
361 |
|
362 |
|
363 |
|
364 |
|
365 |
|
366 |
|
367 | export declare class CdkMenuItemRadio extends CdkMenuItemSelectable implements OnDestroy {
|
368 |
|
369 | private readonly _selectionDispatcher;
|
370 |
|
371 | private _id;
|
372 |
|
373 | private _removeDispatcherListener;
|
374 | constructor();
|
375 | ngOnDestroy(): void;
|
376 | /**
|
377 | * Toggles the checked state of the radio-button.
|
378 | * @param options Options the configure how the item is triggered
|
379 | * - keepOpen: specifies that the menu should be kept open after triggering the item.
|
380 | */
|
381 | trigger(options?: {
|
382 | keepOpen: boolean;
|
383 | }): void;
|
384 | /** Configure the unique selection dispatcher listener in order to toggle the checked state */
|
385 | private _registerDispatcherListener;
|
386 | static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuItemRadio, never>;
|
387 | static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuItemRadio, "[cdkMenuItemRadio]", ["cdkMenuItemRadio"], {}, {}, never, never, true, never>;
|
388 | }
|
389 |
|
390 |
|
391 | export declare abstract class CdkMenuItemSelectable extends CdkMenuItem {
|
392 |
|
393 | get checked(): boolean;
|
394 | set checked(value: BooleanInput);
|
395 | private _checked;
|
396 |
|
397 | protected closeOnSpacebarTrigger: boolean;
|
398 | static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuItemSelectable, never>;
|
399 | static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuItemSelectable, never, never, { "checked": { "alias": "cdkMenuItemChecked"; "required": false; }; }, {}, never, never, false, never>;
|
400 | }
|
401 |
|
402 |
|
403 | export declare class CdkMenuModule {
|
404 | static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuModule, never>;
|
405 | 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]>;
|
406 | static ɵinj: i0.ɵɵInjectorDeclaration<CdkMenuModule>;
|
407 | }
|
408 |
|
409 |
|
410 |
|
411 |
|
412 |
|
413 |
|
414 |
|
415 |
|
416 | export declare class CdkMenuTrigger extends CdkMenuTriggerBase implements OnDestroy {
|
417 | private readonly _elementRef;
|
418 | private readonly _overlay;
|
419 | private readonly _ngZone;
|
420 | private readonly _directionality;
|
421 | private readonly _inputModalityDetector;
|
422 |
|
423 | private readonly _parentMenu;
|
424 |
|
425 | private readonly _menuAim;
|
426 | constructor();
|
427 | /** Toggle the attached menu. */
|
428 | toggle(): void;
|
429 | /** Open the attached menu. */
|
430 | open(): void;
|
431 | /** Close the opened menu. */
|
432 | close(): void;
|
433 | /**
|
434 | * Get a reference to the rendered Menu if the Menu is open and rendered in the DOM.
|
435 | */
|
436 | getMenu(): Menu | undefined;
|
437 | /**
|
438 | * Handles keyboard events for the menu item.
|
439 | * @param event The keyboard event to handle
|
440 | */
|
441 | _toggleOnKeydown(event: KeyboardEvent): void;
|
442 | /** Handles clicks on the menu trigger. */
|
443 | _handleClick(): void;
|
444 | /**
|
445 | * Sets whether the trigger's menu stack has focus.
|
446 | * @param hasFocus Whether the menu stack has focus.
|
447 | */
|
448 | _setHasFocus(hasFocus: boolean): void;
|
449 | /**
|
450 | * Subscribe to the mouseenter events and close any sibling menu items if this element is moused
|
451 | * into.
|
452 | */
|
453 | private _subscribeToMouseEnter;
|
454 | /** Close out any sibling menu trigger menus. */
|
455 | private _closeSiblingTriggers;
|
456 | /** Get the configuration object used to create the overlay. */
|
457 | private _getOverlayConfig;
|
458 | /** Build the position strategy for the overlay which specifies where to place the menu. */
|
459 | private _getOverlayPositionStrategy;
|
460 | /** Get the preferred positions for the opened menu relative to the menu item. */
|
461 | private _getOverlayPositions;
|
462 | /**
|
463 | * Subscribe to the MenuStack close events if this is a standalone trigger and close out the menu
|
464 | * this triggers when requested.
|
465 | */
|
466 | private _registerCloseHandler;
|
467 | /**
|
468 | * Subscribe to the overlays outside pointer events stream and handle closing out the stack if a
|
469 | * click occurs outside the menus.
|
470 | */
|
471 | private _subscribeToOutsideClicks;
|
472 | /** Subscribe to the MenuStack hasFocus events. */
|
473 | private _subscribeToMenuStackHasFocus;
|
474 | /** Subscribe to the MenuStack closed events. */
|
475 | private _subscribeToMenuStackClosed;
|
476 | /** Sets the role attribute for this trigger if needed. */
|
477 | private _setRole;
|
478 | /** Sets thte `type` attribute of the trigger. */
|
479 | private _setType;
|
480 | static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuTrigger, never>;
|
481 | 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>;
|
482 | }
|
483 |
|
484 |
|
485 |
|
486 |
|
487 |
|
488 | export declare abstract class CdkMenuTriggerBase implements OnDestroy {
|
489 |
|
490 | readonly injector: Injector;
|
491 |
|
492 | protected readonly viewContainerRef: ViewContainerRef;
|
493 |
|
494 | protected readonly menuStack: MenuStack;
|
495 | |
496 |
|
497 |
|
498 |
|
499 | menuPosition: ConnectedPosition[];
|
500 |
|
501 | readonly opened: EventEmitter<void>;
|
502 |
|
503 | readonly closed: EventEmitter<void>;
|
504 |
|
505 | menuTemplateRef: TemplateRef<unknown> | null;
|
506 |
|
507 | menuData: unknown;
|
508 |
|
509 | protected overlayRef: OverlayRef | null;
|
510 |
|
511 | protected readonly destroyed: Subject<void>;
|
512 |
|
513 | protected readonly stopOutsideClicksListener: Observable<void>;
|
514 |
|
515 | protected childMenu?: Menu;
|
516 |
|
517 | private _menuPortal;
|
518 |
|
519 | private _childMenuInjector?;
|
520 | ngOnDestroy(): void;
|
521 |
|
522 | isOpen(): boolean;
|
523 |
|
524 | registerChildMenu(child: Menu): void;
|
525 | |
526 |
|
527 |
|
528 |
|
529 | protected getMenuContentPortal(): TemplatePortal<any>;
|
530 | |
531 |
|
532 |
|
533 |
|
534 |
|
535 | protected isElementInsideMenuStack(element: Element): boolean;
|
536 |
|
537 | private _destroyOverlay;
|
538 |
|
539 | private _getChildMenuInjector;
|
540 | static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuTriggerBase, never>;
|
541 | static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuTriggerBase, never, never, {}, {}, never, never, false, never>;
|
542 | }
|
543 |
|
544 |
|
545 |
|
546 |
|
547 |
|
548 | export declare class CdkTargetMenuAim {
|
549 | static ɵfac: i0.ɵɵFactoryDeclaration<CdkTargetMenuAim, never>;
|
550 | static ɵdir: i0.ɵɵDirectiveDeclaration<CdkTargetMenuAim, "[cdkTargetMenuAim]", ["cdkTargetMenuAim"], {}, {}, never, never, true, never>;
|
551 | }
|
552 |
|
553 |
|
554 | export declare interface CloseOptions {
|
555 |
|
556 | focusNextOnEmpty?: FocusNext;
|
557 |
|
558 | focusParentTrigger?: boolean;
|
559 | }
|
560 |
|
561 |
|
562 | export declare type ContextMenuCoordinates = {
|
563 | x: number;
|
564 | y: number;
|
565 | };
|
566 |
|
567 |
|
568 | export declare class ContextMenuTracker {
|
569 |
|
570 | private static _openContextMenuTrigger?;
|
571 | |
572 |
|
573 |
|
574 |
|
575 | update(trigger: CdkContextMenuTrigger): void;
|
576 | static ɵfac: i0.ɵɵFactoryDeclaration<ContextMenuTracker, never>;
|
577 | static ɵprov: i0.ɵɵInjectableDeclaration<ContextMenuTracker>;
|
578 | }
|
579 |
|
580 |
|
581 | export declare interface FocusableElement {
|
582 |
|
583 | _elementRef: ElementRef<HTMLElement>;
|
584 | }
|
585 |
|
586 |
|
587 | export declare const enum FocusNext {
|
588 | nextItem = 0,
|
589 | previousItem = 1,
|
590 | currentItem = 2
|
591 | }
|
592 |
|
593 | declare namespace i10 {
|
594 | export {
|
595 | MenuAim,
|
596 | MENU_AIM,
|
597 | Toggler,
|
598 | TargetMenuAim,
|
599 | CdkTargetMenuAim
|
600 | }
|
601 | }
|
602 |
|
603 | declare namespace i2 {
|
604 | export {
|
605 | CdkMenuBar
|
606 | }
|
607 | }
|
608 |
|
609 | declare namespace i3 {
|
610 | export {
|
611 | CdkMenu
|
612 | }
|
613 | }
|
614 |
|
615 | declare namespace i4 {
|
616 | export {
|
617 | CdkMenuItem
|
618 | }
|
619 | }
|
620 |
|
621 | declare namespace i5 {
|
622 | export {
|
623 | CdkMenuItemRadio
|
624 | }
|
625 | }
|
626 |
|
627 | declare namespace i6 {
|
628 | export {
|
629 | CdkMenuItemCheckbox
|
630 | }
|
631 | }
|
632 |
|
633 | declare namespace i7 {
|
634 | export {
|
635 | CdkMenuTrigger
|
636 | }
|
637 | }
|
638 |
|
639 | declare namespace i8 {
|
640 | export {
|
641 | CdkMenuGroup
|
642 | }
|
643 | }
|
644 |
|
645 | declare namespace i9 {
|
646 | export {
|
647 | ContextMenuTracker,
|
648 | ContextMenuCoordinates,
|
649 | CdkContextMenuTrigger
|
650 | }
|
651 | }
|
652 |
|
653 |
|
654 | export declare interface Menu extends MenuStackItem {
|
655 |
|
656 | id: string;
|
657 |
|
658 | nativeElement: HTMLElement;
|
659 |
|
660 | readonly orientation: 'horizontal' | 'vertical';
|
661 |
|
662 | focusFirstItem(focusOrigin: FocusOrigin): void;
|
663 |
|
664 | focusLastItem(focusOrigin: FocusOrigin): void;
|
665 | }
|
666 |
|
667 |
|
668 | export declare const MENU_AIM: InjectionToken<MenuAim>;
|
669 |
|
670 |
|
671 | export declare const MENU_STACK: InjectionToken<MenuStack>;
|
672 |
|
673 |
|
674 | export declare const MENU_TRIGGER: InjectionToken<CdkMenuTriggerBase>;
|
675 |
|
676 |
|
677 |
|
678 |
|
679 |
|
680 |
|
681 | export declare interface MenuAim {
|
682 | |
683 |
|
684 |
|
685 |
|
686 |
|
687 | initialize(menu: Menu, pointerTracker: PointerFocusTracker<FocusableElement & Toggler>): void;
|
688 | |
689 |
|
690 |
|
691 |
|
692 |
|
693 | toggle(doToggle: () => void): void;
|
694 | }
|
695 |
|
696 |
|
697 |
|
698 |
|
699 |
|
700 |
|
701 |
|
702 | export declare class MenuStack {
|
703 |
|
704 | readonly id: string;
|
705 |
|
706 | private readonly _elements;
|
707 |
|
708 | private readonly _close;
|
709 |
|
710 | private readonly _empty;
|
711 |
|
712 | private readonly _hasFocus;
|
713 |
|
714 | readonly closed: Observable<MenuStackCloseEvent>;
|
715 |
|
716 | readonly hasFocus: Observable<boolean>;
|
717 | |
718 |
|
719 |
|
720 |
|
721 |
|
722 | readonly emptied: Observable<FocusNext | undefined>;
|
723 | |
724 |
|
725 |
|
726 |
|
727 | private _inlineMenuOrientation;
|
728 |
|
729 | static inline(orientation: 'vertical' | 'horizontal'): MenuStack;
|
730 | |
731 |
|
732 |
|
733 |
|
734 | push(menu: MenuStackItem): void;
|
735 | |
736 |
|
737 |
|
738 |
|
739 |
|
740 |
|
741 | close(lastItem: MenuStackItem, options?: CloseOptions): void;
|
742 | |
743 |
|
744 |
|
745 |
|
746 |
|
747 |
|
748 | closeSubMenuOf(lastItem: MenuStackItem): boolean;
|
749 | |
750 |
|
751 |
|
752 |
|
753 | closeAll(options?: CloseOptions): void;
|
754 |
|
755 | isEmpty(): boolean;
|
756 |
|
757 | length(): number;
|
758 |
|
759 | peek(): MenuStackItem | undefined;
|
760 |
|
761 | hasInlineMenu(): boolean;
|
762 |
|
763 | inlineMenuOrientation(): "vertical" | "horizontal" | null;
|
764 |
|
765 | setHasFocus(hasFocus: boolean): void;
|
766 | static ɵfac: i0.ɵɵFactoryDeclaration<MenuStack, never>;
|
767 | static ɵprov: i0.ɵɵInjectableDeclaration<MenuStack>;
|
768 | }
|
769 |
|
770 |
|
771 | export declare interface MenuStackCloseEvent {
|
772 |
|
773 | item: MenuStackItem;
|
774 |
|
775 | focusParentTrigger?: boolean;
|
776 | }
|
777 |
|
778 |
|
779 | export declare interface MenuStackItem {
|
780 |
|
781 | menuStack?: MenuStack;
|
782 | }
|
783 |
|
784 |
|
785 | export declare const PARENT_OR_NEW_INLINE_MENU_STACK_PROVIDER: (orientation: 'vertical' | 'horizontal') => {
|
786 | provide: InjectionToken<MenuStack>;
|
787 | deps: Optional[][];
|
788 | useFactory: (parentMenuStack?: MenuStack) => MenuStack;
|
789 | };
|
790 |
|
791 |
|
792 | export declare const PARENT_OR_NEW_MENU_STACK_PROVIDER: {
|
793 | provide: InjectionToken<MenuStack>;
|
794 | deps: Optional[][];
|
795 | useFactory: (parentMenuStack?: MenuStack) => MenuStack;
|
796 | };
|
797 |
|
798 |
|
799 |
|
800 |
|
801 |
|
802 | export declare class PointerFocusTracker<T extends FocusableElement> {
|
803 |
|
804 | private readonly _items;
|
805 |
|
806 | readonly entered: Observable<T>;
|
807 |
|
808 | readonly exited: Observable<T>;
|
809 |
|
810 | activeElement?: T;
|
811 |
|
812 | previousElement?: T;
|
813 |
|
814 | private readonly _destroyed;
|
815 | constructor(
|
816 |
|
817 | _items: QueryList<T>);
|
818 | /** Stop the managers listeners. */
|
819 | destroy(): void;
|
820 | /**
|
821 | * Gets a stream of pointer (mouse) entries into the given items.
|
822 | * This should typically run outside the Angular zone.
|
823 | */
|
824 | private _getItemPointerEntries;
|
825 | /**
|
826 | * Gets a stream of pointer (mouse) exits out of the given items.
|
827 | * This should typically run outside the Angular zone.
|
828 | */
|
829 | private _getItemPointerExits;
|
830 | }
|
831 |
|
832 | /**
|
833 | * TargetMenuAim predicts if a user is moving into a submenu. It calculates the
|
834 | * trajectory of the user's mouse movement in the current menu to determine if the
|
835 | * mouse is moving towards an open submenu.
|
836 | *
|
837 | * The determination is made by calculating the slope of the users last NUM_POINTS moves where each
|
838 | * pair of points determines if the trajectory line points into the submenu. It uses consensus
|
839 | * approach by checking if at least NUM_POINTS / 2 pairs determine that the user is moving towards
|
840 | * to submenu.
|
841 | */
|
842 | export declare class TargetMenuAim implements MenuAim, OnDestroy {
|
843 |
|
844 | private readonly _ngZone;
|
845 |
|
846 | private readonly _points;
|
847 |
|
848 | private _menu;
|
849 |
|
850 | private _pointerTracker;
|
851 |
|
852 | private _timeoutId;
|
853 |
|
854 | private readonly _destroyed;
|
855 | ngOnDestroy(): void;
|
856 | |
857 |
|
858 |
|
859 |
|
860 |
|
861 | initialize(menu: Menu, pointerTracker: PointerFocusTracker<FocusableElement & Toggler>): void;
|
862 | |
863 |
|
864 |
|
865 |
|
866 |
|
867 | toggle(doToggle: () => void): void;
|
868 | |
869 |
|
870 |
|
871 |
|
872 |
|
873 |
|
874 |
|
875 |
|
876 | private _startTimeout;
|
877 |
|
878 | private _isMovingToSubmenu;
|
879 |
|
880 | private _getSubmenuBounds;
|
881 | |
882 |
|
883 |
|
884 |
|
885 | private _checkConfigured;
|
886 |
|
887 | private _subscribeToMouseMoves;
|
888 | static ɵfac: i0.ɵɵFactoryDeclaration<TargetMenuAim, never>;
|
889 | static ɵprov: i0.ɵɵInjectableDeclaration<TargetMenuAim>;
|
890 | }
|
891 |
|
892 |
|
893 | export declare interface Toggler {
|
894 |
|
895 | getMenu(): Menu | undefined;
|
896 | }
|
897 |
|
898 | export { }
|