@daffodil/design 0.94.1-rc.0 → 0.95.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 (170) hide show
  1. package/README.md +1 -2
  2. package/accordion/src/accordion-theme.scss +4 -4
  3. package/article/README.md +4 -27
  4. package/article/src/article-theme.scss +14 -14
  5. package/badge/src/badge-theme.scss +0 -6
  6. package/button/README.md +0 -4
  7. package/button/src/button/basic/button-theme.scss +17 -42
  8. package/button/src/button/button-base.scss +12 -3
  9. package/button/src/button/flat/flat-theme.scss +14 -12
  10. package/button/src/button/icon/icon-theme.scss +19 -40
  11. package/button/src/button/stroked/stroked-theme.scss +22 -36
  12. package/card/src/card/stroked/stroked-theme.scss +1 -1
  13. package/card/src/card-base.scss +0 -1
  14. package/fesm2022/daffodil-design-accordion.mjs +285 -188
  15. package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
  16. package/fesm2022/daffodil-design-article.mjs +578 -340
  17. package/fesm2022/daffodil-design-article.mjs.map +1 -1
  18. package/fesm2022/daffodil-design-badge.mjs +166 -84
  19. package/fesm2022/daffodil-design-badge.mjs.map +1 -1
  20. package/fesm2022/daffodil-design-beacon.mjs +109 -47
  21. package/fesm2022/daffodil-design-beacon.mjs.map +1 -1
  22. package/fesm2022/daffodil-design-breadcrumb.mjs +384 -277
  23. package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
  24. package/fesm2022/daffodil-design-button.mjs +541 -408
  25. package/fesm2022/daffodil-design-button.mjs.map +1 -1
  26. package/fesm2022/daffodil-design-callout.mjs +349 -224
  27. package/fesm2022/daffodil-design-callout.mjs.map +1 -1
  28. package/fesm2022/daffodil-design-card.mjs +496 -327
  29. package/fesm2022/daffodil-design-card.mjs.map +1 -1
  30. package/fesm2022/daffodil-design-checkbox.mjs +373 -313
  31. package/fesm2022/daffodil-design-checkbox.mjs.map +1 -1
  32. package/fesm2022/daffodil-design-container.mjs +103 -60
  33. package/fesm2022/daffodil-design-container.mjs.map +1 -1
  34. package/fesm2022/daffodil-design-form-field.mjs +441 -352
  35. package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
  36. package/fesm2022/daffodil-design-form.mjs +155 -57
  37. package/fesm2022/daffodil-design-form.mjs.map +1 -1
  38. package/fesm2022/daffodil-design-hero.mjs +349 -234
  39. package/fesm2022/daffodil-design-hero.mjs.map +1 -1
  40. package/fesm2022/daffodil-design-image-lite.mjs +60 -0
  41. package/fesm2022/daffodil-design-image-lite.mjs.map +1 -0
  42. package/fesm2022/daffodil-design-image.mjs +245 -107
  43. package/fesm2022/daffodil-design-image.mjs.map +1 -1
  44. package/fesm2022/daffodil-design-input.mjs +217 -164
  45. package/fesm2022/daffodil-design-input.mjs.map +1 -1
  46. package/fesm2022/daffodil-design-list.mjs +308 -170
  47. package/fesm2022/daffodil-design-list.mjs.map +1 -1
  48. package/fesm2022/daffodil-design-media-gallery.mjs +351 -278
  49. package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
  50. package/fesm2022/daffodil-design-menu.mjs +525 -417
  51. package/fesm2022/daffodil-design-menu.mjs.map +1 -1
  52. package/fesm2022/daffodil-design-modal.mjs +680 -450
  53. package/fesm2022/daffodil-design-modal.mjs.map +1 -1
  54. package/fesm2022/daffodil-design-native-select.mjs +175 -166
  55. package/fesm2022/daffodil-design-native-select.mjs.map +1 -1
  56. package/fesm2022/daffodil-design-navbar.mjs +145 -68
  57. package/fesm2022/daffodil-design-navbar.mjs.map +1 -1
  58. package/fesm2022/daffodil-design-notification.mjs +376 -226
  59. package/fesm2022/daffodil-design-notification.mjs.map +1 -1
  60. package/fesm2022/daffodil-design-paginator.mjs +296 -192
  61. package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
  62. package/fesm2022/daffodil-design-progress-bar.mjs +243 -157
  63. package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
  64. package/fesm2022/daffodil-design-radio.mjs +382 -300
  65. package/fesm2022/daffodil-design-radio.mjs.map +1 -1
  66. package/fesm2022/daffodil-design-select.mjs +424 -364
  67. package/fesm2022/daffodil-design-select.mjs.map +1 -1
  68. package/fesm2022/daffodil-design-sidebar.mjs +874 -887
  69. package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
  70. package/fesm2022/daffodil-design-spinner.mjs +156 -99
  71. package/fesm2022/daffodil-design-spinner.mjs.map +1 -1
  72. package/fesm2022/daffodil-design-switch.mjs +176 -106
  73. package/fesm2022/daffodil-design-switch.mjs.map +1 -1
  74. package/fesm2022/daffodil-design-tabs.mjs +685 -427
  75. package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
  76. package/fesm2022/daffodil-design-tag.mjs +251 -133
  77. package/fesm2022/daffodil-design-tag.mjs.map +1 -1
  78. package/fesm2022/daffodil-design-testing.mjs +4 -16
  79. package/fesm2022/daffodil-design-testing.mjs.map +1 -1
  80. package/fesm2022/daffodil-design-text-snippet.mjs +140 -54
  81. package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
  82. package/fesm2022/daffodil-design-textarea.mjs +170 -150
  83. package/fesm2022/daffodil-design-textarea.mjs.map +1 -1
  84. package/fesm2022/daffodil-design-toast.mjs +658 -481
  85. package/fesm2022/daffodil-design-toast.mjs.map +1 -1
  86. package/fesm2022/daffodil-design-tree.mjs +456 -469
  87. package/fesm2022/daffodil-design-tree.mjs.map +1 -1
  88. package/fesm2022/daffodil-design-youtube-player.mjs +168 -115
  89. package/fesm2022/daffodil-design-youtube-player.mjs.map +1 -1
  90. package/fesm2022/daffodil-design.mjs +1628 -1650
  91. package/fesm2022/daffodil-design.mjs.map +1 -1
  92. package/form-field/README.md +0 -4
  93. package/form-field/src/form-field-theme.scss +12 -4
  94. package/image/README.md +4 -0
  95. package/image-lite/README.md +58 -0
  96. package/image-lite/src/image-theme.scss +18 -0
  97. package/list/src/list-base.scss +3 -4
  98. package/list/src/list-theme.scss +6 -5
  99. package/media-gallery/README.md +1 -1
  100. package/media-gallery/src/media-gallery-theme.scss +3 -3
  101. package/menu/src/menu-theme.scss +6 -2
  102. package/notification/src/notification-theme.scss +10 -10
  103. package/package.json +1 -1
  104. package/scss/global.scss +17 -11
  105. package/scss/theme.scss +2 -18
  106. package/scss/theming/_get-palette.scss +0 -3
  107. package/scss/theming/_index.scss +0 -1
  108. package/scss/theming/_light-dark.scss +2 -2
  109. package/scss/theming/_theme-css-variables.scss +1 -1
  110. package/scss/theming/create-theme/_create-theme.scss +2 -2
  111. package/scss/theming/get-font-colors/_get-font-colors.scss +7 -25
  112. package/scss/theming/get-font-colors/_get-font-colors.spec.scss +0 -12
  113. package/scss/typography/_classes.scss +0 -6
  114. package/scss/typography/_index.scss +0 -1
  115. package/scss/typography/mixins/_sizes.scss +0 -1
  116. package/scss/typography/utilities/_variables.scss +3 -0
  117. package/select/src/select-theme.scss +10 -14
  118. package/switch/src/switch-theme.scss +2 -2
  119. package/tabs/src/tabs-theme.scss +4 -4
  120. package/types/daffodil-design-accordion.d.ts +92 -67
  121. package/types/daffodil-design-article.d.ts +49 -56
  122. package/types/daffodil-design-badge.d.ts +56 -33
  123. package/types/daffodil-design-beacon.d.ts +35 -14
  124. package/types/daffodil-design-breadcrumb.d.ts +89 -85
  125. package/types/daffodil-design-button.d.ts +128 -146
  126. package/types/daffodil-design-callout.d.ts +55 -39
  127. package/types/daffodil-design-card.d.ts +66 -56
  128. package/types/daffodil-design-checkbox.d.ts +211 -167
  129. package/types/daffodil-design-container.d.ts +17 -16
  130. package/types/daffodil-design-form-field.d.ts +273 -240
  131. package/types/daffodil-design-form.d.ts +21 -21
  132. package/types/daffodil-design-hero.d.ts +55 -39
  133. package/types/daffodil-design-image-lite.d.ts +17 -0
  134. package/types/daffodil-design-image.d.ts +89 -55
  135. package/types/daffodil-design-input.d.ts +86 -72
  136. package/types/daffodil-design-list.d.ts +49 -43
  137. package/types/daffodil-design-media-gallery.d.ts +176 -148
  138. package/types/daffodil-design-menu.d.ts +177 -169
  139. package/types/daffodil-design-modal.d.ts +205 -205
  140. package/types/daffodil-design-native-select.d.ts +94 -84
  141. package/types/daffodil-design-navbar.d.ts +34 -24
  142. package/types/daffodil-design-notification.d.ts +82 -67
  143. package/types/daffodil-design-paginator.d.ts +140 -118
  144. package/types/daffodil-design-progress-bar.d.ts +92 -74
  145. package/types/daffodil-design-radio.d.ts +183 -144
  146. package/types/daffodil-design-select.d.ts +207 -178
  147. package/types/daffodil-design-sidebar.d.ts +270 -253
  148. package/types/daffodil-design-spinner.d.ts +49 -36
  149. package/types/daffodil-design-switch.d.ts +77 -46
  150. package/types/daffodil-design-tabs.d.ts +248 -198
  151. package/types/daffodil-design-tag.d.ts +91 -56
  152. package/types/daffodil-design-testing.d.ts +1 -3
  153. package/types/daffodil-design-text-snippet.d.ts +48 -37
  154. package/types/daffodil-design-textarea.d.ts +88 -79
  155. package/types/daffodil-design-toast.d.ts +175 -183
  156. package/types/daffodil-design-tree.d.ts +186 -169
  157. package/types/daffodil-design-youtube-player.d.ts +56 -52
  158. package/types/daffodil-design.d.ts +614 -695
  159. package/button/src/button/raised/raised-theme.scss +0 -92
  160. package/button/src/button/underline/underline-theme.scss +0 -141
  161. package/fesm2022/daffodil-design-link-set.mjs +0 -160
  162. package/fesm2022/daffodil-design-link-set.mjs.map +0 -1
  163. package/fesm2022/daffodil-design-quantity-field.mjs +0 -364
  164. package/fesm2022/daffodil-design-quantity-field.mjs.map +0 -1
  165. package/link-set/README.md +0 -86
  166. package/quantity-field/README.md +0 -63
  167. package/scss/theming/_configure-theme.scss +0 -120
  168. package/scss/typography/mixins/_font-weight.scss +0 -14
  169. package/types/daffodil-design-link-set.d.ts +0 -72
  170. package/types/daffodil-design-quantity-field.d.ts +0 -171
@@ -1,425 +1,533 @@
1
- import * as i1 from '@angular/cdk/overlay';
2
- import { STANDARD_DROPDOWN_BELOW_POSITIONS, OverlayModule } from '@angular/cdk/overlay';
3
- import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
4
- import * as i0 from '@angular/core';
5
- import { Injector, Type, TemplateRef, Injectable, signal, input, computed, 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';
8
- import { CommonModule } from '@angular/common';
9
- import { DaffPrefixDirective } from '@daffodil/design';
10
- import * as i1$1 from '@angular/cdk/a11y';
11
- import { FocusKeyManager } from '@angular/cdk/a11y';
12
-
13
- const daffMenuConfigDefault = {
14
- menuId: '',
15
- xPosition: 'after',
16
- yPosition: 'below',
17
- };
18
- const {
19
- /**
20
- * An injection token for the menu configuration.
21
- */
22
- token: DAFF_MENU_CONFIG,
23
- /**
24
- * Provider function for {@link DAFF_MENU_CONFIG}.
25
- */
26
- provider: provideDaffMenuConfig, } = createConfigInjectionToken(daffMenuConfigDefault, 'DAFF_MENU_CONFIG');
27
-
28
- /**
29
- * The CDK connected position for a menu. `yPosition` controls whether the menu drops
30
- * below or rises above the activator; `xPosition` controls which edges line up. The menu
31
- * stays anchored to the activator, so this is a single placement rather than a set of
32
- * fallbacks.
33
- */
1
+ import * as i1$1 from "@angular/cdk/overlay";
2
+ import { OverlayModule, STANDARD_DROPDOWN_BELOW_POSITIONS } from "@angular/cdk/overlay";
3
+ import { ComponentPortal, TemplatePortal } from "@angular/cdk/portal";
4
+ import * as i0 from "@angular/core";
5
+ import { ChangeDetectionStrategy, Component, ContentChild, ContentChildren, Directive, Inject, Injectable, Injector, NgModule, TemplateRef, Type, ViewEncapsulation, computed, input, signal } from "@angular/core";
6
+ import { BehaviorSubject, Subject, map, takeUntil } from "rxjs";
7
+ import { createConfigInjectionToken, createSingletonInjectionToken } from "@daffodil/core";
8
+ import { CommonModule } from "@angular/common";
9
+ import { DaffPrefixDirective } from "@daffodil/design";
10
+ import * as i1 from "@angular/cdk/a11y";
11
+ import { FocusKeyManager } from "@angular/cdk/a11y";
12
+ const { token: DAFF_MENU_CONFIG, provider: provideDaffMenuConfig } = createConfigInjectionToken({
13
+ menuId: "",
14
+ xPosition: "after",
15
+ yPosition: "below"
16
+ }, "DAFF_MENU_CONFIG");
34
17
  const daffMenuConnectedPosition = (xPosition, yPosition) => {
35
- const x = xPosition === 'before' ? 'end' : 'start';
36
- return {
37
- originX: x,
38
- overlayX: x,
39
- originY: yPosition === 'above' ? 'top' : 'bottom',
40
- overlayY: yPosition === 'above' ? 'bottom' : 'top',
41
- };
18
+ const x = xPosition === "before" ? "end" : "start";
19
+ return {
20
+ originX: x,
21
+ overlayX: x,
22
+ originY: yPosition === "above" ? "top" : "bottom",
23
+ overlayY: yPosition === "above" ? "bottom" : "top"
24
+ };
42
25
  };
43
- const daffMenuCreateOverlay = (overlay, element, xPosition = 'after', yPosition = 'below', config = {}) => overlay.create({
44
- hasBackdrop: true,
45
- backdropClass: 'cdk-overlay-transparent-backdrop',
46
- panelClass: 'daff-menu-overlay',
47
- scrollStrategy: overlay.scrollStrategies.block(),
48
- disposeOnNavigation: true,
49
- positionStrategy: overlay
50
- .position()
51
- .flexibleConnectedTo(element)
52
- .withFlexibleDimensions(true)
53
- .withPush(false)
54
- .withViewportMargin(24)
55
- .withPositions([
56
- daffMenuConnectedPosition(xPosition, yPosition),
57
- ...STANDARD_DROPDOWN_BELOW_POSITIONS,
58
- ]),
59
- ...config,
26
+ const daffMenuCreateOverlay = (overlay, element, xPosition = "after", yPosition = "below", config = {}) => overlay.create({
27
+ hasBackdrop: true,
28
+ backdropClass: "cdk-overlay-transparent-backdrop",
29
+ panelClass: "daff-menu-overlay",
30
+ scrollStrategy: overlay.scrollStrategies.block(),
31
+ disposeOnNavigation: true,
32
+ positionStrategy: overlay.position().flexibleConnectedTo(element).withFlexibleDimensions(true).withPush(false).withViewportMargin(24).withPositions([daffMenuConnectedPosition(xPosition, yPosition), ...STANDARD_DROPDOWN_BELOW_POSITIONS]),
33
+ ...config
34
+ });
35
+ var DaffMenuService = class DaffMenuService {
36
+ constructor(overlay, injector) {
37
+ this.overlay = overlay;
38
+ this.injector = injector;
39
+ this.$_open = new BehaviorSubject(false);
40
+ this.open$ = this.$_open.asObservable();
41
+ }
42
+ async _createOverlay(activatorElement, component, config) {
43
+ if (!this._overlay) {
44
+ this._overlay = daffMenuCreateOverlay(this.overlay, activatorElement.element, config?.xPosition, config?.yPosition);
45
+ if (typeof component === "object" && component?.import) component = await component.import();
46
+ const injector = Injector.create({
47
+ providers: [{
48
+ provide: DAFF_MENU_CONFIG,
49
+ useValue: config
50
+ }],
51
+ parent: this.injector
52
+ });
53
+ if (component instanceof Type) this._overlay.attach(new ComponentPortal(component, null, injector));
54
+ else if (component instanceof TemplateRef) this._overlay.attach(new TemplatePortal(component, activatorElement, null, injector));
55
+ this._overlay.backdropClick().pipe(map(() => this.close())).subscribe();
56
+ }
57
+ }
58
+ _destroyOverlay() {
59
+ if (this._overlay) {
60
+ this._overlay.detach();
61
+ this._overlay.dispose();
62
+ this._overlay = null;
63
+ }
64
+ }
65
+ close() {
66
+ this._destroyOverlay();
67
+ this.$_open.next(false);
68
+ this._activator.element.nativeElement.focus();
69
+ }
70
+ open(activator, component, config) {
71
+ if (this._overlay) this._destroyOverlay();
72
+ this._createOverlay(activator, component, config);
73
+ this._activator = activator;
74
+ this.$_open.next(true);
75
+ }
76
+ static {
77
+ this.ɵfac = i0.ɵɵngDeclareFactory({
78
+ minVersion: "12.0.0",
79
+ version: "22.2.4",
80
+ ngImport: i0,
81
+ type: DaffMenuService,
82
+ deps: [{ token: i1$1.Overlay }, { token: i0.Injector }],
83
+ target: i0.ɵɵFactoryTarget.Injectable
84
+ });
85
+ }
86
+ static {
87
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
88
+ minVersion: "12.0.0",
89
+ version: "22.2.4",
90
+ ngImport: i0,
91
+ type: DaffMenuService
92
+ });
93
+ }
94
+ };
95
+ i0.ɵɵngDeclareClassMetadata({
96
+ minVersion: "12.0.0",
97
+ version: "22.2.4",
98
+ ngImport: i0,
99
+ type: DaffMenuService,
100
+ decorators: [{ type: Injectable }],
101
+ ctorParameters: () => [{ type: i1$1.Overlay }, { type: i0.Injector }]
60
102
  });
61
-
62
- class DaffMenuService {
63
- constructor(overlay, injector) {
64
- this.overlay = overlay;
65
- this.injector = injector;
66
- this.$_open = new BehaviorSubject(false);
67
- this.open$ = this.$_open.asObservable();
68
- }
69
- /**
70
- * @docs-private
71
- */
72
- async _createOverlay(activatorElement, component, config) {
73
- if (!this._overlay) {
74
- this._overlay = daffMenuCreateOverlay(this.overlay, activatorElement.element, config?.xPosition, config?.yPosition);
75
- if (typeof component === 'object' && component?.import) {
76
- component = await component.import();
77
- }
78
- const injector = Injector.create({
79
- providers: [{ provide: DAFF_MENU_CONFIG, useValue: config }],
80
- parent: this.injector,
81
- });
82
- if (component instanceof Type) {
83
- this._overlay.attach(new ComponentPortal(component, null, injector));
84
- }
85
- else if (component instanceof TemplateRef) {
86
- this._overlay.attach(new TemplatePortal(component, activatorElement, null, injector));
87
- }
88
- this._overlay.backdropClick().pipe(map(() => this.close())).subscribe();
89
- }
90
- }
91
- /**
92
- * @docs-private
93
- */
94
- _destroyOverlay() {
95
- if (this._overlay) {
96
- this._overlay.detach();
97
- this._overlay.dispose();
98
- this._overlay = null;
99
- }
100
- }
101
- close() {
102
- this._destroyOverlay();
103
- this.$_open.next(false);
104
- this._activator.element.nativeElement.focus();
105
- }
106
- open(activator, component, config) {
107
- if (this._overlay) {
108
- this._destroyOverlay();
109
- }
110
- this._createOverlay(activator, component, config);
111
- this._activator = activator;
112
- this.$_open.next(true);
113
- }
114
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMenuService, deps: [{ token: i1.Overlay }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
115
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMenuService }); }
116
- }
117
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMenuService, decorators: [{
118
- type: Injectable
119
- }], ctorParameters: () => [{ type: i1.Overlay }, { type: i0.Injector }] });
120
-
121
103
  let daffMenuUniqueId = 0;
122
- /**
123
- * Generates a unique menu ID for each menu instance.
124
- */
125
104
  const daffNextMenuId = () => `daff-menu-${daffMenuUniqueId++}`;
126
-
127
- /**
128
- * 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.
129
- *
130
- * @example
131
- * ```html
132
- * <button [daffMenuActivator]="menu">
133
- * Open Menu
134
- * </button>
135
- * ```
136
- */
137
- class DaffMenuActivatorDirective {
138
- /**
139
- * @docs-private
140
- */
141
- get ariaExpanded() {
142
- return this._open ? 'true' : 'false';
143
- }
144
- constructor(service, viewContainerRef, cdRef) {
145
- this.service = service;
146
- this.viewContainerRef = viewContainerRef;
147
- this.cdRef = cdRef;
148
- this._destroyed$ = new Subject();
149
- this._defaultMenuId = daffNextMenuId();
150
- this.isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
151
- /**
152
- * The menu content to display when activated.
153
- */
154
- this.daffMenuActivator = input(...(ngDevMode ? [undefined, { debugName: "daffMenuActivator" }] : /* istanbul ignore next */ []));
155
- /**
156
- * An optional ID for the activator.
157
- * When set, the menu's ID is derived as `${id}-menu`.
158
- */
159
- this.id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : /* istanbul ignore next */ []));
160
- /**
161
- * The horizontal alignment of the menu relative to the activator. Defaults to `after`.
162
- */
163
- this.xPosition = input('after', ...(ngDevMode ? [{ debugName: "xPosition" }] : /* istanbul ignore next */ []));
164
- /**
165
- * The vertical position of the menu relative to the activator. Defaults to `below`.
166
- */
167
- this.yPosition = input('below', ...(ngDevMode ? [{ debugName: "yPosition" }] : /* istanbul ignore next */ []));
168
- /**
169
- * The resolved menu ID.
170
- */
171
- this.menuId = computed(() => {
172
- const id = this.id();
173
- return id ? `${id}-menu` : this._defaultMenuId;
174
- }, ...(ngDevMode ? [{ debugName: "menuId" }] : /* istanbul ignore next */ []));
175
- this.service.open$.pipe(takeUntil(this._destroyed$)).subscribe((val) => {
176
- this._open = val;
177
- this.isOpen.set(this._open);
178
- this.cdRef.markForCheck();
179
- });
180
- }
181
- /**
182
- * @docs-private
183
- */
184
- ngOnDestroy() {
185
- this._destroyed$.next(true);
186
- this._destroyed$.complete();
187
- }
188
- /**
189
- * @docs-private
190
- */
191
- focus() {
192
- this.viewContainerRef.element.nativeElement.focus();
193
- }
194
- /**
195
- * @docs-private
196
- */
197
- onClick(event) {
198
- event.preventDefault();
199
- this.service.open(this.viewContainerRef, this.daffMenuActivator(), { menuId: this.menuId(), xPosition: this.xPosition(), yPosition: this.yPosition() });
200
- }
201
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMenuActivatorDirective, deps: [{ token: DaffMenuService }, { token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
202
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: DaffMenuActivatorDirective, isStandalone: true, selector: "[daffMenuActivator]", inputs: { daffMenuActivator: { classPropertyName: "daffMenuActivator", publicName: "daffMenuActivator", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, xPosition: { classPropertyName: "xPosition", publicName: "xPosition", isSignal: true, isRequired: false, transformFunction: null }, yPosition: { classPropertyName: "yPosition", publicName: "yPosition", 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" } }, providers: [
203
- DaffMenuService,
204
- ], exportAs: ["daffMenuActivator"], ngImport: i0 }); }
205
- }
206
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMenuActivatorDirective, decorators: [{
207
- type: Directive,
208
- args: [{
209
- selector: '[daffMenuActivator]',
210
- host: {
211
- '(click)': 'onClick($event)',
212
- 'aria-haspopup': 'menu',
213
- '[attr.aria-expanded]': 'ariaExpanded',
214
- '[attr.aria-controls]': '_open ? menuId() : null',
215
- },
216
- exportAs: 'daffMenuActivator',
217
- providers: [
218
- DaffMenuService,
219
- ],
220
- }]
221
- }], ctorParameters: () => [{ type: DaffMenuService }, { type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }], propDecorators: { daffMenuActivator: [{ type: i0.Input, args: [{ isSignal: true, alias: "daffMenuActivator", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], xPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "xPosition", required: false }] }], yPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "yPosition", required: false }] }] } });
222
-
223
- /**
224
- * Injection token/provider pair used to identify menu items.
225
- *
226
- * `DaffMenuComponent` uses `@ContentChildren(DAFF_MENU_ITEM_TOKEN)` to discover
227
- * its menu items. Use `provideDaffMenuItemToken` in component providers to register
228
- * custom directives and components as menu items alongside native `daff-menu-item` elements.
229
- */
230
- const { token: DAFF_MENU_ITEM_TOKEN, provider: provideDaffMenuItemToken, } = createSingletonInjectionToken('DAFF_MENU_ITEM_TOKEN');
231
-
232
- /**
233
- * Individual clickable items within the menu. Applied to `<button>` or `<a>` elements.
234
- *
235
- * @example
236
- * ```
237
- * <a daff-menu-item href="/">Settings</a>
238
- * <button daff-menu-item href="/">Settings</button>
239
- * ```
240
- */
241
- class DaffMenuItemComponent {
242
- constructor(_elementRef, _menuService) {
243
- this._elementRef = _elementRef;
244
- this._menuService = _menuService;
245
- }
246
- /**
247
- * @docs-private
248
- */
249
- onClick() {
250
- this._menuService.close();
251
- }
252
- /**
253
- * Focus the menu item.
254
- */
255
- focus() {
256
- this._elementRef.nativeElement.focus();
257
- }
258
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMenuItemComponent, deps: [{ token: i0.ElementRef }, { token: DaffMenuService }], target: i0.ɵɵFactoryTarget.Component }); }
259
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", 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 }); }
260
- }
261
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMenuItemComponent, decorators: [{
262
- type: Component,
263
- args: [{ selector: 'a[daff-menu-item]' + ',' +
264
- 'button[daff-menu-item]', host: {
265
- 'class': 'daff-menu-item',
266
- 'role': 'menuitem',
267
- '(click)': 'onClick()',
268
- }, changeDetection: ChangeDetectionStrategy.OnPush, providers: [provideDaffMenuItemToken(DaffMenuItemComponent)], template: "@if (_prefix) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<ng-content></ng-content>" }]
269
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: DaffMenuService }], propDecorators: { _prefix: [{
270
- type: ContentChild,
271
- args: [DaffPrefixDirective]
272
- }] } });
273
-
274
- /* eslint-disable quote-props */
275
- /**
276
- * The floating panel that contains menu items.
277
- *
278
- * @example
279
- * ```html
280
- * <daff-menu>
281
- * <button daff-menu-item>
282
- * <fa-icon [icon]="faEdit" daffPrefix></fa-icon>
283
- * Edit
284
- * </button>
285
- * <button daff-menu-item>
286
- * <fa-icon [icon]="faTrash" daffPrefix></fa-icon>
287
- * Delete
288
- * </button>
289
- * <a href="/settings" daff-menu-item>
290
- * <fa-icon [icon]="faCog" daffPrefix></fa-icon>
291
- * Settings
292
- * </a>
293
- * </daff-menu>
294
- * ```
295
- */
296
- class DaffMenuComponent {
297
- constructor(_focusTrapFactory, _elementRef, menuService,
298
- /**
299
- * @docs-private
300
- */
301
- config) {
302
- this._focusTrapFactory = _focusTrapFactory;
303
- this._elementRef = _elementRef;
304
- this.menuService = menuService;
305
- this.config = config;
306
- }
307
- /**
308
- * @docs-private
309
- *
310
- * Handles keyboard navigation.
311
- */
312
- handleKeydown(event) {
313
- switch (event.key) {
314
- case 'Escape':
315
- event.preventDefault();
316
- this.menuService.close();
317
- break;
318
- case 'ArrowDown':
319
- case 'ArrowUp':
320
- case 'Home':
321
- case 'End':
322
- event.preventDefault();
323
- this._keyManager.onKeydown(event);
324
- break;
325
- }
326
- }
327
- /**
328
- * @docs-private
329
- */
330
- ngAfterContentInit() {
331
- this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);
332
- this._keyManager = new FocusKeyManager(this._items)
333
- .withWrap()
334
- .withHomeAndEnd();
335
- }
336
- /**
337
- * @docs-private
338
- */
339
- ngAfterViewInit() {
340
- // Set focus to the first menu item when menu opens
341
- if (this._items.length > 0) {
342
- this._keyManager.setFirstItemActive();
343
- this._keyManager.setActiveItem(0);
344
- }
345
- }
346
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMenuComponent, deps: [{ token: i1$1.ConfigurableFocusTrapFactory }, { token: i0.ElementRef }, { token: DaffMenuService }, { token: DAFF_MENU_CONFIG }], target: i0.ɵɵFactoryTarget.Component }); }
347
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", 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-overlay>*:not(.daff-menu){display:contents}.daff-menu{display:block;min-width:7rem;max-width:20rem;border-radius:.25rem;padding:.5rem;overflow-y:auto}.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 }); }
348
- }
349
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMenuComponent, decorators: [{
350
- type: Component,
351
- args: [{ selector: 'daff-menu', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
352
- class: 'daff-menu',
353
- 'tabindex': '0',
354
- 'role': 'menu',
355
- '[id]': 'config.menuId',
356
- '(keydown)': 'handleKeydown($event)',
357
- }, imports: [
358
- DaffMenuItemComponent,
359
- ], template: "<ng-content></ng-content>", styles: [".daff-menu-overlay>*:not(.daff-menu){display:contents}.daff-menu{display:block;min-width:7rem;max-width:20rem;border-radius:.25rem;padding:.5rem;overflow-y:auto}.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"] }]
360
- }], ctorParameters: () => [{ type: i1$1.ConfigurableFocusTrapFactory }, { type: i0.ElementRef }, { type: DaffMenuService }, { type: undefined, decorators: [{
361
- type: Inject,
362
- args: [DAFF_MENU_CONFIG]
363
- }] }], propDecorators: { _items: [{
364
- type: ContentChildren,
365
- args: [DAFF_MENU_ITEM_TOKEN]
366
- }] } });
367
-
368
- /**
369
- * @deprecated in favor of {@link DAFF_MENU_COMPONENTS} Deprecated in version 0.92.0. Will be removed in version 0.95.0.
370
- */
371
- class DaffMenuModule {
372
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
373
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffMenuModule, imports: [CommonModule,
374
- OverlayModule,
375
- DaffMenuActivatorDirective,
376
- DaffMenuComponent,
377
- DaffMenuItemComponent,
378
- DaffPrefixDirective], exports: [DaffMenuActivatorDirective,
379
- DaffMenuComponent,
380
- DaffMenuItemComponent,
381
- DaffPrefixDirective] }); }
382
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMenuModule, providers: [
383
- DaffMenuService,
384
- ], imports: [CommonModule,
385
- OverlayModule] }); }
386
- }
387
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMenuModule, decorators: [{
388
- type: NgModule,
389
- args: [{
390
- imports: [
391
- CommonModule,
392
- OverlayModule,
393
- DaffMenuActivatorDirective,
394
- DaffMenuComponent,
395
- DaffMenuItemComponent,
396
- DaffPrefixDirective,
397
- ],
398
- exports: [
399
- DaffMenuActivatorDirective,
400
- DaffMenuComponent,
401
- DaffMenuItemComponent,
402
- DaffPrefixDirective,
403
- ],
404
- providers: [
405
- DaffMenuService,
406
- ],
407
- }]
408
- }] });
409
-
410
- /**
411
- * @docs-private
412
- */
105
+ var DaffMenuActivatorDirective = class DaffMenuActivatorDirective {
106
+ get ariaExpanded() {
107
+ return this._open ? "true" : "false";
108
+ }
109
+ constructor(service, viewContainerRef, cdRef) {
110
+ this.service = service;
111
+ this.viewContainerRef = viewContainerRef;
112
+ this.cdRef = cdRef;
113
+ this._destroyed$ = new Subject();
114
+ this._defaultMenuId = daffNextMenuId();
115
+ this.isOpen = signal(false, ...ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []);
116
+ this.daffMenuActivator = input(...ngDevMode ? [void 0, { debugName: "daffMenuActivator" }] : /* istanbul ignore next */ []);
117
+ this.id = input(...ngDevMode ? [void 0, { debugName: "id" }] : /* istanbul ignore next */ []);
118
+ this.xPosition = input("after", ...ngDevMode ? [{ debugName: "xPosition" }] : /* istanbul ignore next */ []);
119
+ this.yPosition = input("below", ...ngDevMode ? [{ debugName: "yPosition" }] : /* istanbul ignore next */ []);
120
+ this.menuId = computed(() => {
121
+ const id = this.id();
122
+ return id ? `${id}-menu` : this._defaultMenuId;
123
+ }, ...ngDevMode ? [{ debugName: "menuId" }] : /* istanbul ignore next */ []);
124
+ this.service.open$.pipe(takeUntil(this._destroyed$)).subscribe((val) => {
125
+ this._open = val;
126
+ this.isOpen.set(this._open);
127
+ this.cdRef.markForCheck();
128
+ });
129
+ }
130
+ ngOnDestroy() {
131
+ this._destroyed$.next(true);
132
+ this._destroyed$.complete();
133
+ }
134
+ focus() {
135
+ this.viewContainerRef.element.nativeElement.focus();
136
+ }
137
+ onClick(event) {
138
+ event.preventDefault();
139
+ this.service.open(this.viewContainerRef, this.daffMenuActivator(), {
140
+ menuId: this.menuId(),
141
+ xPosition: this.xPosition(),
142
+ yPosition: this.yPosition()
143
+ });
144
+ }
145
+ static {
146
+ this.ɵfac = i0.ɵɵngDeclareFactory({
147
+ minVersion: "12.0.0",
148
+ version: "22.2.4",
149
+ ngImport: i0,
150
+ type: DaffMenuActivatorDirective,
151
+ deps: [
152
+ { token: DaffMenuService },
153
+ { token: i0.ViewContainerRef },
154
+ { token: i0.ChangeDetectorRef }
155
+ ],
156
+ target: i0.ɵɵFactoryTarget.Directive
157
+ });
158
+ }
159
+ static {
160
+ this.ɵdir = i0.ɵɵngDeclareDirective({
161
+ minVersion: "17.1.0",
162
+ version: "22.2.4",
163
+ type: DaffMenuActivatorDirective,
164
+ isStandalone: true,
165
+ selector: "[daffMenuActivator]",
166
+ inputs: {
167
+ daffMenuActivator: {
168
+ classPropertyName: "daffMenuActivator",
169
+ publicName: "daffMenuActivator",
170
+ isSignal: true,
171
+ isRequired: false,
172
+ transformFunction: null
173
+ },
174
+ id: {
175
+ classPropertyName: "id",
176
+ publicName: "id",
177
+ isSignal: true,
178
+ isRequired: false,
179
+ transformFunction: null
180
+ },
181
+ xPosition: {
182
+ classPropertyName: "xPosition",
183
+ publicName: "xPosition",
184
+ isSignal: true,
185
+ isRequired: false,
186
+ transformFunction: null
187
+ },
188
+ yPosition: {
189
+ classPropertyName: "yPosition",
190
+ publicName: "yPosition",
191
+ isSignal: true,
192
+ isRequired: false,
193
+ transformFunction: null
194
+ }
195
+ },
196
+ host: {
197
+ attributes: { "aria-haspopup": "menu" },
198
+ listeners: { "click": "onClick($event)" },
199
+ properties: {
200
+ "attr.aria-expanded": "ariaExpanded",
201
+ "attr.aria-controls": "_open ? menuId() : null"
202
+ }
203
+ },
204
+ providers: [DaffMenuService],
205
+ exportAs: ["daffMenuActivator"],
206
+ ngImport: i0
207
+ });
208
+ }
209
+ };
210
+ i0.ɵɵngDeclareClassMetadata({
211
+ minVersion: "12.0.0",
212
+ version: "22.2.4",
213
+ ngImport: i0,
214
+ type: DaffMenuActivatorDirective,
215
+ decorators: [{
216
+ type: Directive,
217
+ args: [{
218
+ selector: "[daffMenuActivator]",
219
+ host: {
220
+ "(click)": "onClick($event)",
221
+ "aria-haspopup": "menu",
222
+ "[attr.aria-expanded]": "ariaExpanded",
223
+ "[attr.aria-controls]": "_open ? menuId() : null"
224
+ },
225
+ exportAs: "daffMenuActivator",
226
+ providers: [DaffMenuService]
227
+ }]
228
+ }],
229
+ ctorParameters: () => [
230
+ { type: DaffMenuService },
231
+ { type: i0.ViewContainerRef },
232
+ { type: i0.ChangeDetectorRef }
233
+ ],
234
+ propDecorators: {
235
+ daffMenuActivator: [{
236
+ type: i0.Input,
237
+ args: [{
238
+ isSignal: true,
239
+ alias: "daffMenuActivator",
240
+ required: false
241
+ }]
242
+ }],
243
+ id: [{
244
+ type: i0.Input,
245
+ args: [{
246
+ isSignal: true,
247
+ alias: "id",
248
+ required: false
249
+ }]
250
+ }],
251
+ xPosition: [{
252
+ type: i0.Input,
253
+ args: [{
254
+ isSignal: true,
255
+ alias: "xPosition",
256
+ required: false
257
+ }]
258
+ }],
259
+ yPosition: [{
260
+ type: i0.Input,
261
+ args: [{
262
+ isSignal: true,
263
+ alias: "yPosition",
264
+ required: false
265
+ }]
266
+ }]
267
+ }
268
+ });
269
+ const { token: DAFF_MENU_ITEM_TOKEN, provider: provideDaffMenuItemToken } = createSingletonInjectionToken("DAFF_MENU_ITEM_TOKEN");
270
+ var DaffMenuItemComponent = class DaffMenuItemComponent {
271
+ constructor(_elementRef, _menuService) {
272
+ this._elementRef = _elementRef;
273
+ this._menuService = _menuService;
274
+ }
275
+ onClick() {
276
+ this._menuService.close();
277
+ }
278
+ focus() {
279
+ this._elementRef.nativeElement.focus();
280
+ }
281
+ static {
282
+ this.ɵfac = i0.ɵɵngDeclareFactory({
283
+ minVersion: "12.0.0",
284
+ version: "22.2.4",
285
+ ngImport: i0,
286
+ type: DaffMenuItemComponent,
287
+ deps: [{ token: i0.ElementRef }, { token: DaffMenuService }],
288
+ target: i0.ɵɵFactoryTarget.Component
289
+ });
290
+ }
291
+ static {
292
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
293
+ minVersion: "17.0.0",
294
+ version: "22.2.4",
295
+ type: DaffMenuItemComponent,
296
+ isStandalone: true,
297
+ selector: "a[daff-menu-item],button[daff-menu-item]",
298
+ host: {
299
+ attributes: { "role": "menuitem" },
300
+ listeners: { "click": "onClick()" },
301
+ classAttribute: "daff-menu-item"
302
+ },
303
+ providers: [provideDaffMenuItemToken(DaffMenuItemComponent)],
304
+ queries: [{
305
+ propertyName: "_prefix",
306
+ first: true,
307
+ predicate: DaffPrefixDirective,
308
+ descendants: true
309
+ }],
310
+ ngImport: i0,
311
+ template: "@if (_prefix) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<ng-content></ng-content>",
312
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
313
+ });
314
+ }
315
+ };
316
+ i0.ɵɵngDeclareClassMetadata({
317
+ minVersion: "12.0.0",
318
+ version: "22.2.4",
319
+ ngImport: i0,
320
+ type: DaffMenuItemComponent,
321
+ decorators: [{
322
+ type: Component,
323
+ args: [{
324
+ selector: "a[daff-menu-item],button[daff-menu-item]",
325
+ host: {
326
+ "class": "daff-menu-item",
327
+ "role": "menuitem",
328
+ "(click)": "onClick()"
329
+ },
330
+ changeDetection: ChangeDetectionStrategy.OnPush,
331
+ providers: [provideDaffMenuItemToken(DaffMenuItemComponent)],
332
+ template: "@if (_prefix) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<ng-content></ng-content>"
333
+ }]
334
+ }],
335
+ ctorParameters: () => [{ type: i0.ElementRef }, { type: DaffMenuService }],
336
+ propDecorators: { _prefix: [{
337
+ type: ContentChild,
338
+ args: [DaffPrefixDirective]
339
+ }] }
340
+ });
341
+ var DaffMenuComponent = class DaffMenuComponent {
342
+ constructor(_focusTrapFactory, _elementRef, menuService, config) {
343
+ this._focusTrapFactory = _focusTrapFactory;
344
+ this._elementRef = _elementRef;
345
+ this.menuService = menuService;
346
+ this.config = config;
347
+ }
348
+ handleKeydown(event) {
349
+ switch (event.key) {
350
+ case "Escape":
351
+ event.preventDefault();
352
+ this.menuService.close();
353
+ break;
354
+ case "ArrowDown":
355
+ case "ArrowUp":
356
+ case "Home":
357
+ case "End":
358
+ event.preventDefault();
359
+ this._keyManager.onKeydown(event);
360
+ }
361
+ }
362
+ ngAfterContentInit() {
363
+ this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);
364
+ this._keyManager = new FocusKeyManager(this._items).withWrap().withHomeAndEnd();
365
+ }
366
+ ngAfterViewInit() {
367
+ if (this._items.length > 0) {
368
+ this._keyManager.setFirstItemActive();
369
+ this._keyManager.setActiveItem(0);
370
+ }
371
+ }
372
+ static {
373
+ this.ɵfac = i0.ɵɵngDeclareFactory({
374
+ minVersion: "12.0.0",
375
+ version: "22.2.4",
376
+ ngImport: i0,
377
+ type: DaffMenuComponent,
378
+ deps: [
379
+ { token: i1.ConfigurableFocusTrapFactory },
380
+ { token: i0.ElementRef },
381
+ { token: DaffMenuService },
382
+ { token: DAFF_MENU_CONFIG }
383
+ ],
384
+ target: i0.ɵɵFactoryTarget.Component
385
+ });
386
+ }
387
+ static {
388
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
389
+ minVersion: "14.0.0",
390
+ version: "22.2.4",
391
+ type: DaffMenuComponent,
392
+ isStandalone: true,
393
+ selector: "daff-menu",
394
+ host: {
395
+ attributes: {
396
+ "tabindex": "0",
397
+ "role": "menu"
398
+ },
399
+ listeners: { "keydown": "handleKeydown($event)" },
400
+ properties: { "id": "config.menuId" },
401
+ classAttribute: "daff-menu"
402
+ },
403
+ queries: [{
404
+ propertyName: "_items",
405
+ predicate: DAFF_MENU_ITEM_TOKEN
406
+ }],
407
+ ngImport: i0,
408
+ template: "<ng-content></ng-content>",
409
+ styles: [".daff-menu-overlay>*:not(.daff-menu){display:contents}.daff-menu{display:block;min-width:7rem;max-width:20rem;border-radius:.25rem;padding:.5rem;overflow-y:auto}.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"],
410
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
411
+ encapsulation: i0.ViewEncapsulation.None
412
+ });
413
+ }
414
+ };
415
+ i0.ɵɵngDeclareClassMetadata({
416
+ minVersion: "12.0.0",
417
+ version: "22.2.4",
418
+ ngImport: i0,
419
+ type: DaffMenuComponent,
420
+ decorators: [{
421
+ type: Component,
422
+ args: [{
423
+ selector: "daff-menu",
424
+ encapsulation: ViewEncapsulation.None,
425
+ changeDetection: ChangeDetectionStrategy.OnPush,
426
+ host: {
427
+ class: "daff-menu",
428
+ "tabindex": "0",
429
+ "role": "menu",
430
+ "[id]": "config.menuId",
431
+ "(keydown)": "handleKeydown($event)"
432
+ },
433
+ imports: [DaffMenuItemComponent],
434
+ template: "<ng-content></ng-content>",
435
+ styles: [".daff-menu-overlay>*:not(.daff-menu){display:contents}.daff-menu{display:block;min-width:7rem;max-width:20rem;border-radius:.25rem;padding:.5rem;overflow-y:auto}.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"]
436
+ }]
437
+ }],
438
+ ctorParameters: () => [
439
+ { type: i1.ConfigurableFocusTrapFactory },
440
+ { type: i0.ElementRef },
441
+ { type: DaffMenuService },
442
+ {
443
+ type: void 0,
444
+ decorators: [{
445
+ type: Inject,
446
+ args: [DAFF_MENU_CONFIG]
447
+ }]
448
+ }
449
+ ],
450
+ propDecorators: { _items: [{
451
+ type: ContentChildren,
452
+ args: [DAFF_MENU_ITEM_TOKEN]
453
+ }] }
454
+ });
455
+ var DaffMenuModule = class DaffMenuModule {
456
+ static {
457
+ this.ɵfac = i0.ɵɵngDeclareFactory({
458
+ minVersion: "12.0.0",
459
+ version: "22.2.4",
460
+ ngImport: i0,
461
+ type: DaffMenuModule,
462
+ deps: [],
463
+ target: i0.ɵɵFactoryTarget.NgModule
464
+ });
465
+ }
466
+ static {
467
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
468
+ minVersion: "14.0.0",
469
+ version: "22.2.4",
470
+ ngImport: i0,
471
+ type: DaffMenuModule,
472
+ imports: [
473
+ CommonModule,
474
+ OverlayModule,
475
+ DaffMenuActivatorDirective,
476
+ DaffMenuComponent,
477
+ DaffMenuItemComponent,
478
+ DaffPrefixDirective
479
+ ],
480
+ exports: [
481
+ DaffMenuActivatorDirective,
482
+ DaffMenuComponent,
483
+ DaffMenuItemComponent,
484
+ DaffPrefixDirective
485
+ ]
486
+ });
487
+ }
488
+ static {
489
+ this.ɵinj = i0.ɵɵngDeclareInjector({
490
+ minVersion: "12.0.0",
491
+ version: "22.2.4",
492
+ ngImport: i0,
493
+ type: DaffMenuModule,
494
+ providers: [DaffMenuService],
495
+ imports: [CommonModule, OverlayModule]
496
+ });
497
+ }
498
+ };
499
+ i0.ɵɵngDeclareClassMetadata({
500
+ minVersion: "12.0.0",
501
+ version: "22.2.4",
502
+ ngImport: i0,
503
+ type: DaffMenuModule,
504
+ decorators: [{
505
+ type: NgModule,
506
+ args: [{
507
+ imports: [
508
+ CommonModule,
509
+ OverlayModule,
510
+ DaffMenuActivatorDirective,
511
+ DaffMenuComponent,
512
+ DaffMenuItemComponent,
513
+ DaffPrefixDirective
514
+ ],
515
+ exports: [
516
+ DaffMenuActivatorDirective,
517
+ DaffMenuComponent,
518
+ DaffMenuItemComponent,
519
+ DaffPrefixDirective
520
+ ],
521
+ providers: [DaffMenuService]
522
+ }]
523
+ }]
524
+ });
413
525
  const DAFF_MENU_COMPONENTS = [
414
- DaffMenuComponent,
415
- DaffMenuActivatorDirective,
416
- DaffMenuItemComponent,
417
- DaffPrefixDirective,
526
+ DaffMenuComponent,
527
+ DaffMenuActivatorDirective,
528
+ DaffMenuItemComponent,
529
+ DaffPrefixDirective
418
530
  ];
419
-
420
- /**
421
- * Generated bundle index. Do not edit.
422
- */
423
-
424
531
  export { DAFF_MENU_COMPONENTS, DAFF_MENU_ITEM_TOKEN, DaffMenuActivatorDirective, DaffMenuComponent, DaffMenuItemComponent, DaffMenuModule, DaffMenuService, provideDaffMenuItemToken };
425
- //# sourceMappingURL=daffodil-design-menu.mjs.map
532
+
533
+ //# sourceMappingURL=daffodil-design-menu.mjs.map