@egose/shadcn-theme-ng 0.0.26 → 0.0.28

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 (333) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +107 -2
  3. package/accordion/fesm2022/accordion.mjs +42 -37
  4. package/accordion/fesm2022/accordion.mjs.map +1 -1
  5. package/accordion/package.json +25 -0
  6. package/accordion/{index.d.ts → types/accordion.d.ts} +1 -1
  7. package/alert/fesm2022/alert.mjs +32 -27
  8. package/alert/fesm2022/alert.mjs.map +1 -1
  9. package/alert/package.json +25 -0
  10. package/alert-dialog/README.md +11 -0
  11. package/alert-dialog/fesm2022/alert-dialog.mjs +287 -0
  12. package/alert-dialog/fesm2022/alert-dialog.mjs.map +1 -0
  13. package/alert-dialog/package.json +25 -0
  14. package/alert-dialog/types/alert-dialog.d.ts +90 -0
  15. package/aspect-ratio/README.md +11 -0
  16. package/aspect-ratio/fesm2022/aspect-ratio.mjs +62 -0
  17. package/aspect-ratio/fesm2022/aspect-ratio.mjs.map +1 -0
  18. package/aspect-ratio/package.json +25 -0
  19. package/aspect-ratio/types/aspect-ratio.d.ts +21 -0
  20. package/autocomplete/fesm2022/autocomplete.mjs +323 -457
  21. package/autocomplete/fesm2022/autocomplete.mjs.map +1 -1
  22. package/autocomplete/package.json +24 -0
  23. package/autocomplete/types/autocomplete.d.ts +96 -0
  24. package/avatar/README.md +11 -0
  25. package/avatar/fesm2022/avatar.mjs +178 -0
  26. package/avatar/fesm2022/avatar.mjs.map +1 -0
  27. package/avatar/package.json +25 -0
  28. package/avatar/types/avatar.d.ts +50 -0
  29. package/badge/fesm2022/badge.mjs +16 -10
  30. package/badge/fesm2022/badge.mjs.map +1 -1
  31. package/badge/package.json +25 -0
  32. package/basic-alert/fesm2022/basic-alert.mjs +12 -8
  33. package/basic-alert/fesm2022/basic-alert.mjs.map +1 -1
  34. package/basic-alert/package.json +24 -0
  35. package/breadcrumb/README.md +11 -0
  36. package/breadcrumb/fesm2022/breadcrumb.mjs +224 -0
  37. package/breadcrumb/fesm2022/breadcrumb.mjs.map +1 -0
  38. package/breadcrumb/package.json +25 -0
  39. package/breadcrumb/types/breadcrumb.d.ts +57 -0
  40. package/button/fesm2022/button.mjs +100 -26
  41. package/button/fesm2022/button.mjs.map +1 -1
  42. package/button/package.json +25 -0
  43. package/button/{index.d.ts → types/button.d.ts} +30 -9
  44. package/button-group/README.md +11 -0
  45. package/button-group/fesm2022/button-group.mjs +102 -0
  46. package/button-group/fesm2022/button-group.mjs.map +1 -0
  47. package/button-group/package.json +25 -0
  48. package/button-group/types/button-group.d.ts +30 -0
  49. package/calendar/fesm2022/calendar.mjs +868 -546
  50. package/calendar/fesm2022/calendar.mjs.map +1 -1
  51. package/calendar/package.json +24 -0
  52. package/calendar/types/calendar.d.ts +94 -0
  53. package/card/README.md +11 -0
  54. package/card/fesm2022/card.mjs +169 -0
  55. package/card/fesm2022/card.mjs.map +1 -0
  56. package/card/package.json +25 -0
  57. package/card/types/card.d.ts +54 -0
  58. package/carousel/README.md +11 -0
  59. package/carousel/fesm2022/carousel.mjs +309 -0
  60. package/carousel/fesm2022/carousel.mjs.map +1 -0
  61. package/carousel/package.json +25 -0
  62. package/carousel/types/carousel.d.ts +84 -0
  63. package/checkbox/fesm2022/checkbox.mjs +25 -20
  64. package/checkbox/fesm2022/checkbox.mjs.map +1 -1
  65. package/checkbox/package.json +24 -0
  66. package/collapsible/README.md +11 -0
  67. package/collapsible/fesm2022/collapsible.mjs +77 -0
  68. package/collapsible/fesm2022/collapsible.mjs.map +1 -0
  69. package/collapsible/package.json +25 -0
  70. package/collapsible/types/collapsible.d.ts +27 -0
  71. package/combobox/README.md +11 -0
  72. package/combobox/fesm2022/combobox.mjs +683 -0
  73. package/combobox/fesm2022/combobox.mjs.map +1 -0
  74. package/combobox/package.json +25 -0
  75. package/combobox/types/combobox.d.ts +151 -0
  76. package/command/README.md +11 -0
  77. package/command/fesm2022/command.mjs +361 -0
  78. package/command/fesm2022/command.mjs.map +1 -0
  79. package/command/package.json +25 -0
  80. package/command/types/command.d.ts +89 -0
  81. package/confirmation-dialog/fesm2022/confirmation-dialog.mjs +19 -8
  82. package/confirmation-dialog/fesm2022/confirmation-dialog.mjs.map +1 -1
  83. package/confirmation-dialog/package.json +24 -0
  84. package/context-menu/README.md +11 -0
  85. package/context-menu/fesm2022/context-menu.mjs +89 -0
  86. package/context-menu/fesm2022/context-menu.mjs.map +1 -0
  87. package/context-menu/package.json +25 -0
  88. package/context-menu/types/context-menu.d.ts +34 -0
  89. package/date-picker/fesm2022/date-picker.mjs +1262 -307
  90. package/date-picker/fesm2022/date-picker.mjs.map +1 -1
  91. package/date-picker/package.json +24 -0
  92. package/date-picker/types/date-picker.d.ts +551 -0
  93. package/dialog/fesm2022/dialog.mjs +137 -108
  94. package/dialog/fesm2022/dialog.mjs.map +1 -1
  95. package/dialog/package.json +24 -0
  96. package/dialog/types/dialog.d.ts +95 -0
  97. package/drawer/README.md +11 -0
  98. package/drawer/fesm2022/drawer.mjs +271 -0
  99. package/drawer/fesm2022/drawer.mjs.map +1 -0
  100. package/drawer/package.json +25 -0
  101. package/drawer/types/drawer.d.ts +76 -0
  102. package/dropdown-menu/README.md +11 -0
  103. package/dropdown-menu/fesm2022/dropdown-menu.mjs +542 -0
  104. package/dropdown-menu/fesm2022/dropdown-menu.mjs.map +1 -0
  105. package/dropdown-menu/package.json +25 -0
  106. package/dropdown-menu/types/dropdown-menu.d.ts +176 -0
  107. package/empty/README.md +11 -0
  108. package/empty/fesm2022/empty.mjs +151 -0
  109. package/empty/fesm2022/empty.mjs.map +1 -0
  110. package/empty/package.json +25 -0
  111. package/empty/types/empty.d.ts +54 -0
  112. package/field/README.md +11 -0
  113. package/field/fesm2022/field.mjs +367 -0
  114. package/field/fesm2022/field.mjs.map +1 -0
  115. package/field/package.json +25 -0
  116. package/field/types/field.d.ts +107 -0
  117. package/form-checkbox/fesm2022/form-checkbox.mjs +39 -22
  118. package/form-checkbox/fesm2022/form-checkbox.mjs.map +1 -1
  119. package/form-checkbox/package.json +24 -0
  120. package/form-date-picker/fesm2022/form-date-picker.mjs +58 -51
  121. package/form-date-picker/fesm2022/form-date-picker.mjs.map +1 -1
  122. package/form-date-picker/package.json +24 -0
  123. package/form-field/fesm2022/form-field.mjs +39 -27
  124. package/form-field/fesm2022/form-field.mjs.map +1 -1
  125. package/form-field/package.json +25 -0
  126. package/form-field/{index.d.ts → types/form-field.d.ts} +4 -3
  127. package/form-field-simple/fesm2022/form-field-simple.mjs +15 -10
  128. package/form-field-simple/fesm2022/form-field-simple.mjs.map +1 -1
  129. package/form-field-simple/package.json +24 -0
  130. package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs +44 -25
  131. package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs.map +1 -1
  132. package/form-searchable-multiselect/package.json +24 -0
  133. package/form-select/fesm2022/form-select.mjs +132 -71
  134. package/form-select/fesm2022/form-select.mjs.map +1 -1
  135. package/form-select/package.json +24 -0
  136. package/form-text-input/fesm2022/form-text-input.mjs +68 -39
  137. package/form-text-input/fesm2022/form-text-input.mjs.map +1 -1
  138. package/form-text-input/package.json +24 -0
  139. package/form-textarea/fesm2022/form-textarea.mjs +54 -30
  140. package/form-textarea/fesm2022/form-textarea.mjs.map +1 -1
  141. package/form-textarea/package.json +24 -0
  142. package/hover-card/README.md +11 -0
  143. package/hover-card/fesm2022/hover-card.mjs +123 -0
  144. package/hover-card/fesm2022/hover-card.mjs.map +1 -0
  145. package/hover-card/package.json +25 -0
  146. package/hover-card/types/hover-card.d.ts +36 -0
  147. package/icon/fesm2022/icon.mjs +12 -10
  148. package/icon/fesm2022/icon.mjs.map +1 -1
  149. package/icon/package.json +25 -0
  150. package/input/fesm2022/input.mjs +20 -70
  151. package/input/fesm2022/input.mjs.map +1 -1
  152. package/input/package.json +25 -0
  153. package/input/types/input.d.ts +18 -0
  154. package/input-group/README.md +11 -0
  155. package/input-group/fesm2022/input-group.mjs +199 -0
  156. package/input-group/fesm2022/input-group.mjs.map +1 -0
  157. package/input-group/package.json +25 -0
  158. package/input-group/types/input-group.d.ts +52 -0
  159. package/input-otp/README.md +11 -0
  160. package/input-otp/fesm2022/input-otp.mjs +141 -0
  161. package/input-otp/fesm2022/input-otp.mjs.map +1 -0
  162. package/input-otp/package.json +25 -0
  163. package/input-otp/types/input-otp.d.ts +43 -0
  164. package/item/README.md +11 -0
  165. package/item/fesm2022/item.mjs +278 -0
  166. package/item/fesm2022/item.mjs.map +1 -0
  167. package/item/package.json +25 -0
  168. package/item/types/item.d.ts +101 -0
  169. package/kbd/README.md +11 -0
  170. package/kbd/fesm2022/kbd.mjs +61 -0
  171. package/kbd/fesm2022/kbd.mjs.map +1 -0
  172. package/kbd/package.json +25 -0
  173. package/kbd/types/kbd.d.ts +22 -0
  174. package/label/fesm2022/label.mjs +11 -10
  175. package/label/fesm2022/label.mjs.map +1 -1
  176. package/label/package.json +25 -0
  177. package/layout-simple/fesm2022/layout-simple.mjs +438 -325
  178. package/layout-simple/fesm2022/layout-simple.mjs.map +1 -1
  179. package/layout-simple/package.json +24 -0
  180. package/layout-simple/{index.d.ts → types/layout-simple.d.ts} +28 -17
  181. package/menubar/README.md +11 -0
  182. package/menubar/fesm2022/menubar.mjs +108 -0
  183. package/menubar/fesm2022/menubar.mjs.map +1 -0
  184. package/menubar/package.json +25 -0
  185. package/menubar/types/menubar.d.ts +40 -0
  186. package/native-select/README.md +11 -0
  187. package/native-select/fesm2022/native-select.mjs +207 -0
  188. package/native-select/fesm2022/native-select.mjs.map +1 -0
  189. package/native-select/package.json +25 -0
  190. package/native-select/types/native-select.d.ts +70 -0
  191. package/navigation-menu/README.md +11 -0
  192. package/navigation-menu/fesm2022/navigation-menu.mjs +206 -0
  193. package/navigation-menu/fesm2022/navigation-menu.mjs.map +1 -0
  194. package/navigation-menu/package.json +25 -0
  195. package/navigation-menu/types/navigation-menu.d.ts +54 -0
  196. package/package.json +223 -81
  197. package/pagination/README.md +11 -0
  198. package/pagination/fesm2022/pagination.mjs +808 -0
  199. package/pagination/fesm2022/pagination.mjs.map +1 -0
  200. package/pagination/package.json +25 -0
  201. package/pagination/types/pagination.d.ts +192 -0
  202. package/popover/fesm2022/popover.mjs +121 -27
  203. package/popover/fesm2022/popover.mjs.map +1 -1
  204. package/popover/package.json +24 -0
  205. package/popover/types/popover.d.ts +54 -0
  206. package/progress/README.md +11 -0
  207. package/progress/fesm2022/progress.mjs +77 -0
  208. package/progress/fesm2022/progress.mjs.map +1 -0
  209. package/progress/package.json +25 -0
  210. package/progress/types/progress.d.ts +27 -0
  211. package/radio-group/fesm2022/radio-group.mjs +96 -62
  212. package/radio-group/fesm2022/radio-group.mjs.map +1 -1
  213. package/radio-group/package.json +25 -0
  214. package/radio-group/{index.d.ts → types/radio-group.d.ts} +22 -14
  215. package/resizable/README.md +11 -0
  216. package/resizable/fesm2022/resizable.mjs +111 -0
  217. package/resizable/fesm2022/resizable.mjs.map +1 -0
  218. package/resizable/package.json +25 -0
  219. package/resizable/types/resizable.d.ts +32 -0
  220. package/scroll-area/README.md +11 -0
  221. package/scroll-area/fesm2022/scroll-area.mjs +51 -0
  222. package/scroll-area/fesm2022/scroll-area.mjs.map +1 -0
  223. package/scroll-area/package.json +25 -0
  224. package/scroll-area/types/scroll-area.d.ts +16 -0
  225. package/searchable-multiselect/fesm2022/searchable-multiselect.mjs +92 -88
  226. package/searchable-multiselect/fesm2022/searchable-multiselect.mjs.map +1 -1
  227. package/searchable-multiselect/package.json +24 -0
  228. package/searchable-multiselect/{index.d.ts → types/searchable-multiselect.d.ts} +13 -24
  229. package/select/fesm2022/select.mjs +371 -189
  230. package/select/fesm2022/select.mjs.map +1 -1
  231. package/select/package.json +25 -0
  232. package/select/types/select.d.ts +119 -0
  233. package/separator/fesm2022/separator.mjs +16 -14
  234. package/separator/fesm2022/separator.mjs.map +1 -1
  235. package/separator/package.json +24 -0
  236. package/separator/{index.d.ts → types/separator.d.ts} +4 -5
  237. package/sheet/fesm2022/sheet.mjs +57 -51
  238. package/sheet/fesm2022/sheet.mjs.map +1 -1
  239. package/sheet/package.json +24 -0
  240. package/sidebar/README.md +11 -0
  241. package/sidebar/fesm2022/sidebar.mjs +948 -0
  242. package/sidebar/fesm2022/sidebar.mjs.map +1 -0
  243. package/sidebar/package.json +25 -0
  244. package/sidebar/types/sidebar.d.ts +237 -0
  245. package/skeleton/README.md +11 -0
  246. package/skeleton/fesm2022/skeleton.mjs +44 -0
  247. package/skeleton/fesm2022/skeleton.mjs.map +1 -0
  248. package/skeleton/package.json +25 -0
  249. package/skeleton/types/skeleton.d.ts +16 -0
  250. package/slider/README.md +11 -0
  251. package/slider/fesm2022/slider.mjs +144 -0
  252. package/slider/fesm2022/slider.mjs.map +1 -0
  253. package/slider/package.json +25 -0
  254. package/slider/types/slider.d.ts +19 -0
  255. package/sonner/fesm2022/sonner.mjs +30 -35
  256. package/sonner/fesm2022/sonner.mjs.map +1 -1
  257. package/sonner/package.json +25 -0
  258. package/spinner/fesm2022/spinner.mjs +18 -14
  259. package/spinner/fesm2022/spinner.mjs.map +1 -1
  260. package/spinner/package.json +25 -0
  261. package/switch/fesm2022/switch.mjs +29 -26
  262. package/switch/fesm2022/switch.mjs.map +1 -1
  263. package/switch/package.json +25 -0
  264. package/table/README.md +11 -0
  265. package/table/fesm2022/table.mjs +211 -0
  266. package/table/fesm2022/table.mjs.map +1 -0
  267. package/table/package.json +25 -0
  268. package/table/types/table.d.ts +87 -0
  269. package/tabs/fesm2022/tabs.mjs +131 -103
  270. package/tabs/fesm2022/tabs.mjs.map +1 -1
  271. package/tabs/package.json +25 -0
  272. package/tabs/types/tabs.d.ts +71 -0
  273. package/textarea/README.md +11 -0
  274. package/textarea/fesm2022/textarea.mjs +47 -0
  275. package/textarea/fesm2022/textarea.mjs.map +1 -0
  276. package/textarea/package.json +25 -0
  277. package/textarea/types/textarea.d.ts +18 -0
  278. package/toggle/README.md +11 -0
  279. package/toggle/fesm2022/toggle.mjs +78 -0
  280. package/toggle/fesm2022/toggle.mjs.map +1 -0
  281. package/toggle/package.json +25 -0
  282. package/toggle/types/toggle.d.ts +27 -0
  283. package/toggle-group/README.md +11 -0
  284. package/toggle-group/fesm2022/toggle-group.mjs +117 -0
  285. package/toggle-group/fesm2022/toggle-group.mjs.map +1 -0
  286. package/toggle-group/package.json +25 -0
  287. package/toggle-group/types/toggle-group.d.ts +39 -0
  288. package/tooltip/fesm2022/tooltip.mjs +33 -54
  289. package/tooltip/fesm2022/tooltip.mjs.map +1 -1
  290. package/tooltip/package.json +25 -0
  291. package/tooltip/types/tooltip.d.ts +22 -0
  292. package/typography/README.md +11 -0
  293. package/typography/fesm2022/typography.mjs +242 -0
  294. package/typography/fesm2022/typography.mjs.map +1 -0
  295. package/typography/package.json +25 -0
  296. package/typography/types/typography.d.ts +94 -0
  297. package/utils/fesm2022/utils.mjs +184 -1
  298. package/utils/fesm2022/utils.mjs.map +1 -1
  299. package/utils/package.json +25 -0
  300. package/utils/types/utils.d.ts +13 -0
  301. package/autocomplete/index.d.ts +0 -162
  302. package/calendar/index.d.ts +0 -111
  303. package/date-picker/index.d.ts +0 -227
  304. package/dialog/index.d.ts +0 -89
  305. package/exports.json +0 -1
  306. package/input/index.d.ts +0 -41
  307. package/menu/README.md +0 -64
  308. package/menu/fesm2022/menu.mjs +0 -449
  309. package/menu/fesm2022/menu.mjs.map +0 -1
  310. package/menu/index.d.ts +0 -137
  311. package/popover/index.d.ts +0 -30
  312. package/select/index.d.ts +0 -92
  313. package/tabs/index.d.ts +0 -71
  314. package/tooltip/index.d.ts +0 -21
  315. package/utils/index.d.ts +0 -5
  316. /package/alert/{index.d.ts → types/alert.d.ts} +0 -0
  317. /package/badge/{index.d.ts → types/badge.d.ts} +0 -0
  318. /package/basic-alert/{index.d.ts → types/basic-alert.d.ts} +0 -0
  319. /package/checkbox/{index.d.ts → types/checkbox.d.ts} +0 -0
  320. /package/confirmation-dialog/{index.d.ts → types/confirmation-dialog.d.ts} +0 -0
  321. /package/form-checkbox/{index.d.ts → types/form-checkbox.d.ts} +0 -0
  322. /package/form-date-picker/{index.d.ts → types/form-date-picker.d.ts} +0 -0
  323. /package/form-field-simple/{index.d.ts → types/form-field-simple.d.ts} +0 -0
  324. /package/form-searchable-multiselect/{index.d.ts → types/form-searchable-multiselect.d.ts} +0 -0
  325. /package/form-select/{index.d.ts → types/form-select.d.ts} +0 -0
  326. /package/form-text-input/{index.d.ts → types/form-text-input.d.ts} +0 -0
  327. /package/form-textarea/{index.d.ts → types/form-textarea.d.ts} +0 -0
  328. /package/icon/{index.d.ts → types/icon.d.ts} +0 -0
  329. /package/label/{index.d.ts → types/label.d.ts} +0 -0
  330. /package/sheet/{index.d.ts → types/sheet.d.ts} +0 -0
  331. /package/sonner/{index.d.ts → types/sonner.d.ts} +0 -0
  332. /package/spinner/{index.d.ts → types/spinner.d.ts} +0 -0
  333. /package/switch/{index.d.ts → types/switch.d.ts} +0 -0
@@ -1,533 +1,399 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, computed, Directive, ChangeDetectionStrategy, Component, inject, ElementRef, booleanAttribute, InjectionToken, forwardRef, viewChild, linkedSignal, output, NgModule } from '@angular/core';
3
- import { NgTemplateOutlet } from '@angular/common';
4
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
5
- import { NgIcon, provideIcons } from '@ng-icons/core';
6
- import { lucideChevronDown, lucideSearch } from '@ng-icons/lucide';
2
+ import { Directive, input, booleanAttribute, ChangeDetectionStrategy, Component, inject, NgModule } from '@angular/core';
7
3
  import * as i1 from '@spartan-ng/brain/autocomplete';
8
- import { BrnAutocompleteGroup, BrnAutocompleteItem, BrnAutocompleteList, BrnAutocompleteSearchInput, BrnAutocomplete, BrnAutocompleteEmpty } from '@spartan-ng/brain/autocomplete';
9
- import { BrnPopover, BrnPopoverContent } from '@spartan-ng/brain/popover';
10
- import { provideHlmIconConfig, HlmIcon } from '@egose/shadcn-theme-ng/icon';
11
- import { HlmPopoverContent } from '@egose/shadcn-theme-ng/popover';
12
- import { hlm } from '@egose/shadcn-theme-ng/utils';
13
- import { BrnDialog } from '@spartan-ng/brain/dialog';
4
+ import { BrnAutocomplete, BrnAutocompleteContent, BrnAutocompleteEmpty, BrnAutocompleteGroup, BrnAutocompleteClear, BrnAutocompleteInput, BrnAutocompleteAnchor, BrnAutocompleteItem, BrnAutocompleteLabel, BrnAutocompleteList, BrnAutocompleteSearch, BrnAutocompleteSeparator, BrnAutocompleteStatus } from '@spartan-ng/brain/autocomplete';
5
+ import * as i2 from '@spartan-ng/brain/popover';
6
+ import { provideBrnPopoverConfig, provideBrnPopoverDefaultOptions, BrnPopover, BrnPopoverContent } from '@spartan-ng/brain/popover';
7
+ import { classes } from '@egose/shadcn-theme-ng/utils';
8
+ import { NgIcon, provideIcons } from '@ng-icons/core';
9
+ import { lucideX, lucideSearch, lucideCheck } from '@ng-icons/lucide';
10
+ import * as i2$1 from '@egose/shadcn-theme-ng/input-group';
11
+ import { HlmInputGroup, HlmInputGroupImports } from '@egose/shadcn-theme-ng/input-group';
14
12
 
15
- class HlmAutocompleteEmpty {
16
- userClass = input('', ...(ngDevMode ? [{ debugName: "userClass", alias: 'class' }] : [{ alias: 'class' }]));
17
- _computedClass = computed(() => hlm('py-2 text-center text-sm', this.userClass()), ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
18
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmAutocompleteEmpty, deps: [], target: i0.ɵɵFactoryTarget.Directive });
19
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.1", type: HlmAutocompleteEmpty, isStandalone: true, selector: "[hlmAutocompleteEmpty]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, ngImport: i0 });
13
+ class HlmAutocomplete {
14
+ constructor() {
15
+ classes(() => 'block');
16
+ }
17
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocomplete, deps: [], target: i0.ɵɵFactoryTarget.Directive });
18
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: HlmAutocomplete, isStandalone: true, selector: "[hlmAutocomplete],hlm-autocomplete", host: { attributes: { "data-slot": "autocomplete" } }, providers: [
19
+ provideBrnPopoverConfig({
20
+ align: 'start',
21
+ sideOffset: 6,
22
+ }),
23
+ provideBrnPopoverDefaultOptions({ role: null }),
24
+ ], hostDirectives: [{ directive: i1.BrnAutocomplete, inputs: ["autoHighlight", "autoHighlight", "disabled", "disabled", "value", "value", "search", "search", "itemToString", "itemToString", "isItemEqualToValue", "isItemEqualToValue"], outputs: ["valueChange", "valueChange", "searchChange", "searchChange"] }, { directive: i2.BrnPopover, inputs: ["align", "align", "closeOnOutsidePointerEvents", "closeOnOutsidePointerEvents", "sideOffset", "sideOffset", "state", "state", "offsetX", "offsetX"], outputs: ["stateChanged", "stateChanged", "closed", "closed"] }], ngImport: i0 });
20
25
  }
21
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmAutocompleteEmpty, decorators: [{
26
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocomplete, decorators: [{
22
27
  type: Directive,
23
28
  args: [{
24
- selector: '[hlmAutocompleteEmpty]',
25
- host: {
26
- '[class]': '_computedClass()',
27
- },
28
- }]
29
- }] });
30
-
31
- class HlmAutocompleteGroup {
32
- /** The user defined class */
33
- userClass = input('', ...(ngDevMode ? [{ debugName: "userClass", alias: 'class' }] : [{ alias: 'class' }]));
34
- /** The styles to apply */
35
- _computedClass = computed(() => hlm('text-foreground block overflow-hidden p-1', this.userClass()), ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
36
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmAutocompleteGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
37
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.1", type: HlmAutocompleteGroup, isStandalone: true, selector: "hlm-autocomplete-group", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, hostDirectives: [{ directive: i1.BrnAutocompleteGroup, inputs: ["id", "id"] }], ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
38
- }
39
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmAutocompleteGroup, decorators: [{
40
- type: Component,
41
- args: [{
42
- selector: 'hlm-autocomplete-group',
43
- template: '<ng-content />',
44
- hostDirectives: [
45
- {
46
- directive: BrnAutocompleteGroup,
47
- inputs: ['id'],
48
- },
29
+ selector: '[hlmAutocomplete],hlm-autocomplete',
30
+ providers: [
31
+ provideBrnPopoverConfig({
32
+ align: 'start',
33
+ sideOffset: 6,
34
+ }),
35
+ provideBrnPopoverDefaultOptions({ role: null }),
49
36
  ],
50
- host: {
51
- '[class]': '_computedClass()',
52
- },
53
- changeDetection: ChangeDetectionStrategy.OnPush,
54
- }]
55
- }] });
56
-
57
- class HlmAutocompleteItem {
58
- /** The user defined class */
59
- userClass = input('', ...(ngDevMode ? [{ debugName: "userClass", alias: 'class' }] : [{ alias: 'class' }]));
60
- /** The styles to apply */
61
- _computedClass = computed(() => hlm('data-[selected]:bg-accent data-[selected]:text-accent-foreground [&>ng-icon]:text-muted-foreground outline-hidden relative flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[hidden]:hidden data-[disabled]:opacity-50 [&>ng-icon]:pointer-events-none [&>ng-icon]:shrink-0 [&>ng-icon]:text-base', this.userClass()), ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
62
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmAutocompleteItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
63
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.1", type: HlmAutocompleteItem, isStandalone: true, selector: "button[hlm-autocomplete-item]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, hostDirectives: [{ directive: i1.BrnAutocompleteItem, inputs: ["value", "value", "disabled", "disabled", "id", "id"], outputs: ["selected", "selected"] }], ngImport: i0, template: ` <ng-content /> `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
64
- }
65
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmAutocompleteItem, decorators: [{
66
- type: Component,
67
- args: [{
68
- selector: 'button[hlm-autocomplete-item]',
69
- template: ` <ng-content /> `,
70
37
  hostDirectives: [
71
38
  {
72
- directive: BrnAutocompleteItem,
73
- inputs: ['value', 'disabled', 'id'],
74
- outputs: ['selected'],
39
+ directive: BrnAutocomplete,
40
+ inputs: ['autoHighlight', 'disabled', 'value', 'search', 'itemToString', 'isItemEqualToValue'],
41
+ outputs: ['valueChange', 'searchChange'],
75
42
  },
76
- ],
77
- host: {
78
- '[class]': '_computedClass()',
79
- },
80
- changeDetection: ChangeDetectionStrategy.OnPush,
81
- }]
82
- }] });
83
-
84
- class HlmAutocompleteList {
85
- /** The user defined class */
86
- userClass = input('', ...(ngDevMode ? [{ debugName: "userClass", alias: 'class' }] : [{ alias: 'class' }]));
87
- /** The styles to apply */
88
- _computedClass = computed(() => hlm('block max-h-60 overflow-y-auto overflow-x-hidden', this.userClass()), ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
89
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmAutocompleteList, deps: [], target: i0.ɵɵFactoryTarget.Component });
90
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.1", type: HlmAutocompleteList, isStandalone: true, selector: "hlm-autocomplete-list", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, hostDirectives: [{ directive: i1.BrnAutocompleteList, inputs: ["id", "id"] }], ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
91
- }
92
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmAutocompleteList, decorators: [{
93
- type: Component,
94
- args: [{
95
- selector: 'hlm-autocomplete-list',
96
- template: '<ng-content />',
97
- host: {
98
- '[class]': '_computedClass()',
99
- },
100
- hostDirectives: [
101
43
  {
102
- directive: BrnAutocompleteList,
103
- inputs: ['id'],
44
+ directive: BrnPopover,
45
+ inputs: ['align', 'closeOnOutsidePointerEvents', 'sideOffset', 'state', 'offsetX'],
46
+ outputs: ['stateChanged', 'closed'],
104
47
  },
105
48
  ],
106
- changeDetection: ChangeDetectionStrategy.OnPush,
49
+ host: { 'data-slot': 'autocomplete' },
107
50
  }]
108
- }] });
51
+ }], ctorParameters: () => [] });
109
52
 
110
- class HlmAutocompleteSearch {
111
- /** The user defined class */
112
- userClass = input('', ...(ngDevMode ? [{ debugName: "userClass", alias: 'class' }] : [{ alias: 'class' }]));
113
- /** The styles to apply */
114
- _computedClass = computed(() => hlm('border-input focus-within:border-ring bg-background focus-within:ring-ring/50 shadow-xs dark:bg-input/10 flex h-9 min-w-0 items-center gap-2 rounded-md border px-3 focus-within:ring-[3px] [&>_ng-icon]:flex-none [&>_ng-icon]:opacity-50', this.userClass()), ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
115
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmAutocompleteSearch, deps: [], target: i0.ɵɵFactoryTarget.Component });
116
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.1", type: HlmAutocompleteSearch, isStandalone: true, selector: "hlm-autocomplete-search", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, providers: [provideHlmIconConfig({ size: 'sm' })], ngImport: i0, template: ` <ng-content /> `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
53
+ class HlmAutocompleteContent {
54
+ constructor() {
55
+ classes(() => 'bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-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 ring-foreground/10 max-h-72 min-w-36 overflow-hidden rounded-md shadow-md ring-1 duration-100 group/autocomplete-content flex w-(--brn-autocomplete-width) flex-col p-0');
56
+ }
57
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompleteContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
58
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: HlmAutocompleteContent, isStandalone: true, selector: "[hlmAutocompleteContent],hlm-autocomplete-content", hostDirectives: [{ directive: i1.BrnAutocompleteContent }], ngImport: i0 });
117
59
  }
118
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmAutocompleteSearch, decorators: [{
119
- type: Component,
60
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompleteContent, decorators: [{
61
+ type: Directive,
120
62
  args: [{
121
- selector: 'hlm-autocomplete-search',
122
- template: ` <ng-content /> `,
123
- host: {
124
- '[class]': '_computedClass()',
125
- },
126
- providers: [provideHlmIconConfig({ size: 'sm' })],
127
- changeDetection: ChangeDetectionStrategy.OnPush,
63
+ selector: '[hlmAutocompleteContent],hlm-autocomplete-content',
64
+ hostDirectives: [BrnAutocompleteContent],
128
65
  }]
129
- }] });
66
+ }], ctorParameters: () => [] });
130
67
 
131
- class HlmAutocompleteSearchInput {
132
- /** The user defined class */
133
- userClass = input('', ...(ngDevMode ? [{ debugName: "userClass", alias: 'class' }] : [{ alias: 'class' }]));
134
- /** The styles to apply */
135
- _computedClass = computed(() => hlm('placeholder:text-muted-foreground flex h-9 w-full bg-transparent py-1 text-base outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm', this.userClass()), ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
136
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmAutocompleteSearchInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
137
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.1", type: HlmAutocompleteSearchInput, isStandalone: true, selector: "input[hlm-autocomplete-search-input]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, hostDirectives: [{ directive: i1.BrnAutocompleteSearchInput, inputs: ["value", "value"] }], ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
68
+ class HlmAutocompleteEmpty {
69
+ constructor() {
70
+ classes(() => 'text-muted-foreground hidden w-full items-center justify-center gap-2 py-2 text-center text-sm group-data-empty/autocomplete-content:flex');
71
+ }
72
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompleteEmpty, deps: [], target: i0.ɵɵFactoryTarget.Directive });
73
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: HlmAutocompleteEmpty, isStandalone: true, selector: "[hlmAutocompleteEmpty],hlm-autocomplete-empty", host: { attributes: { "data-slot": "autocomplete-empty" } }, hostDirectives: [{ directive: i1.BrnAutocompleteEmpty }], ngImport: i0 });
138
74
  }
139
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmAutocompleteSearchInput, decorators: [{
140
- type: Component,
75
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompleteEmpty, decorators: [{
76
+ type: Directive,
141
77
  args: [{
142
- selector: 'input[hlm-autocomplete-search-input]',
143
- template: '',
144
- hostDirectives: [{ directive: BrnAutocompleteSearchInput, inputs: ['value'] }],
145
- host: {
146
- '[class]': '_computedClass()',
147
- },
148
- changeDetection: ChangeDetectionStrategy.OnPush,
78
+ selector: '[hlmAutocompleteEmpty],hlm-autocomplete-empty',
79
+ hostDirectives: [BrnAutocompleteEmpty],
80
+ host: { 'data-slot': 'autocomplete-empty' },
149
81
  }]
150
- }] });
82
+ }], ctorParameters: () => [] });
151
83
 
152
- class HlmAutocompleteTrigger {
153
- _host = inject(ElementRef, { host: true });
154
- _brnDialog = inject(BrnDialog, { optional: true });
155
- /** Whether the trigger is disabled. */
156
- disabledTrigger = input(false, ...(ngDevMode ? [{ debugName: "disabledTrigger", transform: booleanAttribute }] : [{
157
- transform: booleanAttribute,
158
- }]));
84
+ class HlmAutocompleteGroup {
159
85
  constructor() {
160
- if (!this._brnDialog)
161
- return;
162
- this._brnDialog.mutableAttachTo.set(this._host.nativeElement);
86
+ classes(() => 'data-hidden:hidden');
163
87
  }
164
- open() {
165
- if (this.disabledTrigger())
166
- return;
167
- this._brnDialog?.open();
168
- }
169
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmAutocompleteTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
170
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.1", type: HlmAutocompleteTrigger, isStandalone: true, selector: "[hlmAutocompleteTrigger]", inputs: { disabledTrigger: { classPropertyName: "disabledTrigger", publicName: "disabledTrigger", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "open()" } }, ngImport: i0 });
88
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompleteGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive });
89
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: HlmAutocompleteGroup, isStandalone: true, selector: "[hlmAutocompleteGroup]", host: { attributes: { "data-slot": "autocomplete-group" } }, hostDirectives: [{ directive: i1.BrnAutocompleteGroup }], ngImport: i0 });
171
90
  }
172
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmAutocompleteTrigger, decorators: [{
91
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompleteGroup, decorators: [{
173
92
  type: Directive,
174
93
  args: [{
175
- selector: '[hlmAutocompleteTrigger]',
176
- host: {
177
- '(click)': 'open()',
178
- },
94
+ selector: '[hlmAutocompleteGroup]',
95
+ hostDirectives: [BrnAutocompleteGroup],
96
+ host: { 'data-slot': 'autocomplete-group' },
179
97
  }]
180
98
  }], ctorParameters: () => [] });
181
99
 
182
- function getDefaultConfig() {
183
- return {
184
- transformValueToSearch: (value) => (typeof value === 'string' ? value : String(value)),
185
- };
186
- }
187
- const HlmAutocompleteConfigToken = new InjectionToken('HlmAutocompleteConfig');
188
- function provideHlmAutocompleteConfig(config) {
189
- return { provide: HlmAutocompleteConfigToken, useValue: { ...getDefaultConfig(), ...config } };
190
- }
191
- function injectHlmAutocompleteConfig() {
192
- return inject(HlmAutocompleteConfigToken, { optional: true }) ?? getDefaultConfig();
193
- }
194
-
195
- const HLM_AUTOCOMPLETE_VALUE_ACCESSOR = {
196
- provide: NG_VALUE_ACCESSOR,
197
- useExisting: forwardRef(() => HlmAutocomplete),
198
- multi: true,
199
- };
200
- class HlmAutocomplete {
100
+ class HlmAutocompleteInput {
201
101
  static _id = 0;
202
- _config = injectHlmAutocompleteConfig();
203
- _brnPopover = viewChild.required(BrnPopover);
204
- _inputRef = viewChild.required('input', { read: ElementRef });
205
- _elementRef = inject((ElementRef));
206
- onSelect = input(...(ngDevMode ? [undefined, { debugName: "onSelect" }] : []));
207
- /** The user defined class */
208
- userClass = input('', ...(ngDevMode ? [{ debugName: "userClass", alias: 'class' }] : [{ alias: 'class' }]));
209
- _computedClass = computed(() => hlm('block w-full', this.userClass()), ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
210
- /** Custom class for the autocomplete list. */
211
- autocompleteListClass = input('', ...(ngDevMode ? [{ debugName: "autocompleteListClass" }] : []));
212
- _computedAutocompleteListClass = computed(() => hlm('', this.autocompleteListClass()), ...(ngDevMode ? [{ debugName: "_computedAutocompleteListClass" }] : []));
213
- /** Custom class for the empty and loading state container. */
214
- autocompleteEmptyClass = input('', ...(ngDevMode ? [{ debugName: "autocompleteEmptyClass" }] : []));
215
- _computedAutocompleteEmptyClass = computed(() => hlm('', this.autocompleteEmptyClass()), ...(ngDevMode ? [{ debugName: "_computedAutocompleteEmptyClass" }] : []));
216
- /** The list of filtered options to display in the autocomplete. */
217
- filteredOptions = input([], ...(ngDevMode ? [{ debugName: "filteredOptions" }] : []));
218
- /** The selected value. */
219
- value = input(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
220
- _value = linkedSignal(() => this.value(), ...(ngDevMode ? [{ debugName: "_value" }] : []));
221
- /** The search query. */
222
- search = input(...(ngDevMode ? [undefined, { debugName: "search" }] : []));
223
- _search = linkedSignal(() => this.search() || '', ...(ngDevMode ? [{ debugName: "_search" }] : []));
224
- /** Function to transform an option value to a search string. Defaults to identity function for strings. */
225
- transformValueToSearch = input(this._config.transformValueToSearch, ...(ngDevMode ? [{ debugName: "transformValueToSearch" }] : []));
226
- /** Optional template for rendering each option. */
227
- optionTemplate = input(...(ngDevMode ? [undefined, { debugName: "optionTemplate" }] : []));
228
- /** Whether the autocomplete is in a loading state. */
229
- loading = input(false, ...(ngDevMode ? [{ debugName: "loading", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
230
- /** Placeholder text for the input field. */
231
- searchPlaceholderText = input('Select an option', ...(ngDevMode ? [{ debugName: "searchPlaceholderText" }] : []));
232
- /** Text to display when loading options. */
233
- loadingText = input('Loading options...', ...(ngDevMode ? [{ debugName: "loadingText" }] : []));
234
- /** Text to display when no options are found. */
235
- emptyText = input('No options found', ...(ngDevMode ? [{ debugName: "emptyText" }] : []));
236
- /** Aria label for the toggle button. */
237
- ariaLabelToggleButton = input('Toggle options', ...(ngDevMode ? [{ debugName: "ariaLabelToggleButton" }] : []));
238
- /** The id of the input field. */
239
- inputId = input(`hlm-autocomplete-input-${++HlmAutocomplete._id}`, ...(ngDevMode ? [{ debugName: "inputId" }] : []));
240
- /** Whether the autocomplete is disabled. */
241
- disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
242
- _disabled = linkedSignal(() => this.disabled(), ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
243
- /** Emitted when the selected value changes. */
244
- valueChange = output();
245
- /** Emitted when the search query changes. */
246
- searchChange = output();
247
- _onChange;
248
- _onTouched;
249
- _setPopoverState(state) {
250
- if (state === 'open') {
251
- this._brnPopover().open();
252
- }
253
- else {
254
- this._brnPopover().close();
255
- }
256
- }
257
- _click() {
258
- this._toggleOptions();
259
- }
260
- _openPopover() {
261
- if (this._search() || this.filteredOptions().length > 0) {
262
- // only open if there's a search term or options to show
263
- this._brnPopover().open();
264
- }
265
- }
266
- _toggleOptions() {
267
- if (this._search() || this.filteredOptions().length > 0) {
268
- // only toggle if there's a search term or options to show
269
- const state = this._brnPopover().stateComputed();
270
- this._setPopoverState(state === 'open' ? 'closed' : 'open');
271
- }
272
- this._inputRef().nativeElement.focus();
273
- }
274
- _onSearchChanged(event) {
275
- const input = event.target;
276
- this._search.set(input.value);
277
- this.searchChange.emit(input.value);
278
- this._clearOption();
279
- if (this._brnPopover().stateComputed() !== 'open' && input.value.length > 0) {
280
- this._setPopoverState('open');
281
- }
102
+ inputId = input(`hlm-autocomplete-input-${HlmAutocompleteInput._id++}`, /* @ts-ignore */
103
+ ...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
104
+ placeholder = input('', /* @ts-ignore */
105
+ ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
106
+ showSearch = input(true, { ...(ngDevMode ? { debugName: "showSearch" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
107
+ showClear = input(false, { ...(ngDevMode ? { debugName: "showClear" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
108
+ /** Forces the invalid state visually, regardless of form control state. */
109
+ forceInvalid = input(false, { ...(ngDevMode ? { debugName: "forceInvalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
110
+ /** Manual override for aria-invalid. When not set, auto-detects from the parent autocomplete error state. */
111
+ ariaInvalidOverride = input(undefined, { ...(ngDevMode ? { debugName: "ariaInvalidOverride" } : /* istanbul ignore next */ {}), transform: (v) => (v === '' || v === undefined ? undefined : booleanAttribute(v)),
112
+ alias: 'aria-invalid' });
113
+ constructor() {
114
+ classes(() => 'w-auto');
282
115
  }
283
- _clearOption() {
284
- this._value.set(undefined);
285
- this._onChange?.(null);
286
- this.valueChange.emit(null);
116
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompleteInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
117
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: HlmAutocompleteInput, isStandalone: true, selector: "hlm-autocomplete-input", inputs: { inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, showSearch: { classPropertyName: "showSearch", publicName: "showSearch", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, forceInvalid: { classPropertyName: "forceInvalid", publicName: "forceInvalid", isSignal: true, isRequired: false, transformFunction: null }, ariaInvalidOverride: { classPropertyName: "ariaInvalidOverride", publicName: "aria-invalid", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideIcons({ lucideSearch, lucideX })], hostDirectives: [{ directive: i1.BrnAutocompleteAnchor }, { directive: i2$1.HlmInputGroup }], ngImport: i0, template: `
118
+ <input
119
+ brnAutocompleteInput
120
+ #autocompleteInput="brnAutocompleteInput"
121
+ hlmInputGroupInput
122
+ [id]="inputId()"
123
+ [placeholder]="placeholder()"
124
+ [aria-invalid]="ariaInvalidOverride()"
125
+ [forceInvalid]="forceInvalid()"
126
+ />
127
+
128
+ @if (showSearch()) {
129
+ <hlm-input-group-addon>
130
+ <ng-icon name="lucideSearch" [class.opacity-50]="autocompleteInput.disabled()" />
131
+ </hlm-input-group-addon>
287
132
  }
288
- _optionSelected(option) {
289
- this._value.set(option);
290
- this._onChange?.(option);
291
- this.valueChange.emit(option);
292
- const searchValue = this.transformValueToSearch()(option, this.inputId());
293
- if (this.onSelect()) {
294
- this.onSelect()?.(searchValue);
295
- }
296
- else {
297
- this._search.set(searchValue);
298
- this.searchChange.emit(searchValue);
299
- this._setPopoverState('closed');
300
- }
133
+
134
+ @if (showClear()) {
135
+ <hlm-input-group-addon align="inline-end">
136
+ <button
137
+ *brnAutocompleteClear
138
+ hlmInputGroupButton
139
+ data-slot="autocomplete-clear"
140
+ [disabled]="autocompleteInput.disabled()"
141
+ size="icon-xs"
142
+ variant="ghost"
143
+ >
144
+ <ng-icon name="lucideX" />
145
+ </button>
146
+ </hlm-input-group-addon>
301
147
  }
302
- clearText() {
303
- this._inputRef().nativeElement.value = '';
304
- this._search.set('');
305
- this.searchChange.emit('');
148
+ <ng-content />
149
+ `, isInline: true, dependencies: [{ kind: "directive", type: i2$1.HlmInputGroupAddon, selector: "[hlmInputGroupAddon],hlm-input-group-addon", inputs: ["align"] }, { kind: "directive", type: i2$1.HlmInputGroupButton, selector: "button[hlmInputGroupButton]", inputs: ["size", "type"] }, { kind: "directive", type: i2$1.HlmInputGroupInput, selector: "input[hlmInputGroupInput]" }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: BrnAutocompleteClear, selector: "[brnAutocompleteClear]" }, { kind: "directive", type: BrnAutocompleteInput, selector: "input[brnAutocompleteInput]", inputs: ["id", "aria-invalid", "forceInvalid"], exportAs: ["brnAutocompleteInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
150
+ }
151
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompleteInput, decorators: [{
152
+ type: Component,
153
+ args: [{
154
+ selector: 'hlm-autocomplete-input',
155
+ imports: [HlmInputGroupImports, NgIcon, BrnAutocompleteClear, BrnAutocompleteInput],
156
+ providers: [provideIcons({ lucideSearch, lucideX })],
157
+ changeDetection: ChangeDetectionStrategy.OnPush,
158
+ hostDirectives: [BrnAutocompleteAnchor, HlmInputGroup],
159
+ template: `
160
+ <input
161
+ brnAutocompleteInput
162
+ #autocompleteInput="brnAutocompleteInput"
163
+ hlmInputGroupInput
164
+ [id]="inputId()"
165
+ [placeholder]="placeholder()"
166
+ [aria-invalid]="ariaInvalidOverride()"
167
+ [forceInvalid]="forceInvalid()"
168
+ />
169
+
170
+ @if (showSearch()) {
171
+ <hlm-input-group-addon>
172
+ <ng-icon name="lucideSearch" [class.opacity-50]="autocompleteInput.disabled()" />
173
+ </hlm-input-group-addon>
306
174
  }
307
- setPopoverState(state) {
308
- this._setPopoverState(state);
175
+
176
+ @if (showClear()) {
177
+ <hlm-input-group-addon align="inline-end">
178
+ <button
179
+ *brnAutocompleteClear
180
+ hlmInputGroupButton
181
+ data-slot="autocomplete-clear"
182
+ [disabled]="autocompleteInput.disabled()"
183
+ size="icon-xs"
184
+ variant="ghost"
185
+ >
186
+ <ng-icon name="lucideX" />
187
+ </button>
188
+ </hlm-input-group-addon>
309
189
  }
310
- /** CONTROL VALUE ACCESSOR */
311
- writeValue(value) {
312
- this._value.set(value ? value : undefined);
190
+ <ng-content />
191
+ `,
192
+ }]
193
+ }], ctorParameters: () => [], propDecorators: { inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], showSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSearch", required: false }] }], showClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClear", required: false }] }], forceInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "forceInvalid", required: false }] }], ariaInvalidOverride: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-invalid", required: false }] }] } });
194
+
195
+ class HlmAutocompleteItem {
196
+ _brnAutocompleteItem = inject(BrnAutocompleteItem);
197
+ _active = this._brnAutocompleteItem.active;
198
+ constructor() {
199
+ classes(() => 'data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground gap-2 rounded-sm py-1.5 ps-2 pe-8 text-sm relative flex w-full cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-hidden:hidden [&_ng-icon]:pointer-events-none [&_ng-icon]:shrink-0');
313
200
  }
314
- registerOnChange(fn) {
315
- this._onChange = fn;
201
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompleteItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
202
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: HlmAutocompleteItem, isStandalone: true, selector: "hlm-autocomplete-item", host: { attributes: { "data-slot": "autocomplete-item" } }, providers: [provideIcons({ lucideCheck })], hostDirectives: [{ directive: i1.BrnAutocompleteItem, inputs: ["id", "id", "disabled", "disabled", "value", "value"] }], ngImport: i0, template: `
203
+ <ng-content />
204
+ @if (_active()) {
205
+ <ng-icon
206
+ name="lucideCheck"
207
+ class="absolute end-2 flex items-center justify-center text-[length:--spacing(4)]"
208
+ aria-hidden="true"
209
+ />
316
210
  }
317
- registerOnTouched(fn) {
318
- this._onTouched = fn;
211
+ `, isInline: true, dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
212
+ }
213
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompleteItem, decorators: [{
214
+ type: Component,
215
+ args: [{
216
+ selector: 'hlm-autocomplete-item',
217
+ imports: [NgIcon],
218
+ providers: [provideIcons({ lucideCheck })],
219
+ changeDetection: ChangeDetectionStrategy.OnPush,
220
+ hostDirectives: [{ directive: BrnAutocompleteItem, inputs: ['id', 'disabled', 'value'] }],
221
+ host: { 'data-slot': 'autocomplete-item' },
222
+ template: `
223
+ <ng-content />
224
+ @if (_active()) {
225
+ <ng-icon
226
+ name="lucideCheck"
227
+ class="absolute end-2 flex items-center justify-center text-[length:--spacing(4)]"
228
+ aria-hidden="true"
229
+ />
319
230
  }
320
- setDisabledState(isDisabled) {
321
- this._disabled.set(isDisabled);
231
+ `,
232
+ }]
233
+ }], ctorParameters: () => [] });
234
+
235
+ class HlmAutocompleteLabel {
236
+ constructor() {
237
+ classes(() => 'text-muted-foreground px-2 py-1.5 text-xs');
322
238
  }
323
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmAutocomplete, deps: [], target: i0.ɵɵFactoryTarget.Component });
324
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.1", type: HlmAutocomplete, isStandalone: true, selector: "hlm-autocomplete", inputs: { onSelect: { classPropertyName: "onSelect", publicName: "onSelect", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, autocompleteListClass: { classPropertyName: "autocompleteListClass", publicName: "autocompleteListClass", isSignal: true, isRequired: false, transformFunction: null }, autocompleteEmptyClass: { classPropertyName: "autocompleteEmptyClass", publicName: "autocompleteEmptyClass", isSignal: true, isRequired: false, transformFunction: null }, filteredOptions: { classPropertyName: "filteredOptions", publicName: "filteredOptions", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, transformValueToSearch: { classPropertyName: "transformValueToSearch", publicName: "transformValueToSearch", isSignal: true, isRequired: false, transformFunction: null }, optionTemplate: { classPropertyName: "optionTemplate", publicName: "optionTemplate", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholderText: { classPropertyName: "searchPlaceholderText", publicName: "searchPlaceholderText", isSignal: true, isRequired: false, transformFunction: null }, loadingText: { classPropertyName: "loadingText", publicName: "loadingText", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelToggleButton: { classPropertyName: "ariaLabelToggleButton", publicName: "ariaLabelToggleButton", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", searchChange: "searchChange" }, host: { properties: { "class": "_computedClass()" } }, providers: [HLM_AUTOCOMPLETE_VALUE_ACCESSOR, provideIcons({ lucideSearch, lucideChevronDown })], viewQueries: [{ propertyName: "_brnPopover", first: true, predicate: BrnPopover, descendants: true, isSignal: true }, { propertyName: "_inputRef", first: true, predicate: ["input"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: `
325
- <brn-popover
326
- #popover
327
- align="start"
328
- autoFocus="first-heading"
329
- sideOffset="5"
330
- closeDelay="100"
331
- [closeOnOutsidePointerEvents]="true"
332
- >
333
- <div brnAutocomplete>
334
- <hlm-autocomplete-search hlmAutocompleteTrigger [disabledTrigger]="!_search()">
335
- <ng-icon name="lucideSearch" hlm />
336
- <input
337
- #input
338
- type="text"
339
- autocomplete="off"
340
- hlm-autocomplete-search-input
341
- [id]="inputId()"
342
- [placeholder]="searchPlaceholderText()"
343
- [disabled]="_disabled()"
344
- [value]="_search()"
345
- (input)="_onSearchChanged($event)"
346
- (keydown.arrowDown)="_openPopover()"
347
- (click)="_click()"
348
- />
239
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompleteLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
240
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: HlmAutocompleteLabel, isStandalone: true, selector: "[hlmAutocompleteLabel]", host: { attributes: { "data-slot": "autocomplete-label" } }, hostDirectives: [{ directive: i1.BrnAutocompleteLabel, inputs: ["id", "id"] }], ngImport: i0 });
241
+ }
242
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompleteLabel, decorators: [{
243
+ type: Directive,
244
+ args: [{
245
+ selector: '[hlmAutocompleteLabel]',
246
+ hostDirectives: [{ directive: BrnAutocompleteLabel, inputs: ['id'] }],
247
+ host: { 'data-slot': 'autocomplete-label' },
248
+ }]
249
+ }], ctorParameters: () => [] });
349
250
 
350
- <button
351
- class="flex items-center justify-center outline-none disabled:cursor-not-allowed [&>_ng-icon]:opacity-50"
352
- tabindex="-1"
353
- type="button"
354
- [attr.aria-label]="ariaLabelToggleButton()"
355
- [disabled]="_disabled()"
356
- (click)="_toggleOptions()"
357
- >
358
- <ng-icon name="lucideChevronDown" hlm />
359
- </button>
360
- </hlm-autocomplete-search>
251
+ class HlmAutocompleteList {
252
+ constructor() {
253
+ classes(() => 'no-scrollbar max-h-[calc(--spacing(72)---spacing(9))] scroll-py-1 p-1 data-empty:p-0 overflow-y-auto overscroll-contain');
254
+ }
255
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompleteList, deps: [], target: i0.ɵɵFactoryTarget.Directive });
256
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: HlmAutocompleteList, isStandalone: true, selector: "[hlmAutocompleteList]", host: { attributes: { "data-slot": "autocomplete-list" } }, hostDirectives: [{ directive: i1.BrnAutocompleteList, inputs: ["id", "id"] }], ngImport: i0 });
257
+ }
258
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompleteList, decorators: [{
259
+ type: Directive,
260
+ args: [{
261
+ selector: '[hlmAutocompleteList]',
262
+ hostDirectives: [{ directive: BrnAutocompleteList, inputs: ['id'] }],
263
+ host: { 'data-slot': 'autocomplete-list' },
264
+ }]
265
+ }], ctorParameters: () => [] });
361
266
 
362
- <div
363
- *brnPopoverContent="let ctx"
364
- hlmPopoverContent
365
- class="p-0"
366
- [style.width.px]="_elementRef.nativeElement.offsetWidth"
367
- >
368
- <hlm-autocomplete-list
369
- [class]="_computedAutocompleteListClass()"
370
- [class.hidden]="filteredOptions().length === 0"
371
- >
372
- <hlm-autocomplete-group>
373
- @for (option of filteredOptions(); track option) {
374
- <button hlm-autocomplete-item [value]="option" (selected)="_optionSelected(option)">
375
- @if (optionTemplate(); as optionTemplate) {
376
- <ng-container *ngTemplateOutlet="optionTemplate; context: { $implicit: option }" />
377
- } @else {
378
- {{ option }}
379
- }
380
- </button>
381
- }
382
- </hlm-autocomplete-group>
383
- </hlm-autocomplete-list>
267
+ class HlmAutocompletePortal {
268
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompletePortal, deps: [], target: i0.ɵɵFactoryTarget.Directive });
269
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: HlmAutocompletePortal, isStandalone: true, selector: "[hlmAutocompletePortal]", hostDirectives: [{ directive: i2.BrnPopoverContent, inputs: ["context", "context", "class", "class"] }], ngImport: i0 });
270
+ }
271
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompletePortal, decorators: [{
272
+ type: Directive,
273
+ args: [{
274
+ selector: '[hlmAutocompletePortal]',
275
+ hostDirectives: [{ directive: BrnPopoverContent, inputs: ['context', 'class'] }],
276
+ }]
277
+ }] });
384
278
 
385
- <div *brnAutocompleteEmpty hlmAutocompleteEmpty [class]="_computedAutocompleteEmptyClass()">
386
- @if (loading()) {
387
- <ng-content select="[loading]">{{ loadingText() }}</ng-content>
388
- } @else {
389
- <ng-content select="[empty]">{{ emptyText() }}</ng-content>
390
- }
391
- </div>
392
- </div>
393
- </div>
394
- </brn-popover>
395
- `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: BrnPopover, selector: "brn-popover", inputs: ["align", "sideOffset"], exportAs: ["brnPopover"] }, { kind: "directive", type: BrnPopoverContent, selector: "[brnPopoverContent]" }, { kind: "directive", type: HlmPopoverContent, selector: "[hlmPopoverContent],[brnPopoverContent][hlm]", inputs: ["class"] }, { kind: "directive", type: BrnAutocomplete, selector: "[brnAutocomplete]", inputs: ["id"], outputs: ["valueChange"] }, { kind: "directive", type: BrnAutocompleteEmpty, selector: "[brnAutocompleteEmpty]" }, { kind: "directive", type: HlmAutocompleteEmpty, selector: "[hlmAutocompleteEmpty]", inputs: ["class"] }, { kind: "component", type: HlmAutocompleteGroup, selector: "hlm-autocomplete-group", inputs: ["class"] }, { kind: "component", type: HlmAutocompleteItem, selector: "button[hlm-autocomplete-item]", inputs: ["class"] }, { kind: "component", type: HlmAutocompleteList, selector: "hlm-autocomplete-list", inputs: ["class"] }, { kind: "component", type: HlmAutocompleteSearch, selector: "hlm-autocomplete-search", inputs: ["class"] }, { kind: "component", type: HlmAutocompleteSearchInput, selector: "input[hlm-autocomplete-search-input]", inputs: ["class"] }, { kind: "directive", type: HlmAutocompleteTrigger, selector: "[hlmAutocompleteTrigger]", inputs: ["disabledTrigger"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: HlmIcon, selector: "ng-icon[hlm]", inputs: ["size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
279
+ class HlmAutocompleteSearch {
280
+ constructor() {
281
+ classes(() => 'block');
282
+ }
283
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompleteSearch, deps: [], target: i0.ɵɵFactoryTarget.Directive });
284
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: HlmAutocompleteSearch, isStandalone: true, selector: "[hlmAutocompleteSearch],hlm-autocomplete-search", host: { attributes: { "data-slot": "autocomplete" } }, providers: [
285
+ provideBrnPopoverConfig({
286
+ align: 'start',
287
+ sideOffset: 6,
288
+ }),
289
+ provideBrnPopoverDefaultOptions({ role: null }),
290
+ ], hostDirectives: [{ directive: i1.BrnAutocompleteSearch, inputs: ["autoHighlight", "autoHighlight", "disabled", "disabled", "value", "value", "search", "search", "itemToString", "itemToString"], outputs: ["valueChange", "valueChange", "searchChange", "searchChange"] }, { directive: i2.BrnPopover, inputs: ["align", "align", "closeOnOutsidePointerEvents", "closeOnOutsidePointerEvents", "sideOffset", "sideOffset", "state", "state", "offsetX", "offsetX"], outputs: ["stateChanged", "stateChanged", "closed", "closed"] }], ngImport: i0 });
396
291
  }
397
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmAutocomplete, decorators: [{
398
- type: Component,
292
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompleteSearch, decorators: [{
293
+ type: Directive,
399
294
  args: [{
400
- selector: 'hlm-autocomplete',
401
- imports: [
402
- NgTemplateOutlet,
403
- BrnPopover,
404
- BrnPopoverContent,
405
- HlmPopoverContent,
406
- BrnAutocomplete,
407
- BrnAutocompleteEmpty,
408
- HlmAutocompleteEmpty,
409
- HlmAutocompleteGroup,
410
- HlmAutocompleteItem,
411
- HlmAutocompleteList,
412
- HlmAutocompleteSearch,
413
- HlmAutocompleteSearchInput,
414
- HlmAutocompleteTrigger,
415
- NgIcon,
416
- HlmIcon,
295
+ selector: '[hlmAutocompleteSearch],hlm-autocomplete-search',
296
+ providers: [
297
+ provideBrnPopoverConfig({
298
+ align: 'start',
299
+ sideOffset: 6,
300
+ }),
301
+ provideBrnPopoverDefaultOptions({ role: null }),
417
302
  ],
418
- providers: [HLM_AUTOCOMPLETE_VALUE_ACCESSOR, provideIcons({ lucideSearch, lucideChevronDown })],
419
- template: `
420
- <brn-popover
421
- #popover
422
- align="start"
423
- autoFocus="first-heading"
424
- sideOffset="5"
425
- closeDelay="100"
426
- [closeOnOutsidePointerEvents]="true"
427
- >
428
- <div brnAutocomplete>
429
- <hlm-autocomplete-search hlmAutocompleteTrigger [disabledTrigger]="!_search()">
430
- <ng-icon name="lucideSearch" hlm />
431
- <input
432
- #input
433
- type="text"
434
- autocomplete="off"
435
- hlm-autocomplete-search-input
436
- [id]="inputId()"
437
- [placeholder]="searchPlaceholderText()"
438
- [disabled]="_disabled()"
439
- [value]="_search()"
440
- (input)="_onSearchChanged($event)"
441
- (keydown.arrowDown)="_openPopover()"
442
- (click)="_click()"
443
- />
444
-
445
- <button
446
- class="flex items-center justify-center outline-none disabled:cursor-not-allowed [&>_ng-icon]:opacity-50"
447
- tabindex="-1"
448
- type="button"
449
- [attr.aria-label]="ariaLabelToggleButton()"
450
- [disabled]="_disabled()"
451
- (click)="_toggleOptions()"
452
- >
453
- <ng-icon name="lucideChevronDown" hlm />
454
- </button>
455
- </hlm-autocomplete-search>
303
+ hostDirectives: [
304
+ {
305
+ directive: BrnAutocompleteSearch,
306
+ inputs: ['autoHighlight', 'disabled', 'value', 'search', 'itemToString'],
307
+ outputs: ['valueChange', 'searchChange'],
308
+ },
309
+ {
310
+ directive: BrnPopover,
311
+ inputs: ['align', 'closeOnOutsidePointerEvents', 'sideOffset', 'state', 'offsetX'],
312
+ outputs: ['stateChanged', 'closed'],
313
+ },
314
+ ],
315
+ host: { 'data-slot': 'autocomplete' },
316
+ }]
317
+ }], ctorParameters: () => [] });
456
318
 
457
- <div
458
- *brnPopoverContent="let ctx"
459
- hlmPopoverContent
460
- class="p-0"
461
- [style.width.px]="_elementRef.nativeElement.offsetWidth"
462
- >
463
- <hlm-autocomplete-list
464
- [class]="_computedAutocompleteListClass()"
465
- [class.hidden]="filteredOptions().length === 0"
466
- >
467
- <hlm-autocomplete-group>
468
- @for (option of filteredOptions(); track option) {
469
- <button hlm-autocomplete-item [value]="option" (selected)="_optionSelected(option)">
470
- @if (optionTemplate(); as optionTemplate) {
471
- <ng-container *ngTemplateOutlet="optionTemplate; context: { $implicit: option }" />
472
- } @else {
473
- {{ option }}
474
- }
475
- </button>
476
- }
477
- </hlm-autocomplete-group>
478
- </hlm-autocomplete-list>
319
+ class HlmAutocompleteSeparator {
320
+ constructor() {
321
+ classes(() => 'bg-border -mx-1 my-1 h-px');
322
+ }
323
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompleteSeparator, deps: [], target: i0.ɵɵFactoryTarget.Directive });
324
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: HlmAutocompleteSeparator, isStandalone: true, selector: "[hlmAutocompleteSeparator]", host: { attributes: { "data-slot": "autocomplete-separator" } }, hostDirectives: [{ directive: i1.BrnAutocompleteSeparator, inputs: ["orientation", "orientation"] }], ngImport: i0 });
325
+ }
326
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompleteSeparator, decorators: [{
327
+ type: Directive,
328
+ args: [{
329
+ selector: '[hlmAutocompleteSeparator]',
330
+ hostDirectives: [{ directive: BrnAutocompleteSeparator, inputs: ['orientation'] }],
331
+ host: { 'data-slot': 'autocomplete-separator' },
332
+ }]
333
+ }], ctorParameters: () => [] });
479
334
 
480
- <div *brnAutocompleteEmpty hlmAutocompleteEmpty [class]="_computedAutocompleteEmptyClass()">
481
- @if (loading()) {
482
- <ng-content select="[loading]">{{ loadingText() }}</ng-content>
483
- } @else {
484
- <ng-content select="[empty]">{{ emptyText() }}</ng-content>
485
- }
486
- </div>
487
- </div>
488
- </div>
489
- </brn-popover>
490
- `,
491
- changeDetection: ChangeDetectionStrategy.OnPush,
492
- host: {
493
- '[class]': '_computedClass()',
494
- },
335
+ class HlmAutocompleteStatus {
336
+ constructor() {
337
+ classes(() => 'text-muted-foreground gap-2 px-3 py-2 text-sm flex w-full items-center justify-center text-center');
338
+ }
339
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompleteStatus, deps: [], target: i0.ɵɵFactoryTarget.Directive });
340
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: HlmAutocompleteStatus, isStandalone: true, selector: "[hlmAutocompleteStatus],hlm-autocomplete-status", host: { attributes: { "data-slot": "autocomplete-status" } }, hostDirectives: [{ directive: i1.BrnAutocompleteStatus }], ngImport: i0 });
341
+ }
342
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompleteStatus, decorators: [{
343
+ type: Directive,
344
+ args: [{
345
+ selector: '[hlmAutocompleteStatus],hlm-autocomplete-status',
346
+ hostDirectives: [BrnAutocompleteStatus],
347
+ host: { 'data-slot': 'autocomplete-status' },
495
348
  }]
496
- }] });
349
+ }], ctorParameters: () => [] });
497
350
 
498
351
  /*
499
352
  * Public API Surface of autocomplete
500
353
  */
501
354
  const HlmAutocompleteImports = [
502
355
  HlmAutocomplete,
356
+ HlmAutocompleteContent,
503
357
  HlmAutocompleteEmpty,
504
358
  HlmAutocompleteGroup,
359
+ HlmAutocompleteInput,
505
360
  HlmAutocompleteItem,
361
+ HlmAutocompleteLabel,
506
362
  HlmAutocompleteList,
363
+ HlmAutocompletePortal,
507
364
  HlmAutocompleteSearch,
508
- HlmAutocompleteSearchInput,
509
- HlmAutocompleteTrigger,
365
+ HlmAutocompleteSeparator,
366
+ HlmAutocompleteStatus,
510
367
  ];
511
368
  class HlmAutocompleteModule {
512
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmAutocompleteModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
513
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: HlmAutocompleteModule, imports: [HlmAutocomplete,
369
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompleteModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
370
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompleteModule, imports: [HlmAutocomplete,
371
+ HlmAutocompleteContent,
514
372
  HlmAutocompleteEmpty,
515
373
  HlmAutocompleteGroup,
374
+ HlmAutocompleteInput,
516
375
  HlmAutocompleteItem,
376
+ HlmAutocompleteLabel,
517
377
  HlmAutocompleteList,
378
+ HlmAutocompletePortal,
518
379
  HlmAutocompleteSearch,
519
- HlmAutocompleteSearchInput,
520
- HlmAutocompleteTrigger], exports: [HlmAutocomplete,
380
+ HlmAutocompleteSeparator,
381
+ HlmAutocompleteStatus], exports: [HlmAutocomplete,
382
+ HlmAutocompleteContent,
521
383
  HlmAutocompleteEmpty,
522
384
  HlmAutocompleteGroup,
385
+ HlmAutocompleteInput,
523
386
  HlmAutocompleteItem,
387
+ HlmAutocompleteLabel,
524
388
  HlmAutocompleteList,
389
+ HlmAutocompletePortal,
525
390
  HlmAutocompleteSearch,
526
- HlmAutocompleteSearchInput,
527
- HlmAutocompleteTrigger] });
528
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmAutocompleteModule, imports: [HlmAutocomplete] });
391
+ HlmAutocompleteSeparator,
392
+ HlmAutocompleteStatus] });
393
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompleteModule, imports: [HlmAutocompleteInput,
394
+ HlmAutocompleteItem] });
529
395
  }
530
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmAutocompleteModule, decorators: [{
396
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmAutocompleteModule, decorators: [{
531
397
  type: NgModule,
532
398
  args: [{
533
399
  imports: [...HlmAutocompleteImports],
@@ -539,5 +405,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
539
405
  * Generated bundle index. Do not edit.
540
406
  */
541
407
 
542
- export { HLM_AUTOCOMPLETE_VALUE_ACCESSOR, HlmAutocomplete, HlmAutocompleteEmpty, HlmAutocompleteGroup, HlmAutocompleteImports, HlmAutocompleteItem, HlmAutocompleteList, HlmAutocompleteModule, HlmAutocompleteSearch, HlmAutocompleteSearchInput, HlmAutocompleteTrigger, injectHlmAutocompleteConfig, provideHlmAutocompleteConfig };
408
+ export { HlmAutocomplete, HlmAutocompleteContent, HlmAutocompleteEmpty, HlmAutocompleteGroup, HlmAutocompleteImports, HlmAutocompleteInput, HlmAutocompleteItem, HlmAutocompleteLabel, HlmAutocompleteList, HlmAutocompleteModule, HlmAutocompletePortal, HlmAutocompleteSearch, HlmAutocompleteSeparator, HlmAutocompleteStatus };
543
409
  //# sourceMappingURL=autocomplete.mjs.map