@nanahoshi/mona-ui 0.27.2 → 0.28.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 (208) hide show
  1. package/docs/api/chart.md +2 -2
  2. package/docs/api/popup.md +1 -1
  3. package/docs/api/theme.md +2 -2
  4. package/docs/chart.md +14 -0
  5. package/docs/editor.md +2 -0
  6. package/docs/installation.md +147 -15
  7. package/docs/introduction.md +37 -15
  8. package/docs/theming-built-in-themes.md +67 -0
  9. package/docs/theming-custom-colors.md +274 -0
  10. package/docs/theming-custom-themes.md +168 -0
  11. package/docs/theming.md +164 -248
  12. package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1089 -603
  13. package/fesm2022/nanahoshi-mona-ui-avatar.mjs +369 -184
  14. package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +658 -371
  15. package/fesm2022/nanahoshi-mona-ui-button-group.mjs +513 -359
  16. package/fesm2022/nanahoshi-mona-ui-button.mjs +622 -517
  17. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +2070 -1573
  18. package/fesm2022/nanahoshi-mona-ui-card.mjs +620 -316
  19. package/fesm2022/nanahoshi-mona-ui-chart.mjs +61151 -64921
  20. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +646 -317
  21. package/fesm2022/nanahoshi-mona-ui-chip.mjs +737 -516
  22. package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +441 -242
  23. package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +443 -390
  24. package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +1138 -814
  25. package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +1114 -959
  26. package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +858 -504
  27. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1181 -742
  28. package/fesm2022/nanahoshi-mona-ui-command.mjs +1454 -853
  29. package/fesm2022/nanahoshi-mona-ui-common.mjs +569 -743
  30. package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +978 -532
  31. package/fesm2022/nanahoshi-mona-ui-date-input.mjs +283 -266
  32. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +973 -451
  33. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +1203 -658
  34. package/fesm2022/nanahoshi-mona-ui-dialog.mjs +1415 -936
  35. package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +1165 -568
  36. package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +1142 -677
  37. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +1018 -734
  38. package/fesm2022/nanahoshi-mona-ui-editor.mjs +3589 -2122
  39. package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +577 -359
  40. package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +311 -151
  41. package/fesm2022/nanahoshi-mona-ui-filter.mjs +1086 -718
  42. package/fesm2022/nanahoshi-mona-ui-grid-grid-colgroup.component-NhONCVIX.mjs +77 -0
  43. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-Djv8ZnT5.mjs +480 -0
  44. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-WbXAzGCa.mjs +470 -0
  45. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-DkWTD3pN.mjs +2115 -0
  46. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DAHqTwBJ.mjs +330 -0
  47. package/fesm2022/nanahoshi-mona-ui-grid-grid.styles-BmLU-3zP.mjs +3766 -0
  48. package/fesm2022/nanahoshi-mona-ui-grid.mjs +5418 -2
  49. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +1379 -1079
  50. package/fesm2022/nanahoshi-mona-ui-i18n.mjs +4451 -5077
  51. package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +344 -143
  52. package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +257 -127
  53. package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +2080 -1829
  54. package/fesm2022/nanahoshi-mona-ui-internal-popup-menu.mjs +103 -141
  55. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +2498 -2706
  56. package/fesm2022/nanahoshi-mona-ui-internal.mjs +722 -1007
  57. package/fesm2022/nanahoshi-mona-ui-label.mjs +313 -202
  58. package/fesm2022/nanahoshi-mona-ui-list-box.mjs +1308 -1009
  59. package/fesm2022/nanahoshi-mona-ui-list-view.mjs +1411 -677
  60. package/fesm2022/nanahoshi-mona-ui-list.mjs +1 -6
  61. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +556 -577
  62. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +530 -573
  63. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +530 -573
  64. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +533 -576
  65. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +520 -555
  66. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +530 -571
  67. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +520 -555
  68. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +520 -555
  69. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +530 -571
  70. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +576 -591
  71. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +530 -565
  72. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +520 -555
  73. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +520 -555
  74. package/fesm2022/nanahoshi-mona-ui-locales.mjs +59 -77
  75. package/fesm2022/nanahoshi-mona-ui-menubar.mjs +1411 -829
  76. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +1326 -702
  77. package/fesm2022/nanahoshi-mona-ui-notification.mjs +763 -675
  78. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +1306 -826
  79. package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +1122 -897
  80. package/fesm2022/nanahoshi-mona-ui-pager.mjs +1110 -651
  81. package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +95 -53
  82. package/fesm2022/nanahoshi-mona-ui-popover.mjs +559 -397
  83. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +2323 -1694
  84. package/fesm2022/nanahoshi-mona-ui-popup.mjs +1657 -1455
  85. package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +441 -267
  86. package/fesm2022/nanahoshi-mona-ui-query.mjs +211 -340
  87. package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +1017 -548
  88. package/fesm2022/nanahoshi-mona-ui-rating.mjs +874 -624
  89. package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +1130 -917
  90. package/fesm2022/nanahoshi-mona-ui-segmented.mjs +705 -455
  91. package/fesm2022/nanahoshi-mona-ui-sheet.mjs +461 -283
  92. package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +2791 -2449
  93. package/fesm2022/nanahoshi-mona-ui-skeleton.mjs +145 -90
  94. package/fesm2022/nanahoshi-mona-ui-slider.mjs +1563 -1103
  95. package/fesm2022/nanahoshi-mona-ui-spinner.mjs +738 -673
  96. package/fesm2022/nanahoshi-mona-ui-split-button.mjs +1287 -647
  97. package/fesm2022/nanahoshi-mona-ui-splitter.mjs +1313 -909
  98. package/fesm2022/nanahoshi-mona-ui-stepper.mjs +761 -540
  99. package/fesm2022/nanahoshi-mona-ui-switch.mjs +611 -280
  100. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +1393 -841
  101. package/fesm2022/nanahoshi-mona-ui-text-area.mjs +142 -73
  102. package/fesm2022/nanahoshi-mona-ui-text-box.mjs +876 -374
  103. package/fesm2022/nanahoshi-mona-ui-theme.mjs +1465 -1449
  104. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +897 -443
  105. package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +1100 -703
  106. package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +789 -538
  107. package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +1361 -805
  108. package/fesm2022/nanahoshi-mona-ui-window.mjs +2145 -1531
  109. package/fesm2022/nanahoshi-mona-ui.mjs +1 -8
  110. package/llms.txt +6 -2
  111. package/package.json +62 -23
  112. package/types/nanahoshi-mona-ui-auto-complete.d.ts +367 -233
  113. package/types/nanahoshi-mona-ui-avatar.d.ts +722 -649
  114. package/types/nanahoshi-mona-ui-breadcrumb.d.ts +134 -103
  115. package/types/nanahoshi-mona-ui-button-group.d.ts +213 -152
  116. package/types/nanahoshi-mona-ui-button.d.ts +227 -166
  117. package/types/nanahoshi-mona-ui-calendar.d.ts +324 -259
  118. package/types/nanahoshi-mona-ui-card.d.ts +125 -111
  119. package/types/nanahoshi-mona-ui-chart.d.ts +10483 -7326
  120. package/types/nanahoshi-mona-ui-check-box.d.ts +293 -180
  121. package/types/nanahoshi-mona-ui-chip.d.ts +208 -141
  122. package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +194 -133
  123. package/types/nanahoshi-mona-ui-collapsible.d.ts +103 -87
  124. package/types/nanahoshi-mona-ui-color-gradient.d.ts +281 -213
  125. package/types/nanahoshi-mona-ui-color-palette.d.ts +201 -138
  126. package/types/nanahoshi-mona-ui-color-picker.d.ts +283 -194
  127. package/types/nanahoshi-mona-ui-combo-box.d.ts +401 -262
  128. package/types/nanahoshi-mona-ui-command.d.ts +279 -191
  129. package/types/nanahoshi-mona-ui-common.d.ts +354 -385
  130. package/types/nanahoshi-mona-ui-contextmenu.d.ts +142 -117
  131. package/types/nanahoshi-mona-ui-date-input.d.ts +79 -96
  132. package/types/nanahoshi-mona-ui-date-picker.d.ts +338 -208
  133. package/types/nanahoshi-mona-ui-datetime-picker.d.ts +413 -259
  134. package/types/nanahoshi-mona-ui-dialog.d.ts +470 -381
  135. package/types/nanahoshi-mona-ui-dropdown-button.d.ts +216 -168
  136. package/types/nanahoshi-mona-ui-dropdown-list.d.ts +369 -243
  137. package/types/nanahoshi-mona-ui-dropdowns.d.ts +231 -217
  138. package/types/nanahoshi-mona-ui-editor.d.ts +302 -235
  139. package/types/nanahoshi-mona-ui-expansion-panel.d.ts +140 -109
  140. package/types/nanahoshi-mona-ui-fieldset.d.ts +98 -68
  141. package/types/nanahoshi-mona-ui-filter.d.ts +150 -124
  142. package/types/nanahoshi-mona-ui-grid.d.ts +1956 -1678
  143. package/types/nanahoshi-mona-ui-i18n-icu.d.ts +25 -34
  144. package/types/nanahoshi-mona-ui-i18n.d.ts +987 -1052
  145. package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +118 -71
  146. package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +56 -27
  147. package/types/nanahoshi-mona-ui-internal-list.d.ts +474 -408
  148. package/types/nanahoshi-mona-ui-internal-popup-menu.d.ts +143 -150
  149. package/types/nanahoshi-mona-ui-internal-tree.d.ts +493 -506
  150. package/types/nanahoshi-mona-ui-internal.d.ts +195 -213
  151. package/types/nanahoshi-mona-ui-label.d.ts +108 -78
  152. package/types/nanahoshi-mona-ui-list-box.d.ts +392 -322
  153. package/types/nanahoshi-mona-ui-list-view.d.ts +423 -282
  154. package/types/nanahoshi-mona-ui-list.d.ts +2 -1
  155. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +540 -542
  156. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +540 -542
  157. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +540 -542
  158. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +540 -542
  159. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +540 -542
  160. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +540 -542
  161. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +540 -542
  162. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +540 -542
  163. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +540 -542
  164. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +540 -542
  165. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +540 -542
  166. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +540 -542
  167. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +540 -542
  168. package/types/nanahoshi-mona-ui-locales.d.ts +17 -19
  169. package/types/nanahoshi-mona-ui-menubar.d.ts +210 -181
  170. package/types/nanahoshi-mona-ui-multi-select.d.ts +416 -276
  171. package/types/nanahoshi-mona-ui-notification.d.ts +140 -151
  172. package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +407 -270
  173. package/types/nanahoshi-mona-ui-otp-input.d.ts +364 -241
  174. package/types/nanahoshi-mona-ui-pager.d.ts +379 -301
  175. package/types/nanahoshi-mona-ui-placeholder.d.ts +35 -28
  176. package/types/nanahoshi-mona-ui-popover.d.ts +176 -134
  177. package/types/nanahoshi-mona-ui-popup-menu.d.ts +488 -344
  178. package/types/nanahoshi-mona-ui-popup.d.ts +698 -560
  179. package/types/nanahoshi-mona-ui-progress-bar.d.ts +197 -137
  180. package/types/nanahoshi-mona-ui-query.d.ts +82 -88
  181. package/types/nanahoshi-mona-ui-radio-button.d.ts +434 -269
  182. package/types/nanahoshi-mona-ui-rating.d.ts +348 -254
  183. package/types/nanahoshi-mona-ui-scroll-view.d.ts +244 -172
  184. package/types/nanahoshi-mona-ui-segmented.d.ts +250 -175
  185. package/types/nanahoshi-mona-ui-sheet.d.ts +115 -63
  186. package/types/nanahoshi-mona-ui-sidebar.d.ts +653 -493
  187. package/types/nanahoshi-mona-ui-skeleton.d.ts +55 -39
  188. package/types/nanahoshi-mona-ui-slider.d.ts +503 -354
  189. package/types/nanahoshi-mona-ui-spinner.d.ts +125 -112
  190. package/types/nanahoshi-mona-ui-split-button.d.ts +241 -196
  191. package/types/nanahoshi-mona-ui-splitter.d.ts +124 -78
  192. package/types/nanahoshi-mona-ui-stepper.d.ts +206 -181
  193. package/types/nanahoshi-mona-ui-switch.d.ts +197 -131
  194. package/types/nanahoshi-mona-ui-tabs.d.ts +349 -248
  195. package/types/nanahoshi-mona-ui-text-area.d.ts +52 -36
  196. package/types/nanahoshi-mona-ui-text-box.d.ts +349 -218
  197. package/types/nanahoshi-mona-ui-theme.d.ts +415 -408
  198. package/types/nanahoshi-mona-ui-time-picker.d.ts +357 -217
  199. package/types/nanahoshi-mona-ui-time-selector.d.ts +255 -170
  200. package/types/nanahoshi-mona-ui-tooltip.d.ts +222 -144
  201. package/types/nanahoshi-mona-ui-tree-view.d.ts +466 -308
  202. package/types/nanahoshi-mona-ui-window.d.ts +494 -399
  203. package/types/nanahoshi-mona-ui.d.ts +1 -2
  204. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.mjs +0 -181
  205. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-ihQIKeP-.mjs +0 -208
  206. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-BpnybNcs.mjs +0 -1082
  207. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-CYlgfc7c.mjs +0 -186
  208. package/fesm2022/nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-LCzfCYd3.mjs +0 -7568
@@ -1,760 +1,1048 @@
1
- import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, DestroyRef, input, output, effect, untracked, afterNextRender, Directive, Injectable, signal, DOCUMENT, ElementRef } from '@angular/core';
3
- import { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';
4
- import { ListService } from '@nanahoshi/mona-ui/internal/list';
5
- import { PreventableEvent } from '@nanahoshi/mona-ui/common';
6
- import { PopupService, dropdownPopupAnimation, PopupCloseEvent, PopupCloseSource } from '@nanahoshi/mona-ui/popup';
7
- import { Subject, takeUntil, take, filter, switchMap, fromEvent } from 'rxjs';
8
- import { ConnectionPositionPair } from '@angular/cdk/overlay';
9
- import { focusCanReturn, themeOverlaySurfaceClasses } from '@nanahoshi/mona-ui/internal';
10
- import { LiveAnnouncer } from '@angular/cdk/a11y';
11
- import { formatNumber, MonaI18nService } from '@nanahoshi/mona-ui/i18n';
12
- import { cva } from 'class-variance-authority';
13
-
14
- /** @hidden Exported for Mona UI's other entry points; applications don't need it. */
1
+ import * as i0 from "@angular/core";
2
+ import { DOCUMENT, DestroyRef, Directive, ElementRef, Injectable, InjectionToken, afterNextRender, effect, inject, input, output, signal, untracked } from "@angular/core";
3
+ import { takeUntilDestroyed, toObservable } from "@angular/core/rxjs-interop";
4
+ import { ListService } from "@nanahoshi/mona-ui/internal/list";
5
+ import { PreventableEvent } from "@nanahoshi/mona-ui/common";
6
+ import { PopupCloseEvent, PopupCloseSource, PopupService, dropdownPopupAnimation } from "@nanahoshi/mona-ui/popup";
7
+ import { Subject, filter, fromEvent, switchMap, take, takeUntil } from "rxjs";
8
+ import { ConnectionPositionPair } from "@angular/cdk/overlay";
9
+ import { focusCanReturn, themeOverlaySurfaceClasses } from "@nanahoshi/mona-ui/internal";
10
+ import { LiveAnnouncer } from "@angular/cdk/a11y";
11
+ import { MonaI18nService, formatNumber } from "@nanahoshi/mona-ui/i18n";
12
+ import { cva } from "class-variance-authority";
15
13
  const DROPDOWN_DATA_INPUT_TOKEN = new InjectionToken("DROPDOWN_DATA_INPUT");
16
- /**
17
- * @deprecated Use {@link DROPDOWN_DATA_INPUT_TOKEN}.
18
- */
19
- // eslint-disable-next-line @typescript-eslint/naming-convention -- kept so existing imports keep working
20
14
  const DropdownDataInputToken = DROPDOWN_DATA_INPUT_TOKEN;
21
-
22
- /** @hidden Exported for Mona UI's other entry points; applications don't need it. */
23
15
  const DROPDOWN_POPUP_INPUT_TOKEN = new InjectionToken("DROPDOWN_POPUP_INPUT");
24
-
25
- class DropdownFilterableDirective {
26
- #defaultOptions;
27
- #destroyRef;
28
- #listService;
29
- constructor() {
30
- this.#defaultOptions = {
31
- enabled: true,
32
- operator: "contains",
33
- debounce: 0,
34
- caseSensitive: false
35
- };
36
- this.#destroyRef = inject(DestroyRef);
37
- this.#listService = inject(ListService);
38
- /** @description Current filter text used to narrow the visible options. */
39
- this.filter = input("", /* @ts-ignore */
40
- ...(ngDevMode ? [{ debugName: "filter" }] : /* istanbul ignore next */ []));
41
- /** @description Emitted when the filter value changes. Cancelable. */
42
- this.filterChange = output();
43
- /**
44
- * @description Placeholder text in the popup's filter row. Auto Complete has no filter row, since its own input is
45
- * the filter, so it ignores this.
46
- * @default ""
47
- */
48
- this.filterPlaceholder = input("", /* @ts-ignore */
49
- ...(ngDevMode ? [{ debugName: "filterPlaceholder" }] : /* istanbul ignore next */ []));
50
- /**
51
- * @description Filter operator, case sensitivity, and debounce delay. An empty string enables filtering with
52
- * default settings (`operator: "contains"`, `caseSensitive: false`, `debounce: 0`); pass an object to override any
53
- * field.
54
- */
55
- this.options = input("", { ...(ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {}), alias: "monaDropDownFilterable" });
56
- effect(() => {
57
- const filter = this.filter();
58
- untracked(() => this.#listService.setFilter(filter));
59
- });
60
- effect(() => {
61
- const filterPlaceholder = this.filterPlaceholder();
62
- untracked(() => this.#listService.setFilterPlaceholder(filterPlaceholder));
63
- });
64
- effect(() => {
65
- const options = this.options();
66
- untracked(() => {
67
- if (options === "") {
68
- this.#listService.setFilterableOptions(this.#defaultOptions);
69
- }
70
- else {
71
- this.#listService.setFilterableOptions({
72
- ...this.#defaultOptions,
73
- ...options,
74
- enabled: options.enabled ?? this.#defaultOptions.enabled
75
- });
76
- }
77
- });
78
- });
79
- afterNextRender({
80
- read: () => {
81
- this.#listService.filterChange$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(filter => {
82
- this.filterChange.emit(filter);
83
- });
84
- }
85
- });
86
- }
87
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownFilterableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
88
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: DropdownFilterableDirective, isStandalone: true, selector: "\n mona-auto-complete[monaDropDownFilterable],\n mona-dropdown-list[monaDropDownFilterable],\n mona-combo-box[monaDropDownFilterable],\n mona-multi-select[monaDropDownFilterable]\n ", inputs: { filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, filterPlaceholder: { classPropertyName: "filterPlaceholder", publicName: "filterPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "monaDropDownFilterable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterChange: "filterChange" }, ngImport: i0 }); }
89
- }
90
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownFilterableDirective, decorators: [{
91
- type: Directive,
92
- args: [{
93
- selector: `
16
+ var DropdownFilterableDirective = class DropdownFilterableDirective {
17
+ #defaultOptions;
18
+ #destroyRef;
19
+ #listService;
20
+ constructor() {
21
+ this.#defaultOptions = {
22
+ enabled: true,
23
+ operator: "contains",
24
+ debounce: 0,
25
+ caseSensitive: false
26
+ };
27
+ this.#destroyRef = inject(DestroyRef);
28
+ this.#listService = inject(ListService);
29
+ this.filter = input("", ...ngDevMode ? [{ debugName: "filter" }] : /* istanbul ignore next */ []);
30
+ this.filterChange = output();
31
+ this.filterPlaceholder = input("", ...ngDevMode ? [{ debugName: "filterPlaceholder" }] : /* istanbul ignore next */ []);
32
+ this.options = input("", {
33
+ ...ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {},
34
+ alias: "monaDropDownFilterable"
35
+ });
36
+ effect(() => {
37
+ const filter = this.filter();
38
+ untracked(() => this.#listService.setFilter(filter));
39
+ });
40
+ effect(() => {
41
+ const filterPlaceholder = this.filterPlaceholder();
42
+ untracked(() => this.#listService.setFilterPlaceholder(filterPlaceholder));
43
+ });
44
+ effect(() => {
45
+ const options = this.options();
46
+ untracked(() => {
47
+ if (options === "") this.#listService.setFilterableOptions(this.#defaultOptions);
48
+ else this.#listService.setFilterableOptions({
49
+ ...this.#defaultOptions,
50
+ ...options,
51
+ enabled: options.enabled ?? this.#defaultOptions.enabled
52
+ });
53
+ });
54
+ });
55
+ afterNextRender({ read: () => {
56
+ this.#listService.filterChange$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((filter) => {
57
+ this.filterChange.emit(filter);
58
+ });
59
+ } });
60
+ }
61
+ static {
62
+ this.ɵfac = i0.ɵɵngDeclareFactory({
63
+ minVersion: "12.0.0",
64
+ version: "22.2.6",
65
+ ngImport: i0,
66
+ type: DropdownFilterableDirective,
67
+ deps: [],
68
+ target: i0.ɵɵFactoryTarget.Directive
69
+ });
70
+ }
71
+ static {
72
+ this.ɵdir = i0.ɵɵngDeclareDirective({
73
+ minVersion: "17.1.0",
74
+ version: "22.2.6",
75
+ type: DropdownFilterableDirective,
76
+ isStandalone: true,
77
+ selector: "\n mona-auto-complete[monaDropDownFilterable],\n mona-dropdown-list[monaDropDownFilterable],\n mona-combo-box[monaDropDownFilterable],\n mona-multi-select[monaDropDownFilterable]\n ",
78
+ inputs: {
79
+ filter: {
80
+ classPropertyName: "filter",
81
+ publicName: "filter",
82
+ isSignal: true,
83
+ isRequired: false,
84
+ transformFunction: null
85
+ },
86
+ filterPlaceholder: {
87
+ classPropertyName: "filterPlaceholder",
88
+ publicName: "filterPlaceholder",
89
+ isSignal: true,
90
+ isRequired: false,
91
+ transformFunction: null
92
+ },
93
+ options: {
94
+ classPropertyName: "options",
95
+ publicName: "monaDropDownFilterable",
96
+ isSignal: true,
97
+ isRequired: false,
98
+ transformFunction: null
99
+ }
100
+ },
101
+ outputs: { filterChange: "filterChange" },
102
+ ngImport: i0
103
+ });
104
+ }
105
+ };
106
+ i0.ɵɵngDeclareClassMetadata({
107
+ minVersion: "12.0.0",
108
+ version: "22.2.6",
109
+ ngImport: i0,
110
+ type: DropdownFilterableDirective,
111
+ decorators: [{
112
+ type: Directive,
113
+ args: [{ selector: `
94
114
  mona-auto-complete[monaDropDownFilterable],
95
115
  mona-dropdown-list[monaDropDownFilterable],
96
116
  mona-combo-box[monaDropDownFilterable],
97
117
  mona-multi-select[monaDropDownFilterable]
98
- `
99
- }]
100
- }], ctorParameters: () => [], propDecorators: { filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }], filterPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterPlaceholder", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaDropDownFilterable", required: false }] }] } });
101
-
102
- class DropdownFooterTemplateDirective {
103
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownFooterTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
104
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: DropdownFooterTemplateDirective, isStandalone: true, selector: "\n ng-template[monaDropDownFooterTemplate],\n ng-template[monaAutoCompleteFooterTemplate],\n ng-template[monaDropDownListFooterTemplate],\n ng-template[monaDropDownTreeFooterTemplate],\n ng-template[monaComboBoxFooterTemplate],\n ng-template[monaMultiSelectFooterTemplate]\n ", ngImport: i0 }); }
105
- }
106
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownFooterTemplateDirective, decorators: [{
107
- type: Directive,
108
- args: [{
109
- selector: `
118
+ ` }]
119
+ }],
120
+ ctorParameters: () => [],
121
+ propDecorators: {
122
+ filter: [{
123
+ type: i0.Input,
124
+ args: [{
125
+ isSignal: true,
126
+ alias: "filter",
127
+ required: false
128
+ }]
129
+ }],
130
+ filterChange: [{
131
+ type: i0.Output,
132
+ args: ["filterChange"]
133
+ }],
134
+ filterPlaceholder: [{
135
+ type: i0.Input,
136
+ args: [{
137
+ isSignal: true,
138
+ alias: "filterPlaceholder",
139
+ required: false
140
+ }]
141
+ }],
142
+ options: [{
143
+ type: i0.Input,
144
+ args: [{
145
+ isSignal: true,
146
+ alias: "monaDropDownFilterable",
147
+ required: false
148
+ }]
149
+ }]
150
+ }
151
+ });
152
+ var DropdownFooterTemplateDirective = class DropdownFooterTemplateDirective {
153
+ static {
154
+ this.ɵfac = i0.ɵɵngDeclareFactory({
155
+ minVersion: "12.0.0",
156
+ version: "22.2.6",
157
+ ngImport: i0,
158
+ type: DropdownFooterTemplateDirective,
159
+ deps: [],
160
+ target: i0.ɵɵFactoryTarget.Directive
161
+ });
162
+ }
163
+ static {
164
+ this.ɵdir = i0.ɵɵngDeclareDirective({
165
+ minVersion: "14.0.0",
166
+ version: "22.2.6",
167
+ type: DropdownFooterTemplateDirective,
168
+ isStandalone: true,
169
+ selector: "\n ng-template[monaDropDownFooterTemplate],\n ng-template[monaAutoCompleteFooterTemplate],\n ng-template[monaDropDownListFooterTemplate],\n ng-template[monaDropDownTreeFooterTemplate],\n ng-template[monaComboBoxFooterTemplate],\n ng-template[monaMultiSelectFooterTemplate]\n ",
170
+ ngImport: i0
171
+ });
172
+ }
173
+ };
174
+ i0.ɵɵngDeclareClassMetadata({
175
+ minVersion: "12.0.0",
176
+ version: "22.2.6",
177
+ ngImport: i0,
178
+ type: DropdownFooterTemplateDirective,
179
+ decorators: [{
180
+ type: Directive,
181
+ args: [{ selector: `
110
182
  ng-template[monaDropDownFooterTemplate],
111
183
  ng-template[monaAutoCompleteFooterTemplate],
112
184
  ng-template[monaDropDownListFooterTemplate],
113
185
  ng-template[monaDropDownTreeFooterTemplate],
114
186
  ng-template[monaComboBoxFooterTemplate],
115
187
  ng-template[monaMultiSelectFooterTemplate]
116
- `
117
- }]
118
- }] });
119
-
120
- class DropdownGroupHeaderTemplateDirective {
121
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownGroupHeaderTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
122
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: DropdownGroupHeaderTemplateDirective, isStandalone: true, selector: "\n ng-template[monaDropDownGroupHeaderTemplate],\n ng-template[monaAutoCompleteGroupHeaderTemplate],\n ng-template[monaDropDownListGroupHeaderTemplate],\n ng-template[monaComboBoxGroupHeaderTemplate],\n ng-template[monaMultiSelectGroupHeaderTemplate]\n ", ngImport: i0 }); }
123
- }
124
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownGroupHeaderTemplateDirective, decorators: [{
125
- type: Directive,
126
- args: [{
127
- selector: `
188
+ ` }]
189
+ }]
190
+ });
191
+ var DropdownGroupHeaderTemplateDirective = class DropdownGroupHeaderTemplateDirective {
192
+ static {
193
+ this.ɵfac = i0.ɵɵngDeclareFactory({
194
+ minVersion: "12.0.0",
195
+ version: "22.2.6",
196
+ ngImport: i0,
197
+ type: DropdownGroupHeaderTemplateDirective,
198
+ deps: [],
199
+ target: i0.ɵɵFactoryTarget.Directive
200
+ });
201
+ }
202
+ static {
203
+ this.ɵdir = i0.ɵɵngDeclareDirective({
204
+ minVersion: "14.0.0",
205
+ version: "22.2.6",
206
+ type: DropdownGroupHeaderTemplateDirective,
207
+ isStandalone: true,
208
+ selector: "\n ng-template[monaDropDownGroupHeaderTemplate],\n ng-template[monaAutoCompleteGroupHeaderTemplate],\n ng-template[monaDropDownListGroupHeaderTemplate],\n ng-template[monaComboBoxGroupHeaderTemplate],\n ng-template[monaMultiSelectGroupHeaderTemplate]\n ",
209
+ ngImport: i0
210
+ });
211
+ }
212
+ };
213
+ i0.ɵɵngDeclareClassMetadata({
214
+ minVersion: "12.0.0",
215
+ version: "22.2.6",
216
+ ngImport: i0,
217
+ type: DropdownGroupHeaderTemplateDirective,
218
+ decorators: [{
219
+ type: Directive,
220
+ args: [{ selector: `
128
221
  ng-template[monaDropDownGroupHeaderTemplate],
129
222
  ng-template[monaAutoCompleteGroupHeaderTemplate],
130
223
  ng-template[monaDropDownListGroupHeaderTemplate],
131
224
  ng-template[monaComboBoxGroupHeaderTemplate],
132
225
  ng-template[monaMultiSelectGroupHeaderTemplate]
133
- `
134
- }]
135
- }] });
136
-
137
- class DropdownGroupableDirective {
138
- #defaultOptions;
139
- #listService;
140
- constructor() {
141
- this.#defaultOptions = {
142
- enabled: true,
143
- headerOrder: "asc"
144
- };
145
- this.#listService = inject(ListService);
146
- /** @description Property name, or accessor, used to derive an option's group. */
147
- this.groupBy = input("", /* @ts-ignore */
148
- ...(ngDevMode ? [{ debugName: "groupBy" }] : /* istanbul ignore next */ []));
149
- /**
150
- * @description Group header order, and optional per-group item ordering. An empty string enables grouping with
151
- * default settings (`headerOrder: "asc"`); pass an object to override any field.
152
- */
153
- this.options = input("", { ...(ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {}), alias: "monaDropDownGroupable" });
154
- effect(() => {
155
- const groupBy = this.groupBy() ?? "";
156
- untracked(() => this.#listService.setGroupBy(groupBy));
157
- });
158
- effect(() => {
159
- const options = this.options();
160
- untracked(() => {
161
- if (options === "") {
162
- this.#listService.setGroupableOptions(this.#defaultOptions);
163
- }
164
- else {
165
- this.#listService.setGroupableOptions({
166
- ...this.#defaultOptions,
167
- ...options,
168
- enabled: options.enabled ?? this.#defaultOptions.enabled
169
- });
170
- }
171
- });
172
- });
173
- }
174
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownGroupableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
175
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: DropdownGroupableDirective, isStandalone: true, selector: "\n mona-auto-complete[monaDropDownGroupable],\n mona-combo-box[monaDropDownGroupable],\n mona-dropdown-list[monaDropDownGroupable],\n mona-multi-select[monaDropDownGroupable]\n ", inputs: { groupBy: { classPropertyName: "groupBy", publicName: "groupBy", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "monaDropDownGroupable", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
176
- }
177
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownGroupableDirective, decorators: [{
178
- type: Directive,
179
- args: [{
180
- selector: `
226
+ ` }]
227
+ }]
228
+ });
229
+ var DropdownGroupableDirective = class DropdownGroupableDirective {
230
+ #defaultOptions;
231
+ #listService;
232
+ constructor() {
233
+ this.#defaultOptions = {
234
+ enabled: true,
235
+ headerOrder: "asc"
236
+ };
237
+ this.#listService = inject(ListService);
238
+ this.groupBy = input("", ...ngDevMode ? [{ debugName: "groupBy" }] : /* istanbul ignore next */ []);
239
+ this.options = input("", {
240
+ ...ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {},
241
+ alias: "monaDropDownGroupable"
242
+ });
243
+ effect(() => {
244
+ const groupBy = this.groupBy() ?? "";
245
+ untracked(() => this.#listService.setGroupBy(groupBy));
246
+ });
247
+ effect(() => {
248
+ const options = this.options();
249
+ untracked(() => {
250
+ if (options === "") this.#listService.setGroupableOptions(this.#defaultOptions);
251
+ else this.#listService.setGroupableOptions({
252
+ ...this.#defaultOptions,
253
+ ...options,
254
+ enabled: options.enabled ?? this.#defaultOptions.enabled
255
+ });
256
+ });
257
+ });
258
+ }
259
+ static {
260
+ this.ɵfac = i0.ɵɵngDeclareFactory({
261
+ minVersion: "12.0.0",
262
+ version: "22.2.6",
263
+ ngImport: i0,
264
+ type: DropdownGroupableDirective,
265
+ deps: [],
266
+ target: i0.ɵɵFactoryTarget.Directive
267
+ });
268
+ }
269
+ static {
270
+ this.ɵdir = i0.ɵɵngDeclareDirective({
271
+ minVersion: "17.1.0",
272
+ version: "22.2.6",
273
+ type: DropdownGroupableDirective,
274
+ isStandalone: true,
275
+ selector: "\n mona-auto-complete[monaDropDownGroupable],\n mona-combo-box[monaDropDownGroupable],\n mona-dropdown-list[monaDropDownGroupable],\n mona-multi-select[monaDropDownGroupable]\n ",
276
+ inputs: {
277
+ groupBy: {
278
+ classPropertyName: "groupBy",
279
+ publicName: "groupBy",
280
+ isSignal: true,
281
+ isRequired: false,
282
+ transformFunction: null
283
+ },
284
+ options: {
285
+ classPropertyName: "options",
286
+ publicName: "monaDropDownGroupable",
287
+ isSignal: true,
288
+ isRequired: false,
289
+ transformFunction: null
290
+ }
291
+ },
292
+ ngImport: i0
293
+ });
294
+ }
295
+ };
296
+ i0.ɵɵngDeclareClassMetadata({
297
+ minVersion: "12.0.0",
298
+ version: "22.2.6",
299
+ ngImport: i0,
300
+ type: DropdownGroupableDirective,
301
+ decorators: [{
302
+ type: Directive,
303
+ args: [{ selector: `
181
304
  mona-auto-complete[monaDropDownGroupable],
182
305
  mona-combo-box[monaDropDownGroupable],
183
306
  mona-dropdown-list[monaDropDownGroupable],
184
307
  mona-multi-select[monaDropDownGroupable]
185
- `
186
- }]
187
- }], ctorParameters: () => [], propDecorators: { groupBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupBy", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaDropDownGroupable", required: false }] }] } });
188
-
189
- class DropdownHeaderTemplateDirective {
190
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownHeaderTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
191
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: DropdownHeaderTemplateDirective, isStandalone: true, selector: "\n ng-template[monaDropDownHeaderTemplate],\n ng-template[monaAutoCompleteHeaderTemplate],\n ng-template[monaDropDownListHeaderTemplate],\n ng-template[monaDropDownTreeHeaderTemplate],\n ng-template[monaComboBoxHeaderTemplate],\n ng-template[monaMultiSelectHeaderTemplate]\n ", ngImport: i0 }); }
192
- }
193
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownHeaderTemplateDirective, decorators: [{
194
- type: Directive,
195
- args: [{
196
- selector: `
308
+ ` }]
309
+ }],
310
+ ctorParameters: () => [],
311
+ propDecorators: {
312
+ groupBy: [{
313
+ type: i0.Input,
314
+ args: [{
315
+ isSignal: true,
316
+ alias: "groupBy",
317
+ required: false
318
+ }]
319
+ }],
320
+ options: [{
321
+ type: i0.Input,
322
+ args: [{
323
+ isSignal: true,
324
+ alias: "monaDropDownGroupable",
325
+ required: false
326
+ }]
327
+ }]
328
+ }
329
+ });
330
+ var DropdownHeaderTemplateDirective = class DropdownHeaderTemplateDirective {
331
+ static {
332
+ this.ɵfac = i0.ɵɵngDeclareFactory({
333
+ minVersion: "12.0.0",
334
+ version: "22.2.6",
335
+ ngImport: i0,
336
+ type: DropdownHeaderTemplateDirective,
337
+ deps: [],
338
+ target: i0.ɵɵFactoryTarget.Directive
339
+ });
340
+ }
341
+ static {
342
+ this.ɵdir = i0.ɵɵngDeclareDirective({
343
+ minVersion: "14.0.0",
344
+ version: "22.2.6",
345
+ type: DropdownHeaderTemplateDirective,
346
+ isStandalone: true,
347
+ selector: "\n ng-template[monaDropDownHeaderTemplate],\n ng-template[monaAutoCompleteHeaderTemplate],\n ng-template[monaDropDownListHeaderTemplate],\n ng-template[monaDropDownTreeHeaderTemplate],\n ng-template[monaComboBoxHeaderTemplate],\n ng-template[monaMultiSelectHeaderTemplate]\n ",
348
+ ngImport: i0
349
+ });
350
+ }
351
+ };
352
+ i0.ɵɵngDeclareClassMetadata({
353
+ minVersion: "12.0.0",
354
+ version: "22.2.6",
355
+ ngImport: i0,
356
+ type: DropdownHeaderTemplateDirective,
357
+ decorators: [{
358
+ type: Directive,
359
+ args: [{ selector: `
197
360
  ng-template[monaDropDownHeaderTemplate],
198
361
  ng-template[monaAutoCompleteHeaderTemplate],
199
362
  ng-template[monaDropDownListHeaderTemplate],
200
363
  ng-template[monaDropDownTreeHeaderTemplate],
201
364
  ng-template[monaComboBoxHeaderTemplate],
202
365
  ng-template[monaMultiSelectHeaderTemplate]
203
- `
204
- }]
205
- }] });
206
-
207
- class DropdownItemTemplateDirective {
208
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownItemTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
209
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: DropdownItemTemplateDirective, isStandalone: true, selector: "\n ng-template[monaDropDownItemTemplate],\n ng-template[monaAutoCompleteItemTemplate],\n ng-template[monaDropDownListItemTemplate],\n ng-template[monaComboBoxItemTemplate],\n ng-template[monaMultiSelectItemTemplate]\n ", ngImport: i0 }); }
210
- }
211
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownItemTemplateDirective, decorators: [{
212
- type: Directive,
213
- args: [{
214
- selector: `
366
+ ` }]
367
+ }]
368
+ });
369
+ var DropdownItemTemplateDirective = class DropdownItemTemplateDirective {
370
+ static {
371
+ this.ɵfac = i0.ɵɵngDeclareFactory({
372
+ minVersion: "12.0.0",
373
+ version: "22.2.6",
374
+ ngImport: i0,
375
+ type: DropdownItemTemplateDirective,
376
+ deps: [],
377
+ target: i0.ɵɵFactoryTarget.Directive
378
+ });
379
+ }
380
+ static {
381
+ this.ɵdir = i0.ɵɵngDeclareDirective({
382
+ minVersion: "14.0.0",
383
+ version: "22.2.6",
384
+ type: DropdownItemTemplateDirective,
385
+ isStandalone: true,
386
+ selector: "\n ng-template[monaDropDownItemTemplate],\n ng-template[monaAutoCompleteItemTemplate],\n ng-template[monaDropDownListItemTemplate],\n ng-template[monaComboBoxItemTemplate],\n ng-template[monaMultiSelectItemTemplate]\n ",
387
+ ngImport: i0
388
+ });
389
+ }
390
+ };
391
+ i0.ɵɵngDeclareClassMetadata({
392
+ minVersion: "12.0.0",
393
+ version: "22.2.6",
394
+ ngImport: i0,
395
+ type: DropdownItemTemplateDirective,
396
+ decorators: [{
397
+ type: Directive,
398
+ args: [{ selector: `
215
399
  ng-template[monaDropDownItemTemplate],
216
400
  ng-template[monaAutoCompleteItemTemplate],
217
401
  ng-template[monaDropDownListItemTemplate],
218
402
  ng-template[monaComboBoxItemTemplate],
219
403
  ng-template[monaMultiSelectItemTemplate]
220
- `
221
- }]
222
- }] });
223
-
224
- class DropdownNoDataTemplateDirective {
225
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownNoDataTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
226
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: DropdownNoDataTemplateDirective, isStandalone: true, selector: "\n ng-template[monaDropDownNoDataTemplate],\n ng-template[monaAutoCompleteNoDataTemplate],\n ng-template[monaDropDownListNoDataTemplate],\n ng-template[monaDropDownTreeNoDataTemplate],\n ng-template[monaComboBoxNoDataTemplate],\n ng-template[monaMultiSelectNoDataTemplate]\n ", ngImport: i0 }); }
227
- }
228
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownNoDataTemplateDirective, decorators: [{
229
- type: Directive,
230
- args: [{
231
- selector: `
404
+ ` }]
405
+ }]
406
+ });
407
+ var DropdownNoDataTemplateDirective = class DropdownNoDataTemplateDirective {
408
+ static {
409
+ this.ɵfac = i0.ɵɵngDeclareFactory({
410
+ minVersion: "12.0.0",
411
+ version: "22.2.6",
412
+ ngImport: i0,
413
+ type: DropdownNoDataTemplateDirective,
414
+ deps: [],
415
+ target: i0.ɵɵFactoryTarget.Directive
416
+ });
417
+ }
418
+ static {
419
+ this.ɵdir = i0.ɵɵngDeclareDirective({
420
+ minVersion: "14.0.0",
421
+ version: "22.2.6",
422
+ type: DropdownNoDataTemplateDirective,
423
+ isStandalone: true,
424
+ selector: "\n ng-template[monaDropDownNoDataTemplate],\n ng-template[monaAutoCompleteNoDataTemplate],\n ng-template[monaDropDownListNoDataTemplate],\n ng-template[monaDropDownTreeNoDataTemplate],\n ng-template[monaComboBoxNoDataTemplate],\n ng-template[monaMultiSelectNoDataTemplate]\n ",
425
+ ngImport: i0
426
+ });
427
+ }
428
+ };
429
+ i0.ɵɵngDeclareClassMetadata({
430
+ minVersion: "12.0.0",
431
+ version: "22.2.6",
432
+ ngImport: i0,
433
+ type: DropdownNoDataTemplateDirective,
434
+ decorators: [{
435
+ type: Directive,
436
+ args: [{ selector: `
232
437
  ng-template[monaDropDownNoDataTemplate],
233
438
  ng-template[monaAutoCompleteNoDataTemplate],
234
439
  ng-template[monaDropDownListNoDataTemplate],
235
440
  ng-template[monaDropDownTreeNoDataTemplate],
236
441
  ng-template[monaComboBoxNoDataTemplate],
237
442
  ng-template[monaMultiSelectNoDataTemplate]
238
- `
239
- }]
240
- }] });
241
-
242
- class DropdownVirtualScrollDirective {
243
- #defaultOptions;
244
- #listService;
245
- constructor() {
246
- this.#defaultOptions = {
247
- enabled: true,
248
- height: 28
249
- };
250
- this.#listService = inject(ListService);
251
- /**
252
- * @description Whether virtual scrolling is enabled and the pixel height of a single option row. An empty string
253
- * enables virtual scrolling with default settings (`height: 28`); pass an object to override either field.
254
- */
255
- this.options = input("", { ...(ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {}), alias: "monaDropDownVirtualScroll" });
256
- effect(() => {
257
- const options = this.options();
258
- untracked(() => {
259
- if (options === "") {
260
- this.#listService.setVirtualScrollOptions(this.#defaultOptions);
261
- }
262
- else {
263
- this.#listService.setVirtualScrollOptions({
264
- ...this.#defaultOptions,
265
- ...options,
266
- enabled: options.enabled ?? this.#defaultOptions.enabled
267
- });
268
- }
269
- });
270
- });
271
- }
272
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownVirtualScrollDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
273
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: DropdownVirtualScrollDirective, isStandalone: true, selector: "\n mona-auto-complete[monaDropDownVirtualScroll],\n mona-dropdown-list[monaDropDownVirtualScroll],\n mona-combo-box[monaDropDownVirtualScroll],\n mona-multi-select[monaDropDownVirtualScroll]\n ", inputs: { options: { classPropertyName: "options", publicName: "monaDropDownVirtualScroll", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
274
- }
275
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownVirtualScrollDirective, decorators: [{
276
- type: Directive,
277
- args: [{
278
- selector: `
443
+ ` }]
444
+ }]
445
+ });
446
+ var DropdownVirtualScrollDirective = class DropdownVirtualScrollDirective {
447
+ #defaultOptions;
448
+ #listService;
449
+ constructor() {
450
+ this.#defaultOptions = {
451
+ enabled: true,
452
+ height: 28
453
+ };
454
+ this.#listService = inject(ListService);
455
+ this.options = input("", {
456
+ ...ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {},
457
+ alias: "monaDropDownVirtualScroll"
458
+ });
459
+ effect(() => {
460
+ const options = this.options();
461
+ untracked(() => {
462
+ if (options === "") this.#listService.setVirtualScrollOptions(this.#defaultOptions);
463
+ else this.#listService.setVirtualScrollOptions({
464
+ ...this.#defaultOptions,
465
+ ...options,
466
+ enabled: options.enabled ?? this.#defaultOptions.enabled
467
+ });
468
+ });
469
+ });
470
+ }
471
+ static {
472
+ this.ɵfac = i0.ɵɵngDeclareFactory({
473
+ minVersion: "12.0.0",
474
+ version: "22.2.6",
475
+ ngImport: i0,
476
+ type: DropdownVirtualScrollDirective,
477
+ deps: [],
478
+ target: i0.ɵɵFactoryTarget.Directive
479
+ });
480
+ }
481
+ static {
482
+ this.ɵdir = i0.ɵɵngDeclareDirective({
483
+ minVersion: "17.1.0",
484
+ version: "22.2.6",
485
+ type: DropdownVirtualScrollDirective,
486
+ isStandalone: true,
487
+ selector: "\n mona-auto-complete[monaDropDownVirtualScroll],\n mona-dropdown-list[monaDropDownVirtualScroll],\n mona-combo-box[monaDropDownVirtualScroll],\n mona-multi-select[monaDropDownVirtualScroll]\n ",
488
+ inputs: { options: {
489
+ classPropertyName: "options",
490
+ publicName: "monaDropDownVirtualScroll",
491
+ isSignal: true,
492
+ isRequired: false,
493
+ transformFunction: null
494
+ } },
495
+ ngImport: i0
496
+ });
497
+ }
498
+ };
499
+ i0.ɵɵngDeclareClassMetadata({
500
+ minVersion: "12.0.0",
501
+ version: "22.2.6",
502
+ ngImport: i0,
503
+ type: DropdownVirtualScrollDirective,
504
+ decorators: [{
505
+ type: Directive,
506
+ args: [{ selector: `
279
507
  mona-auto-complete[monaDropDownVirtualScroll],
280
508
  mona-dropdown-list[monaDropDownVirtualScroll],
281
509
  mona-combo-box[monaDropDownVirtualScroll],
282
510
  mona-multi-select[monaDropDownVirtualScroll]
283
- `
284
- }]
285
- }], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaDropDownVirtualScroll", required: false }] }] } });
286
-
287
- class DropdownDataHandlerDirective {
288
- #host = inject(DROPDOWN_DATA_INPUT_TOKEN);
289
- #listService = inject(ListService);
290
- constructor() {
291
- effect(() => {
292
- const data = this.#host.data();
293
- untracked(() => this.#listService.setData(data));
294
- });
295
- effect(() => {
296
- const itemDisabled = this.#host.itemDisabled() ?? "";
297
- untracked(() => this.#listService.setDisabledBy(itemDisabled));
298
- });
299
- effect(() => {
300
- const textField = this.#host.textField() ?? "";
301
- untracked(() => this.#listService.setTextField(textField));
302
- });
303
- effect(() => {
304
- const valueField = this.#host.valueField() ?? "";
305
- untracked(() => this.#listService.setValueField(valueField));
306
- });
307
- }
308
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownDataHandlerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
309
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: DropdownDataHandlerDirective, isStandalone: true, selector: "[monaDropdownDataHandler]", ngImport: i0 }); }
310
- }
311
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownDataHandlerDirective, decorators: [{
312
- type: Directive,
313
- args: [{
314
- selector: "[monaDropdownDataHandler]"
315
- }]
316
- }], ctorParameters: () => [] });
317
-
318
- class DropdownListService {
319
- constructor() {
320
- this.navigate$ = new Subject();
321
- }
322
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownListService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
323
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownListService }); }
324
- }
325
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownListService, decorators: [{
326
- type: Injectable
327
- }] });
328
-
329
- /**
330
- * @hidden
331
- * The state one dropdown shares with its popup handlers and live region. Each dropdown provides its own; the date and
332
- * time pickers use it too, which is why it is exported. Applications don't need it.
333
- */
334
- class DropdownService {
335
- constructor() {
336
- /**
337
- * Every key the dropdown's host receives (outside IME composition), before the dropdown handles it. Call
338
- * `preventDefault()` on the event to skip the built-in handling.
339
- */
340
- this.beforeKeydown$ = new Subject();
341
- /**
342
- * ArrowDown or ArrowUp on the host, before the dropdown opens, closes or moves through the list. Call
343
- * `preventDefault()` on the event to skip the built-in handling.
344
- */
345
- this.beforeNavigate$ = new Subject();
346
- /**
347
- * Set when the popup finishes closing: whether focus may return to the dropdown. It is `false` when the user
348
- * moved focus outside the dropdown and its popup first, for example by clicking another field or pressing
349
- * Tab. Read it from `popupCloseComplete$` before calling `focus()`.
350
- */
351
- this.focusCanReturn = signal(true, /* @ts-ignore */
352
- ...(ngDevMode ? [{ debugName: "focusCanReturn" }] : /* istanbul ignore next */ []));
353
- /**
354
- * Keys the dropdown has no built-in handling for, and Enter before it toggles the popup. Calling `preventDefault()`
355
- * on an Enter key stops the toggle.
356
- */
357
- this.keydown$ = new Subject();
358
- /**
359
- * Emits when the popup has closed and its leave animation has finished, with the close event. By then
360
- * `popupRef` is `null` and {@link focusCanReturn} is set.
361
- */
362
- this.popupCloseComplete$ = new Subject();
363
- /** Emits when the popup's close sequence starts, before its leave animation, with the close event. */
364
- this.popupCloseStart$ = new Subject();
365
- /** Emits on the next task after the popup is created, together with the host's `opened` event. */
366
- this.popupOpenComplete$ = new Subject();
367
- /** The open popup, or `null` while it is closed. */
368
- this.popupRef = signal(null, /* @ts-ignore */
369
- ...(ngDevMode ? [{ debugName: "popupRef" }] : /* istanbul ignore next */ []));
370
- /** The template rendered as the popup's content. Each dropdown component sets it to its own popup template. */
371
- this.popupTemplate = signal(null, /* @ts-ignore */
372
- ...(ngDevMode ? [{ debugName: "popupTemplate" }] : /* istanbul ignore next */ []));
373
- /**
374
- * Whether focus returns to the dropdown when the popup closes, passed to the popup as its `restoreFocus` setting.
375
- * The auto-complete sets it to `false`.
376
- */
377
- this.restoreFocus = signal("auto", /* @ts-ignore */
378
- ...(ngDevMode ? [{ debugName: "restoreFocus" }] : /* istanbul ignore next */ []));
379
- /**
380
- * Opens the popup with the given settings when it is closed. Does nothing while the host is disabled or read-only,
381
- * or when the `open` event is prevented.
382
- */
383
- this.triggerPopupOpen$ = new Subject();
384
- /** Closes the popup when it is open, and otherwise opens it as {@link triggerPopupOpen$} does. */
385
- this.triggerPopupToggle$ = new Subject();
386
- }
387
- static getDefaultPositions() {
388
- return [
389
- new ConnectionPositionPair({ originX: "start", originY: "bottom" }, { overlayX: "start", overlayY: "top" }, -1, 0, "mona-dropdown-popup-content-bottom"),
390
- new ConnectionPositionPair({ originX: "start", originY: "top" }, { overlayX: "start", overlayY: "bottom" }, -1, -1, "mona-dropdown-popup-content-top")
391
- ];
392
- }
393
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
394
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownService }); }
395
- }
396
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownService, decorators: [{
397
- type: Injectable
398
- }] });
399
-
400
- /** @hidden Exported for Mona UI's other entry points; applications don't need it. */
401
- class DropdownPopupHandlerDirective {
402
- #destroyRef = inject(DestroyRef);
403
- #document = inject(DOCUMENT);
404
- #dropdownService = inject(DropdownService);
405
- #host = inject(DROPDOWN_POPUP_INPUT_TOKEN);
406
- #hostElementRef = inject((ElementRef));
407
- #popupService = inject(PopupService);
408
- constructor() {
409
- afterNextRender({
410
- read: () => {
411
- this.#dropdownService.triggerPopupOpen$
412
- .pipe(takeUntilDestroyed(this.#destroyRef))
413
- .subscribe(s => this.openPopup(s));
414
- this.#dropdownService.triggerPopupToggle$
415
- .pipe(takeUntilDestroyed(this.#destroyRef))
416
- .subscribe(s => this.togglePopup(s));
417
- }
418
- });
419
- this.#destroyRef.onDestroy(() => this.closePopup());
420
- }
421
- closePopup() {
422
- this.#dropdownService.popupRef()?.close();
423
- }
424
- getMaxHeight(maxHeight, height) {
425
- if (typeof maxHeight === "number") {
426
- return maxHeight;
427
- }
428
- if (maxHeight === "auto" && height === "auto") {
429
- return "auto";
430
- }
431
- if (!maxHeight || maxHeight === "auto") {
432
- if (!height || height === "auto") {
433
- return 200;
434
- }
435
- return height;
436
- }
437
- return maxHeight ?? 200;
438
- }
439
- getMinWidth(minWidth, width) {
440
- if (typeof minWidth === "number") {
441
- return minWidth;
442
- }
443
- if (!minWidth || minWidth === "auto") {
444
- if (!width || width === "auto") {
445
- return this.#hostElementRef.nativeElement.getBoundingClientRect().width;
446
- }
447
- return width;
448
- }
449
- return minWidth ?? this.#hostElementRef.nativeElement.getBoundingClientRect().width;
450
- }
451
- openPopup(settings) {
452
- let popupRef = this.#dropdownService.popupRef();
453
- if (popupRef || this.#host.disabled() || this.#host.readonly()) {
454
- return;
455
- }
456
- const event = new PreventableEvent("popupOpen");
457
- this.#host.open.emit(event);
458
- if (event.isDefaultPrevented()) {
459
- return;
460
- }
461
- const anchor = this.#hostElementRef.nativeElement;
462
- const anchorConnectionPoint = settings.anchorConnectionPoint ?? "bottomleft";
463
- const content = this.#dropdownService.popupTemplate();
464
- const closeOnOutsideClick = settings.closeOnOutsideClick ?? true;
465
- const closeOnScroll = settings.closeOnScroll ?? true;
466
- const hasBackdrop = settings.hasBackdrop ?? false;
467
- const height = settings.height;
468
- // The host's popupHeight caps the popup; shorter lists still shrink to fit.
469
- const maxHeight = this.getMaxHeight(settings.maxHeight ?? (this.#host.popupHeight() || undefined), height);
470
- const minWidth = this.getMinWidth(settings.minWidth, settings.width);
471
- const offset = settings.offset ?? { horizontal: 0, vertical: 4 };
472
- const popupConnectionPoint = settings.popupConnectionPoint ?? "topleft";
473
- const restoreFocus = this.#dropdownService.restoreFocus();
474
- const width = settings.width ?? (this.#host.popupWidth() || anchor.getBoundingClientRect().width);
475
- const withPush = settings.withPush ?? false;
476
- const withScrollTracking = settings.withScrollTracking ?? false;
477
- popupRef = this.#popupService.create({
478
- anchor,
479
- anchorConnectionPoint,
480
- animation: dropdownPopupAnimation,
481
- content,
482
- closeOnOutsideClick,
483
- closeOnScroll,
484
- hasBackdrop,
485
- height,
486
- maxHeight,
487
- minWidth,
488
- offset,
489
- popupConnectionPoint,
490
- restoreFocus,
491
- width,
492
- withPush,
493
- withScrollTracking
494
- });
495
- this.#dropdownService.popupRef.set(popupRef);
496
- this.setPopupCloseSubscriptions(popupRef);
497
- window.setTimeout(() => {
498
- this.#dropdownService.popupOpenComplete$.next();
499
- this.#host.opened.emit();
500
- });
501
- }
502
- setPopupCloseSubscriptions(popupRef) {
503
- popupRef.beforeClose.pipe(takeUntil(popupRef.closed)).subscribe(event => {
504
- this.#host.close.emit(event);
505
- });
506
- popupRef.closeStart.pipe(takeUntil(popupRef.closed)).subscribe(event => {
507
- this.#dropdownService.popupCloseStart$.next(event);
508
- });
509
- popupRef.closed.pipe(take(1)).subscribe(event => {
510
- // Checked before the overlay is disposed, while focus inside the popup is still there to see.
511
- this.#dropdownService.focusCanReturn.set(focusCanReturn(this.#document, this.#hostElementRef.nativeElement, popupRef.overlayRef.overlayElement));
512
- this.#dropdownService.popupRef.set(null);
513
- this.#dropdownService.popupCloseComplete$.next(event);
514
- this.#host.closed.emit();
515
- });
516
- }
517
- togglePopup(settings) {
518
- if (this.#dropdownService.popupRef()) {
519
- this.closePopup();
520
- return;
521
- }
522
- this.openPopup(settings);
523
- }
524
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownPopupHandlerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
525
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: DropdownPopupHandlerDirective, isStandalone: true, selector: "[monaDropdownPopupHandler]", ngImport: i0 }); }
526
- }
527
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownPopupHandlerDirective, decorators: [{
528
- type: Directive,
529
- args: [{
530
- selector: "[monaDropdownPopupHandler]"
531
- }]
532
- }], ctorParameters: () => [] });
533
-
534
- class DropdownListPopupHandlerDirective {
535
- #destroyRef = inject(DestroyRef);
536
- #dropdownListService = inject(DropdownListService, { optional: true });
537
- #dropdownService = inject(DropdownService);
538
- #host = inject(DROPDOWN_POPUP_INPUT_TOKEN);
539
- #hostElementRef = inject(ElementRef);
540
- #listService = inject(ListService);
541
- #popupClosed$ = toObservable(this.#dropdownService.popupRef).pipe(filter(popupRef => !!popupRef), switchMap(popupRef => popupRef.closed.pipe(take(1))));
542
- #popupOpened$ = toObservable(this.#dropdownService.popupRef).pipe(filter(popupRef => !!popupRef), switchMap(popupRef => popupRef.opened.pipe(take(1))));
543
- constructor() {
544
- afterNextRender({
545
- read: () => {
546
- this.setKeyboardEvents();
547
- this.#popupClosed$
548
- .pipe(takeUntilDestroyed(this.#destroyRef))
549
- .subscribe(() => this.setPopupCloseSubscriptions());
550
- this.#popupOpened$
551
- .pipe(takeUntilDestroyed(this.#destroyRef))
552
- .subscribe(() => this.handleScrollOnPopupOpen());
553
- }
554
- });
555
- }
556
- closePopup() {
557
- this.#dropdownService.popupRef()?.close();
558
- }
559
- handleArrowKeys(event) {
560
- const navigateEvent = new PreventableEvent("beforeNavigate", event);
561
- this.#dropdownService.beforeNavigate$.next(navigateEvent);
562
- if (navigateEvent.isDefaultPrevented()) {
563
- return;
564
- }
565
- event.preventDefault();
566
- if (event.altKey) {
567
- if (event.key === "ArrowDown") {
568
- this.#dropdownService.triggerPopupOpen$.next({});
569
- }
570
- else {
571
- this.closePopup();
572
- }
573
- return;
574
- }
575
- const previousItem = this.#listService.selectedListItems().lastOrDefault();
576
- const direction = event.key === "ArrowDown" ? "next" : "previous";
577
- const mode = this.#listService.navigableOptions().mode;
578
- const item = this.#listService.navigate(direction, mode, false);
579
- if (!item || previousItem === item) {
580
- return;
581
- }
582
- this.#dropdownListService?.navigate$.next({ item });
583
- }
584
- handleKeyDown(e) {
585
- // Keys pressed while an IME is composing text (Enter to confirm a conversion, arrows to pick a candidate)
586
- // belong to the IME. Safari reports the confirming Enter with isComposing false but keyCode 229.
587
- if (e.isComposing || e.keyCode === 229) {
588
- return;
589
- }
590
- const event = new PreventableEvent("beforeKeydown", e);
591
- this.#dropdownService.beforeKeydown$.next(event);
592
- if (event.isDefaultPrevented()) {
593
- return;
594
- }
595
- if (e.key === "ArrowDown" || e.key === "ArrowUp") {
596
- this.handleArrowKeys(e);
597
- }
598
- else if (e.key === "Escape") {
599
- this.#dropdownService
600
- .popupRef()
601
- ?.close(new PopupCloseEvent({ event: e, originalEvent: e, via: PopupCloseSource.Escape }));
602
- }
603
- else if (e.key === "Tab") {
604
- this.closePopup();
605
- }
606
- else if (e.key === " ") {
607
- e.preventDefault();
608
- this.#dropdownService.triggerPopupToggle$.next({});
609
- }
610
- else if (e.key === "Enter") {
611
- this.#dropdownService.keydown$.next(e);
612
- if (e.defaultPrevented) {
613
- return;
614
- }
615
- this.#dropdownService.triggerPopupToggle$.next({});
616
- }
617
- else {
618
- this.#dropdownService.keydown$.next(e);
619
- }
620
- }
621
- handleScrollOnPopupOpen() {
622
- const selectedDataItem = this.#listService.selectedListItems().lastOrDefault();
623
- const highlightedItem = this.#listService.highlightedItem();
624
- if (selectedDataItem) {
625
- this.scrollToSelectedItem();
626
- }
627
- else if (highlightedItem) {
628
- this.scrollToHighlightedItem();
629
- }
630
- }
631
- scrollToHighlightedItem() {
632
- const highlightedItem = this.#listService.highlightedItem();
633
- if (!highlightedItem) {
634
- return;
635
- }
636
- window.setTimeout(() => this.#listService.scrollToItem(highlightedItem, false));
637
- }
638
- scrollToSelectedItem() {
639
- const item = this.#listService.selectedListItems().lastOrDefault();
640
- if (!item) {
641
- return;
642
- }
643
- window.setTimeout(() => this.#listService.scrollToItem(item, false));
644
- }
645
- setKeyboardEvents() {
646
- fromEvent(this.#hostElementRef.nativeElement, "click")
647
- .pipe(takeUntilDestroyed(this.#destroyRef), filter(e => !this.#host.disabled() &&
648
- !this.#host.readonly() &&
649
- !!e.target &&
650
- e.target.tagName !== "INPUT"))
651
- .subscribe(() => this.#dropdownService.triggerPopupToggle$.next({}));
652
- fromEvent(this.#hostElementRef.nativeElement, "keydown")
653
- .pipe(takeUntilDestroyed(this.#destroyRef), filter(() => !this.#host.disabled() && !this.#host.readonly()))
654
- .subscribe(e => this.handleKeyDown(e));
655
- }
656
- setPopupCloseSubscriptions() {
657
- this.#listService.clearHighlightedItem();
658
- this.#listService.clearFilter();
659
- }
660
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownListPopupHandlerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
661
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: DropdownListPopupHandlerDirective, isStandalone: true, selector: "[monaDropdownListPopupHandler]", hostDirectives: [{ directive: DropdownPopupHandlerDirective }], ngImport: i0 }); }
662
- }
663
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownListPopupHandlerDirective, decorators: [{
664
- type: Directive,
665
- args: [{
666
- selector: "[monaDropdownListPopupHandler]",
667
- hostDirectives: [DropdownPopupHandlerDirective]
668
- }]
669
- }], ctorParameters: () => [] });
670
-
671
- // Generated from i18n/catalogs/en-US.messages.json by scripts/generate-locale-catalogs.ts. Do not edit.
672
- // Edit the JSON file and run `npm run generate:locale-catalogs`.
511
+ ` }]
512
+ }],
513
+ ctorParameters: () => [],
514
+ propDecorators: { options: [{
515
+ type: i0.Input,
516
+ args: [{
517
+ isSignal: true,
518
+ alias: "monaDropDownVirtualScroll",
519
+ required: false
520
+ }]
521
+ }] }
522
+ });
523
+ var DropdownDataHandlerDirective = class DropdownDataHandlerDirective {
524
+ #host = inject(DROPDOWN_DATA_INPUT_TOKEN);
525
+ #listService = inject(ListService);
526
+ constructor() {
527
+ effect(() => {
528
+ const data = this.#host.data();
529
+ untracked(() => this.#listService.setData(data));
530
+ });
531
+ effect(() => {
532
+ const itemDisabled = this.#host.itemDisabled() ?? "";
533
+ untracked(() => this.#listService.setDisabledBy(itemDisabled));
534
+ });
535
+ effect(() => {
536
+ const textField = this.#host.textField() ?? "";
537
+ untracked(() => this.#listService.setTextField(textField));
538
+ });
539
+ effect(() => {
540
+ const valueField = this.#host.valueField() ?? "";
541
+ untracked(() => this.#listService.setValueField(valueField));
542
+ });
543
+ }
544
+ static {
545
+ this.ɵfac = i0.ɵɵngDeclareFactory({
546
+ minVersion: "12.0.0",
547
+ version: "22.2.6",
548
+ ngImport: i0,
549
+ type: DropdownDataHandlerDirective,
550
+ deps: [],
551
+ target: i0.ɵɵFactoryTarget.Directive
552
+ });
553
+ }
554
+ static {
555
+ this.ɵdir = i0.ɵɵngDeclareDirective({
556
+ minVersion: "14.0.0",
557
+ version: "22.2.6",
558
+ type: DropdownDataHandlerDirective,
559
+ isStandalone: true,
560
+ selector: "[monaDropdownDataHandler]",
561
+ ngImport: i0
562
+ });
563
+ }
564
+ };
565
+ i0.ɵɵngDeclareClassMetadata({
566
+ minVersion: "12.0.0",
567
+ version: "22.2.6",
568
+ ngImport: i0,
569
+ type: DropdownDataHandlerDirective,
570
+ decorators: [{
571
+ type: Directive,
572
+ args: [{ selector: "[monaDropdownDataHandler]" }]
573
+ }],
574
+ ctorParameters: () => []
575
+ });
576
+ var DropdownListService = class DropdownListService {
577
+ constructor() {
578
+ this.navigate$ = new Subject();
579
+ }
580
+ static {
581
+ this.ɵfac = i0.ɵɵngDeclareFactory({
582
+ minVersion: "12.0.0",
583
+ version: "22.2.6",
584
+ ngImport: i0,
585
+ type: DropdownListService,
586
+ deps: [],
587
+ target: i0.ɵɵFactoryTarget.Injectable
588
+ });
589
+ }
590
+ static {
591
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
592
+ minVersion: "12.0.0",
593
+ version: "22.2.6",
594
+ ngImport: i0,
595
+ type: DropdownListService
596
+ });
597
+ }
598
+ };
599
+ i0.ɵɵngDeclareClassMetadata({
600
+ minVersion: "12.0.0",
601
+ version: "22.2.6",
602
+ ngImport: i0,
603
+ type: DropdownListService,
604
+ decorators: [{ type: Injectable }]
605
+ });
606
+ var DropdownService = class DropdownService {
607
+ constructor() {
608
+ this.beforeKeydown$ = new Subject();
609
+ this.beforeNavigate$ = new Subject();
610
+ this.focusCanReturn = signal(true, ...ngDevMode ? [{ debugName: "focusCanReturn" }] : /* istanbul ignore next */ []);
611
+ this.keydown$ = new Subject();
612
+ this.popupCloseComplete$ = new Subject();
613
+ this.popupCloseStart$ = new Subject();
614
+ this.popupOpenComplete$ = new Subject();
615
+ this.popupRef = signal(null, ...ngDevMode ? [{ debugName: "popupRef" }] : /* istanbul ignore next */ []);
616
+ this.popupTemplate = signal(null, ...ngDevMode ? [{ debugName: "popupTemplate" }] : /* istanbul ignore next */ []);
617
+ this.restoreFocus = signal("auto", ...ngDevMode ? [{ debugName: "restoreFocus" }] : /* istanbul ignore next */ []);
618
+ this.triggerPopupOpen$ = new Subject();
619
+ this.triggerPopupToggle$ = new Subject();
620
+ }
621
+ static getDefaultPositions() {
622
+ return [new ConnectionPositionPair({
623
+ originX: "start",
624
+ originY: "bottom"
625
+ }, {
626
+ overlayX: "start",
627
+ overlayY: "top"
628
+ }, -1, 0, "mona-dropdown-popup-content-bottom"), new ConnectionPositionPair({
629
+ originX: "start",
630
+ originY: "top"
631
+ }, {
632
+ overlayX: "start",
633
+ overlayY: "bottom"
634
+ }, -1, -1, "mona-dropdown-popup-content-top")];
635
+ }
636
+ static {
637
+ this.ɵfac = i0.ɵɵngDeclareFactory({
638
+ minVersion: "12.0.0",
639
+ version: "22.2.6",
640
+ ngImport: i0,
641
+ type: DropdownService,
642
+ deps: [],
643
+ target: i0.ɵɵFactoryTarget.Injectable
644
+ });
645
+ }
646
+ static {
647
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
648
+ minVersion: "12.0.0",
649
+ version: "22.2.6",
650
+ ngImport: i0,
651
+ type: DropdownService
652
+ });
653
+ }
654
+ };
655
+ i0.ɵɵngDeclareClassMetadata({
656
+ minVersion: "12.0.0",
657
+ version: "22.2.6",
658
+ ngImport: i0,
659
+ type: DropdownService,
660
+ decorators: [{ type: Injectable }]
661
+ });
662
+ var DropdownPopupHandlerDirective = class DropdownPopupHandlerDirective {
663
+ #destroyRef = inject(DestroyRef);
664
+ #document = inject(DOCUMENT);
665
+ #dropdownService = inject(DropdownService);
666
+ #host = inject(DROPDOWN_POPUP_INPUT_TOKEN);
667
+ #hostElementRef = inject(ElementRef);
668
+ #popupService = inject(PopupService);
669
+ constructor() {
670
+ afterNextRender({ read: () => {
671
+ this.#dropdownService.triggerPopupOpen$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((s) => this.openPopup(s));
672
+ this.#dropdownService.triggerPopupToggle$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((s) => this.togglePopup(s));
673
+ } });
674
+ this.#destroyRef.onDestroy(() => this.closePopup());
675
+ }
676
+ closePopup() {
677
+ this.#dropdownService.popupRef()?.close();
678
+ }
679
+ getMaxHeight(maxHeight, height) {
680
+ if (typeof maxHeight === "number") return maxHeight;
681
+ if (maxHeight === "auto" && height === "auto") return "auto";
682
+ if (!maxHeight || maxHeight === "auto") {
683
+ if (!height || height === "auto") return 200;
684
+ return height;
685
+ }
686
+ return maxHeight ?? 200;
687
+ }
688
+ getMinWidth(minWidth, width) {
689
+ if (typeof minWidth === "number") return minWidth;
690
+ if (!minWidth || minWidth === "auto") {
691
+ if (!width || width === "auto") return this.#hostElementRef.nativeElement.getBoundingClientRect().width;
692
+ return width;
693
+ }
694
+ return minWidth ?? this.#hostElementRef.nativeElement.getBoundingClientRect().width;
695
+ }
696
+ openPopup(settings) {
697
+ let popupRef = this.#dropdownService.popupRef();
698
+ if (popupRef || this.#host.disabled() || this.#host.readonly()) return;
699
+ const event = new PreventableEvent("popupOpen");
700
+ this.#host.open.emit(event);
701
+ if (event.isDefaultPrevented()) return;
702
+ const anchor = this.#hostElementRef.nativeElement;
703
+ const anchorConnectionPoint = settings.anchorConnectionPoint ?? "bottomleft";
704
+ const content = this.#dropdownService.popupTemplate();
705
+ const closeOnOutsideClick = settings.closeOnOutsideClick ?? true;
706
+ const closeOnScroll = settings.closeOnScroll ?? true;
707
+ const hasBackdrop = settings.hasBackdrop ?? false;
708
+ const height = settings.height;
709
+ const maxHeight = this.getMaxHeight(settings.maxHeight ?? (this.#host.popupHeight() || void 0), height);
710
+ const minWidth = this.getMinWidth(settings.minWidth, settings.width);
711
+ const offset = settings.offset ?? {
712
+ horizontal: 0,
713
+ vertical: 4
714
+ };
715
+ const popupConnectionPoint = settings.popupConnectionPoint ?? "topleft";
716
+ const restoreFocus = this.#dropdownService.restoreFocus();
717
+ const width = settings.width ?? (this.#host.popupWidth() || anchor.getBoundingClientRect().width);
718
+ const withPush = settings.withPush ?? false;
719
+ const withScrollTracking = settings.withScrollTracking ?? false;
720
+ popupRef = this.#popupService.create({
721
+ anchor,
722
+ anchorConnectionPoint,
723
+ animation: dropdownPopupAnimation,
724
+ content,
725
+ closeOnOutsideClick,
726
+ closeOnScroll,
727
+ hasBackdrop,
728
+ height,
729
+ maxHeight,
730
+ minWidth,
731
+ offset,
732
+ popupConnectionPoint,
733
+ restoreFocus,
734
+ width,
735
+ withPush,
736
+ withScrollTracking
737
+ });
738
+ this.#dropdownService.popupRef.set(popupRef);
739
+ this.setPopupCloseSubscriptions(popupRef);
740
+ window.setTimeout(() => {
741
+ this.#dropdownService.popupOpenComplete$.next();
742
+ this.#host.opened.emit();
743
+ });
744
+ }
745
+ setPopupCloseSubscriptions(popupRef) {
746
+ popupRef.beforeClose.pipe(takeUntil(popupRef.closed)).subscribe((event) => {
747
+ this.#host.close.emit(event);
748
+ });
749
+ popupRef.closeStart.pipe(takeUntil(popupRef.closed)).subscribe((event) => {
750
+ this.#dropdownService.popupCloseStart$.next(event);
751
+ });
752
+ popupRef.closed.pipe(take(1)).subscribe((event) => {
753
+ this.#dropdownService.focusCanReturn.set(focusCanReturn(this.#document, this.#hostElementRef.nativeElement, popupRef.overlayRef.overlayElement));
754
+ this.#dropdownService.popupRef.set(null);
755
+ this.#dropdownService.popupCloseComplete$.next(event);
756
+ this.#host.closed.emit();
757
+ });
758
+ }
759
+ togglePopup(settings) {
760
+ if (this.#dropdownService.popupRef()) {
761
+ this.closePopup();
762
+ return;
763
+ }
764
+ this.openPopup(settings);
765
+ }
766
+ static {
767
+ this.ɵfac = i0.ɵɵngDeclareFactory({
768
+ minVersion: "12.0.0",
769
+ version: "22.2.6",
770
+ ngImport: i0,
771
+ type: DropdownPopupHandlerDirective,
772
+ deps: [],
773
+ target: i0.ɵɵFactoryTarget.Directive
774
+ });
775
+ }
776
+ static {
777
+ this.ɵdir = i0.ɵɵngDeclareDirective({
778
+ minVersion: "14.0.0",
779
+ version: "22.2.6",
780
+ type: DropdownPopupHandlerDirective,
781
+ isStandalone: true,
782
+ selector: "[monaDropdownPopupHandler]",
783
+ ngImport: i0
784
+ });
785
+ }
786
+ };
787
+ i0.ɵɵngDeclareClassMetadata({
788
+ minVersion: "12.0.0",
789
+ version: "22.2.6",
790
+ ngImport: i0,
791
+ type: DropdownPopupHandlerDirective,
792
+ decorators: [{
793
+ type: Directive,
794
+ args: [{ selector: "[monaDropdownPopupHandler]" }]
795
+ }],
796
+ ctorParameters: () => []
797
+ });
798
+ var DropdownListPopupHandlerDirective = class DropdownListPopupHandlerDirective {
799
+ #destroyRef = inject(DestroyRef);
800
+ #dropdownListService = inject(DropdownListService, { optional: true });
801
+ #dropdownService = inject(DropdownService);
802
+ #host = inject(DROPDOWN_POPUP_INPUT_TOKEN);
803
+ #hostElementRef = inject(ElementRef);
804
+ #listService = inject(ListService);
805
+ #popupClosed$ = toObservable(this.#dropdownService.popupRef).pipe(filter((popupRef) => !!popupRef), switchMap((popupRef) => popupRef.closed.pipe(take(1))));
806
+ #popupOpened$ = toObservable(this.#dropdownService.popupRef).pipe(filter((popupRef) => !!popupRef), switchMap((popupRef) => popupRef.opened.pipe(take(1))));
807
+ constructor() {
808
+ afterNextRender({ read: () => {
809
+ this.setKeyboardEvents();
810
+ this.#popupClosed$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(() => this.setPopupCloseSubscriptions());
811
+ this.#popupOpened$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(() => this.handleScrollOnPopupOpen());
812
+ } });
813
+ }
814
+ closePopup() {
815
+ this.#dropdownService.popupRef()?.close();
816
+ }
817
+ handleArrowKeys(event) {
818
+ const navigateEvent = new PreventableEvent("beforeNavigate", event);
819
+ this.#dropdownService.beforeNavigate$.next(navigateEvent);
820
+ if (navigateEvent.isDefaultPrevented()) return;
821
+ event.preventDefault();
822
+ if (event.altKey) {
823
+ if (event.key === "ArrowDown") this.#dropdownService.triggerPopupOpen$.next({});
824
+ else this.closePopup();
825
+ return;
826
+ }
827
+ const previousItem = this.#listService.selectedListItems().lastOrDefault();
828
+ const direction = event.key === "ArrowDown" ? "next" : "previous";
829
+ const mode = this.#listService.navigableOptions().mode;
830
+ const item = this.#listService.navigate(direction, mode, false);
831
+ if (!item || previousItem === item) return;
832
+ this.#dropdownListService?.navigate$.next({ item });
833
+ }
834
+ handleKeyDown(e) {
835
+ if (e.isComposing || e.keyCode === 229) return;
836
+ const event = new PreventableEvent("beforeKeydown", e);
837
+ this.#dropdownService.beforeKeydown$.next(event);
838
+ if (event.isDefaultPrevented()) return;
839
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") this.handleArrowKeys(e);
840
+ else if (e.key === "Escape") this.#dropdownService.popupRef()?.close(new PopupCloseEvent({
841
+ event: e,
842
+ originalEvent: e,
843
+ via: PopupCloseSource.Escape
844
+ }));
845
+ else if (e.key === "Tab") this.closePopup();
846
+ else if (e.key === " ") {
847
+ e.preventDefault();
848
+ this.#dropdownService.triggerPopupToggle$.next({});
849
+ } else if (e.key === "Enter") {
850
+ this.#dropdownService.keydown$.next(e);
851
+ if (e.defaultPrevented) return;
852
+ this.#dropdownService.triggerPopupToggle$.next({});
853
+ } else this.#dropdownService.keydown$.next(e);
854
+ }
855
+ handleScrollOnPopupOpen() {
856
+ const selectedDataItem = this.#listService.selectedListItems().lastOrDefault();
857
+ const highlightedItem = this.#listService.highlightedItem();
858
+ if (selectedDataItem) this.scrollToSelectedItem();
859
+ else if (highlightedItem) this.scrollToHighlightedItem();
860
+ }
861
+ scrollToHighlightedItem() {
862
+ const highlightedItem = this.#listService.highlightedItem();
863
+ if (!highlightedItem) return;
864
+ window.setTimeout(() => this.#listService.scrollToItem(highlightedItem, false));
865
+ }
866
+ scrollToSelectedItem() {
867
+ const item = this.#listService.selectedListItems().lastOrDefault();
868
+ if (!item) return;
869
+ window.setTimeout(() => this.#listService.scrollToItem(item, false));
870
+ }
871
+ setKeyboardEvents() {
872
+ fromEvent(this.#hostElementRef.nativeElement, "click").pipe(takeUntilDestroyed(this.#destroyRef), filter((e) => !this.#host.disabled() && !this.#host.readonly() && !!e.target && e.target.tagName !== "INPUT")).subscribe(() => this.#dropdownService.triggerPopupToggle$.next({}));
873
+ fromEvent(this.#hostElementRef.nativeElement, "keydown").pipe(takeUntilDestroyed(this.#destroyRef), filter(() => !this.#host.disabled() && !this.#host.readonly())).subscribe((e) => this.handleKeyDown(e));
874
+ }
875
+ setPopupCloseSubscriptions() {
876
+ this.#listService.clearHighlightedItem();
877
+ this.#listService.clearFilter();
878
+ }
879
+ static {
880
+ this.ɵfac = i0.ɵɵngDeclareFactory({
881
+ minVersion: "12.0.0",
882
+ version: "22.2.6",
883
+ ngImport: i0,
884
+ type: DropdownListPopupHandlerDirective,
885
+ deps: [],
886
+ target: i0.ɵɵFactoryTarget.Directive
887
+ });
888
+ }
889
+ static {
890
+ this.ɵdir = i0.ɵɵngDeclareDirective({
891
+ minVersion: "14.0.0",
892
+ version: "22.2.6",
893
+ type: DropdownListPopupHandlerDirective,
894
+ isStandalone: true,
895
+ selector: "[monaDropdownListPopupHandler]",
896
+ hostDirectives: [{ directive: DropdownPopupHandlerDirective }],
897
+ ngImport: i0
898
+ });
899
+ }
900
+ };
901
+ i0.ɵɵngDeclareClassMetadata({
902
+ minVersion: "12.0.0",
903
+ version: "22.2.6",
904
+ ngImport: i0,
905
+ type: DropdownListPopupHandlerDirective,
906
+ decorators: [{
907
+ type: Directive,
908
+ args: [{
909
+ selector: "[monaDropdownListPopupHandler]",
910
+ hostDirectives: [DropdownPopupHandlerDirective]
911
+ }]
912
+ }],
913
+ ctorParameters: () => []
914
+ });
673
915
  function localizeNumber(value, options) {
674
- return formatNumber(value, "en-US", options);
916
+ return formatNumber(value, "en-US", options);
675
917
  }
676
918
  const DROPDOWNS_DEFAULT_MESSAGES = {
677
- itemPosition: (text, position, total) => `${text}, ${localizeNumber(position)} of ${localizeNumber(total)}`,
678
- noResultsFound: "No results found",
679
- resultsAvailable: (count) => count === 1 ? `${localizeNumber(count)} result available` : `${localizeNumber(count)} results available`
919
+ itemPosition: (text, position, total) => `${text}, ${localizeNumber(position)} of ${localizeNumber(total)}`,
920
+ noResultsFound: "No results found",
921
+ resultsAvailable: (count) => count === 1 ? `${localizeNumber(count)} result available` : `${localizeNumber(count)} results available`
680
922
  };
681
-
682
- /**
683
- * Announces how many results a dropdown shows after its list is filtered, or after its items change, while the
684
- * popup is open ("3 results available", "No results found").
685
- *
686
- * The announcement goes through the CDK `LiveAnnouncer`, whose live region lives at the end of the document, so it
687
- * never becomes part of the combobox's content. The highlighted option isn't announced here:
688
- * `aria-activedescendant` already does that.
689
- * @hidden Exported for Mona UI's other entry points; applications don't need it.
690
- */
691
- class DropdownLiveRegionDirective {
692
- #dropdownService = inject(DropdownService);
693
- #i18n = inject(MonaI18nService);
694
- #listService = inject(ListService);
695
- #liveAnnouncer = inject(LiveAnnouncer);
696
- #messages = this.#i18n.componentMessages("dropdowns", DROPDOWNS_DEFAULT_MESSAGES);
697
- constructor() {
698
- // What the list showed when it was last announced, or when the popup opened. Null while the popup is closed.
699
- let lastState = null;
700
- effect(() => {
701
- const expanded = this.#dropdownService.popupRef() !== null;
702
- const filterText = this.#listService.filterText();
703
- const count = this.#listService.viewItems().size();
704
- untracked(() => {
705
- if (!expanded) {
706
- lastState = null;
707
- return;
708
- }
709
- const state = `${filterText}\u0000${count}`;
710
- if (state === lastState) {
711
- return;
712
- }
713
- const opening = lastState === null;
714
- lastState = state;
715
- // Opening the popup isn't news, unless the text that opened it already filtered the list (a combo
716
- // box or auto-complete opens on the first keystroke).
717
- if (opening && !filterText) {
718
- return;
719
- }
720
- const messages = this.#messages();
721
- void this.#liveAnnouncer.announce(count === 0 ? messages.noResultsFound : messages.resultsAvailable(count), "polite");
722
- });
723
- });
724
- }
725
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownLiveRegionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
726
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: DropdownLiveRegionDirective, isStandalone: true, selector: "[monaDropdownLiveRegion]", ngImport: i0 }); }
727
- }
728
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownLiveRegionDirective, decorators: [{
729
- type: Directive,
730
- args: [{
731
- selector: "[monaDropdownLiveRegion]"
732
- }]
733
- }], ctorParameters: () => [] });
734
-
735
- class DropdownPrefixTemplateDirective {
736
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownPrefixTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
737
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: DropdownPrefixTemplateDirective, isStandalone: true, selector: "ng-template[monaDropdownPrefixTemplate]", ngImport: i0 }); }
738
- }
739
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownPrefixTemplateDirective, decorators: [{
740
- type: Directive,
741
- args: [{
742
- selector: "ng-template[monaDropdownPrefixTemplate]"
743
- }]
744
- }] });
745
-
746
- class DropdownSuffixTemplateDirective {
747
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownSuffixTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
748
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: DropdownSuffixTemplateDirective, isStandalone: true, selector: "ng-template[monaDropdownSuffixTemplate]", ngImport: i0 }); }
749
- }
750
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownSuffixTemplateDirective, decorators: [{
751
- type: Directive,
752
- args: [{
753
- selector: "ng-template[monaDropdownSuffixTemplate]"
754
- }]
755
- }] });
756
-
757
- /** @hidden Exported for Mona UI's other entry points; applications don't need it. */
923
+ var DropdownLiveRegionDirective = class DropdownLiveRegionDirective {
924
+ #dropdownService = inject(DropdownService);
925
+ #i18n = inject(MonaI18nService);
926
+ #listService = inject(ListService);
927
+ #liveAnnouncer = inject(LiveAnnouncer);
928
+ #messages = this.#i18n.componentMessages("dropdowns", DROPDOWNS_DEFAULT_MESSAGES);
929
+ constructor() {
930
+ let lastState = null;
931
+ effect(() => {
932
+ const expanded = this.#dropdownService.popupRef() !== null;
933
+ const filterText = this.#listService.filterText();
934
+ const count = this.#listService.viewItems().size();
935
+ untracked(() => {
936
+ if (!expanded) {
937
+ lastState = null;
938
+ return;
939
+ }
940
+ const state = `${filterText}\u0000${count}`;
941
+ if (state === lastState) return;
942
+ const opening = lastState === null;
943
+ lastState = state;
944
+ if (opening && !filterText) return;
945
+ const messages = this.#messages();
946
+ this.#liveAnnouncer.announce(count === 0 ? messages.noResultsFound : messages.resultsAvailable(count), "polite");
947
+ });
948
+ });
949
+ }
950
+ static {
951
+ this.ɵfac = i0.ɵɵngDeclareFactory({
952
+ minVersion: "12.0.0",
953
+ version: "22.2.6",
954
+ ngImport: i0,
955
+ type: DropdownLiveRegionDirective,
956
+ deps: [],
957
+ target: i0.ɵɵFactoryTarget.Directive
958
+ });
959
+ }
960
+ static {
961
+ this.ɵdir = i0.ɵɵngDeclareDirective({
962
+ minVersion: "14.0.0",
963
+ version: "22.2.6",
964
+ type: DropdownLiveRegionDirective,
965
+ isStandalone: true,
966
+ selector: "[monaDropdownLiveRegion]",
967
+ ngImport: i0
968
+ });
969
+ }
970
+ };
971
+ i0.ɵɵngDeclareClassMetadata({
972
+ minVersion: "12.0.0",
973
+ version: "22.2.6",
974
+ ngImport: i0,
975
+ type: DropdownLiveRegionDirective,
976
+ decorators: [{
977
+ type: Directive,
978
+ args: [{ selector: "[monaDropdownLiveRegion]" }]
979
+ }],
980
+ ctorParameters: () => []
981
+ });
982
+ var DropdownPrefixTemplateDirective = class DropdownPrefixTemplateDirective {
983
+ static {
984
+ this.ɵfac = i0.ɵɵngDeclareFactory({
985
+ minVersion: "12.0.0",
986
+ version: "22.2.6",
987
+ ngImport: i0,
988
+ type: DropdownPrefixTemplateDirective,
989
+ deps: [],
990
+ target: i0.ɵɵFactoryTarget.Directive
991
+ });
992
+ }
993
+ static {
994
+ this.ɵdir = i0.ɵɵngDeclareDirective({
995
+ minVersion: "14.0.0",
996
+ version: "22.2.6",
997
+ type: DropdownPrefixTemplateDirective,
998
+ isStandalone: true,
999
+ selector: "ng-template[monaDropdownPrefixTemplate]",
1000
+ ngImport: i0
1001
+ });
1002
+ }
1003
+ };
1004
+ i0.ɵɵngDeclareClassMetadata({
1005
+ minVersion: "12.0.0",
1006
+ version: "22.2.6",
1007
+ ngImport: i0,
1008
+ type: DropdownPrefixTemplateDirective,
1009
+ decorators: [{
1010
+ type: Directive,
1011
+ args: [{ selector: "ng-template[monaDropdownPrefixTemplate]" }]
1012
+ }]
1013
+ });
1014
+ var DropdownSuffixTemplateDirective = class DropdownSuffixTemplateDirective {
1015
+ static {
1016
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1017
+ minVersion: "12.0.0",
1018
+ version: "22.2.6",
1019
+ ngImport: i0,
1020
+ type: DropdownSuffixTemplateDirective,
1021
+ deps: [],
1022
+ target: i0.ɵɵFactoryTarget.Directive
1023
+ });
1024
+ }
1025
+ static {
1026
+ this.ɵdir = i0.ɵɵngDeclareDirective({
1027
+ minVersion: "14.0.0",
1028
+ version: "22.2.6",
1029
+ type: DropdownSuffixTemplateDirective,
1030
+ isStandalone: true,
1031
+ selector: "ng-template[monaDropdownSuffixTemplate]",
1032
+ ngImport: i0
1033
+ });
1034
+ }
1035
+ };
1036
+ i0.ɵɵngDeclareClassMetadata({
1037
+ minVersion: "12.0.0",
1038
+ version: "22.2.6",
1039
+ ngImport: i0,
1040
+ type: DropdownSuffixTemplateDirective,
1041
+ decorators: [{
1042
+ type: Directive,
1043
+ args: [{ selector: "ng-template[monaDropdownSuffixTemplate]" }]
1044
+ }]
1045
+ });
758
1046
  const dropdownPopupThemeVariants = cva(`
759
1047
  h-full max-h-64 overflow-auto
760
1048
  [scrollbar-color:var(--color-scrollbar-thumb)_var(--color-scrollbar-track)] [scrollbar-width:thin]
@@ -763,29 +1051,25 @@ const dropdownPopupThemeVariants = cva(`
763
1051
  [&_mona-list]:[background-color:var(--mona-dropdown-popup-list-background,var(--mona-list-background))]!
764
1052
  border border-border shadow-(--shadow-overlay)
765
1053
  `, {
766
- variants: {
767
- rounded: {
768
- none: "rounded-none",
769
- small: "rounded-sm",
770
- medium: "rounded-md",
771
- large: "rounded-lg",
772
- full: "rounded-lg"
773
- },
774
- size: {
775
- large: "text-base",
776
- medium: "text-sm",
777
- small: "text-xs"
778
- }
779
- },
780
- defaultVariants: {
781
- rounded: "medium",
782
- size: "medium"
783
- }
1054
+ variants: {
1055
+ rounded: {
1056
+ none: "rounded-none",
1057
+ small: "rounded-sm",
1058
+ medium: "rounded-md",
1059
+ large: "rounded-lg",
1060
+ full: "rounded-lg"
1061
+ },
1062
+ size: {
1063
+ large: "text-base",
1064
+ medium: "text-sm",
1065
+ small: "text-xs"
1066
+ }
1067
+ },
1068
+ defaultVariants: {
1069
+ rounded: "medium",
1070
+ size: "medium"
1071
+ }
784
1072
  });
785
-
786
- /**
787
- * Generated bundle index. Do not edit.
788
- */
789
-
790
1073
  export { DROPDOWNS_DEFAULT_MESSAGES, DROPDOWN_DATA_INPUT_TOKEN, DROPDOWN_POPUP_INPUT_TOKEN, DropdownDataHandlerDirective, DropdownDataInputToken, DropdownFilterableDirective, DropdownFooterTemplateDirective, DropdownGroupHeaderTemplateDirective, DropdownGroupableDirective, DropdownHeaderTemplateDirective, DropdownItemTemplateDirective, DropdownListPopupHandlerDirective, DropdownListService, DropdownLiveRegionDirective, DropdownNoDataTemplateDirective, DropdownPopupHandlerDirective, DropdownPrefixTemplateDirective, DropdownService, DropdownSuffixTemplateDirective, DropdownVirtualScrollDirective, dropdownPopupThemeVariants };
791
- //# sourceMappingURL=nanahoshi-mona-ui-dropdowns.mjs.map
1074
+
1075
+ //# sourceMappingURL=nanahoshi-mona-ui-dropdowns.mjs.map