@loomui-ng/ui 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +46 -2
  3. package/accordion/README.md +38 -0
  4. package/alert/README.md +32 -0
  5. package/alert-dialog/README.md +37 -0
  6. package/aspect-ratio/README.md +24 -0
  7. package/attachment/README.md +40 -0
  8. package/avatar/README.md +34 -0
  9. package/badge/README.md +29 -0
  10. package/breadcrumb/README.md +33 -0
  11. package/bubble/README.md +32 -0
  12. package/button/README.md +31 -0
  13. package/button-group/README.md +30 -0
  14. package/calendar/README.md +35 -0
  15. package/card/README.md +41 -0
  16. package/carousel/README.md +41 -0
  17. package/chart/README.md +25 -0
  18. package/checkbox/README.md +31 -0
  19. package/collapsible/README.md +31 -0
  20. package/combobox/README.md +47 -0
  21. package/command/README.md +44 -0
  22. package/context-menu/README.md +36 -0
  23. package/data-table/README.md +39 -0
  24. package/date-picker/README.md +23 -0
  25. package/dialog/README.md +52 -0
  26. package/direction/README.md +19 -0
  27. package/drawer/README.md +37 -0
  28. package/dropdown-menu/README.md +46 -0
  29. package/empty/README.md +38 -0
  30. package/fesm2022/loomui-ng-ui-accordion.mjs +555 -0
  31. package/fesm2022/loomui-ng-ui-accordion.mjs.map +1 -0
  32. package/fesm2022/loomui-ng-ui-alert-dialog.mjs +652 -0
  33. package/fesm2022/loomui-ng-ui-alert-dialog.mjs.map +1 -0
  34. package/fesm2022/loomui-ng-ui-alert.mjs +286 -0
  35. package/fesm2022/loomui-ng-ui-alert.mjs.map +1 -0
  36. package/fesm2022/loomui-ng-ui-aspect-ratio.mjs +97 -0
  37. package/fesm2022/loomui-ng-ui-aspect-ratio.mjs.map +1 -0
  38. package/fesm2022/loomui-ng-ui-attachment.mjs +713 -0
  39. package/fesm2022/loomui-ng-ui-attachment.mjs.map +1 -0
  40. package/fesm2022/loomui-ng-ui-avatar.mjs +561 -0
  41. package/fesm2022/loomui-ng-ui-avatar.mjs.map +1 -0
  42. package/fesm2022/loomui-ng-ui-badge.mjs +102 -0
  43. package/fesm2022/loomui-ng-ui-badge.mjs.map +1 -0
  44. package/fesm2022/loomui-ng-ui-breadcrumb.mjs +520 -0
  45. package/fesm2022/loomui-ng-ui-breadcrumb.mjs.map +1 -0
  46. package/fesm2022/loomui-ng-ui-bubble.mjs +386 -0
  47. package/fesm2022/loomui-ng-ui-bubble.mjs.map +1 -0
  48. package/fesm2022/loomui-ng-ui-button-group.mjs +193 -0
  49. package/fesm2022/loomui-ng-ui-button-group.mjs.map +1 -0
  50. package/fesm2022/loomui-ng-ui-button.mjs +162 -0
  51. package/fesm2022/loomui-ng-ui-button.mjs.map +1 -0
  52. package/fesm2022/loomui-ng-ui-calendar.mjs +681 -0
  53. package/fesm2022/loomui-ng-ui-calendar.mjs.map +1 -0
  54. package/fesm2022/loomui-ng-ui-card.mjs +461 -0
  55. package/fesm2022/loomui-ng-ui-card.mjs.map +1 -0
  56. package/fesm2022/loomui-ng-ui-carousel.mjs +532 -0
  57. package/fesm2022/loomui-ng-ui-carousel.mjs.map +1 -0
  58. package/fesm2022/loomui-ng-ui-chart.mjs +373 -0
  59. package/fesm2022/loomui-ng-ui-chart.mjs.map +1 -0
  60. package/fesm2022/loomui-ng-ui-checkbox.mjs +265 -0
  61. package/fesm2022/loomui-ng-ui-checkbox.mjs.map +1 -0
  62. package/fesm2022/loomui-ng-ui-collapsible.mjs +274 -0
  63. package/fesm2022/loomui-ng-ui-collapsible.mjs.map +1 -0
  64. package/fesm2022/loomui-ng-ui-combobox.mjs +971 -0
  65. package/fesm2022/loomui-ng-ui-combobox.mjs.map +1 -0
  66. package/fesm2022/loomui-ng-ui-command.mjs +982 -0
  67. package/fesm2022/loomui-ng-ui-command.mjs.map +1 -0
  68. package/fesm2022/loomui-ng-ui-context-menu.mjs +1359 -0
  69. package/fesm2022/loomui-ng-ui-context-menu.mjs.map +1 -0
  70. package/fesm2022/loomui-ng-ui-data-table.mjs +535 -0
  71. package/fesm2022/loomui-ng-ui-data-table.mjs.map +1 -0
  72. package/fesm2022/loomui-ng-ui-date-picker.mjs +312 -0
  73. package/fesm2022/loomui-ng-ui-date-picker.mjs.map +1 -0
  74. package/fesm2022/loomui-ng-ui-dialog.mjs +508 -0
  75. package/fesm2022/loomui-ng-ui-dialog.mjs.map +1 -0
  76. package/fesm2022/loomui-ng-ui-direction.mjs +112 -0
  77. package/fesm2022/loomui-ng-ui-direction.mjs.map +1 -0
  78. package/fesm2022/loomui-ng-ui-drawer.mjs +590 -0
  79. package/fesm2022/loomui-ng-ui-drawer.mjs.map +1 -0
  80. package/fesm2022/loomui-ng-ui-dropdown-menu.mjs +1322 -0
  81. package/fesm2022/loomui-ng-ui-dropdown-menu.mjs.map +1 -0
  82. package/fesm2022/loomui-ng-ui-empty.mjs +408 -0
  83. package/fesm2022/loomui-ng-ui-empty.mjs.map +1 -0
  84. package/fesm2022/loomui-ng-ui-field.mjs +630 -0
  85. package/fesm2022/loomui-ng-ui-field.mjs.map +1 -0
  86. package/fesm2022/loomui-ng-ui-hover-card.mjs +230 -0
  87. package/fesm2022/loomui-ng-ui-hover-card.mjs.map +1 -0
  88. package/fesm2022/loomui-ng-ui-icon.mjs +498 -0
  89. package/fesm2022/loomui-ng-ui-icon.mjs.map +1 -0
  90. package/fesm2022/loomui-ng-ui-input-group.mjs +463 -0
  91. package/fesm2022/loomui-ng-ui-input-group.mjs.map +1 -0
  92. package/fesm2022/loomui-ng-ui-input-otp.mjs +586 -0
  93. package/fesm2022/loomui-ng-ui-input-otp.mjs.map +1 -0
  94. package/fesm2022/loomui-ng-ui-input.mjs +289 -0
  95. package/fesm2022/loomui-ng-ui-input.mjs.map +1 -0
  96. package/fesm2022/loomui-ng-ui-item.mjs +598 -0
  97. package/fesm2022/loomui-ng-ui-item.mjs.map +1 -0
  98. package/fesm2022/loomui-ng-ui-kbd.mjs +129 -0
  99. package/fesm2022/loomui-ng-ui-kbd.mjs.map +1 -0
  100. package/fesm2022/loomui-ng-ui-label.mjs +68 -0
  101. package/fesm2022/loomui-ng-ui-label.mjs.map +1 -0
  102. package/fesm2022/loomui-ng-ui-marker.mjs +234 -0
  103. package/fesm2022/loomui-ng-ui-marker.mjs.map +1 -0
  104. package/fesm2022/loomui-ng-ui-menubar.mjs +1523 -0
  105. package/fesm2022/loomui-ng-ui-menubar.mjs.map +1 -0
  106. package/fesm2022/loomui-ng-ui-message-scroller.mjs +519 -0
  107. package/fesm2022/loomui-ng-ui-message-scroller.mjs.map +1 -0
  108. package/fesm2022/loomui-ng-ui-message.mjs +408 -0
  109. package/fesm2022/loomui-ng-ui-message.mjs.map +1 -0
  110. package/fesm2022/loomui-ng-ui-native-select.mjs +389 -0
  111. package/fesm2022/loomui-ng-ui-native-select.mjs.map +1 -0
  112. package/fesm2022/loomui-ng-ui-navigation-menu.mjs +609 -0
  113. package/fesm2022/loomui-ng-ui-navigation-menu.mjs.map +1 -0
  114. package/fesm2022/loomui-ng-ui-pagination.mjs +611 -0
  115. package/fesm2022/loomui-ng-ui-pagination.mjs.map +1 -0
  116. package/fesm2022/loomui-ng-ui-popover.mjs +358 -0
  117. package/fesm2022/loomui-ng-ui-popover.mjs.map +1 -0
  118. package/fesm2022/loomui-ng-ui-progress.mjs +159 -0
  119. package/fesm2022/loomui-ng-ui-progress.mjs.map +1 -0
  120. package/fesm2022/loomui-ng-ui-questionnaire.mjs +1012 -0
  121. package/fesm2022/loomui-ng-ui-questionnaire.mjs.map +1 -0
  122. package/fesm2022/loomui-ng-ui-radio-group.mjs +399 -0
  123. package/fesm2022/loomui-ng-ui-radio-group.mjs.map +1 -0
  124. package/fesm2022/loomui-ng-ui-resizable.mjs +518 -0
  125. package/fesm2022/loomui-ng-ui-resizable.mjs.map +1 -0
  126. package/fesm2022/loomui-ng-ui-scroll-area.mjs +135 -0
  127. package/fesm2022/loomui-ng-ui-scroll-area.mjs.map +1 -0
  128. package/fesm2022/loomui-ng-ui-select.mjs +863 -0
  129. package/fesm2022/loomui-ng-ui-select.mjs.map +1 -0
  130. package/fesm2022/loomui-ng-ui-separator.mjs +114 -0
  131. package/fesm2022/loomui-ng-ui-separator.mjs.map +1 -0
  132. package/fesm2022/loomui-ng-ui-sheet.mjs +530 -0
  133. package/fesm2022/loomui-ng-ui-sheet.mjs.map +1 -0
  134. package/fesm2022/loomui-ng-ui-sidebar.mjs +1918 -0
  135. package/fesm2022/loomui-ng-ui-sidebar.mjs.map +1 -0
  136. package/fesm2022/loomui-ng-ui-skeleton.mjs +69 -0
  137. package/fesm2022/loomui-ng-ui-skeleton.mjs.map +1 -0
  138. package/fesm2022/loomui-ng-ui-slider.mjs +390 -0
  139. package/fesm2022/loomui-ng-ui-slider.mjs.map +1 -0
  140. package/fesm2022/loomui-ng-ui-spinner.mjs +85 -0
  141. package/fesm2022/loomui-ng-ui-spinner.mjs.map +1 -0
  142. package/fesm2022/loomui-ng-ui-switch.mjs +212 -0
  143. package/fesm2022/loomui-ng-ui-switch.mjs.map +1 -0
  144. package/fesm2022/loomui-ng-ui-table.mjs +559 -0
  145. package/fesm2022/loomui-ng-ui-table.mjs.map +1 -0
  146. package/fesm2022/loomui-ng-ui-tabs.mjs +544 -0
  147. package/fesm2022/loomui-ng-ui-tabs.mjs.map +1 -0
  148. package/fesm2022/loomui-ng-ui-textarea.mjs +206 -0
  149. package/fesm2022/loomui-ng-ui-textarea.mjs.map +1 -0
  150. package/fesm2022/loomui-ng-ui-toast.mjs +432 -0
  151. package/fesm2022/loomui-ng-ui-toast.mjs.map +1 -0
  152. package/fesm2022/loomui-ng-ui-toggle-group.mjs +477 -0
  153. package/fesm2022/loomui-ng-ui-toggle-group.mjs.map +1 -0
  154. package/fesm2022/loomui-ng-ui-toggle.mjs +219 -0
  155. package/fesm2022/loomui-ng-ui-toggle.mjs.map +1 -0
  156. package/fesm2022/loomui-ng-ui-tooltip.mjs +240 -0
  157. package/fesm2022/loomui-ng-ui-tooltip.mjs.map +1 -0
  158. package/fesm2022/loomui-ng-ui-typography.mjs +129 -0
  159. package/fesm2022/loomui-ng-ui-typography.mjs.map +1 -0
  160. package/fesm2022/loomui-ng-ui-utils.mjs +1533 -0
  161. package/fesm2022/loomui-ng-ui-utils.mjs.map +1 -0
  162. package/fesm2022/loomui-ng-ui.mjs +4 -0
  163. package/fesm2022/loomui-ng-ui.mjs.map +1 -0
  164. package/field/README.md +43 -0
  165. package/hover-card/README.md +31 -0
  166. package/icon/README.md +42 -0
  167. package/input/README.md +26 -0
  168. package/input-group/README.md +40 -0
  169. package/input-otp/README.md +35 -0
  170. package/item/README.md +33 -0
  171. package/kbd/README.md +21 -0
  172. package/label/README.md +24 -0
  173. package/marker/README.md +24 -0
  174. package/menubar/README.md +40 -0
  175. package/message/README.md +32 -0
  176. package/message-scroller/README.md +40 -0
  177. package/native-select/README.md +26 -0
  178. package/navigation-menu/README.md +39 -0
  179. package/package.json +325 -3
  180. package/pagination/README.md +37 -0
  181. package/popover/README.md +37 -0
  182. package/progress/README.md +25 -0
  183. package/questionnaire/README.md +52 -0
  184. package/radio-group/README.md +33 -0
  185. package/resizable/README.md +37 -0
  186. package/scroll-area/README.md +25 -0
  187. package/select/README.md +45 -0
  188. package/separator/README.md +28 -0
  189. package/sheet/README.md +38 -0
  190. package/sidebar/README.md +60 -0
  191. package/skeleton/README.md +21 -0
  192. package/slider/README.md +29 -0
  193. package/spinner/README.md +15 -0
  194. package/styles/loomui.css +330 -0
  195. package/switch/README.md +29 -0
  196. package/table/README.md +31 -0
  197. package/tabs/README.md +42 -0
  198. package/textarea/README.md +28 -0
  199. package/toast/README.md +27 -0
  200. package/toggle/README.md +27 -0
  201. package/toggle-group/README.md +37 -0
  202. package/tooltip/README.md +31 -0
  203. package/types/loomui-ng-ui-accordion.d.ts +141 -0
  204. package/types/loomui-ng-ui-alert-dialog.d.ts +175 -0
  205. package/types/loomui-ng-ui-alert.d.ts +77 -0
  206. package/types/loomui-ng-ui-aspect-ratio.d.ts +31 -0
  207. package/types/loomui-ng-ui-attachment.d.ts +192 -0
  208. package/types/loomui-ng-ui-avatar.d.ts +147 -0
  209. package/types/loomui-ng-ui-badge.d.ts +32 -0
  210. package/types/loomui-ng-ui-breadcrumb.d.ts +118 -0
  211. package/types/loomui-ng-ui-bubble.d.ts +100 -0
  212. package/types/loomui-ng-ui-button-group.d.ts +51 -0
  213. package/types/loomui-ng-ui-button.d.ts +57 -0
  214. package/types/loomui-ng-ui-calendar.d.ts +171 -0
  215. package/types/loomui-ng-ui-card.d.ts +123 -0
  216. package/types/loomui-ng-ui-carousel.d.ts +140 -0
  217. package/types/loomui-ng-ui-chart.d.ts +95 -0
  218. package/types/loomui-ng-ui-checkbox.d.ts +62 -0
  219. package/types/loomui-ng-ui-collapsible.d.ts +74 -0
  220. package/types/loomui-ng-ui-combobox.d.ts +229 -0
  221. package/types/loomui-ng-ui-command.d.ts +231 -0
  222. package/types/loomui-ng-ui-context-menu.d.ts +288 -0
  223. package/types/loomui-ng-ui-data-table.d.ts +111 -0
  224. package/types/loomui-ng-ui-date-picker.d.ts +63 -0
  225. package/types/loomui-ng-ui-dialog.d.ts +127 -0
  226. package/types/loomui-ng-ui-direction.d.ts +42 -0
  227. package/types/loomui-ng-ui-drawer.d.ts +149 -0
  228. package/types/loomui-ng-ui-dropdown-menu.d.ts +258 -0
  229. package/types/loomui-ng-ui-empty.d.ts +109 -0
  230. package/types/loomui-ng-ui-field.d.ts +169 -0
  231. package/types/loomui-ng-ui-hover-card.d.ts +62 -0
  232. package/types/loomui-ng-ui-icon.d.ts +156 -0
  233. package/types/loomui-ng-ui-input-group.d.ts +130 -0
  234. package/types/loomui-ng-ui-input-otp.d.ts +149 -0
  235. package/types/loomui-ng-ui-input.d.ts +89 -0
  236. package/types/loomui-ng-ui-item.d.ts +157 -0
  237. package/types/loomui-ng-ui-kbd.d.ts +36 -0
  238. package/types/loomui-ng-ui-label.d.ts +19 -0
  239. package/types/loomui-ng-ui-marker.d.ts +61 -0
  240. package/types/loomui-ng-ui-menubar.d.ts +321 -0
  241. package/types/loomui-ng-ui-message-scroller.d.ts +138 -0
  242. package/types/loomui-ng-ui-message.d.ts +109 -0
  243. package/types/loomui-ng-ui-native-select.d.ts +84 -0
  244. package/types/loomui-ng-ui-navigation-menu.d.ts +160 -0
  245. package/types/loomui-ng-ui-pagination.d.ts +130 -0
  246. package/types/loomui-ng-ui-popover.d.ts +90 -0
  247. package/types/loomui-ng-ui-progress.d.ts +39 -0
  248. package/types/loomui-ng-ui-questionnaire.d.ts +274 -0
  249. package/types/loomui-ng-ui-radio-group.d.ts +109 -0
  250. package/types/loomui-ng-ui-resizable.d.ts +121 -0
  251. package/types/loomui-ng-ui-scroll-area.d.ts +44 -0
  252. package/types/loomui-ng-ui-select.d.ts +204 -0
  253. package/types/loomui-ng-ui-separator.d.ts +35 -0
  254. package/types/loomui-ng-ui-sheet.d.ts +124 -0
  255. package/types/loomui-ng-ui-sidebar.d.ts +485 -0
  256. package/types/loomui-ng-ui-skeleton.d.ts +20 -0
  257. package/types/loomui-ng-ui-slider.d.ts +103 -0
  258. package/types/loomui-ng-ui-spinner.d.ts +19 -0
  259. package/types/loomui-ng-ui-switch.d.ts +56 -0
  260. package/types/loomui-ng-ui-table.d.ts +148 -0
  261. package/types/loomui-ng-ui-tabs.d.ts +148 -0
  262. package/types/loomui-ng-ui-textarea.d.ts +52 -0
  263. package/types/loomui-ng-ui-toast.d.ts +97 -0
  264. package/types/loomui-ng-ui-toggle-group.d.ts +138 -0
  265. package/types/loomui-ng-ui-toggle.d.ts +63 -0
  266. package/types/loomui-ng-ui-tooltip.d.ts +63 -0
  267. package/types/loomui-ng-ui-typography.d.ts +42 -0
  268. package/types/loomui-ng-ui-utils.d.ts +392 -0
  269. package/types/loomui-ng-ui.d.ts +5 -0
  270. package/typography/README.md +29 -0
@@ -0,0 +1,971 @@
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, Directive, ElementRef, booleanAttribute, computed, contentChildren, effect, forwardRef, inject, input, model, signal } from "@angular/core";
3
+ import { NG_VALUE_ACCESSOR } from "@angular/forms";
4
+ import { buttonVariants } from "@loomui-ng/ui/button";
5
+ import * as i1 from "@loomui-ng/ui/utils";
6
+ import { UiElementHost, UiLayerRoot, UiPopperContentBase, cn, nextId } from "@loomui-ng/ui/utils";
7
+ import { UiIconSvg } from "@loomui-ng/ui/icon";
8
+ const comboboxTriggerClass = "group/button inline-flex shrink-0 items-center rounded-lg border bg-clip-padding text-sm whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50 h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2 w-64 justify-between font-normal [&_svg:not([class*='size-'])]:size-4";
9
+ const comboboxContentClass = "group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95";
10
+ const comboboxListClass = "no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0";
11
+ const comboboxItemClass = "relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pe-8 ps-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";
12
+ const comboboxEmptyClass = "hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex";
13
+ const comboboxChipsClass = "flex min-h-8 flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40 w-full max-w-xs";
14
+ const comboboxChipClass = "flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pe-0";
15
+ const comboboxChipInputClass = "min-w-16 flex-1 outline-none";
16
+ const comboboxClearClass = "group/button shrink-0 justify-center border border-transparent bg-clip-padding font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2 flex items-center gap-2 text-sm shadow-none size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0 has-[>ui-icon]:p-0";
17
+ const UI_COMBOBOX_GENERATED = [];
18
+ var UiCombobox = class UiCombobox extends UiLayerRoot {
19
+ value = model("", ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
20
+ disabled = input(false, {
21
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
22
+ transform: booleanAttribute
23
+ });
24
+ listId = nextId("ui-combobox-list");
25
+ search = signal("", ...ngDevMode ? [{ debugName: "search" }] : /* istanbul ignore next */ []);
26
+ highlighted = signal(null, ...ngDevMode ? [{ debugName: "highlighted" }] : /* istanbul ignore next */ []);
27
+ items = contentChildren(forwardRef(() => UiComboboxItem), {
28
+ ...ngDevMode ? { debugName: "items" } : /* istanbul ignore next */ {},
29
+ descendants: true
30
+ });
31
+ cvaDisabled = signal(false, ...ngDevMode ? [{ debugName: "cvaDisabled" }] : /* istanbul ignore next */ []);
32
+ isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
33
+ selectedLabel = computed(() => this.items().find((i) => i.value() === this.value())?.label() ?? "", ...ngDevMode ? [{ debugName: "selectedLabel" }] : /* istanbul ignore next */ []);
34
+ visible = computed(() => this.items().filter((i) => i.visible()), ...ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []);
35
+ hasResults = computed(() => this.visible().length > 0, ...ngDevMode ? [{ debugName: "hasResults" }] : /* istanbul ignore next */ []);
36
+ onChange = () => {};
37
+ onTouched = () => {};
38
+ constructor() {
39
+ super();
40
+ effect(() => {
41
+ if (this.open()) {
42
+ this.search.set("");
43
+ queueMicrotask(() => this.ensureHighlight(true));
44
+ }
45
+ });
46
+ }
47
+ ensureHighlight(reset = false) {
48
+ const enabled = this.visible().filter((i) => !i.disabled);
49
+ const selected = enabled.find((i) => i.value() === this.value());
50
+ if (reset) this.highlighted.set((selected ?? enabled[0])?.id ?? null);
51
+ else if (!enabled.some((i) => i.id === this.highlighted())) this.highlighted.set(enabled[0]?.id ?? null);
52
+ }
53
+ move(delta) {
54
+ const enabled = this.visible().filter((i) => !i.disabled);
55
+ if (!enabled.length) return;
56
+ let idx = enabled.findIndex((i) => i.id === this.highlighted());
57
+ if (delta === "first") idx = 0;
58
+ else if (delta === "last") idx = enabled.length - 1;
59
+ else idx = (idx + delta + enabled.length) % enabled.length;
60
+ this.highlighted.set(enabled[idx].id);
61
+ enabled[idx].scrollIntoView();
62
+ }
63
+ choose(v) {
64
+ this.value.set(v);
65
+ this.onChange(v);
66
+ this.close();
67
+ }
68
+ chooseHighlighted() {
69
+ this.items().find((i) => i.id === this.highlighted())?.activate();
70
+ }
71
+ writeValue(v) {
72
+ this.value.set(v ?? "");
73
+ }
74
+ registerOnChange(fn) {
75
+ this.onChange = fn;
76
+ }
77
+ registerOnTouched(fn) {
78
+ this.onTouched = fn;
79
+ }
80
+ setDisabledState(d) {
81
+ this.cvaDisabled.set(d);
82
+ }
83
+ static ɵfac = i0.ɵɵngDeclareFactory({
84
+ minVersion: "12.0.0",
85
+ version: "22.2.2",
86
+ ngImport: i0,
87
+ type: UiCombobox,
88
+ deps: [],
89
+ target: i0.ɵɵFactoryTarget.Directive
90
+ });
91
+ static ɵdir = i0.ɵɵngDeclareDirective({
92
+ minVersion: "17.2.0",
93
+ version: "22.2.2",
94
+ type: UiCombobox,
95
+ isStandalone: true,
96
+ selector: "[uiCombobox], ui-combobox",
97
+ inputs: {
98
+ value: {
99
+ classPropertyName: "value",
100
+ publicName: "value",
101
+ isSignal: true,
102
+ isRequired: false,
103
+ transformFunction: null
104
+ },
105
+ disabled: {
106
+ classPropertyName: "disabled",
107
+ publicName: "disabled",
108
+ isSignal: true,
109
+ isRequired: false,
110
+ transformFunction: null
111
+ }
112
+ },
113
+ outputs: { value: "valueChange" },
114
+ providers: [{
115
+ provide: NG_VALUE_ACCESSOR,
116
+ useExisting: forwardRef(() => UiCombobox),
117
+ multi: true
118
+ }],
119
+ queries: [{
120
+ propertyName: "items",
121
+ predicate: i0.forwardRef(() => UiComboboxItem),
122
+ descendants: true,
123
+ isSignal: true
124
+ }],
125
+ exportAs: ["uiCombobox"],
126
+ usesInheritance: true,
127
+ hostDirectives: [{ directive: i1.UiElementHost }],
128
+ ngImport: i0
129
+ });
130
+ };
131
+ i0.ɵɵngDeclareClassMetadata({
132
+ minVersion: "12.0.0",
133
+ version: "22.2.2",
134
+ ngImport: i0,
135
+ type: UiCombobox,
136
+ decorators: [{
137
+ type: Directive,
138
+ args: [{
139
+ selector: "[uiCombobox], ui-combobox",
140
+ hostDirectives: [UiElementHost],
141
+ exportAs: "uiCombobox",
142
+ providers: [{
143
+ provide: NG_VALUE_ACCESSOR,
144
+ useExisting: forwardRef(() => UiCombobox),
145
+ multi: true
146
+ }]
147
+ }]
148
+ }],
149
+ ctorParameters: () => [],
150
+ propDecorators: {
151
+ value: [{
152
+ type: i0.Input,
153
+ args: [{
154
+ isSignal: true,
155
+ alias: "value",
156
+ required: false
157
+ }]
158
+ }, {
159
+ type: i0.Output,
160
+ args: ["valueChange"]
161
+ }],
162
+ disabled: [{
163
+ type: i0.Input,
164
+ args: [{
165
+ isSignal: true,
166
+ alias: "disabled",
167
+ required: false
168
+ }]
169
+ }],
170
+ items: [{
171
+ type: i0.ContentChildren,
172
+ args: [forwardRef(() => UiComboboxItem), {
173
+ descendants: true,
174
+ isSignal: true
175
+ }]
176
+ }]
177
+ }
178
+ });
179
+ var UiComboboxTrigger = class UiComboboxTrigger {
180
+ root = inject(UiCombobox);
181
+ userClass = input("", {
182
+ ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
183
+ alias: "class"
184
+ });
185
+ classes = computed(() => cn(buttonVariants({ variant: "outline" }), "w-[200px] justify-between font-normal", this.userClass()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
186
+ constructor() {
187
+ this.root.trigger.set(inject(ElementRef).nativeElement);
188
+ }
189
+ onKeydown(e) {
190
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") {
191
+ e.preventDefault();
192
+ this.root.open.set(true);
193
+ }
194
+ }
195
+ static ɵfac = i0.ɵɵngDeclareFactory({
196
+ minVersion: "12.0.0",
197
+ version: "22.2.2",
198
+ ngImport: i0,
199
+ type: UiComboboxTrigger,
200
+ deps: [],
201
+ target: i0.ɵɵFactoryTarget.Component
202
+ });
203
+ static ɵcmp = i0.ɵɵngDeclareComponent({
204
+ minVersion: "17.1.0",
205
+ version: "22.2.2",
206
+ type: UiComboboxTrigger,
207
+ isStandalone: true,
208
+ selector: "button[uiComboboxTrigger], ui-combobox-trigger",
209
+ inputs: { userClass: {
210
+ classPropertyName: "userClass",
211
+ publicName: "class",
212
+ isSignal: true,
213
+ isRequired: false,
214
+ transformFunction: null
215
+ } },
216
+ host: {
217
+ attributes: {
218
+ "type": "button",
219
+ "role": "combobox",
220
+ "aria-haspopup": "listbox",
221
+ "data-slot": "combobox-trigger"
222
+ },
223
+ listeners: {
224
+ "click": "root.toggle()",
225
+ "keydown": "onKeydown($event)",
226
+ "blur": "root.onTouched()"
227
+ },
228
+ properties: {
229
+ "attr.aria-expanded": "root.open()",
230
+ "attr.aria-controls": "root.open() ? root.listId : null",
231
+ "attr.data-state": "root.open() ? \"open\" : \"closed\"",
232
+ "attr.data-placeholder": "root.value() === \"\" ? \"\" : null",
233
+ "attr.disabled": "(root.isDisabled()) ? \"\" : null",
234
+ "attr.class": "classes()"
235
+ }
236
+ },
237
+ hostDirectives: [{ directive: i1.UiElementHost }],
238
+ ngImport: i0,
239
+ template: `<ng-content /><svg uiIcon="chevrons-up-down" class="pointer-events-none size-4 shrink-0 text-muted-foreground"></svg>`,
240
+ isInline: true,
241
+ dependencies: [{
242
+ kind: "directive",
243
+ type: UiIconSvg,
244
+ selector: "svg[uiIcon]",
245
+ inputs: [
246
+ "uiIcon",
247
+ "icon",
248
+ "size",
249
+ "strokeWidth",
250
+ "absoluteStrokeWidth",
251
+ "color",
252
+ "label",
253
+ "class"
254
+ ]
255
+ }],
256
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
257
+ });
258
+ };
259
+ i0.ɵɵngDeclareClassMetadata({
260
+ minVersion: "12.0.0",
261
+ version: "22.2.2",
262
+ ngImport: i0,
263
+ type: UiComboboxTrigger,
264
+ decorators: [{
265
+ type: Component,
266
+ args: [{
267
+ selector: "button[uiComboboxTrigger], ui-combobox-trigger",
268
+ hostDirectives: [UiElementHost],
269
+ imports: [UiIconSvg],
270
+ changeDetection: ChangeDetectionStrategy.OnPush,
271
+ host: {
272
+ type: "button",
273
+ role: "combobox",
274
+ "aria-haspopup": "listbox",
275
+ "data-slot": "combobox-trigger",
276
+ "[attr.aria-expanded]": "root.open()",
277
+ "[attr.aria-controls]": "root.open() ? root.listId : null",
278
+ "[attr.data-state]": "root.open() ? \"open\" : \"closed\"",
279
+ "[attr.data-placeholder]": "root.value() === \"\" ? \"\" : null",
280
+ "[attr.disabled]": "(root.isDisabled()) ? \"\" : null",
281
+ "[attr.class]": "classes()",
282
+ "(click)": "root.toggle()",
283
+ "(keydown)": "onKeydown($event)",
284
+ "(blur)": "root.onTouched()"
285
+ },
286
+ template: `<ng-content /><svg uiIcon="chevrons-up-down" class="pointer-events-none size-4 shrink-0 text-muted-foreground"></svg>`
287
+ }]
288
+ }],
289
+ ctorParameters: () => [],
290
+ propDecorators: { userClass: [{
291
+ type: i0.Input,
292
+ args: [{
293
+ isSignal: true,
294
+ alias: "class",
295
+ required: false
296
+ }]
297
+ }] }
298
+ });
299
+ var UiComboboxValue = class UiComboboxValue {
300
+ root = inject(UiCombobox);
301
+ placeholder = input("", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
302
+ text = computed(() => this.root.selectedLabel() || this.placeholder(), ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
303
+ static ɵfac = i0.ɵɵngDeclareFactory({
304
+ minVersion: "12.0.0",
305
+ version: "22.2.2",
306
+ ngImport: i0,
307
+ type: UiComboboxValue,
308
+ deps: [],
309
+ target: i0.ɵɵFactoryTarget.Directive
310
+ });
311
+ static ɵdir = i0.ɵɵngDeclareDirective({
312
+ minVersion: "17.1.0",
313
+ version: "22.2.2",
314
+ type: UiComboboxValue,
315
+ isStandalone: true,
316
+ selector: "[uiComboboxValue], ui-combobox-value",
317
+ inputs: { placeholder: {
318
+ classPropertyName: "placeholder",
319
+ publicName: "placeholder",
320
+ isSignal: true,
321
+ isRequired: false,
322
+ transformFunction: null
323
+ } },
324
+ host: {
325
+ attributes: { "data-slot": "combobox-value" },
326
+ properties: {
327
+ "textContent": "text()",
328
+ "class.text-muted-foreground": "!root.selectedLabel()"
329
+ }
330
+ },
331
+ hostDirectives: [{ directive: i1.UiElementHost }],
332
+ ngImport: i0
333
+ });
334
+ };
335
+ i0.ɵɵngDeclareClassMetadata({
336
+ minVersion: "12.0.0",
337
+ version: "22.2.2",
338
+ ngImport: i0,
339
+ type: UiComboboxValue,
340
+ decorators: [{
341
+ type: Directive,
342
+ args: [{
343
+ selector: "[uiComboboxValue], ui-combobox-value",
344
+ hostDirectives: [UiElementHost],
345
+ host: {
346
+ "data-slot": "combobox-value",
347
+ "[textContent]": "text()",
348
+ "[class.text-muted-foreground]": "!root.selectedLabel()"
349
+ }
350
+ }]
351
+ }],
352
+ propDecorators: { placeholder: [{
353
+ type: i0.Input,
354
+ args: [{
355
+ isSignal: true,
356
+ alias: "placeholder",
357
+ required: false
358
+ }]
359
+ }] }
360
+ });
361
+ var UiComboboxContent = class UiComboboxContent extends UiPopperContentBase {
362
+ root = inject(UiCombobox);
363
+ varPrefix = "--radix-combobox";
364
+ align = input("start", ...ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []);
365
+ classes = computed(() => cn(comboboxContentClass, this.userClass()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
366
+ constructor() {
367
+ super();
368
+ this.matchTriggerWidth = true;
369
+ this.init();
370
+ }
371
+ onAttached() {
372
+ const t = this.root.trigger();
373
+ if (t) {
374
+ const r = t.getBoundingClientRect();
375
+ this.el.style.setProperty("--anchor-width", `${r.width}px`);
376
+ this.el.style.setProperty("--available-height", `${window.innerHeight - 16}px`);
377
+ this.el.style.setProperty("--available-width", `${window.innerWidth - 16}px`);
378
+ this.el.style.setProperty("--transform-origin", "top");
379
+ }
380
+ queueMicrotask(() => this.el.querySelector("[data-slot=combobox-input]")?.focus());
381
+ }
382
+ static ɵfac = i0.ɵɵngDeclareFactory({
383
+ minVersion: "12.0.0",
384
+ version: "22.2.2",
385
+ ngImport: i0,
386
+ type: UiComboboxContent,
387
+ deps: [],
388
+ target: i0.ɵɵFactoryTarget.Directive
389
+ });
390
+ static ɵdir = i0.ɵɵngDeclareDirective({
391
+ minVersion: "17.1.0",
392
+ version: "22.2.2",
393
+ type: UiComboboxContent,
394
+ isStandalone: true,
395
+ selector: "[uiComboboxContent], ui-combobox-content",
396
+ inputs: { align: {
397
+ classPropertyName: "align",
398
+ publicName: "align",
399
+ isSignal: true,
400
+ isRequired: false,
401
+ transformFunction: null
402
+ } },
403
+ host: {
404
+ attributes: {
405
+ "role": "presentation",
406
+ "data-slot": "combobox-content",
407
+ "data-chips": "false",
408
+ "tabindex": "-1"
409
+ },
410
+ properties: {
411
+ "attr.data-open": "root.state() === \"open\" ? \"\" : null",
412
+ "attr.data-state": "root.state()",
413
+ "attr.data-empty": "!root.hasResults() ? \"\" : null",
414
+ "attr.class": "classes()"
415
+ }
416
+ },
417
+ usesInheritance: true,
418
+ hostDirectives: [{ directive: i1.UiElementHost }],
419
+ ngImport: i0
420
+ });
421
+ };
422
+ i0.ɵɵngDeclareClassMetadata({
423
+ minVersion: "12.0.0",
424
+ version: "22.2.2",
425
+ ngImport: i0,
426
+ type: UiComboboxContent,
427
+ decorators: [{
428
+ type: Directive,
429
+ args: [{
430
+ selector: "[uiComboboxContent], ui-combobox-content",
431
+ hostDirectives: [UiElementHost],
432
+ host: {
433
+ role: "presentation",
434
+ "data-slot": "combobox-content",
435
+ "data-chips": "false",
436
+ tabindex: "-1",
437
+ "[attr.data-open]": "root.state() === \"open\" ? \"\" : null",
438
+ "[attr.data-state]": "root.state()",
439
+ "[attr.data-empty]": "!root.hasResults() ? \"\" : null",
440
+ "[attr.class]": "classes()"
441
+ }
442
+ }]
443
+ }],
444
+ ctorParameters: () => [],
445
+ propDecorators: { align: [{
446
+ type: i0.Input,
447
+ args: [{
448
+ isSignal: true,
449
+ alias: "align",
450
+ required: false
451
+ }]
452
+ }] }
453
+ });
454
+ var UiComboboxInput = class UiComboboxInput {
455
+ root = inject(UiCombobox);
456
+ onInput(e) {
457
+ this.root.search.set(e.target.value);
458
+ queueMicrotask(() => this.root.ensureHighlight());
459
+ }
460
+ onKeydown(e) {
461
+ switch (e.key) {
462
+ case "ArrowDown":
463
+ e.preventDefault();
464
+ return this.root.move(1);
465
+ case "ArrowUp":
466
+ e.preventDefault();
467
+ return this.root.move(-1);
468
+ case "Home":
469
+ e.preventDefault();
470
+ return this.root.move("first");
471
+ case "End":
472
+ e.preventDefault();
473
+ return this.root.move("last");
474
+ case "Enter":
475
+ e.preventDefault();
476
+ return this.root.chooseHighlighted();
477
+ }
478
+ }
479
+ static ɵfac = i0.ɵɵngDeclareFactory({
480
+ minVersion: "12.0.0",
481
+ version: "22.2.2",
482
+ ngImport: i0,
483
+ type: UiComboboxInput,
484
+ deps: [],
485
+ target: i0.ɵɵFactoryTarget.Directive
486
+ });
487
+ static ɵdir = i0.ɵɵngDeclareDirective({
488
+ minVersion: "14.0.0",
489
+ version: "22.2.2",
490
+ type: UiComboboxInput,
491
+ isStandalone: true,
492
+ selector: "input[uiComboboxInput]",
493
+ host: {
494
+ attributes: {
495
+ "data-slot": "combobox-input",
496
+ "type": "text",
497
+ "role": "combobox",
498
+ "autocomplete": "off",
499
+ "spellcheck": "false",
500
+ "aria-autocomplete": "list",
501
+ "aria-expanded": "true"
502
+ },
503
+ listeners: {
504
+ "input": "onInput($event)",
505
+ "keydown": "onKeydown($event)"
506
+ },
507
+ properties: {
508
+ "attr.aria-controls": "root.listId",
509
+ "attr.aria-activedescendant": "root.highlighted()"
510
+ },
511
+ classAttribute: "w-full border-b border-input bg-transparent px-3 py-2 text-sm outline-hidden placeholder:text-muted-foreground"
512
+ },
513
+ ngImport: i0
514
+ });
515
+ };
516
+ i0.ɵɵngDeclareClassMetadata({
517
+ minVersion: "12.0.0",
518
+ version: "22.2.2",
519
+ ngImport: i0,
520
+ type: UiComboboxInput,
521
+ decorators: [{
522
+ type: Directive,
523
+ args: [{
524
+ selector: "input[uiComboboxInput]",
525
+ host: {
526
+ "data-slot": "combobox-input",
527
+ type: "text",
528
+ role: "combobox",
529
+ autocomplete: "off",
530
+ spellcheck: "false",
531
+ "aria-autocomplete": "list",
532
+ "aria-expanded": "true",
533
+ "[attr.aria-controls]": "root.listId",
534
+ "[attr.aria-activedescendant]": "root.highlighted()",
535
+ class: "w-full border-b border-input bg-transparent px-3 py-2 text-sm outline-hidden placeholder:text-muted-foreground",
536
+ "(input)": "onInput($event)",
537
+ "(keydown)": "onKeydown($event)"
538
+ }
539
+ }]
540
+ }]
541
+ });
542
+ var UiComboboxList = class UiComboboxList {
543
+ root = inject(UiCombobox);
544
+ userClass = input("", {
545
+ ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
546
+ alias: "class"
547
+ });
548
+ classes = computed(() => cn(comboboxListClass, this.userClass()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
549
+ static ɵfac = i0.ɵɵngDeclareFactory({
550
+ minVersion: "12.0.0",
551
+ version: "22.2.2",
552
+ ngImport: i0,
553
+ type: UiComboboxList,
554
+ deps: [],
555
+ target: i0.ɵɵFactoryTarget.Directive
556
+ });
557
+ static ɵdir = i0.ɵɵngDeclareDirective({
558
+ minVersion: "17.1.0",
559
+ version: "22.2.2",
560
+ type: UiComboboxList,
561
+ isStandalone: true,
562
+ selector: "[uiComboboxList], ui-combobox-list",
563
+ inputs: { userClass: {
564
+ classPropertyName: "userClass",
565
+ publicName: "class",
566
+ isSignal: true,
567
+ isRequired: false,
568
+ transformFunction: null
569
+ } },
570
+ host: {
571
+ attributes: {
572
+ "role": "listbox",
573
+ "tabindex": "-1",
574
+ "aria-orientation": "vertical",
575
+ "data-slot": "combobox-list"
576
+ },
577
+ properties: {
578
+ "id": "root.listId",
579
+ "attr.class": "classes()"
580
+ }
581
+ },
582
+ hostDirectives: [{ directive: i1.UiElementHost }],
583
+ ngImport: i0
584
+ });
585
+ };
586
+ i0.ɵɵngDeclareClassMetadata({
587
+ minVersion: "12.0.0",
588
+ version: "22.2.2",
589
+ ngImport: i0,
590
+ type: UiComboboxList,
591
+ decorators: [{
592
+ type: Directive,
593
+ args: [{
594
+ selector: "[uiComboboxList], ui-combobox-list",
595
+ hostDirectives: [UiElementHost],
596
+ host: {
597
+ role: "listbox",
598
+ tabindex: "-1",
599
+ "aria-orientation": "vertical",
600
+ "data-slot": "combobox-list",
601
+ "[id]": "root.listId",
602
+ "[attr.class]": "classes()"
603
+ }
604
+ }]
605
+ }],
606
+ propDecorators: { userClass: [{
607
+ type: i0.Input,
608
+ args: [{
609
+ isSignal: true,
610
+ alias: "class",
611
+ required: false
612
+ }]
613
+ }] }
614
+ });
615
+ var UiComboboxEmpty = class UiComboboxEmpty {
616
+ root = inject(UiCombobox);
617
+ userClass = input("", {
618
+ ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
619
+ alias: "class"
620
+ });
621
+ classes = computed(() => cn(comboboxEmptyClass, "flex", this.userClass()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
622
+ static ɵfac = i0.ɵɵngDeclareFactory({
623
+ minVersion: "12.0.0",
624
+ version: "22.2.2",
625
+ ngImport: i0,
626
+ type: UiComboboxEmpty,
627
+ deps: [],
628
+ target: i0.ɵɵFactoryTarget.Directive
629
+ });
630
+ static ɵdir = i0.ɵɵngDeclareDirective({
631
+ minVersion: "17.1.0",
632
+ version: "22.2.2",
633
+ type: UiComboboxEmpty,
634
+ isStandalone: true,
635
+ selector: "[uiComboboxEmpty], ui-combobox-empty",
636
+ inputs: { userClass: {
637
+ classPropertyName: "userClass",
638
+ publicName: "class",
639
+ isSignal: true,
640
+ isRequired: false,
641
+ transformFunction: null
642
+ } },
643
+ host: {
644
+ attributes: {
645
+ "role": "status",
646
+ "aria-live": "polite",
647
+ "aria-atomic": "true",
648
+ "data-slot": "combobox-empty"
649
+ },
650
+ properties: {
651
+ "hidden": "root.hasResults()",
652
+ "attr.class": "classes()"
653
+ }
654
+ },
655
+ hostDirectives: [{ directive: i1.UiElementHost }],
656
+ ngImport: i0
657
+ });
658
+ };
659
+ i0.ɵɵngDeclareClassMetadata({
660
+ minVersion: "12.0.0",
661
+ version: "22.2.2",
662
+ ngImport: i0,
663
+ type: UiComboboxEmpty,
664
+ decorators: [{
665
+ type: Directive,
666
+ args: [{
667
+ selector: "[uiComboboxEmpty], ui-combobox-empty",
668
+ hostDirectives: [UiElementHost],
669
+ host: {
670
+ role: "status",
671
+ "aria-live": "polite",
672
+ "aria-atomic": "true",
673
+ "data-slot": "combobox-empty",
674
+ "[hidden]": "root.hasResults()",
675
+ "[attr.class]": "classes()"
676
+ }
677
+ }]
678
+ }],
679
+ propDecorators: { userClass: [{
680
+ type: i0.Input,
681
+ args: [{
682
+ isSignal: true,
683
+ alias: "class",
684
+ required: false
685
+ }]
686
+ }] }
687
+ });
688
+ var UiComboboxItem = class UiComboboxItem {
689
+ root = inject(UiCombobox);
690
+ el = inject(ElementRef).nativeElement;
691
+ id = nextId("ui-combobox-item");
692
+ value = input("", ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
693
+ disabledInput = input(false, {
694
+ ...ngDevMode ? { debugName: "disabledInput" } : /* istanbul ignore next */ {},
695
+ alias: "disabled",
696
+ transform: booleanAttribute
697
+ });
698
+ userClass = input("", {
699
+ ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
700
+ alias: "class"
701
+ });
702
+ label = signal("", ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
703
+ get disabled() {
704
+ return this.disabledInput();
705
+ }
706
+ selected = computed(() => this.root.value() === this.value(), ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
707
+ highlighted = computed(() => this.root.highlighted() === this.id, ...ngDevMode ? [{ debugName: "highlighted" }] : /* istanbul ignore next */ []);
708
+ visible = computed(() => {
709
+ const q = this.root.search().trim().toLowerCase();
710
+ return !q || (this.label() || this.value()).toLowerCase().includes(q);
711
+ }, ...ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []);
712
+ classes = computed(() => cn(comboboxItemClass, this.userClass()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
713
+ constructor() {
714
+ effect(() => {
715
+ this.value();
716
+ queueMicrotask(() => this.label.set((this.el.querySelector("span")?.textContent ?? "").trim()));
717
+ });
718
+ }
719
+ activate() {
720
+ if (!this.disabled) this.root.choose(this.value());
721
+ }
722
+ scrollIntoView() {
723
+ this.el.scrollIntoView({ block: "nearest" });
724
+ }
725
+ onMove() {
726
+ if (!this.disabled && this.root.highlighted() !== this.id) this.root.highlighted.set(this.id);
727
+ }
728
+ static ɵfac = i0.ɵɵngDeclareFactory({
729
+ minVersion: "12.0.0",
730
+ version: "22.2.2",
731
+ ngImport: i0,
732
+ type: UiComboboxItem,
733
+ deps: [],
734
+ target: i0.ɵɵFactoryTarget.Component
735
+ });
736
+ static ɵcmp = i0.ɵɵngDeclareComponent({
737
+ minVersion: "17.0.0",
738
+ version: "22.2.2",
739
+ type: UiComboboxItem,
740
+ isStandalone: true,
741
+ selector: "[uiComboboxItem], ui-combobox-item",
742
+ inputs: {
743
+ value: {
744
+ classPropertyName: "value",
745
+ publicName: "value",
746
+ isSignal: true,
747
+ isRequired: false,
748
+ transformFunction: null
749
+ },
750
+ disabledInput: {
751
+ classPropertyName: "disabledInput",
752
+ publicName: "disabled",
753
+ isSignal: true,
754
+ isRequired: false,
755
+ transformFunction: null
756
+ },
757
+ userClass: {
758
+ classPropertyName: "userClass",
759
+ publicName: "class",
760
+ isSignal: true,
761
+ isRequired: false,
762
+ transformFunction: null
763
+ }
764
+ },
765
+ host: {
766
+ attributes: {
767
+ "role": "option",
768
+ "data-slot": "combobox-item"
769
+ },
770
+ listeners: {
771
+ "click": "activate()",
772
+ "pointermove": "onMove()"
773
+ },
774
+ properties: {
775
+ "id": "id",
776
+ "attr.aria-selected": "selected()",
777
+ "attr.data-highlighted": "highlighted() ? \"\" : null",
778
+ "attr.data-disabled": "disabled ? \"\" : null",
779
+ "attr.aria-disabled": "disabled ? \"true\" : null",
780
+ "hidden": "!visible()",
781
+ "attr.class": "classes()"
782
+ }
783
+ },
784
+ hostDirectives: [{ directive: i1.UiElementHost }],
785
+ ngImport: i0,
786
+ template: `
787
+ <span><ng-content /></span>
788
+ <span class="pointer-events-none absolute end-2 flex size-4 items-center justify-center">
789
+ @if (selected()) {
790
+ <svg uiIcon="check"></svg>
791
+ }
792
+ </span>
793
+ `,
794
+ isInline: true,
795
+ dependencies: [{
796
+ kind: "directive",
797
+ type: UiIconSvg,
798
+ selector: "svg[uiIcon]",
799
+ inputs: [
800
+ "uiIcon",
801
+ "icon",
802
+ "size",
803
+ "strokeWidth",
804
+ "absoluteStrokeWidth",
805
+ "color",
806
+ "label",
807
+ "class"
808
+ ]
809
+ }],
810
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
811
+ });
812
+ };
813
+ i0.ɵɵngDeclareClassMetadata({
814
+ minVersion: "12.0.0",
815
+ version: "22.2.2",
816
+ ngImport: i0,
817
+ type: UiComboboxItem,
818
+ decorators: [{
819
+ type: Component,
820
+ args: [{
821
+ selector: "[uiComboboxItem], ui-combobox-item",
822
+ hostDirectives: [UiElementHost],
823
+ imports: [UiIconSvg],
824
+ changeDetection: ChangeDetectionStrategy.OnPush,
825
+ host: {
826
+ role: "option",
827
+ "data-slot": "combobox-item",
828
+ "[id]": "id",
829
+ "[attr.aria-selected]": "selected()",
830
+ "[attr.data-highlighted]": "highlighted() ? \"\" : null",
831
+ "[attr.data-disabled]": "disabled ? \"\" : null",
832
+ "[attr.aria-disabled]": "disabled ? \"true\" : null",
833
+ "[hidden]": "!visible()",
834
+ "[attr.class]": "classes()",
835
+ "(click)": "activate()",
836
+ "(pointermove)": "onMove()"
837
+ },
838
+ template: `
839
+ <span><ng-content /></span>
840
+ <span class="pointer-events-none absolute end-2 flex size-4 items-center justify-center">
841
+ @if (selected()) {
842
+ <svg uiIcon="check"></svg>
843
+ }
844
+ </span>
845
+ `
846
+ }]
847
+ }],
848
+ ctorParameters: () => [],
849
+ propDecorators: {
850
+ value: [{
851
+ type: i0.Input,
852
+ args: [{
853
+ isSignal: true,
854
+ alias: "value",
855
+ required: false
856
+ }]
857
+ }],
858
+ disabledInput: [{
859
+ type: i0.Input,
860
+ args: [{
861
+ isSignal: true,
862
+ alias: "disabled",
863
+ required: false
864
+ }]
865
+ }],
866
+ userClass: [{
867
+ type: i0.Input,
868
+ args: [{
869
+ isSignal: true,
870
+ alias: "class",
871
+ required: false
872
+ }]
873
+ }]
874
+ }
875
+ });
876
+ var UiComboboxInputElement = class UiComboboxInputElement {
877
+ placeholder = input("", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
878
+ ariaLabel = input("", {
879
+ ...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
880
+ alias: "aria-label"
881
+ });
882
+ static ɵfac = i0.ɵɵngDeclareFactory({
883
+ minVersion: "12.0.0",
884
+ version: "22.2.2",
885
+ ngImport: i0,
886
+ type: UiComboboxInputElement,
887
+ deps: [],
888
+ target: i0.ɵɵFactoryTarget.Component
889
+ });
890
+ static ɵcmp = i0.ɵɵngDeclareComponent({
891
+ minVersion: "17.1.0",
892
+ version: "22.2.2",
893
+ type: UiComboboxInputElement,
894
+ isStandalone: true,
895
+ selector: "ui-combobox-input",
896
+ inputs: {
897
+ placeholder: {
898
+ classPropertyName: "placeholder",
899
+ publicName: "placeholder",
900
+ isSignal: true,
901
+ isRequired: false,
902
+ transformFunction: null
903
+ },
904
+ ariaLabel: {
905
+ classPropertyName: "ariaLabel",
906
+ publicName: "aria-label",
907
+ isSignal: true,
908
+ isRequired: false,
909
+ transformFunction: null
910
+ }
911
+ },
912
+ host: { classAttribute: "contents" },
913
+ ngImport: i0,
914
+ template: `<input uiComboboxInput [attr.placeholder]="placeholder() || null" [attr.aria-label]="ariaLabel() || null" />`,
915
+ isInline: true,
916
+ dependencies: [{
917
+ kind: "directive",
918
+ type: UiComboboxInput,
919
+ selector: "input[uiComboboxInput]"
920
+ }],
921
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
922
+ });
923
+ };
924
+ i0.ɵɵngDeclareClassMetadata({
925
+ minVersion: "12.0.0",
926
+ version: "22.2.2",
927
+ ngImport: i0,
928
+ type: UiComboboxInputElement,
929
+ decorators: [{
930
+ type: Component,
931
+ args: [{
932
+ selector: "ui-combobox-input",
933
+ imports: [UiComboboxInput],
934
+ changeDetection: ChangeDetectionStrategy.OnPush,
935
+ host: { class: "contents" },
936
+ template: `<input uiComboboxInput [attr.placeholder]="placeholder() || null" [attr.aria-label]="ariaLabel() || null" />`
937
+ }]
938
+ }],
939
+ propDecorators: {
940
+ placeholder: [{
941
+ type: i0.Input,
942
+ args: [{
943
+ isSignal: true,
944
+ alias: "placeholder",
945
+ required: false
946
+ }]
947
+ }],
948
+ ariaLabel: [{
949
+ type: i0.Input,
950
+ args: [{
951
+ isSignal: true,
952
+ alias: "aria-label",
953
+ required: false
954
+ }]
955
+ }]
956
+ }
957
+ });
958
+ const UI_COMBOBOX = [
959
+ UiCombobox,
960
+ UiComboboxTrigger,
961
+ UiComboboxValue,
962
+ UiComboboxContent,
963
+ UiComboboxInput,
964
+ UiComboboxList,
965
+ UiComboboxEmpty,
966
+ UiComboboxItem,
967
+ UiComboboxInputElement
968
+ ];
969
+ export { UI_COMBOBOX, UI_COMBOBOX_GENERATED, UiCombobox, UiComboboxContent, UiComboboxEmpty, UiComboboxInput, UiComboboxInputElement, UiComboboxItem, UiComboboxList, UiComboboxTrigger, UiComboboxValue, comboboxChipClass, comboboxChipInputClass, comboboxChipsClass, comboboxClearClass, comboboxContentClass, comboboxEmptyClass, comboboxItemClass, comboboxListClass, comboboxTriggerClass };
970
+
971
+ //# sourceMappingURL=loomui-ng-ui-combobox.mjs.map