@nanahoshi/mona-ui 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 (134) hide show
  1. package/README.md +25 -0
  2. package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +590 -0
  3. package/fesm2022/nanahoshi-mona-ui-avatar.mjs +168 -0
  4. package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +220 -0
  5. package/fesm2022/nanahoshi-mona-ui-button-group.mjs +225 -0
  6. package/fesm2022/nanahoshi-mona-ui-button.mjs +497 -0
  7. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +1569 -0
  8. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +339 -0
  9. package/fesm2022/nanahoshi-mona-ui-chip.mjs +453 -0
  10. package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +200 -0
  11. package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +853 -0
  12. package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +923 -0
  13. package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +495 -0
  14. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +686 -0
  15. package/fesm2022/nanahoshi-mona-ui-common.mjs +642 -0
  16. package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +485 -0
  17. package/fesm2022/nanahoshi-mona-ui-date-input.mjs +132 -0
  18. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +460 -0
  19. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +659 -0
  20. package/fesm2022/nanahoshi-mona-ui-dialog.mjs +828 -0
  21. package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +523 -0
  22. package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +615 -0
  23. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +701 -0
  24. package/fesm2022/nanahoshi-mona-ui-editor.mjs +1400 -0
  25. package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +245 -0
  26. package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +170 -0
  27. package/fesm2022/nanahoshi-mona-ui-filter.mjs +680 -0
  28. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-cell.component-B9SQH5N-.mjs +105 -0
  29. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-DlLwcCFT.mjs +42 -0
  30. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-Dgea-O0X.mjs +130 -0
  31. package/fesm2022/nanahoshi-mona-ui-grid-grid-toggle.component-DIUutx9s.mjs +773 -0
  32. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DRHycGIh.mjs +240 -0
  33. package/fesm2022/nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-C3eZIaJK.mjs +5374 -0
  34. package/fesm2022/nanahoshi-mona-ui-grid.mjs +2 -0
  35. package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +87 -0
  36. package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +154 -0
  37. package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +1356 -0
  38. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +2263 -0
  39. package/fesm2022/nanahoshi-mona-ui-internal.mjs +379 -0
  40. package/fesm2022/nanahoshi-mona-ui-list-box.mjs +630 -0
  41. package/fesm2022/nanahoshi-mona-ui-list-view.mjs +527 -0
  42. package/fesm2022/nanahoshi-mona-ui-list.mjs +4 -0
  43. package/fesm2022/nanahoshi-mona-ui-menubar.mjs +966 -0
  44. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +641 -0
  45. package/fesm2022/nanahoshi-mona-ui-notification.mjs +536 -0
  46. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +597 -0
  47. package/fesm2022/nanahoshi-mona-ui-pager.mjs +790 -0
  48. package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +83 -0
  49. package/fesm2022/nanahoshi-mona-ui-popover.mjs +325 -0
  50. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +1559 -0
  51. package/fesm2022/nanahoshi-mona-ui-popup.mjs +1321 -0
  52. package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +294 -0
  53. package/fesm2022/nanahoshi-mona-ui-query.mjs +175 -0
  54. package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +339 -0
  55. package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +565 -0
  56. package/fesm2022/nanahoshi-mona-ui-slider.mjs +1049 -0
  57. package/fesm2022/nanahoshi-mona-ui-split-button.mjs +636 -0
  58. package/fesm2022/nanahoshi-mona-ui-splitter.mjs +843 -0
  59. package/fesm2022/nanahoshi-mona-ui-stepper.mjs +537 -0
  60. package/fesm2022/nanahoshi-mona-ui-switch.mjs +308 -0
  61. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +664 -0
  62. package/fesm2022/nanahoshi-mona-ui-text-area.mjs +111 -0
  63. package/fesm2022/nanahoshi-mona-ui-text-box.mjs +369 -0
  64. package/fesm2022/nanahoshi-mona-ui-theme.mjs +314 -0
  65. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +450 -0
  66. package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +723 -0
  67. package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +716 -0
  68. package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +733 -0
  69. package/fesm2022/nanahoshi-mona-ui-window.mjs +1329 -0
  70. package/fesm2022/nanahoshi-mona-ui.mjs +9 -0
  71. package/package.json +289 -0
  72. package/types/nanahoshi-mona-ui-auto-complete.d.ts +223 -0
  73. package/types/nanahoshi-mona-ui-avatar.d.ts +642 -0
  74. package/types/nanahoshi-mona-ui-breadcrumb.d.ts +70 -0
  75. package/types/nanahoshi-mona-ui-button-group.d.ts +77 -0
  76. package/types/nanahoshi-mona-ui-button.d.ts +111 -0
  77. package/types/nanahoshi-mona-ui-calendar.d.ts +262 -0
  78. package/types/nanahoshi-mona-ui-check-box.d.ts +133 -0
  79. package/types/nanahoshi-mona-ui-chip.d.ts +130 -0
  80. package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +113 -0
  81. package/types/nanahoshi-mona-ui-color-gradient.d.ts +201 -0
  82. package/types/nanahoshi-mona-ui-color-palette.d.ts +102 -0
  83. package/types/nanahoshi-mona-ui-color-picker.d.ts +156 -0
  84. package/types/nanahoshi-mona-ui-combo-box.d.ts +232 -0
  85. package/types/nanahoshi-mona-ui-common.d.ts +386 -0
  86. package/types/nanahoshi-mona-ui-contextmenu.d.ts +129 -0
  87. package/types/nanahoshi-mona-ui-date-input.d.ts +60 -0
  88. package/types/nanahoshi-mona-ui-date-picker.d.ts +177 -0
  89. package/types/nanahoshi-mona-ui-datetime-picker.d.ts +199 -0
  90. package/types/nanahoshi-mona-ui-dialog.d.ts +261 -0
  91. package/types/nanahoshi-mona-ui-dropdown-button.d.ts +159 -0
  92. package/types/nanahoshi-mona-ui-dropdown-list.d.ts +219 -0
  93. package/types/nanahoshi-mona-ui-dropdowns.d.ts +176 -0
  94. package/types/nanahoshi-mona-ui-editor.d.ts +113 -0
  95. package/types/nanahoshi-mona-ui-expansion-panel.d.ts +87 -0
  96. package/types/nanahoshi-mona-ui-fieldset.d.ts +68 -0
  97. package/types/nanahoshi-mona-ui-filter.d.ts +115 -0
  98. package/types/nanahoshi-mona-ui-grid.d.ts +1114 -0
  99. package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +25 -0
  100. package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +28 -0
  101. package/types/nanahoshi-mona-ui-internal-list.d.ts +269 -0
  102. package/types/nanahoshi-mona-ui-internal-tree.d.ts +391 -0
  103. package/types/nanahoshi-mona-ui-internal.d.ts +136 -0
  104. package/types/nanahoshi-mona-ui-list-box.d.ts +225 -0
  105. package/types/nanahoshi-mona-ui-list-view.d.ts +188 -0
  106. package/types/nanahoshi-mona-ui-list.d.ts +1 -0
  107. package/types/nanahoshi-mona-ui-menubar.d.ts +198 -0
  108. package/types/nanahoshi-mona-ui-multi-select.d.ts +247 -0
  109. package/types/nanahoshi-mona-ui-notification.d.ts +106 -0
  110. package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +161 -0
  111. package/types/nanahoshi-mona-ui-pager.d.ts +238 -0
  112. package/types/nanahoshi-mona-ui-placeholder.d.ts +35 -0
  113. package/types/nanahoshi-mona-ui-popover.d.ts +130 -0
  114. package/types/nanahoshi-mona-ui-popup-menu.d.ts +412 -0
  115. package/types/nanahoshi-mona-ui-popup.d.ts +485 -0
  116. package/types/nanahoshi-mona-ui-progress-bar.d.ts +139 -0
  117. package/types/nanahoshi-mona-ui-query.d.ts +89 -0
  118. package/types/nanahoshi-mona-ui-radio-button.d.ts +128 -0
  119. package/types/nanahoshi-mona-ui-scroll-view.d.ts +166 -0
  120. package/types/nanahoshi-mona-ui-slider.d.ts +305 -0
  121. package/types/nanahoshi-mona-ui-split-button.d.ts +182 -0
  122. package/types/nanahoshi-mona-ui-splitter.d.ts +70 -0
  123. package/types/nanahoshi-mona-ui-stepper.d.ts +173 -0
  124. package/types/nanahoshi-mona-ui-switch.d.ts +125 -0
  125. package/types/nanahoshi-mona-ui-tabs.d.ts +158 -0
  126. package/types/nanahoshi-mona-ui-text-area.d.ts +42 -0
  127. package/types/nanahoshi-mona-ui-text-box.d.ts +164 -0
  128. package/types/nanahoshi-mona-ui-theme.d.ts +23 -0
  129. package/types/nanahoshi-mona-ui-time-picker.d.ts +184 -0
  130. package/types/nanahoshi-mona-ui-time-selector.d.ts +143 -0
  131. package/types/nanahoshi-mona-ui-tooltip.d.ts +130 -0
  132. package/types/nanahoshi-mona-ui-tree-view.d.ts +274 -0
  133. package/types/nanahoshi-mona-ui-window.d.ts +295 -0
  134. package/types/nanahoshi-mona-ui.d.ts +2 -0
@@ -0,0 +1,485 @@
1
+ import { NgTemplateOutlet } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { forwardRef, Directive, inject, DestroyRef, signal, contentChildren, contentChild, TemplateRef, computed, viewChild, input, output, effect, afterNextRender, ElementRef, Component } from '@angular/core';
4
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
+ import { PopupMenuGroupTemplateDirective, PopupMenuTemplateOrigin, PopupMenuGroupTemplateToken, PopupMenuIconTemplateDirective, PopupMenuIconTemplateToken, PopupMenuShortcutTemplateDirective, PopupMenuShortcutTemplateToken, PopupMenuTextTemplateDirective, PopupMenuTextTemplateToken, PopupMenuItemType, PopupMenuTemplateType, ensurePopupComponentTypes, PopupMenuOrigin, ensurePopupTemplateTypes, PopupMenuToken, PopupMenuComponent, PopupMenuGroupComponent, PopupMenuCheckboxItemComponent, PopupMenuItemComponent, PopupMenuRadioGroupComponent, PopupMenuRadioItemComponent, PopupMenuRadioItemToken, PopupMenuSeparatorComponent } from '@nanahoshi/mona-ui/popup-menu';
6
+ import { createElementControlId } from '@nanahoshi/mona-ui/internal';
7
+ import { any } from '@mirei/ts-collections';
8
+ import { fromEvent } from 'rxjs';
9
+
10
+ class ContextMenuGroupTemplateDirective extends PopupMenuGroupTemplateDirective {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.origin = PopupMenuTemplateOrigin.ContextMenu;
14
+ }
15
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContextMenuGroupTemplateDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
16
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: ContextMenuGroupTemplateDirective, isStandalone: true, selector: "ng-template[monaContextMenuGroupTemplate]", providers: [
17
+ {
18
+ provide: PopupMenuGroupTemplateToken,
19
+ useExisting: forwardRef(() => ContextMenuGroupTemplateDirective)
20
+ }
21
+ ], usesInheritance: true, ngImport: i0 }); }
22
+ }
23
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContextMenuGroupTemplateDirective, decorators: [{
24
+ type: Directive,
25
+ args: [{
26
+ selector: "ng-template[monaContextMenuGroupTemplate]",
27
+ providers: [
28
+ {
29
+ provide: PopupMenuGroupTemplateToken,
30
+ useExisting: forwardRef(() => ContextMenuGroupTemplateDirective)
31
+ }
32
+ ]
33
+ }]
34
+ }] });
35
+
36
+ class ContextMenuIconTemplateDirective extends PopupMenuIconTemplateDirective {
37
+ constructor() {
38
+ super(...arguments);
39
+ this.origin = PopupMenuTemplateOrigin.ContextMenu;
40
+ }
41
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContextMenuIconTemplateDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
42
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: ContextMenuIconTemplateDirective, isStandalone: true, selector: "ng-template[monaContextMenuIconTemplate]", providers: [
43
+ {
44
+ provide: PopupMenuIconTemplateToken,
45
+ useExisting: forwardRef(() => ContextMenuIconTemplateDirective)
46
+ }
47
+ ], usesInheritance: true, ngImport: i0 }); }
48
+ }
49
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContextMenuIconTemplateDirective, decorators: [{
50
+ type: Directive,
51
+ args: [{
52
+ selector: "ng-template[monaContextMenuIconTemplate]",
53
+ providers: [
54
+ {
55
+ provide: PopupMenuIconTemplateToken,
56
+ useExisting: forwardRef(() => ContextMenuIconTemplateDirective)
57
+ }
58
+ ]
59
+ }]
60
+ }] });
61
+
62
+ class ContextMenuShortcutTemplateDirective extends PopupMenuShortcutTemplateDirective {
63
+ constructor() {
64
+ super(...arguments);
65
+ this.origin = PopupMenuTemplateOrigin.ContextMenu;
66
+ }
67
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContextMenuShortcutTemplateDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
68
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: ContextMenuShortcutTemplateDirective, isStandalone: true, selector: "ng-template[monaContextMenuShortcutTemplate]", providers: [
69
+ {
70
+ provide: PopupMenuShortcutTemplateToken,
71
+ useExisting: forwardRef(() => ContextMenuShortcutTemplateDirective)
72
+ }
73
+ ], usesInheritance: true, ngImport: i0 }); }
74
+ }
75
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContextMenuShortcutTemplateDirective, decorators: [{
76
+ type: Directive,
77
+ args: [{
78
+ selector: "ng-template[monaContextMenuShortcutTemplate]",
79
+ providers: [
80
+ {
81
+ provide: PopupMenuShortcutTemplateToken,
82
+ useExisting: forwardRef(() => ContextMenuShortcutTemplateDirective)
83
+ }
84
+ ]
85
+ }]
86
+ }] });
87
+
88
+ class ContextMenuTextTemplateDirective extends PopupMenuTextTemplateDirective {
89
+ constructor() {
90
+ super(...arguments);
91
+ this.origin = PopupMenuTemplateOrigin.ContextMenu;
92
+ }
93
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContextMenuTextTemplateDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
94
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: ContextMenuTextTemplateDirective, isStandalone: true, selector: "ng-template[monaContextMenuTextTemplate]", providers: [
95
+ {
96
+ provide: PopupMenuTextTemplateToken,
97
+ useExisting: forwardRef(() => ContextMenuTextTemplateDirective)
98
+ }
99
+ ], usesInheritance: true, ngImport: i0 }); }
100
+ }
101
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContextMenuTextTemplateDirective, decorators: [{
102
+ type: Directive,
103
+ args: [{
104
+ selector: "ng-template[monaContextMenuTextTemplate]",
105
+ providers: [
106
+ {
107
+ provide: PopupMenuTextTemplateToken,
108
+ useExisting: forwardRef(() => ContextMenuTextTemplateDirective)
109
+ }
110
+ ]
111
+ }]
112
+ }] });
113
+
114
+ const componentTypeMap = {
115
+ [PopupMenuItemType.CheckboxMenuItem]: "mona-contextmenu-checkbox-item",
116
+ [PopupMenuItemType.MenuGroup]: "mona-contextmenu-group",
117
+ [PopupMenuItemType.MenuItem]: "mona-contextmenu-item",
118
+ [PopupMenuItemType.RadioGroup]: "mona-contextmenu-radio-group",
119
+ [PopupMenuItemType.RadioItem]: "mona-contextmenu-radio-item",
120
+ [PopupMenuItemType.Separator]: "mona-contextmenu-separator"
121
+ };
122
+ const templateTypeMap = {
123
+ [PopupMenuTemplateType.Group]: "monaContextMenuGroupTemplate",
124
+ [PopupMenuTemplateType.Icon]: "monaContextMenuIconTemplate",
125
+ [PopupMenuTemplateType.Shortcut]: "monaContextMenuShortcutTemplate",
126
+ [PopupMenuTemplateType.Text]: "monaContextMenuTextTemplate"
127
+ };
128
+ const ensureContextMenuComponentTypes = (components) => {
129
+ ensurePopupComponentTypes({
130
+ components,
131
+ componentTypeMap,
132
+ origin: PopupMenuOrigin.ContextMenu,
133
+ prefix: "mona-contextmenu"
134
+ });
135
+ };
136
+ const ensureContextMenuTemplateTypes = (templates) => {
137
+ ensurePopupTemplateTypes({
138
+ templates,
139
+ templateTypeMap,
140
+ origin: PopupMenuTemplateOrigin.ContextMenu,
141
+ prefix: "mona-contextmenu"
142
+ });
143
+ };
144
+
145
+ class ContextMenuComponent {
146
+ #destroyRef;
147
+ #isMenuOpen;
148
+ constructor() {
149
+ this.#destroyRef = inject(DestroyRef);
150
+ this.#isMenuOpen = signal(false, /* @ts-ignore */
151
+ ...(ngDevMode ? [{ debugName: "#isMenuOpen" }] : /* istanbul ignore next */ []));
152
+ this.menuItemComponents = contentChildren(PopupMenuToken, { ...(ngDevMode ? { debugName: "menuItemComponents" } : /* istanbul ignore next */ {}), descendants: false });
153
+ this.groupTemplate = contentChild(ContextMenuGroupTemplateDirective, { ...(ngDevMode ? { debugName: "groupTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef,
154
+ descendants: false });
155
+ this.iconTemplate = contentChild(ContextMenuIconTemplateDirective, { ...(ngDevMode ? { debugName: "iconTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef,
156
+ descendants: false });
157
+ this.menuId = createElementControlId();
158
+ this.menuItems = computed(() => {
159
+ if (any(this.items())) {
160
+ return this.items();
161
+ }
162
+ return this.menuItemComponents()
163
+ .map(item => item.getPopupMenuItem())
164
+ .flatMap(i => i);
165
+ }, /* @ts-ignore */
166
+ ...(ngDevMode ? [{ debugName: "menuItems" }] : /* istanbul ignore next */ []));
167
+ this.popupMenuRef = viewChild("popupMenu", /* @ts-ignore */
168
+ ...(ngDevMode ? [{ debugName: "popupMenuRef" }] : /* istanbul ignore next */ []));
169
+ this.shortcutTemplate = contentChild(ContextMenuShortcutTemplateDirective, { ...(ngDevMode ? { debugName: "shortcutTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef,
170
+ descendants: false });
171
+ this.textTemplate = contentChild(ContextMenuTextTemplateDirective, { ...(ngDevMode ? { debugName: "textTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef,
172
+ descendants: false });
173
+ /**
174
+ * @description Reserved for an ARIA label on the context menu.
175
+ * Not currently applied to the target element or the rendered menu.
176
+ */
177
+ this.ariaLabel = input("", /* @ts-ignore */
178
+ ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
179
+ /**
180
+ * @description The menu items to render. When provided, these take precedence over
181
+ * content-projected `mona-contextmenu-item` (and related) components.
182
+ */
183
+ this.items = input([], /* @ts-ignore */
184
+ ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
185
+ /**
186
+ * @description Emits when a menu item is clicked.
187
+ */
188
+ this.menuClick = output();
189
+ /**
190
+ * @description Sets the minimum width of the context menu.
191
+ * This will be applied to the root menu and all submenus.
192
+ */
193
+ this.minWidth = input(/* @ts-ignore */
194
+ ...(ngDevMode ? [undefined, { debugName: "minWidth" }] : /* istanbul ignore next */ []));
195
+ /**
196
+ * @description Sets the rounded state of the context menu.
197
+ */
198
+ this.rounded = input("medium", /* @ts-ignore */
199
+ ...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
200
+ /**
201
+ * @description Sets the size of the context menu.
202
+ */
203
+ this.size = input("medium", /* @ts-ignore */
204
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
205
+ /**
206
+ * @description The target element that will be used to trigger the context menu.
207
+ */
208
+ this.target = input.required(/* @ts-ignore */
209
+ ...(ngDevMode ? [{ debugName: "target" }] : /* istanbul ignore next */ []));
210
+ /**
211
+ * @description Sets the width of the context menu.
212
+ * This will be applied to the root menu and all submenus.
213
+ */
214
+ this.width = input(/* @ts-ignore */
215
+ ...(ngDevMode ? [undefined, { debugName: "width" }] : /* istanbul ignore next */ []));
216
+ effect(() => ensureContextMenuComponentTypes(this.menuItemComponents()));
217
+ afterNextRender({
218
+ read: () => {
219
+ this.setTargetAriaAttributes();
220
+ this.setKeyboardEvents();
221
+ }
222
+ });
223
+ }
224
+ onMenuClose() {
225
+ this.#isMenuOpen.set(false);
226
+ this.updateTargetAriaAttributes();
227
+ }
228
+ onMenuOpen() {
229
+ this.#isMenuOpen.set(true);
230
+ this.updateTargetAriaAttributes();
231
+ }
232
+ openMenuViaKeyboard() {
233
+ const popupMenu = this.popupMenuRef();
234
+ if (popupMenu && !this.#isMenuOpen()) {
235
+ popupMenu.openMenuViaKeyboard(true);
236
+ }
237
+ }
238
+ setKeyboardEvents() {
239
+ const target = this.target();
240
+ const targetElement = target instanceof ElementRef ? target.nativeElement : target;
241
+ if (!targetElement) {
242
+ return;
243
+ }
244
+ fromEvent(targetElement, "keydown")
245
+ .pipe(takeUntilDestroyed(this.#destroyRef))
246
+ .subscribe(event => {
247
+ if (event.key === "ContextMenu" || (event.key === "F10" && event.shiftKey)) {
248
+ event.preventDefault();
249
+ this.openMenuViaKeyboard();
250
+ }
251
+ });
252
+ }
253
+ setTargetAriaAttributes() {
254
+ const target = this.target();
255
+ const targetElement = target instanceof ElementRef ? target.nativeElement : target;
256
+ if (!targetElement) {
257
+ return;
258
+ }
259
+ targetElement.setAttribute("aria-haspopup", "menu");
260
+ targetElement.setAttribute("aria-controls", this.menuId);
261
+ this.updateTargetAriaAttributes();
262
+ }
263
+ updateTargetAriaAttributes() {
264
+ const target = this.target();
265
+ const targetElement = target instanceof ElementRef ? target.nativeElement : target;
266
+ if (!targetElement) {
267
+ return;
268
+ }
269
+ targetElement.setAttribute("aria-expanded", this.#isMenuOpen().toString());
270
+ }
271
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContextMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
272
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: ContextMenuComponent, isStandalone: true, selector: "mona-contextmenu", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, minWidth: { classPropertyName: "minWidth", publicName: "minWidth", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: true, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { menuClick: "menuClick" }, queries: [{ propertyName: "menuItemComponents", predicate: PopupMenuToken, isSignal: true }, { propertyName: "groupTemplate", first: true, predicate: ContextMenuGroupTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "iconTemplate", first: true, predicate: ContextMenuIconTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "shortcutTemplate", first: true, predicate: ContextMenuShortcutTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "textTemplate", first: true, predicate: ContextMenuTextTemplateDirective, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "popupMenuRef", first: true, predicate: ["popupMenu"], descendants: true, isSignal: true }], ngImport: i0, template: "<mona-popup-menu\n [target]=\"target()\"\n [trigger]=\"'contextmenu'\"\n [items]=\"menuItems()\"\n [minWidth]=\"minWidth()\"\n [width]=\"width()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [precise]=\"true\"\n (menuClick)=\"menuClick.emit($event)\"\n (open)=\"onMenuOpen()\"\n (close)=\"onMenuClose()\"\n [id]=\"menuId\"\n #popupMenu>\n @if (groupTemplate()) {\n <ng-template monaPopupMenuGroupTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (iconTemplate()) {\n <ng-template monaPopupMenuIconTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"iconTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (shortcutTemplate()) {\n <ng-template monaPopupMenuShortcutTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"shortcutTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (textTemplate()) {\n <ng-template monaPopupMenuTextTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"textTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n</mona-popup-menu>\n", dependencies: [{ kind: "component", type: PopupMenuComponent, selector: "mona-popup-menu", inputs: ["anchor", "anchorConnectionPoint", "items", "id", "minWidth", "offset", "popupConnectionPoint", "precise", "rounded", "size", "target", "trigger", "width"], outputs: ["close", "menuClick", "navigate", "open"] }, { kind: "directive", type: PopupMenuTextTemplateDirective, selector: "ng-template[monaPopupMenuTextTemplate]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: PopupMenuIconTemplateDirective, selector: "ng-template[monaPopupMenuIconTemplate]" }, { kind: "directive", type: PopupMenuShortcutTemplateDirective, selector: "ng-template[monaPopupMenuShortcutTemplate]" }, { kind: "directive", type: PopupMenuGroupTemplateDirective, selector: "ng-template[monaPopupMenuGroupTemplate]" }] }); }
273
+ }
274
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContextMenuComponent, decorators: [{
275
+ type: Component,
276
+ args: [{ selector: "mona-contextmenu", imports: [
277
+ PopupMenuComponent,
278
+ PopupMenuTextTemplateDirective,
279
+ NgTemplateOutlet,
280
+ PopupMenuIconTemplateDirective,
281
+ PopupMenuShortcutTemplateDirective,
282
+ PopupMenuGroupTemplateDirective
283
+ ], template: "<mona-popup-menu\n [target]=\"target()\"\n [trigger]=\"'contextmenu'\"\n [items]=\"menuItems()\"\n [minWidth]=\"minWidth()\"\n [width]=\"width()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [precise]=\"true\"\n (menuClick)=\"menuClick.emit($event)\"\n (open)=\"onMenuOpen()\"\n (close)=\"onMenuClose()\"\n [id]=\"menuId\"\n #popupMenu>\n @if (groupTemplate()) {\n <ng-template monaPopupMenuGroupTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (iconTemplate()) {\n <ng-template monaPopupMenuIconTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"iconTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (shortcutTemplate()) {\n <ng-template monaPopupMenuShortcutTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"shortcutTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (textTemplate()) {\n <ng-template monaPopupMenuTextTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"textTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n</mona-popup-menu>\n" }]
284
+ }], ctorParameters: () => [], propDecorators: { menuItemComponents: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => PopupMenuToken), { ...{ descendants: false }, isSignal: true }] }], groupTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ContextMenuGroupTemplateDirective), { ...{
285
+ read: TemplateRef,
286
+ descendants: false
287
+ }, isSignal: true }] }], iconTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ContextMenuIconTemplateDirective), { ...{
288
+ read: TemplateRef,
289
+ descendants: false
290
+ }, isSignal: true }] }], popupMenuRef: [{ type: i0.ViewChild, args: ["popupMenu", { isSignal: true }] }], shortcutTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ContextMenuShortcutTemplateDirective), { ...{
291
+ read: TemplateRef,
292
+ descendants: false
293
+ }, isSignal: true }] }], textTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ContextMenuTextTemplateDirective), { ...{
294
+ read: TemplateRef,
295
+ descendants: false
296
+ }, isSignal: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], menuClick: [{ type: i0.Output, args: ["menuClick"] }], minWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "minWidth", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], target: [{ type: i0.Input, args: [{ isSignal: true, alias: "target", required: true }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }] } });
297
+
298
+ class ContextMenuGroupComponent extends PopupMenuGroupComponent {
299
+ constructor() {
300
+ super();
301
+ this.origin = PopupMenuOrigin.ContextMenu;
302
+ effect(() => ensureContextMenuComponentTypes(this.items()));
303
+ effect(() => ensureContextMenuTemplateTypes([this.groupTemplateConfig()].filter(t => t !== undefined)));
304
+ }
305
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContextMenuGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
306
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: ContextMenuGroupComponent, isStandalone: true, selector: "mona-contextmenu-group", providers: [
307
+ {
308
+ provide: PopupMenuToken,
309
+ useExisting: forwardRef(() => ContextMenuGroupComponent)
310
+ }
311
+ ], usesInheritance: true, ngImport: i0, template: "", isInline: true }); }
312
+ }
313
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContextMenuGroupComponent, decorators: [{
314
+ type: Component,
315
+ args: [{
316
+ selector: "mona-contextmenu-group",
317
+ template: "",
318
+ providers: [
319
+ {
320
+ provide: PopupMenuToken,
321
+ useExisting: forwardRef(() => ContextMenuGroupComponent)
322
+ }
323
+ ]
324
+ }]
325
+ }], ctorParameters: () => [] });
326
+
327
+ class ContextMenuCheckboxItemComponent extends PopupMenuCheckboxItemComponent {
328
+ constructor() {
329
+ super();
330
+ this.origin = PopupMenuOrigin.ContextMenu;
331
+ effect(() => ensureContextMenuTemplateTypes([this.shortcutTemplateConfig(), this.textTemplateConfig()].filter(t => t !== undefined)));
332
+ }
333
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContextMenuCheckboxItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
334
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: ContextMenuCheckboxItemComponent, isStandalone: true, selector: "mona-contextmenu-checkbox-item", providers: [
335
+ {
336
+ provide: PopupMenuToken,
337
+ useExisting: forwardRef(() => ContextMenuCheckboxItemComponent)
338
+ }
339
+ ], usesInheritance: true, ngImport: i0, template: "", isInline: true }); }
340
+ }
341
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContextMenuCheckboxItemComponent, decorators: [{
342
+ type: Component,
343
+ args: [{
344
+ selector: "mona-contextmenu-checkbox-item",
345
+ template: "",
346
+ providers: [
347
+ {
348
+ provide: PopupMenuToken,
349
+ useExisting: forwardRef(() => ContextMenuCheckboxItemComponent)
350
+ }
351
+ ]
352
+ }]
353
+ }], ctorParameters: () => [] });
354
+
355
+ class ContextMenuItemComponent extends PopupMenuItemComponent {
356
+ constructor() {
357
+ super();
358
+ this.origin = PopupMenuOrigin.ContextMenu;
359
+ effect(() => ensureContextMenuComponentTypes(this.items()));
360
+ effect(() => ensureContextMenuTemplateTypes([this.iconTemplateConfig(), this.shortcutTemplateConfig(), this.textTemplateConfig()].filter(t => t !== undefined)));
361
+ }
362
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContextMenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
363
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: ContextMenuItemComponent, isStandalone: true, selector: "mona-contextmenu-item", providers: [
364
+ {
365
+ provide: PopupMenuToken,
366
+ useExisting: forwardRef(() => ContextMenuItemComponent)
367
+ }
368
+ ], usesInheritance: true, ngImport: i0, template: ``, isInline: true }); }
369
+ }
370
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContextMenuItemComponent, decorators: [{
371
+ type: Component,
372
+ args: [{
373
+ selector: "mona-contextmenu-item",
374
+ template: ``,
375
+ providers: [
376
+ {
377
+ provide: PopupMenuToken,
378
+ useExisting: forwardRef(() => ContextMenuItemComponent)
379
+ }
380
+ ]
381
+ }]
382
+ }], ctorParameters: () => [] });
383
+
384
+ class ContextMenuRadioGroupComponent extends PopupMenuRadioGroupComponent {
385
+ constructor() {
386
+ super();
387
+ this.origin = PopupMenuOrigin.ContextMenu;
388
+ effect(() => ensureContextMenuComponentTypes(this.items()));
389
+ effect(() => ensureContextMenuTemplateTypes([this.groupTemplateConfig()].filter(t => t !== undefined)));
390
+ }
391
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContextMenuRadioGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
392
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: ContextMenuRadioGroupComponent, isStandalone: true, selector: "mona-contextmenu-radio-group", providers: [
393
+ {
394
+ provide: PopupMenuToken,
395
+ useExisting: forwardRef(() => ContextMenuRadioGroupComponent)
396
+ }
397
+ ], usesInheritance: true, ngImport: i0, template: "", isInline: true }); }
398
+ }
399
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContextMenuRadioGroupComponent, decorators: [{
400
+ type: Component,
401
+ args: [{
402
+ selector: "mona-contextmenu-radio-group",
403
+ template: "",
404
+ providers: [
405
+ {
406
+ provide: PopupMenuToken,
407
+ useExisting: forwardRef(() => ContextMenuRadioGroupComponent)
408
+ }
409
+ ]
410
+ }]
411
+ }], ctorParameters: () => [] });
412
+
413
+ class ContextMenuRadioItemComponent extends PopupMenuRadioItemComponent {
414
+ constructor() {
415
+ super();
416
+ this.origin = PopupMenuOrigin.ContextMenu;
417
+ effect(() => ensureContextMenuTemplateTypes([this.shortcutTemplateConfig(), this.textTemplateConfig()].filter(t => t !== undefined)));
418
+ }
419
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContextMenuRadioItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
420
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: ContextMenuRadioItemComponent, isStandalone: true, selector: "mona-contextmenu-radio-item", providers: [
421
+ {
422
+ provide: PopupMenuToken,
423
+ useExisting: forwardRef(() => ContextMenuRadioItemComponent)
424
+ },
425
+ {
426
+ provide: PopupMenuRadioItemToken,
427
+ useExisting: forwardRef(() => ContextMenuRadioItemComponent)
428
+ }
429
+ ], usesInheritance: true, ngImport: i0, template: "", isInline: true }); }
430
+ }
431
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContextMenuRadioItemComponent, decorators: [{
432
+ type: Component,
433
+ args: [{
434
+ selector: "mona-contextmenu-radio-item",
435
+ template: "",
436
+ providers: [
437
+ {
438
+ provide: PopupMenuToken,
439
+ useExisting: forwardRef(() => ContextMenuRadioItemComponent)
440
+ },
441
+ {
442
+ provide: PopupMenuRadioItemToken,
443
+ useExisting: forwardRef(() => ContextMenuRadioItemComponent)
444
+ }
445
+ ]
446
+ }]
447
+ }], ctorParameters: () => [] });
448
+
449
+ class ContextMenuSeparatorComponent extends PopupMenuSeparatorComponent {
450
+ constructor() {
451
+ super(...arguments);
452
+ this.origin = PopupMenuOrigin.ContextMenu;
453
+ }
454
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContextMenuSeparatorComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
455
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: ContextMenuSeparatorComponent, isStandalone: true, selector: "mona-contextmenu-separator", providers: [
456
+ {
457
+ provide: PopupMenuToken,
458
+ useExisting: forwardRef(() => ContextMenuSeparatorComponent)
459
+ }
460
+ ], usesInheritance: true, ngImport: i0, template: "", isInline: true }); }
461
+ }
462
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContextMenuSeparatorComponent, decorators: [{
463
+ type: Component,
464
+ args: [{
465
+ selector: "mona-contextmenu-separator",
466
+ template: "",
467
+ providers: [
468
+ {
469
+ provide: PopupMenuToken,
470
+ useExisting: forwardRef(() => ContextMenuSeparatorComponent)
471
+ }
472
+ ]
473
+ }]
474
+ }] });
475
+
476
+ /*
477
+ * Public API Surface of @nanahoshi/mona-ui/contextmenu
478
+ */
479
+
480
+ /**
481
+ * Generated bundle index. Do not edit.
482
+ */
483
+
484
+ export { ContextMenuCheckboxItemComponent, ContextMenuComponent, ContextMenuGroupComponent, ContextMenuGroupTemplateDirective, ContextMenuIconTemplateDirective, ContextMenuItemComponent, ContextMenuRadioGroupComponent, ContextMenuRadioItemComponent, ContextMenuSeparatorComponent, ContextMenuShortcutTemplateDirective, ContextMenuTextTemplateDirective };
485
+ //# sourceMappingURL=nanahoshi-mona-ui-contextmenu.mjs.map
@@ -0,0 +1,132 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Directive, Pipe, Injectable } from '@angular/core';
3
+ import { toImmutableSet, where, select, sequence } from '@mirei/ts-collections';
4
+ import { cva } from 'class-variance-authority';
5
+ import { Subject } from 'rxjs';
6
+
7
+ class DateInputPrefixTemplateDirective {
8
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DateInputPrefixTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
9
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: DateInputPrefixTemplateDirective, isStandalone: true, selector: "ng-template[monaDateInputPrefixTemplate]", ngImport: i0 }); }
10
+ }
11
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DateInputPrefixTemplateDirective, decorators: [{
12
+ type: Directive,
13
+ args: [{
14
+ selector: "ng-template[monaDateInputPrefixTemplate]"
15
+ }]
16
+ }] });
17
+
18
+ class TimeLimiterPipe {
19
+ transform(timeValues, type, currentDate, min, max) {
20
+ if (!min && !max) {
21
+ return toImmutableSet(timeValues);
22
+ }
23
+ const normalizedMin = min
24
+ ? min.set({ year: currentDate.year, month: currentDate.month, day: currentDate.day })
25
+ : null;
26
+ const normalizedMax = max
27
+ ? max.set({ year: currentDate.year, month: currentDate.month, day: currentDate.day })
28
+ : null;
29
+ const unitMap = { h: "hour", m: "minute", s: "second" };
30
+ const luxonUnit = unitMap[type];
31
+ const result = where(timeValues, timeUnit => {
32
+ const testDate = currentDate.set({ [luxonUnit]: timeUnit.value });
33
+ const isAfterMin = normalizedMin ? testDate >= normalizedMin.startOf(luxonUnit) : true;
34
+ const isBeforeMax = normalizedMax ? testDate <= normalizedMax.endOf(luxonUnit) : true;
35
+ return isAfterMin && isBeforeMax;
36
+ });
37
+ return result.toImmutableSet();
38
+ }
39
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TimeLimiterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
40
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.0.6", ngImport: i0, type: TimeLimiterPipe, isStandalone: true, name: "timeLimiter" }); }
41
+ }
42
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TimeLimiterPipe, decorators: [{
43
+ type: Pipe,
44
+ args: [{
45
+ name: "timeLimiter"
46
+ }]
47
+ }] });
48
+
49
+ const datePopupVariants = cva(`
50
+ bg-background shadow-md
51
+ border border-input-border
52
+ h-full overflow-auto
53
+ [&_mona-calendar]:border-none
54
+ [&_mona-calendar]:shadow-none
55
+ `, {
56
+ variants: {
57
+ rounded: {
58
+ none: "rounded-none",
59
+ small: "rounded-sm",
60
+ medium: "rounded-md",
61
+ large: "rounded-lg",
62
+ full: "rounded-lg"
63
+ },
64
+ size: {
65
+ large: "text-lg",
66
+ medium: "text-md",
67
+ small: "text-sm"
68
+ }
69
+ },
70
+ defaultVariants: {
71
+ rounded: "medium",
72
+ size: "medium"
73
+ }
74
+ });
75
+
76
+ const datePopupThemeVariants = (theme) => {
77
+ switch (theme) {
78
+ case "mona":
79
+ return datePopupVariants;
80
+ default:
81
+ return datePopupVariants;
82
+ }
83
+ };
84
+
85
+ class CalendarService {
86
+ constructor() {
87
+ this.keydown$ = new Subject();
88
+ }
89
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CalendarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
90
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CalendarService }); }
91
+ }
92
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CalendarService, decorators: [{
93
+ type: Injectable
94
+ }] });
95
+
96
+ class TimeSelectorService {
97
+ constructor() {
98
+ this.keydown$ = new Subject();
99
+ }
100
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TimeSelectorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
101
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TimeSelectorService }); }
102
+ }
103
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TimeSelectorService, decorators: [{
104
+ type: Injectable
105
+ }] });
106
+
107
+ const generateHourSet = (hourFormat, meridiem, step = 1) => {
108
+ if (hourFormat === "24") {
109
+ return select(sequence(0, 23, step), h => ({ value: h, viewValue: h })).toImmutableSet();
110
+ }
111
+ if (meridiem === "AM") {
112
+ return select(sequence(1, 11, step), h => ({ value: h, viewValue: h }))
113
+ .prepend({ value: 0, viewValue: 12 })
114
+ .toImmutableSet();
115
+ }
116
+ return select(sequence(1, 11, step), h => ({ value: h + 12, viewValue: h }))
117
+ .prepend({ value: 12, viewValue: 12 })
118
+ .toImmutableSet();
119
+ };
120
+ const generateMinuteSet = (step = 1) => {
121
+ return select(sequence(0, 59, step), m => ({ value: m, viewValue: m })).toImmutableSet();
122
+ };
123
+ const generateSecondSet = (step = 1) => {
124
+ return select(sequence(0, 59, step), s => ({ value: s, viewValue: s })).toImmutableSet();
125
+ };
126
+
127
+ /**
128
+ * Generated bundle index. Do not edit.
129
+ */
130
+
131
+ export { CalendarService, DateInputPrefixTemplateDirective, TimeLimiterPipe, TimeSelectorService, datePopupThemeVariants, generateHourSet, generateMinuteSet, generateSecondSet };
132
+ //# sourceMappingURL=nanahoshi-mona-ui-date-input.mjs.map