@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,5 +1,5 @@
1
1
  import { unref, inject, computed, toRef, toRefs, defineComponent, useAttrs, ref, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, renderSlot, normalizeProps, guardReactiveProps, createTextVNode, toDisplayString, isRef, provide, watchEffect, watch, Fragment, renderList, createBlock, mergeProps, withCtx } from "vue";
2
- import { nanoid } from "nanoid";
2
+ import { uid } from "uid";
3
3
  import { useToggle, useStorage } from "@vueuse/core";
4
4
  var Strategy = /* @__PURE__ */ ((Strategy2) => {
5
5
  Strategy2["absolute"] = "absolute";
@@ -35,6 +35,13 @@ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
35
35
  ButtonType2["reset"] = "reset";
36
36
  return ButtonType2;
37
37
  })(ButtonType || {});
38
+ var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
39
+ ActionTag2["nuxtLink"] = "nuxt-link";
40
+ ActionTag2["routerLink"] = "router-link";
41
+ ActionTag2["a"] = "a";
42
+ ActionTag2["button"] = "button";
43
+ return ActionTag2;
44
+ })(ActionTag || {});
38
45
  var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
39
46
  AnchorTarget2["_blank"] = "_blank";
40
47
  AnchorTarget2["_self"] = "_self";
@@ -60,6 +67,7 @@ const LinkProps = {
60
67
  */
61
68
  target: {
62
69
  type: String,
70
+ default: void 0,
63
71
  validator: (value) => Object.values(AnchorTarget).includes(value)
64
72
  },
65
73
  /**
@@ -74,38 +82,65 @@ const DisabledProps = {
74
82
  /**
75
83
  * Whether the form control is disabled
76
84
  */
77
- disabled: Boolean
85
+ disabled: {
86
+ type: Boolean,
87
+ default: false
88
+ }
78
89
  };
79
90
  const ActiveProps = {
80
91
  /**
81
92
  * Whether the item is active
82
93
  */
83
- active: Boolean
94
+ active: {
95
+ type: Boolean,
96
+ default: false
97
+ }
98
+ };
99
+ const CurrentProps = {
100
+ /**
101
+ * Whether the item is current
102
+ */
103
+ current: {
104
+ type: Boolean,
105
+ default: false
106
+ }
84
107
  };
85
108
  const PressedProps = {
86
109
  /**
87
110
  * Whether the item is pressed
88
111
  */
89
- pressed: Boolean
112
+ pressed: {
113
+ type: Boolean,
114
+ default: false
115
+ }
90
116
  };
91
117
  const LabelProps = {
92
118
  /**
93
119
  * The item label
94
120
  */
95
- label: [String, Number]
121
+ label: {
122
+ type: [String, Number],
123
+ default: void 0
124
+ }
96
125
  };
97
126
  const ModifiersProps = {
98
127
  /**
99
128
  * Component BEM modifiers
100
129
  */
101
- modifiers: [String, Array]
130
+ modifiers: {
131
+ type: [String, Array],
132
+ default: void 0
133
+ }
102
134
  };
103
135
  ({
104
136
  /**
105
137
  * VvIcon name or props
106
138
  * @see VVIcon
107
139
  */
108
- icon: { type: [String, Object] },
140
+ icon: {
141
+ type: [String, Object],
142
+ default: void 0
143
+ },
109
144
  /**
110
145
  * VvIcon position
111
146
  */
@@ -136,7 +171,8 @@ const ModifiersProps = {
136
171
  * Dropdown show / hide transition name
137
172
  */
138
173
  transitionName: {
139
- type: String
174
+ type: String,
175
+ default: void 0
140
176
  },
141
177
  /**
142
178
  * Offset of the dropdown from the trigger
@@ -204,7 +240,8 @@ const ModifiersProps = {
204
240
  * Set dropdown width to the same as the trigger
205
241
  */
206
242
  triggerWidth: {
207
- type: Boolean
243
+ type: Boolean,
244
+ default: false
208
245
  }
209
246
  });
210
247
  ({
@@ -212,6 +249,7 @@ const ModifiersProps = {
212
249
  ...LabelProps,
213
250
  ...PressedProps,
214
251
  ...ActiveProps,
252
+ ...CurrentProps,
215
253
  ...LinkProps,
216
254
  /**
217
255
  * Button type
@@ -227,6 +265,13 @@ const ModifiersProps = {
227
265
  ariaLabel: {
228
266
  type: String,
229
267
  default: void 0
268
+ },
269
+ /**
270
+ * Default tag for the action
271
+ */
272
+ defaultTag: {
273
+ type: String,
274
+ default: ActionTag.button
230
275
  }
231
276
  });
232
277
  function isEmpty(value) {
@@ -374,11 +419,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
374
419
  ...__default__$1,
375
420
  props: VvAccordionProps,
376
421
  emits: VvAccordionEvents,
377
- setup(__props, { emit }) {
422
+ setup(__props, { emit: __emit }) {
378
423
  const props = __props;
379
424
  const attrs = useAttrs();
425
+ const emit = __emit;
380
426
  const accordionName = computed(
381
- () => props.name || (attrs == null ? void 0 : attrs.id) || nanoid()
427
+ () => props.name || (attrs == null ? void 0 : attrs.id) || uid()
382
428
  );
383
429
  const {
384
430
  modifiers,
@@ -451,7 +497,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
451
497
  onClick: _cache[0] || (_cache[0] = withModifiers(($event) => unref(onClick)(), ["prevent"]))
452
498
  }, [
453
499
  renderSlot(_ctx.$slots, "summary", normalizeProps(guardReactiveProps({ open: unref(isOpen) })), () => [
454
- createTextVNode(toDisplayString(unref(title)), 1)
500
+ createTextVNode(
501
+ toDisplayString(unref(title)),
502
+ 1
503
+ /* TEXT */
504
+ )
455
505
  ])
456
506
  ], 8, _hoisted_2),
457
507
  createElementVNode("div", {
@@ -459,7 +509,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
459
509
  class: "vv-accordion__content"
460
510
  }, [
461
511
  renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({ open: unref(isOpen) })), () => [
462
- createTextVNode(toDisplayString(unref(content)), 1)
512
+ createTextVNode(
513
+ toDisplayString(unref(content)),
514
+ 1
515
+ /* TEXT */
516
+ )
463
517
  ])
464
518
  ], 8, _hoisted_3)
465
519
  ], 10, _hoisted_1);
@@ -522,8 +576,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
522
576
  ...__default__,
523
577
  props: VvAccordionGroupProps,
524
578
  emits: VvAccordionGroupEvents,
525
- setup(__props, { emit }) {
579
+ setup(__props, { emit: __emit }) {
526
580
  const props = __props;
581
+ const emit = __emit;
527
582
  const { disabled, collapse, modifiers, itemModifiers, items, not } = toRefs(props);
528
583
  watchEffect(() => {
529
584
  if (typeof props.modelValue === "string" && collapse.value) {
@@ -581,29 +636,48 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
581
636
  }))
582
637
  );
583
638
  return (_ctx, _cache) => {
584
- return openBlock(), createElementBlock("div", {
585
- class: normalizeClass(unref(bemCssClasses))
586
- }, [
587
- renderSlot(_ctx.$slots, "default", {}, () => [
588
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(items), (item) => {
589
- return openBlock(), createBlock(_sfc_main$1, mergeProps({
590
- key: item.title
591
- }, {
592
- name: item.name,
593
- title: item.title,
594
- content: item.content
595
- }), {
596
- header: withCtx((data) => [
597
- renderSlot(_ctx.$slots, `header::${item.name}`, normalizeProps(guardReactiveProps(data)))
598
- ]),
599
- details: withCtx((data) => [
600
- renderSlot(_ctx.$slots, `details::${item.name}`, normalizeProps(guardReactiveProps(data)))
601
- ]),
602
- _: 2
603
- }, 1040);
604
- }), 128))
605
- ])
606
- ], 2);
639
+ return openBlock(), createElementBlock(
640
+ "div",
641
+ {
642
+ class: normalizeClass(unref(bemCssClasses))
643
+ },
644
+ [
645
+ renderSlot(_ctx.$slots, "default", {}, () => [
646
+ (openBlock(true), createElementBlock(
647
+ Fragment,
648
+ null,
649
+ renderList(unref(items), (item) => {
650
+ return openBlock(), createBlock(
651
+ _sfc_main$1,
652
+ mergeProps({
653
+ key: item.title
654
+ }, {
655
+ name: item.name,
656
+ title: item.title,
657
+ content: item.content
658
+ }),
659
+ {
660
+ header: withCtx((data) => [
661
+ renderSlot(_ctx.$slots, `header::${item.name}`, normalizeProps(guardReactiveProps(data)))
662
+ ]),
663
+ details: withCtx((data) => [
664
+ renderSlot(_ctx.$slots, `details::${item.name}`, normalizeProps(guardReactiveProps(data)))
665
+ ]),
666
+ _: 2
667
+ /* DYNAMIC */
668
+ },
669
+ 1040
670
+ /* FULL_PROPS, DYNAMIC_SLOTS */
671
+ );
672
+ }),
673
+ 128
674
+ /* KEYED_FRAGMENT */
675
+ ))
676
+ ])
677
+ ],
678
+ 2
679
+ /* CLASS */
680
+ );
607
681
  };
608
682
  }
609
683
  });
@@ -1 +1 @@
1
- !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("nanoid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","nanoid","@vueuse/core"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAccordionGroup=o(e.vue,e.nanoid,e.core)}(this,(function(e,o,r){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),a=(e=>(e.before="before",e.after="after",e))(a||{}),l=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(l||{});const n=Symbol.for("accordionGroup"),u=(Boolean,Boolean,Boolean,{modifiers:[String,Array]});function i(o){const r=e.inject(o,void 0),t=e.computed((()=>{return o=r,!(null==(t=e.unref(o))||""===t||Array.isArray(t)&&0===t.length||!(t instanceof Date)&&"object"==typeof t&&0===Object.keys(t).length);var o,t}));return{group:r,isInGroup:t,getGroupOrLocalRef:function(o,t,a){if(null==r?void 0:r.value){const t=e.unref(r.value)[o];return e.computed({get:()=>null==t?void 0:t.value,set(e){t.value=e}})}const l=e.toRef(t,o);return e.computed({get:()=>l.value,set(e){a&&a(`update:${o}`,e)}})}}}a.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,l.button;const d={...u,name:String,title:String,content:String,modelValue:{type:Boolean,default:void 0},disabled:Boolean,not:Boolean};function s(o,r,t){return e.computed((()=>{const a={[o]:!0},l="string"==typeof(null==r?void 0:r.value)?r.value.split(" "):null==r?void 0:r.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(a[`${o}--${e}`]=!0)})),t&&Object.keys(t.value).forEach((r=>{a[`${o}--${r}`]=e.unref(t.value[r])})),a}))}const c=["id","open"],v=["aria-controls","aria-expanded"],p=["aria-hidden"],m=e.defineComponent({name:"VvAccordion",props:d,emits:["update:modelValue"],setup(t,{emit:a}){const l=t,u=e.useAttrs(),d=e.computed((()=>l.name||(null==u?void 0:u.id)||o.nanoid())),{modifiers:m,title:f,content:y,disabled:g,collapse:b,modelValue:A,isInGroup:B,not:V}=function(o,r){const{group:t,isInGroup:a,getGroupOrLocalRef:l}=i(n),{title:u,content:d}=e.toRefs(o),s=l("modelValue",o,r),c=l("not",o),v=l("collapse",o),p=e.computed((()=>{var e;return Boolean(o.disabled||(null==(e=null==t?void 0:t.value)?void 0:e.disabled.value))})),m=e.computed((()=>{let e=o.modifiers,r=null==t?void 0:t.value.modifiers.value;const a=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>a.add(e)))),r&&(Array.isArray(r)||(r=r.split(" ")),r.forEach((e=>a.add(e)))),Array.from(a)}));return{modelValue:s,not:c,isInGroup:a,group:t,collapse:v,modifiers:m,disabled:p,title:u,content:d}}(l,a),h=e.ref(!1),S=e.computed({get:()=>{let e=A.value;return B.value?e=b.value&&Array.isArray(A.value)?A.value.includes(d.value):A.value===d.value:void 0===A.value&&(e=h.value),V.value?!e:e},set:e=>{if(V.value&&(e=!e),B.value)return b.value&&Array.isArray(A.value)?e?void A.value.push(d.value):void(A.value=A.value.filter((e=>e!==d.value))):void(A.value=e?d.value:null);void 0!==A.value||"boolean"!=typeof e?A.value=e:h.value=e}}),k=s("vv-accordion",m,e.computed((()=>({disabled:g.value})))),$=r.useToggle(S);return(o,r)=>(e.openBlock(),e.createElementBlock("details",{id:e.unref(d),class:e.normalizeClass(e.unref(k)),open:e.unref(S)},[e.createElementVNode("summary",{"aria-controls":e.unref(d),"aria-expanded":e.unref(S),class:"vv-accordion__summary",onClick:r[0]||(r[0]=e.withModifiers((o=>e.unref($)()),["prevent"]))},[e.renderSlot(o.$slots,"summary",e.normalizeProps(e.guardReactiveProps({open:e.unref(S)})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)),1)]))],8,v),e.createElementVNode("div",{"aria-hidden":!e.unref(S),class:"vv-accordion__content"},[e.renderSlot(o.$slots,"default",e.normalizeProps(e.guardReactiveProps({open:e.unref(S)})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)),1)]))],8,p)],10,c))}}),f={...u,modelValue:[String,Array],items:{type:Array,default:()=>[]},collapse:Boolean,itemModifiers:{type:[String,Array],default:""},disabled:Boolean,not:Boolean,storeKey:String};return e.defineComponent({name:"VvAccordionGroup",props:f,emits:["update:modelValue"],setup(o,{emit:t}){const a=o,{disabled:l,collapse:u,modifiers:i,itemModifiers:d,items:c,not:v}=e.toRefs(a);e.watchEffect((()=>{"string"==typeof a.modelValue&&u.value&&console.warn("[VvAccordionGroup]: modelValue is a string but collapse is true.")}));let p=e.ref([]);e.watch((()=>a.storeKey),(o=>{p=o?r.useStorage(o,p.value):e.ref([])}),{immediate:!0});const f=e.computed({get:()=>{var e;return void 0!==a.modelValue?u.value?a.modelValue:Array.isArray(a.modelValue)?a.modelValue[0]:a.modelValue:u.value?p.value:null==(e=p.value)?void 0:e[0]},set:e=>{if(void 0!==a.modelValue)return!Array.isArray(a.modelValue)&&!u.value||Array.isArray(e)||(e=[e]),t("update:modelValue",e);p.value=Array.isArray(e)?e:[e]}});!function(o){if(Object.keys(o).some((r=>"key"!==r&&!e.isRef(o[r]))))throw Error("One or more groupState props aren't ref.");e.provide(o.key,e.computed((()=>o)))}({key:n,modelValue:f,disabled:l,collapse:u,modifiers:d,not:v});const y=s("vv-accordion-group",i,e.computed((()=>({disabled:l.value}))));return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(y))},[e.renderSlot(o.$slots,"default",{},(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),(r=>(e.openBlock(),e.createBlock(m,e.mergeProps({key:r.title},{name:r.name,title:r.title,content:r.content}),{header:e.withCtx((t=>[e.renderSlot(o.$slots,`header::${r.name}`,e.normalizeProps(e.guardReactiveProps(t)))])),details:e.withCtx((t=>[e.renderSlot(o.$slots,`details::${r.name}`,e.normalizeProps(e.guardReactiveProps(t)))])),_:2},1040)))),128))]))],2))}})}));
1
+ !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("uid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","uid","@vueuse/core"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAccordionGroup=o(e.vue,e.uid,e.core)}(this,(function(e,o,t){"use strict";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||{}),a=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(a||{}),n=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(n||{});const u=Symbol.for("accordionGroup"),i=(Boolean,Boolean,Boolean,Boolean,{modifiers:{type:[String,Array],default:void 0}});function d(o){const t=e.inject(o,void 0),r=e.computed((()=>{return o=t,!(null==(r=e.unref(o))||""===r||Array.isArray(r)&&0===r.length||!(r instanceof Date)&&"object"==typeof r&&0===Object.keys(r).length);var o,r}));return{group:t,isInGroup:r,getGroupOrLocalRef:function(o,r,l){if(null==t?void 0:t.value){const r=e.unref(t.value)[o];return e.computed({get:()=>null==r?void 0:r.value,set(e){r.value=e}})}const a=e.toRef(r,o);return e.computed({get:()=>a.value,set(e){l&&l(`update:${o}`,e)}})}}}l.before,r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,a.button,n.button;const s={...i,name:String,title:String,content:String,modelValue:{type:Boolean,default:void 0},disabled:Boolean,not:Boolean};function c(o,t,r){return e.computed((()=>{const l={[o]:!0},a="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return a&&Array.isArray(a)&&a.forEach((e=>{e&&(l[`${o}--${e}`]=!0)})),r&&Object.keys(r.value).forEach((t=>{l[`${o}--${t}`]=e.unref(r.value[t])})),l}))}const v=["id","open"],p=["aria-controls","aria-expanded"],m=["aria-hidden"],f=e.defineComponent({name:"VvAccordion",props:s,emits:["update:modelValue"],setup(r,{emit:l}){const a=r,n=e.useAttrs(),i=l,s=e.computed((()=>a.name||(null==n?void 0:n.id)||o.uid())),{modifiers:f,title:y,content:g,disabled:b,collapse:A,modelValue:B,isInGroup:V,not:h}=function(o,t){const{group:r,isInGroup:l,getGroupOrLocalRef:a}=d(u),{title:n,content:i}=e.toRefs(o),s=a("modelValue",o,t),c=a("not",o),v=a("collapse",o),p=e.computed((()=>{var e;return Boolean(o.disabled||(null==(e=null==r?void 0:r.value)?void 0:e.disabled.value))})),m=e.computed((()=>{let e=o.modifiers,t=null==r?void 0:r.value.modifiers.value;const l=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>l.add(e)))),t&&(Array.isArray(t)||(t=t.split(" ")),t.forEach((e=>l.add(e)))),Array.from(l)}));return{modelValue:s,not:c,isInGroup:l,group:r,collapse:v,modifiers:m,disabled:p,title:n,content:i}}(a,i),k=e.ref(!1),S=e.computed({get:()=>{let e=B.value;return V.value?e=A.value&&Array.isArray(B.value)?B.value.includes(s.value):B.value===s.value:void 0===B.value&&(e=k.value),h.value?!e:e},set:e=>{if(h.value&&(e=!e),V.value)return A.value&&Array.isArray(B.value)?e?void B.value.push(s.value):void(B.value=B.value.filter((e=>e!==s.value))):void(B.value=e?s.value:null);void 0!==B.value||"boolean"!=typeof e?B.value=e:k.value=e}}),$=c("vv-accordion",f,e.computed((()=>({disabled:b.value})))),E=t.useToggle(S);return(o,t)=>(e.openBlock(),e.createElementBlock("details",{id:e.unref(s),class:e.normalizeClass(e.unref($)),open:e.unref(S)},[e.createElementVNode("summary",{"aria-controls":e.unref(s),"aria-expanded":e.unref(S),class:"vv-accordion__summary",onClick:t[0]||(t[0]=e.withModifiers((o=>e.unref(E)()),["prevent"]))},[e.renderSlot(o.$slots,"summary",e.normalizeProps(e.guardReactiveProps({open:e.unref(S)})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)),1)]))],8,p),e.createElementVNode("div",{"aria-hidden":!e.unref(S),class:"vv-accordion__content"},[e.renderSlot(o.$slots,"default",e.normalizeProps(e.guardReactiveProps({open:e.unref(S)})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)),1)]))],8,m)],10,v))}}),y={...i,modelValue:[String,Array],items:{type:Array,default:()=>[]},collapse:Boolean,itemModifiers:{type:[String,Array],default:""},disabled:Boolean,not:Boolean,storeKey:String};return e.defineComponent({name:"VvAccordionGroup",props:y,emits:["update:modelValue"],setup(o,{emit:r}){const l=o,a=r,{disabled:n,collapse:i,modifiers:d,itemModifiers:s,items:v,not:p}=e.toRefs(l);e.watchEffect((()=>{"string"==typeof l.modelValue&&i.value&&console.warn("[VvAccordionGroup]: modelValue is a string but collapse is true.")}));let m=e.ref([]);e.watch((()=>l.storeKey),(o=>{m=o?t.useStorage(o,m.value):e.ref([])}),{immediate:!0});const y=e.computed({get:()=>{var e;return void 0!==l.modelValue?i.value?l.modelValue:Array.isArray(l.modelValue)?l.modelValue[0]:l.modelValue:i.value?m.value:null==(e=m.value)?void 0:e[0]},set:e=>{if(void 0!==l.modelValue)return!Array.isArray(l.modelValue)&&!i.value||Array.isArray(e)||(e=[e]),a("update:modelValue",e);m.value=Array.isArray(e)?e:[e]}});!function(o){if(Object.keys(o).some((t=>"key"!==t&&!e.isRef(o[t]))))throw Error("One or more groupState props aren't ref.");e.provide(o.key,e.computed((()=>o)))}({key:u,modelValue:y,disabled:n,collapse:i,modifiers:s,not:p});const g=c("vv-accordion-group",d,e.computed((()=>({disabled:n.value}))));return(o,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(g))},[e.renderSlot(o.$slots,"default",{},(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v),(t=>(e.openBlock(),e.createBlock(f,e.mergeProps({key:t.title},{name:t.name,title:t.title,content:t.content}),{header:e.withCtx((r=>[e.renderSlot(o.$slots,`header::${t.name}`,e.normalizeProps(e.guardReactiveProps(r)))])),details:e.withCtx((r=>[e.renderSlot(o.$slots,`details::${t.name}`,e.normalizeProps(e.guardReactiveProps(r)))])),_:2},1040)))),128))]))],2))}})}));
@@ -12,8 +12,13 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
12
12
  disabled: BooleanConstructor;
13
13
  not: BooleanConstructor;
14
14
  storeKey: StringConstructor;
15
- modifiers: globalThis.PropType<string | string[]>;
16
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
15
+ modifiers: {
16
+ type: globalThis.PropType<string | string[]>;
17
+ default: undefined;
18
+ };
19
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
+ [x: string]: (...args: any[]) => void;
21
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<globalThis.ExtractPropTypes<{
17
22
  modelValue: (ArrayConstructor | StringConstructor)[];
18
23
  items: {
19
24
  type: globalThis.PropType<import(".").VvAccordionGroupItem[]>;
@@ -27,16 +32,18 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
27
32
  disabled: BooleanConstructor;
28
33
  not: BooleanConstructor;
29
34
  storeKey: StringConstructor;
30
- modifiers: globalThis.PropType<string | string[]>;
31
- }>> & {
32
- [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
33
- }, {
35
+ modifiers: {
36
+ type: globalThis.PropType<string | string[]>;
37
+ default: undefined;
38
+ };
39
+ }>>, {
34
40
  disabled: boolean;
35
- not: boolean;
41
+ modifiers: string | string[];
36
42
  collapse: boolean;
43
+ not: boolean;
37
44
  items: import(".").VvAccordionGroupItem[];
38
45
  itemModifiers: string | string[];
39
- }, {}>, Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & {
46
+ }, {}>, Partial<Record<`header::${string}`, (_: any) => any>> & Partial<Record<`details::${string}`, (_: any) => any>> & {
40
47
  default?(_: {}): any;
41
48
  }>;
42
49
  export default _default;
@@ -41,6 +41,9 @@ export declare const VvAccordionGroupProps: {
41
41
  * Enable local storage persistence
42
42
  */
43
43
  storeKey: StringConstructor;
44
- modifiers: globalThis.PropType<string | string[]>;
44
+ modifiers: {
45
+ type: globalThis.PropType<string | string[]>;
46
+ default: undefined;
47
+ };
45
48
  };
46
49
  export declare const VvAccordionGroupEvents: string[];
@@ -71,6 +71,7 @@ const LinkProps = {
71
71
  */
72
72
  target: {
73
73
  type: String,
74
+ default: void 0,
74
75
  validator: (value) => Object.values(AnchorTarget).includes(value)
75
76
  },
76
77
  /**
@@ -85,32 +86,56 @@ const DisabledProps = {
85
86
  /**
86
87
  * Whether the form control is disabled
87
88
  */
88
- disabled: Boolean
89
+ disabled: {
90
+ type: Boolean,
91
+ default: false
92
+ }
89
93
  };
90
94
  const ActiveProps = {
91
95
  /**
92
96
  * Whether the item is active
93
97
  */
94
- active: Boolean
98
+ active: {
99
+ type: Boolean,
100
+ default: false
101
+ }
102
+ };
103
+ const CurrentProps = {
104
+ /**
105
+ * Whether the item is current
106
+ */
107
+ current: {
108
+ type: Boolean,
109
+ default: false
110
+ }
95
111
  };
96
112
  const PressedProps = {
97
113
  /**
98
114
  * Whether the item is pressed
99
115
  */
100
- pressed: Boolean
116
+ pressed: {
117
+ type: Boolean,
118
+ default: false
119
+ }
101
120
  };
102
121
  const LabelProps = {
103
122
  /**
104
123
  * The item label
105
124
  */
106
- label: [String, Number]
125
+ label: {
126
+ type: [String, Number],
127
+ default: void 0
128
+ }
107
129
  };
108
130
  ({
109
131
  /**
110
132
  * VvIcon name or props
111
133
  * @see VVIcon
112
134
  */
113
- icon: { type: [String, Object] },
135
+ icon: {
136
+ type: [String, Object],
137
+ default: void 0
138
+ },
114
139
  /**
115
140
  * VvIcon position
116
141
  */
@@ -141,7 +166,8 @@ const LabelProps = {
141
166
  * Dropdown show / hide transition name
142
167
  */
143
168
  transitionName: {
144
- type: String
169
+ type: String,
170
+ default: void 0
145
171
  },
146
172
  /**
147
173
  * Offset of the dropdown from the trigger
@@ -209,7 +235,8 @@ const LabelProps = {
209
235
  * Set dropdown width to the same as the trigger
210
236
  */
211
237
  triggerWidth: {
212
- type: Boolean
238
+ type: Boolean,
239
+ default: false
213
240
  }
214
241
  });
215
242
  const ActionProps = {
@@ -217,6 +244,7 @@ const ActionProps = {
217
244
  ...LabelProps,
218
245
  ...PressedProps,
219
246
  ...ActiveProps,
247
+ ...CurrentProps,
220
248
  ...LinkProps,
221
249
  /**
222
250
  * Button type
@@ -232,6 +260,13 @@ const ActionProps = {
232
260
  ariaLabel: {
233
261
  type: String,
234
262
  default: void 0
263
+ },
264
+ /**
265
+ * Default tag for the action
266
+ */
267
+ defaultTag: {
268
+ type: String,
269
+ default: ActionTag.button
235
270
  }
236
271
  };
237
272
  const VvActionEvents = ["click", "mouseover", "mouseleave"];
@@ -252,8 +287,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
252
287
  ...__default__,
253
288
  props: VvActionProps,
254
289
  emits: VvActionEvents,
255
- setup(__props, { expose: __expose, emit }) {
290
+ setup(__props, { expose: __expose, emit: __emit }) {
256
291
  const props = __props;
292
+ const emit = __emit;
257
293
  const volver = useVolver();
258
294
  const element = ref(null);
259
295
  __expose({ $el: element });
@@ -284,7 +320,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
284
320
  case props.href !== void 0:
285
321
  return ActionTag.a;
286
322
  default:
287
- return ActionTag.button;
323
+ return props.defaultTag;
288
324
  }
289
325
  });
290
326
  const hasProps = computed(() => {
@@ -309,12 +345,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
309
345
  to: props.to,
310
346
  target: props.target
311
347
  };
312
- default:
348
+ case ActionTag.button:
313
349
  return {
314
350
  ...toReturn,
315
351
  type: props.type,
316
352
  disabled: props.disabled
317
353
  };
354
+ default:
355
+ return toReturn;
318
356
  }
319
357
  });
320
358
  const onClick = (e) => {
@@ -340,7 +378,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
340
378
  class: {
341
379
  active: _ctx.active,
342
380
  pressed: unref(pressed),
343
- disabled: _ctx.disabled
381
+ disabled: _ctx.disabled,
382
+ current: _ctx.current
344
383
  },
345
384
  onClickPassive: onClick,
346
385
  onMouseoverPassive: onMouseover,
@@ -348,10 +387,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
348
387
  }), {
349
388
  default: withCtx(() => [
350
389
  renderSlot(_ctx.$slots, "default", {}, () => [
351
- createTextVNode(toDisplayString(_ctx.label), 1)
390
+ createTextVNode(
391
+ toDisplayString(_ctx.label),
392
+ 1
393
+ /* TEXT */
394
+ )
352
395
  ])
353
396
  ]),
354
397
  _: 3
398
+ /* FORWARDED */
355
399
  }, 16, ["class"]);
356
400
  };
357
401
  }
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAction=t(e.vue)}(this,(function(e){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{}),r=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(r||{}),l=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(l||{});const a=Symbol.for("volver"),i=Symbol.for("dropdownTrigger"),u=Symbol.for("dropdownAction"),s={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(l).includes(e)},rel:{type:String,default:"noopener noreferrer"}},d={disabled:Boolean},c={active:Boolean},f={pressed:Boolean},v={label:[String,Number]};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const b={...d,...v,...f,...c,...s,type:{type:String,default:n.button,validator:e=>Object.values(n).includes(e)},ariaLabel:{type:String,default:void 0}};return e.defineComponent({name:"VvAction",props:b,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:n}){const l=t,s=e.inject(a),d=e.ref(null);o({$el:d});const{reference:c,bus:f,aria:v,expanded:b}=e.inject(i,{});e.watch((()=>d.value),(e=>{c&&(c.value=e)}));const p=e.computed((()=>l.pressed||(null==b?void 0:b.value))),{role:m}=e.inject(u,{}),g=e.computed((()=>{switch(!0){case l.disabled:return r.button;case void 0!==l.to:return(null==s?void 0:s.nuxt)?r.nuxtLink:r.routerLink;case void 0!==l.href:return r.a;default:return r.button}})),y=e.computed((()=>{const e={...null==v?void 0:v.value,ariaPressed:!!p.value||void 0,ariaLabel:l.ariaLabel,role:null==m?void 0:m.value};switch(g.value){case r.a:return{...e,href:l.href,target:l.target,rel:l.rel};case r.routerLink:case r.nuxtLink:return{...e,to:l.to,target:l.target};default:return{...e,type:l.type,disabled:l.disabled}}})),k=e=>{l.disabled?e.preventDefault():(null==f||f.emit("click",e),n("click",e))},h=e=>{null==f||f.emit("mouseover",e),n("mouseover",e)},B=e=>{null==f||f.emit("mouseleave",e),n("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(g)),e.mergeProps(e.unref(y),{ref_key:"element",ref:d,class:{active:t.active,pressed:e.unref(p),disabled:t.disabled},onClickPassive:k,onMouseoverPassive:h,onMouseleavePassive:B}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAction=t(e.vue)}(this,(function(e){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),n=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(n||{}),l=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(l||{});const a=Symbol.for("volver"),u=Symbol.for("dropdownTrigger"),i=Symbol.for("dropdownAction"),s={to:{type:[String,Object]},href:String,target:{type:String,default:void 0,validator:e=>Object.values(l).includes(e)},rel:{type:String,default:"noopener noreferrer"}},d={disabled:{type:Boolean,default:!1}},c={active:{type:Boolean,default:!1}},f={current:{type:Boolean,default:!1}},p={pressed:{type:Boolean,default:!1}},v={label:{type:[String,Number],default:void 0}};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const b={...d,...v,...p,...c,...f,...s,type:{type:String,default:r.button,validator:e=>Object.values(r).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:n.button}};return e.defineComponent({name:"VvAction",props:b,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:r}){const l=t,s=r,d=e.inject(a),c=e.ref(null);o({$el:c});const{reference:f,bus:p,aria:v,expanded:b}=e.inject(u,{});e.watch((()=>c.value),(e=>{f&&(f.value=e)}));const m=e.computed((()=>l.pressed||(null==b?void 0:b.value))),{role:y}=e.inject(i,{}),g=e.computed((()=>{switch(!0){case l.disabled:return n.button;case void 0!==l.to:return(null==d?void 0:d.nuxt)?n.nuxtLink:n.routerLink;case void 0!==l.href:return n.a;default:return l.defaultTag}})),k=e.computed((()=>{const e={...null==v?void 0:v.value,ariaPressed:!!m.value||void 0,ariaLabel:l.ariaLabel,role:null==y?void 0:y.value};switch(g.value){case n.a:return{...e,href:l.href,target:l.target,rel:l.rel};case n.routerLink:case n.nuxtLink:return{...e,to:l.to,target:l.target};case n.button:return{...e,type:l.type,disabled:l.disabled};default:return e}})),B=e=>{l.disabled?e.preventDefault():(null==p||p.emit("click",e),s("click",e))},h=e=>{null==p||p.emit("mouseover",e),s("mouseover",e)},S=e=>{null==p||p.emit("mouseleave",e),s("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(g)),e.mergeProps(e.unref(k),{ref_key:"element",ref:c,class:{active:t.active,pressed:e.unref(m),disabled:t.disabled,current:t.current},onClickPassive:B,onMouseoverPassive:h,onMouseleavePassive:S}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}})}));
@@ -1,3 +1,4 @@
1
+ import { ActionTag } from '../../constants';
1
2
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
2
3
  type: {
3
4
  type: globalThis.PropType<"button" | "submit" | "reset">;
@@ -8,25 +9,48 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
8
9
  type: StringConstructor;
9
10
  default: undefined;
10
11
  };
12
+ defaultTag: {
13
+ type: StringConstructor;
14
+ default: ActionTag;
15
+ };
11
16
  to: {
12
17
  type: (ObjectConstructor | StringConstructor)[];
13
18
  };
14
19
  href: StringConstructor;
15
20
  target: {
16
21
  type: globalThis.PropType<"_blank" | "_self" | "_parent" | "_top">;
22
+ default: undefined;
17
23
  validator: (value: import("../../constants").AnchorTarget) => boolean;
18
24
  };
19
25
  rel: {
20
26
  type: StringConstructor;
21
27
  default: string;
22
28
  };
23
- active: BooleanConstructor;
24
- pressed: BooleanConstructor;
25
- label: (StringConstructor | NumberConstructor)[];
26
- disabled: BooleanConstructor;
29
+ current: {
30
+ type: BooleanConstructor;
31
+ default: boolean;
32
+ };
33
+ active: {
34
+ type: BooleanConstructor;
35
+ default: boolean;
36
+ };
37
+ pressed: {
38
+ type: BooleanConstructor;
39
+ default: boolean;
40
+ };
41
+ label: {
42
+ type: (StringConstructor | NumberConstructor)[];
43
+ default: undefined;
44
+ };
45
+ disabled: {
46
+ type: BooleanConstructor;
47
+ default: boolean;
48
+ };
27
49
  }, {
28
50
  $el: globalThis.Ref<HTMLElement | null>;
29
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
51
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
52
+ [x: string]: (...args: any[]) => void;
53
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<globalThis.ExtractPropTypes<{
30
54
  type: {
31
55
  type: globalThis.PropType<"button" | "submit" | "reset">;
32
56
  default: import("../../constants").ButtonType;
@@ -36,29 +60,52 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
36
60
  type: StringConstructor;
37
61
  default: undefined;
38
62
  };
63
+ defaultTag: {
64
+ type: StringConstructor;
65
+ default: ActionTag;
66
+ };
39
67
  to: {
40
68
  type: (ObjectConstructor | StringConstructor)[];
41
69
  };
42
70
  href: StringConstructor;
43
71
  target: {
44
72
  type: globalThis.PropType<"_blank" | "_self" | "_parent" | "_top">;
73
+ default: undefined;
45
74
  validator: (value: import("../../constants").AnchorTarget) => boolean;
46
75
  };
47
76
  rel: {
48
77
  type: StringConstructor;
49
78
  default: string;
50
79
  };
51
- active: BooleanConstructor;
52
- pressed: BooleanConstructor;
53
- label: (StringConstructor | NumberConstructor)[];
54
- disabled: BooleanConstructor;
55
- }>> & {
56
- [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
57
- }, {
80
+ current: {
81
+ type: BooleanConstructor;
82
+ default: boolean;
83
+ };
84
+ active: {
85
+ type: BooleanConstructor;
86
+ default: boolean;
87
+ };
88
+ pressed: {
89
+ type: BooleanConstructor;
90
+ default: boolean;
91
+ };
92
+ label: {
93
+ type: (StringConstructor | NumberConstructor)[];
94
+ default: undefined;
95
+ };
96
+ disabled: {
97
+ type: BooleanConstructor;
98
+ default: boolean;
99
+ };
100
+ }>>, {
58
101
  disabled: boolean;
102
+ label: string | number;
59
103
  type: "button" | "submit" | "reset";
104
+ target: "_blank" | "_self" | "_parent" | "_top";
60
105
  ariaLabel: string;
106
+ defaultTag: string;
61
107
  rel: string;
108
+ current: boolean;
62
109
  active: boolean;
63
110
  pressed: boolean;
64
111
  }, {}>, {