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