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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (481) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +146 -49
  3. package/auto-imports.d.ts +7 -2
  4. package/bin/icons.cjs +1 -1
  5. package/bin/icons.js +27 -20
  6. package/dist/Volver.d.ts +11 -11
  7. package/dist/components/VvAccordion/VvAccordion.es.js +190 -101
  8. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  9. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +30 -8
  10. package/dist/components/VvAccordion/index.d.ts +8 -9
  11. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +450 -170
  12. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  13. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +58 -13
  14. package/dist/components/VvAccordionGroup/index.d.ts +14 -6
  15. package/dist/components/VvAction/VvAction.es.js +84 -33
  16. package/dist/components/VvAction/VvAction.umd.js +1 -1
  17. package/dist/components/VvAction/VvAction.vue.d.ts +57 -22
  18. package/dist/components/VvAction/index.d.ts +25 -9
  19. package/dist/components/VvAlert/VvAlert.es.js +228 -193
  20. package/dist/components/VvAlert/VvAlert.umd.js +1 -1
  21. package/dist/components/VvAlert/VvAlert.vue.d.ts +24 -14
  22. package/dist/components/VvAlert/index.d.ts +17 -9
  23. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +549 -485
  24. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
  25. package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +16 -9
  26. package/dist/components/VvAlertGroup/index.d.ts +7 -15
  27. package/dist/components/VvAvatar/VvAvatar.es.js +65 -22
  28. package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
  29. package/dist/components/VvAvatar/VvAvatar.vue.d.ts +12 -4
  30. package/dist/components/VvAvatar/index.d.ts +4 -1
  31. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +128 -49
  32. package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
  33. package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +10 -3
  34. package/dist/components/VvAvatarGroup/index.d.ts +4 -1
  35. package/dist/components/VvBadge/VvBadge.es.js +77 -28
  36. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  37. package/dist/components/VvBadge/VvBadge.vue.d.ts +12 -4
  38. package/dist/components/VvBadge/index.d.ts +4 -1
  39. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +276 -60
  40. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  41. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +27 -7
  42. package/dist/components/VvBreadcrumb/index.d.ts +6 -10
  43. package/dist/components/VvButton/VvButton.es.js +307 -262
  44. package/dist/components/VvButton/VvButton.umd.js +1 -1
  45. package/dist/components/VvButton/VvButton.vue.d.ts +94 -40
  46. package/dist/components/VvButton/index.d.ts +51 -29
  47. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +95 -40
  48. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  49. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +31 -11
  50. package/dist/components/VvButtonGroup/index.d.ts +11 -2
  51. package/dist/components/VvCard/VvCard.es.js +86 -36
  52. package/dist/components/VvCard/VvCard.umd.js +1 -1
  53. package/dist/components/VvCard/VvCard.vue.d.ts +12 -4
  54. package/dist/components/VvCard/index.d.ts +4 -1
  55. package/dist/components/VvCheckbox/VvCheckbox.es.js +315 -251
  56. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  57. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +106 -34
  58. package/dist/components/VvCheckbox/index.d.ts +47 -14
  59. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +238 -129
  60. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  61. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +101 -30
  62. package/dist/components/VvCheckboxGroup/index.d.ts +45 -12
  63. package/dist/components/VvCombobox/VvCombobox.es.js +1377 -1059
  64. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  65. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +606 -680
  66. package/dist/components/VvCombobox/index.d.ts +488 -26
  67. package/dist/components/VvDialog/VvDialog.es.js +180 -176
  68. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  69. package/dist/components/VvDialog/VvDialog.vue.d.ts +13 -4
  70. package/dist/components/VvDialog/index.d.ts +5 -0
  71. package/dist/components/VvDropdown/VvDropdown.es.js +165 -94
  72. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  73. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +111 -81
  74. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +66 -25
  75. package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +13 -1
  76. package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +12 -4
  77. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +35 -7
  78. package/dist/components/VvDropdown/index.d.ts +52 -10
  79. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +163 -53
  80. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  81. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +335 -8
  82. package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
  83. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +63 -20
  84. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
  85. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +188 -80
  86. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
  87. package/dist/components/VvIcon/VvIcon.es.js +24 -97
  88. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  89. package/dist/components/VvIcon/VvIcon.vue.d.ts +23 -66
  90. package/dist/components/VvIcon/index.d.ts +33 -48
  91. package/dist/components/VvInputFile/VvInputFile.es.js +1789 -0
  92. package/dist/components/VvInputFile/VvInputFile.umd.js +1 -0
  93. package/dist/components/VvInputFile/VvInputFile.vue.d.ts +391 -0
  94. package/dist/components/VvInputFile/index.d.ts +210 -0
  95. package/dist/components/VvInputText/VvInputClearAction.d.ts +7 -5
  96. package/dist/components/VvInputText/VvInputPasswordAction.d.ts +10 -8
  97. package/dist/components/VvInputText/VvInputStepAction.d.ts +2 -2
  98. package/dist/components/VvInputText/VvInputText.es.js +1489 -563
  99. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  100. package/dist/components/VvInputText/VvInputText.vue.d.ts +207 -57
  101. package/dist/components/VvInputText/index.d.ts +105 -30
  102. package/dist/components/VvNav/VvNav.es.js +160 -75
  103. package/dist/components/VvNav/VvNav.umd.js +1 -1
  104. package/dist/components/VvNav/VvNav.vue.d.ts +32 -9
  105. package/dist/components/VvNav/VvNavItem.vue.d.ts +1 -1
  106. package/dist/components/VvNav/VvNavSeparator.vue.d.ts +1 -1
  107. package/dist/components/VvNav/index.d.ts +5 -2
  108. package/dist/components/VvNavItem/VvNavItem.es.js +100 -39
  109. package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
  110. package/dist/components/VvProgress/VvProgress.es.js +73 -27
  111. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  112. package/dist/components/VvProgress/VvProgress.vue.d.ts +10 -3
  113. package/dist/components/VvProgress/index.d.ts +4 -1
  114. package/dist/components/VvRadio/VvRadio.es.js +313 -250
  115. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  116. package/dist/components/VvRadio/VvRadio.vue.d.ts +103 -31
  117. package/dist/components/VvRadio/index.d.ts +50 -17
  118. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +236 -128
  119. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  120. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +101 -30
  121. package/dist/components/VvRadioGroup/index.d.ts +45 -12
  122. package/dist/components/VvSelect/VvSelect.es.js +367 -300
  123. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  124. package/dist/components/VvSelect/VvSelect.vue.d.ts +232 -203
  125. package/dist/components/VvSelect/index.d.ts +195 -15
  126. package/dist/components/VvTab/VvTab.es.js +222 -97
  127. package/dist/components/VvTab/VvTab.umd.js +1 -1
  128. package/dist/components/VvTab/VvTab.vue.d.ts +31 -7
  129. package/dist/components/VvTab/index.d.ts +4 -1
  130. package/dist/components/VvTextarea/VvTextarea.es.js +258 -248
  131. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  132. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +156 -49
  133. package/dist/components/VvTextarea/index.d.ts +68 -19
  134. package/dist/components/VvTooltip/VvTooltip.es.js +83 -30
  135. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  136. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +13 -6
  137. package/dist/components/VvTooltip/index.d.ts +5 -2
  138. package/dist/components/common/HintSlot.d.ts +4 -5
  139. package/dist/components/index.d.ts +10 -0
  140. package/dist/components/index.es.js +4575 -2534
  141. package/dist/components/index.umd.js +1 -1
  142. package/dist/composables/alert/useAlert.d.ts +101 -6
  143. package/dist/composables/alert/useInjectAlert.d.ts +1 -6
  144. package/dist/composables/dropdown/useInjectDropdown.d.ts +3 -23
  145. package/dist/composables/dropdown/useProvideDropdown.d.ts +3 -4
  146. package/dist/composables/group/useInjectedGroupState.d.ts +4 -5
  147. package/dist/composables/group/useProvideGroupState.d.ts +3 -3
  148. package/dist/composables/index.d.ts +1 -0
  149. package/dist/composables/index.es.js +94 -5
  150. package/dist/composables/index.umd.js +1 -1
  151. package/dist/composables/useBlurhash.d.ts +7 -0
  152. package/dist/composables/useComponentFocus.d.ts +1 -1
  153. package/dist/composables/useComponentIcon.d.ts +9 -8
  154. package/dist/composables/useOptions.d.ts +4 -4
  155. package/dist/composables/usePersistence.d.ts +3 -0
  156. package/dist/composables/useUniqueId.d.ts +1 -1
  157. package/dist/composables/useVolver.d.ts +1 -1
  158. package/dist/constants.d.ts +34 -32
  159. package/dist/directives/index.d.ts +3 -5
  160. package/dist/directives/index.es.js +104 -45
  161. package/dist/directives/index.umd.js +1 -1
  162. package/dist/directives/v-contextmenu.es.js +1 -1
  163. package/dist/directives/v-contextmenu.umd.js +1 -1
  164. package/dist/directives/v-tooltip.es.js +101 -39
  165. package/dist/directives/v-tooltip.umd.js +1 -1
  166. package/dist/icons.es.js +267 -267
  167. package/dist/icons.umd.js +1 -1
  168. package/dist/index.d.ts +3 -1
  169. package/dist/index.es.js +92 -18
  170. package/dist/index.umd.js +1 -1
  171. package/dist/props/index.d.ts +272 -81
  172. package/dist/resolvers/unplugin.d.ts +6 -1
  173. package/dist/resolvers/unplugin.es.js +87 -10
  174. package/dist/resolvers/unplugin.umd.js +1 -1
  175. package/dist/stories/Accordion/Accordion.settings.d.ts +2 -57
  176. package/dist/stories/AccordionGroup/AccordionGroup.settings.d.ts +2 -66
  177. package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +2 -127
  178. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +1437 -495
  179. package/dist/stories/Alert/Alert.settings.d.ts +2 -109
  180. package/dist/stories/Alert/AlertModifiers.stories.d.ts +1 -1
  181. package/dist/stories/Alert/AlertSlots.stories.d.ts +1 -1
  182. package/dist/stories/AlertGroup/AlertGroup.settings.d.ts +2 -85
  183. package/dist/stories/AlertGroup/AlertGroupPosition.stories.d.ts +1 -1
  184. package/dist/stories/AlertGroup/AlertGroupSlots.stories.d.ts +1 -1
  185. package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +2 -2
  186. package/dist/stories/AvatarGroup/AvatarGroup.settings.d.ts +2 -38
  187. package/dist/stories/Badge/Badge.settings.d.ts +2 -26
  188. package/dist/stories/Badge/Badge.test.d.ts +1 -1
  189. package/dist/stories/Blurhash/BlurhashComposable.stories.d.ts +4 -0
  190. package/dist/stories/Breadcrumb/Breadcrumb.settings.d.ts +2 -18
  191. package/dist/stories/Breadcrumb/Breadcrumb.test.d.ts +1 -1
  192. package/dist/stories/Button/Button.settings.d.ts +2 -194
  193. package/dist/stories/ButtonGroup/ButtonGroup.settings.d.ts +2 -40
  194. package/dist/stories/Card/Card.settings.d.ts +2 -63
  195. package/dist/stories/Checkbox/Checkbox.settings.d.ts +2 -132
  196. package/dist/stories/CheckboxGroup/CheckboxGroup.settings.d.ts +1 -141
  197. package/dist/stories/Combobox/Combobox.settings.d.ts +2 -609
  198. package/dist/stories/Combobox/Combobox.stories.d.ts +1 -0
  199. package/dist/stories/Combobox/ComboboxMultiple.stories.d.ts +1 -0
  200. package/dist/stories/Dialog/Dialog.settings.d.ts +2 -47
  201. package/dist/stories/Dialog/DialogModifiers.stories.d.ts +8 -0
  202. package/dist/stories/Dropdown/Dropdown.settings.d.ts +2 -205
  203. package/dist/stories/Icon/Icon.settings.d.ts +3 -68
  204. package/dist/stories/InputFile/InputFile.settings.d.ts +6 -0
  205. package/dist/stories/InputFile/InputFile.stories.d.ts +12 -0
  206. package/dist/stories/InputFile/InputFileDropArea.stories.d.ts +9 -0
  207. package/dist/stories/InputFile/InputFileIconPosition.stories.d.ts +8 -0
  208. package/dist/stories/InputFile/InputFileSlots.stories.d.ts +7 -0
  209. package/dist/stories/InputText/InputText.settings.d.ts +2 -438
  210. package/dist/stories/Nav/Nav.settings.d.ts +2 -10
  211. package/dist/stories/Progress/Progress.settings.d.ts +2 -27
  212. package/dist/stories/Radio/Radio.settings.d.ts +1 -110
  213. package/dist/stories/RadioGroup/RadioGroup.settings.d.ts +1 -141
  214. package/dist/stories/Select/Select.settings.d.ts +2 -246
  215. package/dist/stories/Select/Select.stories.d.ts +1 -0
  216. package/dist/stories/Tab/Tab.settings.d.ts +2 -15
  217. package/dist/stories/Textarea/Textarea.settings.d.ts +2 -287
  218. package/dist/stories/argTypes.d.ts +27 -866
  219. package/dist/test/expect.d.ts +1 -1
  220. package/dist/test/options.d.ts +1 -1
  221. package/dist/test/sleep.d.ts +1 -1
  222. package/dist/types/alert.d.ts +9 -7
  223. package/dist/types/blurhash.d.ts +12 -0
  224. package/dist/types/generic.d.ts +1 -2
  225. package/dist/types/group.d.ts +37 -15
  226. package/dist/types/index.d.ts +7 -0
  227. package/dist/types/input-file.d.ts +16 -0
  228. package/dist/types/nav.d.ts +2 -2
  229. package/dist/utils/ObjectUtilities.d.ts +7 -8
  230. package/dist/workers/blurhash.d.ts +1 -0
  231. package/package.json +239 -246
  232. package/src/Volver.ts +245 -234
  233. package/src/assets/icons/detailed.json +1 -1
  234. package/src/assets/icons/normal.json +1 -1
  235. package/src/assets/icons/simple.json +1 -1
  236. package/src/components/VvAccordion/VvAccordion.vue +163 -100
  237. package/src/components/VvAccordion/index.ts +64 -79
  238. package/src/components/VvAccordionGroup/VvAccordionGroup.vue +223 -105
  239. package/src/components/VvAccordionGroup/index.ts +42 -42
  240. package/src/components/VvAction/VvAction.vue +144 -130
  241. package/src/components/VvAlert/VvAlert.vue +72 -70
  242. package/src/components/VvAlert/index.ts +149 -147
  243. package/src/components/VvAlertGroup/VvAlertGroup.vue +57 -56
  244. package/src/components/VvAlertGroup/index.ts +101 -117
  245. package/src/components/VvAvatar/VvAvatar.vue +20 -14
  246. package/src/components/VvAvatar/index.ts +5 -5
  247. package/src/components/VvAvatarGroup/VvAvatarGroup.vue +58 -53
  248. package/src/components/VvAvatarGroup/index.ts +21 -21
  249. package/src/components/VvBadge/VvBadge.vue +15 -14
  250. package/src/components/VvBadge/index.ts +2 -2
  251. package/src/components/VvBreadcrumb/VvBreadcrumb.vue +50 -48
  252. package/src/components/VvBreadcrumb/index.ts +3 -9
  253. package/src/components/VvButton/VvButton.vue +163 -152
  254. package/src/components/VvButton/index.ts +103 -110
  255. package/src/components/VvButtonGroup/VvButtonGroup.vue +72 -64
  256. package/src/components/VvButtonGroup/index.ts +22 -21
  257. package/src/components/VvCard/VvCard.vue +30 -30
  258. package/src/components/VvCard/index.ts +2 -2
  259. package/src/components/VvCheckbox/VvCheckbox.vue +185 -183
  260. package/src/components/VvCheckbox/index.ts +44 -44
  261. package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +88 -87
  262. package/src/components/VvCombobox/VvCombobox.vue +639 -619
  263. package/src/components/VvCombobox/index.ts +206 -164
  264. package/src/components/VvDialog/VvDialog.vue +141 -129
  265. package/src/components/VvDialog/index.ts +38 -36
  266. package/src/components/VvDropdown/VvDropdown.vue +466 -445
  267. package/src/components/VvDropdown/VvDropdownAction.vue +37 -39
  268. package/src/components/VvDropdown/VvDropdownItem.vue +30 -26
  269. package/src/components/VvDropdown/VvDropdownOptgroup.vue +13 -12
  270. package/src/components/VvDropdown/VvDropdownOption.vue +47 -64
  271. package/src/components/VvDropdown/index.ts +61 -27
  272. package/src/components/VvIcon/README.md +1 -1
  273. package/src/components/VvIcon/VvIcon.vue +133 -133
  274. package/src/components/VvIcon/index.ts +84 -97
  275. package/src/components/VvInputFile/VvInputFile.vue +402 -0
  276. package/src/components/VvInputFile/index.ts +141 -0
  277. package/src/components/VvInputText/VvInputClearAction.ts +51 -47
  278. package/src/components/VvInputText/VvInputPasswordAction.ts +66 -62
  279. package/src/components/VvInputText/VvInputStepAction.ts +43 -43
  280. package/src/components/VvInputText/VvInputText.vue +638 -516
  281. package/src/components/VvInputText/VvInputTextActions.ts +86 -86
  282. package/src/components/VvInputText/index.ts +200 -185
  283. package/src/components/VvNav/VvNav.vue +40 -36
  284. package/src/components/VvNav/VvNavItem.vue +12 -12
  285. package/src/components/VvNav/VvNavSeparator.vue +6 -6
  286. package/src/components/VvNav/index.ts +2 -2
  287. package/src/components/VvProgress/VvProgress.vue +27 -27
  288. package/src/components/VvProgress/index.ts +28 -28
  289. package/src/components/VvRadio/VvRadio.vue +115 -112
  290. package/src/components/VvRadio/index.ts +28 -28
  291. package/src/components/VvRadioGroup/VvRadioGroup.vue +91 -90
  292. package/src/components/VvSelect/VvSelect.vue +262 -241
  293. package/src/components/VvSelect/index.ts +88 -63
  294. package/src/components/VvTab/VvTab.vue +79 -69
  295. package/src/components/VvTab/index.ts +12 -12
  296. package/src/components/VvTextarea/VvTextarea.vue +218 -219
  297. package/src/components/VvTextarea/index.ts +35 -35
  298. package/src/components/VvTooltip/VvTooltip.vue +22 -16
  299. package/src/components/VvTooltip/index.ts +12 -12
  300. package/src/components/common/HintSlot.ts +149 -150
  301. package/src/components/index.ts +10 -0
  302. package/src/composables/alert/useAlert.ts +76 -73
  303. package/src/composables/alert/useInjectAlert.ts +1 -1
  304. package/src/composables/alert/useProvideAlert.ts +10 -10
  305. package/src/composables/dropdown/useInjectDropdown.ts +6 -6
  306. package/src/composables/dropdown/useProvideDropdown.ts +63 -63
  307. package/src/composables/group/useInjectedGroupState.ts +46 -42
  308. package/src/composables/group/useProvideGroupState.ts +9 -15
  309. package/src/composables/index.ts +1 -0
  310. package/src/composables/useBlurhash.ts +68 -0
  311. package/src/composables/useComponentFocus.ts +9 -9
  312. package/src/composables/useComponentIcon.ts +36 -35
  313. package/src/composables/useDebouncedInput.ts +25 -25
  314. package/src/composables/useDefaults.ts +77 -76
  315. package/src/composables/useModifiers.ts +29 -29
  316. package/src/composables/useOptions.ts +52 -43
  317. package/src/composables/usePersistence.ts +74 -0
  318. package/src/composables/useTextCount.ts +44 -44
  319. package/src/composables/useUniqueId.ts +3 -2
  320. package/src/composables/useVolver.ts +1 -1
  321. package/src/constants.ts +97 -82
  322. package/src/directives/index.ts +3 -6
  323. package/src/directives/v-contextmenu.ts +34 -34
  324. package/src/directives/v-tooltip.ts +18 -9
  325. package/src/index.ts +6 -4
  326. package/src/props/index.ts +457 -380
  327. package/src/resolvers/unplugin.ts +146 -136
  328. package/src/shims.d.ts +4 -5
  329. package/src/stories/Accordion/Accordion.settings.ts +51 -50
  330. package/src/stories/Accordion/Accordion.stories.ts +21 -21
  331. package/src/stories/Accordion/Accordion.test.ts +56 -54
  332. package/src/stories/Accordion/AccordionSlots.stories.ts +13 -13
  333. package/src/stories/AccordionGroup/AccordionGroup.settings.ts +70 -67
  334. package/src/stories/AccordionGroup/AccordionGroup.stories.ts +41 -39
  335. package/src/stories/AccordionGroup/AccordionGroup.test.ts +49 -45
  336. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.ts +35 -35
  337. package/src/stories/Alert/Alert.settings.ts +117 -116
  338. package/src/stories/Alert/Alert.stories.ts +30 -30
  339. package/src/stories/Alert/Alert.test.ts +78 -80
  340. package/src/stories/Alert/AlertModifiers.stories.ts +45 -45
  341. package/src/stories/Alert/AlertSlots.stories.ts +35 -35
  342. package/src/stories/AlertGroup/AlertGroup.settings.ts +107 -105
  343. package/src/stories/AlertGroup/AlertGroup.stories.ts +25 -25
  344. package/src/stories/AlertGroup/AlertGroup.test.ts +67 -69
  345. package/src/stories/AlertGroup/AlertGroupPosition.stories.ts +68 -68
  346. package/src/stories/AlertGroup/AlertGroupSlots.stories.ts +23 -23
  347. package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +58 -58
  348. package/src/stories/Avatar/Avatar.settings.ts +29 -29
  349. package/src/stories/Avatar/Avatar.stories.ts +23 -23
  350. package/src/stories/Avatar/Avatar.test.ts +22 -24
  351. package/src/stories/Avatar/AvatarBadge.stories.ts +15 -15
  352. package/src/stories/Avatar/AvatarModifiers.stories.ts +61 -61
  353. package/src/stories/Avatar/AvatarSlots.stories.ts +18 -18
  354. package/src/stories/AvatarGroup/AvatarGroup.settings.ts +54 -53
  355. package/src/stories/AvatarGroup/AvatarGroup.stories.ts +17 -17
  356. package/src/stories/AvatarGroup/AvatarGroup.test.ts +24 -26
  357. package/src/stories/AvatarGroup/AvatarGroupModifiers.stories.ts +15 -15
  358. package/src/stories/AvatarGroup/AvatarGroupSlotDefault.stories.ts +17 -17
  359. package/src/stories/Badge/Badge.settings.ts +21 -20
  360. package/src/stories/Badge/Badge.stories.ts +24 -24
  361. package/src/stories/Badge/Badge.test.ts +8 -8
  362. package/src/stories/Badge/BadgeSlots.stories.ts +10 -10
  363. package/src/stories/Blurhash/BlurhashComposable.stories.ts +196 -0
  364. package/src/stories/Breadcrumb/Breadcrumb.settings.ts +35 -34
  365. package/src/stories/Breadcrumb/Breadcrumb.stories.ts +23 -23
  366. package/src/stories/Breadcrumb/Breadcrumb.test.ts +44 -43
  367. package/src/stories/Breadcrumb/BreadcrumbSlots.stories.ts +17 -17
  368. package/src/stories/Button/Button.settings.ts +146 -150
  369. package/src/stories/Button/Button.stories.ts +19 -19
  370. package/src/stories/Button/Button.test.ts +41 -42
  371. package/src/stories/Button/ButtonIcon.stories.ts +42 -42
  372. package/src/stories/Button/ButtonLink.stories.ts +24 -24
  373. package/src/stories/Button/ButtonLoading.stories.ts +22 -22
  374. package/src/stories/Button/ButtonModifiers.stories.ts +91 -91
  375. package/src/stories/Button/ButtonSlots.stories.ts +47 -47
  376. package/src/stories/Button/ButtonState.stories.ts +23 -23
  377. package/src/stories/Button/ButtonToggle.stories.ts +30 -30
  378. package/src/stories/ButtonGroup/ButtonGroup.settings.ts +33 -24
  379. package/src/stories/ButtonGroup/ButtonGroup.stories.ts +20 -20
  380. package/src/stories/ButtonGroup/ButtonGroup.test.ts +23 -26
  381. package/src/stories/ButtonGroup/ButtonGroupModifiers.stories.ts +20 -20
  382. package/src/stories/ButtonGroup/ButtonGroupSlots.stories.ts +18 -18
  383. package/src/stories/ButtonGroup/ButtonGroupToggle.stories.ts +22 -22
  384. package/src/stories/Card/Card.settings.ts +49 -48
  385. package/src/stories/Card/Card.stories.ts +22 -22
  386. package/src/stories/Card/Card.test.ts +14 -16
  387. package/src/stories/Card/CardSlots.stories.ts +42 -42
  388. package/src/stories/Checkbox/Checkbox.settings.ts +36 -35
  389. package/src/stories/Checkbox/Checkbox.stories.ts +57 -57
  390. package/src/stories/Checkbox/Checkbox.test.ts +63 -66
  391. package/src/stories/Checkbox/CheckboxBinary.stories.ts +18 -18
  392. package/src/stories/Checkbox/CheckboxSlots.stories.ts +15 -15
  393. package/src/stories/CheckboxGroup/CheckboxGroup.settings.ts +9 -9
  394. package/src/stories/CheckboxGroup/CheckboxGroup.stories.ts +50 -50
  395. package/src/stories/CheckboxGroup/CheckboxGroup.test.ts +63 -67
  396. package/src/stories/CheckboxGroup/CheckboxGroupOptions.stories.ts +34 -34
  397. package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.ts +23 -23
  398. package/src/stories/Combobox/Combobox.settings.ts +407 -384
  399. package/src/stories/Combobox/Combobox.stories.ts +116 -107
  400. package/src/stories/Combobox/Combobox.test.ts +91 -91
  401. package/src/stories/Combobox/ComboboxIconPosition.stories.ts +25 -24
  402. package/src/stories/Combobox/ComboboxMultiple.stories.ts +32 -22
  403. package/src/stories/Combobox/ComboboxOptions.stories.ts +81 -84
  404. package/src/stories/Combobox/ComboboxSlots.stories.ts +56 -55
  405. package/src/stories/Dialog/Dialog.settings.ts +49 -40
  406. package/src/stories/Dialog/Dialog.stories.ts +28 -28
  407. package/src/stories/Dialog/Dialog.test.ts +49 -54
  408. package/src/stories/Dialog/DialogModifiers.stories.ts +42 -0
  409. package/src/stories/Dialog/DialogSlots.stories.ts +20 -20
  410. package/src/stories/Dropdown/Dropdown.settings.ts +63 -62
  411. package/src/stories/Dropdown/Dropdown.stories.ts +59 -59
  412. package/src/stories/Dropdown/Dropdown.test.ts +9 -13
  413. package/src/stories/Dropdown/DropdownContextmenuDirective.stories.ts +16 -16
  414. package/src/stories/Dropdown/DropdownMultilevel.stories.ts +18 -18
  415. package/src/stories/Dropdown/DropdownSlots.stories.ts +50 -50
  416. package/src/stories/Icon/Icon.settings.ts +66 -65
  417. package/src/stories/Icon/Icon.stories.ts +28 -29
  418. package/src/stories/Icon/IconsCollection.stories.ts +22 -22
  419. package/src/stories/InputFile/InputFile.settings.ts +37 -0
  420. package/src/stories/InputFile/InputFile.stories.ts +89 -0
  421. package/src/stories/InputFile/InputFileDropArea.stories.ts +56 -0
  422. package/src/stories/InputFile/InputFileIconPosition.stories.ts +43 -0
  423. package/src/stories/InputFile/InputFileSlots.stories.ts +33 -0
  424. package/src/stories/InputText/InputText.settings.ts +246 -244
  425. package/src/stories/InputText/InputText.stories.ts +67 -67
  426. package/src/stories/InputText/InputText.test.ts +118 -121
  427. package/src/stories/InputText/InputTextIconPosition.stories.ts +24 -24
  428. package/src/stories/InputText/InputTextLength.stories.ts +33 -33
  429. package/src/stories/InputText/InputTextMask.stories.ts +91 -91
  430. package/src/stories/InputText/InputTextMinMax.stories.ts +30 -30
  431. package/src/stories/InputText/InputTextSlots.stories.ts +20 -20
  432. package/src/stories/InputText/InputTextType.stories.ts +70 -70
  433. package/src/stories/Nav/Nav.settings.ts +27 -27
  434. package/src/stories/Nav/Nav.stories.ts +18 -18
  435. package/src/stories/Nav/Nav.test.ts +10 -12
  436. package/src/stories/Nav/NavModifiers.stories.ts +25 -25
  437. package/src/stories/Progress/Progress.settings.ts +24 -23
  438. package/src/stories/Progress/Progress.stories.ts +23 -23
  439. package/src/stories/Progress/Progress.test.ts +4 -4
  440. package/src/stories/Radio/Radio.settings.ts +9 -9
  441. package/src/stories/Radio/Radio.stories.ts +47 -47
  442. package/src/stories/Radio/Radio.test.ts +54 -57
  443. package/src/stories/Radio/RadioSlots.stories.ts +15 -15
  444. package/src/stories/RadioGroup/RadioGroup.settings.ts +9 -9
  445. package/src/stories/RadioGroup/RadioGroup.stories.ts +51 -52
  446. package/src/stories/RadioGroup/RadioGroup.test.ts +63 -67
  447. package/src/stories/RadioGroup/RadioGroupOptions.stories.ts +35 -35
  448. package/src/stories/RadioGroup/RadioGroupSlots.stories.ts +23 -23
  449. package/src/stories/Select/Select.settings.ts +71 -70
  450. package/src/stories/Select/Select.stories.ts +75 -66
  451. package/src/stories/Select/Select.test.ts +67 -70
  452. package/src/stories/Select/SelectIconPosition.stories.ts +27 -26
  453. package/src/stories/Select/SelectOptions.stories.ts +55 -55
  454. package/src/stories/Select/SelectSlots.stories.ts +21 -20
  455. package/src/stories/Tab/Tab.settings.ts +34 -34
  456. package/src/stories/Tab/Tab.stories.ts +17 -17
  457. package/src/stories/Tab/Tab.test.ts +17 -19
  458. package/src/stories/Textarea/Textarea.settings.ts +79 -77
  459. package/src/stories/Textarea/Textarea.stories.ts +63 -63
  460. package/src/stories/Textarea/Textarea.test.ts +70 -73
  461. package/src/stories/Textarea/TextareaLength.stories.ts +33 -33
  462. package/src/stories/Textarea/TextareaSlots.stories.ts +20 -20
  463. package/src/stories/Textarea/TextareatIconPosition.stories.ts +24 -24
  464. package/src/stories/Tooltip/Tooltip.settings.ts +16 -17
  465. package/src/stories/Tooltip/Tooltip.stories.ts +18 -18
  466. package/src/stories/Tooltip/Tooltip.test.ts +53 -54
  467. package/src/stories/Tooltip/TooltipDirective.stories.ts +37 -37
  468. package/src/stories/argTypes.ts +506 -505
  469. package/src/test/expect.ts +72 -77
  470. package/src/test/options.ts +17 -16
  471. package/src/test/sleep.ts +3 -2
  472. package/src/test/types.d.ts +11 -11
  473. package/src/types/alert.ts +21 -17
  474. package/src/types/blurhash.ts +21 -0
  475. package/src/types/generic.ts +2 -3
  476. package/src/types/group.ts +34 -26
  477. package/src/types/index.ts +7 -0
  478. package/src/types/input-file.ts +18 -0
  479. package/src/types/nav.ts +13 -14
  480. package/src/utils/ObjectUtilities.ts +192 -188
  481. package/src/workers/blurhash.ts +9 -0
@@ -0,0 +1,1789 @@
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 Sortable from "vuedraggable";
4
+ import { iconExists, Icon, addIcon } from "@iconify/vue";
5
+ import { uid } from "uid";
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 Number.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
+ function 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
+ function 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
+ function 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
+ function useUniqueId(id) {
788
+ return computed(() => String((id == null ? void 0 : id.value) || uid()));
789
+ }
790
+ function equals(obj1, obj2, field) {
791
+ if (field) {
792
+ return resolveFieldData(obj1, field) === resolveFieldData(obj2, field);
793
+ }
794
+ return deepEquals(obj1, obj2);
795
+ }
796
+ function deepEquals(a, b) {
797
+ if (a === b)
798
+ return true;
799
+ if (a && b && typeof a == "object" && typeof b == "object") {
800
+ const arrA = Array.isArray(a);
801
+ const arrB = Array.isArray(b);
802
+ let i, length, key;
803
+ if (arrA && arrB) {
804
+ length = a.length;
805
+ if (length !== b.length)
806
+ return false;
807
+ for (i = length; i-- !== 0; ) {
808
+ if (!deepEquals(a[i], b[i]))
809
+ return false;
810
+ }
811
+ return true;
812
+ }
813
+ if (arrA !== arrB)
814
+ return false;
815
+ const dateA = a instanceof Date;
816
+ const dateB = b instanceof Date;
817
+ if (dateA !== dateB)
818
+ return false;
819
+ if (dateA && dateB)
820
+ return a.getTime() === b.getTime();
821
+ const regexpA = a instanceof RegExp;
822
+ const regexpB = b instanceof RegExp;
823
+ if (regexpA !== regexpB)
824
+ return false;
825
+ if (regexpA && regexpB)
826
+ return a.toString() === b.toString();
827
+ const keys = Object.keys(a);
828
+ length = keys.length;
829
+ if (length !== Object.keys(b).length)
830
+ return false;
831
+ for (i = length; i-- !== 0; ) {
832
+ if (!Object.prototype.hasOwnProperty.call(b, keys[i]))
833
+ return false;
834
+ }
835
+ for (i = length; i-- !== 0; ) {
836
+ key = keys[i];
837
+ if (!deepEquals(a[key], b[key]))
838
+ return false;
839
+ }
840
+ return true;
841
+ }
842
+ return Number.isNaN(a) && Number.isNaN(b);
843
+ }
844
+ function resolveFieldData(data, field) {
845
+ if (data && Object.keys(data).length && field) {
846
+ if (!field.includes(".")) {
847
+ return data[field];
848
+ } else {
849
+ const fields = field.split(".");
850
+ let value = data;
851
+ for (let i = 0, len = fields.length; i < len; ++i) {
852
+ if (data == null) {
853
+ return null;
854
+ }
855
+ value = value[fields[i]];
856
+ }
857
+ return value;
858
+ }
859
+ } else {
860
+ return null;
861
+ }
862
+ }
863
+ function contains(value, list) {
864
+ if (value != null && list && list.length) {
865
+ for (const val of list) {
866
+ if (equals(value, val)) {
867
+ return true;
868
+ }
869
+ }
870
+ }
871
+ return false;
872
+ }
873
+ function isString(value) {
874
+ return typeof value === "string" || value instanceof String;
875
+ }
876
+ function useComponentIcon(icon, iconPosition) {
877
+ const hasIcon = computed(() => {
878
+ if (typeof (icon == null ? void 0 : icon.value) === "string") {
879
+ return { name: icon == null ? void 0 : icon.value };
880
+ }
881
+ return icon == null ? void 0 : icon.value;
882
+ });
883
+ const hasIconBefore = computed(
884
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Position.before ? hasIcon.value : void 0
885
+ );
886
+ const hasIconAfter = computed(
887
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Position.after ? hasIcon.value : void 0
888
+ );
889
+ const hasIconLeft = computed(
890
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Side.left ? hasIcon.value : void 0
891
+ );
892
+ const hasIconRight = computed(
893
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Side.right ? hasIcon.value : void 0
894
+ );
895
+ const hasIconTop = computed(
896
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Side.top ? hasIcon.value : void 0
897
+ );
898
+ const hasIconBottom = computed(
899
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Side.bottom ? hasIcon.value : void 0
900
+ );
901
+ return {
902
+ hasIcon,
903
+ hasIconLeft,
904
+ hasIconRight,
905
+ hasIconTop,
906
+ hasIconBottom,
907
+ hasIconBefore,
908
+ hasIconAfter
909
+ };
910
+ }
911
+ const _hoisted_1$1 = {
912
+ key: 1,
913
+ class: "vv-button__label"
914
+ };
915
+ const _hoisted_2$1 = {
916
+ key: 1,
917
+ class: "vv-button__label"
918
+ };
919
+ const __default__$1 = {
920
+ name: "VvButton",
921
+ inheritAttrs: false
922
+ };
923
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
924
+ ...__default__$1,
925
+ props: VvButtonProps,
926
+ emits: VvButtonEvents,
927
+ setup(__props, { expose: __expose, emit: __emit }) {
928
+ const props = __props;
929
+ const emit = __emit;
930
+ const attrs = useAttrs();
931
+ const slots = useSlots();
932
+ const {
933
+ id,
934
+ modifiers,
935
+ iconPosition,
936
+ icon,
937
+ label,
938
+ modelValue,
939
+ disabled,
940
+ toggle,
941
+ unselectable
942
+ } = useGroupProps(props, emit);
943
+ const hasId = useUniqueId(id);
944
+ const name = computed(() => (attrs == null ? void 0 : attrs.name) || hasId.value);
945
+ const element = ref(null);
946
+ const $el = computed(() => {
947
+ var _a;
948
+ return (_a = element.value) == null ? void 0 : _a.$el;
949
+ });
950
+ __expose({ $el });
951
+ const pressed = computed(() => {
952
+ if (!toggle.value) {
953
+ return props.pressed;
954
+ }
955
+ if (Array.isArray(modelValue.value)) {
956
+ return contains(name.value, modelValue.value);
957
+ }
958
+ return equals(name.value, modelValue.value);
959
+ });
960
+ const bemCssClasses = useModifiers(
961
+ "vv-button",
962
+ modifiers,
963
+ computed(() => ({
964
+ "reverse": [Side.right, Side.bottom].includes(
965
+ iconPosition.value
966
+ ),
967
+ "column": [Side.top, Side.bottom].includes(
968
+ iconPosition.value
969
+ ),
970
+ "icon-only": Boolean(
971
+ (icon == null ? void 0 : icon.value) && !(label == null ? void 0 : label.value) && !slots.default
972
+ )
973
+ }))
974
+ );
975
+ const { hasIcon } = useComponentIcon(icon);
976
+ const toggleValue = computed(() => {
977
+ return props.value !== void 0 ? props.value : name.value;
978
+ });
979
+ const hasListeners = computed(() => {
980
+ if (!toggle.value) {
981
+ return void 0;
982
+ }
983
+ return {
984
+ onClick
985
+ };
986
+ });
987
+ function onClick() {
988
+ if (toggle.value) {
989
+ if (Array.isArray(modelValue.value)) {
990
+ if (contains(toggleValue.value, modelValue.value)) {
991
+ if (unselectable.value) {
992
+ modelValue.value = modelValue.value.filter(
993
+ (n) => n !== toggleValue.value
994
+ );
995
+ }
996
+ return;
997
+ }
998
+ modelValue.value.push(toggleValue.value);
999
+ return;
1000
+ }
1001
+ if (toggleValue.value === modelValue.value && unselectable.value) {
1002
+ modelValue.value = props.uncheckedValue;
1003
+ return;
1004
+ }
1005
+ modelValue.value = toggleValue.value;
1006
+ }
1007
+ }
1008
+ return (_ctx, _cache) => {
1009
+ return openBlock(), createBlock(_sfc_main$2, mergeProps({
1010
+ ...unref(attrs),
1011
+ ...unref(hasListeners),
1012
+ disabled: unref(disabled),
1013
+ pressed: unref(pressed),
1014
+ active: _ctx.active,
1015
+ type: _ctx.type,
1016
+ to: _ctx.to,
1017
+ href: _ctx.href,
1018
+ target: _ctx.target,
1019
+ rel: _ctx.rel,
1020
+ ariaLabel: _ctx.ariaLabel
1021
+ }, {
1022
+ id: unref(hasId),
1023
+ ref_key: "element",
1024
+ ref: element,
1025
+ class: unref(bemCssClasses)
1026
+ }), {
1027
+ default: withCtx(() => [
1028
+ renderSlot(_ctx.$slots, "default", {}, () => [
1029
+ _ctx.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }, () => [
1030
+ _ctx.loadingIcon ? (openBlock(), createBlock(_sfc_main$3, {
1031
+ key: 0,
1032
+ class: "vv-button__loading-icon",
1033
+ name: _ctx.loadingIcon
1034
+ }, null, 8, ["name"])) : createCommentVNode("v-if", true),
1035
+ _ctx.loadingLabel ? (openBlock(), createElementBlock(
1036
+ "span",
1037
+ _hoisted_1$1,
1038
+ toDisplayString(_ctx.loadingLabel),
1039
+ 1
1040
+ /* TEXT */
1041
+ )) : createCommentVNode("v-if", true)
1042
+ ]) : (openBlock(), createElementBlock(
1043
+ Fragment,
1044
+ { key: 1 },
1045
+ [
1046
+ renderSlot(_ctx.$slots, "before"),
1047
+ unref(hasIcon) ? (openBlock(), createBlock(
1048
+ _sfc_main$3,
1049
+ mergeProps({ key: 0 }, unref(hasIcon), { class: "vv-button__icon" }),
1050
+ null,
1051
+ 16
1052
+ /* FULL_PROPS */
1053
+ )) : createCommentVNode("v-if", true),
1054
+ unref(label) ? (openBlock(), createElementBlock("span", _hoisted_2$1, [
1055
+ renderSlot(_ctx.$slots, "label", {}, () => [
1056
+ createTextVNode(
1057
+ toDisplayString(unref(label)),
1058
+ 1
1059
+ /* TEXT */
1060
+ )
1061
+ ])
1062
+ ])) : createCommentVNode("v-if", true),
1063
+ renderSlot(_ctx.$slots, "after")
1064
+ ],
1065
+ 64
1066
+ /* STABLE_FRAGMENT */
1067
+ ))
1068
+ ])
1069
+ ]),
1070
+ _: 3
1071
+ /* FORWARDED */
1072
+ }, 16, ["id", "class"]);
1073
+ };
1074
+ }
1075
+ });
1076
+ function joinLines(items) {
1077
+ if (Array.isArray(items)) {
1078
+ return items.filter((item) => isString(item)).join(" ");
1079
+ }
1080
+ return items;
1081
+ }
1082
+ function HintSlotFactory(propsOrRef, slots) {
1083
+ const props = computed(() => {
1084
+ if (isRef(propsOrRef)) {
1085
+ return propsOrRef.value;
1086
+ }
1087
+ return propsOrRef;
1088
+ });
1089
+ const invalidLabel = computed(() => joinLines(props.value.invalidLabel));
1090
+ const validLabel = computed(() => joinLines(props.value.validLabel));
1091
+ const loadingLabel = computed(() => props.value.loadingLabel);
1092
+ const hintLabel = computed(() => props.value.hintLabel);
1093
+ const hasLoadingLabelOrSlot = computed(
1094
+ () => Boolean(props.value.loading && (slots.loading || loadingLabel.value))
1095
+ );
1096
+ const hasInvalidLabelOrSlot = computed(
1097
+ () => !hasLoadingLabelOrSlot.value && Boolean(
1098
+ props.value.invalid && (slots.invalid || invalidLabel.value)
1099
+ )
1100
+ );
1101
+ const hasValidLabelOrSlot = computed(
1102
+ () => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.value.valid && (slots.valid || validLabel.value))
1103
+ );
1104
+ const hasHintLabelOrSlot = computed(
1105
+ () => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && !hasValidLabelOrSlot.value && Boolean(slots.hint || hintLabel.value)
1106
+ );
1107
+ const isVisible = computed(
1108
+ () => hasInvalidLabelOrSlot.value || hasValidLabelOrSlot.value || hasLoadingLabelOrSlot.value || hasHintLabelOrSlot.value
1109
+ );
1110
+ const hintSlotScope = computed(() => ({
1111
+ modelValue: props.value.modelValue,
1112
+ valid: props.value.valid,
1113
+ invalid: props.value.invalid,
1114
+ loading: props.value.loading
1115
+ }));
1116
+ const HintSlot = defineComponent({
1117
+ name: "HintSlot",
1118
+ props: {
1119
+ tag: {
1120
+ type: String,
1121
+ default: "small"
1122
+ }
1123
+ },
1124
+ setup() {
1125
+ return {
1126
+ isVisible,
1127
+ invalidLabel,
1128
+ validLabel,
1129
+ loadingLabel,
1130
+ hintLabel,
1131
+ hasInvalidLabelOrSlot,
1132
+ hasValidLabelOrSlot,
1133
+ hasLoadingLabelOrSlot,
1134
+ hasHintLabelOrSlot
1135
+ };
1136
+ },
1137
+ render() {
1138
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1139
+ if (this.isVisible) {
1140
+ let role;
1141
+ if (this.hasInvalidLabelOrSlot) {
1142
+ role = "alert";
1143
+ }
1144
+ if (this.hasValidLabelOrSlot) {
1145
+ role = "status";
1146
+ }
1147
+ if (this.hasLoadingLabelOrSlot) {
1148
+ return h(
1149
+ this.tag,
1150
+ {
1151
+ role
1152
+ },
1153
+ ((_b = (_a = this.$slots).loading) == null ? void 0 : _b.call(_a)) ?? this.loadingLabel
1154
+ );
1155
+ }
1156
+ if (this.hasInvalidLabelOrSlot) {
1157
+ return h(
1158
+ this.tag,
1159
+ {
1160
+ role
1161
+ },
1162
+ ((_d = (_c = this.$slots).invalid) == null ? void 0 : _d.call(_c)) ?? this.$slots.invalid ?? this.invalidLabel
1163
+ );
1164
+ }
1165
+ if (this.hasValidLabelOrSlot) {
1166
+ return h(
1167
+ this.tag,
1168
+ {
1169
+ role
1170
+ },
1171
+ ((_f = (_e = this.$slots).valid) == null ? void 0 : _f.call(_e)) ?? this.validLabel
1172
+ );
1173
+ }
1174
+ return h(
1175
+ this.tag,
1176
+ {
1177
+ role
1178
+ },
1179
+ ((_h = (_g = this.$slots).hint) == null ? void 0 : _h.call(_g)) ?? this.$slots.hint ?? this.hintLabel
1180
+ );
1181
+ }
1182
+ return null;
1183
+ }
1184
+ });
1185
+ return {
1186
+ hasInvalidLabelOrSlot,
1187
+ hasHintLabelOrSlot,
1188
+ hasValidLabelOrSlot,
1189
+ hasLoadingLabelOrSlot,
1190
+ hintSlotScope,
1191
+ HintSlot
1192
+ };
1193
+ }
1194
+ const VvInputFileProps = {
1195
+ ...IdNameProps,
1196
+ ...ModifiersProps,
1197
+ ...ValidProps,
1198
+ ...InvalidProps,
1199
+ ...HintProps,
1200
+ ...LabelProps,
1201
+ ...LoadingProps,
1202
+ ...ReadonlyProps,
1203
+ ...IconProps,
1204
+ /**
1205
+ * Input value
1206
+ */
1207
+ modelValue: {
1208
+ type: Object
1209
+ },
1210
+ /**
1211
+ * Whether to show progress bar
1212
+ */
1213
+ progress: { type: [Number, String], default: void 0 },
1214
+ /**
1215
+ * Input
1216
+ * Text that appears in the form control when it has no value set
1217
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#placeholder
1218
+ */
1219
+ placeholder: { type: String, default: void 0 },
1220
+ /**
1221
+ * File types to accept
1222
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept
1223
+ */
1224
+ accept: { type: String, default: "*" },
1225
+ /**
1226
+ * Whether to allow multiple values
1227
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#multiple
1228
+ */
1229
+ multiple: { type: Boolean, default: false },
1230
+ /**
1231
+ * Front or rear camera
1232
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/capture
1233
+ */
1234
+ capture: {
1235
+ type: String,
1236
+ default: void 0,
1237
+ validation: (value) => {
1238
+ if (value === void 0) {
1239
+ return true;
1240
+ }
1241
+ return ["user", "environment"].includes(value);
1242
+ }
1243
+ },
1244
+ /**
1245
+ * Max number of files
1246
+ */
1247
+ max: { type: [Number, String], default: void 0 },
1248
+ /**
1249
+ * Show drop area
1250
+ */
1251
+ dropArea: { type: Boolean, default: false },
1252
+ /**
1253
+ * Enable sorting
1254
+ */
1255
+ sortable: { type: Boolean, default: false },
1256
+ /**
1257
+ * Label for add button
1258
+ */
1259
+ labelAdd: {
1260
+ type: String,
1261
+ default: "Add file"
1262
+ },
1263
+ /**
1264
+ * VvIcon name for add button
1265
+ * @see VVIcon
1266
+ */
1267
+ iconAdd: {
1268
+ type: [String, Object],
1269
+ default: ACTION_ICONS.add
1270
+ },
1271
+ /**
1272
+ * Label for replace button
1273
+ */
1274
+ labelReplace: {
1275
+ type: String,
1276
+ default: "Replace file"
1277
+ },
1278
+ /**
1279
+ * VvIcon name for replace button
1280
+ * @see VVIcon
1281
+ */
1282
+ iconReplace: {
1283
+ type: [String, Object],
1284
+ default: ACTION_ICONS.edit
1285
+ },
1286
+ /**
1287
+ * Label for download button
1288
+ */
1289
+ labelDownload: {
1290
+ type: String,
1291
+ default: "Downlaod file"
1292
+ },
1293
+ /**
1294
+ * VvIcon name for download button
1295
+ * @see VVIcon
1296
+ */
1297
+ iconDownload: {
1298
+ type: [String, Object],
1299
+ default: ACTION_ICONS.download
1300
+ },
1301
+ /**
1302
+ * Label for remove button
1303
+ */
1304
+ labelRemove: {
1305
+ type: String,
1306
+ default: "Remove file"
1307
+ }
1308
+ };
1309
+ function useDefaults(componentName, propsDefinition, props) {
1310
+ const volver = useVolver();
1311
+ const volverComponentDefaults = computed(() => {
1312
+ var _a;
1313
+ if (!volver || !((_a = volver.defaults.value) == null ? void 0 : _a[componentName])) {
1314
+ return void 0;
1315
+ }
1316
+ return volver.defaults.value[componentName];
1317
+ });
1318
+ return computed(() => {
1319
+ if (volverComponentDefaults.value === void 0) {
1320
+ return props;
1321
+ }
1322
+ const componentDefaults = volverComponentDefaults.value;
1323
+ const simplifiedPropsDefinition = propsDefinition;
1324
+ const simplifiedProps = props;
1325
+ return Object.keys(simplifiedPropsDefinition).reduce((acc, key) => {
1326
+ const propValue = simplifiedProps[key];
1327
+ acc[key] = propValue;
1328
+ if (key in componentDefaults) {
1329
+ if (Array.isArray(simplifiedPropsDefinition[key])) {
1330
+ const typeArray = simplifiedPropsDefinition[key];
1331
+ if (typeArray.length) {
1332
+ const typeFunction = typeArray[0];
1333
+ if (typeFunction === propValue) {
1334
+ acc[key] = componentDefaults[key];
1335
+ }
1336
+ }
1337
+ }
1338
+ if (typeof simplifiedPropsDefinition[key] === "function") {
1339
+ const typeFunction = simplifiedPropsDefinition[key];
1340
+ if (typeFunction() === propValue) {
1341
+ acc[key] = componentDefaults[key];
1342
+ }
1343
+ }
1344
+ if (typeof simplifiedPropsDefinition[key] === "object") {
1345
+ let defaultValue = simplifiedPropsDefinition[key].default;
1346
+ if (typeof defaultValue === "function") {
1347
+ defaultValue = defaultValue();
1348
+ }
1349
+ if (typeof defaultValue === "object") {
1350
+ if (JSON.stringify(defaultValue) === JSON.stringify(propValue)) {
1351
+ acc[key] = componentDefaults[key];
1352
+ }
1353
+ } else if (defaultValue === propValue) {
1354
+ acc[key] = componentDefaults[key];
1355
+ }
1356
+ }
1357
+ }
1358
+ return acc;
1359
+ }, {});
1360
+ });
1361
+ }
1362
+ const _hoisted_1 = ["for"];
1363
+ const _hoisted_2 = { class: "vv-input-file__preview" };
1364
+ const _hoisted_3 = ["src", "alt"];
1365
+ const _hoisted_4 = { class: "vv-input-file__wrapper" };
1366
+ const _hoisted_5 = ["id", "readonly", "placeholder", "aria-describedby", "aria-invalid", "aria-errormessage", "multiple", "accept", "capture", "name"];
1367
+ const _hoisted_6 = ["value"];
1368
+ const _hoisted_7 = ["onClick"];
1369
+ const _hoisted_8 = ["title", "onClick"];
1370
+ const _hoisted_9 = { class: "vv-input-file__item-name" };
1371
+ const _hoisted_10 = { class: "vv-input-file__item-info" };
1372
+ const _hoisted_11 = ["title", "onClick"];
1373
+ const __default__ = {
1374
+ name: "VvInputFile"
1375
+ };
1376
+ const _sfc_main = /* @__PURE__ */ defineComponent({
1377
+ ...__default__,
1378
+ props: VvInputFileProps,
1379
+ emits: ["remove", "download", "update:modelValue"],
1380
+ setup(__props, { emit: __emit }) {
1381
+ const props = __props;
1382
+ const emit = __emit;
1383
+ const slots = useSlots();
1384
+ const propsDefaults = useDefaults(
1385
+ "VvInputFile",
1386
+ VvInputFileProps,
1387
+ props
1388
+ );
1389
+ const { modifiers, id, readonly, icon, iconPosition, iconDownload } = toRefs(props);
1390
+ const hasId = useUniqueId(id);
1391
+ const hasHintId = computed(() => `${hasId.value}-hint`);
1392
+ const hasProgress = computed(() => {
1393
+ if (!props.progress) {
1394
+ return false;
1395
+ }
1396
+ const progress = typeof props.progress === "string" ? Number.parseInt(props.progress) : props.progress;
1397
+ return progress > 0 && progress < 100;
1398
+ });
1399
+ const { hasIconBefore, hasIconAfter } = useComponentIcon(icon, iconPosition);
1400
+ const { hasIcon: hasIconDownload } = useComponentIcon(iconDownload);
1401
+ const bemCssClasses = useModifiers(
1402
+ "vv-input-file",
1403
+ modifiers,
1404
+ computed(() => ({
1405
+ "dragging": isDragging.value,
1406
+ "loading": props.loading && !hasProgress.value,
1407
+ "valid": props.valid === true,
1408
+ "invalid": props.invalid === true,
1409
+ "icon-before": !!hasIconBefore.value,
1410
+ "icon-after": !!hasIconAfter.value,
1411
+ "drop-area": hasDropArea.value
1412
+ }))
1413
+ );
1414
+ const {
1415
+ HintSlot,
1416
+ hasHintLabelOrSlot,
1417
+ hasInvalidLabelOrSlot,
1418
+ hintSlotScope
1419
+ } = HintSlotFactory(propsDefaults, slots);
1420
+ const localModelValue = useVModel(props, "modelValue", emit);
1421
+ const files = computed({
1422
+ get: () => {
1423
+ var _a;
1424
+ if (!localModelValue.value || !Array.isArray(localModelValue.value) && !((_a = localModelValue.value) == null ? void 0 : _a.name)) {
1425
+ return [];
1426
+ }
1427
+ return Array.isArray(localModelValue.value) ? localModelValue.value : [localModelValue.value];
1428
+ },
1429
+ set: (value) => {
1430
+ if (isMultiple.value) {
1431
+ localModelValue.value = value;
1432
+ return;
1433
+ }
1434
+ localModelValue.value = value == null ? void 0 : value[0];
1435
+ }
1436
+ });
1437
+ const hasMax = computed(() => {
1438
+ return typeof props.max === "string" ? Number.parseInt(props.max) : props.max;
1439
+ });
1440
+ const hasDropArea = computed(() => {
1441
+ return props.dropArea && !readonly.value;
1442
+ });
1443
+ const isMultiple = computed(() => {
1444
+ if (!props.multiple) {
1445
+ return false;
1446
+ }
1447
+ if (!hasMax.value) {
1448
+ return true;
1449
+ }
1450
+ return hasMax.value - files.value.length > 1;
1451
+ });
1452
+ const isDragging = ref(false);
1453
+ const inputEl = ref();
1454
+ function onDragenter() {
1455
+ isDragging.value = true;
1456
+ }
1457
+ function onDragleave() {
1458
+ isDragging.value = false;
1459
+ }
1460
+ function onDrop(event) {
1461
+ var _a, _b;
1462
+ if (!((_a = event.dataTransfer) == null ? void 0 : _a.files)) {
1463
+ return;
1464
+ }
1465
+ isDragging.value = false;
1466
+ addFiles((_b = event.dataTransfer) == null ? void 0 : _b.files);
1467
+ }
1468
+ function onChange() {
1469
+ var _a;
1470
+ if (!((_a = inputEl.value) == null ? void 0 : _a.files)) {
1471
+ return;
1472
+ }
1473
+ addFiles(inputEl.value.files);
1474
+ inputEl.value.value = "";
1475
+ }
1476
+ function addFiles(uploadedFiles) {
1477
+ if (!props.multiple) {
1478
+ if (Array.isArray(localModelValue.value)) {
1479
+ localModelValue.value = [...uploadedFiles];
1480
+ return;
1481
+ }
1482
+ localModelValue.value = uploadedFiles[0];
1483
+ return;
1484
+ }
1485
+ let toReturn = [];
1486
+ if (!Array.isArray(localModelValue.value) && localModelValue.value) {
1487
+ toReturn = [localModelValue.value];
1488
+ } else {
1489
+ toReturn = localModelValue.value && Array.isArray(localModelValue.value) ? [...localModelValue.value] : toReturn;
1490
+ }
1491
+ for (const file of uploadedFiles) {
1492
+ if (hasMax.value && toReturn.length >= hasMax.value) {
1493
+ break;
1494
+ }
1495
+ toReturn.push(file);
1496
+ }
1497
+ localModelValue.value = toReturn;
1498
+ selectedFileIndex.value = toReturn.length - 1;
1499
+ }
1500
+ function onClickDropArea() {
1501
+ if (!inputEl.value) {
1502
+ return;
1503
+ }
1504
+ if (!readonly.value) {
1505
+ inputEl.value.click();
1506
+ }
1507
+ }
1508
+ function onClickRemoveFile(index) {
1509
+ const toRemove = !Array.isArray(localModelValue.value) ? localModelValue.value : localModelValue.value[index];
1510
+ if (!toRemove) {
1511
+ return;
1512
+ }
1513
+ emit("remove", toRemove);
1514
+ if (!Array.isArray(localModelValue.value)) {
1515
+ localModelValue.value = void 0;
1516
+ return;
1517
+ }
1518
+ if (selectedFileIndex.value === index) {
1519
+ selectedFileIndex.value = 0;
1520
+ }
1521
+ const newModelValue = [...localModelValue.value];
1522
+ newModelValue.splice(index, 1);
1523
+ localModelValue.value = newModelValue;
1524
+ }
1525
+ const selectedFileIndex = ref(0);
1526
+ const PREVIEW_MIME_TYPES = ["image/jpeg", "image/png"];
1527
+ const previewSrc = computed(() => {
1528
+ if (files.value.length === 0) {
1529
+ return;
1530
+ }
1531
+ if (!files.value[selectedFileIndex.value]) {
1532
+ return void 0;
1533
+ }
1534
+ if (files.value[selectedFileIndex.value] instanceof File) {
1535
+ const currentFile2 = files.value[selectedFileIndex.value];
1536
+ if (!PREVIEW_MIME_TYPES.includes(currentFile2.type)) {
1537
+ return void 0;
1538
+ }
1539
+ return URL.createObjectURL(currentFile2);
1540
+ }
1541
+ const currentFile = files.value[selectedFileIndex.value];
1542
+ if (currentFile.thumbnailUrl) {
1543
+ return currentFile.thumbnailUrl;
1544
+ }
1545
+ if (!PREVIEW_MIME_TYPES.includes(currentFile.type)) {
1546
+ return void 0;
1547
+ }
1548
+ return currentFile.url;
1549
+ });
1550
+ watch(previewSrc, (_newValue, oldValue) => {
1551
+ if (oldValue) {
1552
+ URL.revokeObjectURL(oldValue);
1553
+ }
1554
+ });
1555
+ onBeforeUnmount(() => {
1556
+ if (previewSrc.value) {
1557
+ URL.revokeObjectURL(previewSrc.value);
1558
+ }
1559
+ });
1560
+ function sizeInKiB(size) {
1561
+ if (!size) {
1562
+ return;
1563
+ }
1564
+ return Math.floor(size / 1024);
1565
+ }
1566
+ function onClickDownloadFile(file) {
1567
+ emit("download", file);
1568
+ const href = file instanceof File ? URL.createObjectURL(file) : file.url;
1569
+ if (!href) {
1570
+ return;
1571
+ }
1572
+ const link = document.createElement("a");
1573
+ link.href = href;
1574
+ link.setAttribute("download", file.name);
1575
+ document.body.appendChild(link);
1576
+ link.click();
1577
+ document.body.removeChild(link);
1578
+ URL.revokeObjectURL(link.href);
1579
+ }
1580
+ function onClickSelectFile(index) {
1581
+ selectedFileIndex.value = index;
1582
+ }
1583
+ const dropdAreaActionLabel = computed(() => {
1584
+ if (files.value.length === 0 || isMultiple.value) {
1585
+ return props.labelAdd;
1586
+ }
1587
+ return props.labelReplace;
1588
+ });
1589
+ const dropAreaActionIcon = computed(() => {
1590
+ if (files.value.length === 0 || isMultiple.value) {
1591
+ return props.iconAdd;
1592
+ }
1593
+ return props.iconReplace;
1594
+ });
1595
+ function onSortEnd({ newIndex }) {
1596
+ if (newIndex !== null) {
1597
+ selectedFileIndex.value = newIndex;
1598
+ }
1599
+ }
1600
+ return (_ctx, _cache) => {
1601
+ return openBlock(), createElementBlock(
1602
+ "div",
1603
+ {
1604
+ class: normalizeClass(unref(bemCssClasses))
1605
+ },
1606
+ [
1607
+ _ctx.label ? (openBlock(), createElementBlock("label", {
1608
+ key: 0,
1609
+ for: unref(hasId)
1610
+ }, toDisplayString(_ctx.label), 9, _hoisted_1)) : createCommentVNode("v-if", true),
1611
+ hasDropArea.value ? (openBlock(), createElementBlock(
1612
+ "div",
1613
+ {
1614
+ key: 1,
1615
+ class: "vv-input-file__drop-area",
1616
+ onDragenter: withModifiers(onDragenter, ["prevent", "stop"]),
1617
+ onDragleave: withModifiers(onDragleave, ["prevent", "stop"]),
1618
+ onDrop: withModifiers(onDrop, ["prevent", "stop"]),
1619
+ onDragover: _cache[0] || (_cache[0] = withModifiers(() => {
1620
+ }, ["prevent", "stop"])),
1621
+ onClick: withModifiers(onClickDropArea, ["stop"])
1622
+ },
1623
+ [
1624
+ renderSlot(_ctx.$slots, "drop-area", {}, () => [
1625
+ createElementVNode("picture", _hoisted_2, [
1626
+ previewSrc.value ? (openBlock(), createElementBlock("img", {
1627
+ key: 0,
1628
+ src: previewSrc.value,
1629
+ alt: files.value[selectedFileIndex.value].name
1630
+ }, null, 8, _hoisted_3)) : createCommentVNode("v-if", true)
1631
+ ]),
1632
+ !unref(readonly) ? (openBlock(), createBlock(_sfc_main$1, {
1633
+ key: 0,
1634
+ modifiers: "action",
1635
+ label: !previewSrc.value ? dropdAreaActionLabel.value : void 0,
1636
+ title: previewSrc.value ? dropdAreaActionLabel.value : void 0,
1637
+ class: normalizeClass({
1638
+ "vv-input-file__drop-area-action": previewSrc.value
1639
+ }),
1640
+ icon: dropAreaActionIcon.value,
1641
+ onClick: withModifiers(onClickDropArea, ["stop"])
1642
+ }, null, 8, ["label", "title", "class", "icon"])) : createCommentVNode("v-if", true)
1643
+ ])
1644
+ ],
1645
+ 32
1646
+ /* NEED_HYDRATION */
1647
+ )) : createCommentVNode("v-if", true),
1648
+ createElementVNode("div", _hoisted_4, [
1649
+ unref(hasIconBefore) ? (openBlock(), createBlock(
1650
+ _sfc_main$3,
1651
+ normalizeProps(mergeProps({ key: 0 }, unref(hasIconBefore))),
1652
+ null,
1653
+ 16
1654
+ /* FULL_PROPS */
1655
+ )) : createCommentVNode("v-if", true),
1656
+ createElementVNode("input", {
1657
+ id: unref(hasId),
1658
+ ref_key: "inputEl",
1659
+ ref: inputEl,
1660
+ type: "file",
1661
+ readonly: unref(readonly),
1662
+ placeholder: _ctx.placeholder,
1663
+ "aria-describedby": unref(hasHintLabelOrSlot) ? hasHintId.value : void 0,
1664
+ "aria-invalid": _ctx.invalid,
1665
+ "aria-errormessage": unref(hasInvalidLabelOrSlot) ? hasHintId.value : void 0,
1666
+ multiple: isMultiple.value,
1667
+ accept: _ctx.accept,
1668
+ capture: _ctx.capture,
1669
+ name: _ctx.name,
1670
+ onChange
1671
+ }, null, 40, _hoisted_5),
1672
+ hasProgress.value ? (openBlock(), createElementBlock("progress", {
1673
+ key: 1,
1674
+ class: "vv-input-file__progress",
1675
+ value: _ctx.progress,
1676
+ max: "100"
1677
+ }, toDisplayString(_ctx.progress) + "% ", 9, _hoisted_6)) : createCommentVNode("v-if", true),
1678
+ unref(hasIconAfter) ? (openBlock(), createBlock(
1679
+ _sfc_main$3,
1680
+ normalizeProps(mergeProps({ key: 2 }, unref(hasIconAfter))),
1681
+ null,
1682
+ 16
1683
+ /* FULL_PROPS */
1684
+ )) : createCommentVNode("v-if", true)
1685
+ ]),
1686
+ createVNode(unref(Sortable), {
1687
+ modelValue: files.value,
1688
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => files.value = $event),
1689
+ tag: "ul",
1690
+ class: "vv-input-file__list",
1691
+ "item-key": "name",
1692
+ move: () => _ctx.sortable,
1693
+ onEnd: onSortEnd
1694
+ }, {
1695
+ item: withCtx(({ element: file, index }) => [
1696
+ createElementVNode("li", {
1697
+ class: normalizeClass(["vv-input-file__item", {
1698
+ "active": index === selectedFileIndex.value && hasDropArea.value && files.value.length > 1,
1699
+ "cursor-move": _ctx.sortable
1700
+ }]),
1701
+ onClick: withModifiers(($event) => onClickSelectFile(index), ["stop"])
1702
+ }, [
1703
+ unref(hasIconDownload) ? (openBlock(), createElementBlock("button", {
1704
+ key: 0,
1705
+ type: "button",
1706
+ class: "vv-input-file__item-action",
1707
+ title: _ctx.labelDownload,
1708
+ onClick: withModifiers(($event) => onClickDownloadFile(file), ["stop"])
1709
+ }, [
1710
+ createVNode(
1711
+ _sfc_main$3,
1712
+ normalizeProps(guardReactiveProps(unref(hasIconDownload))),
1713
+ null,
1714
+ 16
1715
+ /* FULL_PROPS */
1716
+ )
1717
+ ], 8, _hoisted_8)) : createCommentVNode("v-if", true),
1718
+ createElementVNode(
1719
+ "div",
1720
+ _hoisted_9,
1721
+ toDisplayString(file.name),
1722
+ 1
1723
+ /* TEXT */
1724
+ ),
1725
+ createElementVNode(
1726
+ "small",
1727
+ _hoisted_10,
1728
+ toDisplayString(sizeInKiB(file.size)) + " KB ",
1729
+ 1
1730
+ /* TEXT */
1731
+ ),
1732
+ !unref(readonly) ? (openBlock(), createElementBlock("button", {
1733
+ key: 1,
1734
+ type: "button",
1735
+ class: "vv-input-file__item-remove",
1736
+ title: _ctx.labelRemove,
1737
+ onClick: withModifiers(($event) => onClickRemoveFile(index), ["stop"])
1738
+ }, null, 8, _hoisted_11)) : createCommentVNode("v-if", true)
1739
+ ], 10, _hoisted_7)
1740
+ ]),
1741
+ _: 1
1742
+ /* STABLE */
1743
+ }, 8, ["modelValue", "move"]),
1744
+ createVNode(unref(HintSlot), {
1745
+ id: hasHintId.value,
1746
+ class: "vv-input-file__hint"
1747
+ }, createSlots({
1748
+ _: 2
1749
+ /* DYNAMIC */
1750
+ }, [
1751
+ _ctx.$slots.hint ? {
1752
+ name: "hint",
1753
+ fn: withCtx(() => [
1754
+ renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1755
+ ]),
1756
+ key: "0"
1757
+ } : void 0,
1758
+ _ctx.$slots.loading ? {
1759
+ name: "loading",
1760
+ fn: withCtx(() => [
1761
+ renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1762
+ ]),
1763
+ key: "1"
1764
+ } : void 0,
1765
+ _ctx.$slots.valid ? {
1766
+ name: "valid",
1767
+ fn: withCtx(() => [
1768
+ renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1769
+ ]),
1770
+ key: "2"
1771
+ } : void 0,
1772
+ _ctx.$slots.invalid ? {
1773
+ name: "invalid",
1774
+ fn: withCtx(() => [
1775
+ renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1776
+ ]),
1777
+ key: "3"
1778
+ } : void 0
1779
+ ]), 1032, ["id"])
1780
+ ],
1781
+ 2
1782
+ /* CLASS */
1783
+ );
1784
+ };
1785
+ }
1786
+ });
1787
+ export {
1788
+ _sfc_main as default
1789
+ };