@volverjs/ui-vue 0.0.10-beta.47 → 0.0.10-beta.49

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 (357) hide show
  1. package/README.md +2 -2
  2. package/auto-imports.d.ts +19 -11
  3. package/bin/icons.js +1 -0
  4. package/dist/components/VvAccordion/VvAccordion.es.js +4 -5
  5. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  6. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +8 -11
  7. package/dist/components/VvAccordion/index.d.ts +2 -2
  8. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +45 -46
  9. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  10. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +11 -13
  11. package/dist/components/VvAccordionGroup/index.d.ts +2 -2
  12. package/dist/components/VvAction/VvAction.vue.d.ts +8 -10
  13. package/dist/components/VvAction/index.d.ts +1 -1
  14. package/dist/components/VvAlert/VvAlert.es.js +158 -161
  15. package/dist/components/VvAlert/VvAlert.umd.js +1 -1
  16. package/dist/components/VvAlert/VvAlert.vue.d.ts +20 -22
  17. package/dist/components/VvAlert/index.d.ts +1 -1
  18. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +271 -274
  19. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
  20. package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +9 -11
  21. package/dist/components/VvAlertGroup/index.d.ts +2 -2
  22. package/dist/components/VvAvatar/VvAvatar.vue.d.ts +6 -6
  23. package/dist/components/VvAvatar/index.d.ts +1 -1
  24. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +21 -22
  25. package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
  26. package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +6 -6
  27. package/dist/components/VvAvatarGroup/index.d.ts +1 -1
  28. package/dist/components/VvBadge/VvBadge.vue.d.ts +6 -6
  29. package/dist/components/VvBadge/index.d.ts +1 -1
  30. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +23 -23
  31. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  32. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +19 -19
  33. package/dist/components/VvBreadcrumb/index.d.ts +1 -1
  34. package/dist/components/VvButton/VvButton.es.js +313 -314
  35. package/dist/components/VvButton/VvButton.umd.js +1 -1
  36. package/dist/components/VvButton/VvButton.vue.d.ts +14 -16
  37. package/dist/components/VvButton/index.d.ts +9 -9
  38. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +2 -2
  39. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +6 -8
  40. package/dist/components/VvButtonGroup/index.d.ts +1 -1
  41. package/dist/components/VvCard/VvCard.vue.d.ts +6 -6
  42. package/dist/components/VvCard/index.d.ts +1 -1
  43. package/dist/components/VvCheckbox/VvCheckbox.es.js +186 -187
  44. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  45. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +11 -13
  46. package/dist/components/VvCheckbox/index.d.ts +7 -7
  47. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +190 -191
  48. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  49. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +11 -13
  50. package/dist/components/VvCheckboxGroup/index.d.ts +2 -2
  51. package/dist/components/VvCombobox/VvCombobox.es.js +1864 -1865
  52. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  53. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +72 -291
  54. package/dist/components/VvCombobox/index.d.ts +1 -1
  55. package/dist/components/VvDialog/VvDialog.vue.d.ts +7 -9
  56. package/dist/components/VvDialog/index.d.ts +1 -1
  57. package/dist/components/VvDropdown/VvDropdown.es.js +9 -10
  58. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  59. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +51 -51
  60. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +22 -16
  61. package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +4 -4
  62. package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +4 -4
  63. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +6 -6
  64. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +2 -2
  65. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +2 -2
  66. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +2 -2
  67. package/dist/components/VvIcon/VvIcon.vue.d.ts +2 -23
  68. package/dist/components/VvInputFile/VvInputFile.es.js +651 -652
  69. package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
  70. package/dist/components/VvInputFile/VvInputFile.vue.d.ts +19 -19
  71. package/dist/components/VvInputFile/index.d.ts +4 -4
  72. package/dist/components/VvInputText/VvInputClearAction.d.ts +10 -6
  73. package/dist/components/VvInputText/VvInputPasswordAction.d.ts +11 -7
  74. package/dist/components/VvInputText/VvInputStepAction.d.ts +10 -6
  75. package/dist/components/VvInputText/VvInputText.es.js +715 -716
  76. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  77. package/dist/components/VvInputText/VvInputText.vue.d.ts +30 -32
  78. package/dist/components/VvInputText/index.d.ts +1 -1
  79. package/dist/components/VvNav/VvNav.es.js +5 -5
  80. package/dist/components/VvNav/VvNav.umd.js +1 -1
  81. package/dist/components/VvNav/VvNav.vue.d.ts +8 -10
  82. package/dist/components/VvNav/VvNavItem.vue.d.ts +1 -1
  83. package/dist/components/VvNav/VvNavSeparator.vue.d.ts +1 -1
  84. package/dist/components/VvNav/index.d.ts +2 -2
  85. package/dist/components/VvProgress/VvProgress.vue.d.ts +6 -6
  86. package/dist/components/VvProgress/index.d.ts +1 -1
  87. package/dist/components/VvRadio/VvRadio.es.js +186 -187
  88. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  89. package/dist/components/VvRadio/VvRadio.vue.d.ts +10 -12
  90. package/dist/components/VvRadio/index.d.ts +5 -5
  91. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +190 -191
  92. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  93. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +11 -13
  94. package/dist/components/VvRadioGroup/index.d.ts +2 -2
  95. package/dist/components/VvSelect/VvSelect.es.js +337 -338
  96. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  97. package/dist/components/VvSelect/VvSelect.vue.d.ts +20 -131
  98. package/dist/components/VvSelect/index.d.ts +7 -7
  99. package/dist/components/VvTab/VvTab.es.js +18 -18
  100. package/dist/components/VvTab/VvTab.umd.js +1 -1
  101. package/dist/components/VvTab/VvTab.vue.d.ts +6 -8
  102. package/dist/components/VvTab/index.d.ts +1 -1
  103. package/dist/components/VvTextarea/VvTextarea.es.js +292 -293
  104. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  105. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +14 -16
  106. package/dist/components/VvTextarea/index.d.ts +3 -3
  107. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +8 -8
  108. package/dist/components/common/HintSlot.d.ts +6 -6
  109. package/dist/components/index.d.ts +1 -1
  110. package/dist/components/index.es.js +2760 -2763
  111. package/dist/components/index.umd.js +1 -1
  112. package/dist/composables/alert/useAlert.d.ts +4 -4
  113. package/dist/composables/alert/{useProvideAlert.d.ts → useAlertProvide.d.ts} +1 -1
  114. package/dist/composables/dropdown/useDropdownContextmenu.d.ts +18 -0
  115. package/dist/composables/dropdown/{useProvideDropdown.d.ts → useDropdownProvide.d.ts} +6 -6
  116. package/dist/composables/dropdown/useDropdownVirtualElement.d.ts +17 -0
  117. package/dist/composables/group/{useInjectedGroupState.d.ts → useGroupStateInject.d.ts} +1 -1
  118. package/dist/composables/group/{useProvideGroupState.d.ts → useGroupStateProvide.d.ts} +2 -2
  119. package/dist/composables/index.d.ts +2 -0
  120. package/dist/composables/index.es.js +87 -3
  121. package/dist/composables/index.umd.js +1 -1
  122. package/dist/composables/useComponentFocus.d.ts +1 -1
  123. package/dist/composables/useOptions.d.ts +1 -1
  124. package/dist/composables/usePersistence.d.ts +1 -1
  125. package/dist/composables/useUniqueId.d.ts +1 -1
  126. package/dist/constants.d.ts +3 -3
  127. package/dist/directives/index.d.ts +2 -2
  128. package/dist/directives/index.es.js +145 -39
  129. package/dist/directives/index.umd.js +1 -1
  130. package/dist/directives/v-contextmenu.es.js +137 -31
  131. package/dist/directives/v-contextmenu.umd.js +1 -1
  132. package/dist/icons.d.ts +17 -17
  133. package/dist/icons.es.js +424 -424
  134. package/dist/icons.umd.js +1 -1
  135. package/dist/index.d.ts +1 -1
  136. package/dist/index.umd.js +1 -1
  137. package/dist/props/index.d.ts +4 -4
  138. package/dist/resolvers/unplugin.umd.js +1 -1
  139. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +178 -474
  140. package/dist/stories/Alert/Alert.settings.d.ts +1 -1
  141. package/dist/stories/Alert/AlertModifiers.stories.d.ts +1 -1
  142. package/dist/stories/Alert/AlertSlots.stories.d.ts +1 -1
  143. package/dist/stories/AlertGroup/AlertGroupPosition.stories.d.ts +1 -1
  144. package/dist/stories/AlertGroup/AlertGroupSlots.stories.d.ts +1 -1
  145. package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +1 -1
  146. package/dist/stories/Button/Button.settings.d.ts +1 -1
  147. package/dist/stories/Combobox/Combobox.settings.d.ts +1 -1
  148. package/dist/stories/Nav/Nav.settings.d.ts +1 -1
  149. package/dist/stories/Tab/Tab.settings.d.ts +1 -1
  150. package/dist/types/floating-ui.d.ts +1 -1
  151. package/dist/types/group.d.ts +1 -1
  152. package/dist/types/index.d.ts +2 -2
  153. package/dist/utils/DomUtilities.d.ts +1 -0
  154. package/package.json +43 -43
  155. package/src/Volver.ts +3 -3
  156. package/src/assets/icons/detailed.json +1 -1
  157. package/src/assets/icons/normal.json +1 -1
  158. package/src/assets/icons/simple.json +1 -1
  159. package/src/components/VvAccordion/VvAccordion.vue +5 -5
  160. package/src/components/VvAccordion/index.ts +2 -2
  161. package/src/components/VvAccordionGroup/VvAccordionGroup.vue +5 -5
  162. package/src/components/VvAction/VvAction.vue +1 -1
  163. package/src/components/VvAlert/VvAlert.vue +1 -1
  164. package/src/components/VvAlert/index.ts +1 -1
  165. package/src/components/VvAlertGroup/VvAlertGroup.vue +1 -1
  166. package/src/components/VvAlertGroup/index.ts +3 -3
  167. package/src/components/VvAvatarGroup/VvAvatarGroup.vue +1 -1
  168. package/src/components/VvBreadcrumb/VvBreadcrumb.vue +2 -2
  169. package/src/components/VvBreadcrumb/index.ts +1 -1
  170. package/src/components/VvButton/VvButton.vue +3 -3
  171. package/src/components/VvButton/index.ts +4 -4
  172. package/src/components/VvButtonGroup/VvButtonGroup.vue +3 -3
  173. package/src/components/VvCheckbox/VvCheckbox.vue +2 -2
  174. package/src/components/VvCheckbox/index.ts +2 -2
  175. package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +2 -2
  176. package/src/components/VvCombobox/VvCombobox.vue +9 -9
  177. package/src/components/VvCombobox/index.ts +15 -15
  178. package/src/components/VvDropdown/VvDropdown.vue +19 -19
  179. package/src/components/VvDropdown/VvDropdownAction.vue +1 -1
  180. package/src/components/VvDropdown/VvDropdownItem.vue +1 -1
  181. package/src/components/VvDropdown/VvDropdownOption.vue +1 -1
  182. package/src/components/VvDropdown/index.ts +2 -2
  183. package/src/components/VvIcon/VvIcon.vue +2 -2
  184. package/src/components/VvInputFile/VvInputFile.vue +7 -7
  185. package/src/components/VvInputFile/index.ts +7 -7
  186. package/src/components/VvInputText/VvInputPasswordAction.ts +1 -1
  187. package/src/components/VvInputText/VvInputText.vue +19 -19
  188. package/src/components/VvInputText/VvInputTextActions.ts +4 -4
  189. package/src/components/VvInputText/index.ts +2 -2
  190. package/src/components/VvNav/VvNav.vue +1 -1
  191. package/src/components/VvRadio/VvRadio.vue +1 -1
  192. package/src/components/VvRadio/index.ts +2 -2
  193. package/src/components/VvRadioGroup/VvRadioGroup.vue +2 -2
  194. package/src/components/VvSelect/VvSelect.vue +6 -6
  195. package/src/components/VvSelect/index.ts +12 -12
  196. package/src/components/VvTab/VvTab.vue +2 -2
  197. package/src/components/VvTab/index.ts +1 -1
  198. package/src/components/VvTextarea/VvTextarea.vue +1 -1
  199. package/src/components/common/HintSlot.ts +14 -14
  200. package/src/components/index.ts +1 -1
  201. package/src/composables/alert/useAlert.ts +2 -2
  202. package/src/composables/alert/{useProvideAlert.ts → useAlertProvide.ts} +2 -2
  203. package/src/composables/dropdown/useDropdownContextmenu.ts +22 -0
  204. package/src/composables/dropdown/{useProvideDropdown.ts → useDropdownProvide.ts} +9 -9
  205. package/src/composables/dropdown/useDropdownVirtualElement.ts +53 -0
  206. package/src/composables/group/{useInjectedGroupState.ts → useGroupStateInject.ts} +2 -2
  207. package/src/composables/group/{useProvideGroupState.ts → useGroupStateProvide.ts} +2 -2
  208. package/src/composables/index.ts +2 -0
  209. package/src/composables/useBlurhash.ts +2 -2
  210. package/src/composables/useOptions.ts +1 -1
  211. package/src/composables/usePersistence.ts +1 -1
  212. package/src/composables/useTextCount.ts +2 -2
  213. package/src/composables/useUniqueId.ts +2 -3
  214. package/src/constants.ts +5 -5
  215. package/src/directives/index.ts +2 -2
  216. package/src/directives/v-contextmenu.ts +21 -29
  217. package/src/directives/v-tooltip.ts +2 -2
  218. package/src/icons.ts +2 -2
  219. package/src/index.ts +1 -1
  220. package/src/props/index.ts +7 -7
  221. package/src/resolvers/unplugin.ts +5 -5
  222. package/src/stories/Accordion/Accordion.stories.ts +2 -2
  223. package/src/stories/Accordion/Accordion.test.ts +1 -1
  224. package/src/stories/Accordion/AccordionSlots.stories.ts +2 -2
  225. package/src/stories/AccordionGroup/AccordionGroup.stories.ts +2 -2
  226. package/src/stories/AccordionGroup/AccordionGroup.test.ts +1 -1
  227. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.ts +3 -3
  228. package/src/stories/Alert/Alert.settings.ts +1 -1
  229. package/src/stories/Alert/Alert.stories.ts +2 -2
  230. package/src/stories/Alert/Alert.test.ts +1 -1
  231. package/src/stories/Alert/AlertModifiers.stories.ts +2 -2
  232. package/src/stories/Alert/AlertSlots.stories.ts +2 -2
  233. package/src/stories/AlertGroup/AlertGroup.stories.ts +2 -2
  234. package/src/stories/AlertGroup/AlertGroup.test.ts +3 -3
  235. package/src/stories/AlertGroup/AlertGroupPosition.stories.ts +2 -2
  236. package/src/stories/AlertGroup/AlertGroupSlots.stories.ts +2 -2
  237. package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +2 -2
  238. package/src/stories/Avatar/Avatar.stories.ts +2 -2
  239. package/src/stories/Avatar/Avatar.test.ts +1 -1
  240. package/src/stories/Avatar/AvatarBadge.stories.ts +1 -1
  241. package/src/stories/Avatar/AvatarModifiers.stories.ts +2 -2
  242. package/src/stories/Avatar/AvatarSlots.stories.ts +2 -2
  243. package/src/stories/AvatarGroup/AvatarGroup.stories.ts +2 -2
  244. package/src/stories/AvatarGroup/AvatarGroup.test.ts +1 -1
  245. package/src/stories/AvatarGroup/AvatarGroupModifiers.stories.ts +2 -2
  246. package/src/stories/AvatarGroup/AvatarGroupSlotDefault.stories.ts +3 -3
  247. package/src/stories/Badge/Badge.stories.ts +2 -2
  248. package/src/stories/Badge/Badge.test.ts +1 -1
  249. package/src/stories/Badge/BadgeSlots.stories.ts +2 -2
  250. package/src/stories/Blurhash/BlurhashComposable.stories.ts +37 -117
  251. package/src/stories/Breadcrumb/Breadcrumb.stories.ts +2 -2
  252. package/src/stories/Breadcrumb/BreadcrumbSlots.stories.ts +5 -5
  253. package/src/stories/Button/Button.settings.ts +3 -3
  254. package/src/stories/Button/Button.stories.ts +2 -2
  255. package/src/stories/Button/Button.test.ts +1 -1
  256. package/src/stories/Button/ButtonIcon.stories.ts +2 -2
  257. package/src/stories/Button/ButtonLink.stories.ts +2 -2
  258. package/src/stories/Button/ButtonLoading.stories.ts +2 -2
  259. package/src/stories/Button/ButtonModifiers.stories.ts +2 -2
  260. package/src/stories/Button/ButtonSlots.stories.ts +3 -3
  261. package/src/stories/Button/ButtonState.stories.ts +2 -2
  262. package/src/stories/Button/ButtonToggle.stories.ts +2 -2
  263. package/src/stories/ButtonGroup/ButtonGroup.settings.ts +2 -2
  264. package/src/stories/ButtonGroup/ButtonGroup.stories.ts +2 -2
  265. package/src/stories/ButtonGroup/ButtonGroup.test.ts +1 -1
  266. package/src/stories/ButtonGroup/ButtonGroupModifiers.stories.ts +2 -2
  267. package/src/stories/ButtonGroup/ButtonGroupSlots.stories.ts +2 -2
  268. package/src/stories/ButtonGroup/ButtonGroupToggle.stories.ts +2 -2
  269. package/src/stories/Card/Card.stories.ts +2 -2
  270. package/src/stories/Card/Card.test.ts +1 -1
  271. package/src/stories/Card/CardSlots.stories.ts +2 -2
  272. package/src/stories/Checkbox/Checkbox.stories.ts +2 -2
  273. package/src/stories/Checkbox/Checkbox.test.ts +1 -1
  274. package/src/stories/Checkbox/CheckboxBinary.stories.ts +2 -2
  275. package/src/stories/Checkbox/CheckboxSlots.stories.ts +2 -2
  276. package/src/stories/CheckboxGroup/CheckboxGroup.stories.ts +2 -2
  277. package/src/stories/CheckboxGroup/CheckboxGroup.test.ts +2 -2
  278. package/src/stories/CheckboxGroup/CheckboxGroupOptions.stories.ts +2 -2
  279. package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.ts +3 -3
  280. package/src/stories/Combobox/Combobox.settings.ts +9 -9
  281. package/src/stories/Combobox/Combobox.stories.ts +2 -2
  282. package/src/stories/Combobox/Combobox.test.ts +2 -2
  283. package/src/stories/Combobox/ComboboxIconPosition.stories.ts +2 -2
  284. package/src/stories/Combobox/ComboboxMultiple.stories.ts +2 -2
  285. package/src/stories/Combobox/ComboboxOptions.stories.ts +2 -2
  286. package/src/stories/Combobox/ComboboxSlots.stories.ts +3 -3
  287. package/src/stories/Dialog/Dialog.stories.ts +2 -2
  288. package/src/stories/Dialog/Dialog.test.ts +1 -1
  289. package/src/stories/Dialog/DialogModifiers.stories.ts +2 -2
  290. package/src/stories/Dialog/DialogSlots.stories.ts +2 -2
  291. package/src/stories/Dropdown/Dropdown.settings.ts +1 -1
  292. package/src/stories/Dropdown/Dropdown.stories.ts +4 -4
  293. package/src/stories/Dropdown/Dropdown.test.ts +1 -1
  294. package/src/stories/Dropdown/DropdownContextmenuDirective.stories.ts +3 -4
  295. package/src/stories/Dropdown/DropdownMultilevel.stories.ts +4 -4
  296. package/src/stories/Dropdown/DropdownSlots.stories.ts +4 -4
  297. package/src/stories/Icon/Icon.settings.ts +1 -1
  298. package/src/stories/Icon/Icon.stories.ts +2 -2
  299. package/src/stories/Icon/IconsCollection.stories.ts +3 -3
  300. package/src/stories/InputFile/InputFile.settings.ts +1 -1
  301. package/src/stories/InputFile/InputFile.stories.ts +1 -1
  302. package/src/stories/InputFile/InputFileDropArea.stories.ts +2 -2
  303. package/src/stories/InputFile/InputFileIconPosition.stories.ts +2 -2
  304. package/src/stories/InputFile/InputFileSlots.stories.ts +2 -2
  305. package/src/stories/InputText/InputText.settings.ts +2 -2
  306. package/src/stories/InputText/InputText.stories.ts +2 -2
  307. package/src/stories/InputText/InputText.test.ts +2 -2
  308. package/src/stories/InputText/InputTextIconPosition.stories.ts +2 -2
  309. package/src/stories/InputText/InputTextLength.stories.ts +2 -2
  310. package/src/stories/InputText/InputTextMask.stories.ts +2 -2
  311. package/src/stories/InputText/InputTextMinMax.stories.ts +2 -2
  312. package/src/stories/InputText/InputTextSlots.stories.ts +2 -2
  313. package/src/stories/InputText/InputTextType.stories.ts +2 -2
  314. package/src/stories/Nav/Nav.settings.ts +1 -1
  315. package/src/stories/Nav/Nav.stories.ts +2 -2
  316. package/src/stories/Nav/Nav.test.ts +1 -1
  317. package/src/stories/Nav/NavModifiers.stories.ts +2 -2
  318. package/src/stories/Progress/Progress.stories.ts +2 -2
  319. package/src/stories/Progress/Progress.test.ts +2 -2
  320. package/src/stories/Radio/Radio.stories.ts +2 -2
  321. package/src/stories/Radio/Radio.test.ts +1 -1
  322. package/src/stories/Radio/RadioSlots.stories.ts +2 -2
  323. package/src/stories/RadioGroup/RadioGroup.stories.ts +2 -2
  324. package/src/stories/RadioGroup/RadioGroup.test.ts +2 -2
  325. package/src/stories/RadioGroup/RadioGroupOptions.stories.ts +2 -2
  326. package/src/stories/RadioGroup/RadioGroupSlots.stories.ts +3 -3
  327. package/src/stories/Select/Select.settings.ts +10 -10
  328. package/src/stories/Select/Select.stories.ts +2 -2
  329. package/src/stories/Select/Select.test.ts +1 -1
  330. package/src/stories/Select/SelectIconPosition.stories.ts +2 -2
  331. package/src/stories/Select/SelectOptions.stories.ts +2 -2
  332. package/src/stories/Select/SelectSlots.stories.ts +2 -2
  333. package/src/stories/Tab/Tab.settings.ts +1 -1
  334. package/src/stories/Tab/Tab.stories.ts +1 -1
  335. package/src/stories/Tab/Tab.test.ts +1 -1
  336. package/src/stories/Textarea/Textarea.settings.ts +1 -1
  337. package/src/stories/Textarea/Textarea.stories.ts +2 -2
  338. package/src/stories/Textarea/Textarea.test.ts +1 -1
  339. package/src/stories/Textarea/TextareaLength.stories.ts +2 -2
  340. package/src/stories/Textarea/TextareaSlots.stories.ts +2 -2
  341. package/src/stories/Textarea/TextareatIconPosition.stories.ts +2 -2
  342. package/src/stories/Tooltip/Tooltip.stories.ts +3 -3
  343. package/src/stories/Tooltip/Tooltip.test.ts +1 -1
  344. package/src/stories/Tooltip/TooltipDirective.stories.ts +3 -3
  345. package/src/test/expect.ts +3 -3
  346. package/src/test/types.d.ts +2 -2
  347. package/src/types/floating-ui.ts +1 -1
  348. package/src/types/group.ts +1 -1
  349. package/src/types/index.ts +2 -2
  350. package/src/utils/DomUtilities.ts +15 -0
  351. package/src/utils/ObjectUtilities.ts +4 -4
  352. package/src/workers/blurhash.ts +1 -1
  353. package/dist/composables/alert/{useInjectAlert.d.ts → useAlerInject.d.ts} +0 -0
  354. package/dist/composables/dropdown/{useInjectDropdown.d.ts → useDropdownInject.d.ts} +0 -0
  355. package/src/assets/icons/normal/{dulicate.svg → duplicate.svg} +0 -0
  356. package/src/composables/alert/{useInjectAlert.ts → useAlerInject.ts} +0 -0
  357. package/src/composables/dropdown/{useInjectDropdown.ts → useDropdownInject.ts} +1 -1
@@ -1,14 +1,9 @@
1
- import { inject, computed, unref, defineComponent, mergeDefaults, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, provide, h, Fragment, useAttrs, onMounted, watch, nextTick, createElementBlock, createVNode, withCtx, renderSlot, normalizeProps, guardReactiveProps, Transition, toHandlers, withDirectives, createElementVNode, normalizeStyle, normalizeClass, vShow, createTextVNode, toDisplayString, isRef, useSlots, renderList, vModelSelect, createSlots, getCurrentInstance, resolveDynamicComponent, toRef, withModifiers, vModelText } from "vue";
1
+ import { computed, isRef, defineComponent, h, unref, toRefs, openBlock, createElementBlock, normalizeClass, renderSlot, createTextVNode, toDisplayString, inject, toRef, getCurrentInstance, ref, watch, createBlock, resolveDynamicComponent, mergeProps, withCtx, mergeDefaults, createCommentVNode, useId, useAttrs, useSlots, Fragment, provide, useTemplateRef, onMounted, nextTick, createVNode, normalizeProps, guardReactiveProps, Transition, toHandlers, withDirectives, createElementVNode, normalizeStyle, vShow, renderList, vModelSelect, createSlots, withModifiers, vModelText } from "vue";
2
2
  import { iconExists, Icon, addIcon } from "@iconify/vue";
3
3
  import { autoPlacement, flip, shift, size, offset, arrow, useFloating, autoUpdate } from "@floating-ui/vue";
4
- import { uid } from "uid";
5
4
  import { useMutationObserver, useVModel, onClickOutside, useFocusWithin, useElementHover, onKeyStroke, useFocus, useElementVisibility, refDebounced, computedAsync } from "@vueuse/core";
6
5
  import mitt from "mitt";
7
6
  import { get } from "ts-dot-prop";
8
- const VvIconPropsDefaults = {
9
- prefix: "normal"
10
- /* normal */
11
- };
12
7
  var StorageType = /* @__PURE__ */ ((StorageType2) => {
13
8
  StorageType2["local"] = "local";
14
9
  StorageType2["session"] = "session";
@@ -84,145 +79,6 @@ const INJECTION_KEY_DROPDOWN_ITEM = Symbol.for(
84
79
  const INJECTION_KEY_DROPDOWN_ACTION = Symbol.for(
85
80
  "dropdownAction"
86
81
  );
87
- function useVolver() {
88
- return inject(INJECTION_KEY_VOLVER);
89
- }
90
- function useModifiers(prefix, modifiers, others) {
91
- return computed(() => {
92
- const toReturn = {
93
- [prefix]: true
94
- };
95
- const modifiersArray = typeof (modifiers == null ? void 0 : modifiers.value) === "string" ? modifiers.value.split(" ") : modifiers == null ? void 0 : modifiers.value;
96
- if (modifiersArray) {
97
- if (Array.isArray(modifiersArray)) {
98
- modifiersArray.forEach((modifier) => {
99
- if (modifier) {
100
- toReturn[`${prefix}--${modifier}`] = true;
101
- }
102
- });
103
- }
104
- }
105
- if (others) {
106
- Object.keys(others.value).forEach((key) => {
107
- toReturn[`${prefix}--${key}`] = unref(others.value[key]);
108
- });
109
- }
110
- return toReturn;
111
- });
112
- }
113
- const __default__$9 = {
114
- name: "VvIcon"
115
- };
116
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
117
- ...__default__$9,
118
- props: /* @__PURE__ */ mergeDefaults({
119
- name: {},
120
- color: {},
121
- width: {},
122
- height: {},
123
- provider: {},
124
- prefix: {},
125
- src: {},
126
- horizontalFlip: { type: Boolean },
127
- verticalFlip: { type: Boolean },
128
- flip: {},
129
- mode: {},
130
- inline: { type: Boolean },
131
- rotate: {},
132
- onLoad: { type: Function },
133
- svg: {},
134
- modifiers: {}
135
- }, VvIconPropsDefaults),
136
- setup(__props) {
137
- const props = __props;
138
- const hasRotate = computed(() => {
139
- if (typeof props.rotate === "string") {
140
- return Number.parseFloat(props.rotate);
141
- }
142
- return props.rotate;
143
- });
144
- const show = ref(true);
145
- const volver = useVolver();
146
- const { modifiers } = toRefs(props);
147
- const bemCssClasses = useModifiers("vv-icon", modifiers);
148
- const provider = computed(() => {
149
- return props.provider || (volver == null ? void 0 : volver.iconsProvider);
150
- });
151
- const icon = computed(() => {
152
- const name = props.name ?? "";
153
- const iconName = `@${provider.value}:${props.prefix}:${name}`;
154
- if (iconExists(iconName)) {
155
- return iconName;
156
- }
157
- const iconsCollection = volver == null ? void 0 : volver.iconsCollections.find(
158
- (iconsCollection2) => {
159
- const icon2 = `@${provider.value}:${iconsCollection2.prefix}:${name}`;
160
- return iconExists(icon2);
161
- }
162
- );
163
- if (iconsCollection) {
164
- return `@${provider.value}:${iconsCollection.prefix}:${name}`;
165
- }
166
- return name;
167
- });
168
- function getSvgContent(svg) {
169
- let dom;
170
- if (typeof window === "undefined") {
171
- const { JSDOM } = require("jsdom");
172
- dom = new JSDOM().window;
173
- }
174
- const domParser = dom ? new dom.DOMParser() : new window.DOMParser();
175
- const svgDomString = domParser.parseFromString(svg, "text/html");
176
- const svgEl = svgDomString.querySelector("svg");
177
- return svgEl;
178
- }
179
- function addIconFromSvg(svg) {
180
- const svgContentEl = getSvgContent(svg);
181
- const svgContent = (svgContentEl == null ? void 0 : svgContentEl.innerHTML.trim()) || "";
182
- if (svgContentEl && svgContent) {
183
- addIcon(`@${provider.value}:${props.prefix}:${props.name}`, {
184
- body: svgContent,
185
- // Set height and width from svg content
186
- height: svgContentEl.viewBox.baseVal.height,
187
- width: svgContentEl.viewBox.baseVal.width
188
- });
189
- }
190
- }
191
- if (volver) {
192
- if (props.src && !iconExists(`@${provider.value}:${props.prefix}:${props.name}`)) {
193
- show.value = false;
194
- volver.fetchIcon(props.src).then((svg) => {
195
- if (svg) {
196
- addIconFromSvg(svg);
197
- show.value = true;
198
- }
199
- }).catch((e) => {
200
- throw new Error(`Error during fetch icon: ${e == null ? void 0 : e.message}`);
201
- });
202
- }
203
- }
204
- if (props.svg) {
205
- addIconFromSvg(props.svg);
206
- }
207
- return (_ctx, _cache) => {
208
- return unref(show) ? (openBlock(), createBlock(unref(Icon), mergeProps({
209
- key: 0,
210
- class: unref(bemCssClasses)
211
- }, {
212
- inline: _ctx.inline,
213
- width: _ctx.width,
214
- height: _ctx.height,
215
- horizontalFlip: _ctx.horizontalFlip,
216
- verticalFlip: _ctx.verticalFlip,
217
- flip: _ctx.flip,
218
- rotate: unref(hasRotate),
219
- color: _ctx.color,
220
- onLoad: _ctx.onLoad,
221
- icon: unref(icon)
222
- }), null, 16, ["class"])) : createCommentVNode("v-if", true);
223
- };
224
- }
225
- });
226
82
  const LinkProps = {
227
83
  /**
228
84
  * The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
@@ -587,1667 +443,864 @@ const ActionProps = {
587
443
  },
588
444
  storageKey: String
589
445
  });
590
- const VvDropdownProps = {
591
- ...IdProps,
592
- ...DropdownProps,
446
+ const VvComboboxProps = {
447
+ ...IdNameProps,
448
+ ...TabindexProps,
449
+ ...ValidProps,
450
+ ...InvalidProps,
451
+ ...HintProps,
452
+ ...LoadingProps,
453
+ ...DisabledProps,
454
+ ...ReadonlyProps,
593
455
  ...ModifiersProps,
456
+ ...OptionsProps,
457
+ ...IconProps,
458
+ ...FloatingLabelProps,
459
+ ...DropdownProps,
460
+ ...LabelProps,
594
461
  /**
595
- * Show / hide dropdown programmatically
462
+ * Dropdown show / hide transition name
463
+ */
464
+ transitionName: {
465
+ type: String,
466
+ default: "vv-dropdown--mobile-fade-block"
467
+ },
468
+ /**
469
+ * modelValue can be a string, number, boolean, object or array of string, number, boolean, object
596
470
  */
597
471
  modelValue: {
598
- type: Boolean,
472
+ type: [String, Number, Boolean, Object, Array],
599
473
  default: void 0
600
474
  },
601
475
  /**
602
- * Dropdown trigger element
476
+ * Label for no search results
603
477
  */
604
- reference: {
605
- type: Object,
606
- default: null
478
+ noResultsLabel: { type: String, default: "No results" },
479
+ /**
480
+ * Label for no options available
481
+ */
482
+ noOptionsLabel: { type: String, default: "No options available" },
483
+ /**
484
+ * Label for selected option hint
485
+ */
486
+ selectedHintLabel: { type: String, default: "Selected" },
487
+ /**
488
+ * Label for deselect action button
489
+ */
490
+ deselectActionLabel: { type: String, default: "Deselect" },
491
+ /**
492
+ * Label for select option hint
493
+ */
494
+ selectHintLabel: { type: String, default: "Press enter to select" },
495
+ /**
496
+ * Label for deselected option hint
497
+ */
498
+ deselectHintLabel: { type: String, default: "Press enter to remove" },
499
+ /**
500
+ * Label close button
501
+ */
502
+ closeLabel: { type: String, default: "Close" },
503
+ /**
504
+ * Select input placeholder
505
+ */
506
+ placeholder: String,
507
+ /**
508
+ * Use input text to search on options
509
+ */
510
+ searchable: Boolean,
511
+ /**
512
+ * Search function to filter options
513
+ */
514
+ searchFunction: {
515
+ type: Function,
516
+ default: void 0
607
517
  },
608
518
  /**
609
- * Dropdown role
519
+ * On searchable select is the input search placeholder
610
520
  */
611
- role: {
521
+ searchPlaceholder: {
612
522
  type: String,
613
- default: DropdownRole.menu,
614
- validator: (value) => Object.values(DropdownRole).includes(value)
615
- }
616
- };
617
- const VvDropdownItemProps = {
618
- focusOnHover: {
619
- type: Boolean,
620
- default: false
621
- }
622
- };
623
- const VvDropdownOptionProps = {
624
- ...DisabledProps,
625
- ...SelectedProps,
626
- ...UnselectableProps,
627
- ...ModifiersProps,
628
- deselectHintLabel: {
629
- type: String
630
- },
631
- selectHintLabel: {
632
- type: String
523
+ default: "Search..."
633
524
  },
634
- selectedHintLabel: {
635
- type: String
525
+ /**
526
+ * The input search debounce time in ms
527
+ */
528
+ debounceSearch: {
529
+ type: [Number, String],
530
+ default: 0
636
531
  },
637
- focusOnHover: {
638
- type: Boolean,
639
- default: false
640
- }
641
- };
642
- function useUniqueId(id) {
643
- return computed(() => String((id == null ? void 0 : id.value) || uid()));
644
- }
645
- function useProvideDropdownTrigger({
646
- reference,
647
- id,
648
- expanded,
649
- aria
650
- }) {
651
- const bus = mitt();
652
- const component = defineComponent({
653
- name: "VvDropdownTriggerProvider",
654
- setup() {
655
- provide(INJECTION_KEY_DROPDOWN_TRIGGER, {
656
- reference,
657
- id,
658
- expanded,
659
- aria,
660
- bus
661
- });
532
+ /**
533
+ * Manage modelValue as string[] or object[]
534
+ */
535
+ multiple: Boolean,
536
+ /**
537
+ * The min number of selected values
538
+ */
539
+ minValues: {
540
+ type: [Number, String],
541
+ default: 0
542
+ },
543
+ /**
544
+ * The max number of selected values
545
+ */
546
+ maxValues: [Number, String],
547
+ /**
548
+ * If true the input will be unselectable
549
+ * @deprecated use minValues instead
550
+ */
551
+ unselectable: { type: Boolean, default: true },
552
+ /**
553
+ * The select label separator visible to the user
554
+ */
555
+ separator: { type: String, default: ", " },
556
+ /**
557
+ * Show native select
558
+ */
559
+ native: Boolean,
560
+ /**
561
+ * Show badges
562
+ */
563
+ badges: Boolean,
564
+ /**
565
+ * Badge modifiers
566
+ */
567
+ badgeModifiers: {
568
+ type: [String, Array],
569
+ default: "action sm"
570
+ },
571
+ /**
572
+ * Set dropdown width to the same as the trigger
573
+ */
574
+ triggerWidth: {
575
+ ...DropdownProps.triggerWidth,
576
+ default: true
577
+ },
578
+ /**
579
+ * Dropdown modifiers
580
+ */
581
+ dropdownModifiers: {
582
+ type: [String, Array],
583
+ default: "mobile"
584
+ },
585
+ /**
586
+ * Open dropdown on focus
587
+ */
588
+ autoOpen: {
589
+ type: Boolean,
590
+ default: false
591
+ },
592
+ /**
593
+ * Select first option automatically
594
+ */
595
+ autoselectFirst: {
596
+ type: Boolean,
597
+ default: false
598
+ },
599
+ /**
600
+ * Keep open dropdown on single select
601
+ */
602
+ keepOpen: {
603
+ type: Boolean,
604
+ default: false
605
+ }
606
+ };
607
+ function useVvComboboxProps() {
608
+ return {
609
+ ...VvComboboxProps,
610
+ options: {
611
+ ...VvComboboxProps.options,
612
+ type: Array
662
613
  },
663
- render() {
664
- var _a, _b;
665
- return h(Fragment, {}, (_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a));
614
+ searchFunction: {
615
+ ...VvComboboxProps.searchFunction,
616
+ type: Function
666
617
  }
667
- });
668
- return {
669
- bus,
670
- component
671
618
  };
672
619
  }
673
- function useProvideDropdownItem({
674
- role,
675
- ...others
676
- }) {
677
- const itemRole = computed(
678
- () => role.value === DropdownRole.listbox ? DropdownItemRole.option : DropdownItemRole.presentation
679
- );
680
- provide(INJECTION_KEY_DROPDOWN_ITEM, {
681
- role: itemRole,
682
- ...others
683
- });
684
- return { itemRole };
685
- }
686
- function useProvideDropdownAction({
687
- expanded
688
- }) {
689
- provide(INJECTION_KEY_DROPDOWN_ACTION, {
690
- role: ref(ActionRoles.menuitem),
691
- expanded
692
- });
620
+ function equals(obj1, obj2, field) {
621
+ return deepEquals(obj1, obj2);
693
622
  }
694
- const _hoisted_1$5 = ["id", "tabindex", "role", "aria-labelledby"];
695
- const __default__$8 = {
696
- name: "VvDropdown",
697
- inheritAttrs: false
698
- };
699
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
700
- ...__default__$8,
701
- props: VvDropdownProps,
702
- emits: [
703
- "update:modelValue",
704
- "beforeEnter",
705
- "afterLeave",
706
- "beforeExpand",
707
- "beforeCollapse",
708
- "afterExpand",
709
- "afterCollapse",
710
- "before-enter",
711
- "after-leave",
712
- "enter",
713
- "afterEnter",
714
- "enterCancelled",
715
- "beforeLeave",
716
- "leave",
717
- "leaveCancelled"
718
- ],
719
- setup(__props, { expose: __expose, emit: __emit }) {
720
- const props = __props;
721
- const emit = __emit;
722
- const { id } = toRefs(props);
723
- const hasId = useUniqueId(id);
724
- const attrs = useAttrs();
725
- const maxWidth = ref("auto");
726
- const maxHeight = ref("auto");
727
- const localReferenceEl = ref(null);
728
- const floatingEl = ref();
729
- const arrowEl = ref(null);
730
- const listEl = ref(null);
731
- const referenceEl = computed({
732
- get: () => props.reference ?? localReferenceEl.value,
733
- set: (newValue) => {
734
- localReferenceEl.value = newValue;
735
- }
736
- });
737
- const hasCustomPosition = ref(false);
738
- onMounted(() => {
739
- useMutationObserver(
740
- floatingEl.value,
741
- () => {
742
- var _a;
743
- hasCustomPosition.value = ((_a = window.getComputedStyle(floatingEl.value).getPropertyValue("--dropdown-custom-position")) == null ? void 0 : _a.trim()) === "true";
744
- },
745
- {
746
- attributeFilter: ["style"],
747
- window
748
- }
749
- );
750
- });
751
- const middleware = computed(() => {
752
- const toReturn = [];
753
- if (props.autoPlacement) {
754
- if (typeof props.autoPlacement === "boolean") {
755
- toReturn.push(autoPlacement());
756
- } else {
757
- toReturn.push(
758
- autoPlacement(props.autoPlacement)
759
- );
760
- }
761
- } else if (props.flip) {
762
- if (typeof props.flip === "boolean") {
763
- toReturn.push(flip({ fallbackStrategy: "initialPlacement" }));
764
- } else {
765
- toReturn.push(flip(props.flip));
766
- }
623
+ function deepEquals(a, b) {
624
+ if (a === b)
625
+ return true;
626
+ if (a && b && typeof a == "object" && typeof b == "object") {
627
+ const arrA = Array.isArray(a);
628
+ const arrB = Array.isArray(b);
629
+ let i, length, key;
630
+ if (arrA && arrB) {
631
+ length = a.length;
632
+ if (length !== b.length)
633
+ return false;
634
+ for (i = length; i-- !== 0; ) {
635
+ if (!deepEquals(a[i], b[i]))
636
+ return false;
767
637
  }
768
- if (props.shift) {
769
- if (typeof props.shift === "boolean") {
770
- toReturn.push(shift());
771
- } else {
772
- toReturn.push(shift(props.shift));
773
- }
638
+ return true;
639
+ }
640
+ if (arrA !== arrB)
641
+ return false;
642
+ const dateA = a instanceof Date;
643
+ const dateB = b instanceof Date;
644
+ if (dateA !== dateB)
645
+ return false;
646
+ if (dateA && dateB)
647
+ return a.getTime() === b.getTime();
648
+ const regexpA = a instanceof RegExp;
649
+ const regexpB = b instanceof RegExp;
650
+ if (regexpA !== regexpB)
651
+ return false;
652
+ if (regexpA && regexpB)
653
+ return a.toString() === b.toString();
654
+ const keys = Object.keys(a);
655
+ length = keys.length;
656
+ if (length !== Object.keys(b).length)
657
+ return false;
658
+ for (i = length; i-- !== 0; ) {
659
+ if (!Object.prototype.hasOwnProperty.call(b, keys[i]))
660
+ return false;
661
+ }
662
+ for (i = length; i-- !== 0; ) {
663
+ key = keys[i];
664
+ if (!deepEquals(a[key], b[key]))
665
+ return false;
666
+ }
667
+ return true;
668
+ }
669
+ return Number.isNaN(a) && Number.isNaN(b);
670
+ }
671
+ function contains(value, list) {
672
+ if (value != null && list && list.length) {
673
+ for (const val of list) {
674
+ if (equals(value, val)) {
675
+ return true;
774
676
  }
775
- if (props.size) {
776
- const apply = ({
777
- availableWidth,
778
- availableHeight
779
- }) => {
780
- maxWidth.value = `${availableWidth}px`;
781
- maxHeight.value = `${availableHeight}px`;
782
- };
783
- if (typeof props.size === "boolean") {
784
- toReturn.push(
785
- size({
786
- apply
787
- })
677
+ }
678
+ }
679
+ return false;
680
+ }
681
+ function isString(value) {
682
+ return typeof value === "string" || value instanceof String;
683
+ }
684
+ function joinLines(items) {
685
+ if (Array.isArray(items)) {
686
+ return items.filter((item) => isString(item)).join(" ");
687
+ }
688
+ return items;
689
+ }
690
+ function HintSlotFactory(propsOrRef, slots) {
691
+ const props = computed(() => {
692
+ if (isRef(propsOrRef)) {
693
+ return propsOrRef.value;
694
+ }
695
+ return propsOrRef;
696
+ });
697
+ const invalidLabel = computed(() => joinLines(props.value.invalidLabel));
698
+ const validLabel = computed(() => joinLines(props.value.validLabel));
699
+ const loadingLabel = computed(() => props.value.loadingLabel);
700
+ const hintLabel = computed(() => props.value.hintLabel);
701
+ const hasLoadingLabelOrSlot = computed(
702
+ () => Boolean(props.value.loading && (slots.loading || loadingLabel.value))
703
+ );
704
+ const hasInvalidLabelOrSlot = computed(
705
+ () => !hasLoadingLabelOrSlot.value && Boolean(
706
+ props.value.invalid && (slots.invalid || invalidLabel.value)
707
+ )
708
+ );
709
+ const hasValidLabelOrSlot = computed(
710
+ () => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.value.valid && (slots.valid || validLabel.value))
711
+ );
712
+ const hasHintLabelOrSlot = computed(
713
+ () => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && !hasValidLabelOrSlot.value && Boolean(slots.hint || hintLabel.value)
714
+ );
715
+ const isVisible = computed(
716
+ () => hasInvalidLabelOrSlot.value || hasValidLabelOrSlot.value || hasLoadingLabelOrSlot.value || hasHintLabelOrSlot.value
717
+ );
718
+ const hintSlotScope = computed(() => ({
719
+ modelValue: props.value.modelValue,
720
+ valid: props.value.valid,
721
+ invalid: props.value.invalid,
722
+ loading: props.value.loading
723
+ }));
724
+ const HintSlot = defineComponent({
725
+ name: "HintSlot",
726
+ props: {
727
+ tag: {
728
+ type: String,
729
+ default: "small"
730
+ }
731
+ },
732
+ setup() {
733
+ return {
734
+ isVisible,
735
+ invalidLabel,
736
+ validLabel,
737
+ loadingLabel,
738
+ hintLabel,
739
+ hasInvalidLabelOrSlot,
740
+ hasValidLabelOrSlot,
741
+ hasLoadingLabelOrSlot,
742
+ hasHintLabelOrSlot
743
+ };
744
+ },
745
+ render() {
746
+ var _a, _b, _c, _d, _e, _f, _g, _h;
747
+ if (this.isVisible) {
748
+ let role;
749
+ if (this.hasInvalidLabelOrSlot) {
750
+ role = "alert";
751
+ }
752
+ if (this.hasValidLabelOrSlot) {
753
+ role = "status";
754
+ }
755
+ if (this.hasLoadingLabelOrSlot) {
756
+ return h(
757
+ this.tag,
758
+ {
759
+ role
760
+ },
761
+ ((_b = (_a = this.$slots).loading) == null ? void 0 : _b.call(_a)) ?? this.loadingLabel
788
762
  );
789
- } else {
790
- toReturn.push(
791
- size({
792
- ...props.size,
793
- apply
794
- })
763
+ }
764
+ if (this.hasInvalidLabelOrSlot) {
765
+ return h(
766
+ this.tag,
767
+ {
768
+ role
769
+ },
770
+ ((_d = (_c = this.$slots).invalid) == null ? void 0 : _d.call(_c)) ?? this.$slots.invalid ?? this.invalidLabel
795
771
  );
796
772
  }
797
- }
798
- if (props.offset) {
799
- toReturn.push(offset(Number(props.offset)));
800
- if (["string", "number"].includes(typeof props.offset)) {
801
- toReturn.push(offset(Number(props.offset)));
802
- } else {
803
- toReturn.push(offset(props.offset));
773
+ if (this.hasValidLabelOrSlot) {
774
+ return h(
775
+ this.tag,
776
+ {
777
+ role
778
+ },
779
+ ((_f = (_e = this.$slots).valid) == null ? void 0 : _f.call(_e)) ?? this.validLabel
780
+ );
804
781
  }
805
- }
806
- if (props.arrow) {
807
- toReturn.push(
808
- arrow({
809
- element: arrowEl
810
- })
782
+ return h(
783
+ this.tag,
784
+ {
785
+ role
786
+ },
787
+ ((_h = (_g = this.$slots).hint) == null ? void 0 : _h.call(_g)) ?? this.$slots.hint ?? this.hintLabel
811
788
  );
812
789
  }
813
- return toReturn;
814
- });
815
- const { x, y, middlewareData, placement, strategy } = useFloating(
816
- referenceEl,
817
- floatingEl,
818
- {
819
- whileElementsMounted: (...args) => {
820
- return autoUpdate(...args, {
821
- animationFrame: props.strategy === Strategy.fixed
822
- });
823
- },
824
- placement: computed(() => props.placement),
825
- strategy: computed(() => props.strategy),
826
- middleware
827
- }
828
- );
829
- const dropdownPlacement = computed(() => {
830
- var _a;
831
- if (hasCustomPosition.value) {
832
- return void 0;
833
- }
834
- const width = props.triggerWidth && referenceEl.value ? `${(_a = referenceEl.value) == null ? void 0 : _a.offsetWidth}px` : void 0;
835
- return {
836
- position: strategy.value,
837
- top: `${y.value ?? 0}px`,
838
- left: `${x.value ?? 0}px`,
839
- maxWidth: width ? void 0 : maxWidth.value,
840
- maxHeight: maxHeight.value,
841
- width
842
- };
843
- });
844
- const side = computed(
845
- () => placement.value.split("-")[0]
846
- );
847
- const arrowPlacement = computed(() => {
848
- var _a, _b, _c, _d, _e;
849
- if (hasCustomPosition.value) {
850
- return void 0;
851
- }
852
- const staticSide = {
853
- [Side.top]: Side.bottom,
854
- [Side.right]: Side.left,
855
- [Side.bottom]: Side.top,
856
- [Side.left]: Side.right
857
- }[side.value];
858
- return {
859
- left: ((_a = middlewareData.value.arrow) == null ? void 0 : _a.x) !== void 0 ? `${(_b = middlewareData.value.arrow) == null ? void 0 : _b.x}px` : void 0,
860
- top: ((_c = middlewareData.value.arrow) == null ? void 0 : _c.y) !== void 0 ? `${(_d = middlewareData.value.arrow) == null ? void 0 : _d.y}px` : void 0,
861
- [staticSide]: `${-(((_e = arrowEl.value) == null ? void 0 : _e.offsetWidth) ?? 0) / 2}px`
862
- };
863
- });
864
- const modelValue = useVModel(props, "modelValue", emit);
865
- const localModelValue = ref(false);
866
- const expanded = computed({
867
- get: () => modelValue.value ?? localModelValue.value,
868
- set: (newValue) => {
869
- if (modelValue.value === void 0) {
870
- localModelValue.value = newValue;
871
- return;
872
- }
873
- modelValue.value = newValue;
874
- }
875
- });
876
- function show() {
877
- expanded.value = true;
878
- }
879
- function hide() {
880
- expanded.value = false;
881
- }
882
- function toggle() {
883
- expanded.value = !expanded.value;
884
- }
885
- function init(el) {
886
- referenceEl.value = el;
790
+ return null;
887
791
  }
888
- __expose({
889
- toggle,
890
- show,
891
- hide,
892
- init,
893
- customPosition: hasCustomPosition
894
- });
895
- watch(expanded, (newValue) => {
896
- if (newValue && props.autofocusFirst) {
897
- nextTick(() => {
898
- const focusableElements = getKeyboardFocusableElements(
899
- floatingEl.value
900
- );
901
- if (focusableElements.length > 0) {
902
- focusableElements[0].focus({
903
- preventScroll: true
904
- });
792
+ });
793
+ return {
794
+ hasInvalidLabelOrSlot,
795
+ hasHintLabelOrSlot,
796
+ hasValidLabelOrSlot,
797
+ hasLoadingLabelOrSlot,
798
+ hintSlotScope,
799
+ HintSlot
800
+ };
801
+ }
802
+ const VvBadgeProps = {
803
+ ...ModifiersProps,
804
+ value: [String, Number]
805
+ };
806
+ function useModifiers(prefix, modifiers, others) {
807
+ return computed(() => {
808
+ const toReturn = {
809
+ [prefix]: true
810
+ };
811
+ const modifiersArray = typeof (modifiers == null ? void 0 : modifiers.value) === "string" ? modifiers.value.split(" ") : modifiers == null ? void 0 : modifiers.value;
812
+ if (modifiersArray) {
813
+ if (Array.isArray(modifiersArray)) {
814
+ modifiersArray.forEach((modifier) => {
815
+ if (modifier) {
816
+ toReturn[`${prefix}--${modifier}`] = true;
905
817
  }
906
818
  });
907
819
  }
908
- });
909
- onClickOutside(
910
- floatingEl,
911
- () => {
912
- if (!props.keepOpen && expanded.value) {
913
- expanded.value = false;
914
- }
915
- },
916
- { ignore: [referenceEl] }
917
- );
918
- const hasAriaLabelledby = computed(() => {
919
- var _a, _b;
920
- return ((_b = (_a = referenceEl.value) == null ? void 0 : _a.getAttribute) == null ? void 0 : _b.call(_a, "id")) ?? void 0;
921
- });
922
- const referenceAria = computed(() => ({
923
- "aria-controls": hasId.value,
924
- "aria-haspopup": true,
925
- "aria-expanded": expanded.value
926
- }));
927
- const { component: VvDropdownTriggerProvider, bus } = useProvideDropdownTrigger({
928
- reference: referenceEl,
929
- id: hasId,
930
- expanded,
931
- aria: referenceAria
932
- });
933
- bus.on("click", toggle);
934
- const { role, modifiers } = toRefs(props);
935
- const bemCssClasses = useModifiers(
936
- "vv-dropdown",
937
- modifiers,
938
- computed(() => ({
939
- arrow: props.arrow
940
- }))
941
- );
942
- const { focused } = useFocusWithin(floatingEl);
943
- function getKeyboardFocusableElements(element) {
944
- if (!element) {
945
- return [];
946
- }
947
- return [
948
- ...element.querySelectorAll(
949
- 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
950
- )
951
- ].filter(
952
- (el) => !el.hasAttribute("disabled") && !el.getAttribute("aria-hidden")
953
- );
954
- }
955
- function focusNext() {
956
- nextTick(() => {
957
- if (focused.value) {
958
- const focusableElements = getKeyboardFocusableElements(
959
- floatingEl.value
960
- );
961
- if (focusableElements.length === 0 || !document.activeElement) {
962
- return;
963
- }
964
- const activeElementIndex = focusableElements.indexOf(
965
- document.activeElement
966
- );
967
- if (activeElementIndex < focusableElements.length - 1) {
968
- focusableElements[activeElementIndex + 1].focus({
969
- preventScroll: true
970
- });
971
- } else {
972
- focusableElements[0].focus({
973
- preventScroll: true
974
- });
975
- }
976
- }
977
- });
978
820
  }
979
- function focusPrev() {
980
- nextTick(() => {
981
- if (focused.value) {
982
- const focusableElements = getKeyboardFocusableElements(
983
- floatingEl.value
984
- );
985
- if (focusableElements.length === 0 || !document.activeElement) {
986
- return;
987
- }
988
- const activeElementIndex = focusableElements.indexOf(
989
- document.activeElement
990
- );
991
- if (activeElementIndex > 0) {
992
- focusableElements[activeElementIndex - 1].focus({
993
- preventScroll: true
994
- });
995
- } else {
996
- focusableElements[focusableElements.length - 1].focus({
997
- preventScroll: true
998
- });
999
- }
1000
- }
821
+ if (others) {
822
+ Object.keys(others.value).forEach((key) => {
823
+ toReturn[`${prefix}--${key}`] = unref(others.value[key]);
1001
824
  });
1002
825
  }
1003
- const hovered = useElementHover(floatingEl);
1004
- const { itemRole } = useProvideDropdownItem({
1005
- role,
1006
- expanded,
1007
- focused,
1008
- hovered
1009
- });
1010
- onKeyStroke("Escape", (e) => {
1011
- if (expanded.value) {
1012
- e.preventDefault();
1013
- hide();
1014
- }
1015
- });
1016
- onKeyStroke("ArrowDown", (e) => {
1017
- if (expanded.value && focused.value) {
1018
- e.preventDefault();
1019
- focusNext();
1020
- }
1021
- });
1022
- onKeyStroke("ArrowUp", (e) => {
1023
- if (expanded.value && focused.value) {
1024
- e.preventDefault();
1025
- focusPrev();
1026
- }
1027
- });
1028
- onKeyStroke([" ", "Enter"], (e) => {
1029
- const htmlEl = e.target;
1030
- if (expanded.value && focused.value && htmlEl) {
1031
- htmlEl == null ? void 0 : htmlEl.click();
1032
- }
1033
- });
1034
- const dropdownTransitionHandlers = {
1035
- "before-enter": () => {
1036
- emit(expanded.value ? "beforeExpand" : "beforeCollapse");
1037
- emit("beforeEnter");
1038
- },
1039
- "after-leave": () => {
1040
- emit(expanded.value ? "afterExpand" : "afterCollapse");
1041
- emit("afterLeave");
1042
- },
1043
- "enter": () => {
1044
- emit("enter");
1045
- },
1046
- "after-enter": () => {
1047
- emit("afterEnter");
1048
- },
1049
- "enter-cancelled": () => {
1050
- emit("enterCancelled");
1051
- },
1052
- "before-leave": () => {
1053
- emit("beforeLeave");
1054
- },
1055
- "leave": () => {
1056
- emit("leave");
1057
- },
1058
- "leave-cancelled": () => {
1059
- emit("leaveCancelled");
1060
- }
1061
- };
826
+ return toReturn;
827
+ });
828
+ }
829
+ const __default__$9 = {
830
+ name: "VvBadge"
831
+ };
832
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
833
+ ...__default__$9,
834
+ props: VvBadgeProps,
835
+ setup(__props) {
836
+ const props = __props;
837
+ const { modifiers } = toRefs(props);
838
+ const bemCssClasses = useModifiers("vv-badge", modifiers);
1062
839
  return (_ctx, _cache) => {
1063
840
  return openBlock(), createElementBlock(
1064
- Fragment,
1065
- null,
841
+ "span",
842
+ {
843
+ class: normalizeClass(unref(bemCssClasses))
844
+ },
1066
845
  [
1067
- createVNode(unref(VvDropdownTriggerProvider), null, {
1068
- default: withCtx(() => [
1069
- renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({ init, show, hide, toggle, expanded: unref(expanded), aria: unref(referenceAria) })))
1070
- ]),
1071
- _: 3
1072
- /* FORWARDED */
1073
- }),
1074
- createVNode(Transition, mergeProps({ name: _ctx.transitionName }, toHandlers(dropdownTransitionHandlers), { persisted: "" }), {
1075
- default: withCtx(() => [
1076
- withDirectives(createElementVNode(
1077
- "div",
1078
- {
1079
- ref_key: "floatingEl",
1080
- ref: floatingEl,
1081
- style: normalizeStyle(unref(dropdownPlacement)),
1082
- class: normalizeClass(unref(bemCssClasses))
1083
- },
1084
- [
1085
- props.arrow ? (openBlock(), createElementBlock(
1086
- "div",
1087
- {
1088
- key: 0,
1089
- ref_key: "arrowEl",
1090
- ref: arrowEl,
1091
- style: normalizeStyle(unref(arrowPlacement)),
1092
- class: "vv-dropdown__arrow"
1093
- },
1094
- null,
1095
- 4
1096
- /* STYLE */
1097
- )) : createCommentVNode("v-if", true),
1098
- renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps({ expanded: unref(expanded) }))),
1099
- createElementVNode("div", mergeProps(unref(attrs), {
1100
- id: unref(hasId),
1101
- ref_key: "listEl",
1102
- ref: listEl,
1103
- tabindex: !unref(expanded) ? -1 : void 0,
1104
- role: unref(role),
1105
- "aria-labelledby": unref(hasAriaLabelledby),
1106
- class: "vv-dropdown__list"
1107
- }), [
1108
- renderSlot(_ctx.$slots, "items", normalizeProps(guardReactiveProps({
1109
- role: unref(itemRole)
1110
- })))
1111
- ], 16, _hoisted_1$5),
1112
- renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps({ expanded: unref(expanded) })))
1113
- ],
1114
- 6
1115
- /* CLASS, STYLE */
1116
- ), [
1117
- [vShow, unref(expanded)]
1118
- ])
1119
- ]),
1120
- _: 3
1121
- /* FORWARDED */
1122
- }, 16, ["name"])
846
+ renderSlot(_ctx.$slots, "default", {}, () => [
847
+ createTextVNode(
848
+ toDisplayString(_ctx.value),
849
+ 1
850
+ /* TEXT */
851
+ )
852
+ ])
1123
853
  ],
1124
- 64
1125
- /* STABLE_FRAGMENT */
854
+ 2
855
+ /* CLASS */
1126
856
  );
1127
857
  };
1128
858
  }
1129
859
  });
1130
- function useInjectedDropdownTrigger() {
1131
- return inject(INJECTION_KEY_DROPDOWN_TRIGGER, {});
1132
- }
1133
- function useInjectedDropdownItem() {
1134
- return inject(INJECTION_KEY_DROPDOWN_ITEM, {});
1135
- }
1136
- function useInjectedDropdownAction() {
1137
- return inject(INJECTION_KEY_DROPDOWN_ACTION, {});
1138
- }
1139
- const __default__$7 = {
1140
- name: "VvDropdownItem"
1141
- };
1142
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1143
- ...__default__$7,
1144
- props: VvDropdownItemProps,
1145
- setup(__props) {
1146
- const props = __props;
1147
- const { role, expanded } = useInjectedDropdownItem();
1148
- const element = ref(null);
1149
- useProvideDropdownAction({ expanded });
1150
- const hovered = useElementHover(element);
1151
- const { focused } = useFocus(element);
1152
- const { focused: focusedWithin } = useFocusWithin(element);
1153
- watch(hovered, (newValue) => {
1154
- if (newValue && props.focusOnHover) {
1155
- focused.value = true;
1156
- }
1157
- });
1158
- return (_ctx, _cache) => {
1159
- return openBlock(), createElementBlock(
1160
- "div",
1161
- mergeProps({ role: unref(role) }, {
1162
- ref_key: "element",
1163
- ref: element,
1164
- class: ["vv-dropdown__item", { "focus-visible": unref(focused) || unref(focusedWithin) }]
1165
- }),
1166
- [
1167
- renderSlot(_ctx.$slots, "default")
1168
- ],
1169
- 16
1170
- /* FULL_PROPS */
1171
- );
1172
- };
1173
- }
1174
- });
1175
- const _hoisted_1$4 = ["title"];
1176
- const __default__$6 = {
1177
- name: "VvDropdownOption"
1178
- };
1179
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
1180
- ...__default__$6,
1181
- props: VvDropdownOptionProps,
1182
- setup(__props) {
1183
- const props = __props;
1184
- const { modifiers } = toRefs(props);
1185
- const bemCssClasses = useModifiers(
1186
- "vv-dropdown-option",
1187
- modifiers,
1188
- computed(() => ({
1189
- disabled: props.disabled,
1190
- selected: props.selected,
1191
- unselectable: props.unselectable && props.selected
1192
- }))
1193
- );
1194
- const hintLabel = computed(() => {
1195
- if (props.selected) {
1196
- return props.unselectable ? props.deselectHintLabel : props.selectedHintLabel;
1197
- }
1198
- if (!props.disabled) {
1199
- return props.selectHintLabel;
860
+ function useGroupStateInject(groupKey) {
861
+ const group = inject(groupKey, void 0);
862
+ const isInGroup = computed(() => group !== void 0);
863
+ function getGroupOrLocalRef(propName, props, emit) {
864
+ const groupPropValue = group == null ? void 0 : group[propName];
865
+ if (groupPropValue) {
866
+ return computed({
867
+ get() {
868
+ return groupPropValue.value;
869
+ },
870
+ set(value) {
871
+ groupPropValue.value = value;
872
+ }
873
+ });
874
+ }
875
+ const propRef = toRef(props, propName);
876
+ return computed({
877
+ get() {
878
+ return propRef.value;
879
+ },
880
+ set(value) {
881
+ if (emit) {
882
+ emit(`update:${propName}`, value);
883
+ }
1200
884
  }
1201
- return "";
1202
885
  });
1203
- return (_ctx, _cache) => {
1204
- return openBlock(), createBlock(_sfc_main$7, {
1205
- class: normalizeClass(unref(bemCssClasses)),
1206
- tabindex: _ctx.disabled ? -1 : 0,
1207
- "aria-selected": _ctx.selected,
1208
- "aria-disabled": _ctx.disabled,
1209
- "focus-on-hover": _ctx.focusOnHover
1210
- }, {
1211
- default: withCtx(() => [
1212
- renderSlot(_ctx.$slots, "default"),
1213
- createElementVNode("span", {
1214
- class: "vv-dropdown-option__hint",
1215
- title: unref(hintLabel)
1216
- }, [
1217
- renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps({ disabled: _ctx.disabled, selected: _ctx.selected, unselectable: _ctx.unselectable })), () => [
1218
- createTextVNode(
1219
- toDisplayString(unref(hintLabel)),
1220
- 1
1221
- /* TEXT */
1222
- )
1223
- ])
1224
- ], 8, _hoisted_1$4)
1225
- ]),
1226
- _: 3
1227
- /* FORWARDED */
1228
- }, 8, ["class", "tabindex", "aria-selected", "aria-disabled", "focus-on-hover"]);
1229
- };
1230
886
  }
1231
- });
1232
- const _hoisted_1$3 = {
1233
- class: "vv-dropdown-optgroup",
1234
- role: "presentation",
1235
- tabindex: "-1"
1236
- };
1237
- const __default__$5 = {
1238
- name: "VvDropdownOptgroup"
1239
- };
1240
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
1241
- ...__default__$5,
1242
- props: {
1243
- ...LabelProps
887
+ return {
888
+ group,
889
+ isInGroup,
890
+ getGroupOrLocalRef
891
+ };
892
+ }
893
+ const VvButtonEvents = ["update:modelValue"];
894
+ const VvButtonProps = {
895
+ ...ActionProps,
896
+ ...IdProps,
897
+ ...ModifiersProps,
898
+ ...UnselectableProps,
899
+ ...LoadingProps,
900
+ ...IconProps,
901
+ /**
902
+ * Button icon position
903
+ */
904
+ iconPosition: {
905
+ type: String,
906
+ default: Side.left,
907
+ validator: (value) => Object.values(Side).includes(value)
1244
908
  },
1245
- setup(__props) {
1246
- const props = __props;
1247
- return (_ctx, _cache) => {
1248
- return openBlock(), createElementBlock(
1249
- "li",
1250
- _hoisted_1$3,
1251
- toDisplayString(props.label),
1252
- 1
1253
- /* TEXT */
1254
- );
1255
- };
909
+ /**
910
+ * Loading icon
911
+ */
912
+ loadingIcon: { type: String, default: "eos-icons:bubble-loading" },
913
+ /**
914
+ * Enable button toggle
915
+ */
916
+ toggle: {
917
+ type: Boolean,
918
+ default: false
919
+ },
920
+ /**
921
+ * Button toggle value
922
+ */
923
+ value: {
924
+ type: [String, Number, Boolean],
925
+ default: void 0
926
+ },
927
+ /**
928
+ * Value associated with the unchecked state
929
+ */
930
+ uncheckedValue: {
931
+ type: [String, Number, Boolean],
932
+ default: void 0
933
+ },
934
+ /**
935
+ * Button toggle model value
936
+ */
937
+ modelValue: {
938
+ type: [String, Number, Boolean],
939
+ default: void 0
1256
940
  }
1257
- });
1258
- function equals(obj1, obj2, field) {
1259
- return deepEquals(obj1, obj2);
1260
- }
1261
- function deepEquals(a, b) {
1262
- if (a === b)
1263
- return true;
1264
- if (a && b && typeof a == "object" && typeof b == "object") {
1265
- const arrA = Array.isArray(a);
1266
- const arrB = Array.isArray(b);
1267
- let i, length, key;
1268
- if (arrA && arrB) {
1269
- length = a.length;
1270
- if (length !== b.length)
1271
- return false;
1272
- for (i = length; i-- !== 0; ) {
1273
- if (!deepEquals(a[i], b[i]))
1274
- return false;
941
+ };
942
+ function useGroupProps(props, emit) {
943
+ const { group, isInGroup, getGroupOrLocalRef } = useGroupStateInject(INJECTION_KEY_BUTTON_GROUP);
944
+ const { id, iconPosition, icon, label, pressed } = toRefs(props);
945
+ const modelValue = getGroupOrLocalRef("modelValue", props, emit);
946
+ const toggle = getGroupOrLocalRef("toggle", props);
947
+ const unselectable = getGroupOrLocalRef("unselectable", props);
948
+ const multiple = computed(() => (group == null ? void 0 : group.multiple.value) ?? false);
949
+ const modifiers = computed(() => {
950
+ let localModifiers = props.modifiers;
951
+ let groupModifiers = group == null ? void 0 : group.modifiers.value;
952
+ const toReturn = /* @__PURE__ */ new Set();
953
+ if (localModifiers) {
954
+ if (!Array.isArray(localModifiers)) {
955
+ localModifiers = localModifiers.split(" ");
1275
956
  }
1276
- return true;
1277
- }
1278
- if (arrA !== arrB)
1279
- return false;
1280
- const dateA = a instanceof Date;
1281
- const dateB = b instanceof Date;
1282
- if (dateA !== dateB)
1283
- return false;
1284
- if (dateA && dateB)
1285
- return a.getTime() === b.getTime();
1286
- const regexpA = a instanceof RegExp;
1287
- const regexpB = b instanceof RegExp;
1288
- if (regexpA !== regexpB)
1289
- return false;
1290
- if (regexpA && regexpB)
1291
- return a.toString() === b.toString();
1292
- const keys = Object.keys(a);
1293
- length = keys.length;
1294
- if (length !== Object.keys(b).length)
1295
- return false;
1296
- for (i = length; i-- !== 0; ) {
1297
- if (!Object.prototype.hasOwnProperty.call(b, keys[i]))
1298
- return false;
1299
- }
1300
- for (i = length; i-- !== 0; ) {
1301
- key = keys[i];
1302
- if (!deepEquals(a[key], b[key]))
1303
- return false;
957
+ localModifiers.forEach((modifier) => toReturn.add(modifier));
1304
958
  }
1305
- return true;
1306
- }
1307
- return Number.isNaN(a) && Number.isNaN(b);
1308
- }
1309
- function contains(value, list) {
1310
- if (value != null && list && list.length) {
1311
- for (const val of list) {
1312
- if (equals(value, val)) {
1313
- return true;
959
+ if (groupModifiers) {
960
+ if (!Array.isArray(groupModifiers)) {
961
+ groupModifiers = groupModifiers.split(" ");
1314
962
  }
963
+ groupModifiers.forEach((modifier) => toReturn.add(modifier));
1315
964
  }
1316
- }
1317
- return false;
1318
- }
1319
- function isString(value) {
1320
- return typeof value === "string" || value instanceof String;
1321
- }
1322
- function joinLines(items) {
1323
- if (Array.isArray(items)) {
1324
- return items.filter((item) => isString(item)).join(" ");
1325
- }
1326
- return items;
1327
- }
1328
- function HintSlotFactory(propsOrRef, slots) {
1329
- const props = computed(() => {
1330
- if (isRef(propsOrRef)) {
1331
- return propsOrRef.value;
1332
- }
1333
- return propsOrRef;
965
+ return Array.from(toReturn);
1334
966
  });
1335
- const invalidLabel = computed(() => joinLines(props.value.invalidLabel));
1336
- const validLabel = computed(() => joinLines(props.value.validLabel));
1337
- const loadingLabel = computed(() => props.value.loadingLabel);
1338
- const hintLabel = computed(() => props.value.hintLabel);
1339
- const hasLoadingLabelOrSlot = computed(
1340
- () => Boolean(props.value.loading && (slots.loading || loadingLabel.value))
1341
- );
1342
- const hasInvalidLabelOrSlot = computed(
1343
- () => !hasLoadingLabelOrSlot.value && Boolean(
1344
- props.value.invalid && (slots.invalid || invalidLabel.value)
1345
- )
1346
- );
1347
- const hasValidLabelOrSlot = computed(
1348
- () => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.value.valid && (slots.valid || validLabel.value))
1349
- );
1350
- const hasHintLabelOrSlot = computed(
1351
- () => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && !hasValidLabelOrSlot.value && Boolean(slots.hint || hintLabel.value)
1352
- );
1353
- const isVisible = computed(
1354
- () => hasInvalidLabelOrSlot.value || hasValidLabelOrSlot.value || hasLoadingLabelOrSlot.value || hasHintLabelOrSlot.value
967
+ const disabled = computed(
968
+ () => Boolean(props.disabled || (group == null ? void 0 : group.disabled.value))
1355
969
  );
1356
- const hintSlotScope = computed(() => ({
1357
- modelValue: props.value.modelValue,
1358
- valid: props.value.valid,
1359
- invalid: props.value.invalid,
1360
- loading: props.value.loading
1361
- }));
1362
- const HintSlot = defineComponent({
1363
- name: "HintSlot",
1364
- props: {
1365
- tag: {
1366
- type: String,
1367
- default: "small"
1368
- }
1369
- },
1370
- setup() {
1371
- return {
1372
- isVisible,
1373
- invalidLabel,
1374
- validLabel,
1375
- loadingLabel,
1376
- hintLabel,
1377
- hasInvalidLabelOrSlot,
1378
- hasValidLabelOrSlot,
1379
- hasLoadingLabelOrSlot,
1380
- hasHintLabelOrSlot
1381
- };
1382
- },
1383
- render() {
1384
- var _a, _b, _c, _d, _e, _f, _g, _h;
1385
- if (this.isVisible) {
1386
- let role;
1387
- if (this.hasInvalidLabelOrSlot) {
1388
- role = "alert";
1389
- }
1390
- if (this.hasValidLabelOrSlot) {
1391
- role = "status";
1392
- }
1393
- if (this.hasLoadingLabelOrSlot) {
1394
- return h(
1395
- this.tag,
1396
- {
1397
- role
1398
- },
1399
- ((_b = (_a = this.$slots).loading) == null ? void 0 : _b.call(_a)) ?? this.loadingLabel
1400
- );
1401
- }
1402
- if (this.hasInvalidLabelOrSlot) {
1403
- return h(
1404
- this.tag,
1405
- {
1406
- role
1407
- },
1408
- ((_d = (_c = this.$slots).invalid) == null ? void 0 : _d.call(_c)) ?? this.$slots.invalid ?? this.invalidLabel
1409
- );
1410
- }
1411
- if (this.hasValidLabelOrSlot) {
1412
- return h(
1413
- this.tag,
1414
- {
1415
- role
1416
- },
1417
- ((_f = (_e = this.$slots).valid) == null ? void 0 : _f.call(_e)) ?? this.validLabel
1418
- );
1419
- }
1420
- return h(
1421
- this.tag,
1422
- {
1423
- role
1424
- },
1425
- ((_h = (_g = this.$slots).hint) == null ? void 0 : _h.call(_g)) ?? this.$slots.hint ?? this.hintLabel
1426
- );
1427
- }
1428
- return null;
1429
- }
1430
- });
1431
970
  return {
1432
- hasInvalidLabelOrSlot,
1433
- hasHintLabelOrSlot,
1434
- hasValidLabelOrSlot,
1435
- hasLoadingLabelOrSlot,
1436
- hintSlotScope,
1437
- HintSlot
971
+ // group props
972
+ group,
973
+ isInGroup,
974
+ modelValue,
975
+ toggle,
976
+ unselectable,
977
+ multiple,
978
+ modifiers,
979
+ disabled,
980
+ // local props
981
+ id,
982
+ pressed,
983
+ iconPosition,
984
+ icon,
985
+ label
1438
986
  };
1439
987
  }
1440
- const VvSelectProps = {
1441
- ...IdNameProps,
1442
- ...AutofocusProps,
1443
- ...AutocompleteProps,
1444
- ...TabindexProps,
1445
- ...ValidProps,
1446
- ...InvalidProps,
1447
- ...HintProps,
1448
- ...LoadingProps,
1449
- ...DisabledProps,
1450
- ...ReadonlyProps,
1451
- ...ModifiersProps,
1452
- ...OptionsProps,
1453
- ...IconProps,
1454
- ...FloatingLabelProps,
1455
- ...UnselectableProps,
1456
- ...LabelProps,
1457
- /**
1458
- * This Boolean attribute indicates that multiple options can be selected in the list.
1459
- * If it is not specified, then only one option can be selected at a time.
1460
- * When multiple is specified, most browsers will show a scrolling list box instead of a single line dropdown.
1461
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select#attr-multiple
1462
- */
1463
- multiple: Boolean,
1464
- /**
1465
- * A Boolean attribute indicating that an option with a non-empty string value must be selected.
1466
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select#attr-required
1467
- */
1468
- required: Boolean,
1469
- /**
1470
- * If the control is presented as a scrolling list box (e.g. when multiple is specified),
1471
- * this attribute represents the number of rows in the list that should be visible at one time.
1472
- * Browsers are not required to present a select element as a scrolled list box. The default value is 0.
1473
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select#attr-size
1474
- */
1475
- size: [String, Number],
1476
- /**
1477
- * modelValue can be a string, number, boolean, object or array of string, number, boolean, object
1478
- */
1479
- modelValue: {
1480
- type: [String, Number, Boolean, Object, Array],
1481
- default: void 0
1482
- },
1483
- /**
1484
- * Select first option automatically
1485
- */
1486
- autoselectFirst: {
1487
- type: Boolean,
1488
- default: false
1489
- },
1490
- /**
1491
- * Select placeholder
1492
- */
1493
- placeholder: String
1494
- };
1495
- function useVvSelectProps() {
1496
- return {
1497
- ...VvSelectProps,
1498
- options: {
1499
- ...VvSelectProps.options,
1500
- type: Array,
1501
- default: () => []
1502
- }
1503
- };
988
+ const VvActionEvents = ["click", "mouseover", "mouseleave"];
989
+ const VvActionProps = ActionProps;
990
+ function useVolver() {
991
+ return inject(INJECTION_KEY_VOLVER);
1504
992
  }
1505
- function useDefaults(componentName, propsDefinition, props) {
1506
- const volver = useVolver();
1507
- const volverComponentDefaults = computed(() => {
1508
- var _a;
1509
- if (!volver || !((_a = volver.defaults.value) == null ? void 0 : _a[componentName])) {
1510
- return void 0;
1511
- }
1512
- return volver.defaults.value[componentName];
1513
- });
1514
- return computed(() => {
1515
- if (volverComponentDefaults.value === void 0) {
1516
- return props;
1517
- }
1518
- const componentDefaults = volverComponentDefaults.value;
1519
- const simplifiedPropsDefinition = propsDefinition;
1520
- const simplifiedProps = props;
1521
- return Object.keys(simplifiedPropsDefinition).reduce((acc, key) => {
1522
- const propValue = simplifiedProps[key];
1523
- acc[key] = propValue;
1524
- if (key in componentDefaults) {
1525
- if (Array.isArray(simplifiedPropsDefinition[key])) {
1526
- const typeArray = simplifiedPropsDefinition[key];
1527
- if (typeArray.length) {
1528
- const typeFunction = typeArray[0];
1529
- if (typeFunction === propValue) {
1530
- acc[key] = componentDefaults[key];
1531
- }
1532
- }
1533
- }
1534
- if (typeof simplifiedPropsDefinition[key] === "function") {
1535
- const typeFunction = simplifiedPropsDefinition[key];
1536
- if (typeFunction() === propValue) {
1537
- acc[key] = componentDefaults[key];
1538
- }
1539
- }
1540
- if (typeof simplifiedPropsDefinition[key] === "object") {
1541
- let defaultValue = simplifiedPropsDefinition[key].default;
1542
- if (typeof defaultValue === "function") {
1543
- defaultValue = defaultValue();
1544
- }
1545
- if (typeof defaultValue === "object") {
1546
- if (JSON.stringify(defaultValue) === JSON.stringify(propValue)) {
1547
- acc[key] = componentDefaults[key];
1548
- }
1549
- } else if (defaultValue === propValue) {
1550
- acc[key] = componentDefaults[key];
1551
- }
1552
- }
1553
- }
1554
- return acc;
1555
- }, {});
1556
- });
993
+ function useInjectedDropdownTrigger() {
994
+ return inject(INJECTION_KEY_DROPDOWN_TRIGGER, {});
1557
995
  }
1558
- function useComponentFocus(inputTemplateRef, emit) {
1559
- const { focused } = useFocus(inputTemplateRef);
1560
- watch(focused, (newValue) => {
1561
- emit(newValue ? "focus" : "blur", unref(inputTemplateRef));
1562
- });
1563
- return {
1564
- focused
1565
- };
1566
- }
1567
- function useComponentIcon(icon, iconPosition) {
1568
- const hasIcon = computed(() => {
1569
- if (typeof (icon == null ? void 0 : icon.value) === "string") {
1570
- return { name: icon == null ? void 0 : icon.value };
1571
- }
1572
- return icon == null ? void 0 : icon.value;
1573
- });
1574
- const hasIconBefore = computed(
1575
- () => (iconPosition == null ? void 0 : iconPosition.value) === Position.before ? hasIcon.value : void 0
1576
- );
1577
- const hasIconAfter = computed(
1578
- () => (iconPosition == null ? void 0 : iconPosition.value) === Position.after ? hasIcon.value : void 0
1579
- );
1580
- const hasIconLeft = computed(
1581
- () => (iconPosition == null ? void 0 : iconPosition.value) === Side.left ? hasIcon.value : void 0
1582
- );
1583
- const hasIconRight = computed(
1584
- () => (iconPosition == null ? void 0 : iconPosition.value) === Side.right ? hasIcon.value : void 0
1585
- );
1586
- const hasIconTop = computed(
1587
- () => (iconPosition == null ? void 0 : iconPosition.value) === Side.top ? hasIcon.value : void 0
1588
- );
1589
- const hasIconBottom = computed(
1590
- () => (iconPosition == null ? void 0 : iconPosition.value) === Side.bottom ? hasIcon.value : void 0
1591
- );
1592
- return {
1593
- hasIcon,
1594
- hasIconLeft,
1595
- hasIconRight,
1596
- hasIconTop,
1597
- hasIconBottom,
1598
- hasIconBefore,
1599
- hasIconAfter
1600
- };
996
+ function useInjectedDropdownItem() {
997
+ return inject(INJECTION_KEY_DROPDOWN_ITEM, {});
1601
998
  }
1602
- function useOptions(props) {
1603
- const { options, labelKey, valueKey, disabledKey } = toRefs(props);
1604
- const getOptionLabel = (option) => {
1605
- if (typeof option === "string") {
1606
- return option;
1607
- }
1608
- if (typeof labelKey.value === "function") {
1609
- return labelKey.value(option);
1610
- }
1611
- return String(
1612
- labelKey.value ? get(option, labelKey.value) : option
1613
- );
1614
- };
1615
- const getOptionValue = (option) => {
1616
- if (typeof option === "string") {
1617
- return option;
1618
- }
1619
- if (typeof valueKey.value === "function") {
1620
- return valueKey.value(option);
1621
- }
1622
- return valueKey.value ? get(option, valueKey.value) : option;
1623
- };
1624
- const isOptionDisabled = (option) => {
1625
- if (typeof option === "string") {
1626
- return false;
1627
- }
1628
- if (typeof disabledKey.value === "function") {
1629
- return disabledKey.value(option);
1630
- }
1631
- return disabledKey.value ? get(option, disabledKey.value) : false;
1632
- };
1633
- const getOptionGrouped = (option) => {
1634
- if (typeof option == "string") {
1635
- return [];
1636
- }
1637
- if (typeof option === "object" && option && "options" in option) {
1638
- return option.options;
1639
- }
1640
- return [];
1641
- };
1642
- return {
1643
- options,
1644
- getOptionLabel,
1645
- getOptionValue,
1646
- isOptionDisabled,
1647
- getOptionGrouped
1648
- };
999
+ function useInjectedDropdownAction() {
1000
+ return inject(INJECTION_KEY_DROPDOWN_ACTION, {});
1649
1001
  }
1650
- const _hoisted_1$2 = ["for"];
1651
- const _hoisted_2$2 = { class: "vv-select__wrapper" };
1652
- const _hoisted_3$1 = {
1653
- key: 0,
1654
- class: "vv-select__input-before"
1655
- };
1656
- const _hoisted_4$1 = { class: "vv-select__inner" };
1657
- const _hoisted_5$1 = ["id"];
1658
- const _hoisted_6$1 = ["disabled", "hidden"];
1659
- const _hoisted_7$1 = ["disabled", "value"];
1660
- const _hoisted_8$1 = ["disabled", "label"];
1661
- const _hoisted_9$1 = ["disabled", "value"];
1662
- const _hoisted_10 = {
1663
- key: 1,
1664
- class: "vv-select__input-after"
1665
- };
1666
- const __default__$4 = {
1667
- name: "VvSelect"
1002
+ const __default__$8 = {
1003
+ name: "VvAction"
1668
1004
  };
1669
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1670
- ...__default__$4,
1671
- props: useVvSelectProps(),
1672
- emits: ["update:modelValue", "focus", "blur"],
1673
- setup(__props, { emit: __emit }) {
1005
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
1006
+ ...__default__$8,
1007
+ props: VvActionProps,
1008
+ emits: VvActionEvents,
1009
+ setup(__props, { expose: __expose, emit: __emit }) {
1674
1010
  const props = __props;
1675
1011
  const emit = __emit;
1676
- const slots = useSlots();
1677
- const VvSelectProps2 = useVvSelectProps();
1678
- const propsDefaults = useDefaults(
1679
- "VvSelect",
1680
- VvSelectProps2,
1681
- props
1682
- );
1683
- const selectEl = ref();
1684
- const {
1685
- HintSlot,
1686
- hasHintLabelOrSlot,
1687
- hasInvalidLabelOrSlot,
1688
- hintSlotScope
1689
- } = HintSlotFactory(propsDefaults, slots);
1690
- const { focused } = useComponentFocus(selectEl, emit);
1691
- function isGroup(option) {
1692
- var _a;
1693
- if (typeof option === "string") {
1694
- return false;
1695
- }
1696
- return (_a = option.options) == null ? void 0 : _a.length;
1697
- }
1012
+ const instance = getCurrentInstance();
1013
+ const volver = useVolver();
1014
+ const element = ref(null);
1015
+ __expose({ $el: element });
1698
1016
  const {
1699
- id,
1700
- modifiers,
1701
- disabled,
1702
- readonly,
1703
- loading,
1704
- icon,
1705
- iconPosition,
1706
- invalid,
1707
- valid,
1708
- floating,
1709
- multiple
1710
- } = toRefs(props);
1711
- const hasId = useUniqueId(id);
1712
- const hasHintId = computed(() => `${hasId.value}-hint`);
1713
- const isDisabledOrReadonly = computed(() => props.disabled || props.readonly);
1714
- const hasTabindex = computed(() => {
1715
- return isDisabledOrReadonly.value ? -1 : props.tabindex;
1716
- });
1717
- const localModelValue = computed({
1718
- get: () => {
1719
- return props.modelValue;
1720
- },
1721
- set: (newValue) => {
1722
- if (Array.isArray(newValue)) {
1723
- newValue = newValue.filter((item) => item !== void 0);
1724
- if (newValue.length === 0 && !props.unselectable) {
1725
- selectEl.value.value = props.modelValue;
1726
- return;
1727
- }
1017
+ reference: dropdownTriggerReference,
1018
+ bus: dropdownEventBus,
1019
+ aria: dropdownAria,
1020
+ expanded: dropdownExpanded
1021
+ } = useInjectedDropdownTrigger();
1022
+ watch(
1023
+ () => element.value,
1024
+ (newValue) => {
1025
+ if (dropdownTriggerReference) {
1026
+ dropdownTriggerReference.value = newValue;
1728
1027
  }
1729
- emit("update:modelValue", newValue);
1730
1028
  }
1029
+ );
1030
+ const pressed = computed(() => {
1031
+ return props.pressed || (dropdownExpanded == null ? void 0 : dropdownExpanded.value);
1731
1032
  });
1732
- const isDirty = computed(() => {
1733
- if (Array.isArray(localModelValue.value)) {
1734
- return localModelValue.value.length > 0;
1033
+ const { role } = useInjectedDropdownAction();
1034
+ const hasTag = computed(() => {
1035
+ switch (true) {
1036
+ case props.disabled:
1037
+ return ActionTag.button;
1038
+ case props.to !== void 0:
1039
+ return (volver == null ? void 0 : volver.nuxt) ? ActionTag.nuxtLink : ActionTag.routerLink;
1040
+ case props.href !== void 0:
1041
+ return ActionTag.a;
1042
+ default:
1043
+ return props.defaultTag;
1735
1044
  }
1736
- return localModelValue.value !== void 0 && localModelValue.value !== null;
1737
1045
  });
1738
- const isVisible = useElementVisibility(selectEl);
1739
- watch(isVisible, (newValue) => {
1740
- if (newValue && props.autofocus) {
1741
- focused.value = true;
1046
+ const hasProps = computed(() => {
1047
+ const toReturn = {
1048
+ ...dropdownAria == null ? void 0 : dropdownAria.value,
1049
+ ariaPressed: pressed.value ? true : void 0,
1050
+ ariaLabel: props.ariaLabel,
1051
+ role: role == null ? void 0 : role.value
1052
+ };
1053
+ switch (hasTag.value) {
1054
+ case ActionTag.a:
1055
+ return {
1056
+ ...toReturn,
1057
+ href: props.href,
1058
+ target: props.target,
1059
+ rel: props.rel
1060
+ };
1061
+ case ActionTag.routerLink:
1062
+ case ActionTag.nuxtLink:
1063
+ return {
1064
+ ...toReturn,
1065
+ to: props.to,
1066
+ target: props.target
1067
+ };
1068
+ case ActionTag.button:
1069
+ return {
1070
+ ...toReturn,
1071
+ type: props.type,
1072
+ disabled: props.disabled
1073
+ };
1074
+ default:
1075
+ return toReturn;
1742
1076
  }
1743
1077
  });
1744
- const { hasIconBefore, hasIconAfter } = useComponentIcon(icon, iconPosition);
1745
- const isInvalid = computed(() => {
1746
- if (props.invalid === true) {
1747
- return true;
1078
+ function onClick(e) {
1079
+ var _a;
1080
+ if (props.disabled) {
1081
+ e.preventDefault();
1082
+ return;
1748
1083
  }
1749
- if (props.valid === true) {
1750
- return false;
1084
+ if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onClick) {
1085
+ emit("click", e);
1086
+ return;
1751
1087
  }
1752
- return void 0;
1753
- });
1754
- const bemCssClasses = useModifiers(
1755
- "vv-select",
1756
- modifiers,
1757
- computed(() => ({
1758
- "valid": valid.value,
1759
- "invalid": invalid.value,
1760
- "loading": loading.value,
1761
- "disabled": disabled.value,
1762
- "readonly": readonly.value,
1763
- "icon-before": hasIconBefore.value !== void 0,
1764
- "icon-after": hasIconAfter.value !== void 0,
1765
- "dirty": isDirty.value,
1766
- "focus": focused.value,
1767
- "floating": floating.value,
1768
- "multiple": multiple.value
1769
- }))
1770
- );
1771
- const {
1772
- getOptionLabel,
1773
- getOptionValue,
1774
- isOptionDisabled,
1775
- getOptionGrouped
1776
- } = useOptions(props);
1777
- watch(
1778
- () => props.options,
1779
- (newValue) => {
1780
- if ((newValue == null ? void 0 : newValue.length) && props.autoselectFirst && !isDirty.value) {
1781
- const firstOptionValue = getOptionValue(newValue[0]);
1782
- localModelValue.value = props.multiple ? [firstOptionValue] : firstOptionValue;
1783
- }
1784
- },
1785
- { immediate: true }
1786
- );
1787
- const hasAttrs = computed(() => {
1788
- return {
1789
- "name": props.name,
1790
- "tabindex": hasTabindex.value,
1791
- "disabled": isDisabledOrReadonly.value,
1792
- "required": props.required,
1793
- "size": props.size,
1794
- "autocomplete": props.autocomplete,
1795
- "multiple": props.multiple,
1796
- "aria-invalid": isInvalid.value,
1797
- "aria-describedby": hasHintLabelOrSlot.value ? hasHintId.value : void 0,
1798
- "aria-errormessage": hasInvalidLabelOrSlot.value ? hasHintId.value : void 0
1799
- };
1800
- });
1801
- const slotProps = computed(() => ({
1802
- valid: props.valid,
1803
- invalid: props.invalid,
1804
- modelValue: props.modelValue
1805
- }));
1806
- return (_ctx, _cache) => {
1807
- return openBlock(), createElementBlock(
1808
- "div",
1809
- {
1810
- class: normalizeClass(unref(bemCssClasses))
1811
- },
1812
- [
1813
- _ctx.label ? (openBlock(), createElementBlock("label", {
1814
- key: 0,
1815
- for: unref(hasId)
1816
- }, toDisplayString(_ctx.label), 9, _hoisted_1$2)) : createCommentVNode("v-if", true),
1817
- createElementVNode("div", _hoisted_2$2, [
1818
- _ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
1819
- renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
1820
- ])) : createCommentVNode("v-if", true),
1821
- createElementVNode("div", _hoisted_4$1, [
1822
- unref(hasIconBefore) ? (openBlock(), createBlock(
1823
- _sfc_main$9,
1824
- mergeProps({ key: 0 }, unref(hasIconBefore), { class: "vv-select__icon" }),
1825
- null,
1826
- 16
1827
- /* FULL_PROPS */
1828
- )) : createCommentVNode("v-if", true),
1829
- withDirectives(createElementVNode("select", mergeProps({
1830
- id: unref(hasId),
1831
- ref_key: "selectEl",
1832
- ref: selectEl
1833
- }, unref(hasAttrs), {
1834
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(localModelValue) ? localModelValue.value = $event : null)
1835
- }), [
1836
- _ctx.placeholder ? (openBlock(), createElementBlock("option", {
1837
- key: 0,
1838
- value: void 0,
1839
- disabled: !_ctx.unselectable,
1840
- hidden: !_ctx.unselectable
1841
- }, toDisplayString(_ctx.placeholder), 9, _hoisted_6$1)) : createCommentVNode("v-if", true),
1842
- (openBlock(true), createElementBlock(
1843
- Fragment,
1844
- null,
1845
- renderList(_ctx.options, (option, index) => {
1846
- return openBlock(), createElementBlock(
1847
- Fragment,
1848
- null,
1849
- [
1850
- !isGroup(option) ? (openBlock(), createElementBlock("option", {
1851
- key: index,
1852
- disabled: unref(isOptionDisabled)(option),
1853
- value: unref(getOptionValue)(option)
1854
- }, toDisplayString(unref(getOptionLabel)(option)), 9, _hoisted_7$1)) : (openBlock(), createElementBlock("optgroup", {
1855
- key: `group-${index}`,
1856
- disabled: unref(isOptionDisabled)(option),
1857
- label: unref(getOptionLabel)(option)
1858
- }, [
1859
- (openBlock(true), createElementBlock(
1860
- Fragment,
1861
- null,
1862
- renderList(unref(getOptionGrouped)(option), (item, i) => {
1863
- return openBlock(), createElementBlock("option", {
1864
- key: `group-${index}-item-${i}`,
1865
- disabled: unref(isOptionDisabled)(item),
1866
- value: unref(getOptionValue)(item)
1867
- }, toDisplayString(unref(getOptionLabel)(item)), 9, _hoisted_9$1);
1868
- }),
1869
- 128
1870
- /* KEYED_FRAGMENT */
1871
- ))
1872
- ], 8, _hoisted_8$1))
1873
- ],
1874
- 64
1875
- /* STABLE_FRAGMENT */
1876
- );
1877
- }),
1878
- 256
1879
- /* UNKEYED_FRAGMENT */
1880
- ))
1881
- ], 16, _hoisted_5$1), [
1882
- [vModelSelect, unref(localModelValue)]
1883
- ]),
1884
- unref(hasIconAfter) ? (openBlock(), createBlock(
1885
- _sfc_main$9,
1886
- mergeProps({ key: 1 }, unref(hasIconAfter), { class: "vv-select__icon vv-select__icon-after" }),
1887
- null,
1888
- 16
1889
- /* FULL_PROPS */
1890
- )) : createCommentVNode("v-if", true)
1891
- ]),
1892
- _ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_10, [
1893
- renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps(unref(slotProps))))
1894
- ])) : createCommentVNode("v-if", true)
1895
- ]),
1896
- createVNode(unref(HintSlot), {
1897
- id: unref(hasHintId),
1898
- class: "vv-select__hint"
1899
- }, createSlots({
1900
- _: 2
1901
- /* DYNAMIC */
1902
- }, [
1903
- _ctx.$slots.hint ? {
1904
- name: "hint",
1905
- fn: withCtx(() => [
1906
- renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1907
- ]),
1908
- key: "0"
1909
- } : void 0,
1910
- _ctx.$slots.loading ? {
1911
- name: "loading",
1912
- fn: withCtx(() => [
1913
- renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1914
- ]),
1915
- key: "1"
1916
- } : void 0,
1917
- _ctx.$slots.valid ? {
1918
- name: "valid",
1919
- fn: withCtx(() => [
1920
- renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1921
- ]),
1922
- key: "2"
1923
- } : void 0,
1924
- _ctx.$slots.invalid ? {
1925
- name: "invalid",
1926
- fn: withCtx(() => [
1927
- renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1928
- ]),
1929
- key: "3"
1930
- } : void 0
1931
- ]), 1032, ["id"])
1932
- ],
1933
- 2
1934
- /* CLASS */
1935
- );
1936
- };
1937
- }
1938
- });
1939
- const VvBadgeProps = {
1940
- ...ModifiersProps,
1941
- value: [String, Number]
1942
- };
1943
- const __default__$3 = {
1944
- name: "VvBadge"
1945
- };
1946
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1947
- ...__default__$3,
1948
- props: VvBadgeProps,
1949
- setup(__props) {
1950
- const props = __props;
1951
- const { modifiers } = toRefs(props);
1952
- const bemCssClasses = useModifiers("vv-badge", modifiers);
1088
+ dropdownEventBus == null ? void 0 : dropdownEventBus.emit("click", e);
1089
+ }
1090
+ function onMouseover(e) {
1091
+ var _a;
1092
+ if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onMouseover) {
1093
+ emit("mouseover", e);
1094
+ return;
1095
+ }
1096
+ dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseover", e);
1097
+ }
1098
+ function onMouseleave(e) {
1099
+ var _a;
1100
+ if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onMouseleave) {
1101
+ emit("mouseleave", e);
1102
+ return;
1103
+ }
1104
+ dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseleave", e);
1105
+ }
1953
1106
  return (_ctx, _cache) => {
1954
- return openBlock(), createElementBlock(
1955
- "span",
1956
- {
1957
- class: normalizeClass(unref(bemCssClasses))
1107
+ return openBlock(), createBlock(resolveDynamicComponent(unref(hasTag)), mergeProps(unref(hasProps), {
1108
+ ref_key: "element",
1109
+ ref: element,
1110
+ class: {
1111
+ active: _ctx.active,
1112
+ pressed: unref(pressed),
1113
+ disabled: _ctx.disabled,
1114
+ current: _ctx.current
1958
1115
  },
1959
- [
1116
+ onClickPassive: onClick,
1117
+ onMouseoverPassive: onMouseover,
1118
+ onMouseleavePassive: onMouseleave
1119
+ }), {
1120
+ default: withCtx(() => [
1960
1121
  renderSlot(_ctx.$slots, "default", {}, () => [
1961
1122
  createTextVNode(
1962
- toDisplayString(_ctx.value),
1123
+ toDisplayString(_ctx.label),
1963
1124
  1
1964
1125
  /* TEXT */
1965
1126
  )
1966
1127
  ])
1967
- ],
1968
- 2
1969
- /* CLASS */
1970
- );
1128
+ ]),
1129
+ _: 3
1130
+ /* FORWARDED */
1131
+ }, 16, ["class"]);
1971
1132
  };
1972
1133
  }
1973
1134
  });
1974
- const VvActionEvents = ["click", "mouseover", "mouseleave"];
1975
- const VvActionProps = ActionProps;
1976
- const __default__$2 = {
1977
- name: "VvAction"
1135
+ const VvIconPropsDefaults = {
1136
+ prefix: "normal"
1137
+ /* normal */
1978
1138
  };
1979
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1980
- ...__default__$2,
1981
- props: VvActionProps,
1982
- emits: VvActionEvents,
1983
- setup(__props, { expose: __expose, emit: __emit }) {
1984
- const props = __props;
1985
- const emit = __emit;
1986
- const instance = getCurrentInstance();
1987
- const volver = useVolver();
1988
- const element = ref(null);
1989
- __expose({ $el: element });
1990
- const {
1991
- reference: dropdownTriggerReference,
1992
- bus: dropdownEventBus,
1993
- aria: dropdownAria,
1994
- expanded: dropdownExpanded
1995
- } = useInjectedDropdownTrigger();
1996
- watch(
1997
- () => element.value,
1998
- (newValue) => {
1999
- if (dropdownTriggerReference) {
2000
- dropdownTriggerReference.value = newValue;
2001
- }
1139
+ const __default__$7 = {
1140
+ name: "VvIcon"
1141
+ };
1142
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1143
+ ...__default__$7,
1144
+ props: /* @__PURE__ */ mergeDefaults({
1145
+ name: {},
1146
+ color: {},
1147
+ width: {},
1148
+ height: {},
1149
+ provider: {},
1150
+ prefix: {},
1151
+ src: {},
1152
+ horizontalFlip: { type: Boolean },
1153
+ verticalFlip: { type: Boolean },
1154
+ flip: {},
1155
+ mode: {},
1156
+ inline: { type: Boolean },
1157
+ rotate: {},
1158
+ onLoad: { type: Function },
1159
+ svg: {},
1160
+ modifiers: {}
1161
+ }, VvIconPropsDefaults),
1162
+ setup(__props) {
1163
+ const props = __props;
1164
+ const hasRotate = computed(() => {
1165
+ if (typeof props.rotate === "string") {
1166
+ return Number.parseFloat(props.rotate);
2002
1167
  }
2003
- );
2004
- const pressed = computed(() => {
2005
- return props.pressed || (dropdownExpanded == null ? void 0 : dropdownExpanded.value);
1168
+ return props.rotate;
2006
1169
  });
2007
- const { role } = useInjectedDropdownAction();
2008
- const hasTag = computed(() => {
2009
- switch (true) {
2010
- case props.disabled:
2011
- return ActionTag.button;
2012
- case props.to !== void 0:
2013
- return (volver == null ? void 0 : volver.nuxt) ? ActionTag.nuxtLink : ActionTag.routerLink;
2014
- case props.href !== void 0:
2015
- return ActionTag.a;
2016
- default:
2017
- return props.defaultTag;
2018
- }
1170
+ const show = ref(true);
1171
+ const volver = useVolver();
1172
+ const { modifiers } = toRefs(props);
1173
+ const bemCssClasses = useModifiers("vv-icon", modifiers);
1174
+ const provider = computed(() => {
1175
+ return props.provider || (volver == null ? void 0 : volver.iconsProvider);
2019
1176
  });
2020
- const hasProps = computed(() => {
2021
- const toReturn = {
2022
- ...dropdownAria == null ? void 0 : dropdownAria.value,
2023
- ariaPressed: pressed.value ? true : void 0,
2024
- ariaLabel: props.ariaLabel,
2025
- role: role == null ? void 0 : role.value
2026
- };
2027
- switch (hasTag.value) {
2028
- case ActionTag.a:
2029
- return {
2030
- ...toReturn,
2031
- href: props.href,
2032
- target: props.target,
2033
- rel: props.rel
2034
- };
2035
- case ActionTag.routerLink:
2036
- case ActionTag.nuxtLink:
2037
- return {
2038
- ...toReturn,
2039
- to: props.to,
2040
- target: props.target
2041
- };
2042
- case ActionTag.button:
2043
- return {
2044
- ...toReturn,
2045
- type: props.type,
2046
- disabled: props.disabled
2047
- };
2048
- default:
2049
- return toReturn;
1177
+ const icon = computed(() => {
1178
+ const name = props.name ?? "";
1179
+ const iconName = `@${provider.value}:${props.prefix}:${name}`;
1180
+ if (iconExists(iconName)) {
1181
+ return iconName;
2050
1182
  }
2051
- });
2052
- function onClick(e) {
2053
- var _a;
2054
- if (props.disabled) {
2055
- e.preventDefault();
2056
- return;
1183
+ const iconsCollection = volver == null ? void 0 : volver.iconsCollections.find(
1184
+ (iconsCollection2) => {
1185
+ const icon2 = `@${provider.value}:${iconsCollection2.prefix}:${name}`;
1186
+ return iconExists(icon2);
1187
+ }
1188
+ );
1189
+ if (iconsCollection) {
1190
+ return `@${provider.value}:${iconsCollection.prefix}:${name}`;
2057
1191
  }
2058
- if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onClick) {
2059
- emit("click", e);
2060
- return;
1192
+ return name;
1193
+ });
1194
+ function getSvgContent(svg) {
1195
+ let dom;
1196
+ if (typeof window === "undefined") {
1197
+ const { JSDOM } = require("jsdom");
1198
+ dom = new JSDOM().window;
2061
1199
  }
2062
- dropdownEventBus == null ? void 0 : dropdownEventBus.emit("click", e);
1200
+ const domParser = dom ? new dom.DOMParser() : new window.DOMParser();
1201
+ const svgDomString = domParser.parseFromString(svg, "text/html");
1202
+ const svgEl = svgDomString.querySelector("svg");
1203
+ return svgEl;
2063
1204
  }
2064
- function onMouseover(e) {
2065
- var _a;
2066
- if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onMouseover) {
2067
- emit("mouseover", e);
2068
- return;
1205
+ function addIconFromSvg(svg) {
1206
+ const svgContentEl = getSvgContent(svg);
1207
+ const svgContent = (svgContentEl == null ? void 0 : svgContentEl.innerHTML.trim()) || "";
1208
+ if (svgContentEl && svgContent) {
1209
+ addIcon(`@${provider.value}:${props.prefix}:${props.name}`, {
1210
+ body: svgContent,
1211
+ // Set height and width from svg content
1212
+ height: svgContentEl.viewBox.baseVal.height,
1213
+ width: svgContentEl.viewBox.baseVal.width
1214
+ });
2069
1215
  }
2070
- dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseover", e);
2071
1216
  }
2072
- function onMouseleave(e) {
2073
- var _a;
2074
- if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onMouseleave) {
2075
- emit("mouseleave", e);
2076
- return;
1217
+ if (volver) {
1218
+ if (props.src && !iconExists(`@${provider.value}:${props.prefix}:${props.name}`)) {
1219
+ show.value = false;
1220
+ volver.fetchIcon(props.src).then((svg) => {
1221
+ if (svg) {
1222
+ addIconFromSvg(svg);
1223
+ show.value = true;
1224
+ }
1225
+ }).catch((e) => {
1226
+ throw new Error(`Error during fetch icon: ${e == null ? void 0 : e.message}`);
1227
+ });
2077
1228
  }
2078
- dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseleave", e);
1229
+ }
1230
+ if (props.svg) {
1231
+ addIconFromSvg(props.svg);
2079
1232
  }
2080
1233
  return (_ctx, _cache) => {
2081
- return openBlock(), createBlock(resolveDynamicComponent(unref(hasTag)), mergeProps(unref(hasProps), {
2082
- ref_key: "element",
2083
- ref: element,
2084
- class: {
2085
- active: _ctx.active,
2086
- pressed: unref(pressed),
2087
- disabled: _ctx.disabled,
2088
- current: _ctx.current
2089
- },
2090
- onClickPassive: onClick,
2091
- onMouseoverPassive: onMouseover,
2092
- onMouseleavePassive: onMouseleave
2093
- }), {
2094
- default: withCtx(() => [
2095
- renderSlot(_ctx.$slots, "default", {}, () => [
2096
- createTextVNode(
2097
- toDisplayString(_ctx.label),
2098
- 1
2099
- /* TEXT */
2100
- )
2101
- ])
2102
- ]),
2103
- _: 3
2104
- /* FORWARDED */
2105
- }, 16, ["class"]);
1234
+ return unref(show) ? (openBlock(), createBlock(unref(Icon), mergeProps({
1235
+ key: 0,
1236
+ class: unref(bemCssClasses)
1237
+ }, {
1238
+ inline: _ctx.inline,
1239
+ width: _ctx.width,
1240
+ height: _ctx.height,
1241
+ horizontalFlip: _ctx.horizontalFlip,
1242
+ verticalFlip: _ctx.verticalFlip,
1243
+ flip: _ctx.flip,
1244
+ rotate: unref(hasRotate),
1245
+ color: _ctx.color,
1246
+ onLoad: _ctx.onLoad,
1247
+ icon: unref(icon)
1248
+ }), null, 16, ["class"])) : createCommentVNode("v-if", true);
2106
1249
  };
2107
1250
  }
2108
1251
  });
2109
- function useInjectedGroupState(groupKey) {
2110
- const group = inject(groupKey, void 0);
2111
- const isInGroup = computed(() => group !== void 0);
2112
- function getGroupOrLocalRef(propName, props, emit) {
2113
- const groupPropValue = group == null ? void 0 : group[propName];
2114
- if (groupPropValue) {
2115
- return computed({
2116
- get() {
2117
- return groupPropValue.value;
2118
- },
2119
- set(value) {
2120
- groupPropValue.value = value;
2121
- }
2122
- });
1252
+ function useUniqueId(id) {
1253
+ return computed(() => String((id == null ? void 0 : id.value) || useId()));
1254
+ }
1255
+ function useComponentIcon(icon, iconPosition) {
1256
+ const hasIcon = computed(() => {
1257
+ if (typeof (icon == null ? void 0 : icon.value) === "string") {
1258
+ return { name: icon == null ? void 0 : icon.value };
2123
1259
  }
2124
- const propRef = toRef(props, propName);
2125
- return computed({
2126
- get() {
2127
- return propRef.value;
2128
- },
2129
- set(value) {
2130
- if (emit) {
2131
- emit(`update:${propName}`, value);
2132
- }
2133
- }
2134
- });
2135
- }
1260
+ return icon == null ? void 0 : icon.value;
1261
+ });
1262
+ const hasIconBefore = computed(
1263
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Position.before ? hasIcon.value : void 0
1264
+ );
1265
+ const hasIconAfter = computed(
1266
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Position.after ? hasIcon.value : void 0
1267
+ );
1268
+ const hasIconLeft = computed(
1269
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Side.left ? hasIcon.value : void 0
1270
+ );
1271
+ const hasIconRight = computed(
1272
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Side.right ? hasIcon.value : void 0
1273
+ );
1274
+ const hasIconTop = computed(
1275
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Side.top ? hasIcon.value : void 0
1276
+ );
1277
+ const hasIconBottom = computed(
1278
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Side.bottom ? hasIcon.value : void 0
1279
+ );
2136
1280
  return {
2137
- group,
2138
- isInGroup,
2139
- getGroupOrLocalRef
1281
+ hasIcon,
1282
+ hasIconLeft,
1283
+ hasIconRight,
1284
+ hasIconTop,
1285
+ hasIconBottom,
1286
+ hasIconBefore,
1287
+ hasIconAfter
2140
1288
  };
2141
1289
  }
2142
- const VvButtonEvents = ["update:modelValue"];
2143
- const VvButtonProps = {
2144
- ...ActionProps,
2145
- ...IdProps,
2146
- ...ModifiersProps,
2147
- ...UnselectableProps,
2148
- ...LoadingProps,
2149
- ...IconProps,
2150
- /**
2151
- * Button icon position
2152
- */
2153
- iconPosition: {
2154
- type: String,
2155
- default: Side.left,
2156
- validator: (value) => Object.values(Side).includes(value)
2157
- },
2158
- /**
2159
- * Loading icon
2160
- */
2161
- loadingIcon: { type: String, default: "eos-icons:bubble-loading" },
2162
- /**
2163
- * Enable button toggle
2164
- */
2165
- toggle: {
2166
- type: Boolean,
2167
- default: false
2168
- },
2169
- /**
2170
- * Button toggle value
2171
- */
2172
- value: {
2173
- type: [String, Number, Boolean],
2174
- default: void 0
2175
- },
2176
- /**
2177
- * Value associated with the unchecked state
2178
- */
2179
- uncheckedValue: {
2180
- type: [String, Number, Boolean],
2181
- default: void 0
2182
- },
2183
- /**
2184
- * Button toggle model value
2185
- */
2186
- modelValue: {
2187
- type: [String, Number, Boolean],
2188
- default: void 0
2189
- }
2190
- };
2191
- function useGroupProps(props, emit) {
2192
- const { group, isInGroup, getGroupOrLocalRef } = useInjectedGroupState(INJECTION_KEY_BUTTON_GROUP);
2193
- const { id, iconPosition, icon, label, pressed } = toRefs(props);
2194
- const modelValue = getGroupOrLocalRef("modelValue", props, emit);
2195
- const toggle = getGroupOrLocalRef("toggle", props);
2196
- const unselectable = getGroupOrLocalRef("unselectable", props);
2197
- const multiple = computed(() => (group == null ? void 0 : group.multiple.value) ?? false);
2198
- const modifiers = computed(() => {
2199
- let localModifiers = props.modifiers;
2200
- let groupModifiers = group == null ? void 0 : group.modifiers.value;
2201
- const toReturn = /* @__PURE__ */ new Set();
2202
- if (localModifiers) {
2203
- if (!Array.isArray(localModifiers)) {
2204
- localModifiers = localModifiers.split(" ");
2205
- }
2206
- localModifiers.forEach((modifier) => toReturn.add(modifier));
2207
- }
2208
- if (groupModifiers) {
2209
- if (!Array.isArray(groupModifiers)) {
2210
- groupModifiers = groupModifiers.split(" ");
2211
- }
2212
- groupModifiers.forEach((modifier) => toReturn.add(modifier));
2213
- }
2214
- return Array.from(toReturn);
2215
- });
2216
- const disabled = computed(
2217
- () => Boolean(props.disabled || (group == null ? void 0 : group.disabled.value))
2218
- );
2219
- return {
2220
- // group props
2221
- group,
2222
- isInGroup,
2223
- modelValue,
2224
- toggle,
2225
- unselectable,
2226
- multiple,
2227
- modifiers,
2228
- disabled,
2229
- // local props
2230
- id,
2231
- pressed,
2232
- iconPosition,
2233
- icon,
2234
- label
2235
- };
2236
- }
2237
- const _hoisted_1$1 = {
1290
+ const _hoisted_1$5 = {
2238
1291
  key: 1,
2239
1292
  class: "vv-button__label"
2240
1293
  };
2241
- const _hoisted_2$1 = {
1294
+ const _hoisted_2$2 = {
2242
1295
  key: 1,
2243
1296
  class: "vv-button__label"
2244
1297
  };
2245
- const __default__$1 = {
1298
+ const __default__$6 = {
2246
1299
  name: "VvButton",
2247
1300
  inheritAttrs: false
2248
1301
  };
2249
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2250
- ...__default__$1,
1302
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
1303
+ ...__default__$6,
2251
1304
  props: VvButtonProps,
2252
1305
  emits: VvButtonEvents,
2253
1306
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -2332,7 +1385,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2332
1385
  }
2333
1386
  }
2334
1387
  return (_ctx, _cache) => {
2335
- return openBlock(), createBlock(_sfc_main$2, mergeProps({
1388
+ return openBlock(), createBlock(_sfc_main$8, mergeProps({
2336
1389
  ...unref(attrs),
2337
1390
  ...unref(hasListeners),
2338
1391
  disabled: unref(disabled),
@@ -2353,14 +1406,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2353
1406
  default: withCtx(() => [
2354
1407
  renderSlot(_ctx.$slots, "default", {}, () => [
2355
1408
  _ctx.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }, () => [
2356
- _ctx.loadingIcon ? (openBlock(), createBlock(_sfc_main$9, {
1409
+ _ctx.loadingIcon ? (openBlock(), createBlock(_sfc_main$7, {
2357
1410
  key: 0,
2358
1411
  class: "vv-button__loading-icon",
2359
1412
  name: _ctx.loadingIcon
2360
1413
  }, null, 8, ["name"])) : createCommentVNode("v-if", true),
2361
1414
  _ctx.loadingLabel ? (openBlock(), createElementBlock(
2362
1415
  "span",
2363
- _hoisted_1$1,
1416
+ _hoisted_1$5,
2364
1417
  toDisplayString(_ctx.loadingLabel),
2365
1418
  1
2366
1419
  /* TEXT */
@@ -2371,13 +1424,13 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2371
1424
  [
2372
1425
  renderSlot(_ctx.$slots, "before"),
2373
1426
  unref(hasIcon) ? (openBlock(), createBlock(
2374
- _sfc_main$9,
1427
+ _sfc_main$7,
2375
1428
  mergeProps({ key: 0 }, unref(hasIcon), { class: "vv-button__icon" }),
2376
1429
  null,
2377
1430
  16
2378
1431
  /* FULL_PROPS */
2379
1432
  )) : createCommentVNode("v-if", true),
2380
- unref(label) ? (openBlock(), createElementBlock("span", _hoisted_2$1, [
1433
+ unref(label) ? (openBlock(), createElementBlock("span", _hoisted_2$2, [
2381
1434
  renderSlot(_ctx.$slots, "label", {}, () => [
2382
1435
  createTextVNode(
2383
1436
  toDisplayString(unref(label)),
@@ -2399,180 +1452,1126 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2399
1452
  };
2400
1453
  }
2401
1454
  });
2402
- const VvComboboxProps = {
2403
- ...IdNameProps,
2404
- ...TabindexProps,
2405
- ...ValidProps,
2406
- ...InvalidProps,
2407
- ...HintProps,
2408
- ...LoadingProps,
2409
- ...DisabledProps,
2410
- ...ReadonlyProps,
2411
- ...ModifiersProps,
2412
- ...OptionsProps,
2413
- ...IconProps,
2414
- ...FloatingLabelProps,
1455
+ const VvDropdownProps = {
1456
+ ...IdProps,
2415
1457
  ...DropdownProps,
2416
- ...LabelProps,
2417
- /**
2418
- * Dropdown show / hide transition name
2419
- */
2420
- transitionName: {
2421
- type: String,
2422
- default: "vv-dropdown--mobile-fade-block"
2423
- },
1458
+ ...ModifiersProps,
2424
1459
  /**
2425
- * modelValue can be a string, number, boolean, object or array of string, number, boolean, object
1460
+ * Show / hide dropdown programmatically
2426
1461
  */
2427
1462
  modelValue: {
2428
- type: [String, Number, Boolean, Object, Array],
1463
+ type: Boolean,
2429
1464
  default: void 0
2430
1465
  },
2431
1466
  /**
2432
- * Label for no search results
2433
- */
2434
- noResultsLabel: { type: String, default: "No results" },
2435
- /**
2436
- * Label for no options available
2437
- */
2438
- noOptionsLabel: { type: String, default: "No options available" },
2439
- /**
2440
- * Label for selected option hint
2441
- */
2442
- selectedHintLabel: { type: String, default: "Selected" },
2443
- /**
2444
- * Label for deselect action button
2445
- */
2446
- deselectActionLabel: { type: String, default: "Deselect" },
2447
- /**
2448
- * Label for select option hint
2449
- */
2450
- selectHintLabel: { type: String, default: "Press enter to select" },
2451
- /**
2452
- * Label for deselected option hint
2453
- */
2454
- deselectHintLabel: { type: String, default: "Press enter to remove" },
2455
- /**
2456
- * Label close button
2457
- */
2458
- closeLabel: { type: String, default: "Close" },
2459
- /**
2460
- * Select input placeholder
2461
- */
2462
- placeholder: String,
2463
- /**
2464
- * Use input text to search on options
2465
- */
2466
- searchable: Boolean,
2467
- /**
2468
- * Search function to filter options
1467
+ * Dropdown trigger element
2469
1468
  */
2470
- searchFunction: {
2471
- type: Function,
2472
- default: void 0
1469
+ reference: {
1470
+ type: Object,
1471
+ default: null
2473
1472
  },
2474
1473
  /**
2475
- * On searchable select is the input search placeholder
1474
+ * Dropdown role
2476
1475
  */
2477
- searchPlaceholder: {
1476
+ role: {
2478
1477
  type: String,
2479
- default: "Search..."
2480
- },
2481
- /**
2482
- * The input search debounce time in ms
2483
- */
2484
- debounceSearch: {
2485
- type: [Number, String],
2486
- default: 0
2487
- },
2488
- /**
2489
- * Manage modelValue as string[] or object[]
2490
- */
2491
- multiple: Boolean,
2492
- /**
2493
- * The min number of selected values
2494
- */
2495
- minValues: {
2496
- type: [Number, String],
2497
- default: 0
2498
- },
2499
- /**
2500
- * The max number of selected values
2501
- */
2502
- maxValues: [Number, String],
2503
- /**
2504
- * If true the input will be unselectable
2505
- * @deprecated use minValues instead
2506
- */
2507
- unselectable: { type: Boolean, default: true },
2508
- /**
2509
- * The select label separator visible to the user
2510
- */
2511
- separator: { type: String, default: ", " },
2512
- /**
2513
- * Show native select
2514
- */
2515
- native: Boolean,
2516
- /**
2517
- * Show badges
2518
- */
2519
- badges: Boolean,
2520
- /**
2521
- * Badge modifiers
2522
- */
2523
- badgeModifiers: {
2524
- type: [String, Array],
2525
- default: "action sm"
2526
- },
2527
- /**
2528
- * Set dropdown width to the same as the trigger
2529
- */
2530
- triggerWidth: {
2531
- ...DropdownProps.triggerWidth,
2532
- default: true
2533
- },
2534
- /**
2535
- * Dropdown modifiers
2536
- */
2537
- dropdownModifiers: {
2538
- type: [String, Array],
2539
- default: "mobile"
2540
- },
2541
- /**
2542
- * Open dropdown on focus
2543
- */
2544
- autoOpen: {
1478
+ default: DropdownRole.menu,
1479
+ validator: (value) => Object.values(DropdownRole).includes(value)
1480
+ }
1481
+ };
1482
+ const VvDropdownItemProps = {
1483
+ focusOnHover: {
2545
1484
  type: Boolean,
2546
1485
  default: false
1486
+ }
1487
+ };
1488
+ const VvDropdownOptionProps = {
1489
+ ...DisabledProps,
1490
+ ...SelectedProps,
1491
+ ...UnselectableProps,
1492
+ ...ModifiersProps,
1493
+ deselectHintLabel: {
1494
+ type: String
2547
1495
  },
2548
- /**
2549
- * Select first option automatically
2550
- */
2551
- autoselectFirst: {
2552
- type: Boolean,
2553
- default: false
1496
+ selectHintLabel: {
1497
+ type: String
2554
1498
  },
2555
- /**
2556
- * Keep open dropdown on single select
2557
- */
2558
- keepOpen: {
1499
+ selectedHintLabel: {
1500
+ type: String
1501
+ },
1502
+ focusOnHover: {
2559
1503
  type: Boolean,
2560
1504
  default: false
2561
1505
  }
2562
1506
  };
2563
- function useVvComboboxProps() {
2564
- return {
2565
- ...VvComboboxProps,
2566
- options: {
2567
- ...VvComboboxProps.options,
2568
- type: Array
1507
+ function useDropdownProvideTrigger({
1508
+ reference,
1509
+ id,
1510
+ expanded,
1511
+ aria
1512
+ }) {
1513
+ const bus = mitt();
1514
+ const component = defineComponent({
1515
+ name: "VvDropdownTriggerProvider",
1516
+ setup() {
1517
+ provide(INJECTION_KEY_DROPDOWN_TRIGGER, {
1518
+ reference,
1519
+ id,
1520
+ expanded,
1521
+ aria,
1522
+ bus
1523
+ });
2569
1524
  },
2570
- searchFunction: {
2571
- ...VvComboboxProps.searchFunction,
2572
- type: Function
1525
+ render() {
1526
+ var _a, _b;
1527
+ return h(Fragment, {}, (_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a));
2573
1528
  }
1529
+ });
1530
+ return {
1531
+ bus,
1532
+ component
2574
1533
  };
2575
1534
  }
1535
+ function useDropdownProvideItem({
1536
+ role,
1537
+ ...others
1538
+ }) {
1539
+ const itemRole = computed(
1540
+ () => role.value === DropdownRole.listbox ? DropdownItemRole.option : DropdownItemRole.presentation
1541
+ );
1542
+ provide(INJECTION_KEY_DROPDOWN_ITEM, {
1543
+ role: itemRole,
1544
+ ...others
1545
+ });
1546
+ return { itemRole };
1547
+ }
1548
+ function useDropdownProvideAction({
1549
+ expanded
1550
+ }) {
1551
+ provide(INJECTION_KEY_DROPDOWN_ACTION, {
1552
+ role: ref(ActionRoles.menuitem),
1553
+ expanded
1554
+ });
1555
+ }
1556
+ const _hoisted_1$4 = ["id", "tabindex", "role", "aria-labelledby"];
1557
+ const __default__$5 = {
1558
+ name: "VvDropdown",
1559
+ inheritAttrs: false
1560
+ };
1561
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
1562
+ ...__default__$5,
1563
+ props: VvDropdownProps,
1564
+ emits: [
1565
+ "update:modelValue",
1566
+ "beforeEnter",
1567
+ "afterLeave",
1568
+ "beforeExpand",
1569
+ "beforeCollapse",
1570
+ "afterExpand",
1571
+ "afterCollapse",
1572
+ "before-enter",
1573
+ "after-leave",
1574
+ "enter",
1575
+ "afterEnter",
1576
+ "enterCancelled",
1577
+ "beforeLeave",
1578
+ "leave",
1579
+ "leaveCancelled"
1580
+ ],
1581
+ setup(__props, { expose: __expose, emit: __emit }) {
1582
+ const props = __props;
1583
+ const emit = __emit;
1584
+ const { id } = toRefs(props);
1585
+ const hasId = useUniqueId(id);
1586
+ const attrs = useAttrs();
1587
+ const maxWidth = ref("auto");
1588
+ const maxHeight = ref("auto");
1589
+ const localReferenceEl = ref();
1590
+ const floatingEl = ref();
1591
+ const arrowEl = useTemplateRef("arrowEl");
1592
+ const listEl = useTemplateRef("listEl");
1593
+ const referenceEl = computed({
1594
+ get: () => props.reference ?? localReferenceEl.value,
1595
+ set: (newValue) => {
1596
+ localReferenceEl.value = newValue;
1597
+ }
1598
+ });
1599
+ const hasCustomPosition = ref(false);
1600
+ onMounted(() => {
1601
+ useMutationObserver(
1602
+ floatingEl.value,
1603
+ () => {
1604
+ var _a;
1605
+ hasCustomPosition.value = ((_a = window.getComputedStyle(floatingEl.value).getPropertyValue("--dropdown-custom-position")) == null ? void 0 : _a.trim()) === "true";
1606
+ },
1607
+ {
1608
+ attributeFilter: ["style"],
1609
+ window
1610
+ }
1611
+ );
1612
+ });
1613
+ const middleware = computed(() => {
1614
+ const toReturn = [];
1615
+ if (props.autoPlacement) {
1616
+ if (typeof props.autoPlacement === "boolean") {
1617
+ toReturn.push(autoPlacement());
1618
+ } else {
1619
+ toReturn.push(
1620
+ autoPlacement(props.autoPlacement)
1621
+ );
1622
+ }
1623
+ } else if (props.flip) {
1624
+ if (typeof props.flip === "boolean") {
1625
+ toReturn.push(flip({ fallbackStrategy: "initialPlacement" }));
1626
+ } else {
1627
+ toReturn.push(flip(props.flip));
1628
+ }
1629
+ }
1630
+ if (props.shift) {
1631
+ if (typeof props.shift === "boolean") {
1632
+ toReturn.push(shift());
1633
+ } else {
1634
+ toReturn.push(shift(props.shift));
1635
+ }
1636
+ }
1637
+ if (props.size) {
1638
+ const apply = ({
1639
+ availableWidth,
1640
+ availableHeight
1641
+ }) => {
1642
+ maxWidth.value = `${availableWidth}px`;
1643
+ maxHeight.value = `${availableHeight}px`;
1644
+ };
1645
+ if (typeof props.size === "boolean") {
1646
+ toReturn.push(
1647
+ size({
1648
+ apply
1649
+ })
1650
+ );
1651
+ } else {
1652
+ toReturn.push(
1653
+ size({
1654
+ ...props.size,
1655
+ apply
1656
+ })
1657
+ );
1658
+ }
1659
+ }
1660
+ if (props.offset) {
1661
+ toReturn.push(offset(Number(props.offset)));
1662
+ if (["string", "number"].includes(typeof props.offset)) {
1663
+ toReturn.push(offset(Number(props.offset)));
1664
+ } else {
1665
+ toReturn.push(offset(props.offset));
1666
+ }
1667
+ }
1668
+ if (props.arrow) {
1669
+ toReturn.push(
1670
+ arrow({
1671
+ element: arrowEl
1672
+ })
1673
+ );
1674
+ }
1675
+ return toReturn;
1676
+ });
1677
+ const { x, y, middlewareData, placement, strategy } = useFloating(
1678
+ referenceEl,
1679
+ floatingEl,
1680
+ {
1681
+ whileElementsMounted: (...args) => {
1682
+ return autoUpdate(...args, {
1683
+ animationFrame: props.strategy === Strategy.fixed
1684
+ });
1685
+ },
1686
+ placement: computed(() => props.placement),
1687
+ strategy: computed(() => props.strategy),
1688
+ middleware
1689
+ }
1690
+ );
1691
+ const dropdownPlacement = computed(() => {
1692
+ var _a;
1693
+ if (hasCustomPosition.value) {
1694
+ return void 0;
1695
+ }
1696
+ const width = props.triggerWidth && referenceEl.value ? `${(_a = referenceEl.value) == null ? void 0 : _a.offsetWidth}px` : void 0;
1697
+ return {
1698
+ position: strategy.value,
1699
+ top: `${y.value ?? 0}px`,
1700
+ left: `${x.value ?? 0}px`,
1701
+ maxWidth: width ? void 0 : maxWidth.value,
1702
+ maxHeight: maxHeight.value,
1703
+ width
1704
+ };
1705
+ });
1706
+ const side = computed(
1707
+ () => placement.value.split("-")[0]
1708
+ );
1709
+ const arrowPlacement = computed(() => {
1710
+ var _a, _b, _c, _d, _e;
1711
+ if (hasCustomPosition.value) {
1712
+ return void 0;
1713
+ }
1714
+ const staticSide = {
1715
+ [Side.top]: Side.bottom,
1716
+ [Side.right]: Side.left,
1717
+ [Side.bottom]: Side.top,
1718
+ [Side.left]: Side.right
1719
+ }[side.value];
1720
+ return {
1721
+ left: ((_a = middlewareData.value.arrow) == null ? void 0 : _a.x) !== void 0 ? `${(_b = middlewareData.value.arrow) == null ? void 0 : _b.x}px` : void 0,
1722
+ top: ((_c = middlewareData.value.arrow) == null ? void 0 : _c.y) !== void 0 ? `${(_d = middlewareData.value.arrow) == null ? void 0 : _d.y}px` : void 0,
1723
+ [staticSide]: `${-(((_e = arrowEl.value) == null ? void 0 : _e.offsetWidth) ?? 0) / 2}px`
1724
+ };
1725
+ });
1726
+ const modelValue = useVModel(props, "modelValue", emit);
1727
+ const localModelValue = ref(false);
1728
+ const expanded = computed({
1729
+ get: () => modelValue.value ?? localModelValue.value,
1730
+ set: (newValue) => {
1731
+ if (modelValue.value === void 0) {
1732
+ localModelValue.value = newValue;
1733
+ return;
1734
+ }
1735
+ modelValue.value = newValue;
1736
+ }
1737
+ });
1738
+ function show() {
1739
+ expanded.value = true;
1740
+ }
1741
+ function hide() {
1742
+ expanded.value = false;
1743
+ }
1744
+ function toggle() {
1745
+ expanded.value = !expanded.value;
1746
+ }
1747
+ function init(el) {
1748
+ referenceEl.value = el;
1749
+ }
1750
+ __expose({
1751
+ toggle,
1752
+ show,
1753
+ hide,
1754
+ init,
1755
+ customPosition: hasCustomPosition
1756
+ });
1757
+ watch(expanded, (newValue) => {
1758
+ if (newValue && props.autofocusFirst) {
1759
+ nextTick(() => {
1760
+ const focusableElements = getKeyboardFocusableElements(
1761
+ floatingEl.value
1762
+ );
1763
+ if (focusableElements.length > 0) {
1764
+ focusableElements[0].focus({
1765
+ preventScroll: true
1766
+ });
1767
+ }
1768
+ });
1769
+ }
1770
+ });
1771
+ onClickOutside(
1772
+ floatingEl,
1773
+ () => {
1774
+ if (!props.keepOpen && expanded.value) {
1775
+ expanded.value = false;
1776
+ }
1777
+ },
1778
+ { ignore: [referenceEl] }
1779
+ );
1780
+ const hasAriaLabelledby = computed(() => {
1781
+ var _a, _b;
1782
+ return ((_b = (_a = referenceEl.value) == null ? void 0 : _a.getAttribute) == null ? void 0 : _b.call(_a, "id")) ?? void 0;
1783
+ });
1784
+ const referenceAria = computed(() => ({
1785
+ "aria-controls": hasId.value,
1786
+ "aria-haspopup": true,
1787
+ "aria-expanded": expanded.value
1788
+ }));
1789
+ const { component: VvDropdownTriggerProvider, bus } = useDropdownProvideTrigger({
1790
+ reference: referenceEl,
1791
+ id: hasId,
1792
+ expanded,
1793
+ aria: referenceAria
1794
+ });
1795
+ bus.on("click", toggle);
1796
+ const { role, modifiers } = toRefs(props);
1797
+ const bemCssClasses = useModifiers(
1798
+ "vv-dropdown",
1799
+ modifiers,
1800
+ computed(() => ({
1801
+ arrow: props.arrow
1802
+ }))
1803
+ );
1804
+ const { focused } = useFocusWithin(floatingEl);
1805
+ function getKeyboardFocusableElements(element) {
1806
+ if (!element) {
1807
+ return [];
1808
+ }
1809
+ return [
1810
+ ...element.querySelectorAll(
1811
+ 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
1812
+ )
1813
+ ].filter(
1814
+ (el) => !el.hasAttribute("disabled") && !el.getAttribute("aria-hidden")
1815
+ );
1816
+ }
1817
+ function focusNext() {
1818
+ nextTick(() => {
1819
+ if (focused.value) {
1820
+ const focusableElements = getKeyboardFocusableElements(
1821
+ floatingEl.value
1822
+ );
1823
+ if (focusableElements.length === 0 || !document.activeElement) {
1824
+ return;
1825
+ }
1826
+ const activeElementIndex = focusableElements.indexOf(
1827
+ document.activeElement
1828
+ );
1829
+ if (activeElementIndex < focusableElements.length - 1) {
1830
+ focusableElements[activeElementIndex + 1].focus({
1831
+ preventScroll: true
1832
+ });
1833
+ } else {
1834
+ focusableElements[0].focus({
1835
+ preventScroll: true
1836
+ });
1837
+ }
1838
+ }
1839
+ });
1840
+ }
1841
+ function focusPrev() {
1842
+ nextTick(() => {
1843
+ if (focused.value) {
1844
+ const focusableElements = getKeyboardFocusableElements(
1845
+ floatingEl.value
1846
+ );
1847
+ if (focusableElements.length === 0 || !document.activeElement) {
1848
+ return;
1849
+ }
1850
+ const activeElementIndex = focusableElements.indexOf(
1851
+ document.activeElement
1852
+ );
1853
+ if (activeElementIndex > 0) {
1854
+ focusableElements[activeElementIndex - 1].focus({
1855
+ preventScroll: true
1856
+ });
1857
+ } else {
1858
+ focusableElements[focusableElements.length - 1].focus({
1859
+ preventScroll: true
1860
+ });
1861
+ }
1862
+ }
1863
+ });
1864
+ }
1865
+ const hovered = useElementHover(floatingEl);
1866
+ const { itemRole } = useDropdownProvideItem({
1867
+ role,
1868
+ expanded,
1869
+ focused,
1870
+ hovered
1871
+ });
1872
+ onKeyStroke("Escape", (e) => {
1873
+ if (expanded.value) {
1874
+ e.preventDefault();
1875
+ hide();
1876
+ }
1877
+ });
1878
+ onKeyStroke("ArrowDown", (e) => {
1879
+ if (expanded.value && focused.value) {
1880
+ e.preventDefault();
1881
+ focusNext();
1882
+ }
1883
+ });
1884
+ onKeyStroke("ArrowUp", (e) => {
1885
+ if (expanded.value && focused.value) {
1886
+ e.preventDefault();
1887
+ focusPrev();
1888
+ }
1889
+ });
1890
+ onKeyStroke([" ", "Enter"], (e) => {
1891
+ const htmlEl = e.target;
1892
+ if (expanded.value && focused.value && htmlEl) {
1893
+ htmlEl == null ? void 0 : htmlEl.click();
1894
+ }
1895
+ });
1896
+ const dropdownTransitionHandlers = {
1897
+ "before-enter": () => {
1898
+ emit(expanded.value ? "beforeExpand" : "beforeCollapse");
1899
+ emit("beforeEnter");
1900
+ },
1901
+ "after-leave": () => {
1902
+ emit(expanded.value ? "afterExpand" : "afterCollapse");
1903
+ emit("afterLeave");
1904
+ },
1905
+ "enter": () => {
1906
+ emit("enter");
1907
+ },
1908
+ "after-enter": () => {
1909
+ emit("afterEnter");
1910
+ },
1911
+ "enter-cancelled": () => {
1912
+ emit("enterCancelled");
1913
+ },
1914
+ "before-leave": () => {
1915
+ emit("beforeLeave");
1916
+ },
1917
+ "leave": () => {
1918
+ emit("leave");
1919
+ },
1920
+ "leave-cancelled": () => {
1921
+ emit("leaveCancelled");
1922
+ }
1923
+ };
1924
+ return (_ctx, _cache) => {
1925
+ return openBlock(), createElementBlock(
1926
+ Fragment,
1927
+ null,
1928
+ [
1929
+ createVNode(unref(VvDropdownTriggerProvider), null, {
1930
+ default: withCtx(() => [
1931
+ renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({ init, show, hide, toggle, expanded: unref(expanded), aria: unref(referenceAria) })))
1932
+ ]),
1933
+ _: 3
1934
+ /* FORWARDED */
1935
+ }),
1936
+ createVNode(Transition, mergeProps({ name: _ctx.transitionName }, toHandlers(dropdownTransitionHandlers), { persisted: "" }), {
1937
+ default: withCtx(() => [
1938
+ withDirectives(createElementVNode(
1939
+ "div",
1940
+ {
1941
+ ref_key: "floatingEl",
1942
+ ref: floatingEl,
1943
+ style: normalizeStyle(unref(dropdownPlacement)),
1944
+ class: normalizeClass(unref(bemCssClasses))
1945
+ },
1946
+ [
1947
+ props.arrow ? (openBlock(), createElementBlock(
1948
+ "div",
1949
+ {
1950
+ key: 0,
1951
+ ref_key: "arrowEl",
1952
+ ref: arrowEl,
1953
+ style: normalizeStyle(unref(arrowPlacement)),
1954
+ class: "vv-dropdown__arrow"
1955
+ },
1956
+ null,
1957
+ 4
1958
+ /* STYLE */
1959
+ )) : createCommentVNode("v-if", true),
1960
+ renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps({ expanded: unref(expanded) }))),
1961
+ createElementVNode("div", mergeProps(unref(attrs), {
1962
+ id: unref(hasId),
1963
+ ref_key: "listEl",
1964
+ ref: listEl,
1965
+ tabindex: !unref(expanded) ? -1 : void 0,
1966
+ role: unref(role),
1967
+ "aria-labelledby": unref(hasAriaLabelledby),
1968
+ class: "vv-dropdown__list"
1969
+ }), [
1970
+ renderSlot(_ctx.$slots, "items", normalizeProps(guardReactiveProps({
1971
+ role: unref(itemRole)
1972
+ })))
1973
+ ], 16, _hoisted_1$4),
1974
+ renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps({ expanded: unref(expanded) })))
1975
+ ],
1976
+ 6
1977
+ /* CLASS, STYLE */
1978
+ ), [
1979
+ [vShow, unref(expanded)]
1980
+ ])
1981
+ ]),
1982
+ _: 3
1983
+ /* FORWARDED */
1984
+ }, 16, ["name"])
1985
+ ],
1986
+ 64
1987
+ /* STABLE_FRAGMENT */
1988
+ );
1989
+ };
1990
+ }
1991
+ });
1992
+ const _hoisted_1$3 = {
1993
+ class: "vv-dropdown-optgroup",
1994
+ role: "presentation",
1995
+ tabindex: "-1"
1996
+ };
1997
+ const __default__$4 = {
1998
+ name: "VvDropdownOptgroup"
1999
+ };
2000
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
2001
+ ...__default__$4,
2002
+ props: {
2003
+ ...LabelProps
2004
+ },
2005
+ setup(__props) {
2006
+ const props = __props;
2007
+ return (_ctx, _cache) => {
2008
+ return openBlock(), createElementBlock(
2009
+ "li",
2010
+ _hoisted_1$3,
2011
+ toDisplayString(props.label),
2012
+ 1
2013
+ /* TEXT */
2014
+ );
2015
+ };
2016
+ }
2017
+ });
2018
+ const __default__$3 = {
2019
+ name: "VvDropdownItem"
2020
+ };
2021
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2022
+ ...__default__$3,
2023
+ props: VvDropdownItemProps,
2024
+ setup(__props) {
2025
+ const props = __props;
2026
+ const { role, expanded } = useInjectedDropdownItem();
2027
+ const element = ref(null);
2028
+ useDropdownProvideAction({ expanded });
2029
+ const hovered = useElementHover(element);
2030
+ const { focused } = useFocus(element);
2031
+ const { focused: focusedWithin } = useFocusWithin(element);
2032
+ watch(hovered, (newValue) => {
2033
+ if (newValue && props.focusOnHover) {
2034
+ focused.value = true;
2035
+ }
2036
+ });
2037
+ return (_ctx, _cache) => {
2038
+ return openBlock(), createElementBlock(
2039
+ "div",
2040
+ mergeProps({ role: unref(role) }, {
2041
+ ref_key: "element",
2042
+ ref: element,
2043
+ class: ["vv-dropdown__item", { "focus-visible": unref(focused) || unref(focusedWithin) }]
2044
+ }),
2045
+ [
2046
+ renderSlot(_ctx.$slots, "default")
2047
+ ],
2048
+ 16
2049
+ /* FULL_PROPS */
2050
+ );
2051
+ };
2052
+ }
2053
+ });
2054
+ const _hoisted_1$2 = ["title"];
2055
+ const __default__$2 = {
2056
+ name: "VvDropdownOption"
2057
+ };
2058
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2059
+ ...__default__$2,
2060
+ props: VvDropdownOptionProps,
2061
+ setup(__props) {
2062
+ const props = __props;
2063
+ const { modifiers } = toRefs(props);
2064
+ const bemCssClasses = useModifiers(
2065
+ "vv-dropdown-option",
2066
+ modifiers,
2067
+ computed(() => ({
2068
+ disabled: props.disabled,
2069
+ selected: props.selected,
2070
+ unselectable: props.unselectable && props.selected
2071
+ }))
2072
+ );
2073
+ const hintLabel = computed(() => {
2074
+ if (props.selected) {
2075
+ return props.unselectable ? props.deselectHintLabel : props.selectedHintLabel;
2076
+ }
2077
+ if (!props.disabled) {
2078
+ return props.selectHintLabel;
2079
+ }
2080
+ return "";
2081
+ });
2082
+ return (_ctx, _cache) => {
2083
+ return openBlock(), createBlock(_sfc_main$3, {
2084
+ class: normalizeClass(unref(bemCssClasses)),
2085
+ tabindex: _ctx.disabled ? -1 : 0,
2086
+ "aria-selected": _ctx.selected,
2087
+ "aria-disabled": _ctx.disabled,
2088
+ "focus-on-hover": _ctx.focusOnHover
2089
+ }, {
2090
+ default: withCtx(() => [
2091
+ renderSlot(_ctx.$slots, "default"),
2092
+ createElementVNode("span", {
2093
+ class: "vv-dropdown-option__hint",
2094
+ title: unref(hintLabel)
2095
+ }, [
2096
+ renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps({ disabled: _ctx.disabled, selected: _ctx.selected, unselectable: _ctx.unselectable })), () => [
2097
+ createTextVNode(
2098
+ toDisplayString(unref(hintLabel)),
2099
+ 1
2100
+ /* TEXT */
2101
+ )
2102
+ ])
2103
+ ], 8, _hoisted_1$2)
2104
+ ]),
2105
+ _: 3
2106
+ /* FORWARDED */
2107
+ }, 8, ["class", "tabindex", "aria-selected", "aria-disabled", "focus-on-hover"]);
2108
+ };
2109
+ }
2110
+ });
2111
+ const VvSelectProps = {
2112
+ ...IdNameProps,
2113
+ ...AutofocusProps,
2114
+ ...AutocompleteProps,
2115
+ ...TabindexProps,
2116
+ ...ValidProps,
2117
+ ...InvalidProps,
2118
+ ...HintProps,
2119
+ ...LoadingProps,
2120
+ ...DisabledProps,
2121
+ ...ReadonlyProps,
2122
+ ...ModifiersProps,
2123
+ ...OptionsProps,
2124
+ ...IconProps,
2125
+ ...FloatingLabelProps,
2126
+ ...UnselectableProps,
2127
+ ...LabelProps,
2128
+ /**
2129
+ * This Boolean attribute indicates that multiple options can be selected in the list.
2130
+ * If it is not specified, then only one option can be selected at a time.
2131
+ * When multiple is specified, most browsers will show a scrolling list box instead of a single line dropdown.
2132
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select#attr-multiple
2133
+ */
2134
+ multiple: Boolean,
2135
+ /**
2136
+ * A Boolean attribute indicating that an option with a non-empty string value must be selected.
2137
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select#attr-required
2138
+ */
2139
+ required: Boolean,
2140
+ /**
2141
+ * If the control is presented as a scrolling list box (e.g. when multiple is specified),
2142
+ * this attribute represents the number of rows in the list that should be visible at one time.
2143
+ * Browsers are not required to present a select element as a scrolled list box. The default value is 0.
2144
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select#attr-size
2145
+ */
2146
+ size: [String, Number],
2147
+ /**
2148
+ * modelValue can be a string, number, boolean, object or array of string, number, boolean, object
2149
+ */
2150
+ modelValue: {
2151
+ type: [String, Number, Boolean, Object, Array],
2152
+ default: void 0
2153
+ },
2154
+ /**
2155
+ * Select first option automatically
2156
+ */
2157
+ autoselectFirst: {
2158
+ type: Boolean,
2159
+ default: false
2160
+ },
2161
+ /**
2162
+ * Select placeholder
2163
+ */
2164
+ placeholder: String
2165
+ };
2166
+ function useVvSelectProps() {
2167
+ return {
2168
+ ...VvSelectProps,
2169
+ options: {
2170
+ ...VvSelectProps.options,
2171
+ type: Array,
2172
+ default: () => []
2173
+ }
2174
+ };
2175
+ }
2176
+ function useDefaults(componentName, propsDefinition, props) {
2177
+ const volver = useVolver();
2178
+ const volverComponentDefaults = computed(() => {
2179
+ var _a;
2180
+ if (!volver || !((_a = volver.defaults.value) == null ? void 0 : _a[componentName])) {
2181
+ return void 0;
2182
+ }
2183
+ return volver.defaults.value[componentName];
2184
+ });
2185
+ return computed(() => {
2186
+ if (volverComponentDefaults.value === void 0) {
2187
+ return props;
2188
+ }
2189
+ const componentDefaults = volverComponentDefaults.value;
2190
+ const simplifiedPropsDefinition = propsDefinition;
2191
+ const simplifiedProps = props;
2192
+ return Object.keys(simplifiedPropsDefinition).reduce((acc, key) => {
2193
+ const propValue = simplifiedProps[key];
2194
+ acc[key] = propValue;
2195
+ if (key in componentDefaults) {
2196
+ if (Array.isArray(simplifiedPropsDefinition[key])) {
2197
+ const typeArray = simplifiedPropsDefinition[key];
2198
+ if (typeArray.length) {
2199
+ const typeFunction = typeArray[0];
2200
+ if (typeFunction === propValue) {
2201
+ acc[key] = componentDefaults[key];
2202
+ }
2203
+ }
2204
+ }
2205
+ if (typeof simplifiedPropsDefinition[key] === "function") {
2206
+ const typeFunction = simplifiedPropsDefinition[key];
2207
+ if (typeFunction() === propValue) {
2208
+ acc[key] = componentDefaults[key];
2209
+ }
2210
+ }
2211
+ if (typeof simplifiedPropsDefinition[key] === "object") {
2212
+ let defaultValue = simplifiedPropsDefinition[key].default;
2213
+ if (typeof defaultValue === "function") {
2214
+ defaultValue = defaultValue();
2215
+ }
2216
+ if (typeof defaultValue === "object") {
2217
+ if (JSON.stringify(defaultValue) === JSON.stringify(propValue)) {
2218
+ acc[key] = componentDefaults[key];
2219
+ }
2220
+ } else if (defaultValue === propValue) {
2221
+ acc[key] = componentDefaults[key];
2222
+ }
2223
+ }
2224
+ }
2225
+ return acc;
2226
+ }, {});
2227
+ });
2228
+ }
2229
+ function useComponentFocus(inputTemplateRef, emit) {
2230
+ const { focused } = useFocus(inputTemplateRef);
2231
+ watch(focused, (newValue) => {
2232
+ emit(newValue ? "focus" : "blur", unref(inputTemplateRef));
2233
+ });
2234
+ return {
2235
+ focused
2236
+ };
2237
+ }
2238
+ function useOptions(props) {
2239
+ const { options, labelKey, valueKey, disabledKey } = toRefs(props);
2240
+ const getOptionLabel = (option) => {
2241
+ if (typeof option === "string") {
2242
+ return option;
2243
+ }
2244
+ if (typeof labelKey.value === "function") {
2245
+ return labelKey.value(option);
2246
+ }
2247
+ return String(
2248
+ labelKey.value ? get(option, labelKey.value) : option
2249
+ );
2250
+ };
2251
+ const getOptionValue = (option) => {
2252
+ if (typeof option === "string") {
2253
+ return option;
2254
+ }
2255
+ if (typeof valueKey.value === "function") {
2256
+ return valueKey.value(option);
2257
+ }
2258
+ return valueKey.value ? get(option, valueKey.value) : option;
2259
+ };
2260
+ const isOptionDisabled = (option) => {
2261
+ if (typeof option === "string") {
2262
+ return false;
2263
+ }
2264
+ if (typeof disabledKey.value === "function") {
2265
+ return disabledKey.value(option);
2266
+ }
2267
+ return disabledKey.value ? get(option, disabledKey.value) : false;
2268
+ };
2269
+ const getOptionGrouped = (option) => {
2270
+ if (typeof option == "string") {
2271
+ return [];
2272
+ }
2273
+ if (typeof option === "object" && option && "options" in option) {
2274
+ return option.options;
2275
+ }
2276
+ return [];
2277
+ };
2278
+ return {
2279
+ options,
2280
+ getOptionLabel,
2281
+ getOptionValue,
2282
+ isOptionDisabled,
2283
+ getOptionGrouped
2284
+ };
2285
+ }
2286
+ const _hoisted_1$1 = ["for"];
2287
+ const _hoisted_2$1 = { class: "vv-select__wrapper" };
2288
+ const _hoisted_3$1 = {
2289
+ key: 0,
2290
+ class: "vv-select__input-before"
2291
+ };
2292
+ const _hoisted_4$1 = { class: "vv-select__inner" };
2293
+ const _hoisted_5$1 = ["id"];
2294
+ const _hoisted_6$1 = ["disabled", "hidden"];
2295
+ const _hoisted_7$1 = ["disabled", "value"];
2296
+ const _hoisted_8$1 = ["disabled", "label"];
2297
+ const _hoisted_9$1 = ["disabled", "value"];
2298
+ const _hoisted_10 = {
2299
+ key: 1,
2300
+ class: "vv-select__input-after"
2301
+ };
2302
+ const __default__$1 = {
2303
+ name: "VvSelect"
2304
+ };
2305
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2306
+ ...__default__$1,
2307
+ props: useVvSelectProps(),
2308
+ emits: ["update:modelValue", "focus", "blur"],
2309
+ setup(__props, { emit: __emit }) {
2310
+ const props = __props;
2311
+ const emit = __emit;
2312
+ const slots = useSlots();
2313
+ const VvSelectProps2 = useVvSelectProps();
2314
+ const propsDefaults = useDefaults(
2315
+ "VvSelect",
2316
+ VvSelectProps2,
2317
+ props
2318
+ );
2319
+ const selectEl = useTemplateRef("selectEl");
2320
+ const {
2321
+ HintSlot,
2322
+ hasHintLabelOrSlot,
2323
+ hasInvalidLabelOrSlot,
2324
+ hintSlotScope
2325
+ } = HintSlotFactory(propsDefaults, slots);
2326
+ const { focused } = useComponentFocus(selectEl, emit);
2327
+ function isGroup(option) {
2328
+ var _a;
2329
+ if (typeof option === "string") {
2330
+ return false;
2331
+ }
2332
+ return (_a = option.options) == null ? void 0 : _a.length;
2333
+ }
2334
+ const {
2335
+ id,
2336
+ modifiers,
2337
+ disabled,
2338
+ readonly,
2339
+ loading,
2340
+ icon,
2341
+ iconPosition,
2342
+ invalid,
2343
+ valid,
2344
+ floating,
2345
+ multiple
2346
+ } = toRefs(props);
2347
+ const hasId = useUniqueId(id);
2348
+ const hasHintId = computed(() => `${hasId.value}-hint`);
2349
+ const isDisabledOrReadonly = computed(() => props.disabled || props.readonly);
2350
+ const hasTabindex = computed(() => {
2351
+ return isDisabledOrReadonly.value ? -1 : props.tabindex;
2352
+ });
2353
+ const localModelValue = computed({
2354
+ get: () => {
2355
+ return props.modelValue;
2356
+ },
2357
+ set: (newValue) => {
2358
+ if (Array.isArray(newValue)) {
2359
+ newValue = newValue.filter((item) => item !== void 0);
2360
+ if (newValue.length === 0 && !props.unselectable && selectEl.value) {
2361
+ selectEl.value.value = String(props.modelValue);
2362
+ return;
2363
+ }
2364
+ }
2365
+ emit("update:modelValue", newValue);
2366
+ }
2367
+ });
2368
+ const isDirty = computed(() => {
2369
+ if (Array.isArray(localModelValue.value)) {
2370
+ return localModelValue.value.length > 0;
2371
+ }
2372
+ return localModelValue.value !== void 0 && localModelValue.value !== null;
2373
+ });
2374
+ const isVisible = useElementVisibility(selectEl);
2375
+ watch(isVisible, (newValue) => {
2376
+ if (newValue && props.autofocus) {
2377
+ focused.value = true;
2378
+ }
2379
+ });
2380
+ const { hasIconBefore, hasIconAfter } = useComponentIcon(icon, iconPosition);
2381
+ const isInvalid = computed(() => {
2382
+ if (props.invalid === true) {
2383
+ return true;
2384
+ }
2385
+ if (props.valid === true) {
2386
+ return false;
2387
+ }
2388
+ return void 0;
2389
+ });
2390
+ const bemCssClasses = useModifiers(
2391
+ "vv-select",
2392
+ modifiers,
2393
+ computed(() => ({
2394
+ "valid": valid.value,
2395
+ "invalid": invalid.value,
2396
+ "loading": loading.value,
2397
+ "disabled": disabled.value,
2398
+ "readonly": readonly.value,
2399
+ "icon-before": hasIconBefore.value !== void 0,
2400
+ "icon-after": hasIconAfter.value !== void 0,
2401
+ "dirty": isDirty.value,
2402
+ "focus": focused.value,
2403
+ "floating": floating.value,
2404
+ "multiple": multiple.value
2405
+ }))
2406
+ );
2407
+ const {
2408
+ getOptionLabel,
2409
+ getOptionValue,
2410
+ isOptionDisabled,
2411
+ getOptionGrouped
2412
+ } = useOptions(props);
2413
+ watch(
2414
+ () => props.options,
2415
+ (newValue) => {
2416
+ if ((newValue == null ? void 0 : newValue.length) && props.autoselectFirst && !isDirty.value) {
2417
+ const firstOptionValue = getOptionValue(newValue[0]);
2418
+ localModelValue.value = props.multiple ? [firstOptionValue] : firstOptionValue;
2419
+ }
2420
+ },
2421
+ { immediate: true }
2422
+ );
2423
+ const hasAttrs = computed(() => {
2424
+ return {
2425
+ "name": props.name,
2426
+ "tabindex": hasTabindex.value,
2427
+ "disabled": isDisabledOrReadonly.value,
2428
+ "required": props.required,
2429
+ "size": props.size,
2430
+ "autocomplete": props.autocomplete,
2431
+ "multiple": props.multiple,
2432
+ "aria-invalid": isInvalid.value,
2433
+ "aria-describedby": hasHintLabelOrSlot.value ? hasHintId.value : void 0,
2434
+ "aria-errormessage": hasInvalidLabelOrSlot.value ? hasHintId.value : void 0
2435
+ };
2436
+ });
2437
+ const slotProps = computed(() => ({
2438
+ valid: props.valid,
2439
+ invalid: props.invalid,
2440
+ modelValue: props.modelValue
2441
+ }));
2442
+ return (_ctx, _cache) => {
2443
+ return openBlock(), createElementBlock(
2444
+ "div",
2445
+ {
2446
+ class: normalizeClass(unref(bemCssClasses))
2447
+ },
2448
+ [
2449
+ _ctx.label ? (openBlock(), createElementBlock("label", {
2450
+ key: 0,
2451
+ for: unref(hasId)
2452
+ }, toDisplayString(_ctx.label), 9, _hoisted_1$1)) : createCommentVNode("v-if", true),
2453
+ createElementVNode("div", _hoisted_2$1, [
2454
+ _ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
2455
+ renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
2456
+ ])) : createCommentVNode("v-if", true),
2457
+ createElementVNode("div", _hoisted_4$1, [
2458
+ unref(hasIconBefore) ? (openBlock(), createBlock(
2459
+ _sfc_main$7,
2460
+ mergeProps({ key: 0 }, unref(hasIconBefore), { class: "vv-select__icon" }),
2461
+ null,
2462
+ 16
2463
+ /* FULL_PROPS */
2464
+ )) : createCommentVNode("v-if", true),
2465
+ withDirectives(createElementVNode("select", mergeProps({
2466
+ id: unref(hasId),
2467
+ ref_key: "selectEl",
2468
+ ref: selectEl
2469
+ }, unref(hasAttrs), {
2470
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(localModelValue) ? localModelValue.value = $event : null)
2471
+ }), [
2472
+ _ctx.placeholder ? (openBlock(), createElementBlock("option", {
2473
+ key: 0,
2474
+ value: void 0,
2475
+ disabled: !_ctx.unselectable,
2476
+ hidden: !_ctx.unselectable
2477
+ }, toDisplayString(_ctx.placeholder), 9, _hoisted_6$1)) : createCommentVNode("v-if", true),
2478
+ (openBlock(true), createElementBlock(
2479
+ Fragment,
2480
+ null,
2481
+ renderList(_ctx.options, (option, index) => {
2482
+ return openBlock(), createElementBlock(
2483
+ Fragment,
2484
+ null,
2485
+ [
2486
+ !isGroup(option) ? (openBlock(), createElementBlock("option", {
2487
+ key: index,
2488
+ disabled: unref(isOptionDisabled)(option),
2489
+ value: unref(getOptionValue)(option)
2490
+ }, toDisplayString(unref(getOptionLabel)(option)), 9, _hoisted_7$1)) : (openBlock(), createElementBlock("optgroup", {
2491
+ key: `group-${index}`,
2492
+ disabled: unref(isOptionDisabled)(option),
2493
+ label: unref(getOptionLabel)(option)
2494
+ }, [
2495
+ (openBlock(true), createElementBlock(
2496
+ Fragment,
2497
+ null,
2498
+ renderList(unref(getOptionGrouped)(option), (item, i) => {
2499
+ return openBlock(), createElementBlock("option", {
2500
+ key: `group-${index}-item-${i}`,
2501
+ disabled: unref(isOptionDisabled)(item),
2502
+ value: unref(getOptionValue)(item)
2503
+ }, toDisplayString(unref(getOptionLabel)(item)), 9, _hoisted_9$1);
2504
+ }),
2505
+ 128
2506
+ /* KEYED_FRAGMENT */
2507
+ ))
2508
+ ], 8, _hoisted_8$1))
2509
+ ],
2510
+ 64
2511
+ /* STABLE_FRAGMENT */
2512
+ );
2513
+ }),
2514
+ 256
2515
+ /* UNKEYED_FRAGMENT */
2516
+ ))
2517
+ ], 16, _hoisted_5$1), [
2518
+ [vModelSelect, unref(localModelValue)]
2519
+ ]),
2520
+ unref(hasIconAfter) ? (openBlock(), createBlock(
2521
+ _sfc_main$7,
2522
+ mergeProps({ key: 1 }, unref(hasIconAfter), { class: "vv-select__icon vv-select__icon-after" }),
2523
+ null,
2524
+ 16
2525
+ /* FULL_PROPS */
2526
+ )) : createCommentVNode("v-if", true)
2527
+ ]),
2528
+ _ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_10, [
2529
+ renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps(unref(slotProps))))
2530
+ ])) : createCommentVNode("v-if", true)
2531
+ ]),
2532
+ createVNode(unref(HintSlot), {
2533
+ id: unref(hasHintId),
2534
+ class: "vv-select__hint"
2535
+ }, createSlots({
2536
+ _: 2
2537
+ /* DYNAMIC */
2538
+ }, [
2539
+ _ctx.$slots.hint ? {
2540
+ name: "hint",
2541
+ fn: withCtx(() => [
2542
+ renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
2543
+ ]),
2544
+ key: "0"
2545
+ } : void 0,
2546
+ _ctx.$slots.loading ? {
2547
+ name: "loading",
2548
+ fn: withCtx(() => [
2549
+ renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
2550
+ ]),
2551
+ key: "1"
2552
+ } : void 0,
2553
+ _ctx.$slots.valid ? {
2554
+ name: "valid",
2555
+ fn: withCtx(() => [
2556
+ renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
2557
+ ]),
2558
+ key: "2"
2559
+ } : void 0,
2560
+ _ctx.$slots.invalid ? {
2561
+ name: "invalid",
2562
+ fn: withCtx(() => [
2563
+ renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
2564
+ ]),
2565
+ key: "3"
2566
+ } : void 0
2567
+ ]), 1032, ["id"])
2568
+ ],
2569
+ 2
2570
+ /* CLASS */
2571
+ );
2572
+ };
2573
+ }
2574
+ });
2576
2575
  const _hoisted_1 = ["id"];
2577
2576
  const _hoisted_2 = ["id", "for"];
2578
2577
  const _hoisted_3 = ["id", "aria-controls", "placeholder"];
@@ -2594,10 +2593,10 @@ const _hoisted_9 = {
2594
2593
  const __default__ = {
2595
2594
  name: "VvCombobox",
2596
2595
  components: {
2597
- VvDropdown: _sfc_main$8,
2598
- VvDropdownOption: _sfc_main$6,
2599
- VvDropdownOptgroup: _sfc_main$5,
2600
- VvButton: _sfc_main$1
2596
+ VvDropdown: _sfc_main$5,
2597
+ VvDropdownOption: _sfc_main$2,
2598
+ VvDropdownOptgroup: _sfc_main$4,
2599
+ VvButton: _sfc_main$6
2601
2600
  }
2602
2601
  };
2603
2602
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -2617,7 +2616,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2617
2616
  const inputEl = ref(null);
2618
2617
  const inputSearchEl = ref(null);
2619
2618
  const wrapperEl = ref(null);
2620
- const dropdownEl = ref(null);
2619
+ const dropdownEl = useTemplateRef("dropdownEl");
2621
2620
  const {
2622
2621
  HintSlot,
2623
2622
  hasHintLabelOrSlot,
@@ -2937,7 +2936,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2937
2936
  class: "vv-select__wrapper"
2938
2937
  },
2939
2938
  [
2940
- createVNode(_sfc_main$8, mergeProps({
2939
+ createVNode(_sfc_main$5, mergeProps({
2941
2940
  ref_key: "dropdownEl",
2942
2941
  ref: dropdownEl,
2943
2942
  modelValue: unref(expanded),
@@ -2953,7 +2952,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2953
2952
  ])) : createCommentVNode("v-if", true),
2954
2953
  createElementVNode("div", _hoisted_5, [
2955
2954
  unref(hasIconBefore) ? (openBlock(), createBlock(
2956
- _sfc_main$9,
2955
+ _sfc_main$7,
2957
2956
  mergeProps({ key: 0 }, unref(hasIconBefore), { class: "vv-select__icon" }),
2958
2957
  null,
2959
2958
  16
@@ -2988,7 +2987,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2988
2987
  Fragment,
2989
2988
  { key: 1 },
2990
2989
  renderList(unref(selectedOptions), (option, index) => {
2991
- return openBlock(), createBlock(_sfc_main$3, {
2990
+ return openBlock(), createBlock(_sfc_main$9, {
2992
2991
  key: index,
2993
2992
  modifiers: _ctx.badgeModifiers,
2994
2993
  class: "vv-select__badge"
@@ -3005,7 +3004,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3005
3004
  type: "button",
3006
3005
  onClick: withModifiers(($event) => onInput(option), ["stop"])
3007
3006
  }, [
3008
- createVNode(_sfc_main$9, { name: "close" })
3007
+ createVNode(_sfc_main$7, { name: "close" })
3009
3008
  ], 8, _hoisted_8)) : createCommentVNode("v-if", true)
3010
3009
  ]),
3011
3010
  _: 2
@@ -3034,7 +3033,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3034
3033
  ])
3035
3034
  ], 16, _hoisted_6),
3036
3035
  unref(hasIconAfter) ? (openBlock(), createBlock(
3037
- _sfc_main$9,
3036
+ _sfc_main$7,
3038
3037
  mergeProps({ key: 1 }, unref(hasIconAfter), { class: "vv-select__icon vv-select__icon-after" }),
3039
3038
  null,
3040
3039
  16
@@ -3060,7 +3059,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3060
3059
  Fragment,
3061
3060
  { key: 0 },
3062
3061
  [
3063
- createVNode(_sfc_main$5, {
3062
+ createVNode(_sfc_main$4, {
3064
3063
  label: unref(getOptionLabel)(option)
3065
3064
  }, null, 8, ["label"]),
3066
3065
  (openBlock(true), createElementBlock(
@@ -3069,7 +3068,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3069
3068
  renderList(unref(getOptionGrouped)(
3070
3069
  option
3071
3070
  ), (item, i) => {
3072
- return openBlock(), createBlock(_sfc_main$6, mergeProps({ ref_for: true }, {
3071
+ return openBlock(), createBlock(_sfc_main$2, mergeProps({ ref_for: true }, {
3073
3072
  selected: isOptionSelected(item),
3074
3073
  disabled: isOptionDisabledOrNotSelectable(item),
3075
3074
  unselectable: unref(isUnselectable),
@@ -3106,7 +3105,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3106
3105
  ],
3107
3106
  64
3108
3107
  /* STABLE_FRAGMENT */
3109
- )) : (openBlock(), createBlock(_sfc_main$6, mergeProps({
3108
+ )) : (openBlock(), createBlock(_sfc_main$2, mergeProps({
3110
3109
  key: 1,
3111
3110
  ref_for: true
3112
3111
  }, {
@@ -3145,7 +3144,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3145
3144
  }),
3146
3145
  128
3147
3146
  /* KEYED_FRAGMENT */
3148
- )) : !_ctx.options.length ? (openBlock(), createBlock(_sfc_main$6, {
3147
+ )) : !_ctx.options.length ? (openBlock(), createBlock(_sfc_main$2, {
3149
3148
  key: 1,
3150
3149
  modifiers: "inert"
3151
3150
  }, {
@@ -3160,7 +3159,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3160
3159
  ]),
3161
3160
  _: 3
3162
3161
  /* FORWARDED */
3163
- })) : !unref(disabled) ? (openBlock(), createBlock(_sfc_main$6, {
3162
+ })) : !unref(disabled) ? (openBlock(), createBlock(_sfc_main$2, {
3164
3163
  key: 2,
3165
3164
  modifiers: "inert"
3166
3165
  }, {
@@ -3182,7 +3181,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3182
3181
  renderSlot(_ctx.$slots, "dropdown::after", {}, () => {
3183
3182
  var _a;
3184
3183
  return [
3185
- ((_a = unref(dropdownEl)) == null ? void 0 : _a.customPosition) ? (openBlock(), createBlock(_sfc_main$1, {
3184
+ ((_a = unref(dropdownEl)) == null ? void 0 : _a.customPosition) ? (openBlock(), createBlock(_sfc_main$6, {
3186
3185
  key: 0,
3187
3186
  label: unref(propsDefaults).closeLabel,
3188
3187
  modifiers: "secondary",
@@ -3259,7 +3258,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3259
3258
  } : void 0
3260
3259
  ]), 1032, ["id"])
3261
3260
  ], 10, _hoisted_1)) : (openBlock(), createBlock(
3262
- _sfc_main$4,
3261
+ _sfc_main$1,
3263
3262
  mergeProps({ key: 1 }, unref(selectProps), {
3264
3263
  "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => emit("update:modelValue", $event))
3265
3264
  }),