@raqm/ui 0.0.0-stage → 0.1.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 (178) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE +21 -0
  3. package/NOTICE.md +28 -0
  4. package/README.md +125 -3
  5. package/combobox/README.md +17 -0
  6. package/fesm2022/raqm-ui-accordion.mjs +414 -0
  7. package/fesm2022/raqm-ui-accordion.mjs.map +1 -0
  8. package/fesm2022/raqm-ui-alert-dialog.mjs +457 -0
  9. package/fesm2022/raqm-ui-alert-dialog.mjs.map +1 -0
  10. package/fesm2022/raqm-ui-alert.mjs +195 -0
  11. package/fesm2022/raqm-ui-alert.mjs.map +1 -0
  12. package/fesm2022/raqm-ui-aspect-ratio.mjs +66 -0
  13. package/fesm2022/raqm-ui-aspect-ratio.mjs.map +1 -0
  14. package/fesm2022/raqm-ui-attachment.mjs +435 -0
  15. package/fesm2022/raqm-ui-attachment.mjs.map +1 -0
  16. package/fesm2022/raqm-ui-avatar.mjs +337 -0
  17. package/fesm2022/raqm-ui-avatar.mjs.map +1 -0
  18. package/fesm2022/raqm-ui-badge.mjs +68 -0
  19. package/fesm2022/raqm-ui-badge.mjs.map +1 -0
  20. package/fesm2022/raqm-ui-breadcrumb.mjs +309 -0
  21. package/fesm2022/raqm-ui-breadcrumb.mjs.map +1 -0
  22. package/fesm2022/raqm-ui-button-group.mjs +138 -0
  23. package/fesm2022/raqm-ui-button-group.mjs.map +1 -0
  24. package/fesm2022/raqm-ui-button.mjs +295 -0
  25. package/fesm2022/raqm-ui-button.mjs.map +1 -0
  26. package/fesm2022/raqm-ui-calendar.mjs +1394 -0
  27. package/fesm2022/raqm-ui-calendar.mjs.map +1 -0
  28. package/fesm2022/raqm-ui-card.mjs +331 -0
  29. package/fesm2022/raqm-ui-card.mjs.map +1 -0
  30. package/fesm2022/raqm-ui-carousel.mjs +410 -0
  31. package/fesm2022/raqm-ui-carousel.mjs.map +1 -0
  32. package/fesm2022/raqm-ui-checkbox.mjs +86 -0
  33. package/fesm2022/raqm-ui-checkbox.mjs.map +1 -0
  34. package/fesm2022/raqm-ui-collapsible.mjs +266 -0
  35. package/fesm2022/raqm-ui-collapsible.mjs.map +1 -0
  36. package/fesm2022/raqm-ui-combobox.mjs +1584 -0
  37. package/fesm2022/raqm-ui-combobox.mjs.map +1 -0
  38. package/fesm2022/raqm-ui-command.mjs +1210 -0
  39. package/fesm2022/raqm-ui-command.mjs.map +1 -0
  40. package/fesm2022/raqm-ui-context-menu.mjs +723 -0
  41. package/fesm2022/raqm-ui-context-menu.mjs.map +1 -0
  42. package/fesm2022/raqm-ui-dialog.mjs +1214 -0
  43. package/fesm2022/raqm-ui-dialog.mjs.map +1 -0
  44. package/fesm2022/raqm-ui-drawer.mjs +687 -0
  45. package/fesm2022/raqm-ui-drawer.mjs.map +1 -0
  46. package/fesm2022/raqm-ui-dropdown-menu.mjs +1168 -0
  47. package/fesm2022/raqm-ui-dropdown-menu.mjs.map +1 -0
  48. package/fesm2022/raqm-ui-empty.mjs +272 -0
  49. package/fesm2022/raqm-ui-empty.mjs.map +1 -0
  50. package/fesm2022/raqm-ui-field.mjs +517 -0
  51. package/fesm2022/raqm-ui-field.mjs.map +1 -0
  52. package/fesm2022/raqm-ui-hover-card.mjs +828 -0
  53. package/fesm2022/raqm-ui-hover-card.mjs.map +1 -0
  54. package/fesm2022/raqm-ui-input-group.mjs +270 -0
  55. package/fesm2022/raqm-ui-input-group.mjs.map +1 -0
  56. package/fesm2022/raqm-ui-input-otp.mjs +788 -0
  57. package/fesm2022/raqm-ui-input-otp.mjs.map +1 -0
  58. package/fesm2022/raqm-ui-input.mjs +73 -0
  59. package/fesm2022/raqm-ui-input.mjs.map +1 -0
  60. package/fesm2022/raqm-ui-item.mjs +495 -0
  61. package/fesm2022/raqm-ui-item.mjs.map +1 -0
  62. package/fesm2022/raqm-ui-kbd.mjs +80 -0
  63. package/fesm2022/raqm-ui-kbd.mjs.map +1 -0
  64. package/fesm2022/raqm-ui-label.mjs +44 -0
  65. package/fesm2022/raqm-ui-label.mjs.map +1 -0
  66. package/fesm2022/raqm-ui-menubar.mjs +536 -0
  67. package/fesm2022/raqm-ui-menubar.mjs.map +1 -0
  68. package/fesm2022/raqm-ui-native-select.mjs +131 -0
  69. package/fesm2022/raqm-ui-native-select.mjs.map +1 -0
  70. package/fesm2022/raqm-ui-navigation-menu.mjs +1399 -0
  71. package/fesm2022/raqm-ui-navigation-menu.mjs.map +1 -0
  72. package/fesm2022/raqm-ui-overlay-internal.mjs +185 -0
  73. package/fesm2022/raqm-ui-overlay-internal.mjs.map +1 -0
  74. package/fesm2022/raqm-ui-pagination.mjs +440 -0
  75. package/fesm2022/raqm-ui-pagination.mjs.map +1 -0
  76. package/fesm2022/raqm-ui-popover.mjs +1495 -0
  77. package/fesm2022/raqm-ui-popover.mjs.map +1 -0
  78. package/fesm2022/raqm-ui-progress.mjs +369 -0
  79. package/fesm2022/raqm-ui-progress.mjs.map +1 -0
  80. package/fesm2022/raqm-ui-questionnaire.mjs +1005 -0
  81. package/fesm2022/raqm-ui-questionnaire.mjs.map +1 -0
  82. package/fesm2022/raqm-ui-radio-group.mjs +151 -0
  83. package/fesm2022/raqm-ui-radio-group.mjs.map +1 -0
  84. package/fesm2022/raqm-ui-resizable.mjs +439 -0
  85. package/fesm2022/raqm-ui-resizable.mjs.map +1 -0
  86. package/fesm2022/raqm-ui-scroll-area.mjs +510 -0
  87. package/fesm2022/raqm-ui-scroll-area.mjs.map +1 -0
  88. package/fesm2022/raqm-ui-select.mjs +1073 -0
  89. package/fesm2022/raqm-ui-select.mjs.map +1 -0
  90. package/fesm2022/raqm-ui-separator.mjs +103 -0
  91. package/fesm2022/raqm-ui-separator.mjs.map +1 -0
  92. package/fesm2022/raqm-ui-sheet.mjs +411 -0
  93. package/fesm2022/raqm-ui-sheet.mjs.map +1 -0
  94. package/fesm2022/raqm-ui-sidebar.mjs +1784 -0
  95. package/fesm2022/raqm-ui-sidebar.mjs.map +1 -0
  96. package/fesm2022/raqm-ui-skeleton.mjs +50 -0
  97. package/fesm2022/raqm-ui-skeleton.mjs.map +1 -0
  98. package/fesm2022/raqm-ui-slider.mjs +609 -0
  99. package/fesm2022/raqm-ui-slider.mjs.map +1 -0
  100. package/fesm2022/raqm-ui-spinner.mjs +137 -0
  101. package/fesm2022/raqm-ui-spinner.mjs.map +1 -0
  102. package/fesm2022/raqm-ui-switch.mjs +109 -0
  103. package/fesm2022/raqm-ui-switch.mjs.map +1 -0
  104. package/fesm2022/raqm-ui-table.mjs +271 -0
  105. package/fesm2022/raqm-ui-table.mjs.map +1 -0
  106. package/fesm2022/raqm-ui-tabs.mjs +536 -0
  107. package/fesm2022/raqm-ui-tabs.mjs.map +1 -0
  108. package/fesm2022/raqm-ui-textarea.mjs +37 -0
  109. package/fesm2022/raqm-ui-textarea.mjs.map +1 -0
  110. package/fesm2022/raqm-ui-toast.mjs +918 -0
  111. package/fesm2022/raqm-ui-toast.mjs.map +1 -0
  112. package/fesm2022/raqm-ui-toggle-group.mjs +462 -0
  113. package/fesm2022/raqm-ui-toggle-group.mjs.map +1 -0
  114. package/fesm2022/raqm-ui-toggle.mjs +158 -0
  115. package/fesm2022/raqm-ui-toggle.mjs.map +1 -0
  116. package/fesm2022/raqm-ui-tooltip.mjs +1226 -0
  117. package/fesm2022/raqm-ui-tooltip.mjs.map +1 -0
  118. package/fesm2022/raqm-ui.mjs +50 -0
  119. package/input-otp/README.md +12 -0
  120. package/package.json +275 -3
  121. package/styles/theme.css +4322 -0
  122. package/types/raqm-ui-accordion.d.ts +124 -0
  123. package/types/raqm-ui-alert-dialog.d.ts +81 -0
  124. package/types/raqm-ui-alert.d.ts +29 -0
  125. package/types/raqm-ui-aspect-ratio.d.ts +13 -0
  126. package/types/raqm-ui-attachment.d.ts +72 -0
  127. package/types/raqm-ui-avatar.d.ts +67 -0
  128. package/types/raqm-ui-badge.d.ts +20 -0
  129. package/types/raqm-ui-breadcrumb.d.ts +35 -0
  130. package/types/raqm-ui-button-group.d.ts +27 -0
  131. package/types/raqm-ui-button.d.ts +80 -0
  132. package/types/raqm-ui-calendar.d.ts +359 -0
  133. package/types/raqm-ui-card.d.ts +34 -0
  134. package/types/raqm-ui-carousel.d.ts +81 -0
  135. package/types/raqm-ui-checkbox.d.ts +24 -0
  136. package/types/raqm-ui-collapsible.d.ts +72 -0
  137. package/types/raqm-ui-combobox.d.ts +405 -0
  138. package/types/raqm-ui-command.d.ts +256 -0
  139. package/types/raqm-ui-context-menu.d.ts +196 -0
  140. package/types/raqm-ui-dialog.d.ts +232 -0
  141. package/types/raqm-ui-drawer.d.ts +121 -0
  142. package/types/raqm-ui-dropdown-menu.d.ts +319 -0
  143. package/types/raqm-ui-empty.d.ts +35 -0
  144. package/types/raqm-ui-field.d.ts +88 -0
  145. package/types/raqm-ui-hover-card.d.ts +139 -0
  146. package/types/raqm-ui-input-group.d.ts +45 -0
  147. package/types/raqm-ui-input-otp.d.ts +197 -0
  148. package/types/raqm-ui-input.d.ts +16 -0
  149. package/types/raqm-ui-item.d.ts +71 -0
  150. package/types/raqm-ui-kbd.d.ts +12 -0
  151. package/types/raqm-ui-label.d.ts +6 -0
  152. package/types/raqm-ui-menubar.d.ts +159 -0
  153. package/types/raqm-ui-native-select.d.ts +23 -0
  154. package/types/raqm-ui-navigation-menu.d.ts +230 -0
  155. package/types/raqm-ui-overlay-internal.d.ts +5 -0
  156. package/types/raqm-ui-pagination.d.ts +84 -0
  157. package/types/raqm-ui-popover.d.ts +235 -0
  158. package/types/raqm-ui-progress.d.ts +79 -0
  159. package/types/raqm-ui-questionnaire.d.ts +217 -0
  160. package/types/raqm-ui-radio-group.d.ts +48 -0
  161. package/types/raqm-ui-resizable.d.ts +98 -0
  162. package/types/raqm-ui-scroll-area.d.ts +132 -0
  163. package/types/raqm-ui-select.d.ts +205 -0
  164. package/types/raqm-ui-separator.d.ts +21 -0
  165. package/types/raqm-ui-sheet.d.ts +79 -0
  166. package/types/raqm-ui-sidebar.d.ts +285 -0
  167. package/types/raqm-ui-skeleton.d.ts +6 -0
  168. package/types/raqm-ui-slider.d.ts +129 -0
  169. package/types/raqm-ui-spinner.d.ts +32 -0
  170. package/types/raqm-ui-switch.d.ts +32 -0
  171. package/types/raqm-ui-table.d.ts +36 -0
  172. package/types/raqm-ui-tabs.d.ts +154 -0
  173. package/types/raqm-ui-textarea.d.ts +6 -0
  174. package/types/raqm-ui-toast.d.ts +190 -0
  175. package/types/raqm-ui-toggle-group.d.ts +167 -0
  176. package/types/raqm-ui-toggle.d.ts +42 -0
  177. package/types/raqm-ui-tooltip.d.ts +207 -0
  178. package/types/raqm-ui.d.ts +50 -0
@@ -0,0 +1,1168 @@
1
+ import * as i0 from "@angular/core";
2
+ import { DestroyRef, Directive, ElementRef, InjectionToken, booleanAttribute, computed, effect, forwardRef, inject, input, isDevMode, model } from "@angular/core";
3
+ import * as i2 from "@angular/cdk/menu";
4
+ import { CDK_MENU, CdkContextMenuTrigger, CdkMenu, CdkMenuGroup, CdkMenuItem, CdkMenuItemCheckbox, CdkMenuItemRadio, CdkMenuItemSelectable, CdkMenuTrigger, MENU_STACK, MENU_TRIGGER, MenuStack, PARENT_OR_NEW_MENU_STACK_PROVIDER } from "@angular/cdk/menu";
5
+ import { Directionality } from "@angular/cdk/bidi";
6
+ import { FlexibleConnectedPositionStrategy } from "@angular/cdk/overlay";
7
+ import { Subject, Subscription } from "rxjs";
8
+ import { registerOverlayOwnership } from "@raqm/ui/overlay-internal";
9
+ var RaqmMenuDirection = class RaqmMenuDirection extends Directionality {
10
+ element = inject(ElementRef).nativeElement;
11
+ observer = null;
12
+ disposed = false;
13
+ get value() {
14
+ const view = this.element.ownerDocument.defaultView;
15
+ return view ? view.getComputedStyle(this.element).direction === "rtl" ? "rtl" : "ltr" : super.value;
16
+ }
17
+ constructor() {
18
+ super();
19
+ queueMicrotask(() => {
20
+ if (this.disposed) return;
21
+ const view = this.element.ownerDocument.defaultView;
22
+ if (!view) return;
23
+ const sync = () => {
24
+ const next = this.value;
25
+ if (next !== this.valueSignal()) {
26
+ this.valueSignal.set(next);
27
+ this.change.emit(next);
28
+ }
29
+ };
30
+ this.observer = new view.MutationObserver(sync);
31
+ for (let node = this.element; node; node = node.parentElement) this.observer.observe(node, {
32
+ attributes: true,
33
+ attributeFilter: [
34
+ "dir",
35
+ "class",
36
+ "style"
37
+ ]
38
+ });
39
+ sync();
40
+ });
41
+ }
42
+ ngOnDestroy() {
43
+ this.disposed = true;
44
+ this.observer?.disconnect();
45
+ super.ngOnDestroy();
46
+ }
47
+ static ɵfac = i0.ɵɵngDeclareFactory({
48
+ minVersion: "12.0.0",
49
+ version: "22.2.2",
50
+ ngImport: i0,
51
+ type: RaqmMenuDirection,
52
+ deps: [],
53
+ target: i0.ɵɵFactoryTarget.Directive
54
+ });
55
+ static ɵdir = i0.ɵɵngDeclareDirective({
56
+ minVersion: "14.0.0",
57
+ version: "22.2.2",
58
+ type: RaqmMenuDirection,
59
+ isStandalone: true,
60
+ providers: [{
61
+ provide: Directionality,
62
+ useExisting: forwardRef(() => RaqmMenuDirection)
63
+ }],
64
+ usesInheritance: true,
65
+ ngImport: i0
66
+ });
67
+ };
68
+ i0.ɵɵngDeclareClassMetadata({
69
+ minVersion: "12.0.0",
70
+ version: "22.2.2",
71
+ ngImport: i0,
72
+ type: RaqmMenuDirection,
73
+ decorators: [{
74
+ type: Directive,
75
+ args: [{ providers: [{
76
+ provide: Directionality,
77
+ useExisting: forwardRef(() => RaqmMenuDirection)
78
+ }] }]
79
+ }],
80
+ ctorParameters: () => []
81
+ });
82
+ var RaqmMenuTriggerBase = class RaqmMenuTriggerBase extends CdkMenuTrigger {
83
+ get menuOverlay() {
84
+ return this.overlayRef;
85
+ }
86
+ static ɵfac = i0.ɵɵngDeclareFactory({
87
+ minVersion: "12.0.0",
88
+ version: "22.2.2",
89
+ ngImport: i0,
90
+ type: RaqmMenuTriggerBase,
91
+ deps: null,
92
+ target: i0.ɵɵFactoryTarget.Directive
93
+ });
94
+ static ɵdir = i0.ɵɵngDeclareDirective({
95
+ minVersion: "14.0.0",
96
+ version: "22.2.2",
97
+ type: RaqmMenuTriggerBase,
98
+ isStandalone: true,
99
+ providers: [
100
+ {
101
+ provide: CdkMenuTrigger,
102
+ useExisting: forwardRef(() => RaqmMenuTriggerBase)
103
+ },
104
+ {
105
+ provide: MENU_TRIGGER,
106
+ useExisting: forwardRef(() => RaqmMenuTriggerBase)
107
+ },
108
+ PARENT_OR_NEW_MENU_STACK_PROVIDER
109
+ ],
110
+ usesInheritance: true,
111
+ ngImport: i0
112
+ });
113
+ };
114
+ i0.ɵɵngDeclareClassMetadata({
115
+ minVersion: "12.0.0",
116
+ version: "22.2.2",
117
+ ngImport: i0,
118
+ type: RaqmMenuTriggerBase,
119
+ decorators: [{
120
+ type: Directive,
121
+ args: [{ providers: [
122
+ {
123
+ provide: CdkMenuTrigger,
124
+ useExisting: forwardRef(() => RaqmMenuTriggerBase)
125
+ },
126
+ {
127
+ provide: MENU_TRIGGER,
128
+ useExisting: forwardRef(() => RaqmMenuTriggerBase)
129
+ },
130
+ PARENT_OR_NEW_MENU_STACK_PROVIDER
131
+ ] }]
132
+ }]
133
+ });
134
+ var RaqmContextMenuTriggerBase = class RaqmContextMenuTriggerBase extends CdkContextMenuTrigger {
135
+ geometryChanged = new Subject();
136
+ get menuOverlay() {
137
+ return this.overlayRef;
138
+ }
139
+ menuAnchorPoint = null;
140
+ open(coordinates) {
141
+ this.menuAnchorPoint = coordinates;
142
+ super.open(coordinates);
143
+ this.geometryChanged.next();
144
+ }
145
+ ngOnDestroy() {
146
+ this.geometryChanged.complete();
147
+ super.ngOnDestroy();
148
+ }
149
+ static ɵfac = i0.ɵɵngDeclareFactory({
150
+ minVersion: "12.0.0",
151
+ version: "22.2.2",
152
+ ngImport: i0,
153
+ type: RaqmContextMenuTriggerBase,
154
+ deps: null,
155
+ target: i0.ɵɵFactoryTarget.Directive
156
+ });
157
+ static ɵdir = i0.ɵɵngDeclareDirective({
158
+ minVersion: "14.0.0",
159
+ version: "22.2.2",
160
+ type: RaqmContextMenuTriggerBase,
161
+ isStandalone: true,
162
+ providers: [
163
+ {
164
+ provide: CdkContextMenuTrigger,
165
+ useExisting: forwardRef(() => RaqmContextMenuTriggerBase)
166
+ },
167
+ {
168
+ provide: MENU_TRIGGER,
169
+ useExisting: forwardRef(() => RaqmContextMenuTriggerBase)
170
+ },
171
+ {
172
+ provide: MENU_STACK,
173
+ useClass: MenuStack
174
+ }
175
+ ],
176
+ usesInheritance: true,
177
+ ngImport: i0
178
+ });
179
+ };
180
+ i0.ɵɵngDeclareClassMetadata({
181
+ minVersion: "12.0.0",
182
+ version: "22.2.2",
183
+ ngImport: i0,
184
+ type: RaqmContextMenuTriggerBase,
185
+ decorators: [{
186
+ type: Directive,
187
+ args: [{ providers: [
188
+ {
189
+ provide: CdkContextMenuTrigger,
190
+ useExisting: forwardRef(() => RaqmContextMenuTriggerBase)
191
+ },
192
+ {
193
+ provide: MENU_TRIGGER,
194
+ useExisting: forwardRef(() => RaqmContextMenuTriggerBase)
195
+ },
196
+ {
197
+ provide: MENU_STACK,
198
+ useClass: MenuStack
199
+ }
200
+ ] }]
201
+ }]
202
+ });
203
+ var RaqmMenuOverlaySync = class {
204
+ trigger;
205
+ anchor;
206
+ directionality;
207
+ options;
208
+ generation = 0;
209
+ disposed = false;
210
+ frame = 0;
211
+ overlay = null;
212
+ releaseOwnership;
213
+ resizeObserver = null;
214
+ connection;
215
+ subscriptions = new Subscription();
216
+ schedule = () => {
217
+ const view = this.anchor.ownerDocument.defaultView;
218
+ if (!view || !this.overlay || this.frame || this.disposed) return;
219
+ this.frame = view.requestAnimationFrame(() => {
220
+ this.frame = 0;
221
+ this.measure();
222
+ });
223
+ };
224
+ constructor(trigger, anchor, destroyRef, directionality, options) {
225
+ this.trigger = trigger;
226
+ this.anchor = anchor;
227
+ this.directionality = directionality;
228
+ this.options = options;
229
+ this.subscriptions.add(trigger.opened.subscribe(() => {
230
+ const generation = ++this.generation;
231
+ queueMicrotask(() => {
232
+ if (this.disposed || generation !== this.generation || !trigger.isOpen()) return;
233
+ this.detach();
234
+ this.overlay = trigger.menuOverlay;
235
+ if (!this.overlay) return;
236
+ this.releaseOwnership = registerOverlayOwnership(this.anchor, this.overlay);
237
+ this.observe();
238
+ this.measure();
239
+ });
240
+ }));
241
+ this.subscriptions.add(trigger.closed.subscribe(() => {
242
+ ++this.generation;
243
+ this.detach();
244
+ }));
245
+ this.subscriptions.add(directionality.change.subscribe(this.schedule));
246
+ if (trigger instanceof RaqmContextMenuTriggerBase) this.subscriptions.add(trigger.geometryChanged.subscribe(this.schedule));
247
+ destroyRef.onDestroy(() => {
248
+ this.disposed = true;
249
+ ++this.generation;
250
+ this.detach();
251
+ this.subscriptions.unsubscribe();
252
+ });
253
+ }
254
+ refresh() {
255
+ this.schedule();
256
+ }
257
+ measure() {
258
+ const overlay = this.overlay;
259
+ if (this.disposed || !overlay?.hasAttached()) return;
260
+ const strategy = overlay.getConfig().positionStrategy;
261
+ if (!(strategy instanceof FlexibleConnectedPositionStrategy)) return;
262
+ const pane = overlay.overlayElement;
263
+ const height = this.anchor.ownerDocument.documentElement.clientHeight;
264
+ overlay.setDirection(this.directionality.value);
265
+ const positions = this.options.positions?.() ?? strategy.positions;
266
+ strategy.withPositions(positions.map((position) => ({ ...position })));
267
+ if (this.options.matchAnchorWidth) {
268
+ pane.style.setProperty("--raqm-menu-anchor-width", `${this.anchor.getBoundingClientRect().width}px`);
269
+ pane.setAttribute("data-raqm-anchor-width", "");
270
+ }
271
+ pane.style.setProperty("--raqm-menu-available-height", `${Math.max(0, height - 10)}px`);
272
+ strategy.withViewportMargin(5).withFlexibleDimensions(false).withLockedPosition(false).withPush(true);
273
+ const selection = strategy.positionChanges.subscribe((event) => {
274
+ this.connection = event.connectionPair;
275
+ });
276
+ overlay.updatePosition();
277
+ selection.unsubscribe();
278
+ if (!this.connection) return;
279
+ const pair = this.connection;
280
+ const point = this.options.anchorPoint?.();
281
+ const rect = this.anchor.getBoundingClientRect();
282
+ const origin = point ? point.y : pair.originY === "top" ? rect.top : pair.originY === "bottom" ? rect.bottom : rect.top + rect.height / 2;
283
+ const edge = Math.max(5, Math.min(height - 5, origin + (pair.offsetY ?? 0)));
284
+ const available = pair.overlayY === "bottom" ? edge - 5 : pair.overlayY === "center" ? 2 * Math.min(edge - 5, height - 5 - edge) : height - 5 - edge;
285
+ pane.style.setProperty("--raqm-menu-available-height", `${Math.max(0, Math.min(height - 10, available))}px`);
286
+ strategy.reapplyLastPosition();
287
+ }
288
+ observe() {
289
+ const view = this.anchor.ownerDocument.defaultView;
290
+ view?.addEventListener("resize", this.schedule, { passive: true });
291
+ view?.document.addEventListener("scroll", this.schedule, {
292
+ capture: true,
293
+ passive: true
294
+ });
295
+ if (view && typeof view.ResizeObserver !== "undefined" && this.overlay) {
296
+ this.resizeObserver = new view.ResizeObserver(this.schedule);
297
+ this.resizeObserver.observe(this.overlay.overlayElement);
298
+ this.resizeObserver.observe(this.anchor);
299
+ }
300
+ }
301
+ detach() {
302
+ this.releaseOwnership?.();
303
+ this.releaseOwnership = void 0;
304
+ const view = this.anchor.ownerDocument.defaultView;
305
+ view?.removeEventListener("resize", this.schedule);
306
+ view?.document.removeEventListener("scroll", this.schedule, { capture: true });
307
+ if (this.frame) view?.cancelAnimationFrame(this.frame);
308
+ this.frame = 0;
309
+ this.resizeObserver?.disconnect();
310
+ this.resizeObserver = null;
311
+ this.overlay = null;
312
+ this.connection = void 0;
313
+ }
314
+ };
315
+ var RaqmMenuDirective = class RaqmMenuDirective {
316
+ static ɵfac = i0.ɵɵngDeclareFactory({
317
+ minVersion: "12.0.0",
318
+ version: "22.2.2",
319
+ ngImport: i0,
320
+ type: RaqmMenuDirective,
321
+ deps: [],
322
+ target: i0.ɵɵFactoryTarget.Directive
323
+ });
324
+ static ɵdir = i0.ɵɵngDeclareDirective({
325
+ minVersion: "14.0.0",
326
+ version: "22.2.2",
327
+ type: RaqmMenuDirective,
328
+ isStandalone: true,
329
+ selector: "[raqm-menu]",
330
+ host: { classAttribute: "raqm-menu" },
331
+ hostDirectives: [{ directive: RaqmMenuDirection }, { directive: i2.CdkMenu }],
332
+ ngImport: i0
333
+ });
334
+ };
335
+ i0.ɵɵngDeclareClassMetadata({
336
+ minVersion: "12.0.0",
337
+ version: "22.2.2",
338
+ ngImport: i0,
339
+ type: RaqmMenuDirective,
340
+ decorators: [{
341
+ type: Directive,
342
+ args: [{
343
+ selector: "[raqm-menu]",
344
+ hostDirectives: [RaqmMenuDirection, { directive: CdkMenu }],
345
+ host: { class: "raqm-menu" }
346
+ }]
347
+ }]
348
+ });
349
+ var RaqmMenuGroupDirective = class RaqmMenuGroupDirective {
350
+ static ɵfac = i0.ɵɵngDeclareFactory({
351
+ minVersion: "12.0.0",
352
+ version: "22.2.2",
353
+ ngImport: i0,
354
+ type: RaqmMenuGroupDirective,
355
+ deps: [],
356
+ target: i0.ɵɵFactoryTarget.Directive
357
+ });
358
+ static ɵdir = i0.ɵɵngDeclareDirective({
359
+ minVersion: "14.0.0",
360
+ version: "22.2.2",
361
+ type: RaqmMenuGroupDirective,
362
+ isStandalone: true,
363
+ selector: "[raqm-menu-group]",
364
+ host: {
365
+ attributes: { "role": "group" },
366
+ classAttribute: "raqm-menu-group"
367
+ },
368
+ ngImport: i0
369
+ });
370
+ };
371
+ i0.ɵɵngDeclareClassMetadata({
372
+ minVersion: "12.0.0",
373
+ version: "22.2.2",
374
+ ngImport: i0,
375
+ type: RaqmMenuGroupDirective,
376
+ decorators: [{
377
+ type: Directive,
378
+ args: [{
379
+ selector: "[raqm-menu-group]",
380
+ host: {
381
+ class: "raqm-menu-group",
382
+ role: "group"
383
+ }
384
+ }]
385
+ }]
386
+ });
387
+ var RaqmMenuLabelDirective = class RaqmMenuLabelDirective {
388
+ inset = input(false, {
389
+ ...ngDevMode ? { debugName: "inset" } : /* istanbul ignore next */ {},
390
+ transform: booleanAttribute
391
+ });
392
+ static ɵfac = i0.ɵɵngDeclareFactory({
393
+ minVersion: "12.0.0",
394
+ version: "22.2.2",
395
+ ngImport: i0,
396
+ type: RaqmMenuLabelDirective,
397
+ deps: [],
398
+ target: i0.ɵɵFactoryTarget.Directive
399
+ });
400
+ static ɵdir = i0.ɵɵngDeclareDirective({
401
+ minVersion: "17.1.0",
402
+ version: "22.2.2",
403
+ type: RaqmMenuLabelDirective,
404
+ isStandalone: true,
405
+ selector: "[raqm-menu-label]",
406
+ inputs: { inset: {
407
+ classPropertyName: "inset",
408
+ publicName: "inset",
409
+ isSignal: true,
410
+ isRequired: false,
411
+ transformFunction: null
412
+ } },
413
+ host: {
414
+ properties: { "attr.data-raqm-inset": "inset() ? \"\" : null" },
415
+ classAttribute: "raqm-menu-label"
416
+ },
417
+ ngImport: i0
418
+ });
419
+ };
420
+ i0.ɵɵngDeclareClassMetadata({
421
+ minVersion: "12.0.0",
422
+ version: "22.2.2",
423
+ ngImport: i0,
424
+ type: RaqmMenuLabelDirective,
425
+ decorators: [{
426
+ type: Directive,
427
+ args: [{
428
+ selector: "[raqm-menu-label]",
429
+ host: {
430
+ class: "raqm-menu-label",
431
+ "[attr.data-raqm-inset]": "inset() ? \"\" : null"
432
+ }
433
+ }]
434
+ }],
435
+ propDecorators: { inset: [{
436
+ type: i0.Input,
437
+ args: [{
438
+ isSignal: true,
439
+ alias: "inset",
440
+ required: false
441
+ }]
442
+ }] }
443
+ });
444
+ var RaqmMenuSeparatorDirective = class RaqmMenuSeparatorDirective {
445
+ static ɵfac = i0.ɵɵngDeclareFactory({
446
+ minVersion: "12.0.0",
447
+ version: "22.2.2",
448
+ ngImport: i0,
449
+ type: RaqmMenuSeparatorDirective,
450
+ deps: [],
451
+ target: i0.ɵɵFactoryTarget.Directive
452
+ });
453
+ static ɵdir = i0.ɵɵngDeclareDirective({
454
+ minVersion: "14.0.0",
455
+ version: "22.2.2",
456
+ type: RaqmMenuSeparatorDirective,
457
+ isStandalone: true,
458
+ selector: "[raqm-menu-separator]",
459
+ host: {
460
+ attributes: {
461
+ "role": "separator",
462
+ "aria-orientation": "horizontal"
463
+ },
464
+ classAttribute: "raqm-menu-separator"
465
+ },
466
+ ngImport: i0
467
+ });
468
+ };
469
+ i0.ɵɵngDeclareClassMetadata({
470
+ minVersion: "12.0.0",
471
+ version: "22.2.2",
472
+ ngImport: i0,
473
+ type: RaqmMenuSeparatorDirective,
474
+ decorators: [{
475
+ type: Directive,
476
+ args: [{
477
+ selector: "[raqm-menu-separator]",
478
+ host: {
479
+ class: "raqm-menu-separator",
480
+ role: "separator",
481
+ "aria-orientation": "horizontal"
482
+ }
483
+ }]
484
+ }]
485
+ });
486
+ var RaqmMenuShortcutDirective = class RaqmMenuShortcutDirective {
487
+ static ɵfac = i0.ɵɵngDeclareFactory({
488
+ minVersion: "12.0.0",
489
+ version: "22.2.2",
490
+ ngImport: i0,
491
+ type: RaqmMenuShortcutDirective,
492
+ deps: [],
493
+ target: i0.ɵɵFactoryTarget.Directive
494
+ });
495
+ static ɵdir = i0.ɵɵngDeclareDirective({
496
+ minVersion: "14.0.0",
497
+ version: "22.2.2",
498
+ type: RaqmMenuShortcutDirective,
499
+ isStandalone: true,
500
+ selector: "[raqm-menu-shortcut]",
501
+ host: { classAttribute: "raqm-menu-shortcut" },
502
+ ngImport: i0
503
+ });
504
+ };
505
+ i0.ɵɵngDeclareClassMetadata({
506
+ minVersion: "12.0.0",
507
+ version: "22.2.2",
508
+ ngImport: i0,
509
+ type: RaqmMenuShortcutDirective,
510
+ decorators: [{
511
+ type: Directive,
512
+ args: [{
513
+ selector: "[raqm-menu-shortcut]",
514
+ host: { class: "raqm-menu-shortcut" }
515
+ }]
516
+ }]
517
+ });
518
+ const ROOT_MENU_POSITIONS = [{
519
+ originX: "start",
520
+ originY: "bottom",
521
+ overlayX: "start",
522
+ overlayY: "top",
523
+ offsetY: 4
524
+ }, {
525
+ originX: "start",
526
+ originY: "top",
527
+ overlayX: "start",
528
+ overlayY: "bottom",
529
+ offsetY: -4
530
+ }];
531
+ const SUBMENU_ALIGN_OFFSET = -3;
532
+ const SUBMENU_POSITIONS = [{
533
+ originX: "end",
534
+ originY: "top",
535
+ overlayX: "start",
536
+ overlayY: "top",
537
+ offsetY: SUBMENU_ALIGN_OFFSET
538
+ }, {
539
+ originX: "start",
540
+ originY: "top",
541
+ overlayX: "end",
542
+ overlayY: "top",
543
+ offsetY: SUBMENU_ALIGN_OFFSET
544
+ }];
545
+ const RAQM_MENU_SUBMENU_POSITIONS = new InjectionToken("RAQM_MENU_SUBMENU_POSITIONS");
546
+ var RaqmMenuTriggerDirective = class RaqmMenuTriggerDirective {
547
+ trigger = inject(RaqmMenuTriggerBase);
548
+ parentMenu = inject(CDK_MENU, { optional: true });
549
+ submenu = this.parentMenu !== null;
550
+ element = inject(ElementRef);
551
+ directionality = inject(Directionality);
552
+ submenuPositionsDefault = inject(RAQM_MENU_SUBMENU_POSITIONS, { optional: true }) ?? SUBMENU_POSITIONS;
553
+ overlaySync = new RaqmMenuOverlaySync(this.trigger, this.element.nativeElement, inject(DestroyRef), this.directionality, { matchAnchorWidth: !this.submenu });
554
+ ngOnInit() {
555
+ if (this.trigger.menuPosition == null) this.trigger.menuPosition = this.submenu ? this.submenuPositionsDefault : ROOT_MENU_POSITIONS;
556
+ }
557
+ static ɵfac = i0.ɵɵngDeclareFactory({
558
+ minVersion: "12.0.0",
559
+ version: "22.2.2",
560
+ ngImport: i0,
561
+ type: RaqmMenuTriggerDirective,
562
+ deps: [],
563
+ target: i0.ɵɵFactoryTarget.Directive
564
+ });
565
+ static ɵdir = i0.ɵɵngDeclareDirective({
566
+ minVersion: "14.0.0",
567
+ version: "22.2.2",
568
+ type: RaqmMenuTriggerDirective,
569
+ isStandalone: true,
570
+ selector: "button[raqm-menu-trigger-for], a[raqm-menu-trigger-for]",
571
+ host: {
572
+ properties: { "attr.data-raqm-submenu": "submenu ? \"\" : null" },
573
+ classAttribute: "raqm-menu-trigger"
574
+ },
575
+ hostDirectives: [{ directive: RaqmMenuDirection }, {
576
+ directive: RaqmMenuTriggerBase,
577
+ inputs: [
578
+ "cdkMenuTriggerFor",
579
+ "raqm-menu-trigger-for",
580
+ "cdkMenuPosition",
581
+ "positions"
582
+ ],
583
+ outputs: [
584
+ "cdkMenuOpened",
585
+ "opened",
586
+ "cdkMenuClosed",
587
+ "closed"
588
+ ]
589
+ }],
590
+ ngImport: i0
591
+ });
592
+ };
593
+ i0.ɵɵngDeclareClassMetadata({
594
+ minVersion: "12.0.0",
595
+ version: "22.2.2",
596
+ ngImport: i0,
597
+ type: RaqmMenuTriggerDirective,
598
+ decorators: [{
599
+ type: Directive,
600
+ args: [{
601
+ selector: "button[raqm-menu-trigger-for], a[raqm-menu-trigger-for]",
602
+ hostDirectives: [RaqmMenuDirection, {
603
+ directive: RaqmMenuTriggerBase,
604
+ inputs: ["cdkMenuTriggerFor: raqm-menu-trigger-for", "cdkMenuPosition: positions"],
605
+ outputs: ["cdkMenuOpened: opened", "cdkMenuClosed: closed"]
606
+ }],
607
+ host: {
608
+ class: "raqm-menu-trigger",
609
+ "[attr.data-raqm-submenu]": "submenu ? \"\" : null"
610
+ }
611
+ }]
612
+ }]
613
+ });
614
+ const SPACE_KEY_CODE = 32;
615
+ var RaqmMenuItemDirective = class RaqmMenuItemDirective {
616
+ elementRef = inject(ElementRef);
617
+ destroyRef = inject(DestroyRef);
618
+ item = inject(CdkMenuItem);
619
+ appearance = input("", {
620
+ ...ngDevMode ? { debugName: "appearance" } : /* istanbul ignore next */ {},
621
+ alias: "raqm-menu-item"
622
+ });
623
+ activeAppearance = computed(() => this.appearance() || "default", ...ngDevMode ? [{ debugName: "activeAppearance" }] : /* istanbul ignore next */ []);
624
+ inset = input(false, {
625
+ ...ngDevMode ? { debugName: "inset" } : /* istanbul ignore next */ {},
626
+ transform: booleanAttribute
627
+ });
628
+ guardDisabledAnchor = (event) => {
629
+ if (!this.item.disabled) return;
630
+ event.preventDefault();
631
+ event.stopImmediatePropagation();
632
+ };
633
+ activateAnchorWithSpace = (event) => {
634
+ if (event.keyCode !== SPACE_KEY_CODE || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;
635
+ event.preventDefault();
636
+ event.stopImmediatePropagation();
637
+ if (event.repeat || this.item.disabled) return;
638
+ this.elementRef.nativeElement.click();
639
+ };
640
+ constructor() {
641
+ const element = this.elementRef.nativeElement;
642
+ if (element.nodeName !== "A") return;
643
+ element.addEventListener("click", this.guardDisabledAnchor, true);
644
+ element.addEventListener("auxclick", this.guardDisabledAnchor, true);
645
+ element.addEventListener("keydown", this.activateAnchorWithSpace, true);
646
+ this.destroyRef.onDestroy(() => {
647
+ element.removeEventListener("click", this.guardDisabledAnchor, true);
648
+ element.removeEventListener("auxclick", this.guardDisabledAnchor, true);
649
+ element.removeEventListener("keydown", this.activateAnchorWithSpace, true);
650
+ });
651
+ }
652
+ onPointerEnter(event) {
653
+ if (!(event instanceof PointerEvent) || event.pointerType === "touch" || this.item.disabled) return;
654
+ this.item.focus();
655
+ }
656
+ static ɵfac = i0.ɵɵngDeclareFactory({
657
+ minVersion: "12.0.0",
658
+ version: "22.2.2",
659
+ ngImport: i0,
660
+ type: RaqmMenuItemDirective,
661
+ deps: [],
662
+ target: i0.ɵɵFactoryTarget.Directive
663
+ });
664
+ static ɵdir = i0.ɵɵngDeclareDirective({
665
+ minVersion: "17.1.0",
666
+ version: "22.2.2",
667
+ type: RaqmMenuItemDirective,
668
+ isStandalone: true,
669
+ selector: "button[raqm-menu-item], a[raqm-menu-item]",
670
+ inputs: {
671
+ appearance: {
672
+ classPropertyName: "appearance",
673
+ publicName: "raqm-menu-item",
674
+ isSignal: true,
675
+ isRequired: false,
676
+ transformFunction: null
677
+ },
678
+ inset: {
679
+ classPropertyName: "inset",
680
+ publicName: "inset",
681
+ isSignal: true,
682
+ isRequired: false,
683
+ transformFunction: null
684
+ }
685
+ },
686
+ host: {
687
+ listeners: { "pointerenter": "onPointerEnter($event)" },
688
+ properties: {
689
+ "attr.data-raqm-variant": "activeAppearance()",
690
+ "attr.data-raqm-inset": "inset() ? \"\" : null"
691
+ },
692
+ classAttribute: "raqm-menu-item"
693
+ },
694
+ hostDirectives: [{
695
+ directive: i2.CdkMenuItem,
696
+ inputs: ["cdkMenuItemDisabled", "disabled"],
697
+ outputs: ["cdkMenuItemTriggered", "triggered"]
698
+ }],
699
+ ngImport: i0
700
+ });
701
+ };
702
+ i0.ɵɵngDeclareClassMetadata({
703
+ minVersion: "12.0.0",
704
+ version: "22.2.2",
705
+ ngImport: i0,
706
+ type: RaqmMenuItemDirective,
707
+ decorators: [{
708
+ type: Directive,
709
+ args: [{
710
+ selector: "button[raqm-menu-item], a[raqm-menu-item]",
711
+ hostDirectives: [{
712
+ directive: CdkMenuItem,
713
+ inputs: ["cdkMenuItemDisabled: disabled"],
714
+ outputs: ["cdkMenuItemTriggered: triggered"]
715
+ }],
716
+ host: {
717
+ class: "raqm-menu-item",
718
+ "[attr.data-raqm-variant]": "activeAppearance()",
719
+ "[attr.data-raqm-inset]": "inset() ? \"\" : null",
720
+ "(pointerenter)": "onPointerEnter($event)"
721
+ }
722
+ }]
723
+ }],
724
+ ctorParameters: () => [],
725
+ propDecorators: {
726
+ appearance: [{
727
+ type: i0.Input,
728
+ args: [{
729
+ isSignal: true,
730
+ alias: "raqm-menu-item",
731
+ required: false
732
+ }]
733
+ }],
734
+ inset: [{
735
+ type: i0.Input,
736
+ args: [{
737
+ isSignal: true,
738
+ alias: "inset",
739
+ required: false
740
+ }]
741
+ }]
742
+ }
743
+ });
744
+ var RaqmMenuCheckboxItemBase = class RaqmMenuCheckboxItemBase extends CdkMenuItemCheckbox {
745
+ trigger(options) {
746
+ super.trigger({
747
+ ...options,
748
+ keepOpen: true
749
+ });
750
+ }
751
+ static ɵfac = i0.ɵɵngDeclareFactory({
752
+ minVersion: "12.0.0",
753
+ version: "22.2.2",
754
+ ngImport: i0,
755
+ type: RaqmMenuCheckboxItemBase,
756
+ deps: null,
757
+ target: i0.ɵɵFactoryTarget.Directive
758
+ });
759
+ static ɵdir = i0.ɵɵngDeclareDirective({
760
+ minVersion: "14.0.0",
761
+ version: "22.2.2",
762
+ type: RaqmMenuCheckboxItemBase,
763
+ isStandalone: true,
764
+ providers: [{
765
+ provide: CdkMenuItemSelectable,
766
+ useExisting: RaqmMenuCheckboxItemBase
767
+ }, {
768
+ provide: CdkMenuItem,
769
+ useExisting: RaqmMenuCheckboxItemBase
770
+ }],
771
+ usesInheritance: true,
772
+ ngImport: i0
773
+ });
774
+ };
775
+ i0.ɵɵngDeclareClassMetadata({
776
+ minVersion: "12.0.0",
777
+ version: "22.2.2",
778
+ ngImport: i0,
779
+ type: RaqmMenuCheckboxItemBase,
780
+ decorators: [{
781
+ type: Directive,
782
+ args: [{ providers: [{
783
+ provide: CdkMenuItemSelectable,
784
+ useExisting: RaqmMenuCheckboxItemBase
785
+ }, {
786
+ provide: CdkMenuItem,
787
+ useExisting: RaqmMenuCheckboxItemBase
788
+ }] }]
789
+ }]
790
+ });
791
+ var RaqmMenuCheckboxItemDirective = class RaqmMenuCheckboxItemDirective {
792
+ checkbox = inject(RaqmMenuCheckboxItemBase);
793
+ element = inject(ElementRef);
794
+ inset = input(false, {
795
+ ...ngDevMode ? { debugName: "inset" } : /* istanbul ignore next */ {},
796
+ transform: booleanAttribute
797
+ });
798
+ checked = model(false, ...ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []);
799
+ triggerSubscription;
800
+ constructor() {
801
+ effect(() => {
802
+ const checked = this.checked();
803
+ this.checkbox.checked = checked;
804
+ this.element.nativeElement.setAttribute("aria-checked", String(checked));
805
+ });
806
+ this.triggerSubscription = this.checkbox.triggered.subscribe(() => {
807
+ this.checked.set(!this.checkbox.checked);
808
+ });
809
+ }
810
+ ngOnDestroy() {
811
+ this.triggerSubscription.unsubscribe();
812
+ }
813
+ onPointerEnter(event) {
814
+ if (!(event instanceof PointerEvent) || event.pointerType === "touch" || this.checkbox.disabled) return;
815
+ this.checkbox.focus();
816
+ }
817
+ static ɵfac = i0.ɵɵngDeclareFactory({
818
+ minVersion: "12.0.0",
819
+ version: "22.2.2",
820
+ ngImport: i0,
821
+ type: RaqmMenuCheckboxItemDirective,
822
+ deps: [],
823
+ target: i0.ɵɵFactoryTarget.Directive
824
+ });
825
+ static ɵdir = i0.ɵɵngDeclareDirective({
826
+ minVersion: "17.1.0",
827
+ version: "22.2.2",
828
+ type: RaqmMenuCheckboxItemDirective,
829
+ isStandalone: true,
830
+ selector: "button[raqm-menu-checkbox-item]",
831
+ inputs: {
832
+ inset: {
833
+ classPropertyName: "inset",
834
+ publicName: "inset",
835
+ isSignal: true,
836
+ isRequired: false,
837
+ transformFunction: null
838
+ },
839
+ checked: {
840
+ classPropertyName: "checked",
841
+ publicName: "checked",
842
+ isSignal: true,
843
+ isRequired: false,
844
+ transformFunction: null
845
+ }
846
+ },
847
+ outputs: { checked: "checkedChange" },
848
+ host: {
849
+ listeners: { "pointerenter": "onPointerEnter($event)" },
850
+ properties: { "attr.data-raqm-inset": "inset() ? \"\" : null" },
851
+ classAttribute: "raqm-menu-checkbox-item"
852
+ },
853
+ hostDirectives: [{
854
+ directive: RaqmMenuCheckboxItemBase,
855
+ inputs: ["cdkMenuItemDisabled", "disabled"]
856
+ }],
857
+ ngImport: i0
858
+ });
859
+ };
860
+ i0.ɵɵngDeclareClassMetadata({
861
+ minVersion: "12.0.0",
862
+ version: "22.2.2",
863
+ ngImport: i0,
864
+ type: RaqmMenuCheckboxItemDirective,
865
+ decorators: [{
866
+ type: Directive,
867
+ args: [{
868
+ selector: "button[raqm-menu-checkbox-item]",
869
+ hostDirectives: [{
870
+ directive: RaqmMenuCheckboxItemBase,
871
+ inputs: ["cdkMenuItemDisabled: disabled"]
872
+ }],
873
+ host: {
874
+ class: "raqm-menu-checkbox-item",
875
+ "[attr.data-raqm-inset]": "inset() ? \"\" : null",
876
+ "(pointerenter)": "onPointerEnter($event)"
877
+ }
878
+ }]
879
+ }],
880
+ ctorParameters: () => [],
881
+ propDecorators: {
882
+ inset: [{
883
+ type: i0.Input,
884
+ args: [{
885
+ isSignal: true,
886
+ alias: "inset",
887
+ required: false
888
+ }]
889
+ }],
890
+ checked: [{
891
+ type: i0.Input,
892
+ args: [{
893
+ isSignal: true,
894
+ alias: "checked",
895
+ required: false
896
+ }]
897
+ }, {
898
+ type: i0.Output,
899
+ args: ["checkedChange"]
900
+ }]
901
+ }
902
+ });
903
+ const RAQM_MENU_RADIO_GROUP = new InjectionToken("raqm-menu-radio-group");
904
+ var RaqmMenuRadioItemBase = class RaqmMenuRadioItemBase extends CdkMenuItemRadio {
905
+ trigger(options) {
906
+ super.trigger({
907
+ ...options,
908
+ keepOpen: true
909
+ });
910
+ }
911
+ static ɵfac = i0.ɵɵngDeclareFactory({
912
+ minVersion: "12.0.0",
913
+ version: "22.2.2",
914
+ ngImport: i0,
915
+ type: RaqmMenuRadioItemBase,
916
+ deps: null,
917
+ target: i0.ɵɵFactoryTarget.Directive
918
+ });
919
+ static ɵdir = i0.ɵɵngDeclareDirective({
920
+ minVersion: "14.0.0",
921
+ version: "22.2.2",
922
+ type: RaqmMenuRadioItemBase,
923
+ isStandalone: true,
924
+ providers: [{
925
+ provide: CdkMenuItemSelectable,
926
+ useExisting: RaqmMenuRadioItemBase
927
+ }, {
928
+ provide: CdkMenuItem,
929
+ useExisting: RaqmMenuRadioItemBase
930
+ }],
931
+ usesInheritance: true,
932
+ ngImport: i0
933
+ });
934
+ };
935
+ i0.ɵɵngDeclareClassMetadata({
936
+ minVersion: "12.0.0",
937
+ version: "22.2.2",
938
+ ngImport: i0,
939
+ type: RaqmMenuRadioItemBase,
940
+ decorators: [{
941
+ type: Directive,
942
+ args: [{ providers: [{
943
+ provide: CdkMenuItemSelectable,
944
+ useExisting: RaqmMenuRadioItemBase
945
+ }, {
946
+ provide: CdkMenuItem,
947
+ useExisting: RaqmMenuRadioItemBase
948
+ }] }]
949
+ }]
950
+ });
951
+ var RaqmMenuRadioGroupDirective = class RaqmMenuRadioGroupDirective {
952
+ value = model(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
953
+ registrations = /* @__PURE__ */ new Map();
954
+ isSelected(value) {
955
+ return this.value() === value;
956
+ }
957
+ select(value) {
958
+ this.value.set(value);
959
+ }
960
+ register(value) {
961
+ if (!value && isDevMode()) throw new Error("Raqm menu radio item: a non-empty `value` is required.");
962
+ const count = this.registrations.get(value) ?? 0;
963
+ if (count > 0 && isDevMode()) throw new Error(`Raqm menu radio group: duplicate radio item value "${value}". Each radio item inside one group needs a unique non-empty value.`);
964
+ this.registrations.set(value, count + 1);
965
+ }
966
+ unregister(value) {
967
+ const count = this.registrations.get(value) ?? 0;
968
+ if (count <= 1) this.registrations.delete(value);
969
+ else this.registrations.set(value, count - 1);
970
+ }
971
+ static ɵfac = i0.ɵɵngDeclareFactory({
972
+ minVersion: "12.0.0",
973
+ version: "22.2.2",
974
+ ngImport: i0,
975
+ type: RaqmMenuRadioGroupDirective,
976
+ deps: [],
977
+ target: i0.ɵɵFactoryTarget.Directive
978
+ });
979
+ static ɵdir = i0.ɵɵngDeclareDirective({
980
+ minVersion: "17.1.0",
981
+ version: "22.2.2",
982
+ type: RaqmMenuRadioGroupDirective,
983
+ isStandalone: true,
984
+ selector: "[raqm-menu-radio-group]",
985
+ inputs: { value: {
986
+ classPropertyName: "value",
987
+ publicName: "value",
988
+ isSignal: true,
989
+ isRequired: false,
990
+ transformFunction: null
991
+ } },
992
+ outputs: { value: "valueChange" },
993
+ providers: [{
994
+ provide: RAQM_MENU_RADIO_GROUP,
995
+ useExisting: RaqmMenuRadioGroupDirective
996
+ }],
997
+ hostDirectives: [{ directive: i2.CdkMenuGroup }],
998
+ ngImport: i0
999
+ });
1000
+ };
1001
+ i0.ɵɵngDeclareClassMetadata({
1002
+ minVersion: "12.0.0",
1003
+ version: "22.2.2",
1004
+ ngImport: i0,
1005
+ type: RaqmMenuRadioGroupDirective,
1006
+ decorators: [{
1007
+ type: Directive,
1008
+ args: [{
1009
+ selector: "[raqm-menu-radio-group]",
1010
+ hostDirectives: [{ directive: CdkMenuGroup }],
1011
+ providers: [{
1012
+ provide: RAQM_MENU_RADIO_GROUP,
1013
+ useExisting: RaqmMenuRadioGroupDirective
1014
+ }]
1015
+ }]
1016
+ }],
1017
+ propDecorators: { value: [{
1018
+ type: i0.Input,
1019
+ args: [{
1020
+ isSignal: true,
1021
+ alias: "value",
1022
+ required: false
1023
+ }]
1024
+ }, {
1025
+ type: i0.Output,
1026
+ args: ["valueChange"]
1027
+ }] }
1028
+ });
1029
+ var RaqmMenuRadioItemDirective = class RaqmMenuRadioItemDirective {
1030
+ radio = inject(RaqmMenuRadioItemBase);
1031
+ group;
1032
+ value = input.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
1033
+ inset = input(false, {
1034
+ ...ngDevMode ? { debugName: "inset" } : /* istanbul ignore next */ {},
1035
+ transform: booleanAttribute
1036
+ });
1037
+ triggerSubscription;
1038
+ registeredValue = null;
1039
+ constructor() {
1040
+ const group = inject(RAQM_MENU_RADIO_GROUP, { optional: true });
1041
+ if (!group) throw new Error("Raqm menu radio item: an enclosing [raqm-menu-radio-group] is required.");
1042
+ this.group = group;
1043
+ effect(() => {
1044
+ this.radio.checked = this.group.isSelected(this.value());
1045
+ });
1046
+ this.triggerSubscription = this.radio.triggered.subscribe(() => {
1047
+ if (!this.radio.disabled) this.group.select(this.value());
1048
+ });
1049
+ }
1050
+ ngOnInit() {
1051
+ this.updateRegistration(this.value());
1052
+ }
1053
+ ngOnChanges(changes) {
1054
+ if (changes["value"] && this.registeredValue !== null) this.updateRegistration(this.value());
1055
+ }
1056
+ updateRegistration(value) {
1057
+ if (value === this.registeredValue) return;
1058
+ this.group.register(value);
1059
+ const previousValue = this.registeredValue;
1060
+ this.registeredValue = value;
1061
+ if (previousValue !== null) this.group.unregister(previousValue);
1062
+ }
1063
+ ngOnDestroy() {
1064
+ if (this.registeredValue !== null) this.group.unregister(this.registeredValue);
1065
+ this.triggerSubscription.unsubscribe();
1066
+ }
1067
+ onPointerEnter(event) {
1068
+ if (!(event instanceof PointerEvent) || event.pointerType === "touch" || this.radio.disabled) return;
1069
+ this.radio.focus();
1070
+ }
1071
+ static ɵfac = i0.ɵɵngDeclareFactory({
1072
+ minVersion: "12.0.0",
1073
+ version: "22.2.2",
1074
+ ngImport: i0,
1075
+ type: RaqmMenuRadioItemDirective,
1076
+ deps: [],
1077
+ target: i0.ɵɵFactoryTarget.Directive
1078
+ });
1079
+ static ɵdir = i0.ɵɵngDeclareDirective({
1080
+ minVersion: "17.1.0",
1081
+ version: "22.2.2",
1082
+ type: RaqmMenuRadioItemDirective,
1083
+ isStandalone: true,
1084
+ selector: "button[raqm-menu-radio-item]",
1085
+ inputs: {
1086
+ value: {
1087
+ classPropertyName: "value",
1088
+ publicName: "value",
1089
+ isSignal: true,
1090
+ isRequired: true,
1091
+ transformFunction: null
1092
+ },
1093
+ inset: {
1094
+ classPropertyName: "inset",
1095
+ publicName: "inset",
1096
+ isSignal: true,
1097
+ isRequired: false,
1098
+ transformFunction: null
1099
+ }
1100
+ },
1101
+ host: {
1102
+ listeners: { "pointerenter": "onPointerEnter($event)" },
1103
+ properties: { "attr.data-raqm-inset": "inset() ? \"\" : null" },
1104
+ classAttribute: "raqm-menu-radio-item"
1105
+ },
1106
+ usesOnChanges: true,
1107
+ hostDirectives: [{
1108
+ directive: RaqmMenuRadioItemBase,
1109
+ inputs: ["cdkMenuItemDisabled", "disabled"]
1110
+ }],
1111
+ ngImport: i0
1112
+ });
1113
+ };
1114
+ i0.ɵɵngDeclareClassMetadata({
1115
+ minVersion: "12.0.0",
1116
+ version: "22.2.2",
1117
+ ngImport: i0,
1118
+ type: RaqmMenuRadioItemDirective,
1119
+ decorators: [{
1120
+ type: Directive,
1121
+ args: [{
1122
+ selector: "button[raqm-menu-radio-item]",
1123
+ hostDirectives: [{
1124
+ directive: RaqmMenuRadioItemBase,
1125
+ inputs: ["cdkMenuItemDisabled: disabled"]
1126
+ }],
1127
+ host: {
1128
+ class: "raqm-menu-radio-item",
1129
+ "[attr.data-raqm-inset]": "inset() ? \"\" : null",
1130
+ "(pointerenter)": "onPointerEnter($event)"
1131
+ }
1132
+ }]
1133
+ }],
1134
+ ctorParameters: () => [],
1135
+ propDecorators: {
1136
+ value: [{
1137
+ type: i0.Input,
1138
+ args: [{
1139
+ isSignal: true,
1140
+ alias: "value",
1141
+ required: true
1142
+ }]
1143
+ }],
1144
+ inset: [{
1145
+ type: i0.Input,
1146
+ args: [{
1147
+ isSignal: true,
1148
+ alias: "inset",
1149
+ required: false
1150
+ }]
1151
+ }]
1152
+ }
1153
+ });
1154
+ const RaqmDropdownMenu = [
1155
+ RaqmMenuDirective,
1156
+ RaqmMenuTriggerDirective,
1157
+ RaqmMenuItemDirective,
1158
+ RaqmMenuCheckboxItemDirective,
1159
+ RaqmMenuRadioGroupDirective,
1160
+ RaqmMenuRadioItemDirective,
1161
+ RaqmMenuGroupDirective,
1162
+ RaqmMenuLabelDirective,
1163
+ RaqmMenuSeparatorDirective,
1164
+ RaqmMenuShortcutDirective
1165
+ ];
1166
+ export { RAQM_MENU_SUBMENU_POSITIONS, RaqmContextMenuTriggerBase, RaqmDropdownMenu, RaqmMenuCheckboxItemBase, RaqmMenuCheckboxItemDirective, RaqmMenuDirection, RaqmMenuDirective, RaqmMenuGroupDirective, RaqmMenuItemDirective, RaqmMenuLabelDirective, RaqmMenuOverlaySync, RaqmMenuRadioGroupDirective, RaqmMenuRadioItemBase, RaqmMenuRadioItemDirective, RaqmMenuSeparatorDirective, RaqmMenuShortcutDirective, RaqmMenuTriggerBase, RaqmMenuTriggerDirective };
1167
+
1168
+ //# sourceMappingURL=raqm-ui-dropdown-menu.mjs.map