@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,35 +1,50 @@
1
- import { NgTemplateOutlet } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { Directive, inject, DestroyRef, ElementRef, linkedSignal, computed, contentChild, TemplateRef, viewChild, input, output, booleanAttribute, model, effect, untracked, afterNextRender, forwardRef, Component } from '@angular/core';
4
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
- import * as i1 from '@nanahoshi/mona-ui/dropdowns';
6
- import { DropdownListService, DropdownService, DropdownFooterTemplateDirective, DropdownGroupHeaderTemplateDirective, DropdownHeaderTemplateDirective, DropdownItemTemplateDirective, dropdownPopupThemeVariants, DropdownNoDataTemplateDirective, DropdownPrefixTemplateDirective, DROPDOWN_DATA_INPUT_TOKEN, DROPDOWN_POPUP_INPUT_TOKEN, DropdownDataHandlerDirective, DropdownListPopupHandlerDirective, DropdownLiveRegionDirective } from '@nanahoshi/mona-ui/dropdowns';
7
- import { themeControlSurfaceClasses, injectEffectiveDisabled, createElementControlId, isTypeaheadKey, TYPEAHEAD_RESET_DELAY, setupTypeahead } from '@nanahoshi/mona-ui/internal';
8
- import { IndicatorIconComponent } from '@nanahoshi/mona-ui/internal/indicator-icon';
9
- import { ListService, ListComponent, ListItemTemplateDirective, ListGroupHeaderTemplateDirective, ListFooterTemplateDirective, ListHeaderTemplateDirective, ListNoDataTemplateDirective } from '@nanahoshi/mona-ui/internal/list';
10
- import { PopupCloseSource } from '@nanahoshi/mona-ui/popup';
11
- import { MonaI18nService } from '@nanahoshi/mona-ui/i18n';
12
- import { Subject, filter } from 'rxjs';
13
- import { twMerge } from 'tailwind-merge';
14
- import { cva } from 'class-variance-authority';
15
-
16
- class DropdownListValueTemplateDirective {
17
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownListValueTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
18
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: DropdownListValueTemplateDirective, isStandalone: true, selector: "ng-template[monaDropDownListValueTemplate]", ngImport: i0 }); }
19
- }
20
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownListValueTemplateDirective, decorators: [{
21
- type: Directive,
22
- args: [{
23
- selector: "ng-template[monaDropDownListValueTemplate]"
24
- }]
25
- }] });
26
-
27
- // Generated from i18n/catalogs/en-US.messages.json by scripts/generate-locale-catalogs.ts. Do not edit.
28
- // Edit the JSON file and run `npm run generate:locale-catalogs`.
29
- const DROPDOWN_LIST_DEFAULT_MESSAGES = {
30
- clear: "Clear"
1
+ import { NgTemplateOutlet } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { Component, DestroyRef, Directive, ElementRef, TemplateRef, afterNextRender, booleanAttribute, computed, contentChild, effect, forwardRef, inject, input, linkedSignal, model, output, untracked, viewChild } from "@angular/core";
4
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
5
+ import * as i1 from "@nanahoshi/mona-ui/dropdowns";
6
+ import { DROPDOWN_DATA_INPUT_TOKEN, DROPDOWN_POPUP_INPUT_TOKEN, DropdownDataHandlerDirective, DropdownFooterTemplateDirective, DropdownGroupHeaderTemplateDirective, DropdownHeaderTemplateDirective, DropdownItemTemplateDirective, DropdownListPopupHandlerDirective, DropdownListService, DropdownLiveRegionDirective, DropdownNoDataTemplateDirective, DropdownPrefixTemplateDirective, DropdownService, dropdownPopupThemeVariants } from "@nanahoshi/mona-ui/dropdowns";
7
+ import { TYPEAHEAD_RESET_DELAY, createElementControlId, injectEffectiveDisabled, isTypeaheadKey, setupTypeahead, themeControlSurfaceClasses } from "@nanahoshi/mona-ui/internal";
8
+ import { IndicatorIconComponent } from "@nanahoshi/mona-ui/internal/indicator-icon";
9
+ import { ListComponent, ListFooterTemplateDirective, ListGroupHeaderTemplateDirective, ListHeaderTemplateDirective, ListItemTemplateDirective, ListNoDataTemplateDirective, ListService } from "@nanahoshi/mona-ui/internal/list";
10
+ import { PopupCloseSource } from "@nanahoshi/mona-ui/popup";
11
+ import { MonaI18nService } from "@nanahoshi/mona-ui/i18n";
12
+ import { Subject, filter } from "rxjs";
13
+ import { twMerge } from "tailwind-merge";
14
+ import { cva } from "class-variance-authority";
15
+ var DropdownListValueTemplateDirective = class DropdownListValueTemplateDirective {
16
+ static {
17
+ this.ɵfac = i0.ɵɵngDeclareFactory({
18
+ minVersion: "12.0.0",
19
+ version: "22.2.6",
20
+ ngImport: i0,
21
+ type: DropdownListValueTemplateDirective,
22
+ deps: [],
23
+ target: i0.ɵɵFactoryTarget.Directive
24
+ });
25
+ }
26
+ static {
27
+ this.ɵdir = i0.ɵɵngDeclareDirective({
28
+ minVersion: "14.0.0",
29
+ version: "22.2.6",
30
+ type: DropdownListValueTemplateDirective,
31
+ isStandalone: true,
32
+ selector: "ng-template[monaDropDownListValueTemplate]",
33
+ ngImport: i0
34
+ });
35
+ }
31
36
  };
32
-
37
+ i0.ɵɵngDeclareClassMetadata({
38
+ minVersion: "12.0.0",
39
+ version: "22.2.6",
40
+ ngImport: i0,
41
+ type: DropdownListValueTemplateDirective,
42
+ decorators: [{
43
+ type: Directive,
44
+ args: [{ selector: "ng-template[monaDropDownListValueTemplate]" }]
45
+ }]
46
+ });
47
+ const DROPDOWN_LIST_DEFAULT_MESSAGES = { clear: "Clear" };
33
48
  const dropdownListInputThemeVariants = cva(`
34
49
  inline-flex items-center
35
50
  cursor-pointer select-none
@@ -40,657 +55,1107 @@ const dropdownListInputThemeVariants = cva(`
40
55
  hover:bg-hover active:bg-active
41
56
  focus-within:border-focus-indicator focus-within:ring-2 focus-within:ring-focus-indicator/35
42
57
  `, {
43
- variants: {
44
- disabled: {
45
- true: `
58
+ variants: {
59
+ disabled: {
60
+ true: `
46
61
  pointer-events-none cursor-not-allowed
47
62
  bg-disabled-background text-disabled-foreground
48
63
  border-disabled-border shadow-none
49
64
  `,
50
- false: ""
51
- },
52
- expanded: {
53
- true: "border-focus-indicator ring-2 ring-focus-indicator/35",
54
- false: ""
55
- },
56
- hasPrefix: {
57
- false: "ps-2"
58
- },
59
- invalid: {
60
- true: "border-error ring-2 ring-error/35 focus-within:border-error focus-within:ring-error/35",
61
- false: ""
62
- },
63
- rounded: {
64
- none: "rounded-none",
65
- small: "rounded-sm",
66
- medium: "rounded-md",
67
- large: "rounded-lg",
68
- full: "rounded-full px-3"
69
- },
70
- size: {
71
- large: "h-10 text-base",
72
- medium: "h-9 text-sm",
73
- small: "h-8 text-xs"
74
- }
75
- },
76
- compoundVariants: [
77
- {
78
- expanded: true,
79
- invalid: true,
80
- class: "border-error ring-error/35"
81
- }
82
- ]
83
- });
84
- const dropdownListValueContainerThemeVariants = cva(`flex h-full w-full items-center overflow-hidden`, {
85
- variants: {
86
- hasTemplate: {
87
- false: "[&>span]:truncate [&>span]:items-center [&>span]:inline-block"
88
- }
89
- }
65
+ false: ""
66
+ },
67
+ expanded: {
68
+ true: "border-focus-indicator ring-2 ring-focus-indicator/35",
69
+ false: ""
70
+ },
71
+ hasPrefix: { false: "ps-2" },
72
+ invalid: {
73
+ true: "border-error ring-2 ring-error/35 focus-within:border-error focus-within:ring-error/35",
74
+ false: ""
75
+ },
76
+ rounded: {
77
+ none: "rounded-none",
78
+ small: "rounded-sm",
79
+ medium: "rounded-md",
80
+ large: "rounded-lg",
81
+ full: "rounded-full px-3"
82
+ },
83
+ size: {
84
+ large: "h-10 text-base",
85
+ medium: "h-9 text-sm",
86
+ small: "h-8 text-xs"
87
+ }
88
+ },
89
+ compoundVariants: [{
90
+ expanded: true,
91
+ invalid: true,
92
+ class: "border-error ring-error/35"
93
+ }]
90
94
  });
95
+ const dropdownListValueContainerThemeVariants = cva(`flex h-full w-full items-center overflow-hidden`, { variants: { hasTemplate: { false: "[&>span]:truncate [&>span]:items-center [&>span]:inline-block" } } });
91
96
  const dropdownListAffixContainerThemeVariants = cva(`flex h-full flex-none items-center justify-center`);
92
-
93
- const cancellingCloseSources = new Set([
94
- PopupCloseSource.BackdropClick,
95
- PopupCloseSource.Escape,
96
- PopupCloseSource.OutsideClick,
97
- PopupCloseSource.Scroll
97
+ const cancellingCloseSources = /* @__PURE__ */ new Set([
98
+ PopupCloseSource.BackdropClick,
99
+ PopupCloseSource.Escape,
100
+ PopupCloseSource.OutsideClick,
101
+ PopupCloseSource.Scroll
98
102
  ]);
99
- class DropdownListComponent {
100
- #destroyRef;
101
- #dropdownListService;
102
- #dropdownService;
103
- #hostElementRef;
104
- #i18n;
105
- #listService;
106
- #navigatedItem;
107
- #typeaheadKey;
108
- #lastTypeaheadKeyTime;
109
- constructor() {
110
- this.#destroyRef = inject(DestroyRef);
111
- this.#dropdownListService = inject(DropdownListService);
112
- this.#dropdownService = inject(DropdownService);
113
- this.#hostElementRef = inject((ElementRef));
114
- this.#i18n = inject(MonaI18nService);
115
- this.#listService = inject(ListService);
116
- this.#navigatedItem = linkedSignal(() => this.selectedDataItem(), /* @ts-ignore */
117
- ...(ngDevMode ? [{ debugName: "#navigatedItem" }] : /* istanbul ignore next */ []));
118
- this.#typeaheadKey = new Subject();
119
- this.#lastTypeaheadKeyTime = Number.NEGATIVE_INFINITY;
120
- this.activeDescendant = computed(() => {
121
- const highlightedItem = this.#listService.highlightedItem();
122
- return highlightedItem ? highlightedItem.uid : null;
123
- }, /* @ts-ignore */
124
- ...(ngDevMode ? [{ debugName: "activeDescendant" }] : /* istanbul ignore next */ []));
125
- this.affixClass = computed(() => {
126
- return dropdownListAffixContainerThemeVariants();
127
- }, /* @ts-ignore */
128
- ...(ngDevMode ? [{ debugName: "affixClass" }] : /* istanbul ignore next */ []));
129
- this.baseClass = computed(() => {
130
- const disabled = this.effectiveDisabled();
131
- const expanded = this.expanded();
132
- const hasPrefix = this.prefixTemplate() != null;
133
- const invalid = this.invalidState();
134
- const rounded = this.rounded();
135
- const size = this.size();
136
- const classes = dropdownListInputThemeVariants({
137
- disabled,
138
- expanded,
139
- hasPrefix,
140
- invalid,
141
- rounded,
142
- size
143
- });
144
- const userClass = this.userClass();
145
- return twMerge(classes, userClass);
146
- }, /* @ts-ignore */
147
- ...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
148
- this.clearButtonVisible = computed(() => this.showClearButton() &&
149
- this.selectedListItem() != null &&
150
- !this.loading() &&
151
- !this.effectiveDisabled() &&
152
- !this.readonly(), /* @ts-ignore */
153
- ...(ngDevMode ? [{ debugName: "clearButtonVisible" }] : /* istanbul ignore next */ []));
154
- this.effectiveAriaLabel = computed(() => this.ariaLabel() || (this.ariaLabelledBy() ? "" : this.placeholder()), /* @ts-ignore */
155
- ...(ngDevMode ? [{ debugName: "effectiveAriaLabel" }] : /* istanbul ignore next */ []));
156
- this.effectiveDisabled = injectEffectiveDisabled(() => this.disabled());
157
- this.expanded = computed(() => this.#dropdownService.popupRef() !== null, /* @ts-ignore */
158
- ...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
159
- this.footerTemplate = contentChild(DropdownFooterTemplateDirective, { ...(ngDevMode ? { debugName: "footerTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
160
- this.groupHeaderTemplate = contentChild(DropdownGroupHeaderTemplateDirective, { ...(ngDevMode ? { debugName: "groupHeaderTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
161
- this.headerTemplate = contentChild(DropdownHeaderTemplateDirective, { ...(ngDevMode ? { debugName: "headerTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
162
- this.invalidState = computed(() => this.touched() && (this.invalid() || (this.required() && this.value() == null)), /* @ts-ignore */
163
- ...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
164
- this.isEmpty = computed(() => !this.#listService.viewItems().any(), /* @ts-ignore */
165
- ...(ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []));
166
- this.itemTemplate = contentChild(DropdownItemTemplateDirective, { ...(ngDevMode ? { debugName: "itemTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
167
- this.listId = createElementControlId();
168
- this.listPopupClass = computed(() => {
169
- const rounded = this.rounded();
170
- const size = this.size();
171
- const userClass = this.popupClass();
172
- const variantClass = dropdownPopupThemeVariants({ rounded, size });
173
- // With a popupHeight, the overlay sets the limit; the default max-h-64 would cut a taller popup short.
174
- const heightClass = this.popupHeight() ? "max-h-none" : "";
175
- return twMerge(variantClass, heightClass, userClass);
176
- }, /* @ts-ignore */
177
- ...(ngDevMode ? [{ debugName: "listPopupClass" }] : /* istanbul ignore next */ []));
178
- this.messages = this.#i18n.componentMessages("dropdownList", DROPDOWN_LIST_DEFAULT_MESSAGES);
179
- this.noDataTemplate = contentChild(DropdownNoDataTemplateDirective, { ...(ngDevMode ? { debugName: "noDataTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
180
- this.popupTemplate = viewChild.required("popupTemplate", /* @ts-ignore */
181
- ...(ngDevMode ? [{ debugName: "popupTemplate" }] : /* istanbul ignore next */ []));
182
- this.prefixTemplate = contentChild(DropdownPrefixTemplateDirective, { ...(ngDevMode ? { debugName: "prefixTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
183
- this.selectableOptions = {
184
- enabled: true,
185
- mode: "single",
186
- toggleable: false
187
- };
188
- this.selectedDataItem = computed(() => {
189
- return this.selectedListItem()?.data ?? null;
190
- }, /* @ts-ignore */
191
- ...(ngDevMode ? [{ debugName: "selectedDataItem" }] : /* istanbul ignore next */ []));
192
- this.selectedListItem = computed(() => {
193
- return this.#listService.selectedListItems().firstOrDefault();
194
- }, /* @ts-ignore */
195
- ...(ngDevMode ? [{ debugName: "selectedListItem" }] : /* istanbul ignore next */ []));
196
- this.valueContainerClass = computed(() => {
197
- const hasTemplate = this.valueTemplate() != null;
198
- return dropdownListValueContainerThemeVariants({ hasTemplate });
199
- }, /* @ts-ignore */
200
- ...(ngDevMode ? [{ debugName: "valueContainerClass" }] : /* istanbul ignore next */ []));
201
- this.valueTemplate = contentChild(DropdownListValueTemplateDirective, { ...(ngDevMode ? { debugName: "valueTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
202
- this.valueText = computed(() => {
203
- const listItem = this.selectedListItem();
204
- if (!listItem) {
205
- return "";
206
- }
207
- return this.#listService.getItemText(listItem);
208
- }, /* @ts-ignore */
209
- ...(ngDevMode ? [{ debugName: "valueText" }] : /* istanbul ignore next */ []));
210
- /**
211
- * @description ID of an element that describes the dropdown list, such as help text or an error message.
212
- * @default ""
213
- */
214
- this.ariaDescribedBy = input("", { ...(ngDevMode ? { debugName: "ariaDescribedBy" } : /* istanbul ignore next */ {}), alias: "aria-describedby" });
215
- /**
216
- * @description Accessible name for the host element. Describe what the component represents.
217
- * When empty, falls back to the placeholder text.
218
- * @default ""
219
- */
220
- this.ariaLabel = input("", { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: "aria-label" });
221
- /**
222
- * @description ID of an external element that provides the accessible name for the host element.
223
- * @default ""
224
- */
225
- this.ariaLabelledBy = input("", { ...(ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {}), alias: "aria-labelledby" });
226
- /**
227
- * @description Emitted when the popup is about to close. This event is preventable.
228
- */
229
- // eslint-disable-next-line @angular-eslint/no-output-native -- renaming the output would break existing (close) bindings
230
- this.close = output();
231
- /**
232
- * @description Emitted after the popup closes.
233
- */
234
- this.closed = output();
235
- /**
236
- * @description Collection of items to render.
237
- * @default []
238
- */
239
- this.data = input([], /* @ts-ignore */
240
- ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
241
- /**
242
- * @description Renders the component with reduced visual emphasis and removes pointer interaction.
243
- * @default false
244
- */
245
- this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
246
- /**
247
- * @description Marks the field as invalid. Set automatically by the `FormField` directive when bound via `[formField]`.
248
- * @default false
249
- */
250
- this.invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
251
- /**
252
- * @description Predicate or field name used to determine whether an individual item is disabled.
253
- * @default undefined
254
- */
255
- this.itemDisabled = input(/* @ts-ignore */
256
- ...(ngDevMode ? [undefined, { debugName: "itemDisabled" }] : /* istanbul ignore next */ []));
257
- /**
258
- * @description Shows a loading indicator, in place of the clear button, and marks the field busy. It doesn't
259
- * block interaction: the field stays usable while data loads.
260
- * @default false
261
- */
262
- this.loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
263
- /**
264
- * @description Emitted when the popup is about to open. This event is preventable.
265
- */
266
- this.open = output();
267
- /**
268
- * @description Emitted after the popup opens.
269
- */
270
- this.opened = output();
271
- /**
272
- * @description Placeholder text shown when no value is selected or entered.
273
- * @default ""
274
- */
275
- this.placeholder = input("", /* @ts-ignore */
276
- ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
277
- /**
278
- * @description Additional CSS classes applied to the popup element.
279
- * @default ""
280
- */
281
- this.popupClass = input("", /* @ts-ignore */
282
- ...(ngDevMode ? [{ debugName: "popupClass" }] : /* istanbul ignore next */ []));
283
- /**
284
- * @description Maximum height of the popup, in pixels or as a CSS length. Shorter lists shrink to fit. When
285
- * unset, the popup is at most 200 pixels tall.
286
- * @default null
287
- */
288
- this.popupHeight = input(null, /* @ts-ignore */
289
- ...(ngDevMode ? [{ debugName: "popupHeight" }] : /* istanbul ignore next */ []));
290
- /**
291
- * @description Width of the popup element.
292
- * @default null
293
- */
294
- this.popupWidth = input(null, /* @ts-ignore */
295
- ...(ngDevMode ? [{ debugName: "popupWidth" }] : /* istanbul ignore next */ []));
296
- /**
297
- * @description Prevents value changes while preserving the component's visual state.
298
- * @default false
299
- */
300
- this.readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
301
- /**
302
- * @description Marks the field as required for form validation.
303
- * @default false
304
- */
305
- this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
306
- /**
307
- * @description Border-radius preset applied to the component.
308
- * @default "medium"
309
- */
310
- this.rounded = input("medium", /* @ts-ignore */
311
- ...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
312
- /**
313
- * @description Shows a clear button that resets the selected value when clicked.
314
- * @default false
315
- */
316
- this.showClearButton = input(false, { ...(ngDevMode ? { debugName: "showClearButton" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
317
- /**
318
- * @description Size preset controlling the component's dimensions.
319
- * @default "medium"
320
- */
321
- this.size = input("medium", /* @ts-ignore */
322
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
323
- /**
324
- * @description Property name or accessor used to derive the display text from a data item.
325
- * If omitted, the item itself is used as the display text.
326
- * @default undefined
327
- */
328
- this.textField = input(/* @ts-ignore */
329
- ...(ngDevMode ? [undefined, { debugName: "textField" }] : /* istanbul ignore next */ []));
330
- /**
331
- * @description Emitted when focus leaves the dropdown list. Moving between it, its clear button and its popup
332
- * doesn't count. The `FormField` directive listens to this to mark the field as touched.
333
- */
334
- this.touch = output();
335
- /**
336
- * @description Marks the control as touched. Set automatically by the `FormField` directive when bound via `[formField]`.
337
- * @default false
338
- */
339
- this.touched = input(false, { ...(ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
340
- /**
341
- * @description Additional CSS classes merged onto the host element via `tailwind-merge`.
342
- * @default ""
343
- */
344
- this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
345
- /**
346
- * @description Currently selected value, two-way bindable and compatible with Signal Forms via `[formField]`.
347
- * Object mode returns the selected data item; primitive mode (see {@link valuePrimitive}) returns the value
348
- * resolved through {@link valueField}. `null` represents no selection.
349
- * @default null
350
- */
351
- this.value = model(null, /* @ts-ignore */
352
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
353
- /**
354
- * @description Property name or accessor used to derive the value from a data item.
355
- * It is used for stable item identity, matching externally supplied values, and primitive
356
- * value projection when {@link valuePrimitive} is enabled.
357
- * When omitted, the item itself is used as the value.
358
- * Should resolve to a stable, unique scalar.
359
- * @default undefined
360
- */
361
- this.valueField = input(/* @ts-ignore */
362
- ...(ngDevMode ? [undefined, { debugName: "valueField" }] : /* istanbul ignore next */ []));
363
- /**
364
- * @description Determines whether the bound value contains complete data items
365
- * or values extracted through {@link valueField}.
366
- *
367
- * When `false`, selecting an item writes the complete data item.
368
- * When `true`, selecting an item writes the value resolved through `valueField`.
369
- *
370
- * @default false
371
- */
372
- this.valuePrimitive = input(false, { ...(ngDevMode ? { debugName: "valuePrimitive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
373
- effect(() => {
374
- const value = this.value();
375
- const valueField = this.valueField();
376
- this.valuePrimitive();
377
- untracked(() => {
378
- this.#listService.setValueField(valueField ?? "");
379
- this.synchronizeSelection(value);
380
- });
381
- });
382
- effect(() => {
383
- const popupTemplate = this.popupTemplate();
384
- untracked(() => this.#dropdownService.popupTemplate.set(popupTemplate));
385
- });
386
- afterNextRender({
387
- read: () => {
388
- this.initialize();
389
- this.setSubscriptions();
390
- }
391
- });
392
- effect(() => {
393
- const filterableOptions = this.#listService.filterableOptions();
394
- untracked(() => {
395
- if (filterableOptions.enabled) {
396
- this.#listService.setNavigableOptions({ mode: "highlight" });
397
- }
398
- else {
399
- this.#listService.setNavigableOptions({ mode: "select" });
400
- }
401
- });
402
- });
403
- }
404
- /**
405
- * @description Moves focus to the dropdown list.
406
- * @param options Passed to `HTMLElement.focus()`, for example `{ preventScroll: true }`.
407
- */
408
- focus(options) {
409
- this.#hostElementRef.nativeElement?.focus(options);
410
- }
411
- setValue(value) {
412
- this.updateValue(value);
413
- }
414
- onFocusOut(event) {
415
- // Removing a focused dropdown from the page fires focusout after it is destroyed.
416
- if (this.#destroyRef.destroyed) {
417
- return;
418
- }
419
- const nextTarget = event.relatedTarget;
420
- if (nextTarget instanceof Node) {
421
- const popupElement = this.#dropdownService.popupRef()?.overlayRef.overlayElement;
422
- if (this.#hostElementRef.nativeElement.contains(nextTarget) || popupElement?.contains(nextTarget)) {
423
- return;
424
- }
425
- }
426
- this.touch.emit();
427
- }
428
- onItemSelect(event) {
429
- if (this.#listService.filterableOptions().enabled &&
430
- event.source.via === "keyboard" &&
431
- event.source.key !== "Enter") {
432
- this.#navigatedItem.set(event.item.data);
433
- return;
434
- }
435
- this.updateValue(this.getControlValue(event.item.data));
436
- if (event.source.via === "mouse" || event.source.key === "Enter" || event.source.key === "NumpadEnter") {
437
- this.closePopup();
438
- }
439
- }
440
- onPopupPointerDown(event) {
441
- const target = event.target;
442
- if (target?.tagName !== "INPUT") {
443
- event.preventDefault();
444
- }
445
- }
446
- onValueClear(event) {
447
- if (this.effectiveDisabled() ||
448
- this.readonly() ||
449
- (event instanceof KeyboardEvent && event.key !== "Enter" && event.key !== " ")) {
450
- return;
451
- }
452
- event.stopImmediatePropagation();
453
- event.preventDefault();
454
- this.updateValue(null);
455
- this.#listService.clearSelections();
456
- this.focus();
457
- }
458
- closePopup() {
459
- this.#dropdownService.popupRef()?.close();
460
- }
461
- cycleThroughMatchedItems(buffer) {
462
- const nextItem = this.#listService.cycleThroughMatchedItems(buffer);
463
- if (!nextItem) {
464
- return;
465
- }
466
- const selectedItems = this.#listService.selectedListItems();
467
- if (selectedItems.contains(nextItem)) {
468
- return;
469
- }
470
- this.#listService.selectItem(nextItem);
471
- const expanded = this.expanded();
472
- if (!expanded) {
473
- this.updateValue(this.getControlValue(nextItem.data));
474
- }
475
- else {
476
- this.scrollToSelectedItem();
477
- this.#navigatedItem.set(nextItem.data);
478
- }
479
- }
480
- getControlValue(dataItem) {
481
- const value = this.valuePrimitive() ? this.#listService.getDataItemValue(dataItem) : dataItem;
482
- return value;
483
- }
484
- handleEnterKey() {
485
- if (!this.expanded()) {
486
- this.#dropdownService.triggerPopupOpen$.next({});
487
- return;
488
- }
489
- const navigatedItem = this.#navigatedItem();
490
- if (navigatedItem && this.value() !== this.getControlValue(navigatedItem)) {
491
- this.updateValue(this.getControlValue(navigatedItem));
492
- }
493
- this.closePopup();
494
- }
495
- handleHomeEndKeys(event) {
496
- const itemToSelect = event.key === "Home"
497
- ? this.#listService.viewItems().firstOrDefault()
498
- : this.#listService.viewItems().lastOrDefault();
499
- if (!itemToSelect) {
500
- return;
501
- }
502
- this.#listService.selectItem(itemToSelect, true, false);
503
- if (!this.expanded()) {
504
- this.updateValue(this.getControlValue(itemToSelect.data));
505
- }
506
- else {
507
- this.#navigatedItem.set(itemToSelect.data);
508
- }
509
- }
510
- initialize() {
511
- this.#listService.setNavigableOptions({ enabled: true, mode: "select" });
512
- this.#listService.setSelectableOptions(this.selectableOptions);
513
- }
514
- pushTypeaheadKey(key) {
515
- this.#lastTypeaheadKeyTime = Date.now();
516
- this.#typeaheadKey.next(key);
517
- }
518
- scrollToSelectedItem() {
519
- const item = this.selectedListItem();
520
- if (!item) {
521
- return;
522
- }
523
- window.setTimeout(() => this.#listService.scrollToItem(item, false));
524
- }
525
- setArrowKeyNavigationSubscription() {
526
- this.#dropdownListService.navigate$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(({ item }) => {
527
- if (!this.expanded()) {
528
- this.updateValue(this.getControlValue(item.data));
529
- }
530
- else {
531
- this.#navigatedItem.set(item.data);
532
- }
533
- });
534
- }
535
- setFilterChangeSubscription() {
536
- this.#listService.filterChange$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(event => {
537
- if (event.filter) {
538
- const item = this.#listService.getMatchingFilteredItem(event.filter);
539
- if (item) {
540
- this.#listService.highlightedItem.set(item);
541
- }
542
- }
543
- });
544
- }
545
- setKeydownSubscription() {
546
- this.#dropdownService.keydown$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(event => {
547
- if (event.key === "Enter") {
548
- event.preventDefault();
549
- this.handleEnterKey();
550
- }
551
- else if (event.key === "Home" || event.key === "End") {
552
- event.preventDefault();
553
- this.handleHomeEndKeys(event);
554
- }
555
- else if (isTypeaheadKey(event.key, event)) {
556
- this.pushTypeaheadKey(event.key);
557
- }
558
- });
559
- }
560
- setPopupCloseSubscriptions() {
561
- this.#dropdownService.popupCloseComplete$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(event => {
562
- if (cancellingCloseSources.has(event.via)) {
563
- // Escape, an outside click or a scroll cancels: drop the option the arrow keys reached.
564
- this.synchronizeSelection(this.value());
565
- this.#navigatedItem.set(this.selectedDataItem());
566
- }
567
- else {
568
- const navigatedItem = this.#navigatedItem();
569
- this.updateValue(navigatedItem ? this.getControlValue(navigatedItem) : null);
570
- }
571
- if (this.#dropdownService.focusCanReturn()) {
572
- window.setTimeout(() => this.focus());
573
- }
574
- else if (!this.#destroyRef.destroyed) {
575
- // Focus left from inside the popup (its filter box), so the host never saw a focusout.
576
- this.touch.emit();
577
- }
578
- });
579
- }
580
- setSubscriptions() {
581
- this.setArrowKeyNavigationSubscription();
582
- this.setKeydownSubscription();
583
- this.setFilterChangeSubscription();
584
- this.setPopupCloseSubscriptions();
585
- this.setTypeaheadSpaceSubscription();
586
- this.setTypeaheadSubscription();
587
- }
588
- setTypeaheadSpaceSubscription() {
589
- // While a typeahead search is under way, Space is part of it ("New York"), not the popup toggle.
590
- this.#dropdownService.beforeKeydown$
591
- .pipe(takeUntilDestroyed(this.#destroyRef), filter(e => e.originalEvent?.key === " " && Date.now() - this.#lastTypeaheadKeyTime < TYPEAHEAD_RESET_DELAY))
592
- .subscribe(event => {
593
- event.preventDefault();
594
- event.originalEvent?.preventDefault();
595
- this.pushTypeaheadKey(" ");
596
- });
597
- }
598
- setTypeaheadSubscription() {
599
- setupTypeahead(this.#typeaheadKey)
600
- .pipe(takeUntilDestroyed(this.#destroyRef))
601
- .subscribe(buffer => this.cycleThroughMatchedItems(buffer));
602
- }
603
- synchronizeSelection(value) {
604
- if (value == null) {
605
- this.#listService.clearSelections();
606
- return;
607
- }
608
- if (this.valuePrimitive()) {
609
- this.#listService.setSelectedKeys([value]);
610
- }
611
- else {
612
- this.#listService.setSelectedDataItems([value]);
613
- }
614
- }
615
- updateValue(value) {
616
- if (this.value() !== value) {
617
- this.value.set(value);
618
- }
619
- }
620
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
621
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: DropdownListComponent, isStandalone: true, selector: "mona-dropdown-list", inputs: { ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", 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 }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, itemDisabled: { classPropertyName: "itemDisabled", publicName: "itemDisabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", 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 }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, valuePrimitive: { classPropertyName: "valuePrimitive", publicName: "valuePrimitive", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close", closed: "closed", open: "open", opened: "opened", touch: "touch", value: "valueChange" }, host: { listeners: { "focusout": "onFocusOut($event)" }, properties: { "attr.aria-activedescendant": "activeDescendant()", "attr.aria-busy": "loading() ? 'true' : undefined", "attr.aria-controls": "listId", "attr.aria-describedby": "ariaDescribedBy() || null", "attr.aria-disabled": "effectiveDisabled() ? true : undefined", "attr.aria-expanded": "expanded()", "attr.aria-haspopup": "'listbox'", "attr.aria-invalid": "invalidState() ? true : undefined", "attr.aria-label": "effectiveAriaLabel() || null", "attr.aria-labelledby": "ariaLabelledBy() || null", "attr.aria-readonly": "readonly() ? true : undefined", "attr.aria-required": "required() ? true : undefined", "attr.data-disabled": "effectiveDisabled() || null", "attr.data-invalid": "invalidState() || null", "attr.data-readonly": "readonly() || null", "attr.role": "'combobox'", "attr.tabindex": "effectiveDisabled() ? null : 0", "class": "baseClass()" } }, providers: [
622
- ListService,
623
- DropdownService,
624
- DropdownListService,
625
- {
626
- provide: DROPDOWN_DATA_INPUT_TOKEN,
627
- useExisting: forwardRef(() => DropdownListComponent),
628
- multi: false
629
- },
630
- {
631
- provide: DROPDOWN_POPUP_INPUT_TOKEN,
632
- useExisting: forwardRef(() => DropdownListComponent),
633
- multi: false
634
- }
635
- ], 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: "valueTemplate", first: true, predicate: DropdownListValueTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.DropdownDataHandlerDirective }, { directive: i1.DropdownListPopupHandlerDirective }, { directive: i1.DropdownLiveRegionDirective }], ngImport: i0, template: "@if (prefixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </span>\n}\n\n<span [class]=\"valueContainerClass()\">\n @if (!valueTemplate()) {\n <span>\n @if (selectedListItem()) {\n <span>{{ valueText() }}</span>\n } @else {\n <span>{{ placeholder() }}</span>\n }\n </span>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"valueTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: selectedDataItem() }\"></ng-container>\n }\n</span>\n\n@if (clearButtonVisible()) {\n <mona-indicator-icon\n preset=\"clear\"\n [interactive]=\"true\"\n [label]=\"messages().clear\"\n (activate)=\"onValueClear($event)\"></mona-indicator-icon>\n}\n\n@if (loading()) {\n <mona-indicator-icon preset=\"loading\" [size]=\"12\"></mona-indicator-icon>\n}\n\n<mona-indicator-icon preset=\"dropdown\" [size]=\"18\"></mona-indicator-icon>\n\n<ng-template #popupTemplate>\n <div [class]=\"listPopupClass()\" (pointerdown)=\"onPopupPointerDown($event)\">\n <mona-list [listId]=\"listId\" [focusOnMount]=\"false\" [size]=\"size()\" (itemSelect)=\"onItemSelect($event)\">\n @if (footerTemplate()) {\n <ng-template monaListFooterTemplate>\n <ng-container [ngTemplateOutlet]=\"footerTemplate()\"></ng-container>\n </ng-template>\n }\n @if (groupHeaderTemplate()) {\n <ng-template monaListGroupHeaderTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupHeaderTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (headerTemplate()) {\n <ng-template monaListHeaderTemplate>\n <ng-container [ngTemplateOutlet]=\"headerTemplate()\"></ng-container>\n </ng-template>\n }\n @if (itemTemplate()) {\n <ng-template monaListItemTemplate let-dataItem>\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\n </ng-template>\n }\n @if (noDataTemplate()) {\n <ng-template monaListNoDataTemplate>\n <ng-container [ngTemplateOutlet]=\"noDataTemplate()\"></ng-container>\n </ng-template>\n }\n </mona-list>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ListComponent, selector: "mona-list", inputs: ["ariaLabel", "ariaLabelledBy", "busy", "data", "focusOnMount", "height", "listClass", "listId", "listItemClass", "listItemStyle", "listRole", "listStyle", "maxHeight", "maxWidth", "size", "textField", "width"], outputs: ["itemActivate", "itemSelect"] }, { kind: "directive", type: ListItemTemplateDirective, selector: "ng-template[monaListItemTemplate]" }, { kind: "directive", type: ListGroupHeaderTemplateDirective, selector: "ng-template[monaListGroupHeaderTemplate]" }, { 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: "component", type: IndicatorIconComponent, selector: "mona-indicator-icon", inputs: ["icon", "interactive", "label", "preset", "size", "class"], outputs: ["activate"] }] }); }
636
- }
637
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownListComponent, decorators: [{
638
- type: Component,
639
- args: [{ selector: "mona-dropdown-list", hostDirectives: [DropdownDataHandlerDirective, DropdownListPopupHandlerDirective, DropdownLiveRegionDirective], providers: [
640
- ListService,
641
- DropdownService,
642
- DropdownListService,
643
- {
644
- provide: DROPDOWN_DATA_INPUT_TOKEN,
645
- useExisting: forwardRef(() => DropdownListComponent),
646
- multi: false
647
- },
648
- {
649
- provide: DROPDOWN_POPUP_INPUT_TOKEN,
650
- useExisting: forwardRef(() => DropdownListComponent),
651
- multi: false
652
- }
653
- ], imports: [
654
- NgTemplateOutlet,
655
- ListComponent,
656
- ListItemTemplateDirective,
657
- ListGroupHeaderTemplateDirective,
658
- ListFooterTemplateDirective,
659
- ListHeaderTemplateDirective,
660
- ListNoDataTemplateDirective,
661
- IndicatorIconComponent
662
- ], host: {
663
- "[attr.aria-activedescendant]": "activeDescendant()",
664
- "[attr.aria-busy]": "loading() ? 'true' : undefined",
665
- "[attr.aria-controls]": "listId",
666
- "[attr.aria-describedby]": "ariaDescribedBy() || null",
667
- "[attr.aria-disabled]": "effectiveDisabled() ? true : undefined",
668
- "[attr.aria-expanded]": "expanded()",
669
- "[attr.aria-haspopup]": "'listbox'",
670
- "[attr.aria-invalid]": "invalidState() ? true : undefined",
671
- "[attr.aria-label]": "effectiveAriaLabel() || null",
672
- "[attr.aria-labelledby]": "ariaLabelledBy() || null",
673
- "[attr.aria-readonly]": "readonly() ? true : undefined",
674
- "[attr.aria-required]": "required() ? true : undefined",
675
- "[attr.data-disabled]": "effectiveDisabled() || null",
676
- "[attr.data-invalid]": "invalidState() || null",
677
- "[attr.data-readonly]": "readonly() || null",
678
- "[attr.role]": "'combobox'",
679
- "[attr.tabindex]": "effectiveDisabled() ? null : 0",
680
- "[class]": "baseClass()",
681
- "(focusout)": "onFocusOut($event)"
682
- }, template: "@if (prefixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </span>\n}\n\n<span [class]=\"valueContainerClass()\">\n @if (!valueTemplate()) {\n <span>\n @if (selectedListItem()) {\n <span>{{ valueText() }}</span>\n } @else {\n <span>{{ placeholder() }}</span>\n }\n </span>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"valueTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: selectedDataItem() }\"></ng-container>\n }\n</span>\n\n@if (clearButtonVisible()) {\n <mona-indicator-icon\n preset=\"clear\"\n [interactive]=\"true\"\n [label]=\"messages().clear\"\n (activate)=\"onValueClear($event)\"></mona-indicator-icon>\n}\n\n@if (loading()) {\n <mona-indicator-icon preset=\"loading\" [size]=\"12\"></mona-indicator-icon>\n}\n\n<mona-indicator-icon preset=\"dropdown\" [size]=\"18\"></mona-indicator-icon>\n\n<ng-template #popupTemplate>\n <div [class]=\"listPopupClass()\" (pointerdown)=\"onPopupPointerDown($event)\">\n <mona-list [listId]=\"listId\" [focusOnMount]=\"false\" [size]=\"size()\" (itemSelect)=\"onItemSelect($event)\">\n @if (footerTemplate()) {\n <ng-template monaListFooterTemplate>\n <ng-container [ngTemplateOutlet]=\"footerTemplate()\"></ng-container>\n </ng-template>\n }\n @if (groupHeaderTemplate()) {\n <ng-template monaListGroupHeaderTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupHeaderTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (headerTemplate()) {\n <ng-template monaListHeaderTemplate>\n <ng-container [ngTemplateOutlet]=\"headerTemplate()\"></ng-container>\n </ng-template>\n }\n @if (itemTemplate()) {\n <ng-template monaListItemTemplate let-dataItem>\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\n </ng-template>\n }\n @if (noDataTemplate()) {\n <ng-template monaListNoDataTemplate>\n <ng-container [ngTemplateOutlet]=\"noDataTemplate()\"></ng-container>\n </ng-template>\n }\n </mona-list>\n </div>\n</ng-template>\n" }]
683
- }], ctorParameters: () => [], propDecorators: { footerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownFooterTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], groupHeaderTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownGroupHeaderTemplateDirective), { ...{
684
- read: TemplateRef
685
- }, 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 }] }], valueTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownListValueTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], ariaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", 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 }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], itemDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemDisabled", 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"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], 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 }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], valueField: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueField", required: false }] }], valuePrimitive: [{ type: i0.Input, args: [{ isSignal: true, alias: "valuePrimitive", required: false }] }] } });
686
-
687
- /*
688
- * Public API Surface of @nanahoshi/mona-ui/dropdown-list
689
- */
690
-
691
- /**
692
- * Generated bundle index. Do not edit.
693
- */
694
-
103
+ var DropdownListComponent = class DropdownListComponent {
104
+ #destroyRef;
105
+ #dropdownListService;
106
+ #dropdownService;
107
+ #hostElementRef;
108
+ #i18n;
109
+ #listService;
110
+ #navigatedItem;
111
+ #typeaheadKey;
112
+ #lastTypeaheadKeyTime;
113
+ constructor() {
114
+ this.#destroyRef = inject(DestroyRef);
115
+ this.#dropdownListService = inject(DropdownListService);
116
+ this.#dropdownService = inject(DropdownService);
117
+ this.#hostElementRef = inject(ElementRef);
118
+ this.#i18n = inject(MonaI18nService);
119
+ this.#listService = inject(ListService);
120
+ this.#navigatedItem = linkedSignal(() => this.selectedDataItem(), ...ngDevMode ? [{ debugName: "#navigatedItem" }] : /* istanbul ignore next */ []);
121
+ this.#typeaheadKey = new Subject();
122
+ this.#lastTypeaheadKeyTime = Number.NEGATIVE_INFINITY;
123
+ this.activeDescendant = computed(() => {
124
+ const highlightedItem = this.#listService.highlightedItem();
125
+ return highlightedItem ? highlightedItem.uid : null;
126
+ }, ...ngDevMode ? [{ debugName: "activeDescendant" }] : /* istanbul ignore next */ []);
127
+ this.affixClass = computed(() => {
128
+ return dropdownListAffixContainerThemeVariants();
129
+ }, ...ngDevMode ? [{ debugName: "affixClass" }] : /* istanbul ignore next */ []);
130
+ this.baseClass = computed(() => {
131
+ const disabled = this.effectiveDisabled();
132
+ const expanded = this.expanded();
133
+ const hasPrefix = this.prefixTemplate() != null;
134
+ const invalid = this.invalidState();
135
+ const rounded = this.rounded();
136
+ const size = this.size();
137
+ const classes = dropdownListInputThemeVariants({
138
+ disabled,
139
+ expanded,
140
+ hasPrefix,
141
+ invalid,
142
+ rounded,
143
+ size
144
+ });
145
+ const userClass = this.userClass();
146
+ return twMerge(classes, userClass);
147
+ }, ...ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []);
148
+ this.clearButtonVisible = computed(() => this.showClearButton() && this.selectedListItem() != null && !this.loading() && !this.effectiveDisabled() && !this.readonly(), ...ngDevMode ? [{ debugName: "clearButtonVisible" }] : /* istanbul ignore next */ []);
149
+ this.effectiveAriaLabel = computed(() => this.ariaLabel() || (this.ariaLabelledBy() ? "" : this.placeholder()), ...ngDevMode ? [{ debugName: "effectiveAriaLabel" }] : /* istanbul ignore next */ []);
150
+ this.effectiveDisabled = injectEffectiveDisabled(() => this.disabled());
151
+ this.expanded = computed(() => this.#dropdownService.popupRef() !== null, ...ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []);
152
+ this.footerTemplate = contentChild(DropdownFooterTemplateDirective, {
153
+ ...ngDevMode ? { debugName: "footerTemplate" } : /* istanbul ignore next */ {},
154
+ read: TemplateRef
155
+ });
156
+ this.groupHeaderTemplate = contentChild(DropdownGroupHeaderTemplateDirective, {
157
+ ...ngDevMode ? { debugName: "groupHeaderTemplate" } : /* istanbul ignore next */ {},
158
+ read: TemplateRef
159
+ });
160
+ this.headerTemplate = contentChild(DropdownHeaderTemplateDirective, {
161
+ ...ngDevMode ? { debugName: "headerTemplate" } : /* istanbul ignore next */ {},
162
+ read: TemplateRef
163
+ });
164
+ this.invalidState = computed(() => this.touched() && (this.invalid() || this.required() && this.value() == null), ...ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []);
165
+ this.isEmpty = computed(() => !this.#listService.viewItems().any(), ...ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []);
166
+ this.itemTemplate = contentChild(DropdownItemTemplateDirective, {
167
+ ...ngDevMode ? { debugName: "itemTemplate" } : /* istanbul ignore next */ {},
168
+ read: TemplateRef
169
+ });
170
+ this.listId = createElementControlId();
171
+ this.listPopupClass = computed(() => {
172
+ const rounded = this.rounded();
173
+ const size = this.size();
174
+ const userClass = this.popupClass();
175
+ const variantClass = dropdownPopupThemeVariants({
176
+ rounded,
177
+ size
178
+ });
179
+ const heightClass = this.popupHeight() ? "max-h-none" : "";
180
+ return twMerge(variantClass, heightClass, userClass);
181
+ }, ...ngDevMode ? [{ debugName: "listPopupClass" }] : /* istanbul ignore next */ []);
182
+ this.messages = this.#i18n.componentMessages("dropdownList", DROPDOWN_LIST_DEFAULT_MESSAGES);
183
+ this.noDataTemplate = contentChild(DropdownNoDataTemplateDirective, {
184
+ ...ngDevMode ? { debugName: "noDataTemplate" } : /* istanbul ignore next */ {},
185
+ read: TemplateRef
186
+ });
187
+ this.popupTemplate = viewChild.required("popupTemplate", ...ngDevMode ? [{ debugName: "popupTemplate" }] : /* istanbul ignore next */ []);
188
+ this.prefixTemplate = contentChild(DropdownPrefixTemplateDirective, {
189
+ ...ngDevMode ? { debugName: "prefixTemplate" } : /* istanbul ignore next */ {},
190
+ read: TemplateRef
191
+ });
192
+ this.selectableOptions = {
193
+ enabled: true,
194
+ mode: "single",
195
+ toggleable: false
196
+ };
197
+ this.selectedDataItem = computed(() => {
198
+ return this.selectedListItem()?.data ?? null;
199
+ }, ...ngDevMode ? [{ debugName: "selectedDataItem" }] : /* istanbul ignore next */ []);
200
+ this.selectedListItem = computed(() => {
201
+ return this.#listService.selectedListItems().firstOrDefault();
202
+ }, ...ngDevMode ? [{ debugName: "selectedListItem" }] : /* istanbul ignore next */ []);
203
+ this.valueContainerClass = computed(() => {
204
+ const hasTemplate = this.valueTemplate() != null;
205
+ return dropdownListValueContainerThemeVariants({ hasTemplate });
206
+ }, ...ngDevMode ? [{ debugName: "valueContainerClass" }] : /* istanbul ignore next */ []);
207
+ this.valueTemplate = contentChild(DropdownListValueTemplateDirective, {
208
+ ...ngDevMode ? { debugName: "valueTemplate" } : /* istanbul ignore next */ {},
209
+ read: TemplateRef
210
+ });
211
+ this.valueText = computed(() => {
212
+ const listItem = this.selectedListItem();
213
+ if (!listItem) return "";
214
+ return this.#listService.getItemText(listItem);
215
+ }, ...ngDevMode ? [{ debugName: "valueText" }] : /* istanbul ignore next */ []);
216
+ this.ariaDescribedBy = input("", {
217
+ ...ngDevMode ? { debugName: "ariaDescribedBy" } : /* istanbul ignore next */ {},
218
+ alias: "aria-describedby"
219
+ });
220
+ this.ariaLabel = input("", {
221
+ ...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
222
+ alias: "aria-label"
223
+ });
224
+ this.ariaLabelledBy = input("", {
225
+ ...ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {},
226
+ alias: "aria-labelledby"
227
+ });
228
+ this.close = output();
229
+ this.closed = output();
230
+ this.data = input([], ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
231
+ this.disabled = input(false, {
232
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
233
+ transform: booleanAttribute
234
+ });
235
+ this.invalid = input(false, {
236
+ ...ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {},
237
+ transform: booleanAttribute
238
+ });
239
+ this.itemDisabled = input(...ngDevMode ? [void 0, { debugName: "itemDisabled" }] : /* istanbul ignore next */ []);
240
+ this.loading = input(false, {
241
+ ...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
242
+ transform: booleanAttribute
243
+ });
244
+ this.open = output();
245
+ this.opened = output();
246
+ this.placeholder = input("", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
247
+ this.popupClass = input("", ...ngDevMode ? [{ debugName: "popupClass" }] : /* istanbul ignore next */ []);
248
+ this.popupHeight = input(null, ...ngDevMode ? [{ debugName: "popupHeight" }] : /* istanbul ignore next */ []);
249
+ this.popupWidth = input(null, ...ngDevMode ? [{ debugName: "popupWidth" }] : /* istanbul ignore next */ []);
250
+ this.readonly = input(false, {
251
+ ...ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {},
252
+ transform: booleanAttribute
253
+ });
254
+ this.required = input(false, {
255
+ ...ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {},
256
+ transform: booleanAttribute
257
+ });
258
+ this.rounded = input("medium", ...ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []);
259
+ this.showClearButton = input(false, {
260
+ ...ngDevMode ? { debugName: "showClearButton" } : /* istanbul ignore next */ {},
261
+ transform: booleanAttribute
262
+ });
263
+ this.size = input("medium", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
264
+ this.textField = input(...ngDevMode ? [void 0, { debugName: "textField" }] : /* istanbul ignore next */ []);
265
+ this.touch = output();
266
+ this.touched = input(false, {
267
+ ...ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {},
268
+ transform: booleanAttribute
269
+ });
270
+ this.userClass = input("", {
271
+ ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
272
+ alias: "class"
273
+ });
274
+ this.value = model(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
275
+ this.valueField = input(...ngDevMode ? [void 0, { debugName: "valueField" }] : /* istanbul ignore next */ []);
276
+ this.valuePrimitive = input(false, {
277
+ ...ngDevMode ? { debugName: "valuePrimitive" } : /* istanbul ignore next */ {},
278
+ transform: booleanAttribute
279
+ });
280
+ effect(() => {
281
+ const value = this.value();
282
+ const valueField = this.valueField();
283
+ this.valuePrimitive();
284
+ untracked(() => {
285
+ this.#listService.setValueField(valueField ?? "");
286
+ this.synchronizeSelection(value);
287
+ });
288
+ });
289
+ effect(() => {
290
+ const popupTemplate = this.popupTemplate();
291
+ untracked(() => this.#dropdownService.popupTemplate.set(popupTemplate));
292
+ });
293
+ afterNextRender({ read: () => {
294
+ this.initialize();
295
+ this.setSubscriptions();
296
+ } });
297
+ effect(() => {
298
+ const filterableOptions = this.#listService.filterableOptions();
299
+ untracked(() => {
300
+ if (filterableOptions.enabled) this.#listService.setNavigableOptions({ mode: "highlight" });
301
+ else this.#listService.setNavigableOptions({ mode: "select" });
302
+ });
303
+ });
304
+ }
305
+ focus(options) {
306
+ this.#hostElementRef.nativeElement?.focus(options);
307
+ }
308
+ setValue(value) {
309
+ this.updateValue(value);
310
+ }
311
+ onFocusOut(event) {
312
+ if (this.#destroyRef.destroyed) return;
313
+ const nextTarget = event.relatedTarget;
314
+ if (nextTarget instanceof Node) {
315
+ const popupElement = this.#dropdownService.popupRef()?.overlayRef.overlayElement;
316
+ if (this.#hostElementRef.nativeElement.contains(nextTarget) || popupElement?.contains(nextTarget)) return;
317
+ }
318
+ this.touch.emit();
319
+ }
320
+ onItemSelect(event) {
321
+ if (this.#listService.filterableOptions().enabled && event.source.via === "keyboard" && event.source.key !== "Enter") {
322
+ this.#navigatedItem.set(event.item.data);
323
+ return;
324
+ }
325
+ this.updateValue(this.getControlValue(event.item.data));
326
+ if (event.source.via === "mouse" || event.source.key === "Enter" || event.source.key === "NumpadEnter") this.closePopup();
327
+ }
328
+ onPopupPointerDown(event) {
329
+ if (event.target?.tagName !== "INPUT") event.preventDefault();
330
+ }
331
+ onValueClear(event) {
332
+ if (this.effectiveDisabled() || this.readonly() || event instanceof KeyboardEvent && event.key !== "Enter" && event.key !== " ") return;
333
+ event.stopImmediatePropagation();
334
+ event.preventDefault();
335
+ this.updateValue(null);
336
+ this.#listService.clearSelections();
337
+ this.focus();
338
+ }
339
+ closePopup() {
340
+ this.#dropdownService.popupRef()?.close();
341
+ }
342
+ cycleThroughMatchedItems(buffer) {
343
+ const nextItem = this.#listService.cycleThroughMatchedItems(buffer);
344
+ if (!nextItem) return;
345
+ if (this.#listService.selectedListItems().contains(nextItem)) return;
346
+ this.#listService.selectItem(nextItem);
347
+ if (!this.expanded()) this.updateValue(this.getControlValue(nextItem.data));
348
+ else {
349
+ this.scrollToSelectedItem();
350
+ this.#navigatedItem.set(nextItem.data);
351
+ }
352
+ }
353
+ getControlValue(dataItem) {
354
+ return this.valuePrimitive() ? this.#listService.getDataItemValue(dataItem) : dataItem;
355
+ }
356
+ handleEnterKey() {
357
+ if (!this.expanded()) {
358
+ this.#dropdownService.triggerPopupOpen$.next({});
359
+ return;
360
+ }
361
+ const navigatedItem = this.#navigatedItem();
362
+ if (navigatedItem && this.value() !== this.getControlValue(navigatedItem)) this.updateValue(this.getControlValue(navigatedItem));
363
+ this.closePopup();
364
+ }
365
+ handleHomeEndKeys(event) {
366
+ const itemToSelect = event.key === "Home" ? this.#listService.viewItems().firstOrDefault() : this.#listService.viewItems().lastOrDefault();
367
+ if (!itemToSelect) return;
368
+ this.#listService.selectItem(itemToSelect, true, false);
369
+ if (!this.expanded()) this.updateValue(this.getControlValue(itemToSelect.data));
370
+ else this.#navigatedItem.set(itemToSelect.data);
371
+ }
372
+ initialize() {
373
+ this.#listService.setNavigableOptions({
374
+ enabled: true,
375
+ mode: "select"
376
+ });
377
+ this.#listService.setSelectableOptions(this.selectableOptions);
378
+ }
379
+ pushTypeaheadKey(key) {
380
+ this.#lastTypeaheadKeyTime = Date.now();
381
+ this.#typeaheadKey.next(key);
382
+ }
383
+ scrollToSelectedItem() {
384
+ const item = this.selectedListItem();
385
+ if (!item) return;
386
+ window.setTimeout(() => this.#listService.scrollToItem(item, false));
387
+ }
388
+ setArrowKeyNavigationSubscription() {
389
+ this.#dropdownListService.navigate$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(({ item }) => {
390
+ if (!this.expanded()) this.updateValue(this.getControlValue(item.data));
391
+ else this.#navigatedItem.set(item.data);
392
+ });
393
+ }
394
+ setFilterChangeSubscription() {
395
+ this.#listService.filterChange$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((event) => {
396
+ if (event.filter) {
397
+ const item = this.#listService.getMatchingFilteredItem(event.filter);
398
+ if (item) this.#listService.highlightedItem.set(item);
399
+ }
400
+ });
401
+ }
402
+ setKeydownSubscription() {
403
+ this.#dropdownService.keydown$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((event) => {
404
+ if (event.key === "Enter") {
405
+ event.preventDefault();
406
+ this.handleEnterKey();
407
+ } else if (event.key === "Home" || event.key === "End") {
408
+ event.preventDefault();
409
+ this.handleHomeEndKeys(event);
410
+ } else if (isTypeaheadKey(event.key, event)) this.pushTypeaheadKey(event.key);
411
+ });
412
+ }
413
+ setPopupCloseSubscriptions() {
414
+ this.#dropdownService.popupCloseComplete$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((event) => {
415
+ if (cancellingCloseSources.has(event.via)) {
416
+ this.synchronizeSelection(this.value());
417
+ this.#navigatedItem.set(this.selectedDataItem());
418
+ } else {
419
+ const navigatedItem = this.#navigatedItem();
420
+ this.updateValue(navigatedItem ? this.getControlValue(navigatedItem) : null);
421
+ }
422
+ if (this.#dropdownService.focusCanReturn()) window.setTimeout(() => this.focus());
423
+ else if (!this.#destroyRef.destroyed) this.touch.emit();
424
+ });
425
+ }
426
+ setSubscriptions() {
427
+ this.setArrowKeyNavigationSubscription();
428
+ this.setKeydownSubscription();
429
+ this.setFilterChangeSubscription();
430
+ this.setPopupCloseSubscriptions();
431
+ this.setTypeaheadSpaceSubscription();
432
+ this.setTypeaheadSubscription();
433
+ }
434
+ setTypeaheadSpaceSubscription() {
435
+ this.#dropdownService.beforeKeydown$.pipe(takeUntilDestroyed(this.#destroyRef), filter((e) => e.originalEvent?.key === " " && Date.now() - this.#lastTypeaheadKeyTime < TYPEAHEAD_RESET_DELAY)).subscribe((event) => {
436
+ event.preventDefault();
437
+ event.originalEvent?.preventDefault();
438
+ this.pushTypeaheadKey(" ");
439
+ });
440
+ }
441
+ setTypeaheadSubscription() {
442
+ setupTypeahead(this.#typeaheadKey).pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((buffer) => this.cycleThroughMatchedItems(buffer));
443
+ }
444
+ synchronizeSelection(value) {
445
+ if (value == null) {
446
+ this.#listService.clearSelections();
447
+ return;
448
+ }
449
+ if (this.valuePrimitive()) this.#listService.setSelectedKeys([value]);
450
+ else this.#listService.setSelectedDataItems([value]);
451
+ }
452
+ updateValue(value) {
453
+ if (this.value() !== value) this.value.set(value);
454
+ }
455
+ static {
456
+ this.ɵfac = i0.ɵɵngDeclareFactory({
457
+ minVersion: "12.0.0",
458
+ version: "22.2.6",
459
+ ngImport: i0,
460
+ type: DropdownListComponent,
461
+ deps: [],
462
+ target: i0.ɵɵFactoryTarget.Component
463
+ });
464
+ }
465
+ static {
466
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
467
+ minVersion: "17.0.0",
468
+ version: "22.2.6",
469
+ type: DropdownListComponent,
470
+ isStandalone: true,
471
+ selector: "mona-dropdown-list",
472
+ inputs: {
473
+ ariaDescribedBy: {
474
+ classPropertyName: "ariaDescribedBy",
475
+ publicName: "aria-describedby",
476
+ isSignal: true,
477
+ isRequired: false,
478
+ transformFunction: null
479
+ },
480
+ ariaLabel: {
481
+ classPropertyName: "ariaLabel",
482
+ publicName: "aria-label",
483
+ isSignal: true,
484
+ isRequired: false,
485
+ transformFunction: null
486
+ },
487
+ ariaLabelledBy: {
488
+ classPropertyName: "ariaLabelledBy",
489
+ publicName: "aria-labelledby",
490
+ isSignal: true,
491
+ isRequired: false,
492
+ transformFunction: null
493
+ },
494
+ data: {
495
+ classPropertyName: "data",
496
+ publicName: "data",
497
+ isSignal: true,
498
+ isRequired: false,
499
+ transformFunction: null
500
+ },
501
+ disabled: {
502
+ classPropertyName: "disabled",
503
+ publicName: "disabled",
504
+ isSignal: true,
505
+ isRequired: false,
506
+ transformFunction: null
507
+ },
508
+ invalid: {
509
+ classPropertyName: "invalid",
510
+ publicName: "invalid",
511
+ isSignal: true,
512
+ isRequired: false,
513
+ transformFunction: null
514
+ },
515
+ itemDisabled: {
516
+ classPropertyName: "itemDisabled",
517
+ publicName: "itemDisabled",
518
+ isSignal: true,
519
+ isRequired: false,
520
+ transformFunction: null
521
+ },
522
+ loading: {
523
+ classPropertyName: "loading",
524
+ publicName: "loading",
525
+ isSignal: true,
526
+ isRequired: false,
527
+ transformFunction: null
528
+ },
529
+ placeholder: {
530
+ classPropertyName: "placeholder",
531
+ publicName: "placeholder",
532
+ isSignal: true,
533
+ isRequired: false,
534
+ transformFunction: null
535
+ },
536
+ popupClass: {
537
+ classPropertyName: "popupClass",
538
+ publicName: "popupClass",
539
+ isSignal: true,
540
+ isRequired: false,
541
+ transformFunction: null
542
+ },
543
+ popupHeight: {
544
+ classPropertyName: "popupHeight",
545
+ publicName: "popupHeight",
546
+ isSignal: true,
547
+ isRequired: false,
548
+ transformFunction: null
549
+ },
550
+ popupWidth: {
551
+ classPropertyName: "popupWidth",
552
+ publicName: "popupWidth",
553
+ isSignal: true,
554
+ isRequired: false,
555
+ transformFunction: null
556
+ },
557
+ readonly: {
558
+ classPropertyName: "readonly",
559
+ publicName: "readonly",
560
+ isSignal: true,
561
+ isRequired: false,
562
+ transformFunction: null
563
+ },
564
+ required: {
565
+ classPropertyName: "required",
566
+ publicName: "required",
567
+ isSignal: true,
568
+ isRequired: false,
569
+ transformFunction: null
570
+ },
571
+ rounded: {
572
+ classPropertyName: "rounded",
573
+ publicName: "rounded",
574
+ isSignal: true,
575
+ isRequired: false,
576
+ transformFunction: null
577
+ },
578
+ showClearButton: {
579
+ classPropertyName: "showClearButton",
580
+ publicName: "showClearButton",
581
+ isSignal: true,
582
+ isRequired: false,
583
+ transformFunction: null
584
+ },
585
+ size: {
586
+ classPropertyName: "size",
587
+ publicName: "size",
588
+ isSignal: true,
589
+ isRequired: false,
590
+ transformFunction: null
591
+ },
592
+ textField: {
593
+ classPropertyName: "textField",
594
+ publicName: "textField",
595
+ isSignal: true,
596
+ isRequired: false,
597
+ transformFunction: null
598
+ },
599
+ touched: {
600
+ classPropertyName: "touched",
601
+ publicName: "touched",
602
+ isSignal: true,
603
+ isRequired: false,
604
+ transformFunction: null
605
+ },
606
+ userClass: {
607
+ classPropertyName: "userClass",
608
+ publicName: "class",
609
+ isSignal: true,
610
+ isRequired: false,
611
+ transformFunction: null
612
+ },
613
+ value: {
614
+ classPropertyName: "value",
615
+ publicName: "value",
616
+ isSignal: true,
617
+ isRequired: false,
618
+ transformFunction: null
619
+ },
620
+ valueField: {
621
+ classPropertyName: "valueField",
622
+ publicName: "valueField",
623
+ isSignal: true,
624
+ isRequired: false,
625
+ transformFunction: null
626
+ },
627
+ valuePrimitive: {
628
+ classPropertyName: "valuePrimitive",
629
+ publicName: "valuePrimitive",
630
+ isSignal: true,
631
+ isRequired: false,
632
+ transformFunction: null
633
+ }
634
+ },
635
+ outputs: {
636
+ close: "close",
637
+ closed: "closed",
638
+ open: "open",
639
+ opened: "opened",
640
+ touch: "touch",
641
+ value: "valueChange"
642
+ },
643
+ host: {
644
+ listeners: { "focusout": "onFocusOut($event)" },
645
+ properties: {
646
+ "attr.aria-activedescendant": "activeDescendant()",
647
+ "attr.aria-busy": "loading() ? 'true' : undefined",
648
+ "attr.aria-controls": "listId",
649
+ "attr.aria-describedby": "ariaDescribedBy() || null",
650
+ "attr.aria-disabled": "effectiveDisabled() ? true : undefined",
651
+ "attr.aria-expanded": "expanded()",
652
+ "attr.aria-haspopup": "'listbox'",
653
+ "attr.aria-invalid": "invalidState() ? true : undefined",
654
+ "attr.aria-label": "effectiveAriaLabel() || null",
655
+ "attr.aria-labelledby": "ariaLabelledBy() || null",
656
+ "attr.aria-readonly": "readonly() ? true : undefined",
657
+ "attr.aria-required": "required() ? true : undefined",
658
+ "attr.data-disabled": "effectiveDisabled() || null",
659
+ "attr.data-invalid": "invalidState() || null",
660
+ "attr.data-readonly": "readonly() || null",
661
+ "attr.role": "'combobox'",
662
+ "attr.tabindex": "effectiveDisabled() ? null : 0",
663
+ "class": "baseClass()"
664
+ }
665
+ },
666
+ providers: [
667
+ ListService,
668
+ DropdownService,
669
+ DropdownListService,
670
+ {
671
+ provide: DROPDOWN_DATA_INPUT_TOKEN,
672
+ useExisting: forwardRef(() => DropdownListComponent),
673
+ multi: false
674
+ },
675
+ {
676
+ provide: DROPDOWN_POPUP_INPUT_TOKEN,
677
+ useExisting: forwardRef(() => DropdownListComponent),
678
+ multi: false
679
+ }
680
+ ],
681
+ queries: [
682
+ {
683
+ propertyName: "footerTemplate",
684
+ first: true,
685
+ predicate: DropdownFooterTemplateDirective,
686
+ descendants: true,
687
+ read: TemplateRef,
688
+ isSignal: true
689
+ },
690
+ {
691
+ propertyName: "groupHeaderTemplate",
692
+ first: true,
693
+ predicate: DropdownGroupHeaderTemplateDirective,
694
+ descendants: true,
695
+ read: TemplateRef,
696
+ isSignal: true
697
+ },
698
+ {
699
+ propertyName: "headerTemplate",
700
+ first: true,
701
+ predicate: DropdownHeaderTemplateDirective,
702
+ descendants: true,
703
+ read: TemplateRef,
704
+ isSignal: true
705
+ },
706
+ {
707
+ propertyName: "itemTemplate",
708
+ first: true,
709
+ predicate: DropdownItemTemplateDirective,
710
+ descendants: true,
711
+ read: TemplateRef,
712
+ isSignal: true
713
+ },
714
+ {
715
+ propertyName: "noDataTemplate",
716
+ first: true,
717
+ predicate: DropdownNoDataTemplateDirective,
718
+ descendants: true,
719
+ read: TemplateRef,
720
+ isSignal: true
721
+ },
722
+ {
723
+ propertyName: "prefixTemplate",
724
+ first: true,
725
+ predicate: DropdownPrefixTemplateDirective,
726
+ descendants: true,
727
+ read: TemplateRef,
728
+ isSignal: true
729
+ },
730
+ {
731
+ propertyName: "valueTemplate",
732
+ first: true,
733
+ predicate: DropdownListValueTemplateDirective,
734
+ descendants: true,
735
+ read: TemplateRef,
736
+ isSignal: true
737
+ }
738
+ ],
739
+ viewQueries: [{
740
+ propertyName: "popupTemplate",
741
+ first: true,
742
+ predicate: ["popupTemplate"],
743
+ descendants: true,
744
+ isSignal: true
745
+ }],
746
+ hostDirectives: [
747
+ { directive: i1.DropdownDataHandlerDirective },
748
+ { directive: i1.DropdownListPopupHandlerDirective },
749
+ { directive: i1.DropdownLiveRegionDirective }
750
+ ],
751
+ ngImport: i0,
752
+ template: "@if (prefixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </span>\n}\n\n<span [class]=\"valueContainerClass()\">\n @if (!valueTemplate()) {\n <span>\n @if (selectedListItem()) {\n <span>{{ valueText() }}</span>\n } @else {\n <span>{{ placeholder() }}</span>\n }\n </span>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"valueTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: selectedDataItem() }\"></ng-container>\n }\n</span>\n\n@if (clearButtonVisible()) {\n <mona-indicator-icon\n preset=\"clear\"\n [interactive]=\"true\"\n [label]=\"messages().clear\"\n (activate)=\"onValueClear($event)\"></mona-indicator-icon>\n}\n\n@if (loading()) {\n <mona-indicator-icon preset=\"loading\" [size]=\"12\"></mona-indicator-icon>\n}\n\n<mona-indicator-icon preset=\"dropdown\" [size]=\"18\"></mona-indicator-icon>\n\n<ng-template #popupTemplate>\n <div [class]=\"listPopupClass()\" (pointerdown)=\"onPopupPointerDown($event)\">\n <mona-list [listId]=\"listId\" [focusOnMount]=\"false\" [size]=\"size()\" (itemSelect)=\"onItemSelect($event)\">\n @if (footerTemplate()) {\n <ng-template monaListFooterTemplate>\n <ng-container [ngTemplateOutlet]=\"footerTemplate()\"></ng-container>\n </ng-template>\n }\n @if (groupHeaderTemplate()) {\n <ng-template monaListGroupHeaderTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupHeaderTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (headerTemplate()) {\n <ng-template monaListHeaderTemplate>\n <ng-container [ngTemplateOutlet]=\"headerTemplate()\"></ng-container>\n </ng-template>\n }\n @if (itemTemplate()) {\n <ng-template monaListItemTemplate let-dataItem>\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\n </ng-template>\n }\n @if (noDataTemplate()) {\n <ng-template monaListNoDataTemplate>\n <ng-container [ngTemplateOutlet]=\"noDataTemplate()\"></ng-container>\n </ng-template>\n }\n </mona-list>\n </div>\n</ng-template>\n",
753
+ dependencies: [
754
+ {
755
+ kind: "directive",
756
+ type: NgTemplateOutlet,
757
+ selector: "[ngTemplateOutlet]",
758
+ inputs: [
759
+ "ngTemplateOutletContext",
760
+ "ngTemplateOutlet",
761
+ "ngTemplateOutletInjector"
762
+ ]
763
+ },
764
+ {
765
+ kind: "component",
766
+ type: ListComponent,
767
+ selector: "mona-list",
768
+ inputs: [
769
+ "ariaLabel",
770
+ "ariaLabelledBy",
771
+ "busy",
772
+ "data",
773
+ "focusOnMount",
774
+ "height",
775
+ "listClass",
776
+ "listId",
777
+ "listItemClass",
778
+ "listItemStyle",
779
+ "listRole",
780
+ "listStyle",
781
+ "maxHeight",
782
+ "maxWidth",
783
+ "size",
784
+ "textField",
785
+ "width"
786
+ ],
787
+ outputs: ["itemActivate", "itemSelect"]
788
+ },
789
+ {
790
+ kind: "directive",
791
+ type: ListItemTemplateDirective,
792
+ selector: "ng-template[monaListItemTemplate]"
793
+ },
794
+ {
795
+ kind: "directive",
796
+ type: ListGroupHeaderTemplateDirective,
797
+ selector: "ng-template[monaListGroupHeaderTemplate]"
798
+ },
799
+ {
800
+ kind: "directive",
801
+ type: ListFooterTemplateDirective,
802
+ selector: "ng-template[monaListFooterTemplate]"
803
+ },
804
+ {
805
+ kind: "directive",
806
+ type: ListHeaderTemplateDirective,
807
+ selector: "ng-template[monaListHeaderTemplate]"
808
+ },
809
+ {
810
+ kind: "directive",
811
+ type: ListNoDataTemplateDirective,
812
+ selector: "ng-template[monaListNoDataTemplate]"
813
+ },
814
+ {
815
+ kind: "component",
816
+ type: IndicatorIconComponent,
817
+ selector: "mona-indicator-icon",
818
+ inputs: [
819
+ "icon",
820
+ "interactive",
821
+ "label",
822
+ "preset",
823
+ "size",
824
+ "class"
825
+ ],
826
+ outputs: ["activate"]
827
+ }
828
+ ]
829
+ });
830
+ }
831
+ };
832
+ i0.ɵɵngDeclareClassMetadata({
833
+ minVersion: "12.0.0",
834
+ version: "22.2.6",
835
+ ngImport: i0,
836
+ type: DropdownListComponent,
837
+ decorators: [{
838
+ type: Component,
839
+ args: [{
840
+ selector: "mona-dropdown-list",
841
+ hostDirectives: [
842
+ DropdownDataHandlerDirective,
843
+ DropdownListPopupHandlerDirective,
844
+ DropdownLiveRegionDirective
845
+ ],
846
+ providers: [
847
+ ListService,
848
+ DropdownService,
849
+ DropdownListService,
850
+ {
851
+ provide: DROPDOWN_DATA_INPUT_TOKEN,
852
+ useExisting: forwardRef(() => DropdownListComponent),
853
+ multi: false
854
+ },
855
+ {
856
+ provide: DROPDOWN_POPUP_INPUT_TOKEN,
857
+ useExisting: forwardRef(() => DropdownListComponent),
858
+ multi: false
859
+ }
860
+ ],
861
+ imports: [
862
+ NgTemplateOutlet,
863
+ ListComponent,
864
+ ListItemTemplateDirective,
865
+ ListGroupHeaderTemplateDirective,
866
+ ListFooterTemplateDirective,
867
+ ListHeaderTemplateDirective,
868
+ ListNoDataTemplateDirective,
869
+ IndicatorIconComponent
870
+ ],
871
+ host: {
872
+ "[attr.aria-activedescendant]": "activeDescendant()",
873
+ "[attr.aria-busy]": "loading() ? 'true' : undefined",
874
+ "[attr.aria-controls]": "listId",
875
+ "[attr.aria-describedby]": "ariaDescribedBy() || null",
876
+ "[attr.aria-disabled]": "effectiveDisabled() ? true : undefined",
877
+ "[attr.aria-expanded]": "expanded()",
878
+ "[attr.aria-haspopup]": "'listbox'",
879
+ "[attr.aria-invalid]": "invalidState() ? true : undefined",
880
+ "[attr.aria-label]": "effectiveAriaLabel() || null",
881
+ "[attr.aria-labelledby]": "ariaLabelledBy() || null",
882
+ "[attr.aria-readonly]": "readonly() ? true : undefined",
883
+ "[attr.aria-required]": "required() ? true : undefined",
884
+ "[attr.data-disabled]": "effectiveDisabled() || null",
885
+ "[attr.data-invalid]": "invalidState() || null",
886
+ "[attr.data-readonly]": "readonly() || null",
887
+ "[attr.role]": "'combobox'",
888
+ "[attr.tabindex]": "effectiveDisabled() ? null : 0",
889
+ "[class]": "baseClass()",
890
+ "(focusout)": "onFocusOut($event)"
891
+ },
892
+ template: "@if (prefixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </span>\n}\n\n<span [class]=\"valueContainerClass()\">\n @if (!valueTemplate()) {\n <span>\n @if (selectedListItem()) {\n <span>{{ valueText() }}</span>\n } @else {\n <span>{{ placeholder() }}</span>\n }\n </span>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"valueTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: selectedDataItem() }\"></ng-container>\n }\n</span>\n\n@if (clearButtonVisible()) {\n <mona-indicator-icon\n preset=\"clear\"\n [interactive]=\"true\"\n [label]=\"messages().clear\"\n (activate)=\"onValueClear($event)\"></mona-indicator-icon>\n}\n\n@if (loading()) {\n <mona-indicator-icon preset=\"loading\" [size]=\"12\"></mona-indicator-icon>\n}\n\n<mona-indicator-icon preset=\"dropdown\" [size]=\"18\"></mona-indicator-icon>\n\n<ng-template #popupTemplate>\n <div [class]=\"listPopupClass()\" (pointerdown)=\"onPopupPointerDown($event)\">\n <mona-list [listId]=\"listId\" [focusOnMount]=\"false\" [size]=\"size()\" (itemSelect)=\"onItemSelect($event)\">\n @if (footerTemplate()) {\n <ng-template monaListFooterTemplate>\n <ng-container [ngTemplateOutlet]=\"footerTemplate()\"></ng-container>\n </ng-template>\n }\n @if (groupHeaderTemplate()) {\n <ng-template monaListGroupHeaderTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupHeaderTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (headerTemplate()) {\n <ng-template monaListHeaderTemplate>\n <ng-container [ngTemplateOutlet]=\"headerTemplate()\"></ng-container>\n </ng-template>\n }\n @if (itemTemplate()) {\n <ng-template monaListItemTemplate let-dataItem>\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\n </ng-template>\n }\n @if (noDataTemplate()) {\n <ng-template monaListNoDataTemplate>\n <ng-container [ngTemplateOutlet]=\"noDataTemplate()\"></ng-container>\n </ng-template>\n }\n </mona-list>\n </div>\n</ng-template>\n"
893
+ }]
894
+ }],
895
+ ctorParameters: () => [],
896
+ propDecorators: {
897
+ footerTemplate: [{
898
+ type: i0.ContentChild,
899
+ args: [i0.forwardRef(() => DropdownFooterTemplateDirective), {
900
+ read: TemplateRef,
901
+ isSignal: true
902
+ }]
903
+ }],
904
+ groupHeaderTemplate: [{
905
+ type: i0.ContentChild,
906
+ args: [i0.forwardRef(() => DropdownGroupHeaderTemplateDirective), {
907
+ read: TemplateRef,
908
+ isSignal: true
909
+ }]
910
+ }],
911
+ headerTemplate: [{
912
+ type: i0.ContentChild,
913
+ args: [i0.forwardRef(() => DropdownHeaderTemplateDirective), {
914
+ read: TemplateRef,
915
+ isSignal: true
916
+ }]
917
+ }],
918
+ itemTemplate: [{
919
+ type: i0.ContentChild,
920
+ args: [i0.forwardRef(() => DropdownItemTemplateDirective), {
921
+ read: TemplateRef,
922
+ isSignal: true
923
+ }]
924
+ }],
925
+ noDataTemplate: [{
926
+ type: i0.ContentChild,
927
+ args: [i0.forwardRef(() => DropdownNoDataTemplateDirective), {
928
+ read: TemplateRef,
929
+ isSignal: true
930
+ }]
931
+ }],
932
+ popupTemplate: [{
933
+ type: i0.ViewChild,
934
+ args: ["popupTemplate", { isSignal: true }]
935
+ }],
936
+ prefixTemplate: [{
937
+ type: i0.ContentChild,
938
+ args: [i0.forwardRef(() => DropdownPrefixTemplateDirective), {
939
+ read: TemplateRef,
940
+ isSignal: true
941
+ }]
942
+ }],
943
+ valueTemplate: [{
944
+ type: i0.ContentChild,
945
+ args: [i0.forwardRef(() => DropdownListValueTemplateDirective), {
946
+ read: TemplateRef,
947
+ isSignal: true
948
+ }]
949
+ }],
950
+ ariaDescribedBy: [{
951
+ type: i0.Input,
952
+ args: [{
953
+ isSignal: true,
954
+ alias: "aria-describedby",
955
+ required: false
956
+ }]
957
+ }],
958
+ ariaLabel: [{
959
+ type: i0.Input,
960
+ args: [{
961
+ isSignal: true,
962
+ alias: "aria-label",
963
+ required: false
964
+ }]
965
+ }],
966
+ ariaLabelledBy: [{
967
+ type: i0.Input,
968
+ args: [{
969
+ isSignal: true,
970
+ alias: "aria-labelledby",
971
+ required: false
972
+ }]
973
+ }],
974
+ close: [{
975
+ type: i0.Output,
976
+ args: ["close"]
977
+ }],
978
+ closed: [{
979
+ type: i0.Output,
980
+ args: ["closed"]
981
+ }],
982
+ data: [{
983
+ type: i0.Input,
984
+ args: [{
985
+ isSignal: true,
986
+ alias: "data",
987
+ required: false
988
+ }]
989
+ }],
990
+ disabled: [{
991
+ type: i0.Input,
992
+ args: [{
993
+ isSignal: true,
994
+ alias: "disabled",
995
+ required: false
996
+ }]
997
+ }],
998
+ invalid: [{
999
+ type: i0.Input,
1000
+ args: [{
1001
+ isSignal: true,
1002
+ alias: "invalid",
1003
+ required: false
1004
+ }]
1005
+ }],
1006
+ itemDisabled: [{
1007
+ type: i0.Input,
1008
+ args: [{
1009
+ isSignal: true,
1010
+ alias: "itemDisabled",
1011
+ required: false
1012
+ }]
1013
+ }],
1014
+ loading: [{
1015
+ type: i0.Input,
1016
+ args: [{
1017
+ isSignal: true,
1018
+ alias: "loading",
1019
+ required: false
1020
+ }]
1021
+ }],
1022
+ open: [{
1023
+ type: i0.Output,
1024
+ args: ["open"]
1025
+ }],
1026
+ opened: [{
1027
+ type: i0.Output,
1028
+ args: ["opened"]
1029
+ }],
1030
+ placeholder: [{
1031
+ type: i0.Input,
1032
+ args: [{
1033
+ isSignal: true,
1034
+ alias: "placeholder",
1035
+ required: false
1036
+ }]
1037
+ }],
1038
+ popupClass: [{
1039
+ type: i0.Input,
1040
+ args: [{
1041
+ isSignal: true,
1042
+ alias: "popupClass",
1043
+ required: false
1044
+ }]
1045
+ }],
1046
+ popupHeight: [{
1047
+ type: i0.Input,
1048
+ args: [{
1049
+ isSignal: true,
1050
+ alias: "popupHeight",
1051
+ required: false
1052
+ }]
1053
+ }],
1054
+ popupWidth: [{
1055
+ type: i0.Input,
1056
+ args: [{
1057
+ isSignal: true,
1058
+ alias: "popupWidth",
1059
+ required: false
1060
+ }]
1061
+ }],
1062
+ readonly: [{
1063
+ type: i0.Input,
1064
+ args: [{
1065
+ isSignal: true,
1066
+ alias: "readonly",
1067
+ required: false
1068
+ }]
1069
+ }],
1070
+ required: [{
1071
+ type: i0.Input,
1072
+ args: [{
1073
+ isSignal: true,
1074
+ alias: "required",
1075
+ required: false
1076
+ }]
1077
+ }],
1078
+ rounded: [{
1079
+ type: i0.Input,
1080
+ args: [{
1081
+ isSignal: true,
1082
+ alias: "rounded",
1083
+ required: false
1084
+ }]
1085
+ }],
1086
+ showClearButton: [{
1087
+ type: i0.Input,
1088
+ args: [{
1089
+ isSignal: true,
1090
+ alias: "showClearButton",
1091
+ required: false
1092
+ }]
1093
+ }],
1094
+ size: [{
1095
+ type: i0.Input,
1096
+ args: [{
1097
+ isSignal: true,
1098
+ alias: "size",
1099
+ required: false
1100
+ }]
1101
+ }],
1102
+ textField: [{
1103
+ type: i0.Input,
1104
+ args: [{
1105
+ isSignal: true,
1106
+ alias: "textField",
1107
+ required: false
1108
+ }]
1109
+ }],
1110
+ touch: [{
1111
+ type: i0.Output,
1112
+ args: ["touch"]
1113
+ }],
1114
+ touched: [{
1115
+ type: i0.Input,
1116
+ args: [{
1117
+ isSignal: true,
1118
+ alias: "touched",
1119
+ required: false
1120
+ }]
1121
+ }],
1122
+ userClass: [{
1123
+ type: i0.Input,
1124
+ args: [{
1125
+ isSignal: true,
1126
+ alias: "class",
1127
+ required: false
1128
+ }]
1129
+ }],
1130
+ value: [{
1131
+ type: i0.Input,
1132
+ args: [{
1133
+ isSignal: true,
1134
+ alias: "value",
1135
+ required: false
1136
+ }]
1137
+ }, {
1138
+ type: i0.Output,
1139
+ args: ["valueChange"]
1140
+ }],
1141
+ valueField: [{
1142
+ type: i0.Input,
1143
+ args: [{
1144
+ isSignal: true,
1145
+ alias: "valueField",
1146
+ required: false
1147
+ }]
1148
+ }],
1149
+ valuePrimitive: [{
1150
+ type: i0.Input,
1151
+ args: [{
1152
+ isSignal: true,
1153
+ alias: "valuePrimitive",
1154
+ required: false
1155
+ }]
1156
+ }]
1157
+ }
1158
+ });
695
1159
  export { DROPDOWN_LIST_DEFAULT_MESSAGES, DropdownListComponent, DropdownListValueTemplateDirective };
696
- //# sourceMappingURL=nanahoshi-mona-ui-dropdown-list.mjs.map
1160
+
1161
+ //# sourceMappingURL=nanahoshi-mona-ui-dropdown-list.mjs.map