@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,641 @@
1
+ import { NgTemplateOutlet } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { Directive, signal, Injectable, inject, DestroyRef, ElementRef, computed, contentChild, TemplateRef, viewChild, input, output, model, afterNextRender, effect, untracked, forwardRef, Component } from '@angular/core';
4
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
+ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
6
+ import { ChipComponent } from '@nanahoshi/mona-ui/chip';
7
+ import * as i1 from '@nanahoshi/mona-ui/dropdowns';
8
+ import { DropdownService, DropdownFooterTemplateDirective, DropdownGroupHeaderTemplateDirective, DropdownHeaderTemplateDirective, DropdownItemTemplateDirective, dropdownPopupThemeVariants, DropdownNoDataTemplateDirective, DropdownPrefixTemplateDirective, DropdownLiveRegionDirective, DropdownDataInputToken, DropdownPopupInputToken, DropdownDataHandlerDirective, DropdownListPopupHandlerDirective } from '@nanahoshi/mona-ui/dropdowns';
9
+ import { createElementControlId, restoreOverlayScroll, rxFromResize } from '@nanahoshi/mona-ui/internal';
10
+ import { IndicatorIconComponent } from '@nanahoshi/mona-ui/internal/indicator-icon';
11
+ import { ListService, ListComponent, ListGroupHeaderTemplateDirective, ListItemTemplateDirective, ListFooterTemplateDirective, ListHeaderTemplateDirective, ListNoDataTemplateDirective } from '@nanahoshi/mona-ui/internal/list';
12
+ import { ThemeService } from '@nanahoshi/mona-ui/theme';
13
+ import { none } from '@mirei/ts-collections';
14
+ import { filter, tap } from 'rxjs';
15
+ import { twMerge } from 'tailwind-merge';
16
+ import { cva } from 'class-variance-authority';
17
+
18
+ class MultiSelectTagTemplateDirective {
19
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MultiSelectTagTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
20
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: MultiSelectTagTemplateDirective, isStandalone: true, selector: "ng-template[monaMultiSelectTagTemplate]", ngImport: i0 }); }
21
+ }
22
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MultiSelectTagTemplateDirective, decorators: [{
23
+ type: Directive,
24
+ args: [{
25
+ selector: "ng-template[monaMultiSelectTagTemplate]"
26
+ }]
27
+ }] });
28
+
29
+ class MultiSelectService {
30
+ constructor() {
31
+ this.summaryTagTemplate = signal(null, /* @ts-ignore */
32
+ ...(ngDevMode ? [{ debugName: "summaryTagTemplate" }] : /* istanbul ignore next */ []));
33
+ this.tagCount = signal(-1, /* @ts-ignore */
34
+ ...(ngDevMode ? [{ debugName: "tagCount" }] : /* istanbul ignore next */ []));
35
+ }
36
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MultiSelectService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
37
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MultiSelectService }); }
38
+ }
39
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MultiSelectService, decorators: [{
40
+ type: Injectable
41
+ }] });
42
+
43
+ const multiSelectBaseVariants = cva(`
44
+ flex items-center justify-between
45
+ border border-input-border outline-none
46
+ bg-background shadow-xs
47
+ cursor-pointer
48
+ focus-within:ring-1 focus-within:ring-primary/40
49
+ transition-[color,box-shadow,border] ease-in-out duration-300
50
+ `, {
51
+ variants: {
52
+ disabled: {
53
+ true: "pointer-events-none opacity-50 cursor-not-allowed"
54
+ },
55
+ focused: {
56
+ true: "ring-1 ring-primary/40"
57
+ },
58
+ invalid: {
59
+ true: "border-error ring-1 ring-error/40",
60
+ false: ""
61
+ },
62
+ rounded: {
63
+ none: "rounded-none",
64
+ small: "rounded-sm",
65
+ medium: "rounded-md",
66
+ large: "rounded-lg",
67
+ full: "rounded-full"
68
+ },
69
+ size: {
70
+ small: "min-h-8 text-xs",
71
+ medium: "min-h-9 text-sm",
72
+ large: "min-h-10 text-md"
73
+ }
74
+ }
75
+ });
76
+ const multiSelectItemContainerVariants = cva(`
77
+ flex flex-1 items-center gap-1 flex-wrap p-1
78
+ `, {
79
+ variants: {
80
+ rounded: {
81
+ none: "rounded-none",
82
+ small: "rounded-sm",
83
+ medium: "rounded-md",
84
+ large: "rounded-lg",
85
+ full: "rounded-full"
86
+ }
87
+ }
88
+ });
89
+ const multiSelectAffixContainerVariants = cva(`h-full flex flex-none items-center justify-center`);
90
+ const multiSelectIndicatorContainerVariants = cva(`self-center`, {
91
+ variants: {
92
+ size: {
93
+ small: "h-8",
94
+ medium: "h-9",
95
+ large: "h-10"
96
+ }
97
+ }
98
+ });
99
+
100
+ const multiSelectBaseThemeVariants = (theme) => {
101
+ switch (theme) {
102
+ case "mona":
103
+ return multiSelectBaseVariants;
104
+ default:
105
+ return multiSelectBaseVariants;
106
+ }
107
+ };
108
+ const multiSelectItemContainerThemeVariants = (theme) => {
109
+ switch (theme) {
110
+ case "mona":
111
+ return multiSelectItemContainerVariants;
112
+ default:
113
+ return multiSelectItemContainerVariants;
114
+ }
115
+ };
116
+ const multiSelectAffixContainerThemeVariants = (theme) => {
117
+ switch (theme) {
118
+ case "mona":
119
+ return multiSelectAffixContainerVariants;
120
+ default:
121
+ return multiSelectAffixContainerVariants;
122
+ }
123
+ };
124
+ const multiSelectIndicatorContainerThemeVariants = (theme) => {
125
+ switch (theme) {
126
+ case "mona":
127
+ return multiSelectIndicatorContainerVariants;
128
+ default:
129
+ return multiSelectIndicatorContainerVariants;
130
+ }
131
+ };
132
+
133
+ class MultiSelectComponent {
134
+ #destroyRef;
135
+ #dropdownService;
136
+ #hostElementRef;
137
+ #listService;
138
+ #multiSelectService;
139
+ #popupRef;
140
+ #themeService;
141
+ constructor() {
142
+ this.#destroyRef = inject(DestroyRef);
143
+ this.#dropdownService = inject(DropdownService);
144
+ this.#hostElementRef = inject(ElementRef);
145
+ this.#listService = inject((ListService));
146
+ this.#multiSelectService = inject(MultiSelectService);
147
+ this.#popupRef = this.#dropdownService.popupRef;
148
+ this.#themeService = inject(ThemeService);
149
+ this.activeDescendant = computed(() => {
150
+ const highlightedItem = this.#listService.highlightedItem();
151
+ return highlightedItem ? highlightedItem.uid : null;
152
+ }, /* @ts-ignore */
153
+ ...(ngDevMode ? [{ debugName: "activeDescendant" }] : /* istanbul ignore next */ []));
154
+ this.affixClass = computed(() => {
155
+ const theme = this.#themeService.theme();
156
+ return multiSelectAffixContainerThemeVariants(theme)();
157
+ }, /* @ts-ignore */
158
+ ...(ngDevMode ? [{ debugName: "affixClass" }] : /* istanbul ignore next */ []));
159
+ this.baseClass = computed(() => {
160
+ const theme = this.#themeService.theme();
161
+ const disabled = this.disabled();
162
+ const focused = this.#popupRef() != null;
163
+ const invalid = this.invalidState();
164
+ const rounded = this.rounded();
165
+ const size = this.size();
166
+ const variantClass = multiSelectBaseThemeVariants(theme)({ disabled, focused, invalid, rounded, size });
167
+ const userClass = this.userClass();
168
+ return twMerge(variantClass, userClass);
169
+ }, /* @ts-ignore */
170
+ ...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
171
+ this.expanded = computed(() => this.#dropdownService.popupRef() !== null, /* @ts-ignore */
172
+ ...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
173
+ this.footerTemplate = contentChild(DropdownFooterTemplateDirective, { ...(ngDevMode ? { debugName: "footerTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
174
+ this.groupHeaderTemplate = contentChild(DropdownGroupHeaderTemplateDirective, { ...(ngDevMode ? { debugName: "groupHeaderTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
175
+ this.headerTemplate = contentChild(DropdownHeaderTemplateDirective, { ...(ngDevMode ? { debugName: "headerTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
176
+ this.invalidState = computed(() => this.invalid() || (this.required() && this.touched() && none(this.value())), /* @ts-ignore */
177
+ ...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
178
+ this.indicatorClass = computed(() => {
179
+ const theme = this.#themeService.theme();
180
+ const size = this.size();
181
+ return multiSelectIndicatorContainerThemeVariants(theme)({ size });
182
+ }, /* @ts-ignore */
183
+ ...(ngDevMode ? [{ debugName: "indicatorClass" }] : /* istanbul ignore next */ []));
184
+ this.itemContainerClass = computed(() => {
185
+ const theme = this.#themeService.theme();
186
+ const rounded = this.rounded();
187
+ return multiSelectItemContainerThemeVariants(theme)({ rounded });
188
+ }, /* @ts-ignore */
189
+ ...(ngDevMode ? [{ debugName: "itemContainerClass" }] : /* istanbul ignore next */ []));
190
+ this.itemTemplate = contentChild(DropdownItemTemplateDirective, { ...(ngDevMode ? { debugName: "itemTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
191
+ this.listId = createElementControlId();
192
+ this.listPopupClass = computed(() => {
193
+ const theme = this.#themeService.theme();
194
+ const rounded = this.rounded();
195
+ const size = this.size();
196
+ const userClass = this.popupClass();
197
+ const variantClass = dropdownPopupThemeVariants(theme)({ rounded, size });
198
+ return twMerge(variantClass, userClass);
199
+ }, /* @ts-ignore */
200
+ ...(ngDevMode ? [{ debugName: "listPopupClass" }] : /* istanbul ignore next */ []));
201
+ this.noDataTemplate = contentChild(DropdownNoDataTemplateDirective, { ...(ngDevMode ? { debugName: "noDataTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
202
+ this.popupTemplate = viewChild.required("popupTemplate", /* @ts-ignore */
203
+ ...(ngDevMode ? [{ debugName: "popupTemplate" }] : /* istanbul ignore next */ []));
204
+ this.prefixTemplate = contentChild(DropdownPrefixTemplateDirective, { ...(ngDevMode ? { debugName: "prefixTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
205
+ this.summaryTagTemplate = this.#multiSelectService.summaryTagTemplate.asReadonly();
206
+ this.tagCount = this.#multiSelectService.tagCount.asReadonly();
207
+ this.tagTemplate = contentChild(MultiSelectTagTemplateDirective, { ...(ngDevMode ? { debugName: "tagTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
208
+ this.selectedDataItems = computed(() => {
209
+ return this.selectedListItems()
210
+ .select(i => i.data)
211
+ .toImmutableSet();
212
+ }, /* @ts-ignore */
213
+ ...(ngDevMode ? [{ debugName: "selectedDataItems" }] : /* istanbul ignore next */ []));
214
+ this.selectedListItems = computed(() => {
215
+ return this.#listService.selectedListItems();
216
+ }, /* @ts-ignore */
217
+ ...(ngDevMode ? [{ debugName: "selectedListItems" }] : /* istanbul ignore next */ []));
218
+ this.valueTextMap = computed(() => {
219
+ const tagCount = this.visibleTagCount();
220
+ return this.selectedListItems()
221
+ .take(tagCount)
222
+ .toImmutableDictionary(i => i, i => this.#listService.getItemText(i));
223
+ }, /* @ts-ignore */
224
+ ...(ngDevMode ? [{ debugName: "valueTextMap" }] : /* istanbul ignore next */ []));
225
+ this.visibleTagCount = computed(() => {
226
+ const tagCount = this.tagCount();
227
+ const itemCount = this.selectedListItems().size();
228
+ if (tagCount < 0) {
229
+ return itemCount;
230
+ }
231
+ return tagCount;
232
+ }, /* @ts-ignore */
233
+ ...(ngDevMode ? [{ debugName: "visibleTagCount" }] : /* istanbul ignore next */ []));
234
+ /**
235
+ * @description Sets the aria-label attribute of the multi select component.
236
+ * @default ""
237
+ */
238
+ this.ariaLabel = input("", { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: "aria-label" });
239
+ /**
240
+ * @description Sets the aria-labelledby attribute of the multi select component.
241
+ * @default ""
242
+ */
243
+ this.ariaLabelledBy = input("", { ...(ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {}), alias: "aria-labelledby" });
244
+ /**
245
+ * @description Closes the popup automatically after an item is selected or deselected.
246
+ * @default false
247
+ */
248
+ this.autoClose = input(false, /* @ts-ignore */
249
+ ...(ngDevMode ? [{ debugName: "autoClose" }] : /* istanbul ignore next */ []));
250
+ /**
251
+ * @description Renders a checkbox next to each item in the popup list to indicate its selected state.
252
+ * @default false
253
+ */
254
+ this.checkboxes = input(false, /* @ts-ignore */
255
+ ...(ngDevMode ? [{ debugName: "checkboxes" }] : /* istanbul ignore next */ []));
256
+ /**
257
+ * @description Emits when the popup is about to close. This event is preventable.
258
+ */
259
+ this.close = output();
260
+ /**
261
+ * @description Emits after the popup is closed.
262
+ */
263
+ this.closed = output();
264
+ /**
265
+ * @description Collection of items rendered in the popup list.
266
+ * @default []
267
+ */
268
+ this.data = input([], /* @ts-ignore */
269
+ ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
270
+ /**
271
+ * @description Disables the component, preventing the popup from opening and blocking tag removal.
272
+ * @default false
273
+ */
274
+ this.disabled = model(false, /* @ts-ignore */
275
+ ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
276
+ /**
277
+ * @description A predicate function or the name of the field that determines whether an item is disabled.
278
+ */
279
+ this.itemDisabled = input(/* @ts-ignore */
280
+ ...(ngDevMode ? [undefined, { debugName: "itemDisabled" }] : /* istanbul ignore next */ []));
281
+ /**
282
+ * @description Marks the multi select as invalid. When bound to a signal form field via `[formField]`,
283
+ * this is written by the `FormField` directive.
284
+ * @default false
285
+ */
286
+ this.invalid = input(false, /* @ts-ignore */
287
+ ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
288
+ /**
289
+ * @description Sets the loading state of the multi select component.
290
+ * @default false
291
+ */
292
+ this.loading = input(false, /* @ts-ignore */
293
+ ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
294
+ /**
295
+ * @description Emits when the popup is about to open. This event is preventable.
296
+ */
297
+ this.open = output();
298
+ /**
299
+ * @description Emits after the popup is opened.
300
+ */
301
+ this.opened = output();
302
+ /**
303
+ * @description Sets the class of the popup element.
304
+ * @default ""
305
+ */
306
+ this.popupClass = input("", /* @ts-ignore */
307
+ ...(ngDevMode ? [{ debugName: "popupClass" }] : /* istanbul ignore next */ []));
308
+ /**
309
+ * @description Sets the height of the popup element.
310
+ * @default null
311
+ */
312
+ this.popupHeight = input(null, /* @ts-ignore */
313
+ ...(ngDevMode ? [{ debugName: "popupHeight" }] : /* istanbul ignore next */ []));
314
+ /**
315
+ * @description Sets the width of the popup element.
316
+ * @default null
317
+ */
318
+ this.popupWidth = input(null, /* @ts-ignore */
319
+ ...(ngDevMode ? [{ debugName: "popupWidth" }] : /* istanbul ignore next */ []));
320
+ /**
321
+ * @description Sets the readonly state of the multi select component.
322
+ * @default false
323
+ */
324
+ this.readonly = input(false, /* @ts-ignore */
325
+ ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
326
+ /**
327
+ * @description Sets the required state of the multi select component.
328
+ * @default false
329
+ */
330
+ this.required = input(false, /* @ts-ignore */
331
+ ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
332
+ /**
333
+ * @description Sets the border radius of the multi select component.
334
+ * @default "medium"
335
+ */
336
+ this.rounded = input("medium", /* @ts-ignore */
337
+ ...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
338
+ /**
339
+ * @description Renders a button that clears all selected items when at least one item is selected.
340
+ * @default false
341
+ */
342
+ this.showClearButton = input(false, /* @ts-ignore */
343
+ ...(ngDevMode ? [{ debugName: "showClearButton" }] : /* istanbul ignore next */ []));
344
+ /**
345
+ * @description The size of the multi select component.
346
+ * @default "medium"
347
+ */
348
+ this.size = input("medium", /* @ts-ignore */
349
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
350
+ /**
351
+ * @description Sets the text field of the multi select component.
352
+ * It can be null, string, or a function that takes an item and returns a string.
353
+ * If null, the item itself will be used as the text representation.
354
+ * @default null
355
+ */
356
+ this.textField = input(/* @ts-ignore */
357
+ ...(ngDevMode ? [undefined, { debugName: "textField" }] : /* istanbul ignore next */ []));
358
+ /**
359
+ * @description Emitted when the multi select is interacted with on blur, selection, remove, or clear.
360
+ * The `FormField` directive listens to this to mark the field as touched.
361
+ */
362
+ this.touch = output();
363
+ /**
364
+ * @description Sets the touched state of the multi select. When bound to a signal form field via `[formField]`,
365
+ * this is written by the `FormField` directive.
366
+ * @default false
367
+ */
368
+ this.touched = input(false, /* @ts-ignore */
369
+ ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
370
+ /**
371
+ * @description Additional CSS classes merged onto the host element via `tailwind-merge`.
372
+ * @default ""
373
+ */
374
+ this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
375
+ /**
376
+ * @description Sets the value field of the multi select component.
377
+ * It can be null, string, or a function that takes an item and returns a string.
378
+ * If null, the item itself will be used as the value representation.
379
+ * @default null
380
+ */
381
+ this.valueField = input(/* @ts-ignore */
382
+ ...(ngDevMode ? [undefined, { debugName: "valueField" }] : /* istanbul ignore next */ []));
383
+ /**
384
+ * @description Two-way bindable current selected values. Implements `FormValueControl<Iterable<TData>>`,
385
+ * enabling signal forms `[formField]` binding. When `valueField` is set, primitive field values can be
386
+ * written into this model to restore matching selected items.
387
+ * @default []
388
+ */
389
+ this.value = model([], /* @ts-ignore */
390
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
391
+ afterNextRender({
392
+ read: () => {
393
+ this.initialize();
394
+ this.setEventListeners();
395
+ this.setSubscriptions();
396
+ }
397
+ });
398
+ effect(() => {
399
+ const popupTemplate = this.popupTemplate();
400
+ untracked(() => this.#dropdownService.popupTemplate.set(popupTemplate));
401
+ });
402
+ effect(() => {
403
+ const valueField = this.valueField();
404
+ const value = this.value();
405
+ untracked(() => {
406
+ this.#listService.setValueField(valueField ?? "");
407
+ this.#listService.setSelectedDataItems(value);
408
+ });
409
+ });
410
+ effect(() => {
411
+ const checkboxVisible = this.checkboxes();
412
+ untracked(() => this.#listService.setSelectableOptions({ checkboxes: checkboxVisible }));
413
+ });
414
+ }
415
+ focus() {
416
+ this.#hostElementRef.nativeElement.focus();
417
+ }
418
+ onBlur() {
419
+ this.touch.emit();
420
+ }
421
+ onItemSelect() {
422
+ this.updateValue(this.selectedDataItems().toArray());
423
+ if (this.autoClose()) {
424
+ this.#popupRef()?.close();
425
+ }
426
+ }
427
+ onSelectedItemRemove(event, listItem) {
428
+ event.stopImmediatePropagation();
429
+ if (this.readonly() || this.disabled()) {
430
+ return;
431
+ }
432
+ this.#listService.deselectItems([listItem]);
433
+ this.updateValue(this.selectedDataItems().toArray());
434
+ this.focus();
435
+ }
436
+ onSelectedItemGroupRemove(event) {
437
+ event.stopImmediatePropagation();
438
+ if (this.readonly() || this.disabled()) {
439
+ return;
440
+ }
441
+ const selectedItemCount = this.selectedListItems().size();
442
+ const removedItems = this.selectedListItems()
443
+ .takeLast(selectedItemCount - this.visibleTagCount())
444
+ .toArray();
445
+ this.#listService.deselectItems(removedItems);
446
+ this.updateValue(this.selectedDataItems().toArray());
447
+ this.focus();
448
+ }
449
+ onValueClear(event) {
450
+ if (this.readonly() || (event instanceof KeyboardEvent && event.key !== "Enter" && event.key !== " ")) {
451
+ return;
452
+ }
453
+ event.preventDefault();
454
+ event.stopImmediatePropagation();
455
+ this.updateValue([]);
456
+ this.#listService.clearSelections();
457
+ this.focus();
458
+ }
459
+ handleEnterKey() {
460
+ if (!this.#popupRef()) {
461
+ this.#dropdownService.triggerPopupOpen$.next({});
462
+ return;
463
+ }
464
+ const highlightedItem = this.#listService.highlightedItem();
465
+ if (!highlightedItem) {
466
+ return;
467
+ }
468
+ const selected = this.#listService.isSelected(highlightedItem);
469
+ if (selected) {
470
+ this.#listService.deselectItems([highlightedItem]);
471
+ }
472
+ else {
473
+ this.#listService.selectItem(highlightedItem);
474
+ }
475
+ this.updateValue(this.selectedDataItems().toArray());
476
+ if (this.autoClose()) {
477
+ this.#popupRef()?.close();
478
+ }
479
+ }
480
+ handlePopupPositionUpdate() {
481
+ const popupRef = this.#popupRef();
482
+ if (!popupRef) {
483
+ return;
484
+ }
485
+ restoreOverlayScroll(popupRef.overlayRef, this.#hostElementRef.nativeElement);
486
+ }
487
+ initialize() {
488
+ this.#listService.setNavigableOptions({ enabled: true, mode: "highlight", wrap: true });
489
+ this.#listService.setSelectableOptions({ enabled: true, mode: "multiple" });
490
+ }
491
+ setBackspaceKeySubscription() {
492
+ this.#dropdownService.keydown$
493
+ .pipe(takeUntilDestroyed(this.#destroyRef), filter(e => e.key === "Backspace"), tap(e => e.preventDefault()))
494
+ .subscribe(() => {
495
+ const selectedItems = this.selectedListItems();
496
+ if (selectedItems.isEmpty()) {
497
+ return;
498
+ }
499
+ const lastSelectedItem = selectedItems.last();
500
+ this.#listService.deselectItems([lastSelectedItem]);
501
+ this.updateValue(this.selectedDataItems().toArray());
502
+ });
503
+ }
504
+ setEnterKeySubscription() {
505
+ this.#dropdownService.keydown$
506
+ .pipe(takeUntilDestroyed(this.#destroyRef), filter(e => e.key === "Enter"), tap(e => e.preventDefault()))
507
+ .subscribe(() => this.handleEnterKey());
508
+ }
509
+ setEventListeners() {
510
+ rxFromResize(this.#hostElementRef.nativeElement)
511
+ .pipe(takeUntilDestroyed(this.#destroyRef))
512
+ .subscribe(() => this.handlePopupPositionUpdate());
513
+ }
514
+ setSubscriptions() {
515
+ this.setBackspaceKeySubscription();
516
+ this.setEnterKeySubscription();
517
+ }
518
+ updateValue(value, notify = true) {
519
+ this.value.set(value);
520
+ if (notify) {
521
+ this.touch.emit();
522
+ }
523
+ }
524
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MultiSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
525
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: MultiSelectComponent, isStandalone: true, selector: "mona-multi-select", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, autoClose: { classPropertyName: "autoClose", publicName: "autoClose", isSignal: true, isRequired: false, transformFunction: null }, checkboxes: { classPropertyName: "checkboxes", publicName: "checkboxes", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, itemDisabled: { classPropertyName: "itemDisabled", publicName: "itemDisabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, popupClass: { classPropertyName: "popupClass", publicName: "popupClass", isSignal: true, isRequired: false, transformFunction: null }, popupHeight: { classPropertyName: "popupHeight", publicName: "popupHeight", isSignal: true, isRequired: false, transformFunction: null }, popupWidth: { classPropertyName: "popupWidth", publicName: "popupWidth", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, showClearButton: { classPropertyName: "showClearButton", publicName: "showClearButton", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, textField: { classPropertyName: "textField", publicName: "textField", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close", closed: "closed", disabled: "disabledChange", open: "open", opened: "opened", touch: "touch", value: "valueChange" }, host: { listeners: { "blur": "onBlur()" }, properties: { "attr.aria-activedescendant": "activeDescendant()", "attr.aria-busy": "loading() ? 'true' : undefined", "attr.aria-controls": "listId", "attr.aria-disabled": "disabled() ? true : undefined", "attr.aria-expanded": "expanded()", "attr.aria-haspopup": "'listbox'", "attr.aria-invalid": "invalidState() ? true : undefined", "attr.aria-label": "ariaLabel()", "attr.aria-labelledby": "ariaLabelledBy()", "attr.aria-readonly": "readonly() ? true : undefined", "attr.aria-required": "required() ? true : undefined", "attr.role": "'combobox'", "attr.tabindex": "disabled() ? null : 0", "attr.data-invalid": "invalidState() || null", "class": "baseClass()" } }, providers: [
526
+ ListService,
527
+ DropdownService,
528
+ MultiSelectService,
529
+ {
530
+ provide: DropdownDataInputToken,
531
+ useExisting: forwardRef(() => MultiSelectComponent),
532
+ multi: false
533
+ },
534
+ {
535
+ provide: DropdownPopupInputToken,
536
+ useExisting: forwardRef(() => MultiSelectComponent),
537
+ multi: false
538
+ }
539
+ ], queries: [{ propertyName: "footerTemplate", first: true, predicate: DropdownFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: DropdownGroupHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "headerTemplate", first: true, predicate: DropdownHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "itemTemplate", first: true, predicate: DropdownItemTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "noDataTemplate", first: true, predicate: DropdownNoDataTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "prefixTemplate", first: true, predicate: DropdownPrefixTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "tagTemplate", first: true, predicate: MultiSelectTagTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.DropdownDataHandlerDirective }, { directive: i1.DropdownListPopupHandlerDirective }], ngImport: i0, template: "@if (prefixTemplate()) {\r\n <span [class]=\"affixClass()\">\r\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\r\n </span>\r\n}\r\n\r\n<div [class]=\"itemContainerClass()\">\r\n @for (pair of valueTextMap(); track pair.key) {\r\n <mona-chip\r\n look=\"default\"\r\n [tabindex]=\"-1\"\r\n [removable]=\"true\"\r\n [removeTabIndex]=\"-1\"\r\n [disabled]=\"disabled()\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n (remove)=\"onSelectedItemRemove($event, pair.key!)\">\r\n @if (tagTemplate()) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"tagTemplate()\"\r\n [ngTemplateOutletContext]=\"{ $implicit: pair.key!.data }\"></ng-container>\r\n } @else {\r\n {{ pair.value }}\r\n }\r\n </mona-chip>\r\n }\r\n\r\n @if (tagCount() >= 0 && selectedListItems().length > tagCount()) {\r\n <mona-chip\r\n look=\"outline\"\r\n [tabindex]=\"-1\"\r\n [removable]=\"true\"\r\n [removeTabIndex]=\"-1\"\r\n [disabled]=\"disabled()\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n (remove)=\"onSelectedItemGroupRemove($event)\">\r\n @let remainingCount = selectedDataItems().length - tagCount();\r\n @if (summaryTagTemplate()) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"summaryTagTemplate()\"\r\n [ngTemplateOutletContext]=\"{ $implicit: selectedDataItems(), tagCount: tagCount() }\"></ng-container>\r\n } @else {\r\n @let itemLabel = remainingCount === 1 ? \"item\" : \"items\";\r\n + {{ remainingCount }} {{ itemLabel }}\r\n }\r\n </mona-chip>\r\n }\r\n</div>\r\n\r\n@if (showClearButton() && selectedListItems().length !== 0 && !loading()) {\r\n <mona-indicator-icon\r\n preset=\"clear\"\r\n [class]=\"indicatorClass()\"\r\n [interactive]=\"true\"\r\n label=\"Clear\"\r\n (activate)=\"onValueClear($event)\"></mona-indicator-icon>\r\n}\r\n\r\n@if (loading()) {\r\n <mona-indicator-icon preset=\"loading\" [class]=\"indicatorClass()\" [size]=\"12\"></mona-indicator-icon>\r\n}\r\n\r\n<mona-indicator-icon preset=\"dropdown\" [class]=\"indicatorClass()\" [size]=\"18\"></mona-indicator-icon>\r\n\r\n<span monaDropdownLiveRegion></span>\r\n\r\n<ng-template #popupTemplate>\r\n <div [class]=\"listPopupClass()\">\r\n <mona-list [listId]=\"listId\" [focusOnMount]=\"false\" [size]=\"size()\" (itemSelect)=\"onItemSelect()\">\r\n @if (footerTemplate()) {\r\n <ng-template monaListFooterTemplate>\r\n <ng-container [ngTemplateOutlet]=\"footerTemplate() ?? null\"></ng-container>\r\n </ng-template>\r\n }\r\n @if (groupHeaderTemplate()) {\r\n <ng-template monaListGroupHeaderTemplate let-group>\r\n <ng-container\r\n [ngTemplateOutlet]=\"groupHeaderTemplate() ?? null\"\r\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\r\n </ng-template>\r\n }\r\n @if (headerTemplate()) {\r\n <ng-template monaListHeaderTemplate>\r\n <ng-container [ngTemplateOutlet]=\"headerTemplate() ?? null\"></ng-container>\r\n </ng-template>\r\n }\r\n @if (itemTemplate()) {\r\n <ng-template monaListItemTemplate let-dataItem>\r\n <ng-container\r\n [ngTemplateOutlet]=\"itemTemplate() ?? null\"\r\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\r\n </ng-template>\r\n }\r\n @if (noDataTemplate()) {\r\n <ng-template monaListNoDataTemplate>\r\n <ng-container [ngTemplateOutlet]=\"noDataTemplate() ?? null\"></ng-container>\r\n </ng-template>\r\n }\r\n </mona-list>\r\n </div>\r\n</ng-template>\r\n", dependencies: [{ kind: "component", type: ChipComponent, selector: "mona-chip", inputs: ["aria-label", "disabled", "label", "look", "removable", "removeLabel", "removeTabIndex", "rounded", "selected", "size", "tabindex", "toggleable", "class", "value"], outputs: ["contentClick", "remove", "selectedChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FontAwesomeModule }, { kind: "component", type: ListComponent, selector: "mona-list", inputs: ["ariaLabel", "data", "focusOnMount", "height", "listClass", "listId", "listItemClass", "listItemStyle", "listStyle", "maxHeight", "maxWidth", "size", "textField", "width"], outputs: ["itemSelect"] }, { kind: "directive", type: ListGroupHeaderTemplateDirective, selector: "ng-template[monaListGroupHeaderTemplate]" }, { kind: "directive", type: ListItemTemplateDirective, selector: "ng-template[monaListItemTemplate]" }, { kind: "directive", type: ListFooterTemplateDirective, selector: "ng-template[monaListFooterTemplate]" }, { kind: "directive", type: ListHeaderTemplateDirective, selector: "ng-template[monaListHeaderTemplate]" }, { kind: "directive", type: ListNoDataTemplateDirective, selector: "ng-template[monaListNoDataTemplate]" }, { kind: "directive", type: DropdownLiveRegionDirective, selector: "span[monaDropdownLiveRegion]" }, { kind: "component", type: IndicatorIconComponent, selector: "mona-indicator-icon", inputs: ["icon", "interactive", "label", "preset", "size", "class"], outputs: ["activate"] }] }); }
540
+ }
541
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MultiSelectComponent, decorators: [{
542
+ type: Component,
543
+ args: [{ selector: "mona-multi-select", providers: [
544
+ ListService,
545
+ DropdownService,
546
+ MultiSelectService,
547
+ {
548
+ provide: DropdownDataInputToken,
549
+ useExisting: forwardRef(() => MultiSelectComponent),
550
+ multi: false
551
+ },
552
+ {
553
+ provide: DropdownPopupInputToken,
554
+ useExisting: forwardRef(() => MultiSelectComponent),
555
+ multi: false
556
+ }
557
+ ], imports: [
558
+ ChipComponent,
559
+ NgTemplateOutlet,
560
+ FontAwesomeModule,
561
+ ListComponent,
562
+ ListGroupHeaderTemplateDirective,
563
+ ListItemTemplateDirective,
564
+ ListFooterTemplateDirective,
565
+ ListHeaderTemplateDirective,
566
+ ListNoDataTemplateDirective,
567
+ DropdownLiveRegionDirective,
568
+ IndicatorIconComponent
569
+ ], hostDirectives: [DropdownDataHandlerDirective, DropdownListPopupHandlerDirective], host: {
570
+ "[attr.aria-activedescendant]": "activeDescendant()",
571
+ "[attr.aria-busy]": "loading() ? 'true' : undefined",
572
+ "[attr.aria-controls]": "listId",
573
+ "[attr.aria-disabled]": "disabled() ? true : undefined",
574
+ "[attr.aria-expanded]": "expanded()",
575
+ "[attr.aria-haspopup]": "'listbox'",
576
+ "[attr.aria-invalid]": "invalidState() ? true : undefined",
577
+ "[attr.aria-label]": "ariaLabel()",
578
+ "[attr.aria-labelledby]": "ariaLabelledBy()",
579
+ "[attr.aria-readonly]": "readonly() ? true : undefined",
580
+ "[attr.aria-required]": "required() ? true : undefined",
581
+ "[attr.role]": "'combobox'",
582
+ "[attr.tabindex]": "disabled() ? null : 0",
583
+ "[attr.data-invalid]": "invalidState() || null",
584
+ "[class]": "baseClass()",
585
+ "(blur)": "onBlur()"
586
+ }, template: "@if (prefixTemplate()) {\r\n <span [class]=\"affixClass()\">\r\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\r\n </span>\r\n}\r\n\r\n<div [class]=\"itemContainerClass()\">\r\n @for (pair of valueTextMap(); track pair.key) {\r\n <mona-chip\r\n look=\"default\"\r\n [tabindex]=\"-1\"\r\n [removable]=\"true\"\r\n [removeTabIndex]=\"-1\"\r\n [disabled]=\"disabled()\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n (remove)=\"onSelectedItemRemove($event, pair.key!)\">\r\n @if (tagTemplate()) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"tagTemplate()\"\r\n [ngTemplateOutletContext]=\"{ $implicit: pair.key!.data }\"></ng-container>\r\n } @else {\r\n {{ pair.value }}\r\n }\r\n </mona-chip>\r\n }\r\n\r\n @if (tagCount() >= 0 && selectedListItems().length > tagCount()) {\r\n <mona-chip\r\n look=\"outline\"\r\n [tabindex]=\"-1\"\r\n [removable]=\"true\"\r\n [removeTabIndex]=\"-1\"\r\n [disabled]=\"disabled()\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n (remove)=\"onSelectedItemGroupRemove($event)\">\r\n @let remainingCount = selectedDataItems().length - tagCount();\r\n @if (summaryTagTemplate()) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"summaryTagTemplate()\"\r\n [ngTemplateOutletContext]=\"{ $implicit: selectedDataItems(), tagCount: tagCount() }\"></ng-container>\r\n } @else {\r\n @let itemLabel = remainingCount === 1 ? \"item\" : \"items\";\r\n + {{ remainingCount }} {{ itemLabel }}\r\n }\r\n </mona-chip>\r\n }\r\n</div>\r\n\r\n@if (showClearButton() && selectedListItems().length !== 0 && !loading()) {\r\n <mona-indicator-icon\r\n preset=\"clear\"\r\n [class]=\"indicatorClass()\"\r\n [interactive]=\"true\"\r\n label=\"Clear\"\r\n (activate)=\"onValueClear($event)\"></mona-indicator-icon>\r\n}\r\n\r\n@if (loading()) {\r\n <mona-indicator-icon preset=\"loading\" [class]=\"indicatorClass()\" [size]=\"12\"></mona-indicator-icon>\r\n}\r\n\r\n<mona-indicator-icon preset=\"dropdown\" [class]=\"indicatorClass()\" [size]=\"18\"></mona-indicator-icon>\r\n\r\n<span monaDropdownLiveRegion></span>\r\n\r\n<ng-template #popupTemplate>\r\n <div [class]=\"listPopupClass()\">\r\n <mona-list [listId]=\"listId\" [focusOnMount]=\"false\" [size]=\"size()\" (itemSelect)=\"onItemSelect()\">\r\n @if (footerTemplate()) {\r\n <ng-template monaListFooterTemplate>\r\n <ng-container [ngTemplateOutlet]=\"footerTemplate() ?? null\"></ng-container>\r\n </ng-template>\r\n }\r\n @if (groupHeaderTemplate()) {\r\n <ng-template monaListGroupHeaderTemplate let-group>\r\n <ng-container\r\n [ngTemplateOutlet]=\"groupHeaderTemplate() ?? null\"\r\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\r\n </ng-template>\r\n }\r\n @if (headerTemplate()) {\r\n <ng-template monaListHeaderTemplate>\r\n <ng-container [ngTemplateOutlet]=\"headerTemplate() ?? null\"></ng-container>\r\n </ng-template>\r\n }\r\n @if (itemTemplate()) {\r\n <ng-template monaListItemTemplate let-dataItem>\r\n <ng-container\r\n [ngTemplateOutlet]=\"itemTemplate() ?? null\"\r\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\r\n </ng-template>\r\n }\r\n @if (noDataTemplate()) {\r\n <ng-template monaListNoDataTemplate>\r\n <ng-container [ngTemplateOutlet]=\"noDataTemplate() ?? null\"></ng-container>\r\n </ng-template>\r\n }\r\n </mona-list>\r\n </div>\r\n</ng-template>\r\n" }]
587
+ }], ctorParameters: () => [], propDecorators: { footerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownFooterTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], groupHeaderTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownGroupHeaderTemplateDirective), { ...{
588
+ read: TemplateRef
589
+ }, isSignal: true }] }], headerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownHeaderTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], itemTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownItemTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], noDataTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownNoDataTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], popupTemplate: [{ type: i0.ViewChild, args: ["popupTemplate", { isSignal: true }] }], prefixTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownPrefixTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], tagTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => MultiSelectTagTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], autoClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoClose", required: false }] }], checkboxes: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkboxes", required: false }] }], close: [{ type: i0.Output, args: ["close"] }], closed: [{ type: i0.Output, args: ["closed"] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], itemDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemDisabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], open: [{ type: i0.Output, args: ["open"] }], opened: [{ type: i0.Output, args: ["opened"] }], popupClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupClass", required: false }] }], popupHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupHeight", required: false }] }], popupWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupWidth", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], showClearButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClearButton", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], textField: [{ type: i0.Input, args: [{ isSignal: true, alias: "textField", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], valueField: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueField", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
590
+
591
+ class MultiSelectSummaryTagTemplateDirective {
592
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MultiSelectSummaryTagTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
593
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: MultiSelectSummaryTagTemplateDirective, isStandalone: true, selector: "ng-template[monaMultiSelectSummaryTagTemplate]", ngImport: i0 }); }
594
+ }
595
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MultiSelectSummaryTagTemplateDirective, decorators: [{
596
+ type: Directive,
597
+ args: [{
598
+ selector: "ng-template[monaMultiSelectSummaryTagTemplate]"
599
+ }]
600
+ }] });
601
+
602
+ class MultiSelectSummaryTagDirective {
603
+ #multiSelectService;
604
+ constructor() {
605
+ this.#multiSelectService = inject(MultiSelectService);
606
+ this.summaryTagTemplate = contentChild(MultiSelectSummaryTagTemplateDirective, { ...(ngDevMode ? { debugName: "summaryTagTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
607
+ /**
608
+ * @description Number of selected item tags to display before collapsing the rest into a summary tag.
609
+ * A negative value shows every selected item as its own tag and never renders the summary tag.
610
+ * @default -1
611
+ */
612
+ this.tagCount = input(-1, { ...(ngDevMode ? { debugName: "tagCount" } : /* istanbul ignore next */ {}), alias: "monaMultiSelectSummaryTag" });
613
+ effect(() => {
614
+ const tagCount = this.tagCount();
615
+ untracked(() => this.#multiSelectService.tagCount.set(tagCount));
616
+ });
617
+ effect(() => {
618
+ const tagTemplate = this.summaryTagTemplate();
619
+ untracked(() => this.#multiSelectService.summaryTagTemplate.set(tagTemplate ?? null));
620
+ });
621
+ }
622
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MultiSelectSummaryTagDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
623
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "22.0.6", type: MultiSelectSummaryTagDirective, isStandalone: true, selector: "mona-multi-select[monaMultiSelectSummaryTag]", inputs: { tagCount: { classPropertyName: "tagCount", publicName: "monaMultiSelectSummaryTag", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "summaryTagTemplate", first: true, predicate: MultiSelectSummaryTagTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0 }); }
624
+ }
625
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MultiSelectSummaryTagDirective, decorators: [{
626
+ type: Directive,
627
+ args: [{
628
+ selector: "mona-multi-select[monaMultiSelectSummaryTag]"
629
+ }]
630
+ }], ctorParameters: () => [], propDecorators: { summaryTagTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => MultiSelectSummaryTagTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], tagCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaMultiSelectSummaryTag", required: false }] }] } });
631
+
632
+ /*
633
+ * Public API Surface of @nanahoshi/mona-ui/multi-select
634
+ */
635
+
636
+ /**
637
+ * Generated bundle index. Do not edit.
638
+ */
639
+
640
+ export { MultiSelectComponent, MultiSelectSummaryTagDirective, MultiSelectSummaryTagTemplateDirective, MultiSelectTagTemplateDirective };
641
+ //# sourceMappingURL=nanahoshi-mona-ui-multi-select.mjs.map