@angular/cdk 14.0.0-next.9 → 14.0.0-rc.2

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 (474) hide show
  1. package/a11y/_index.scss +11 -0
  2. package/a11y/index.d.ts +1119 -5
  3. package/a11y-prebuilt.css +1 -1
  4. package/accordion/index.d.ts +108 -6
  5. package/bidi/index.d.ts +77 -5
  6. package/clipboard/index.d.ts +112 -5
  7. package/coercion/index.d.ts +64 -5
  8. package/collections/index.d.ts +348 -5
  9. package/dialog/index.d.ts +410 -0
  10. package/drag-drop/index.d.ts +1456 -5
  11. package/esm2020/a11y/a11y-module.mjs +5 -5
  12. package/esm2020/a11y/aria-describer/aria-describer.mjs +10 -9
  13. package/esm2020/a11y/focus-monitor/focus-monitor.mjs +10 -10
  14. package/esm2020/a11y/focus-trap/configurable-focus-trap-factory.mjs +4 -4
  15. package/esm2020/a11y/focus-trap/focus-trap-manager.mjs +4 -4
  16. package/esm2020/a11y/focus-trap/focus-trap.mjs +7 -7
  17. package/esm2020/a11y/high-contrast-mode/high-contrast-mode-detector.mjs +10 -10
  18. package/esm2020/a11y/input-modality/input-modality-detector.mjs +4 -4
  19. package/esm2020/a11y/interactivity-checker/interactivity-checker.mjs +4 -4
  20. package/esm2020/a11y/live-announcer/live-announcer.mjs +7 -7
  21. package/esm2020/accordion/accordion-item.mjs +4 -4
  22. package/esm2020/accordion/accordion-module.mjs +5 -5
  23. package/esm2020/accordion/accordion.mjs +4 -4
  24. package/esm2020/bidi/bidi-module.mjs +5 -5
  25. package/esm2020/bidi/dir.mjs +4 -4
  26. package/esm2020/bidi/directionality.mjs +4 -4
  27. package/esm2020/clipboard/clipboard-module.mjs +5 -5
  28. package/esm2020/clipboard/clipboard.mjs +4 -4
  29. package/esm2020/clipboard/copy-to-clipboard.mjs +4 -4
  30. package/esm2020/collections/dispose-view-repeater-strategy.mjs +4 -4
  31. package/esm2020/collections/recycle-view-repeater-strategy.mjs +4 -4
  32. package/esm2020/collections/unique-selection-dispatcher.mjs +4 -4
  33. package/esm2020/dialog/dialog-config.mjs +63 -0
  34. package/esm2020/dialog/dialog-container.mjs +278 -0
  35. package/esm2020/dialog/dialog-injectors.mjs +26 -0
  36. package/esm2020/dialog/dialog-module.mjs +42 -0
  37. package/esm2020/dialog/dialog-ref.mjs +76 -0
  38. package/esm2020/dialog/dialog.mjs +298 -0
  39. package/esm2020/dialog/dialog_public_index.mjs +5 -0
  40. package/esm2020/dialog/index.mjs +9 -0
  41. package/esm2020/dialog/public-api.mjs +14 -0
  42. package/esm2020/drag-drop/directives/drag-handle.mjs +4 -4
  43. package/esm2020/drag-drop/directives/drag-placeholder.mjs +4 -4
  44. package/esm2020/drag-drop/directives/drag-preview.mjs +4 -4
  45. package/esm2020/drag-drop/directives/drag.mjs +11 -4
  46. package/esm2020/drag-drop/directives/drop-list-group.mjs +4 -4
  47. package/esm2020/drag-drop/directives/drop-list.mjs +4 -4
  48. package/esm2020/drag-drop/drag-drop-module.mjs +5 -5
  49. package/esm2020/drag-drop/drag-drop-registry.mjs +4 -4
  50. package/esm2020/drag-drop/drag-drop.mjs +4 -4
  51. package/esm2020/drag-drop/drop-list-ref.mjs +23 -23
  52. package/esm2020/layout/breakpoints-observer.mjs +4 -4
  53. package/esm2020/layout/layout-module.mjs +5 -5
  54. package/esm2020/layout/media-matcher.mjs +4 -4
  55. package/esm2020/menu/context-menu-trigger.mjs +212 -0
  56. package/esm2020/menu/index.mjs +9 -0
  57. package/esm2020/menu/menu-aim.mjs +203 -0
  58. package/esm2020/menu/menu-bar.mjs +133 -0
  59. package/esm2020/menu/menu-base.mjs +187 -0
  60. package/esm2020/menu/menu-errors.mjs +22 -0
  61. package/esm2020/menu/menu-group.mjs +30 -0
  62. package/esm2020/menu/menu-interface.mjs +11 -0
  63. package/esm2020/menu/menu-item-checkbox.mjs +49 -0
  64. package/esm2020/menu/menu-item-radio.mjs +71 -0
  65. package/esm2020/menu/menu-item-selectable.mjs +42 -0
  66. package/esm2020/menu/menu-item.mjs +259 -0
  67. package/esm2020/menu/menu-module.mjs +62 -0
  68. package/esm2020/menu/menu-stack.mjs +156 -0
  69. package/esm2020/menu/menu-trigger-base.mjs +107 -0
  70. package/esm2020/menu/menu-trigger.mjs +283 -0
  71. package/esm2020/menu/menu.mjs +134 -0
  72. package/esm2020/menu/menu_public_index.mjs +5 -0
  73. package/esm2020/menu/pointer-focus-tracker.mjs +51 -0
  74. package/esm2020/menu/public-api.mjs +24 -0
  75. package/esm2020/observers/observe-content.mjs +14 -14
  76. package/esm2020/overlay/dispatchers/base-overlay-dispatcher.mjs +4 -4
  77. package/esm2020/overlay/dispatchers/overlay-keyboard-dispatcher.mjs +4 -4
  78. package/esm2020/overlay/dispatchers/overlay-outside-click-dispatcher.mjs +4 -4
  79. package/esm2020/overlay/fullscreen-overlay-container.mjs +4 -4
  80. package/esm2020/overlay/overlay-container.mjs +4 -4
  81. package/esm2020/overlay/overlay-directives.mjs +7 -7
  82. package/esm2020/overlay/overlay-module.mjs +5 -5
  83. package/esm2020/overlay/overlay-ref.mjs +14 -5
  84. package/esm2020/overlay/overlay.mjs +14 -8
  85. package/esm2020/overlay/position/overlay-position-builder.mjs +4 -4
  86. package/esm2020/overlay/scroll/scroll-strategy-options.mjs +4 -4
  87. package/esm2020/platform/features/scrolling.mjs +4 -4
  88. package/esm2020/platform/platform-module.mjs +5 -5
  89. package/esm2020/platform/platform.mjs +4 -4
  90. package/esm2020/portal/dom-portal-outlet.mjs +6 -2
  91. package/esm2020/portal/portal-directives.mjs +17 -17
  92. package/esm2020/scrolling/fixed-size-virtual-scroll.mjs +4 -4
  93. package/esm2020/scrolling/scroll-dispatcher.mjs +4 -4
  94. package/esm2020/scrolling/scrollable.mjs +9 -9
  95. package/esm2020/scrolling/scrolling-module.mjs +9 -9
  96. package/esm2020/scrolling/viewport-ruler.mjs +4 -4
  97. package/esm2020/scrolling/virtual-for-of.mjs +4 -4
  98. package/esm2020/scrolling/virtual-scroll-viewport.mjs +4 -4
  99. package/esm2020/stepper/step-header.mjs +4 -4
  100. package/esm2020/stepper/step-label.mjs +4 -4
  101. package/esm2020/stepper/stepper-button.mjs +7 -7
  102. package/esm2020/stepper/stepper-module.mjs +5 -5
  103. package/esm2020/stepper/stepper.mjs +7 -7
  104. package/esm2020/table/cell.mjs +22 -22
  105. package/esm2020/table/coalesced-style-scheduler.mjs +4 -4
  106. package/esm2020/table/row.mjs +28 -28
  107. package/esm2020/table/table-module.mjs +5 -5
  108. package/esm2020/table/table.mjs +21 -21
  109. package/esm2020/table/text-column.mjs +5 -5
  110. package/esm2020/testing/selenium-webdriver/selenium-web-driver-harness-environment.mjs +1 -1
  111. package/esm2020/testing/test-element.mjs +1 -1
  112. package/esm2020/text-field/autofill.mjs +7 -7
  113. package/esm2020/text-field/autosize.mjs +4 -4
  114. package/esm2020/text-field/text-field-module.mjs +5 -5
  115. package/esm2020/tree/nested-node.mjs +4 -4
  116. package/esm2020/tree/node.mjs +4 -4
  117. package/esm2020/tree/outlet.mjs +4 -4
  118. package/esm2020/tree/padding.mjs +4 -4
  119. package/esm2020/tree/toggle.mjs +4 -4
  120. package/esm2020/tree/tree-module.mjs +5 -5
  121. package/esm2020/tree/tree.mjs +7 -7
  122. package/esm2020/version.mjs +1 -1
  123. package/fesm2015/a11y.mjs +55 -54
  124. package/fesm2015/a11y.mjs.map +1 -1
  125. package/fesm2015/accordion.mjs +10 -10
  126. package/fesm2015/accordion.mjs.map +1 -1
  127. package/fesm2015/bidi.mjs +10 -10
  128. package/fesm2015/bidi.mjs.map +1 -1
  129. package/fesm2015/cdk.mjs +1 -1
  130. package/fesm2015/cdk.mjs.map +1 -1
  131. package/fesm2015/clipboard.mjs +10 -10
  132. package/fesm2015/clipboard.mjs.map +1 -1
  133. package/fesm2015/collections.mjs +9 -9
  134. package/fesm2015/collections.mjs.map +1 -1
  135. package/fesm2015/dialog.mjs +780 -0
  136. package/fesm2015/dialog.mjs.map +1 -0
  137. package/fesm2015/drag-drop.mjs +57 -50
  138. package/fesm2015/drag-drop.mjs.map +1 -1
  139. package/fesm2015/layout.mjs +10 -10
  140. package/fesm2015/layout.mjs.map +1 -1
  141. package/fesm2015/menu.mjs +1960 -0
  142. package/fesm2015/menu.mjs.map +1 -0
  143. package/fesm2015/observers.mjs +13 -13
  144. package/fesm2015/observers.mjs.map +1 -1
  145. package/fesm2015/overlay.mjs +57 -42
  146. package/fesm2015/overlay.mjs.map +1 -1
  147. package/fesm2015/platform.mjs +10 -10
  148. package/fesm2015/platform.mjs.map +1 -1
  149. package/fesm2015/portal.mjs +21 -17
  150. package/fesm2015/portal.mjs.map +1 -1
  151. package/fesm2015/scrolling.mjs +31 -31
  152. package/fesm2015/scrolling.mjs.map +1 -1
  153. package/fesm2015/stepper.mjs +22 -22
  154. package/fesm2015/stepper.mjs.map +1 -1
  155. package/fesm2015/table.mjs +79 -79
  156. package/fesm2015/table.mjs.map +1 -1
  157. package/fesm2015/testing/selenium-webdriver.mjs.map +1 -1
  158. package/fesm2015/testing.mjs.map +1 -1
  159. package/fesm2015/text-field.mjs +13 -13
  160. package/fesm2015/text-field.mjs.map +1 -1
  161. package/fesm2015/tree.mjs +25 -25
  162. package/fesm2015/tree.mjs.map +1 -1
  163. package/fesm2020/a11y.mjs +55 -54
  164. package/fesm2020/a11y.mjs.map +1 -1
  165. package/fesm2020/accordion.mjs +10 -10
  166. package/fesm2020/accordion.mjs.map +1 -1
  167. package/fesm2020/bidi.mjs +10 -10
  168. package/fesm2020/bidi.mjs.map +1 -1
  169. package/fesm2020/cdk.mjs +1 -1
  170. package/fesm2020/cdk.mjs.map +1 -1
  171. package/fesm2020/clipboard.mjs +10 -10
  172. package/fesm2020/clipboard.mjs.map +1 -1
  173. package/fesm2020/collections.mjs +9 -9
  174. package/fesm2020/collections.mjs.map +1 -1
  175. package/fesm2020/dialog.mjs +784 -0
  176. package/fesm2020/dialog.mjs.map +1 -0
  177. package/fesm2020/drag-drop.mjs +57 -50
  178. package/fesm2020/drag-drop.mjs.map +1 -1
  179. package/fesm2020/layout.mjs +10 -10
  180. package/fesm2020/layout.mjs.map +1 -1
  181. package/fesm2020/menu.mjs +1942 -0
  182. package/fesm2020/menu.mjs.map +1 -0
  183. package/fesm2020/observers.mjs +13 -13
  184. package/fesm2020/observers.mjs.map +1 -1
  185. package/fesm2020/overlay.mjs +57 -42
  186. package/fesm2020/overlay.mjs.map +1 -1
  187. package/fesm2020/platform.mjs +10 -10
  188. package/fesm2020/platform.mjs.map +1 -1
  189. package/fesm2020/portal.mjs +21 -17
  190. package/fesm2020/portal.mjs.map +1 -1
  191. package/fesm2020/scrolling.mjs +31 -31
  192. package/fesm2020/scrolling.mjs.map +1 -1
  193. package/fesm2020/stepper.mjs +22 -22
  194. package/fesm2020/stepper.mjs.map +1 -1
  195. package/fesm2020/table.mjs +79 -79
  196. package/fesm2020/table.mjs.map +1 -1
  197. package/fesm2020/testing/selenium-webdriver.mjs.map +1 -1
  198. package/fesm2020/testing.mjs.map +1 -1
  199. package/fesm2020/text-field.mjs +13 -13
  200. package/fesm2020/text-field.mjs.map +1 -1
  201. package/fesm2020/tree.mjs +25 -25
  202. package/fesm2020/tree.mjs.map +1 -1
  203. package/index.d.ts +6 -8
  204. package/keycodes/index.d.ts +247 -6
  205. package/layout/index.d.ts +91 -8
  206. package/menu/index.d.ts +893 -0
  207. package/observers/index.d.ts +89 -6
  208. package/overlay/_index.scss +4 -0
  209. package/overlay/index.d.ts +1202 -5
  210. package/overlay-prebuilt.css +1 -1
  211. package/package.json +34 -18
  212. package/platform/index.d.ts +104 -6
  213. package/portal/index.d.ts +325 -5
  214. package/schematics/index.d.ts +2 -1
  215. package/schematics/index.js +4 -4
  216. package/schematics/index.mjs +4 -4
  217. package/schematics/ng-add/index.js +1 -1
  218. package/schematics/ng-add/index.mjs +1 -1
  219. package/schematics/ng-generate/drag-drop/schema.json +3 -0
  220. package/schematics/utils/ast/standalone.d.ts +26 -0
  221. package/schematics/utils/ast/standalone.js +191 -0
  222. package/schematics/utils/ast/standalone.mjs +191 -0
  223. package/schematics/utils/ast.js +5 -4
  224. package/schematics/utils/ast.mjs +5 -4
  225. package/schematics/utils/build-component.js +5 -5
  226. package/schematics/utils/build-component.mjs +5 -5
  227. package/schematics/utils/index.d.ts +1 -0
  228. package/schematics/utils/index.js +5 -1
  229. package/schematics/utils/index.mjs +5 -1
  230. package/schematics/utils/schematic-options.js +2 -2
  231. package/schematics/utils/schematic-options.mjs +2 -2
  232. package/scrolling/index.d.ts +647 -6
  233. package/stepper/index.d.ts +328 -6
  234. package/table/index.d.ts +1172 -5
  235. package/testing/index.d.ts +726 -5
  236. package/testing/selenium-webdriver/index.d.ts +134 -8
  237. package/testing/testbed/index.d.ts +161 -8
  238. package/text-field/index.d.ts +175 -6
  239. package/tree/index.d.ts +498 -6
  240. package/a11y/a11y-module.d.ts +0 -12
  241. package/a11y/a11y_public_index.d.ts +0 -4
  242. package/a11y/aria-describer/aria-describer.d.ts +0 -101
  243. package/a11y/aria-describer/aria-reference.d.ts +0 -22
  244. package/a11y/fake-event-detection.d.ts +0 -11
  245. package/a11y/focus-monitor/focus-monitor.d.ts +0 -209
  246. package/a11y/focus-trap/configurable-focus-trap-config.d.ts +0 -16
  247. package/a11y/focus-trap/configurable-focus-trap-factory.d.ts +0 -30
  248. package/a11y/focus-trap/configurable-focus-trap.d.ts +0 -33
  249. package/a11y/focus-trap/event-listener-inert-strategy.d.ts +0 -29
  250. package/a11y/focus-trap/focus-trap-inert-strategy.d.ts +0 -21
  251. package/a11y/focus-trap/focus-trap-manager.d.ts +0 -26
  252. package/a11y/focus-trap/focus-trap.d.ts +0 -163
  253. package/a11y/high-contrast-mode/high-contrast-mode-detector.d.ts +0 -48
  254. package/a11y/input-modality/input-modality-detector.d.ts +0 -99
  255. package/a11y/interactivity-checker/interactivity-checker.d.ts +0 -60
  256. package/a11y/key-manager/activedescendant-key-manager.d.ts +0 -35
  257. package/a11y/key-manager/focus-key-manager.d.ts +0 -37
  258. package/a11y/key-manager/list-key-manager.d.ts +0 -152
  259. package/a11y/live-announcer/live-announcer-tokens.d.ts +0 -22
  260. package/a11y/live-announcer/live-announcer.d.ts +0 -85
  261. package/a11y/package.json +0 -9
  262. package/a11y/public-api.d.ts +0 -25
  263. package/accordion/accordion-item.d.ts +0 -59
  264. package/accordion/accordion-module.d.ts +0 -8
  265. package/accordion/accordion.d.ts +0 -40
  266. package/accordion/accordion_public_index.d.ts +0 -4
  267. package/accordion/package.json +0 -9
  268. package/accordion/public-api.d.ts +0 -10
  269. package/bidi/bidi-module.d.ts +0 -7
  270. package/bidi/bidi_public_index.d.ts +0 -4
  271. package/bidi/dir-document-token.d.ts +0 -26
  272. package/bidi/dir.d.ts +0 -36
  273. package/bidi/directionality.d.ts +0 -26
  274. package/bidi/package.json +0 -9
  275. package/bidi/public-api.d.ts +0 -11
  276. package/clipboard/clipboard-module.d.ts +0 -7
  277. package/clipboard/clipboard.d.ts +0 -28
  278. package/clipboard/clipboard_public_index.d.ts +0 -4
  279. package/clipboard/copy-to-clipboard.d.ts +0 -49
  280. package/clipboard/package.json +0 -9
  281. package/clipboard/pending-copy.d.ts +0 -29
  282. package/clipboard/public-api.d.ts +0 -11
  283. package/coercion/array.d.ts +0 -10
  284. package/coercion/boolean-property.d.ts +0 -14
  285. package/coercion/css-pixel-value.d.ts +0 -9
  286. package/coercion/element.d.ts +0 -13
  287. package/coercion/number-property.d.ts +0 -20
  288. package/coercion/package.json +0 -9
  289. package/coercion/public-api.d.ts +0 -13
  290. package/coercion/string-array.d.ts +0 -25
  291. package/collections/array-data-source.d.ts +0 -16
  292. package/collections/collection-viewer.d.ts +0 -24
  293. package/collections/collections_public_index.d.ts +0 -4
  294. package/collections/data-source.d.ts +0 -30
  295. package/collections/dispose-view-repeater-strategy.d.ts +0 -22
  296. package/collections/package.json +0 -9
  297. package/collections/public-api.d.ts +0 -16
  298. package/collections/recycle-view-repeater-strategy.d.ts +0 -54
  299. package/collections/selection-model.d.ts +0 -95
  300. package/collections/tree-adapter.d.ts +0 -26
  301. package/collections/unique-selection-dispatcher.d.ts +0 -36
  302. package/collections/view-repeater.d.ts +0 -92
  303. package/drag-drop/client-rect.d.ts +0 -38
  304. package/drag-drop/clone-node.d.ts +0 -9
  305. package/drag-drop/directives/assertions.d.ts +0 -13
  306. package/drag-drop/directives/config.d.ts +0 -43
  307. package/drag-drop/directives/drag-handle.d.ts +0 -33
  308. package/drag-drop/directives/drag-placeholder.d.ts +0 -27
  309. package/drag-drop/directives/drag-preview.d.ts +0 -32
  310. package/drag-drop/directives/drag.d.ts +0 -160
  311. package/drag-drop/directives/drop-list-group.d.ts +0 -33
  312. package/drag-drop/directives/drop-list.d.ts +0 -123
  313. package/drag-drop/drag-drop-module.d.ts +0 -13
  314. package/drag-drop/drag-drop-registry.d.ts +0 -89
  315. package/drag-drop/drag-drop.d.ts +0 -36
  316. package/drag-drop/drag-drop_public_index.d.ts +0 -4
  317. package/drag-drop/drag-events.d.ts +0 -124
  318. package/drag-drop/drag-parent.d.ts +0 -15
  319. package/drag-drop/drag-ref.d.ts +0 -448
  320. package/drag-drop/drag-styling.d.ts +0 -42
  321. package/drag-drop/drag-utils.d.ts +0 -32
  322. package/drag-drop/drop-list-ref.d.ts +0 -312
  323. package/drag-drop/package.json +0 -9
  324. package/drag-drop/parent-position-tracker.d.ts +0 -39
  325. package/drag-drop/public-api.d.ts +0 -22
  326. package/drag-drop/transition-duration.d.ts +0 -9
  327. package/keycodes/keycodes.d.ts +0 -126
  328. package/keycodes/keycodes_public_index.d.ts +0 -4
  329. package/keycodes/modifiers.d.ts +0 -14
  330. package/keycodes/package.json +0 -9
  331. package/keycodes/public-api.d.ts +0 -9
  332. package/layout/breakpoints-observer.d.ts +0 -45
  333. package/layout/breakpoints.d.ts +0 -23
  334. package/layout/layout-module.d.ts +0 -6
  335. package/layout/layout_public_index.d.ts +0 -4
  336. package/layout/media-matcher.d.ts +0 -18
  337. package/layout/package.json +0 -9
  338. package/layout/public-api.d.ts +0 -11
  339. package/observers/observe-content.d.ts +0 -87
  340. package/observers/observers_public_index.d.ts +0 -4
  341. package/observers/package.json +0 -9
  342. package/observers/public-api.d.ts +0 -8
  343. package/overlay/dispatchers/base-overlay-dispatcher.d.ts +0 -24
  344. package/overlay/dispatchers/index.d.ts +0 -9
  345. package/overlay/dispatchers/overlay-keyboard-dispatcher.d.ts +0 -24
  346. package/overlay/dispatchers/overlay-outside-click-dispatcher.d.ts +0 -32
  347. package/overlay/fullscreen-overlay-container.d.ts +0 -35
  348. package/overlay/overlay-config.d.ts +0 -47
  349. package/overlay/overlay-container.d.ts +0 -25
  350. package/overlay/overlay-directives.d.ts +0 -148
  351. package/overlay/overlay-module.d.ts +0 -10
  352. package/overlay/overlay-ref.d.ts +0 -144
  353. package/overlay/overlay-reference.d.ts +0 -38
  354. package/overlay/overlay.d.ts +0 -75
  355. package/overlay/overlay_public_index.d.ts +0 -4
  356. package/overlay/package.json +0 -9
  357. package/overlay/position/connected-position.d.ts +0 -102
  358. package/overlay/position/flexible-connected-position-strategy.d.ts +0 -282
  359. package/overlay/position/global-position-strategy.d.ts +0 -99
  360. package/overlay/position/overlay-position-builder.d.ts +0 -32
  361. package/overlay/position/position-strategy.d.ts +0 -19
  362. package/overlay/position/scroll-clip.d.ts +0 -26
  363. package/overlay/public-api.d.ts +0 -23
  364. package/overlay/scroll/block-scroll-strategy.d.ts +0 -27
  365. package/overlay/scroll/close-scroll-strategy.d.ts +0 -40
  366. package/overlay/scroll/index.d.ts +0 -14
  367. package/overlay/scroll/noop-scroll-strategy.d.ts +0 -17
  368. package/overlay/scroll/reposition-scroll-strategy.d.ts +0 -39
  369. package/overlay/scroll/scroll-strategy-options.d.ts +0 -44
  370. package/overlay/scroll/scroll-strategy.d.ts +0 -25
  371. package/platform/features/input-types.d.ts +0 -9
  372. package/platform/features/passive-listeners.d.ts +0 -19
  373. package/platform/features/scrolling.d.ts +0 -32
  374. package/platform/features/shadow-dom.d.ts +0 -18
  375. package/platform/features/test-environment.d.ts +0 -9
  376. package/platform/package.json +0 -9
  377. package/platform/platform-module.d.ts +0 -6
  378. package/platform/platform.d.ts +0 -29
  379. package/platform/platform_public_index.d.ts +0 -4
  380. package/platform/public-api.d.ts +0 -14
  381. package/portal/dom-portal-outlet.d.ts +0 -71
  382. package/portal/package.json +0 -9
  383. package/portal/portal-directives.d.ts +0 -99
  384. package/portal/portal-errors.d.ts +0 -37
  385. package/portal/portal-injector.d.ts +0 -21
  386. package/portal/portal.d.ts +0 -140
  387. package/portal/portal_public_index.d.ts +0 -4
  388. package/portal/public-api.d.ts +0 -11
  389. package/public-api.d.ts +0 -8
  390. package/schematics/utils/vendored-ast-utils/index.d.ts +0 -70
  391. package/schematics/utils/vendored-ast-utils/index.js +0 -480
  392. package/schematics/utils/vendored-ast-utils/index.mjs +0 -480
  393. package/scrolling/fixed-size-virtual-scroll.d.ts +0 -97
  394. package/scrolling/package.json +0 -9
  395. package/scrolling/public-api.d.ts +0 -16
  396. package/scrolling/scroll-dispatcher.d.ts +0 -71
  397. package/scrolling/scrollable.d.ts +0 -85
  398. package/scrolling/scrolling-module.d.ts +0 -19
  399. package/scrolling/scrolling_public_index.d.ts +0 -4
  400. package/scrolling/viewport-ruler.d.ts +0 -63
  401. package/scrolling/virtual-for-of.d.ts +0 -117
  402. package/scrolling/virtual-scroll-repeater.d.ts +0 -16
  403. package/scrolling/virtual-scroll-strategy.d.ts +0 -38
  404. package/scrolling/virtual-scroll-viewport.d.ts +0 -147
  405. package/stepper/package.json +0 -9
  406. package/stepper/public-api.d.ts +0 -12
  407. package/stepper/step-header.d.ts +0 -18
  408. package/stepper/step-label.d.ts +0 -15
  409. package/stepper/stepper-button.d.ts +0 -20
  410. package/stepper/stepper-module.d.ts +0 -11
  411. package/stepper/stepper.d.ts +0 -233
  412. package/stepper/stepper_public_index.d.ts +0 -4
  413. package/table/can-stick.d.ts +0 -34
  414. package/table/cell.d.ts +0 -126
  415. package/table/coalesced-style-scheduler.d.ts +0 -46
  416. package/table/package.json +0 -9
  417. package/table/public-api.d.ts +0 -19
  418. package/table/row.d.ts +0 -175
  419. package/table/sticky-position-listener.d.ts +0 -31
  420. package/table/sticky-styler.d.ts +0 -126
  421. package/table/table-errors.d.ts +0 -48
  422. package/table/table-module.d.ts +0 -11
  423. package/table/table.d.ts +0 -494
  424. package/table/table_public_index.d.ts +0 -4
  425. package/table/text-column.d.ts +0 -73
  426. package/table/tokens.d.ts +0 -25
  427. package/testing/change-detection.d.ts +0 -83
  428. package/testing/component-harness.d.ts +0 -426
  429. package/testing/element-dimensions.d.ts +0 -16
  430. package/testing/harness-environment.d.ts +0 -62
  431. package/testing/package.json +0 -9
  432. package/testing/public-api.d.ts +0 -14
  433. package/testing/selenium-webdriver/package.json +0 -9
  434. package/testing/selenium-webdriver/public-api.d.ts +0 -9
  435. package/testing/selenium-webdriver/selenium-web-driver-element.d.ts +0 -91
  436. package/testing/selenium-webdriver/selenium-web-driver-harness-environment.d.ts +0 -66
  437. package/testing/selenium-webdriver/selenium-webdriver-keys.d.ts +0 -46
  438. package/testing/test-element-errors.d.ts +0 -12
  439. package/testing/test-element.d.ts +0 -135
  440. package/testing/testbed/fake-events/dispatch-events.d.ts +0 -39
  441. package/testing/testbed/fake-events/element-focus.d.ts +0 -18
  442. package/testing/testbed/fake-events/event-objects.d.ts +0 -39
  443. package/testing/testbed/fake-events/index.d.ts +0 -11
  444. package/testing/testbed/fake-events/type-in-element.d.ts +0 -41
  445. package/testing/testbed/package.json +0 -9
  446. package/testing/testbed/proxy-zone-types.d.ts +0 -29
  447. package/testing/testbed/public-api.d.ts +0 -9
  448. package/testing/testbed/task-state-zone-interceptor.d.ts +0 -37
  449. package/testing/testbed/testbed-harness-environment.d.ts +0 -64
  450. package/testing/testbed/unit-test-element.d.ts +0 -98
  451. package/testing/testbed/zone-types.d.ts +0 -22
  452. package/testing/text-filtering.d.ts +0 -13
  453. package/text-field/autofill.d.ts +0 -66
  454. package/text-field/autosize.d.ts +0 -95
  455. package/text-field/package.json +0 -9
  456. package/text-field/public-api.d.ts +0 -10
  457. package/text-field/text-field-module.d.ts +0 -8
  458. package/text-field/text-field_public_index.d.ts +0 -4
  459. package/tree/control/base-tree-control.d.ts +0 -54
  460. package/tree/control/flat-tree-control.d.ts +0 -34
  461. package/tree/control/nested-tree-control.d.ts +0 -31
  462. package/tree/control/tree-control.d.ts +0 -49
  463. package/tree/nested-node.d.ts +0 -38
  464. package/tree/node.d.ts +0 -40
  465. package/tree/outlet.d.ts +0 -26
  466. package/tree/package.json +0 -9
  467. package/tree/padding.d.ts +0 -60
  468. package/tree/public-api.d.ts +0 -19
  469. package/tree/toggle.d.ts +0 -25
  470. package/tree/tree-errors.d.ts +0 -32
  471. package/tree/tree-module.d.ts +0 -12
  472. package/tree/tree.d.ts +0 -128
  473. package/tree/tree_public_index.d.ts +0 -4
  474. package/version.d.ts +0 -10
@@ -0,0 +1,1942 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Directive, InjectionToken, Optional, SkipSelf, Inject, Injectable, inject, Injector, ViewContainerRef, EventEmitter, NgZone, ElementRef, InjectFlags, Input, Output, ContentChildren, NgModule } from '@angular/core';
3
+ import { Overlay, OverlayConfig, STANDARD_DROPDOWN_BELOW_POSITIONS, STANDARD_DROPDOWN_ADJACENT_POSITIONS, OverlayModule } from '@angular/cdk/overlay';
4
+ import { UP_ARROW, hasModifierKey, DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW, ENTER, SPACE, TAB, ESCAPE } from '@angular/cdk/keycodes';
5
+ import { startWith, debounceTime, distinctUntilChanged, filter, takeUntil, mergeMap, mapTo, mergeAll, switchMap, skip } from 'rxjs/operators';
6
+ import { UniqueSelectionDispatcher } from '@angular/cdk/collections';
7
+ import { Subject, merge, fromEvent, defer, partition } from 'rxjs';
8
+ import { TemplatePortal } from '@angular/cdk/portal';
9
+ import { FocusKeyManager } from '@angular/cdk/a11y';
10
+ import { coerceBooleanProperty } from '@angular/cdk/coercion';
11
+ import { Directionality } from '@angular/cdk/bidi';
12
+
13
+ /**
14
+ * @license
15
+ * Copyright Google LLC All Rights Reserved.
16
+ *
17
+ * Use of this source code is governed by an MIT-style license that can be
18
+ * found in the LICENSE file at https://angular.io/license
19
+ */
20
+ /**
21
+ * A grouping container for `CdkMenuItemRadio` instances, similar to a `role="radiogroup"` element.
22
+ */
23
+ class CdkMenuGroup {
24
+ }
25
+ CdkMenuGroup.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive });
26
+ CdkMenuGroup.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkMenuGroup, selector: "[cdkMenuGroup]", host: { attributes: { "role": "group" }, classAttribute: "cdk-menu-group" }, providers: [{ provide: UniqueSelectionDispatcher, useClass: UniqueSelectionDispatcher }], exportAs: ["cdkMenuGroup"], ngImport: i0 });
27
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuGroup, decorators: [{
28
+ type: Directive,
29
+ args: [{
30
+ selector: '[cdkMenuGroup]',
31
+ exportAs: 'cdkMenuGroup',
32
+ host: {
33
+ 'role': 'group',
34
+ 'class': 'cdk-menu-group',
35
+ },
36
+ providers: [{ provide: UniqueSelectionDispatcher, useClass: UniqueSelectionDispatcher }],
37
+ }]
38
+ }] });
39
+
40
+ /**
41
+ * @license
42
+ * Copyright Google LLC All Rights Reserved.
43
+ *
44
+ * Use of this source code is governed by an MIT-style license that can be
45
+ * found in the LICENSE file at https://angular.io/license
46
+ */
47
+ /** Injection token used to return classes implementing the Menu interface */
48
+ const CDK_MENU = new InjectionToken('cdk-menu');
49
+
50
+ /**
51
+ * @license
52
+ * Copyright Google LLC All Rights Reserved.
53
+ *
54
+ * Use of this source code is governed by an MIT-style license that can be
55
+ * found in the LICENSE file at https://angular.io/license
56
+ */
57
+ /** Injection token used for an implementation of MenuStack. */
58
+ const MENU_STACK = new InjectionToken('cdk-menu-stack');
59
+ /** Provider that provides the parent menu stack, or a new menu stack if there is no parent one. */
60
+ const PARENT_OR_NEW_MENU_STACK_PROVIDER = {
61
+ provide: MENU_STACK,
62
+ deps: [[new Optional(), new SkipSelf(), new Inject(MENU_STACK)]],
63
+ useFactory: (parentMenuStack) => parentMenuStack || new MenuStack(),
64
+ };
65
+ /** Provider that provides the parent menu stack, or a new inline menu stack if there is no parent one. */
66
+ const PARENT_OR_NEW_INLINE_MENU_STACK_PROVIDER = (orientation) => ({
67
+ provide: MENU_STACK,
68
+ deps: [[new Optional(), new SkipSelf(), new Inject(MENU_STACK)]],
69
+ useFactory: (parentMenuStack) => parentMenuStack || MenuStack.inline(orientation),
70
+ });
71
+ /** The next available menu stack ID. */
72
+ let nextId$2 = 0;
73
+ /**
74
+ * MenuStack allows subscribers to listen for close events (when a MenuStackItem is popped off
75
+ * of the stack) in order to perform closing actions. Upon the MenuStack being empty it emits
76
+ * from the `empty` observable specifying the next focus action which the listener should perform
77
+ * as requested by the closer.
78
+ */
79
+ class MenuStack {
80
+ constructor() {
81
+ /** The ID of this menu stack. */
82
+ this.id = `${nextId$2++}`;
83
+ /** All MenuStackItems tracked by this MenuStack. */
84
+ this._elements = [];
85
+ /** Emits the element which was popped off of the stack when requested by a closer. */
86
+ this._close = new Subject();
87
+ /** Emits once the MenuStack has become empty after popping off elements. */
88
+ this._empty = new Subject();
89
+ /** Emits whether any menu in the menu stack has focus. */
90
+ this._hasFocus = new Subject();
91
+ /** Observable which emits the MenuStackItem which has been requested to close. */
92
+ this.closed = this._close;
93
+ /** Observable which emits whether any menu in the menu stack has focus. */
94
+ this.hasFocus = this._hasFocus.pipe(startWith(false), debounceTime(0), distinctUntilChanged());
95
+ /**
96
+ * Observable which emits when the MenuStack is empty after popping off the last element. It
97
+ * emits a FocusNext event which specifies the action the closer has requested the listener
98
+ * perform.
99
+ */
100
+ this.emptied = this._empty;
101
+ /**
102
+ * Whether the inline menu associated with this menu stack is vertical or horizontal.
103
+ * `null` indicates there is no inline menu associated with this menu stack.
104
+ */
105
+ this._inlineMenuOrientation = null;
106
+ }
107
+ /** Creates a menu stack that originates from an inline menu. */
108
+ static inline(orientation) {
109
+ const stack = new MenuStack();
110
+ stack._inlineMenuOrientation = orientation;
111
+ return stack;
112
+ }
113
+ /**
114
+ * Adds an item to the menu stack.
115
+ * @param menu the MenuStackItem to put on the stack.
116
+ */
117
+ push(menu) {
118
+ this._elements.push(menu);
119
+ }
120
+ /**
121
+ * Pop items off of the stack up to and including `lastItem` and emit each on the close
122
+ * observable. If the stack is empty or `lastItem` is not on the stack it does nothing.
123
+ * @param lastItem the last item to pop off the stack.
124
+ * @param options Options that configure behavior on close.
125
+ */
126
+ close(lastItem, options) {
127
+ const { focusNextOnEmpty, focusParentTrigger } = { ...options };
128
+ if (this._elements.indexOf(lastItem) >= 0) {
129
+ let poppedElement;
130
+ do {
131
+ poppedElement = this._elements.pop();
132
+ this._close.next({ item: poppedElement, focusParentTrigger });
133
+ } while (poppedElement !== lastItem);
134
+ if (this.isEmpty()) {
135
+ this._empty.next(focusNextOnEmpty);
136
+ }
137
+ }
138
+ }
139
+ /**
140
+ * Pop items off of the stack up to but excluding `lastItem` and emit each on the close
141
+ * observable. If the stack is empty or `lastItem` is not on the stack it does nothing.
142
+ * @param lastItem the element which should be left on the stack
143
+ * @return whether or not an item was removed from the stack
144
+ */
145
+ closeSubMenuOf(lastItem) {
146
+ let removed = false;
147
+ if (this._elements.indexOf(lastItem) >= 0) {
148
+ removed = this.peek() !== lastItem;
149
+ while (this.peek() !== lastItem) {
150
+ this._close.next({ item: this._elements.pop() });
151
+ }
152
+ }
153
+ return removed;
154
+ }
155
+ /**
156
+ * Pop off all MenuStackItems and emit each one on the `close` observable one by one.
157
+ * @param options Options that configure behavior on close.
158
+ */
159
+ closeAll(options) {
160
+ const { focusNextOnEmpty, focusParentTrigger } = { ...options };
161
+ if (!this.isEmpty()) {
162
+ while (!this.isEmpty()) {
163
+ const menuStackItem = this._elements.pop();
164
+ if (menuStackItem) {
165
+ this._close.next({ item: menuStackItem, focusParentTrigger });
166
+ }
167
+ }
168
+ this._empty.next(focusNextOnEmpty);
169
+ }
170
+ }
171
+ /** Return true if this stack is empty. */
172
+ isEmpty() {
173
+ return !this._elements.length;
174
+ }
175
+ /** Return the length of the stack. */
176
+ length() {
177
+ return this._elements.length;
178
+ }
179
+ /** Get the top most element on the stack. */
180
+ peek() {
181
+ return this._elements[this._elements.length - 1];
182
+ }
183
+ /** Whether the menu stack is associated with an inline menu. */
184
+ hasInlineMenu() {
185
+ return this._inlineMenuOrientation != null;
186
+ }
187
+ /** The orientation of the associated inline menu. */
188
+ inlineMenuOrientation() {
189
+ return this._inlineMenuOrientation;
190
+ }
191
+ /** Sets whether the menu stack contains the focused element. */
192
+ setHasFocus(hasFocus) {
193
+ this._hasFocus.next(hasFocus);
194
+ }
195
+ }
196
+ MenuStack.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: MenuStack, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
197
+ MenuStack.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: MenuStack });
198
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: MenuStack, decorators: [{
199
+ type: Injectable
200
+ }] });
201
+
202
+ /**
203
+ * @license
204
+ * Copyright Google LLC All Rights Reserved.
205
+ *
206
+ * Use of this source code is governed by an MIT-style license that can be
207
+ * found in the LICENSE file at https://angular.io/license
208
+ */
209
+ /** Injection token used for an implementation of MenuStack. */
210
+ const MENU_TRIGGER = new InjectionToken('cdk-menu-trigger');
211
+ /**
212
+ * Abstract directive that implements shared logic common to all menu triggers.
213
+ * This class can be extended to create custom menu trigger types.
214
+ */
215
+ class CdkMenuTriggerBase {
216
+ constructor() {
217
+ /** The DI injector for this component. */
218
+ this.injector = inject(Injector);
219
+ /** The view container ref for this component */
220
+ this.viewContainerRef = inject(ViewContainerRef);
221
+ /** The menu stack in which this menu resides. */
222
+ this.menuStack = inject(MENU_STACK);
223
+ /** Emits when the attached menu is requested to open */
224
+ this.opened = new EventEmitter();
225
+ /** Emits when the attached menu is requested to close */
226
+ this.closed = new EventEmitter();
227
+ /** A reference to the overlay which manages the triggered menu */
228
+ this.overlayRef = null;
229
+ /** Emits when this trigger is destroyed. */
230
+ this.destroyed = new Subject();
231
+ /** Emits when the outside pointer events listener on the overlay should be stopped. */
232
+ this.stopOutsideClicksListener = merge(this.closed, this.destroyed);
233
+ }
234
+ ngOnDestroy() {
235
+ this._destroyOverlay();
236
+ this.destroyed.next();
237
+ this.destroyed.complete();
238
+ }
239
+ /** Whether the attached menu is open. */
240
+ isOpen() {
241
+ return !!this.overlayRef?.hasAttached();
242
+ }
243
+ /** Registers a child menu as having been opened by this trigger. */
244
+ registerChildMenu(child) {
245
+ this.childMenu = child;
246
+ }
247
+ /**
248
+ * Get the portal to be attached to the overlay which contains the menu. Allows for the menu
249
+ * content to change dynamically and be reflected in the application.
250
+ */
251
+ getMenuContentPortal() {
252
+ const hasMenuContentChanged = this.menuTemplateRef !== this._menuPortal?.templateRef;
253
+ if (this.menuTemplateRef && (!this._menuPortal || hasMenuContentChanged)) {
254
+ this._menuPortal = new TemplatePortal(this.menuTemplateRef, this.viewContainerRef, undefined, this._getChildMenuInjector());
255
+ }
256
+ return this._menuPortal;
257
+ }
258
+ /**
259
+ * Whether the given element is inside the scope of this trigger's menu stack.
260
+ * @param element The element to check.
261
+ * @return Whether the element is inside the scope of this trigger's menu stack.
262
+ */
263
+ isElementInsideMenuStack(element) {
264
+ for (let el = element; el; el = el?.parentElement ?? null) {
265
+ if (el.getAttribute('data-cdk-menu-stack-id') === this.menuStack.id) {
266
+ return true;
267
+ }
268
+ }
269
+ return false;
270
+ }
271
+ /** Destroy and unset the overlay reference it if exists */
272
+ _destroyOverlay() {
273
+ if (this.overlayRef) {
274
+ this.overlayRef.dispose();
275
+ this.overlayRef = null;
276
+ }
277
+ }
278
+ /** Gets the injector to use when creating a child menu. */
279
+ _getChildMenuInjector() {
280
+ this._childMenuInjector =
281
+ this._childMenuInjector ||
282
+ Injector.create({
283
+ providers: [
284
+ { provide: MENU_TRIGGER, useValue: this },
285
+ { provide: MENU_STACK, useValue: this.menuStack },
286
+ ],
287
+ parent: this.injector,
288
+ });
289
+ return this._childMenuInjector;
290
+ }
291
+ }
292
+ CdkMenuTriggerBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuTriggerBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
293
+ CdkMenuTriggerBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkMenuTriggerBase, host: { properties: { "attr.aria-controls": "childMenu?.id", "attr.data-cdk-menu-stack-id": "menuStack.id" } }, ngImport: i0 });
294
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuTriggerBase, decorators: [{
295
+ type: Directive,
296
+ args: [{
297
+ host: {
298
+ '[attr.aria-controls]': 'childMenu?.id',
299
+ '[attr.data-cdk-menu-stack-id]': 'menuStack.id',
300
+ },
301
+ }]
302
+ }] });
303
+
304
+ /**
305
+ * @license
306
+ * Copyright Google LLC All Rights Reserved.
307
+ *
308
+ * Use of this source code is governed by an MIT-style license that can be
309
+ * found in the LICENSE file at https://angular.io/license
310
+ */
311
+ /**
312
+ * Throws an exception when an instance of the PointerFocusTracker is not provided.
313
+ * @docs-private
314
+ */
315
+ function throwMissingPointerFocusTracker() {
316
+ throw Error('expected an instance of PointerFocusTracker to be provided');
317
+ }
318
+ /**
319
+ * Throws an exception when a reference to the parent menu is not provided.
320
+ * @docs-private
321
+ */
322
+ function throwMissingMenuReference() {
323
+ throw Error('expected a reference to the parent menu');
324
+ }
325
+
326
+ /**
327
+ * @license
328
+ * Copyright Google LLC All Rights Reserved.
329
+ *
330
+ * Use of this source code is governed by an MIT-style license that can be
331
+ * found in the LICENSE file at https://angular.io/license
332
+ */
333
+ /** Injection token used for an implementation of MenuAim. */
334
+ const MENU_AIM = new InjectionToken('cdk-menu-aim');
335
+ /** Capture every nth mouse move event. */
336
+ const MOUSE_MOVE_SAMPLE_FREQUENCY = 3;
337
+ /** The number of mouse move events to track. */
338
+ const NUM_POINTS = 5;
339
+ /**
340
+ * How long to wait before closing a sibling menu if a user stops short of the submenu they were
341
+ * predicted to go into.
342
+ */
343
+ const CLOSE_DELAY = 300;
344
+ /** Calculate the slope between point a and b. */
345
+ function getSlope(a, b) {
346
+ return (b.y - a.y) / (b.x - a.x);
347
+ }
348
+ /** Calculate the y intercept for the given point and slope. */
349
+ function getYIntercept(point, slope) {
350
+ return point.y - slope * point.x;
351
+ }
352
+ /**
353
+ * Whether the given mouse trajectory line defined by the slope and y intercept falls within the
354
+ * submenu as defined by `submenuPoints`
355
+ * @param submenuPoints the submenu DOMRect points.
356
+ * @param m the slope of the trajectory line.
357
+ * @param b the y intercept of the trajectory line.
358
+ * @return true if any point on the line falls within the submenu.
359
+ */
360
+ function isWithinSubmenu(submenuPoints, m, b) {
361
+ const { left, right, top, bottom } = submenuPoints;
362
+ // Check for intersection with each edge of the submenu (left, right, top, bottom)
363
+ // by fixing one coordinate to that edge's coordinate (either x or y) and checking if the
364
+ // other coordinate is within bounds.
365
+ return ((m * left + b >= top && m * left + b <= bottom) ||
366
+ (m * right + b >= top && m * right + b <= bottom) ||
367
+ ((top - b) / m >= left && (top - b) / m <= right) ||
368
+ ((bottom - b) / m >= left && (bottom - b) / m <= right));
369
+ }
370
+ /**
371
+ * TargetMenuAim predicts if a user is moving into a submenu. It calculates the
372
+ * trajectory of the user's mouse movement in the current menu to determine if the
373
+ * mouse is moving towards an open submenu.
374
+ *
375
+ * The determination is made by calculating the slope of the users last NUM_POINTS moves where each
376
+ * pair of points determines if the trajectory line points into the submenu. It uses consensus
377
+ * approach by checking if at least NUM_POINTS / 2 pairs determine that the user is moving towards
378
+ * to submenu.
379
+ */
380
+ class TargetMenuAim {
381
+ constructor() {
382
+ /** The Angular zone. */
383
+ this._ngZone = inject(NgZone);
384
+ /** The last NUM_POINTS mouse move events. */
385
+ this._points = [];
386
+ /** Emits when this service is destroyed. */
387
+ this._destroyed = new Subject();
388
+ }
389
+ ngOnDestroy() {
390
+ this._destroyed.next();
391
+ this._destroyed.complete();
392
+ }
393
+ /**
394
+ * Set the Menu and its PointerFocusTracker.
395
+ * @param menu The menu that this menu aim service controls.
396
+ * @param pointerTracker The `PointerFocusTracker` for the given menu.
397
+ */
398
+ initialize(menu, pointerTracker) {
399
+ this._menu = menu;
400
+ this._pointerTracker = pointerTracker;
401
+ this._subscribeToMouseMoves();
402
+ }
403
+ /**
404
+ * Calls the `doToggle` callback when it is deemed that the user is not moving towards
405
+ * the submenu.
406
+ * @param doToggle the function called when the user is not moving towards the submenu.
407
+ */
408
+ toggle(doToggle) {
409
+ // If the menu is horizontal the sub-menus open below and there is no risk of premature
410
+ // closing of any sub-menus therefore we automatically resolve the callback.
411
+ if (this._menu.orientation === 'horizontal') {
412
+ doToggle();
413
+ }
414
+ this._checkConfigured();
415
+ const siblingItemIsWaiting = !!this._timeoutId;
416
+ const hasPoints = this._points.length > 1;
417
+ if (hasPoints && !siblingItemIsWaiting) {
418
+ if (this._isMovingToSubmenu()) {
419
+ this._startTimeout(doToggle);
420
+ }
421
+ else {
422
+ doToggle();
423
+ }
424
+ }
425
+ else if (!siblingItemIsWaiting) {
426
+ doToggle();
427
+ }
428
+ }
429
+ /**
430
+ * Start the delayed toggle handler if one isn't running already.
431
+ *
432
+ * The delayed toggle handler executes the `doToggle` callback after some period of time iff the
433
+ * users mouse is on an item in the current menu.
434
+ *
435
+ * @param doToggle the function called when the user is not moving towards the submenu.
436
+ */
437
+ _startTimeout(doToggle) {
438
+ // If the users mouse is moving towards a submenu we don't want to immediately resolve.
439
+ // Wait for some period of time before determining if the previous menu should close in
440
+ // cases where the user may have moved towards the submenu but stopped on a sibling menu
441
+ // item intentionally.
442
+ const timeoutId = setTimeout(() => {
443
+ // Resolve if the user is currently moused over some element in the root menu
444
+ if (this._pointerTracker.activeElement && timeoutId === this._timeoutId) {
445
+ doToggle();
446
+ }
447
+ this._timeoutId = null;
448
+ }, CLOSE_DELAY);
449
+ this._timeoutId = timeoutId;
450
+ }
451
+ /** Whether the user is heading towards the open submenu. */
452
+ _isMovingToSubmenu() {
453
+ const submenuPoints = this._getSubmenuBounds();
454
+ if (!submenuPoints) {
455
+ return false;
456
+ }
457
+ let numMoving = 0;
458
+ const currPoint = this._points[this._points.length - 1];
459
+ // start from the second last point and calculate the slope between each point and the last
460
+ // point.
461
+ for (let i = this._points.length - 2; i >= 0; i--) {
462
+ const previous = this._points[i];
463
+ const slope = getSlope(currPoint, previous);
464
+ if (isWithinSubmenu(submenuPoints, slope, getYIntercept(currPoint, slope))) {
465
+ numMoving++;
466
+ }
467
+ }
468
+ return numMoving >= Math.floor(NUM_POINTS / 2);
469
+ }
470
+ /** Get the bounding DOMRect for the open submenu. */
471
+ _getSubmenuBounds() {
472
+ return this._pointerTracker?.previousElement?.getMenu()?.nativeElement.getBoundingClientRect();
473
+ }
474
+ /**
475
+ * Check if a reference to the PointerFocusTracker and menu element is provided.
476
+ * @throws an error if neither reference is provided.
477
+ */
478
+ _checkConfigured() {
479
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
480
+ if (!this._pointerTracker) {
481
+ throwMissingPointerFocusTracker();
482
+ }
483
+ if (!this._menu) {
484
+ throwMissingMenuReference();
485
+ }
486
+ }
487
+ }
488
+ /** Subscribe to the root menus mouse move events and update the tracked mouse points. */
489
+ _subscribeToMouseMoves() {
490
+ this._ngZone.runOutsideAngular(() => {
491
+ fromEvent(this._menu.nativeElement, 'mousemove')
492
+ .pipe(filter((_, index) => index % MOUSE_MOVE_SAMPLE_FREQUENCY === 0), takeUntil(this._destroyed))
493
+ .subscribe((event) => {
494
+ this._points.push({ x: event.clientX, y: event.clientY });
495
+ if (this._points.length > NUM_POINTS) {
496
+ this._points.shift();
497
+ }
498
+ });
499
+ });
500
+ }
501
+ }
502
+ TargetMenuAim.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: TargetMenuAim, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
503
+ TargetMenuAim.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: TargetMenuAim });
504
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: TargetMenuAim, decorators: [{
505
+ type: Injectable
506
+ }] });
507
+ /**
508
+ * CdkTargetMenuAim is a provider for the TargetMenuAim service. It can be added to an
509
+ * element with either the `cdkMenu` or `cdkMenuBar` directive and child menu items.
510
+ */
511
+ class CdkTargetMenuAim {
512
+ }
513
+ CdkTargetMenuAim.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkTargetMenuAim, deps: [], target: i0.ɵɵFactoryTarget.Directive });
514
+ CdkTargetMenuAim.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkTargetMenuAim, selector: "[cdkTargetMenuAim]", providers: [{ provide: MENU_AIM, useClass: TargetMenuAim }], exportAs: ["cdkTargetMenuAim"], ngImport: i0 });
515
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkTargetMenuAim, decorators: [{
516
+ type: Directive,
517
+ args: [{
518
+ selector: '[cdkTargetMenuAim]',
519
+ exportAs: 'cdkTargetMenuAim',
520
+ providers: [{ provide: MENU_AIM, useClass: TargetMenuAim }],
521
+ }]
522
+ }] });
523
+
524
+ /**
525
+ * @license
526
+ * Copyright Google LLC All Rights Reserved.
527
+ *
528
+ * Use of this source code is governed by an MIT-style license that can be
529
+ * found in the LICENSE file at https://angular.io/license
530
+ */
531
+ /**
532
+ * A directive that turns its host element into a trigger for a popup menu.
533
+ * It can be combined with cdkMenuItem to create sub-menus. If the element is in a top level
534
+ * MenuBar it will open the menu on click, or if a sibling is already opened it will open on hover.
535
+ * If it is inside of a Menu it will open the attached Submenu on hover regardless of its sibling
536
+ * state.
537
+ */
538
+ class CdkMenuTrigger extends CdkMenuTriggerBase {
539
+ constructor() {
540
+ super();
541
+ /** The host element. */
542
+ this._elementRef = inject(ElementRef);
543
+ /** The CDK overlay service. */
544
+ this._overlay = inject(Overlay);
545
+ /** The Angular zone. */
546
+ this._ngZone = inject(NgZone);
547
+ /** The parent menu this trigger belongs to. */
548
+ this._parentMenu = inject(CDK_MENU, InjectFlags.Optional);
549
+ /** The menu aim service used by this menu. */
550
+ this._menuAim = inject(MENU_AIM, InjectFlags.Optional);
551
+ /** The directionality of the page. */
552
+ this._directionality = inject(Directionality, InjectFlags.Optional);
553
+ this._setRole();
554
+ this._registerCloseHandler();
555
+ this._subscribeToMenuStackClosed();
556
+ this._subscribeToMouseEnter();
557
+ this._subscribeToMenuStackHasFocus();
558
+ }
559
+ /** Toggle the attached menu. */
560
+ toggle() {
561
+ this.isOpen() ? this.close() : this.open();
562
+ }
563
+ /** Open the attached menu. */
564
+ open() {
565
+ if (!this.isOpen()) {
566
+ this.opened.next();
567
+ this.overlayRef = this.overlayRef || this._overlay.create(this._getOverlayConfig());
568
+ this.overlayRef.attach(this.getMenuContentPortal());
569
+ this._subscribeToOutsideClicks();
570
+ }
571
+ }
572
+ /** Close the opened menu. */
573
+ close() {
574
+ if (this.isOpen()) {
575
+ this.closed.next();
576
+ this.overlayRef.detach();
577
+ }
578
+ this._closeSiblingTriggers();
579
+ }
580
+ /**
581
+ * Get a reference to the rendered Menu if the Menu is open and rendered in the DOM.
582
+ */
583
+ getMenu() {
584
+ return this.childMenu;
585
+ }
586
+ /**
587
+ * Handles keyboard events for the menu item.
588
+ * @param event The keyboard event to handle
589
+ */
590
+ _toggleOnKeydown(event) {
591
+ const isParentVertical = this._parentMenu?.orientation === 'vertical';
592
+ const keyCode = event.keyCode;
593
+ switch (keyCode) {
594
+ case SPACE:
595
+ case ENTER:
596
+ if (!hasModifierKey(event)) {
597
+ event.preventDefault();
598
+ this.toggle();
599
+ this.childMenu?.focusFirstItem('keyboard');
600
+ }
601
+ break;
602
+ case RIGHT_ARROW:
603
+ if (!hasModifierKey(event)) {
604
+ if (this._parentMenu && isParentVertical && this._directionality?.value !== 'rtl') {
605
+ event.preventDefault();
606
+ this.open();
607
+ this.childMenu?.focusFirstItem('keyboard');
608
+ }
609
+ }
610
+ break;
611
+ case LEFT_ARROW:
612
+ if (!hasModifierKey(event)) {
613
+ if (this._parentMenu && isParentVertical && this._directionality?.value === 'rtl') {
614
+ event.preventDefault();
615
+ this.open();
616
+ this.childMenu?.focusFirstItem('keyboard');
617
+ }
618
+ }
619
+ break;
620
+ case DOWN_ARROW:
621
+ case UP_ARROW:
622
+ if (!hasModifierKey(event)) {
623
+ if (!isParentVertical) {
624
+ event.preventDefault();
625
+ this.open();
626
+ keyCode === DOWN_ARROW
627
+ ? this.childMenu?.focusFirstItem('keyboard')
628
+ : this.childMenu?.focusLastItem('keyboard');
629
+ }
630
+ }
631
+ break;
632
+ }
633
+ }
634
+ /**
635
+ * Sets whether the trigger's menu stack has focus.
636
+ * @param hasFocus Whether the menu stack has focus.
637
+ */
638
+ _setHasFocus(hasFocus) {
639
+ if (!this._parentMenu) {
640
+ this.menuStack.setHasFocus(hasFocus);
641
+ }
642
+ }
643
+ /**
644
+ * Subscribe to the mouseenter events and close any sibling menu items if this element is moused
645
+ * into.
646
+ */
647
+ _subscribeToMouseEnter() {
648
+ // Closes any sibling menu items and opens the menu associated with this trigger.
649
+ const toggleMenus = () => this._ngZone.run(() => {
650
+ this._closeSiblingTriggers();
651
+ this.open();
652
+ });
653
+ this._ngZone.runOutsideAngular(() => {
654
+ fromEvent(this._elementRef.nativeElement, 'mouseenter')
655
+ .pipe(filter(() => !this.menuStack.isEmpty() && !this.isOpen()), takeUntil(this.destroyed))
656
+ .subscribe(() => {
657
+ if (this._menuAim) {
658
+ this._menuAim.toggle(toggleMenus);
659
+ }
660
+ else {
661
+ toggleMenus();
662
+ }
663
+ });
664
+ });
665
+ }
666
+ /** Close out any sibling menu trigger menus. */
667
+ _closeSiblingTriggers() {
668
+ if (this._parentMenu) {
669
+ // If nothing was removed from the stack and the last element is not the parent item
670
+ // that means that the parent menu is a menu bar since we don't put the menu bar on the
671
+ // stack
672
+ const isParentMenuBar = !this.menuStack.closeSubMenuOf(this._parentMenu) &&
673
+ this.menuStack.peek() !== this._parentMenu;
674
+ if (isParentMenuBar) {
675
+ this.menuStack.closeAll();
676
+ }
677
+ }
678
+ else {
679
+ this.menuStack.closeAll();
680
+ }
681
+ }
682
+ /** Get the configuration object used to create the overlay. */
683
+ _getOverlayConfig() {
684
+ return new OverlayConfig({
685
+ positionStrategy: this._getOverlayPositionStrategy(),
686
+ scrollStrategy: this._overlay.scrollStrategies.reposition(),
687
+ direction: this._directionality || undefined,
688
+ });
689
+ }
690
+ /** Build the position strategy for the overlay which specifies where to place the menu. */
691
+ _getOverlayPositionStrategy() {
692
+ return this._overlay
693
+ .position()
694
+ .flexibleConnectedTo(this._elementRef)
695
+ .withLockedPosition()
696
+ .withGrowAfterOpen()
697
+ .withPositions(this._getOverlayPositions());
698
+ }
699
+ /** Get the preferred positions for the opened menu relative to the menu item. */
700
+ _getOverlayPositions() {
701
+ return (this.menuPosition ??
702
+ (!this._parentMenu || this._parentMenu.orientation === 'horizontal'
703
+ ? STANDARD_DROPDOWN_BELOW_POSITIONS
704
+ : STANDARD_DROPDOWN_ADJACENT_POSITIONS));
705
+ }
706
+ /**
707
+ * Subscribe to the MenuStack close events if this is a standalone trigger and close out the menu
708
+ * this triggers when requested.
709
+ */
710
+ _registerCloseHandler() {
711
+ if (!this._parentMenu) {
712
+ this.menuStack.closed.pipe(takeUntil(this.destroyed)).subscribe(({ item }) => {
713
+ if (item === this.childMenu) {
714
+ this.close();
715
+ }
716
+ });
717
+ }
718
+ }
719
+ /**
720
+ * Subscribe to the overlays outside pointer events stream and handle closing out the stack if a
721
+ * click occurs outside the menus.
722
+ */
723
+ _subscribeToOutsideClicks() {
724
+ if (this.overlayRef) {
725
+ this.overlayRef
726
+ .outsidePointerEvents()
727
+ .pipe(filter(e => e.target != this._elementRef.nativeElement &&
728
+ !this._elementRef.nativeElement.contains(e.target)), takeUntil(this.stopOutsideClicksListener))
729
+ .subscribe(event => {
730
+ if (!this.isElementInsideMenuStack(event.target)) {
731
+ this.menuStack.closeAll();
732
+ }
733
+ else {
734
+ this._closeSiblingTriggers();
735
+ }
736
+ });
737
+ }
738
+ }
739
+ /** Subscribe to the MenuStack hasFocus events. */
740
+ _subscribeToMenuStackHasFocus() {
741
+ if (!this._parentMenu) {
742
+ this.menuStack.hasFocus.pipe(takeUntil(this.destroyed)).subscribe(hasFocus => {
743
+ if (!hasFocus) {
744
+ this.menuStack.closeAll();
745
+ }
746
+ });
747
+ }
748
+ }
749
+ /** Subscribe to the MenuStack closed events. */
750
+ _subscribeToMenuStackClosed() {
751
+ if (!this._parentMenu) {
752
+ this.menuStack.closed.subscribe(({ focusParentTrigger }) => {
753
+ if (focusParentTrigger && !this.menuStack.length()) {
754
+ this._elementRef.nativeElement.focus();
755
+ }
756
+ });
757
+ }
758
+ }
759
+ /** Sets the role attribute for this trigger if needed. */
760
+ _setRole() {
761
+ // If this trigger is part of another menu, the cdkMenuItem directive will handle setting the
762
+ // role, otherwise this is a standalone trigger, and we should ensure it has role="button".
763
+ if (!this._parentMenu) {
764
+ this._elementRef.nativeElement.setAttribute('role', 'button');
765
+ }
766
+ }
767
+ }
768
+ CdkMenuTrigger.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
769
+ CdkMenuTrigger.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkMenuTrigger, selector: "[cdkMenuTriggerFor]", inputs: { menuTemplateRef: ["cdkMenuTriggerFor", "menuTemplateRef"], menuPosition: ["cdkMenuPosition", "menuPosition"] }, outputs: { opened: "cdkMenuOpened", closed: "cdkMenuClosed" }, host: { attributes: { "aria-haspopup": "menu" }, listeners: { "focusin": "_setHasFocus(true)", "focusout": "_setHasFocus(false)", "keydown": "_toggleOnKeydown($event)", "click": "toggle()" }, properties: { "attr.aria-expanded": "isOpen()" }, classAttribute: "cdk-menu-trigger" }, providers: [
770
+ { provide: MENU_TRIGGER, useExisting: CdkMenuTrigger },
771
+ PARENT_OR_NEW_MENU_STACK_PROVIDER,
772
+ ], exportAs: ["cdkMenuTriggerFor"], usesInheritance: true, ngImport: i0 });
773
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuTrigger, decorators: [{
774
+ type: Directive,
775
+ args: [{
776
+ selector: '[cdkMenuTriggerFor]',
777
+ exportAs: 'cdkMenuTriggerFor',
778
+ host: {
779
+ 'class': 'cdk-menu-trigger',
780
+ 'aria-haspopup': 'menu',
781
+ '[attr.aria-expanded]': 'isOpen()',
782
+ '(focusin)': '_setHasFocus(true)',
783
+ '(focusout)': '_setHasFocus(false)',
784
+ '(keydown)': '_toggleOnKeydown($event)',
785
+ '(click)': 'toggle()',
786
+ },
787
+ inputs: ['menuTemplateRef: cdkMenuTriggerFor', 'menuPosition: cdkMenuPosition'],
788
+ outputs: ['opened: cdkMenuOpened', 'closed: cdkMenuClosed'],
789
+ providers: [
790
+ { provide: MENU_TRIGGER, useExisting: CdkMenuTrigger },
791
+ PARENT_OR_NEW_MENU_STACK_PROVIDER,
792
+ ],
793
+ }]
794
+ }], ctorParameters: function () { return []; } });
795
+
796
+ /**
797
+ * @license
798
+ * Copyright Google LLC All Rights Reserved.
799
+ *
800
+ * Use of this source code is governed by an MIT-style license that can be
801
+ * found in the LICENSE file at https://angular.io/license
802
+ */
803
+ /**
804
+ * Directive which provides the ability for an element to be focused and navigated to using the
805
+ * keyboard when residing in a CdkMenu, CdkMenuBar, or CdkMenuGroup. It performs user defined
806
+ * behavior when clicked.
807
+ */
808
+ class CdkMenuItem {
809
+ constructor() {
810
+ /** The directionality (text direction) of the current page. */
811
+ this._dir = inject(Directionality, InjectFlags.Optional);
812
+ /** The menu's native DOM host element. */
813
+ this._elementRef = inject(ElementRef);
814
+ /** The Angular zone. */
815
+ this._ngZone = inject(NgZone);
816
+ /** The menu aim service used by this menu. */
817
+ this._menuAim = inject(MENU_AIM, InjectFlags.Optional);
818
+ /** The stack of menus this menu belongs to. */
819
+ this._menuStack = inject(MENU_STACK);
820
+ /** The parent menu in which this menuitem resides. */
821
+ this._parentMenu = inject(CDK_MENU, InjectFlags.Optional);
822
+ /** Reference to the CdkMenuItemTrigger directive if one is added to the same element */
823
+ this._menuTrigger = inject(CdkMenuTrigger, InjectFlags.Optional | InjectFlags.Self);
824
+ this._disabled = false;
825
+ /**
826
+ * If this MenuItem is a regular MenuItem, outputs when it is triggered by a keyboard or mouse
827
+ * event.
828
+ */
829
+ this.triggered = new EventEmitter();
830
+ /** Whether the menu item opens a menu. */
831
+ this.hasMenu = !!this._menuTrigger;
832
+ /**
833
+ * The tabindex for this menu item managed internally and used for implementing roving a
834
+ * tab index.
835
+ */
836
+ this._tabindex = -1;
837
+ /** Whether the item should close the menu if triggered by the spacebar. */
838
+ this.closeOnSpacebarTrigger = true;
839
+ /** Emits when the menu item is destroyed. */
840
+ this.destroyed = new Subject();
841
+ this._setupMouseEnter();
842
+ if (this._isStandaloneItem()) {
843
+ this._tabindex = 0;
844
+ }
845
+ }
846
+ /** Whether the CdkMenuItem is disabled - defaults to false */
847
+ get disabled() {
848
+ return this._disabled;
849
+ }
850
+ set disabled(value) {
851
+ this._disabled = coerceBooleanProperty(value);
852
+ }
853
+ ngOnDestroy() {
854
+ this.destroyed.next();
855
+ this.destroyed.complete();
856
+ }
857
+ /** Place focus on the element. */
858
+ focus() {
859
+ this._elementRef.nativeElement.focus();
860
+ }
861
+ /**
862
+ * If the menu item is not disabled and the element does not have a menu trigger attached, emit
863
+ * on the cdkMenuItemTriggered emitter and close all open menus.
864
+ * @param options Options the configure how the item is triggered
865
+ * - keepOpen: specifies that the menu should be kept open after triggering the item.
866
+ */
867
+ trigger(options) {
868
+ const { keepOpen } = { ...options };
869
+ if (!this.disabled && !this.hasMenu) {
870
+ this.triggered.next();
871
+ if (!keepOpen) {
872
+ this._menuStack.closeAll({ focusParentTrigger: true });
873
+ }
874
+ }
875
+ }
876
+ /** Return true if this MenuItem has an attached menu and it is open. */
877
+ isMenuOpen() {
878
+ return !!this._menuTrigger?.isOpen();
879
+ }
880
+ /**
881
+ * Get a reference to the rendered Menu if the Menu is open and it is visible in the DOM.
882
+ * @return the menu if it is open, otherwise undefined.
883
+ */
884
+ getMenu() {
885
+ return this._menuTrigger?.getMenu();
886
+ }
887
+ /** Get the CdkMenuTrigger associated with this element. */
888
+ getMenuTrigger() {
889
+ return this._menuTrigger;
890
+ }
891
+ /** Get the label for this element which is required by the FocusableOption interface. */
892
+ getLabel() {
893
+ return this.typeaheadLabel || this._elementRef.nativeElement.textContent?.trim() || '';
894
+ }
895
+ /** Reset the tabindex to -1. */
896
+ _resetTabIndex() {
897
+ if (!this._isStandaloneItem()) {
898
+ this._tabindex = -1;
899
+ }
900
+ }
901
+ /**
902
+ * Set the tab index to 0 if not disabled and it's a focus event, or a mouse enter if this element
903
+ * is not in a menu bar.
904
+ */
905
+ _setTabIndex(event) {
906
+ if (this.disabled) {
907
+ return;
908
+ }
909
+ // don't set the tabindex if there are no open sibling or parent menus
910
+ if (!event || !this._menuStack.isEmpty()) {
911
+ this._tabindex = 0;
912
+ }
913
+ }
914
+ /**
915
+ * Handles keyboard events for the menu item, specifically either triggering the user defined
916
+ * callback or opening/closing the current menu based on whether the left or right arrow key was
917
+ * pressed.
918
+ * @param event the keyboard event to handle
919
+ */
920
+ _onKeydown(event) {
921
+ switch (event.keyCode) {
922
+ case SPACE:
923
+ case ENTER:
924
+ if (!hasModifierKey(event)) {
925
+ event.preventDefault();
926
+ this.trigger({ keepOpen: event.keyCode === SPACE && !this.closeOnSpacebarTrigger });
927
+ }
928
+ break;
929
+ case RIGHT_ARROW:
930
+ if (!hasModifierKey(event)) {
931
+ if (this._parentMenu && this._isParentVertical()) {
932
+ if (this._dir?.value !== 'rtl') {
933
+ this._forwardArrowPressed(event);
934
+ }
935
+ else {
936
+ this._backArrowPressed(event);
937
+ }
938
+ }
939
+ }
940
+ break;
941
+ case LEFT_ARROW:
942
+ if (!hasModifierKey(event)) {
943
+ if (this._parentMenu && this._isParentVertical()) {
944
+ if (this._dir?.value !== 'rtl') {
945
+ this._backArrowPressed(event);
946
+ }
947
+ else {
948
+ this._forwardArrowPressed(event);
949
+ }
950
+ }
951
+ }
952
+ break;
953
+ }
954
+ }
955
+ /** Whether this menu item is standalone or within a menu or menu bar. */
956
+ _isStandaloneItem() {
957
+ return !this._parentMenu;
958
+ }
959
+ /**
960
+ * Handles the user pressing the back arrow key.
961
+ * @param event The keyboard event.
962
+ */
963
+ _backArrowPressed(event) {
964
+ const parentMenu = this._parentMenu;
965
+ if (this._menuStack.hasInlineMenu() || this._menuStack.length() > 1) {
966
+ event.preventDefault();
967
+ this._menuStack.close(parentMenu, {
968
+ focusNextOnEmpty: this._menuStack.inlineMenuOrientation() === 'horizontal'
969
+ ? 1 /* FocusNext.previousItem */
970
+ : 2 /* FocusNext.currentItem */,
971
+ focusParentTrigger: true,
972
+ });
973
+ }
974
+ }
975
+ /**
976
+ * Handles the user pressing the forward arrow key.
977
+ * @param event The keyboard event.
978
+ */
979
+ _forwardArrowPressed(event) {
980
+ if (!this.hasMenu && this._menuStack.inlineMenuOrientation() === 'horizontal') {
981
+ event.preventDefault();
982
+ this._menuStack.closeAll({
983
+ focusNextOnEmpty: 0 /* FocusNext.nextItem */,
984
+ focusParentTrigger: true,
985
+ });
986
+ }
987
+ }
988
+ /**
989
+ * Subscribe to the mouseenter events and close any sibling menu items if this element is moused
990
+ * into.
991
+ */
992
+ _setupMouseEnter() {
993
+ if (!this._isStandaloneItem()) {
994
+ const closeOpenSiblings = () => this._ngZone.run(() => this._menuStack.closeSubMenuOf(this._parentMenu));
995
+ this._ngZone.runOutsideAngular(() => fromEvent(this._elementRef.nativeElement, 'mouseenter')
996
+ .pipe(filter(() => !this._menuStack.isEmpty() && !this.hasMenu), takeUntil(this.destroyed))
997
+ .subscribe(() => {
998
+ if (this._menuAim) {
999
+ this._menuAim.toggle(closeOpenSiblings);
1000
+ }
1001
+ else {
1002
+ closeOpenSiblings();
1003
+ }
1004
+ }));
1005
+ }
1006
+ }
1007
+ /**
1008
+ * Return true if the enclosing parent menu is configured in a horizontal orientation, false
1009
+ * otherwise or if no parent.
1010
+ */
1011
+ _isParentVertical() {
1012
+ return this._parentMenu?.orientation === 'vertical';
1013
+ }
1014
+ }
1015
+ CdkMenuItem.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuItem, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1016
+ CdkMenuItem.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkMenuItem, selector: "[cdkMenuItem]", inputs: { disabled: ["cdkMenuItemDisabled", "disabled"], typeaheadLabel: ["cdkMenuitemTypeaheadLabel", "typeaheadLabel"] }, outputs: { triggered: "cdkMenuItemTriggered" }, host: { attributes: { "role": "menuitem" }, listeners: { "blur": "_resetTabIndex()", "focus": "_setTabIndex()", "click": "trigger()", "keydown": "_onKeydown($event)" }, properties: { "tabindex": "_tabindex", "attr.aria-disabled": "disabled || null" }, classAttribute: "cdk-menu-item" }, exportAs: ["cdkMenuItem"], ngImport: i0 });
1017
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuItem, decorators: [{
1018
+ type: Directive,
1019
+ args: [{
1020
+ selector: '[cdkMenuItem]',
1021
+ exportAs: 'cdkMenuItem',
1022
+ host: {
1023
+ 'role': 'menuitem',
1024
+ 'class': 'cdk-menu-item',
1025
+ '[tabindex]': '_tabindex',
1026
+ '[attr.aria-disabled]': 'disabled || null',
1027
+ '(blur)': '_resetTabIndex()',
1028
+ '(focus)': '_setTabIndex()',
1029
+ '(click)': 'trigger()',
1030
+ '(keydown)': '_onKeydown($event)',
1031
+ },
1032
+ }]
1033
+ }], ctorParameters: function () { return []; }, propDecorators: { disabled: [{
1034
+ type: Input,
1035
+ args: ['cdkMenuItemDisabled']
1036
+ }], typeaheadLabel: [{
1037
+ type: Input,
1038
+ args: ['cdkMenuitemTypeaheadLabel']
1039
+ }], triggered: [{
1040
+ type: Output,
1041
+ args: ['cdkMenuItemTriggered']
1042
+ }] } });
1043
+
1044
+ /**
1045
+ * @license
1046
+ * Copyright Google LLC All Rights Reserved.
1047
+ *
1048
+ * Use of this source code is governed by an MIT-style license that can be
1049
+ * found in the LICENSE file at https://angular.io/license
1050
+ */
1051
+ /**
1052
+ * PointerFocusTracker keeps track of the currently active item under mouse focus. It also has
1053
+ * observables which emit when the users mouse enters and leaves a tracked element.
1054
+ */
1055
+ class PointerFocusTracker {
1056
+ constructor(
1057
+ /** The list of items being tracked. */
1058
+ _items) {
1059
+ this._items = _items;
1060
+ /** Emits when an element is moused into. */
1061
+ this.entered = this._getItemPointerEntries();
1062
+ /** Emits when an element is moused out. */
1063
+ this.exited = this._getItemPointerExits();
1064
+ /** Emits when this is destroyed. */
1065
+ this._destroyed = new Subject();
1066
+ this.entered.subscribe(element => (this.activeElement = element));
1067
+ this.exited.subscribe(() => {
1068
+ this.previousElement = this.activeElement;
1069
+ this.activeElement = undefined;
1070
+ });
1071
+ }
1072
+ /** Stop the managers listeners. */
1073
+ destroy() {
1074
+ this._destroyed.next();
1075
+ this._destroyed.complete();
1076
+ }
1077
+ /**
1078
+ * Gets a stream of pointer (mouse) entries into the given items.
1079
+ * This should typically run outside the Angular zone.
1080
+ */
1081
+ _getItemPointerEntries() {
1082
+ return defer(() => this._items.changes.pipe(startWith(this._items), mergeMap((list) => list.map(element => fromEvent(element._elementRef.nativeElement, 'mouseenter').pipe(mapTo(element), takeUntil(this._items.changes)))), mergeAll()));
1083
+ }
1084
+ /**
1085
+ * Gets a stream of pointer (mouse) exits out of the given items.
1086
+ * This should typically run outside the Angular zone.
1087
+ */
1088
+ _getItemPointerExits() {
1089
+ return defer(() => this._items.changes.pipe(startWith(this._items), mergeMap((list) => list.map(element => fromEvent(element._elementRef.nativeElement, 'mouseout').pipe(mapTo(element), takeUntil(this._items.changes)))), mergeAll()));
1090
+ }
1091
+ }
1092
+
1093
+ /**
1094
+ * @license
1095
+ * Copyright Google LLC All Rights Reserved.
1096
+ *
1097
+ * Use of this source code is governed by an MIT-style license that can be
1098
+ * found in the LICENSE file at https://angular.io/license
1099
+ */
1100
+ /** Counter used to create unique IDs for menus. */
1101
+ let nextId$1 = 0;
1102
+ /**
1103
+ * Abstract directive that implements shared logic common to all menus.
1104
+ * This class can be extended to create custom menu types.
1105
+ */
1106
+ class CdkMenuBase extends CdkMenuGroup {
1107
+ constructor() {
1108
+ super(...arguments);
1109
+ /** The menu's native DOM host element. */
1110
+ this.nativeElement = inject(ElementRef).nativeElement;
1111
+ /** The Angular zone. */
1112
+ this.ngZone = inject(NgZone);
1113
+ /** The stack of menus this menu belongs to. */
1114
+ this.menuStack = inject(MENU_STACK);
1115
+ /** The menu aim service used by this menu. */
1116
+ this.menuAim = inject(MENU_AIM, InjectFlags.Optional | InjectFlags.Self);
1117
+ /** The directionality (text direction) of the current page. */
1118
+ this.dir = inject(Directionality, InjectFlags.Optional);
1119
+ /** The id of the menu's host element. */
1120
+ this.id = `cdk-menu-${nextId$1++}`;
1121
+ /** The direction items in the menu flow. */
1122
+ this.orientation = 'vertical';
1123
+ /**
1124
+ * Whether the menu is displayed inline (i.e. always present vs a conditional popup that the
1125
+ * user triggers with a trigger element).
1126
+ */
1127
+ this.isInline = false;
1128
+ /** Emits when the MenuBar is destroyed. */
1129
+ this.destroyed = new Subject();
1130
+ /** Whether this menu's menu stack has focus. */
1131
+ this._menuStackHasFocus = false;
1132
+ }
1133
+ ngAfterContentInit() {
1134
+ if (!this.isInline) {
1135
+ this.menuStack.push(this);
1136
+ }
1137
+ this._setKeyManager();
1138
+ this._subscribeToMenuStackHasFocus();
1139
+ this._subscribeToMenuOpen();
1140
+ this._subscribeToMenuStackClosed();
1141
+ this._setUpPointerTracker();
1142
+ }
1143
+ ngOnDestroy() {
1144
+ this.destroyed.next();
1145
+ this.destroyed.complete();
1146
+ this.pointerTracker?.destroy();
1147
+ }
1148
+ /**
1149
+ * Place focus on the first MenuItem in the menu and set the focus origin.
1150
+ * @param focusOrigin The origin input mode of the focus event.
1151
+ */
1152
+ focusFirstItem(focusOrigin = 'program') {
1153
+ this.keyManager.setFocusOrigin(focusOrigin);
1154
+ this.keyManager.setFirstItemActive();
1155
+ }
1156
+ /**
1157
+ * Place focus on the last MenuItem in the menu and set the focus origin.
1158
+ * @param focusOrigin The origin input mode of the focus event.
1159
+ */
1160
+ focusLastItem(focusOrigin = 'program') {
1161
+ this.keyManager.setFocusOrigin(focusOrigin);
1162
+ this.keyManager.setLastItemActive();
1163
+ }
1164
+ /** Gets the tabindex for this menu. */
1165
+ _getTabIndex() {
1166
+ const tabindexIfInline = this._menuStackHasFocus ? -1 : 0;
1167
+ return this.isInline ? tabindexIfInline : null;
1168
+ }
1169
+ /**
1170
+ * Close the open menu if the current active item opened the requested MenuStackItem.
1171
+ * @param menu The menu requested to be closed.
1172
+ * @param options Options to configure the behavior on close.
1173
+ * - `focusParentTrigger` Whether to focus the parent trigger after closing the menu.
1174
+ */
1175
+ closeOpenMenu(menu, options) {
1176
+ const { focusParentTrigger } = { ...options };
1177
+ const keyManager = this.keyManager;
1178
+ const trigger = this.triggerItem;
1179
+ if (menu === trigger?.getMenuTrigger()?.getMenu()) {
1180
+ trigger?.getMenuTrigger()?.close();
1181
+ // If the user has moused over a sibling item we want to focus the element under mouse focus
1182
+ // not the trigger which previously opened the now closed menu.
1183
+ if (focusParentTrigger) {
1184
+ if (trigger) {
1185
+ keyManager.setActiveItem(trigger);
1186
+ }
1187
+ else {
1188
+ keyManager.setFirstItemActive();
1189
+ }
1190
+ }
1191
+ }
1192
+ }
1193
+ /** Setup the FocusKeyManager with the correct orientation for the menu. */
1194
+ _setKeyManager() {
1195
+ this.keyManager = new FocusKeyManager(this.items).withWrap().withTypeAhead().withHomeAndEnd();
1196
+ if (this.orientation === 'horizontal') {
1197
+ this.keyManager.withHorizontalOrientation(this.dir?.value || 'ltr');
1198
+ }
1199
+ else {
1200
+ this.keyManager.withVerticalOrientation();
1201
+ }
1202
+ }
1203
+ /**
1204
+ * Subscribe to the menu trigger's open events in order to track the trigger which opened the menu
1205
+ * and stop tracking it when the menu is closed.
1206
+ */
1207
+ _subscribeToMenuOpen() {
1208
+ const exitCondition = merge(this.items.changes, this.destroyed);
1209
+ this.items.changes
1210
+ .pipe(startWith(this.items), mergeMap((list) => list
1211
+ .filter(item => item.hasMenu)
1212
+ .map(item => item.getMenuTrigger().opened.pipe(mapTo(item), takeUntil(exitCondition)))), mergeAll(), switchMap((item) => {
1213
+ this.triggerItem = item;
1214
+ return item.getMenuTrigger().closed;
1215
+ }), takeUntil(this.destroyed))
1216
+ .subscribe(() => (this.triggerItem = undefined));
1217
+ }
1218
+ /** Subscribe to the MenuStack close events. */
1219
+ _subscribeToMenuStackClosed() {
1220
+ this.menuStack.closed
1221
+ .pipe(takeUntil(this.destroyed))
1222
+ .subscribe(({ item, focusParentTrigger }) => this.closeOpenMenu(item, { focusParentTrigger }));
1223
+ }
1224
+ /** Subscribe to the MenuStack hasFocus events. */
1225
+ _subscribeToMenuStackHasFocus() {
1226
+ if (this.isInline) {
1227
+ this.menuStack.hasFocus.pipe(takeUntil(this.destroyed)).subscribe(hasFocus => {
1228
+ this._menuStackHasFocus = hasFocus;
1229
+ });
1230
+ }
1231
+ }
1232
+ /**
1233
+ * Set the PointerFocusTracker and ensure that when mouse focus changes the key manager is updated
1234
+ * with the latest menu item under mouse focus.
1235
+ */
1236
+ _setUpPointerTracker() {
1237
+ if (this.menuAim) {
1238
+ this.ngZone.runOutsideAngular(() => {
1239
+ this.pointerTracker = new PointerFocusTracker(this.items);
1240
+ });
1241
+ this.menuAim.initialize(this, this.pointerTracker);
1242
+ }
1243
+ }
1244
+ }
1245
+ CdkMenuBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuBase, deps: null, target: i0.ɵɵFactoryTarget.Directive });
1246
+ CdkMenuBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkMenuBase, inputs: { id: "id" }, host: { attributes: { "role": "menu" }, listeners: { "focus": "focusFirstItem()", "focusin": "menuStack.setHasFocus(true)", "focusout": "menuStack.setHasFocus(false)" }, properties: { "tabindex": "_getTabIndex()", "id": "id", "attr.aria-orientation": "orientation", "attr.data-cdk-menu-stack-id": "menuStack.id" } }, queries: [{ propertyName: "items", predicate: CdkMenuItem, descendants: true }], usesInheritance: true, ngImport: i0 });
1247
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuBase, decorators: [{
1248
+ type: Directive,
1249
+ args: [{
1250
+ host: {
1251
+ 'role': 'menu',
1252
+ 'class': '',
1253
+ '[tabindex]': '_getTabIndex()',
1254
+ '[id]': 'id',
1255
+ '[attr.aria-orientation]': 'orientation',
1256
+ '[attr.data-cdk-menu-stack-id]': 'menuStack.id',
1257
+ '(focus)': 'focusFirstItem()',
1258
+ '(focusin)': 'menuStack.setHasFocus(true)',
1259
+ '(focusout)': 'menuStack.setHasFocus(false)',
1260
+ },
1261
+ }]
1262
+ }], propDecorators: { id: [{
1263
+ type: Input
1264
+ }], items: [{
1265
+ type: ContentChildren,
1266
+ args: [CdkMenuItem, { descendants: true }]
1267
+ }] } });
1268
+
1269
+ /**
1270
+ * @license
1271
+ * Copyright Google LLC All Rights Reserved.
1272
+ *
1273
+ * Use of this source code is governed by an MIT-style license that can be
1274
+ * found in the LICENSE file at https://angular.io/license
1275
+ */
1276
+ /**
1277
+ * Directive which configures the element as a Menu which should contain child elements marked as
1278
+ * CdkMenuItem or CdkMenuGroup. Sets the appropriate role and aria-attributes for a menu and
1279
+ * contains accessible keyboard and mouse handling logic.
1280
+ *
1281
+ * It also acts as a RadioGroup for elements marked with role `menuitemradio`.
1282
+ */
1283
+ class CdkMenu extends CdkMenuBase {
1284
+ constructor() {
1285
+ super();
1286
+ this._parentTrigger = inject(MENU_TRIGGER, InjectFlags.Optional);
1287
+ /** Event emitted when the menu is closed. */
1288
+ this.closed = new EventEmitter();
1289
+ /** The direction items in the menu flow. */
1290
+ this.orientation = 'vertical';
1291
+ /** Whether the menu is displayed inline (i.e. always present vs a conditional popup that the user triggers with a trigger element). */
1292
+ this.isInline = !this._parentTrigger;
1293
+ this.destroyed.subscribe(this.closed);
1294
+ this._parentTrigger?.registerChildMenu(this);
1295
+ }
1296
+ ngAfterContentInit() {
1297
+ super.ngAfterContentInit();
1298
+ this._subscribeToMenuStackEmptied();
1299
+ }
1300
+ ngOnDestroy() {
1301
+ super.ngOnDestroy();
1302
+ this.closed.complete();
1303
+ }
1304
+ /**
1305
+ * Handle keyboard events for the Menu.
1306
+ * @param event The keyboard event to be handled.
1307
+ */
1308
+ _handleKeyEvent(event) {
1309
+ const keyManager = this.keyManager;
1310
+ switch (event.keyCode) {
1311
+ case LEFT_ARROW:
1312
+ case RIGHT_ARROW:
1313
+ if (!hasModifierKey(event)) {
1314
+ event.preventDefault();
1315
+ keyManager.setFocusOrigin('keyboard');
1316
+ keyManager.onKeydown(event);
1317
+ }
1318
+ break;
1319
+ case ESCAPE:
1320
+ if (!hasModifierKey(event)) {
1321
+ event.preventDefault();
1322
+ this.menuStack.close(this, {
1323
+ focusNextOnEmpty: 2 /* FocusNext.currentItem */,
1324
+ focusParentTrigger: true,
1325
+ });
1326
+ }
1327
+ break;
1328
+ case TAB:
1329
+ if (!hasModifierKey(event, 'altKey', 'metaKey', 'ctrlKey')) {
1330
+ this.menuStack.closeAll({ focusParentTrigger: true });
1331
+ }
1332
+ break;
1333
+ default:
1334
+ keyManager.onKeydown(event);
1335
+ }
1336
+ }
1337
+ /**
1338
+ * Set focus the either the current, previous or next item based on the FocusNext event.
1339
+ * @param focusNext The element to focus.
1340
+ */
1341
+ _toggleMenuFocus(focusNext) {
1342
+ const keyManager = this.keyManager;
1343
+ switch (focusNext) {
1344
+ case 0 /* FocusNext.nextItem */:
1345
+ keyManager.setFocusOrigin('keyboard');
1346
+ keyManager.setNextItemActive();
1347
+ break;
1348
+ case 1 /* FocusNext.previousItem */:
1349
+ keyManager.setFocusOrigin('keyboard');
1350
+ keyManager.setPreviousItemActive();
1351
+ break;
1352
+ case 2 /* FocusNext.currentItem */:
1353
+ if (keyManager.activeItem) {
1354
+ keyManager.setFocusOrigin('keyboard');
1355
+ keyManager.setActiveItem(keyManager.activeItem);
1356
+ }
1357
+ break;
1358
+ }
1359
+ }
1360
+ /** Subscribe to the MenuStack emptied events. */
1361
+ _subscribeToMenuStackEmptied() {
1362
+ this.menuStack.emptied
1363
+ .pipe(takeUntil(this.destroyed))
1364
+ .subscribe(event => this._toggleMenuFocus(event));
1365
+ }
1366
+ }
1367
+ CdkMenu.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenu, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1368
+ CdkMenu.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkMenu, selector: "[cdkMenu]", outputs: { closed: "closed" }, host: { attributes: { "role": "menu" }, listeners: { "keydown": "_handleKeyEvent($event)" }, properties: { "class.cdk-menu-inline": "isInline" }, classAttribute: "cdk-menu" }, providers: [
1369
+ { provide: CdkMenuGroup, useExisting: CdkMenu },
1370
+ { provide: CDK_MENU, useExisting: CdkMenu },
1371
+ PARENT_OR_NEW_INLINE_MENU_STACK_PROVIDER('vertical'),
1372
+ ], exportAs: ["cdkMenu"], usesInheritance: true, ngImport: i0 });
1373
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenu, decorators: [{
1374
+ type: Directive,
1375
+ args: [{
1376
+ selector: '[cdkMenu]',
1377
+ exportAs: 'cdkMenu',
1378
+ host: {
1379
+ 'role': 'menu',
1380
+ 'class': 'cdk-menu',
1381
+ '[class.cdk-menu-inline]': 'isInline',
1382
+ '(keydown)': '_handleKeyEvent($event)',
1383
+ },
1384
+ providers: [
1385
+ { provide: CdkMenuGroup, useExisting: CdkMenu },
1386
+ { provide: CDK_MENU, useExisting: CdkMenu },
1387
+ PARENT_OR_NEW_INLINE_MENU_STACK_PROVIDER('vertical'),
1388
+ ],
1389
+ }]
1390
+ }], ctorParameters: function () { return []; }, propDecorators: { closed: [{
1391
+ type: Output
1392
+ }] } });
1393
+
1394
+ /**
1395
+ * @license
1396
+ * Copyright Google LLC All Rights Reserved.
1397
+ *
1398
+ * Use of this source code is governed by an MIT-style license that can be
1399
+ * found in the LICENSE file at https://angular.io/license
1400
+ */
1401
+ /**
1402
+ * Directive applied to an element which configures it as a MenuBar by setting the appropriate
1403
+ * role, aria attributes, and accessible keyboard and mouse handling logic. The component that
1404
+ * this directive is applied to should contain components marked with CdkMenuItem.
1405
+ *
1406
+ */
1407
+ class CdkMenuBar extends CdkMenuBase {
1408
+ constructor() {
1409
+ super(...arguments);
1410
+ /** The direction items in the menu flow. */
1411
+ this.orientation = 'horizontal';
1412
+ /** Whether the menu is displayed inline (i.e. always present vs a conditional popup that the user triggers with a trigger element). */
1413
+ this.isInline = true;
1414
+ }
1415
+ ngAfterContentInit() {
1416
+ super.ngAfterContentInit();
1417
+ this._subscribeToMenuStackEmptied();
1418
+ }
1419
+ /**
1420
+ * Handle keyboard events for the Menu.
1421
+ * @param event The keyboard event to be handled.
1422
+ */
1423
+ _handleKeyEvent(event) {
1424
+ const keyManager = this.keyManager;
1425
+ switch (event.keyCode) {
1426
+ case UP_ARROW:
1427
+ case DOWN_ARROW:
1428
+ case LEFT_ARROW:
1429
+ case RIGHT_ARROW:
1430
+ if (!hasModifierKey(event)) {
1431
+ const horizontalArrows = event.keyCode === LEFT_ARROW || event.keyCode === RIGHT_ARROW;
1432
+ // For a horizontal menu if the left/right keys were clicked, or a vertical menu if the
1433
+ // up/down keys were clicked: if the current menu is open, close it then focus and open the
1434
+ // next menu.
1435
+ if (horizontalArrows) {
1436
+ event.preventDefault();
1437
+ const prevIsOpen = keyManager.activeItem?.isMenuOpen();
1438
+ keyManager.activeItem?.getMenuTrigger()?.close();
1439
+ keyManager.setFocusOrigin('keyboard');
1440
+ keyManager.onKeydown(event);
1441
+ if (prevIsOpen) {
1442
+ keyManager.activeItem?.getMenuTrigger()?.open();
1443
+ }
1444
+ }
1445
+ }
1446
+ break;
1447
+ case ESCAPE:
1448
+ if (!hasModifierKey(event)) {
1449
+ event.preventDefault();
1450
+ keyManager.activeItem?.getMenuTrigger()?.close();
1451
+ }
1452
+ break;
1453
+ case TAB:
1454
+ if (!hasModifierKey(event, 'altKey', 'metaKey', 'ctrlKey')) {
1455
+ keyManager.activeItem?.getMenuTrigger()?.close();
1456
+ }
1457
+ break;
1458
+ default:
1459
+ keyManager.onKeydown(event);
1460
+ }
1461
+ }
1462
+ /**
1463
+ * Set focus to either the current, previous or next item based on the FocusNext event, then
1464
+ * open the previous or next item.
1465
+ * @param focusNext The element to focus.
1466
+ */
1467
+ _toggleOpenMenu(focusNext) {
1468
+ const keyManager = this.keyManager;
1469
+ switch (focusNext) {
1470
+ case 0 /* FocusNext.nextItem */:
1471
+ keyManager.setFocusOrigin('keyboard');
1472
+ keyManager.setNextItemActive();
1473
+ keyManager.activeItem?.getMenuTrigger()?.open();
1474
+ break;
1475
+ case 1 /* FocusNext.previousItem */:
1476
+ keyManager.setFocusOrigin('keyboard');
1477
+ keyManager.setPreviousItemActive();
1478
+ keyManager.activeItem?.getMenuTrigger()?.open();
1479
+ break;
1480
+ case 2 /* FocusNext.currentItem */:
1481
+ if (keyManager.activeItem) {
1482
+ keyManager.setFocusOrigin('keyboard');
1483
+ keyManager.setActiveItem(keyManager.activeItem);
1484
+ }
1485
+ break;
1486
+ }
1487
+ }
1488
+ /** Subscribe to the MenuStack emptied events. */
1489
+ _subscribeToMenuStackEmptied() {
1490
+ this.menuStack?.emptied
1491
+ .pipe(takeUntil(this.destroyed))
1492
+ .subscribe(event => this._toggleOpenMenu(event));
1493
+ }
1494
+ }
1495
+ CdkMenuBar.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuBar, deps: null, target: i0.ɵɵFactoryTarget.Directive });
1496
+ CdkMenuBar.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkMenuBar, selector: "[cdkMenuBar]", host: { attributes: { "role": "menubar" }, listeners: { "keydown": "_handleKeyEvent($event)" }, classAttribute: "cdk-menu-bar" }, providers: [
1497
+ { provide: CdkMenuGroup, useExisting: CdkMenuBar },
1498
+ { provide: CDK_MENU, useExisting: CdkMenuBar },
1499
+ { provide: MENU_STACK, useFactory: () => MenuStack.inline('horizontal') },
1500
+ ], exportAs: ["cdkMenuBar"], usesInheritance: true, ngImport: i0 });
1501
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuBar, decorators: [{
1502
+ type: Directive,
1503
+ args: [{
1504
+ selector: '[cdkMenuBar]',
1505
+ exportAs: 'cdkMenuBar',
1506
+ host: {
1507
+ 'role': 'menubar',
1508
+ 'class': 'cdk-menu-bar',
1509
+ '(keydown)': '_handleKeyEvent($event)',
1510
+ },
1511
+ providers: [
1512
+ { provide: CdkMenuGroup, useExisting: CdkMenuBar },
1513
+ { provide: CDK_MENU, useExisting: CdkMenuBar },
1514
+ { provide: MENU_STACK, useFactory: () => MenuStack.inline('horizontal') },
1515
+ ],
1516
+ }]
1517
+ }] });
1518
+
1519
+ /**
1520
+ * @license
1521
+ * Copyright Google LLC All Rights Reserved.
1522
+ *
1523
+ * Use of this source code is governed by an MIT-style license that can be
1524
+ * found in the LICENSE file at https://angular.io/license
1525
+ */
1526
+ /** Base class providing checked state for selectable MenuItems. */
1527
+ class CdkMenuItemSelectable extends CdkMenuItem {
1528
+ constructor() {
1529
+ super(...arguments);
1530
+ this._checked = false;
1531
+ /** Whether the item should close the menu if triggered by the spacebar. */
1532
+ this.closeOnSpacebarTrigger = false;
1533
+ }
1534
+ /** Whether the element is checked */
1535
+ get checked() {
1536
+ return this._checked;
1537
+ }
1538
+ set checked(value) {
1539
+ this._checked = coerceBooleanProperty(value);
1540
+ }
1541
+ }
1542
+ CdkMenuItemSelectable.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuItemSelectable, deps: null, target: i0.ɵɵFactoryTarget.Directive });
1543
+ CdkMenuItemSelectable.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkMenuItemSelectable, inputs: { checked: ["cdkMenuItemChecked", "checked"] }, host: { properties: { "attr.aria-checked": "!!checked", "attr.aria-disabled": "disabled || null" } }, usesInheritance: true, ngImport: i0 });
1544
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuItemSelectable, decorators: [{
1545
+ type: Directive,
1546
+ args: [{
1547
+ host: {
1548
+ '[attr.aria-checked]': '!!checked',
1549
+ '[attr.aria-disabled]': 'disabled || null',
1550
+ },
1551
+ }]
1552
+ }], propDecorators: { checked: [{
1553
+ type: Input,
1554
+ args: ['cdkMenuItemChecked']
1555
+ }] } });
1556
+
1557
+ /**
1558
+ * @license
1559
+ * Copyright Google LLC All Rights Reserved.
1560
+ *
1561
+ * Use of this source code is governed by an MIT-style license that can be
1562
+ * found in the LICENSE file at https://angular.io/license
1563
+ */
1564
+ /** Counter used to set a unique id and name for a selectable item */
1565
+ let nextId = 0;
1566
+ /**
1567
+ * A directive providing behavior for the "menuitemradio" ARIA role, which behaves similarly to
1568
+ * a conventional radio-button. Any sibling `CdkMenuItemRadio` instances within the same `CdkMenu`
1569
+ * or `CdkMenuGroup` comprise a radio group with unique selection enforced.
1570
+ */
1571
+ class CdkMenuItemRadio extends CdkMenuItemSelectable {
1572
+ constructor() {
1573
+ super();
1574
+ /** The unique selection dispatcher for this radio's `CdkMenuGroup`. */
1575
+ this._selectionDispatcher = inject(UniqueSelectionDispatcher);
1576
+ /** An ID to identify this radio item to the `UniqueSelectionDisptcher`. */
1577
+ this._id = `${nextId++}`;
1578
+ this._registerDispatcherListener();
1579
+ }
1580
+ ngOnDestroy() {
1581
+ super.ngOnDestroy();
1582
+ this._removeDispatcherListener();
1583
+ }
1584
+ /**
1585
+ * Toggles the checked state of the radio-button.
1586
+ * @param options Options the configure how the item is triggered
1587
+ * - keepOpen: specifies that the menu should be kept open after triggering the item.
1588
+ */
1589
+ trigger(options) {
1590
+ super.trigger(options);
1591
+ if (!this.disabled) {
1592
+ this._selectionDispatcher.notify(this._id, '');
1593
+ }
1594
+ }
1595
+ /** Configure the unique selection dispatcher listener in order to toggle the checked state */
1596
+ _registerDispatcherListener() {
1597
+ this._removeDispatcherListener = this._selectionDispatcher.listen((id) => {
1598
+ this.checked = this._id === id;
1599
+ });
1600
+ }
1601
+ }
1602
+ CdkMenuItemRadio.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuItemRadio, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1603
+ CdkMenuItemRadio.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkMenuItemRadio, selector: "[cdkMenuItemRadio]", host: { attributes: { "role": "menuitemradio" }, properties: { "class.cdk-menu-item-radio": "true" } }, providers: [
1604
+ { provide: CdkMenuItemSelectable, useExisting: CdkMenuItemRadio },
1605
+ { provide: CdkMenuItem, useExisting: CdkMenuItemSelectable },
1606
+ ], exportAs: ["cdkMenuItemRadio"], usesInheritance: true, ngImport: i0 });
1607
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuItemRadio, decorators: [{
1608
+ type: Directive,
1609
+ args: [{
1610
+ selector: '[cdkMenuItemRadio]',
1611
+ exportAs: 'cdkMenuItemRadio',
1612
+ host: {
1613
+ 'role': 'menuitemradio',
1614
+ '[class.cdk-menu-item-radio]': 'true',
1615
+ },
1616
+ providers: [
1617
+ { provide: CdkMenuItemSelectable, useExisting: CdkMenuItemRadio },
1618
+ { provide: CdkMenuItem, useExisting: CdkMenuItemSelectable },
1619
+ ],
1620
+ }]
1621
+ }], ctorParameters: function () { return []; } });
1622
+
1623
+ /**
1624
+ * @license
1625
+ * Copyright Google LLC All Rights Reserved.
1626
+ *
1627
+ * Use of this source code is governed by an MIT-style license that can be
1628
+ * found in the LICENSE file at https://angular.io/license
1629
+ */
1630
+ /**
1631
+ * A directive providing behavior for the "menuitemcheckbox" ARIA role, which behaves similarly to a
1632
+ * conventional checkbox.
1633
+ */
1634
+ class CdkMenuItemCheckbox extends CdkMenuItemSelectable {
1635
+ /**
1636
+ * Toggle the checked state of the checkbox.
1637
+ * @param options Options the configure how the item is triggered
1638
+ * - keepOpen: specifies that the menu should be kept open after triggering the item.
1639
+ */
1640
+ trigger(options) {
1641
+ super.trigger(options);
1642
+ if (!this.disabled) {
1643
+ this.checked = !this.checked;
1644
+ }
1645
+ }
1646
+ }
1647
+ CdkMenuItemCheckbox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuItemCheckbox, deps: null, target: i0.ɵɵFactoryTarget.Directive });
1648
+ CdkMenuItemCheckbox.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkMenuItemCheckbox, selector: "[cdkMenuItemCheckbox]", host: { attributes: { "role": "menuitemcheckbox" }, properties: { "class.cdk-menu-item-checkbox": "true" } }, providers: [
1649
+ { provide: CdkMenuItemSelectable, useExisting: CdkMenuItemCheckbox },
1650
+ { provide: CdkMenuItem, useExisting: CdkMenuItemSelectable },
1651
+ ], exportAs: ["cdkMenuItemCheckbox"], usesInheritance: true, ngImport: i0 });
1652
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuItemCheckbox, decorators: [{
1653
+ type: Directive,
1654
+ args: [{
1655
+ selector: '[cdkMenuItemCheckbox]',
1656
+ exportAs: 'cdkMenuItemCheckbox',
1657
+ host: {
1658
+ 'role': 'menuitemcheckbox',
1659
+ '[class.cdk-menu-item-checkbox]': 'true',
1660
+ },
1661
+ providers: [
1662
+ { provide: CdkMenuItemSelectable, useExisting: CdkMenuItemCheckbox },
1663
+ { provide: CdkMenuItem, useExisting: CdkMenuItemSelectable },
1664
+ ],
1665
+ }]
1666
+ }] });
1667
+
1668
+ /**
1669
+ * @license
1670
+ * Copyright Google LLC All Rights Reserved.
1671
+ *
1672
+ * Use of this source code is governed by an MIT-style license that can be
1673
+ * found in the LICENSE file at https://angular.io/license
1674
+ */
1675
+ /** The preferred menu positions for the context menu. */
1676
+ const CONTEXT_MENU_POSITIONS = STANDARD_DROPDOWN_BELOW_POSITIONS.map(position => {
1677
+ // In cases where the first menu item in the context menu is a trigger the submenu opens on a
1678
+ // hover event. We offset the context menu 2px by default to prevent this from occurring.
1679
+ const offsetX = position.overlayX === 'start' ? 2 : -2;
1680
+ const offsetY = position.overlayY === 'top' ? 2 : -2;
1681
+ return { ...position, offsetX, offsetY };
1682
+ });
1683
+ /** Tracks the last open context menu trigger across the entire application. */
1684
+ class ContextMenuTracker {
1685
+ /**
1686
+ * Close the previous open context menu and set the given one as being open.
1687
+ * @param trigger The trigger for the currently open Context Menu.
1688
+ */
1689
+ update(trigger) {
1690
+ if (ContextMenuTracker._openContextMenuTrigger !== trigger) {
1691
+ ContextMenuTracker._openContextMenuTrigger?.close();
1692
+ ContextMenuTracker._openContextMenuTrigger = trigger;
1693
+ }
1694
+ }
1695
+ }
1696
+ ContextMenuTracker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: ContextMenuTracker, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1697
+ ContextMenuTracker.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: ContextMenuTracker, providedIn: 'root' });
1698
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: ContextMenuTracker, decorators: [{
1699
+ type: Injectable,
1700
+ args: [{ providedIn: 'root' }]
1701
+ }] });
1702
+ /**
1703
+ * A directive that opens a menu when a user right-clicks within its host element.
1704
+ * It is aware of nested context menus and will trigger only the lowest level non-disabled context menu.
1705
+ */
1706
+ class CdkContextMenuTrigger extends CdkMenuTriggerBase {
1707
+ constructor() {
1708
+ super();
1709
+ /** The CDK overlay service. */
1710
+ this._overlay = inject(Overlay);
1711
+ /** The directionality of the page. */
1712
+ this._directionality = inject(Directionality, InjectFlags.Optional);
1713
+ /** The app's context menu tracking registry */
1714
+ this._contextMenuTracker = inject(ContextMenuTracker);
1715
+ this._disabled = false;
1716
+ this._setMenuStackCloseListener();
1717
+ }
1718
+ /** Whether the context menu is disabled. */
1719
+ get disabled() {
1720
+ return this._disabled;
1721
+ }
1722
+ set disabled(value) {
1723
+ this._disabled = coerceBooleanProperty(value);
1724
+ }
1725
+ /**
1726
+ * Open the attached menu at the specified location.
1727
+ * @param coordinates where to open the context menu
1728
+ */
1729
+ open(coordinates) {
1730
+ this._open(coordinates, false);
1731
+ }
1732
+ /** Close the currently opened context menu. */
1733
+ close() {
1734
+ this.menuStack.closeAll();
1735
+ }
1736
+ /**
1737
+ * Open the context menu and closes any previously open menus.
1738
+ * @param event the mouse event which opens the context menu.
1739
+ */
1740
+ _openOnContextMenu(event) {
1741
+ if (!this.disabled) {
1742
+ // Prevent the native context menu from opening because we're opening a custom one.
1743
+ event.preventDefault();
1744
+ // Stop event propagation to ensure that only the closest enabled context menu opens.
1745
+ // Otherwise, any context menus attached to containing elements would *also* open,
1746
+ // resulting in multiple stacked context menus being displayed.
1747
+ event.stopPropagation();
1748
+ this._contextMenuTracker.update(this);
1749
+ this._open({ x: event.clientX, y: event.clientY }, true);
1750
+ // A context menu can be triggered via a mouse right click or a keyboard shortcut.
1751
+ if (event.button === 2) {
1752
+ this.childMenu?.focusFirstItem('mouse');
1753
+ }
1754
+ else if (event.button === 0) {
1755
+ this.childMenu?.focusFirstItem('keyboard');
1756
+ }
1757
+ else {
1758
+ this.childMenu?.focusFirstItem('program');
1759
+ }
1760
+ }
1761
+ }
1762
+ /**
1763
+ * Get the configuration object used to create the overlay.
1764
+ * @param coordinates the location to place the opened menu
1765
+ */
1766
+ _getOverlayConfig(coordinates) {
1767
+ return new OverlayConfig({
1768
+ positionStrategy: this._getOverlayPositionStrategy(coordinates),
1769
+ scrollStrategy: this._overlay.scrollStrategies.reposition(),
1770
+ direction: this._directionality || undefined,
1771
+ });
1772
+ }
1773
+ /**
1774
+ * Get the position strategy for the overlay which specifies where to place the menu.
1775
+ * @param coordinates the location to place the opened menu
1776
+ */
1777
+ _getOverlayPositionStrategy(coordinates) {
1778
+ return this._overlay
1779
+ .position()
1780
+ .flexibleConnectedTo(coordinates)
1781
+ .withLockedPosition()
1782
+ .withGrowAfterOpen()
1783
+ .withPositions(this.menuPosition ?? CONTEXT_MENU_POSITIONS);
1784
+ }
1785
+ /** Subscribe to the menu stack close events and close this menu when requested. */
1786
+ _setMenuStackCloseListener() {
1787
+ this.menuStack.closed.pipe(takeUntil(this.destroyed)).subscribe(({ item }) => {
1788
+ if (item === this.childMenu && this.isOpen()) {
1789
+ this.closed.next();
1790
+ this.overlayRef.detach();
1791
+ }
1792
+ });
1793
+ }
1794
+ /**
1795
+ * Subscribe to the overlays outside pointer events stream and handle closing out the stack if a
1796
+ * click occurs outside the menus.
1797
+ * @param ignoreFirstAuxClick Whether to ignore the first auxclick event outside the menu.
1798
+ */
1799
+ _subscribeToOutsideClicks(ignoreFirstAuxClick) {
1800
+ if (this.overlayRef) {
1801
+ let outsideClicks = this.overlayRef.outsidePointerEvents();
1802
+ // If the menu was triggered by the `contextmenu` event, skip the first `auxclick` event
1803
+ // because it fires when the mouse is released on the same click that opened the menu.
1804
+ if (ignoreFirstAuxClick) {
1805
+ const [auxClicks, nonAuxClicks] = partition(outsideClicks, ({ type }) => type === 'auxclick');
1806
+ outsideClicks = merge(nonAuxClicks, auxClicks.pipe(skip(1)));
1807
+ }
1808
+ outsideClicks.pipe(takeUntil(this.stopOutsideClicksListener)).subscribe(event => {
1809
+ if (!this.isElementInsideMenuStack(event.target)) {
1810
+ this.menuStack.closeAll();
1811
+ }
1812
+ });
1813
+ }
1814
+ }
1815
+ /**
1816
+ * Open the attached menu at the specified location.
1817
+ * @param coordinates where to open the context menu
1818
+ * @param ignoreFirstOutsideAuxClick Whether to ignore the first auxclick outside the menu after opening.
1819
+ */
1820
+ _open(coordinates, ignoreFirstOutsideAuxClick) {
1821
+ if (this.disabled) {
1822
+ return;
1823
+ }
1824
+ if (this.isOpen()) {
1825
+ // since we're moving this menu we need to close any submenus first otherwise they end up
1826
+ // disconnected from this one.
1827
+ this.menuStack.closeSubMenuOf(this.childMenu);
1828
+ this.overlayRef.getConfig().positionStrategy.setOrigin(coordinates);
1829
+ this.overlayRef.updatePosition();
1830
+ }
1831
+ else {
1832
+ this.opened.next();
1833
+ if (this.overlayRef) {
1834
+ this.overlayRef.getConfig().positionStrategy.setOrigin(coordinates);
1835
+ this.overlayRef.updatePosition();
1836
+ }
1837
+ else {
1838
+ this.overlayRef = this._overlay.create(this._getOverlayConfig(coordinates));
1839
+ }
1840
+ this.overlayRef.attach(this.getMenuContentPortal());
1841
+ this._subscribeToOutsideClicks(ignoreFirstOutsideAuxClick);
1842
+ }
1843
+ }
1844
+ }
1845
+ CdkContextMenuTrigger.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkContextMenuTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1846
+ CdkContextMenuTrigger.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkContextMenuTrigger, selector: "[cdkContextMenuTriggerFor]", inputs: { menuTemplateRef: ["cdkContextMenuTriggerFor", "menuTemplateRef"], menuPosition: ["cdkContextMenuPosition", "menuPosition"], disabled: ["cdkContextMenuDisabled", "disabled"] }, outputs: { opened: "cdkContextMenuOpened", closed: "cdkContextMenuClosed" }, host: { listeners: { "contextmenu": "_openOnContextMenu($event)" }, properties: { "attr.data-cdk-menu-stack-id": "null" } }, providers: [
1847
+ { provide: MENU_TRIGGER, useExisting: CdkContextMenuTrigger },
1848
+ { provide: MENU_STACK, useClass: MenuStack },
1849
+ ], exportAs: ["cdkContextMenuTriggerFor"], usesInheritance: true, ngImport: i0 });
1850
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkContextMenuTrigger, decorators: [{
1851
+ type: Directive,
1852
+ args: [{
1853
+ selector: '[cdkContextMenuTriggerFor]',
1854
+ exportAs: 'cdkContextMenuTriggerFor',
1855
+ host: {
1856
+ '[attr.data-cdk-menu-stack-id]': 'null',
1857
+ '(contextmenu)': '_openOnContextMenu($event)',
1858
+ },
1859
+ inputs: ['menuTemplateRef: cdkContextMenuTriggerFor', 'menuPosition: cdkContextMenuPosition'],
1860
+ outputs: ['opened: cdkContextMenuOpened', 'closed: cdkContextMenuClosed'],
1861
+ providers: [
1862
+ { provide: MENU_TRIGGER, useExisting: CdkContextMenuTrigger },
1863
+ { provide: MENU_STACK, useClass: MenuStack },
1864
+ ],
1865
+ }]
1866
+ }], ctorParameters: function () { return []; }, propDecorators: { disabled: [{
1867
+ type: Input,
1868
+ args: ['cdkContextMenuDisabled']
1869
+ }] } });
1870
+
1871
+ /**
1872
+ * @license
1873
+ * Copyright Google LLC All Rights Reserved.
1874
+ *
1875
+ * Use of this source code is governed by an MIT-style license that can be
1876
+ * found in the LICENSE file at https://angular.io/license
1877
+ */
1878
+ /** The list of components and directives that should be declared and exported from this module. */
1879
+ const EXPORTED_DECLARATIONS = [
1880
+ CdkMenuBar,
1881
+ CdkMenu,
1882
+ CdkMenuItem,
1883
+ CdkMenuItemRadio,
1884
+ CdkMenuItemCheckbox,
1885
+ CdkMenuTrigger,
1886
+ CdkMenuGroup,
1887
+ CdkContextMenuTrigger,
1888
+ CdkTargetMenuAim,
1889
+ ];
1890
+ /** Module that declares components and directives for the CDK menu. */
1891
+ class CdkMenuModule {
1892
+ }
1893
+ CdkMenuModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1894
+ CdkMenuModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuModule, declarations: [CdkMenuBar,
1895
+ CdkMenu,
1896
+ CdkMenuItem,
1897
+ CdkMenuItemRadio,
1898
+ CdkMenuItemCheckbox,
1899
+ CdkMenuTrigger,
1900
+ CdkMenuGroup,
1901
+ CdkContextMenuTrigger,
1902
+ CdkTargetMenuAim], imports: [OverlayModule], exports: [CdkMenuBar,
1903
+ CdkMenu,
1904
+ CdkMenuItem,
1905
+ CdkMenuItemRadio,
1906
+ CdkMenuItemCheckbox,
1907
+ CdkMenuTrigger,
1908
+ CdkMenuGroup,
1909
+ CdkContextMenuTrigger,
1910
+ CdkTargetMenuAim] });
1911
+ CdkMenuModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuModule, imports: [OverlayModule] });
1912
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuModule, decorators: [{
1913
+ type: NgModule,
1914
+ args: [{
1915
+ imports: [OverlayModule],
1916
+ exports: EXPORTED_DECLARATIONS,
1917
+ declarations: EXPORTED_DECLARATIONS,
1918
+ }]
1919
+ }] });
1920
+
1921
+ /**
1922
+ * @license
1923
+ * Copyright Google LLC All Rights Reserved.
1924
+ *
1925
+ * Use of this source code is governed by an MIT-style license that can be
1926
+ * found in the LICENSE file at https://angular.io/license
1927
+ */
1928
+
1929
+ /**
1930
+ * @license
1931
+ * Copyright Google LLC All Rights Reserved.
1932
+ *
1933
+ * Use of this source code is governed by an MIT-style license that can be
1934
+ * found in the LICENSE file at https://angular.io/license
1935
+ */
1936
+
1937
+ /**
1938
+ * Generated bundle index. Do not edit.
1939
+ */
1940
+
1941
+ export { CDK_MENU, CdkContextMenuTrigger, CdkMenu, CdkMenuBar, CdkMenuBase, CdkMenuGroup, CdkMenuItem, CdkMenuItemCheckbox, CdkMenuItemRadio, CdkMenuItemSelectable, CdkMenuModule, CdkMenuTrigger, CdkMenuTriggerBase, CdkTargetMenuAim, ContextMenuTracker, MENU_AIM, MENU_STACK, MENU_TRIGGER, MenuStack, PARENT_OR_NEW_INLINE_MENU_STACK_PROVIDER, PARENT_OR_NEW_MENU_STACK_PROVIDER, PointerFocusTracker, TargetMenuAim };
1942
+ //# sourceMappingURL=menu.mjs.map