@volverjs/ui-vue 0.0.10-beta.3 → 0.0.10-beta.30

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 (472) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +106 -10
  3. package/auto-imports.d.ts +7 -2
  4. package/bin/icons.cjs +1 -1
  5. package/bin/icons.js +22 -15
  6. package/dist/.storybook/main.d.ts +3 -0
  7. package/dist/.storybook/preview.d.ts +89 -0
  8. package/dist/components/VvAccordion/VvAccordion.es.js +192 -103
  9. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  10. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +451 -172
  11. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  12. package/dist/components/VvAction/VvAction.es.js +78 -27
  13. package/dist/components/VvAction/VvAction.umd.js +1 -1
  14. package/dist/components/VvAlert/VvAlert.es.js +204 -171
  15. package/dist/components/VvAlert/VvAlert.umd.js +1 -1
  16. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +250 -188
  17. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
  18. package/dist/components/VvAvatar/VvAvatar.es.js +61 -21
  19. package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
  20. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +118 -48
  21. package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
  22. package/dist/components/VvBadge/VvBadge.es.js +78 -28
  23. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  24. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +276 -60
  25. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  26. package/dist/components/VvButton/VvButton.es.js +291 -252
  27. package/dist/components/VvButton/VvButton.umd.js +1 -1
  28. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +81 -40
  29. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  30. package/dist/components/VvCard/VvCard.es.js +86 -36
  31. package/dist/components/VvCard/VvCard.umd.js +1 -1
  32. package/dist/components/VvCheckbox/VvCheckbox.es.js +177 -120
  33. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  34. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +190 -107
  35. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  36. package/dist/components/VvCombobox/VvCombobox.es.js +806 -581
  37. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  38. package/dist/components/VvDialog/VvDialog.es.js +140 -153
  39. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  40. package/dist/components/VvDropdown/VvDropdown.es.js +138 -71
  41. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  42. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +152 -39
  43. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  44. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +335 -8
  45. package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
  46. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +63 -20
  47. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
  48. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +188 -80
  49. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
  50. package/dist/components/VvIcon/VvIcon.es.js +23 -96
  51. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  52. package/dist/components/VvInputFile/VvInputFile.es.js +1777 -0
  53. package/dist/components/VvInputFile/VvInputFile.umd.js +1 -0
  54. package/dist/components/VvInputText/VvInputText.es.js +1237 -324
  55. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  56. package/dist/components/VvNav/VvNav.es.js +135 -56
  57. package/dist/components/VvNav/VvNav.umd.js +1 -1
  58. package/dist/components/VvNavItem/VvNavItem.es.js +91 -33
  59. package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
  60. package/dist/components/VvProgress/VvProgress.es.js +72 -26
  61. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  62. package/dist/components/VvRadio/VvRadio.es.js +160 -103
  63. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  64. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +190 -107
  65. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  66. package/dist/components/VvSelect/VvSelect.es.js +251 -238
  67. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  68. package/dist/components/VvTab/VvTab.es.js +191 -75
  69. package/dist/components/VvTab/VvTab.umd.js +1 -1
  70. package/dist/components/VvTextarea/VvTextarea.es.js +232 -224
  71. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  72. package/dist/components/VvTooltip/VvTooltip.es.js +79 -29
  73. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  74. package/dist/components/index.es.js +3534 -1650
  75. package/dist/components/index.umd.js +1 -1
  76. package/dist/composables/index.es.js +92 -3
  77. package/dist/composables/index.umd.js +1 -1
  78. package/dist/directives/index.es.js +99 -43
  79. package/dist/directives/index.umd.js +1 -1
  80. package/dist/directives/v-tooltip.es.js +97 -38
  81. package/dist/directives/v-tooltip.umd.js +1 -1
  82. package/dist/icons.es.js +267 -267
  83. package/dist/icons.umd.js +1 -1
  84. package/dist/index.es.js +90 -16
  85. package/dist/index.umd.js +1 -1
  86. package/dist/resolvers/unplugin.es.js +87 -10
  87. package/dist/resolvers/unplugin.umd.js +1 -1
  88. package/dist/src/components/VvAccordion/VvAccordion.vue.d.ts +194 -0
  89. package/dist/{components → src/components}/VvAccordion/index.d.ts +8 -9
  90. package/dist/src/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +92 -0
  91. package/dist/{components → src/components}/VvAccordionGroup/index.d.ts +14 -6
  92. package/dist/{components → src/components}/VvAction/VvAction.vue.d.ts +57 -22
  93. package/dist/{components → src/components}/VvAction/index.d.ts +25 -9
  94. package/dist/{components → src/components}/VvAlert/VvAlert.vue.d.ts +24 -14
  95. package/dist/{components → src/components}/VvAlert/index.d.ts +17 -9
  96. package/dist/{components → src/components}/VvAlertGroup/VvAlertGroup.vue.d.ts +16 -9
  97. package/dist/{components → src/components}/VvAlertGroup/index.d.ts +6 -14
  98. package/dist/src/components/VvAvatar/VvAvatar.vue.d.ts +23 -0
  99. package/dist/{components → src/components}/VvAvatar/index.d.ts +4 -1
  100. package/dist/{components → src/components}/VvAvatarGroup/VvAvatarGroup.vue.d.ts +10 -3
  101. package/dist/{components → src/components}/VvAvatarGroup/index.d.ts +4 -1
  102. package/dist/{components → src/components}/VvBadge/VvBadge.vue.d.ts +12 -4
  103. package/dist/src/components/VvBadge/index.d.ts +7 -0
  104. package/dist/src/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +38 -0
  105. package/dist/src/components/VvBreadcrumb/index.d.ts +8 -0
  106. package/dist/{components → src/components}/VvButton/VvButton.vue.d.ts +94 -40
  107. package/dist/{components → src/components}/VvButton/index.d.ts +51 -29
  108. package/dist/{components → src/components}/VvButtonGroup/VvButtonGroup.vue.d.ts +24 -11
  109. package/dist/{components → src/components}/VvButtonGroup/index.d.ts +8 -2
  110. package/dist/{components → src/components}/VvCard/VvCard.vue.d.ts +12 -4
  111. package/dist/src/components/VvCard/index.d.ts +7 -0
  112. package/dist/src/components/VvCheckbox/VvCheckbox.vue.d.ts +184 -0
  113. package/dist/{components → src/components}/VvCheckbox/index.d.ts +47 -14
  114. package/dist/{components → src/components}/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +101 -30
  115. package/dist/src/components/VvCheckboxGroup/index.d.ts +75 -0
  116. package/dist/{components → src/components}/VvCombobox/VvCombobox.vue.d.ts +171 -104
  117. package/dist/{components → src/components}/VvCombobox/index.d.ts +62 -26
  118. package/dist/{components → src/components}/VvDialog/VvDialog.vue.d.ts +4 -4
  119. package/dist/{components → src/components}/VvDropdown/VvDropdown.vue.d.ts +101 -75
  120. package/dist/src/components/VvDropdown/VvDropdownAction.vue.d.ts +114 -0
  121. package/dist/src/components/VvDropdown/VvDropdownItem.vue.d.ts +21 -0
  122. package/dist/src/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +14 -0
  123. package/dist/{components → src/components}/VvDropdown/VvDropdownOption.vue.d.ts +35 -7
  124. package/dist/{components → src/components}/VvDropdown/index.d.ts +52 -10
  125. package/dist/src/components/VvIcon/VvIcon.vue.d.ts +26 -0
  126. package/dist/{components → src/components}/VvIcon/index.d.ts +33 -48
  127. package/dist/src/components/VvInputFile/VvInputFile.vue.d.ts +359 -0
  128. package/dist/src/components/VvInputFile/index.d.ts +200 -0
  129. package/dist/{components → src/components}/VvInputText/VvInputClearAction.d.ts +7 -5
  130. package/dist/{components → src/components}/VvInputText/VvInputPasswordAction.d.ts +10 -8
  131. package/dist/{components → src/components}/VvInputText/VvInputStepAction.d.ts +2 -2
  132. package/dist/{components → src/components}/VvInputText/VvInputText.vue.d.ts +207 -57
  133. package/dist/{components → src/components}/VvInputText/index.d.ts +99 -29
  134. package/dist/src/components/VvNav/VvNav.vue.d.ts +48 -0
  135. package/dist/{components → src/components}/VvNav/VvNavItem.vue.d.ts +1 -1
  136. package/dist/src/components/VvNav/VvNavSeparator.vue.d.ts +2 -0
  137. package/dist/src/components/VvNav/index.d.ts +11 -0
  138. package/dist/{components → src/components}/VvProgress/VvProgress.vue.d.ts +10 -3
  139. package/dist/{components → src/components}/VvProgress/index.d.ts +4 -1
  140. package/dist/src/components/VvRadio/VvRadio.vue.d.ts +176 -0
  141. package/dist/src/components/VvRadio/index.d.ts +80 -0
  142. package/dist/{components → src/components}/VvRadioGroup/VvRadioGroup.vue.d.ts +101 -30
  143. package/dist/src/components/VvRadioGroup/index.d.ts +75 -0
  144. package/dist/{components → src/components}/VvSelect/VvSelect.vue.d.ts +117 -44
  145. package/dist/{components → src/components}/VvSelect/index.d.ts +48 -14
  146. package/dist/src/components/VvTab/VvTab.vue.d.ts +63 -0
  147. package/dist/{components → src/components}/VvTab/index.d.ts +4 -1
  148. package/dist/{components → src/components}/VvTextarea/VvTextarea.vue.d.ts +156 -49
  149. package/dist/{components → src/components}/VvTextarea/index.d.ts +68 -19
  150. package/dist/src/components/VvTooltip/VvTooltip.vue.d.ts +36 -0
  151. package/dist/{components → src/components}/VvTooltip/index.d.ts +5 -2
  152. package/dist/{components → src/components}/common/HintSlot.d.ts +1 -1
  153. package/dist/{components → src/components}/index.d.ts +10 -0
  154. package/dist/src/composables/alert/useAlert.d.ts +122 -0
  155. package/dist/src/composables/alert/useInjectAlert.d.ts +4 -0
  156. package/dist/src/composables/dropdown/useInjectDropdown.d.ts +12 -0
  157. package/dist/{composables → src/composables}/dropdown/useProvideDropdown.d.ts +3 -4
  158. package/dist/src/composables/group/useInjectedGroupState.d.ts +9 -0
  159. package/dist/src/composables/group/useProvideGroupState.d.ts +6 -0
  160. package/dist/{composables → src/composables}/index.d.ts +1 -0
  161. package/dist/src/composables/useBlurhash.d.ts +7 -0
  162. package/dist/src/composables/useComponentIcon.d.ts +11 -0
  163. package/dist/src/composables/usePersistence.d.ts +2 -0
  164. package/dist/src/composables/useVolver.d.ts +1 -0
  165. package/dist/{constants.d.ts → src/constants.d.ts} +34 -32
  166. package/dist/src/directives/index.d.ts +3 -0
  167. package/dist/{index.d.ts → src/index.d.ts} +3 -1
  168. package/dist/{props → src/props}/index.d.ts +272 -81
  169. package/dist/{resolvers → src/resolvers}/unplugin.d.ts +6 -1
  170. package/dist/src/stories/AccordionGroup/AccordionGroup.stories.d.ts +188 -0
  171. package/dist/src/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +1262 -0
  172. package/dist/{stories → src/stories}/AlertGroup/AlertGroupWithComposable.stories.d.ts +1 -1
  173. package/dist/src/stories/Blurhash/BlurhashComposable.stories.d.ts +4 -0
  174. package/dist/{stories → src/stories}/Button/Button.settings.d.ts +0 -1
  175. package/dist/{stories → src/stories}/Combobox/Combobox.settings.d.ts +8 -0
  176. package/dist/{stories → src/stories}/Icon/Icon.settings.d.ts +1 -0
  177. package/dist/src/stories/InputFile/InputFile.settings.d.ts +56 -0
  178. package/dist/src/stories/InputFile/InputFile.stories.d.ts +12 -0
  179. package/dist/src/stories/InputFile/InputFileDropArea.stories.d.ts +9 -0
  180. package/dist/src/stories/InputFile/InputFileIconPosition.stories.d.ts +8 -0
  181. package/dist/src/stories/InputFile/InputFileSlots.stories.d.ts +7 -0
  182. package/dist/src/stories/Tab/Tab.settings.d.ts +4 -0
  183. package/dist/{test → src/test}/expect.d.ts +1 -1
  184. package/dist/src/types/alert.d.ts +15 -0
  185. package/dist/src/types/blurhash.d.ts +12 -0
  186. package/dist/{types → src/types}/generic.d.ts +1 -2
  187. package/dist/src/types/group.d.ts +59 -0
  188. package/dist/src/types/index.d.ts +7 -0
  189. package/dist/src/types/input-file.d.ts +16 -0
  190. package/dist/{types → src/types}/nav.d.ts +2 -2
  191. package/dist/{utils → src/utils}/ObjectUtilities.d.ts +0 -1
  192. package/dist/src/workers/blurhash.d.ts +1 -0
  193. package/package.json +78 -78
  194. package/src/Volver.ts +31 -20
  195. package/src/assets/icons/detailed.json +1 -1
  196. package/src/assets/icons/normal.json +1 -1
  197. package/src/assets/icons/simple.json +1 -1
  198. package/src/components/VvAccordion/VvAccordion.vue +121 -58
  199. package/src/components/VvAccordion/index.ts +8 -23
  200. package/src/components/VvAccordionGroup/VvAccordionGroup.vue +164 -47
  201. package/src/components/VvAccordionGroup/index.ts +6 -6
  202. package/src/components/VvAction/VvAction.vue +17 -5
  203. package/src/components/VvAlert/index.ts +14 -9
  204. package/src/components/VvAlertGroup/index.ts +3 -15
  205. package/src/components/VvBreadcrumb/VvBreadcrumb.vue +20 -19
  206. package/src/components/VvBreadcrumb/index.ts +2 -8
  207. package/src/components/VvButton/VvButton.vue +17 -7
  208. package/src/components/VvButton/index.ts +9 -16
  209. package/src/components/VvButtonGroup/VvButtonGroup.vue +1 -2
  210. package/src/components/VvCheckbox/index.ts +2 -2
  211. package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +1 -2
  212. package/src/components/VvCombobox/VvCombobox.vue +15 -12
  213. package/src/components/VvCombobox/index.ts +4 -0
  214. package/src/components/VvDropdown/VvDropdown.vue +11 -2
  215. package/src/components/VvDropdown/VvDropdownItem.vue +4 -1
  216. package/src/components/VvDropdown/VvDropdownOption.vue +4 -21
  217. package/src/components/VvDropdown/index.ts +35 -1
  218. package/src/components/VvIcon/VvIcon.vue +2 -2
  219. package/src/components/VvIcon/index.ts +35 -48
  220. package/src/components/VvInputFile/VvInputFile.vue +395 -0
  221. package/src/components/VvInputFile/index.ts +135 -0
  222. package/src/components/VvInputText/VvInputClearAction.ts +10 -6
  223. package/src/components/VvInputText/VvInputPasswordAction.ts +13 -9
  224. package/src/components/VvInputText/VvInputText.vue +141 -33
  225. package/src/components/VvInputText/index.ts +31 -16
  226. package/src/components/VvNav/VvNav.vue +4 -2
  227. package/src/components/VvRadio/index.ts +5 -5
  228. package/src/components/VvRadioGroup/VvRadioGroup.vue +1 -2
  229. package/src/components/VvSelect/VvSelect.vue +5 -8
  230. package/src/components/VvTab/VvTab.vue +5 -1
  231. package/src/components/VvTextarea/VvTextarea.vue +6 -9
  232. package/src/components/index.ts +10 -0
  233. package/src/composables/alert/useAlert.ts +12 -9
  234. package/src/composables/dropdown/useProvideDropdown.ts +4 -4
  235. package/src/composables/group/useInjectedGroupState.ts +20 -16
  236. package/src/composables/group/useProvideGroupState.ts +10 -15
  237. package/src/composables/index.ts +1 -0
  238. package/src/composables/useBlurhash.ts +76 -0
  239. package/src/composables/useComponentIcon.ts +15 -14
  240. package/src/composables/usePersistence.ts +76 -0
  241. package/src/composables/useUniqueId.ts +2 -2
  242. package/src/constants.ts +47 -32
  243. package/src/directives/index.ts +3 -6
  244. package/src/directives/v-tooltip.ts +19 -10
  245. package/src/index.ts +3 -1
  246. package/src/props/index.ts +108 -31
  247. package/src/resolvers/unplugin.ts +24 -14
  248. package/src/stories/Accordion/Accordion.test.ts +1 -1
  249. package/src/stories/AccordionGroup/AccordionGroup.settings.ts +2 -2
  250. package/src/stories/AccordionGroup/AccordionGroup.test.ts +17 -11
  251. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.ts +1 -1
  252. package/src/stories/Alert/Alert.test.ts +1 -1
  253. package/src/stories/AlertGroup/AlertGroup.test.ts +1 -1
  254. package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +2 -2
  255. package/src/stories/Avatar/Avatar.test.ts +1 -1
  256. package/src/stories/AvatarGroup/AvatarGroup.test.ts +1 -1
  257. package/src/stories/Badge/Badge.test.ts +1 -1
  258. package/src/stories/Blurhash/BlurhashComposable.stories.ts +195 -0
  259. package/src/stories/Button/Button.settings.ts +1 -4
  260. package/src/stories/Button/Button.test.ts +1 -1
  261. package/src/stories/ButtonGroup/ButtonGroup.test.ts +1 -1
  262. package/src/stories/Card/Card.test.ts +1 -1
  263. package/src/stories/Checkbox/Checkbox.test.ts +1 -1
  264. package/src/stories/CheckboxGroup/CheckboxGroup.test.ts +1 -1
  265. package/src/stories/Combobox/Combobox.settings.ts +8 -0
  266. package/src/stories/Combobox/Combobox.test.ts +1 -1
  267. package/src/stories/Dialog/Dialog.test.ts +2 -2
  268. package/src/stories/Dropdown/Dropdown.test.ts +1 -1
  269. package/src/stories/Icon/Icon.settings.ts +3 -3
  270. package/src/stories/InputFile/InputFile.settings.ts +36 -0
  271. package/src/stories/InputFile/InputFile.stories.ts +89 -0
  272. package/src/stories/InputFile/InputFileDropArea.stories.ts +56 -0
  273. package/src/stories/InputFile/InputFileIconPosition.stories.ts +43 -0
  274. package/src/stories/InputFile/InputFileSlots.stories.ts +33 -0
  275. package/src/stories/InputText/InputText.test.ts +1 -1
  276. package/src/stories/Nav/Nav.test.ts +1 -1
  277. package/src/stories/Progress/Progress.test.ts +1 -1
  278. package/src/stories/Radio/Radio.test.ts +1 -1
  279. package/src/stories/RadioGroup/RadioGroup.test.ts +1 -1
  280. package/src/stories/Select/Select.test.ts +1 -1
  281. package/src/stories/Tab/Tab.settings.ts +2 -2
  282. package/src/stories/Tab/Tab.test.ts +1 -1
  283. package/src/stories/Textarea/Textarea.test.ts +1 -1
  284. package/src/stories/Tooltip/Tooltip.test.ts +1 -1
  285. package/src/stories/argTypes.ts +1 -1
  286. package/src/test/expect.ts +2 -4
  287. package/src/types/alert.ts +11 -7
  288. package/src/types/blurhash.ts +21 -0
  289. package/src/types/generic.ts +3 -3
  290. package/src/types/group.ts +22 -14
  291. package/src/types/index.ts +7 -0
  292. package/src/types/input-file.ts +18 -0
  293. package/src/types/nav.ts +2 -3
  294. package/src/utils/ObjectUtilities.ts +0 -11
  295. package/src/workers/blurhash.ts +9 -0
  296. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +0 -42
  297. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +0 -47
  298. package/dist/components/VvAvatar/VvAvatar.vue.d.ts +0 -15
  299. package/dist/components/VvBadge/index.d.ts +0 -4
  300. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +0 -18
  301. package/dist/components/VvBreadcrumb/index.d.ts +0 -12
  302. package/dist/components/VvCard/index.d.ts +0 -4
  303. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +0 -112
  304. package/dist/components/VvCheckboxGroup/index.d.ts +0 -42
  305. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +0 -73
  306. package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +0 -9
  307. package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +0 -6
  308. package/dist/components/VvIcon/VvIcon.vue.d.ts +0 -69
  309. package/dist/components/VvNav/VvNav.vue.d.ts +0 -25
  310. package/dist/components/VvNav/VvNavSeparator.vue.d.ts +0 -2
  311. package/dist/components/VvNav/index.d.ts +0 -8
  312. package/dist/components/VvRadio/VvRadio.vue.d.ts +0 -104
  313. package/dist/components/VvRadio/index.d.ts +0 -47
  314. package/dist/components/VvRadioGroup/index.d.ts +0 -42
  315. package/dist/components/VvTab/VvTab.vue.d.ts +0 -39
  316. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +0 -29
  317. package/dist/composables/alert/useAlert.d.ts +0 -27
  318. package/dist/composables/alert/useInjectAlert.d.ts +0 -9
  319. package/dist/composables/dropdown/useInjectDropdown.d.ts +0 -32
  320. package/dist/composables/group/useInjectedGroupState.d.ts +0 -10
  321. package/dist/composables/group/useProvideGroupState.d.ts +0 -6
  322. package/dist/composables/useComponentIcon.d.ts +0 -10
  323. package/dist/composables/useVolver.d.ts +0 -1
  324. package/dist/directives/index.d.ts +0 -5
  325. package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +0 -134
  326. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +0 -679
  327. package/dist/stories/Tab/Tab.settings.d.ts +0 -17
  328. package/dist/types/alert.d.ts +0 -13
  329. package/dist/types/group.d.ts +0 -37
  330. package/dist/{Volver.d.ts → src/Volver.d.ts} +1 -1
  331. /package/dist/{components → src/components}/VvDialog/index.d.ts +0 -0
  332. /package/dist/{components → src/components}/VvInputText/VvInputTextActions.d.ts +0 -0
  333. /package/dist/{composables → src/composables}/alert/useProvideAlert.d.ts +0 -0
  334. /package/dist/{composables → src/composables}/useComponentFocus.d.ts +0 -0
  335. /package/dist/{composables → src/composables}/useDebouncedInput.d.ts +0 -0
  336. /package/dist/{composables → src/composables}/useDefaults.d.ts +0 -0
  337. /package/dist/{composables → src/composables}/useModifiers.d.ts +0 -0
  338. /package/dist/{composables → src/composables}/useOptions.d.ts +0 -0
  339. /package/dist/{composables → src/composables}/useTextCount.d.ts +0 -0
  340. /package/dist/{composables → src/composables}/useUniqueId.d.ts +0 -0
  341. /package/dist/{directives → src/directives}/v-contextmenu.d.ts +0 -0
  342. /package/dist/{directives → src/directives}/v-tooltip.d.ts +0 -0
  343. /package/dist/{icons.d.ts → src/icons.d.ts} +0 -0
  344. /package/dist/{stories → src/stories}/Accordion/Accordion.settings.d.ts +0 -0
  345. /package/dist/{stories → src/stories}/Accordion/Accordion.stories.d.ts +0 -0
  346. /package/dist/{stories → src/stories}/Accordion/Accordion.test.d.ts +0 -0
  347. /package/dist/{stories → src/stories}/Accordion/AccordionSlots.stories.d.ts +0 -0
  348. /package/dist/{stories → src/stories}/AccordionGroup/AccordionGroup.settings.d.ts +0 -0
  349. /package/dist/{stories → src/stories}/AccordionGroup/AccordionGroup.test.d.ts +0 -0
  350. /package/dist/{stories → src/stories}/Alert/Alert.settings.d.ts +0 -0
  351. /package/dist/{stories → src/stories}/Alert/Alert.stories.d.ts +0 -0
  352. /package/dist/{stories → src/stories}/Alert/Alert.test.d.ts +0 -0
  353. /package/dist/{stories → src/stories}/Alert/AlertModifiers.stories.d.ts +0 -0
  354. /package/dist/{stories → src/stories}/Alert/AlertSlots.stories.d.ts +0 -0
  355. /package/dist/{stories → src/stories}/AlertGroup/AlertGroup.settings.d.ts +0 -0
  356. /package/dist/{stories → src/stories}/AlertGroup/AlertGroup.stories.d.ts +0 -0
  357. /package/dist/{stories → src/stories}/AlertGroup/AlertGroup.test.d.ts +0 -0
  358. /package/dist/{stories → src/stories}/AlertGroup/AlertGroupPosition.stories.d.ts +0 -0
  359. /package/dist/{stories → src/stories}/AlertGroup/AlertGroupSlots.stories.d.ts +0 -0
  360. /package/dist/{stories → src/stories}/Avatar/Avatar.settings.d.ts +0 -0
  361. /package/dist/{stories → src/stories}/Avatar/Avatar.stories.d.ts +0 -0
  362. /package/dist/{stories → src/stories}/Avatar/Avatar.test.d.ts +0 -0
  363. /package/dist/{stories → src/stories}/Avatar/AvatarBadge.stories.d.ts +0 -0
  364. /package/dist/{stories → src/stories}/Avatar/AvatarModifiers.stories.d.ts +0 -0
  365. /package/dist/{stories → src/stories}/Avatar/AvatarSlots.stories.d.ts +0 -0
  366. /package/dist/{stories → src/stories}/AvatarGroup/AvatarGroup.settings.d.ts +0 -0
  367. /package/dist/{stories → src/stories}/AvatarGroup/AvatarGroup.stories.d.ts +0 -0
  368. /package/dist/{stories → src/stories}/AvatarGroup/AvatarGroup.test.d.ts +0 -0
  369. /package/dist/{stories → src/stories}/AvatarGroup/AvatarGroupModifiers.stories.d.ts +0 -0
  370. /package/dist/{stories → src/stories}/AvatarGroup/AvatarGroupSlotDefault.stories.d.ts +0 -0
  371. /package/dist/{stories → src/stories}/Badge/Badge.settings.d.ts +0 -0
  372. /package/dist/{stories → src/stories}/Badge/Badge.stories.d.ts +0 -0
  373. /package/dist/{stories → src/stories}/Badge/Badge.test.d.ts +0 -0
  374. /package/dist/{stories → src/stories}/Badge/BadgeSlots.stories.d.ts +0 -0
  375. /package/dist/{stories → src/stories}/Breadcrumb/Breadcrumb.settings.d.ts +0 -0
  376. /package/dist/{stories → src/stories}/Breadcrumb/Breadcrumb.stories.d.ts +0 -0
  377. /package/dist/{stories → src/stories}/Breadcrumb/Breadcrumb.test.d.ts +0 -0
  378. /package/dist/{stories → src/stories}/Breadcrumb/BreadcrumbSlots.stories.d.ts +0 -0
  379. /package/dist/{stories → src/stories}/Button/Button.stories.d.ts +0 -0
  380. /package/dist/{stories → src/stories}/Button/Button.test.d.ts +0 -0
  381. /package/dist/{stories → src/stories}/Button/ButtonIcon.stories.d.ts +0 -0
  382. /package/dist/{stories → src/stories}/Button/ButtonLink.stories.d.ts +0 -0
  383. /package/dist/{stories → src/stories}/Button/ButtonLoading.stories.d.ts +0 -0
  384. /package/dist/{stories → src/stories}/Button/ButtonModifiers.stories.d.ts +0 -0
  385. /package/dist/{stories → src/stories}/Button/ButtonSlots.stories.d.ts +0 -0
  386. /package/dist/{stories → src/stories}/Button/ButtonState.stories.d.ts +0 -0
  387. /package/dist/{stories → src/stories}/Button/ButtonToggle.stories.d.ts +0 -0
  388. /package/dist/{stories → src/stories}/ButtonGroup/ButtonGroup.settings.d.ts +0 -0
  389. /package/dist/{stories → src/stories}/ButtonGroup/ButtonGroup.stories.d.ts +0 -0
  390. /package/dist/{stories → src/stories}/ButtonGroup/ButtonGroup.test.d.ts +0 -0
  391. /package/dist/{stories → src/stories}/ButtonGroup/ButtonGroupModifiers.stories.d.ts +0 -0
  392. /package/dist/{stories → src/stories}/ButtonGroup/ButtonGroupSlots.stories.d.ts +0 -0
  393. /package/dist/{stories → src/stories}/ButtonGroup/ButtonGroupToggle.stories.d.ts +0 -0
  394. /package/dist/{stories → src/stories}/Card/Card.settings.d.ts +0 -0
  395. /package/dist/{stories → src/stories}/Card/Card.stories.d.ts +0 -0
  396. /package/dist/{stories → src/stories}/Card/Card.test.d.ts +0 -0
  397. /package/dist/{stories → src/stories}/Card/CardSlots.stories.d.ts +0 -0
  398. /package/dist/{stories → src/stories}/Checkbox/Checkbox.settings.d.ts +0 -0
  399. /package/dist/{stories → src/stories}/Checkbox/Checkbox.stories.d.ts +0 -0
  400. /package/dist/{stories → src/stories}/Checkbox/Checkbox.test.d.ts +0 -0
  401. /package/dist/{stories → src/stories}/Checkbox/CheckboxBinary.stories.d.ts +0 -0
  402. /package/dist/{stories → src/stories}/Checkbox/CheckboxSlots.stories.d.ts +0 -0
  403. /package/dist/{stories → src/stories}/CheckboxGroup/CheckboxGroup.settings.d.ts +0 -0
  404. /package/dist/{stories → src/stories}/CheckboxGroup/CheckboxGroup.stories.d.ts +0 -0
  405. /package/dist/{stories → src/stories}/CheckboxGroup/CheckboxGroup.test.d.ts +0 -0
  406. /package/dist/{stories → src/stories}/CheckboxGroup/CheckboxGroupOptions.stories.d.ts +0 -0
  407. /package/dist/{stories → src/stories}/CheckboxGroup/CheckboxGroupSlots.stories.d.ts +0 -0
  408. /package/dist/{stories → src/stories}/Combobox/Combobox.stories.d.ts +0 -0
  409. /package/dist/{stories → src/stories}/Combobox/Combobox.test.d.ts +0 -0
  410. /package/dist/{stories → src/stories}/Combobox/ComboboxIconPosition.stories.d.ts +0 -0
  411. /package/dist/{stories → src/stories}/Combobox/ComboboxMultiple.stories.d.ts +0 -0
  412. /package/dist/{stories → src/stories}/Combobox/ComboboxOptions.stories.d.ts +0 -0
  413. /package/dist/{stories → src/stories}/Combobox/ComboboxSlots.stories.d.ts +0 -0
  414. /package/dist/{stories → src/stories}/Dialog/Dialog.settings.d.ts +0 -0
  415. /package/dist/{stories → src/stories}/Dialog/Dialog.stories.d.ts +0 -0
  416. /package/dist/{stories → src/stories}/Dialog/Dialog.test.d.ts +0 -0
  417. /package/dist/{stories → src/stories}/Dialog/DialogSlots.stories.d.ts +0 -0
  418. /package/dist/{stories → src/stories}/Dropdown/Dropdown.settings.d.ts +0 -0
  419. /package/dist/{stories → src/stories}/Dropdown/Dropdown.stories.d.ts +0 -0
  420. /package/dist/{stories → src/stories}/Dropdown/Dropdown.test.d.ts +0 -0
  421. /package/dist/{stories → src/stories}/Dropdown/DropdownContextmenuDirective.stories.d.ts +0 -0
  422. /package/dist/{stories → src/stories}/Dropdown/DropdownMultilevel.stories.d.ts +0 -0
  423. /package/dist/{stories → src/stories}/Dropdown/DropdownSlots.stories.d.ts +0 -0
  424. /package/dist/{stories → src/stories}/Icon/Icon.stories.d.ts +0 -0
  425. /package/dist/{stories → src/stories}/Icon/IconsCollection.stories.d.ts +0 -0
  426. /package/dist/{stories → src/stories}/InputText/InputText.settings.d.ts +0 -0
  427. /package/dist/{stories → src/stories}/InputText/InputText.stories.d.ts +0 -0
  428. /package/dist/{stories → src/stories}/InputText/InputText.test.d.ts +0 -0
  429. /package/dist/{stories → src/stories}/InputText/InputTextIconPosition.stories.d.ts +0 -0
  430. /package/dist/{stories → src/stories}/InputText/InputTextLength.stories.d.ts +0 -0
  431. /package/dist/{stories → src/stories}/InputText/InputTextMask.stories.d.ts +0 -0
  432. /package/dist/{stories → src/stories}/InputText/InputTextMinMax.stories.d.ts +0 -0
  433. /package/dist/{stories → src/stories}/InputText/InputTextSlots.stories.d.ts +0 -0
  434. /package/dist/{stories → src/stories}/InputText/InputTextType.stories.d.ts +0 -0
  435. /package/dist/{stories → src/stories}/Nav/Nav.settings.d.ts +0 -0
  436. /package/dist/{stories → src/stories}/Nav/Nav.stories.d.ts +0 -0
  437. /package/dist/{stories → src/stories}/Nav/Nav.test.d.ts +0 -0
  438. /package/dist/{stories → src/stories}/Nav/NavModifiers.stories.d.ts +0 -0
  439. /package/dist/{stories → src/stories}/Progress/Progress.settings.d.ts +0 -0
  440. /package/dist/{stories → src/stories}/Progress/Progress.stories.d.ts +0 -0
  441. /package/dist/{stories → src/stories}/Progress/Progress.test.d.ts +0 -0
  442. /package/dist/{stories → src/stories}/Radio/Radio.settings.d.ts +0 -0
  443. /package/dist/{stories → src/stories}/Radio/Radio.stories.d.ts +0 -0
  444. /package/dist/{stories → src/stories}/Radio/Radio.test.d.ts +0 -0
  445. /package/dist/{stories → src/stories}/Radio/RadioSlots.stories.d.ts +0 -0
  446. /package/dist/{stories → src/stories}/RadioGroup/RadioGroup.settings.d.ts +0 -0
  447. /package/dist/{stories → src/stories}/RadioGroup/RadioGroup.stories.d.ts +0 -0
  448. /package/dist/{stories → src/stories}/RadioGroup/RadioGroup.test.d.ts +0 -0
  449. /package/dist/{stories → src/stories}/RadioGroup/RadioGroupOptions.stories.d.ts +0 -0
  450. /package/dist/{stories → src/stories}/RadioGroup/RadioGroupSlots.stories.d.ts +0 -0
  451. /package/dist/{stories → src/stories}/Select/Select.settings.d.ts +0 -0
  452. /package/dist/{stories → src/stories}/Select/Select.stories.d.ts +0 -0
  453. /package/dist/{stories → src/stories}/Select/Select.test.d.ts +0 -0
  454. /package/dist/{stories → src/stories}/Select/SelectIconPosition.stories.d.ts +0 -0
  455. /package/dist/{stories → src/stories}/Select/SelectOptions.stories.d.ts +0 -0
  456. /package/dist/{stories → src/stories}/Select/SelectSlots.stories.d.ts +0 -0
  457. /package/dist/{stories → src/stories}/Tab/Tab.stories.d.ts +0 -0
  458. /package/dist/{stories → src/stories}/Tab/Tab.test.d.ts +0 -0
  459. /package/dist/{stories → src/stories}/Textarea/Textarea.settings.d.ts +0 -0
  460. /package/dist/{stories → src/stories}/Textarea/Textarea.stories.d.ts +0 -0
  461. /package/dist/{stories → src/stories}/Textarea/Textarea.test.d.ts +0 -0
  462. /package/dist/{stories → src/stories}/Textarea/TextareaLength.stories.d.ts +0 -0
  463. /package/dist/{stories → src/stories}/Textarea/TextareaSlots.stories.d.ts +0 -0
  464. /package/dist/{stories → src/stories}/Textarea/TextareatIconPosition.stories.d.ts +0 -0
  465. /package/dist/{stories → src/stories}/Tooltip/Tooltip.settings.d.ts +0 -0
  466. /package/dist/{stories → src/stories}/Tooltip/Tooltip.stories.d.ts +0 -0
  467. /package/dist/{stories → src/stories}/Tooltip/Tooltip.test.d.ts +0 -0
  468. /package/dist/{stories → src/stories}/Tooltip/TooltipDirective.stories.d.ts +0 -0
  469. /package/dist/{stories → src/stories}/argTypes.d.ts +0 -0
  470. /package/dist/{test → src/test}/options.d.ts +0 -0
  471. /package/dist/{test → src/test}/sleep.d.ts +0 -0
  472. /package/dist/{types → src/types}/floating-ui.d.ts +0 -0
@@ -0,0 +1,1777 @@
1
+ import { inject, computed, unref, defineComponent, mergeDefaults, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, getCurrentInstance, watch, resolveDynamicComponent, withCtx, renderSlot, createTextVNode, toDisplayString, toRef, useAttrs, useSlots, createElementBlock, Fragment, isRef, h, onBeforeUnmount, normalizeClass, withModifiers, createElementVNode, normalizeProps, createVNode, guardReactiveProps, createSlots } from "vue";
2
+ import { useVModel } from "@vueuse/core";
3
+ import { iconExists, Icon, addIcon } from "@iconify/vue";
4
+ import { uid } from "uid";
5
+ import Sortable from "vuedraggable";
6
+ const ACTION_ICONS = {
7
+ showPassword: "eye-on",
8
+ hidePassword: "eye-off",
9
+ showDatePicker: "calendar",
10
+ showTimePicker: "time",
11
+ showColorPicker: "color",
12
+ clear: "close",
13
+ add: "add",
14
+ remove: "trash",
15
+ edit: "edit",
16
+ download: "download"
17
+ };
18
+ const VvIconPropsDefaults = {
19
+ prefix: "normal"
20
+ /* normal */
21
+ };
22
+ var StorageType = /* @__PURE__ */ ((StorageType2) => {
23
+ StorageType2["local"] = "local";
24
+ StorageType2["session"] = "session";
25
+ return StorageType2;
26
+ })(StorageType || {});
27
+ var Strategy = /* @__PURE__ */ ((Strategy2) => {
28
+ Strategy2["absolute"] = "absolute";
29
+ Strategy2["fixed"] = "fixed";
30
+ return Strategy2;
31
+ })(Strategy || {});
32
+ var Side = /* @__PURE__ */ ((Side2) => {
33
+ Side2["left"] = "left";
34
+ Side2["right"] = "right";
35
+ Side2["top"] = "top";
36
+ Side2["bottom"] = "bottom";
37
+ return Side2;
38
+ })(Side || {});
39
+ var Placement = /* @__PURE__ */ ((Placement2) => {
40
+ Placement2["topStart"] = "top-start";
41
+ Placement2["topEnd"] = "top-end";
42
+ Placement2["bottomStart"] = "bottom-start";
43
+ Placement2["bottomEnd"] = "bottom-end";
44
+ Placement2["leftStart"] = "left-start";
45
+ Placement2["leftEnd"] = "left-end";
46
+ Placement2["rightStart"] = "right-start";
47
+ Placement2["rightEnd"] = "right-end";
48
+ return Placement2;
49
+ })(Placement || {});
50
+ var Position = /* @__PURE__ */ ((Position2) => {
51
+ Position2["before"] = "before";
52
+ Position2["after"] = "after";
53
+ return Position2;
54
+ })(Position || {});
55
+ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
56
+ ButtonType2["button"] = "button";
57
+ ButtonType2["submit"] = "submit";
58
+ ButtonType2["reset"] = "reset";
59
+ return ButtonType2;
60
+ })(ButtonType || {});
61
+ var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
62
+ ActionTag2["nuxtLink"] = "nuxt-link";
63
+ ActionTag2["routerLink"] = "router-link";
64
+ ActionTag2["a"] = "a";
65
+ ActionTag2["button"] = "button";
66
+ return ActionTag2;
67
+ })(ActionTag || {});
68
+ const INJECTION_KEY_VOLVER = Symbol.for("volver");
69
+ const INJECTION_KEY_BUTTON_GROUP = Symbol.for(
70
+ "buttonGroup"
71
+ );
72
+ const INJECTION_KEY_DROPDOWN_TRIGGER = Symbol.for(
73
+ "dropdownTrigger"
74
+ );
75
+ const INJECTION_KEY_DROPDOWN_ACTION = Symbol.for(
76
+ "dropdownAction"
77
+ );
78
+ function useVolver() {
79
+ return inject(INJECTION_KEY_VOLVER);
80
+ }
81
+ function useModifiers(prefix, modifiers, others) {
82
+ return computed(() => {
83
+ const toReturn = {
84
+ [prefix]: true
85
+ };
86
+ const modifiersArray = typeof (modifiers == null ? void 0 : modifiers.value) === "string" ? modifiers.value.split(" ") : modifiers == null ? void 0 : modifiers.value;
87
+ if (modifiersArray) {
88
+ if (Array.isArray(modifiersArray)) {
89
+ modifiersArray.forEach((modifier) => {
90
+ if (modifier) {
91
+ toReturn[`${prefix}--${modifier}`] = true;
92
+ }
93
+ });
94
+ }
95
+ }
96
+ if (others) {
97
+ Object.keys(others.value).forEach((key) => {
98
+ toReturn[`${prefix}--${key}`] = unref(others.value[key]);
99
+ });
100
+ }
101
+ return toReturn;
102
+ });
103
+ }
104
+ const __default__$3 = {
105
+ name: "VvIcon"
106
+ };
107
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
108
+ ...__default__$3,
109
+ props: /* @__PURE__ */ mergeDefaults({
110
+ name: {},
111
+ color: {},
112
+ width: {},
113
+ height: {},
114
+ provider: {},
115
+ prefix: {},
116
+ src: {},
117
+ horizontalFlip: { type: Boolean },
118
+ verticalFlip: { type: Boolean },
119
+ flip: {},
120
+ mode: {},
121
+ inline: { type: Boolean },
122
+ rotate: {},
123
+ onLoad: { type: Function },
124
+ svg: {},
125
+ modifiers: {}
126
+ }, VvIconPropsDefaults),
127
+ setup(__props) {
128
+ const props = __props;
129
+ const hasRotate = computed(() => {
130
+ if (typeof props.rotate === "string") {
131
+ return parseFloat(props.rotate);
132
+ }
133
+ return props.rotate;
134
+ });
135
+ const show = ref(true);
136
+ const volver = useVolver();
137
+ const { modifiers } = toRefs(props);
138
+ const bemCssClasses = useModifiers("vv-icon", modifiers);
139
+ const provider = computed(() => {
140
+ return props.provider || (volver == null ? void 0 : volver.iconsProvider);
141
+ });
142
+ const icon = computed(() => {
143
+ const name = props.name ?? "";
144
+ const iconName = `@${provider.value}:${props.prefix}:${name}`;
145
+ if (iconExists(iconName)) {
146
+ return iconName;
147
+ }
148
+ const iconsCollection = volver == null ? void 0 : volver.iconsCollections.find(
149
+ (iconsCollection2) => {
150
+ const icon2 = `@${provider.value}:${iconsCollection2.prefix}:${name}`;
151
+ return iconExists(icon2);
152
+ }
153
+ );
154
+ if (iconsCollection) {
155
+ return `@${provider.value}:${iconsCollection.prefix}:${name}`;
156
+ }
157
+ return name;
158
+ });
159
+ function getSvgContent(svg) {
160
+ let dom;
161
+ if (typeof window === "undefined") {
162
+ const { JSDOM } = require("jsdom");
163
+ dom = new JSDOM().window;
164
+ }
165
+ const domParser = dom ? new dom.DOMParser() : new window.DOMParser();
166
+ const svgDomString = domParser.parseFromString(svg, "text/html");
167
+ const svgEl = svgDomString.querySelector("svg");
168
+ return svgEl;
169
+ }
170
+ function addIconFromSvg(svg) {
171
+ const svgContentEl = getSvgContent(svg);
172
+ const svgContent = (svgContentEl == null ? void 0 : svgContentEl.innerHTML.trim()) || "";
173
+ if (svgContentEl && svgContent) {
174
+ addIcon(`@${provider.value}:${props.prefix}:${props.name}`, {
175
+ body: svgContent,
176
+ // Set height and width from svg content
177
+ height: svgContentEl.viewBox.baseVal.height,
178
+ width: svgContentEl.viewBox.baseVal.width
179
+ });
180
+ }
181
+ }
182
+ if (volver) {
183
+ if (props.src && !iconExists(`@${provider.value}:${props.prefix}:${props.name}`)) {
184
+ show.value = false;
185
+ volver.fetchIcon(props.src).then((svg) => {
186
+ if (svg) {
187
+ addIconFromSvg(svg);
188
+ show.value = true;
189
+ }
190
+ }).catch((e) => {
191
+ throw new Error(`Error during fetch icon: ${e == null ? void 0 : e.message}`);
192
+ });
193
+ }
194
+ }
195
+ if (props.svg) {
196
+ addIconFromSvg(props.svg);
197
+ }
198
+ return (_ctx, _cache) => {
199
+ return unref(show) ? (openBlock(), createBlock(unref(Icon), mergeProps({
200
+ key: 0,
201
+ class: unref(bemCssClasses)
202
+ }, {
203
+ inline: _ctx.inline,
204
+ width: _ctx.width,
205
+ height: _ctx.height,
206
+ horizontalFlip: _ctx.horizontalFlip,
207
+ verticalFlip: _ctx.verticalFlip,
208
+ flip: _ctx.flip,
209
+ rotate: unref(hasRotate),
210
+ color: _ctx.color,
211
+ onLoad: _ctx.onLoad,
212
+ icon: unref(icon)
213
+ }), null, 16, ["class"])) : createCommentVNode("v-if", true);
214
+ };
215
+ }
216
+ });
217
+ const LinkProps = {
218
+ /**
219
+ * The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
220
+ * @see Documentation of [router-link](https://router.vuejs.org/api/#router-link) and [nuxt-link](https://nuxtjs.org/api/components-nuxt-link/)
221
+ */
222
+ to: {
223
+ type: [String, Object]
224
+ },
225
+ /**
226
+ * Anchor href
227
+ */
228
+ href: String,
229
+ /**
230
+ * Anchor target
231
+ */
232
+ target: String,
233
+ /**
234
+ * Anchor rel
235
+ */
236
+ rel: {
237
+ type: String,
238
+ default: "noopener noreferrer"
239
+ }
240
+ };
241
+ const ValidProps = {
242
+ /**
243
+ * Valid status
244
+ */
245
+ valid: { type: Boolean, default: false },
246
+ /**
247
+ * Valid label
248
+ */
249
+ validLabel: { type: [String, Array], default: void 0 }
250
+ };
251
+ const InvalidProps = {
252
+ /**
253
+ * Invalid status
254
+ */
255
+ invalid: {
256
+ type: Boolean,
257
+ default: false
258
+ },
259
+ /**
260
+ * Invalid label
261
+ */
262
+ invalidLabel: { type: [String, Array], default: void 0 }
263
+ };
264
+ const LoadingProps = {
265
+ /**
266
+ * Loading status
267
+ */
268
+ loading: {
269
+ type: Boolean,
270
+ default: false
271
+ },
272
+ /**
273
+ * Loading label
274
+ */
275
+ loadingLabel: {
276
+ type: String,
277
+ default: "Loading..."
278
+ }
279
+ };
280
+ const DisabledProps = {
281
+ /**
282
+ * Whether the form control is disabled
283
+ */
284
+ disabled: {
285
+ type: Boolean,
286
+ default: false
287
+ }
288
+ };
289
+ const ActiveProps = {
290
+ /**
291
+ * Whether the item is active
292
+ */
293
+ active: {
294
+ type: Boolean,
295
+ default: false
296
+ }
297
+ };
298
+ const CurrentProps = {
299
+ /**
300
+ * Whether the item is current
301
+ */
302
+ current: {
303
+ type: Boolean,
304
+ default: false
305
+ }
306
+ };
307
+ const PressedProps = {
308
+ /**
309
+ * Whether the item is pressed
310
+ */
311
+ pressed: {
312
+ type: Boolean,
313
+ default: false
314
+ }
315
+ };
316
+ const LabelProps = {
317
+ /**
318
+ * The item label
319
+ */
320
+ label: {
321
+ type: [String, Number],
322
+ default: void 0
323
+ }
324
+ };
325
+ const ReadonlyProps = {
326
+ /**
327
+ * The value is not editable
328
+ */
329
+ readonly: {
330
+ type: Boolean,
331
+ default: false
332
+ }
333
+ };
334
+ const ModifiersProps = {
335
+ /**
336
+ * Component BEM modifiers
337
+ */
338
+ modifiers: {
339
+ type: [String, Array],
340
+ default: void 0
341
+ }
342
+ };
343
+ const HintProps = {
344
+ hintLabel: { type: String, default: "" }
345
+ };
346
+ const IconProps = {
347
+ /**
348
+ * VvIcon name or props
349
+ * @see VVIcon
350
+ */
351
+ icon: {
352
+ type: [String, Object],
353
+ default: void 0
354
+ },
355
+ /**
356
+ * VvIcon position
357
+ */
358
+ iconPosition: {
359
+ type: String,
360
+ default: Position.before,
361
+ validation: (value) => Object.values(Position).includes(value)
362
+ }
363
+ };
364
+ const UnselectableProps = {
365
+ /**
366
+ * If true the input will be unselectable
367
+ */
368
+ unselectable: { type: Boolean, default: true }
369
+ };
370
+ const IdProps = {
371
+ /**
372
+ * Global attribute id
373
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
374
+ */
375
+ id: [String, Number]
376
+ };
377
+ ({
378
+ /**
379
+ * Dropdown placement
380
+ */
381
+ placement: {
382
+ type: String,
383
+ default: Side.bottom,
384
+ validator: (value) => Object.values(Side).includes(value) || Object.values(Placement).includes(value)
385
+ },
386
+ /**
387
+ * Dropdown strategy
388
+ */
389
+ strategy: {
390
+ type: String,
391
+ default: void 0,
392
+ validator: (value) => Object.values(Strategy).includes(value)
393
+ },
394
+ /**
395
+ * Dropdown show / hide transition name
396
+ */
397
+ transitionName: {
398
+ type: String,
399
+ default: void 0
400
+ },
401
+ /**
402
+ * Offset of the dropdown from the trigger
403
+ * @see https://floating-ui.com/docs/offset
404
+ */
405
+ offset: {
406
+ type: [Number, String, Object],
407
+ default: 0
408
+ },
409
+ /**
410
+ * Move dropdown to the side if there is no space in the default position
411
+ * @see https://floating-ui.com/docs/shift
412
+ */
413
+ shift: {
414
+ type: [Boolean, Object],
415
+ default: false
416
+ },
417
+ /**
418
+ * Flip dropdown position if there is no space in the default position
419
+ * @see https://floating-ui.com/docs/flip
420
+ */
421
+ flip: {
422
+ type: [Boolean, Object],
423
+ default: true
424
+ },
425
+ /**
426
+ * Size of the dropdown
427
+ * @see https://floating-ui.com/docs/size
428
+ */
429
+ size: {
430
+ type: [Boolean, Object],
431
+ default: () => ({ padding: 10 })
432
+ },
433
+ /**
434
+ * Automatically change the position of the dropdown
435
+ * @see https://floating-ui.com/docs/autoPlacement
436
+ */
437
+ autoPlacement: {
438
+ type: [Boolean, Object],
439
+ default: false
440
+ },
441
+ /**
442
+ * Add arrow to the dropdown
443
+ * @see https://floating-ui.com/docs/arrow
444
+ */
445
+ arrow: {
446
+ type: Boolean,
447
+ default: false
448
+ },
449
+ /**
450
+ * Keep open dropdown on click outside
451
+ */
452
+ keepOpen: {
453
+ type: Boolean,
454
+ default: false
455
+ },
456
+ /**
457
+ * Autofocus first item on dropdown open
458
+ */
459
+ autofocusFirst: {
460
+ type: Boolean,
461
+ default: true
462
+ },
463
+ /**
464
+ * Set dropdown width to the same as the trigger
465
+ */
466
+ triggerWidth: {
467
+ type: Boolean,
468
+ default: false
469
+ }
470
+ });
471
+ const IdNameProps = {
472
+ ...IdProps,
473
+ /**
474
+ * Input / Textarea name
475
+ * Name of the form control. Submitted with the form as part of a name/value pair
476
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name
477
+ */
478
+ name: { type: String, required: true }
479
+ };
480
+ const ActionProps = {
481
+ ...DisabledProps,
482
+ ...LabelProps,
483
+ ...PressedProps,
484
+ ...ActiveProps,
485
+ ...CurrentProps,
486
+ ...LinkProps,
487
+ /**
488
+ * Button type
489
+ */
490
+ type: {
491
+ type: String,
492
+ default: ButtonType.button,
493
+ validator: (value) => Object.values(ButtonType).includes(value)
494
+ },
495
+ /**
496
+ * Button aria-label
497
+ */
498
+ ariaLabel: {
499
+ type: String,
500
+ default: void 0
501
+ },
502
+ /**
503
+ * Default tag for the action
504
+ */
505
+ defaultTag: {
506
+ type: String,
507
+ default: ActionTag.button
508
+ }
509
+ };
510
+ ({
511
+ storageType: {
512
+ type: String,
513
+ default: StorageType.local,
514
+ validator: (value) => Object.values(StorageType).includes(value)
515
+ },
516
+ storageKey: String
517
+ });
518
+ const VvActionEvents = ["click", "mouseover", "mouseleave"];
519
+ const VvActionProps = ActionProps;
520
+ function useInjectedDropdownTrigger() {
521
+ return inject(INJECTION_KEY_DROPDOWN_TRIGGER, {});
522
+ }
523
+ function useInjectedDropdownAction() {
524
+ return inject(INJECTION_KEY_DROPDOWN_ACTION, {});
525
+ }
526
+ const __default__$2 = {
527
+ name: "VvAction"
528
+ };
529
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
530
+ ...__default__$2,
531
+ props: VvActionProps,
532
+ emits: VvActionEvents,
533
+ setup(__props, { expose: __expose, emit: __emit }) {
534
+ const props = __props;
535
+ const emit = __emit;
536
+ const instance = getCurrentInstance();
537
+ const volver = useVolver();
538
+ const element = ref(null);
539
+ __expose({ $el: element });
540
+ const {
541
+ reference: dropdownTriggerReference,
542
+ bus: dropdownEventBus,
543
+ aria: dropdownAria,
544
+ expanded: dropdownExpanded
545
+ } = useInjectedDropdownTrigger();
546
+ watch(
547
+ () => element.value,
548
+ (newValue) => {
549
+ if (dropdownTriggerReference) {
550
+ dropdownTriggerReference.value = newValue;
551
+ }
552
+ }
553
+ );
554
+ const pressed = computed(() => {
555
+ return props.pressed || (dropdownExpanded == null ? void 0 : dropdownExpanded.value);
556
+ });
557
+ const { role } = useInjectedDropdownAction();
558
+ const hasTag = computed(() => {
559
+ switch (true) {
560
+ case props.disabled:
561
+ return ActionTag.button;
562
+ case props.to !== void 0:
563
+ return (volver == null ? void 0 : volver.nuxt) ? ActionTag.nuxtLink : ActionTag.routerLink;
564
+ case props.href !== void 0:
565
+ return ActionTag.a;
566
+ default:
567
+ return props.defaultTag;
568
+ }
569
+ });
570
+ const hasProps = computed(() => {
571
+ const toReturn = {
572
+ ...dropdownAria == null ? void 0 : dropdownAria.value,
573
+ ariaPressed: pressed.value ? true : void 0,
574
+ ariaLabel: props.ariaLabel,
575
+ role: role == null ? void 0 : role.value
576
+ };
577
+ switch (hasTag.value) {
578
+ case ActionTag.a:
579
+ return {
580
+ ...toReturn,
581
+ href: props.href,
582
+ target: props.target,
583
+ rel: props.rel
584
+ };
585
+ case ActionTag.routerLink:
586
+ case ActionTag.nuxtLink:
587
+ return {
588
+ ...toReturn,
589
+ to: props.to,
590
+ target: props.target
591
+ };
592
+ case ActionTag.button:
593
+ return {
594
+ ...toReturn,
595
+ type: props.type,
596
+ disabled: props.disabled
597
+ };
598
+ default:
599
+ return toReturn;
600
+ }
601
+ });
602
+ const onClick = (e) => {
603
+ var _a;
604
+ if (props.disabled) {
605
+ e.preventDefault();
606
+ return;
607
+ }
608
+ if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onClick) {
609
+ emit("click", e);
610
+ return;
611
+ }
612
+ dropdownEventBus == null ? void 0 : dropdownEventBus.emit("click", e);
613
+ };
614
+ const onMouseover = (e) => {
615
+ var _a;
616
+ if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onMouseover) {
617
+ emit("mouseover", e);
618
+ return;
619
+ }
620
+ dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseover", e);
621
+ };
622
+ const onMouseleave = (e) => {
623
+ var _a;
624
+ if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onMouseleave) {
625
+ emit("mouseleave", e);
626
+ return;
627
+ }
628
+ dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseleave", e);
629
+ };
630
+ return (_ctx, _cache) => {
631
+ return openBlock(), createBlock(resolveDynamicComponent(unref(hasTag)), mergeProps(unref(hasProps), {
632
+ ref_key: "element",
633
+ ref: element,
634
+ class: {
635
+ active: _ctx.active,
636
+ pressed: unref(pressed),
637
+ disabled: _ctx.disabled,
638
+ current: _ctx.current
639
+ },
640
+ onClickPassive: onClick,
641
+ onMouseoverPassive: onMouseover,
642
+ onMouseleavePassive: onMouseleave
643
+ }), {
644
+ default: withCtx(() => [
645
+ renderSlot(_ctx.$slots, "default", {}, () => [
646
+ createTextVNode(
647
+ toDisplayString(_ctx.label),
648
+ 1
649
+ /* TEXT */
650
+ )
651
+ ])
652
+ ]),
653
+ _: 3
654
+ /* FORWARDED */
655
+ }, 16, ["class"]);
656
+ };
657
+ }
658
+ });
659
+ function useInjectedGroupState(groupKey) {
660
+ const group = inject(groupKey, void 0);
661
+ const isInGroup = computed(() => group !== void 0);
662
+ function getGroupOrLocalRef(propName, props, emit) {
663
+ const groupPropValue = group == null ? void 0 : group[propName];
664
+ if (groupPropValue) {
665
+ return computed({
666
+ get() {
667
+ return groupPropValue.value;
668
+ },
669
+ set(value) {
670
+ groupPropValue.value = value;
671
+ }
672
+ });
673
+ }
674
+ const propRef = toRef(props, propName);
675
+ return computed({
676
+ get() {
677
+ return propRef.value;
678
+ },
679
+ set(value) {
680
+ if (emit) {
681
+ emit(`update:${propName}`, value);
682
+ }
683
+ }
684
+ });
685
+ }
686
+ return {
687
+ group,
688
+ isInGroup,
689
+ getGroupOrLocalRef
690
+ };
691
+ }
692
+ const VvButtonEvents = ["update:modelValue"];
693
+ const VvButtonProps = {
694
+ ...ActionProps,
695
+ ...IdProps,
696
+ ...ModifiersProps,
697
+ ...UnselectableProps,
698
+ ...LoadingProps,
699
+ ...IconProps,
700
+ /**
701
+ * Button icon position
702
+ */
703
+ iconPosition: {
704
+ type: String,
705
+ default: Side.left,
706
+ validator: (value) => Object.values(Side).includes(value)
707
+ },
708
+ /**
709
+ * Loading icon
710
+ */
711
+ loadingIcon: { type: String, default: "eos-icons:bubble-loading" },
712
+ /**
713
+ * Enable button toggle
714
+ */
715
+ toggle: {
716
+ type: Boolean,
717
+ default: false
718
+ },
719
+ /**
720
+ * Button toggle value
721
+ */
722
+ value: {
723
+ type: [String, Number, Boolean],
724
+ default: void 0
725
+ },
726
+ /**
727
+ * Value associated with the unchecked state
728
+ */
729
+ uncheckedValue: {
730
+ type: [String, Number, Boolean],
731
+ default: void 0
732
+ },
733
+ /**
734
+ * Button toggle model value
735
+ */
736
+ modelValue: {
737
+ type: [String, Number, Boolean],
738
+ default: void 0
739
+ }
740
+ };
741
+ function useGroupProps(props, emit) {
742
+ const { group, isInGroup, getGroupOrLocalRef } = useInjectedGroupState(INJECTION_KEY_BUTTON_GROUP);
743
+ const { id, iconPosition, icon, label, pressed } = toRefs(props);
744
+ const modelValue = getGroupOrLocalRef("modelValue", props, emit);
745
+ const toggle = getGroupOrLocalRef("toggle", props);
746
+ const unselectable = getGroupOrLocalRef("unselectable", props);
747
+ const multiple = computed(() => (group == null ? void 0 : group.multiple.value) ?? false);
748
+ const modifiers = computed(() => {
749
+ let localModifiers = props.modifiers;
750
+ let groupModifiers = group == null ? void 0 : group.modifiers.value;
751
+ const toReturn = /* @__PURE__ */ new Set();
752
+ if (localModifiers) {
753
+ if (!Array.isArray(localModifiers)) {
754
+ localModifiers = localModifiers.split(" ");
755
+ }
756
+ localModifiers.forEach((modifier) => toReturn.add(modifier));
757
+ }
758
+ if (groupModifiers) {
759
+ if (!Array.isArray(groupModifiers)) {
760
+ groupModifiers = groupModifiers.split(" ");
761
+ }
762
+ groupModifiers.forEach((modifier) => toReturn.add(modifier));
763
+ }
764
+ return Array.from(toReturn);
765
+ });
766
+ const disabled = computed(
767
+ () => Boolean(props.disabled || (group == null ? void 0 : group.disabled.value))
768
+ );
769
+ return {
770
+ // group props
771
+ group,
772
+ isInGroup,
773
+ modelValue,
774
+ toggle,
775
+ unselectable,
776
+ multiple,
777
+ modifiers,
778
+ disabled,
779
+ // local props
780
+ id,
781
+ pressed,
782
+ iconPosition,
783
+ icon,
784
+ label
785
+ };
786
+ }
787
+ const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || uid()));
788
+ function equals(obj1, obj2, field) {
789
+ if (field) {
790
+ return resolveFieldData(obj1, field) === resolveFieldData(obj2, field);
791
+ }
792
+ return deepEquals(obj1, obj2);
793
+ }
794
+ function deepEquals(a, b) {
795
+ if (a === b)
796
+ return true;
797
+ if (a && b && typeof a == "object" && typeof b == "object") {
798
+ const arrA = Array.isArray(a);
799
+ const arrB = Array.isArray(b);
800
+ let i, length, key;
801
+ if (arrA && arrB) {
802
+ length = a.length;
803
+ if (length != b.length)
804
+ return false;
805
+ for (i = length; i-- !== 0; )
806
+ if (!deepEquals(a[i], b[i]))
807
+ return false;
808
+ return true;
809
+ }
810
+ if (arrA != arrB)
811
+ return false;
812
+ const dateA = a instanceof Date, dateB = b instanceof Date;
813
+ if (dateA != dateB)
814
+ return false;
815
+ if (dateA && dateB)
816
+ return a.getTime() == b.getTime();
817
+ const regexpA = a instanceof RegExp, regexpB = b instanceof RegExp;
818
+ if (regexpA != regexpB)
819
+ return false;
820
+ if (regexpA && regexpB)
821
+ return a.toString() == b.toString();
822
+ const keys = Object.keys(a);
823
+ length = keys.length;
824
+ if (length !== Object.keys(b).length)
825
+ return false;
826
+ for (i = length; i-- !== 0; )
827
+ if (!Object.prototype.hasOwnProperty.call(b, keys[i]))
828
+ return false;
829
+ for (i = length; i-- !== 0; ) {
830
+ key = keys[i];
831
+ if (!deepEquals(a[key], b[key]))
832
+ return false;
833
+ }
834
+ return true;
835
+ }
836
+ return a !== a && b !== b;
837
+ }
838
+ function resolveFieldData(data, field) {
839
+ if (data && Object.keys(data).length && field) {
840
+ if (field.indexOf(".") === -1) {
841
+ return data[field];
842
+ } else {
843
+ const fields = field.split(".");
844
+ let value = data;
845
+ for (let i = 0, len = fields.length; i < len; ++i) {
846
+ if (data == null) {
847
+ return null;
848
+ }
849
+ value = value[fields[i]];
850
+ }
851
+ return value;
852
+ }
853
+ } else {
854
+ return null;
855
+ }
856
+ }
857
+ function contains(value, list) {
858
+ if (value != null && list && list.length) {
859
+ for (const val of list) {
860
+ if (equals(value, val)) {
861
+ return true;
862
+ }
863
+ }
864
+ }
865
+ return false;
866
+ }
867
+ function isString(value) {
868
+ return typeof value === "string" || value instanceof String;
869
+ }
870
+ function useComponentIcon(icon, iconPosition) {
871
+ const hasIcon = computed(() => {
872
+ if (typeof (icon == null ? void 0 : icon.value) === "string") {
873
+ return { name: icon == null ? void 0 : icon.value };
874
+ }
875
+ return icon == null ? void 0 : icon.value;
876
+ });
877
+ const hasIconBefore = computed(
878
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Position.before ? hasIcon.value : void 0
879
+ );
880
+ const hasIconAfter = computed(
881
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Position.after ? hasIcon.value : void 0
882
+ );
883
+ const hasIconLeft = computed(
884
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Side.left ? hasIcon.value : void 0
885
+ );
886
+ const hasIconRight = computed(
887
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Side.right ? hasIcon.value : void 0
888
+ );
889
+ const hasIconTop = computed(
890
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Side.top ? hasIcon.value : void 0
891
+ );
892
+ const hasIconBottom = computed(
893
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Side.bottom ? hasIcon.value : void 0
894
+ );
895
+ return {
896
+ hasIcon,
897
+ hasIconLeft,
898
+ hasIconRight,
899
+ hasIconTop,
900
+ hasIconBottom,
901
+ hasIconBefore,
902
+ hasIconAfter
903
+ };
904
+ }
905
+ const _hoisted_1$1 = {
906
+ key: 1,
907
+ class: "vv-button__label"
908
+ };
909
+ const _hoisted_2$1 = {
910
+ key: 1,
911
+ class: "vv-button__label"
912
+ };
913
+ const __default__$1 = {
914
+ name: "VvButton",
915
+ inheritAttrs: false
916
+ };
917
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
918
+ ...__default__$1,
919
+ props: VvButtonProps,
920
+ emits: VvButtonEvents,
921
+ setup(__props, { expose: __expose, emit: __emit }) {
922
+ const props = __props;
923
+ const attrs = useAttrs();
924
+ const slots = useSlots();
925
+ const emit = __emit;
926
+ const {
927
+ id,
928
+ modifiers,
929
+ iconPosition,
930
+ icon,
931
+ label,
932
+ modelValue,
933
+ disabled,
934
+ toggle,
935
+ unselectable
936
+ } = useGroupProps(props, emit);
937
+ const hasId = useUniqueId(id);
938
+ const name = computed(() => (attrs == null ? void 0 : attrs.name) || hasId.value);
939
+ const element = ref(null);
940
+ const $el = computed(() => {
941
+ var _a;
942
+ return (_a = element.value) == null ? void 0 : _a.$el;
943
+ });
944
+ __expose({ $el });
945
+ const pressed = computed(() => {
946
+ if (!toggle.value) {
947
+ return props.pressed;
948
+ }
949
+ if (Array.isArray(modelValue.value)) {
950
+ return contains(name.value, modelValue.value);
951
+ }
952
+ return equals(name.value, modelValue.value);
953
+ });
954
+ const bemCssClasses = useModifiers(
955
+ "vv-button",
956
+ modifiers,
957
+ computed(() => ({
958
+ reverse: [Side.right, Side.bottom].includes(
959
+ iconPosition.value
960
+ ),
961
+ column: [Side.top, Side.bottom].includes(
962
+ iconPosition.value
963
+ ),
964
+ "icon-only": Boolean(
965
+ (icon == null ? void 0 : icon.value) && !(label == null ? void 0 : label.value) && !slots.default
966
+ )
967
+ }))
968
+ );
969
+ const { hasIcon } = useComponentIcon(icon);
970
+ const toggleValue = computed(() => {
971
+ return props.value !== void 0 ? props.value : name.value;
972
+ });
973
+ const hasListeners = computed(() => {
974
+ if (!toggle.value) {
975
+ return void 0;
976
+ }
977
+ return {
978
+ onClick
979
+ };
980
+ });
981
+ const onClick = () => {
982
+ if (toggle.value) {
983
+ if (Array.isArray(modelValue.value)) {
984
+ if (contains(toggleValue.value, modelValue.value)) {
985
+ if (unselectable.value) {
986
+ modelValue.value = modelValue.value.filter(
987
+ (n) => n !== toggleValue.value
988
+ );
989
+ }
990
+ return;
991
+ }
992
+ modelValue.value.push(toggleValue.value);
993
+ return;
994
+ }
995
+ if (toggleValue.value === modelValue.value && unselectable.value) {
996
+ modelValue.value = props.uncheckedValue;
997
+ return;
998
+ }
999
+ modelValue.value = toggleValue.value;
1000
+ }
1001
+ };
1002
+ return (_ctx, _cache) => {
1003
+ return openBlock(), createBlock(_sfc_main$2, mergeProps({
1004
+ ...unref(attrs),
1005
+ ...unref(hasListeners),
1006
+ disabled: unref(disabled),
1007
+ pressed: unref(pressed),
1008
+ active: _ctx.active,
1009
+ type: _ctx.type,
1010
+ to: _ctx.to,
1011
+ href: _ctx.href,
1012
+ target: _ctx.target,
1013
+ rel: _ctx.rel,
1014
+ ariaLabel: _ctx.ariaLabel
1015
+ }, {
1016
+ id: unref(hasId),
1017
+ ref_key: "element",
1018
+ ref: element,
1019
+ class: unref(bemCssClasses)
1020
+ }), {
1021
+ default: withCtx(() => [
1022
+ renderSlot(_ctx.$slots, "default", {}, () => [
1023
+ _ctx.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }, () => [
1024
+ _ctx.loadingIcon ? (openBlock(), createBlock(_sfc_main$3, {
1025
+ key: 0,
1026
+ class: "vv-button__loading-icon",
1027
+ name: _ctx.loadingIcon
1028
+ }, null, 8, ["name"])) : createCommentVNode("v-if", true),
1029
+ _ctx.loadingLabel ? (openBlock(), createElementBlock(
1030
+ "span",
1031
+ _hoisted_1$1,
1032
+ toDisplayString(_ctx.loadingLabel),
1033
+ 1
1034
+ /* TEXT */
1035
+ )) : createCommentVNode("v-if", true)
1036
+ ]) : (openBlock(), createElementBlock(
1037
+ Fragment,
1038
+ { key: 1 },
1039
+ [
1040
+ renderSlot(_ctx.$slots, "before"),
1041
+ unref(hasIcon) ? (openBlock(), createBlock(
1042
+ _sfc_main$3,
1043
+ mergeProps({ key: 0 }, unref(hasIcon), { class: "vv-button__icon" }),
1044
+ null,
1045
+ 16
1046
+ /* FULL_PROPS */
1047
+ )) : createCommentVNode("v-if", true),
1048
+ unref(label) ? (openBlock(), createElementBlock("span", _hoisted_2$1, [
1049
+ renderSlot(_ctx.$slots, "label", {}, () => [
1050
+ createTextVNode(
1051
+ toDisplayString(unref(label)),
1052
+ 1
1053
+ /* TEXT */
1054
+ )
1055
+ ])
1056
+ ])) : createCommentVNode("v-if", true),
1057
+ renderSlot(_ctx.$slots, "after")
1058
+ ],
1059
+ 64
1060
+ /* STABLE_FRAGMENT */
1061
+ ))
1062
+ ])
1063
+ ]),
1064
+ _: 3
1065
+ /* FORWARDED */
1066
+ }, 16, ["id", "class"]);
1067
+ };
1068
+ }
1069
+ });
1070
+ function joinLines(items) {
1071
+ if (Array.isArray(items)) {
1072
+ return items.filter((item) => isString(item)).join(" ");
1073
+ }
1074
+ return items;
1075
+ }
1076
+ function HintSlotFactory(propsOrRef, slots) {
1077
+ const props = computed(() => {
1078
+ if (isRef(propsOrRef)) {
1079
+ return propsOrRef.value;
1080
+ }
1081
+ return propsOrRef;
1082
+ });
1083
+ const invalidLabel = computed(() => joinLines(props.value.invalidLabel));
1084
+ const validLabel = computed(() => joinLines(props.value.validLabel));
1085
+ const loadingLabel = computed(() => props.value.loadingLabel);
1086
+ const hintLabel = computed(() => props.value.hintLabel);
1087
+ const hasLoadingLabelOrSlot = computed(
1088
+ () => Boolean(props.value.loading && (slots.loading || loadingLabel.value))
1089
+ );
1090
+ const hasInvalidLabelOrSlot = computed(
1091
+ () => !hasLoadingLabelOrSlot.value && Boolean(
1092
+ props.value.invalid && (slots.invalid || invalidLabel.value)
1093
+ )
1094
+ );
1095
+ const hasValidLabelOrSlot = computed(
1096
+ () => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.value.valid && (slots.valid || validLabel.value))
1097
+ );
1098
+ const hasHintLabelOrSlot = computed(
1099
+ () => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && !hasValidLabelOrSlot.value && Boolean(slots.hint || hintLabel.value)
1100
+ );
1101
+ const isVisible = computed(
1102
+ () => hasInvalidLabelOrSlot.value || hasValidLabelOrSlot.value || hasLoadingLabelOrSlot.value || hasHintLabelOrSlot.value
1103
+ );
1104
+ const hintSlotScope = computed(() => ({
1105
+ modelValue: props.value.modelValue,
1106
+ valid: props.value.valid,
1107
+ invalid: props.value.invalid,
1108
+ loading: props.value.loading
1109
+ }));
1110
+ const HintSlot = defineComponent({
1111
+ name: "HintSlot",
1112
+ props: {
1113
+ tag: {
1114
+ type: String,
1115
+ default: "small"
1116
+ }
1117
+ },
1118
+ setup() {
1119
+ return {
1120
+ isVisible,
1121
+ invalidLabel,
1122
+ validLabel,
1123
+ loadingLabel,
1124
+ hintLabel,
1125
+ hasInvalidLabelOrSlot,
1126
+ hasValidLabelOrSlot,
1127
+ hasLoadingLabelOrSlot,
1128
+ hasHintLabelOrSlot
1129
+ };
1130
+ },
1131
+ render() {
1132
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1133
+ if (this.isVisible) {
1134
+ let role;
1135
+ if (this.hasInvalidLabelOrSlot) {
1136
+ role = "alert";
1137
+ }
1138
+ if (this.hasValidLabelOrSlot) {
1139
+ role = "status";
1140
+ }
1141
+ if (this.hasLoadingLabelOrSlot) {
1142
+ return h(
1143
+ this.tag,
1144
+ {
1145
+ role
1146
+ },
1147
+ ((_b = (_a = this.$slots).loading) == null ? void 0 : _b.call(_a)) ?? this.loadingLabel
1148
+ );
1149
+ }
1150
+ if (this.hasInvalidLabelOrSlot) {
1151
+ return h(
1152
+ this.tag,
1153
+ {
1154
+ role
1155
+ },
1156
+ ((_d = (_c = this.$slots).invalid) == null ? void 0 : _d.call(_c)) ?? this.$slots.invalid ?? this.invalidLabel
1157
+ );
1158
+ }
1159
+ if (this.hasValidLabelOrSlot) {
1160
+ return h(
1161
+ this.tag,
1162
+ {
1163
+ role
1164
+ },
1165
+ ((_f = (_e = this.$slots).valid) == null ? void 0 : _f.call(_e)) ?? this.validLabel
1166
+ );
1167
+ }
1168
+ return h(
1169
+ this.tag,
1170
+ {
1171
+ role
1172
+ },
1173
+ ((_h = (_g = this.$slots).hint) == null ? void 0 : _h.call(_g)) ?? this.$slots.hint ?? this.hintLabel
1174
+ );
1175
+ }
1176
+ return null;
1177
+ }
1178
+ });
1179
+ return {
1180
+ hasInvalidLabelOrSlot,
1181
+ hasHintLabelOrSlot,
1182
+ hasValidLabelOrSlot,
1183
+ hasLoadingLabelOrSlot,
1184
+ hintSlotScope,
1185
+ HintSlot
1186
+ };
1187
+ }
1188
+ const VvInputFileProps = {
1189
+ ...IdNameProps,
1190
+ ...ModifiersProps,
1191
+ ...ValidProps,
1192
+ ...InvalidProps,
1193
+ ...HintProps,
1194
+ ...LabelProps,
1195
+ ...LoadingProps,
1196
+ ...ReadonlyProps,
1197
+ ...IconProps,
1198
+ /**
1199
+ * Input value
1200
+ */
1201
+ modelValue: {
1202
+ type: Object
1203
+ },
1204
+ /**
1205
+ * Whether to show progress bar
1206
+ */
1207
+ progress: { type: [Number, String], default: void 0 },
1208
+ /**
1209
+ * Input
1210
+ * Text that appears in the form control when it has no value set
1211
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#placeholder
1212
+ */
1213
+ placeholder: { type: String, default: void 0 },
1214
+ /**
1215
+ * File types to accept
1216
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept
1217
+ */
1218
+ accept: { type: String, default: "*" },
1219
+ /**
1220
+ * Whether to allow multiple values
1221
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#multiple
1222
+ */
1223
+ multiple: { type: Boolean, default: false },
1224
+ /**
1225
+ * Front or rear camera
1226
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/capture
1227
+ */
1228
+ capture: {
1229
+ type: String,
1230
+ default: void 0,
1231
+ validation: (value) => {
1232
+ if (value === void 0) {
1233
+ return true;
1234
+ }
1235
+ return ["user", "environment"].includes(value);
1236
+ }
1237
+ },
1238
+ /**
1239
+ * Max number of files
1240
+ */
1241
+ max: { type: [Number, String], default: void 0 },
1242
+ /**
1243
+ * Show drop area
1244
+ */
1245
+ dropArea: { type: Boolean, default: false },
1246
+ /**
1247
+ * Enable sorting
1248
+ */
1249
+ sortable: { type: Boolean, default: false },
1250
+ /**
1251
+ * Label for add button
1252
+ */
1253
+ labelAdd: {
1254
+ type: String,
1255
+ default: "Add file"
1256
+ },
1257
+ /**
1258
+ * VvIcon name for add button
1259
+ * @see VVIcon
1260
+ */
1261
+ iconAdd: {
1262
+ type: [String, Object],
1263
+ default: ACTION_ICONS.add
1264
+ },
1265
+ /**
1266
+ * Label for replace button
1267
+ */
1268
+ labelReplace: {
1269
+ type: String,
1270
+ default: "Replace file"
1271
+ },
1272
+ /**
1273
+ * VvIcon name for replace button
1274
+ * @see VVIcon
1275
+ */
1276
+ iconReplace: {
1277
+ type: [String, Object],
1278
+ default: ACTION_ICONS.edit
1279
+ },
1280
+ /**
1281
+ * Label for download button
1282
+ */
1283
+ labelDownload: {
1284
+ type: String,
1285
+ default: "Downlaod file"
1286
+ },
1287
+ /**
1288
+ * VvIcon name for download button
1289
+ * @see VVIcon
1290
+ */
1291
+ iconDownload: {
1292
+ type: [String, Object],
1293
+ default: ACTION_ICONS.download
1294
+ },
1295
+ /**
1296
+ * Label for remove button
1297
+ */
1298
+ labelRemove: {
1299
+ type: String,
1300
+ default: "Remove file"
1301
+ }
1302
+ };
1303
+ function useDefaults(componentName, propsDefinition, props) {
1304
+ const volver = useVolver();
1305
+ const volverComponentDefaults = computed(() => {
1306
+ var _a;
1307
+ if (!volver || !((_a = volver.defaults.value) == null ? void 0 : _a[componentName])) {
1308
+ return void 0;
1309
+ }
1310
+ return volver.defaults.value[componentName];
1311
+ });
1312
+ return computed(() => {
1313
+ if (volverComponentDefaults.value === void 0) {
1314
+ return props;
1315
+ }
1316
+ const componentDefaults = volverComponentDefaults.value;
1317
+ const simplifiedPropsDefinition = propsDefinition;
1318
+ const simplifiedProps = props;
1319
+ return Object.keys(simplifiedPropsDefinition).reduce((acc, key) => {
1320
+ const propValue = simplifiedProps[key];
1321
+ acc[key] = propValue;
1322
+ if (key in componentDefaults) {
1323
+ if (Array.isArray(simplifiedPropsDefinition[key])) {
1324
+ const typeArray = simplifiedPropsDefinition[key];
1325
+ if (typeArray.length) {
1326
+ const typeFunction = typeArray[0];
1327
+ if (typeFunction === propValue) {
1328
+ acc[key] = componentDefaults[key];
1329
+ }
1330
+ }
1331
+ }
1332
+ if (typeof simplifiedPropsDefinition[key] === "function") {
1333
+ const typeFunction = simplifiedPropsDefinition[key];
1334
+ if (typeFunction() === propValue) {
1335
+ acc[key] = componentDefaults[key];
1336
+ }
1337
+ }
1338
+ if (typeof simplifiedPropsDefinition[key] === "object") {
1339
+ let defaultValue = simplifiedPropsDefinition[key].default;
1340
+ if (typeof defaultValue === "function") {
1341
+ defaultValue = defaultValue();
1342
+ }
1343
+ if (typeof defaultValue === "object") {
1344
+ if (JSON.stringify(defaultValue) === JSON.stringify(propValue)) {
1345
+ acc[key] = componentDefaults[key];
1346
+ }
1347
+ } else if (defaultValue === propValue) {
1348
+ acc[key] = componentDefaults[key];
1349
+ }
1350
+ }
1351
+ }
1352
+ return acc;
1353
+ }, {});
1354
+ });
1355
+ }
1356
+ const _hoisted_1 = ["for"];
1357
+ const _hoisted_2 = { class: "vv-input-file__preview" };
1358
+ const _hoisted_3 = ["src", "alt"];
1359
+ const _hoisted_4 = { class: "vv-input-file__wrapper" };
1360
+ const _hoisted_5 = ["id", "readonly", "placeholder", "aria-describedby", "aria-invalid", "aria-errormessage", "multiple", "accept", "capture", "name"];
1361
+ const _hoisted_6 = ["value"];
1362
+ const _hoisted_7 = ["onClick"];
1363
+ const _hoisted_8 = ["title", "onClick"];
1364
+ const _hoisted_9 = { class: "vv-input-file__item-name" };
1365
+ const _hoisted_10 = { class: "vv-input-file__item-info" };
1366
+ const _hoisted_11 = ["title", "onClick"];
1367
+ const __default__ = {
1368
+ name: "VvInputFile"
1369
+ };
1370
+ const _sfc_main = /* @__PURE__ */ defineComponent({
1371
+ ...__default__,
1372
+ props: VvInputFileProps,
1373
+ emits: ["update:modelValue"],
1374
+ setup(__props, { emit: __emit }) {
1375
+ const props = __props;
1376
+ const emit = __emit;
1377
+ const slots = useSlots();
1378
+ const propsDefaults = useDefaults(
1379
+ "VvInputFile",
1380
+ VvInputFileProps,
1381
+ props
1382
+ );
1383
+ const { modifiers, id, readonly, icon, iconPosition, iconDownload } = toRefs(props);
1384
+ const hasId = useUniqueId(id);
1385
+ const hasHintId = computed(() => `${hasId.value}-hint`);
1386
+ const hasProgress = computed(() => {
1387
+ if (!props.progress) {
1388
+ return false;
1389
+ }
1390
+ const progress = typeof props.progress === "string" ? parseInt(props.progress) : props.progress;
1391
+ return progress > 0 && progress < 100;
1392
+ });
1393
+ const { hasIconBefore, hasIconAfter } = useComponentIcon(icon, iconPosition);
1394
+ const { hasIcon: hasIconDownload } = useComponentIcon(iconDownload);
1395
+ const bemCssClasses = useModifiers(
1396
+ "vv-input-file",
1397
+ modifiers,
1398
+ computed(() => ({
1399
+ dragging: isDragging.value,
1400
+ loading: props.loading && !hasProgress.value,
1401
+ valid: props.valid === true,
1402
+ invalid: props.invalid === true,
1403
+ "icon-before": !!hasIconBefore.value,
1404
+ "icon-after": !!hasIconAfter.value,
1405
+ "drop-area": hasDropArea.value
1406
+ }))
1407
+ );
1408
+ const {
1409
+ HintSlot,
1410
+ hasHintLabelOrSlot,
1411
+ hasInvalidLabelOrSlot,
1412
+ hintSlotScope
1413
+ } = HintSlotFactory(propsDefaults, slots);
1414
+ const localModelValue = useVModel(props, "modelValue", emit);
1415
+ const files = computed({
1416
+ get: () => {
1417
+ var _a;
1418
+ if (!localModelValue.value || !Array.isArray(localModelValue.value) && !((_a = localModelValue.value) == null ? void 0 : _a.name)) {
1419
+ return [];
1420
+ }
1421
+ return Array.isArray(localModelValue.value) ? localModelValue.value : [localModelValue.value];
1422
+ },
1423
+ set: (value) => {
1424
+ if (isMultiple.value) {
1425
+ localModelValue.value = value;
1426
+ return;
1427
+ }
1428
+ localModelValue.value = value == null ? void 0 : value[0];
1429
+ }
1430
+ });
1431
+ const hasMax = computed(() => {
1432
+ return typeof props.max === "string" ? parseInt(props.max) : props.max;
1433
+ });
1434
+ const hasDropArea = computed(() => {
1435
+ return props.dropArea && !readonly.value;
1436
+ });
1437
+ const isMultiple = computed(() => {
1438
+ if (!props.multiple) {
1439
+ return false;
1440
+ }
1441
+ if (!hasMax.value) {
1442
+ return true;
1443
+ }
1444
+ return hasMax.value - files.value.length > 1;
1445
+ });
1446
+ const isDragging = ref(false);
1447
+ const inputEl = ref();
1448
+ const onDragenter = () => {
1449
+ isDragging.value = true;
1450
+ };
1451
+ const onDragleave = () => {
1452
+ isDragging.value = false;
1453
+ };
1454
+ const onDrop = (event) => {
1455
+ var _a, _b;
1456
+ if (!((_a = event.dataTransfer) == null ? void 0 : _a.files)) {
1457
+ return;
1458
+ }
1459
+ isDragging.value = false;
1460
+ addFiles((_b = event.dataTransfer) == null ? void 0 : _b.files);
1461
+ };
1462
+ const onChange = () => {
1463
+ var _a;
1464
+ if (!((_a = inputEl.value) == null ? void 0 : _a.files)) {
1465
+ return;
1466
+ }
1467
+ addFiles(inputEl.value.files);
1468
+ inputEl.value.value = "";
1469
+ };
1470
+ const addFiles = (uploadedFiles) => {
1471
+ if (!props.multiple) {
1472
+ if (Array.isArray(localModelValue.value)) {
1473
+ localModelValue.value = [...uploadedFiles];
1474
+ return;
1475
+ }
1476
+ localModelValue.value = uploadedFiles[0];
1477
+ return;
1478
+ }
1479
+ let toReturn = [];
1480
+ if (!Array.isArray(localModelValue.value) && localModelValue.value) {
1481
+ toReturn = [localModelValue.value];
1482
+ } else {
1483
+ toReturn = localModelValue.value && Array.isArray(localModelValue.value) ? [...localModelValue.value] : toReturn;
1484
+ }
1485
+ for (const file of uploadedFiles) {
1486
+ if (hasMax.value && toReturn.length >= hasMax.value) {
1487
+ break;
1488
+ }
1489
+ toReturn.push(file);
1490
+ }
1491
+ localModelValue.value = toReturn;
1492
+ selectedFileIndex.value = toReturn.length - 1;
1493
+ };
1494
+ const onClickDropArea = () => {
1495
+ if (!inputEl.value) {
1496
+ return;
1497
+ }
1498
+ if (!readonly.value) {
1499
+ inputEl.value.click();
1500
+ }
1501
+ };
1502
+ const onClickRemoveFile = (index) => {
1503
+ if (!Array.isArray(localModelValue.value)) {
1504
+ localModelValue.value = void 0;
1505
+ return;
1506
+ }
1507
+ if (selectedFileIndex.value === index) {
1508
+ selectedFileIndex.value = 0;
1509
+ }
1510
+ const toReturn = [...localModelValue.value];
1511
+ toReturn.splice(index, 1);
1512
+ localModelValue.value = toReturn;
1513
+ };
1514
+ const selectedFileIndex = ref(0);
1515
+ const PREVIEW_MIME_TYPES = ["image/jpeg", "image/png"];
1516
+ const previewSrc = computed(() => {
1517
+ if (files.value.length === 0) {
1518
+ return;
1519
+ }
1520
+ if (!files.value[selectedFileIndex.value]) {
1521
+ return void 0;
1522
+ }
1523
+ if (files.value[selectedFileIndex.value] instanceof File) {
1524
+ const currentFile2 = files.value[selectedFileIndex.value];
1525
+ if (!PREVIEW_MIME_TYPES.includes(currentFile2.type)) {
1526
+ return void 0;
1527
+ }
1528
+ return URL.createObjectURL(currentFile2);
1529
+ }
1530
+ const currentFile = files.value[selectedFileIndex.value];
1531
+ if (currentFile.thumbnailUrl) {
1532
+ return currentFile.thumbnailUrl;
1533
+ }
1534
+ if (!PREVIEW_MIME_TYPES.includes(currentFile.type)) {
1535
+ return void 0;
1536
+ }
1537
+ return currentFile.url;
1538
+ });
1539
+ watch(previewSrc, (_newValue, oldValue) => {
1540
+ if (oldValue) {
1541
+ URL.revokeObjectURL(oldValue);
1542
+ }
1543
+ });
1544
+ onBeforeUnmount(() => {
1545
+ if (previewSrc.value) {
1546
+ URL.revokeObjectURL(previewSrc.value);
1547
+ }
1548
+ });
1549
+ const sizeInKiB = (size) => {
1550
+ if (!size) {
1551
+ return;
1552
+ }
1553
+ return Math.floor(size / 1024);
1554
+ };
1555
+ const onClickDownloadFile = (file) => {
1556
+ const link = document.createElement("a");
1557
+ if (file instanceof File) {
1558
+ link.href = URL.createObjectURL(file);
1559
+ } else if (file.url) {
1560
+ link.href = file.url;
1561
+ }
1562
+ link.setAttribute("download", file.name);
1563
+ document.body.appendChild(link);
1564
+ link.click();
1565
+ document.body.removeChild(link);
1566
+ URL.revokeObjectURL(link.href);
1567
+ };
1568
+ const onClickSelectFile = (index) => {
1569
+ selectedFileIndex.value = index;
1570
+ };
1571
+ const dropdAreaActionLabel = computed(() => {
1572
+ if (files.value.length === 0 || isMultiple.value) {
1573
+ return props.labelAdd;
1574
+ }
1575
+ return props.labelReplace;
1576
+ });
1577
+ const dropAreaActionIcon = computed(() => {
1578
+ if (files.value.length === 0 || isMultiple.value) {
1579
+ return props.iconAdd;
1580
+ }
1581
+ return props.iconReplace;
1582
+ });
1583
+ const onSortEnd = ({ newIndex }) => {
1584
+ if (newIndex !== null) {
1585
+ selectedFileIndex.value = newIndex;
1586
+ }
1587
+ };
1588
+ return (_ctx, _cache) => {
1589
+ return openBlock(), createElementBlock(
1590
+ "div",
1591
+ {
1592
+ class: normalizeClass(unref(bemCssClasses))
1593
+ },
1594
+ [
1595
+ _ctx.label ? (openBlock(), createElementBlock("label", {
1596
+ key: 0,
1597
+ for: unref(hasId)
1598
+ }, toDisplayString(_ctx.label), 9, _hoisted_1)) : createCommentVNode("v-if", true),
1599
+ hasDropArea.value ? (openBlock(), createElementBlock(
1600
+ "div",
1601
+ {
1602
+ key: 1,
1603
+ class: "vv-input-file__drop-area",
1604
+ onDragenter: withModifiers(onDragenter, ["prevent", "stop"]),
1605
+ onDragleave: withModifiers(onDragleave, ["prevent", "stop"]),
1606
+ onDrop: withModifiers(onDrop, ["prevent", "stop"]),
1607
+ onDragover: _cache[0] || (_cache[0] = withModifiers(() => {
1608
+ }, ["prevent", "stop"])),
1609
+ onClick: withModifiers(onClickDropArea, ["stop"])
1610
+ },
1611
+ [
1612
+ renderSlot(_ctx.$slots, "drop-area", {}, () => [
1613
+ createElementVNode("picture", _hoisted_2, [
1614
+ previewSrc.value ? (openBlock(), createElementBlock("img", {
1615
+ key: 0,
1616
+ src: previewSrc.value,
1617
+ alt: files.value[selectedFileIndex.value].name
1618
+ }, null, 8, _hoisted_3)) : createCommentVNode("v-if", true)
1619
+ ]),
1620
+ !unref(readonly) ? (openBlock(), createBlock(_sfc_main$1, {
1621
+ key: 0,
1622
+ modifiers: "action",
1623
+ label: !previewSrc.value ? dropdAreaActionLabel.value : void 0,
1624
+ title: previewSrc.value ? dropdAreaActionLabel.value : void 0,
1625
+ class: normalizeClass({
1626
+ "vv-input-file__drop-area-action": previewSrc.value
1627
+ }),
1628
+ icon: dropAreaActionIcon.value,
1629
+ onClick: withModifiers(onClickDropArea, ["stop"])
1630
+ }, null, 8, ["label", "title", "class", "icon"])) : createCommentVNode("v-if", true)
1631
+ ])
1632
+ ],
1633
+ 32
1634
+ /* NEED_HYDRATION */
1635
+ )) : createCommentVNode("v-if", true),
1636
+ createElementVNode("div", _hoisted_4, [
1637
+ unref(hasIconBefore) ? (openBlock(), createBlock(
1638
+ _sfc_main$3,
1639
+ normalizeProps(mergeProps({ key: 0 }, unref(hasIconBefore))),
1640
+ null,
1641
+ 16
1642
+ /* FULL_PROPS */
1643
+ )) : createCommentVNode("v-if", true),
1644
+ createElementVNode("input", {
1645
+ id: unref(hasId),
1646
+ ref_key: "inputEl",
1647
+ ref: inputEl,
1648
+ type: "file",
1649
+ readonly: unref(readonly),
1650
+ placeholder: _ctx.placeholder,
1651
+ "aria-describedby": unref(hasHintLabelOrSlot) ? hasHintId.value : void 0,
1652
+ "aria-invalid": _ctx.invalid,
1653
+ "aria-errormessage": unref(hasInvalidLabelOrSlot) ? hasHintId.value : void 0,
1654
+ multiple: isMultiple.value,
1655
+ accept: _ctx.accept,
1656
+ capture: _ctx.capture,
1657
+ name: _ctx.name,
1658
+ onChange
1659
+ }, null, 40, _hoisted_5),
1660
+ hasProgress.value ? (openBlock(), createElementBlock("progress", {
1661
+ key: 1,
1662
+ class: "vv-input-file__progress",
1663
+ value: _ctx.progress,
1664
+ max: "100"
1665
+ }, toDisplayString(_ctx.progress) + "% ", 9, _hoisted_6)) : createCommentVNode("v-if", true),
1666
+ unref(hasIconAfter) ? (openBlock(), createBlock(
1667
+ _sfc_main$3,
1668
+ normalizeProps(mergeProps({ key: 2 }, unref(hasIconAfter))),
1669
+ null,
1670
+ 16
1671
+ /* FULL_PROPS */
1672
+ )) : createCommentVNode("v-if", true)
1673
+ ]),
1674
+ createVNode(unref(Sortable), {
1675
+ modelValue: files.value,
1676
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => files.value = $event),
1677
+ tag: "ul",
1678
+ class: "vv-input-file__list",
1679
+ "item-key": "name",
1680
+ move: () => _ctx.sortable,
1681
+ onEnd: onSortEnd
1682
+ }, {
1683
+ item: withCtx(({ element: file, index }) => [
1684
+ createElementVNode("li", {
1685
+ class: normalizeClass(["vv-input-file__item", {
1686
+ active: index === selectedFileIndex.value && hasDropArea.value && files.value.length > 1,
1687
+ "cursor-move": _ctx.sortable
1688
+ }]),
1689
+ onClick: withModifiers(($event) => onClickSelectFile(index), ["stop"])
1690
+ }, [
1691
+ unref(hasIconDownload) ? (openBlock(), createElementBlock("button", {
1692
+ key: 0,
1693
+ type: "button",
1694
+ class: "vv-input-file__item-action",
1695
+ title: _ctx.labelDownload,
1696
+ onClick: withModifiers(($event) => onClickDownloadFile(file), ["stop"])
1697
+ }, [
1698
+ createVNode(
1699
+ _sfc_main$3,
1700
+ normalizeProps(guardReactiveProps(unref(hasIconDownload))),
1701
+ null,
1702
+ 16
1703
+ /* FULL_PROPS */
1704
+ )
1705
+ ], 8, _hoisted_8)) : createCommentVNode("v-if", true),
1706
+ createElementVNode(
1707
+ "div",
1708
+ _hoisted_9,
1709
+ toDisplayString(file.name),
1710
+ 1
1711
+ /* TEXT */
1712
+ ),
1713
+ createElementVNode(
1714
+ "small",
1715
+ _hoisted_10,
1716
+ toDisplayString(sizeInKiB(file.size)) + " KB ",
1717
+ 1
1718
+ /* TEXT */
1719
+ ),
1720
+ !unref(readonly) ? (openBlock(), createElementBlock("button", {
1721
+ key: 1,
1722
+ type: "button",
1723
+ class: "vv-input-file__item-remove",
1724
+ title: _ctx.labelRemove,
1725
+ onClick: withModifiers(($event) => onClickRemoveFile(index), ["stop"])
1726
+ }, null, 8, _hoisted_11)) : createCommentVNode("v-if", true)
1727
+ ], 10, _hoisted_7)
1728
+ ]),
1729
+ _: 1
1730
+ /* STABLE */
1731
+ }, 8, ["modelValue", "move"]),
1732
+ createVNode(unref(HintSlot), {
1733
+ id: hasHintId.value,
1734
+ class: "vv-input-file__hint"
1735
+ }, createSlots({
1736
+ _: 2
1737
+ /* DYNAMIC */
1738
+ }, [
1739
+ _ctx.$slots.hint ? {
1740
+ name: "hint",
1741
+ fn: withCtx(() => [
1742
+ renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1743
+ ]),
1744
+ key: "0"
1745
+ } : void 0,
1746
+ _ctx.$slots.loading ? {
1747
+ name: "loading",
1748
+ fn: withCtx(() => [
1749
+ renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1750
+ ]),
1751
+ key: "1"
1752
+ } : void 0,
1753
+ _ctx.$slots.valid ? {
1754
+ name: "valid",
1755
+ fn: withCtx(() => [
1756
+ renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1757
+ ]),
1758
+ key: "2"
1759
+ } : void 0,
1760
+ _ctx.$slots.invalid ? {
1761
+ name: "invalid",
1762
+ fn: withCtx(() => [
1763
+ renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1764
+ ]),
1765
+ key: "3"
1766
+ } : void 0
1767
+ ]), 1032, ["id"])
1768
+ ],
1769
+ 2
1770
+ /* CLASS */
1771
+ );
1772
+ };
1773
+ }
1774
+ });
1775
+ export {
1776
+ _sfc_main as default
1777
+ };