@vadem/ui 0.0.0-stage → 0.0.1

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 (289) hide show
  1. package/LICENSE-lucide.txt +43 -0
  2. package/README.md +19 -2
  3. package/fesm2022/vadem-ui-accordion.mjs +139 -0
  4. package/fesm2022/vadem-ui-accordion.mjs.map +1 -0
  5. package/fesm2022/vadem-ui-active-filters.mjs +355 -0
  6. package/fesm2022/vadem-ui-active-filters.mjs.map +1 -0
  7. package/fesm2022/vadem-ui-alert-dialog.mjs +433 -0
  8. package/fesm2022/vadem-ui-alert-dialog.mjs.map +1 -0
  9. package/fesm2022/vadem-ui-alert.mjs +266 -0
  10. package/fesm2022/vadem-ui-alert.mjs.map +1 -0
  11. package/fesm2022/vadem-ui-autocomplete.mjs +715 -0
  12. package/fesm2022/vadem-ui-autocomplete.mjs.map +1 -0
  13. package/fesm2022/vadem-ui-avatar.mjs +219 -0
  14. package/fesm2022/vadem-ui-avatar.mjs.map +1 -0
  15. package/fesm2022/vadem-ui-badge.mjs +86 -0
  16. package/fesm2022/vadem-ui-badge.mjs.map +1 -0
  17. package/fesm2022/vadem-ui-breadcrumbs.mjs +61 -0
  18. package/fesm2022/vadem-ui-breadcrumbs.mjs.map +1 -0
  19. package/fesm2022/vadem-ui-button.mjs +220 -0
  20. package/fesm2022/vadem-ui-button.mjs.map +1 -0
  21. package/fesm2022/vadem-ui-calendar.mjs +1314 -0
  22. package/fesm2022/vadem-ui-calendar.mjs.map +1 -0
  23. package/fesm2022/vadem-ui-card.mjs +271 -0
  24. package/fesm2022/vadem-ui-card.mjs.map +1 -0
  25. package/fesm2022/vadem-ui-character-count.mjs +269 -0
  26. package/fesm2022/vadem-ui-character-count.mjs.map +1 -0
  27. package/fesm2022/vadem-ui-chart.mjs +1984 -0
  28. package/fesm2022/vadem-ui-chart.mjs.map +1 -0
  29. package/fesm2022/vadem-ui-checkbox.mjs +67 -0
  30. package/fesm2022/vadem-ui-checkbox.mjs.map +1 -0
  31. package/fesm2022/vadem-ui-color-picker.mjs +815 -0
  32. package/fesm2022/vadem-ui-color-picker.mjs.map +1 -0
  33. package/fesm2022/vadem-ui-command.mjs +735 -0
  34. package/fesm2022/vadem-ui-command.mjs.map +1 -0
  35. package/fesm2022/vadem-ui-copy-button.mjs +375 -0
  36. package/fesm2022/vadem-ui-copy-button.mjs.map +1 -0
  37. package/fesm2022/vadem-ui-date-range-picker.mjs +1011 -0
  38. package/fesm2022/vadem-ui-date-range-picker.mjs.map +1 -0
  39. package/fesm2022/vadem-ui-description-list.mjs +59 -0
  40. package/fesm2022/vadem-ui-description-list.mjs.map +1 -0
  41. package/fesm2022/vadem-ui-dialog.mjs +587 -0
  42. package/fesm2022/vadem-ui-dialog.mjs.map +1 -0
  43. package/fesm2022/vadem-ui-dropzone.mjs +176 -0
  44. package/fesm2022/vadem-ui-dropzone.mjs.map +1 -0
  45. package/fesm2022/vadem-ui-editable-text.mjs +641 -0
  46. package/fesm2022/vadem-ui-editable-text.mjs.map +1 -0
  47. package/fesm2022/vadem-ui-empty-state.mjs +175 -0
  48. package/fesm2022/vadem-ui-empty-state.mjs.map +1 -0
  49. package/fesm2022/vadem-ui-expandable-text.mjs +244 -0
  50. package/fesm2022/vadem-ui-expandable-text.mjs.map +1 -0
  51. package/fesm2022/vadem-ui-field.mjs +583 -0
  52. package/fesm2022/vadem-ui-field.mjs.map +1 -0
  53. package/fesm2022/vadem-ui-file-preview.mjs +532 -0
  54. package/fesm2022/vadem-ui-file-preview.mjs.map +1 -0
  55. package/fesm2022/vadem-ui-file-size.mjs +83 -0
  56. package/fesm2022/vadem-ui-file-size.mjs.map +1 -0
  57. package/fesm2022/vadem-ui-form-error-summary.mjs +201 -0
  58. package/fesm2022/vadem-ui-form-error-summary.mjs.map +1 -0
  59. package/fesm2022/vadem-ui-icon.mjs +303 -0
  60. package/fesm2022/vadem-ui-icon.mjs.map +1 -0
  61. package/fesm2022/vadem-ui-input.mjs +120 -0
  62. package/fesm2022/vadem-ui-input.mjs.map +1 -0
  63. package/fesm2022/vadem-ui-kbd.mjs +286 -0
  64. package/fesm2022/vadem-ui-kbd.mjs.map +1 -0
  65. package/fesm2022/vadem-ui-keyboard.mjs +105 -0
  66. package/fesm2022/vadem-ui-keyboard.mjs.map +1 -0
  67. package/fesm2022/vadem-ui-locale.mjs +443 -0
  68. package/fesm2022/vadem-ui-locale.mjs.map +1 -0
  69. package/fesm2022/vadem-ui-menu.mjs +637 -0
  70. package/fesm2022/vadem-ui-menu.mjs.map +1 -0
  71. package/fesm2022/vadem-ui-navigation-list.mjs +130 -0
  72. package/fesm2022/vadem-ui-navigation-list.mjs.map +1 -0
  73. package/fesm2022/vadem-ui-number-input.mjs +264 -0
  74. package/fesm2022/vadem-ui-number-input.mjs.map +1 -0
  75. package/fesm2022/vadem-ui-otp-input.mjs +86 -0
  76. package/fesm2022/vadem-ui-otp-input.mjs.map +1 -0
  77. package/fesm2022/vadem-ui-pagination.mjs +353 -0
  78. package/fesm2022/vadem-ui-pagination.mjs.map +1 -0
  79. package/fesm2022/vadem-ui-password-input.mjs +213 -0
  80. package/fesm2022/vadem-ui-password-input.mjs.map +1 -0
  81. package/fesm2022/vadem-ui-popover.mjs +178 -0
  82. package/fesm2022/vadem-ui-popover.mjs.map +1 -0
  83. package/fesm2022/vadem-ui-progress.mjs +331 -0
  84. package/fesm2022/vadem-ui-progress.mjs.map +1 -0
  85. package/fesm2022/vadem-ui-radio.mjs +39 -0
  86. package/fesm2022/vadem-ui-radio.mjs.map +1 -0
  87. package/fesm2022/vadem-ui-range-slider.mjs +561 -0
  88. package/fesm2022/vadem-ui-range-slider.mjs.map +1 -0
  89. package/fesm2022/vadem-ui-rating.mjs +404 -0
  90. package/fesm2022/vadem-ui-rating.mjs.map +1 -0
  91. package/fesm2022/vadem-ui-relative-time.mjs +217 -0
  92. package/fesm2022/vadem-ui-relative-time.mjs.map +1 -0
  93. package/fesm2022/vadem-ui-reorder-list.mjs +601 -0
  94. package/fesm2022/vadem-ui-reorder-list.mjs.map +1 -0
  95. package/fesm2022/vadem-ui-scroll-area.mjs +65 -0
  96. package/fesm2022/vadem-ui-scroll-area.mjs.map +1 -0
  97. package/fesm2022/vadem-ui-search-input.mjs +307 -0
  98. package/fesm2022/vadem-ui-search-input.mjs.map +1 -0
  99. package/fesm2022/vadem-ui-segmented.mjs +297 -0
  100. package/fesm2022/vadem-ui-segmented.mjs.map +1 -0
  101. package/fesm2022/vadem-ui-select.mjs +1462 -0
  102. package/fesm2022/vadem-ui-select.mjs.map +1 -0
  103. package/fesm2022/vadem-ui-sidebar.mjs +493 -0
  104. package/fesm2022/vadem-ui-sidebar.mjs.map +1 -0
  105. package/fesm2022/vadem-ui-skeleton.mjs +106 -0
  106. package/fesm2022/vadem-ui-skeleton.mjs.map +1 -0
  107. package/fesm2022/vadem-ui-slider.mjs +60 -0
  108. package/fesm2022/vadem-ui-slider.mjs.map +1 -0
  109. package/fesm2022/vadem-ui-splitter.mjs +438 -0
  110. package/fesm2022/vadem-ui-splitter.mjs.map +1 -0
  111. package/fesm2022/vadem-ui-stat.mjs +369 -0
  112. package/fesm2022/vadem-ui-stat.mjs.map +1 -0
  113. package/fesm2022/vadem-ui-stepper.mjs +483 -0
  114. package/fesm2022/vadem-ui-stepper.mjs.map +1 -0
  115. package/fesm2022/vadem-ui-switch.mjs +45 -0
  116. package/fesm2022/vadem-ui-switch.mjs.map +1 -0
  117. package/fesm2022/vadem-ui-table.mjs +593 -0
  118. package/fesm2022/vadem-ui-table.mjs.map +1 -0
  119. package/fesm2022/vadem-ui-tabs.mjs +405 -0
  120. package/fesm2022/vadem-ui-tabs.mjs.map +1 -0
  121. package/fesm2022/vadem-ui-tag-input.mjs +685 -0
  122. package/fesm2022/vadem-ui-tag-input.mjs.map +1 -0
  123. package/fesm2022/vadem-ui-text-highlight.mjs +126 -0
  124. package/fesm2022/vadem-ui-text-highlight.mjs.map +1 -0
  125. package/fesm2022/vadem-ui-time-input.mjs +430 -0
  126. package/fesm2022/vadem-ui-time-input.mjs.map +1 -0
  127. package/fesm2022/vadem-ui-timeline.mjs +313 -0
  128. package/fesm2022/vadem-ui-timeline.mjs.map +1 -0
  129. package/fesm2022/vadem-ui-toast.mjs +397 -0
  130. package/fesm2022/vadem-ui-toast.mjs.map +1 -0
  131. package/fesm2022/vadem-ui-toolbar.mjs +396 -0
  132. package/fesm2022/vadem-ui-toolbar.mjs.map +1 -0
  133. package/fesm2022/vadem-ui-tooltip.mjs +218 -0
  134. package/fesm2022/vadem-ui-tooltip.mjs.map +1 -0
  135. package/fesm2022/vadem-ui-tree.mjs +551 -0
  136. package/fesm2022/vadem-ui-tree.mjs.map +1 -0
  137. package/fesm2022/vadem-ui-upload-list.mjs +408 -0
  138. package/fesm2022/vadem-ui-upload-list.mjs.map +1 -0
  139. package/fesm2022/vadem-ui.mjs +4 -0
  140. package/fesm2022/vadem-ui.mjs.map +1 -0
  141. package/fonts/jetbrains-mono/OFL.txt +93 -0
  142. package/fonts/jetbrains-mono/jetbrains-mono-cyrillic.woff2 +0 -0
  143. package/fonts/jetbrains-mono/jetbrains-mono-latin.woff2 +0 -0
  144. package/fonts/manrope/OFL.txt +93 -0
  145. package/fonts/manrope/manrope-cyrillic.woff2 +0 -0
  146. package/fonts/manrope/manrope-latin.woff2 +0 -0
  147. package/package.json +306 -3
  148. package/styles/base.css +160 -0
  149. package/styles/components/accordion.css +130 -0
  150. package/styles/components/active-filters.css +42 -0
  151. package/styles/components/alert-dialog.css +34 -0
  152. package/styles/components/alert.css +159 -0
  153. package/styles/components/autocomplete.css +97 -0
  154. package/styles/components/avatar.css +90 -0
  155. package/styles/components/badge.css +91 -0
  156. package/styles/components/breadcrumbs.css +94 -0
  157. package/styles/components/button.css +174 -0
  158. package/styles/components/calendar.css +186 -0
  159. package/styles/components/card.css +206 -0
  160. package/styles/components/character-count.css +41 -0
  161. package/styles/components/chart.css +308 -0
  162. package/styles/components/checkbox.css +115 -0
  163. package/styles/components/color-picker.css +158 -0
  164. package/styles/components/command.css +175 -0
  165. package/styles/components/copy-button.css +58 -0
  166. package/styles/components/date-range-picker.css +153 -0
  167. package/styles/components/description-list.css +69 -0
  168. package/styles/components/dialog.css +334 -0
  169. package/styles/components/dropzone.css +89 -0
  170. package/styles/components/editable-text.css +58 -0
  171. package/styles/components/empty-state.css +72 -0
  172. package/styles/components/expandable-text.css +24 -0
  173. package/styles/components/field.css +148 -0
  174. package/styles/components/file-preview.css +65 -0
  175. package/styles/components/form-error-summary.css +71 -0
  176. package/styles/components/icon.css +38 -0
  177. package/styles/components/index.css +80 -0
  178. package/styles/components/input.css +171 -0
  179. package/styles/components/kbd.css +42 -0
  180. package/styles/components/menu.css +168 -0
  181. package/styles/components/multi-select.css +156 -0
  182. package/styles/components/navigation-list.css +147 -0
  183. package/styles/components/number-input.css +33 -0
  184. package/styles/components/otp-input.css +26 -0
  185. package/styles/components/pagination.css +127 -0
  186. package/styles/components/password-input.css +20 -0
  187. package/styles/components/popover.css +93 -0
  188. package/styles/components/progress-ring.css +112 -0
  189. package/styles/components/progress.css +162 -0
  190. package/styles/components/radio.css +117 -0
  191. package/styles/components/range-slider.css +158 -0
  192. package/styles/components/rating.css +100 -0
  193. package/styles/components/reorder-list.css +143 -0
  194. package/styles/components/scroll-area.css +39 -0
  195. package/styles/components/search-input.css +25 -0
  196. package/styles/components/segmented.css +136 -0
  197. package/styles/components/select.css +257 -0
  198. package/styles/components/sidebar.css +105 -0
  199. package/styles/components/skeleton.css +83 -0
  200. package/styles/components/slider.css +132 -0
  201. package/styles/components/splitter.css +83 -0
  202. package/styles/components/stat.css +62 -0
  203. package/styles/components/stepper.css +236 -0
  204. package/styles/components/switch.css +107 -0
  205. package/styles/components/table.css +195 -0
  206. package/styles/components/tabs.css +198 -0
  207. package/styles/components/tag-input.css +138 -0
  208. package/styles/components/text-highlight.css +22 -0
  209. package/styles/components/time-input.css +96 -0
  210. package/styles/components/timeline.css +182 -0
  211. package/styles/components/toast.css +146 -0
  212. package/styles/components/toolbar.css +72 -0
  213. package/styles/components/tooltip.css +93 -0
  214. package/styles/components/tree.css +88 -0
  215. package/styles/components/upload-list.css +113 -0
  216. package/styles/fonts.css +67 -0
  217. package/styles/index.css +14 -0
  218. package/styles/reset.css +57 -0
  219. package/styles/tokens/primitives.css +364 -0
  220. package/styles/tokens/semantic.css +233 -0
  221. package/types/vadem-ui-accordion.d.ts +43 -0
  222. package/types/vadem-ui-active-filters.d.ts +73 -0
  223. package/types/vadem-ui-alert-dialog.d.ts +87 -0
  224. package/types/vadem-ui-alert.d.ts +64 -0
  225. package/types/vadem-ui-autocomplete.d.ts +156 -0
  226. package/types/vadem-ui-avatar.d.ts +59 -0
  227. package/types/vadem-ui-badge.d.ts +25 -0
  228. package/types/vadem-ui-breadcrumbs.d.ts +22 -0
  229. package/types/vadem-ui-button.d.ts +52 -0
  230. package/types/vadem-ui-calendar.d.ts +327 -0
  231. package/types/vadem-ui-card.d.ts +58 -0
  232. package/types/vadem-ui-character-count.d.ts +71 -0
  233. package/types/vadem-ui-chart.d.ts +452 -0
  234. package/types/vadem-ui-checkbox.d.ts +20 -0
  235. package/types/vadem-ui-color-picker.d.ts +171 -0
  236. package/types/vadem-ui-command.d.ts +145 -0
  237. package/types/vadem-ui-copy-button.d.ts +90 -0
  238. package/types/vadem-ui-date-range-picker.d.ts +216 -0
  239. package/types/vadem-ui-description-list.d.ts +15 -0
  240. package/types/vadem-ui-dialog.d.ts +174 -0
  241. package/types/vadem-ui-dropzone.d.ts +73 -0
  242. package/types/vadem-ui-editable-text.d.ts +141 -0
  243. package/types/vadem-ui-empty-state.d.ts +34 -0
  244. package/types/vadem-ui-expandable-text.d.ts +52 -0
  245. package/types/vadem-ui-field.d.ts +180 -0
  246. package/types/vadem-ui-file-preview.d.ts +108 -0
  247. package/types/vadem-ui-file-size.d.ts +18 -0
  248. package/types/vadem-ui-form-error-summary.d.ts +46 -0
  249. package/types/vadem-ui-icon.d.ts +152 -0
  250. package/types/vadem-ui-input.d.ts +31 -0
  251. package/types/vadem-ui-kbd.d.ts +66 -0
  252. package/types/vadem-ui-keyboard.d.ts +61 -0
  253. package/types/vadem-ui-locale.d.ts +241 -0
  254. package/types/vadem-ui-menu.d.ts +132 -0
  255. package/types/vadem-ui-navigation-list.d.ts +28 -0
  256. package/types/vadem-ui-number-input.d.ts +39 -0
  257. package/types/vadem-ui-otp-input.d.ts +15 -0
  258. package/types/vadem-ui-pagination.d.ts +96 -0
  259. package/types/vadem-ui-password-input.d.ts +36 -0
  260. package/types/vadem-ui-popover.d.ts +48 -0
  261. package/types/vadem-ui-progress.d.ts +95 -0
  262. package/types/vadem-ui-radio.d.ts +11 -0
  263. package/types/vadem-ui-range-slider.d.ts +136 -0
  264. package/types/vadem-ui-rating.d.ts +95 -0
  265. package/types/vadem-ui-relative-time.d.ts +58 -0
  266. package/types/vadem-ui-reorder-list.d.ts +120 -0
  267. package/types/vadem-ui-scroll-area.d.ts +13 -0
  268. package/types/vadem-ui-search-input.d.ts +58 -0
  269. package/types/vadem-ui-segmented.d.ts +76 -0
  270. package/types/vadem-ui-select.d.ts +303 -0
  271. package/types/vadem-ui-sidebar.d.ts +70 -0
  272. package/types/vadem-ui-skeleton.d.ts +28 -0
  273. package/types/vadem-ui-slider.d.ts +17 -0
  274. package/types/vadem-ui-splitter.d.ts +99 -0
  275. package/types/vadem-ui-stat.d.ts +101 -0
  276. package/types/vadem-ui-stepper.d.ts +108 -0
  277. package/types/vadem-ui-switch.d.ts +10 -0
  278. package/types/vadem-ui-table.d.ts +172 -0
  279. package/types/vadem-ui-tabs.d.ts +101 -0
  280. package/types/vadem-ui-tag-input.d.ts +170 -0
  281. package/types/vadem-ui-text-highlight.d.ts +27 -0
  282. package/types/vadem-ui-time-input.d.ts +47 -0
  283. package/types/vadem-ui-timeline.d.ts +54 -0
  284. package/types/vadem-ui-toast.d.ts +104 -0
  285. package/types/vadem-ui-toolbar.d.ts +80 -0
  286. package/types/vadem-ui-tooltip.d.ts +71 -0
  287. package/types/vadem-ui-tree.d.ts +123 -0
  288. package/types/vadem-ui-upload-list.d.ts +70 -0
  289. package/types/vadem-ui.d.ts +1 -0
@@ -0,0 +1,1462 @@
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, InjectionToken, Injector, ViewEncapsulation, afterNextRender, afterRenderEffect, booleanAttribute, computed, forwardRef, inject, input, model, signal, viewChild } from "@angular/core";
3
+ import { NG_VALUE_ACCESSOR, NgControl } from "@angular/forms";
4
+ import { VdIcon } from "@vadem/ui/icon";
5
+ import { VdTypeahead, vdListTarget, vdMatchesQuery } from "@vadem/ui/keyboard";
6
+ import { VD_FIELD, vdNgControlState, vdUniqueId } from "@vadem/ui/field";
7
+ import { vdTexts } from "@vadem/ui/locale";
8
+ const NO_NG_STATE = {
9
+ invalid: false,
10
+ touched: false,
11
+ disabled: false,
12
+ required: false
13
+ };
14
+ var VdListboxBase = class VdListboxBase {
15
+ placeholder = input("", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
16
+ size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
17
+ disabled = input(false, {
18
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
19
+ transform: booleanAttribute
20
+ });
21
+ invalid = input(false, {
22
+ ...ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {},
23
+ transform: booleanAttribute
24
+ });
25
+ touched = input(void 0, ...ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []);
26
+ required = input(false, {
27
+ ...ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {},
28
+ transform: booleanAttribute
29
+ });
30
+ emptyText = input(...ngDevMode ? [void 0, { debugName: "emptyText" }] : /* istanbul ignore next */ []);
31
+ t = vdTexts("select", { emptyText: this.emptyText });
32
+ ariaLabel = input(void 0, {
33
+ ...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
34
+ alias: "aria-label"
35
+ });
36
+ ariaLabelledby = input(void 0, {
37
+ ...ngDevMode ? { debugName: "ariaLabelledby" } : /* istanbul ignore next */ {},
38
+ alias: "aria-labelledby"
39
+ });
40
+ listboxId = vdUniqueId("vd-listbox");
41
+ controlId = vdUniqueId("vd-combobox");
42
+ field = inject(VD_FIELD, { optional: true });
43
+ hostEl = inject(ElementRef).nativeElement;
44
+ injector = inject(Injector);
45
+ destroyRef = inject(DestroyRef);
46
+ options = signal([], ...ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []);
47
+ open = signal(false, ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
48
+ activeId = signal(null, ...ngDevMode ? [{ debugName: "activeId" }] : /* istanbul ignore next */ []);
49
+ formDisabled = signal(false, ...ngDevMode ? [{ debugName: "formDisabled" }] : /* istanbul ignore next */ []);
50
+ ngSource = signal(null, ...ngDevMode ? [{ debugName: "ngSource" }] : /* istanbul ignore next */ []);
51
+ typeahead = new VdTypeahead();
52
+ ordered = computed(() => [...this.options()].sort((a, b) => a.el.compareDocumentPosition(b.el) & a.el.DOCUMENT_POSITION_FOLLOWING ? -1 : 1), ...ngDevMode ? [{ debugName: "ordered" }] : /* istanbul ignore next */ []);
53
+ visibleOptions = computed(() => this.ordered().filter((o) => this.isVisible(o)), ...ngDevMode ? [{ debugName: "visibleOptions" }] : /* istanbul ignore next */ []);
54
+ selectedOption = computed(() => this.ordered().find((o) => this.isSelected(o)), ...ngDevMode ? [{ debugName: "selectedOption" }] : /* istanbul ignore next */ []);
55
+ selectedLabel = computed(() => this.selectedOption()?.textLabel() ?? "", ...ngDevMode ? [{ debugName: "selectedLabel" }] : /* istanbul ignore next */ []);
56
+ isDisabled = computed(() => this.disabled() || this.formDisabled(), ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
57
+ ngState = computed(() => this.ngSource()?.() ?? NO_NG_STATE, ...ngDevMode ? [{ debugName: "ngState" }] : /* istanbul ignore next */ []);
58
+ showInvalid = computed(() => {
59
+ if (this.invalid() && this.touched() !== false) return true;
60
+ const ng = this.ngState();
61
+ return ng.invalid && ng.touched;
62
+ }, ...ngDevMode ? [{ debugName: "showInvalid" }] : /* istanbul ignore next */ []);
63
+ isRequired = computed(() => this.required() || this.ngState().required, ...ngDevMode ? [{ debugName: "isRequired" }] : /* istanbul ignore next */ []);
64
+ describedBy = computed(() => this.field?.describedBy() ?? null, ...ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []);
65
+ onChange = () => void 0;
66
+ onTouched = () => void 0;
67
+ constructor() {
68
+ const fieldControl = {
69
+ id: signal(this.controlId),
70
+ invalid: this.showInvalid,
71
+ required: this.isRequired,
72
+ disabled: this.isDisabled
73
+ };
74
+ this.field?.register(fieldControl);
75
+ this.destroyRef.onDestroy(() => this.field?.unregister(fieldControl));
76
+ afterNextRender(() => {
77
+ const list = this.listEl();
78
+ const anchor = this.anchorEl();
79
+ if (!list || !anchor) return;
80
+ const name = `--${this.listboxId}`;
81
+ anchor.style.setProperty("anchor-name", name);
82
+ list.style.setProperty("position-anchor", name);
83
+ const onToggle = (e) => {
84
+ if (e.newState === "closed") this.afterClose();
85
+ };
86
+ list.addEventListener("toggle", onToggle);
87
+ this.destroyRef.onDestroy(() => list.removeEventListener("toggle", onToggle));
88
+ });
89
+ afterRenderEffect(() => {
90
+ const id = this.activeId();
91
+ if (!this.open() || !id) return;
92
+ this.ordered().find((o) => o.id === id)?.el.scrollIntoView({ block: "nearest" });
93
+ });
94
+ }
95
+ ngOnInit() {
96
+ const ngControl = this.injector.get(NgControl, null, {
97
+ self: true,
98
+ optional: true
99
+ });
100
+ this.ngSource.set(vdNgControlState(ngControl, this.destroyRef));
101
+ }
102
+ isActive(option) {
103
+ return option.id === this.activeId();
104
+ }
105
+ isVisible(_option) {
106
+ return true;
107
+ }
108
+ hover(option) {
109
+ if (!option.disabled()) this.activeId.set(option.id);
110
+ }
111
+ register(option) {
112
+ this.options.update((list) => [...list, option]);
113
+ return () => this.options.update((list) => list.filter((o) => o !== option));
114
+ }
115
+ registerOnChange(fn) {
116
+ this.onChange = fn;
117
+ }
118
+ registerOnTouched(fn) {
119
+ this.onTouched = fn;
120
+ }
121
+ setDisabledState(disabled) {
122
+ this.formDisabled.set(disabled);
123
+ }
124
+ onChosen(_option) {}
125
+ onClosed() {}
126
+ setValue(value) {
127
+ if (value === this.value()) return;
128
+ this.value.set(value);
129
+ this.onChange(value);
130
+ }
131
+ markTouched() {
132
+ this.onTouched();
133
+ }
134
+ openList(start = "selected") {
135
+ if (this.isDisabled() || this.open()) return;
136
+ const list = this.listEl();
137
+ if (!list) return;
138
+ this.open.set(true);
139
+ list.showPopover({ source: this.anchorEl() });
140
+ this.activate(start);
141
+ }
142
+ closeList() {
143
+ const list = this.listEl();
144
+ if (list?.matches(":popover-open")) list.hidePopover();
145
+ else this.afterClose();
146
+ }
147
+ activate(start) {
148
+ const enabled = this.visibleOptions().filter((o) => !o.disabled());
149
+ const pick = start === "selected" ? enabled.find((o) => this.isSelected(o)) ?? enabled[0] : start === "first" ? enabled[0] : enabled[enabled.length - 1];
150
+ this.activeId.set(pick?.id ?? null);
151
+ }
152
+ navigate(event) {
153
+ const visible = this.visibleOptions();
154
+ const current = visible.findIndex((o) => o.id === this.activeId());
155
+ const target = vdListTarget(event.key, current, visible.map((o) => o.disabled()), {
156
+ loop: false,
157
+ pageSize: 10
158
+ });
159
+ if (target === null) return false;
160
+ event.preventDefault();
161
+ this.activeId.set(visible[target]?.id ?? null);
162
+ return true;
163
+ }
164
+ typeaheadMatch(event) {
165
+ if (!VdTypeahead.accepts(event)) return void 0;
166
+ const visible = this.visibleOptions();
167
+ const current = visible.findIndex((o) => o.id === (this.activeId() ?? this.selectedOption()?.id));
168
+ const idx = this.typeahead.match(event.key, visible.map((o) => o.textLabel()), visible.map((o) => o.disabled()), current);
169
+ return idx === null ? void 0 : visible[idx];
170
+ }
171
+ activeOption() {
172
+ return this.visibleOptions().find((o) => o.id === this.activeId());
173
+ }
174
+ afterClose() {
175
+ if (!this.open()) return;
176
+ this.open.set(false);
177
+ this.activeId.set(null);
178
+ this.typeahead.reset();
179
+ this.onClosed();
180
+ }
181
+ static ɵfac = i0.ɵɵngDeclareFactory({
182
+ minVersion: "12.0.0",
183
+ version: "22.2.1",
184
+ ngImport: i0,
185
+ type: VdListboxBase,
186
+ deps: [],
187
+ target: i0.ɵɵFactoryTarget.Directive
188
+ });
189
+ static ɵdir = i0.ɵɵngDeclareDirective({
190
+ minVersion: "17.1.0",
191
+ version: "22.2.1",
192
+ type: VdListboxBase,
193
+ isStandalone: true,
194
+ inputs: {
195
+ placeholder: {
196
+ classPropertyName: "placeholder",
197
+ publicName: "placeholder",
198
+ isSignal: true,
199
+ isRequired: false,
200
+ transformFunction: null
201
+ },
202
+ size: {
203
+ classPropertyName: "size",
204
+ publicName: "size",
205
+ isSignal: true,
206
+ isRequired: false,
207
+ transformFunction: null
208
+ },
209
+ disabled: {
210
+ classPropertyName: "disabled",
211
+ publicName: "disabled",
212
+ isSignal: true,
213
+ isRequired: false,
214
+ transformFunction: null
215
+ },
216
+ invalid: {
217
+ classPropertyName: "invalid",
218
+ publicName: "invalid",
219
+ isSignal: true,
220
+ isRequired: false,
221
+ transformFunction: null
222
+ },
223
+ touched: {
224
+ classPropertyName: "touched",
225
+ publicName: "touched",
226
+ isSignal: true,
227
+ isRequired: false,
228
+ transformFunction: null
229
+ },
230
+ required: {
231
+ classPropertyName: "required",
232
+ publicName: "required",
233
+ isSignal: true,
234
+ isRequired: false,
235
+ transformFunction: null
236
+ },
237
+ emptyText: {
238
+ classPropertyName: "emptyText",
239
+ publicName: "emptyText",
240
+ isSignal: true,
241
+ isRequired: false,
242
+ transformFunction: null
243
+ },
244
+ ariaLabel: {
245
+ classPropertyName: "ariaLabel",
246
+ publicName: "aria-label",
247
+ isSignal: true,
248
+ isRequired: false,
249
+ transformFunction: null
250
+ },
251
+ ariaLabelledby: {
252
+ classPropertyName: "ariaLabelledby",
253
+ publicName: "aria-labelledby",
254
+ isSignal: true,
255
+ isRequired: false,
256
+ transformFunction: null
257
+ }
258
+ },
259
+ ngImport: i0
260
+ });
261
+ };
262
+ i0.ɵɵngDeclareClassMetadata({
263
+ minVersion: "12.0.0",
264
+ version: "22.2.1",
265
+ ngImport: i0,
266
+ type: VdListboxBase,
267
+ decorators: [{ type: Directive }],
268
+ ctorParameters: () => [],
269
+ propDecorators: {
270
+ placeholder: [{
271
+ type: i0.Input,
272
+ args: [{
273
+ isSignal: true,
274
+ alias: "placeholder",
275
+ required: false
276
+ }]
277
+ }],
278
+ size: [{
279
+ type: i0.Input,
280
+ args: [{
281
+ isSignal: true,
282
+ alias: "size",
283
+ required: false
284
+ }]
285
+ }],
286
+ disabled: [{
287
+ type: i0.Input,
288
+ args: [{
289
+ isSignal: true,
290
+ alias: "disabled",
291
+ required: false
292
+ }]
293
+ }],
294
+ invalid: [{
295
+ type: i0.Input,
296
+ args: [{
297
+ isSignal: true,
298
+ alias: "invalid",
299
+ required: false
300
+ }]
301
+ }],
302
+ touched: [{
303
+ type: i0.Input,
304
+ args: [{
305
+ isSignal: true,
306
+ alias: "touched",
307
+ required: false
308
+ }]
309
+ }],
310
+ required: [{
311
+ type: i0.Input,
312
+ args: [{
313
+ isSignal: true,
314
+ alias: "required",
315
+ required: false
316
+ }]
317
+ }],
318
+ emptyText: [{
319
+ type: i0.Input,
320
+ args: [{
321
+ isSignal: true,
322
+ alias: "emptyText",
323
+ required: false
324
+ }]
325
+ }],
326
+ ariaLabel: [{
327
+ type: i0.Input,
328
+ args: [{
329
+ isSignal: true,
330
+ alias: "aria-label",
331
+ required: false
332
+ }]
333
+ }],
334
+ ariaLabelledby: [{
335
+ type: i0.Input,
336
+ args: [{
337
+ isSignal: true,
338
+ alias: "aria-labelledby",
339
+ required: false
340
+ }]
341
+ }]
342
+ }
343
+ });
344
+ const VD_LISTBOX = new InjectionToken("VD_LISTBOX");
345
+ var VdCombobox = class VdCombobox extends VdListboxBase {
346
+ value = model(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
347
+ isSelected(option) {
348
+ return option.value() === this.value();
349
+ }
350
+ writeValue(value) {
351
+ this.value.set(value ?? null);
352
+ }
353
+ choose(option) {
354
+ if (option.disabled() || this.isDisabled()) return;
355
+ this.setValue(option.value());
356
+ this.onChosen();
357
+ this.closeList();
358
+ }
359
+ fieldRef = viewChild.required("field", ...ngDevMode ? [{ debugName: "fieldRef" }] : /* istanbul ignore next */ []);
360
+ inputRef = viewChild.required("input", ...ngDevMode ? [{ debugName: "inputRef" }] : /* istanbul ignore next */ []);
361
+ list = viewChild.required("list", ...ngDevMode ? [{ debugName: "list" }] : /* istanbul ignore next */ []);
362
+ query = signal(null, ...ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []);
363
+ inputText = computed(() => this.query() ?? this.selectedLabel(), ...ngDevMode ? [{ debugName: "inputText" }] : /* istanbul ignore next */ []);
364
+ listEl() {
365
+ return this.list()?.nativeElement;
366
+ }
367
+ anchorEl() {
368
+ return this.fieldRef()?.nativeElement;
369
+ }
370
+ focus() {
371
+ this.inputRef().nativeElement.focus();
372
+ }
373
+ isVisible(option) {
374
+ const q = this.query();
375
+ return q === null || vdMatchesQuery(option.textLabel(), q);
376
+ }
377
+ onChosen() {
378
+ this.query.set(null);
379
+ }
380
+ onClosed() {
381
+ this.query.set(null);
382
+ if (this.hostEl.ownerDocument.activeElement !== this.inputRef().nativeElement) this.markTouched();
383
+ }
384
+ wasOpen = false;
385
+ onFieldPointerDown(event) {
386
+ this.wasOpen = this.open();
387
+ const input = this.inputRef().nativeElement;
388
+ if (event.target !== input && !this.isDisabled()) {
389
+ event.preventDefault();
390
+ input.focus();
391
+ }
392
+ }
393
+ onFieldClick(event) {
394
+ if (this.isDisabled()) return;
395
+ const onInput = event.target === this.inputRef().nativeElement;
396
+ if (this.open() && !onInput) this.closeList();
397
+ else if (!this.open() && !(this.wasOpen && !onInput)) this.openList("selected");
398
+ this.wasOpen = false;
399
+ }
400
+ onInput(event) {
401
+ this.query.set(event.target.value);
402
+ if (!this.open()) this.openList("first");
403
+ else this.activate("first");
404
+ }
405
+ onBlur() {
406
+ this.query.set(null);
407
+ if (!this.open()) this.markTouched();
408
+ }
409
+ onKeydown(event) {
410
+ const { key, altKey } = event;
411
+ if (!this.open()) {
412
+ if (key === "ArrowDown" || key === "ArrowUp") {
413
+ event.preventDefault();
414
+ this.openList(key === "ArrowUp" ? "last" : "selected");
415
+ }
416
+ return;
417
+ }
418
+ if (key === "Escape") {
419
+ event.preventDefault();
420
+ this.closeList();
421
+ } else if (key === "Enter" || altKey && key === "ArrowUp") {
422
+ event.preventDefault();
423
+ const active = this.activeOption();
424
+ if (active) this.choose(active);
425
+ else this.closeList();
426
+ } else if (key === "Tab") this.closeList();
427
+ else if (key !== "Home" && key !== "End") this.navigate(event);
428
+ }
429
+ static ɵfac = i0.ɵɵngDeclareFactory({
430
+ minVersion: "12.0.0",
431
+ version: "22.2.1",
432
+ ngImport: i0,
433
+ type: VdCombobox,
434
+ deps: null,
435
+ target: i0.ɵɵFactoryTarget.Component
436
+ });
437
+ static ɵcmp = i0.ɵɵngDeclareComponent({
438
+ minVersion: "17.0.0",
439
+ version: "22.2.1",
440
+ type: VdCombobox,
441
+ isStandalone: true,
442
+ selector: "vd-combobox",
443
+ inputs: { value: {
444
+ classPropertyName: "value",
445
+ publicName: "value",
446
+ isSignal: true,
447
+ isRequired: false,
448
+ transformFunction: null
449
+ } },
450
+ outputs: { value: "valueChange" },
451
+ host: {
452
+ properties: {
453
+ "attr.data-size": "size()",
454
+ "attr.data-open": "open() ? \"\" : null",
455
+ "attr.data-invalid": "showInvalid() ? \"\" : null",
456
+ "attr.data-disabled": "isDisabled() ? \"\" : null",
457
+ "attr.aria-label": "null",
458
+ "attr.aria-labelledby": "null"
459
+ },
460
+ classAttribute: "vd-combobox"
461
+ },
462
+ providers: [{
463
+ provide: VD_LISTBOX,
464
+ useExisting: forwardRef(() => VdCombobox)
465
+ }, {
466
+ provide: NG_VALUE_ACCESSOR,
467
+ useExisting: forwardRef(() => VdCombobox),
468
+ multi: true
469
+ }],
470
+ viewQueries: [
471
+ {
472
+ propertyName: "fieldRef",
473
+ first: true,
474
+ predicate: ["field"],
475
+ descendants: true,
476
+ isSignal: true
477
+ },
478
+ {
479
+ propertyName: "inputRef",
480
+ first: true,
481
+ predicate: ["input"],
482
+ descendants: true,
483
+ isSignal: true
484
+ },
485
+ {
486
+ propertyName: "list",
487
+ first: true,
488
+ predicate: ["list"],
489
+ descendants: true,
490
+ isSignal: true
491
+ }
492
+ ],
493
+ usesInheritance: true,
494
+ ngImport: i0,
495
+ template: `
496
+ <!-- Pointer convenience only: the input inside handles every key. -->
497
+ <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->
498
+ <div
499
+ #field
500
+ class="vd-combobox__field"
501
+ (pointerdown)="onFieldPointerDown($event)"
502
+ (click)="onFieldClick($event)"
503
+ >
504
+ <vd-icon name="search" class="vd-combobox__icon" />
505
+ <input
506
+ #input
507
+ class="vd-combobox__input"
508
+ role="combobox"
509
+ aria-autocomplete="list"
510
+ autocomplete="off"
511
+ [id]="controlId"
512
+ [value]="inputText()"
513
+ [placeholder]="placeholder()"
514
+ [disabled]="isDisabled()"
515
+ [attr.aria-expanded]="open()"
516
+ [attr.aria-controls]="listboxId"
517
+ [attr.aria-activedescendant]="open() ? activeId() : null"
518
+ [attr.aria-invalid]="showInvalid() || null"
519
+ [attr.aria-required]="isRequired() || null"
520
+ [attr.aria-describedby]="describedBy()"
521
+ [attr.aria-label]="ariaLabel() ?? null"
522
+ [attr.aria-labelledby]="ariaLabelledby() ?? null"
523
+ (input)="onInput($event)"
524
+ (keydown)="onKeydown($event)"
525
+ (blur)="onBlur()"
526
+ />
527
+ <vd-icon name="chevron-down" class="vd-select__chevron" />
528
+ </div>
529
+ <div #list class="vd-listbox" popover="auto" role="listbox" [id]="listboxId" tabindex="-1">
530
+ <ng-content />
531
+ @if (visibleOptions().length === 0) {
532
+ <p class="vd-listbox__empty">{{ t().emptyText }}</p>
533
+ }
534
+ </div>
535
+ `,
536
+ isInline: true,
537
+ dependencies: [{
538
+ kind: "component",
539
+ type: VdIcon,
540
+ selector: "vd-icon",
541
+ inputs: ["name", "label"]
542
+ }],
543
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
544
+ encapsulation: i0.ViewEncapsulation.None
545
+ });
546
+ };
547
+ i0.ɵɵngDeclareClassMetadata({
548
+ minVersion: "12.0.0",
549
+ version: "22.2.1",
550
+ ngImport: i0,
551
+ type: VdCombobox,
552
+ decorators: [{
553
+ type: Component,
554
+ args: [{
555
+ selector: "vd-combobox",
556
+ imports: [VdIcon],
557
+ template: `
558
+ <!-- Pointer convenience only: the input inside handles every key. -->
559
+ <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->
560
+ <div
561
+ #field
562
+ class="vd-combobox__field"
563
+ (pointerdown)="onFieldPointerDown($event)"
564
+ (click)="onFieldClick($event)"
565
+ >
566
+ <vd-icon name="search" class="vd-combobox__icon" />
567
+ <input
568
+ #input
569
+ class="vd-combobox__input"
570
+ role="combobox"
571
+ aria-autocomplete="list"
572
+ autocomplete="off"
573
+ [id]="controlId"
574
+ [value]="inputText()"
575
+ [placeholder]="placeholder()"
576
+ [disabled]="isDisabled()"
577
+ [attr.aria-expanded]="open()"
578
+ [attr.aria-controls]="listboxId"
579
+ [attr.aria-activedescendant]="open() ? activeId() : null"
580
+ [attr.aria-invalid]="showInvalid() || null"
581
+ [attr.aria-required]="isRequired() || null"
582
+ [attr.aria-describedby]="describedBy()"
583
+ [attr.aria-label]="ariaLabel() ?? null"
584
+ [attr.aria-labelledby]="ariaLabelledby() ?? null"
585
+ (input)="onInput($event)"
586
+ (keydown)="onKeydown($event)"
587
+ (blur)="onBlur()"
588
+ />
589
+ <vd-icon name="chevron-down" class="vd-select__chevron" />
590
+ </div>
591
+ <div #list class="vd-listbox" popover="auto" role="listbox" [id]="listboxId" tabindex="-1">
592
+ <ng-content />
593
+ @if (visibleOptions().length === 0) {
594
+ <p class="vd-listbox__empty">{{ t().emptyText }}</p>
595
+ }
596
+ </div>
597
+ `,
598
+ host: {
599
+ class: "vd-combobox",
600
+ "[attr.data-size]": "size()",
601
+ "[attr.data-open]": "open() ? \"\" : null",
602
+ "[attr.data-invalid]": "showInvalid() ? \"\" : null",
603
+ "[attr.data-disabled]": "isDisabled() ? \"\" : null",
604
+ "[attr.aria-label]": "null",
605
+ "[attr.aria-labelledby]": "null"
606
+ },
607
+ providers: [{
608
+ provide: VD_LISTBOX,
609
+ useExisting: forwardRef(() => VdCombobox)
610
+ }, {
611
+ provide: NG_VALUE_ACCESSOR,
612
+ useExisting: forwardRef(() => VdCombobox),
613
+ multi: true
614
+ }],
615
+ changeDetection: ChangeDetectionStrategy.OnPush,
616
+ encapsulation: ViewEncapsulation.None
617
+ }]
618
+ }],
619
+ propDecorators: {
620
+ value: [{
621
+ type: i0.Input,
622
+ args: [{
623
+ isSignal: true,
624
+ alias: "value",
625
+ required: false
626
+ }]
627
+ }, {
628
+ type: i0.Output,
629
+ args: ["valueChange"]
630
+ }],
631
+ fieldRef: [{
632
+ type: i0.ViewChild,
633
+ args: ["field", { isSignal: true }]
634
+ }],
635
+ inputRef: [{
636
+ type: i0.ViewChild,
637
+ args: ["input", { isSignal: true }]
638
+ }],
639
+ list: [{
640
+ type: i0.ViewChild,
641
+ args: ["list", { isSignal: true }]
642
+ }]
643
+ }
644
+ });
645
+ function vdUniqueSelection(values) {
646
+ return [...new Set(values ?? [])];
647
+ }
648
+ function vdToggleSelection(values, value) {
649
+ return values.includes(value) ? values.filter((item) => item !== value) : [.../* @__PURE__ */ new Set([...values, value])];
650
+ }
651
+ var VdMultiSelect = class VdMultiSelect extends VdListboxBase {
652
+ value = model([], ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
653
+ removeLabel = input(...ngDevMode ? [void 0, { debugName: "removeLabel" }] : /* istanbul ignore next */ []);
654
+ selectionLabel = input(...ngDevMode ? [void 0, { debugName: "selectionLabel" }] : /* istanbul ignore next */ []);
655
+ multiTexts = vdTexts("multiSelect", {
656
+ removeLabel: this.removeLabel,
657
+ selectionLabel: this.selectionLabel
658
+ });
659
+ fieldRef = viewChild.required("field", ...ngDevMode ? [{ debugName: "fieldRef" }] : /* istanbul ignore next */ []);
660
+ inputRef = viewChild.required("input", ...ngDevMode ? [{ debugName: "inputRef" }] : /* istanbul ignore next */ []);
661
+ list = viewChild.required("list", ...ngDevMode ? [{ debugName: "list" }] : /* istanbul ignore next */ []);
662
+ query = signal("", ...ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []);
663
+ summaryId = vdUniqueId("vd-selection");
664
+ descriptionIds = computed(() => [this.describedBy(), this.summaryId].filter(Boolean).join(" "), ...ngDevMode ? [{ debugName: "descriptionIds" }] : /* istanbul ignore next */ []);
665
+ selectedItems = computed(() => vdUniqueSelection(this.value()).map((value) => {
666
+ const option = this.ordered().find((item) => item.value() === value);
667
+ return {
668
+ value,
669
+ label: option?.textLabel() || value,
670
+ disabled: option?.disabled() ?? false
671
+ };
672
+ }), ...ngDevMode ? [{ debugName: "selectedItems" }] : /* istanbul ignore next */ []);
673
+ constructor() {
674
+ super();
675
+ afterRenderEffect(() => {
676
+ if (this.isDisabled()) this.closeList();
677
+ else if (this.open()) {
678
+ const active = this.activeOption();
679
+ if (!active || active.disabled()) this.activate("first");
680
+ }
681
+ });
682
+ }
683
+ listEl() {
684
+ return this.list()?.nativeElement;
685
+ }
686
+ anchorEl() {
687
+ return this.fieldRef()?.nativeElement;
688
+ }
689
+ focus() {
690
+ this.inputRef().nativeElement.focus();
691
+ }
692
+ isSelected(option) {
693
+ return this.value().includes(option.value());
694
+ }
695
+ isVisible(option) {
696
+ return vdMatchesQuery(option.textLabel(), this.query());
697
+ }
698
+ choose(option) {
699
+ if (this.isDisabled() || option.disabled()) return;
700
+ this.setValue(vdToggleSelection(this.value(), option.value()));
701
+ this.focus();
702
+ }
703
+ writeValue(value) {
704
+ this.value.set(vdUniqueSelection(value));
705
+ }
706
+ remove(value) {
707
+ const item = this.selectedItems().find((item) => item.value === value);
708
+ if (this.isDisabled() || item?.disabled) return;
709
+ this.setValue(this.value().filter((item) => item !== value));
710
+ this.focus();
711
+ }
712
+ onInput(event) {
713
+ this.query.set(event.target.value);
714
+ if (event.isComposing) return;
715
+ this.openList("first");
716
+ this.activate("first");
717
+ }
718
+ onFocusOut(event) {
719
+ const next = event.relatedTarget;
720
+ if (next && this.hostEl.contains(next)) return;
721
+ this.markTouched();
722
+ this.closeList();
723
+ }
724
+ onFieldPointerDown(event) {
725
+ const target = event.target;
726
+ if (this.isDisabled() || target.closest("button") || target === this.inputRef().nativeElement) return;
727
+ event.preventDefault();
728
+ this.focus();
729
+ this.openList();
730
+ }
731
+ onClosed() {
732
+ this.query.set("");
733
+ if (!this.hostEl.contains(this.hostEl.ownerDocument.activeElement)) this.markTouched();
734
+ }
735
+ onKeydown(event) {
736
+ if (event.isComposing || this.isDisabled()) return;
737
+ const { key, altKey } = event;
738
+ if (key === "Backspace" && this.query() === "") {
739
+ const last = this.selectedItems().at(-1);
740
+ if (last && !last.disabled) {
741
+ event.preventDefault();
742
+ this.remove(last.value);
743
+ }
744
+ } else if (!this.open()) {
745
+ if (key === "ArrowDown" || key === "ArrowUp") {
746
+ event.preventDefault();
747
+ this.openList(key === "ArrowUp" ? "last" : "selected");
748
+ }
749
+ } else if (key === "Escape" || altKey && key === "ArrowUp") {
750
+ event.preventDefault();
751
+ event.stopPropagation();
752
+ this.closeList();
753
+ } else if (key === "Enter") {
754
+ event.preventDefault();
755
+ const active = this.activeOption();
756
+ if (active) this.choose(active);
757
+ } else if (key === "Tab") this.closeList();
758
+ else if (key !== "Home" && key !== "End") this.navigate(event);
759
+ }
760
+ static ɵfac = i0.ɵɵngDeclareFactory({
761
+ minVersion: "12.0.0",
762
+ version: "22.2.1",
763
+ ngImport: i0,
764
+ type: VdMultiSelect,
765
+ deps: [],
766
+ target: i0.ɵɵFactoryTarget.Component
767
+ });
768
+ static ɵcmp = i0.ɵɵngDeclareComponent({
769
+ minVersion: "17.0.0",
770
+ version: "22.2.1",
771
+ type: VdMultiSelect,
772
+ isStandalone: true,
773
+ selector: "vd-multi-select",
774
+ inputs: {
775
+ value: {
776
+ classPropertyName: "value",
777
+ publicName: "value",
778
+ isSignal: true,
779
+ isRequired: false,
780
+ transformFunction: null
781
+ },
782
+ removeLabel: {
783
+ classPropertyName: "removeLabel",
784
+ publicName: "removeLabel",
785
+ isSignal: true,
786
+ isRequired: false,
787
+ transformFunction: null
788
+ },
789
+ selectionLabel: {
790
+ classPropertyName: "selectionLabel",
791
+ publicName: "selectionLabel",
792
+ isSignal: true,
793
+ isRequired: false,
794
+ transformFunction: null
795
+ }
796
+ },
797
+ outputs: { value: "valueChange" },
798
+ host: {
799
+ listeners: { "focusout": "onFocusOut($event)" },
800
+ properties: {
801
+ "attr.data-size": "size()",
802
+ "attr.data-open": "open() ? \"\" : null",
803
+ "attr.data-invalid": "showInvalid() ? \"\" : null",
804
+ "attr.data-disabled": "isDisabled() ? \"\" : null",
805
+ "attr.aria-disabled": "isDisabled() || null",
806
+ "attr.aria-label": "null",
807
+ "attr.aria-labelledby": "null"
808
+ },
809
+ classAttribute: "vd-multi-select"
810
+ },
811
+ providers: [{
812
+ provide: VD_LISTBOX,
813
+ useExisting: forwardRef(() => VdMultiSelect)
814
+ }, {
815
+ provide: NG_VALUE_ACCESSOR,
816
+ useExisting: forwardRef(() => VdMultiSelect),
817
+ multi: true
818
+ }],
819
+ viewQueries: [
820
+ {
821
+ propertyName: "fieldRef",
822
+ first: true,
823
+ predicate: ["field"],
824
+ descendants: true,
825
+ isSignal: true
826
+ },
827
+ {
828
+ propertyName: "inputRef",
829
+ first: true,
830
+ predicate: ["input"],
831
+ descendants: true,
832
+ isSignal: true
833
+ },
834
+ {
835
+ propertyName: "list",
836
+ first: true,
837
+ predicate: ["list"],
838
+ descendants: true,
839
+ isSignal: true
840
+ }
841
+ ],
842
+ usesInheritance: true,
843
+ ngImport: i0,
844
+ template: `
845
+ <div #field class="vd-multi-select__field" (pointerdown)="onFieldPointerDown($event)">
846
+ @for (item of selectedItems(); track item.value) {
847
+ <span class="vd-multi-select__chip">
848
+ <span class="vd-multi-select__label" [title]="item.label">{{ item.label }}</span>
849
+ <button
850
+ type="button"
851
+ class="vd-multi-select__remove"
852
+ [disabled]="isDisabled() || item.disabled"
853
+ [attr.aria-label]="multiTexts().removeLabel(item.label)"
854
+ (click)="remove(item.value)"
855
+ >
856
+ <vd-icon name="x" />
857
+ </button>
858
+ </span>
859
+ }
860
+ <input
861
+ #input
862
+ class="vd-multi-select__input"
863
+ role="combobox"
864
+ aria-autocomplete="list"
865
+ aria-haspopup="listbox"
866
+ autocomplete="off"
867
+ [id]="controlId"
868
+ [value]="query()"
869
+ [placeholder]="placeholder()"
870
+ [disabled]="isDisabled()"
871
+ [attr.aria-expanded]="open()"
872
+ [attr.aria-controls]="listboxId"
873
+ [attr.aria-activedescendant]="open() ? activeId() : null"
874
+ [attr.aria-invalid]="showInvalid() || null"
875
+ [attr.aria-required]="isRequired() || null"
876
+ [attr.aria-describedby]="descriptionIds()"
877
+ [attr.aria-label]="ariaLabel() ?? null"
878
+ [attr.aria-labelledby]="ariaLabelledby() ?? null"
879
+ (click)="openList()"
880
+ (input)="onInput($event)"
881
+ (keydown)="onKeydown($event)"
882
+ (compositionend)="onInput($event)"
883
+ />
884
+ <vd-icon name="chevron-down" class="vd-select__chevron" />
885
+ </div>
886
+ <span class="vd-visually-hidden" [id]="summaryId" role="status" aria-atomic="true">
887
+ {{ multiTexts().selectionLabel(selectedItems().length) }}
888
+ </span>
889
+ <div
890
+ #list
891
+ class="vd-listbox vd-multi-select__list"
892
+ popover="auto"
893
+ role="listbox"
894
+ aria-multiselectable="true"
895
+ [id]="listboxId"
896
+ tabindex="-1"
897
+ >
898
+ <ng-content />
899
+ @if (visibleOptions().length === 0) {
900
+ <p class="vd-listbox__empty">{{ t().emptyText }}</p>
901
+ }
902
+ </div>
903
+ `,
904
+ isInline: true,
905
+ dependencies: [{
906
+ kind: "component",
907
+ type: VdIcon,
908
+ selector: "vd-icon",
909
+ inputs: ["name", "label"]
910
+ }],
911
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
912
+ encapsulation: i0.ViewEncapsulation.None
913
+ });
914
+ };
915
+ i0.ɵɵngDeclareClassMetadata({
916
+ minVersion: "12.0.0",
917
+ version: "22.2.1",
918
+ ngImport: i0,
919
+ type: VdMultiSelect,
920
+ decorators: [{
921
+ type: Component,
922
+ args: [{
923
+ selector: "vd-multi-select",
924
+ imports: [VdIcon],
925
+ template: `
926
+ <div #field class="vd-multi-select__field" (pointerdown)="onFieldPointerDown($event)">
927
+ @for (item of selectedItems(); track item.value) {
928
+ <span class="vd-multi-select__chip">
929
+ <span class="vd-multi-select__label" [title]="item.label">{{ item.label }}</span>
930
+ <button
931
+ type="button"
932
+ class="vd-multi-select__remove"
933
+ [disabled]="isDisabled() || item.disabled"
934
+ [attr.aria-label]="multiTexts().removeLabel(item.label)"
935
+ (click)="remove(item.value)"
936
+ >
937
+ <vd-icon name="x" />
938
+ </button>
939
+ </span>
940
+ }
941
+ <input
942
+ #input
943
+ class="vd-multi-select__input"
944
+ role="combobox"
945
+ aria-autocomplete="list"
946
+ aria-haspopup="listbox"
947
+ autocomplete="off"
948
+ [id]="controlId"
949
+ [value]="query()"
950
+ [placeholder]="placeholder()"
951
+ [disabled]="isDisabled()"
952
+ [attr.aria-expanded]="open()"
953
+ [attr.aria-controls]="listboxId"
954
+ [attr.aria-activedescendant]="open() ? activeId() : null"
955
+ [attr.aria-invalid]="showInvalid() || null"
956
+ [attr.aria-required]="isRequired() || null"
957
+ [attr.aria-describedby]="descriptionIds()"
958
+ [attr.aria-label]="ariaLabel() ?? null"
959
+ [attr.aria-labelledby]="ariaLabelledby() ?? null"
960
+ (click)="openList()"
961
+ (input)="onInput($event)"
962
+ (keydown)="onKeydown($event)"
963
+ (compositionend)="onInput($event)"
964
+ />
965
+ <vd-icon name="chevron-down" class="vd-select__chevron" />
966
+ </div>
967
+ <span class="vd-visually-hidden" [id]="summaryId" role="status" aria-atomic="true">
968
+ {{ multiTexts().selectionLabel(selectedItems().length) }}
969
+ </span>
970
+ <div
971
+ #list
972
+ class="vd-listbox vd-multi-select__list"
973
+ popover="auto"
974
+ role="listbox"
975
+ aria-multiselectable="true"
976
+ [id]="listboxId"
977
+ tabindex="-1"
978
+ >
979
+ <ng-content />
980
+ @if (visibleOptions().length === 0) {
981
+ <p class="vd-listbox__empty">{{ t().emptyText }}</p>
982
+ }
983
+ </div>
984
+ `,
985
+ host: {
986
+ class: "vd-multi-select",
987
+ "[attr.data-size]": "size()",
988
+ "[attr.data-open]": "open() ? \"\" : null",
989
+ "[attr.data-invalid]": "showInvalid() ? \"\" : null",
990
+ "[attr.data-disabled]": "isDisabled() ? \"\" : null",
991
+ "[attr.aria-disabled]": "isDisabled() || null",
992
+ "[attr.aria-label]": "null",
993
+ "[attr.aria-labelledby]": "null",
994
+ "(focusout)": "onFocusOut($event)"
995
+ },
996
+ providers: [{
997
+ provide: VD_LISTBOX,
998
+ useExisting: forwardRef(() => VdMultiSelect)
999
+ }, {
1000
+ provide: NG_VALUE_ACCESSOR,
1001
+ useExisting: forwardRef(() => VdMultiSelect),
1002
+ multi: true
1003
+ }],
1004
+ changeDetection: ChangeDetectionStrategy.OnPush,
1005
+ encapsulation: ViewEncapsulation.None
1006
+ }]
1007
+ }],
1008
+ ctorParameters: () => [],
1009
+ propDecorators: {
1010
+ value: [{
1011
+ type: i0.Input,
1012
+ args: [{
1013
+ isSignal: true,
1014
+ alias: "value",
1015
+ required: false
1016
+ }]
1017
+ }, {
1018
+ type: i0.Output,
1019
+ args: ["valueChange"]
1020
+ }],
1021
+ removeLabel: [{
1022
+ type: i0.Input,
1023
+ args: [{
1024
+ isSignal: true,
1025
+ alias: "removeLabel",
1026
+ required: false
1027
+ }]
1028
+ }],
1029
+ selectionLabel: [{
1030
+ type: i0.Input,
1031
+ args: [{
1032
+ isSignal: true,
1033
+ alias: "selectionLabel",
1034
+ required: false
1035
+ }]
1036
+ }],
1037
+ fieldRef: [{
1038
+ type: i0.ViewChild,
1039
+ args: ["field", { isSignal: true }]
1040
+ }],
1041
+ inputRef: [{
1042
+ type: i0.ViewChild,
1043
+ args: ["input", { isSignal: true }]
1044
+ }],
1045
+ list: [{
1046
+ type: i0.ViewChild,
1047
+ args: ["list", { isSignal: true }]
1048
+ }]
1049
+ }
1050
+ });
1051
+ var VdOption = class VdOption {
1052
+ value = input.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
1053
+ disabled = input(false, {
1054
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
1055
+ transform: booleanAttribute
1056
+ });
1057
+ label = input(...ngDevMode ? [void 0, { debugName: "label" }] : /* istanbul ignore next */ []);
1058
+ host = inject(VD_LISTBOX);
1059
+ el = inject(ElementRef).nativeElement;
1060
+ id = vdUniqueId("vd-option");
1061
+ destroyRef = inject(DestroyRef);
1062
+ selected = computed(() => this.host.isSelected(this), ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
1063
+ active = computed(() => this.host.isActive(this), ...ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []);
1064
+ visible = computed(() => this.host.isVisible(this), ...ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []);
1065
+ textLabel() {
1066
+ return this.label() ?? this.el.querySelector(".vd-option__label")?.textContent?.trim() ?? "";
1067
+ }
1068
+ ngOnInit() {
1069
+ this.destroyRef.onDestroy(this.host.register(this));
1070
+ }
1071
+ static ɵfac = i0.ɵɵngDeclareFactory({
1072
+ minVersion: "12.0.0",
1073
+ version: "22.2.1",
1074
+ ngImport: i0,
1075
+ type: VdOption,
1076
+ deps: [],
1077
+ target: i0.ɵɵFactoryTarget.Component
1078
+ });
1079
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1080
+ minVersion: "17.1.0",
1081
+ version: "22.2.1",
1082
+ type: VdOption,
1083
+ isStandalone: true,
1084
+ selector: "vd-option",
1085
+ inputs: {
1086
+ value: {
1087
+ classPropertyName: "value",
1088
+ publicName: "value",
1089
+ isSignal: true,
1090
+ isRequired: true,
1091
+ transformFunction: null
1092
+ },
1093
+ disabled: {
1094
+ classPropertyName: "disabled",
1095
+ publicName: "disabled",
1096
+ isSignal: true,
1097
+ isRequired: false,
1098
+ transformFunction: null
1099
+ },
1100
+ label: {
1101
+ classPropertyName: "label",
1102
+ publicName: "label",
1103
+ isSignal: true,
1104
+ isRequired: false,
1105
+ transformFunction: null
1106
+ }
1107
+ },
1108
+ host: {
1109
+ attributes: { "role": "option" },
1110
+ listeners: {
1111
+ "click": "host.choose(this)",
1112
+ "pointermove": "host.hover(this)",
1113
+ "mousedown": "$event.preventDefault()"
1114
+ },
1115
+ properties: {
1116
+ "id": "id",
1117
+ "attr.aria-selected": "selected()",
1118
+ "attr.aria-disabled": "disabled() || null",
1119
+ "attr.data-active": "active() ? \"\" : null",
1120
+ "hidden": "!visible()"
1121
+ },
1122
+ classAttribute: "vd-option"
1123
+ },
1124
+ ngImport: i0,
1125
+ template: `
1126
+ <span class="vd-option__label"><ng-content /></span>
1127
+ <vd-icon name="check" class="vd-option__check" />
1128
+ `,
1129
+ isInline: true,
1130
+ dependencies: [{
1131
+ kind: "component",
1132
+ type: VdIcon,
1133
+ selector: "vd-icon",
1134
+ inputs: ["name", "label"]
1135
+ }],
1136
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
1137
+ encapsulation: i0.ViewEncapsulation.None
1138
+ });
1139
+ };
1140
+ i0.ɵɵngDeclareClassMetadata({
1141
+ minVersion: "12.0.0",
1142
+ version: "22.2.1",
1143
+ ngImport: i0,
1144
+ type: VdOption,
1145
+ decorators: [{
1146
+ type: Component,
1147
+ args: [{
1148
+ selector: "vd-option",
1149
+ imports: [VdIcon],
1150
+ template: `
1151
+ <span class="vd-option__label"><ng-content /></span>
1152
+ <vd-icon name="check" class="vd-option__check" />
1153
+ `,
1154
+ host: {
1155
+ class: "vd-option",
1156
+ role: "option",
1157
+ "[id]": "id",
1158
+ "[attr.aria-selected]": "selected()",
1159
+ "[attr.aria-disabled]": "disabled() || null",
1160
+ "[attr.data-active]": "active() ? \"\" : null",
1161
+ "[hidden]": "!visible()",
1162
+ "(click)": "host.choose(this)",
1163
+ "(pointermove)": "host.hover(this)",
1164
+ "(mousedown)": "$event.preventDefault()"
1165
+ },
1166
+ changeDetection: ChangeDetectionStrategy.OnPush,
1167
+ encapsulation: ViewEncapsulation.None
1168
+ }]
1169
+ }],
1170
+ propDecorators: {
1171
+ value: [{
1172
+ type: i0.Input,
1173
+ args: [{
1174
+ isSignal: true,
1175
+ alias: "value",
1176
+ required: true
1177
+ }]
1178
+ }],
1179
+ disabled: [{
1180
+ type: i0.Input,
1181
+ args: [{
1182
+ isSignal: true,
1183
+ alias: "disabled",
1184
+ required: false
1185
+ }]
1186
+ }],
1187
+ label: [{
1188
+ type: i0.Input,
1189
+ args: [{
1190
+ isSignal: true,
1191
+ alias: "label",
1192
+ required: false
1193
+ }]
1194
+ }]
1195
+ }
1196
+ });
1197
+ var VdSelect = class VdSelect extends VdListboxBase {
1198
+ value = model(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
1199
+ isSelected(option) {
1200
+ return option.value() === this.value();
1201
+ }
1202
+ writeValue(value) {
1203
+ this.value.set(value ?? null);
1204
+ }
1205
+ choose(option) {
1206
+ if (option.disabled() || this.isDisabled()) return;
1207
+ this.setValue(option.value());
1208
+ this.onChosen(option);
1209
+ this.closeList();
1210
+ }
1211
+ trigger = viewChild.required("trigger", ...ngDevMode ? [{ debugName: "trigger" }] : /* istanbul ignore next */ []);
1212
+ list = viewChild.required("list", ...ngDevMode ? [{ debugName: "list" }] : /* istanbul ignore next */ []);
1213
+ wasOpen = false;
1214
+ listEl() {
1215
+ return this.list()?.nativeElement;
1216
+ }
1217
+ anchorEl() {
1218
+ return this.trigger()?.nativeElement;
1219
+ }
1220
+ focus() {
1221
+ this.trigger().nativeElement.focus();
1222
+ }
1223
+ onClick() {
1224
+ if (this.wasOpen || this.open()) {
1225
+ this.wasOpen = false;
1226
+ this.closeList();
1227
+ return;
1228
+ }
1229
+ this.openList("selected");
1230
+ }
1231
+ onBlur() {
1232
+ if (!this.open()) this.markTouched();
1233
+ }
1234
+ onClosed() {
1235
+ if (this.hostEl.ownerDocument.activeElement !== this.trigger().nativeElement) this.markTouched();
1236
+ }
1237
+ onKeydown(event) {
1238
+ const { key, altKey } = event;
1239
+ if (!this.open()) {
1240
+ if (key === "ArrowDown" || key === "ArrowUp" || key === "Enter" || key === " ") {
1241
+ event.preventDefault();
1242
+ this.openList("selected");
1243
+ } else if (key === "Home" || key === "End") {
1244
+ event.preventDefault();
1245
+ this.openList(key === "Home" ? "first" : "last");
1246
+ } else {
1247
+ const match = this.typeaheadMatch(event);
1248
+ if (match) {
1249
+ this.openList("selected");
1250
+ this.activeId.set(match.id);
1251
+ }
1252
+ }
1253
+ return;
1254
+ }
1255
+ if (key === "Escape") {
1256
+ event.preventDefault();
1257
+ this.closeList();
1258
+ } else if (key === "Enter" || key === " " || altKey && key === "ArrowUp") {
1259
+ event.preventDefault();
1260
+ const active = this.activeOption();
1261
+ if (active) this.choose(active);
1262
+ else this.closeList();
1263
+ } else if (key === "Tab") {
1264
+ const active = this.activeOption();
1265
+ if (active) this.choose(active);
1266
+ else this.closeList();
1267
+ } else if (!this.navigate(event)) {
1268
+ const match = this.typeaheadMatch(event);
1269
+ if (match) this.activeId.set(match.id);
1270
+ }
1271
+ }
1272
+ static ɵfac = i0.ɵɵngDeclareFactory({
1273
+ minVersion: "12.0.0",
1274
+ version: "22.2.1",
1275
+ ngImport: i0,
1276
+ type: VdSelect,
1277
+ deps: null,
1278
+ target: i0.ɵɵFactoryTarget.Component
1279
+ });
1280
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1281
+ minVersion: "17.0.0",
1282
+ version: "22.2.1",
1283
+ type: VdSelect,
1284
+ isStandalone: true,
1285
+ selector: "vd-select",
1286
+ inputs: { value: {
1287
+ classPropertyName: "value",
1288
+ publicName: "value",
1289
+ isSignal: true,
1290
+ isRequired: false,
1291
+ transformFunction: null
1292
+ } },
1293
+ outputs: { value: "valueChange" },
1294
+ host: {
1295
+ properties: {
1296
+ "attr.data-size": "size()",
1297
+ "attr.data-open": "open() ? \"\" : null",
1298
+ "attr.data-invalid": "showInvalid() ? \"\" : null",
1299
+ "attr.data-disabled": "isDisabled() ? \"\" : null",
1300
+ "attr.aria-label": "null",
1301
+ "attr.aria-labelledby": "null"
1302
+ },
1303
+ classAttribute: "vd-select"
1304
+ },
1305
+ providers: [{
1306
+ provide: VD_LISTBOX,
1307
+ useExisting: forwardRef(() => VdSelect)
1308
+ }, {
1309
+ provide: NG_VALUE_ACCESSOR,
1310
+ useExisting: forwardRef(() => VdSelect),
1311
+ multi: true
1312
+ }],
1313
+ viewQueries: [{
1314
+ propertyName: "trigger",
1315
+ first: true,
1316
+ predicate: ["trigger"],
1317
+ descendants: true,
1318
+ isSignal: true
1319
+ }, {
1320
+ propertyName: "list",
1321
+ first: true,
1322
+ predicate: ["list"],
1323
+ descendants: true,
1324
+ isSignal: true
1325
+ }],
1326
+ usesInheritance: true,
1327
+ ngImport: i0,
1328
+ template: `
1329
+ <button
1330
+ #trigger
1331
+ type="button"
1332
+ class="vd-select__trigger"
1333
+ role="combobox"
1334
+ aria-haspopup="listbox"
1335
+ [id]="controlId"
1336
+ [disabled]="isDisabled()"
1337
+ [attr.aria-expanded]="open()"
1338
+ [attr.aria-controls]="listboxId"
1339
+ [attr.aria-activedescendant]="open() ? activeId() : null"
1340
+ [attr.aria-invalid]="showInvalid() || null"
1341
+ [attr.aria-required]="isRequired() || null"
1342
+ [attr.aria-describedby]="describedBy()"
1343
+ [attr.aria-label]="ariaLabel() ?? null"
1344
+ [attr.aria-labelledby]="ariaLabelledby() ?? null"
1345
+ (pointerdown)="wasOpen = open()"
1346
+ (click)="onClick()"
1347
+ (keydown)="onKeydown($event)"
1348
+ (blur)="onBlur()"
1349
+ >
1350
+ <span class="vd-select__value" [attr.data-placeholder]="selectedLabel() ? null : ''">
1351
+ {{ selectedLabel() || placeholder() }}
1352
+ </span>
1353
+ <vd-icon name="chevron-down" class="vd-select__chevron" />
1354
+ </button>
1355
+ <div #list class="vd-listbox" popover="auto" role="listbox" [id]="listboxId" tabindex="-1">
1356
+ <ng-content />
1357
+ @if (visibleOptions().length === 0) {
1358
+ <p class="vd-listbox__empty">{{ t().emptyText }}</p>
1359
+ }
1360
+ </div>
1361
+ `,
1362
+ isInline: true,
1363
+ dependencies: [{
1364
+ kind: "component",
1365
+ type: VdIcon,
1366
+ selector: "vd-icon",
1367
+ inputs: ["name", "label"]
1368
+ }],
1369
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
1370
+ encapsulation: i0.ViewEncapsulation.None
1371
+ });
1372
+ };
1373
+ i0.ɵɵngDeclareClassMetadata({
1374
+ minVersion: "12.0.0",
1375
+ version: "22.2.1",
1376
+ ngImport: i0,
1377
+ type: VdSelect,
1378
+ decorators: [{
1379
+ type: Component,
1380
+ args: [{
1381
+ selector: "vd-select",
1382
+ imports: [VdIcon],
1383
+ template: `
1384
+ <button
1385
+ #trigger
1386
+ type="button"
1387
+ class="vd-select__trigger"
1388
+ role="combobox"
1389
+ aria-haspopup="listbox"
1390
+ [id]="controlId"
1391
+ [disabled]="isDisabled()"
1392
+ [attr.aria-expanded]="open()"
1393
+ [attr.aria-controls]="listboxId"
1394
+ [attr.aria-activedescendant]="open() ? activeId() : null"
1395
+ [attr.aria-invalid]="showInvalid() || null"
1396
+ [attr.aria-required]="isRequired() || null"
1397
+ [attr.aria-describedby]="describedBy()"
1398
+ [attr.aria-label]="ariaLabel() ?? null"
1399
+ [attr.aria-labelledby]="ariaLabelledby() ?? null"
1400
+ (pointerdown)="wasOpen = open()"
1401
+ (click)="onClick()"
1402
+ (keydown)="onKeydown($event)"
1403
+ (blur)="onBlur()"
1404
+ >
1405
+ <span class="vd-select__value" [attr.data-placeholder]="selectedLabel() ? null : ''">
1406
+ {{ selectedLabel() || placeholder() }}
1407
+ </span>
1408
+ <vd-icon name="chevron-down" class="vd-select__chevron" />
1409
+ </button>
1410
+ <div #list class="vd-listbox" popover="auto" role="listbox" [id]="listboxId" tabindex="-1">
1411
+ <ng-content />
1412
+ @if (visibleOptions().length === 0) {
1413
+ <p class="vd-listbox__empty">{{ t().emptyText }}</p>
1414
+ }
1415
+ </div>
1416
+ `,
1417
+ host: {
1418
+ class: "vd-select",
1419
+ "[attr.data-size]": "size()",
1420
+ "[attr.data-open]": "open() ? \"\" : null",
1421
+ "[attr.data-invalid]": "showInvalid() ? \"\" : null",
1422
+ "[attr.data-disabled]": "isDisabled() ? \"\" : null",
1423
+ "[attr.aria-label]": "null",
1424
+ "[attr.aria-labelledby]": "null"
1425
+ },
1426
+ providers: [{
1427
+ provide: VD_LISTBOX,
1428
+ useExisting: forwardRef(() => VdSelect)
1429
+ }, {
1430
+ provide: NG_VALUE_ACCESSOR,
1431
+ useExisting: forwardRef(() => VdSelect),
1432
+ multi: true
1433
+ }],
1434
+ changeDetection: ChangeDetectionStrategy.OnPush,
1435
+ encapsulation: ViewEncapsulation.None
1436
+ }]
1437
+ }],
1438
+ propDecorators: {
1439
+ value: [{
1440
+ type: i0.Input,
1441
+ args: [{
1442
+ isSignal: true,
1443
+ alias: "value",
1444
+ required: false
1445
+ }]
1446
+ }, {
1447
+ type: i0.Output,
1448
+ args: ["valueChange"]
1449
+ }],
1450
+ trigger: [{
1451
+ type: i0.ViewChild,
1452
+ args: ["trigger", { isSignal: true }]
1453
+ }],
1454
+ list: [{
1455
+ type: i0.ViewChild,
1456
+ args: ["list", { isSignal: true }]
1457
+ }]
1458
+ }
1459
+ });
1460
+ export { VdCombobox, VdMultiSelect, VdOption, VdSelect };
1461
+
1462
+ //# sourceMappingURL=vadem-ui-select.mjs.map