@4sh/ui-kit 0.16.0 → 0.17.0

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 (219) hide show
  1. package/README.fr.md +10 -10
  2. package/README.md +10 -10
  3. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs +542 -150
  4. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs.map +1 -1
  5. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs +622 -248
  6. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs.map +1 -1
  7. package/fesm2022/4sh-ui-kit-actions-ui-link.mjs +385 -152
  8. package/fesm2022/4sh-ui-kit-actions-ui-link.mjs.map +1 -1
  9. package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs +748 -433
  10. package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs.map +1 -1
  11. package/fesm2022/4sh-ui-kit-base-ui-icon.mjs +227 -135
  12. package/fesm2022/4sh-ui-kit-base-ui-icon.mjs.map +1 -1
  13. package/fesm2022/4sh-ui-kit-base-ui-image.mjs +1200 -633
  14. package/fesm2022/4sh-ui-kit-base-ui-image.mjs.map +1 -1
  15. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs +1675 -1000
  16. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs.map +1 -1
  17. package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs +243 -117
  18. package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs.map +1 -1
  19. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs +2294 -2048
  20. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs.map +1 -1
  21. package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs +1058 -1113
  22. package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs.map +1 -1
  23. package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs +1108 -0
  24. package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs.map +1 -0
  25. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs +397 -141
  26. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs.map +1 -1
  27. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs +1529 -583
  28. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs.map +1 -1
  29. package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs +383 -224
  30. package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs.map +1 -1
  31. package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs +345 -177
  32. package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs.map +1 -1
  33. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs +280 -138
  34. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs.map +1 -1
  35. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs +507 -257
  36. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs.map +1 -1
  37. package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs +401 -312
  38. package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs.map +1 -1
  39. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs +1277 -697
  40. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs.map +1 -1
  41. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs +467 -199
  42. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs.map +1 -1
  43. package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs +394 -270
  44. package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs.map +1 -1
  45. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs +140 -60
  46. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs.map +1 -1
  47. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs +386 -167
  48. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs.map +1 -1
  49. package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs +150 -87
  50. package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs.map +1 -1
  51. package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs +345 -180
  52. package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs.map +1 -1
  53. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs +582 -392
  54. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs.map +1 -1
  55. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs +1552 -888
  56. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs.map +1 -1
  57. package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs +485 -338
  58. package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs.map +1 -1
  59. package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs +503 -311
  60. package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs.map +1 -1
  61. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs +271 -137
  62. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs.map +1 -1
  63. package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs +457 -214
  64. package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs.map +1 -1
  65. package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs +711 -371
  66. package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs.map +1 -1
  67. package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs +235 -121
  68. package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs.map +1 -1
  69. package/fesm2022/4sh-ui-kit-forms.mjs +721 -638
  70. package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -1
  71. package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs +546 -242
  72. package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs.map +1 -1
  73. package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs +335 -157
  74. package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs.map +1 -1
  75. package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs +53 -33
  76. package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs.map +1 -1
  77. package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs +218 -121
  78. package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs.map +1 -1
  79. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs +192 -100
  80. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs.map +1 -1
  81. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs +456 -204
  82. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs.map +1 -1
  83. package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs +314 -147
  84. package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs.map +1 -1
  85. package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs +179 -82
  86. package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs.map +1 -1
  87. package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs +268 -123
  88. package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs.map +1 -1
  89. package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs +391 -146
  90. package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs.map +1 -1
  91. package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs +158 -76
  92. package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs.map +1 -1
  93. package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs +159 -80
  94. package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs.map +1 -1
  95. package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs +295 -131
  96. package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs.map +1 -1
  97. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs +211 -83
  98. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs.map +1 -1
  99. package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs +784 -414
  100. package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs.map +1 -1
  101. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs +822 -476
  102. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs.map +1 -1
  103. package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs +1014 -599
  104. package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs.map +1 -1
  105. package/fesm2022/4sh-ui-kit-layout-ui-card.mjs +403 -189
  106. package/fesm2022/4sh-ui-kit-layout-ui-card.mjs.map +1 -1
  107. package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs +707 -272
  108. package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs.map +1 -1
  109. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs +1146 -568
  110. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs.map +1 -1
  111. package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs +519 -308
  112. package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs.map +1 -1
  113. package/fesm2022/4sh-ui-kit-motion.mjs +252 -150
  114. package/fesm2022/4sh-ui-kit-motion.mjs.map +1 -1
  115. package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs +793 -341
  116. package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs.map +1 -1
  117. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs +351 -194
  118. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs.map +1 -1
  119. package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs +511 -220
  120. package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs.map +1 -1
  121. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs +910 -548
  122. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs.map +1 -1
  123. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs +1128 -555
  124. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs.map +1 -1
  125. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs +915 -470
  126. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs.map +1 -1
  127. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs +931 -474
  128. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs.map +1 -1
  129. package/fesm2022/4sh-ui-kit-overlay.mjs +26 -109
  130. package/fesm2022/4sh-ui-kit-overlay.mjs.map +1 -1
  131. package/fesm2022/4sh-ui-kit-ripple.mjs +329 -290
  132. package/fesm2022/4sh-ui-kit-ripple.mjs.map +1 -1
  133. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs +709 -248
  134. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs.map +1 -1
  135. package/fesm2022/4sh-ui-kit-table-ui-table.mjs +2633 -1370
  136. package/fesm2022/4sh-ui-kit-table-ui-table.mjs.map +1 -1
  137. package/fesm2022/4sh-ui-kit-theming.mjs +112 -113
  138. package/fesm2022/4sh-ui-kit-theming.mjs.map +1 -1
  139. package/fesm2022/4sh-ui-kit-types.mjs +0 -12
  140. package/fesm2022/4sh-ui-kit.mjs +3 -15
  141. package/fesm2022/4sh-ui-kit.mjs.map +1 -1
  142. package/mcp/data/component-api.json +299 -2
  143. package/mcp/data/text-search-docs.json +149 -9
  144. package/mcp/data/ui-config.json +378 -1
  145. package/mcp/index.js +8190 -2876
  146. package/mcp/package.json +1 -1
  147. package/package.json +5 -1
  148. package/styles/component-vars.scss +22 -1
  149. package/types/4sh-ui-kit-actions-ui-button-split.d.ts +198 -87
  150. package/types/4sh-ui-kit-actions-ui-button.d.ts +240 -116
  151. package/types/4sh-ui-kit-actions-ui-link.d.ts +136 -67
  152. package/types/4sh-ui-kit-actions-ui-speed-dial.d.ts +287 -180
  153. package/types/4sh-ui-kit-base-ui-icon.d.ts +92 -58
  154. package/types/4sh-ui-kit-base-ui-image.d.ts +406 -205
  155. package/types/4sh-ui-kit-forms-ui-autocomplete.d.ts +573 -376
  156. package/types/4sh-ui-kit-forms-ui-checkbox.d.ts +77 -42
  157. package/types/4sh-ui-kit-forms-ui-datepicker.d.ts +953 -700
  158. package/types/4sh-ui-kit-forms-ui-editor.d.ts +374 -340
  159. package/types/4sh-ui-kit-forms-ui-field-sign.d.ts +325 -0
  160. package/types/4sh-ui-kit-forms-ui-field.d.ts +150 -64
  161. package/types/4sh-ui-kit-forms-ui-file-upload.d.ts +583 -241
  162. package/types/4sh-ui-kit-forms-ui-input-date.d.ts +152 -103
  163. package/types/4sh-ui-kit-forms-ui-input-group.d.ts +109 -63
  164. package/types/4sh-ui-kit-forms-ui-input-mask.d.ts +93 -59
  165. package/types/4sh-ui-kit-forms-ui-input-number.d.ts +171 -96
  166. package/types/4sh-ui-kit-forms-ui-input-otp.d.ts +137 -104
  167. package/types/4sh-ui-kit-forms-ui-input-tags.d.ts +469 -309
  168. package/types/4sh-ui-kit-forms-ui-input.d.ts +198 -118
  169. package/types/4sh-ui-kit-forms-ui-knob.d.ts +132 -80
  170. package/types/4sh-ui-kit-forms-ui-label.d.ts +47 -22
  171. package/types/4sh-ui-kit-forms-ui-nudger.d.ts +134 -67
  172. package/types/4sh-ui-kit-forms-ui-radio.d.ts +48 -33
  173. package/types/4sh-ui-kit-forms-ui-rating.d.ts +120 -86
  174. package/types/4sh-ui-kit-forms-ui-segment-control.d.ts +221 -147
  175. package/types/4sh-ui-kit-forms-ui-select.d.ts +561 -357
  176. package/types/4sh-ui-kit-forms-ui-slider.d.ts +156 -105
  177. package/types/4sh-ui-kit-forms-ui-swatch-picker.d.ts +133 -97
  178. package/types/4sh-ui-kit-forms-ui-textarea.d.ts +90 -56
  179. package/types/4sh-ui-kit-forms-ui-toggle-block.d.ts +158 -94
  180. package/types/4sh-ui-kit-forms-ui-toggle-button.d.ts +314 -178
  181. package/types/4sh-ui-kit-forms-ui-toggle.d.ts +88 -54
  182. package/types/4sh-ui-kit-forms.d.ts +275 -194
  183. package/types/4sh-ui-kit-informative-ui-accordion.d.ts +162 -92
  184. package/types/4sh-ui-kit-informative-ui-alert.d.ts +128 -62
  185. package/types/4sh-ui-kit-informative-ui-avatar-group.d.ts +8 -8
  186. package/types/4sh-ui-kit-informative-ui-avatar.d.ts +81 -44
  187. package/types/4sh-ui-kit-informative-ui-badge.d.ts +71 -41
  188. package/types/4sh-ui-kit-informative-ui-chip.d.ts +194 -99
  189. package/types/4sh-ui-kit-informative-ui-empty-state.d.ts +105 -65
  190. package/types/4sh-ui-kit-informative-ui-helper.d.ts +64 -34
  191. package/types/4sh-ui-kit-informative-ui-progress-bar.d.ts +120 -65
  192. package/types/4sh-ui-kit-informative-ui-read-only.d.ts +147 -67
  193. package/types/4sh-ui-kit-informative-ui-separator.d.ts +65 -35
  194. package/types/4sh-ui-kit-informative-ui-skeleton.d.ts +62 -32
  195. package/types/4sh-ui-kit-informative-ui-spinner.d.ts +111 -50
  196. package/types/4sh-ui-kit-informative-ui-tag.d.ts +77 -37
  197. package/types/4sh-ui-kit-informative-ui-toast.d.ts +300 -180
  198. package/types/4sh-ui-kit-informative-ui-tooltip.d.ts +269 -141
  199. package/types/4sh-ui-kit-layout-ui-bottom-sheet.d.ts +360 -221
  200. package/types/4sh-ui-kit-layout-ui-card.d.ts +119 -79
  201. package/types/4sh-ui-kit-layout-ui-drawer.d.ts +244 -120
  202. package/types/4sh-ui-kit-layout-ui-modal.d.ts +409 -222
  203. package/types/4sh-ui-kit-layout-ui-popover.d.ts +149 -91
  204. package/types/4sh-ui-kit-motion.d.ts +117 -67
  205. package/types/4sh-ui-kit-navigation-ui-bottom-tab-bar.d.ts +279 -145
  206. package/types/4sh-ui-kit-navigation-ui-breadcrumb.d.ts +134 -96
  207. package/types/4sh-ui-kit-navigation-ui-context-menu.d.ts +148 -89
  208. package/types/4sh-ui-kit-navigation-ui-menu.d.ts +282 -201
  209. package/types/4sh-ui-kit-navigation-ui-sidebar.d.ts +425 -261
  210. package/types/4sh-ui-kit-navigation-ui-stepper.d.ts +279 -183
  211. package/types/4sh-ui-kit-navigation-ui-tabs.d.ts +275 -173
  212. package/types/4sh-ui-kit-overlay.d.ts +6 -6
  213. package/types/4sh-ui-kit-ripple.d.ts +99 -74
  214. package/types/4sh-ui-kit-table-ui-paginator.d.ts +237 -133
  215. package/types/4sh-ui-kit-table-ui-table.d.ts +769 -470
  216. package/types/4sh-ui-kit-theming.d.ts +27 -29
  217. package/types/4sh-ui-kit-types.d.ts +6 -5
  218. package/types/4sh-ui-kit.d.ts +4 -3
  219. package/fesm2022/4sh-ui-kit-types.mjs.map +0 -1
@@ -1,551 +1,913 @@
1
- import * as i0 from '@angular/core';
2
- import { input, booleanAttribute, model, numberAttribute, output, contentChild, computed, viewChild, signal, viewChildren, inject, effect, Component } from '@angular/core';
3
- import { DOCUMENT, NgTemplateOutlet } from '@angular/common';
4
- import { RouterLink, RouterLinkActive } from '@angular/router';
5
- import * as i1 from '@angular/cdk/overlay';
6
- import { CdkConnectedOverlay, OverlayModule } from '@angular/cdk/overlay';
7
- import { UiIcon } from '@4sh/ui-kit/base/ui-icon';
8
- import { UiMotion } from '@4sh/ui-kit/motion';
9
- import { closeOnNavigation } from '@4sh/ui-kit/overlay';
10
- import { UiSeparator } from '@4sh/ui-kit/informative/ui-separator';
11
-
12
- /** Process-wide counter for unique menu ids (aria wiring). */
1
+ import * as i0 from "@angular/core";
2
+ import { Component, booleanAttribute, computed, contentChild, effect, inject, input, model, numberAttribute, output, signal, viewChild, viewChildren } from "@angular/core";
3
+ import { DOCUMENT, NgTemplateOutlet } from "@angular/common";
4
+ import { RouterLink, RouterLinkActive } from "@angular/router";
5
+ import * as i1 from "@angular/cdk/overlay";
6
+ import { CdkConnectedOverlay, OverlayModule } from "@angular/cdk/overlay";
7
+ import { UiIcon } from "@4sh/ui-kit/base/ui-icon";
8
+ import { UiMotion } from "@4sh/ui-kit/motion";
9
+ import { closeOnNavigation } from "@4sh/ui-kit/overlay";
10
+ import { UiSeparator } from "@4sh/ui-kit/informative/ui-separator";
13
11
  let nextUid = 0;
14
- /** Trigger ↔ panel gap — keep aligned with `$overlay-panel-offset` (ui-config). */
15
12
  const OVERLAY_OFFSET = 8;
16
- /**
17
- * ui-menu — headless navigation / command menu, static or popup.
18
- *
19
- * Driven by a declarative `items` model ({@link UiMenuItem}): labeled groups
20
- * with separators, collapsible submenus (nested groups are toggleable by
21
- * default, override per item with `toggleable`), commands, router links and
22
- * external URLs. The open/closed state of toggleable groups is controllable
23
- * (and two-way bindable) through `expandedKeys`, keyed by the items' `id`.
24
- *
25
- * `popup` mode renders the panel in a CDK overlay anchored to the element
26
- * that triggered `toggle(event)` / `show(event)`.
27
- *
28
- * Styled 100% with the `navigation.*` tokens; the panel shell shares the
29
- * structural `overlay-panel` recipe with the other floating panels.
30
- *
31
- * Customisation: `#item` template (menuitem content, `$implicit` = item),
32
- * `#submenuheader` (group headers), `#start` / `#end` slots around the list.
33
- */
34
- class UiMenu {
35
- constructor() {
36
- /** Menu entries (see {@link UiMenuItem}). */
37
- this.items = input([], /* @ts-ignore */
38
- ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
39
- /** Popup mode: the panel opens in an overlay via `toggle(event)` / `show(event)`. */
40
- this.popup = input(false, { ...(ngDevMode ? { debugName: "popup" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
41
- /**
42
- * Open/closed state of the toggleable groups, keyed by item `id`
43
- * (`{ [id]: boolean }`). Two-way bindable; a key absent from the map
44
- * falls back to the item's own `expanded`, then to closed.
45
- */
46
- this.expandedKeys = model({}, /* @ts-ignore */
47
- ...(ngDevMode ? [{ debugName: "expandedKeys" }] : /* istanbul ignore next */ []));
48
- /** Accessible name of the menu list. */
49
- this.ariaLabel = input(/* @ts-ignore */
50
- ...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
51
- /** id of an external element labelling the menu list. */
52
- this.ariaLabelledBy = input(/* @ts-ignore */
53
- ...(ngDevMode ? [undefined, { debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []));
54
- /** Extra class(es) applied to the panel (scoped custom styling). */
55
- this.styleClass = input(/* @ts-ignore */
56
- ...(ngDevMode ? [undefined, { debugName: "styleClass" }] : /* istanbul ignore next */ []));
57
- /** Color family: `high` (default) or `low` navigation tokens. */
58
- this.level = input('high', /* @ts-ignore */
59
- ...(ngDevMode ? [{ debugName: "level" }] : /* istanbul ignore next */ []));
60
- /** Density: `default`, or `small` for compact action menus ("…" buttons). */
61
- this.size = input('default', /* @ts-ignore */
62
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
63
- /** Group rendering: `inline` sections/accordions (default) or `flyout` cascading side panels. */
64
- this.submenus = input('inline', /* @ts-ignore */
65
- ...(ngDevMode ? [{ debugName: "submenus" }] : /* istanbul ignore next */ []));
66
- /** Animate the popup entrance and the submenu collapse (reduced-motion always wins). */
67
- this.motion = input(true, { ...(ngDevMode ? { debugName: "motion" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
68
- /** Ripple Effect */
69
- this.ripple = input(true, { ...(ngDevMode ? { debugName: "ripple" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
70
- /** Auto-flip the popup above the trigger when space is lacking below. */
71
- this.autoFlip = input(true, { ...(ngDevMode ? { debugName: "autoFlip" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
72
- /** Tabindex of the menu's roving tab stop. */
73
- this.tabindex = input(0, { ...(ngDevMode ? { debugName: "tabindex" } : /* istanbul ignore next */ {}), transform: numberAttribute });
74
- /** Emitted when the popup opens. */
75
- this.opened = output();
76
- /** Emitted when the popup closes. */
77
- this.closed = output();
78
- /** Emitted when a leaf item is clicked / keyboard-activated (never when disabled). */
79
- this.itemClick = output();
80
- /** Menuitem content template, provided programmatically (embedding components like ui-context-menu). */
81
- this.itemTemplate = input(/* @ts-ignore */
82
- ...(ngDevMode ? [undefined, { debugName: "itemTemplate" }] : /* istanbul ignore next */ []));
83
- /** Group-header content template, provided programmatically (embedding components). */
84
- this.submenuHeaderTemplate = input(/* @ts-ignore */
85
- ...(ngDevMode ? [undefined, { debugName: "submenuHeaderTemplate" }] : /* istanbul ignore next */ []));
86
- /** Custom menuitem content: `<ng-template #item let-item>`. */
87
- this.itemTemplateContent = contentChild('item', /* @ts-ignore */
88
- ...(ngDevMode ? [{ debugName: "itemTemplateContent" }] : /* istanbul ignore next */ []));
89
- /** Custom group-header content: `<ng-template #submenuheader let-item>`. */
90
- this.submenuHeaderTemplateContent = contentChild('submenuheader', /* @ts-ignore */
91
- ...(ngDevMode ? [{ debugName: "submenuHeaderTemplateContent" }] : /* istanbul ignore next */ []));
92
- /** @ignore Input wins over the projected `#item` template. */
93
- this.resolvedItemTemplate = computed(() => this.itemTemplate() ?? this.itemTemplateContent(), /* @ts-ignore */
94
- ...(ngDevMode ? [{ debugName: "resolvedItemTemplate" }] : /* istanbul ignore next */ []));
95
- /** @ignore Input wins over the projected `#submenuheader` template. */
96
- this.resolvedSubmenuHeaderTemplate = computed(() => this.submenuHeaderTemplate() ?? this.submenuHeaderTemplateContent(), /* @ts-ignore */
97
- ...(ngDevMode ? [{ debugName: "resolvedSubmenuHeaderTemplate" }] : /* istanbul ignore next */ []));
98
- /** Free content rendered before the list. */
99
- this.startTemplate = contentChild('start', /* @ts-ignore */
100
- ...(ngDevMode ? [{ debugName: "startTemplate" }] : /* istanbul ignore next */ []));
101
- /** Free content rendered after the list. */
102
- this.endTemplate = contentChild('end', /* @ts-ignore */
103
- ...(ngDevMode ? [{ debugName: "endTemplate" }] : /* istanbul ignore next */ []));
104
- /** @ignore Panel root (overlay or inline) — keyboard focus queries. */
105
- this.panelEl = viewChild('panel', /* @ts-ignore */
106
- ...(ngDevMode ? [{ debugName: "panelEl" }] : /* istanbul ignore next */ []));
107
- /** Unique id of the panel (public: wire the trigger's `aria-controls` to it). */
108
- this.uid = `ui-menu-${nextUid++}`;
109
- /** @ignore Popup open state. */
110
- this.popupOpen = signal(false, /* @ts-ignore */
111
- ...(ngDevMode ? [{ debugName: "popupOpen" }] : /* istanbul ignore next */ []));
112
- /** @ignore Element the overlay is anchored to (the `toggle(event)` trigger). */
113
- this.overlayOrigin = signal(null, /* @ts-ignore */
114
- ...(ngDevMode ? [{ debugName: "overlayOrigin" }] : /* istanbul ignore next */ []));
115
- /** @ignore Key of the node owning the roving tabindex. */
116
- this.focusedKey = signal(null, /* @ts-ignore */
117
- ...(ngDevMode ? [{ debugName: "focusedKey" }] : /* istanbul ignore next */ []));
118
- /** @ignore Key of the open flyout submenu (one per level; children have their own). */
119
- this.openFlyoutKey = signal(null, /* @ts-ignore */
120
- ...(ngDevMode ? [{ debugName: "openFlyoutKey" }] : /* istanbul ignore next */ []));
121
- /** @ignore Nested flyout menus rendered by this instance (matched by `items` reference). */
122
- this.childMenus = viewChildren(UiMenu, /* @ts-ignore */
123
- ...(ngDevMode ? [{ debugName: "childMenus" }] : /* istanbul ignore next */ []));
124
- /** @ignore All connected overlays of this instance (popup + flyouts). */
125
- this.connectedOverlays = viewChildren(CdkConnectedOverlay, /* @ts-ignore */
126
- ...(ngDevMode ? [{ debugName: "connectedOverlays" }] : /* istanbul ignore next */ []));
127
- /** @ignore */
128
- this.doc = inject(DOCUMENT);
129
- /** @ignore Below the trigger, flipping above when `autoFlip` and space is lacking. */
130
- this.overlayPositions = computed(() => {
131
- const below = {
132
- originX: 'start',
133
- originY: 'bottom',
134
- overlayX: 'start',
135
- overlayY: 'top',
136
- offsetY: OVERLAY_OFFSET,
137
- };
138
- const above = {
139
- originX: 'start',
140
- originY: 'top',
141
- overlayX: 'start',
142
- overlayY: 'bottom',
143
- offsetY: -OVERLAY_OFFSET,
144
- };
145
- return this.autoFlip() ? [below, above] : [below];
146
- }, /* @ts-ignore */
147
- ...(ngDevMode ? [{ debugName: "overlayPositions" }] : /* istanbul ignore next */ []));
148
- /** @ignore Flyout panel beside its parent item: right-start first, then flips.
149
- * The vertical offset aligns the child's first item with the parent item. */
150
- this.flyoutPositions = [
151
- {
152
- originX: 'end',
153
- originY: 'top',
154
- overlayX: 'start',
155
- overlayY: 'top',
156
- offsetY: -OVERLAY_OFFSET,
157
- },
158
- {
159
- originX: 'start',
160
- originY: 'top',
161
- overlayX: 'end',
162
- overlayY: 'top',
163
- offsetY: -OVERLAY_OFFSET,
164
- },
165
- {
166
- originX: 'end',
167
- originY: 'bottom',
168
- overlayX: 'start',
169
- overlayY: 'bottom',
170
- offsetY: OVERLAY_OFFSET,
171
- },
172
- {
173
- originX: 'start',
174
- originY: 'bottom',
175
- overlayX: 'end',
176
- overlayY: 'bottom',
177
- offsetY: OVERLAY_OFFSET,
178
- },
179
- ];
180
- /** @ignore Resolved render tree (kinds, keys, expanded state). */
181
- this.nodes = computed(() => this.buildNodes(this.items(), this.uid, 0), /* @ts-ignore */
182
- ...(ngDevMode ? [{ debugName: "nodes" }] : /* istanbul ignore next */ []));
183
- /** @ignore Keys of the focusable entries, in visual order (roving focus path). */
184
- this.focusableKeys = computed(() => {
185
- const keys = [];
186
- const walk = (nodes) => {
187
- for (const node of nodes) {
188
- if (node.kind === 'separator')
189
- continue;
190
- if ((node.kind === 'item' || node.kind === 'flyout') && !node.item.disabled)
191
- keys.push(node.key);
192
- if (node.kind === 'toggle' && !node.item.disabled) {
193
- keys.push(node.key);
194
- if (node.expanded)
195
- walk(node.children);
196
- }
197
- if (node.kind === 'header')
198
- walk(node.children);
199
- }
200
- };
201
- walk(this.nodes());
202
- return keys;
203
- }, /* @ts-ignore */
204
- ...(ngDevMode ? [{ debugName: "focusableKeys" }] : /* istanbul ignore next */ []));
205
- /** @ignore Node owning the tab stop: last focused, else first focusable. */
206
- this.tabStopKey = computed(() => {
207
- const keys = this.focusableKeys();
208
- const focused = this.focusedKey();
209
- return focused && keys.includes(focused) ? focused : (keys[0] ?? null);
210
- }, /* @ts-ignore */
211
- ...(ngDevMode ? [{ debugName: "tabStopKey" }] : /* istanbul ignore next */ []));
212
- /** @ignore */
213
- this.panelClasses = computed(() => {
214
- const c = ['ui-menu', `_${this.level()}`];
215
- if (this.size() !== 'default')
216
- c.push(`_${this.size()}`);
217
- if (this.popup())
218
- c.push('_popup');
219
- if (!this.motion())
220
- c.push('_no-motion');
221
- const extra = this.styleClass();
222
- if (extra)
223
- c.push(extra);
224
- return c.join(' ');
225
- }, /* @ts-ignore */
226
- ...(ngDevMode ? [{ debugName: "panelClasses" }] : /* istanbul ignore next */ []));
227
- // A menu declared in an app shell outlives the routed view: dismiss its
228
- // floating panels rather than carrying them over to the next page.
229
- closeOnNavigation(() => {
230
- this.hide();
231
- this.closeFlyouts();
232
- });
233
- // Keep floating panels GLUED to their scrolling anchors: while the popup
234
- // or a flyout is open, re-apply the overlay positions on any scroll (the
235
- // CDK reposition scroll strategy proved unreliable in zoneless contexts).
236
- effect((onCleanup) => {
237
- const active = this.popupOpen() || this.openFlyoutKey() !== null;
238
- if (!active || typeof window === 'undefined')
239
- return;
240
- // Deferred a macrotask: when this menu is itself in an overlay (context
241
- // menu / popup), ITS panel is re-anchored during the next change
242
- // detection — flyouts must re-read their origin AFTER that move.
243
- const handler = () => setTimeout(() => {
244
- // The trigger can be gone while the menu lives on (its page was
245
- // destroyed): re-positioning on a detached origin measures 0×0 and
246
- // would snap the panel to the top-left corner.
247
- if (this.popupOpen() && this.overlayOrigin()?.isConnected === false) {
248
- this.hide();
249
- return;
250
- }
251
- for (const overlay of this.connectedOverlays()) {
252
- if (overlay.open)
253
- overlay.overlayRef?.updatePosition();
254
- }
255
- });
256
- this.doc.addEventListener('scroll', handler, { capture: true, passive: true });
257
- onCleanup(() => this.doc.removeEventListener('scroll', handler, true));
258
- });
259
- }
260
- // --- Popup ------------------------------------------------------------
261
- /** Toggles the popup relative to the event's `currentTarget`. */
262
- toggle(event) {
263
- this.popupOpen() ? this.hide() : this.show(event);
264
- }
265
- /** Opens the popup anchored to the event's `currentTarget`. */
266
- show(event) {
267
- if (!this.popup() || this.popupOpen())
268
- return;
269
- this.overlayOrigin.set((event.currentTarget ?? event.target));
270
- this.popupOpen.set(true);
271
- this.opened.emit();
272
- this.queueFocusTabStop();
273
- }
274
- /** Moves focus onto the menu's roving tab stop (first focusable entry). */
275
- focusFirst() {
276
- this.queueFocusTabStop();
277
- }
278
- /** Closes the popup. */
279
- hide(focusTrigger = false) {
280
- if (!this.popupOpen())
281
- return;
282
- this.popupOpen.set(false);
283
- this.focusedKey.set(null);
284
- this.openFlyoutKey.set(null);
285
- this.closed.emit();
286
- if (focusTrigger)
287
- this.overlayOrigin()?.focus?.();
288
- }
289
- /** Closes any open flyout submenu (recursively, children detach with their parent). */
290
- closeFlyouts() {
291
- this.openFlyoutKey.set(null);
292
- }
293
- // --- Interactions -------------------------------------------------------
294
- /** @ignore Leaf activation: command + itemClick, popup auto-close. */
295
- onItemClick(event, node) {
296
- const item = node.item;
297
- if (item.disabled) {
298
- event.preventDefault();
299
- return;
300
- }
301
- if (!item.url && !item.routerLink)
302
- event.preventDefault();
303
- this.focusedKey.set(node.key);
304
- item.command?.({ originalEvent: event, item });
305
- this.itemClick.emit({ originalEvent: event, item });
306
- if (this.popup())
307
- this.hide(true);
308
- }
309
- // --- Flyout submenus ------------------------------------------------------
310
- /** @ignore Click on a flyout parent item: open its side panel (never toggle, hover already opened it). */
311
- onFlyoutClick(node) {
312
- if (node.item.disabled)
313
- return;
314
- this.focusedKey.set(node.key);
315
- this.openFlyoutKey.set(node.key);
316
- }
317
- /** @ignore Hovering an entry: open its flyout, or close the sibling one. */
318
- onEntryHover(node) {
319
- if (node.kind === 'flyout' && !node.item.disabled)
320
- this.openFlyoutKey.set(node.key);
321
- else
322
- this.openFlyoutKey.set(null);
323
- }
324
- /** @ignore `ArrowLeft`/`Escape` inside a flyout panel: close it, focus its parent item. */
325
- onFlyoutPanelKeydown(event, node) {
326
- if (event.key !== 'ArrowLeft' && event.key !== 'Escape')
327
- return;
328
- event.preventDefault();
329
- event.stopPropagation();
330
- this.openFlyoutKey.set(null);
331
- this.focusByKey(node.key);
332
- }
333
- /** @ignore Activation bubbling up from a flyout submenu: re-emit and close. */
334
- onChildItemClick(event) {
335
- this.itemClick.emit(event);
336
- this.openFlyoutKey.set(null);
337
- if (this.popup())
338
- this.hide(true);
339
- }
340
- /** @ignore Open a flyout and move focus onto its first entry. The overlay
341
- * attaches after change detection: retry over macrotasks (NOT rAF — it
342
- * never fires in throttled/background tabs). */
343
- openFlyoutAndFocus(node, attempts = 20) {
344
- this.openFlyoutKey.set(node.key);
345
- setTimeout(() => {
346
- // Nested menus are view children; match ours by its `items` reference.
347
- const menu = this.childMenus().find((child) => child.items() === node.item.items);
348
- if (menu)
349
- menu.focusFirst();
350
- else if (attempts > 0)
351
- this.openFlyoutAndFocus(node, attempts - 1);
352
- });
353
- }
354
- /** @ignore Expand/collapse a toggleable group (updates `expandedKeys`). */
355
- onToggleClick(node) {
356
- if (node.item.disabled)
357
- return;
358
- this.focusedKey.set(node.key);
359
- this.setExpanded(node, !node.expanded);
360
- }
361
- /** @ignore */
362
- setExpanded(node, expanded) {
363
- if (node.expanded === expanded)
364
- return;
365
- this.expandedKeys.update((keys) => ({ ...keys, [node.key]: expanded }));
366
- }
367
- /** @ignore Roving keyboard navigation (WAI-ARIA menu pattern). */
368
- onListKeydown(event) {
369
- const keys = this.focusableKeys();
370
- if (!keys.length)
371
- return;
372
- const currentKey = this.currentFocusKey(event);
373
- const index = currentKey ? keys.indexOf(currentKey) : -1;
374
- switch (event.key) {
375
- case 'ArrowDown':
376
- event.preventDefault();
377
- this.focusByKey(keys[(index + 1) % keys.length]);
378
- break;
379
- case 'ArrowUp':
380
- event.preventDefault();
381
- this.focusByKey(keys[(index - 1 + keys.length) % keys.length]);
382
- break;
383
- case 'Home':
384
- event.preventDefault();
385
- this.focusByKey(keys[0]);
386
- break;
387
- case 'End':
388
- event.preventDefault();
389
- this.focusByKey(keys[keys.length - 1]);
390
- break;
391
- case 'ArrowRight':
392
- case 'ArrowLeft': {
393
- const node = currentKey ? this.findNode(currentKey) : null;
394
- if (node?.kind === 'toggle') {
395
- event.preventDefault();
396
- this.setExpanded(node, event.key === 'ArrowRight');
397
- }
398
- else if (node?.kind === 'flyout') {
399
- event.preventDefault();
400
- if (event.key === 'ArrowRight')
401
- this.openFlyoutAndFocus(node);
402
- else
403
- this.openFlyoutKey.set(null);
404
- }
405
- break;
406
- }
407
- case ' ': {
408
- // Space activates anchors too (native only on buttons).
409
- const target = event.target;
410
- if (target.tagName === 'A') {
411
- event.preventDefault();
412
- target.click();
413
- }
414
- break;
415
- }
416
- case 'Escape':
417
- if (this.popup()) {
418
- event.preventDefault();
419
- this.hide(true);
420
- }
421
- break;
422
- }
423
- }
424
- /** @ignore */
425
- onEntryFocus(node) {
426
- this.focusedKey.set(node.key);
427
- }
428
- /** @ignore Popup outside interaction: ignore events landing in ANY overlay
429
- * (our flyout side panels are separate overlay elements). */
430
- onPopupOutsideClick(event) {
431
- if (event.target instanceof Element && event.target.closest('.cdk-overlay-container'))
432
- return;
433
- this.hide();
434
- }
435
- /** @ignore id of a header label (aria-labelledby of its group). */
436
- headerId(node) {
437
- return `${this.uid}-${node.key}-label`;
438
- }
439
- /** @ignore id of a collapsible group (aria-controls of its toggle). */
440
- groupId(node) {
441
- return `${this.uid}-${node.key}-group`;
442
- }
443
- // --- Internals ----------------------------------------------------------
444
- /** @ignore */
445
- buildNodes(items, parentKey, depth) {
446
- const expandedKeys = this.expandedKeys();
447
- return items
448
- .filter((item) => item.visible !== false)
449
- .map((item, index) => {
450
- const key = item.id ?? `${parentKey}_${index}`;
451
- if (item.separator) {
452
- return {
453
- item,
454
- key,
455
- kind: 'separator',
456
- children: [],
457
- expanded: false,
458
- depth,
459
- };
460
- }
461
- if (item.items) {
462
- // Flyout mode: every group becomes a cascading side panel.
463
- if (this.submenus() === 'flyout') {
464
- return {
465
- item,
466
- key,
467
- kind: 'flyout',
468
- children: [],
469
- expanded: false,
470
- depth,
471
- };
472
- }
473
- const toggleable = item.toggleable ?? depth > 0;
474
- const expanded = toggleable ? (expandedKeys[key] ?? item.expanded ?? false) : true;
475
- return {
476
- item,
477
- key,
478
- kind: toggleable ? 'toggle' : 'header',
479
- children: this.buildNodes(item.items, key, depth + 1),
480
- expanded,
481
- depth,
482
- };
483
- }
484
- return {
485
- item,
486
- key,
487
- kind: 'item',
488
- children: [],
489
- expanded: false,
490
- depth,
491
- };
492
- });
493
- }
494
- /** @ignore */
495
- findNode(key, nodes = this.nodes()) {
496
- for (const node of nodes) {
497
- if (node.key === key)
498
- return node;
499
- const found = this.findNode(key, node.children);
500
- if (found)
501
- return found;
502
- }
503
- return null;
504
- }
505
- /** @ignore Key of the entry currently holding DOM focus. */
506
- currentFocusKey(event) {
507
- const el = event.target.closest?.('[data-key]');
508
- return el?.getAttribute('data-key') ?? this.focusedKey();
509
- }
510
- /** @ignore Move DOM focus (and the tab stop) to the entry with the given key. */
511
- focusByKey(key) {
512
- if (!key)
513
- return;
514
- this.focusedKey.set(key);
515
- this.panelEl()
516
- ?.nativeElement.querySelector(`[data-key="${CSS.escape(key)}"]`)
517
- ?.focus();
518
- }
519
- /** @ignore Focus the roving tab stop once the panel is rendered
520
- * (macrotask, not rAF: rAF never fires in throttled/background tabs). */
521
- queueFocusTabStop() {
522
- setTimeout(() => this.focusByKey(this.tabStopKey() ?? undefined));
523
- }
524
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiMenu, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
525
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: UiMenu, isStandalone: true, selector: "ui-menu", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, popup: { classPropertyName: "popup", publicName: "popup", isSignal: true, isRequired: false, transformFunction: null }, expandedKeys: { classPropertyName: "expandedKeys", publicName: "expandedKeys", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: true, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null }, level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, submenus: { classPropertyName: "submenus", publicName: "submenus", isSignal: true, isRequired: false, transformFunction: null }, motion: { classPropertyName: "motion", publicName: "motion", isSignal: true, isRequired: false, transformFunction: null }, ripple: { classPropertyName: "ripple", publicName: "ripple", isSignal: true, isRequired: false, transformFunction: null }, autoFlip: { classPropertyName: "autoFlip", publicName: "autoFlip", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null }, itemTemplate: { classPropertyName: "itemTemplate", publicName: "itemTemplate", isSignal: true, isRequired: false, transformFunction: null }, submenuHeaderTemplate: { classPropertyName: "submenuHeaderTemplate", publicName: "submenuHeaderTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expandedKeys: "expandedKeysChange", opened: "opened", closed: "closed", itemClick: "itemClick" }, host: { properties: { "style.display": "popup() ? 'contents' : 'block'" } }, queries: [{ propertyName: "itemTemplateContent", first: true, predicate: ["item"], descendants: true, isSignal: true }, { propertyName: "submenuHeaderTemplateContent", first: true, predicate: ["submenuheader"], descendants: true, isSignal: true }, { propertyName: "startTemplate", first: true, predicate: ["start"], descendants: true, isSignal: true }, { propertyName: "endTemplate", first: true, predicate: ["end"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "panelEl", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "childMenus", predicate: UiMenu, descendants: true, isSignal: true }, { propertyName: "connectedOverlays", predicate: CdkConnectedOverlay, descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Menu panel: shared between inline render and the CDK overlay popup. -->\n<ng-template #panelTpl>\n <div\n #panel\n [class]=\"panelClasses()\"\n [attr.id]=\"uid\"\n [uiMotion]=\"'slide-down'\"\n [motionDisabled]=\"!motion()\"\n #panelMotion=\"uiMotion\"\n [motionOnInsert]=\"popup()\"\n >\n @if (startTemplate(); as tpl) {\n <div class=\"ui-menu-start\">\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n </div>\n }\n\n <!-- ARIA menu pattern: keyboard delegated to the role=\"menu\" container, focus\n lives on the items (roving tabindex). -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <ul\n class=\"ui-menu-list\"\n role=\"menu\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n (keydown)=\"onListKeydown($event)\"\n >\n <ng-container\n [ngTemplateOutlet]=\"nodesTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: nodes() }\"\n />\n </ul>\n\n @if (endTemplate(); as tpl) {\n <div class=\"ui-menu-end\">\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n </div>\n }\n </div>\n</ng-template>\n\n<!-- Recursive node list (separator | header section | toggleable group | leaf item). -->\n<ng-template #nodesTpl let-nodes>\n @for (node of nodes; track node.key) {\n @switch (node.kind) {\n @case ('separator') {\n <li class=\"ui-menu-separator\" role=\"separator\" aria-hidden=\"true\">\n <ui-separator></ui-separator>\n </li>\n }\n\n @case ('header') {\n <li class=\"ui-menu-section\" role=\"none\" [class]=\"node.item.styleClass ?? ''\">\n <span class=\"ui-menu-header\" [attr.id]=\"headerId(node)\">\n @if (resolvedSubmenuHeaderTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: node.item }\"\n />\n } @else {\n @if (node.item.icon; as icon) {\n <ui-icon class=\"ui-menu-item-icon\" [name]=\"icon\" size=\"sm\" />\n }\n <span class=\"ui-menu-item-label\">{{ node.item.label }}</span>\n }\n </span>\n <ul class=\"ui-menu-group\" role=\"group\" [attr.aria-labelledby]=\"headerId(node)\">\n <ng-container\n [ngTemplateOutlet]=\"nodesTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: node.children }\"\n />\n </ul>\n </li>\n }\n\n @case ('toggle') {\n <li class=\"ui-menu-entry\" role=\"none\" [class]=\"node.item.styleClass ?? ''\">\n <button\n type=\"button\"\n class=\"ui-menu-action _toggle\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n role=\"menuitem\"\n [attr.data-key]=\"node.key\"\n [attr.aria-expanded]=\"node.expanded\"\n [attr.aria-controls]=\"groupId(node)\"\n [attr.aria-label]=\"node.item.ariaLabel || null\"\n [attr.title]=\"node.item.title || null\"\n [disabled]=\"node.item.disabled ?? false\"\n [attr.tabindex]=\"node.key === tabStopKey() ? tabindex() : -1\"\n (click)=\"onToggleClick(node)\"\n (mouseenter)=\"onEntryHover(node)\"\n (focus)=\"onEntryFocus(node)\"\n >\n @if (resolvedSubmenuHeaderTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: node.item }\"\n />\n } @else {\n @if (node.item.icon; as icon) {\n <ui-icon class=\"ui-menu-item-icon\" [name]=\"icon\" size=\"sm\" />\n }\n <span class=\"ui-menu-item-label\">{{ node.item.label }}</span>\n }\n <!-- `_open`, not `_expanded`: a global helper class `._expanded` (width:100%) exists. -->\n <ui-icon\n class=\"ui-menu-chevron\"\n [class._open]=\"node.expanded\"\n name=\"chevron-down\"\n size=\"sm\"\n />\n </button>\n <div\n class=\"ui-menu-collapse\"\n [class._open]=\"node.expanded\"\n [attr.id]=\"groupId(node)\"\n [attr.inert]=\"node.expanded ? null : ''\"\n >\n <div class=\"ui-menu-collapse-inner\">\n <ul class=\"ui-menu-group _nested\" role=\"group\">\n <ng-container\n [ngTemplateOutlet]=\"nodesTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: node.children }\"\n />\n </ul>\n </div>\n </div>\n </li>\n }\n\n @case ('flyout') {\n <li\n class=\"ui-menu-entry\"\n role=\"none\"\n [class]=\"node.item.styleClass ?? ''\"\n cdkOverlayOrigin\n #flyoutOrigin=\"cdkOverlayOrigin\"\n >\n <button\n type=\"button\"\n class=\"ui-menu-action _has-sub\"\n [class._sub-open]=\"openFlyoutKey() === node.key\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n role=\"menuitem\"\n aria-haspopup=\"menu\"\n [attr.data-key]=\"node.key\"\n [attr.aria-expanded]=\"openFlyoutKey() === node.key\"\n [attr.aria-label]=\"node.item.ariaLabel || null\"\n [attr.title]=\"node.item.title || null\"\n [disabled]=\"node.item.disabled ?? false\"\n [attr.tabindex]=\"node.key === tabStopKey() ? tabindex() : -1\"\n (click)=\"onFlyoutClick(node)\"\n (mouseenter)=\"onEntryHover(node)\"\n (focus)=\"onEntryFocus(node)\"\n >\n @if (resolvedItemTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: node.item }\"\n />\n } @else {\n @if (node.item.icon; as icon) {\n <ui-icon class=\"ui-menu-item-icon\" [name]=\"icon\" size=\"sm\" />\n }\n <span class=\"ui-menu-item-label\">{{ node.item.label }}</span>\n }\n <ui-icon class=\"ui-menu-chevron\" name=\"chevron-right\" size=\"sm\" />\n </button>\n\n <!-- Cascading side panel: a nested menu in its own overlay, anchored to the item. -->\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"flyoutOrigin\"\n [cdkConnectedOverlayOpen]=\"openFlyoutKey() === node.key\"\n [cdkConnectedOverlayPositions]=\"flyoutPositions\"\n >\n <!-- Flyout: keyboard delegated to the panel, focus lives on the items. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"ui-menu-flyout\"\n [uiMotion]=\"'fade'\"\n [motionDisabled]=\"!motion()\"\n #flyoutMotion=\"uiMotion\"\n motionOnInsert\n (keydown)=\"onFlyoutPanelKeydown($event, node)\"\n >\n <ui-menu\n [items]=\"node.item.items ?? []\"\n [level]=\"level()\"\n [size]=\"size()\"\n [motion]=\"motion()\"\n submenus=\"flyout\"\n styleClass=\"_floating\"\n [itemTemplate]=\"resolvedItemTemplate()\"\n [submenuHeaderTemplate]=\"resolvedSubmenuHeaderTemplate()\"\n [ariaLabel]=\"node.item.label\"\n (itemClick)=\"onChildItemClick($event)\"\n />\n </div>\n </ng-template>\n </li>\n }\n\n @case ('item') {\n <li class=\"ui-menu-entry\" role=\"none\" [class]=\"node.item.styleClass ?? ''\">\n <!-- Shared menuitem content (icon + label, or the #item template). -->\n <ng-template #content>\n @if (resolvedItemTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: node.item }\"\n />\n } @else {\n @if (node.item.icon; as icon) {\n <ui-icon class=\"ui-menu-item-icon\" [name]=\"icon\" size=\"sm\" />\n }\n <span class=\"ui-menu-item-label\">{{ node.item.label }}</span>\n }\n </ng-template>\n\n @if (node.item.routerLink !== undefined && !node.item.disabled) {\n <a\n class=\"ui-menu-action\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n role=\"menuitem\"\n [attr.data-key]=\"node.key\"\n [routerLink]=\"node.item.routerLink\"\n [queryParams]=\"node.item.queryParams ?? null\"\n [queryParamsHandling]=\"node.item.queryParamsHandling ?? null\"\n routerLinkActive=\"_active\"\n [routerLinkActiveOptions]=\"{ exact: node.item.routerLinkActiveExact ?? false }\"\n [attr.target]=\"node.item.target || null\"\n [attr.aria-label]=\"node.item.ariaLabel || null\"\n [attr.title]=\"node.item.title || null\"\n [attr.tabindex]=\"node.key === tabStopKey() ? tabindex() : -1\"\n (click)=\"onItemClick($event, node)\"\n (mouseenter)=\"onEntryHover(node)\"\n (focus)=\"onEntryFocus(node)\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n } @else if (node.item.url && !node.item.disabled) {\n <a\n class=\"ui-menu-action\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n role=\"menuitem\"\n [attr.data-key]=\"node.key\"\n [attr.href]=\"node.item.url\"\n [attr.target]=\"node.item.target || null\"\n [attr.rel]=\"node.item.target === '_blank' ? 'noopener noreferrer' : null\"\n [attr.aria-label]=\"node.item.ariaLabel || null\"\n [attr.title]=\"node.item.title || null\"\n [attr.tabindex]=\"node.key === tabStopKey() ? tabindex() : -1\"\n (click)=\"onItemClick($event, node)\"\n (mouseenter)=\"onEntryHover(node)\"\n (focus)=\"onEntryFocus(node)\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n } @else {\n <button\n type=\"button\"\n class=\"ui-menu-action\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n role=\"menuitem\"\n [attr.data-key]=\"node.key\"\n [disabled]=\"node.item.disabled ?? false\"\n [attr.aria-label]=\"node.item.ariaLabel || null\"\n [attr.title]=\"node.item.title || null\"\n [attr.tabindex]=\"node.key === tabStopKey() ? tabindex() : -1\"\n (click)=\"onItemClick($event, node)\"\n (mouseenter)=\"onEntryHover(node)\"\n (focus)=\"onEntryFocus(node)\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </button>\n }\n </li>\n }\n }\n }\n</ng-template>\n\n@if (popup()) {\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayOrigin()!\"\n [cdkConnectedOverlayOpen]=\"popupOpen()\"\n [cdkConnectedOverlayPositions]=\"overlayPositions()\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n (backdropClick)=\"hide()\"\n (overlayOutsideClick)=\"onPopupOutsideClick($event)\"\n (detach)=\"hide()\"\n >\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\n </ng-template>\n} @else {\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\n}\n", styles: [".ui-menu{display:flex;flex-direction:column;gap:var(--units-2xs);padding:var(--ui-menu-panel-padding, var(--ui-overlay-panel-padding, var(--units-sm)));box-sizing:border-box;border:var(--ui-control-stroke-width, var(--stroke-default)) solid var(--ui-overlay-stroke, transparent);border-radius:var(--ui-overlay-radius, var(--ui-overlay-panel-radius, var(--radius-default)));background-color:var(--ui-overlay-surface, var(--ui-menu-panel-surface, var(--global-background-default)));box-shadow:var(--ui-overlay-shadow, var(--ui-overlay-panel-shadow, var(--shadow-default-md)));font-family:var(--ui-overlay-panel-font-family, var(--fontfamily-base));border:none;min-width:var(--ui-menu-min-width, 13.125rem)}.ui-menu .ui-menu-action{min-height:var(--ui-menu-item-height, 2.5rem);padding:0 var(--ui-menu-item-padding-x, var(--units-md));font-size:var(--ui-menu-font-size, var(--size-typography-text-default))}.ui-menu .ui-menu-header{min-height:var(--ui-menu-header-height, 2rem);padding:0 var(--ui-menu-item-padding-x, var(--units-md));font-size:var(--ui-menu-header-font-size, var(--size-typography-text-md))}.ui-menu._popup,.ui-menu._floating{width:max-content;max-width:calc(100vw - var(--units-lg));max-height:calc(100vh - var(--units-lg));overflow:auto}.ui-menu-list,.ui-menu-group{display:flex;flex-direction:column;gap:var(--units-2xs);margin:0;padding:0;list-style:none}.ui-menu-group._nested{padding-left:var(--ui-menu-group-indent, var(--units-default))}.ui-menu-section,.ui-menu-entry{display:flex;flex-direction:column;gap:var(--units-2xs)}.ui-menu._small{min-width:var(--ui-menu-min-width-small, 10rem)}.ui-menu._small .ui-menu-action{min-height:var(--ui-menu-item-height-small, 2rem);padding:0 var(--ui-menu-item-padding-x-small, var(--units-sm));font-size:var(--ui-menu-font-size-small, var(--size-typography-text-md))}.ui-menu._small .ui-menu-header{min-height:var(--ui-menu-header-height-small, 1.5rem);padding:0 var(--ui-menu-item-padding-x-small, var(--units-sm));font-size:var(--ui-menu-header-font-size-small, var(--size-typography-text-sm))}.ui-menu-header{display:flex;align-items:center;gap:var(--units-sm);font-weight:var(--ui-menu-header-weight, var(--weight-bold));-webkit-user-select:none;user-select:none}.ui-menu-action{display:flex;align-items:center;gap:var(--units-sm);box-sizing:border-box;width:100%;border:none;border-radius:var(--ui-menu-item-radius, var(--radius-sm));background:none;font-family:var(--ui-menu-font-family, var(--fontfamily-base));font-size:var(--size-typography-text-default);font-weight:var(--ui-menu-action-weight, var(--weight-regular));line-height:1.2;text-align:left;text-decoration:none;cursor:pointer;transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),box-shadow var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-menu-action:focus-visible{outline:none;box-shadow:inset 0 0 0 var(--ui-menu-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-menu-action-focus-ring-color, var(--global-border-focus))}.ui-menu-action:disabled{cursor:not-allowed}.ui-menu-item-icon,.ui-menu-chevron{flex-shrink:0;line-height:0}.ui-menu-item-label{flex:1 1 auto;min-width:0}.ui-menu-chevron{margin-left:auto;transition:rotate var(--ui-motion-duration, var(--motion-toggle-duration, var(--transition-default))) var(--ui-motion-easing, var(--motion-toggle-easing, var(--transition-easeinout))) var(--ui-motion-delay, 0ms)}.ui-menu-chevron._open{rotate:180deg}.ui-menu-flyout{display:block}.ui-menu-collapse{display:grid;grid-template-rows:0fr;opacity:0;transition:grid-template-rows var(--ui-motion-duration, var(--motion-toggle-duration, var(--transition-default))) var(--ui-motion-easing, var(--motion-toggle-easing, var(--transition-easeinout))) var(--ui-motion-delay, 0ms),opacity var(--ui-motion-duration, var(--motion-toggle-duration, var(--transition-default))) var(--ui-motion-easing, var(--motion-toggle-easing, var(--transition-easeinout))) var(--ui-motion-delay, 0ms)}.ui-menu-collapse._open{grid-template-rows:1fr;opacity:1}.ui-menu-collapse-inner{min-height:0;overflow:hidden}.ui-menu._no-motion .ui-menu-collapse,.ui-menu._no-motion .ui-menu-chevron{transition:none}.ui-menu-separator{border:none}.ui-menu-start,.ui-menu-end{padding:var(--units-2xs) var(--units-md)}.ui-menu._high .ui-menu-header{color:var(--ui-menu-header-color, var(--navigation-high-content-default))}.ui-menu._high .ui-menu-action{color:var(--ui-menu-action-color, var(--navigation-high-content-default))}.ui-menu._high .ui-menu-action:hover:not(:disabled){background-color:var(--ui-menu-action-surface-hover, var(--navigation-high-surface-hover));color:var(--ui-menu-action-color-hover, var(--navigation-high-content-hover))}.ui-menu._high .ui-menu-action:active:not(:disabled){background-color:var(--ui-menu-action-surface-pressed, var(--navigation-high-surface-active));color:var(--ui-menu-action-color-pressed, var(--navigation-high-content-active))}.ui-menu._high .ui-menu-action._sub-open:not(:disabled){background-color:var(--ui-menu-action-surface-hover, var(--navigation-high-surface-hover));color:var(--ui-menu-action-color-hover, var(--navigation-high-content-hover))}.ui-menu._high .ui-menu-action._active{background-color:var(--ui-menu-action-surface-active, var(--navigation-high-surface-active));color:var(--ui-menu-action-color-active, var(--navigation-high-content-active))}.ui-menu._high .ui-menu-action:disabled{background-color:var(--ui-menu-action-surface-disabled, var(--navigation-high-surface-disabled));color:var(--ui-menu-action-color-disabled, var(--navigation-high-content-disabled))}.ui-menu._low .ui-menu-header{color:var(--ui-menu-header-color, var(--navigation-low-content-default))}.ui-menu._low .ui-menu-action{color:var(--ui-menu-action-color, var(--navigation-low-content-default))}.ui-menu._low .ui-menu-action:hover:not(:disabled){background-color:var(--ui-menu-action-surface-hover, var(--navigation-low-surface-hover));color:var(--ui-menu-action-color-hover, var(--navigation-low-content-hover))}.ui-menu._low .ui-menu-action:active:not(:disabled){background-color:var(--ui-menu-action-surface-pressed, var(--navigation-low-surface-active));color:var(--ui-menu-action-color-pressed, var(--navigation-low-content-active))}.ui-menu._low .ui-menu-action._sub-open:not(:disabled){background-color:var(--ui-menu-action-surface-hover, var(--navigation-low-surface-hover));color:var(--ui-menu-action-color-hover, var(--navigation-low-content-hover))}.ui-menu._low .ui-menu-action._active{background-color:var(--ui-menu-action-surface-active, var(--navigation-low-surface-active));color:var(--ui-menu-action-color-active, var(--navigation-low-content-active))}.ui-menu._low .ui-menu-action:disabled{background-color:var(--ui-menu-action-surface-disabled, var(--navigation-low-surface-disabled));color:var(--ui-menu-action-color-disabled, var(--navigation-low-content-disabled))}\n"], dependencies: [{ kind: "component", type: UiMenu, selector: "ui-menu", inputs: ["items", "popup", "expandedKeys", "ariaLabel", "ariaLabelledBy", "styleClass", "level", "size", "submenus", "motion", "ripple", "autoFlip", "tabindex", "itemTemplate", "submenuHeaderTemplate"], outputs: ["expandedKeysChange", "opened", "closed", "itemClick"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i1.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }, { kind: "directive", type: UiMotion, selector: "[uiMotion]", inputs: ["uiMotion", "motionDuration", "motionDelay", "motionEasing", "motionEnterEasing", "motionLeaveEasing", "motionDistance", "motionScale", "motionDisabled", "motionOnInsert"], exportAs: ["uiMotion"] }, { kind: "component", type: UiSeparator, selector: "ui-separator", inputs: ["label", "orientation", "variant", "size", "labelAlign", "ariaLabel"] }] }); }
526
- }
527
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiMenu, decorators: [{
528
- type: Component,
529
- args: [{ selector: 'ui-menu', imports: [
530
- NgTemplateOutlet,
531
- OverlayModule,
532
- RouterLink,
533
- RouterLinkActive,
534
- UiIcon,
535
- UiMotion,
536
- UiSeparator,
537
- ], host: {
538
- '[style.display]': "popup() ? 'contents' : 'block'",
539
- }, template: "<!-- Menu panel: shared between inline render and the CDK overlay popup. -->\n<ng-template #panelTpl>\n <div\n #panel\n [class]=\"panelClasses()\"\n [attr.id]=\"uid\"\n [uiMotion]=\"'slide-down'\"\n [motionDisabled]=\"!motion()\"\n #panelMotion=\"uiMotion\"\n [motionOnInsert]=\"popup()\"\n >\n @if (startTemplate(); as tpl) {\n <div class=\"ui-menu-start\">\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n </div>\n }\n\n <!-- ARIA menu pattern: keyboard delegated to the role=\"menu\" container, focus\n lives on the items (roving tabindex). -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <ul\n class=\"ui-menu-list\"\n role=\"menu\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n (keydown)=\"onListKeydown($event)\"\n >\n <ng-container\n [ngTemplateOutlet]=\"nodesTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: nodes() }\"\n />\n </ul>\n\n @if (endTemplate(); as tpl) {\n <div class=\"ui-menu-end\">\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n </div>\n }\n </div>\n</ng-template>\n\n<!-- Recursive node list (separator | header section | toggleable group | leaf item). -->\n<ng-template #nodesTpl let-nodes>\n @for (node of nodes; track node.key) {\n @switch (node.kind) {\n @case ('separator') {\n <li class=\"ui-menu-separator\" role=\"separator\" aria-hidden=\"true\">\n <ui-separator></ui-separator>\n </li>\n }\n\n @case ('header') {\n <li class=\"ui-menu-section\" role=\"none\" [class]=\"node.item.styleClass ?? ''\">\n <span class=\"ui-menu-header\" [attr.id]=\"headerId(node)\">\n @if (resolvedSubmenuHeaderTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: node.item }\"\n />\n } @else {\n @if (node.item.icon; as icon) {\n <ui-icon class=\"ui-menu-item-icon\" [name]=\"icon\" size=\"sm\" />\n }\n <span class=\"ui-menu-item-label\">{{ node.item.label }}</span>\n }\n </span>\n <ul class=\"ui-menu-group\" role=\"group\" [attr.aria-labelledby]=\"headerId(node)\">\n <ng-container\n [ngTemplateOutlet]=\"nodesTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: node.children }\"\n />\n </ul>\n </li>\n }\n\n @case ('toggle') {\n <li class=\"ui-menu-entry\" role=\"none\" [class]=\"node.item.styleClass ?? ''\">\n <button\n type=\"button\"\n class=\"ui-menu-action _toggle\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n role=\"menuitem\"\n [attr.data-key]=\"node.key\"\n [attr.aria-expanded]=\"node.expanded\"\n [attr.aria-controls]=\"groupId(node)\"\n [attr.aria-label]=\"node.item.ariaLabel || null\"\n [attr.title]=\"node.item.title || null\"\n [disabled]=\"node.item.disabled ?? false\"\n [attr.tabindex]=\"node.key === tabStopKey() ? tabindex() : -1\"\n (click)=\"onToggleClick(node)\"\n (mouseenter)=\"onEntryHover(node)\"\n (focus)=\"onEntryFocus(node)\"\n >\n @if (resolvedSubmenuHeaderTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: node.item }\"\n />\n } @else {\n @if (node.item.icon; as icon) {\n <ui-icon class=\"ui-menu-item-icon\" [name]=\"icon\" size=\"sm\" />\n }\n <span class=\"ui-menu-item-label\">{{ node.item.label }}</span>\n }\n <!-- `_open`, not `_expanded`: a global helper class `._expanded` (width:100%) exists. -->\n <ui-icon\n class=\"ui-menu-chevron\"\n [class._open]=\"node.expanded\"\n name=\"chevron-down\"\n size=\"sm\"\n />\n </button>\n <div\n class=\"ui-menu-collapse\"\n [class._open]=\"node.expanded\"\n [attr.id]=\"groupId(node)\"\n [attr.inert]=\"node.expanded ? null : ''\"\n >\n <div class=\"ui-menu-collapse-inner\">\n <ul class=\"ui-menu-group _nested\" role=\"group\">\n <ng-container\n [ngTemplateOutlet]=\"nodesTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: node.children }\"\n />\n </ul>\n </div>\n </div>\n </li>\n }\n\n @case ('flyout') {\n <li\n class=\"ui-menu-entry\"\n role=\"none\"\n [class]=\"node.item.styleClass ?? ''\"\n cdkOverlayOrigin\n #flyoutOrigin=\"cdkOverlayOrigin\"\n >\n <button\n type=\"button\"\n class=\"ui-menu-action _has-sub\"\n [class._sub-open]=\"openFlyoutKey() === node.key\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n role=\"menuitem\"\n aria-haspopup=\"menu\"\n [attr.data-key]=\"node.key\"\n [attr.aria-expanded]=\"openFlyoutKey() === node.key\"\n [attr.aria-label]=\"node.item.ariaLabel || null\"\n [attr.title]=\"node.item.title || null\"\n [disabled]=\"node.item.disabled ?? false\"\n [attr.tabindex]=\"node.key === tabStopKey() ? tabindex() : -1\"\n (click)=\"onFlyoutClick(node)\"\n (mouseenter)=\"onEntryHover(node)\"\n (focus)=\"onEntryFocus(node)\"\n >\n @if (resolvedItemTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: node.item }\"\n />\n } @else {\n @if (node.item.icon; as icon) {\n <ui-icon class=\"ui-menu-item-icon\" [name]=\"icon\" size=\"sm\" />\n }\n <span class=\"ui-menu-item-label\">{{ node.item.label }}</span>\n }\n <ui-icon class=\"ui-menu-chevron\" name=\"chevron-right\" size=\"sm\" />\n </button>\n\n <!-- Cascading side panel: a nested menu in its own overlay, anchored to the item. -->\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"flyoutOrigin\"\n [cdkConnectedOverlayOpen]=\"openFlyoutKey() === node.key\"\n [cdkConnectedOverlayPositions]=\"flyoutPositions\"\n >\n <!-- Flyout: keyboard delegated to the panel, focus lives on the items. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"ui-menu-flyout\"\n [uiMotion]=\"'fade'\"\n [motionDisabled]=\"!motion()\"\n #flyoutMotion=\"uiMotion\"\n motionOnInsert\n (keydown)=\"onFlyoutPanelKeydown($event, node)\"\n >\n <ui-menu\n [items]=\"node.item.items ?? []\"\n [level]=\"level()\"\n [size]=\"size()\"\n [motion]=\"motion()\"\n submenus=\"flyout\"\n styleClass=\"_floating\"\n [itemTemplate]=\"resolvedItemTemplate()\"\n [submenuHeaderTemplate]=\"resolvedSubmenuHeaderTemplate()\"\n [ariaLabel]=\"node.item.label\"\n (itemClick)=\"onChildItemClick($event)\"\n />\n </div>\n </ng-template>\n </li>\n }\n\n @case ('item') {\n <li class=\"ui-menu-entry\" role=\"none\" [class]=\"node.item.styleClass ?? ''\">\n <!-- Shared menuitem content (icon + label, or the #item template). -->\n <ng-template #content>\n @if (resolvedItemTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: node.item }\"\n />\n } @else {\n @if (node.item.icon; as icon) {\n <ui-icon class=\"ui-menu-item-icon\" [name]=\"icon\" size=\"sm\" />\n }\n <span class=\"ui-menu-item-label\">{{ node.item.label }}</span>\n }\n </ng-template>\n\n @if (node.item.routerLink !== undefined && !node.item.disabled) {\n <a\n class=\"ui-menu-action\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n role=\"menuitem\"\n [attr.data-key]=\"node.key\"\n [routerLink]=\"node.item.routerLink\"\n [queryParams]=\"node.item.queryParams ?? null\"\n [queryParamsHandling]=\"node.item.queryParamsHandling ?? null\"\n routerLinkActive=\"_active\"\n [routerLinkActiveOptions]=\"{ exact: node.item.routerLinkActiveExact ?? false }\"\n [attr.target]=\"node.item.target || null\"\n [attr.aria-label]=\"node.item.ariaLabel || null\"\n [attr.title]=\"node.item.title || null\"\n [attr.tabindex]=\"node.key === tabStopKey() ? tabindex() : -1\"\n (click)=\"onItemClick($event, node)\"\n (mouseenter)=\"onEntryHover(node)\"\n (focus)=\"onEntryFocus(node)\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n } @else if (node.item.url && !node.item.disabled) {\n <a\n class=\"ui-menu-action\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n role=\"menuitem\"\n [attr.data-key]=\"node.key\"\n [attr.href]=\"node.item.url\"\n [attr.target]=\"node.item.target || null\"\n [attr.rel]=\"node.item.target === '_blank' ? 'noopener noreferrer' : null\"\n [attr.aria-label]=\"node.item.ariaLabel || null\"\n [attr.title]=\"node.item.title || null\"\n [attr.tabindex]=\"node.key === tabStopKey() ? tabindex() : -1\"\n (click)=\"onItemClick($event, node)\"\n (mouseenter)=\"onEntryHover(node)\"\n (focus)=\"onEntryFocus(node)\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n } @else {\n <button\n type=\"button\"\n class=\"ui-menu-action\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n role=\"menuitem\"\n [attr.data-key]=\"node.key\"\n [disabled]=\"node.item.disabled ?? false\"\n [attr.aria-label]=\"node.item.ariaLabel || null\"\n [attr.title]=\"node.item.title || null\"\n [attr.tabindex]=\"node.key === tabStopKey() ? tabindex() : -1\"\n (click)=\"onItemClick($event, node)\"\n (mouseenter)=\"onEntryHover(node)\"\n (focus)=\"onEntryFocus(node)\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </button>\n }\n </li>\n }\n }\n }\n</ng-template>\n\n@if (popup()) {\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayOrigin()!\"\n [cdkConnectedOverlayOpen]=\"popupOpen()\"\n [cdkConnectedOverlayPositions]=\"overlayPositions()\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n (backdropClick)=\"hide()\"\n (overlayOutsideClick)=\"onPopupOutsideClick($event)\"\n (detach)=\"hide()\"\n >\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\n </ng-template>\n} @else {\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\n}\n", styles: [".ui-menu{display:flex;flex-direction:column;gap:var(--units-2xs);padding:var(--ui-menu-panel-padding, var(--ui-overlay-panel-padding, var(--units-sm)));box-sizing:border-box;border:var(--ui-control-stroke-width, var(--stroke-default)) solid var(--ui-overlay-stroke, transparent);border-radius:var(--ui-overlay-radius, var(--ui-overlay-panel-radius, var(--radius-default)));background-color:var(--ui-overlay-surface, var(--ui-menu-panel-surface, var(--global-background-default)));box-shadow:var(--ui-overlay-shadow, var(--ui-overlay-panel-shadow, var(--shadow-default-md)));font-family:var(--ui-overlay-panel-font-family, var(--fontfamily-base));border:none;min-width:var(--ui-menu-min-width, 13.125rem)}.ui-menu .ui-menu-action{min-height:var(--ui-menu-item-height, 2.5rem);padding:0 var(--ui-menu-item-padding-x, var(--units-md));font-size:var(--ui-menu-font-size, var(--size-typography-text-default))}.ui-menu .ui-menu-header{min-height:var(--ui-menu-header-height, 2rem);padding:0 var(--ui-menu-item-padding-x, var(--units-md));font-size:var(--ui-menu-header-font-size, var(--size-typography-text-md))}.ui-menu._popup,.ui-menu._floating{width:max-content;max-width:calc(100vw - var(--units-lg));max-height:calc(100vh - var(--units-lg));overflow:auto}.ui-menu-list,.ui-menu-group{display:flex;flex-direction:column;gap:var(--units-2xs);margin:0;padding:0;list-style:none}.ui-menu-group._nested{padding-left:var(--ui-menu-group-indent, var(--units-default))}.ui-menu-section,.ui-menu-entry{display:flex;flex-direction:column;gap:var(--units-2xs)}.ui-menu._small{min-width:var(--ui-menu-min-width-small, 10rem)}.ui-menu._small .ui-menu-action{min-height:var(--ui-menu-item-height-small, 2rem);padding:0 var(--ui-menu-item-padding-x-small, var(--units-sm));font-size:var(--ui-menu-font-size-small, var(--size-typography-text-md))}.ui-menu._small .ui-menu-header{min-height:var(--ui-menu-header-height-small, 1.5rem);padding:0 var(--ui-menu-item-padding-x-small, var(--units-sm));font-size:var(--ui-menu-header-font-size-small, var(--size-typography-text-sm))}.ui-menu-header{display:flex;align-items:center;gap:var(--units-sm);font-weight:var(--ui-menu-header-weight, var(--weight-bold));-webkit-user-select:none;user-select:none}.ui-menu-action{display:flex;align-items:center;gap:var(--units-sm);box-sizing:border-box;width:100%;border:none;border-radius:var(--ui-menu-item-radius, var(--radius-sm));background:none;font-family:var(--ui-menu-font-family, var(--fontfamily-base));font-size:var(--size-typography-text-default);font-weight:var(--ui-menu-action-weight, var(--weight-regular));line-height:1.2;text-align:left;text-decoration:none;cursor:pointer;transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),box-shadow var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-menu-action:focus-visible{outline:none;box-shadow:inset 0 0 0 var(--ui-menu-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-menu-action-focus-ring-color, var(--global-border-focus))}.ui-menu-action:disabled{cursor:not-allowed}.ui-menu-item-icon,.ui-menu-chevron{flex-shrink:0;line-height:0}.ui-menu-item-label{flex:1 1 auto;min-width:0}.ui-menu-chevron{margin-left:auto;transition:rotate var(--ui-motion-duration, var(--motion-toggle-duration, var(--transition-default))) var(--ui-motion-easing, var(--motion-toggle-easing, var(--transition-easeinout))) var(--ui-motion-delay, 0ms)}.ui-menu-chevron._open{rotate:180deg}.ui-menu-flyout{display:block}.ui-menu-collapse{display:grid;grid-template-rows:0fr;opacity:0;transition:grid-template-rows var(--ui-motion-duration, var(--motion-toggle-duration, var(--transition-default))) var(--ui-motion-easing, var(--motion-toggle-easing, var(--transition-easeinout))) var(--ui-motion-delay, 0ms),opacity var(--ui-motion-duration, var(--motion-toggle-duration, var(--transition-default))) var(--ui-motion-easing, var(--motion-toggle-easing, var(--transition-easeinout))) var(--ui-motion-delay, 0ms)}.ui-menu-collapse._open{grid-template-rows:1fr;opacity:1}.ui-menu-collapse-inner{min-height:0;overflow:hidden}.ui-menu._no-motion .ui-menu-collapse,.ui-menu._no-motion .ui-menu-chevron{transition:none}.ui-menu-separator{border:none}.ui-menu-start,.ui-menu-end{padding:var(--units-2xs) var(--units-md)}.ui-menu._high .ui-menu-header{color:var(--ui-menu-header-color, var(--navigation-high-content-default))}.ui-menu._high .ui-menu-action{color:var(--ui-menu-action-color, var(--navigation-high-content-default))}.ui-menu._high .ui-menu-action:hover:not(:disabled){background-color:var(--ui-menu-action-surface-hover, var(--navigation-high-surface-hover));color:var(--ui-menu-action-color-hover, var(--navigation-high-content-hover))}.ui-menu._high .ui-menu-action:active:not(:disabled){background-color:var(--ui-menu-action-surface-pressed, var(--navigation-high-surface-active));color:var(--ui-menu-action-color-pressed, var(--navigation-high-content-active))}.ui-menu._high .ui-menu-action._sub-open:not(:disabled){background-color:var(--ui-menu-action-surface-hover, var(--navigation-high-surface-hover));color:var(--ui-menu-action-color-hover, var(--navigation-high-content-hover))}.ui-menu._high .ui-menu-action._active{background-color:var(--ui-menu-action-surface-active, var(--navigation-high-surface-active));color:var(--ui-menu-action-color-active, var(--navigation-high-content-active))}.ui-menu._high .ui-menu-action:disabled{background-color:var(--ui-menu-action-surface-disabled, var(--navigation-high-surface-disabled));color:var(--ui-menu-action-color-disabled, var(--navigation-high-content-disabled))}.ui-menu._low .ui-menu-header{color:var(--ui-menu-header-color, var(--navigation-low-content-default))}.ui-menu._low .ui-menu-action{color:var(--ui-menu-action-color, var(--navigation-low-content-default))}.ui-menu._low .ui-menu-action:hover:not(:disabled){background-color:var(--ui-menu-action-surface-hover, var(--navigation-low-surface-hover));color:var(--ui-menu-action-color-hover, var(--navigation-low-content-hover))}.ui-menu._low .ui-menu-action:active:not(:disabled){background-color:var(--ui-menu-action-surface-pressed, var(--navigation-low-surface-active));color:var(--ui-menu-action-color-pressed, var(--navigation-low-content-active))}.ui-menu._low .ui-menu-action._sub-open:not(:disabled){background-color:var(--ui-menu-action-surface-hover, var(--navigation-low-surface-hover));color:var(--ui-menu-action-color-hover, var(--navigation-low-content-hover))}.ui-menu._low .ui-menu-action._active{background-color:var(--ui-menu-action-surface-active, var(--navigation-low-surface-active));color:var(--ui-menu-action-color-active, var(--navigation-low-content-active))}.ui-menu._low .ui-menu-action:disabled{background-color:var(--ui-menu-action-surface-disabled, var(--navigation-low-surface-disabled));color:var(--ui-menu-action-color-disabled, var(--navigation-low-content-disabled))}\n"] }]
540
- }], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], popup: [{ type: i0.Input, args: [{ isSignal: true, alias: "popup", required: false }] }], expandedKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedKeys", required: false }] }, { type: i0.Output, args: ["expandedKeysChange"] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledBy", required: false }] }], styleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleClass", required: false }] }], level: [{ type: i0.Input, args: [{ isSignal: true, alias: "level", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], submenus: [{ type: i0.Input, args: [{ isSignal: true, alias: "submenus", required: false }] }], motion: [{ type: i0.Input, args: [{ isSignal: true, alias: "motion", required: false }] }], ripple: [{ type: i0.Input, args: [{ isSignal: true, alias: "ripple", required: false }] }], autoFlip: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoFlip", required: false }] }], tabindex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabindex", required: false }] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }], itemTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemTemplate", required: false }] }], submenuHeaderTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "submenuHeaderTemplate", required: false }] }], itemTemplateContent: [{ type: i0.ContentChild, args: ['item', { isSignal: true }] }], submenuHeaderTemplateContent: [{ type: i0.ContentChild, args: ['submenuheader', { isSignal: true }] }], startTemplate: [{ type: i0.ContentChild, args: ['start', { isSignal: true }] }], endTemplate: [{ type: i0.ContentChild, args: ['end', { isSignal: true }] }], panelEl: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], childMenus: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => UiMenu), { isSignal: true }] }], connectedOverlays: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => CdkConnectedOverlay), { isSignal: true }] }] } });
541
-
542
- /*
543
- * Public API Surface of ui-kit/ui-menu
544
- */
545
-
546
- /**
547
- * Generated bundle index. Do not edit.
548
- */
549
-
13
+ var UiMenu = class UiMenu {
14
+ constructor() {
15
+ this.items = input([], ...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
16
+ this.popup = input(false, {
17
+ ...ngDevMode ? { debugName: "popup" } : /* istanbul ignore next */ {},
18
+ transform: booleanAttribute
19
+ });
20
+ this.expandedKeys = model({}, ...ngDevMode ? [{ debugName: "expandedKeys" }] : /* istanbul ignore next */ []);
21
+ this.ariaLabel = input(...ngDevMode ? [void 0, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
22
+ this.ariaLabelledBy = input(...ngDevMode ? [void 0, { debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []);
23
+ this.styleClass = input(...ngDevMode ? [void 0, { debugName: "styleClass" }] : /* istanbul ignore next */ []);
24
+ this.level = input("high", ...ngDevMode ? [{ debugName: "level" }] : /* istanbul ignore next */ []);
25
+ this.size = input("default", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
26
+ this.submenus = input("inline", ...ngDevMode ? [{ debugName: "submenus" }] : /* istanbul ignore next */ []);
27
+ this.motion = input(true, {
28
+ ...ngDevMode ? { debugName: "motion" } : /* istanbul ignore next */ {},
29
+ transform: booleanAttribute
30
+ });
31
+ this.ripple = input(true, {
32
+ ...ngDevMode ? { debugName: "ripple" } : /* istanbul ignore next */ {},
33
+ transform: booleanAttribute
34
+ });
35
+ this.autoFlip = input(true, {
36
+ ...ngDevMode ? { debugName: "autoFlip" } : /* istanbul ignore next */ {},
37
+ transform: booleanAttribute
38
+ });
39
+ this.tabindex = input(0, {
40
+ ...ngDevMode ? { debugName: "tabindex" } : /* istanbul ignore next */ {},
41
+ transform: numberAttribute
42
+ });
43
+ this.opened = output();
44
+ this.closed = output();
45
+ this.itemClick = output();
46
+ this.itemTemplate = input(...ngDevMode ? [void 0, { debugName: "itemTemplate" }] : /* istanbul ignore next */ []);
47
+ this.submenuHeaderTemplate = input(...ngDevMode ? [void 0, { debugName: "submenuHeaderTemplate" }] : /* istanbul ignore next */ []);
48
+ this.itemTemplateContent = contentChild("item", ...ngDevMode ? [{ debugName: "itemTemplateContent" }] : /* istanbul ignore next */ []);
49
+ this.submenuHeaderTemplateContent = contentChild("submenuheader", ...ngDevMode ? [{ debugName: "submenuHeaderTemplateContent" }] : /* istanbul ignore next */ []);
50
+ this.resolvedItemTemplate = computed(() => this.itemTemplate() ?? this.itemTemplateContent(), ...ngDevMode ? [{ debugName: "resolvedItemTemplate" }] : /* istanbul ignore next */ []);
51
+ this.resolvedSubmenuHeaderTemplate = computed(() => this.submenuHeaderTemplate() ?? this.submenuHeaderTemplateContent(), ...ngDevMode ? [{ debugName: "resolvedSubmenuHeaderTemplate" }] : /* istanbul ignore next */ []);
52
+ this.startTemplate = contentChild("start", ...ngDevMode ? [{ debugName: "startTemplate" }] : /* istanbul ignore next */ []);
53
+ this.endTemplate = contentChild("end", ...ngDevMode ? [{ debugName: "endTemplate" }] : /* istanbul ignore next */ []);
54
+ this.panelEl = viewChild("panel", ...ngDevMode ? [{ debugName: "panelEl" }] : /* istanbul ignore next */ []);
55
+ this.uid = `ui-menu-${nextUid++}`;
56
+ this.popupOpen = signal(false, ...ngDevMode ? [{ debugName: "popupOpen" }] : /* istanbul ignore next */ []);
57
+ this.overlayOrigin = signal(null, ...ngDevMode ? [{ debugName: "overlayOrigin" }] : /* istanbul ignore next */ []);
58
+ this.focusedKey = signal(null, ...ngDevMode ? [{ debugName: "focusedKey" }] : /* istanbul ignore next */ []);
59
+ this.openFlyoutKey = signal(null, ...ngDevMode ? [{ debugName: "openFlyoutKey" }] : /* istanbul ignore next */ []);
60
+ this.childMenus = viewChildren(UiMenu, ...ngDevMode ? [{ debugName: "childMenus" }] : /* istanbul ignore next */ []);
61
+ this.connectedOverlays = viewChildren(CdkConnectedOverlay, ...ngDevMode ? [{ debugName: "connectedOverlays" }] : /* istanbul ignore next */ []);
62
+ this.doc = inject(DOCUMENT);
63
+ this.overlayPositions = computed(() => {
64
+ const below = {
65
+ originX: "start",
66
+ originY: "bottom",
67
+ overlayX: "start",
68
+ overlayY: "top",
69
+ offsetY: OVERLAY_OFFSET
70
+ };
71
+ return this.autoFlip() ? [below, {
72
+ originX: "start",
73
+ originY: "top",
74
+ overlayX: "start",
75
+ overlayY: "bottom",
76
+ offsetY: -8
77
+ }] : [below];
78
+ }, ...ngDevMode ? [{ debugName: "overlayPositions" }] : /* istanbul ignore next */ []);
79
+ this.flyoutPositions = [
80
+ {
81
+ originX: "end",
82
+ originY: "top",
83
+ overlayX: "start",
84
+ overlayY: "top",
85
+ offsetY: -8
86
+ },
87
+ {
88
+ originX: "start",
89
+ originY: "top",
90
+ overlayX: "end",
91
+ overlayY: "top",
92
+ offsetY: -8
93
+ },
94
+ {
95
+ originX: "end",
96
+ originY: "bottom",
97
+ overlayX: "start",
98
+ overlayY: "bottom",
99
+ offsetY: OVERLAY_OFFSET
100
+ },
101
+ {
102
+ originX: "start",
103
+ originY: "bottom",
104
+ overlayX: "end",
105
+ overlayY: "bottom",
106
+ offsetY: OVERLAY_OFFSET
107
+ }
108
+ ];
109
+ this.nodes = computed(() => this.buildNodes(this.items(), this.uid, 0), ...ngDevMode ? [{ debugName: "nodes" }] : /* istanbul ignore next */ []);
110
+ this.focusableKeys = computed(() => {
111
+ const keys = [];
112
+ const walk = (nodes) => {
113
+ for (const node of nodes) {
114
+ if (node.kind === "separator") continue;
115
+ if ((node.kind === "item" || node.kind === "flyout") && !node.item.disabled) keys.push(node.key);
116
+ if (node.kind === "toggle" && !node.item.disabled) {
117
+ keys.push(node.key);
118
+ if (node.expanded) walk(node.children);
119
+ }
120
+ if (node.kind === "header") walk(node.children);
121
+ }
122
+ };
123
+ walk(this.nodes());
124
+ return keys;
125
+ }, ...ngDevMode ? [{ debugName: "focusableKeys" }] : /* istanbul ignore next */ []);
126
+ this.tabStopKey = computed(() => {
127
+ const keys = this.focusableKeys();
128
+ const focused = this.focusedKey();
129
+ return focused && keys.includes(focused) ? focused : keys[0] ?? null;
130
+ }, ...ngDevMode ? [{ debugName: "tabStopKey" }] : /* istanbul ignore next */ []);
131
+ this.panelClasses = computed(() => {
132
+ const c = ["ui-menu", `_${this.level()}`];
133
+ if (this.size() !== "default") c.push(`_${this.size()}`);
134
+ if (this.popup()) c.push("_popup");
135
+ if (!this.motion()) c.push("_no-motion");
136
+ const extra = this.styleClass();
137
+ if (extra) c.push(extra);
138
+ return c.join(" ");
139
+ }, ...ngDevMode ? [{ debugName: "panelClasses" }] : /* istanbul ignore next */ []);
140
+ closeOnNavigation(() => {
141
+ this.hide();
142
+ this.closeFlyouts();
143
+ });
144
+ effect((onCleanup) => {
145
+ if (!(this.popupOpen() || this.openFlyoutKey() !== null) || typeof window === "undefined") return;
146
+ const handler = () => setTimeout(() => {
147
+ if (this.popupOpen() && this.overlayOrigin()?.isConnected === false) {
148
+ this.hide();
149
+ return;
150
+ }
151
+ for (const overlay of this.connectedOverlays()) if (overlay.open) overlay.overlayRef?.updatePosition();
152
+ });
153
+ this.doc.addEventListener("scroll", handler, {
154
+ capture: true,
155
+ passive: true
156
+ });
157
+ onCleanup(() => this.doc.removeEventListener("scroll", handler, true));
158
+ });
159
+ }
160
+ toggle(event) {
161
+ this.popupOpen() ? this.hide() : this.show(event);
162
+ }
163
+ show(event) {
164
+ if (!this.popup() || this.popupOpen()) return;
165
+ this.overlayOrigin.set(event.currentTarget ?? event.target);
166
+ this.popupOpen.set(true);
167
+ this.opened.emit();
168
+ this.queueFocusTabStop();
169
+ }
170
+ focusFirst() {
171
+ this.queueFocusTabStop();
172
+ }
173
+ hide(focusTrigger = false) {
174
+ if (!this.popupOpen()) return;
175
+ this.popupOpen.set(false);
176
+ this.focusedKey.set(null);
177
+ this.openFlyoutKey.set(null);
178
+ this.closed.emit();
179
+ if (focusTrigger) this.overlayOrigin()?.focus?.();
180
+ }
181
+ closeFlyouts() {
182
+ this.openFlyoutKey.set(null);
183
+ }
184
+ onItemClick(event, node) {
185
+ const item = node.item;
186
+ if (item.disabled) {
187
+ event.preventDefault();
188
+ return;
189
+ }
190
+ if (!item.url && !item.routerLink) event.preventDefault();
191
+ this.focusedKey.set(node.key);
192
+ item.command?.({
193
+ originalEvent: event,
194
+ item
195
+ });
196
+ this.itemClick.emit({
197
+ originalEvent: event,
198
+ item
199
+ });
200
+ if (this.popup()) this.hide(true);
201
+ }
202
+ onFlyoutClick(node) {
203
+ if (node.item.disabled) return;
204
+ this.focusedKey.set(node.key);
205
+ this.openFlyoutKey.set(node.key);
206
+ }
207
+ onEntryHover(node) {
208
+ if (node.kind === "flyout" && !node.item.disabled) this.openFlyoutKey.set(node.key);
209
+ else this.openFlyoutKey.set(null);
210
+ }
211
+ onFlyoutPanelKeydown(event, node) {
212
+ if (event.key !== "ArrowLeft" && event.key !== "Escape") return;
213
+ event.preventDefault();
214
+ event.stopPropagation();
215
+ this.openFlyoutKey.set(null);
216
+ this.focusByKey(node.key);
217
+ }
218
+ onChildItemClick(event) {
219
+ this.itemClick.emit(event);
220
+ this.openFlyoutKey.set(null);
221
+ if (this.popup()) this.hide(true);
222
+ }
223
+ openFlyoutAndFocus(node, attempts = 20) {
224
+ this.openFlyoutKey.set(node.key);
225
+ setTimeout(() => {
226
+ const menu = this.childMenus().find((child) => child.items() === node.item.items);
227
+ if (menu) menu.focusFirst();
228
+ else if (attempts > 0) this.openFlyoutAndFocus(node, attempts - 1);
229
+ });
230
+ }
231
+ onToggleClick(node) {
232
+ if (node.item.disabled) return;
233
+ this.focusedKey.set(node.key);
234
+ this.setExpanded(node, !node.expanded);
235
+ }
236
+ setExpanded(node, expanded) {
237
+ if (node.expanded === expanded) return;
238
+ this.expandedKeys.update((keys) => ({
239
+ ...keys,
240
+ [node.key]: expanded
241
+ }));
242
+ }
243
+ onListKeydown(event) {
244
+ const keys = this.focusableKeys();
245
+ if (!keys.length) return;
246
+ const currentKey = this.currentFocusKey(event);
247
+ const index = currentKey ? keys.indexOf(currentKey) : -1;
248
+ switch (event.key) {
249
+ case "ArrowDown":
250
+ event.preventDefault();
251
+ this.focusByKey(keys[(index + 1) % keys.length]);
252
+ break;
253
+ case "ArrowUp":
254
+ event.preventDefault();
255
+ this.focusByKey(keys[(index - 1 + keys.length) % keys.length]);
256
+ break;
257
+ case "Home":
258
+ event.preventDefault();
259
+ this.focusByKey(keys[0]);
260
+ break;
261
+ case "End":
262
+ event.preventDefault();
263
+ this.focusByKey(keys[keys.length - 1]);
264
+ break;
265
+ case "ArrowRight":
266
+ case "ArrowLeft": {
267
+ const node = currentKey ? this.findNode(currentKey) : null;
268
+ if (node?.kind === "toggle") {
269
+ event.preventDefault();
270
+ this.setExpanded(node, event.key === "ArrowRight");
271
+ } else if (node?.kind === "flyout") {
272
+ event.preventDefault();
273
+ if (event.key === "ArrowRight") this.openFlyoutAndFocus(node);
274
+ else this.openFlyoutKey.set(null);
275
+ }
276
+ break;
277
+ }
278
+ case " ": {
279
+ const target = event.target;
280
+ if (target.tagName === "A") {
281
+ event.preventDefault();
282
+ target.click();
283
+ }
284
+ break;
285
+ }
286
+ case "Escape": if (this.popup()) {
287
+ event.preventDefault();
288
+ this.hide(true);
289
+ }
290
+ }
291
+ }
292
+ onEntryFocus(node) {
293
+ this.focusedKey.set(node.key);
294
+ }
295
+ onPopupOutsideClick(event) {
296
+ if (event.target instanceof Element && event.target.closest(".cdk-overlay-container")) return;
297
+ this.hide();
298
+ }
299
+ headerId(node) {
300
+ return `${this.uid}-${node.key}-label`;
301
+ }
302
+ groupId(node) {
303
+ return `${this.uid}-${node.key}-group`;
304
+ }
305
+ buildNodes(items, parentKey, depth) {
306
+ const expandedKeys = this.expandedKeys();
307
+ return items.filter((item) => item.visible !== false).map((item, index) => {
308
+ const key = item.id ?? `${parentKey}_${index}`;
309
+ if (item.separator) return {
310
+ item,
311
+ key,
312
+ kind: "separator",
313
+ children: [],
314
+ expanded: false,
315
+ depth
316
+ };
317
+ if (item.items) {
318
+ if (this.submenus() === "flyout") return {
319
+ item,
320
+ key,
321
+ kind: "flyout",
322
+ children: [],
323
+ expanded: false,
324
+ depth
325
+ };
326
+ const toggleable = item.toggleable ?? depth > 0;
327
+ const expanded = toggleable ? expandedKeys[key] ?? item.expanded ?? false : true;
328
+ return {
329
+ item,
330
+ key,
331
+ kind: toggleable ? "toggle" : "header",
332
+ children: this.buildNodes(item.items, key, depth + 1),
333
+ expanded,
334
+ depth
335
+ };
336
+ }
337
+ return {
338
+ item,
339
+ key,
340
+ kind: "item",
341
+ children: [],
342
+ expanded: false,
343
+ depth
344
+ };
345
+ });
346
+ }
347
+ findNode(key, nodes = this.nodes()) {
348
+ for (const node of nodes) {
349
+ if (node.key === key) return node;
350
+ const found = this.findNode(key, node.children);
351
+ if (found) return found;
352
+ }
353
+ return null;
354
+ }
355
+ currentFocusKey(event) {
356
+ return (event.target.closest?.("[data-key]"))?.getAttribute("data-key") ?? this.focusedKey();
357
+ }
358
+ focusByKey(key) {
359
+ if (!key) return;
360
+ this.focusedKey.set(key);
361
+ this.panelEl()?.nativeElement.querySelector(`[data-key="${CSS.escape(key)}"]`)?.focus();
362
+ }
363
+ queueFocusTabStop() {
364
+ setTimeout(() => this.focusByKey(this.tabStopKey() ?? void 0));
365
+ }
366
+ static {
367
+ this.ɵfac = i0.ɵɵngDeclareFactory({
368
+ minVersion: "12.0.0",
369
+ version: "22.3.0",
370
+ ngImport: i0,
371
+ type: UiMenu,
372
+ deps: [],
373
+ target: i0.ɵɵFactoryTarget.Component
374
+ });
375
+ }
376
+ static {
377
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
378
+ minVersion: "17.0.0",
379
+ version: "22.3.0",
380
+ type: UiMenu,
381
+ isStandalone: true,
382
+ selector: "ui-menu",
383
+ inputs: {
384
+ items: {
385
+ classPropertyName: "items",
386
+ publicName: "items",
387
+ isSignal: true,
388
+ isRequired: false,
389
+ transformFunction: null
390
+ },
391
+ popup: {
392
+ classPropertyName: "popup",
393
+ publicName: "popup",
394
+ isSignal: true,
395
+ isRequired: false,
396
+ transformFunction: null
397
+ },
398
+ expandedKeys: {
399
+ classPropertyName: "expandedKeys",
400
+ publicName: "expandedKeys",
401
+ isSignal: true,
402
+ isRequired: false,
403
+ transformFunction: null
404
+ },
405
+ ariaLabel: {
406
+ classPropertyName: "ariaLabel",
407
+ publicName: "ariaLabel",
408
+ isSignal: true,
409
+ isRequired: false,
410
+ transformFunction: null
411
+ },
412
+ ariaLabelledBy: {
413
+ classPropertyName: "ariaLabelledBy",
414
+ publicName: "ariaLabelledBy",
415
+ isSignal: true,
416
+ isRequired: false,
417
+ transformFunction: null
418
+ },
419
+ styleClass: {
420
+ classPropertyName: "styleClass",
421
+ publicName: "styleClass",
422
+ isSignal: true,
423
+ isRequired: false,
424
+ transformFunction: null
425
+ },
426
+ level: {
427
+ classPropertyName: "level",
428
+ publicName: "level",
429
+ isSignal: true,
430
+ isRequired: false,
431
+ transformFunction: null
432
+ },
433
+ size: {
434
+ classPropertyName: "size",
435
+ publicName: "size",
436
+ isSignal: true,
437
+ isRequired: false,
438
+ transformFunction: null
439
+ },
440
+ submenus: {
441
+ classPropertyName: "submenus",
442
+ publicName: "submenus",
443
+ isSignal: true,
444
+ isRequired: false,
445
+ transformFunction: null
446
+ },
447
+ motion: {
448
+ classPropertyName: "motion",
449
+ publicName: "motion",
450
+ isSignal: true,
451
+ isRequired: false,
452
+ transformFunction: null
453
+ },
454
+ ripple: {
455
+ classPropertyName: "ripple",
456
+ publicName: "ripple",
457
+ isSignal: true,
458
+ isRequired: false,
459
+ transformFunction: null
460
+ },
461
+ autoFlip: {
462
+ classPropertyName: "autoFlip",
463
+ publicName: "autoFlip",
464
+ isSignal: true,
465
+ isRequired: false,
466
+ transformFunction: null
467
+ },
468
+ tabindex: {
469
+ classPropertyName: "tabindex",
470
+ publicName: "tabindex",
471
+ isSignal: true,
472
+ isRequired: false,
473
+ transformFunction: null
474
+ },
475
+ itemTemplate: {
476
+ classPropertyName: "itemTemplate",
477
+ publicName: "itemTemplate",
478
+ isSignal: true,
479
+ isRequired: false,
480
+ transformFunction: null
481
+ },
482
+ submenuHeaderTemplate: {
483
+ classPropertyName: "submenuHeaderTemplate",
484
+ publicName: "submenuHeaderTemplate",
485
+ isSignal: true,
486
+ isRequired: false,
487
+ transformFunction: null
488
+ }
489
+ },
490
+ outputs: {
491
+ expandedKeys: "expandedKeysChange",
492
+ opened: "opened",
493
+ closed: "closed",
494
+ itemClick: "itemClick"
495
+ },
496
+ host: { properties: { "style.display": "popup() ? 'contents' : 'block'" } },
497
+ queries: [
498
+ {
499
+ propertyName: "itemTemplateContent",
500
+ first: true,
501
+ predicate: ["item"],
502
+ descendants: true,
503
+ isSignal: true
504
+ },
505
+ {
506
+ propertyName: "submenuHeaderTemplateContent",
507
+ first: true,
508
+ predicate: ["submenuheader"],
509
+ descendants: true,
510
+ isSignal: true
511
+ },
512
+ {
513
+ propertyName: "startTemplate",
514
+ first: true,
515
+ predicate: ["start"],
516
+ descendants: true,
517
+ isSignal: true
518
+ },
519
+ {
520
+ propertyName: "endTemplate",
521
+ first: true,
522
+ predicate: ["end"],
523
+ descendants: true,
524
+ isSignal: true
525
+ }
526
+ ],
527
+ viewQueries: [
528
+ {
529
+ propertyName: "panelEl",
530
+ first: true,
531
+ predicate: ["panel"],
532
+ descendants: true,
533
+ isSignal: true
534
+ },
535
+ {
536
+ propertyName: "childMenus",
537
+ predicate: UiMenu,
538
+ descendants: true,
539
+ isSignal: true
540
+ },
541
+ {
542
+ propertyName: "connectedOverlays",
543
+ predicate: CdkConnectedOverlay,
544
+ descendants: true,
545
+ isSignal: true
546
+ }
547
+ ],
548
+ ngImport: i0,
549
+ template: "<!-- Menu panel: shared between inline render and the CDK overlay popup. -->\n<ng-template #panelTpl>\n <div\n #panel\n [class]=\"panelClasses()\"\n [attr.id]=\"uid\"\n [uiMotion]=\"'slide-down'\"\n [motionDisabled]=\"!motion()\"\n #panelMotion=\"uiMotion\"\n [motionOnInsert]=\"popup()\"\n >\n @if (startTemplate(); as tpl) {\n <div class=\"ui-menu-start\">\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n </div>\n }\n\n <!-- ARIA menu pattern: keyboard delegated to the role=\"menu\" container, focus\n lives on the items (roving tabindex). -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <ul\n class=\"ui-menu-list\"\n role=\"menu\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n (keydown)=\"onListKeydown($event)\"\n >\n <ng-container\n [ngTemplateOutlet]=\"nodesTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: nodes() }\"\n />\n </ul>\n\n @if (endTemplate(); as tpl) {\n <div class=\"ui-menu-end\">\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n </div>\n }\n </div>\n</ng-template>\n\n<!-- Recursive node list (separator | header section | toggleable group | leaf item). -->\n<ng-template #nodesTpl let-nodes>\n @for (node of nodes; track node.key) {\n @switch (node.kind) {\n @case ('separator') {\n <li class=\"ui-menu-separator\" role=\"separator\" aria-hidden=\"true\">\n <ui-separator></ui-separator>\n </li>\n }\n\n @case ('header') {\n <li class=\"ui-menu-section\" role=\"none\" [class]=\"node.item.styleClass ?? ''\">\n <span class=\"ui-menu-header\" [attr.id]=\"headerId(node)\">\n @if (resolvedSubmenuHeaderTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: node.item }\"\n />\n } @else {\n @if (node.item.icon; as icon) {\n <ui-icon class=\"ui-menu-item-icon\" [name]=\"icon\" size=\"sm\" />\n }\n <span class=\"ui-menu-item-label\">{{ node.item.label }}</span>\n }\n </span>\n <ul class=\"ui-menu-group\" role=\"group\" [attr.aria-labelledby]=\"headerId(node)\">\n <ng-container\n [ngTemplateOutlet]=\"nodesTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: node.children }\"\n />\n </ul>\n </li>\n }\n\n @case ('toggle') {\n <li class=\"ui-menu-entry\" role=\"none\" [class]=\"node.item.styleClass ?? ''\">\n <button\n type=\"button\"\n class=\"ui-menu-action _toggle\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n role=\"menuitem\"\n [attr.data-key]=\"node.key\"\n [attr.aria-expanded]=\"node.expanded\"\n [attr.aria-controls]=\"groupId(node)\"\n [attr.aria-label]=\"node.item.ariaLabel || null\"\n [attr.title]=\"node.item.title || null\"\n [disabled]=\"node.item.disabled ?? false\"\n [attr.tabindex]=\"node.key === tabStopKey() ? tabindex() : -1\"\n (click)=\"onToggleClick(node)\"\n (mouseenter)=\"onEntryHover(node)\"\n (focus)=\"onEntryFocus(node)\"\n >\n @if (resolvedSubmenuHeaderTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: node.item }\"\n />\n } @else {\n @if (node.item.icon; as icon) {\n <ui-icon class=\"ui-menu-item-icon\" [name]=\"icon\" size=\"sm\" />\n }\n <span class=\"ui-menu-item-label\">{{ node.item.label }}</span>\n }\n <!-- `_open`, not `_expanded`: a global helper class `._expanded` (width:100%) exists. -->\n <ui-icon\n class=\"ui-menu-chevron\"\n [class._open]=\"node.expanded\"\n name=\"chevron-down\"\n size=\"sm\"\n />\n </button>\n <div\n class=\"ui-menu-collapse\"\n [class._open]=\"node.expanded\"\n [attr.id]=\"groupId(node)\"\n [attr.inert]=\"node.expanded ? null : ''\"\n >\n <div class=\"ui-menu-collapse-inner\">\n <ul class=\"ui-menu-group _nested\" role=\"group\">\n <ng-container\n [ngTemplateOutlet]=\"nodesTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: node.children }\"\n />\n </ul>\n </div>\n </div>\n </li>\n }\n\n @case ('flyout') {\n <li\n class=\"ui-menu-entry\"\n role=\"none\"\n [class]=\"node.item.styleClass ?? ''\"\n cdkOverlayOrigin\n #flyoutOrigin=\"cdkOverlayOrigin\"\n >\n <button\n type=\"button\"\n class=\"ui-menu-action _has-sub\"\n [class._sub-open]=\"openFlyoutKey() === node.key\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n role=\"menuitem\"\n aria-haspopup=\"menu\"\n [attr.data-key]=\"node.key\"\n [attr.aria-expanded]=\"openFlyoutKey() === node.key\"\n [attr.aria-label]=\"node.item.ariaLabel || null\"\n [attr.title]=\"node.item.title || null\"\n [disabled]=\"node.item.disabled ?? false\"\n [attr.tabindex]=\"node.key === tabStopKey() ? tabindex() : -1\"\n (click)=\"onFlyoutClick(node)\"\n (mouseenter)=\"onEntryHover(node)\"\n (focus)=\"onEntryFocus(node)\"\n >\n @if (resolvedItemTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: node.item }\"\n />\n } @else {\n @if (node.item.icon; as icon) {\n <ui-icon class=\"ui-menu-item-icon\" [name]=\"icon\" size=\"sm\" />\n }\n <span class=\"ui-menu-item-label\">{{ node.item.label }}</span>\n }\n <ui-icon class=\"ui-menu-chevron\" name=\"chevron-right\" size=\"sm\" />\n </button>\n\n <!-- Cascading side panel: a nested menu in its own overlay, anchored to the item. -->\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"flyoutOrigin\"\n [cdkConnectedOverlayOpen]=\"openFlyoutKey() === node.key\"\n [cdkConnectedOverlayPositions]=\"flyoutPositions\"\n >\n <!-- Flyout: keyboard delegated to the panel, focus lives on the items. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"ui-menu-flyout\"\n [uiMotion]=\"'fade'\"\n [motionDisabled]=\"!motion()\"\n #flyoutMotion=\"uiMotion\"\n motionOnInsert\n (keydown)=\"onFlyoutPanelKeydown($event, node)\"\n >\n <ui-menu\n [items]=\"node.item.items ?? []\"\n [level]=\"level()\"\n [size]=\"size()\"\n [motion]=\"motion()\"\n submenus=\"flyout\"\n styleClass=\"_floating\"\n [itemTemplate]=\"resolvedItemTemplate()\"\n [submenuHeaderTemplate]=\"resolvedSubmenuHeaderTemplate()\"\n [ariaLabel]=\"node.item.label\"\n (itemClick)=\"onChildItemClick($event)\"\n />\n </div>\n </ng-template>\n </li>\n }\n\n @case ('item') {\n <li class=\"ui-menu-entry\" role=\"none\" [class]=\"node.item.styleClass ?? ''\">\n <!-- Shared menuitem content (icon + label, or the #item template). -->\n <ng-template #content>\n @if (resolvedItemTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: node.item }\"\n />\n } @else {\n @if (node.item.icon; as icon) {\n <ui-icon class=\"ui-menu-item-icon\" [name]=\"icon\" size=\"sm\" />\n }\n <span class=\"ui-menu-item-label\">{{ node.item.label }}</span>\n }\n </ng-template>\n\n @if (node.item.routerLink !== undefined && !node.item.disabled) {\n <a\n class=\"ui-menu-action\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n role=\"menuitem\"\n [attr.data-key]=\"node.key\"\n [routerLink]=\"node.item.routerLink\"\n [queryParams]=\"node.item.queryParams ?? null\"\n [queryParamsHandling]=\"node.item.queryParamsHandling ?? null\"\n routerLinkActive=\"_active\"\n [routerLinkActiveOptions]=\"{ exact: node.item.routerLinkActiveExact ?? false }\"\n [attr.target]=\"node.item.target || null\"\n [attr.aria-label]=\"node.item.ariaLabel || null\"\n [attr.title]=\"node.item.title || null\"\n [attr.tabindex]=\"node.key === tabStopKey() ? tabindex() : -1\"\n (click)=\"onItemClick($event, node)\"\n (mouseenter)=\"onEntryHover(node)\"\n (focus)=\"onEntryFocus(node)\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n } @else if (node.item.url && !node.item.disabled) {\n <a\n class=\"ui-menu-action\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n role=\"menuitem\"\n [attr.data-key]=\"node.key\"\n [attr.href]=\"node.item.url\"\n [attr.target]=\"node.item.target || null\"\n [attr.rel]=\"node.item.target === '_blank' ? 'noopener noreferrer' : null\"\n [attr.aria-label]=\"node.item.ariaLabel || null\"\n [attr.title]=\"node.item.title || null\"\n [attr.tabindex]=\"node.key === tabStopKey() ? tabindex() : -1\"\n (click)=\"onItemClick($event, node)\"\n (mouseenter)=\"onEntryHover(node)\"\n (focus)=\"onEntryFocus(node)\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n } @else {\n <button\n type=\"button\"\n class=\"ui-menu-action\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n role=\"menuitem\"\n [attr.data-key]=\"node.key\"\n [disabled]=\"node.item.disabled ?? false\"\n [attr.aria-label]=\"node.item.ariaLabel || null\"\n [attr.title]=\"node.item.title || null\"\n [attr.tabindex]=\"node.key === tabStopKey() ? tabindex() : -1\"\n (click)=\"onItemClick($event, node)\"\n (mouseenter)=\"onEntryHover(node)\"\n (focus)=\"onEntryFocus(node)\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </button>\n }\n </li>\n }\n }\n }\n</ng-template>\n\n@if (popup()) {\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayOrigin()!\"\n [cdkConnectedOverlayOpen]=\"popupOpen()\"\n [cdkConnectedOverlayPositions]=\"overlayPositions()\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n (backdropClick)=\"hide()\"\n (overlayOutsideClick)=\"onPopupOutsideClick($event)\"\n (detach)=\"hide()\"\n >\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\n </ng-template>\n} @else {\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\n}\n",
550
+ styles: [".ui-menu{display:flex;flex-direction:column;gap:var(--units-2xs);padding:var(--ui-menu-panel-padding, var(--ui-overlay-panel-padding, var(--units-sm)));box-sizing:border-box;border:var(--ui-control-stroke-width, var(--stroke-default)) solid var(--ui-overlay-stroke, transparent);border-radius:var(--ui-overlay-radius, var(--ui-overlay-panel-radius, var(--radius-default)));background-color:var(--ui-overlay-surface, var(--ui-menu-panel-surface, var(--global-background-default)));box-shadow:var(--ui-overlay-shadow, var(--ui-overlay-panel-shadow, var(--shadow-default-md)));font-family:var(--ui-overlay-panel-font-family, var(--fontfamily-base));border:none;min-width:var(--ui-menu-min-width, 13.125rem)}.ui-menu .ui-menu-action{min-height:var(--ui-menu-item-height, 2.5rem);padding:0 var(--ui-menu-item-padding-x, var(--units-md));font-size:var(--ui-menu-font-size, var(--size-typography-text-default))}.ui-menu .ui-menu-header{min-height:var(--ui-menu-header-height, 2rem);padding:0 var(--ui-menu-item-padding-x, var(--units-md));font-size:var(--ui-menu-header-font-size, var(--size-typography-text-md))}.ui-menu._popup,.ui-menu._floating{width:max-content;max-width:calc(100vw - var(--units-lg));max-height:calc(100vh - var(--units-lg));overflow:auto}.ui-menu-list,.ui-menu-group{display:flex;flex-direction:column;gap:var(--units-2xs);margin:0;padding:0;list-style:none}.ui-menu-group._nested{padding-left:var(--ui-menu-group-indent, var(--units-default))}.ui-menu-section,.ui-menu-entry{display:flex;flex-direction:column;gap:var(--units-2xs)}.ui-menu._small{min-width:var(--ui-menu-min-width-small, 10rem)}.ui-menu._small .ui-menu-action{min-height:var(--ui-menu-item-height-small, 2rem);padding:0 var(--ui-menu-item-padding-x-small, var(--units-sm));font-size:var(--ui-menu-font-size-small, var(--size-typography-text-md))}.ui-menu._small .ui-menu-header{min-height:var(--ui-menu-header-height-small, 1.5rem);padding:0 var(--ui-menu-item-padding-x-small, var(--units-sm));font-size:var(--ui-menu-header-font-size-small, var(--size-typography-text-sm))}.ui-menu-header{display:flex;align-items:center;gap:var(--units-sm);font-weight:var(--ui-menu-header-weight, var(--weight-bold));-webkit-user-select:none;user-select:none}.ui-menu-action{display:flex;align-items:center;gap:var(--units-sm);box-sizing:border-box;width:100%;border:none;border-radius:var(--ui-menu-item-radius, var(--radius-sm));background:none;font-family:var(--ui-menu-font-family, var(--fontfamily-base));font-size:var(--size-typography-text-default);font-weight:var(--ui-menu-action-weight, var(--weight-regular));line-height:1.2;text-align:left;text-decoration:none;cursor:pointer;transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),box-shadow var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-menu-action:focus-visible{outline:none;box-shadow:inset 0 0 0 var(--ui-menu-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-menu-action-focus-ring-color, var(--global-border-focus))}.ui-menu-action:disabled{cursor:not-allowed}.ui-menu-item-icon,.ui-menu-chevron{flex-shrink:0;line-height:0}.ui-menu-item-label{flex:1 1 auto;min-width:0}.ui-menu-chevron{margin-left:auto;transition:rotate var(--ui-motion-duration, var(--motion-toggle-duration, var(--transition-default))) var(--ui-motion-easing, var(--motion-toggle-easing, var(--transition-easeinout))) var(--ui-motion-delay, 0ms)}.ui-menu-chevron._open{rotate:180deg}.ui-menu-flyout{display:block}.ui-menu-collapse{display:grid;grid-template-rows:0fr;opacity:0;transition:grid-template-rows var(--ui-motion-duration, var(--motion-toggle-duration, var(--transition-default))) var(--ui-motion-easing, var(--motion-toggle-easing, var(--transition-easeinout))) var(--ui-motion-delay, 0ms),opacity var(--ui-motion-duration, var(--motion-toggle-duration, var(--transition-default))) var(--ui-motion-easing, var(--motion-toggle-easing, var(--transition-easeinout))) var(--ui-motion-delay, 0ms)}.ui-menu-collapse._open{grid-template-rows:1fr;opacity:1}.ui-menu-collapse-inner{min-height:0;overflow:hidden}.ui-menu._no-motion .ui-menu-collapse,.ui-menu._no-motion .ui-menu-chevron{transition:none}.ui-menu-separator{border:none}.ui-menu-start,.ui-menu-end{padding:var(--units-2xs) var(--units-md)}.ui-menu._high .ui-menu-header{color:var(--ui-menu-header-color, var(--navigation-high-content-default))}.ui-menu._high .ui-menu-action{color:var(--ui-menu-action-color, var(--navigation-high-content-default))}.ui-menu._high .ui-menu-action:hover:not(:disabled){background-color:var(--ui-menu-action-surface-hover, var(--navigation-high-surface-hover));color:var(--ui-menu-action-color-hover, var(--navigation-high-content-hover))}.ui-menu._high .ui-menu-action:active:not(:disabled){background-color:var(--ui-menu-action-surface-pressed, var(--navigation-high-surface-active));color:var(--ui-menu-action-color-pressed, var(--navigation-high-content-active))}.ui-menu._high .ui-menu-action._sub-open:not(:disabled){background-color:var(--ui-menu-action-surface-hover, var(--navigation-high-surface-hover));color:var(--ui-menu-action-color-hover, var(--navigation-high-content-hover))}.ui-menu._high .ui-menu-action._active{background-color:var(--ui-menu-action-surface-active, var(--navigation-high-surface-active));color:var(--ui-menu-action-color-active, var(--navigation-high-content-active))}.ui-menu._high .ui-menu-action:disabled{background-color:var(--ui-menu-action-surface-disabled, var(--navigation-high-surface-disabled));color:var(--ui-menu-action-color-disabled, var(--navigation-high-content-disabled))}.ui-menu._low .ui-menu-header{color:var(--ui-menu-header-color, var(--navigation-low-content-default))}.ui-menu._low .ui-menu-action{color:var(--ui-menu-action-color, var(--navigation-low-content-default))}.ui-menu._low .ui-menu-action:hover:not(:disabled){background-color:var(--ui-menu-action-surface-hover, var(--navigation-low-surface-hover));color:var(--ui-menu-action-color-hover, var(--navigation-low-content-hover))}.ui-menu._low .ui-menu-action:active:not(:disabled){background-color:var(--ui-menu-action-surface-pressed, var(--navigation-low-surface-active));color:var(--ui-menu-action-color-pressed, var(--navigation-low-content-active))}.ui-menu._low .ui-menu-action._sub-open:not(:disabled){background-color:var(--ui-menu-action-surface-hover, var(--navigation-low-surface-hover));color:var(--ui-menu-action-color-hover, var(--navigation-low-content-hover))}.ui-menu._low .ui-menu-action._active{background-color:var(--ui-menu-action-surface-active, var(--navigation-low-surface-active));color:var(--ui-menu-action-color-active, var(--navigation-low-content-active))}.ui-menu._low .ui-menu-action:disabled{background-color:var(--ui-menu-action-surface-disabled, var(--navigation-low-surface-disabled));color:var(--ui-menu-action-color-disabled, var(--navigation-low-content-disabled))}\n"],
551
+ dependencies: [
552
+ {
553
+ kind: "component",
554
+ type: UiMenu,
555
+ selector: "ui-menu",
556
+ inputs: [
557
+ "items",
558
+ "popup",
559
+ "expandedKeys",
560
+ "ariaLabel",
561
+ "ariaLabelledBy",
562
+ "styleClass",
563
+ "level",
564
+ "size",
565
+ "submenus",
566
+ "motion",
567
+ "ripple",
568
+ "autoFlip",
569
+ "tabindex",
570
+ "itemTemplate",
571
+ "submenuHeaderTemplate"
572
+ ],
573
+ outputs: [
574
+ "expandedKeysChange",
575
+ "opened",
576
+ "closed",
577
+ "itemClick"
578
+ ]
579
+ },
580
+ {
581
+ kind: "directive",
582
+ type: NgTemplateOutlet,
583
+ selector: "[ngTemplateOutlet]",
584
+ inputs: [
585
+ "ngTemplateOutletContext",
586
+ "ngTemplateOutlet",
587
+ "ngTemplateOutletInjector"
588
+ ]
589
+ },
590
+ {
591
+ kind: "ngmodule",
592
+ type: OverlayModule
593
+ },
594
+ {
595
+ kind: "directive",
596
+ type: i1.CdkConnectedOverlay,
597
+ selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]",
598
+ inputs: [
599
+ "cdkConnectedOverlayOrigin",
600
+ "cdkConnectedOverlayPositions",
601
+ "cdkConnectedOverlayPositionStrategy",
602
+ "cdkConnectedOverlayOffsetX",
603
+ "cdkConnectedOverlayOffsetY",
604
+ "cdkConnectedOverlayWidth",
605
+ "cdkConnectedOverlayHeight",
606
+ "cdkConnectedOverlayMinWidth",
607
+ "cdkConnectedOverlayMinHeight",
608
+ "cdkConnectedOverlayBackdropClass",
609
+ "cdkConnectedOverlayPanelClass",
610
+ "cdkConnectedOverlayViewportMargin",
611
+ "cdkConnectedOverlayScrollStrategy",
612
+ "cdkConnectedOverlayOpen",
613
+ "cdkConnectedOverlayDisableClose",
614
+ "cdkConnectedOverlayTransformOriginOn",
615
+ "cdkConnectedOverlayHasBackdrop",
616
+ "cdkConnectedOverlayLockPosition",
617
+ "cdkConnectedOverlayFlexibleDimensions",
618
+ "cdkConnectedOverlayGrowAfterOpen",
619
+ "cdkConnectedOverlayPush",
620
+ "cdkConnectedOverlayDisposeOnNavigation",
621
+ "cdkConnectedOverlayUsePopover",
622
+ "cdkConnectedOverlayMatchWidth",
623
+ "cdkConnectedOverlay"
624
+ ],
625
+ outputs: [
626
+ "backdropClick",
627
+ "positionChange",
628
+ "attach",
629
+ "detach",
630
+ "overlayKeydown",
631
+ "overlayOutsideClick"
632
+ ],
633
+ exportAs: ["cdkConnectedOverlay"]
634
+ },
635
+ {
636
+ kind: "directive",
637
+ type: i1.CdkOverlayOrigin,
638
+ selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]",
639
+ exportAs: ["cdkOverlayOrigin"]
640
+ },
641
+ {
642
+ kind: "directive",
643
+ type: RouterLink,
644
+ selector: "[routerLink]",
645
+ inputs: [
646
+ "target",
647
+ "queryParams",
648
+ "fragment",
649
+ "queryParamsHandling",
650
+ "state",
651
+ "info",
652
+ "relativeTo",
653
+ "preserveFragment",
654
+ "skipLocationChange",
655
+ "replaceUrl",
656
+ "browserUrl",
657
+ "scroll",
658
+ "routerLink"
659
+ ]
660
+ },
661
+ {
662
+ kind: "directive",
663
+ type: RouterLinkActive,
664
+ selector: "[routerLinkActive]",
665
+ inputs: [
666
+ "routerLinkActiveOptions",
667
+ "ariaCurrentWhenActive",
668
+ "routerLinkActive"
669
+ ],
670
+ outputs: ["isActiveChange"],
671
+ exportAs: ["routerLinkActive"]
672
+ },
673
+ {
674
+ kind: "component",
675
+ type: UiIcon,
676
+ selector: "ui-icon",
677
+ inputs: [
678
+ "name",
679
+ "size",
680
+ "type",
681
+ "family",
682
+ "decorative",
683
+ "ariaLabel"
684
+ ]
685
+ },
686
+ {
687
+ kind: "directive",
688
+ type: UiMotion,
689
+ selector: "[uiMotion]",
690
+ inputs: [
691
+ "uiMotion",
692
+ "motionDuration",
693
+ "motionDelay",
694
+ "motionEasing",
695
+ "motionEnterEasing",
696
+ "motionLeaveEasing",
697
+ "motionDistance",
698
+ "motionScale",
699
+ "motionDisabled",
700
+ "motionOnInsert"
701
+ ],
702
+ exportAs: ["uiMotion"]
703
+ },
704
+ {
705
+ kind: "component",
706
+ type: UiSeparator,
707
+ selector: "ui-separator",
708
+ inputs: [
709
+ "label",
710
+ "orientation",
711
+ "variant",
712
+ "size",
713
+ "labelAlign",
714
+ "ariaLabel"
715
+ ]
716
+ }
717
+ ]
718
+ });
719
+ }
720
+ };
721
+ i0.ɵɵngDeclareClassMetadata({
722
+ minVersion: "12.0.0",
723
+ version: "22.3.0",
724
+ ngImport: i0,
725
+ type: UiMenu,
726
+ decorators: [{
727
+ type: Component,
728
+ args: [{
729
+ selector: "ui-menu",
730
+ imports: [
731
+ NgTemplateOutlet,
732
+ OverlayModule,
733
+ RouterLink,
734
+ RouterLinkActive,
735
+ UiIcon,
736
+ UiMotion,
737
+ UiSeparator
738
+ ],
739
+ host: { "[style.display]": "popup() ? 'contents' : 'block'" },
740
+ template: "<!-- Menu panel: shared between inline render and the CDK overlay popup. -->\n<ng-template #panelTpl>\n <div\n #panel\n [class]=\"panelClasses()\"\n [attr.id]=\"uid\"\n [uiMotion]=\"'slide-down'\"\n [motionDisabled]=\"!motion()\"\n #panelMotion=\"uiMotion\"\n [motionOnInsert]=\"popup()\"\n >\n @if (startTemplate(); as tpl) {\n <div class=\"ui-menu-start\">\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n </div>\n }\n\n <!-- ARIA menu pattern: keyboard delegated to the role=\"menu\" container, focus\n lives on the items (roving tabindex). -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <ul\n class=\"ui-menu-list\"\n role=\"menu\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n (keydown)=\"onListKeydown($event)\"\n >\n <ng-container\n [ngTemplateOutlet]=\"nodesTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: nodes() }\"\n />\n </ul>\n\n @if (endTemplate(); as tpl) {\n <div class=\"ui-menu-end\">\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n </div>\n }\n </div>\n</ng-template>\n\n<!-- Recursive node list (separator | header section | toggleable group | leaf item). -->\n<ng-template #nodesTpl let-nodes>\n @for (node of nodes; track node.key) {\n @switch (node.kind) {\n @case ('separator') {\n <li class=\"ui-menu-separator\" role=\"separator\" aria-hidden=\"true\">\n <ui-separator></ui-separator>\n </li>\n }\n\n @case ('header') {\n <li class=\"ui-menu-section\" role=\"none\" [class]=\"node.item.styleClass ?? ''\">\n <span class=\"ui-menu-header\" [attr.id]=\"headerId(node)\">\n @if (resolvedSubmenuHeaderTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: node.item }\"\n />\n } @else {\n @if (node.item.icon; as icon) {\n <ui-icon class=\"ui-menu-item-icon\" [name]=\"icon\" size=\"sm\" />\n }\n <span class=\"ui-menu-item-label\">{{ node.item.label }}</span>\n }\n </span>\n <ul class=\"ui-menu-group\" role=\"group\" [attr.aria-labelledby]=\"headerId(node)\">\n <ng-container\n [ngTemplateOutlet]=\"nodesTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: node.children }\"\n />\n </ul>\n </li>\n }\n\n @case ('toggle') {\n <li class=\"ui-menu-entry\" role=\"none\" [class]=\"node.item.styleClass ?? ''\">\n <button\n type=\"button\"\n class=\"ui-menu-action _toggle\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n role=\"menuitem\"\n [attr.data-key]=\"node.key\"\n [attr.aria-expanded]=\"node.expanded\"\n [attr.aria-controls]=\"groupId(node)\"\n [attr.aria-label]=\"node.item.ariaLabel || null\"\n [attr.title]=\"node.item.title || null\"\n [disabled]=\"node.item.disabled ?? false\"\n [attr.tabindex]=\"node.key === tabStopKey() ? tabindex() : -1\"\n (click)=\"onToggleClick(node)\"\n (mouseenter)=\"onEntryHover(node)\"\n (focus)=\"onEntryFocus(node)\"\n >\n @if (resolvedSubmenuHeaderTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: node.item }\"\n />\n } @else {\n @if (node.item.icon; as icon) {\n <ui-icon class=\"ui-menu-item-icon\" [name]=\"icon\" size=\"sm\" />\n }\n <span class=\"ui-menu-item-label\">{{ node.item.label }}</span>\n }\n <!-- `_open`, not `_expanded`: a global helper class `._expanded` (width:100%) exists. -->\n <ui-icon\n class=\"ui-menu-chevron\"\n [class._open]=\"node.expanded\"\n name=\"chevron-down\"\n size=\"sm\"\n />\n </button>\n <div\n class=\"ui-menu-collapse\"\n [class._open]=\"node.expanded\"\n [attr.id]=\"groupId(node)\"\n [attr.inert]=\"node.expanded ? null : ''\"\n >\n <div class=\"ui-menu-collapse-inner\">\n <ul class=\"ui-menu-group _nested\" role=\"group\">\n <ng-container\n [ngTemplateOutlet]=\"nodesTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: node.children }\"\n />\n </ul>\n </div>\n </div>\n </li>\n }\n\n @case ('flyout') {\n <li\n class=\"ui-menu-entry\"\n role=\"none\"\n [class]=\"node.item.styleClass ?? ''\"\n cdkOverlayOrigin\n #flyoutOrigin=\"cdkOverlayOrigin\"\n >\n <button\n type=\"button\"\n class=\"ui-menu-action _has-sub\"\n [class._sub-open]=\"openFlyoutKey() === node.key\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n role=\"menuitem\"\n aria-haspopup=\"menu\"\n [attr.data-key]=\"node.key\"\n [attr.aria-expanded]=\"openFlyoutKey() === node.key\"\n [attr.aria-label]=\"node.item.ariaLabel || null\"\n [attr.title]=\"node.item.title || null\"\n [disabled]=\"node.item.disabled ?? false\"\n [attr.tabindex]=\"node.key === tabStopKey() ? tabindex() : -1\"\n (click)=\"onFlyoutClick(node)\"\n (mouseenter)=\"onEntryHover(node)\"\n (focus)=\"onEntryFocus(node)\"\n >\n @if (resolvedItemTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: node.item }\"\n />\n } @else {\n @if (node.item.icon; as icon) {\n <ui-icon class=\"ui-menu-item-icon\" [name]=\"icon\" size=\"sm\" />\n }\n <span class=\"ui-menu-item-label\">{{ node.item.label }}</span>\n }\n <ui-icon class=\"ui-menu-chevron\" name=\"chevron-right\" size=\"sm\" />\n </button>\n\n <!-- Cascading side panel: a nested menu in its own overlay, anchored to the item. -->\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"flyoutOrigin\"\n [cdkConnectedOverlayOpen]=\"openFlyoutKey() === node.key\"\n [cdkConnectedOverlayPositions]=\"flyoutPositions\"\n >\n <!-- Flyout: keyboard delegated to the panel, focus lives on the items. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"ui-menu-flyout\"\n [uiMotion]=\"'fade'\"\n [motionDisabled]=\"!motion()\"\n #flyoutMotion=\"uiMotion\"\n motionOnInsert\n (keydown)=\"onFlyoutPanelKeydown($event, node)\"\n >\n <ui-menu\n [items]=\"node.item.items ?? []\"\n [level]=\"level()\"\n [size]=\"size()\"\n [motion]=\"motion()\"\n submenus=\"flyout\"\n styleClass=\"_floating\"\n [itemTemplate]=\"resolvedItemTemplate()\"\n [submenuHeaderTemplate]=\"resolvedSubmenuHeaderTemplate()\"\n [ariaLabel]=\"node.item.label\"\n (itemClick)=\"onChildItemClick($event)\"\n />\n </div>\n </ng-template>\n </li>\n }\n\n @case ('item') {\n <li class=\"ui-menu-entry\" role=\"none\" [class]=\"node.item.styleClass ?? ''\">\n <!-- Shared menuitem content (icon + label, or the #item template). -->\n <ng-template #content>\n @if (resolvedItemTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: node.item }\"\n />\n } @else {\n @if (node.item.icon; as icon) {\n <ui-icon class=\"ui-menu-item-icon\" [name]=\"icon\" size=\"sm\" />\n }\n <span class=\"ui-menu-item-label\">{{ node.item.label }}</span>\n }\n </ng-template>\n\n @if (node.item.routerLink !== undefined && !node.item.disabled) {\n <a\n class=\"ui-menu-action\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n role=\"menuitem\"\n [attr.data-key]=\"node.key\"\n [routerLink]=\"node.item.routerLink\"\n [queryParams]=\"node.item.queryParams ?? null\"\n [queryParamsHandling]=\"node.item.queryParamsHandling ?? null\"\n routerLinkActive=\"_active\"\n [routerLinkActiveOptions]=\"{ exact: node.item.routerLinkActiveExact ?? false }\"\n [attr.target]=\"node.item.target || null\"\n [attr.aria-label]=\"node.item.ariaLabel || null\"\n [attr.title]=\"node.item.title || null\"\n [attr.tabindex]=\"node.key === tabStopKey() ? tabindex() : -1\"\n (click)=\"onItemClick($event, node)\"\n (mouseenter)=\"onEntryHover(node)\"\n (focus)=\"onEntryFocus(node)\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n } @else if (node.item.url && !node.item.disabled) {\n <a\n class=\"ui-menu-action\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n role=\"menuitem\"\n [attr.data-key]=\"node.key\"\n [attr.href]=\"node.item.url\"\n [attr.target]=\"node.item.target || null\"\n [attr.rel]=\"node.item.target === '_blank' ? 'noopener noreferrer' : null\"\n [attr.aria-label]=\"node.item.ariaLabel || null\"\n [attr.title]=\"node.item.title || null\"\n [attr.tabindex]=\"node.key === tabStopKey() ? tabindex() : -1\"\n (click)=\"onItemClick($event, node)\"\n (mouseenter)=\"onEntryHover(node)\"\n (focus)=\"onEntryFocus(node)\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n } @else {\n <button\n type=\"button\"\n class=\"ui-menu-action\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n role=\"menuitem\"\n [attr.data-key]=\"node.key\"\n [disabled]=\"node.item.disabled ?? false\"\n [attr.aria-label]=\"node.item.ariaLabel || null\"\n [attr.title]=\"node.item.title || null\"\n [attr.tabindex]=\"node.key === tabStopKey() ? tabindex() : -1\"\n (click)=\"onItemClick($event, node)\"\n (mouseenter)=\"onEntryHover(node)\"\n (focus)=\"onEntryFocus(node)\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </button>\n }\n </li>\n }\n }\n }\n</ng-template>\n\n@if (popup()) {\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayOrigin()!\"\n [cdkConnectedOverlayOpen]=\"popupOpen()\"\n [cdkConnectedOverlayPositions]=\"overlayPositions()\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n (backdropClick)=\"hide()\"\n (overlayOutsideClick)=\"onPopupOutsideClick($event)\"\n (detach)=\"hide()\"\n >\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\n </ng-template>\n} @else {\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\n}\n",
741
+ styles: [".ui-menu{display:flex;flex-direction:column;gap:var(--units-2xs);padding:var(--ui-menu-panel-padding, var(--ui-overlay-panel-padding, var(--units-sm)));box-sizing:border-box;border:var(--ui-control-stroke-width, var(--stroke-default)) solid var(--ui-overlay-stroke, transparent);border-radius:var(--ui-overlay-radius, var(--ui-overlay-panel-radius, var(--radius-default)));background-color:var(--ui-overlay-surface, var(--ui-menu-panel-surface, var(--global-background-default)));box-shadow:var(--ui-overlay-shadow, var(--ui-overlay-panel-shadow, var(--shadow-default-md)));font-family:var(--ui-overlay-panel-font-family, var(--fontfamily-base));border:none;min-width:var(--ui-menu-min-width, 13.125rem)}.ui-menu .ui-menu-action{min-height:var(--ui-menu-item-height, 2.5rem);padding:0 var(--ui-menu-item-padding-x, var(--units-md));font-size:var(--ui-menu-font-size, var(--size-typography-text-default))}.ui-menu .ui-menu-header{min-height:var(--ui-menu-header-height, 2rem);padding:0 var(--ui-menu-item-padding-x, var(--units-md));font-size:var(--ui-menu-header-font-size, var(--size-typography-text-md))}.ui-menu._popup,.ui-menu._floating{width:max-content;max-width:calc(100vw - var(--units-lg));max-height:calc(100vh - var(--units-lg));overflow:auto}.ui-menu-list,.ui-menu-group{display:flex;flex-direction:column;gap:var(--units-2xs);margin:0;padding:0;list-style:none}.ui-menu-group._nested{padding-left:var(--ui-menu-group-indent, var(--units-default))}.ui-menu-section,.ui-menu-entry{display:flex;flex-direction:column;gap:var(--units-2xs)}.ui-menu._small{min-width:var(--ui-menu-min-width-small, 10rem)}.ui-menu._small .ui-menu-action{min-height:var(--ui-menu-item-height-small, 2rem);padding:0 var(--ui-menu-item-padding-x-small, var(--units-sm));font-size:var(--ui-menu-font-size-small, var(--size-typography-text-md))}.ui-menu._small .ui-menu-header{min-height:var(--ui-menu-header-height-small, 1.5rem);padding:0 var(--ui-menu-item-padding-x-small, var(--units-sm));font-size:var(--ui-menu-header-font-size-small, var(--size-typography-text-sm))}.ui-menu-header{display:flex;align-items:center;gap:var(--units-sm);font-weight:var(--ui-menu-header-weight, var(--weight-bold));-webkit-user-select:none;user-select:none}.ui-menu-action{display:flex;align-items:center;gap:var(--units-sm);box-sizing:border-box;width:100%;border:none;border-radius:var(--ui-menu-item-radius, var(--radius-sm));background:none;font-family:var(--ui-menu-font-family, var(--fontfamily-base));font-size:var(--size-typography-text-default);font-weight:var(--ui-menu-action-weight, var(--weight-regular));line-height:1.2;text-align:left;text-decoration:none;cursor:pointer;transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),box-shadow var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-menu-action:focus-visible{outline:none;box-shadow:inset 0 0 0 var(--ui-menu-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-menu-action-focus-ring-color, var(--global-border-focus))}.ui-menu-action:disabled{cursor:not-allowed}.ui-menu-item-icon,.ui-menu-chevron{flex-shrink:0;line-height:0}.ui-menu-item-label{flex:1 1 auto;min-width:0}.ui-menu-chevron{margin-left:auto;transition:rotate var(--ui-motion-duration, var(--motion-toggle-duration, var(--transition-default))) var(--ui-motion-easing, var(--motion-toggle-easing, var(--transition-easeinout))) var(--ui-motion-delay, 0ms)}.ui-menu-chevron._open{rotate:180deg}.ui-menu-flyout{display:block}.ui-menu-collapse{display:grid;grid-template-rows:0fr;opacity:0;transition:grid-template-rows var(--ui-motion-duration, var(--motion-toggle-duration, var(--transition-default))) var(--ui-motion-easing, var(--motion-toggle-easing, var(--transition-easeinout))) var(--ui-motion-delay, 0ms),opacity var(--ui-motion-duration, var(--motion-toggle-duration, var(--transition-default))) var(--ui-motion-easing, var(--motion-toggle-easing, var(--transition-easeinout))) var(--ui-motion-delay, 0ms)}.ui-menu-collapse._open{grid-template-rows:1fr;opacity:1}.ui-menu-collapse-inner{min-height:0;overflow:hidden}.ui-menu._no-motion .ui-menu-collapse,.ui-menu._no-motion .ui-menu-chevron{transition:none}.ui-menu-separator{border:none}.ui-menu-start,.ui-menu-end{padding:var(--units-2xs) var(--units-md)}.ui-menu._high .ui-menu-header{color:var(--ui-menu-header-color, var(--navigation-high-content-default))}.ui-menu._high .ui-menu-action{color:var(--ui-menu-action-color, var(--navigation-high-content-default))}.ui-menu._high .ui-menu-action:hover:not(:disabled){background-color:var(--ui-menu-action-surface-hover, var(--navigation-high-surface-hover));color:var(--ui-menu-action-color-hover, var(--navigation-high-content-hover))}.ui-menu._high .ui-menu-action:active:not(:disabled){background-color:var(--ui-menu-action-surface-pressed, var(--navigation-high-surface-active));color:var(--ui-menu-action-color-pressed, var(--navigation-high-content-active))}.ui-menu._high .ui-menu-action._sub-open:not(:disabled){background-color:var(--ui-menu-action-surface-hover, var(--navigation-high-surface-hover));color:var(--ui-menu-action-color-hover, var(--navigation-high-content-hover))}.ui-menu._high .ui-menu-action._active{background-color:var(--ui-menu-action-surface-active, var(--navigation-high-surface-active));color:var(--ui-menu-action-color-active, var(--navigation-high-content-active))}.ui-menu._high .ui-menu-action:disabled{background-color:var(--ui-menu-action-surface-disabled, var(--navigation-high-surface-disabled));color:var(--ui-menu-action-color-disabled, var(--navigation-high-content-disabled))}.ui-menu._low .ui-menu-header{color:var(--ui-menu-header-color, var(--navigation-low-content-default))}.ui-menu._low .ui-menu-action{color:var(--ui-menu-action-color, var(--navigation-low-content-default))}.ui-menu._low .ui-menu-action:hover:not(:disabled){background-color:var(--ui-menu-action-surface-hover, var(--navigation-low-surface-hover));color:var(--ui-menu-action-color-hover, var(--navigation-low-content-hover))}.ui-menu._low .ui-menu-action:active:not(:disabled){background-color:var(--ui-menu-action-surface-pressed, var(--navigation-low-surface-active));color:var(--ui-menu-action-color-pressed, var(--navigation-low-content-active))}.ui-menu._low .ui-menu-action._sub-open:not(:disabled){background-color:var(--ui-menu-action-surface-hover, var(--navigation-low-surface-hover));color:var(--ui-menu-action-color-hover, var(--navigation-low-content-hover))}.ui-menu._low .ui-menu-action._active{background-color:var(--ui-menu-action-surface-active, var(--navigation-low-surface-active));color:var(--ui-menu-action-color-active, var(--navigation-low-content-active))}.ui-menu._low .ui-menu-action:disabled{background-color:var(--ui-menu-action-surface-disabled, var(--navigation-low-surface-disabled));color:var(--ui-menu-action-color-disabled, var(--navigation-low-content-disabled))}\n"]
742
+ }]
743
+ }],
744
+ ctorParameters: () => [],
745
+ propDecorators: {
746
+ items: [{
747
+ type: i0.Input,
748
+ args: [{
749
+ isSignal: true,
750
+ alias: "items",
751
+ required: false
752
+ }]
753
+ }],
754
+ popup: [{
755
+ type: i0.Input,
756
+ args: [{
757
+ isSignal: true,
758
+ alias: "popup",
759
+ required: false
760
+ }]
761
+ }],
762
+ expandedKeys: [{
763
+ type: i0.Input,
764
+ args: [{
765
+ isSignal: true,
766
+ alias: "expandedKeys",
767
+ required: false
768
+ }]
769
+ }, {
770
+ type: i0.Output,
771
+ args: ["expandedKeysChange"]
772
+ }],
773
+ ariaLabel: [{
774
+ type: i0.Input,
775
+ args: [{
776
+ isSignal: true,
777
+ alias: "ariaLabel",
778
+ required: false
779
+ }]
780
+ }],
781
+ ariaLabelledBy: [{
782
+ type: i0.Input,
783
+ args: [{
784
+ isSignal: true,
785
+ alias: "ariaLabelledBy",
786
+ required: false
787
+ }]
788
+ }],
789
+ styleClass: [{
790
+ type: i0.Input,
791
+ args: [{
792
+ isSignal: true,
793
+ alias: "styleClass",
794
+ required: false
795
+ }]
796
+ }],
797
+ level: [{
798
+ type: i0.Input,
799
+ args: [{
800
+ isSignal: true,
801
+ alias: "level",
802
+ required: false
803
+ }]
804
+ }],
805
+ size: [{
806
+ type: i0.Input,
807
+ args: [{
808
+ isSignal: true,
809
+ alias: "size",
810
+ required: false
811
+ }]
812
+ }],
813
+ submenus: [{
814
+ type: i0.Input,
815
+ args: [{
816
+ isSignal: true,
817
+ alias: "submenus",
818
+ required: false
819
+ }]
820
+ }],
821
+ motion: [{
822
+ type: i0.Input,
823
+ args: [{
824
+ isSignal: true,
825
+ alias: "motion",
826
+ required: false
827
+ }]
828
+ }],
829
+ ripple: [{
830
+ type: i0.Input,
831
+ args: [{
832
+ isSignal: true,
833
+ alias: "ripple",
834
+ required: false
835
+ }]
836
+ }],
837
+ autoFlip: [{
838
+ type: i0.Input,
839
+ args: [{
840
+ isSignal: true,
841
+ alias: "autoFlip",
842
+ required: false
843
+ }]
844
+ }],
845
+ tabindex: [{
846
+ type: i0.Input,
847
+ args: [{
848
+ isSignal: true,
849
+ alias: "tabindex",
850
+ required: false
851
+ }]
852
+ }],
853
+ opened: [{
854
+ type: i0.Output,
855
+ args: ["opened"]
856
+ }],
857
+ closed: [{
858
+ type: i0.Output,
859
+ args: ["closed"]
860
+ }],
861
+ itemClick: [{
862
+ type: i0.Output,
863
+ args: ["itemClick"]
864
+ }],
865
+ itemTemplate: [{
866
+ type: i0.Input,
867
+ args: [{
868
+ isSignal: true,
869
+ alias: "itemTemplate",
870
+ required: false
871
+ }]
872
+ }],
873
+ submenuHeaderTemplate: [{
874
+ type: i0.Input,
875
+ args: [{
876
+ isSignal: true,
877
+ alias: "submenuHeaderTemplate",
878
+ required: false
879
+ }]
880
+ }],
881
+ itemTemplateContent: [{
882
+ type: i0.ContentChild,
883
+ args: ["item", { isSignal: true }]
884
+ }],
885
+ submenuHeaderTemplateContent: [{
886
+ type: i0.ContentChild,
887
+ args: ["submenuheader", { isSignal: true }]
888
+ }],
889
+ startTemplate: [{
890
+ type: i0.ContentChild,
891
+ args: ["start", { isSignal: true }]
892
+ }],
893
+ endTemplate: [{
894
+ type: i0.ContentChild,
895
+ args: ["end", { isSignal: true }]
896
+ }],
897
+ panelEl: [{
898
+ type: i0.ViewChild,
899
+ args: ["panel", { isSignal: true }]
900
+ }],
901
+ childMenus: [{
902
+ type: i0.ViewChildren,
903
+ args: [i0.forwardRef(() => UiMenu), { isSignal: true }]
904
+ }],
905
+ connectedOverlays: [{
906
+ type: i0.ViewChildren,
907
+ args: [i0.forwardRef(() => CdkConnectedOverlay), { isSignal: true }]
908
+ }]
909
+ }
910
+ });
550
911
  export { UiMenu };
551
- //# sourceMappingURL=4sh-ui-kit-navigation-ui-menu.mjs.map
912
+
913
+ //# sourceMappingURL=4sh-ui-kit-navigation-ui-menu.mjs.map