@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
@@ -1,99 +1,9 @@
1
- import { inject, computed, unref, defineComponent, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, watch, resolveDynamicComponent, withCtx, renderSlot, createTextVNode, toDisplayString, toRef, useAttrs, useSlots, createElementBlock, Fragment } from "vue";
1
+ import { inject, computed, unref, defineComponent, mergeDefaults, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, watch, resolveDynamicComponent, withCtx, renderSlot, createTextVNode, toDisplayString, toRef, useAttrs, useSlots, createElementBlock, Fragment } from "vue";
2
2
  import { iconExists, Icon, addIcon } from "@iconify/vue";
3
- import { nanoid } from "nanoid";
4
- const VvIconProps = {
5
- /**
6
- * Color
7
- */
8
- color: String,
9
- /**
10
- * Width
11
- */
12
- width: {
13
- type: [String, Number]
14
- },
15
- /**
16
- * Height
17
- */
18
- height: {
19
- type: [String, Number]
20
- },
21
- /**
22
- * Icon name
23
- * Can be the full composition of iconify name "@{provider}:{prefix}:{name}" or "{prefix}:{name}" or "{name}"
24
- * https://docs.iconify.design/api/providers.html#provider-in-icon-name
25
- */
26
- name: {
27
- type: String,
28
- required: true
29
- },
30
- /**
31
- * By default 'vv'
32
- * If custom collection is not added with "addCollection" DS class method, this prop could not be used
33
- * Icon provider: https://docs.iconify.design/api/providers.html#provider-in-icon-name
34
- */
35
- provider: {
36
- type: String
37
- },
38
- /**
39
- * The name of icon set.
40
- * Icon default options prefix: simple | normal | detailed
41
- */
42
- prefix: {
43
- type: String,
44
- default: "normal"
45
- },
46
- /**
47
- * Url remote SVG icon
48
- */
49
- src: String,
50
- /**
51
- * Horizontal flip
52
- */
53
- horizontalFlip: Boolean,
54
- /**
55
- * Vertical flip
56
- */
57
- verticalFlip: Boolean,
58
- /**
59
- * String alternative to "horizontalFlip" and "verticalFlip".
60
- * Example: https://docs.iconify.design/icon-components/vue/transform.html
61
- */
62
- flip: String,
63
- /**
64
- * Icon render mode
65
- * 'style' = 'bg' or 'mask', depending on icon content
66
- * 'bg' = span with style using `background`
67
- * 'mask' = span with style using `mask`
68
- * 'svg' = svg
69
- * Iconify doc: https://docs.iconify.design/iconify-icon/modes.html
70
- */
71
- mode: String,
72
- /**
73
- * Toggles inline or block mode
74
- * Example https://docs.iconify.design/icon-components/vue/inline.html
75
- */
76
- inline: Boolean,
77
- /**
78
- * rotates icon
79
- * Example https://docs.iconify.design/icon-components/vue/transform.html
80
- */
81
- rotate: [Number, String],
82
- /**
83
- * A callback that is called when icon data has been loaded
84
- */
85
- onLoad: Function,
86
- /**
87
- * SVG icon string
88
- */
89
- svg: String,
90
- /**
91
- * Icon modifiers: vv-icon css helper classes, value/s are concatened with prefix 'vv-icon--'
92
- * @values string | string[]
93
- */
94
- modifiers: {
95
- type: [String, Array]
96
- }
3
+ import { uid } from "uid";
4
+ const VvIconPropsDefaults = {
5
+ prefix: "normal"
6
+ /* normal */
97
7
  };
98
8
  var Strategy = /* @__PURE__ */ ((Strategy2) => {
99
9
  Strategy2["absolute"] = "absolute";
@@ -182,7 +92,24 @@ const __default__$2 = {
182
92
  };
183
93
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
184
94
  ...__default__$2,
185
- props: VvIconProps,
95
+ props: /* @__PURE__ */ mergeDefaults({
96
+ name: {},
97
+ color: {},
98
+ width: {},
99
+ height: {},
100
+ provider: {},
101
+ prefix: {},
102
+ src: {},
103
+ horizontalFlip: { type: Boolean },
104
+ verticalFlip: { type: Boolean },
105
+ flip: {},
106
+ mode: {},
107
+ inline: { type: Boolean },
108
+ rotate: {},
109
+ onLoad: { type: Function },
110
+ svg: {},
111
+ modifiers: {}
112
+ }, VvIconPropsDefaults),
186
113
  setup(__props) {
187
114
  const props = __props;
188
115
  const hasRotate = computed(() => {
@@ -269,7 +196,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
269
196
  color: _ctx.color,
270
197
  onLoad: _ctx.onLoad,
271
198
  icon: unref(icon)
272
- }), null, 16, ["class"])) : createCommentVNode("", true);
199
+ }), null, 16, ["class"])) : createCommentVNode("v-if", true);
273
200
  };
274
201
  }
275
202
  });
@@ -290,6 +217,7 @@ const LinkProps = {
290
217
  */
291
218
  target: {
292
219
  type: String,
220
+ default: void 0,
293
221
  validator: (value) => Object.values(AnchorTarget).includes(value)
294
222
  },
295
223
  /**
@@ -304,7 +232,10 @@ const LoadingProps = {
304
232
  /**
305
233
  * Loading status
306
234
  */
307
- loading: Boolean,
235
+ loading: {
236
+ type: Boolean,
237
+ default: false
238
+ },
308
239
  /**
309
240
  * Loading label
310
241
  */
@@ -317,38 +248,65 @@ const DisabledProps = {
317
248
  /**
318
249
  * Whether the form control is disabled
319
250
  */
320
- disabled: Boolean
251
+ disabled: {
252
+ type: Boolean,
253
+ default: false
254
+ }
321
255
  };
322
256
  const ActiveProps = {
323
257
  /**
324
258
  * Whether the item is active
325
259
  */
326
- active: Boolean
260
+ active: {
261
+ type: Boolean,
262
+ default: false
263
+ }
264
+ };
265
+ const CurrentProps = {
266
+ /**
267
+ * Whether the item is current
268
+ */
269
+ current: {
270
+ type: Boolean,
271
+ default: false
272
+ }
327
273
  };
328
274
  const PressedProps = {
329
275
  /**
330
276
  * Whether the item is pressed
331
277
  */
332
- pressed: Boolean
278
+ pressed: {
279
+ type: Boolean,
280
+ default: false
281
+ }
333
282
  };
334
283
  const LabelProps = {
335
284
  /**
336
285
  * The item label
337
286
  */
338
- label: [String, Number]
287
+ label: {
288
+ type: [String, Number],
289
+ default: void 0
290
+ }
339
291
  };
340
292
  const ModifiersProps = {
341
293
  /**
342
294
  * Component BEM modifiers
343
295
  */
344
- modifiers: [String, Array]
296
+ modifiers: {
297
+ type: [String, Array],
298
+ default: void 0
299
+ }
345
300
  };
346
- ({
301
+ const IconProps = {
347
302
  /**
348
303
  * VvIcon name or props
349
304
  * @see VVIcon
350
305
  */
351
- icon: { type: [String, Object] },
306
+ icon: {
307
+ type: [String, Object],
308
+ default: void 0
309
+ },
352
310
  /**
353
311
  * VvIcon position
354
312
  */
@@ -357,7 +315,7 @@ const ModifiersProps = {
357
315
  default: Position.before,
358
316
  validation: (value) => Object.values(Position).includes(value)
359
317
  }
360
- });
318
+ };
361
319
  const UnselectableProps = {
362
320
  /**
363
321
  * If true the input will be unselectable
@@ -392,7 +350,8 @@ const IdProps = {
392
350
  * Dropdown show / hide transition name
393
351
  */
394
352
  transitionName: {
395
- type: String
353
+ type: String,
354
+ default: void 0
396
355
  },
397
356
  /**
398
357
  * Offset of the dropdown from the trigger
@@ -460,7 +419,8 @@ const IdProps = {
460
419
  * Set dropdown width to the same as the trigger
461
420
  */
462
421
  triggerWidth: {
463
- type: Boolean
422
+ type: Boolean,
423
+ default: false
464
424
  }
465
425
  });
466
426
  const ActionProps = {
@@ -468,6 +428,7 @@ const ActionProps = {
468
428
  ...LabelProps,
469
429
  ...PressedProps,
470
430
  ...ActiveProps,
431
+ ...CurrentProps,
471
432
  ...LinkProps,
472
433
  /**
473
434
  * Button type
@@ -483,6 +444,13 @@ const ActionProps = {
483
444
  ariaLabel: {
484
445
  type: String,
485
446
  default: void 0
447
+ },
448
+ /**
449
+ * Default tag for the action
450
+ */
451
+ defaultTag: {
452
+ type: String,
453
+ default: ActionTag.button
486
454
  }
487
455
  };
488
456
  const VvActionEvents = ["click", "mouseover", "mouseleave"];
@@ -500,8 +468,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
500
468
  ...__default__$1,
501
469
  props: VvActionProps,
502
470
  emits: VvActionEvents,
503
- setup(__props, { expose: __expose, emit }) {
471
+ setup(__props, { expose: __expose, emit: __emit }) {
504
472
  const props = __props;
473
+ const emit = __emit;
505
474
  const volver = useVolver();
506
475
  const element = ref(null);
507
476
  __expose({ $el: element });
@@ -532,7 +501,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
532
501
  case props.href !== void 0:
533
502
  return ActionTag.a;
534
503
  default:
535
- return ActionTag.button;
504
+ return props.defaultTag;
536
505
  }
537
506
  });
538
507
  const hasProps = computed(() => {
@@ -557,12 +526,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
557
526
  to: props.to,
558
527
  target: props.target
559
528
  };
560
- default:
529
+ case ActionTag.button:
561
530
  return {
562
531
  ...toReturn,
563
532
  type: props.type,
564
533
  disabled: props.disabled
565
534
  };
535
+ default:
536
+ return toReturn;
566
537
  }
567
538
  });
568
539
  const onClick = (e) => {
@@ -588,7 +559,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
588
559
  class: {
589
560
  active: _ctx.active,
590
561
  pressed: unref(pressed),
591
- disabled: _ctx.disabled
562
+ disabled: _ctx.disabled,
563
+ current: _ctx.current
592
564
  },
593
565
  onClickPassive: onClick,
594
566
  onMouseoverPassive: onMouseover,
@@ -596,10 +568,15 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
596
568
  }), {
597
569
  default: withCtx(() => [
598
570
  renderSlot(_ctx.$slots, "default", {}, () => [
599
- createTextVNode(toDisplayString(_ctx.label), 1)
571
+ createTextVNode(
572
+ toDisplayString(_ctx.label),
573
+ 1
574
+ /* TEXT */
575
+ )
600
576
  ])
601
577
  ]),
602
578
  _: 3
579
+ /* FORWARDED */
603
580
  }, 16, ["class"]);
604
581
  };
605
582
  }
@@ -725,10 +702,7 @@ const VvButtonProps = {
725
702
  ...ModifiersProps,
726
703
  ...UnselectableProps,
727
704
  ...LoadingProps,
728
- /**
729
- * Button icon
730
- */
731
- icon: [String, Object],
705
+ ...IconProps,
732
706
  /**
733
707
  * Button icon position
734
708
  */
@@ -822,7 +796,42 @@ function useGroupProps(props, emit) {
822
796
  label
823
797
  };
824
798
  }
825
- const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || nanoid()));
799
+ const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || uid()));
800
+ function useComponentIcon(icon, iconPosition) {
801
+ const hasIcon = computed(() => {
802
+ if (typeof (icon == null ? void 0 : icon.value) === "string") {
803
+ return { name: icon == null ? void 0 : icon.value };
804
+ }
805
+ return icon == null ? void 0 : icon.value;
806
+ });
807
+ const hasIconBefore = computed(
808
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Position.before ? hasIcon.value : void 0
809
+ );
810
+ const hasIconAfter = computed(
811
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Position.after ? hasIcon.value : void 0
812
+ );
813
+ const hasIconLeft = computed(
814
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Side.left ? hasIcon.value : void 0
815
+ );
816
+ const hasIconRight = computed(
817
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Side.right ? hasIcon.value : void 0
818
+ );
819
+ const hasIconTop = computed(
820
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Side.top ? hasIcon.value : void 0
821
+ );
822
+ const hasIconBottom = computed(
823
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Side.bottom ? hasIcon.value : void 0
824
+ );
825
+ return {
826
+ hasIcon,
827
+ hasIconLeft,
828
+ hasIconRight,
829
+ hasIconTop,
830
+ hasIconBottom,
831
+ hasIconBefore,
832
+ hasIconAfter
833
+ };
834
+ }
826
835
  const _hoisted_1 = {
827
836
  key: 1,
828
837
  class: "vv-button__label"
@@ -838,10 +847,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
838
847
  ...__default__,
839
848
  props: VvButtonProps,
840
849
  emits: VvButtonEvents,
841
- setup(__props, { expose: __expose, emit }) {
850
+ setup(__props, { expose: __expose, emit: __emit }) {
842
851
  const props = __props;
843
852
  const attrs = useAttrs();
844
853
  const slots = useSlots();
854
+ const emit = __emit;
845
855
  const {
846
856
  id,
847
857
  modifiers,
@@ -885,9 +895,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
885
895
  )
886
896
  }))
887
897
  );
888
- const hasIconProps = computed(
889
- () => typeof (icon == null ? void 0 : icon.value) === "string" ? { name: icon == null ? void 0 : icon.value } : icon == null ? void 0 : icon.value
890
- );
898
+ const { hasIcon } = useComponentIcon(icon);
891
899
  const toggleValue = computed(() => {
892
900
  return props.value !== void 0 ? props.value : name.value;
893
901
  });
@@ -937,24 +945,44 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
937
945
  key: 0,
938
946
  class: "vv-button__loading-icon",
939
947
  name: _ctx.loadingIcon
940
- }, null, 8, ["name"])) : createCommentVNode("", true),
941
- _ctx.loadingLabel ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(_ctx.loadingLabel), 1)) : createCommentVNode("", true)
942
- ]) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
943
- renderSlot(_ctx.$slots, "before"),
944
- unref(icon) ? (openBlock(), createBlock(_sfc_main$2, mergeProps({
945
- key: 0,
946
- class: "vv-button__icon"
947
- }, unref(hasIconProps)), null, 16)) : createCommentVNode("", true),
948
- unref(label) ? (openBlock(), createElementBlock("span", _hoisted_2, [
949
- renderSlot(_ctx.$slots, "label", {}, () => [
950
- createTextVNode(toDisplayString(unref(label)), 1)
951
- ])
952
- ])) : createCommentVNode("", true),
953
- renderSlot(_ctx.$slots, "after")
954
- ], 64))
948
+ }, null, 8, ["name"])) : createCommentVNode("v-if", true),
949
+ _ctx.loadingLabel ? (openBlock(), createElementBlock(
950
+ "span",
951
+ _hoisted_1,
952
+ toDisplayString(_ctx.loadingLabel),
953
+ 1
954
+ /* TEXT */
955
+ )) : createCommentVNode("v-if", true)
956
+ ]) : (openBlock(), createElementBlock(
957
+ Fragment,
958
+ { key: 1 },
959
+ [
960
+ renderSlot(_ctx.$slots, "before"),
961
+ unref(hasIcon) ? (openBlock(), createBlock(
962
+ _sfc_main$2,
963
+ mergeProps({ key: 0 }, unref(hasIcon), { class: "vv-button__icon" }),
964
+ null,
965
+ 16
966
+ /* FULL_PROPS */
967
+ )) : createCommentVNode("v-if", true),
968
+ unref(label) ? (openBlock(), createElementBlock("span", _hoisted_2, [
969
+ renderSlot(_ctx.$slots, "label", {}, () => [
970
+ createTextVNode(
971
+ toDisplayString(unref(label)),
972
+ 1
973
+ /* TEXT */
974
+ )
975
+ ])
976
+ ])) : createCommentVNode("v-if", true),
977
+ renderSlot(_ctx.$slots, "after")
978
+ ],
979
+ 64
980
+ /* STABLE_FRAGMENT */
981
+ ))
955
982
  ])
956
983
  ]),
957
984
  _: 3
985
+ /* FORWARDED */
958
986
  }, 16, ["id", "class"]);
959
987
  };
960
988
  }
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@iconify/vue"),require("nanoid")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","nanoid"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvButton=t(e.vue,e.vue$1,e.nanoid)}(this,(function(e,t,o){"use strict";const n={color:String,width:{type:[String,Number]},height:{type:[String,Number]},name:{type:String,required:!0},provider:{type:String},prefix:{type:String,default:"normal"},src:String,horizontalFlip:Boolean,verticalFlip:Boolean,flip:String,mode:String,inline:Boolean,rotate:[Number,String],onLoad:Function,svg:String,modifiers:{type:[String,Array]}};var r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),l=(e=>(e.before="before",e.after="after",e))(l||{}),i=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(i||{}),a=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(a||{}),u=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(u||{});const s=Symbol.for("volver"),c=Symbol.for("buttonGroup"),d=Symbol.for("dropdownTrigger"),f=Symbol.for("dropdownAction");function v(){return e.inject(s)}function p(t,o,n){return e.computed((()=>{const r={[t]:!0},l="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(r[`${t}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((o=>{r[`${t}--${o}`]=e.unref(n.value[o])})),r}))}const m=e.defineComponent({name:"VvIcon",props:n,setup(o){const n=o,r=e.computed((()=>"string"==typeof n.rotate?parseFloat(n.rotate):n.rotate)),l=e.ref(!0),i=v(),{modifiers:a}=e.toRefs(n),u=p("vv-icon",a),s=e.computed((()=>n.provider||(null==i?void 0:i.iconsProvider))),c=e.computed((()=>{const e=n.name??"",o=`@${s.value}:${n.prefix}:${e}`;if(t.iconExists(o))return o;const r=null==i?void 0:i.iconsCollections.find((o=>{const n=`@${s.value}:${o.prefix}:${e}`;return t.iconExists(n)}));return r?`@${s.value}:${r.prefix}:${e}`:e}));function d(e){const o=function(e){let t;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");t=(new e).window}return(t?new t.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),r=(null==o?void 0:o.innerHTML.trim())||"";o&&r&&t.addIcon(`@${s.value}:${n.prefix}:${n.name}`,{body:r,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return i&&n.src&&!t.iconExists(`@${s.value}:${n.prefix}:${n.name}`)&&(l.value=!1,i.fetchIcon(n.src).then((e=>{e&&(d(e),l.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),n.svg&&d(n.svg),(o,n)=>e.unref(l)?(e.openBlock(),e.createBlock(e.unref(t.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:o.inline,width:o.width,height:o.height,horizontalFlip:o.horizontalFlip,verticalFlip:o.verticalFlip,flip:o.flip,rotate:e.unref(r),color:o.color,onLoad:o.onLoad,icon:e.unref(c)}),null,16,["class"])):e.createCommentVNode("",!0)}}),g={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(u).includes(e)},rel:{type:String,default:"noopener noreferrer"}},b={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},y={disabled:Boolean},h={active:Boolean},S={pressed:Boolean},k={label:[String,Number]},B={modifiers:[String,Array]};l.before;const $={unselectable:{type:Boolean,default:!0}},x={id:[String,Number]};r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const w={...y,...k,...S,...h,...g,type:{type:String,default:i.button,validator:e=>Object.values(i).includes(e)},ariaLabel:{type:String,default:void 0}},A=w;const L=e.defineComponent({name:"VvAction",props:A,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:n}){const r=t,l=v(),i=e.ref(null);o({$el:i});const{reference:u,bus:s,aria:c,expanded:p}=e.inject(d,{});e.watch((()=>i.value),(e=>{u&&(u.value=e)}));const m=e.computed((()=>r.pressed||(null==p?void 0:p.value))),{role:g}=e.inject(f,{}),b=e.computed((()=>{switch(!0){case r.disabled:return a.button;case void 0!==r.to:return(null==l?void 0:l.nuxt)?a.nuxtLink:a.routerLink;case void 0!==r.href:return a.a;default:return a.button}})),y=e.computed((()=>{const e={...null==c?void 0:c.value,ariaPressed:!!m.value||void 0,ariaLabel:r.ariaLabel,role:null==g?void 0:g.value};switch(b.value){case a.a:return{...e,href:r.href,target:r.target,rel:r.rel};case a.routerLink:case a.nuxtLink:return{...e,to:r.to,target:r.target};default:return{...e,type:r.type,disabled:r.disabled}}})),h=e=>{r.disabled?e.preventDefault():(null==s||s.emit("click",e),n("click",e))},S=e=>{null==s||s.emit("mouseover",e),n("mouseover",e)},k=e=>{null==s||s.emit("mouseleave",e),n("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(b)),e.mergeProps(e.unref(y),{ref_key:"element",ref:i,class:{active:t.active,pressed:e.unref(m),disabled:t.disabled},onClickPassive:h,onMouseoverPassive:S,onMouseleavePassive:k}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}});function j(e,t,o){return o?_(e,o)===_(t,o):V(e,t)}function V(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const o=Array.isArray(e),n=Array.isArray(t);let r,l,i;if(o&&n){if(l=e.length,l!=t.length)return!1;for(r=l;0!=r--;)if(!V(e[r],t[r]))return!1;return!0}if(o!=n)return!1;const a=e instanceof Date,u=t instanceof Date;if(a!=u)return!1;if(a&&u)return e.getTime()==t.getTime();const s=e instanceof RegExp,c=t instanceof RegExp;if(s!=c)return!1;if(s&&c)return e.toString()==t.toString();const d=Object.keys(e);if(l=d.length,l!==Object.keys(t).length)return!1;for(r=l;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,d[r]))return!1;for(r=l;0!=r--;)if(i=d[r],!V(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function _(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const o=t.split(".");let n=e;for(let t=0,r=o.length;t<r;++t){if(null==e)return null;n=n[o[t]]}return n}}return null}function O(e,t){if(null!=e&&t&&t.length)for(const o of t)if(j(e,o))return!0;return!1}function P(t){const o=e.inject(t,void 0),n=e.computed((()=>{return t=o,!(null==(n=e.unref(t))||""===n||Array.isArray(n)&&0===n.length||!(n instanceof Date)&&"object"==typeof n&&0===Object.keys(n).length);var t,n}));return{group:o,isInGroup:n,getGroupOrLocalRef:function(t,n,r){if(null==o?void 0:o.value){const n=e.unref(o.value)[t];return e.computed({get:()=>null==n?void 0:n.value,set(e){n.value=e}})}const l=e.toRef(n,t);return e.computed({get:()=>l.value,set(e){r&&r(`update:${t}`,e)}})}}}const N={...w,...x,...B,...$,...b,icon:[String,Object],iconPosition:{type:String,default:r.left,validator:e=>Object.values(r).includes(e)},loadingIcon:{type:String,default:"eos-icons:bubble-loading"},toggle:{type:Boolean,default:!1},value:{type:[String,Number,Boolean],default:void 0},uncheckedValue:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[String,Number,Boolean],default:void 0}};const C={key:1,class:"vv-button__label"},E={key:1,class:"vv-button__label"};return e.defineComponent({name:"VvButton",props:N,emits:["update:modelValue"],setup(t,{expose:n,emit:l}){const i=t,a=e.useAttrs(),u=e.useSlots(),{id:s,modifiers:d,iconPosition:f,icon:v,label:g,modelValue:b,disabled:y,toggle:h,unselectable:S}=function(t,o){const{group:n,isInGroup:r,getGroupOrLocalRef:l}=P(c),{id:i,iconPosition:a,icon:u,label:s,pressed:d}=e.toRefs(t),f=l("modelValue",t,o),v=l("toggle",t),p=l("unselectable",t),m=e.computed((()=>(null==n?void 0:n.value.multiple.value)??!1)),g=e.computed((()=>{let e=t.modifiers,o=null==n?void 0:n.value.modifiers.value;const r=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>r.add(e)))),o&&(Array.isArray(o)||(o=o.split(" ")),o.forEach((e=>r.add(e)))),Array.from(r)})),b=e.computed((()=>{var e;return Boolean(t.disabled||(null==(e=null==n?void 0:n.value)?void 0:e.disabled.value))}));return{group:n,isInGroup:r,modelValue:f,toggle:v,unselectable:p,multiple:m,modifiers:g,disabled:b,id:i,pressed:d,iconPosition:a,icon:u,label:s}}(i,l),k=(t=>e.computed((()=>String((null==t?void 0:t.value)||o.nanoid()))))(s),B=e.computed((()=>(null==a?void 0:a.name)||k.value)),$=e.ref(null);n({$el:e.computed((()=>{var e;return null==(e=$.value)?void 0:e.$el}))});const x=e.computed((()=>h.value?Array.isArray(b.value)?O(B.value,b.value):j(B.value,b.value):i.pressed)),w=p("vv-button",d,e.computed((()=>({reverse:[r.right,r.bottom].includes(f.value),column:[r.top,r.bottom].includes(f.value),"icon-only":Boolean((null==v?void 0:v.value)&&!(null==g?void 0:g.value)&&!u.default)})))),A=e.computed((()=>"string"==typeof(null==v?void 0:v.value)?{name:null==v?void 0:v.value}:null==v?void 0:v.value)),V=e.computed((()=>void 0!==i.value?i.value:B.value)),_=()=>{if(h.value){if(Array.isArray(b.value))return O(V.value,b.value)?void(S.value&&(b.value=b.value.filter((e=>e!==V.value)))):void b.value.push(V.value);if(V.value===b.value&&S.value)return void(b.value=i.uncheckedValue);b.value=V.value}};return(t,o)=>(e.openBlock(),e.createBlock(L,e.mergeProps({disabled:e.unref(y),pressed:e.unref(x),active:t.active,type:t.type,to:t.to,href:t.href,target:t.target,rel:t.rel,ariaLabel:t.ariaLabel},{id:e.unref(k),ref_key:"element",ref:$,class:e.unref(w),onClick:_}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[t.loading?e.renderSlot(t.$slots,"loading",{key:0},(()=>[t.loadingIcon?(e.openBlock(),e.createBlock(m,{key:0,class:"vv-button__loading-icon",name:t.loadingIcon},null,8,["name"])):e.createCommentVNode("",!0),t.loadingLabel?(e.openBlock(),e.createElementBlock("span",C,e.toDisplayString(t.loadingLabel),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(t.$slots,"before"),e.unref(v)?(e.openBlock(),e.createBlock(m,e.mergeProps({key:0,class:"vv-button__icon"},e.unref(A)),null,16)):e.createCommentVNode("",!0),e.unref(g)?(e.openBlock(),e.createElementBlock("span",E,[e.renderSlot(t.$slots,"label",{},(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)),1)]))])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"after")],64))]))])),_:3},16,["id","class"]))}})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@iconify/vue"),require("uid")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","uid"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvButton=t(e.vue,e.vue$1,e.uid)}(this,(function(e,t,o){"use strict";const n={prefix:"normal"};var l=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(l||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),a=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(a||{}),u=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(u||{}),i=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(i||{});const s=Symbol.for("volver"),d=Symbol.for("buttonGroup"),c=Symbol.for("dropdownTrigger"),v=Symbol.for("dropdownAction");function f(){return e.inject(s)}function p(t,o,n){return e.computed((()=>{const l={[t]:!0},r="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return r&&Array.isArray(r)&&r.forEach((e=>{e&&(l[`${t}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((o=>{l[`${t}--${o}`]=e.unref(n.value[o])})),l}))}const m=e.defineComponent({name:"VvIcon",props:e.mergeDefaults({name:{},color:{},width:{},height:{},provider:{},prefix:{},src:{},horizontalFlip:{type:Boolean},verticalFlip:{type:Boolean},flip:{},mode:{},inline:{type:Boolean},rotate:{},onLoad:{type:Function},svg:{},modifiers:{}},n),setup(o){const n=o,l=e.computed((()=>"string"==typeof n.rotate?parseFloat(n.rotate):n.rotate)),r=e.ref(!0),a=f(),{modifiers:u}=e.toRefs(n),i=p("vv-icon",u),s=e.computed((()=>n.provider||(null==a?void 0:a.iconsProvider))),d=e.computed((()=>{const e=n.name??"",o=`@${s.value}:${n.prefix}:${e}`;if(t.iconExists(o))return o;const l=null==a?void 0:a.iconsCollections.find((o=>{const n=`@${s.value}:${o.prefix}:${e}`;return t.iconExists(n)}));return l?`@${s.value}:${l.prefix}:${e}`:e}));function c(e){const o=function(e){let t;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");t=(new e).window}return(t?new t.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),l=(null==o?void 0:o.innerHTML.trim())||"";o&&l&&t.addIcon(`@${s.value}:${n.prefix}:${n.name}`,{body:l,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return a&&n.src&&!t.iconExists(`@${s.value}:${n.prefix}:${n.name}`)&&(r.value=!1,a.fetchIcon(n.src).then((e=>{e&&(c(e),r.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),n.svg&&c(n.svg),(o,n)=>e.unref(r)?(e.openBlock(),e.createBlock(e.unref(t.Icon),e.mergeProps({key:0,class:e.unref(i)},{inline:o.inline,width:o.width,height:o.height,horizontalFlip:o.horizontalFlip,verticalFlip:o.verticalFlip,flip:o.flip,rotate:e.unref(l),color:o.color,onLoad:o.onLoad,icon:e.unref(d)}),null,16,["class"])):e.createCommentVNode("v-if",!0)}}),g={to:{type:[String,Object]},href:String,target:{type:String,default:void 0,validator:e=>Object.values(i).includes(e)},rel:{type:String,default:"noopener noreferrer"}},b={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},y={disabled:{type:Boolean,default:!1}},h={active:{type:Boolean,default:!1}},k={current:{type:Boolean,default:!1}},B={pressed:{type:Boolean,default:!1}},S={label:{type:[String,Number],default:void 0}},$={modifiers:{type:[String,Array],default:void 0}},x={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:r.before,validation:e=>Object.values(r).includes(e)}},w={unselectable:{type:Boolean,default:!0}},A={id:[String,Number]};l.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const L={...y,...S,...B,...h,...k,...g,type:{type:String,default:a.button,validator:e=>Object.values(a).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:u.button}},j=L;const V=e.defineComponent({name:"VvAction",props:j,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:n}){const l=t,r=n,a=f(),i=e.ref(null);o({$el:i});const{reference:s,bus:d,aria:p,expanded:m}=e.inject(c,{});e.watch((()=>i.value),(e=>{s&&(s.value=e)}));const g=e.computed((()=>l.pressed||(null==m?void 0:m.value))),{role:b}=e.inject(v,{}),y=e.computed((()=>{switch(!0){case l.disabled:return u.button;case void 0!==l.to:return(null==a?void 0:a.nuxt)?u.nuxtLink:u.routerLink;case void 0!==l.href:return u.a;default:return l.defaultTag}})),h=e.computed((()=>{const e={...null==p?void 0:p.value,ariaPressed:!!g.value||void 0,ariaLabel:l.ariaLabel,role:null==b?void 0:b.value};switch(y.value){case u.a:return{...e,href:l.href,target:l.target,rel:l.rel};case u.routerLink:case u.nuxtLink:return{...e,to:l.to,target:l.target};case u.button:return{...e,type:l.type,disabled:l.disabled};default:return e}})),k=e=>{l.disabled?e.preventDefault():(null==d||d.emit("click",e),r("click",e))},B=e=>{null==d||d.emit("mouseover",e),r("mouseover",e)},S=e=>{null==d||d.emit("mouseleave",e),r("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(y)),e.mergeProps(e.unref(h),{ref_key:"element",ref:i,class:{active:t.active,pressed:e.unref(g),disabled:t.disabled,current:t.current},onClickPassive:k,onMouseoverPassive:B,onMouseleavePassive:S}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}});function _(e,t,o){return o?I(e,o)===I(t,o):O(e,t)}function O(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const o=Array.isArray(e),n=Array.isArray(t);let l,r,a;if(o&&n){if(r=e.length,r!=t.length)return!1;for(l=r;0!=l--;)if(!O(e[l],t[l]))return!1;return!0}if(o!=n)return!1;const u=e instanceof Date,i=t instanceof Date;if(u!=i)return!1;if(u&&i)return e.getTime()==t.getTime();const s=e instanceof RegExp,d=t instanceof RegExp;if(s!=d)return!1;if(s&&d)return e.toString()==t.toString();const c=Object.keys(e);if(r=c.length,r!==Object.keys(t).length)return!1;for(l=r;0!=l--;)if(!Object.prototype.hasOwnProperty.call(t,c[l]))return!1;for(l=r;0!=l--;)if(a=c[l],!O(e[a],t[a]))return!1;return!0}return e!=e&&t!=t}function I(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const o=t.split(".");let n=e;for(let t=0,l=o.length;t<l;++t){if(null==e)return null;n=n[o[t]]}return n}}return null}function P(e,t){if(null!=e&&t&&t.length)for(const o of t)if(_(e,o))return!0;return!1}function C(t){const o=e.inject(t,void 0),n=e.computed((()=>{return t=o,!(null==(n=e.unref(t))||""===n||Array.isArray(n)&&0===n.length||!(n instanceof Date)&&"object"==typeof n&&0===Object.keys(n).length);var t,n}));return{group:o,isInGroup:n,getGroupOrLocalRef:function(t,n,l){if(null==o?void 0:o.value){const n=e.unref(o.value)[t];return e.computed({get:()=>null==n?void 0:n.value,set(e){n.value=e}})}const r=e.toRef(n,t);return e.computed({get:()=>r.value,set(e){l&&l(`update:${t}`,e)}})}}}const E={...L,...A,...$,...w,...b,...x,iconPosition:{type:String,default:l.left,validator:e=>Object.values(l).includes(e)},loadingIcon:{type:String,default:"eos-icons:bubble-loading"},toggle:{type:Boolean,default:!1},value:{type:[String,Number,Boolean],default:void 0},uncheckedValue:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[String,Number,Boolean],default:void 0}};const D={key:1,class:"vv-button__label"},N={key:1,class:"vv-button__label"};return e.defineComponent({name:"VvButton",props:E,emits:["update:modelValue"],setup(t,{expose:n,emit:a}){const u=t,i=e.useAttrs(),s=e.useSlots(),c=a,{id:v,modifiers:f,iconPosition:g,icon:b,label:y,modelValue:h,disabled:k,toggle:B,unselectable:S}=function(t,o){const{group:n,isInGroup:l,getGroupOrLocalRef:r}=C(d),{id:a,iconPosition:u,icon:i,label:s,pressed:c}=e.toRefs(t),v=r("modelValue",t,o),f=r("toggle",t),p=r("unselectable",t),m=e.computed((()=>(null==n?void 0:n.value.multiple.value)??!1)),g=e.computed((()=>{let e=t.modifiers,o=null==n?void 0:n.value.modifiers.value;const l=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>l.add(e)))),o&&(Array.isArray(o)||(o=o.split(" ")),o.forEach((e=>l.add(e)))),Array.from(l)})),b=e.computed((()=>{var e;return Boolean(t.disabled||(null==(e=null==n?void 0:n.value)?void 0:e.disabled.value))}));return{group:n,isInGroup:l,modelValue:v,toggle:f,unselectable:p,multiple:m,modifiers:g,disabled:b,id:a,pressed:c,iconPosition:u,icon:i,label:s}}(u,c),$=(t=>e.computed((()=>String((null==t?void 0:t.value)||o.uid()))))(v),x=e.computed((()=>(null==i?void 0:i.name)||$.value)),w=e.ref(null);n({$el:e.computed((()=>{var e;return null==(e=w.value)?void 0:e.$el}))});const A=e.computed((()=>B.value?Array.isArray(h.value)?P(x.value,h.value):_(x.value,h.value):u.pressed)),L=p("vv-button",f,e.computed((()=>({reverse:[l.right,l.bottom].includes(g.value),column:[l.top,l.bottom].includes(g.value),"icon-only":Boolean((null==b?void 0:b.value)&&!(null==y?void 0:y.value)&&!s.default)})))),{hasIcon:j}=function(t,o){const n=e.computed((()=>"string"==typeof(null==t?void 0:t.value)?{name:null==t?void 0:t.value}:null==t?void 0:t.value)),a=e.computed((()=>(null==o?void 0:o.value)===r.before?n.value:void 0)),u=e.computed((()=>(null==o?void 0:o.value)===r.after?n.value:void 0)),i=e.computed((()=>(null==o?void 0:o.value)===l.left?n.value:void 0)),s=e.computed((()=>(null==o?void 0:o.value)===l.right?n.value:void 0)),d=e.computed((()=>(null==o?void 0:o.value)===l.top?n.value:void 0)),c=e.computed((()=>(null==o?void 0:o.value)===l.bottom?n.value:void 0));return{hasIcon:n,hasIconLeft:i,hasIconRight:s,hasIconTop:d,hasIconBottom:c,hasIconBefore:a,hasIconAfter:u}}(b),O=e.computed((()=>void 0!==u.value?u.value:x.value)),I=()=>{if(B.value){if(Array.isArray(h.value))return P(O.value,h.value)?void(S.value&&(h.value=h.value.filter((e=>e!==O.value)))):void h.value.push(O.value);if(O.value===h.value&&S.value)return void(h.value=u.uncheckedValue);h.value=O.value}};return(t,o)=>(e.openBlock(),e.createBlock(V,e.mergeProps({disabled:e.unref(k),pressed:e.unref(A),active:t.active,type:t.type,to:t.to,href:t.href,target:t.target,rel:t.rel,ariaLabel:t.ariaLabel},{id:e.unref($),ref_key:"element",ref:w,class:e.unref(L),onClick:I}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[t.loading?e.renderSlot(t.$slots,"loading",{key:0},(()=>[t.loadingIcon?(e.openBlock(),e.createBlock(m,{key:0,class:"vv-button__loading-icon",name:t.loadingIcon},null,8,["name"])):e.createCommentVNode("v-if",!0),t.loadingLabel?(e.openBlock(),e.createElementBlock("span",D,e.toDisplayString(t.loadingLabel),1)):e.createCommentVNode("v-if",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(t.$slots,"before"),e.unref(j)?(e.openBlock(),e.createBlock(m,e.mergeProps({key:0},e.unref(j),{class:"vv-button__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.unref(y)?(e.openBlock(),e.createElementBlock("span",N,[e.renderSlot(t.$slots,"label",{},(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)),1)]))])):e.createCommentVNode("v-if",!0),e.renderSlot(t.$slots,"after")],64))]))])),_:3},16,["id","class"]))}})}));