@volverjs/ui-vue 0.0.10-beta.5 → 0.0.10-beta.50

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