@angular/cdk-experimental 14.0.0-next.8 → 14.0.0-next.9

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 (95) hide show
  1. package/dialog/dialog-config.d.ts +6 -1
  2. package/esm2020/column-resize/column-resize-directives/column-resize-flex.mjs +3 -3
  3. package/esm2020/column-resize/column-resize-directives/column-resize.mjs +3 -3
  4. package/esm2020/column-resize/column-resize-directives/default-enabled-column-resize-flex.mjs +3 -3
  5. package/esm2020/column-resize/column-resize-directives/default-enabled-column-resize.mjs +3 -3
  6. package/esm2020/column-resize/column-resize-module.mjs +8 -8
  7. package/esm2020/column-resize/column-resize-notifier.mjs +6 -6
  8. package/esm2020/column-resize/column-resize.mjs +3 -3
  9. package/esm2020/column-resize/column-size-store.mjs +3 -3
  10. package/esm2020/column-resize/event-dispatcher.mjs +3 -3
  11. package/esm2020/column-resize/overlay-handle.mjs +3 -3
  12. package/esm2020/column-resize/resizable.mjs +3 -3
  13. package/esm2020/column-resize/resize-strategy.mjs +9 -9
  14. package/esm2020/combobox/combobox-module.mjs +4 -4
  15. package/esm2020/combobox/combobox-popup.mjs +3 -3
  16. package/esm2020/combobox/combobox.mjs +3 -3
  17. package/esm2020/dialog/dialog-config.mjs +1 -1
  18. package/esm2020/dialog/dialog-container.mjs +5 -5
  19. package/esm2020/dialog/dialog-module.mjs +4 -4
  20. package/esm2020/dialog/dialog.mjs +5 -5
  21. package/esm2020/listbox/listbox-module.mjs +4 -4
  22. package/esm2020/listbox/listbox.mjs +6 -6
  23. package/esm2020/menu/context-menu.mjs +12 -48
  24. package/esm2020/menu/menu-aim.mjs +6 -6
  25. package/esm2020/menu/menu-bar.mjs +39 -130
  26. package/esm2020/menu/menu-base.mjs +129 -0
  27. package/esm2020/menu/menu-group.mjs +9 -9
  28. package/esm2020/menu/menu-interface.mjs +1 -1
  29. package/esm2020/menu/menu-item-checkbox.mjs +3 -3
  30. package/esm2020/menu/menu-item-radio.mjs +4 -6
  31. package/esm2020/menu/menu-item-selectable.mjs +3 -3
  32. package/esm2020/menu/menu-item-trigger.mjs +30 -90
  33. package/esm2020/menu/menu-item.mjs +36 -22
  34. package/esm2020/menu/menu-module.mjs +4 -4
  35. package/esm2020/menu/menu-stack.mjs +26 -5
  36. package/esm2020/menu/menu-trigger.mjs +35 -8
  37. package/esm2020/menu/menu.mjs +43 -127
  38. package/esm2020/popover-edit/edit-event-dispatcher.mjs +3 -3
  39. package/esm2020/popover-edit/edit-ref.mjs +3 -3
  40. package/esm2020/popover-edit/edit-services.mjs +3 -3
  41. package/esm2020/popover-edit/focus-dispatcher.mjs +3 -3
  42. package/esm2020/popover-edit/focus-escape-notifier.mjs +3 -3
  43. package/esm2020/popover-edit/lens-directives.mjs +9 -9
  44. package/esm2020/popover-edit/popover-edit-module.mjs +4 -4
  45. package/esm2020/popover-edit/popover-edit-position-strategy-factory.mjs +6 -6
  46. package/esm2020/popover-edit/table-directives.mjs +15 -15
  47. package/esm2020/scrolling/auto-size-virtual-scroll.mjs +3 -3
  48. package/esm2020/scrolling/scrolling-module.mjs +4 -4
  49. package/esm2020/selection/row-selection.mjs +3 -3
  50. package/esm2020/selection/select-all.mjs +3 -3
  51. package/esm2020/selection/selection-column.mjs +3 -3
  52. package/esm2020/selection/selection-module.mjs +4 -4
  53. package/esm2020/selection/selection-toggle.mjs +3 -3
  54. package/esm2020/selection/selection.mjs +3 -3
  55. package/esm2020/table-scroll-container/table-scroll-container-module.mjs +4 -4
  56. package/esm2020/table-scroll-container/table-scroll-container.mjs +3 -3
  57. package/esm2020/version.mjs +1 -1
  58. package/fesm2015/cdk-experimental.mjs +1 -1
  59. package/fesm2015/cdk-experimental.mjs.map +1 -1
  60. package/fesm2015/column-resize.mjs +50 -50
  61. package/fesm2015/combobox.mjs +10 -10
  62. package/fesm2015/dialog.mjs +13 -12
  63. package/fesm2015/dialog.mjs.map +1 -1
  64. package/fesm2015/listbox.mjs +10 -10
  65. package/fesm2015/menu.mjs +353 -445
  66. package/fesm2015/menu.mjs.map +1 -1
  67. package/fesm2015/popover-edit.mjs +49 -49
  68. package/fesm2015/scrolling.mjs +7 -7
  69. package/fesm2015/selection.mjs +19 -19
  70. package/fesm2015/table-scroll-container.mjs +7 -7
  71. package/fesm2020/cdk-experimental.mjs +1 -1
  72. package/fesm2020/cdk-experimental.mjs.map +1 -1
  73. package/fesm2020/column-resize.mjs +50 -50
  74. package/fesm2020/combobox.mjs +10 -10
  75. package/fesm2020/dialog.mjs +12 -12
  76. package/fesm2020/dialog.mjs.map +1 -1
  77. package/fesm2020/listbox.mjs +10 -10
  78. package/fesm2020/menu.mjs +345 -435
  79. package/fesm2020/menu.mjs.map +1 -1
  80. package/fesm2020/popover-edit.mjs +49 -49
  81. package/fesm2020/scrolling.mjs +7 -7
  82. package/fesm2020/selection.mjs +19 -19
  83. package/fesm2020/table-scroll-container.mjs +7 -7
  84. package/menu/context-menu.d.ts +3 -24
  85. package/menu/menu-bar.d.ts +9 -50
  86. package/menu/menu-base.d.ts +64 -0
  87. package/menu/menu-group.d.ts +2 -2
  88. package/menu/menu-interface.d.ts +1 -1
  89. package/menu/menu-item-radio.d.ts +2 -2
  90. package/menu/menu-item-trigger.d.ts +4 -27
  91. package/menu/menu-item.d.ts +3 -3
  92. package/menu/menu-stack.d.ts +17 -2
  93. package/menu/menu-trigger.d.ts +29 -5
  94. package/menu/menu.d.ts +9 -49
  95. package/package.json +2 -2
@@ -0,0 +1,64 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ import { CdkMenuGroup } from './menu-group';
9
+ import { AfterContentInit, ElementRef, OnDestroy, QueryList } from '@angular/core';
10
+ import { FocusKeyManager, FocusOrigin } from '@angular/cdk/a11y';
11
+ import { CdkMenuItem } from './menu-item';
12
+ import { Subject } from 'rxjs';
13
+ import { Directionality } from '@angular/cdk/bidi';
14
+ import { MenuStack, MenuStackItem } from './menu-stack';
15
+ import { Menu } from './menu-interface';
16
+ import { PointerFocusTracker } from './pointer-focus-tracker';
17
+ import * as i0 from "@angular/core";
18
+ export declare abstract class CdkMenuBase extends CdkMenuGroup implements Menu, AfterContentInit, OnDestroy {
19
+ readonly _elementRef: ElementRef<HTMLElement>;
20
+ readonly menuStack: MenuStack;
21
+ protected readonly dir?: Directionality | undefined;
22
+ /**
23
+ * Sets the aria-orientation attribute and determines where menus will be opened.
24
+ * Does not affect styling/layout.
25
+ */
26
+ orientation: 'horizontal' | 'vertical';
27
+ /** All child MenuItem elements nested in this Menu. */
28
+ protected readonly items: QueryList<CdkMenuItem>;
29
+ /** Handles keyboard events for the menu. */
30
+ protected keyManager: FocusKeyManager<CdkMenuItem>;
31
+ /** Emits when the MenuBar is destroyed. */
32
+ protected readonly destroyed: Subject<void>;
33
+ /** The Menu Item which triggered the open submenu. */
34
+ protected openItem?: CdkMenuItem;
35
+ /** Manages items under mouse focus */
36
+ protected pointerTracker?: PointerFocusTracker<CdkMenuItem>;
37
+ protected constructor(_elementRef: ElementRef<HTMLElement>, menuStack: MenuStack, dir?: Directionality | undefined);
38
+ ngAfterContentInit(): void;
39
+ ngOnDestroy(): void;
40
+ /** Place focus on the first MenuItem in the menu and set the focus origin. */
41
+ focusFirstItem(focusOrigin?: FocusOrigin): void;
42
+ /** Place focus on the last MenuItem in the menu and set the focus origin. */
43
+ focusLastItem(focusOrigin?: FocusOrigin): void;
44
+ /** Return true if this menu has been configured in a horizontal orientation. */
45
+ protected isHorizontal(): boolean;
46
+ /** Return true if the MenuBar has an open submenu. */
47
+ protected hasOpenSubmenu(): boolean;
48
+ /**
49
+ * Close the open menu if the current active item opened the requested MenuStackItem.
50
+ * @param item the MenuStackItem requested to be closed.
51
+ */
52
+ protected closeOpenMenu(menu: MenuStackItem | undefined): void;
53
+ /** Setup the FocusKeyManager with the correct orientation for the menu. */
54
+ private _setKeyManager;
55
+ /**
56
+ * Subscribe to the menu trigger's open events in order to track the trigger which opened the menu
57
+ * and stop tracking it when the menu is closed.
58
+ */
59
+ private _subscribeToMenuOpen;
60
+ /** Subscribe to the MenuStack close and empty observables. */
61
+ private _subscribeToMenuStackClosed;
62
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuBase, [null, null, { optional: true; }]>;
63
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuBase, never, never, {}, {}, ["items"]>;
64
+ }
@@ -5,7 +5,7 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
- import { EventEmitter, AfterContentInit, OnDestroy } from '@angular/core';
8
+ import { AfterContentInit, EventEmitter, OnDestroy } from '@angular/core';
9
9
  import { CdkMenuItem } from './menu-item';
10
10
  import * as i0 from "@angular/core";
11
11
  /**
@@ -20,6 +20,7 @@ export declare class CdkMenuGroup implements AfterContentInit, OnDestroy {
20
20
  /** Emits when the _selectableItems QueryList triggers a change */
21
21
  private readonly _selectableChanges;
22
22
  ngAfterContentInit(): void;
23
+ ngOnDestroy(): void;
23
24
  /**
24
25
  * Register the child selectable elements with the change emitter and ensure any new child
25
26
  * elements do so as well.
@@ -27,7 +28,6 @@ export declare class CdkMenuGroup implements AfterContentInit, OnDestroy {
27
28
  private _registerMenuSelectionListeners;
28
29
  /** Register each selectable to emit on the change Emitter when clicked */
29
30
  private _registerClickListener;
30
- ngOnDestroy(): void;
31
31
  static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuGroup, never>;
32
32
  static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuGroup, "[cdkMenuGroup]", ["cdkMenuGroup"], {}, { "change": "change"; }, ["_selectableItems"]>;
33
33
  }
@@ -15,7 +15,7 @@ export interface Menu extends MenuStackItem {
15
15
  /** The element the Menu directive is placed on. */
16
16
  _elementRef: ElementRef<HTMLElement>;
17
17
  /** The orientation of the menu */
18
- orientation: 'horizontal' | 'vertical';
18
+ readonly orientation: 'horizontal' | 'vertical';
19
19
  /** Place focus on the first MenuItem in the menu. */
20
20
  focusFirstItem(focusOrigin: FocusOrigin): void;
21
21
  /** Place focus on the last MenuItem in the menu. */
@@ -23,7 +23,7 @@ export declare class CdkMenuItemRadio extends CdkMenuItemSelectable implements O
23
23
  private readonly _selectionDispatcher;
24
24
  /** Function to unregister the selection dispatcher */
25
25
  private _removeDispatcherListener;
26
- constructor(_selectionDispatcher: UniqueSelectionDispatcher, element: ElementRef<HTMLElement>, ngZone: NgZone, menuStack?: MenuStack, parentMenu?: Menu, menuAim?: MenuAim, dir?: Directionality,
26
+ constructor(_selectionDispatcher: UniqueSelectionDispatcher, element: ElementRef<HTMLElement>, ngZone: NgZone, menuStack: MenuStack, parentMenu?: Menu, menuAim?: MenuAim, dir?: Directionality,
27
27
  /** Reference to the CdkMenuItemTrigger directive if one is added to the same element */
28
28
  menuTrigger?: CdkMenuItemTrigger);
29
29
  /** Configure the unique selection dispatcher listener in order to toggle the checked state */
@@ -31,6 +31,6 @@ export declare class CdkMenuItemRadio extends CdkMenuItemSelectable implements O
31
31
  /** Toggles the checked state of the radio-button. */
32
32
  trigger(): void;
33
33
  ngOnDestroy(): void;
34
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuItemRadio, [null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; self: true; }]>;
34
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuItemRadio, [null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; self: true; }]>;
35
35
  static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuItemRadio, "[cdkMenuItemRadio]", ["cdkMenuItemRadio"], {}, {}, never>;
36
36
  }
@@ -5,9 +5,9 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
- import { ElementRef, EventEmitter, Injector, NgZone, OnDestroy, TemplateRef, ViewContainerRef } from '@angular/core';
8
+ import { ElementRef, Injector, NgZone, OnDestroy, ViewContainerRef } from '@angular/core';
9
9
  import { Directionality } from '@angular/cdk/bidi';
10
- import { ConnectedPosition, Overlay } from '@angular/cdk/overlay';
10
+ import { Overlay } from '@angular/cdk/overlay';
11
11
  import { Menu } from './menu-interface';
12
12
  import { MenuStack } from './menu-stack';
13
13
  import { MenuAim } from './menu-aim';
@@ -34,33 +34,13 @@ export declare class CdkMenuItemTrigger extends MenuTrigger implements OnDestroy
34
34
  private readonly _parentMenu?;
35
35
  private readonly _menuAim?;
36
36
  private readonly _directionality?;
37
- /** Template reference variable to the menu this trigger opens */
38
- _menuTemplateRef?: TemplateRef<unknown>;
39
- /** A list of preferred menu positions to be used when constructing the `FlexibleConnectedPositionStrategy` for this trigger's menu. */
40
- menuPosition: ConnectedPosition[];
41
- /** Emits when the attached menu is requested to open */
42
- readonly opened: EventEmitter<void>;
43
- /** Emits when the attached menu is requested to close */
44
- readonly closed: EventEmitter<void>;
45
- /** A reference to the overlay which manages the triggered menu */
46
- private _overlayRef;
47
- /** The content of the menu panel opened by this trigger. */
48
- private _menuPortal;
49
- /** Emits when this trigger is destroyed. */
50
- private readonly _destroyed;
51
- /** Emits when the outside pointer events listener on the overlay should be stopped. */
52
- private readonly _stopOutsideClicksListener;
53
37
  constructor(injector: Injector, _elementRef: ElementRef<HTMLElement>, _viewContainerRef: ViewContainerRef, _overlay: Overlay, _ngZone: NgZone, menuStack: MenuStack, _parentMenu?: Menu | undefined, _menuAim?: MenuAim | undefined, _directionality?: Directionality | undefined);
54
38
  /** Open/close the attached menu if the trigger has been configured with one */
55
39
  toggle(): void;
56
40
  /** Open the attached menu. */
57
- openMenu(): void;
41
+ open(): void;
58
42
  /** Close the opened menu. */
59
- closeMenu(): void;
60
- /** Return true if the trigger has an attached menu */
61
- hasMenu(): boolean;
62
- /** Whether the menu this button is a trigger for is open */
63
- isMenuOpen(): boolean;
43
+ close(): void;
64
44
  /**
65
45
  * Get a reference to the rendered Menu if the Menu is open and it is visible in the DOM.
66
46
  * @return the menu if it is open, otherwise undefined.
@@ -99,14 +79,11 @@ export declare class CdkMenuItemTrigger extends MenuTrigger implements OnDestroy
99
79
  * this triggers when requested.
100
80
  */
101
81
  private _registerCloseHandler;
102
- ngOnDestroy(): void;
103
82
  /**
104
83
  * Subscribe to the overlays outside pointer events stream and handle closing out the stack if a
105
84
  * click occurs outside the menus.
106
85
  */
107
86
  private _subscribeToOutsideClicks;
108
- /** Destroy and unset the overlay reference it if exists */
109
- private _destroyOverlay;
110
87
  static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuItemTrigger, [null, null, null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }]>;
111
88
  static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuItemTrigger, "[cdkMenuTriggerFor]", ["cdkMenuTriggerFor"], { "_menuTemplateRef": "cdkMenuTriggerFor"; "menuPosition": "cdkMenuPosition"; }, { "opened": "cdkMenuOpened"; "closed": "cdkMenuClosed"; }, never>;
112
89
  }
@@ -23,7 +23,7 @@ import * as i0 from "@angular/core";
23
23
  export declare class CdkMenuItem implements FocusableOption, FocusableElement, Toggler, OnDestroy {
24
24
  readonly _elementRef: ElementRef<HTMLElement>;
25
25
  private readonly _ngZone;
26
- private readonly _menuStack?;
26
+ private readonly _menuStack;
27
27
  private readonly _parentMenu?;
28
28
  private readonly _menuAim?;
29
29
  private readonly _dir?;
@@ -50,7 +50,7 @@ export declare class CdkMenuItem implements FocusableOption, FocusableElement, T
50
50
  _tabindex: 0 | -1;
51
51
  /** Emits when the menu item is destroyed. */
52
52
  private readonly _destroyed;
53
- constructor(_elementRef: ElementRef<HTMLElement>, _ngZone: NgZone, _menuStack?: MenuStack | undefined, _parentMenu?: Menu | undefined, _menuAim?: MenuAim | undefined, _dir?: Directionality | undefined,
53
+ constructor(_elementRef: ElementRef<HTMLElement>, _ngZone: NgZone, _menuStack: MenuStack, _parentMenu?: Menu | undefined, _menuAim?: MenuAim | undefined, _dir?: Directionality | undefined,
54
54
  /** Reference to the CdkMenuItemTrigger directive if one is added to the same element */
55
55
  _menuTrigger?: CdkMenuItemTrigger | undefined);
56
56
  /** Place focus on the element. */
@@ -100,6 +100,6 @@ export declare class CdkMenuItem implements FocusableOption, FocusableElement, T
100
100
  */
101
101
  private _isParentVertical;
102
102
  ngOnDestroy(): void;
103
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuItem, [null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; self: true; }]>;
103
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuItem, [null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; self: true; }]>;
104
104
  static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuItem, "[cdkMenuItem]", ["cdkMenuItem"], { "disabled": "disabled"; "typeahead": "typeahead"; }, { "triggered": "cdkMenuItemTriggered"; }, never>;
105
105
  }
@@ -5,7 +5,7 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
- import { InjectionToken } from '@angular/core';
8
+ import { InjectionToken, Optional } from '@angular/core';
9
9
  import { Observable } from 'rxjs';
10
10
  import * as i0 from "@angular/core";
11
11
  /** Events to emit as specified by the caller once the MenuStack is empty. */
@@ -19,10 +19,22 @@ export declare const enum FocusNext {
19
19
  */
20
20
  export interface MenuStackItem {
21
21
  /** A reference to the previous Menus MenuStack instance. */
22
- _menuStack?: MenuStack;
22
+ menuStack?: MenuStack;
23
23
  }
24
24
  /** Injection token used for an implementation of MenuStack. */
25
25
  export declare const MENU_STACK: InjectionToken<MenuStack>;
26
+ /** A provider that provides the parent menu stack, or a new menu stack if there is no parent one. */
27
+ export declare const PARENT_OR_NEW_MENU_STACK_PROVIDER: {
28
+ provide: InjectionToken<MenuStack>;
29
+ deps: Optional[][];
30
+ useFactory: (parentMenuStack?: MenuStack | undefined) => MenuStack;
31
+ };
32
+ /** A provider that provides the parent menu stack, or a new menu stack if there is no parent one. */
33
+ export declare const PARENT_OR_NEW_INLINE_MENU_STACK_PROVIDER: {
34
+ provide: InjectionToken<MenuStack>;
35
+ deps: Optional[][];
36
+ useFactory: (parentMenuStack?: MenuStack | undefined) => MenuStack;
37
+ };
26
38
  /**
27
39
  * MenuStack allows subscribers to listen for close events (when a MenuStackItem is popped off
28
40
  * of the stack) in order to perform closing actions. Upon the MenuStack being empty it emits
@@ -44,6 +56,8 @@ export declare class MenuStack {
44
56
  * perform.
45
57
  */
46
58
  readonly emptied: Observable<FocusNext | undefined>;
59
+ private _hasInlineMenu;
60
+ static inline(): MenuStack;
47
61
  /** @param menu the MenuStackItem to put on the stack. */
48
62
  push(menu: MenuStackItem): void;
49
63
  /**
@@ -74,6 +88,7 @@ export declare class MenuStack {
74
88
  length(): number;
75
89
  /** Get the top most element on the stack. */
76
90
  peek(): MenuStackItem | undefined;
91
+ hasInlineMenu(): boolean;
77
92
  static ɵfac: i0.ɵɵFactoryDeclaration<MenuStack, never>;
78
93
  static ɵprov: i0.ɵɵInjectableDeclaration<MenuStack>;
79
94
  }
@@ -5,20 +5,44 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
- import { InjectionToken, Injector } from '@angular/core';
8
+ import { EventEmitter, InjectionToken, Injector, OnDestroy, TemplateRef } from '@angular/core';
9
9
  import { Menu } from './menu-interface';
10
10
  import { MenuStack } from './menu-stack';
11
+ import { ConnectedPosition, OverlayRef } from '@angular/cdk/overlay';
12
+ import { TemplatePortal } from '@angular/cdk/portal';
13
+ import { Subject } from 'rxjs';
11
14
  import * as i0 from "@angular/core";
12
15
  /** Injection token used for an implementation of MenuStack. */
13
16
  export declare const MENU_TRIGGER: InjectionToken<MenuTrigger>;
14
- export declare class MenuTrigger {
17
+ export declare abstract class MenuTrigger implements OnDestroy {
15
18
  protected injector: Injector;
16
19
  protected menuStack: MenuStack;
20
+ /** A list of preferred menu positions to be used when constructing the `FlexibleConnectedPositionStrategy` for this trigger's menu. */
21
+ menuPosition: ConnectedPosition[];
22
+ /** Emits when the attached menu is requested to open */
23
+ readonly opened: EventEmitter<void>;
24
+ /** Emits when the attached menu is requested to close */
25
+ readonly closed: EventEmitter<void>;
26
+ /** Template reference variable to the menu this trigger opens */
27
+ protected _menuTemplateRef: TemplateRef<unknown>;
28
+ /** A reference to the overlay which manages the triggered menu */
29
+ protected _overlayRef: OverlayRef | null;
30
+ /** The content of the menu panel opened by this trigger. */
31
+ protected _menuPortal: TemplatePortal;
32
+ /** Emits when this trigger is destroyed. */
33
+ protected readonly _destroyed: Subject<void>;
34
+ /** Emits when the outside pointer events listener on the overlay should be stopped. */
35
+ protected readonly _stopOutsideClicksListener: import("rxjs").Observable<void>;
17
36
  private _childMenuInjector?;
18
37
  protected childMenu?: Menu;
19
- constructor(injector: Injector, menuStack: MenuStack);
20
- protected getChildMenuInjector(): Injector;
38
+ protected constructor(injector: Injector, menuStack: MenuStack);
39
+ ngOnDestroy(): void;
40
+ /** Whether the attached menu is open. */
41
+ isOpen(): boolean;
21
42
  registerChildMenu(child: Menu): void;
43
+ protected getChildMenuInjector(): Injector;
44
+ /** Destroy and unset the overlay reference it if exists */
45
+ private _destroyOverlay;
22
46
  static ɵfac: i0.ɵɵFactoryDeclaration<MenuTrigger, never>;
23
- static ɵprov: i0.ɵɵInjectableDeclaration<MenuTrigger>;
47
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MenuTrigger, never, never, {}, {}, never>;
24
48
  }
package/menu/menu.d.ts CHANGED
@@ -5,14 +5,12 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
- import { AfterContentInit, ElementRef, EventEmitter, NgZone, OnDestroy, OnInit } from '@angular/core';
9
- import { FocusOrigin } from '@angular/cdk/a11y';
8
+ import { AfterContentInit, ElementRef, EventEmitter, NgZone, OnDestroy } from '@angular/core';
10
9
  import { Directionality } from '@angular/cdk/bidi';
11
- import { CdkMenuGroup } from './menu-group';
12
- import { Menu } from './menu-interface';
13
10
  import { MenuStack } from './menu-stack';
14
11
  import { MenuAim } from './menu-aim';
15
12
  import { MenuTrigger } from './menu-trigger';
13
+ import { CdkMenuBase } from './menu-base';
16
14
  import * as i0 from "@angular/core";
17
15
  /**
18
16
  * Directive which configures the element as a Menu which should contain child elements marked as
@@ -21,37 +19,17 @@ import * as i0 from "@angular/core";
21
19
  *
22
20
  * It also acts as a RadioGroup for elements marked with role `menuitemradio`.
23
21
  */
24
- export declare class CdkMenu extends CdkMenuGroup implements Menu, AfterContentInit, OnInit, OnDestroy {
22
+ export declare class CdkMenu extends CdkMenuBase implements AfterContentInit, OnDestroy {
25
23
  private readonly _ngZone;
26
- readonly _elementRef: ElementRef<HTMLElement>;
27
- readonly _menuStack?: MenuStack | undefined;
28
24
  private _parentTrigger?;
29
25
  private readonly _menuAim?;
30
- private readonly _dir?;
31
- /**
32
- * Sets the aria-orientation attribute and determines where menus will be opened.
33
- * Does not affect styling/layout.
34
- */
35
- orientation: 'horizontal' | 'vertical';
36
26
  /** Event emitted when the menu is closed. */
37
- readonly closed: EventEmitter<void | 'click' | 'tab' | 'escape'>;
38
- /** Handles keyboard events for the menu. */
39
- private _keyManager;
40
- /** Manages items under mouse focus. */
41
- private _pointerTracker?;
27
+ readonly closed: EventEmitter<void>;
42
28
  /** List of nested CdkMenuGroup elements */
43
29
  private readonly _nestedGroups;
44
- /** All child MenuItem elements nested in this Menu. */
45
- private readonly _allItems;
46
- /** The Menu Item which triggered the open submenu. */
47
- private _openItem?;
48
- constructor(_ngZone: NgZone, _elementRef: ElementRef<HTMLElement>, _menuStack?: MenuStack | undefined, _parentTrigger?: MenuTrigger | undefined, _menuAim?: MenuAim | undefined, _dir?: Directionality | undefined);
49
- ngOnInit(): void;
30
+ constructor(_ngZone: NgZone, elementRef: ElementRef<HTMLElement>, menuStack: MenuStack, _parentTrigger?: MenuTrigger | undefined, _menuAim?: MenuAim | undefined, dir?: Directionality);
50
31
  ngAfterContentInit(): void;
51
- /** Place focus on the first MenuItem in the menu and set the focus origin. */
52
- focusFirstItem(focusOrigin?: FocusOrigin): void;
53
- /** Place focus on the last MenuItem in the menu and set the focus origin. */
54
- focusLastItem(focusOrigin?: FocusOrigin): void;
32
+ ngOnDestroy(): void;
55
33
  /** Handle keyboard events for the Menu. */
56
34
  _handleKeyEvent(event: KeyboardEvent): void;
57
35
  /**
@@ -61,37 +39,19 @@ export declare class CdkMenu extends CdkMenuGroup implements Menu, AfterContentI
61
39
  private _completeChangeEmitter;
62
40
  /** Return true if there are nested CdkMenuGroup elements within the Menu */
63
41
  private _hasNestedGroups;
64
- /** Setup the FocusKeyManager with the correct orientation for the menu. */
65
- private _setKeyManager;
66
42
  /**
67
43
  * Set the PointerFocusTracker and ensure that when mouse focus changes the key manager is updated
68
44
  * with the latest menu item under mouse focus.
69
45
  */
70
46
  private _subscribeToMouseManager;
71
- /** Subscribe to the MenuStack close and empty observables. */
72
- private _subscribeToMenuStack;
73
- /**
74
- * Close the open menu if the current active item opened the requested MenuStackItem.
75
- * @param item the MenuStackItem requested to be closed.
76
- */
77
- private _closeOpenMenu;
78
47
  /** Set focus the either the current, previous or next item based on the FocusNext event. */
79
48
  private _toggleMenuFocus;
80
- /**
81
- * Subscribe to the menu trigger's open events in order to track the trigger which opened the menu
82
- * and stop tracking it when the menu is closed.
83
- */
84
- private _subscribeToMenuOpen;
85
- /** Return true if this menu has been configured in a horizontal orientation. */
86
- private _isHorizontal;
87
49
  /**
88
50
  * Return true if this menu is an inline menu. That is, it does not exist in a pop-up and is
89
51
  * always visible in the dom.
90
52
  */
91
53
  _isInline(): boolean;
92
- ngOnDestroy(): void;
93
- /** Emit and complete the closed event emitter */
94
- private _emitClosedEvent;
95
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenu, [null, null, { optional: true; }, { optional: true; }, { optional: true; self: true; }, { optional: true; }]>;
96
- static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenu, "[cdkMenu]", ["cdkMenu"], { "orientation": "cdkMenuOrientation"; }, { "closed": "closed"; }, ["_nestedGroups", "_allItems"]>;
54
+ private _subscribeToMenuStackEmptied;
55
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenu, [null, null, null, { optional: true; }, { optional: true; self: true; }, { optional: true; }]>;
56
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenu, "[cdkMenu]", ["cdkMenu"], {}, { "closed": "closed"; }, ["_nestedGroups"]>;
97
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/cdk-experimental",
3
- "version": "14.0.0-next.8",
3
+ "version": "14.0.0-next.9",
4
4
  "description": "Experimental components for Angular CDK",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "homepage": "https://github.com/angular/components#readme",
14
14
  "peerDependencies": {
15
- "@angular/cdk": "14.0.0-next.8",
15
+ "@angular/cdk": "14.0.0-next.9",
16
16
  "@angular/core": "^14.0.0-0 || ^15.0.0"
17
17
  },
18
18
  "dependencies": {