@volverjs/ui-vue 0.0.10-beta.2 → 0.0.10-beta.20

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