@volverjs/ui-vue 0.0.13 → 0.0.15

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 (343) hide show
  1. package/dist/Volver.d.ts +121 -0
  2. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +68 -0
  3. package/dist/components/VvAccordion/index.d.ts +47 -0
  4. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +98 -0
  5. package/dist/components/VvAccordionGroup/index.d.ts +54 -0
  6. package/dist/components/VvAction/VvAction.es.js +26 -26
  7. package/dist/components/VvAction/VvAction.umd.js +1 -1
  8. package/dist/components/VvAction/VvAction.vue.d.ts +110 -0
  9. package/dist/components/VvAction/index.d.ts +2 -0
  10. package/dist/components/VvAlert/VvAlert.es.js +43 -44
  11. package/dist/components/VvAlert/VvAlert.umd.js +1 -1
  12. package/dist/components/VvAlert/VvAlert.vue.d.ts +124 -0
  13. package/dist/components/VvAlert/index.d.ts +104 -0
  14. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +54 -55
  15. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
  16. package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +97 -0
  17. package/dist/components/VvAlertGroup/index.d.ts +47 -0
  18. package/dist/components/VvAvatar/VvAvatar.vue.d.ts +24 -0
  19. package/dist/components/VvAvatar/index.d.ts +10 -0
  20. package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +50 -0
  21. package/dist/components/VvAvatarGroup/index.d.ts +28 -0
  22. package/dist/components/VvBadge/VvBadge.vue.d.ts +24 -0
  23. package/dist/components/VvBadge/index.d.ts +7 -0
  24. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +34 -34
  25. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  26. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +39 -0
  27. package/dist/components/VvBreadcrumb/index.d.ts +8 -0
  28. package/dist/components/VvButton/VvButton.es.js +186 -187
  29. package/dist/components/VvButton/VvButton.umd.js +1 -1
  30. package/dist/components/VvButton/VvButton.vue.d.ts +221 -0
  31. package/dist/components/VvButton/index.d.ts +131 -0
  32. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +84 -0
  33. package/dist/components/VvButtonGroup/index.d.ts +37 -0
  34. package/dist/components/VvCard/VvCard.vue.d.ts +30 -0
  35. package/dist/components/VvCard/index.d.ts +7 -0
  36. package/dist/components/VvCheckbox/VvCheckbox.es.js +215 -217
  37. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  38. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +187 -0
  39. package/dist/components/VvCheckbox/index.d.ts +94 -0
  40. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +235 -237
  41. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  42. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +212 -0
  43. package/dist/components/VvCheckboxGroup/index.d.ts +2 -0
  44. package/dist/components/VvCombobox/VvCombobox.es.js +810 -813
  45. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  46. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +346 -0
  47. package/dist/components/VvCombobox/index.d.ts +694 -0
  48. package/dist/components/VvDialog/VvDialog.vue.d.ts +73 -0
  49. package/dist/components/VvDialog/index.d.ts +45 -0
  50. package/dist/components/VvDropdown/VvDropdown.es.js +4 -4
  51. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  52. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +258 -0
  53. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +118 -0
  54. package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +22 -0
  55. package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +22 -0
  56. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +82 -0
  57. package/dist/components/VvDropdown/index.d.ts +120 -0
  58. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +50 -50
  59. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  60. package/dist/components/VvIcon/VvIcon.es.js +30 -31
  61. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  62. package/dist/components/VvIcon/VvIcon.vue.d.ts +6 -0
  63. package/dist/components/VvIcon/index.d.ts +86 -0
  64. package/dist/components/VvInputFile/VvInputFile.es.js +415 -418
  65. package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
  66. package/dist/components/VvInputFile/VvInputFile.vue.d.ts +361 -0
  67. package/dist/components/VvInputFile/index.d.ts +204 -0
  68. package/dist/components/VvInputText/VvInputText.es.js +595 -588
  69. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  70. package/dist/components/VvInputText/VvInputText.vue.d.ts +524 -0
  71. package/dist/components/VvInputText/VvInputTextActions.d.ts +4 -0
  72. package/dist/components/VvInputText/index.d.ts +313 -0
  73. package/dist/components/VvNav/VvNav.es.js +63 -63
  74. package/dist/components/VvNav/VvNav.umd.js +1 -1
  75. package/dist/components/VvNav/VvNav.vue.d.ts +48 -0
  76. package/dist/components/VvNav/VvNavItem.vue.d.ts +14 -0
  77. package/dist/components/VvNav/VvNavSeparator.vue.d.ts +3 -0
  78. package/dist/components/VvNav/index.d.ts +11 -0
  79. package/dist/components/VvNavItem/VvNavItem.es.js +41 -41
  80. package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
  81. package/dist/components/VvProgress/VvProgress.vue.d.ts +38 -0
  82. package/dist/components/VvProgress/index.d.ts +33 -0
  83. package/dist/components/VvRadio/VvRadio.es.js +222 -224
  84. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  85. package/dist/components/VvRadio/VvRadio.vue.d.ts +179 -0
  86. package/dist/components/VvRadio/index.d.ts +80 -0
  87. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +234 -236
  88. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  89. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +212 -0
  90. package/dist/components/VvRadioGroup/index.d.ts +2 -0
  91. package/dist/components/VvSelect/VvSelect.es.js +200 -203
  92. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  93. package/dist/components/VvSelect/VvSelect.vue.d.ts +183 -0
  94. package/dist/components/VvSelect/index.d.ts +298 -0
  95. package/dist/components/VvTab/VvTab.es.js +35 -35
  96. package/dist/components/VvTab/VvTab.umd.js +1 -1
  97. package/dist/components/VvTab/VvTab.vue.d.ts +64 -0
  98. package/dist/components/VvTab/index.d.ts +19 -0
  99. package/dist/components/VvTextarea/VvTextarea.es.js +341 -344
  100. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  101. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +384 -0
  102. package/dist/components/VvTextarea/index.d.ts +190 -0
  103. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +37 -0
  104. package/dist/components/VvTooltip/index.d.ts +19 -0
  105. package/dist/components/VvVirtualScroll/VvVirtualScroll.vue.d.ts +51 -0
  106. package/dist/components/common/HintSlot.d.ts +57 -0
  107. package/dist/components/common/VvInputClearAction.d.ts +52 -0
  108. package/dist/components/common/VvInputPasswordAction.d.ts +71 -0
  109. package/dist/components/common/VvInputStepAction.d.ts +50 -0
  110. package/dist/components/index.d.ts +34 -0
  111. package/dist/components/index.es.js +1965 -1958
  112. package/dist/components/index.umd.js +1 -1
  113. package/dist/composables/alert/useAlerInject.d.ts +4 -0
  114. package/dist/composables/alert/useAlert.d.ts +92 -0
  115. package/dist/composables/alert/useAlertProvide.d.ts +10 -0
  116. package/dist/composables/dropdown/useDropdownContextmenu.d.ts +18 -0
  117. package/dist/composables/dropdown/useDropdownInject.d.ts +12 -0
  118. package/dist/composables/dropdown/useDropdownProvide.d.ts +40 -0
  119. package/dist/composables/dropdown/useDropdownVirtualElement.d.ts +17 -0
  120. package/dist/composables/group/useGroupStateInject.d.ts +9 -0
  121. package/dist/composables/group/useGroupStateProvide.d.ts +6 -0
  122. package/dist/composables/index.d.ts +5 -0
  123. package/dist/composables/index.es.js +34 -34
  124. package/dist/composables/index.umd.js +2 -2
  125. package/dist/composables/useBlurhash.d.ts +7 -0
  126. package/dist/composables/useComponentFocus.d.ts +4 -0
  127. package/dist/composables/useComponentIcon.d.ts +11 -0
  128. package/dist/composables/useDebouncedInput.d.ts +5 -0
  129. package/dist/composables/useDefaults.d.ts +2 -0
  130. package/dist/composables/useModifiers.d.ts +2 -0
  131. package/dist/composables/useOptions.d.ts +8 -0
  132. package/dist/composables/usePersistence.d.ts +3 -0
  133. package/dist/composables/useTextCount.d.ts +10 -0
  134. package/dist/composables/useUniqueId.d.ts +2 -0
  135. package/dist/composables/useVirtualScroll.d.ts +35 -0
  136. package/dist/composables/useVolver.d.ts +4 -0
  137. package/dist/constants.d.ts +104 -0
  138. package/dist/directives/index.d.ts +3 -0
  139. package/dist/directives/index.es.js +22 -22
  140. package/dist/directives/index.umd.js +1 -1
  141. package/dist/directives/v-contextmenu.d.ts +3 -0
  142. package/dist/directives/v-contextmenu.es.js +13 -13
  143. package/dist/directives/v-contextmenu.umd.js +1 -1
  144. package/dist/directives/v-tooltip.d.ts +3 -0
  145. package/dist/icons.d.ts +1889 -0
  146. package/dist/index.d.ts +10 -0
  147. package/dist/index.es.js +19 -19
  148. package/dist/index.umd.js +1 -1
  149. package/dist/json-render/catalog.d.ts +395 -0
  150. package/dist/json-render/components.d.ts +111 -0
  151. package/dist/json-render/definitions.d.ts +697 -0
  152. package/dist/json-render/index.d.ts +55 -0
  153. package/dist/json-render/index.es.js +1877 -1870
  154. package/dist/json-render/index.umd.js +1 -1
  155. package/dist/json-render/registry.d.ts +34 -0
  156. package/dist/props/index.d.ts +959 -0
  157. package/dist/resolvers/unplugin.d.ts +38 -0
  158. package/dist/resolvers/unplugin.es.js +28 -28
  159. package/dist/resolvers/unplugin.umd.js +1 -1
  160. package/dist/stories/Accordion/Accordion.settings.d.ts +9 -0
  161. package/dist/stories/Accordion/Accordion.stories.d.ts +7 -0
  162. package/dist/stories/Accordion/Accordion.test.d.ts +2 -0
  163. package/dist/stories/Accordion/AccordionSlots.stories.d.ts +7 -0
  164. package/dist/stories/AccordionGroup/AccordionGroup.settings.d.ts +13 -0
  165. package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +9 -0
  166. package/dist/stories/AccordionGroup/AccordionGroup.test.d.ts +2 -0
  167. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +1788 -0
  168. package/dist/stories/Alert/Alert.settings.d.ts +4 -0
  169. package/dist/stories/Alert/Alert.stories.d.ts +9 -0
  170. package/dist/stories/Alert/Alert.test.d.ts +2 -0
  171. package/dist/stories/Alert/AlertModifiers.stories.d.ts +13 -0
  172. package/dist/stories/Alert/AlertSlots.stories.d.ts +10 -0
  173. package/dist/stories/AlertGroup/AlertGroup.settings.d.ts +14 -0
  174. package/dist/stories/AlertGroup/AlertGroup.stories.d.ts +8 -0
  175. package/dist/stories/AlertGroup/AlertGroup.test.d.ts +2 -0
  176. package/dist/stories/AlertGroup/AlertGroupPosition.stories.d.ts +14 -0
  177. package/dist/stories/AlertGroup/AlertGroupSlots.stories.d.ts +8 -0
  178. package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +4 -0
  179. package/dist/stories/Avatar/Avatar.settings.d.ts +5 -0
  180. package/dist/stories/Avatar/Avatar.stories.d.ts +7 -0
  181. package/dist/stories/Avatar/Avatar.test.d.ts +2 -0
  182. package/dist/stories/Avatar/AvatarBadge.stories.d.ts +6 -0
  183. package/dist/stories/Avatar/AvatarModifiers.stories.d.ts +13 -0
  184. package/dist/stories/Avatar/AvatarSlots.stories.d.ts +6 -0
  185. package/dist/stories/AvatarGroup/AvatarGroup.settings.d.ts +14 -0
  186. package/dist/stories/AvatarGroup/AvatarGroup.stories.d.ts +6 -0
  187. package/dist/stories/AvatarGroup/AvatarGroup.test.d.ts +2 -0
  188. package/dist/stories/AvatarGroup/AvatarGroupModifiers.stories.d.ts +7 -0
  189. package/dist/stories/AvatarGroup/AvatarGroupSlotDefault.stories.d.ts +6 -0
  190. package/dist/stories/Badge/Badge.settings.d.ts +5 -0
  191. package/dist/stories/Badge/Badge.stories.d.ts +7 -0
  192. package/dist/stories/Badge/Badge.test.d.ts +2 -0
  193. package/dist/stories/Badge/BadgeSlots.stories.d.ts +6 -0
  194. package/dist/stories/Blurhash/BlurhashComposable.stories.d.ts +4 -0
  195. package/dist/stories/Breadcrumb/Breadcrumb.settings.d.ts +13 -0
  196. package/dist/stories/Breadcrumb/Breadcrumb.stories.d.ts +7 -0
  197. package/dist/stories/Breadcrumb/Breadcrumb.test.d.ts +2 -0
  198. package/dist/stories/Breadcrumb/BreadcrumbSlots.stories.d.ts +6 -0
  199. package/dist/stories/Button/Button.settings.d.ts +4 -0
  200. package/dist/stories/Button/Button.stories.d.ts +6 -0
  201. package/dist/stories/Button/Button.test.d.ts +2 -0
  202. package/dist/stories/Button/ButtonIcon.stories.d.ts +10 -0
  203. package/dist/stories/Button/ButtonLink.stories.d.ts +7 -0
  204. package/dist/stories/Button/ButtonLoading.stories.d.ts +8 -0
  205. package/dist/stories/Button/ButtonModifiers.stories.d.ts +17 -0
  206. package/dist/stories/Button/ButtonSlots.stories.d.ts +9 -0
  207. package/dist/stories/Button/ButtonState.stories.d.ts +8 -0
  208. package/dist/stories/Button/ButtonToggle.stories.d.ts +9 -0
  209. package/dist/stories/ButtonGroup/ButtonGroup.settings.d.ts +5 -0
  210. package/dist/stories/ButtonGroup/ButtonGroup.stories.d.ts +6 -0
  211. package/dist/stories/ButtonGroup/ButtonGroup.test.d.ts +2 -0
  212. package/dist/stories/ButtonGroup/ButtonGroupModifiers.stories.d.ts +8 -0
  213. package/dist/stories/ButtonGroup/ButtonGroupSlots.stories.d.ts +6 -0
  214. package/dist/stories/ButtonGroup/ButtonGroupToggle.stories.d.ts +8 -0
  215. package/dist/stories/Card/Card.settings.d.ts +6 -0
  216. package/dist/stories/Card/Card.stories.d.ts +6 -0
  217. package/dist/stories/Card/Card.test.d.ts +2 -0
  218. package/dist/stories/Card/CardSlots.stories.d.ts +9 -0
  219. package/dist/stories/Checkbox/Checkbox.settings.d.ts +15 -0
  220. package/dist/stories/Checkbox/Checkbox.stories.d.ts +13 -0
  221. package/dist/stories/Checkbox/Checkbox.test.d.ts +2 -0
  222. package/dist/stories/Checkbox/CheckboxBinary.stories.d.ts +7 -0
  223. package/dist/stories/Checkbox/CheckboxSlots.stories.d.ts +7 -0
  224. package/dist/stories/CheckboxGroup/CheckboxGroup.settings.d.ts +12 -0
  225. package/dist/stories/CheckboxGroup/CheckboxGroup.stories.d.ts +12 -0
  226. package/dist/stories/CheckboxGroup/CheckboxGroup.test.d.ts +2 -0
  227. package/dist/stories/CheckboxGroup/CheckboxGroupOptions.stories.d.ts +8 -0
  228. package/dist/stories/CheckboxGroup/CheckboxGroupSlots.stories.d.ts +7 -0
  229. package/dist/stories/Combobox/Combobox.settings.d.ts +4 -0
  230. package/dist/stories/Combobox/Combobox.stories.d.ts +24 -0
  231. package/dist/stories/Combobox/Combobox.test.d.ts +2 -0
  232. package/dist/stories/Combobox/ComboboxIconPosition.stories.d.ts +8 -0
  233. package/dist/stories/Combobox/ComboboxMultiple.stories.d.ts +9 -0
  234. package/dist/stories/Combobox/ComboboxOptions.stories.d.ts +11 -0
  235. package/dist/stories/Combobox/ComboboxSlots.stories.d.ts +10 -0
  236. package/dist/stories/Dialog/Dialog.settings.d.ts +10 -0
  237. package/dist/stories/Dialog/Dialog.stories.d.ts +7 -0
  238. package/dist/stories/Dialog/Dialog.test.d.ts +2 -0
  239. package/dist/stories/Dialog/DialogModifiers.stories.d.ts +8 -0
  240. package/dist/stories/Dialog/DialogSlots.stories.d.ts +8 -0
  241. package/dist/stories/Dropdown/Dropdown.settings.d.ts +5 -0
  242. package/dist/stories/Dropdown/Dropdown.stories.d.ts +9 -0
  243. package/dist/stories/Dropdown/Dropdown.test.d.ts +2 -0
  244. package/dist/stories/Dropdown/DropdownContextmenuDirective.stories.d.ts +6 -0
  245. package/dist/stories/Dropdown/DropdownMultilevel.stories.d.ts +6 -0
  246. package/dist/stories/Dropdown/DropdownSlots.stories.d.ts +8 -0
  247. package/dist/stories/Icon/Icon.settings.d.ts +7 -0
  248. package/dist/stories/Icon/Icon.stories.d.ts +8 -0
  249. package/dist/stories/Icon/IconsCollection.stories.d.ts +6 -0
  250. package/dist/stories/InputFile/InputFile.settings.d.ts +6 -0
  251. package/dist/stories/InputFile/InputFile.stories.d.ts +13 -0
  252. package/dist/stories/InputFile/InputFileDropArea.stories.d.ts +9 -0
  253. package/dist/stories/InputFile/InputFileIconPosition.stories.d.ts +8 -0
  254. package/dist/stories/InputFile/InputFileSlots.stories.d.ts +7 -0
  255. package/dist/stories/InputText/InputText.settings.d.ts +11 -0
  256. package/dist/stories/InputText/InputText.stories.d.ts +16 -0
  257. package/dist/stories/InputText/InputText.test.d.ts +5 -0
  258. package/dist/stories/InputText/InputTextIconPosition.stories.d.ts +8 -0
  259. package/dist/stories/InputText/InputTextIso.stories.d.ts +10 -0
  260. package/dist/stories/InputText/InputTextLength.stories.d.ts +10 -0
  261. package/dist/stories/InputText/InputTextMask.stories.d.ts +12 -0
  262. package/dist/stories/InputText/InputTextMinMax.stories.d.ts +9 -0
  263. package/dist/stories/InputText/InputTextSlots.stories.d.ts +8 -0
  264. package/dist/stories/InputText/InputTextSuggestions.stories.d.ts +8 -0
  265. package/dist/stories/InputText/InputTextType.stories.d.ts +18 -0
  266. package/dist/stories/Nav/Nav.settings.d.ts +4 -0
  267. package/dist/stories/Nav/Nav.stories.d.ts +6 -0
  268. package/dist/stories/Nav/Nav.test.d.ts +2 -0
  269. package/dist/stories/Nav/NavModifiers.stories.d.ts +9 -0
  270. package/dist/stories/Progress/Progress.settings.d.ts +7 -0
  271. package/dist/stories/Progress/Progress.stories.d.ts +7 -0
  272. package/dist/stories/Progress/Progress.test.d.ts +2 -0
  273. package/dist/stories/Radio/Radio.settings.d.ts +12 -0
  274. package/dist/stories/Radio/Radio.stories.d.ts +11 -0
  275. package/dist/stories/Radio/Radio.test.d.ts +2 -0
  276. package/dist/stories/Radio/RadioSlots.stories.d.ts +7 -0
  277. package/dist/stories/RadioGroup/RadioGroup.settings.d.ts +12 -0
  278. package/dist/stories/RadioGroup/RadioGroup.stories.d.ts +12 -0
  279. package/dist/stories/RadioGroup/RadioGroup.test.d.ts +2 -0
  280. package/dist/stories/RadioGroup/RadioGroupOptions.stories.d.ts +8 -0
  281. package/dist/stories/RadioGroup/RadioGroupSlots.stories.d.ts +7 -0
  282. package/dist/stories/Select/Select.settings.d.ts +8 -0
  283. package/dist/stories/Select/Select.stories.d.ts +16 -0
  284. package/dist/stories/Select/Select.test.d.ts +2 -0
  285. package/dist/stories/Select/SelectIconPosition.stories.d.ts +8 -0
  286. package/dist/stories/Select/SelectOptions.stories.d.ts +9 -0
  287. package/dist/stories/Select/SelectSlots.stories.d.ts +8 -0
  288. package/dist/stories/Tab/Tab.settings.d.ts +4 -0
  289. package/dist/stories/Tab/Tab.stories.d.ts +6 -0
  290. package/dist/stories/Tab/Tab.test.d.ts +2 -0
  291. package/dist/stories/Textarea/Textarea.settings.d.ts +9 -0
  292. package/dist/stories/Textarea/Textarea.stories.d.ts +14 -0
  293. package/dist/stories/Textarea/Textarea.test.d.ts +2 -0
  294. package/dist/stories/Textarea/TextareaLength.stories.d.ts +10 -0
  295. package/dist/stories/Textarea/TextareaSlots.stories.d.ts +8 -0
  296. package/dist/stories/Textarea/TextareatIconPosition.stories.d.ts +8 -0
  297. package/dist/stories/Tooltip/Tooltip.settings.d.ts +5 -0
  298. package/dist/stories/Tooltip/Tooltip.stories.d.ts +6 -0
  299. package/dist/stories/Tooltip/Tooltip.test.d.ts +2 -0
  300. package/dist/stories/Tooltip/TooltipDirective.stories.d.ts +10 -0
  301. package/dist/stories/VirtualScroll/VirtualScroll.settings.d.ts +5 -0
  302. package/dist/stories/VirtualScroll/VirtualScroll.stories.d.ts +7 -0
  303. package/dist/stories/VirtualScroll/VirtualScroll.test.d.ts +2 -0
  304. package/dist/stories/VirtualScroll/VirtualScrollWithComposable.stories.d.ts +4 -0
  305. package/dist/stories/argTypes.d.ts +56 -0
  306. package/dist/test/expect.d.ts +18 -0
  307. package/dist/test/options.d.ts +1 -0
  308. package/dist/test/sleep.d.ts +1 -0
  309. package/dist/types/alert.d.ts +15 -0
  310. package/dist/types/blurhash.d.ts +12 -0
  311. package/dist/types/floating-ui.d.ts +15 -0
  312. package/dist/types/generic.d.ts +4 -0
  313. package/dist/types/group.d.ts +59 -0
  314. package/dist/types/index.d.ts +7 -0
  315. package/dist/types/input-file.d.ts +9 -0
  316. package/dist/types/nav.d.ts +17 -0
  317. package/dist/utils/DateUtilities.d.ts +14 -0
  318. package/dist/utils/DomUtilities.d.ts +1 -0
  319. package/dist/utils/FileUtilities.d.ts +14 -0
  320. package/dist/utils/ObjectUtilities.d.ts +76 -0
  321. package/dist/workers/blurhash.d.ts +1 -0
  322. package/package.json +3 -2
  323. package/src/Volver.ts +8 -6
  324. package/src/components/VvAction/index.ts +1 -3
  325. package/src/components/VvButton/VvButton.vue +1 -1
  326. package/src/components/VvCheckboxGroup/index.ts +1 -3
  327. package/src/components/VvCombobox/VvCombobox.vue +3 -3
  328. package/src/components/VvDropdown/VvDropdown.vue +8 -8
  329. package/src/components/VvIcon/VvIcon.vue +3 -6
  330. package/src/components/VvInputFile/VvInputFile.vue +6 -6
  331. package/src/components/VvInputText/VvInputText.vue +95 -78
  332. package/src/components/VvRadioGroup/index.ts +1 -3
  333. package/src/composables/useBlurhash.ts +1 -1
  334. package/src/composables/useDebouncedInput.ts +1 -1
  335. package/src/composables/useDefaults.ts +55 -44
  336. package/src/composables/useModifiers.ts +1 -1
  337. package/src/index.ts +2 -2
  338. package/src/resolvers/unplugin.ts +6 -6
  339. package/src/types/alert.ts +1 -1
  340. package/src/types/nav.ts +1 -1
  341. package/src/utils/DateUtilities.ts +3 -3
  342. package/src/utils/DomUtilities.ts +7 -1
  343. package/src/utils/ObjectUtilities.ts +60 -59
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import VvTooltip from '@/components/VvTooltip/VvTooltip.vue';
3
+ declare const meta: Meta<typeof VvTooltip>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof VvTooltip>;
6
+ export declare const Default: Story;
@@ -0,0 +1,2 @@
1
+ import type { PlayAttributes } from '@/test/types';
2
+ export declare function defaultTest({ canvasElement, args }: PlayAttributes): Promise<void>;
@@ -0,0 +1,10 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import VvTooltip from '@/components/VvTooltip/VvTooltip.vue';
3
+ declare const meta: Meta<typeof VvTooltip>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof VvTooltip>;
6
+ export declare const DefaultDirective: Story;
7
+ export declare const Top: Story;
8
+ export declare const Bottom: Story;
9
+ export declare const Right: Story;
10
+ export declare const Left: Story;
@@ -0,0 +1,5 @@
1
+ import type { ArgTypes } from '@storybook/vue3-vite';
2
+ export declare const defaultArgs: {
3
+ items: string[];
4
+ };
5
+ export declare const argTypes: ArgTypes;
@@ -0,0 +1,7 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import VvVirtualScroll from '@/components/VvVirtualScroll/VvVirtualScroll.vue';
3
+ declare const meta: Meta<typeof VvVirtualScroll>;
4
+ export default meta;
5
+ export type Story = StoryObj<typeof VvVirtualScroll>;
6
+ export declare const Default: Story;
7
+ export declare const Horizontal: Story;
@@ -0,0 +1,2 @@
1
+ import type { PlayAttributes } from '@/test/types';
2
+ export declare function defaultTest({ canvasElement, args }?: PlayAttributes): Promise<void>;
@@ -0,0 +1,4 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ declare const meta: Meta;
3
+ export default meta;
4
+ export declare const Default: StoryObj;
@@ -0,0 +1,56 @@
1
+ import type { ArgTypes } from '@storybook/vue3-vite';
2
+ export declare const ValidArgTypes: ArgTypes;
3
+ export declare const InvalidArgTypes: ArgTypes;
4
+ export declare const LoadingArgTypes: ArgTypes;
5
+ export declare const DisabledArgTypes: ArgTypes;
6
+ export declare const ReadonlyArgTypes: ArgTypes;
7
+ export declare const ModifiersArgTypes: ArgTypes;
8
+ export declare const IconArgTypes: ArgTypes;
9
+ export declare const OptionsArgTypes: ArgTypes;
10
+ export declare const CountArgTypes: ArgTypes;
11
+ export declare const DebounceArgTypes: ArgTypes;
12
+ export declare const DefaultSlotArgTypes: ArgTypes;
13
+ export declare const HintArgTypes: ArgTypes;
14
+ export declare const TabindexArgTypes: ArgTypes;
15
+ export declare const IdNameArgTypes: ArgTypes;
16
+ export declare const DropdownArgTypes: ArgTypes;
17
+ export declare const UnselectableArgTypes: ArgTypes;
18
+ export declare const FloatingLabelArgTypes: ArgTypes;
19
+ export declare const AutofocusArgTypes: ArgTypes;
20
+ export declare const AutocompleteArgTypes: ArgTypes;
21
+ export declare const InputTextareaArgTypes: {
22
+ minlength: {
23
+ description: string;
24
+ control: {
25
+ type: string;
26
+ };
27
+ };
28
+ maxlength: {
29
+ description: string;
30
+ control: {
31
+ type: string;
32
+ };
33
+ };
34
+ placeholder: {
35
+ description: string;
36
+ control: {
37
+ type: string;
38
+ };
39
+ };
40
+ required: {
41
+ description: string;
42
+ table: {
43
+ defaultValue: {
44
+ summary: boolean;
45
+ };
46
+ };
47
+ };
48
+ label: {
49
+ description: string;
50
+ control: {
51
+ type: string;
52
+ };
53
+ };
54
+ };
55
+ export declare const CheckboxRadioArgTypes: ArgTypes;
56
+ export declare const CheckboxRadioGroupArgTypes: ArgTypes;
@@ -0,0 +1,18 @@
1
+ import { expect } from 'storybook/test';
2
+ declare global {
3
+ namespace jest {
4
+ interface Matchers<R> {
5
+ toBeChecked: (expected?: HTMLElement) => CustomMatcherResult;
6
+ }
7
+ interface Matchers<R> {
8
+ toBeClicked: (expected?: HTMLElement) => CustomMatcherResult;
9
+ }
10
+ interface Matchers<R> {
11
+ toHaveClass: (className: string | string[], expected?: HTMLElement) => CustomMatcherResult;
12
+ }
13
+ interface Matchers<R> {
14
+ toHaveImgChild: (imgTag: string, expected?: HTMLElement) => CustomMatcherResult;
15
+ }
16
+ }
17
+ }
18
+ export { expect };
@@ -0,0 +1 @@
1
+ export declare function getOptionValue(args: any, index: number): any;
@@ -0,0 +1 @@
1
+ export declare function sleep(ms?: number): Promise<unknown>;
@@ -0,0 +1,15 @@
1
+ import type { VvIconProps } from '@/components/VvIcon';
2
+ import type { AlertRole } from '@/constants';
3
+ export type AlertModifier = 'success' | 'info' | 'warning' | 'danger' | 'brand' | 'accent' | (string & {});
4
+ export type Alert = {
5
+ id: string | number;
6
+ title?: string;
7
+ icon?: string | VvIconProps;
8
+ content?: string;
9
+ footer?: string;
10
+ modifiers?: AlertModifier | AlertModifier[];
11
+ dismissable?: boolean;
12
+ autoClose?: number;
13
+ closeLabel?: string;
14
+ role?: AlertRole;
15
+ };
@@ -0,0 +1,12 @@
1
+ declare class ValidationError extends Error {
2
+ }
3
+ export type BlurhashWorkerType = {
4
+ encode: (pixels: Uint8ClampedArray, width: number, height: number, componentX: number, componentY: number) => string;
5
+ decode: (blurhash: string, width: number, height: number, punch?: number) => Uint8ClampedArray;
6
+ isBlurhashValid: (blurhash: string) => {
7
+ result: boolean;
8
+ errorReason?: string;
9
+ };
10
+ ValidationError: ValidationError;
11
+ };
12
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { autoPlacement, flip, offset, shift, size } from '@floating-ui/vue';
2
+ export type { MiddlewareState } from '@floating-ui/core';
3
+ export type { Middleware } from '@floating-ui/vue';
4
+ /**
5
+ * Drop the `Derivable` (callback) variant from a floating-ui option type.
6
+ * The components only ever pass plain option objects, and keeping the
7
+ * callback variant leaks non-portable floating-ui internals
8
+ * (`Derivable`, `MiddlewareState`) into the emitted declaration files.
9
+ */
10
+ type NonDerivable<T> = Exclude<T, (...args: never[]) => unknown>;
11
+ export type AutoPlacementOptions = NonDerivable<Parameters<typeof autoPlacement>[0]>;
12
+ export type FlipOptions = NonDerivable<Parameters<typeof flip>[0]>;
13
+ export type ShiftOptions = NonDerivable<Parameters<typeof shift>[0]>;
14
+ export type OffsetOptions = NonDerivable<Parameters<typeof offset>[0]>;
15
+ export type SizeOptions = NonDerivable<Parameters<typeof size>[0]>;
@@ -0,0 +1,4 @@
1
+ export type Nullable<T> = T | null | undefined;
2
+ export type Option = Record<string | number | symbol, any> & {
3
+ options?: Option[];
4
+ };
@@ -0,0 +1,59 @@
1
+ import type { Emitter } from 'mitt';
2
+ import type { Ref } from 'vue';
3
+ /**
4
+ * State shared in a group of inputs
5
+ */
6
+ export type InputGroupState = {
7
+ modelValue: Ref<unknown>;
8
+ readonly: Ref<boolean>;
9
+ disabled: Ref<boolean>;
10
+ valid: Ref<boolean>;
11
+ invalid: Ref<boolean>;
12
+ };
13
+ /**
14
+ * State shared in a group of buttons
15
+ */
16
+ export type ButtonGroupState = {
17
+ modelValue: Ref<string | number | boolean | (string | number | boolean)[] | undefined>;
18
+ disabled: Ref<boolean>;
19
+ toggle: Ref<boolean>;
20
+ multiple: Ref<boolean>;
21
+ unselectable: Ref<boolean>;
22
+ modifiers: Ref<string | string[] | undefined>;
23
+ };
24
+ /**
25
+ * State shared in a group of accordions
26
+ */
27
+ export type AccordionGroupBusEvents = {
28
+ toggle: {
29
+ name: string;
30
+ value: boolean;
31
+ };
32
+ register: {
33
+ name: string;
34
+ };
35
+ unregister: {
36
+ name: string;
37
+ };
38
+ expand: {
39
+ name?: string | string[];
40
+ };
41
+ collapse: {
42
+ name?: string | string[];
43
+ };
44
+ };
45
+ export type AccordionGroupState = {
46
+ disabled: Ref<boolean>;
47
+ modifiers: Ref<string[] | string | undefined>;
48
+ bus: Emitter<AccordionGroupBusEvents>;
49
+ };
50
+ /**
51
+ * State shared in a group of alerts
52
+ */
53
+ export type AlertGroupBusEvents = {
54
+ close: string;
55
+ };
56
+ export type AlertGroupState = {
57
+ name?: Ref<string | undefined>;
58
+ bus?: Emitter<AlertGroupBusEvents>;
59
+ };
@@ -0,0 +1,7 @@
1
+ export * from './alert';
2
+ export * from './blurhash';
3
+ export * from './floating-ui';
4
+ export * from './generic';
5
+ export * from './group';
6
+ export * from './input-file';
7
+ export * from './nav';
@@ -0,0 +1,9 @@
1
+ export type UploadedFile<Source = unknown> = {
2
+ name: string;
3
+ size: number;
4
+ type: string;
5
+ url?: string;
6
+ thumbnailUrl?: string;
7
+ lastModified?: number;
8
+ source?: Source;
9
+ };
@@ -0,0 +1,17 @@
1
+ export type NavItem = {
2
+ label: string;
3
+ ariaLabel?: string;
4
+ title?: string;
5
+ to?: string | Record<string, unknown>;
6
+ href?: string;
7
+ target?: string;
8
+ rel?: string;
9
+ disabled?: boolean;
10
+ current?: boolean;
11
+ class?: string | string[];
12
+ on?: Record<'click' | (string & {}), () => void>;
13
+ data?: Record<string, unknown>;
14
+ };
15
+ export type NavItemTab = NavItem & {
16
+ tab?: string;
17
+ };
@@ -0,0 +1,14 @@
1
+ export declare function isDateIsoString(dateString: unknown): boolean;
2
+ /**
3
+ * Converts a Date object to a string value for input element
4
+ * @param date - Date object or string
5
+ * @param typeOfInput - Type of HTML input element
6
+ * @param withSeconds - Include seconds in time value
7
+ * @returns String value for input element
8
+ * @example
9
+ * getInputValueFromDate(new Date(), 'date') // '2021-12-31'
10
+ * getInputValueFromDate(new Date(), 'time') // '23:59'
11
+ * getInputValueFromDate(new Date(), 'datetime-local') // '2021-12-31T23:59'
12
+ */
13
+ export declare function getInputValueFromDate(date: Date | string, typeOfInput?: 'date' | 'time' | 'month' | 'datetime-local', withSeconds?: boolean): string;
14
+ export declare function getDateFromInputValue(value: string, typeOfInput?: 'date' | 'time' | 'month' | 'datetime-local'): Date | null;
@@ -0,0 +1 @@
1
+ export declare function findScrollContainer(element: HTMLElement | null): HTMLElement | undefined;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Validates if all files in a FileList meet the restrictions of the accept attribute
3
+ * @param {FileList} fileList - The FileList object to validate
4
+ * @param {string} [acceptValue] - The value of the accept attribute (e.g. ".jpg,.png,image/*")
5
+ * @returns {boolean} - true if all files are valid, false otherwise
6
+ */
7
+ export declare function validateFileList(fileList: FileList, acceptValue?: string): boolean;
8
+ /**
9
+ * Filters a FileList and returns only the files that match the accept attribute criteria
10
+ * @param {FileList} fileList - The FileList object to filter
11
+ * @param {string} [acceptValue] - The value of the accept attribute (e.g. ".jpg,.png,image/*")
12
+ * @returns {File[]} - Array of files that match the accept criteria
13
+ */
14
+ export declare function filterFileList(fileList: FileList, acceptValue?: string): File[];
@@ -0,0 +1,76 @@
1
+ import type { Ref } from 'vue';
2
+ /**
3
+ * Compare objects, primitives, array, dates, regexp
4
+ * @param {any} obj1 first literal
5
+ * @param {any} obj2 second literal
6
+ * @param {string} field optional field of obj1 and obj2 (also nested dotted field "prop1.prop12")
7
+ * @returns {boolean}
8
+ */
9
+ export declare function equals(obj1: any, obj2: any, field?: string): boolean;
10
+ export declare function deepEquals(a: any, b: any): boolean;
11
+ /**
12
+ * Find and return field or nested field from object (also nested dotted field)
13
+ * @param {object} data object that contains the field
14
+ * @param {string} field ex: "prop1" or "prop1.prop12"
15
+ * @returns {boolean} the field value
16
+ */
17
+ export declare function resolveFieldData(data: Record<string, unknown>, field: string): unknown;
18
+ /**
19
+ * @param {any} obj data to check
20
+ * @returns {boolean}
21
+ */
22
+ export declare function isFunction(obj: any): boolean;
23
+ /**
24
+ * Return the index of value in list array
25
+ * @param {any} value the element to find
26
+ * @param {Array<any>} list array list
27
+ * @returns {number} the index
28
+ */
29
+ export declare function findIndexInList<Type = unknown>(value: Type, list: Type[]): number;
30
+ /**
31
+ * Return the index of value in list array
32
+ * @param {any} value the element to find
33
+ * @param {Array<any>} list array list
34
+ * @returns {boolean} the index
35
+ */
36
+ export declare function contains<Type = unknown>(value: Type, list: Type[]): boolean;
37
+ /**
38
+ * @param {boolean | string | null | undefined | number | Array<unknown> | object} value element to checj
39
+ * @returns {boolean} true if value is empty
40
+ */
41
+ export declare function isEmpty(value: boolean | string | null | undefined | number | unknown[] | object | Ref): boolean;
42
+ /**
43
+ * Return the object entries that match the predicate passed
44
+ * @param {object} value
45
+ * @param {Function} predicate
46
+ * @returns {object} the object entries
47
+ */
48
+ export declare function pickBy(value: Record<string, unknown>, predicate: (k: string) => boolean): {
49
+ [k: string]: unknown;
50
+ };
51
+ /**
52
+ * Remove a value from an Array
53
+ * @param {any} value the element to remove
54
+ * @param {Array<any>} list
55
+ * @returns {Array<any>} the list without the value
56
+ */
57
+ export declare function removeFromList<Type = unknown>(value: Type, list: Type[]): Type[];
58
+ /**
59
+ * @param {any} value
60
+ * @returns {boolean} true if value is a string
61
+ */
62
+ export declare function isString(value: unknown): value is string;
63
+ /**
64
+ * Convert props definition to object with "prop" as key and default as value
65
+ * @param {ComponentObjectPropsOptions} props vue component props
66
+ * @returns {object}
67
+ */
68
+ export declare function propsToObject(props: any): Record<string, unknown>;
69
+ /**
70
+ * Filter array objects by filter array
71
+ * @param {object[]} list the listo to filter
72
+ * @param {object[] | string[]} filter the filter list, array of string or array of object
73
+ * @param {string} key
74
+ * @return {object[]}
75
+ */
76
+ export declare function filterArray<T = Record<string, unknown>>(list: T[], filter: T[] | string[], key: string): T[];
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@volverjs/ui-vue",
3
3
  "type": "module",
4
- "version": "0.0.13",
4
+ "version": "0.0.15",
5
5
  "description": "@volverjs/ui-vue is a lightweight Vue 3 component library to accompany @volverjs/style.",
6
6
  "author": "8 wave S.r.l.",
7
7
  "license": "MIT",
@@ -496,7 +496,8 @@
496
496
  "scripts": {
497
497
  "dev": "storybook dev -p 6006",
498
498
  "styleguide": "storybook build",
499
- "build": "npm run generate-icons && npm run generate-tsd && node ./scripts/build.js",
499
+ "build": "npm run clean && npm run generate-icons && npm run generate-tsd && node ./scripts/build.js",
500
+ "clean": "node ./scripts/clean.js",
500
501
  "hot": "node ./scripts/build.js --hot",
501
502
  "type-check": "vue-tsc --noEmit",
502
503
  "lint": "eslint .",
package/src/Volver.ts CHANGED
@@ -9,6 +9,8 @@ import {
9
9
  import { kebabCase } from 'change-case'
10
10
  import { DEFAULT_ICONIFY_PROVIDER, INJECTION_KEY_VOLVER } from './constants'
11
11
 
12
+ const DEFAULT_FETCH_ICON_OPTIONS: RequestInit = { cache: 'force-cache' }
13
+
12
14
  export function useDefaultProps(
13
15
  component: Component,
14
16
  defaults?: Record<string, unknown>,
@@ -171,11 +173,11 @@ export interface VolverInterface {
171
173
  }
172
174
 
173
175
  export class Volver implements VolverInterface {
174
- private _fetchOptions: RequestInit = {}
175
- private _iconsCollections: IconifyJSON[] = []
176
- private _iconsProvider = DEFAULT_ICONIFY_PROVIDER
177
- private _nuxt = false
178
- private _experimentalFeatures: VolverExperimentalFeatures = {}
176
+ private readonly _fetchOptions: RequestInit = {}
177
+ private readonly _iconsCollections: IconifyJSON[] = []
178
+ private readonly _iconsProvider: string = DEFAULT_ICONIFY_PROVIDER
179
+ private readonly _nuxt: boolean = false
180
+ private readonly _experimentalFeatures: VolverExperimentalFeatures = {}
179
181
 
180
182
  defaults: Ref<DefaultOptions> = ref({})
181
183
 
@@ -260,7 +262,7 @@ export class Volver implements VolverInterface {
260
262
 
261
263
  async fetchIcon(
262
264
  src: string,
263
- options: RequestInit = { cache: 'force-cache' },
265
+ options: RequestInit = DEFAULT_FETCH_ICON_OPTIONS,
264
266
  ): Promise<string | undefined> {
265
267
  const response = await fetch(src, {
266
268
  ...this._fetchOptions,
@@ -1,5 +1,3 @@
1
- import { ActionProps } from '../../props'
2
-
3
1
  export const VvActionEvents = ['click', 'mouseover', 'mouseleave']
4
2
 
5
- export const VvActionProps = ActionProps
3
+ export { ActionProps as VvActionProps } from '../../props'
@@ -78,7 +78,7 @@ const { hasIcon } = useComponentIcon(icon)
78
78
  * @description Catch click event
79
79
  */
80
80
  const toggleValue = computed(() => {
81
- return props.value !== undefined ? props.value : name.value
81
+ return props.value === undefined ? name.value : props.value
82
82
  })
83
83
  const hasListeners = computed(() => {
84
84
  if (!toggle.value) {
@@ -1,5 +1,3 @@
1
- import { CheckboxRadioGroupProps } from '../../props'
2
-
3
- export const VvCheckboxGroupProps = CheckboxRadioGroupProps
1
+ export { CheckboxRadioGroupProps as VvCheckboxGroupProps } from '../../props'
4
2
 
5
3
  export const VvCheckboxGroupEvents = ['update:modelValue', 'change']
@@ -398,10 +398,10 @@ function onInput(option: string | Option) {
398
398
  return item !== optionValue
399
399
  })
400
400
  } else if (!isSelected && isSelectable.value) {
401
- if (!props.multiple) {
402
- localModelValue.value = [optionValue]
403
- } else {
401
+ if (props.multiple) {
404
402
  localModelValue.value = [...localModelValue.value, optionValue]
403
+ } else {
404
+ localModelValue.value = [optionValue]
405
405
  }
406
406
  }
407
407
  if (!props.multiple && !props.keepOpen) {
@@ -69,14 +69,14 @@ onMounted(() => {
69
69
  floatingEl.value,
70
70
  () => {
71
71
  hasCustomPosition.value
72
- = window
72
+ = globalThis
73
73
  .getComputedStyle(floatingEl.value)
74
74
  .getPropertyValue('--dropdown-custom-position')
75
75
  ?.trim() === 'true'
76
76
  },
77
77
  {
78
78
  attributeFilter: ['style'],
79
- window,
79
+ window: globalThis.window,
80
80
  },
81
81
  )
82
82
  })
@@ -216,13 +216,13 @@ const arrowPlacement = computed(() => {
216
216
  }[side.value]
217
217
  return {
218
218
  left:
219
- middlewareData.value.arrow?.x !== undefined
220
- ? `${middlewareData.value.arrow?.x}px`
221
- : undefined,
219
+ middlewareData.value.arrow?.x === undefined
220
+ ? undefined
221
+ : `${middlewareData.value.arrow?.x}px`,
222
222
  top:
223
- middlewareData.value.arrow?.y !== undefined
224
- ? `${middlewareData.value.arrow?.y}px`
225
- : undefined,
223
+ middlewareData.value.arrow?.y === undefined
224
+ ? undefined
225
+ : `${middlewareData.value.arrow?.y}px`,
226
226
  [staticSide]: `${-(arrowEl.value?.offsetWidth ?? 0) / 2}px`,
227
227
  }
228
228
  })
@@ -59,15 +59,12 @@ const icon = computed(() => {
59
59
  * @return {SVGSVGElement | null} https://developer.mozilla.org/en-US/docs/Web/API/SVGSVGElement
60
60
  */
61
61
  function getSvgContent(svg: string): SVGSVGElement | null {
62
- const domParser = typeof window !== 'undefined'
63
- ? new window.DOMParser()
64
- : null
65
- if (!domParser) {
62
+ if (globalThis.window === undefined) {
66
63
  return null
67
64
  }
65
+ const domParser = new globalThis.DOMParser()
68
66
  const svgDomString = domParser.parseFromString(svg, 'text/html')
69
- const svgEl = svgDomString.querySelector('svg')
70
- return svgEl
67
+ return svgDomString.querySelector('svg')
71
68
  }
72
69
 
73
70
  /**
@@ -176,7 +176,7 @@ function onClickDropArea() {
176
176
  }
177
177
 
178
178
  function onRemoveIndex(index: number) {
179
- const toRemove = !Array.isArray(localModelValue.value) ? localModelValue.value : localModelValue.value[index]
179
+ const toRemove = Array.isArray(localModelValue.value) ? localModelValue.value[index] : localModelValue.value
180
180
  if (!toRemove) {
181
181
  return
182
182
  }
@@ -194,7 +194,7 @@ function onRemoveIndex(index: number) {
194
194
  }
195
195
 
196
196
  const selectedFileIndex = ref(0)
197
- const PREVIEW_MIME_TYPES = ['image/jpeg', 'image/png']
197
+ const PREVIEW_MIME_TYPES = new Set(['image/jpeg', 'image/png'])
198
198
  const previewSrc = computed(() => {
199
199
  if (props.hidePreview) {
200
200
  return undefined
@@ -207,7 +207,7 @@ const previewSrc = computed(() => {
207
207
  }
208
208
  if (files.value[selectedFileIndex.value] instanceof File) {
209
209
  const currentFile = files.value[selectedFileIndex.value] as File
210
- if (!PREVIEW_MIME_TYPES.includes(currentFile.type)) {
210
+ if (!PREVIEW_MIME_TYPES.has(currentFile.type)) {
211
211
  return undefined
212
212
  }
213
213
  return URL.createObjectURL(currentFile)
@@ -216,7 +216,7 @@ const previewSrc = computed(() => {
216
216
  if (currentFile.thumbnailUrl) {
217
217
  return currentFile.thumbnailUrl
218
218
  }
219
- if (!PREVIEW_MIME_TYPES.includes(currentFile.type)) {
219
+ if (!PREVIEW_MIME_TYPES.has(currentFile.type)) {
220
220
  return undefined
221
221
  }
222
222
  return currentFile.url
@@ -241,7 +241,7 @@ function formatBytes(bytes?: number, decimals?: number) {
241
241
  if (bytes === 0)
242
242
  return '0 Bytes'
243
243
  const k = 1024
244
- const dm = !decimals ? 2 : decimals <= 0 ? 0 : decimals
244
+ const dm = Math.max(0, decimals ?? 2)
245
245
  const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
246
246
  const i = Math.floor(Math.log(bytes) / Math.log(k))
247
247
  return `${Number.parseFloat((bytes / (k ** i)).toFixed(dm))} ${sizes[i]}`
@@ -258,7 +258,7 @@ function onDownloadFile(file: File | UploadedFile) {
258
258
  link.setAttribute('download', file.name)
259
259
  document.body.appendChild(link)
260
260
  link.click()
261
- document.body.removeChild(link)
261
+ link.remove()
262
262
  URL.revokeObjectURL(link.href)
263
263
  }
264
264