@volverjs/ui-vue 0.0.10-beta.4 → 0.0.10-beta.41

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 (481) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +146 -49
  3. package/auto-imports.d.ts +7 -2
  4. package/bin/icons.cjs +1 -1
  5. package/bin/icons.js +27 -20
  6. package/dist/Volver.d.ts +11 -11
  7. package/dist/components/VvAccordion/VvAccordion.es.js +190 -101
  8. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  9. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +30 -8
  10. package/dist/components/VvAccordion/index.d.ts +8 -9
  11. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +450 -170
  12. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  13. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +58 -13
  14. package/dist/components/VvAccordionGroup/index.d.ts +14 -6
  15. package/dist/components/VvAction/VvAction.es.js +84 -33
  16. package/dist/components/VvAction/VvAction.umd.js +1 -1
  17. package/dist/components/VvAction/VvAction.vue.d.ts +57 -22
  18. package/dist/components/VvAction/index.d.ts +25 -9
  19. package/dist/components/VvAlert/VvAlert.es.js +228 -193
  20. package/dist/components/VvAlert/VvAlert.umd.js +1 -1
  21. package/dist/components/VvAlert/VvAlert.vue.d.ts +24 -14
  22. package/dist/components/VvAlert/index.d.ts +17 -9
  23. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +549 -485
  24. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
  25. package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +16 -9
  26. package/dist/components/VvAlertGroup/index.d.ts +7 -15
  27. package/dist/components/VvAvatar/VvAvatar.es.js +65 -22
  28. package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
  29. package/dist/components/VvAvatar/VvAvatar.vue.d.ts +12 -4
  30. package/dist/components/VvAvatar/index.d.ts +4 -1
  31. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +128 -49
  32. package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
  33. package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +10 -3
  34. package/dist/components/VvAvatarGroup/index.d.ts +4 -1
  35. package/dist/components/VvBadge/VvBadge.es.js +77 -28
  36. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  37. package/dist/components/VvBadge/VvBadge.vue.d.ts +12 -4
  38. package/dist/components/VvBadge/index.d.ts +4 -1
  39. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +276 -60
  40. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  41. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +27 -7
  42. package/dist/components/VvBreadcrumb/index.d.ts +6 -10
  43. package/dist/components/VvButton/VvButton.es.js +307 -262
  44. package/dist/components/VvButton/VvButton.umd.js +1 -1
  45. package/dist/components/VvButton/VvButton.vue.d.ts +94 -40
  46. package/dist/components/VvButton/index.d.ts +51 -29
  47. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +95 -40
  48. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  49. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +31 -11
  50. package/dist/components/VvButtonGroup/index.d.ts +11 -2
  51. package/dist/components/VvCard/VvCard.es.js +86 -36
  52. package/dist/components/VvCard/VvCard.umd.js +1 -1
  53. package/dist/components/VvCard/VvCard.vue.d.ts +12 -4
  54. package/dist/components/VvCard/index.d.ts +4 -1
  55. package/dist/components/VvCheckbox/VvCheckbox.es.js +315 -251
  56. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  57. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +106 -34
  58. package/dist/components/VvCheckbox/index.d.ts +47 -14
  59. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +238 -129
  60. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  61. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +101 -30
  62. package/dist/components/VvCheckboxGroup/index.d.ts +45 -12
  63. package/dist/components/VvCombobox/VvCombobox.es.js +1377 -1059
  64. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  65. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +606 -680
  66. package/dist/components/VvCombobox/index.d.ts +488 -26
  67. package/dist/components/VvDialog/VvDialog.es.js +180 -176
  68. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  69. package/dist/components/VvDialog/VvDialog.vue.d.ts +13 -4
  70. package/dist/components/VvDialog/index.d.ts +5 -0
  71. package/dist/components/VvDropdown/VvDropdown.es.js +165 -94
  72. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  73. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +111 -81
  74. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +66 -25
  75. package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +13 -1
  76. package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +12 -4
  77. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +35 -7
  78. package/dist/components/VvDropdown/index.d.ts +52 -10
  79. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +163 -53
  80. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  81. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +335 -8
  82. package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
  83. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +63 -20
  84. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
  85. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +188 -80
  86. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
  87. package/dist/components/VvIcon/VvIcon.es.js +24 -97
  88. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  89. package/dist/components/VvIcon/VvIcon.vue.d.ts +23 -66
  90. package/dist/components/VvIcon/index.d.ts +33 -48
  91. package/dist/components/VvInputFile/VvInputFile.es.js +1789 -0
  92. package/dist/components/VvInputFile/VvInputFile.umd.js +1 -0
  93. package/dist/components/VvInputFile/VvInputFile.vue.d.ts +391 -0
  94. package/dist/components/VvInputFile/index.d.ts +210 -0
  95. package/dist/components/VvInputText/VvInputClearAction.d.ts +7 -5
  96. package/dist/components/VvInputText/VvInputPasswordAction.d.ts +10 -8
  97. package/dist/components/VvInputText/VvInputStepAction.d.ts +2 -2
  98. package/dist/components/VvInputText/VvInputText.es.js +1489 -563
  99. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  100. package/dist/components/VvInputText/VvInputText.vue.d.ts +207 -57
  101. package/dist/components/VvInputText/index.d.ts +105 -30
  102. package/dist/components/VvNav/VvNav.es.js +160 -75
  103. package/dist/components/VvNav/VvNav.umd.js +1 -1
  104. package/dist/components/VvNav/VvNav.vue.d.ts +32 -9
  105. package/dist/components/VvNav/VvNavItem.vue.d.ts +1 -1
  106. package/dist/components/VvNav/VvNavSeparator.vue.d.ts +1 -1
  107. package/dist/components/VvNav/index.d.ts +5 -2
  108. package/dist/components/VvNavItem/VvNavItem.es.js +100 -39
  109. package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
  110. package/dist/components/VvProgress/VvProgress.es.js +73 -27
  111. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  112. package/dist/components/VvProgress/VvProgress.vue.d.ts +10 -3
  113. package/dist/components/VvProgress/index.d.ts +4 -1
  114. package/dist/components/VvRadio/VvRadio.es.js +313 -250
  115. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  116. package/dist/components/VvRadio/VvRadio.vue.d.ts +103 -31
  117. package/dist/components/VvRadio/index.d.ts +50 -17
  118. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +236 -128
  119. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  120. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +101 -30
  121. package/dist/components/VvRadioGroup/index.d.ts +45 -12
  122. package/dist/components/VvSelect/VvSelect.es.js +367 -300
  123. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  124. package/dist/components/VvSelect/VvSelect.vue.d.ts +232 -203
  125. package/dist/components/VvSelect/index.d.ts +195 -15
  126. package/dist/components/VvTab/VvTab.es.js +222 -97
  127. package/dist/components/VvTab/VvTab.umd.js +1 -1
  128. package/dist/components/VvTab/VvTab.vue.d.ts +31 -7
  129. package/dist/components/VvTab/index.d.ts +4 -1
  130. package/dist/components/VvTextarea/VvTextarea.es.js +258 -248
  131. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  132. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +156 -49
  133. package/dist/components/VvTextarea/index.d.ts +68 -19
  134. package/dist/components/VvTooltip/VvTooltip.es.js +83 -30
  135. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  136. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +13 -6
  137. package/dist/components/VvTooltip/index.d.ts +5 -2
  138. package/dist/components/common/HintSlot.d.ts +4 -5
  139. package/dist/components/index.d.ts +10 -0
  140. package/dist/components/index.es.js +4575 -2534
  141. package/dist/components/index.umd.js +1 -1
  142. package/dist/composables/alert/useAlert.d.ts +101 -6
  143. package/dist/composables/alert/useInjectAlert.d.ts +1 -6
  144. package/dist/composables/dropdown/useInjectDropdown.d.ts +3 -23
  145. package/dist/composables/dropdown/useProvideDropdown.d.ts +3 -4
  146. package/dist/composables/group/useInjectedGroupState.d.ts +4 -5
  147. package/dist/composables/group/useProvideGroupState.d.ts +3 -3
  148. package/dist/composables/index.d.ts +1 -0
  149. package/dist/composables/index.es.js +94 -5
  150. package/dist/composables/index.umd.js +1 -1
  151. package/dist/composables/useBlurhash.d.ts +7 -0
  152. package/dist/composables/useComponentFocus.d.ts +1 -1
  153. package/dist/composables/useComponentIcon.d.ts +9 -8
  154. package/dist/composables/useOptions.d.ts +4 -4
  155. package/dist/composables/usePersistence.d.ts +3 -0
  156. package/dist/composables/useUniqueId.d.ts +1 -1
  157. package/dist/composables/useVolver.d.ts +1 -1
  158. package/dist/constants.d.ts +34 -32
  159. package/dist/directives/index.d.ts +3 -5
  160. package/dist/directives/index.es.js +104 -45
  161. package/dist/directives/index.umd.js +1 -1
  162. package/dist/directives/v-contextmenu.es.js +1 -1
  163. package/dist/directives/v-contextmenu.umd.js +1 -1
  164. package/dist/directives/v-tooltip.es.js +101 -39
  165. package/dist/directives/v-tooltip.umd.js +1 -1
  166. package/dist/icons.es.js +267 -267
  167. package/dist/icons.umd.js +1 -1
  168. package/dist/index.d.ts +3 -1
  169. package/dist/index.es.js +92 -18
  170. package/dist/index.umd.js +1 -1
  171. package/dist/props/index.d.ts +272 -81
  172. package/dist/resolvers/unplugin.d.ts +6 -1
  173. package/dist/resolvers/unplugin.es.js +87 -10
  174. package/dist/resolvers/unplugin.umd.js +1 -1
  175. package/dist/stories/Accordion/Accordion.settings.d.ts +2 -57
  176. package/dist/stories/AccordionGroup/AccordionGroup.settings.d.ts +2 -66
  177. package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +2 -127
  178. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +1437 -495
  179. package/dist/stories/Alert/Alert.settings.d.ts +2 -109
  180. package/dist/stories/Alert/AlertModifiers.stories.d.ts +1 -1
  181. package/dist/stories/Alert/AlertSlots.stories.d.ts +1 -1
  182. package/dist/stories/AlertGroup/AlertGroup.settings.d.ts +2 -85
  183. package/dist/stories/AlertGroup/AlertGroupPosition.stories.d.ts +1 -1
  184. package/dist/stories/AlertGroup/AlertGroupSlots.stories.d.ts +1 -1
  185. package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +2 -2
  186. package/dist/stories/AvatarGroup/AvatarGroup.settings.d.ts +2 -38
  187. package/dist/stories/Badge/Badge.settings.d.ts +2 -26
  188. package/dist/stories/Badge/Badge.test.d.ts +1 -1
  189. package/dist/stories/Blurhash/BlurhashComposable.stories.d.ts +4 -0
  190. package/dist/stories/Breadcrumb/Breadcrumb.settings.d.ts +2 -18
  191. package/dist/stories/Breadcrumb/Breadcrumb.test.d.ts +1 -1
  192. package/dist/stories/Button/Button.settings.d.ts +2 -194
  193. package/dist/stories/ButtonGroup/ButtonGroup.settings.d.ts +2 -40
  194. package/dist/stories/Card/Card.settings.d.ts +2 -63
  195. package/dist/stories/Checkbox/Checkbox.settings.d.ts +2 -132
  196. package/dist/stories/CheckboxGroup/CheckboxGroup.settings.d.ts +1 -141
  197. package/dist/stories/Combobox/Combobox.settings.d.ts +2 -609
  198. package/dist/stories/Combobox/Combobox.stories.d.ts +1 -0
  199. package/dist/stories/Combobox/ComboboxMultiple.stories.d.ts +1 -0
  200. package/dist/stories/Dialog/Dialog.settings.d.ts +2 -47
  201. package/dist/stories/Dialog/DialogModifiers.stories.d.ts +8 -0
  202. package/dist/stories/Dropdown/Dropdown.settings.d.ts +2 -205
  203. package/dist/stories/Icon/Icon.settings.d.ts +3 -68
  204. package/dist/stories/InputFile/InputFile.settings.d.ts +6 -0
  205. package/dist/stories/InputFile/InputFile.stories.d.ts +12 -0
  206. package/dist/stories/InputFile/InputFileDropArea.stories.d.ts +9 -0
  207. package/dist/stories/InputFile/InputFileIconPosition.stories.d.ts +8 -0
  208. package/dist/stories/InputFile/InputFileSlots.stories.d.ts +7 -0
  209. package/dist/stories/InputText/InputText.settings.d.ts +2 -438
  210. package/dist/stories/Nav/Nav.settings.d.ts +2 -10
  211. package/dist/stories/Progress/Progress.settings.d.ts +2 -27
  212. package/dist/stories/Radio/Radio.settings.d.ts +1 -110
  213. package/dist/stories/RadioGroup/RadioGroup.settings.d.ts +1 -141
  214. package/dist/stories/Select/Select.settings.d.ts +2 -246
  215. package/dist/stories/Select/Select.stories.d.ts +1 -0
  216. package/dist/stories/Tab/Tab.settings.d.ts +2 -15
  217. package/dist/stories/Textarea/Textarea.settings.d.ts +2 -287
  218. package/dist/stories/argTypes.d.ts +27 -866
  219. package/dist/test/expect.d.ts +1 -1
  220. package/dist/test/options.d.ts +1 -1
  221. package/dist/test/sleep.d.ts +1 -1
  222. package/dist/types/alert.d.ts +9 -7
  223. package/dist/types/blurhash.d.ts +12 -0
  224. package/dist/types/generic.d.ts +1 -2
  225. package/dist/types/group.d.ts +37 -15
  226. package/dist/types/index.d.ts +7 -0
  227. package/dist/types/input-file.d.ts +16 -0
  228. package/dist/types/nav.d.ts +2 -2
  229. package/dist/utils/ObjectUtilities.d.ts +7 -8
  230. package/dist/workers/blurhash.d.ts +1 -0
  231. package/package.json +239 -246
  232. package/src/Volver.ts +245 -234
  233. package/src/assets/icons/detailed.json +1 -1
  234. package/src/assets/icons/normal.json +1 -1
  235. package/src/assets/icons/simple.json +1 -1
  236. package/src/components/VvAccordion/VvAccordion.vue +163 -100
  237. package/src/components/VvAccordion/index.ts +64 -79
  238. package/src/components/VvAccordionGroup/VvAccordionGroup.vue +223 -105
  239. package/src/components/VvAccordionGroup/index.ts +42 -42
  240. package/src/components/VvAction/VvAction.vue +144 -130
  241. package/src/components/VvAlert/VvAlert.vue +72 -70
  242. package/src/components/VvAlert/index.ts +149 -147
  243. package/src/components/VvAlertGroup/VvAlertGroup.vue +57 -56
  244. package/src/components/VvAlertGroup/index.ts +101 -117
  245. package/src/components/VvAvatar/VvAvatar.vue +20 -14
  246. package/src/components/VvAvatar/index.ts +5 -5
  247. package/src/components/VvAvatarGroup/VvAvatarGroup.vue +58 -53
  248. package/src/components/VvAvatarGroup/index.ts +21 -21
  249. package/src/components/VvBadge/VvBadge.vue +15 -14
  250. package/src/components/VvBadge/index.ts +2 -2
  251. package/src/components/VvBreadcrumb/VvBreadcrumb.vue +50 -48
  252. package/src/components/VvBreadcrumb/index.ts +3 -9
  253. package/src/components/VvButton/VvButton.vue +163 -152
  254. package/src/components/VvButton/index.ts +103 -110
  255. package/src/components/VvButtonGroup/VvButtonGroup.vue +72 -64
  256. package/src/components/VvButtonGroup/index.ts +22 -21
  257. package/src/components/VvCard/VvCard.vue +30 -30
  258. package/src/components/VvCard/index.ts +2 -2
  259. package/src/components/VvCheckbox/VvCheckbox.vue +185 -183
  260. package/src/components/VvCheckbox/index.ts +44 -44
  261. package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +88 -87
  262. package/src/components/VvCombobox/VvCombobox.vue +639 -619
  263. package/src/components/VvCombobox/index.ts +206 -164
  264. package/src/components/VvDialog/VvDialog.vue +141 -129
  265. package/src/components/VvDialog/index.ts +38 -36
  266. package/src/components/VvDropdown/VvDropdown.vue +466 -445
  267. package/src/components/VvDropdown/VvDropdownAction.vue +37 -39
  268. package/src/components/VvDropdown/VvDropdownItem.vue +30 -26
  269. package/src/components/VvDropdown/VvDropdownOptgroup.vue +13 -12
  270. package/src/components/VvDropdown/VvDropdownOption.vue +47 -64
  271. package/src/components/VvDropdown/index.ts +61 -27
  272. package/src/components/VvIcon/README.md +1 -1
  273. package/src/components/VvIcon/VvIcon.vue +133 -133
  274. package/src/components/VvIcon/index.ts +84 -97
  275. package/src/components/VvInputFile/VvInputFile.vue +402 -0
  276. package/src/components/VvInputFile/index.ts +141 -0
  277. package/src/components/VvInputText/VvInputClearAction.ts +51 -47
  278. package/src/components/VvInputText/VvInputPasswordAction.ts +66 -62
  279. package/src/components/VvInputText/VvInputStepAction.ts +43 -43
  280. package/src/components/VvInputText/VvInputText.vue +638 -516
  281. package/src/components/VvInputText/VvInputTextActions.ts +86 -86
  282. package/src/components/VvInputText/index.ts +200 -185
  283. package/src/components/VvNav/VvNav.vue +40 -36
  284. package/src/components/VvNav/VvNavItem.vue +12 -12
  285. package/src/components/VvNav/VvNavSeparator.vue +6 -6
  286. package/src/components/VvNav/index.ts +2 -2
  287. package/src/components/VvProgress/VvProgress.vue +27 -27
  288. package/src/components/VvProgress/index.ts +28 -28
  289. package/src/components/VvRadio/VvRadio.vue +115 -112
  290. package/src/components/VvRadio/index.ts +28 -28
  291. package/src/components/VvRadioGroup/VvRadioGroup.vue +91 -90
  292. package/src/components/VvSelect/VvSelect.vue +262 -241
  293. package/src/components/VvSelect/index.ts +88 -63
  294. package/src/components/VvTab/VvTab.vue +79 -69
  295. package/src/components/VvTab/index.ts +12 -12
  296. package/src/components/VvTextarea/VvTextarea.vue +218 -219
  297. package/src/components/VvTextarea/index.ts +35 -35
  298. package/src/components/VvTooltip/VvTooltip.vue +22 -16
  299. package/src/components/VvTooltip/index.ts +12 -12
  300. package/src/components/common/HintSlot.ts +149 -150
  301. package/src/components/index.ts +10 -0
  302. package/src/composables/alert/useAlert.ts +76 -73
  303. package/src/composables/alert/useInjectAlert.ts +1 -1
  304. package/src/composables/alert/useProvideAlert.ts +10 -10
  305. package/src/composables/dropdown/useInjectDropdown.ts +6 -6
  306. package/src/composables/dropdown/useProvideDropdown.ts +63 -63
  307. package/src/composables/group/useInjectedGroupState.ts +46 -42
  308. package/src/composables/group/useProvideGroupState.ts +9 -15
  309. package/src/composables/index.ts +1 -0
  310. package/src/composables/useBlurhash.ts +68 -0
  311. package/src/composables/useComponentFocus.ts +9 -9
  312. package/src/composables/useComponentIcon.ts +36 -35
  313. package/src/composables/useDebouncedInput.ts +25 -25
  314. package/src/composables/useDefaults.ts +77 -76
  315. package/src/composables/useModifiers.ts +29 -29
  316. package/src/composables/useOptions.ts +52 -43
  317. package/src/composables/usePersistence.ts +74 -0
  318. package/src/composables/useTextCount.ts +44 -44
  319. package/src/composables/useUniqueId.ts +3 -2
  320. package/src/composables/useVolver.ts +1 -1
  321. package/src/constants.ts +97 -82
  322. package/src/directives/index.ts +3 -6
  323. package/src/directives/v-contextmenu.ts +34 -34
  324. package/src/directives/v-tooltip.ts +18 -9
  325. package/src/index.ts +6 -4
  326. package/src/props/index.ts +457 -380
  327. package/src/resolvers/unplugin.ts +146 -136
  328. package/src/shims.d.ts +4 -5
  329. package/src/stories/Accordion/Accordion.settings.ts +51 -50
  330. package/src/stories/Accordion/Accordion.stories.ts +21 -21
  331. package/src/stories/Accordion/Accordion.test.ts +56 -54
  332. package/src/stories/Accordion/AccordionSlots.stories.ts +13 -13
  333. package/src/stories/AccordionGroup/AccordionGroup.settings.ts +70 -67
  334. package/src/stories/AccordionGroup/AccordionGroup.stories.ts +41 -39
  335. package/src/stories/AccordionGroup/AccordionGroup.test.ts +49 -45
  336. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.ts +35 -35
  337. package/src/stories/Alert/Alert.settings.ts +117 -116
  338. package/src/stories/Alert/Alert.stories.ts +30 -30
  339. package/src/stories/Alert/Alert.test.ts +78 -80
  340. package/src/stories/Alert/AlertModifiers.stories.ts +45 -45
  341. package/src/stories/Alert/AlertSlots.stories.ts +35 -35
  342. package/src/stories/AlertGroup/AlertGroup.settings.ts +107 -105
  343. package/src/stories/AlertGroup/AlertGroup.stories.ts +25 -25
  344. package/src/stories/AlertGroup/AlertGroup.test.ts +67 -69
  345. package/src/stories/AlertGroup/AlertGroupPosition.stories.ts +68 -68
  346. package/src/stories/AlertGroup/AlertGroupSlots.stories.ts +23 -23
  347. package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +58 -58
  348. package/src/stories/Avatar/Avatar.settings.ts +29 -29
  349. package/src/stories/Avatar/Avatar.stories.ts +23 -23
  350. package/src/stories/Avatar/Avatar.test.ts +22 -24
  351. package/src/stories/Avatar/AvatarBadge.stories.ts +15 -15
  352. package/src/stories/Avatar/AvatarModifiers.stories.ts +61 -61
  353. package/src/stories/Avatar/AvatarSlots.stories.ts +18 -18
  354. package/src/stories/AvatarGroup/AvatarGroup.settings.ts +54 -53
  355. package/src/stories/AvatarGroup/AvatarGroup.stories.ts +17 -17
  356. package/src/stories/AvatarGroup/AvatarGroup.test.ts +24 -26
  357. package/src/stories/AvatarGroup/AvatarGroupModifiers.stories.ts +15 -15
  358. package/src/stories/AvatarGroup/AvatarGroupSlotDefault.stories.ts +17 -17
  359. package/src/stories/Badge/Badge.settings.ts +21 -20
  360. package/src/stories/Badge/Badge.stories.ts +24 -24
  361. package/src/stories/Badge/Badge.test.ts +8 -8
  362. package/src/stories/Badge/BadgeSlots.stories.ts +10 -10
  363. package/src/stories/Blurhash/BlurhashComposable.stories.ts +196 -0
  364. package/src/stories/Breadcrumb/Breadcrumb.settings.ts +35 -34
  365. package/src/stories/Breadcrumb/Breadcrumb.stories.ts +23 -23
  366. package/src/stories/Breadcrumb/Breadcrumb.test.ts +44 -43
  367. package/src/stories/Breadcrumb/BreadcrumbSlots.stories.ts +17 -17
  368. package/src/stories/Button/Button.settings.ts +146 -150
  369. package/src/stories/Button/Button.stories.ts +19 -19
  370. package/src/stories/Button/Button.test.ts +41 -42
  371. package/src/stories/Button/ButtonIcon.stories.ts +42 -42
  372. package/src/stories/Button/ButtonLink.stories.ts +24 -24
  373. package/src/stories/Button/ButtonLoading.stories.ts +22 -22
  374. package/src/stories/Button/ButtonModifiers.stories.ts +91 -91
  375. package/src/stories/Button/ButtonSlots.stories.ts +47 -47
  376. package/src/stories/Button/ButtonState.stories.ts +23 -23
  377. package/src/stories/Button/ButtonToggle.stories.ts +30 -30
  378. package/src/stories/ButtonGroup/ButtonGroup.settings.ts +33 -24
  379. package/src/stories/ButtonGroup/ButtonGroup.stories.ts +20 -20
  380. package/src/stories/ButtonGroup/ButtonGroup.test.ts +23 -26
  381. package/src/stories/ButtonGroup/ButtonGroupModifiers.stories.ts +20 -20
  382. package/src/stories/ButtonGroup/ButtonGroupSlots.stories.ts +18 -18
  383. package/src/stories/ButtonGroup/ButtonGroupToggle.stories.ts +22 -22
  384. package/src/stories/Card/Card.settings.ts +49 -48
  385. package/src/stories/Card/Card.stories.ts +22 -22
  386. package/src/stories/Card/Card.test.ts +14 -16
  387. package/src/stories/Card/CardSlots.stories.ts +42 -42
  388. package/src/stories/Checkbox/Checkbox.settings.ts +36 -35
  389. package/src/stories/Checkbox/Checkbox.stories.ts +57 -57
  390. package/src/stories/Checkbox/Checkbox.test.ts +63 -66
  391. package/src/stories/Checkbox/CheckboxBinary.stories.ts +18 -18
  392. package/src/stories/Checkbox/CheckboxSlots.stories.ts +15 -15
  393. package/src/stories/CheckboxGroup/CheckboxGroup.settings.ts +9 -9
  394. package/src/stories/CheckboxGroup/CheckboxGroup.stories.ts +50 -50
  395. package/src/stories/CheckboxGroup/CheckboxGroup.test.ts +63 -67
  396. package/src/stories/CheckboxGroup/CheckboxGroupOptions.stories.ts +34 -34
  397. package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.ts +23 -23
  398. package/src/stories/Combobox/Combobox.settings.ts +407 -384
  399. package/src/stories/Combobox/Combobox.stories.ts +116 -107
  400. package/src/stories/Combobox/Combobox.test.ts +91 -91
  401. package/src/stories/Combobox/ComboboxIconPosition.stories.ts +25 -24
  402. package/src/stories/Combobox/ComboboxMultiple.stories.ts +32 -22
  403. package/src/stories/Combobox/ComboboxOptions.stories.ts +81 -84
  404. package/src/stories/Combobox/ComboboxSlots.stories.ts +56 -55
  405. package/src/stories/Dialog/Dialog.settings.ts +49 -40
  406. package/src/stories/Dialog/Dialog.stories.ts +28 -28
  407. package/src/stories/Dialog/Dialog.test.ts +49 -54
  408. package/src/stories/Dialog/DialogModifiers.stories.ts +42 -0
  409. package/src/stories/Dialog/DialogSlots.stories.ts +20 -20
  410. package/src/stories/Dropdown/Dropdown.settings.ts +63 -62
  411. package/src/stories/Dropdown/Dropdown.stories.ts +59 -59
  412. package/src/stories/Dropdown/Dropdown.test.ts +9 -13
  413. package/src/stories/Dropdown/DropdownContextmenuDirective.stories.ts +16 -16
  414. package/src/stories/Dropdown/DropdownMultilevel.stories.ts +18 -18
  415. package/src/stories/Dropdown/DropdownSlots.stories.ts +50 -50
  416. package/src/stories/Icon/Icon.settings.ts +66 -65
  417. package/src/stories/Icon/Icon.stories.ts +28 -29
  418. package/src/stories/Icon/IconsCollection.stories.ts +22 -22
  419. package/src/stories/InputFile/InputFile.settings.ts +37 -0
  420. package/src/stories/InputFile/InputFile.stories.ts +89 -0
  421. package/src/stories/InputFile/InputFileDropArea.stories.ts +56 -0
  422. package/src/stories/InputFile/InputFileIconPosition.stories.ts +43 -0
  423. package/src/stories/InputFile/InputFileSlots.stories.ts +33 -0
  424. package/src/stories/InputText/InputText.settings.ts +246 -244
  425. package/src/stories/InputText/InputText.stories.ts +67 -67
  426. package/src/stories/InputText/InputText.test.ts +118 -121
  427. package/src/stories/InputText/InputTextIconPosition.stories.ts +24 -24
  428. package/src/stories/InputText/InputTextLength.stories.ts +33 -33
  429. package/src/stories/InputText/InputTextMask.stories.ts +91 -91
  430. package/src/stories/InputText/InputTextMinMax.stories.ts +30 -30
  431. package/src/stories/InputText/InputTextSlots.stories.ts +20 -20
  432. package/src/stories/InputText/InputTextType.stories.ts +70 -70
  433. package/src/stories/Nav/Nav.settings.ts +27 -27
  434. package/src/stories/Nav/Nav.stories.ts +18 -18
  435. package/src/stories/Nav/Nav.test.ts +10 -12
  436. package/src/stories/Nav/NavModifiers.stories.ts +25 -25
  437. package/src/stories/Progress/Progress.settings.ts +24 -23
  438. package/src/stories/Progress/Progress.stories.ts +23 -23
  439. package/src/stories/Progress/Progress.test.ts +4 -4
  440. package/src/stories/Radio/Radio.settings.ts +9 -9
  441. package/src/stories/Radio/Radio.stories.ts +47 -47
  442. package/src/stories/Radio/Radio.test.ts +54 -57
  443. package/src/stories/Radio/RadioSlots.stories.ts +15 -15
  444. package/src/stories/RadioGroup/RadioGroup.settings.ts +9 -9
  445. package/src/stories/RadioGroup/RadioGroup.stories.ts +51 -52
  446. package/src/stories/RadioGroup/RadioGroup.test.ts +63 -67
  447. package/src/stories/RadioGroup/RadioGroupOptions.stories.ts +35 -35
  448. package/src/stories/RadioGroup/RadioGroupSlots.stories.ts +23 -23
  449. package/src/stories/Select/Select.settings.ts +71 -70
  450. package/src/stories/Select/Select.stories.ts +75 -66
  451. package/src/stories/Select/Select.test.ts +67 -70
  452. package/src/stories/Select/SelectIconPosition.stories.ts +27 -26
  453. package/src/stories/Select/SelectOptions.stories.ts +55 -55
  454. package/src/stories/Select/SelectSlots.stories.ts +21 -20
  455. package/src/stories/Tab/Tab.settings.ts +34 -34
  456. package/src/stories/Tab/Tab.stories.ts +17 -17
  457. package/src/stories/Tab/Tab.test.ts +17 -19
  458. package/src/stories/Textarea/Textarea.settings.ts +79 -77
  459. package/src/stories/Textarea/Textarea.stories.ts +63 -63
  460. package/src/stories/Textarea/Textarea.test.ts +70 -73
  461. package/src/stories/Textarea/TextareaLength.stories.ts +33 -33
  462. package/src/stories/Textarea/TextareaSlots.stories.ts +20 -20
  463. package/src/stories/Textarea/TextareatIconPosition.stories.ts +24 -24
  464. package/src/stories/Tooltip/Tooltip.settings.ts +16 -17
  465. package/src/stories/Tooltip/Tooltip.stories.ts +18 -18
  466. package/src/stories/Tooltip/Tooltip.test.ts +53 -54
  467. package/src/stories/Tooltip/TooltipDirective.stories.ts +37 -37
  468. package/src/stories/argTypes.ts +506 -505
  469. package/src/test/expect.ts +72 -77
  470. package/src/test/options.ts +17 -16
  471. package/src/test/sleep.ts +3 -2
  472. package/src/test/types.d.ts +11 -11
  473. package/src/types/alert.ts +21 -17
  474. package/src/types/blurhash.ts +21 -0
  475. package/src/types/generic.ts +2 -3
  476. package/src/types/group.ts +34 -26
  477. package/src/types/index.ts +7 -0
  478. package/src/types/input-file.ts +18 -0
  479. package/src/types/nav.ts +13 -14
  480. package/src/utils/ObjectUtilities.ts +192 -188
  481. package/src/workers/blurhash.ts +9 -0
@@ -1,8 +1,10 @@
1
- import { unref, computed, isRef, defineComponent, h, inject, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, watch, useSlots, onMounted, createElementBlock, normalizeClass, toDisplayString, createElementVNode, renderSlot, normalizeProps, guardReactiveProps, withModifiers, createTextVNode, createVNode, createSlots, withCtx } from "vue";
1
+ import { unref, computed, isRef, defineComponent, h, inject, mergeDefaults, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, provide, Fragment, useAttrs, onMounted, watch, nextTick, createElementBlock, createVNode, withCtx, renderSlot, normalizeProps, guardReactiveProps, Transition, toHandlers, withDirectives, createElementVNode, normalizeStyle, normalizeClass, vShow, createTextVNode, toDisplayString, useSlots, withModifiers, createSlots, renderList } from "vue";
2
2
  import { useIMask } from "vue-imask";
3
3
  import { iconExists, Icon, addIcon } from "@iconify/vue";
4
+ import { autoPlacement, flip, shift, size, offset, arrow, useFloating, autoUpdate } from "@floating-ui/vue";
4
5
  import { uid } from "uid";
5
- import { useFocus, useElementVisibility } from "@vueuse/core";
6
+ import { useMutationObserver, useVModel, onClickOutside, useFocusWithin, useElementHover, onKeyStroke, useFocus, useStorage, useElementVisibility } from "@vueuse/core";
7
+ import mitt from "mitt";
6
8
  function isEmpty(value) {
7
9
  return ((value2) => value2 === null || value2 === void 0 || value2 === "" || Array.isArray(value2) && value2.length === 0 || !(value2 instanceof Date) && typeof value2 === "object" && Object.keys(value2).length === 0)(unref(value));
8
10
  }
@@ -127,100 +129,27 @@ function HintSlotFactory(propsOrRef, slots) {
127
129
  HintSlot
128
130
  };
129
131
  }
130
- const VvIconProps = {
131
- /**
132
- * Color
133
- */
134
- color: String,
135
- /**
136
- * Width
137
- */
138
- width: {
139
- type: [String, Number]
140
- },
141
- /**
142
- * Height
143
- */
144
- height: {
145
- type: [String, Number]
146
- },
147
- /**
148
- * Icon name
149
- * Can be the full composition of iconify name "@{provider}:{prefix}:{name}" or "{prefix}:{name}" or "{name}"
150
- * https://docs.iconify.design/api/providers.html#provider-in-icon-name
151
- */
152
- name: {
153
- type: String,
154
- required: true
155
- },
156
- /**
157
- * By default 'vv'
158
- * If custom collection is not added with "addCollection" DS class method, this prop could not be used
159
- * Icon provider: https://docs.iconify.design/api/providers.html#provider-in-icon-name
160
- */
161
- provider: {
162
- type: String
163
- },
164
- /**
165
- * The name of icon set.
166
- * Icon default options prefix: simple | normal | detailed
167
- */
168
- prefix: {
169
- type: String,
170
- default: "normal"
171
- },
172
- /**
173
- * Url remote SVG icon
174
- */
175
- src: String,
176
- /**
177
- * Horizontal flip
178
- */
179
- horizontalFlip: Boolean,
180
- /**
181
- * Vertical flip
182
- */
183
- verticalFlip: Boolean,
184
- /**
185
- * String alternative to "horizontalFlip" and "verticalFlip".
186
- * Example: https://docs.iconify.design/icon-components/vue/transform.html
187
- */
188
- flip: String,
189
- /**
190
- * Icon render mode
191
- * 'style' = 'bg' or 'mask', depending on icon content
192
- * 'bg' = span with style using `background`
193
- * 'mask' = span with style using `mask`
194
- * 'svg' = svg
195
- * Iconify doc: https://docs.iconify.design/iconify-icon/modes.html
196
- */
197
- mode: String,
198
- /**
199
- * Toggles inline or block mode
200
- * Example https://docs.iconify.design/icon-components/vue/inline.html
201
- */
202
- inline: Boolean,
203
- /**
204
- * rotates icon
205
- * Example https://docs.iconify.design/icon-components/vue/transform.html
206
- */
207
- rotate: [Number, String],
208
- /**
209
- * A callback that is called when icon data has been loaded
210
- */
211
- onLoad: Function,
212
- /**
213
- * SVG icon string
214
- */
215
- svg: String,
216
- /**
217
- * Icon modifiers: vv-icon css helper classes, value/s are concatened with prefix 'vv-icon--'
218
- * @values string | string[]
219
- */
220
- modifiers: {
221
- type: [String, Array]
222
- }
132
+ const ACTION_ICONS = {
133
+ showPassword: "eye-on",
134
+ hidePassword: "eye-off",
135
+ showDatePicker: "calendar",
136
+ showTimePicker: "time",
137
+ showColorPicker: "color",
138
+ clear: "close",
139
+ add: "add",
140
+ remove: "trash",
141
+ edit: "edit",
142
+ download: "download"
223
143
  };
144
+ const VvIconPropsDefaults = {
145
+ prefix: "normal"
146
+ /* normal */
147
+ };
148
+ var StorageType = /* @__PURE__ */ ((StorageType2) => {
149
+ StorageType2["local"] = "local";
150
+ StorageType2["session"] = "session";
151
+ return StorageType2;
152
+ })(StorageType || {});
224
153
  var Strategy = /* @__PURE__ */ ((Strategy2) => {
225
154
  Strategy2["absolute"] = "absolute";
226
155
  Strategy2["fixed"] = "fixed";
@@ -255,14 +184,39 @@ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
255
184
  ButtonType2["reset"] = "reset";
256
185
  return ButtonType2;
257
186
  })(ButtonType || {});
258
- var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
259
- AnchorTarget2["_blank"] = "_blank";
260
- AnchorTarget2["_self"] = "_self";
261
- AnchorTarget2["_parent"] = "_parent";
262
- AnchorTarget2["_top"] = "_top";
263
- return AnchorTarget2;
264
- })(AnchorTarget || {});
187
+ var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
188
+ ActionTag2["nuxtLink"] = "nuxt-link";
189
+ ActionTag2["routerLink"] = "router-link";
190
+ ActionTag2["a"] = "a";
191
+ ActionTag2["button"] = "button";
192
+ return ActionTag2;
193
+ })(ActionTag || {});
194
+ var ActionRoles = /* @__PURE__ */ ((ActionRoles2) => {
195
+ ActionRoles2["button"] = "button";
196
+ ActionRoles2["link"] = "link";
197
+ ActionRoles2["menuitem"] = "menuitem";
198
+ return ActionRoles2;
199
+ })(ActionRoles || {});
200
+ var DropdownRole = /* @__PURE__ */ ((DropdownRole2) => {
201
+ DropdownRole2["listbox"] = "listbox";
202
+ DropdownRole2["menu"] = "menu";
203
+ return DropdownRole2;
204
+ })(DropdownRole || {});
205
+ var DropdownItemRole = /* @__PURE__ */ ((DropdownItemRole2) => {
206
+ DropdownItemRole2["option"] = "option";
207
+ DropdownItemRole2["presentation"] = "presentation";
208
+ return DropdownItemRole2;
209
+ })(DropdownItemRole || {});
265
210
  const INJECTION_KEY_VOLVER = Symbol.for("volver");
211
+ const INJECTION_KEY_DROPDOWN_TRIGGER = Symbol.for(
212
+ "dropdownTrigger"
213
+ );
214
+ const INJECTION_KEY_DROPDOWN_ITEM = Symbol.for(
215
+ "dropdownItem"
216
+ );
217
+ const INJECTION_KEY_DROPDOWN_ACTION = Symbol.for(
218
+ "dropdownAction"
219
+ );
266
220
  function useVolver() {
267
221
  return inject(INJECTION_KEY_VOLVER);
268
222
  }
@@ -289,17 +243,34 @@ function useModifiers(prefix, modifiers, others) {
289
243
  return toReturn;
290
244
  });
291
245
  }
292
- const __default__$1 = {
246
+ const __default__$4 = {
293
247
  name: "VvIcon"
294
248
  };
295
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
296
- ...__default__$1,
297
- props: VvIconProps,
249
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
250
+ ...__default__$4,
251
+ props: /* @__PURE__ */ mergeDefaults({
252
+ name: {},
253
+ color: {},
254
+ width: {},
255
+ height: {},
256
+ provider: {},
257
+ prefix: {},
258
+ src: {},
259
+ horizontalFlip: { type: Boolean },
260
+ verticalFlip: { type: Boolean },
261
+ flip: {},
262
+ mode: {},
263
+ inline: { type: Boolean },
264
+ rotate: {},
265
+ onLoad: { type: Function },
266
+ svg: {},
267
+ modifiers: {}
268
+ }, VvIconPropsDefaults),
298
269
  setup(__props) {
299
270
  const props = __props;
300
271
  const hasRotate = computed(() => {
301
272
  if (typeof props.rotate === "string") {
302
- return parseFloat(props.rotate);
273
+ return Number.parseFloat(props.rotate);
303
274
  }
304
275
  return props.rotate;
305
276
  });
@@ -381,8 +352,203 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
381
352
  color: _ctx.color,
382
353
  onLoad: _ctx.onLoad,
383
354
  icon: unref(icon)
384
- }), null, 16, ["class"])) : createCommentVNode("", true);
355
+ }), null, 16, ["class"])) : createCommentVNode("v-if", true);
356
+ };
357
+ }
358
+ });
359
+ function useComponentIcon(icon, iconPosition) {
360
+ const hasIcon = computed(() => {
361
+ if (typeof (icon == null ? void 0 : icon.value) === "string") {
362
+ return { name: icon == null ? void 0 : icon.value };
363
+ }
364
+ return icon == null ? void 0 : icon.value;
365
+ });
366
+ const hasIconBefore = computed(
367
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Position.before ? hasIcon.value : void 0
368
+ );
369
+ const hasIconAfter = computed(
370
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Position.after ? hasIcon.value : void 0
371
+ );
372
+ const hasIconLeft = computed(
373
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Side.left ? hasIcon.value : void 0
374
+ );
375
+ const hasIconRight = computed(
376
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Side.right ? hasIcon.value : void 0
377
+ );
378
+ const hasIconTop = computed(
379
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Side.top ? hasIcon.value : void 0
380
+ );
381
+ const hasIconBottom = computed(
382
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Side.bottom ? hasIcon.value : void 0
383
+ );
384
+ return {
385
+ hasIcon,
386
+ hasIconLeft,
387
+ hasIconRight,
388
+ hasIconTop,
389
+ hasIconBottom,
390
+ hasIconBefore,
391
+ hasIconAfter
392
+ };
393
+ }
394
+ const VvInputPasswordAction = defineComponent({
395
+ components: {
396
+ VvIcon: _sfc_main$4
397
+ },
398
+ props: {
399
+ disabled: {
400
+ type: Boolean,
401
+ default: false
402
+ },
403
+ labelShow: {
404
+ type: String,
405
+ default: "Show password"
406
+ },
407
+ labelHide: {
408
+ type: String,
409
+ default: "Hide password"
410
+ },
411
+ iconShow: {
412
+ type: [String, Object],
413
+ default: ACTION_ICONS.showPassword
414
+ },
415
+ iconHide: {
416
+ type: [String, Object],
417
+ default: ACTION_ICONS.hidePassword
418
+ }
419
+ },
420
+ emits: ["toggle-password"],
421
+ setup(props, { emit }) {
422
+ const active = ref(false);
423
+ const activeIcon = computed(
424
+ () => active.value ? props.iconHide : props.iconShow
425
+ );
426
+ const { hasIcon } = useComponentIcon(activeIcon);
427
+ function onClick(e) {
428
+ e == null ? void 0 : e.stopPropagation();
429
+ if (!props.disabled) {
430
+ active.value = !active.value;
431
+ emit("toggle-password", active.value);
432
+ }
433
+ }
434
+ return {
435
+ active,
436
+ activeIcon,
437
+ hasIcon,
438
+ onClick
439
+ };
440
+ },
441
+ render() {
442
+ const icon = this.hasIcon ? h(_sfc_main$4, {
443
+ ...this.hasIcon,
444
+ class: "vv-input-text__icon"
445
+ }) : void 0;
446
+ return h(
447
+ "button",
448
+ {
449
+ disabled: this.disabled,
450
+ class: "vv-input-text__action",
451
+ ariaLabel: this.active ? this.labelHide : this.labelShow,
452
+ type: "button",
453
+ onClick: this.onClick
454
+ },
455
+ icon
456
+ );
457
+ }
458
+ });
459
+ const VvInputStepAction = defineComponent({
460
+ components: {
461
+ VvIcon: _sfc_main$4
462
+ },
463
+ props: {
464
+ disabled: {
465
+ type: Boolean,
466
+ default: false
467
+ },
468
+ label: {
469
+ type: String
470
+ },
471
+ mode: {
472
+ type: String,
473
+ validator: (v) => ["up", "down"].includes(v),
474
+ default: "up"
475
+ }
476
+ },
477
+ emits: ["step-up", "step-down"],
478
+ setup(props, { emit }) {
479
+ const isUp = computed(() => props.mode === "up");
480
+ const onClick = (e) => {
481
+ e == null ? void 0 : e.stopPropagation();
482
+ if (!props.disabled) {
483
+ emit(isUp.value ? "step-up" : "step-down");
484
+ }
485
+ };
486
+ return {
487
+ isUp,
488
+ onClick
489
+ };
490
+ },
491
+ render() {
492
+ return h("button", {
493
+ class: [
494
+ "vv-input-text__action vv-input-text__action-chevron",
495
+ this.isUp && "vv-input-text__action-chevron-up"
496
+ ],
497
+ disabled: this.disabled,
498
+ ariaLabel: this.label,
499
+ type: "button",
500
+ onClick: this.onClick
501
+ });
502
+ }
503
+ });
504
+ const VvInputClearAction = defineComponent({
505
+ components: {
506
+ VvIcon: _sfc_main$4
507
+ },
508
+ props: {
509
+ disabled: {
510
+ type: Boolean,
511
+ default: false
512
+ },
513
+ label: {
514
+ type: String,
515
+ default: "Clear"
516
+ },
517
+ icon: {
518
+ type: [String, Object],
519
+ default: "close"
520
+ }
521
+ },
522
+ emits: ["clear"],
523
+ setup(props, { emit }) {
524
+ const { hasIcon } = useComponentIcon(computed(() => props.icon));
525
+ function onClick(e) {
526
+ e == null ? void 0 : e.stopPropagation();
527
+ if (!props.disabled) {
528
+ emit("clear");
529
+ }
530
+ }
531
+ return {
532
+ hasIcon,
533
+ onClick
385
534
  };
535
+ },
536
+ render() {
537
+ const icon = this.hasIcon ? h(_sfc_main$4, {
538
+ ...this.hasIcon,
539
+ class: "vv-input-text__icon"
540
+ }) : void 0;
541
+ return h(
542
+ "button",
543
+ {
544
+ disabled: this.disabled,
545
+ class: "vv-input-text__action",
546
+ ariaLabel: this.label,
547
+ type: "button",
548
+ onClick: this.onClick
549
+ },
550
+ icon
551
+ );
386
552
  }
387
553
  });
388
554
  const LinkProps = {
@@ -400,10 +566,7 @@ const LinkProps = {
400
566
  /**
401
567
  * Anchor target
402
568
  */
403
- target: {
404
- type: String,
405
- validator: (value) => Object.values(AnchorTarget).includes(value)
406
- },
569
+ target: String,
407
570
  /**
408
571
  * Anchor rel
409
572
  */
@@ -416,27 +579,33 @@ const ValidProps = {
416
579
  /**
417
580
  * Valid status
418
581
  */
419
- valid: Boolean,
582
+ valid: { type: Boolean, default: false },
420
583
  /**
421
584
  * Valid label
422
585
  */
423
- validLabel: [String, Array]
586
+ validLabel: { type: [String, Array], default: void 0 }
424
587
  };
425
588
  const InvalidProps = {
426
589
  /**
427
590
  * Invalid status
428
591
  */
429
- invalid: Boolean,
592
+ invalid: {
593
+ type: Boolean,
594
+ default: false
595
+ },
430
596
  /**
431
597
  * Invalid label
432
598
  */
433
- invalidLabel: [String, Array]
599
+ invalidLabel: { type: [String, Array], default: void 0 }
434
600
  };
435
601
  const LoadingProps = {
436
602
  /**
437
603
  * Loading status
438
604
  */
439
- loading: Boolean,
605
+ loading: {
606
+ type: Boolean,
607
+ default: false
608
+ },
440
609
  /**
441
610
  * Loading label
442
611
  */
@@ -449,43 +618,73 @@ const DisabledProps = {
449
618
  /**
450
619
  * Whether the form control is disabled
451
620
  */
452
- disabled: Boolean
621
+ disabled: {
622
+ type: Boolean,
623
+ default: false
624
+ }
625
+ };
626
+ const SelectedProps = {
627
+ /**
628
+ * Whether the item is selected
629
+ */
630
+ selected: {
631
+ type: Boolean,
632
+ default: false
633
+ }
453
634
  };
454
635
  const ActiveProps = {
455
636
  /**
456
637
  * Whether the item is active
457
638
  */
458
- active: Boolean
639
+ active: {
640
+ type: Boolean,
641
+ default: false
642
+ }
459
643
  };
460
644
  const CurrentProps = {
461
645
  /**
462
646
  * Whether the item is current
463
647
  */
464
- current: Boolean
648
+ current: {
649
+ type: Boolean,
650
+ default: false
651
+ }
465
652
  };
466
653
  const PressedProps = {
467
654
  /**
468
655
  * Whether the item is pressed
469
656
  */
470
- pressed: Boolean
657
+ pressed: {
658
+ type: Boolean,
659
+ default: false
660
+ }
471
661
  };
472
662
  const LabelProps = {
473
663
  /**
474
664
  * The item label
475
665
  */
476
- label: [String, Number]
666
+ label: {
667
+ type: [String, Number],
668
+ default: void 0
669
+ }
477
670
  };
478
671
  const ReadonlyProps = {
479
672
  /**
480
673
  * The value is not editable
481
674
  */
482
- readonly: Boolean
675
+ readonly: {
676
+ type: Boolean,
677
+ default: false
678
+ }
483
679
  };
484
680
  const ModifiersProps = {
485
681
  /**
486
682
  * Component BEM modifiers
487
683
  */
488
- modifiers: [String, Array]
684
+ modifiers: {
685
+ type: [String, Array],
686
+ default: void 0
687
+ }
489
688
  };
490
689
  const HintProps = {
491
690
  hintLabel: { type: String, default: "" }
@@ -504,14 +703,20 @@ const DebounceProps = {
504
703
  /**
505
704
  * Milliseconds to wait before emitting the input event
506
705
  */
507
- debounce: [Number, String]
706
+ debounce: {
707
+ type: [Number, String],
708
+ default: void 0
709
+ }
508
710
  };
509
711
  const IconProps = {
510
712
  /**
511
713
  * VvIcon name or props
512
714
  * @see VVIcon
513
715
  */
514
- icon: { type: [String, Object] },
716
+ icon: {
717
+ type: [String, Object],
718
+ default: void 0
719
+ },
515
720
  /**
516
721
  * VvIcon position
517
722
  */
@@ -532,8 +737,17 @@ const FloatingLabelProps = {
532
737
  /**
533
738
  * If true the label will be floating
534
739
  */
535
- floating: Boolean
536
- };
740
+ floating: {
741
+ type: Boolean,
742
+ default: false
743
+ }
744
+ };
745
+ const UnselectableProps = {
746
+ /**
747
+ * If true the input will be unselectable
748
+ */
749
+ unselectable: { type: Boolean, default: true }
750
+ };
537
751
  const IdProps = {
538
752
  /**
539
753
  * Global attribute id
@@ -541,7 +755,7 @@ const IdProps = {
541
755
  */
542
756
  id: [String, Number]
543
757
  };
544
- ({
758
+ const DropdownProps = {
545
759
  /**
546
760
  * Dropdown placement
547
761
  */
@@ -562,7 +776,8 @@ const IdProps = {
562
776
  * Dropdown show / hide transition name
563
777
  */
564
778
  transitionName: {
565
- type: String
779
+ type: String,
780
+ default: void 0
566
781
  },
567
782
  /**
568
783
  * Offset of the dropdown from the trigger
@@ -630,9 +845,10 @@ const IdProps = {
630
845
  * Set dropdown width to the same as the trigger
631
846
  */
632
847
  triggerWidth: {
633
- type: Boolean
848
+ type: Boolean,
849
+ default: false
634
850
  }
635
- });
851
+ };
636
852
  const IdNameProps = {
637
853
  ...IdProps,
638
854
  /**
@@ -647,7 +863,10 @@ const AutofocusProps = {
647
863
  * Global attribute autofocus
648
864
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus
649
865
  */
650
- autofocus: Boolean
866
+ autofocus: {
867
+ type: Boolean,
868
+ default: false
869
+ }
651
870
  };
652
871
  const AutocompleteProps = {
653
872
  /**
@@ -679,28 +898,34 @@ const InputTextareaProps = {
679
898
  * Available for input types: text, search, url, tel, email, password
680
899
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#minlength
681
900
  */
682
- minlength: [String, Number],
901
+ minlength: { type: [String, Number], default: void 0 },
683
902
  /**
684
903
  * Input / Textarea maxlength
685
904
  * Maximum length (number of characters) of value
686
905
  * Available for input types: text, search, url, tel, email, password
687
906
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength
688
907
  */
689
- maxlength: [String, Number],
908
+ maxlength: { type: [String, Number], default: void 0 },
690
909
  /**
691
910
  * Input / Textarea placeholder
692
911
  * Text that appears in the form control when it has no value set
693
912
  * Available for input types: text, search, url, tel, email, password, number
694
913
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#placeholder
695
914
  */
696
- placeholder: String,
915
+ placeholder: {
916
+ type: String,
917
+ default: void 0
918
+ },
697
919
  /**
698
920
  * Input / Textarea required
699
921
  * A value is required or must be check for the form to be submittable
700
922
  * Available for all input types except color
701
923
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#required
702
924
  */
703
- required: Boolean
925
+ required: {
926
+ type: Boolean,
927
+ default: false
928
+ }
704
929
  };
705
930
  ({
706
931
  ...DisabledProps,
@@ -723,8 +948,23 @@ const InputTextareaProps = {
723
948
  ariaLabel: {
724
949
  type: String,
725
950
  default: void 0
951
+ },
952
+ /**
953
+ * Default tag for the action
954
+ */
955
+ defaultTag: {
956
+ type: String,
957
+ default: ActionTag.button
726
958
  }
727
959
  });
960
+ const StorageProps = {
961
+ storageType: {
962
+ type: String,
963
+ default: StorageType.local,
964
+ validator: (value) => Object.values(StorageType).includes(value)
965
+ },
966
+ storageKey: String
967
+ };
728
968
  const INPUT_TYPES = {
729
969
  TEXT: "text",
730
970
  PASSWORD: "password",
@@ -740,14 +980,6 @@ const INPUT_TYPES = {
740
980
  MONTH: "month",
741
981
  WEEK: "week"
742
982
  };
743
- const TYPES_ICON = {
744
- PASSWORD_SHOW: "eye-on",
745
- PASSWORD_HIDE: "eye-off",
746
- DATE: "calendar",
747
- TIME: "time",
748
- COLOR: "color",
749
- SEARCH: "close"
750
- };
751
983
  const VvInputTextEvents = [
752
984
  "update:modelValue",
753
985
  "update:masked",
@@ -767,6 +999,7 @@ const VvInputTextEvents = [
767
999
  ];
768
1000
  const VvInputTextProps = {
769
1001
  ...InputTextareaProps,
1002
+ ...StorageProps,
770
1003
  /**
771
1004
  * Input value
772
1005
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value
@@ -816,24 +1049,32 @@ const VvInputTextProps = {
816
1049
  * @see VVIcon
817
1050
  */
818
1051
  iconShowPassword: {
819
- type: String,
820
- default: TYPES_ICON.PASSWORD_SHOW
1052
+ type: [String, Object],
1053
+ default: ACTION_ICONS.showPassword
821
1054
  },
822
1055
  /**
823
1056
  * VvIcon name for hide password button
824
1057
  * @see VVIcon
825
1058
  */
826
1059
  iconHidePassword: {
827
- type: String,
828
- default: TYPES_ICON.PASSWORD_HIDE
1060
+ type: [String, Object],
1061
+ default: ACTION_ICONS.hidePassword
829
1062
  },
830
1063
  /**
831
1064
  * VvIcon name for clear button
832
1065
  * @see VVIcon
833
1066
  */
834
1067
  iconClear: {
835
- type: String,
836
- default: TYPES_ICON.SEARCH
1068
+ type: [String, Object],
1069
+ default: ACTION_ICONS.clear
1070
+ },
1071
+ /**
1072
+ * VvIcon name for remove suggestion button
1073
+ * @see VVIcon
1074
+ */
1075
+ iconRemoveSuggestion: {
1076
+ type: [String, Object],
1077
+ default: ACTION_ICONS.remove
837
1078
  },
838
1079
  /**
839
1080
  * Label for step up button
@@ -870,6 +1111,13 @@ const VvInputTextProps = {
870
1111
  type: String,
871
1112
  default: "Clear"
872
1113
  },
1114
+ /**
1115
+ * Label for remove suggestion button
1116
+ */
1117
+ labelRemoveSuggestion: {
1118
+ type: String,
1119
+ default: "Remove suggestion"
1120
+ },
873
1121
  /**
874
1122
  * iMask options
875
1123
  * @see https://imask.js.org/guide.html
@@ -911,241 +1159,728 @@ const VvInputTextProps = {
911
1159
  selectOnFocus: {
912
1160
  type: Boolean,
913
1161
  default: false
1162
+ },
1163
+ /**
1164
+ * Maximum number of suggestions
1165
+ */
1166
+ maxSuggestions: {
1167
+ type: Number,
1168
+ default: 5
914
1169
  }
915
1170
  };
916
- const VvInputPasswordAction = defineComponent({
917
- components: {
918
- VvIcon: _sfc_main$1
919
- },
920
- props: {
921
- disabled: {
922
- type: Boolean,
923
- default: false
924
- },
925
- labelShow: {
926
- type: String,
927
- default: "Show password"
928
- },
929
- labelHide: {
930
- type: String,
931
- default: "Hide password"
1171
+ function VvInputTextActionsFactory(type, parentProps) {
1172
+ return {
1173
+ name: "VvInputTextActions",
1174
+ components: {
1175
+ VvIcon: _sfc_main$4,
1176
+ VvInputPasswordAction,
1177
+ VvInputStepAction,
1178
+ VvInputClearAction
932
1179
  },
933
- iconShow: {
934
- type: String,
935
- default: TYPES_ICON.PASSWORD_SHOW
1180
+ setup() {
1181
+ const isDisabled = computed(() => {
1182
+ return parentProps.disabled || parentProps.readonly;
1183
+ });
1184
+ return {
1185
+ isDisabled,
1186
+ labelStepUp: parentProps.labelStepUp,
1187
+ labelStepDown: parentProps.labelStepDown,
1188
+ labelShowPassword: parentProps.labelShowPassword,
1189
+ labelHidePassword: parentProps.labelHidePassword,
1190
+ labelClear: parentProps.labelClear,
1191
+ iconShowPassword: parentProps.iconShowPassword,
1192
+ iconHidePassword: parentProps.iconHidePassword
1193
+ };
936
1194
  },
937
- iconHide: {
938
- type: String,
939
- default: TYPES_ICON.PASSWORD_HIDE
1195
+ render() {
1196
+ let actions = null;
1197
+ switch (type) {
1198
+ case INPUT_TYPES.SEARCH: {
1199
+ const { onClear } = this.$attrs;
1200
+ actions = [
1201
+ h(VvInputClearAction, {
1202
+ disabled: this.isDisabled,
1203
+ label: this.labelShowPassword,
1204
+ onClear
1205
+ })
1206
+ ];
1207
+ break;
1208
+ }
1209
+ case INPUT_TYPES.PASSWORD: {
1210
+ const { onTogglePassword } = this.$attrs;
1211
+ actions = [
1212
+ h(VvInputPasswordAction, {
1213
+ disabled: this.isDisabled,
1214
+ onTogglePassword,
1215
+ labelShow: this.labelShowPassword,
1216
+ labelHide: this.labelHidePassword,
1217
+ iconShow: this.iconShowPassword,
1218
+ iconHide: this.iconHidePassword
1219
+ })
1220
+ ];
1221
+ break;
1222
+ }
1223
+ case INPUT_TYPES.NUMBER: {
1224
+ const { onStepUp, onStepDown } = this.$attrs;
1225
+ actions = [
1226
+ h(VvInputStepAction, {
1227
+ mode: "up",
1228
+ disabled: this.isDisabled || parentProps.max !== void 0 && parentProps.modelValue === parentProps.max,
1229
+ label: this.labelStepUp,
1230
+ onStepUp,
1231
+ onStepDown
1232
+ }),
1233
+ h(VvInputStepAction, {
1234
+ mode: "down",
1235
+ disabled: this.isDisabled || parentProps.min !== void 0 && parentProps.modelValue === parentProps.min,
1236
+ label: this.labelStepDown,
1237
+ onStepUp,
1238
+ onStepDown
1239
+ })
1240
+ ];
1241
+ break;
1242
+ }
1243
+ }
1244
+ return Array.isArray(actions) ? h("div", { class: "vv-input-text__actions-group" }, actions) : actions;
940
1245
  }
1246
+ };
1247
+ }
1248
+ const VvDropdownProps = {
1249
+ ...IdProps,
1250
+ ...DropdownProps,
1251
+ ...ModifiersProps,
1252
+ /**
1253
+ * Show / hide dropdown programmatically
1254
+ */
1255
+ modelValue: {
1256
+ type: Boolean,
1257
+ default: void 0
941
1258
  },
942
- emits: ["toggle-password"],
943
- setup(props, { emit }) {
944
- const active = ref(false);
945
- const activeIcon = computed(
946
- () => active.value ? props.iconHide : props.iconShow
1259
+ /**
1260
+ * Dropdown trigger element
1261
+ */
1262
+ reference: {
1263
+ type: Object,
1264
+ default: null
1265
+ },
1266
+ /**
1267
+ * Dropdown role
1268
+ */
1269
+ role: {
1270
+ type: String,
1271
+ default: DropdownRole.menu,
1272
+ validator: (value) => Object.values(DropdownRole).includes(value)
1273
+ }
1274
+ };
1275
+ const VvDropdownItemProps = {
1276
+ focusOnHover: {
1277
+ type: Boolean,
1278
+ default: false
1279
+ }
1280
+ };
1281
+ const VvDropdownOptionProps = {
1282
+ ...DisabledProps,
1283
+ ...SelectedProps,
1284
+ ...UnselectableProps,
1285
+ ...ModifiersProps,
1286
+ deselectHintLabel: {
1287
+ type: String
1288
+ },
1289
+ selectHintLabel: {
1290
+ type: String
1291
+ },
1292
+ selectedHintLabel: {
1293
+ type: String
1294
+ },
1295
+ focusOnHover: {
1296
+ type: Boolean,
1297
+ default: false
1298
+ }
1299
+ };
1300
+ function useUniqueId(id) {
1301
+ return computed(() => String((id == null ? void 0 : id.value) || uid()));
1302
+ }
1303
+ function useProvideDropdownTrigger({
1304
+ reference,
1305
+ id,
1306
+ expanded,
1307
+ aria
1308
+ }) {
1309
+ const bus = mitt();
1310
+ const component = defineComponent({
1311
+ name: "VvDropdownTriggerProvider",
1312
+ setup() {
1313
+ provide(INJECTION_KEY_DROPDOWN_TRIGGER, {
1314
+ reference,
1315
+ id,
1316
+ expanded,
1317
+ aria,
1318
+ bus
1319
+ });
1320
+ },
1321
+ render() {
1322
+ var _a, _b;
1323
+ return h(Fragment, {}, (_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a));
1324
+ }
1325
+ });
1326
+ return {
1327
+ bus,
1328
+ component
1329
+ };
1330
+ }
1331
+ function useProvideDropdownItem({
1332
+ role,
1333
+ ...others
1334
+ }) {
1335
+ const itemRole = computed(
1336
+ () => role.value === DropdownRole.listbox ? DropdownItemRole.option : DropdownItemRole.presentation
1337
+ );
1338
+ provide(INJECTION_KEY_DROPDOWN_ITEM, {
1339
+ role: itemRole,
1340
+ ...others
1341
+ });
1342
+ return { itemRole };
1343
+ }
1344
+ function useProvideDropdownAction({
1345
+ expanded
1346
+ }) {
1347
+ provide(INJECTION_KEY_DROPDOWN_ACTION, {
1348
+ role: ref(ActionRoles.menuitem),
1349
+ expanded
1350
+ });
1351
+ }
1352
+ const _hoisted_1$2 = ["id", "tabindex", "role", "aria-labelledby"];
1353
+ const __default__$3 = {
1354
+ name: "VvDropdown",
1355
+ inheritAttrs: false
1356
+ };
1357
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1358
+ ...__default__$3,
1359
+ props: VvDropdownProps,
1360
+ emits: [
1361
+ "update:modelValue",
1362
+ "beforeEnter",
1363
+ "afterLeave",
1364
+ "beforeExpand",
1365
+ "beforeCollapse",
1366
+ "afterExpand",
1367
+ "afterCollapse",
1368
+ "before-enter",
1369
+ "after-leave",
1370
+ "enter",
1371
+ "afterEnter",
1372
+ "enterCancelled",
1373
+ "beforeLeave",
1374
+ "leave",
1375
+ "leaveCancelled"
1376
+ ],
1377
+ setup(__props, { expose: __expose, emit: __emit }) {
1378
+ const props = __props;
1379
+ const emit = __emit;
1380
+ const { id } = toRefs(props);
1381
+ const hasId = useUniqueId(id);
1382
+ const attrs = useAttrs();
1383
+ const maxWidth = ref("auto");
1384
+ const maxHeight = ref("auto");
1385
+ const localReferenceEl = ref(null);
1386
+ const floatingEl = ref();
1387
+ const arrowEl = ref(null);
1388
+ const listEl = ref(null);
1389
+ const referenceEl = computed({
1390
+ get: () => props.reference ?? localReferenceEl.value,
1391
+ set: (newValue) => {
1392
+ localReferenceEl.value = newValue;
1393
+ }
1394
+ });
1395
+ const hasCustomPosition = ref(false);
1396
+ onMounted(() => {
1397
+ useMutationObserver(
1398
+ floatingEl.value,
1399
+ () => {
1400
+ var _a;
1401
+ hasCustomPosition.value = ((_a = window.getComputedStyle(floatingEl.value).getPropertyValue("--dropdown-custom-position")) == null ? void 0 : _a.trim()) === "true";
1402
+ },
1403
+ {
1404
+ attributeFilter: ["style"],
1405
+ window
1406
+ }
1407
+ );
1408
+ });
1409
+ const middleware = computed(() => {
1410
+ const toReturn = [];
1411
+ if (props.autoPlacement) {
1412
+ if (typeof props.autoPlacement === "boolean") {
1413
+ toReturn.push(autoPlacement());
1414
+ } else {
1415
+ toReturn.push(
1416
+ autoPlacement(props.autoPlacement)
1417
+ );
1418
+ }
1419
+ } else if (props.flip) {
1420
+ if (typeof props.flip === "boolean") {
1421
+ toReturn.push(flip({ fallbackStrategy: "initialPlacement" }));
1422
+ } else {
1423
+ toReturn.push(flip(props.flip));
1424
+ }
1425
+ }
1426
+ if (props.shift) {
1427
+ if (typeof props.shift === "boolean") {
1428
+ toReturn.push(shift());
1429
+ } else {
1430
+ toReturn.push(shift(props.shift));
1431
+ }
1432
+ }
1433
+ if (props.size) {
1434
+ const apply = ({
1435
+ availableWidth,
1436
+ availableHeight
1437
+ }) => {
1438
+ maxWidth.value = `${availableWidth}px`;
1439
+ maxHeight.value = `${availableHeight}px`;
1440
+ };
1441
+ if (typeof props.size === "boolean") {
1442
+ toReturn.push(
1443
+ size({
1444
+ apply
1445
+ })
1446
+ );
1447
+ } else {
1448
+ toReturn.push(
1449
+ size({
1450
+ ...props.size,
1451
+ apply
1452
+ })
1453
+ );
1454
+ }
1455
+ }
1456
+ if (props.offset) {
1457
+ toReturn.push(offset(Number(props.offset)));
1458
+ if (["string", "number"].includes(typeof props.offset)) {
1459
+ toReturn.push(offset(Number(props.offset)));
1460
+ } else {
1461
+ toReturn.push(offset(props.offset));
1462
+ }
1463
+ }
1464
+ if (props.arrow) {
1465
+ toReturn.push(
1466
+ arrow({
1467
+ element: arrowEl
1468
+ })
1469
+ );
1470
+ }
1471
+ return toReturn;
1472
+ });
1473
+ const { x, y, middlewareData, placement, strategy } = useFloating(
1474
+ referenceEl,
1475
+ floatingEl,
1476
+ {
1477
+ whileElementsMounted: (...args) => {
1478
+ return autoUpdate(...args, {
1479
+ animationFrame: props.strategy === Strategy.fixed
1480
+ });
1481
+ },
1482
+ placement: computed(() => props.placement),
1483
+ strategy: computed(() => props.strategy),
1484
+ middleware
1485
+ }
947
1486
  );
948
- function onClick(e) {
949
- e == null ? void 0 : e.stopPropagation();
950
- if (!props.disabled) {
951
- active.value = !active.value;
952
- emit("toggle-password", active.value);
1487
+ const dropdownPlacement = computed(() => {
1488
+ var _a;
1489
+ if (hasCustomPosition.value) {
1490
+ return void 0;
953
1491
  }
1492
+ const width = props.triggerWidth && referenceEl.value ? `${(_a = referenceEl.value) == null ? void 0 : _a.offsetWidth}px` : void 0;
1493
+ return {
1494
+ position: strategy.value,
1495
+ top: `${y.value ?? 0}px`,
1496
+ left: `${x.value ?? 0}px`,
1497
+ maxWidth: width ? void 0 : maxWidth.value,
1498
+ maxHeight: maxHeight.value,
1499
+ width
1500
+ };
1501
+ });
1502
+ const side = computed(
1503
+ () => placement.value.split("-")[0]
1504
+ );
1505
+ const arrowPlacement = computed(() => {
1506
+ var _a, _b, _c, _d, _e;
1507
+ if (hasCustomPosition.value) {
1508
+ return void 0;
1509
+ }
1510
+ const staticSide = {
1511
+ [Side.top]: Side.bottom,
1512
+ [Side.right]: Side.left,
1513
+ [Side.bottom]: Side.top,
1514
+ [Side.left]: Side.right
1515
+ }[side.value];
1516
+ return {
1517
+ left: ((_a = middlewareData.value.arrow) == null ? void 0 : _a.x) !== void 0 ? `${(_b = middlewareData.value.arrow) == null ? void 0 : _b.x}px` : void 0,
1518
+ top: ((_c = middlewareData.value.arrow) == null ? void 0 : _c.y) !== void 0 ? `${(_d = middlewareData.value.arrow) == null ? void 0 : _d.y}px` : void 0,
1519
+ [staticSide]: `${-(((_e = arrowEl.value) == null ? void 0 : _e.offsetWidth) ?? 0) / 2}px`
1520
+ };
1521
+ });
1522
+ const modelValue = useVModel(props, "modelValue", emit);
1523
+ const localModelValue = ref(false);
1524
+ const expanded = computed({
1525
+ get: () => modelValue.value ?? localModelValue.value,
1526
+ set: (newValue) => {
1527
+ if (modelValue.value === void 0) {
1528
+ localModelValue.value = newValue;
1529
+ return;
1530
+ }
1531
+ modelValue.value = newValue;
1532
+ }
1533
+ });
1534
+ function show() {
1535
+ expanded.value = true;
954
1536
  }
955
- return {
956
- active,
957
- activeIcon,
958
- onClick
959
- };
960
- },
961
- render() {
962
- const icon = h(_sfc_main$1, {
963
- name: this.activeIcon,
964
- class: "vv-input-text__icon"
1537
+ function hide() {
1538
+ expanded.value = false;
1539
+ }
1540
+ function toggle() {
1541
+ expanded.value = !expanded.value;
1542
+ }
1543
+ function init(el) {
1544
+ referenceEl.value = el;
1545
+ }
1546
+ __expose({
1547
+ toggle,
1548
+ show,
1549
+ hide,
1550
+ init,
1551
+ customPosition: hasCustomPosition
965
1552
  });
966
- return h(
967
- "button",
968
- {
969
- disabled: this.disabled,
970
- class: "vv-input-text__action",
971
- ariaLabel: this.active ? this.labelHide : this.labelShow,
972
- type: "button",
973
- onClick: this.onClick
1553
+ watch(expanded, (newValue) => {
1554
+ if (newValue && props.autofocusFirst) {
1555
+ nextTick(() => {
1556
+ const focusableElements = getKeyboardFocusableElements(
1557
+ floatingEl.value
1558
+ );
1559
+ if (focusableElements.length > 0) {
1560
+ focusableElements[0].focus({
1561
+ preventScroll: true
1562
+ });
1563
+ }
1564
+ });
1565
+ }
1566
+ });
1567
+ onClickOutside(
1568
+ floatingEl,
1569
+ () => {
1570
+ if (!props.keepOpen && expanded.value) {
1571
+ expanded.value = false;
1572
+ }
974
1573
  },
975
- icon
1574
+ { ignore: [referenceEl] }
976
1575
  );
977
- }
978
- });
979
- const VvInputStepAction = defineComponent({
980
- components: {
981
- VvIcon: _sfc_main$1
982
- },
983
- props: {
984
- disabled: {
985
- type: Boolean,
986
- default: false
987
- },
988
- label: {
989
- type: String
990
- },
991
- mode: {
992
- type: String,
993
- validator: (v) => ["up", "down"].includes(v),
994
- default: "up"
1576
+ const hasAriaLabelledby = computed(() => {
1577
+ var _a, _b;
1578
+ return ((_b = (_a = referenceEl.value) == null ? void 0 : _a.getAttribute) == null ? void 0 : _b.call(_a, "id")) ?? void 0;
1579
+ });
1580
+ const referenceAria = computed(() => ({
1581
+ "aria-controls": hasId.value,
1582
+ "aria-haspopup": true,
1583
+ "aria-expanded": expanded.value
1584
+ }));
1585
+ const { component: VvDropdownTriggerProvider, bus } = useProvideDropdownTrigger({
1586
+ reference: referenceEl,
1587
+ id: hasId,
1588
+ expanded,
1589
+ aria: referenceAria
1590
+ });
1591
+ bus.on("click", toggle);
1592
+ const { role, modifiers } = toRefs(props);
1593
+ const bemCssClasses = useModifiers(
1594
+ "vv-dropdown",
1595
+ modifiers,
1596
+ computed(() => ({
1597
+ arrow: props.arrow
1598
+ }))
1599
+ );
1600
+ const { focused } = useFocusWithin(floatingEl);
1601
+ function getKeyboardFocusableElements(element) {
1602
+ if (!element) {
1603
+ return [];
1604
+ }
1605
+ return [
1606
+ ...element.querySelectorAll(
1607
+ 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
1608
+ )
1609
+ ].filter(
1610
+ (el) => !el.hasAttribute("disabled") && !el.getAttribute("aria-hidden")
1611
+ );
995
1612
  }
996
- },
997
- emits: ["step-up", "step-down"],
998
- setup(props, { emit }) {
999
- const isUp = computed(() => props.mode === "up");
1000
- const onClick = (e) => {
1001
- e == null ? void 0 : e.stopPropagation();
1002
- if (!props.disabled) {
1003
- emit(isUp.value ? "step-up" : "step-down");
1613
+ function focusNext() {
1614
+ nextTick(() => {
1615
+ if (focused.value) {
1616
+ const focusableElements = getKeyboardFocusableElements(
1617
+ floatingEl.value
1618
+ );
1619
+ if (focusableElements.length === 0 || !document.activeElement) {
1620
+ return;
1621
+ }
1622
+ const activeElementIndex = focusableElements.indexOf(
1623
+ document.activeElement
1624
+ );
1625
+ if (activeElementIndex < focusableElements.length - 1) {
1626
+ focusableElements[activeElementIndex + 1].focus({
1627
+ preventScroll: true
1628
+ });
1629
+ } else {
1630
+ focusableElements[0].focus({
1631
+ preventScroll: true
1632
+ });
1633
+ }
1634
+ }
1635
+ });
1636
+ }
1637
+ function focusPrev() {
1638
+ nextTick(() => {
1639
+ if (focused.value) {
1640
+ const focusableElements = getKeyboardFocusableElements(
1641
+ floatingEl.value
1642
+ );
1643
+ if (focusableElements.length === 0 || !document.activeElement) {
1644
+ return;
1645
+ }
1646
+ const activeElementIndex = focusableElements.indexOf(
1647
+ document.activeElement
1648
+ );
1649
+ if (activeElementIndex > 0) {
1650
+ focusableElements[activeElementIndex - 1].focus({
1651
+ preventScroll: true
1652
+ });
1653
+ } else {
1654
+ focusableElements[focusableElements.length - 1].focus({
1655
+ preventScroll: true
1656
+ });
1657
+ }
1658
+ }
1659
+ });
1660
+ }
1661
+ const hovered = useElementHover(floatingEl);
1662
+ const { itemRole } = useProvideDropdownItem({
1663
+ role,
1664
+ expanded,
1665
+ focused,
1666
+ hovered
1667
+ });
1668
+ onKeyStroke("Escape", (e) => {
1669
+ if (expanded.value) {
1670
+ e.preventDefault();
1671
+ hide();
1672
+ }
1673
+ });
1674
+ onKeyStroke("ArrowDown", (e) => {
1675
+ if (expanded.value && focused.value) {
1676
+ e.preventDefault();
1677
+ focusNext();
1678
+ }
1679
+ });
1680
+ onKeyStroke("ArrowUp", (e) => {
1681
+ if (expanded.value && focused.value) {
1682
+ e.preventDefault();
1683
+ focusPrev();
1684
+ }
1685
+ });
1686
+ onKeyStroke([" ", "Enter"], (e) => {
1687
+ const htmlEl = e.target;
1688
+ if (expanded.value && focused.value && htmlEl) {
1689
+ htmlEl == null ? void 0 : htmlEl.click();
1690
+ }
1691
+ });
1692
+ const dropdownTransitionHandlers = {
1693
+ "before-enter": () => {
1694
+ emit(expanded.value ? "beforeExpand" : "beforeCollapse");
1695
+ emit("beforeEnter");
1696
+ },
1697
+ "after-leave": () => {
1698
+ emit(expanded.value ? "afterExpand" : "afterCollapse");
1699
+ emit("afterLeave");
1700
+ },
1701
+ "enter": () => {
1702
+ emit("enter");
1703
+ },
1704
+ "after-enter": () => {
1705
+ emit("afterEnter");
1706
+ },
1707
+ "enter-cancelled": () => {
1708
+ emit("enterCancelled");
1709
+ },
1710
+ "before-leave": () => {
1711
+ emit("beforeLeave");
1712
+ },
1713
+ "leave": () => {
1714
+ emit("leave");
1715
+ },
1716
+ "leave-cancelled": () => {
1717
+ emit("leaveCancelled");
1004
1718
  }
1005
1719
  };
1006
- return {
1007
- isUp,
1008
- onClick
1720
+ return (_ctx, _cache) => {
1721
+ return openBlock(), createElementBlock(
1722
+ Fragment,
1723
+ null,
1724
+ [
1725
+ createVNode(unref(VvDropdownTriggerProvider), null, {
1726
+ default: withCtx(() => [
1727
+ renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({ init, show, hide, toggle, expanded: unref(expanded), aria: unref(referenceAria) })))
1728
+ ]),
1729
+ _: 3
1730
+ /* FORWARDED */
1731
+ }),
1732
+ createVNode(Transition, mergeProps({ name: _ctx.transitionName }, toHandlers(dropdownTransitionHandlers), { persisted: "" }), {
1733
+ default: withCtx(() => [
1734
+ withDirectives(createElementVNode(
1735
+ "div",
1736
+ {
1737
+ ref_key: "floatingEl",
1738
+ ref: floatingEl,
1739
+ style: normalizeStyle(unref(dropdownPlacement)),
1740
+ class: normalizeClass(unref(bemCssClasses))
1741
+ },
1742
+ [
1743
+ props.arrow ? (openBlock(), createElementBlock(
1744
+ "div",
1745
+ {
1746
+ key: 0,
1747
+ ref_key: "arrowEl",
1748
+ ref: arrowEl,
1749
+ style: normalizeStyle(unref(arrowPlacement)),
1750
+ class: "vv-dropdown__arrow"
1751
+ },
1752
+ null,
1753
+ 4
1754
+ /* STYLE */
1755
+ )) : createCommentVNode("v-if", true),
1756
+ renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps({ expanded: unref(expanded) }))),
1757
+ createElementVNode("div", mergeProps(unref(attrs), {
1758
+ id: unref(hasId),
1759
+ ref_key: "listEl",
1760
+ ref: listEl,
1761
+ tabindex: !unref(expanded) ? -1 : void 0,
1762
+ role: unref(role),
1763
+ "aria-labelledby": unref(hasAriaLabelledby),
1764
+ class: "vv-dropdown__list"
1765
+ }), [
1766
+ renderSlot(_ctx.$slots, "items", normalizeProps(guardReactiveProps({
1767
+ role: unref(itemRole)
1768
+ })))
1769
+ ], 16, _hoisted_1$2),
1770
+ renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps({ expanded: unref(expanded) })))
1771
+ ],
1772
+ 6
1773
+ /* CLASS, STYLE */
1774
+ ), [
1775
+ [vShow, unref(expanded)]
1776
+ ])
1777
+ ]),
1778
+ _: 3
1779
+ /* FORWARDED */
1780
+ }, 16, ["name"])
1781
+ ],
1782
+ 64
1783
+ /* STABLE_FRAGMENT */
1784
+ );
1009
1785
  };
1010
- },
1011
- render() {
1012
- return h("button", {
1013
- class: [
1014
- "vv-input-text__action vv-input-text__action-chevron",
1015
- this.isUp && "vv-input-text__action-chevron-up"
1016
- ],
1017
- disabled: this.disabled,
1018
- ariaLabel: this.label,
1019
- type: "button",
1020
- onClick: this.onClick
1786
+ }
1787
+ });
1788
+ function useInjectedDropdownItem() {
1789
+ return inject(INJECTION_KEY_DROPDOWN_ITEM, {});
1790
+ }
1791
+ const __default__$2 = {
1792
+ name: "VvDropdownItem"
1793
+ };
1794
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1795
+ ...__default__$2,
1796
+ props: VvDropdownItemProps,
1797
+ setup(__props) {
1798
+ const props = __props;
1799
+ const { role, expanded } = useInjectedDropdownItem();
1800
+ const element = ref(null);
1801
+ useProvideDropdownAction({ expanded });
1802
+ const hovered = useElementHover(element);
1803
+ const { focused } = useFocus(element);
1804
+ const { focused: focusedWithin } = useFocusWithin(element);
1805
+ watch(hovered, (newValue) => {
1806
+ if (newValue && props.focusOnHover) {
1807
+ focused.value = true;
1808
+ }
1021
1809
  });
1810
+ return (_ctx, _cache) => {
1811
+ return openBlock(), createElementBlock(
1812
+ "div",
1813
+ mergeProps({ role: unref(role) }, {
1814
+ ref_key: "element",
1815
+ ref: element,
1816
+ class: ["vv-dropdown__item", { "focus-visible": unref(focused) || unref(focusedWithin) }]
1817
+ }),
1818
+ [
1819
+ renderSlot(_ctx.$slots, "default")
1820
+ ],
1821
+ 16
1822
+ /* FULL_PROPS */
1823
+ );
1824
+ };
1022
1825
  }
1023
1826
  });
1024
- const VvInputClearAction = defineComponent({
1025
- components: {
1026
- VvIcon: _sfc_main$1
1027
- },
1028
- props: {
1029
- disabled: {
1030
- type: Boolean,
1031
- default: false
1032
- },
1033
- label: {
1034
- type: String,
1035
- default: "Clear"
1036
- },
1037
- icon: {
1038
- type: String,
1039
- default: "close"
1040
- }
1041
- },
1042
- emits: ["clear"],
1043
- setup(props, { emit }) {
1044
- function onClick(e) {
1045
- e == null ? void 0 : e.stopPropagation();
1827
+ const _hoisted_1$1 = ["title"];
1828
+ const __default__$1 = {
1829
+ name: "VvDropdownOption"
1830
+ };
1831
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1832
+ ...__default__$1,
1833
+ props: VvDropdownOptionProps,
1834
+ setup(__props) {
1835
+ const props = __props;
1836
+ const { modifiers } = toRefs(props);
1837
+ const bemCssClasses = useModifiers(
1838
+ "vv-dropdown-option",
1839
+ modifiers,
1840
+ computed(() => ({
1841
+ disabled: props.disabled,
1842
+ selected: props.selected,
1843
+ unselectable: props.unselectable && props.selected
1844
+ }))
1845
+ );
1846
+ const hintLabel = computed(() => {
1847
+ if (props.selected) {
1848
+ return props.unselectable ? props.deselectHintLabel : props.selectedHintLabel;
1849
+ }
1046
1850
  if (!props.disabled) {
1047
- emit("clear");
1851
+ return props.selectHintLabel;
1048
1852
  }
1049
- }
1050
- return {
1051
- onClick
1052
- };
1053
- },
1054
- render() {
1055
- const icon = h(_sfc_main$1, {
1056
- name: this.icon,
1057
- class: "vv-input-text__icon"
1853
+ return "";
1058
1854
  });
1059
- return h(
1060
- "button",
1061
- {
1062
- disabled: this.disabled,
1063
- class: "vv-input-text__action",
1064
- ariaLabel: this.label,
1065
- type: "button",
1066
- onClick: this.onClick
1067
- },
1068
- icon
1069
- );
1855
+ return (_ctx, _cache) => {
1856
+ return openBlock(), createBlock(_sfc_main$2, {
1857
+ class: normalizeClass(unref(bemCssClasses)),
1858
+ tabindex: _ctx.disabled ? -1 : 0,
1859
+ "aria-selected": _ctx.selected,
1860
+ "aria-disabled": _ctx.disabled,
1861
+ "focus-on-hover": _ctx.focusOnHover
1862
+ }, {
1863
+ default: withCtx(() => [
1864
+ renderSlot(_ctx.$slots, "default"),
1865
+ createElementVNode("span", {
1866
+ class: "vv-dropdown-option__hint",
1867
+ title: unref(hintLabel)
1868
+ }, [
1869
+ renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps({ disabled: _ctx.disabled, selected: _ctx.selected, unselectable: _ctx.unselectable })), () => [
1870
+ createTextVNode(
1871
+ toDisplayString(unref(hintLabel)),
1872
+ 1
1873
+ /* TEXT */
1874
+ )
1875
+ ])
1876
+ ], 8, _hoisted_1$1)
1877
+ ]),
1878
+ _: 3
1879
+ /* FORWARDED */
1880
+ }, 8, ["class", "tabindex", "aria-selected", "aria-disabled", "focus-on-hover"]);
1881
+ };
1070
1882
  }
1071
1883
  });
1072
- function VvInputTextActionsFactory(type, parentProps) {
1073
- return {
1074
- name: "VvInputTextActions",
1075
- components: {
1076
- VvIcon: _sfc_main$1,
1077
- VvInputPasswordAction,
1078
- VvInputStepAction,
1079
- VvInputClearAction
1080
- },
1081
- setup() {
1082
- const isDisabled = computed(() => {
1083
- return parentProps.disabled || parentProps.readonly;
1084
- });
1085
- return {
1086
- isDisabled,
1087
- labelStepUp: parentProps.labelStepUp,
1088
- labelStepDown: parentProps.labelStepDown,
1089
- labelShowPassword: parentProps.labelShowPassword,
1090
- labelHidePassword: parentProps.labelHidePassword,
1091
- labelClear: parentProps.labelClear,
1092
- iconShowPassword: parentProps.iconShowPassword,
1093
- iconHidePassword: parentProps.iconHidePassword
1094
- };
1095
- },
1096
- render() {
1097
- let actions = null;
1098
- switch (type) {
1099
- case INPUT_TYPES.SEARCH: {
1100
- const { onClear } = this.$attrs;
1101
- actions = [
1102
- h(VvInputClearAction, {
1103
- disabled: this.isDisabled,
1104
- label: this.labelShowPassword,
1105
- onClear
1106
- })
1107
- ];
1108
- break;
1109
- }
1110
- case INPUT_TYPES.PASSWORD: {
1111
- const { onTogglePassword } = this.$attrs;
1112
- actions = [
1113
- h(VvInputPasswordAction, {
1114
- disabled: this.isDisabled,
1115
- onTogglePassword,
1116
- labelShow: this.labelShowPassword,
1117
- labelHide: this.labelHidePassword,
1118
- iconShow: this.iconShowPassword,
1119
- iconHide: this.iconHidePassword
1120
- })
1121
- ];
1122
- break;
1123
- }
1124
- case INPUT_TYPES.NUMBER: {
1125
- const { onStepUp, onStepDown } = this.$attrs;
1126
- actions = [
1127
- h(VvInputStepAction, {
1128
- mode: "up",
1129
- disabled: this.isDisabled || parentProps.max !== void 0 && parentProps.modelValue === parentProps.max,
1130
- label: this.labelStepUp,
1131
- onStepUp,
1132
- onStepDown
1133
- }),
1134
- h(VvInputStepAction, {
1135
- mode: "down",
1136
- disabled: this.isDisabled || parentProps.min !== void 0 && parentProps.modelValue === parentProps.min,
1137
- label: this.labelStepDown,
1138
- onStepUp,
1139
- onStepDown
1140
- })
1141
- ];
1142
- break;
1143
- }
1144
- }
1145
- return Array.isArray(actions) ? h("div", { class: "vv-input-text__actions-group" }, actions) : actions;
1146
- }
1147
- };
1148
- }
1149
1884
  function useDefaults(componentName, propsDefinition, props) {
1150
1885
  const volver = useVolver();
1151
1886
  const volverComponentDefaults = computed(() => {
@@ -1199,14 +1934,13 @@ function useDefaults(componentName, propsDefinition, props) {
1199
1934
  }, {});
1200
1935
  });
1201
1936
  }
1202
- const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || uid()));
1203
1937
  function useDebouncedInput(modelValue, emit, ms = 0, {
1204
1938
  getter = (value) => value,
1205
1939
  setter = (value) => value
1206
1940
  } = {}) {
1207
1941
  let timeout;
1208
1942
  if (typeof ms === "string") {
1209
- ms = parseInt(ms);
1943
+ ms = Number.parseInt(ms);
1210
1944
  }
1211
1945
  return computed({
1212
1946
  get: () => getter(modelValue == null ? void 0 : modelValue.value),
@@ -1229,41 +1963,6 @@ function useComponentFocus(inputTemplateRef, emit) {
1229
1963
  focused
1230
1964
  };
1231
1965
  }
1232
- function useComponentIcon(icon, iconPosition) {
1233
- const hasIconBefore = computed(
1234
- () => Boolean((icon == null ? void 0 : icon.value) && iconPosition.value === Position.before)
1235
- );
1236
- const hasIconAfter = computed(
1237
- () => Boolean((icon == null ? void 0 : icon.value) && iconPosition.value === Position.after)
1238
- );
1239
- const hasIconLeft = computed(
1240
- () => Boolean((icon == null ? void 0 : icon.value) && iconPosition.value === Side.left)
1241
- );
1242
- const hasIconRight = computed(
1243
- () => Boolean((icon == null ? void 0 : icon.value) && iconPosition.value === Side.right)
1244
- );
1245
- const hasIconTop = computed(
1246
- () => Boolean((icon == null ? void 0 : icon.value) && iconPosition.value === Side.top)
1247
- );
1248
- const hasIconBottom = computed(
1249
- () => Boolean((icon == null ? void 0 : icon.value) && iconPosition.value === Side.bottom)
1250
- );
1251
- const hasIcon = computed(() => {
1252
- if (typeof (icon == null ? void 0 : icon.value) === "string") {
1253
- return { name: icon == null ? void 0 : icon.value };
1254
- }
1255
- return icon == null ? void 0 : icon.value;
1256
- });
1257
- return {
1258
- hasIcon,
1259
- hasIconLeft,
1260
- hasIconRight,
1261
- hasIconTop,
1262
- hasIconBottom,
1263
- hasIconBefore,
1264
- hasIconAfter
1265
- };
1266
- }
1267
1966
  function useTextCount(text, options) {
1268
1967
  const length = computed(() => {
1269
1968
  return (unref(text) ?? "").length;
@@ -1298,26 +1997,86 @@ function useTextCount(text, options) {
1298
1997
  formatted
1299
1998
  };
1300
1999
  }
2000
+ function usePersistence(storageKey, storageType = StorageType.local, defaultValue) {
2001
+ const localValue = ref();
2002
+ if (defaultValue) {
2003
+ localValue.value = defaultValue;
2004
+ }
2005
+ let storageValue;
2006
+ if (storageKey) {
2007
+ watch(
2008
+ storageKey,
2009
+ (newKey, oldKey) => {
2010
+ const storage = unref(storageType) === StorageType.session ? sessionStorage : localStorage;
2011
+ if (oldKey && oldKey !== newKey) {
2012
+ storage.removeItem(oldKey);
2013
+ }
2014
+ if (newKey) {
2015
+ storageValue = useStorage(
2016
+ newKey,
2017
+ (storageValue == null ? void 0 : storageValue.value) ?? localValue.value,
2018
+ storage
2019
+ );
2020
+ return;
2021
+ }
2022
+ storageValue = void 0;
2023
+ },
2024
+ {
2025
+ immediate: true
2026
+ }
2027
+ );
2028
+ }
2029
+ if (isRef(storageType)) {
2030
+ watch(storageType, (newType, oldType) => {
2031
+ if (storageKey == null ? void 0 : storageKey.value) {
2032
+ if (newType) {
2033
+ const storage = newType === StorageType.session ? sessionStorage : localStorage;
2034
+ storageValue = useStorage(
2035
+ storageKey.value,
2036
+ (storageValue == null ? void 0 : storageValue.value) ?? localValue.value,
2037
+ storage
2038
+ );
2039
+ }
2040
+ if (oldType && oldType !== newType) {
2041
+ const oldStorage = oldType === StorageType.session ? sessionStorage : localStorage;
2042
+ oldStorage.removeItem(storageKey.value);
2043
+ }
2044
+ }
2045
+ });
2046
+ }
2047
+ return computed({
2048
+ get: () => {
2049
+ return (storageValue == null ? void 0 : storageValue.value) ?? localValue.value;
2050
+ },
2051
+ set: (value) => {
2052
+ if (storageValue) {
2053
+ storageValue.value = value;
2054
+ return;
2055
+ }
2056
+ localValue.value = value;
2057
+ }
2058
+ });
2059
+ }
1301
2060
  const _hoisted_1 = ["for"];
1302
- const _hoisted_2 = { class: "vv-input-text__wrapper" };
1303
- const _hoisted_3 = {
2061
+ const _hoisted_2 = {
1304
2062
  key: 0,
1305
2063
  class: "vv-input-text__input-before"
1306
2064
  };
1307
- const _hoisted_4 = ["onClick"];
1308
- const _hoisted_5 = ["id"];
1309
- const _hoisted_6 = {
2065
+ const _hoisted_3 = ["id"];
2066
+ const _hoisted_4 = {
1310
2067
  key: 1,
1311
2068
  class: "vv-input-text__unit"
1312
2069
  };
1313
- const _hoisted_7 = {
2070
+ const _hoisted_5 = {
1314
2071
  key: 5,
1315
2072
  class: "vv-input-text__input-after"
1316
2073
  };
1317
- const _hoisted_8 = {
2074
+ const _hoisted_6 = {
1318
2075
  key: 6,
1319
2076
  class: "vv-input-text__limit"
1320
2077
  };
2078
+ const _hoisted_7 = { class: "flex-1" };
2079
+ const _hoisted_8 = ["title", "onClick"];
1321
2080
  const __default__ = {
1322
2081
  name: "VvInputText"
1323
2082
  };
@@ -1325,8 +2084,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1325
2084
  ...__default__,
1326
2085
  props: VvInputTextProps,
1327
2086
  emits: VvInputTextEvents,
1328
- setup(__props, { expose: __expose, emit }) {
2087
+ setup(__props, { expose: __expose, emit: __emit }) {
1329
2088
  const props = __props;
2089
+ const emit = __emit;
1330
2090
  const slots = useSlots();
1331
2091
  const propsDefaults = useDefaults(
1332
2092
  "VvInputText",
@@ -1334,31 +2094,39 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1334
2094
  props
1335
2095
  );
1336
2096
  const {
1337
- id,
2097
+ count,
2098
+ debounce,
1338
2099
  icon,
1339
2100
  iconPosition,
1340
- label,
1341
- modelValue,
1342
- count,
1343
- valid,
2101
+ iconRemoveSuggestion,
2102
+ id,
1344
2103
  invalid,
2104
+ label,
1345
2105
  loading,
1346
- debounce,
1347
2106
  maxlength,
1348
2107
  minlength,
2108
+ modelValue,
2109
+ step,
2110
+ storageKey,
2111
+ storageType,
1349
2112
  type,
1350
- iMask,
1351
- step
2113
+ valid
1352
2114
  } = toRefs(props);
1353
2115
  const hasId = useUniqueId(id);
1354
2116
  const hasHintId = computed(() => `${hasId.value}-hint`);
1355
2117
  const inputTextPlaceholder = computed(
1356
2118
  () => props.floating && isEmpty(props.placeholder) ? " " : props.placeholder
1357
2119
  );
2120
+ const localModelValue = useDebouncedInput(
2121
+ modelValue,
2122
+ emit,
2123
+ (debounce == null ? void 0 : debounce.value) ?? 0
2124
+ );
2125
+ const NEGATIVE_ZERO_REGEX = /^-0?[.,]?[0*]?$/;
1358
2126
  const maskReady = ref(false);
1359
2127
  const { el, mask, typed, masked, unmasked } = useIMask(
1360
2128
  computed(
1361
- () => (iMask == null ? void 0 : iMask.value) ?? {
2129
+ () => props.iMask ?? {
1362
2130
  mask: /./
1363
2131
  }
1364
2132
  ),
@@ -1370,13 +2138,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1370
2138
  }
1371
2139
  emit("update:masked", masked.value);
1372
2140
  if (type.value === INPUT_TYPES.NUMBER) {
1373
- if (masked.value === "") {
2141
+ if (/^-$|^$/.test(unmasked.value)) {
1374
2142
  if (localModelValue.value === null || localModelValue.value === void 0) {
1375
2143
  return;
1376
2144
  }
1377
2145
  localModelValue.value = void 0;
1378
2146
  return;
1379
2147
  }
2148
+ if (NEGATIVE_ZERO_REGEX.test(unmasked.value)) {
2149
+ localModelValue.value = 0;
2150
+ return;
2151
+ }
1380
2152
  if (typeof typed.value !== "number") {
1381
2153
  localModelValue.value = Number(typed.value);
1382
2154
  return;
@@ -1400,7 +2172,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1400
2172
  if (!(date instanceof Date)) {
1401
2173
  date = new Date(date);
1402
2174
  }
1403
- localModelValue.value = `${date.getFullYear()}-${("0" + (date.getMonth() + 1)).slice(-2)}-${("0" + date.getDate()).slice(-2)}`;
2175
+ localModelValue.value = `${date.getFullYear()}-${`0${date.getMonth() + 1}`.slice(-2)}-${`0${date.getDate()}`.slice(-2)}`;
1404
2176
  return;
1405
2177
  }
1406
2178
  if (type.value === INPUT_TYPES.DATETIME_LOCAL) {
@@ -1419,7 +2191,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1419
2191
  if (!(typed.value instanceof Date)) {
1420
2192
  date = new Date(date);
1421
2193
  }
1422
- localModelValue.value = `${date.getFullYear()}-${("0" + (date.getMonth() + 1)).slice(-2)}-${("0" + date.getDate()).slice(-2)}T${("0" + date.getHours()).slice(-2)}:${("0" + date.getMinutes()).slice(-2)}`;
2194
+ localModelValue.value = `${date.getFullYear()}-${`0${date.getMonth() + 1}`.slice(-2)}-${`0${date.getDate()}`.slice(-2)}T${`0${date.getHours()}`.slice(-2)}:${`0${date.getMinutes()}`.slice(-2)}`;
1423
2195
  return;
1424
2196
  }
1425
2197
  if (!localModelValue.value && !unmasked.value) {
@@ -1429,18 +2201,34 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1429
2201
  }
1430
2202
  }
1431
2203
  );
2204
+ function updateMaskValue(newValue) {
2205
+ var _a;
2206
+ if (newValue === void 0) {
2207
+ typed.value = "";
2208
+ unmasked.value = "";
2209
+ return;
2210
+ }
2211
+ if (((_a = props.iMask) == null ? void 0 : _a.mask) === Date) {
2212
+ typed.value = new Date(newValue);
2213
+ return;
2214
+ }
2215
+ if (type.value === INPUT_TYPES.NUMBER && NEGATIVE_ZERO_REGEX.test(unmasked.value) && newValue === 0) {
2216
+ return;
2217
+ }
2218
+ typed.value = newValue;
2219
+ unmasked.value = `${typed.value}`;
2220
+ }
1432
2221
  onMounted(() => {
1433
2222
  if (mask.value) {
1434
2223
  maskReady.value = true;
1435
- typed.value = localModelValue.value ?? "";
2224
+ updateMaskValue(props.modelValue);
1436
2225
  }
1437
2226
  });
1438
2227
  watch(
1439
2228
  () => props.modelValue,
1440
2229
  (newValue) => {
1441
- var _a;
1442
2230
  if (mask.value) {
1443
- typed.value = newValue && ((_a = iMask == null ? void 0 : iMask.value) == null ? void 0 : _a.mask) === Date ? new Date(newValue) : newValue ?? "";
2231
+ updateMaskValue(newValue);
1444
2232
  }
1445
2233
  }
1446
2234
  );
@@ -1452,20 +2240,35 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1452
2240
  );
1453
2241
  const inputEl = el;
1454
2242
  const innerEl = ref();
2243
+ const wrapperEl = ref();
2244
+ const dropdownEl = ref();
1455
2245
  __expose({ $inner: innerEl });
1456
- const localModelValue = useDebouncedInput(
1457
- modelValue,
1458
- emit,
1459
- (debounce == null ? void 0 : debounce.value) ?? 0
1460
- );
1461
2246
  const { focused } = useComponentFocus(inputEl, emit);
1462
2247
  const isFocused = computed(
1463
2248
  () => focused.value && !props.disabled && !props.readonly
1464
2249
  );
1465
2250
  watch(isFocused, (newValue) => {
2251
+ var _a;
1466
2252
  if (newValue && propsDefaults.value.selectOnFocus && inputEl.value) {
1467
2253
  inputEl.value.select();
1468
2254
  }
2255
+ if (newValue) {
2256
+ (_a = dropdownEl.value) == null ? void 0 : _a.show();
2257
+ return;
2258
+ }
2259
+ setTimeout(() => {
2260
+ if (isDirty.value && suggestions.value) {
2261
+ const suggestionsLimit = props.maxSuggestions - 1;
2262
+ if (suggestions.value.size > suggestionsLimit && !suggestions.value.has(localModelValue.value)) {
2263
+ suggestions.value = new Set(
2264
+ [...suggestions.value].slice(
2265
+ suggestions.value.size - suggestionsLimit
2266
+ )
2267
+ );
2268
+ }
2269
+ suggestions.value.add(localModelValue.value);
2270
+ }
2271
+ }, 300);
1469
2272
  });
1470
2273
  const isVisible = useElementVisibility(inputEl);
1471
2274
  watch(isVisible, (newValue) => {
@@ -1475,56 +2278,56 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1475
2278
  });
1476
2279
  const showPassword = ref(false);
1477
2280
  const isPassword = computed(() => props.type === INPUT_TYPES.PASSWORD);
1478
- const onTogglePassword = () => {
2281
+ function onTogglePassword() {
1479
2282
  showPassword.value = !showPassword.value;
1480
- };
2283
+ }
1481
2284
  const isDateTime = computed(
1482
2285
  () => props.type === INPUT_TYPES.TIME || props.type === INPUT_TYPES.DATETIME_LOCAL || props.type === INPUT_TYPES.DATE || props.type === INPUT_TYPES.WEEK || props.type === INPUT_TYPES.MONTH
1483
2286
  );
1484
2287
  const isNumber = computed(() => props.type === INPUT_TYPES.NUMBER);
1485
- const onStepUp = () => {
2288
+ function onStepUp() {
1486
2289
  if (isClickable.value) {
1487
- if (iMask == null ? void 0 : iMask.value) {
2290
+ if (props.iMask) {
1488
2291
  typed.value = typed.value + Number((step == null ? void 0 : step.value) ?? 1);
1489
2292
  return;
1490
2293
  }
1491
2294
  inputEl.value.stepUp();
1492
- localModelValue.value = unref(inputEl).value;
2295
+ localModelValue.value = Number(unref(inputEl).value);
1493
2296
  }
1494
- };
1495
- const onStepDown = () => {
2297
+ }
2298
+ function onStepDown() {
1496
2299
  if (isClickable.value) {
1497
- if (iMask == null ? void 0 : iMask.value) {
2300
+ if (props.iMask) {
1498
2301
  typed.value = typed.value - Number((step == null ? void 0 : step.value) ?? 1);
1499
2302
  return;
1500
2303
  }
1501
2304
  inputEl.value.stepDown();
1502
- localModelValue.value = unref(inputEl).value;
2305
+ localModelValue.value = Number(unref(inputEl).value);
1503
2306
  }
1504
- };
2307
+ }
1505
2308
  const isSearch = computed(() => props.type === INPUT_TYPES.SEARCH);
1506
- const onClear = () => {
2309
+ function onClear() {
1507
2310
  localModelValue.value = "";
1508
- };
1509
- const { hasIcon, hasIconBefore, hasIconAfter } = useComponentIcon(
1510
- icon,
1511
- iconPosition
1512
- );
1513
- const defaultAfterIcon = computed(() => {
2311
+ }
2312
+ const { hasIconBefore, hasIconAfter } = useComponentIcon(icon, iconPosition);
2313
+ const iconAfter = computed(() => {
2314
+ if (hasIconAfter.value !== void 0) {
2315
+ return hasIconAfter.value;
2316
+ }
1514
2317
  switch (props.type) {
1515
2318
  case INPUT_TYPES.COLOR:
1516
- return { name: TYPES_ICON.COLOR };
2319
+ return { name: ACTION_ICONS.showColorPicker };
1517
2320
  case INPUT_TYPES.DATE:
1518
2321
  case INPUT_TYPES.DATETIME_LOCAL:
1519
2322
  case INPUT_TYPES.WEEK:
1520
2323
  case INPUT_TYPES.MONTH:
1521
- return { name: TYPES_ICON.DATE };
2324
+ return { name: ACTION_ICONS.showDatePicker };
1522
2325
  case INPUT_TYPES.TIME:
1523
- return { name: TYPES_ICON.TIME };
1524
- default:
1525
- return "";
2326
+ return { name: ACTION_ICONS.showTimePicker };
1526
2327
  }
2328
+ return void 0;
1527
2329
  });
2330
+ const { hasIcon: hasIconRemoveSuggestion } = useComponentIcon(iconRemoveSuggestion);
1528
2331
  const { formatted: countFormatted } = useTextCount(localModelValue, {
1529
2332
  mode: count.value,
1530
2333
  upperLimit: Number(maxlength == null ? void 0 : maxlength.value),
@@ -1544,21 +2347,46 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1544
2347
  }
1545
2348
  return void 0;
1546
2349
  });
2350
+ const suggestions = usePersistence(
2351
+ storageKey,
2352
+ storageType,
2353
+ /* @__PURE__ */ new Set()
2354
+ );
2355
+ const filteredSuggestions = computed(() => {
2356
+ if (!suggestions.value) {
2357
+ return [];
2358
+ }
2359
+ return [...suggestions.value].filter(
2360
+ (suggestion) => isEmpty(localModelValue.value) || `${suggestion}`.toLowerCase().includes(`${localModelValue.value}`.toLowerCase()) && suggestion !== localModelValue.value
2361
+ ).reverse();
2362
+ });
2363
+ const hasSuggestions = computed(
2364
+ () => (storageKey == null ? void 0 : storageKey.value) && suggestions.value && suggestions.value.size > 0
2365
+ );
2366
+ function onSuggestionSelect(suggestion) {
2367
+ var _a;
2368
+ localModelValue.value = suggestion;
2369
+ (_a = dropdownEl.value) == null ? void 0 : _a.hide();
2370
+ }
2371
+ function onSuggestionRemove(suggestion) {
2372
+ var _a;
2373
+ (_a = suggestions.value) == null ? void 0 : _a.delete(suggestion);
2374
+ }
1547
2375
  const { modifiers } = toRefs(props);
1548
2376
  const bemCssClasses = useModifiers(
1549
2377
  "vv-input-text",
1550
2378
  modifiers,
1551
2379
  computed(() => ({
1552
- valid: valid.value,
1553
- invalid: invalid.value,
1554
- loading: loading.value,
1555
- disabled: props.disabled,
1556
- readonly: props.readonly,
1557
- "icon-before": hasIconBefore.value,
1558
- "icon-after": hasIconAfter.value || !isEmpty(defaultAfterIcon),
1559
- floating: props.floating && !isEmpty(props.label),
1560
- dirty: isDirty.value,
1561
- focus: isFocused.value,
2380
+ "valid": valid.value,
2381
+ "invalid": invalid.value,
2382
+ "loading": loading.value,
2383
+ "disabled": props.disabled,
2384
+ "readonly": props.readonly,
2385
+ "icon-before": !!hasIconBefore.value,
2386
+ "icon-after": !!iconAfter.value,
2387
+ "floating": props.floating && !isEmpty(props.label),
2388
+ "dirty": isDirty.value,
2389
+ "focus": isFocused.value,
1562
2390
  "auto-width": props.autoWidth
1563
2391
  }))
1564
2392
  );
@@ -1570,26 +2398,30 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1570
2398
  if (isDateTime.value && !isDirty.value && !focused.value) {
1571
2399
  return INPUT_TYPES.TEXT;
1572
2400
  }
1573
- if (iMask == null ? void 0 : iMask.value) {
2401
+ if (props.iMask) {
1574
2402
  return INPUT_TYPES.TEXT;
1575
2403
  }
1576
2404
  return props.type;
1577
2405
  })();
1578
2406
  const toReturn = {
1579
2407
  type: type2,
1580
- name: props.name,
1581
- tabindex: hasTabindex.value,
1582
- disabled: props.disabled,
1583
- readonly: props.readonly,
1584
- required: props.required,
1585
- autocomplete: props.autocomplete,
2408
+ "name": props.name,
2409
+ "tabindex": hasTabindex.value,
2410
+ "disabled": props.disabled,
2411
+ "readonly": props.readonly,
2412
+ "required": props.required,
2413
+ "autocomplete": props.autocomplete,
1586
2414
  "aria-invalid": isInvalid.value,
1587
2415
  "aria-describedby": hasHintLabelOrSlot.value ? hasHintId.value : void 0,
1588
2416
  "aria-errormessage": hasInvalidLabelOrSlot.value ? hasHintId.value : void 0
1589
2417
  };
1590
2418
  if (type2 === INPUT_TYPES.DATE || type2 === INPUT_TYPES.MONTH || type2 === INPUT_TYPES.WEEK || type2 === INPUT_TYPES.TIME || type2 === INPUT_TYPES.DATETIME_LOCAL || type2 === INPUT_TYPES.NUMBER) {
2419
+ let max = props.max;
2420
+ if (type2 === INPUT_TYPES.DATE && !max) {
2421
+ max = "9999-12-31";
2422
+ }
1591
2423
  toReturn.step = props.step;
1592
- toReturn.max = props.max !== void 0 ? String(props.max) : void 0;
2424
+ toReturn.max = max !== void 0 ? String(max) : void 0;
1593
2425
  toReturn.min = props.min !== void 0 ? String(props.min) : void 0;
1594
2426
  }
1595
2427
  if (type2 === INPUT_TYPES.TEXT || type2 === INPUT_TYPES.SEARCH || type2 === INPUT_TYPES.URL || type2 === INPUT_TYPES.TEL || type2 === INPUT_TYPES.EMAIL || type2 === INPUT_TYPES.PASSWORD || type2 === INPUT_TYPES.NUMBER) {
@@ -1632,11 +2464,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1632
2464
  INPUT_TYPES.SEARCH,
1633
2465
  props
1634
2466
  );
1635
- const onClickInner = () => {
2467
+ function onClickInner() {
1636
2468
  if (isClickable.value) {
1637
2469
  focused.value = true;
1638
2470
  }
1639
- };
2471
+ }
1640
2472
  const hasStyle = computed(() => {
1641
2473
  if (!props.autoWidth) {
1642
2474
  return void 0;
@@ -1645,7 +2477,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1645
2477
  width: localModelValue.value !== void 0 ? `${String(localModelValue.value).length + 1}ch` : void 0
1646
2478
  };
1647
2479
  });
1648
- const onKeyDown = (event) => {
2480
+ function onKeyDown(event) {
1649
2481
  switch (event.code) {
1650
2482
  case "ArrowUp":
1651
2483
  if (isNumber.value) {
@@ -1661,103 +2493,197 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1661
2493
  break;
1662
2494
  }
1663
2495
  emit("keydown", event);
1664
- };
2496
+ }
1665
2497
  return (_ctx, _cache) => {
1666
- return openBlock(), createElementBlock("div", {
1667
- class: normalizeClass(unref(bemCssClasses))
1668
- }, [
1669
- unref(label) ? (openBlock(), createElementBlock("label", {
1670
- key: 0,
1671
- for: unref(hasId),
1672
- class: "vv-input-text__label"
1673
- }, toDisplayString(unref(label)), 9, _hoisted_1)) : createCommentVNode("", true),
1674
- createElementVNode("div", _hoisted_2, [
1675
- _ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_3, [
1676
- renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
1677
- ])) : createCommentVNode("", true),
1678
- createElementVNode("div", {
1679
- ref_key: "innerEl",
1680
- ref: innerEl,
1681
- class: "vv-input-text__inner",
1682
- onClick: withModifiers(onClickInner, ["stop"])
2498
+ return openBlock(), createElementBlock(
2499
+ "div",
2500
+ {
2501
+ class: normalizeClass(unref(bemCssClasses))
2502
+ },
2503
+ [
2504
+ unref(label) ? (openBlock(), createElementBlock("label", {
2505
+ key: 0,
2506
+ for: unref(hasId),
2507
+ class: "vv-input-text__label"
2508
+ }, toDisplayString(unref(label)), 9, _hoisted_1)) : createCommentVNode("v-if", true),
2509
+ createElementVNode(
2510
+ "div",
2511
+ {
2512
+ ref_key: "wrapperEl",
2513
+ ref: wrapperEl,
2514
+ class: "vv-input-text__wrapper"
2515
+ },
2516
+ [
2517
+ _ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_2, [
2518
+ renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
2519
+ ])) : createCommentVNode("v-if", true),
2520
+ createElementVNode(
2521
+ "div",
2522
+ {
2523
+ ref_key: "innerEl",
2524
+ ref: innerEl,
2525
+ class: "vv-input-text__inner",
2526
+ onClick: withModifiers(onClickInner, ["stop"])
2527
+ },
2528
+ [
2529
+ unref(hasIconBefore) ? (openBlock(), createBlock(
2530
+ _sfc_main$4,
2531
+ mergeProps({ key: 0 }, unref(hasIconBefore), { class: "vv-input-text__icon" }),
2532
+ null,
2533
+ 16
2534
+ /* FULL_PROPS */
2535
+ )) : createCommentVNode("v-if", true),
2536
+ createElementVNode("input", mergeProps({
2537
+ id: unref(hasId),
2538
+ ref_key: "inputEl",
2539
+ ref: inputEl
2540
+ }, unref(hasAttrs), {
2541
+ style: unref(hasStyle),
2542
+ onKeyup: _cache[0] || (_cache[0] = ($event) => emit("keyup", $event)),
2543
+ onKeydown: onKeyDown,
2544
+ onKeypress: _cache[1] || (_cache[1] = ($event) => emit("keypress", $event))
2545
+ }), null, 16, _hoisted_3),
2546
+ (_ctx.unit || _ctx.$slots.unit) && unref(isDirty) ? (openBlock(), createElementBlock("div", _hoisted_4, [
2547
+ renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotProps))), () => [
2548
+ createTextVNode(
2549
+ toDisplayString(_ctx.unit),
2550
+ 1
2551
+ /* TEXT */
2552
+ )
2553
+ ])
2554
+ ])) : createCommentVNode("v-if", true)
2555
+ ],
2556
+ 512
2557
+ /* NEED_PATCH */
2558
+ ),
2559
+ unref(iconAfter) ? (openBlock(), createBlock(
2560
+ _sfc_main$4,
2561
+ mergeProps({ key: 1 }, unref(iconAfter), { class: "vv-input-text__icon vv-input-text__icon-after" }),
2562
+ null,
2563
+ 16
2564
+ /* FULL_PROPS */
2565
+ )) : unref(isPassword) && !_ctx.hideActions && unref(isClickable) ? (openBlock(), createBlock(unref(PasswordInputActions), {
2566
+ key: 2,
2567
+ onTogglePassword
2568
+ })) : unref(isNumber) && !_ctx.hideActions && unref(isClickable) ? (openBlock(), createBlock(unref(NumberInputActions), {
2569
+ key: 3,
2570
+ onStepUp,
2571
+ onStepDown
2572
+ })) : unref(isSearch) && !_ctx.hideActions && unref(isClickable) ? (openBlock(), createBlock(unref(SearchInputActions), {
2573
+ key: 4,
2574
+ onClear
2575
+ })) : createCommentVNode("v-if", true),
2576
+ _ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_5, [
2577
+ renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps(unref(slotProps))))
2578
+ ])) : createCommentVNode("v-if", true),
2579
+ unref(count) ? (openBlock(), createElementBlock("span", _hoisted_6, [
2580
+ renderSlot(_ctx.$slots, "count", normalizeProps(guardReactiveProps(unref(slotProps))), () => [
2581
+ createTextVNode(
2582
+ toDisplayString(unref(countFormatted)),
2583
+ 1
2584
+ /* TEXT */
2585
+ )
2586
+ ])
2587
+ ])) : createCommentVNode("v-if", true)
2588
+ ],
2589
+ 512
2590
+ /* NEED_PATCH */
2591
+ ),
2592
+ createVNode(unref(HintSlot), {
2593
+ id: unref(hasHintId),
2594
+ class: "vv-input-text__hint"
2595
+ }, createSlots({
2596
+ _: 2
2597
+ /* DYNAMIC */
1683
2598
  }, [
1684
- unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$1, mergeProps({
1685
- key: 0,
1686
- class: "vv-input-text__icon"
1687
- }, unref(hasIcon)), null, 16)) : createCommentVNode("", true),
1688
- createElementVNode("input", mergeProps({
1689
- id: unref(hasId),
1690
- ref_key: "inputEl",
1691
- ref: inputEl
1692
- }, unref(hasAttrs), {
1693
- style: unref(hasStyle),
1694
- onKeyup: _cache[0] || (_cache[0] = ($event) => emit("keyup", $event)),
1695
- onKeydown: onKeyDown,
1696
- onKeypress: _cache[1] || (_cache[1] = ($event) => emit("keypress", $event))
1697
- }), null, 16, _hoisted_5),
1698
- (_ctx.unit || _ctx.$slots.unit) && unref(isDirty) ? (openBlock(), createElementBlock("div", _hoisted_6, [
1699
- renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotProps))), () => [
1700
- createTextVNode(toDisplayString(_ctx.unit), 1)
1701
- ])
1702
- ])) : createCommentVNode("", true)
1703
- ], 8, _hoisted_4),
1704
- unref(hasIconAfter) || unref(defaultAfterIcon) ? (openBlock(), createBlock(_sfc_main$1, mergeProps({
2599
+ _ctx.$slots.hint ? {
2600
+ name: "hint",
2601
+ fn: withCtx(() => [
2602
+ renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
2603
+ ]),
2604
+ key: "0"
2605
+ } : void 0,
2606
+ _ctx.$slots.loading ? {
2607
+ name: "loading",
2608
+ fn: withCtx(() => [
2609
+ renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
2610
+ ]),
2611
+ key: "1"
2612
+ } : void 0,
2613
+ _ctx.$slots.valid ? {
2614
+ name: "valid",
2615
+ fn: withCtx(() => [
2616
+ renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
2617
+ ]),
2618
+ key: "2"
2619
+ } : void 0,
2620
+ _ctx.$slots.invalid ? {
2621
+ name: "invalid",
2622
+ fn: withCtx(() => [
2623
+ renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
2624
+ ]),
2625
+ key: "3"
2626
+ } : void 0
2627
+ ]), 1032, ["id"]),
2628
+ unref(hasSuggestions) ? (openBlock(), createBlock(_sfc_main$3, {
1705
2629
  key: 1,
1706
- class: "vv-input-text__icon vv-input-text__icon-after"
1707
- }, unref(hasIconAfter) ? unref(hasIcon) : unref(defaultAfterIcon)), null, 16)) : unref(isPassword) && !_ctx.hideActions && unref(isClickable) ? (openBlock(), createBlock(unref(PasswordInputActions), {
1708
- key: 2,
1709
- onTogglePassword
1710
- })) : unref(isNumber) && !_ctx.hideActions && unref(isClickable) ? (openBlock(), createBlock(unref(NumberInputActions), {
1711
- key: 3,
1712
- onStepUp,
1713
- onStepDown
1714
- })) : unref(isSearch) && !_ctx.hideActions && unref(isClickable) ? (openBlock(), createBlock(unref(SearchInputActions), {
1715
- key: 4,
1716
- onClear
1717
- })) : createCommentVNode("", true),
1718
- _ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_7, [
1719
- renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps(unref(slotProps))))
1720
- ])) : createCommentVNode("", true),
1721
- unref(count) ? (openBlock(), createElementBlock("span", _hoisted_8, [
1722
- renderSlot(_ctx.$slots, "count", normalizeProps(guardReactiveProps(unref(slotProps))), () => [
1723
- createTextVNode(toDisplayString(unref(countFormatted)), 1)
1724
- ])
1725
- ])) : createCommentVNode("", true)
1726
- ]),
1727
- createVNode(unref(HintSlot), {
1728
- id: unref(hasHintId),
1729
- class: "vv-input-text__hint"
1730
- }, createSlots({ _: 2 }, [
1731
- _ctx.$slots.hint ? {
1732
- name: "hint",
1733
- fn: withCtx(() => [
1734
- renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
2630
+ ref_key: "dropdownEl",
2631
+ ref: dropdownEl,
2632
+ reference: unref(wrapperEl),
2633
+ "autofocus-first": false,
2634
+ "trigger-width": true
2635
+ }, {
2636
+ items: withCtx(() => [
2637
+ (openBlock(true), createElementBlock(
2638
+ Fragment,
2639
+ null,
2640
+ renderList(unref(filteredSuggestions), (value) => {
2641
+ return openBlock(), createBlock(_sfc_main$1, {
2642
+ key: value,
2643
+ onClick: withModifiers(($event) => onSuggestionSelect(value), ["stop"])
2644
+ }, {
2645
+ default: withCtx(() => [
2646
+ createElementVNode("div", _hoisted_7, [
2647
+ renderSlot(_ctx.$slots, "suggestion", mergeProps({ ref_for: true }, { value }), () => [
2648
+ createTextVNode(
2649
+ toDisplayString(value),
2650
+ 1
2651
+ /* TEXT */
2652
+ )
2653
+ ])
2654
+ ]),
2655
+ unref(suggestions) && unref(hasIconRemoveSuggestion) ? (openBlock(), createElementBlock("button", {
2656
+ key: 0,
2657
+ type: "button",
2658
+ tabindex: "-1",
2659
+ class: "cursor-pointer",
2660
+ title: _ctx.labelRemoveSuggestion,
2661
+ onClick: withModifiers(($event) => onSuggestionRemove(value), ["stop"])
2662
+ }, [
2663
+ createVNode(
2664
+ _sfc_main$4,
2665
+ mergeProps({ ref_for: true }, unref(hasIconRemoveSuggestion)),
2666
+ null,
2667
+ 16
2668
+ /* FULL_PROPS */
2669
+ )
2670
+ ], 8, _hoisted_8)) : createCommentVNode("v-if", true)
2671
+ ]),
2672
+ _: 2
2673
+ /* DYNAMIC */
2674
+ }, 1032, ["onClick"]);
2675
+ }),
2676
+ 128
2677
+ /* KEYED_FRAGMENT */
2678
+ ))
1735
2679
  ]),
1736
- key: "0"
1737
- } : void 0,
1738
- _ctx.$slots.loading ? {
1739
- name: "loading",
1740
- fn: withCtx(() => [
1741
- renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1742
- ]),
1743
- key: "1"
1744
- } : void 0,
1745
- _ctx.$slots.valid ? {
1746
- name: "valid",
1747
- fn: withCtx(() => [
1748
- renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1749
- ]),
1750
- key: "2"
1751
- } : void 0,
1752
- _ctx.$slots.invalid ? {
1753
- name: "invalid",
1754
- fn: withCtx(() => [
1755
- renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1756
- ]),
1757
- key: "3"
1758
- } : void 0
1759
- ]), 1032, ["id"])
1760
- ], 2);
2680
+ _: 3
2681
+ /* FORWARDED */
2682
+ }, 8, ["reference"])) : createCommentVNode("v-if", true)
2683
+ ],
2684
+ 2
2685
+ /* CLASS */
2686
+ );
1761
2687
  };
1762
2688
  }
1763
2689
  });