@daffodil/design 0.90.0 → 0.92.3-rc.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 (277) hide show
  1. package/accordion/README.md +26 -38
  2. package/accordion/index.d.ts +9 -6
  3. package/article/README.md +66 -46
  4. package/article/index.d.ts +41 -0
  5. package/article/src/article-theme.scss +22 -0
  6. package/breadcrumb/README.md +6 -1
  7. package/breadcrumb/index.d.ts +65 -11
  8. package/breadcrumb/src/breadcrumb-theme.scss +1 -1
  9. package/button/README.md +36 -33
  10. package/button/index.d.ts +27 -6
  11. package/button/src/button/basic/button-theme.scss +4 -2
  12. package/button/src/button/button-base.scss +29 -6
  13. package/button/src/button/icon/icon-theme.scss +10 -6
  14. package/button/src/button/raised/raised-theme.scss +6 -4
  15. package/callout/README.md +15 -27
  16. package/card/README.md +36 -69
  17. package/card/index.d.ts +7 -41
  18. package/card/src/card-base-theme.scss +2 -5
  19. package/card/src/card-base.scss +2 -2
  20. package/checkbox/README.md +0 -0
  21. package/checkbox/index.d.ts +177 -0
  22. package/container/README.md +18 -23
  23. package/fesm2022/daffodil-design-accordion.mjs +34 -25
  24. package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
  25. package/fesm2022/daffodil-design-article.mjs +283 -17
  26. package/fesm2022/daffodil-design-article.mjs.map +1 -1
  27. package/fesm2022/daffodil-design-breadcrumb.mjs +180 -28
  28. package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
  29. package/fesm2022/daffodil-design-button.mjs +90 -45
  30. package/fesm2022/daffodil-design-button.mjs.map +1 -1
  31. package/fesm2022/daffodil-design-callout.mjs +23 -23
  32. package/fesm2022/daffodil-design-callout.mjs.map +1 -1
  33. package/fesm2022/daffodil-design-card.mjs +43 -90
  34. package/fesm2022/daffodil-design-card.mjs.map +1 -1
  35. package/fesm2022/daffodil-design-checkbox.mjs +317 -0
  36. package/fesm2022/daffodil-design-checkbox.mjs.map +1 -0
  37. package/fesm2022/daffodil-design-container.mjs +8 -8
  38. package/fesm2022/daffodil-design-container.mjs.map +1 -1
  39. package/fesm2022/daffodil-design-form-field.mjs +56 -86
  40. package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
  41. package/fesm2022/daffodil-design-form.mjs +62 -0
  42. package/fesm2022/daffodil-design-form.mjs.map +1 -0
  43. package/fesm2022/daffodil-design-hero.mjs +23 -23
  44. package/fesm2022/daffodil-design-hero.mjs.map +1 -1
  45. package/fesm2022/daffodil-design-image.mjs +19 -11
  46. package/fesm2022/daffodil-design-image.mjs.map +1 -1
  47. package/fesm2022/daffodil-design-input.mjs +18 -14
  48. package/fesm2022/daffodil-design-input.mjs.map +1 -1
  49. package/fesm2022/daffodil-design-link-set.mjs +25 -17
  50. package/fesm2022/daffodil-design-link-set.mjs.map +1 -1
  51. package/fesm2022/daffodil-design-list.mjs +16 -16
  52. package/fesm2022/daffodil-design-list.mjs.map +1 -1
  53. package/fesm2022/daffodil-design-loading-icon.mjs +8 -8
  54. package/fesm2022/daffodil-design-loading-icon.mjs.map +1 -1
  55. package/fesm2022/daffodil-design-media-gallery.mjs +13 -13
  56. package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
  57. package/fesm2022/daffodil-design-menu.mjs +223 -60
  58. package/fesm2022/daffodil-design-menu.mjs.map +1 -1
  59. package/fesm2022/daffodil-design-modal.mjs +86 -83
  60. package/fesm2022/daffodil-design-modal.mjs.map +1 -1
  61. package/fesm2022/daffodil-design-native-select.mjs +47 -41
  62. package/fesm2022/daffodil-design-native-select.mjs.map +1 -1
  63. package/fesm2022/daffodil-design-navbar.mjs +25 -21
  64. package/fesm2022/daffodil-design-navbar.mjs.map +1 -1
  65. package/fesm2022/daffodil-design-notification.mjs +28 -64
  66. package/fesm2022/daffodil-design-notification.mjs.map +1 -1
  67. package/fesm2022/daffodil-design-paginator.mjs +11 -16
  68. package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
  69. package/fesm2022/daffodil-design-progress-bar.mjs +10 -10
  70. package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
  71. package/fesm2022/daffodil-design-quantity-field.mjs +19 -18
  72. package/fesm2022/daffodil-design-quantity-field.mjs.map +1 -1
  73. package/fesm2022/daffodil-design-radio.mjs +27 -56
  74. package/fesm2022/daffodil-design-radio.mjs.map +1 -1
  75. package/fesm2022/daffodil-design-select.mjs +6 -6
  76. package/fesm2022/daffodil-design-select.mjs.map +1 -1
  77. package/fesm2022/daffodil-design-sidebar.mjs +30 -60
  78. package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
  79. package/fesm2022/daffodil-design-spinner.mjs +99 -0
  80. package/fesm2022/daffodil-design-spinner.mjs.map +1 -0
  81. package/fesm2022/daffodil-design-switch.mjs +49 -106
  82. package/fesm2022/daffodil-design-switch.mjs.map +1 -1
  83. package/fesm2022/daffodil-design-tabs.mjs +35 -27
  84. package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
  85. package/fesm2022/daffodil-design-tag.mjs +7 -7
  86. package/fesm2022/daffodil-design-tag.mjs.map +1 -1
  87. package/fesm2022/daffodil-design-text-snippet.mjs +6 -8
  88. package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
  89. package/fesm2022/daffodil-design-textarea.mjs +6 -3
  90. package/fesm2022/daffodil-design-textarea.mjs.map +1 -1
  91. package/fesm2022/daffodil-design-toast.mjs +79 -80
  92. package/fesm2022/daffodil-design-toast.mjs.map +1 -1
  93. package/fesm2022/daffodil-design-tree.mjs +152 -112
  94. package/fesm2022/daffodil-design-tree.mjs.map +1 -1
  95. package/fesm2022/daffodil-design-youtube-player.mjs +6 -6
  96. package/fesm2022/daffodil-design-youtube-player.mjs.map +1 -1
  97. package/fesm2022/daffodil-design.mjs +559 -711
  98. package/fesm2022/daffodil-design.mjs.map +1 -1
  99. package/form/README.md +75 -0
  100. package/form/index.d.ts +27 -0
  101. package/form-field/README.md +74 -99
  102. package/form-field/index.d.ts +64 -42
  103. package/hero/README.md +5 -5
  104. package/image/README.md +27 -19
  105. package/image/index.d.ts +6 -1
  106. package/index.d.ts +282 -447
  107. package/input/README.md +36 -16
  108. package/input/index.d.ts +4 -3
  109. package/link-set/index.d.ts +9 -1
  110. package/list/README.md +2 -2
  111. package/loading-icon/README.md +1 -1
  112. package/loading-icon/index.d.ts +1 -1
  113. package/media-gallery/README.md +3 -3
  114. package/menu/README.md +107 -10
  115. package/menu/index.d.ts +143 -11
  116. package/modal/README.md +107 -17
  117. package/modal/index.d.ts +72 -35
  118. package/native-select/README.md +52 -15
  119. package/native-select/index.d.ts +8 -7
  120. package/navbar/README.md +23 -17
  121. package/navbar/index.d.ts +12 -2
  122. package/navbar/src/navbar-theme.scss +4 -46
  123. package/notification/README.md +4 -4
  124. package/notification/index.d.ts +7 -38
  125. package/package.json +1 -1
  126. package/paginator/README.md +42 -6
  127. package/paginator/index.d.ts +5 -9
  128. package/progress-bar/README.md +3 -3
  129. package/quantity-field/README.md +4 -4
  130. package/quantity-field/index.d.ts +4 -1
  131. package/radio/README.md +1 -1
  132. package/radio/index.d.ts +0 -16
  133. package/scss/layout/_breakpoint.scss +1 -1
  134. package/scss/theme.scss +9 -5
  135. package/scss/theming/_color-palettes.scss +19 -11
  136. package/scss/theming/_configure-theme.scss +11 -10
  137. package/scss/theming/_daff-theme.scss +5 -14
  138. package/scss/theming/_get-base-color.scss +2 -2
  139. package/scss/theming/_get-palette.scss +2 -2
  140. package/scss/theming/_get-theme-mode.scss +3 -3
  141. package/scss/theming/_index.scss +2 -1
  142. package/scss/theming/contrast/max-contrast/max-contrast.scss +3 -3
  143. package/scss/theming/contrast/text-contrast/text-contrast.scss +22 -16
  144. package/scss/theming/contrast/text-contrast/text-contrast.spec.scss +57 -0
  145. package/scss/theming/create-theme/_create-theme.scss +330 -0
  146. package/scss/theming/create-theme/_create-theme.spec.scss +122 -0
  147. package/scss/theming/create-theme/_index.scss +1 -0
  148. package/scss/theming/get-font-colors/_get-font-colors.scss +36 -0
  149. package/scss/theming/get-font-colors/_get-font-colors.spec.scss +72 -0
  150. package/scss/typography/mixins/_font-weight.scss +8 -14
  151. package/select/README.md +107 -4
  152. package/sidebar/README.md +6 -14
  153. package/sidebar/index.d.ts +3 -15
  154. package/spinner/README.md +57 -0
  155. package/spinner/index.d.ts +53 -0
  156. package/spinner/src/spinner-theme.scss +62 -0
  157. package/switch/README.md +21 -29
  158. package/switch/index.d.ts +18 -48
  159. package/switch/src/switch-theme.scss +26 -18
  160. package/tabs/README.md +1 -1
  161. package/tabs/index.d.ts +8 -5
  162. package/tag/README.md +24 -30
  163. package/tag/index.d.ts +1 -1
  164. package/tag/src/tag-theme.scss +11 -9
  165. package/text-snippet/README.md +1 -1
  166. package/text-snippet/src/text-snippet-theme.scss +12 -0
  167. package/textarea/README.md +36 -6
  168. package/textarea/index.d.ts +4 -4
  169. package/toast/README.md +4 -4
  170. package/tree/README.md +39 -22
  171. package/tree/index.d.ts +57 -96
  172. package/tree/src/tree-theme.scss +0 -4
  173. package/accordion/examples/index.d.ts +0 -20
  174. package/article/examples/index.d.ts +0 -50
  175. package/breadcrumb/examples/index.d.ts +0 -10
  176. package/button/examples/index.d.ts +0 -67
  177. package/callout/examples/index.d.ts +0 -41
  178. package/card/examples/index.d.ts +0 -62
  179. package/card/src/card/raised/raised-theme.scss +0 -28
  180. package/checkbox/examples/index.d.ts +0 -32
  181. package/container/examples/index.d.ts +0 -16
  182. package/fesm2022/daffodil-design-accordion-examples.mjs +0 -50
  183. package/fesm2022/daffodil-design-accordion-examples.mjs.map +0 -1
  184. package/fesm2022/daffodil-design-article-examples.mjs +0 -134
  185. package/fesm2022/daffodil-design-article-examples.mjs.map +0 -1
  186. package/fesm2022/daffodil-design-breadcrumb-examples.mjs +0 -46
  187. package/fesm2022/daffodil-design-breadcrumb-examples.mjs.map +0 -1
  188. package/fesm2022/daffodil-design-button-examples.mjs +0 -178
  189. package/fesm2022/daffodil-design-button-examples.mjs.map +0 -1
  190. package/fesm2022/daffodil-design-callout-examples.mjs +0 -116
  191. package/fesm2022/daffodil-design-callout-examples.mjs.map +0 -1
  192. package/fesm2022/daffodil-design-card-examples.mjs +0 -168
  193. package/fesm2022/daffodil-design-card-examples.mjs.map +0 -1
  194. package/fesm2022/daffodil-design-checkbox-examples.mjs +0 -76
  195. package/fesm2022/daffodil-design-checkbox-examples.mjs.map +0 -1
  196. package/fesm2022/daffodil-design-container-examples.mjs +0 -41
  197. package/fesm2022/daffodil-design-container-examples.mjs.map +0 -1
  198. package/fesm2022/daffodil-design-form-field-examples.mjs +0 -96
  199. package/fesm2022/daffodil-design-form-field-examples.mjs.map +0 -1
  200. package/fesm2022/daffodil-design-hero-examples.mjs +0 -121
  201. package/fesm2022/daffodil-design-hero-examples.mjs.map +0 -1
  202. package/fesm2022/daffodil-design-image-examples.mjs +0 -58
  203. package/fesm2022/daffodil-design-image-examples.mjs.map +0 -1
  204. package/fesm2022/daffodil-design-input-examples.mjs +0 -108
  205. package/fesm2022/daffodil-design-input-examples.mjs.map +0 -1
  206. package/fesm2022/daffodil-design-list-examples.mjs +0 -77
  207. package/fesm2022/daffodil-design-list-examples.mjs.map +0 -1
  208. package/fesm2022/daffodil-design-loading-icon-examples.mjs +0 -44
  209. package/fesm2022/daffodil-design-loading-icon-examples.mjs.map +0 -1
  210. package/fesm2022/daffodil-design-media-gallery-examples.mjs +0 -104
  211. package/fesm2022/daffodil-design-media-gallery-examples.mjs.map +0 -1
  212. package/fesm2022/daffodil-design-menu-examples.mjs +0 -50
  213. package/fesm2022/daffodil-design-menu-examples.mjs.map +0 -1
  214. package/fesm2022/daffodil-design-modal-examples.mjs +0 -51
  215. package/fesm2022/daffodil-design-modal-examples.mjs.map +0 -1
  216. package/fesm2022/daffodil-design-native-select-examples.mjs +0 -71
  217. package/fesm2022/daffodil-design-native-select-examples.mjs.map +0 -1
  218. package/fesm2022/daffodil-design-navbar-examples.mjs +0 -88
  219. package/fesm2022/daffodil-design-navbar-examples.mjs.map +0 -1
  220. package/fesm2022/daffodil-design-notification-examples.mjs +0 -102
  221. package/fesm2022/daffodil-design-notification-examples.mjs.map +0 -1
  222. package/fesm2022/daffodil-design-paginator-examples.mjs +0 -59
  223. package/fesm2022/daffodil-design-paginator-examples.mjs.map +0 -1
  224. package/fesm2022/daffodil-design-progress-bar-examples.mjs +0 -57
  225. package/fesm2022/daffodil-design-progress-bar-examples.mjs.map +0 -1
  226. package/fesm2022/daffodil-design-quantity-field-examples.mjs +0 -85
  227. package/fesm2022/daffodil-design-quantity-field-examples.mjs.map +0 -1
  228. package/fesm2022/daffodil-design-radio-examples.mjs +0 -34
  229. package/fesm2022/daffodil-design-radio-examples.mjs.map +0 -1
  230. package/fesm2022/daffodil-design-select-examples.mjs +0 -117
  231. package/fesm2022/daffodil-design-select-examples.mjs.map +0 -1
  232. package/fesm2022/daffodil-design-sidebar-examples.mjs +0 -109
  233. package/fesm2022/daffodil-design-sidebar-examples.mjs.map +0 -1
  234. package/fesm2022/daffodil-design-sticky-examples.mjs +0 -25
  235. package/fesm2022/daffodil-design-sticky-examples.mjs.map +0 -1
  236. package/fesm2022/daffodil-design-switch-examples.mjs +0 -110
  237. package/fesm2022/daffodil-design-switch-examples.mjs.map +0 -1
  238. package/fesm2022/daffodil-design-tabs-examples.mjs +0 -115
  239. package/fesm2022/daffodil-design-tabs-examples.mjs.map +0 -1
  240. package/fesm2022/daffodil-design-tag-examples.mjs +0 -125
  241. package/fesm2022/daffodil-design-tag-examples.mjs.map +0 -1
  242. package/fesm2022/daffodil-design-text-snippet-examples.mjs +0 -25
  243. package/fesm2022/daffodil-design-text-snippet-examples.mjs.map +0 -1
  244. package/fesm2022/daffodil-design-textarea-examples.mjs +0 -66
  245. package/fesm2022/daffodil-design-textarea-examples.mjs.map +0 -1
  246. package/fesm2022/daffodil-design-toast-examples.mjs +0 -147
  247. package/fesm2022/daffodil-design-toast-examples.mjs.map +0 -1
  248. package/fesm2022/daffodil-design-tree-examples.mjs +0 -104
  249. package/fesm2022/daffodil-design-tree-examples.mjs.map +0 -1
  250. package/form-field/examples/index.d.ts +0 -18
  251. package/hero/examples/index.d.ts +0 -45
  252. package/image/examples/index.d.ts +0 -10
  253. package/input/examples/index.d.ts +0 -10
  254. package/list/examples/index.d.ts +0 -29
  255. package/loading-icon/examples/index.d.ts +0 -16
  256. package/media-gallery/examples/index.d.ts +0 -38
  257. package/menu/examples/index.d.ts +0 -20
  258. package/modal/examples/index.d.ts +0 -15
  259. package/native-select/examples/index.d.ts +0 -10
  260. package/navbar/examples/index.d.ts +0 -31
  261. package/notification/examples/index.d.ts +0 -12
  262. package/paginator/examples/index.d.ts +0 -26
  263. package/progress-bar/examples/index.d.ts +0 -10
  264. package/quantity-field/examples/index.d.ts +0 -30
  265. package/radio/examples/index.d.ts +0 -13
  266. package/select/examples/index.d.ts +0 -28
  267. package/sidebar/examples/index.d.ts +0 -10
  268. package/sticky/examples/index.d.ts +0 -10
  269. package/switch/examples/index.d.ts +0 -46
  270. package/tabs/examples/index.d.ts +0 -12
  271. package/tag/examples/index.d.ts +0 -50
  272. package/text-snippet/examples/index.d.ts +0 -10
  273. package/textarea/examples/index.d.ts +0 -10
  274. package/toast/examples/index.d.ts +0 -56
  275. package/tree/examples/index.d.ts +0 -18
  276. /package/{form-field → form}/src/error-message/error-message-theme.scss +0 -0
  277. /package/{form-field → form}/src/hint/hint-theme.scss +0 -0
@@ -2,11 +2,26 @@ import * as i1 from '@angular/cdk/overlay';
2
2
  import { OverlayModule } from '@angular/cdk/overlay';
3
3
  import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
4
4
  import * as i0 from '@angular/core';
5
- import { Type, TemplateRef, Injectable, Input, Directive, ContentChild, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
6
- import { BehaviorSubject, map, Subject, takeUntil, fromEvent, filter } from 'rxjs';
5
+ import { Injector, Type, TemplateRef, Injectable, signal, input, computed, Input, Directive, ContentChild, ChangeDetectionStrategy, Component, ContentChildren, Inject, ViewEncapsulation, NgModule } from '@angular/core';
6
+ import { BehaviorSubject, map, Subject, takeUntil } from 'rxjs';
7
+ import { createConfigInjectionToken, createSingletonInjectionToken } from '@daffodil/core';
7
8
  import { CommonModule } from '@angular/common';
9
+ import { DaffPrefixDirective } from '@daffodil/design';
8
10
  import * as i1$1 from '@angular/cdk/a11y';
9
- import { DaffPrefixDirective, daffFocusableElementsSelector } from '@daffodil/design';
11
+ import { FocusKeyManager } from '@angular/cdk/a11y';
12
+
13
+ const daffMenuConfigDefault = {
14
+ menuId: '',
15
+ };
16
+ const {
17
+ /**
18
+ * An injection token for the menu configuration.
19
+ */
20
+ token: DAFF_MENU_CONFIG,
21
+ /**
22
+ * Provider function for {@link DAFF_MENU_CONFIG}.
23
+ */
24
+ provider: provideDaffMenuConfig, } = createConfigInjectionToken(daffMenuConfigDefault, 'DAFF_MENU_CONFIG');
10
25
 
11
26
  function daffMenuCreateOverlay(overlay, element, config = {}) {
12
27
  return overlay.create({
@@ -44,21 +59,31 @@ class DaffMenuService {
44
59
  this.$_open = new BehaviorSubject(false);
45
60
  this.open$ = this.$_open.asObservable();
46
61
  }
47
- async _createOverlay(activatorElement, component) {
62
+ /**
63
+ * @docs-private
64
+ */
65
+ async _createOverlay(activatorElement, component, config) {
48
66
  if (!this._overlay) {
49
67
  this._overlay = daffMenuCreateOverlay(this.overlay, activatorElement.element);
50
68
  if (typeof component === 'object' && component?.import) {
51
69
  component = await component.import();
52
70
  }
71
+ const injector = Injector.create({
72
+ providers: [{ provide: DAFF_MENU_CONFIG, useValue: config }],
73
+ parent: this.injector,
74
+ });
53
75
  if (component instanceof Type) {
54
- this._overlay.attach(new ComponentPortal(component, null, this.injector));
76
+ this._overlay.attach(new ComponentPortal(component, null, injector));
55
77
  }
56
78
  else if (component instanceof TemplateRef) {
57
- this._overlay.attach(new TemplatePortal(component, activatorElement, null, this.injector));
79
+ this._overlay.attach(new TemplatePortal(component, activatorElement, null, injector));
58
80
  }
59
- this._overlay.backdropClick().pipe(map(() => this._destroyOverlay())).subscribe();
81
+ this._overlay.backdropClick().pipe(map(() => this.close())).subscribe();
60
82
  }
61
83
  }
84
+ /**
85
+ * @docs-private
86
+ */
62
87
  _destroyOverlay() {
63
88
  if (this._overlay) {
64
89
  this._overlay.detach();
@@ -71,33 +96,79 @@ class DaffMenuService {
71
96
  this.$_open.next(false);
72
97
  this._activator.element.nativeElement.focus();
73
98
  }
74
- open(activator, component) {
75
- this._createOverlay(activator, component);
99
+ open(activator, component, config) {
100
+ if (this._overlay) {
101
+ this._destroyOverlay();
102
+ }
103
+ this._createOverlay(activator, component, config);
76
104
  this._activator = activator;
77
105
  this.$_open.next(true);
78
106
  }
79
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffMenuService, deps: [{ token: i1.Overlay }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
80
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffMenuService }); }
107
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMenuService, deps: [{ token: i1.Overlay }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
108
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMenuService }); }
81
109
  }
82
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffMenuService, decorators: [{
110
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMenuService, decorators: [{
83
111
  type: Injectable
84
112
  }], ctorParameters: () => [{ type: i1.Overlay }, { type: i0.Injector }] });
85
113
 
114
+ let daffMenuUniqueId = 0;
115
+ /**
116
+ * Generates a unique menu ID for each menu instance.
117
+ */
118
+ const daffNextMenuId = () => `daff-menu-${daffMenuUniqueId++}`;
119
+
120
+ /**
121
+ * Directive that triggers the menu to open/close. Applied to the button that activates the menu. The selector doubles as an input for the menu content to display.
122
+ *
123
+ * @example
124
+ * ```html
125
+ * <button [daffMenuActivator]="menu">
126
+ * Open Menu
127
+ * </button>
128
+ * ```
129
+ */
86
130
  class DaffMenuActivatorDirective {
131
+ /**
132
+ * @docs-private
133
+ */
134
+ get ariaExpanded() {
135
+ return this._open ? 'true' : 'false';
136
+ }
87
137
  constructor(service, viewContainerRef, cdRef) {
88
138
  this.service = service;
89
139
  this.viewContainerRef = viewContainerRef;
90
140
  this.cdRef = cdRef;
91
141
  this._destroyed$ = new Subject();
142
+ this._defaultMenuId = daffNextMenuId();
143
+ this.isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
144
+ /**
145
+ * An optional ID for the activator.
146
+ * When set, the menu's ID is derived as `${id}-menu`.
147
+ */
148
+ this.id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
149
+ /**
150
+ * The resolved menu ID.
151
+ */
152
+ this.menuId = computed(() => {
153
+ const id = this.id();
154
+ return id ? `${id}-menu` : this._defaultMenuId;
155
+ }, ...(ngDevMode ? [{ debugName: "menuId" }] : []));
92
156
  this.service.open$.pipe(takeUntil(this._destroyed$)).subscribe((val) => {
93
157
  this._open = val;
158
+ this.isOpen.set(this._open);
94
159
  this.cdRef.markForCheck();
95
160
  });
96
161
  }
162
+ /**
163
+ * @docs-private
164
+ */
97
165
  ngOnDestroy() {
98
166
  this._destroyed$.next(true);
99
167
  this._destroyed$.complete();
100
168
  }
169
+ /**
170
+ * @docs-private
171
+ */
101
172
  focus() {
102
173
  this.viewContainerRef.element.nativeElement.focus();
103
174
  }
@@ -106,111 +177,192 @@ class DaffMenuActivatorDirective {
106
177
  */
107
178
  onClick(event) {
108
179
  event.preventDefault();
109
- this.service.open(this.viewContainerRef, this.daffMenuActivator);
180
+ this.service.open(this.viewContainerRef, this.daffMenuActivator, { menuId: this.menuId() });
110
181
  }
111
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffMenuActivatorDirective, deps: [{ token: DaffMenuService }, { token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
112
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffMenuActivatorDirective, isStandalone: true, selector: "[daffMenuActivator]", inputs: { daffMenuActivator: "daffMenuActivator" }, host: { listeners: { "click": "onClick($event)" } }, ngImport: i0 }); }
182
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMenuActivatorDirective, deps: [{ token: DaffMenuService }, { token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
183
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.18", type: DaffMenuActivatorDirective, isStandalone: true, selector: "[daffMenuActivator]", inputs: { daffMenuActivator: { classPropertyName: "daffMenuActivator", publicName: "daffMenuActivator", isSignal: false, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-haspopup": "menu" }, listeners: { "click": "onClick($event)" }, properties: { "attr.aria-expanded": "ariaExpanded", "attr.aria-controls": "_open ? menuId() : null" } }, exportAs: ["daffMenuActivator"], ngImport: i0 }); }
113
184
  }
114
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffMenuActivatorDirective, decorators: [{
185
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMenuActivatorDirective, decorators: [{
115
186
  type: Directive,
116
187
  args: [{
117
188
  selector: '[daffMenuActivator]',
118
189
  host: {
119
190
  '(click)': 'onClick($event)',
191
+ 'aria-haspopup': 'menu',
192
+ '[attr.aria-expanded]': 'ariaExpanded',
193
+ '[attr.aria-controls]': '_open ? menuId() : null',
120
194
  },
195
+ exportAs: 'daffMenuActivator',
121
196
  }]
122
197
  }], ctorParameters: () => [{ type: DaffMenuService }, { type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }], propDecorators: { daffMenuActivator: [{
123
198
  type: Input
124
- }] } });
199
+ }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
125
200
 
126
- /* eslint-disable quote-props */
201
+ /**
202
+ * Injection token/provider pair used to identify menu items.
203
+ *
204
+ * `DaffMenuComponent` uses `@ContentChildren(DAFF_MENU_ITEM_TOKEN)` to discover
205
+ * its menu items. Use `provideDaffMenuItemToken` in component providers to register
206
+ * custom directives and components as menu items alongside native `daff-menu-item` elements.
207
+ */
208
+ const { token: DAFF_MENU_ITEM_TOKEN, provider: provideDaffMenuItemToken, } = createSingletonInjectionToken('DAFF_MENU_ITEM_TOKEN');
209
+
210
+ /**
211
+ * Individual clickable items within the menu. Applied to `<button>` or `<a>` elements.
212
+ *
213
+ * @example
214
+ * ```
215
+ * <a daff-menu-item href="/">Settings</a>
216
+ * <button daff-menu-item href="/">Settings</button>
217
+ * ```
218
+ */
127
219
  class DaffMenuItemComponent {
128
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffMenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
129
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.1", type: DaffMenuItemComponent, isStandalone: true, selector: "a[daff-menu-item],button[daff-menu-item]", host: { attributes: { "role": "menuitem" }, classAttribute: "daff-menu-item" }, queries: [{ propertyName: "_prefix", first: true, predicate: DaffPrefixDirective, descendants: true }], ngImport: i0, template: "@if (_prefix) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<div class=\"daff-menu-item__content\">\n <ng-content></ng-content>\n</div>", styles: [":host{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;gap:8px;border:none;border-radius:4px;margin:0;padding:12px 16px;text-decoration:none;width:100%}.daff-menu-item__content{font-size:1rem;line-height:1.25rem;text-align:left}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
220
+ constructor(_elementRef, _menuService) {
221
+ this._elementRef = _elementRef;
222
+ this._menuService = _menuService;
223
+ }
224
+ /**
225
+ * @docs-private
226
+ */
227
+ onClick() {
228
+ this._menuService.close();
229
+ }
230
+ /**
231
+ * Focus the menu item.
232
+ */
233
+ focus() {
234
+ this._elementRef.nativeElement.focus();
235
+ }
236
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMenuItemComponent, deps: [{ token: i0.ElementRef }, { token: DaffMenuService }], target: i0.ɵɵFactoryTarget.Component }); }
237
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: DaffMenuItemComponent, isStandalone: true, selector: "a[daff-menu-item],button[daff-menu-item]", host: { attributes: { "role": "menuitem" }, listeners: { "click": "onClick()" }, classAttribute: "daff-menu-item" }, providers: [provideDaffMenuItemToken(DaffMenuItemComponent)], queries: [{ propertyName: "_prefix", first: true, predicate: DaffPrefixDirective, descendants: true }], ngImport: i0, template: "@if (_prefix) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<ng-content></ng-content>", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
130
238
  }
131
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffMenuItemComponent, decorators: [{
239
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMenuItemComponent, decorators: [{
132
240
  type: Component,
133
241
  args: [{ selector: 'a[daff-menu-item]' + ',' +
134
242
  'button[daff-menu-item]', host: {
135
243
  'class': 'daff-menu-item',
136
244
  'role': 'menuitem',
137
- }, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (_prefix) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<div class=\"daff-menu-item__content\">\n <ng-content></ng-content>\n</div>", styles: [":host{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;gap:8px;border:none;border-radius:4px;margin:0;padding:12px 16px;text-decoration:none;width:100%}.daff-menu-item__content{font-size:1rem;line-height:1.25rem;text-align:left}\n"] }]
138
- }], propDecorators: { _prefix: [{
245
+ '(click)': 'onClick()',
246
+ }, changeDetection: ChangeDetectionStrategy.OnPush, providers: [provideDaffMenuItemToken(DaffMenuItemComponent)], template: "@if (_prefix) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<ng-content></ng-content>" }]
247
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: DaffMenuService }], propDecorators: { _prefix: [{
139
248
  type: ContentChild,
140
249
  args: [DaffPrefixDirective]
141
250
  }] } });
142
251
 
143
252
  /* eslint-disable quote-props */
253
+ /**
254
+ * The floating panel that contains menu items.
255
+ *
256
+ * @example
257
+ * ```html
258
+ * <daff-menu>
259
+ * <button daff-menu-item>
260
+ * <fa-icon [icon]="faEdit" daffPrefix></fa-icon>
261
+ * Edit
262
+ * </button>
263
+ * <button daff-menu-item>
264
+ * <fa-icon [icon]="faTrash" daffPrefix></fa-icon>
265
+ * Delete
266
+ * </button>
267
+ * <a href="/settings" daff-menu-item>
268
+ * <fa-icon [icon]="faCog" daffPrefix></fa-icon>
269
+ * Settings
270
+ * </a>
271
+ * </daff-menu>
272
+ * ```
273
+ */
144
274
  class DaffMenuComponent {
145
- constructor(_focusTrapFactory, _ngZone, _elementRef, menuService) {
275
+ constructor(_focusTrapFactory, _elementRef, menuService,
276
+ /**
277
+ * @docs-private
278
+ */
279
+ config) {
146
280
  this._focusTrapFactory = _focusTrapFactory;
147
- this._ngZone = _ngZone;
148
281
  this._elementRef = _elementRef;
149
282
  this.menuService = menuService;
150
- /**
151
- * Listen to `keydown` events outside the zone so that change detection is not run every
152
- * time a key is pressed. Instead we re-enter the zone only if the `ESC` key is pressed.
153
- *
154
- */
155
- this._ngZone.runOutsideAngular(() => {
156
- fromEvent(this._elementRef.nativeElement, 'keyup')
157
- .pipe(filter((event) => event.key === 'Escape'))
158
- .subscribe((event) => this._ngZone.run(() => {
283
+ this.config = config;
284
+ }
285
+ /**
286
+ * @docs-private
287
+ *
288
+ * Handle keyboard navigation
289
+ */
290
+ handleKeydown(event) {
291
+ switch (event.key) {
292
+ case 'Escape':
293
+ event.preventDefault();
159
294
  this.menuService.close();
160
- event.stopPropagation();
161
- }));
162
- });
295
+ break;
296
+ case 'ArrowDown':
297
+ case 'ArrowUp':
298
+ case 'Home':
299
+ case 'End':
300
+ event.preventDefault();
301
+ this._keyManager.onKeydown(event);
302
+ break;
303
+ }
163
304
  }
164
305
  /**
165
306
  * @docs-private
166
307
  */
167
308
  ngAfterContentInit() {
168
309
  this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);
310
+ this._keyManager = new FocusKeyManager(this._items)
311
+ .withWrap()
312
+ .withHomeAndEnd();
169
313
  }
170
314
  /**
171
315
  * @docs-private
172
316
  */
173
317
  ngAfterViewInit() {
174
- const focusableChild = this._elementRef.nativeElement.querySelector(daffFocusableElementsSelector);
175
- if (focusableChild) {
176
- focusableChild.focus();
177
- }
178
- else {
179
- // There's a timing condition when computing HostBindings afterContentInit
180
- // so to allow the menu to be focused, we manually set the tabindex.
181
- this._elementRef.nativeElement.tabIndex = 0;
182
- this._elementRef.nativeElement.focus();
318
+ // Set focus to the first menu item when menu opens
319
+ if (this._items.length > 0) {
320
+ this._keyManager.setFirstItemActive();
321
+ this._keyManager.setActiveItem(0);
183
322
  }
184
323
  }
185
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffMenuComponent, deps: [{ token: i1$1.ConfigurableFocusTrapFactory }, { token: i0.NgZone }, { token: i0.ElementRef }, { token: DaffMenuService }], target: i0.ɵɵFactoryTarget.Component }); }
186
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.1", type: DaffMenuComponent, isStandalone: true, selector: "daff-menu", host: { attributes: { "tabindex": "0", "role": "menu" }, classAttribute: "daff-menu" }, ngImport: i0, template: "<ng-content select=\"[daff-menu-item]\"></ng-content>", styles: [":host{display:block;min-width:112px;max-width:320px;border-radius:4px;padding:8px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
324
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMenuComponent, deps: [{ token: i1$1.ConfigurableFocusTrapFactory }, { token: i0.ElementRef }, { token: DaffMenuService }, { token: DAFF_MENU_CONFIG }], target: i0.ɵɵFactoryTarget.Component }); }
325
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: DaffMenuComponent, isStandalone: true, selector: "daff-menu", host: { attributes: { "tabindex": "0", "role": "menu" }, listeners: { "keydown": "handleKeydown($event)" }, properties: { "id": "config.menuId" }, classAttribute: "daff-menu" }, queries: [{ propertyName: "_items", predicate: DAFF_MENU_ITEM_TOKEN }], ngImport: i0, template: "<ng-content></ng-content>", styles: [".daff-menu{display:block;min-width:7rem;max-width:20rem;border-radius:.25rem;padding:.5rem}.daff-menu-item{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;gap:.5rem;font-size:1rem;line-height:1.25rem;border:none;border-radius:.25rem;margin:0;padding:.75rem 1rem;text-decoration:none;width:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
187
326
  }
188
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffMenuComponent, decorators: [{
327
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMenuComponent, decorators: [{
189
328
  type: Component,
190
- args: [{ selector: 'daff-menu', changeDetection: ChangeDetectionStrategy.OnPush, host: {
191
- 'class': 'daff-menu',
329
+ args: [{ selector: 'daff-menu', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
330
+ class: 'daff-menu',
192
331
  'tabindex': '0',
193
332
  'role': 'menu',
333
+ '[id]': 'config.menuId',
334
+ '(keydown)': 'handleKeydown($event)',
194
335
  }, imports: [
195
336
  DaffMenuItemComponent,
196
- ], template: "<ng-content select=\"[daff-menu-item]\"></ng-content>", styles: [":host{display:block;min-width:112px;max-width:320px;border-radius:4px;padding:8px}\n"] }]
197
- }], ctorParameters: () => [{ type: i1$1.ConfigurableFocusTrapFactory }, { type: i0.NgZone }, { type: i0.ElementRef }, { type: DaffMenuService }] });
337
+ ], template: "<ng-content></ng-content>", styles: [".daff-menu{display:block;min-width:7rem;max-width:20rem;border-radius:.25rem;padding:.5rem}.daff-menu-item{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;gap:.5rem;font-size:1rem;line-height:1.25rem;border:none;border-radius:.25rem;margin:0;padding:.75rem 1rem;text-decoration:none;width:100%}\n"] }]
338
+ }], ctorParameters: () => [{ type: i1$1.ConfigurableFocusTrapFactory }, { type: i0.ElementRef }, { type: DaffMenuService }, { type: undefined, decorators: [{
339
+ type: Inject,
340
+ args: [DAFF_MENU_CONFIG]
341
+ }] }], propDecorators: { _items: [{
342
+ type: ContentChildren,
343
+ args: [DAFF_MENU_ITEM_TOKEN]
344
+ }] } });
198
345
 
346
+ /**
347
+ * @deprecated in favor of {@link DAFF_MENU_COMPONENTS} Deprecated in version 0.92.0. Will be removed in version 0.95.0.
348
+ */
199
349
  class DaffMenuModule {
200
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
201
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: DaffMenuModule, imports: [CommonModule,
350
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
351
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.18", ngImport: i0, type: DaffMenuModule, imports: [CommonModule,
202
352
  OverlayModule,
203
353
  DaffMenuActivatorDirective,
204
354
  DaffMenuComponent,
205
- DaffMenuItemComponent], exports: [DaffMenuActivatorDirective,
355
+ DaffMenuItemComponent,
356
+ DaffPrefixDirective], exports: [DaffMenuActivatorDirective,
206
357
  DaffMenuComponent,
207
- DaffMenuItemComponent] }); }
208
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffMenuModule, providers: [
358
+ DaffMenuItemComponent,
359
+ DaffPrefixDirective] }); }
360
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMenuModule, providers: [
209
361
  DaffMenuService,
210
362
  ], imports: [CommonModule,
211
363
  OverlayModule] }); }
212
364
  }
213
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffMenuModule, decorators: [{
365
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffMenuModule, decorators: [{
214
366
  type: NgModule,
215
367
  args: [{
216
368
  imports: [
@@ -219,11 +371,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
219
371
  DaffMenuActivatorDirective,
220
372
  DaffMenuComponent,
221
373
  DaffMenuItemComponent,
374
+ DaffPrefixDirective,
222
375
  ],
223
376
  exports: [
224
377
  DaffMenuActivatorDirective,
225
378
  DaffMenuComponent,
226
379
  DaffMenuItemComponent,
380
+ DaffPrefixDirective,
227
381
  ],
228
382
  providers: [
229
383
  DaffMenuService,
@@ -231,9 +385,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
231
385
  }]
232
386
  }] });
233
387
 
388
+ /**
389
+ * @docs-private
390
+ */
391
+ const DAFF_MENU_COMPONENTS = [
392
+ DaffMenuComponent,
393
+ DaffMenuActivatorDirective,
394
+ DaffMenuItemComponent,
395
+ ];
396
+
234
397
  /**
235
398
  * Generated bundle index. Do not edit.
236
399
  */
237
400
 
238
- export { DaffMenuActivatorDirective, DaffMenuComponent, DaffMenuItemComponent, DaffMenuModule, DaffMenuService };
401
+ export { DAFF_MENU_COMPONENTS, DAFF_MENU_ITEM_TOKEN, DaffMenuActivatorDirective, DaffMenuComponent, DaffMenuItemComponent, DaffMenuModule, DaffMenuService, provideDaffMenuItemToken };
239
402
  //# sourceMappingURL=daffodil-design-menu.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-design-menu.mjs","sources":["../../../libs/design/menu/src/helpers/create-overlay.ts","../../../libs/design/menu/src/services/menu.service.ts","../../../libs/design/menu/src/menu-activator/menu-activator.component.ts","../../../libs/design/menu/src/menu-item/menu-item.component.ts","../../../libs/design/menu/src/menu-item/menu-item.component.html","../../../libs/design/menu/src/menu/menu.component.ts","../../../libs/design/menu/src/menu/menu.component.html","../../../libs/design/menu/src/menu.module.ts","../../../libs/design/menu/src/daffodil-design-menu.ts"],"sourcesContent":["import {\n Overlay,\n OverlayConfig,\n} from '@angular/cdk/overlay';\nimport { ElementRef } from '@angular/core';\n\nexport function daffMenuCreateOverlay(overlay: Overlay, element: ElementRef, config: OverlayConfig = {}) {\n return overlay.create({\n hasBackdrop: true,\n backdropClass: 'cdk-overlay-transparent-backdrop',\n scrollStrategy: overlay.scrollStrategies.block(),\n disposeOnNavigation: true,\n positionStrategy: overlay\n .position()\n .flexibleConnectedTo(element)\n .withPositions([\n {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'top',\n offsetY: 0,\n },\n {\n originX: 'start',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'bottom',\n },\n ]),\n ...config,\n });\n};\n","import {\n Overlay,\n OverlayRef,\n} from '@angular/cdk/overlay';\nimport {\n ComponentPortal,\n TemplatePortal,\n} from '@angular/cdk/portal';\nimport {\n ElementRef,\n Injectable,\n Injector,\n TemplateRef,\n Type,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n BehaviorSubject,\n map,\n Observable,\n} from 'rxjs';\n\nimport { DaffLazyComponent } from '@daffodil/design';\n\nimport { daffMenuCreateOverlay } from '../helpers/create-overlay';\n\nexport interface DaffActivatedMenu {\n el: ElementRef;\n component: Type<unknown>;\n}\n\nexport type DaffMenuSlot = TemplateRef<unknown> | DaffLazyComponent | Type<unknown>;\n\n@Injectable()\nexport class DaffMenuService {\n protected _overlay: OverlayRef | null;\n private _activator: ViewContainerRef;\n\n private $_open: BehaviorSubject<boolean> = new BehaviorSubject(false);\n public open$: Observable<boolean> = this.$_open.asObservable();\n\n constructor(\n protected overlay: Overlay,\n private injector: Injector,\n ) {}\n\n protected async _createOverlay(activatorElement: ViewContainerRef, component: DaffMenuSlot) {\n if (!this._overlay) {\n this._overlay = daffMenuCreateOverlay(this.overlay, activatorElement.element);\n if(typeof component === 'object' && (<DaffLazyComponent>component)?.import) {\n component = await (<DaffLazyComponent>component).import();\n }\n\n if(component instanceof Type) {\n this._overlay.attach(new ComponentPortal(<Type<unknown>>component, null, this.injector));\n } else if (component instanceof TemplateRef) {\n this._overlay.attach(new TemplatePortal(component, activatorElement, null, this.injector));\n }\n\n this._overlay.backdropClick().pipe(\n map(() => this._destroyOverlay()),\n ).subscribe();\n }\n }\n\n protected _destroyOverlay() {\n if (this._overlay) {\n this._overlay.detach();\n this._overlay.dispose();\n this._overlay = null;\n }\n }\n\n close() {\n this._destroyOverlay();\n this.$_open.next(false);\n this._activator.element.nativeElement.focus();\n }\n\n open(activator: ViewContainerRef, component: DaffMenuSlot) {\n this._createOverlay(activator, component);\n this._activator = activator;\n this.$_open.next(true);\n }\n}\n","import {\n ChangeDetectorRef,\n Directive,\n Input,\n OnDestroy,\n TemplateRef,\n Type,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n Subject,\n takeUntil,\n} from 'rxjs';\n\nimport { DaffMenuService } from '../services/menu.service';\n\n@Directive({\n selector: '[daffMenuActivator]',\n host: {\n '(click)': 'onClick($event)',\n },\n})\nexport class DaffMenuActivatorDirective implements OnDestroy {\n\n private _destroyed$ = new Subject<boolean>();\n private _open: boolean;\n\n @Input() daffMenuActivator: Type<unknown> | TemplateRef<unknown>;\n\n constructor(\n private service: DaffMenuService,\n private viewContainerRef: ViewContainerRef,\n private cdRef: ChangeDetectorRef,\n ) {\n this.service.open$.pipe(\n takeUntil(this._destroyed$),\n ).subscribe((val: boolean) => {\n this._open = val;\n this.cdRef.markForCheck();\n });\n }\n\n ngOnDestroy(): void {\n this._destroyed$.next(true);\n this._destroyed$.complete();\n }\n\n focus() {\n this.viewContainerRef.element.nativeElement.focus();\n }\n\n /**\n * @docs-private\n */\n onClick(event: MouseEvent) {\n event.preventDefault();\n this.service.open(this.viewContainerRef, this.daffMenuActivator);\n }\n}\n","/* eslint-disable quote-props */\nimport {\n Component,\n ChangeDetectionStrategy,\n ContentChild,\n} from '@angular/core';\n\nimport { DaffPrefixDirective } from '@daffodil/design';\n\n@Component({\n selector:\n 'a[daff-menu-item]' + ',' +\n 'button[daff-menu-item]',\n templateUrl: './menu-item.component.html',\n styleUrls: ['./menu-item.component.scss'],\n host: {\n 'class': 'daff-menu-item',\n 'role': 'menuitem',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n\nexport class DaffMenuItemComponent {\n /**\n * @docs-private\n */\n @ContentChild(DaffPrefixDirective) _prefix: DaffPrefixDirective;\n}\n","@if (_prefix) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<div class=\"daff-menu-item__content\">\n <ng-content></ng-content>\n</div>","/* eslint-disable quote-props */\nimport {\n ConfigurableFocusTrapFactory,\n ConfigurableFocusTrap,\n} from '@angular/cdk/a11y';\nimport {\n AfterContentInit,\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n NgZone,\n} from '@angular/core';\nimport {\n filter,\n fromEvent,\n} from 'rxjs';\n\nimport { daffFocusableElementsSelector } from '@daffodil/design';\n\nimport { DaffMenuItemComponent } from '../menu-item/menu-item.component';\nimport { DaffMenuService } from '../services/menu.service';\n\n@Component({\n selector: 'daff-menu',\n templateUrl: './menu.component.html',\n styleUrl: './menu.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n 'class': 'daff-menu',\n 'tabindex': '0',\n 'role': 'menu',\n },\n imports: [\n DaffMenuItemComponent,\n ],\n})\nexport class DaffMenuComponent implements AfterContentInit, AfterViewInit {\n private _focusTrap: ConfigurableFocusTrap;\n\n constructor(\n private _focusTrapFactory: ConfigurableFocusTrapFactory,\n private _ngZone: NgZone,\n private _elementRef: ElementRef<HTMLElement>,\n private menuService: DaffMenuService,\n ) {\n /**\n * Listen to `keydown` events outside the zone so that change detection is not run every\n * time a key is pressed. Instead we re-enter the zone only if the `ESC` key is pressed.\n *\n */\n this._ngZone.runOutsideAngular(() => {\n fromEvent<KeyboardEvent>(this._elementRef.nativeElement, 'keyup')\n .pipe(\n filter((event) => event.key === 'Escape'),\n )\n .subscribe((event) =>\n this._ngZone.run(() => {\n this.menuService.close();\n event.stopPropagation();\n }),\n );\n });\n }\n\n /**\n * @docs-private\n */\n ngAfterContentInit() {\n this._focusTrap = this._focusTrapFactory.create(\n this._elementRef.nativeElement,\n );\n }\n\n /**\n * @docs-private\n */\n ngAfterViewInit() {\n const focusableChild = (<HTMLElement>this._elementRef.nativeElement.querySelector(\n daffFocusableElementsSelector)\n );\n\n if(focusableChild) {\n focusableChild.focus();\n } else {\n // There's a timing condition when computing HostBindings afterContentInit\n // so to allow the menu to be focused, we manually set the tabindex.\n this._elementRef.nativeElement.tabIndex = 0;\n (<HTMLElement>this._elementRef.nativeElement).focus();\n }\n }\n}\n","<ng-content select=\"[daff-menu-item]\"></ng-content>","import { OverlayModule } from '@angular/cdk/overlay';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { DaffMenuComponent } from './menu/menu.component';\nimport { DaffMenuActivatorDirective } from './menu-activator/menu-activator.component';\nimport { DaffMenuItemComponent } from './menu-item/menu-item.component';\nimport { DaffMenuService } from './services/menu.service';\n\n@NgModule({\n imports: [\n CommonModule,\n OverlayModule,\n DaffMenuActivatorDirective,\n DaffMenuComponent,\n DaffMenuItemComponent,\n ],\n exports: [\n DaffMenuActivatorDirective,\n DaffMenuComponent,\n DaffMenuItemComponent,\n ],\n providers: [\n DaffMenuService,\n ],\n})\n\nexport class DaffMenuModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.DaffMenuService","i1","i2.DaffMenuService"],"mappings":";;;;;;;;;;AAMM,SAAU,qBAAqB,CAAC,OAAgB,EAAE,OAAmB,EAAE,SAAwB,EAAE,EAAA;IACrG,OAAO,OAAO,CAAC,MAAM,CAAC;AACpB,QAAA,WAAW,EAAE,IAAI;AACjB,QAAA,aAAa,EAAE,kCAAkC;AACjD,QAAA,cAAc,EAAE,OAAO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AA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAd,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,YAhBvB,YAAY;YACZ,aAAa;YACb,0BAA0B;YAC1B,iBAAiB;AACjB,YAAA,qBAAqB,aAGrB,0BAA0B;YAC1B,iBAAiB;YACjB,qBAAqB,CAAA,EAAA,CAAA,CAAA;AAOZ,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,EAAA,SAAA,EALd;YACT,eAAe;AAChB,SAAA,EAAA,OAAA,EAAA,CAbC,YAAY;YACZ,aAAa,CAAA,EAAA,CAAA,CAAA;;2FAeJ,cAAc,EAAA,UAAA,EAAA,CAAA;kBAlB1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,aAAa;wBACb,0BAA0B;wBAC1B,iBAAiB;wBACjB,qBAAqB;AACtB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,0BAA0B;wBAC1B,iBAAiB;wBACjB,qBAAqB;AACtB,qBAAA;AACD,oBAAA,SAAS,EAAE;wBACT,eAAe;AAChB,qBAAA;AACF,iBAAA;;;ACzBD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-design-menu.mjs","sources":["../../../libs/design/menu/src/config/menu-config.ts","../../../libs/design/menu/src/helpers/create-overlay.ts","../../../libs/design/menu/src/services/menu.service.ts","../../../libs/design/menu/src/config/menu-id.ts","../../../libs/design/menu/src/menu-activator/menu-activator.component.ts","../../../libs/design/menu/src/menu-item/menu-item.token.ts","../../../libs/design/menu/src/menu-item/menu-item.component.ts","../../../libs/design/menu/src/menu-item/menu-item.component.html","../../../libs/design/menu/src/menu/menu.component.ts","../../../libs/design/menu/src/menu/menu.component.html","../../../libs/design/menu/src/menu.module.ts","../../../libs/design/menu/src/menu.ts","../../../libs/design/menu/src/daffodil-design-menu.ts"],"sourcesContent":["import { createConfigInjectionToken } from '@daffodil/core';\n\n/**\n * Configuration for a menu instance.\n */\nexport interface DaffMenuConfig {\n /**\n * A unique identifier for the menu instance.\n */\n menuId?: string;\n}\n\nconst daffMenuConfigDefault: DaffMenuConfig = {\n menuId: '',\n};\n\nexport const {\n /**\n * An injection token for the menu configuration.\n */\n token: DAFF_MENU_CONFIG,\n /**\n * Provider function for {@link DAFF_MENU_CONFIG}.\n */\n provider: provideDaffMenuConfig,\n} = createConfigInjectionToken<DaffMenuConfig>(daffMenuConfigDefault, 'DAFF_MENU_CONFIG');\n","import {\n Overlay,\n OverlayConfig,\n} from '@angular/cdk/overlay';\nimport { ElementRef } from '@angular/core';\n\nexport function daffMenuCreateOverlay(overlay: Overlay, element: ElementRef, config: OverlayConfig = {}) {\n return overlay.create({\n hasBackdrop: true,\n backdropClass: 'cdk-overlay-transparent-backdrop',\n scrollStrategy: overlay.scrollStrategies.block(),\n disposeOnNavigation: true,\n positionStrategy: overlay\n .position()\n .flexibleConnectedTo(element)\n .withPositions([\n {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'top',\n offsetY: 0,\n },\n {\n originX: 'start',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'bottom',\n },\n ]),\n ...config,\n });\n};\n","import {\n Overlay,\n OverlayRef,\n} from '@angular/cdk/overlay';\nimport {\n ComponentPortal,\n TemplatePortal,\n} from '@angular/cdk/portal';\nimport {\n Injectable,\n Injector,\n TemplateRef,\n Type,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n BehaviorSubject,\n map,\n Observable,\n} from 'rxjs';\n\nimport { DaffLazyComponent } from '@daffodil/design';\n\nimport {\n DAFF_MENU_CONFIG,\n DaffMenuConfig,\n} from '../config/menu-config';\nimport { daffMenuCreateOverlay } from '../helpers/create-overlay';\n\nexport type DaffMenuSlot = TemplateRef<unknown> | DaffLazyComponent | Type<unknown>;\n\n@Injectable()\nexport class DaffMenuService {\n protected _overlay: OverlayRef | null;\n private _activator: ViewContainerRef;\n\n private $_open: BehaviorSubject<boolean> = new BehaviorSubject(false);\n public open$: Observable<boolean> = this.$_open.asObservable();\n\n constructor(\n protected overlay: Overlay,\n private injector: Injector,\n ) {}\n\n /**\n * @docs-private\n */\n protected async _createOverlay(activatorElement: ViewContainerRef, component: DaffMenuSlot, config?: DaffMenuConfig) {\n if (!this._overlay) {\n this._overlay = daffMenuCreateOverlay(this.overlay, activatorElement.element);\n if(typeof component === 'object' && (<DaffLazyComponent>component)?.import) {\n component = await (<DaffLazyComponent>component).import();\n }\n\n const injector = Injector.create({\n providers: [{ provide: DAFF_MENU_CONFIG, useValue: config }],\n parent: this.injector,\n });\n\n if(component instanceof Type) {\n this._overlay.attach(new ComponentPortal(<Type<unknown>>component, null, injector));\n } else if (component instanceof TemplateRef) {\n this._overlay.attach(new TemplatePortal(component, activatorElement, null, injector));\n }\n\n this._overlay.backdropClick().pipe(\n map(() => this.close()),\n ).subscribe();\n }\n }\n\n /**\n * @docs-private\n */\n protected _destroyOverlay() {\n if (this._overlay) {\n this._overlay.detach();\n this._overlay.dispose();\n this._overlay = null;\n }\n }\n\n close() {\n this._destroyOverlay();\n this.$_open.next(false);\n this._activator.element.nativeElement.focus();\n }\n\n open(activator: ViewContainerRef, component: DaffMenuSlot, config?: DaffMenuConfig) {\n if (this._overlay) {\n this._destroyOverlay();\n }\n this._createOverlay(activator, component, config);\n this._activator = activator;\n this.$_open.next(true);\n }\n}\n","let daffMenuUniqueId = 0;\n\n/**\n * Generates a unique menu ID for each menu instance.\n */\nexport const daffNextMenuId = (): string =>\n `daff-menu-${daffMenuUniqueId++}`;\n","import {\n ChangeDetectorRef,\n computed,\n Directive,\n input,\n Input,\n OnDestroy,\n signal,\n TemplateRef,\n Type,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n Subject,\n takeUntil,\n} from 'rxjs';\n\nimport { daffNextMenuId } from '../config/menu-id';\nimport { DaffMenuService } from '../services/menu.service';\n\n/**\n * Directive that triggers the menu to open/close. Applied to the button that activates the menu. The selector doubles as an input for the menu content to display.\n *\n * @example\n * ```html\n * <button [daffMenuActivator]=\"menu\">\n * Open Menu\n * </button>\n * ```\n */\n@Directive({\n selector: '[daffMenuActivator]',\n host: {\n '(click)': 'onClick($event)',\n 'aria-haspopup': 'menu',\n '[attr.aria-expanded]': 'ariaExpanded',\n '[attr.aria-controls]': '_open ? menuId() : null',\n },\n exportAs: 'daffMenuActivator',\n})\nexport class DaffMenuActivatorDirective implements OnDestroy {\n\n private _destroyed$ = new Subject<boolean>();\n private _open: boolean;\n private _defaultMenuId = daffNextMenuId();\n readonly isOpen = signal(false);\n\n /**\n * The menu content to display when activated.\n */\n @Input() daffMenuActivator: Type<unknown> | TemplateRef<unknown>;\n\n /**\n * An optional ID for the activator.\n * When set, the menu's ID is derived as `${id}-menu`.\n */\n id = input<string>();\n\n /**\n * The resolved menu ID.\n */\n private menuId = computed(() => {\n const id = this.id();\n return id ? `${id}-menu` : this._defaultMenuId;\n });\n\n /**\n * @docs-private\n */\n get ariaExpanded() {\n return this._open ? 'true' : 'false';\n }\n\n constructor(\n private service: DaffMenuService,\n private viewContainerRef: ViewContainerRef,\n private cdRef: ChangeDetectorRef,\n ) {\n this.service.open$.pipe(\n takeUntil(this._destroyed$),\n ).subscribe((val: boolean) => {\n this._open = val;\n this.isOpen.set(this._open);\n this.cdRef.markForCheck();\n });\n }\n\n /**\n * @docs-private\n */\n ngOnDestroy(): void {\n this._destroyed$.next(true);\n this._destroyed$.complete();\n }\n\n /**\n * @docs-private\n */\n focus() {\n this.viewContainerRef.element.nativeElement.focus();\n }\n\n /**\n * @docs-private\n */\n onClick(event: MouseEvent) {\n event.preventDefault();\n this.service.open(this.viewContainerRef, this.daffMenuActivator, { menuId: this.menuId() });\n }\n}\n","import { FocusableOption } from '@angular/cdk/a11y';\n\nimport { createSingletonInjectionToken } from '@daffodil/core';\n\n/**\n * Injection token/provider pair used to identify menu items.\n *\n * `DaffMenuComponent` uses `@ContentChildren(DAFF_MENU_ITEM_TOKEN)` to discover\n * its menu items. Use `provideDaffMenuItemToken` in component providers to register\n * custom directives and components as menu items alongside native `daff-menu-item` elements.\n */\nexport const {\n token: DAFF_MENU_ITEM_TOKEN,\n provider: provideDaffMenuItemToken,\n} = createSingletonInjectionToken<FocusableOption>('DAFF_MENU_ITEM_TOKEN');\n","/* eslint-disable quote-props */\nimport { FocusableOption } from '@angular/cdk/a11y';\nimport {\n Component,\n ChangeDetectionStrategy,\n ContentChild,\n ElementRef,\n} from '@angular/core';\n\nimport { DaffPrefixDirective } from '@daffodil/design';\n\nimport { provideDaffMenuItemToken } from './menu-item.token';\nimport { DaffMenuService } from '../services/menu.service';\n\n/**\n * Individual clickable items within the menu. Applied to `<button>` or `<a>` elements.\n *\n * @example\n * ```\n * <a daff-menu-item href=\"/\">Settings</a>\n * <button daff-menu-item href=\"/\">Settings</button>\n * ```\n */\n@Component({\n selector:\n 'a[daff-menu-item]' + ',' +\n 'button[daff-menu-item]',\n templateUrl: './menu-item.component.html',\n host: {\n 'class': 'daff-menu-item',\n 'role': 'menuitem',\n '(click)': 'onClick()',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [provideDaffMenuItemToken(DaffMenuItemComponent)],\n})\n\nexport class DaffMenuItemComponent implements FocusableOption {\n /**\n * @docs-private\n */\n @ContentChild(DaffPrefixDirective) _prefix: DaffPrefixDirective;\n\n constructor(\n private _elementRef: ElementRef<HTMLElement>,\n private _menuService: DaffMenuService,\n ) {}\n\n /**\n * @docs-private\n */\n onClick() {\n this._menuService.close();\n }\n\n /**\n * Focus the menu item.\n */\n focus() {\n this._elementRef.nativeElement.focus();\n }\n}\n","@if (_prefix) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<ng-content></ng-content>","/* eslint-disable quote-props */\nimport {\n ConfigurableFocusTrapFactory,\n ConfigurableFocusTrap,\n FocusKeyManager,\n FocusableOption,\n} from '@angular/cdk/a11y';\nimport {\n AfterContentInit,\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Inject,\n QueryList,\n ContentChildren,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport {\n DAFF_MENU_CONFIG,\n DaffMenuConfig,\n} from '../config/menu-config';\nimport { DaffMenuItemComponent } from '../menu-item/menu-item.component';\nimport { DAFF_MENU_ITEM_TOKEN } from '../menu-item/menu-item.token';\nimport { DaffMenuService } from '../services/menu.service';\n\n/**\n * The floating panel that contains menu items.\n *\n * @example\n * ```html\n * <daff-menu>\n * <button daff-menu-item>\n * <fa-icon [icon]=\"faEdit\" daffPrefix></fa-icon>\n * Edit\n * </button>\n * <button daff-menu-item>\n * <fa-icon [icon]=\"faTrash\" daffPrefix></fa-icon>\n * Delete\n * </button>\n * <a href=\"/settings\" daff-menu-item>\n * <fa-icon [icon]=\"faCog\" daffPrefix></fa-icon>\n * Settings\n * </a>\n * </daff-menu>\n * ```\n */\n@Component({\n selector: 'daff-menu',\n templateUrl: './menu.component.html',\n styleUrl: './menu.component.scss',\n encapsulation: ViewEncapsulation.None, // Required to allow breadcrumb items to take on `.daff-menu-item` styles\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'daff-menu',\n 'tabindex': '0',\n 'role': 'menu',\n '[id]': 'config.menuId',\n '(keydown)': 'handleKeydown($event)',\n },\n imports: [\n DaffMenuItemComponent,\n ],\n})\nexport class DaffMenuComponent implements AfterContentInit, AfterViewInit {\n private _focusTrap: ConfigurableFocusTrap;\n private _keyManager: FocusKeyManager<unknown>; // Matches any component or directive that provides `DAFF_MENU_ITEM_TOKEN`, not just `DaffMenuItemComponent`.\n\n /**\n * @docs-private\n *\n * Content children that provide `DAFF_MENU_ITEM_TOKEN` are treated as menu items.\n * This includes both `daff-menu-item` components and any custom directives that also provide the token.\n */\n @ContentChildren(DAFF_MENU_ITEM_TOKEN) private _items: QueryList<FocusableOption>;\n\n constructor(\n private _focusTrapFactory: ConfigurableFocusTrapFactory,\n private _elementRef: ElementRef<HTMLElement>,\n private menuService: DaffMenuService,\n\n /**\n * @docs-private\n */\n @Inject(DAFF_MENU_CONFIG) public readonly config: DaffMenuConfig,\n ) {}\n\n /**\n * @docs-private\n *\n * Handle keyboard navigation\n */\n handleKeydown(event: KeyboardEvent): void {\n switch (event.key) {\n case 'Escape':\n event.preventDefault();\n this.menuService.close();\n break;\n case 'ArrowDown':\n case 'ArrowUp':\n case 'Home':\n case 'End':\n event.preventDefault();\n this._keyManager.onKeydown(event);\n break;\n }\n }\n\n /**\n * @docs-private\n */\n ngAfterContentInit() {\n this._focusTrap = this._focusTrapFactory.create(\n this._elementRef.nativeElement,\n );\n\n this._keyManager = new FocusKeyManager(this._items)\n .withWrap()\n .withHomeAndEnd();\n }\n\n /**\n * @docs-private\n */\n ngAfterViewInit() {\n // Set focus to the first menu item when menu opens\n if (this._items.length > 0) {\n this._keyManager.setFirstItemActive();\n this._keyManager.setActiveItem(0);\n }\n }\n}\n","<ng-content></ng-content>","import { OverlayModule } from '@angular/cdk/overlay';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { DaffPrefixDirective } from '@daffodil/design';\n\nimport { DaffMenuComponent } from './menu/menu.component';\nimport { DaffMenuActivatorDirective } from './menu-activator/menu-activator.component';\nimport { DaffMenuItemComponent } from './menu-item/menu-item.component';\nimport { DaffMenuService } from './services/menu.service';\n\n/**\n * @deprecated in favor of {@link DAFF_MENU_COMPONENTS} Deprecated in version 0.92.0. Will be removed in version 0.95.0.\n */\n@NgModule({\n imports: [\n CommonModule,\n OverlayModule,\n DaffMenuActivatorDirective,\n DaffMenuComponent,\n DaffMenuItemComponent,\n DaffPrefixDirective,\n ],\n exports: [\n DaffMenuActivatorDirective,\n DaffMenuComponent,\n DaffMenuItemComponent,\n DaffPrefixDirective,\n ],\n providers: [\n DaffMenuService,\n ],\n})\n\nexport class DaffMenuModule {}\n","import { DaffMenuComponent } from './menu/menu.component';\nimport { DaffMenuActivatorDirective } from './menu-activator/menu-activator.component';\nimport { DaffMenuItemComponent } from './menu-item/menu-item.component';\n\n/**\n * @docs-private\n */\nexport const DAFF_MENU_COMPONENTS = <const> [\n DaffMenuComponent,\n DaffMenuActivatorDirective,\n DaffMenuItemComponent,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.DaffMenuService"],"mappings":";;;;;;;;;;;;AAYA,MAAM,qBAAqB,GAAmB;AAC5C,IAAA,MAAM,EAAE,EAAE;CACX;AAEM,MAAM;AACX;;AAEG;AACH,KAAK,EAAE,gBAAgB;AACvB;;AAEG;AACH,QAAQ,EAAE,qBAAqB,GAChC,GAAG,0BAA0B,CAAiB,qBAAqB,EAAE,kBAAkB,CAAC;;ACnBnF,SAAU,qBAAqB,CAAC,OAAgB,EAAE,OAAmB,EAAE,SAAwB,EAAE,EAAA;IACrG,OAAO,OAAO,CAAC,MAAM,CAAC;AACpB,QAAA,WAAW,EAAE,IAAI;AACjB,QAAA,aAAa,EAAE,kCAAkC;AACjD,QAAA,cAAc,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,EAAE;AAChD,QAAA,mBAAmB,EAAE,IAAI;AACzB,QAAA,gBAAgB,EAAE;AACf,aAAA,QAAQ;aACR,mBAAmB,CAAC,OAAO;AAC3B,aAAA,aAAa,CAAC;AACb,YAAA;AACE,gBAAA,OAAO,EAAE,OAAO;AAChB,gBAAA,OAAO,EAAE,QAAQ;AACjB,gBAAA,QAAQ,EAAE,OAAO;AACjB,gBAAA,QAAQ,EAAE,KAAK;AACf,gBAAA,OAAO,EAAE,CAAC;AACX,aAAA;AACD,YAAA;AACE,gBAAA,OAAO,EAAE,OAAO;AAChB,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