@angular/cdk 14.0.0-next.11 → 14.0.0-next.12

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 (227) hide show
  1. package/a11y/focus-monitor/focus-monitor.d.ts +1 -1
  2. package/a11y/focus-trap/focus-trap.d.ts +1 -1
  3. package/a11y/live-announcer/live-announcer.d.ts +1 -1
  4. package/accordion/accordion-item.d.ts +1 -1
  5. package/accordion/accordion.d.ts +1 -1
  6. package/bidi/dir.d.ts +1 -1
  7. package/clipboard/copy-to-clipboard.d.ts +1 -1
  8. package/dialog/dialog-config.d.ts +115 -0
  9. package/dialog/dialog-container.d.ts +95 -0
  10. package/dialog/dialog-injectors.d.ts +24 -0
  11. package/dialog/dialog-module.d.ts +10 -0
  12. package/dialog/dialog-ref.d.ts +64 -0
  13. package/dialog/dialog.d.ts +103 -0
  14. package/dialog/dialog_public_index.d.ts +4 -0
  15. package/dialog/index.d.ts +8 -0
  16. package/dialog/package.json +9 -0
  17. package/dialog/public-api.d.ts +13 -0
  18. package/drag-drop/directives/drag-handle.d.ts +1 -1
  19. package/drag-drop/directives/drag-placeholder.d.ts +1 -1
  20. package/drag-drop/directives/drag-preview.d.ts +1 -1
  21. package/drag-drop/directives/drag.d.ts +8 -9
  22. package/drag-drop/directives/drop-list-group.d.ts +1 -1
  23. package/drag-drop/directives/drop-list.d.ts +1 -1
  24. package/esm2020/a11y/a11y-module.mjs +4 -4
  25. package/esm2020/a11y/aria-describer/aria-describer.mjs +3 -3
  26. package/esm2020/a11y/focus-monitor/focus-monitor.mjs +6 -6
  27. package/esm2020/a11y/focus-trap/configurable-focus-trap-factory.mjs +3 -3
  28. package/esm2020/a11y/focus-trap/focus-trap-manager.mjs +3 -3
  29. package/esm2020/a11y/focus-trap/focus-trap.mjs +6 -6
  30. package/esm2020/a11y/high-contrast-mode/high-contrast-mode-detector.mjs +3 -3
  31. package/esm2020/a11y/input-modality/input-modality-detector.mjs +3 -3
  32. package/esm2020/a11y/interactivity-checker/interactivity-checker.mjs +3 -3
  33. package/esm2020/a11y/live-announcer/live-announcer.mjs +6 -6
  34. package/esm2020/accordion/accordion-item.mjs +3 -3
  35. package/esm2020/accordion/accordion-module.mjs +4 -4
  36. package/esm2020/accordion/accordion.mjs +3 -3
  37. package/esm2020/bidi/bidi-module.mjs +4 -4
  38. package/esm2020/bidi/dir.mjs +3 -3
  39. package/esm2020/bidi/directionality.mjs +3 -3
  40. package/esm2020/clipboard/clipboard-module.mjs +4 -4
  41. package/esm2020/clipboard/clipboard.mjs +3 -3
  42. package/esm2020/clipboard/copy-to-clipboard.mjs +3 -3
  43. package/esm2020/collections/unique-selection-dispatcher.mjs +3 -3
  44. package/esm2020/dialog/dialog-config.mjs +58 -0
  45. package/esm2020/dialog/dialog-container.mjs +265 -0
  46. package/esm2020/dialog/dialog-injectors.mjs +26 -0
  47. package/esm2020/dialog/dialog-module.mjs +42 -0
  48. package/esm2020/dialog/dialog-ref.mjs +76 -0
  49. package/esm2020/dialog/dialog.mjs +285 -0
  50. package/esm2020/dialog/dialog_public_index.mjs +5 -0
  51. package/esm2020/dialog/index.mjs +9 -0
  52. package/esm2020/dialog/public-api.mjs +14 -0
  53. package/esm2020/drag-drop/directives/drag-handle.mjs +3 -3
  54. package/esm2020/drag-drop/directives/drag-placeholder.mjs +3 -3
  55. package/esm2020/drag-drop/directives/drag-preview.mjs +3 -3
  56. package/esm2020/drag-drop/directives/drag.mjs +11 -4
  57. package/esm2020/drag-drop/directives/drop-list-group.mjs +3 -3
  58. package/esm2020/drag-drop/directives/drop-list.mjs +3 -3
  59. package/esm2020/drag-drop/drag-drop-module.mjs +4 -4
  60. package/esm2020/drag-drop/drag-drop-registry.mjs +3 -3
  61. package/esm2020/drag-drop/drag-drop.mjs +3 -3
  62. package/esm2020/layout/breakpoints-observer.mjs +3 -3
  63. package/esm2020/layout/layout-module.mjs +4 -4
  64. package/esm2020/layout/media-matcher.mjs +3 -3
  65. package/esm2020/menu/context-menu-trigger.mjs +227 -0
  66. package/esm2020/menu/index.mjs +9 -0
  67. package/esm2020/menu/menu-aim.mjs +204 -0
  68. package/esm2020/menu/menu-bar.mjs +159 -0
  69. package/esm2020/menu/menu-base.mjs +203 -0
  70. package/esm2020/menu/menu-errors.mjs +22 -0
  71. package/esm2020/menu/menu-group.mjs +30 -0
  72. package/esm2020/menu/menu-interface.mjs +11 -0
  73. package/esm2020/menu/menu-item-checkbox.mjs +48 -0
  74. package/esm2020/menu/menu-item-radio.mjs +114 -0
  75. package/esm2020/menu/menu-item-selectable.mjs +42 -0
  76. package/esm2020/menu/menu-item.mjs +289 -0
  77. package/esm2020/menu/menu-module.mjs +62 -0
  78. package/esm2020/menu/menu-stack.mjs +156 -0
  79. package/esm2020/menu/menu-trigger-base.mjs +114 -0
  80. package/esm2020/menu/menu-trigger.mjs +302 -0
  81. package/esm2020/menu/menu.mjs +168 -0
  82. package/esm2020/menu/menu_public_index.mjs +5 -0
  83. package/esm2020/menu/pointer-focus-tracker.mjs +51 -0
  84. package/esm2020/menu/public-api.mjs +24 -0
  85. package/esm2020/observers/observe-content.mjs +13 -13
  86. package/esm2020/overlay/dispatchers/base-overlay-dispatcher.mjs +3 -3
  87. package/esm2020/overlay/dispatchers/overlay-keyboard-dispatcher.mjs +3 -3
  88. package/esm2020/overlay/dispatchers/overlay-outside-click-dispatcher.mjs +3 -3
  89. package/esm2020/overlay/fullscreen-overlay-container.mjs +3 -3
  90. package/esm2020/overlay/overlay-container.mjs +3 -3
  91. package/esm2020/overlay/overlay-directives.mjs +6 -6
  92. package/esm2020/overlay/overlay-module.mjs +4 -4
  93. package/esm2020/overlay/overlay-ref.mjs +4 -3
  94. package/esm2020/overlay/overlay.mjs +3 -3
  95. package/esm2020/overlay/position/overlay-position-builder.mjs +3 -3
  96. package/esm2020/overlay/scroll/scroll-strategy-options.mjs +3 -3
  97. package/esm2020/platform/platform-module.mjs +4 -4
  98. package/esm2020/platform/platform.mjs +3 -3
  99. package/esm2020/portal/portal-directives.mjs +16 -16
  100. package/esm2020/scrolling/fixed-size-virtual-scroll.mjs +3 -3
  101. package/esm2020/scrolling/scroll-dispatcher.mjs +3 -3
  102. package/esm2020/scrolling/scrollable.mjs +3 -3
  103. package/esm2020/scrolling/scrolling-module.mjs +8 -8
  104. package/esm2020/scrolling/viewport-ruler.mjs +3 -3
  105. package/esm2020/scrolling/virtual-for-of.mjs +3 -3
  106. package/esm2020/scrolling/virtual-scroll-viewport.mjs +3 -3
  107. package/esm2020/stepper/step-header.mjs +3 -3
  108. package/esm2020/stepper/step-label.mjs +3 -3
  109. package/esm2020/stepper/stepper-button.mjs +6 -6
  110. package/esm2020/stepper/stepper-module.mjs +4 -4
  111. package/esm2020/stepper/stepper.mjs +6 -6
  112. package/esm2020/table/cell.mjs +21 -21
  113. package/esm2020/table/coalesced-style-scheduler.mjs +3 -3
  114. package/esm2020/table/row.mjs +28 -28
  115. package/esm2020/table/table-module.mjs +4 -4
  116. package/esm2020/table/table.mjs +20 -20
  117. package/esm2020/table/text-column.mjs +4 -4
  118. package/esm2020/text-field/autofill.mjs +6 -6
  119. package/esm2020/text-field/autosize.mjs +3 -3
  120. package/esm2020/text-field/text-field-module.mjs +4 -4
  121. package/esm2020/tree/nested-node.mjs +3 -3
  122. package/esm2020/tree/node.mjs +3 -3
  123. package/esm2020/tree/outlet.mjs +3 -3
  124. package/esm2020/tree/padding.mjs +3 -3
  125. package/esm2020/tree/toggle.mjs +3 -3
  126. package/esm2020/tree/tree-module.mjs +4 -4
  127. package/esm2020/tree/tree.mjs +6 -6
  128. package/esm2020/version.mjs +1 -1
  129. package/fesm2015/a11y.mjs +40 -40
  130. package/fesm2015/accordion.mjs +10 -10
  131. package/fesm2015/bidi.mjs +10 -10
  132. package/fesm2015/cdk.mjs +1 -1
  133. package/fesm2015/cdk.mjs.map +1 -1
  134. package/fesm2015/clipboard.mjs +10 -10
  135. package/fesm2015/collections.mjs +3 -3
  136. package/fesm2015/dialog.mjs +749 -0
  137. package/fesm2015/dialog.mjs.map +1 -0
  138. package/fesm2015/drag-drop.mjs +35 -28
  139. package/fesm2015/drag-drop.mjs.map +1 -1
  140. package/fesm2015/layout.mjs +10 -10
  141. package/fesm2015/menu.mjs +2131 -0
  142. package/fesm2015/menu.mjs.map +1 -0
  143. package/fesm2015/observers.mjs +13 -13
  144. package/fesm2015/overlay.mjs +37 -36
  145. package/fesm2015/overlay.mjs.map +1 -1
  146. package/fesm2015/platform.mjs +7 -7
  147. package/fesm2015/portal.mjs +16 -16
  148. package/fesm2015/scrolling.mjs +26 -26
  149. package/fesm2015/stepper.mjs +22 -22
  150. package/fesm2015/table.mjs +78 -78
  151. package/fesm2015/table.mjs.map +1 -1
  152. package/fesm2015/text-field.mjs +13 -13
  153. package/fesm2015/tree.mjs +25 -25
  154. package/fesm2015/tree.mjs.map +1 -1
  155. package/fesm2020/a11y.mjs +40 -40
  156. package/fesm2020/accordion.mjs +10 -10
  157. package/fesm2020/bidi.mjs +10 -10
  158. package/fesm2020/cdk.mjs +1 -1
  159. package/fesm2020/cdk.mjs.map +1 -1
  160. package/fesm2020/clipboard.mjs +10 -10
  161. package/fesm2020/collections.mjs +3 -3
  162. package/fesm2020/dialog.mjs +753 -0
  163. package/fesm2020/dialog.mjs.map +1 -0
  164. package/fesm2020/drag-drop.mjs +35 -28
  165. package/fesm2020/drag-drop.mjs.map +1 -1
  166. package/fesm2020/layout.mjs +10 -10
  167. package/fesm2020/menu.mjs +2104 -0
  168. package/fesm2020/menu.mjs.map +1 -0
  169. package/fesm2020/observers.mjs +13 -13
  170. package/fesm2020/overlay.mjs +37 -36
  171. package/fesm2020/overlay.mjs.map +1 -1
  172. package/fesm2020/platform.mjs +7 -7
  173. package/fesm2020/portal.mjs +16 -16
  174. package/fesm2020/scrolling.mjs +26 -26
  175. package/fesm2020/stepper.mjs +22 -22
  176. package/fesm2020/table.mjs +78 -78
  177. package/fesm2020/table.mjs.map +1 -1
  178. package/fesm2020/text-field.mjs +13 -13
  179. package/fesm2020/tree.mjs +25 -25
  180. package/fesm2020/tree.mjs.map +1 -1
  181. package/menu/context-menu-trigger.d.ts +98 -0
  182. package/menu/index.d.ts +8 -0
  183. package/menu/menu-aim.d.ts +107 -0
  184. package/menu/menu-bar.d.ts +52 -0
  185. package/menu/menu-base.d.ts +104 -0
  186. package/menu/menu-errors.d.ts +17 -0
  187. package/menu/menu-group.d.ts +8 -0
  188. package/menu/menu-interface.d.ts +25 -0
  189. package/menu/menu-item-checkbox.d.ts +18 -0
  190. package/menu/menu-item-radio.d.ts +59 -0
  191. package/menu/menu-item-selectable.d.ts +21 -0
  192. package/menu/menu-item.d.ts +140 -0
  193. package/menu/menu-module.d.ts +17 -0
  194. package/menu/menu-stack.d.ts +122 -0
  195. package/menu/menu-trigger-base.d.ts +77 -0
  196. package/menu/menu-trigger.d.ts +104 -0
  197. package/menu/menu.d.ts +60 -0
  198. package/menu/menu_public_index.d.ts +4 -0
  199. package/menu/package.json +9 -0
  200. package/menu/pointer-focus-tracker.d.ts +47 -0
  201. package/menu/public-api.d.ts +23 -0
  202. package/observers/observe-content.d.ts +1 -1
  203. package/overlay/overlay-directives.d.ts +2 -2
  204. package/package.json +17 -1
  205. package/portal/portal-directives.d.ts +4 -4
  206. package/schematics/ng-add/index.js +1 -1
  207. package/schematics/ng-add/index.mjs +1 -1
  208. package/scrolling/fixed-size-virtual-scroll.d.ts +1 -1
  209. package/scrolling/scrollable.d.ts +1 -1
  210. package/scrolling/virtual-for-of.d.ts +1 -1
  211. package/scrolling/virtual-scroll-viewport.d.ts +1 -1
  212. package/stepper/step-header.d.ts +1 -1
  213. package/stepper/step-label.d.ts +1 -1
  214. package/stepper/stepper-button.d.ts +2 -2
  215. package/stepper/stepper.d.ts +2 -2
  216. package/table/cell.d.ts +7 -7
  217. package/table/row.d.ts +9 -9
  218. package/table/table.d.ts +6 -6
  219. package/table/text-column.d.ts +1 -1
  220. package/text-field/autofill.d.ts +1 -1
  221. package/text-field/autosize.d.ts +1 -1
  222. package/tree/nested-node.d.ts +1 -1
  223. package/tree/node.d.ts +1 -1
  224. package/tree/outlet.d.ts +1 -1
  225. package/tree/padding.d.ts +1 -1
  226. package/tree/toggle.d.ts +1 -1
  227. package/tree/tree.d.ts +2 -2
@@ -0,0 +1,8 @@
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
+ export * from './public-api';
@@ -0,0 +1,107 @@
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 { NgZone, OnDestroy, InjectionToken } from '@angular/core';
9
+ import { PointerFocusTracker, FocusableElement } from './pointer-focus-tracker';
10
+ import { Menu } from './menu-interface';
11
+ import * as i0 from "@angular/core";
12
+ /**
13
+ * MenuAim is responsible for determining if a sibling menuitem's menu should be closed when a
14
+ * Toggler item is hovered into. It is up to the hovered in item to call the MenuAim service in
15
+ * order to determine if it may perform its close actions.
16
+ */
17
+ export interface MenuAim {
18
+ /**
19
+ * Set the Menu and its PointerFocusTracker.
20
+ * @param menu The menu that this menu aim service controls.
21
+ * @param pointerTracker The `PointerFocusTracker` for the given menu.
22
+ */
23
+ initialize(menu: Menu, pointerTracker: PointerFocusTracker<FocusableElement & Toggler>): void;
24
+ /**
25
+ * Calls the `doToggle` callback when it is deemed that the user is not moving towards
26
+ * the submenu.
27
+ * @param doToggle the function called when the user is not moving towards the submenu.
28
+ */
29
+ toggle(doToggle: () => void): void;
30
+ }
31
+ /** Injection token used for an implementation of MenuAim. */
32
+ export declare const MENU_AIM: InjectionToken<MenuAim>;
33
+ /** An element which when hovered over may open or close a menu. */
34
+ export interface Toggler {
35
+ /** Gets the open menu, or undefined if no menu is open. */
36
+ getMenu(): Menu | undefined;
37
+ }
38
+ /**
39
+ * TargetMenuAim predicts if a user is moving into a submenu. It calculates the
40
+ * trajectory of the user's mouse movement in the current menu to determine if the
41
+ * mouse is moving towards an open submenu.
42
+ *
43
+ * The determination is made by calculating the slope of the users last NUM_POINTS moves where each
44
+ * pair of points determines if the trajectory line points into the submenu. It uses consensus
45
+ * approach by checking if at least NUM_POINTS / 2 pairs determine that the user is moving towards
46
+ * to submenu.
47
+ */
48
+ export declare class TargetMenuAim implements MenuAim, OnDestroy {
49
+ /** The Angular zone. */
50
+ private readonly _ngZone;
51
+ /** The last NUM_POINTS mouse move events. */
52
+ private readonly _points;
53
+ /** Reference to the root menu in which we are tracking mouse moves. */
54
+ private _menu;
55
+ /** Reference to the root menu's mouse manager. */
56
+ private _pointerTracker;
57
+ /** The id associated with the current timeout call waiting to resolve. */
58
+ private _timeoutId;
59
+ /** Emits when this service is destroyed. */
60
+ private readonly _destroyed;
61
+ constructor(
62
+ /** The Angular zone. */
63
+ _ngZone: NgZone);
64
+ ngOnDestroy(): void;
65
+ /**
66
+ * Set the Menu and its PointerFocusTracker.
67
+ * @param menu The menu that this menu aim service controls.
68
+ * @param pointerTracker The `PointerFocusTracker` for the given menu.
69
+ */
70
+ initialize(menu: Menu, pointerTracker: PointerFocusTracker<FocusableElement & Toggler>): void;
71
+ /**
72
+ * Calls the `doToggle` callback when it is deemed that the user is not moving towards
73
+ * the submenu.
74
+ * @param doToggle the function called when the user is not moving towards the submenu.
75
+ */
76
+ toggle(doToggle: () => void): void;
77
+ /**
78
+ * Start the delayed toggle handler if one isn't running already.
79
+ *
80
+ * The delayed toggle handler executes the `doToggle` callback after some period of time iff the
81
+ * users mouse is on an item in the current menu.
82
+ *
83
+ * @param doToggle the function called when the user is not moving towards the submenu.
84
+ */
85
+ private _startTimeout;
86
+ /** Whether the user is heading towards the open submenu. */
87
+ private _isMovingToSubmenu;
88
+ /** Get the bounding DOMRect for the open submenu. */
89
+ private _getSubmenuBounds;
90
+ /**
91
+ * Check if a reference to the PointerFocusTracker and menu element is provided.
92
+ * @throws an error if neither reference is provided.
93
+ */
94
+ private _checkConfigured;
95
+ /** Subscribe to the root menus mouse move events and update the tracked mouse points. */
96
+ private _subscribeToMouseMoves;
97
+ static ɵfac: i0.ɵɵFactoryDeclaration<TargetMenuAim, never>;
98
+ static ɵprov: i0.ɵɵInjectableDeclaration<TargetMenuAim>;
99
+ }
100
+ /**
101
+ * CdkTargetMenuAim is a provider for the TargetMenuAim service. It can be added to an
102
+ * element with either the `cdkMenu` or `cdkMenuBar` directive and child menu items.
103
+ */
104
+ export declare class CdkTargetMenuAim {
105
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkTargetMenuAim, never>;
106
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkTargetMenuAim, "[cdkTargetMenuAim]", ["cdkTargetMenuAim"], {}, {}, never, never, false>;
107
+ }
@@ -0,0 +1,52 @@
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 { AfterContentInit, ElementRef, NgZone } from '@angular/core';
9
+ import { Directionality } from '@angular/cdk/bidi';
10
+ import { MenuStack } from './menu-stack';
11
+ import { MenuAim } from './menu-aim';
12
+ import { CdkMenuBase } from './menu-base';
13
+ import * as i0 from "@angular/core";
14
+ /**
15
+ * Directive applied to an element which configures it as a MenuBar by setting the appropriate
16
+ * role, aria attributes, and accessible keyboard and mouse handling logic. The component that
17
+ * this directive is applied to should contain components marked with CdkMenuItem.
18
+ *
19
+ */
20
+ export declare class CdkMenuBar extends CdkMenuBase implements AfterContentInit {
21
+ /** The direction items in the menu flow. */
22
+ readonly orientation = "horizontal";
23
+ /** Whether the menu is displayed inline (i.e. always present vs a conditional popup that the user triggers with a trigger element). */
24
+ readonly isInline = true;
25
+ constructor(
26
+ /** The host element. */
27
+ elementRef: ElementRef<HTMLElement>,
28
+ /** The Angular zone. */
29
+ ngZone: NgZone,
30
+ /** The menu stack this menu is part of. */
31
+ menuStack: MenuStack,
32
+ /** The menu aim service used by this menu. */
33
+ menuAim?: MenuAim,
34
+ /** The directionality of the page. */
35
+ dir?: Directionality);
36
+ ngAfterContentInit(): void;
37
+ /**
38
+ * Handle keyboard events for the Menu.
39
+ * @param event The keyboard event to be handled.
40
+ */
41
+ _handleKeyEvent(event: KeyboardEvent): void;
42
+ /**
43
+ * Set focus to either the current, previous or next item based on the FocusNext event, then
44
+ * open the previous or next item.
45
+ * @param focusNext The element to focus.
46
+ */
47
+ private _toggleOpenMenu;
48
+ /** Subscribe to the MenuStack emptied events. */
49
+ private _subscribeToMenuStackEmptied;
50
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuBar, [null, null, null, { optional: true; self: true; }, { optional: true; }]>;
51
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuBar, "[cdkMenuBar]", ["cdkMenuBar"], {}, {}, never, never, false>;
52
+ }
@@ -0,0 +1,104 @@
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, NgZone, 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 { MenuAim } from './menu-aim';
18
+ import * as i0 from "@angular/core";
19
+ /**
20
+ * Abstract directive that implements shared logic common to all menus.
21
+ * This class can be extended to create custom menu types.
22
+ */
23
+ export declare abstract class CdkMenuBase extends CdkMenuGroup implements Menu, AfterContentInit, OnDestroy {
24
+ /** The Angular zone. */
25
+ protected ngZone: NgZone;
26
+ /** The stack of menus this menu belongs to. */
27
+ readonly menuStack: MenuStack;
28
+ /** The menu aim service used by this menu. */
29
+ protected readonly menuAim?: MenuAim | undefined;
30
+ /** The directionality of the current page. */
31
+ protected readonly dir?: Directionality | undefined;
32
+ /** The id of the menu's host element. */
33
+ id: string;
34
+ /** All child MenuItem elements nested in this Menu. */
35
+ readonly items: QueryList<CdkMenuItem>;
36
+ /** The direction items in the menu flow. */
37
+ orientation: 'horizontal' | 'vertical';
38
+ /** Whether the menu is displayed inline (i.e. always present vs a conditional popup that the user triggers with a trigger element). */
39
+ isInline: boolean;
40
+ /** The menu's native DOM host element. */
41
+ readonly nativeElement: HTMLElement;
42
+ /** Handles keyboard events for the menu. */
43
+ protected keyManager: FocusKeyManager<CdkMenuItem>;
44
+ /** Emits when the MenuBar is destroyed. */
45
+ protected readonly destroyed: Subject<void>;
46
+ /** The Menu Item which triggered the open submenu. */
47
+ protected triggerItem?: CdkMenuItem;
48
+ /** Tracks the users mouse movements over the menu. */
49
+ protected pointerTracker?: PointerFocusTracker<CdkMenuItem>;
50
+ /** Whether this menu's menu stack has focus. */
51
+ private _menuStackHasFocus;
52
+ protected constructor(
53
+ /** The host element. */
54
+ elementRef: ElementRef<HTMLElement>,
55
+ /** The Angular zone. */
56
+ ngZone: NgZone,
57
+ /** The stack of menus this menu belongs to. */
58
+ menuStack: MenuStack,
59
+ /** The menu aim service used by this menu. */
60
+ menuAim?: MenuAim | undefined,
61
+ /** The directionality of the current page. */
62
+ dir?: Directionality | undefined);
63
+ ngAfterContentInit(): void;
64
+ ngOnDestroy(): void;
65
+ /**
66
+ * Place focus on the first MenuItem in the menu and set the focus origin.
67
+ * @param focusOrigin The origin input mode of the focus event.
68
+ */
69
+ focusFirstItem(focusOrigin?: FocusOrigin): void;
70
+ /**
71
+ * Place focus on the last MenuItem in the menu and set the focus origin.
72
+ * @param focusOrigin The origin input mode of the focus event.
73
+ */
74
+ focusLastItem(focusOrigin?: FocusOrigin): void;
75
+ /** Gets the tabindex for this menu. */
76
+ _getTabIndex(): 0 | -1 | null;
77
+ /**
78
+ * Close the open menu if the current active item opened the requested MenuStackItem.
79
+ * @param menu The menu requested to be closed.
80
+ * @param options Options to configure the behavior on close.
81
+ * - `focusParentTrigger` Whether to focus the parent trigger after closing the menu.
82
+ */
83
+ protected closeOpenMenu(menu: MenuStackItem, options?: {
84
+ focusParentTrigger?: boolean;
85
+ }): void;
86
+ /** Setup the FocusKeyManager with the correct orientation for the menu. */
87
+ private _setKeyManager;
88
+ /**
89
+ * Subscribe to the menu trigger's open events in order to track the trigger which opened the menu
90
+ * and stop tracking it when the menu is closed.
91
+ */
92
+ private _subscribeToMenuOpen;
93
+ /** Subscribe to the MenuStack close events. */
94
+ private _subscribeToMenuStackClosed;
95
+ /** Subscribe to the MenuStack hasFocus events. */
96
+ private _subscribeToMenuStackHasFocus;
97
+ /**
98
+ * Set the PointerFocusTracker and ensure that when mouse focus changes the key manager is updated
99
+ * with the latest menu item under mouse focus.
100
+ */
101
+ private _setUpPointerTracker;
102
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuBase, [null, null, null, { optional: true; self: true; }, { optional: true; }]>;
103
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuBase, never, never, { "id": "id"; }, {}, ["items"], never, false>;
104
+ }
@@ -0,0 +1,17 @@
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
+ /**
9
+ * Throws an exception when an instance of the PointerFocusTracker is not provided.
10
+ * @docs-private
11
+ */
12
+ export declare function throwMissingPointerFocusTracker(): void;
13
+ /**
14
+ * Throws an exception when a reference to the parent menu is not provided.
15
+ * @docs-private
16
+ */
17
+ export declare function throwMissingMenuReference(): void;
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ /**
3
+ * A grouping container for `CdkMenuItemRadio` instances, similar to a `role="radiogroup"` element.
4
+ */
5
+ export declare class CdkMenuGroup {
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuGroup, never>;
7
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuGroup, "[cdkMenuGroup]", ["cdkMenuGroup"], {}, {}, never, never, false>;
8
+ }
@@ -0,0 +1,25 @@
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 { InjectionToken } from '@angular/core';
9
+ import { MenuStackItem } from './menu-stack';
10
+ import { FocusOrigin } from '@angular/cdk/a11y';
11
+ /** Injection token used to return classes implementing the Menu interface */
12
+ export declare const CDK_MENU: InjectionToken<Menu>;
13
+ /** Interface which specifies Menu operations and used to break circular dependency issues */
14
+ export interface Menu extends MenuStackItem {
15
+ /** The id of the menu's host element. */
16
+ id: string;
17
+ /** The menu's native DOM host element. */
18
+ nativeElement: HTMLElement;
19
+ /** The direction items in the menu flow. */
20
+ readonly orientation: 'horizontal' | 'vertical';
21
+ /** Place focus on the first MenuItem in the menu. */
22
+ focusFirstItem(focusOrigin: FocusOrigin): void;
23
+ /** Place focus on the last MenuItem in the menu. */
24
+ focusLastItem(focusOrigin: FocusOrigin): void;
25
+ }
@@ -0,0 +1,18 @@
1
+ import { CdkMenuItemSelectable } from './menu-item-selectable';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * A directive providing behavior for the "menuitemcheckbox" ARIA role, which behaves similarly to a
5
+ * conventional checkbox.
6
+ */
7
+ export declare class CdkMenuItemCheckbox extends CdkMenuItemSelectable {
8
+ /**
9
+ * Toggle the checked state of the checkbox.
10
+ * @param options Options the configure how the item is triggered
11
+ * - keepOpen: specifies that the menu should be kept open after triggering the item.
12
+ */
13
+ trigger(options?: {
14
+ keepOpen: boolean;
15
+ }): void;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuItemCheckbox, never>;
17
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuItemCheckbox, "[cdkMenuItemCheckbox]", ["cdkMenuItemCheckbox"], {}, {}, never, never, false>;
18
+ }
@@ -0,0 +1,59 @@
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 { UniqueSelectionDispatcher } from '@angular/cdk/collections';
9
+ import { ElementRef, NgZone, OnDestroy } from '@angular/core';
10
+ import { Directionality } from '@angular/cdk/bidi';
11
+ import { CdkMenuItemSelectable } from './menu-item-selectable';
12
+ import { CdkMenuTrigger } from './menu-trigger';
13
+ import { Menu } from './menu-interface';
14
+ import { MenuAim } from './menu-aim';
15
+ import { MenuStack } from './menu-stack';
16
+ import * as i0 from "@angular/core";
17
+ /**
18
+ * A directive providing behavior for the "menuitemradio" ARIA role, which behaves similarly to
19
+ * a conventional radio-button. Any sibling `CdkMenuItemRadio` instances within the same `CdkMenu`
20
+ * or `CdkMenuGroup` comprise a radio group with unique selection enforced.
21
+ */
22
+ export declare class CdkMenuItemRadio extends CdkMenuItemSelectable implements OnDestroy {
23
+ /** The unique selection dispatcher for this radio's `CdkMenuGroup`. */
24
+ private readonly _selectionDispatcher;
25
+ /** An ID to identify this radio item to the `UniqueSelectionDisptcher`. */
26
+ private _id;
27
+ /** Function to unregister the selection dispatcher */
28
+ private _removeDispatcherListener;
29
+ constructor(
30
+ /** The host element for this radio item. */
31
+ element: ElementRef<HTMLElement>,
32
+ /** The Angular zone. */
33
+ ngZone: NgZone,
34
+ /** The unique selection dispatcher for this radio's `CdkMenuGroup`. */
35
+ _selectionDispatcher: UniqueSelectionDispatcher,
36
+ /** The menu stack this item belongs to. */
37
+ menuStack: MenuStack,
38
+ /** The parent menu for this item. */
39
+ parentMenu?: Menu,
40
+ /** The menu aim used for this item. */
41
+ menuAim?: MenuAim,
42
+ /** The directionality of the page. */
43
+ dir?: Directionality,
44
+ /** Reference to the CdkMenuItemTrigger directive if one is added to the same element */
45
+ menuTrigger?: CdkMenuTrigger);
46
+ ngOnDestroy(): void;
47
+ /**
48
+ * Toggles the checked state of the radio-button.
49
+ * @param options Options the configure how the item is triggered
50
+ * - keepOpen: specifies that the menu should be kept open after triggering the item.
51
+ */
52
+ trigger(options?: {
53
+ keepOpen: boolean;
54
+ }): void;
55
+ /** Configure the unique selection dispatcher listener in order to toggle the checked state */
56
+ private _registerDispatcherListener;
57
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuItemRadio, [null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; self: true; }]>;
58
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuItemRadio, "[cdkMenuItemRadio]", ["cdkMenuItemRadio"], {}, {}, never, never, false>;
59
+ }
@@ -0,0 +1,21 @@
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 { BooleanInput } from '@angular/cdk/coercion';
9
+ import { CdkMenuItem } from './menu-item';
10
+ import * as i0 from "@angular/core";
11
+ /** Base class providing checked state for selectable MenuItems. */
12
+ export declare abstract class CdkMenuItemSelectable extends CdkMenuItem {
13
+ /** Whether the element is checked */
14
+ get checked(): boolean;
15
+ set checked(value: BooleanInput);
16
+ private _checked;
17
+ /** Whether the item should close the menu if triggered by the spacebar. */
18
+ protected closeOnSpacebarTrigger: boolean;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuItemSelectable, never>;
20
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuItemSelectable, never, never, { "checked": "cdkMenuItemChecked"; }, {}, never, never, false>;
21
+ }
@@ -0,0 +1,140 @@
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 { ElementRef, EventEmitter, NgZone, OnDestroy } from '@angular/core';
9
+ import { BooleanInput } from '@angular/cdk/coercion';
10
+ import { FocusableOption } from '@angular/cdk/a11y';
11
+ import { Directionality } from '@angular/cdk/bidi';
12
+ import { Subject } from 'rxjs';
13
+ import { CdkMenuTrigger } from './menu-trigger';
14
+ import { Menu } from './menu-interface';
15
+ import { MenuStack } from './menu-stack';
16
+ import { FocusableElement } from './pointer-focus-tracker';
17
+ import { MenuAim, Toggler } from './menu-aim';
18
+ import * as i0 from "@angular/core";
19
+ /**
20
+ * Directive which provides the ability for an element to be focused and navigated to using the
21
+ * keyboard when residing in a CdkMenu, CdkMenuBar, or CdkMenuGroup. It performs user defined
22
+ * behavior when clicked.
23
+ */
24
+ export declare class CdkMenuItem implements FocusableOption, FocusableElement, Toggler, OnDestroy {
25
+ /** The host element for this item. */
26
+ readonly _elementRef: ElementRef<HTMLElement>;
27
+ /** The Angular zone. */
28
+ private readonly _ngZone;
29
+ /** The menu stack this item belongs to. */
30
+ private readonly _menuStack;
31
+ /** The parent menu this item belongs to. */
32
+ private readonly _parentMenu?;
33
+ /** The menu aim service used for this item. */
34
+ private readonly _menuAim?;
35
+ /** The directionality of the page. */
36
+ private readonly _dir?;
37
+ /** Reference to the CdkMenuItemTrigger directive if one is added to the same element */
38
+ private readonly _menuTrigger?;
39
+ /** Whether the CdkMenuItem is disabled - defaults to false */
40
+ get disabled(): boolean;
41
+ set disabled(value: BooleanInput);
42
+ private _disabled;
43
+ /**
44
+ * The text used to locate this item during menu typeahead. If not specified,
45
+ * the `textContent` of the item will be used.
46
+ */
47
+ typeaheadLabel: string | null;
48
+ /**
49
+ * If this MenuItem is a regular MenuItem, outputs when it is triggered by a keyboard or mouse
50
+ * event.
51
+ */
52
+ readonly triggered: EventEmitter<void>;
53
+ /** Whether the menu item opens a menu. */
54
+ readonly hasMenu: boolean;
55
+ /**
56
+ * The tabindex for this menu item managed internally and used for implementing roving a
57
+ * tab index.
58
+ */
59
+ _tabindex: 0 | -1;
60
+ /** Whether the item should close the menu if triggered by the spacebar. */
61
+ protected closeOnSpacebarTrigger: boolean;
62
+ /** Emits when the menu item is destroyed. */
63
+ protected readonly destroyed: Subject<void>;
64
+ constructor(
65
+ /** The host element for this item. */
66
+ _elementRef: ElementRef<HTMLElement>,
67
+ /** The Angular zone. */
68
+ _ngZone: NgZone,
69
+ /** The menu stack this item belongs to. */
70
+ _menuStack: MenuStack,
71
+ /** The parent menu this item belongs to. */
72
+ _parentMenu?: Menu | undefined,
73
+ /** The menu aim service used for this item. */
74
+ _menuAim?: MenuAim | undefined,
75
+ /** The directionality of the page. */
76
+ _dir?: Directionality | undefined,
77
+ /** Reference to the CdkMenuItemTrigger directive if one is added to the same element */
78
+ _menuTrigger?: CdkMenuTrigger | undefined);
79
+ ngOnDestroy(): void;
80
+ /** Place focus on the element. */
81
+ focus(): void;
82
+ /**
83
+ * If the menu item is not disabled and the element does not have a menu trigger attached, emit
84
+ * on the cdkMenuItemTriggered emitter and close all open menus.
85
+ * @param options Options the configure how the item is triggered
86
+ * - keepOpen: specifies that the menu should be kept open after triggering the item.
87
+ */
88
+ trigger(options?: {
89
+ keepOpen: boolean;
90
+ }): void;
91
+ /** Return true if this MenuItem has an attached menu and it is open. */
92
+ isMenuOpen(): boolean;
93
+ /**
94
+ * Get a reference to the rendered Menu if the Menu is open and it is visible in the DOM.
95
+ * @return the menu if it is open, otherwise undefined.
96
+ */
97
+ getMenu(): Menu | undefined;
98
+ /** Get the CdkMenuTrigger associated with this element. */
99
+ getMenuTrigger(): CdkMenuTrigger | undefined;
100
+ /** Get the label for this element which is required by the FocusableOption interface. */
101
+ getLabel(): string;
102
+ /** Reset the tabindex to -1. */
103
+ _resetTabIndex(): void;
104
+ /**
105
+ * Set the tab index to 0 if not disabled and it's a focus event, or a mouse enter if this element
106
+ * is not in a menu bar.
107
+ */
108
+ _setTabIndex(event?: MouseEvent): void;
109
+ /**
110
+ * Handles keyboard events for the menu item, specifically either triggering the user defined
111
+ * callback or opening/closing the current menu based on whether the left or right arrow key was
112
+ * pressed.
113
+ * @param event the keyboard event to handle
114
+ */
115
+ _onKeydown(event: KeyboardEvent): void;
116
+ /** Whether this menu item is standalone or within a menu or menu bar. */
117
+ private _isStandaloneItem;
118
+ /**
119
+ * Handles the user pressing the back arrow key.
120
+ * @param event The keyboard event.
121
+ */
122
+ private _backArrowPressed;
123
+ /**
124
+ * Handles the user pressing the forward arrow key.
125
+ * @param event The keyboard event.
126
+ */
127
+ private _forwardArrowPressed;
128
+ /**
129
+ * Subscribe to the mouseenter events and close any sibling menu items if this element is moused
130
+ * into.
131
+ */
132
+ private _setupMouseEnter;
133
+ /**
134
+ * Return true if the enclosing parent menu is configured in a horizontal orientation, false
135
+ * otherwise or if no parent.
136
+ */
137
+ private _isParentVertical;
138
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuItem, [null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; self: true; }]>;
139
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuItem, "[cdkMenuItem]", ["cdkMenuItem"], { "disabled": "cdkMenuItemDisabled"; "typeaheadLabel": "cdkMenuitemTypeaheadLabel"; }, { "triggered": "cdkMenuItemTriggered"; }, never, never, false>;
140
+ }
@@ -0,0 +1,17 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./menu-bar";
3
+ import * as i2 from "./menu";
4
+ import * as i3 from "./menu-item";
5
+ import * as i4 from "./menu-item-radio";
6
+ import * as i5 from "./menu-item-checkbox";
7
+ import * as i6 from "./menu-trigger";
8
+ import * as i7 from "./menu-group";
9
+ import * as i8 from "./context-menu-trigger";
10
+ import * as i9 from "./menu-aim";
11
+ import * as i10 from "@angular/cdk/overlay";
12
+ /** Module that declares components and directives for the CDK menu. */
13
+ export declare class CdkMenuModule {
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuModule, never>;
15
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CdkMenuModule, [typeof i1.CdkMenuBar, typeof i2.CdkMenu, typeof i3.CdkMenuItem, typeof i4.CdkMenuItemRadio, typeof i5.CdkMenuItemCheckbox, typeof i6.CdkMenuTrigger, typeof i7.CdkMenuGroup, typeof i8.CdkContextMenuTrigger, typeof i9.CdkTargetMenuAim], [typeof i10.OverlayModule], [typeof i1.CdkMenuBar, typeof i2.CdkMenu, typeof i3.CdkMenuItem, typeof i4.CdkMenuItemRadio, typeof i5.CdkMenuItemCheckbox, typeof i6.CdkMenuTrigger, typeof i7.CdkMenuGroup, typeof i8.CdkContextMenuTrigger, typeof i9.CdkTargetMenuAim]>;
16
+ static ɵinj: i0.ɵɵInjectorDeclaration<CdkMenuModule>;
17
+ }