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

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 (258) 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 +70 -14
  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 +117 -38
  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 +58 -13
  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 +195 -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 +240 -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 +73 -17
  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 +259 -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 +187 -141
  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 +69 -16
  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 +84 -25
  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 +91 -22
  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 +180 -67
  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 +758 -531
  64. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  65. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +181 -108
  66. package/dist/components/VvCombobox/index.d.ts +53 -22
  67. package/dist/components/VvDialog/VvDialog.es.js +136 -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 +101 -75
  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 +82 -22
  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 +33 -48
  89. package/dist/components/VvInputFile/VvInputFile.es.js +1734 -0
  90. package/dist/components/VvInputFile/VvInputFile.umd.js +1 -0
  91. package/dist/components/VvInputFile/VvInputFile.vue.d.ts +313 -0
  92. package/dist/components/VvInputFile/index.d.ts +179 -0
  93. package/dist/components/VvInputText/VvInputClearAction.d.ts +7 -5
  94. package/dist/components/VvInputText/VvInputPasswordAction.d.ts +10 -8
  95. package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
  96. package/dist/components/VvInputText/VvInputText.es.js +331 -293
  97. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  98. package/dist/components/VvInputText/VvInputText.vue.d.ts +162 -55
  99. package/dist/components/VvInputText/index.d.ts +71 -29
  100. package/dist/components/VvNav/VvNav.es.js +151 -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.vue.d.ts +2 -0
  105. package/dist/components/VvNav/index.d.ts +5 -13
  106. package/dist/components/VvNavItem/VvNavItem.es.js +436 -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 +180 -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 +248 -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 +256 -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 +229 -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/common/HintSlot.d.ts +1 -1
  139. package/dist/components/index.d.ts +10 -0
  140. package/dist/components/index.es.js +2902 -1329
  141. package/dist/components/index.umd.js +1 -1
  142. package/dist/composables/alert/useAlert.d.ts +37 -4
  143. package/dist/composables/dropdown/useProvideDropdown.d.ts +1 -1
  144. package/dist/composables/index.d.ts +1 -0
  145. package/dist/composables/index.es.js +88 -1
  146. package/dist/composables/index.umd.js +1 -1
  147. package/dist/composables/useBlurhash.d.ts +7 -0
  148. package/dist/composables/useComponentIcon.d.ts +9 -8
  149. package/dist/composables/useVolver.d.ts +1 -1
  150. package/dist/directives/index.d.ts +3 -5
  151. package/dist/directives/index.es.js +92 -31
  152. package/dist/directives/index.umd.js +1 -1
  153. package/dist/directives/v-tooltip.es.js +90 -26
  154. package/dist/directives/v-tooltip.umd.js +1 -1
  155. package/dist/icons.es.js +210 -210
  156. package/dist/icons.umd.js +1 -1
  157. package/dist/index.d.ts +3 -1
  158. package/dist/index.es.js +81 -16
  159. package/dist/index.umd.js +1 -1
  160. package/dist/props/index.d.ts +287 -73
  161. package/dist/resolvers/unplugin.d.ts +6 -1
  162. package/dist/resolvers/unplugin.es.js +78 -10
  163. package/dist/resolvers/unplugin.umd.js +1 -1
  164. package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +72 -84
  165. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +623 -461
  166. package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +1 -1
  167. package/dist/stories/Blurhash/BlurhashComposable.stories.d.ts +4 -0
  168. package/dist/stories/Combobox/Combobox.settings.d.ts +8 -0
  169. package/dist/stories/Icon/Icon.settings.d.ts +1 -0
  170. package/dist/stories/InputFile/InputFile.settings.d.ts +56 -0
  171. package/dist/stories/InputFile/InputFile.stories.d.ts +12 -0
  172. package/dist/stories/InputFile/InputFileDropArea.stories.d.ts +9 -0
  173. package/dist/stories/InputFile/InputFileIconPosition.stories.d.ts +8 -0
  174. package/dist/stories/InputFile/InputFileSlots.stories.d.ts +7 -0
  175. package/dist/stories/Tab/Tab.settings.d.ts +4 -37
  176. package/dist/types/alert.d.ts +13 -0
  177. package/dist/types/blurhash.d.ts +12 -0
  178. package/dist/types/floating-ui.d.ts +6 -0
  179. package/dist/types/generic.d.ts +4 -0
  180. package/dist/types/group.d.ts +37 -0
  181. package/dist/types/index.d.ts +7 -0
  182. package/dist/types/input-file.d.ts +16 -0
  183. package/dist/types/nav.d.ts +18 -0
  184. package/dist/utils/ObjectUtilities.d.ts +0 -1
  185. package/dist/workers/blurhash.d.ts +1 -0
  186. package/package.json +97 -80
  187. package/src/Volver.ts +31 -20
  188. package/src/assets/icons/detailed.json +1 -1
  189. package/src/assets/icons/normal.json +1 -1
  190. package/src/assets/icons/simple.json +1 -1
  191. package/src/components/VvAccordion/VvAccordion.vue +2 -2
  192. package/src/components/VvAction/VvAction.vue +5 -2
  193. package/src/components/VvAlert/index.ts +1 -3
  194. package/src/components/VvAlertGroup/index.ts +2 -1
  195. package/src/components/VvBreadcrumb/VvBreadcrumb.vue +20 -19
  196. package/src/components/VvBreadcrumb/index.ts +2 -8
  197. package/src/components/VvButton/VvButton.vue +6 -6
  198. package/src/components/VvButton/index.ts +2 -4
  199. package/src/components/VvCombobox/VvCombobox.vue +24 -16
  200. package/src/components/VvCombobox/index.ts +4 -0
  201. package/src/components/VvIcon/VvIcon.vue +2 -2
  202. package/src/components/VvIcon/index.ts +35 -48
  203. package/src/components/VvInputFile/VvInputFile.vue +365 -0
  204. package/src/components/VvInputFile/index.ts +116 -0
  205. package/src/components/VvInputText/VvInputClearAction.ts +10 -6
  206. package/src/components/VvInputText/VvInputPasswordAction.ts +13 -9
  207. package/src/components/VvInputText/VvInputText.vue +17 -18
  208. package/src/components/VvInputText/index.ts +7 -15
  209. package/src/components/VvNav/VvNav.vue +30 -50
  210. package/src/components/VvNav/VvNavItem.vue +18 -0
  211. package/src/components/VvNav/VvNavSeparator.vue +11 -0
  212. package/src/components/VvNav/index.ts +2 -15
  213. package/src/components/VvSelect/VvSelect.vue +5 -8
  214. package/src/components/VvTab/VvTab.vue +63 -35
  215. package/src/components/VvTab/index.ts +10 -4
  216. package/src/components/VvTextarea/VvTextarea.vue +6 -9
  217. package/src/components/index.ts +10 -0
  218. package/src/composables/index.ts +1 -0
  219. package/src/composables/useBlurhash.ts +76 -0
  220. package/src/composables/useComponentIcon.ts +15 -14
  221. package/src/composables/useUniqueId.ts +2 -2
  222. package/src/directives/index.ts +3 -6
  223. package/src/directives/v-tooltip.ts +19 -10
  224. package/src/index.ts +3 -1
  225. package/src/props/index.ts +115 -27
  226. package/src/resolvers/unplugin.ts +24 -14
  227. package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +2 -2
  228. package/src/stories/Blurhash/BlurhashComposable.stories.ts +195 -0
  229. package/src/stories/Combobox/Combobox.settings.ts +8 -0
  230. package/src/stories/Icon/Icon.settings.ts +3 -3
  231. package/src/stories/InputFile/InputFile.settings.ts +36 -0
  232. package/src/stories/InputFile/InputFile.stories.ts +89 -0
  233. package/src/stories/InputFile/InputFileDropArea.stories.ts +56 -0
  234. package/src/stories/InputFile/InputFileIconPosition.stories.ts +43 -0
  235. package/src/stories/InputFile/InputFileSlots.stories.ts +33 -0
  236. package/src/stories/Nav/Nav.settings.ts +3 -4
  237. package/src/stories/Nav/Nav.test.ts +4 -15
  238. package/src/stories/Tab/Tab.settings.ts +9 -9
  239. package/src/stories/Tab/Tab.stories.ts +2 -2
  240. package/src/stories/Tab/Tab.test.ts +6 -14
  241. package/src/stories/argTypes.ts +1 -1
  242. package/src/types/blurhash.ts +21 -0
  243. package/src/types/generic.ts +6 -0
  244. package/src/types/index.ts +7 -0
  245. package/src/types/input-file.ts +18 -0
  246. package/src/types/nav.ts +20 -0
  247. package/src/utils/ObjectUtilities.ts +0 -11
  248. package/src/workers/blurhash.ts +9 -0
  249. package/dist/components/VvNav/VvNavItemTitle.vue.d.ts +0 -6
  250. package/dist/components/VvNav/VvNavSeparator.d.ts +0 -2
  251. package/dist/components/VvNavItemTitle/VvNavItemTitle.es.js +0 -19
  252. package/dist/components/VvNavItemTitle/VvNavItemTitle.umd.js +0 -1
  253. package/src/components/VvNav/VvNavItemTitle.vue +0 -11
  254. package/src/components/VvNav/VvNavSeparator.ts +0 -8
  255. package/src/types/generic.d.ts +0 -6
  256. /package/src/types/{alert.d.ts → alert.ts} +0 -0
  257. /package/src/types/{floating-ui.d.ts → floating-ui.ts} +0 -0
  258. /package/src/types/{group.d.ts → group.ts} +0 -0
@@ -1,5 +1,5 @@
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";
1
+ import { unref, inject, computed, toRef, toRefs, defineComponent, useAttrs, ref, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, createCommentVNode, renderSlot, normalizeProps, guardReactiveProps, createTextVNode, toDisplayString, isRef, provide, watchEffect, watch, Fragment, renderList, createBlock, mergeProps, withCtx } from "vue";
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,
@@ -450,16 +496,26 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
450
496
  class: "vv-accordion__summary",
451
497
  onClick: _cache[0] || (_cache[0] = withModifiers(($event) => unref(onClick)(), ["prevent"]))
452
498
  }, [
499
+ createCommentVNode(" @slot Slot for title "),
453
500
  renderSlot(_ctx.$slots, "summary", normalizeProps(guardReactiveProps({ open: unref(isOpen) })), () => [
454
- createTextVNode(toDisplayString(unref(title)), 1)
501
+ createTextVNode(
502
+ toDisplayString(unref(title)),
503
+ 1
504
+ /* TEXT */
505
+ )
455
506
  ])
456
507
  ], 8, _hoisted_2),
457
508
  createElementVNode("div", {
458
509
  "aria-hidden": !unref(isOpen),
459
510
  class: "vv-accordion__content"
460
511
  }, [
512
+ createCommentVNode(" @slot Slot for content "),
461
513
  renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({ open: unref(isOpen) })), () => [
462
- createTextVNode(toDisplayString(unref(content)), 1)
514
+ createTextVNode(
515
+ toDisplayString(unref(content)),
516
+ 1
517
+ /* TEXT */
518
+ )
463
519
  ])
464
520
  ], 8, _hoisted_3)
465
521
  ], 10, _hoisted_1);
@@ -522,8 +578,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
522
578
  ...__default__,
523
579
  props: VvAccordionGroupProps,
524
580
  emits: VvAccordionGroupEvents,
525
- setup(__props, { emit }) {
581
+ setup(__props, { emit: __emit }) {
526
582
  const props = __props;
583
+ const emit = __emit;
527
584
  const { disabled, collapse, modifiers, itemModifiers, items, not } = toRefs(props);
528
585
  watchEffect(() => {
529
586
  if (typeof props.modelValue === "string" && collapse.value) {
@@ -581,29 +638,51 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
581
638
  }))
582
639
  );
583
640
  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);
641
+ return openBlock(), createElementBlock(
642
+ "div",
643
+ {
644
+ class: normalizeClass(unref(bemCssClasses))
645
+ },
646
+ [
647
+ createCommentVNode(" @slot Default slot "),
648
+ renderSlot(_ctx.$slots, "default", {}, () => [
649
+ (openBlock(true), createElementBlock(
650
+ Fragment,
651
+ null,
652
+ renderList(unref(items), (item) => {
653
+ return openBlock(), createBlock(
654
+ _sfc_main$1,
655
+ mergeProps({
656
+ key: item.title
657
+ }, {
658
+ name: item.name,
659
+ title: item.title,
660
+ content: item.content
661
+ }),
662
+ {
663
+ header: withCtx((data) => [
664
+ createCommentVNode(" @slot Slot for accordion header "),
665
+ renderSlot(_ctx.$slots, `header::${item.name}`, normalizeProps(guardReactiveProps(data)))
666
+ ]),
667
+ details: withCtx((data) => [
668
+ createCommentVNode(" @slot Slot for accordion details "),
669
+ renderSlot(_ctx.$slots, `details::${item.name}`, normalizeProps(guardReactiveProps(data)))
670
+ ]),
671
+ _: 2
672
+ /* DYNAMIC */
673
+ },
674
+ 1040
675
+ /* FULL_PROPS, DYNAMIC_SLOTS */
676
+ );
677
+ }),
678
+ 128
679
+ /* KEYED_FRAGMENT */
680
+ ))
681
+ ])
682
+ ],
683
+ 2
684
+ /* CLASS */
685
+ );
607
686
  };
608
687
  }
609
688
  });
@@ -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 m=["id","open"],v=["aria-controls","aria-expanded"],f=["aria-hidden"],p=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:p,title:y,content:g,disabled:b,collapse:V,modelValue:A,isInGroup:B,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),m=a("collapse",o),v=e.computed((()=>{var e;return Boolean(o.disabled||(null==(e=null==r?void 0:r.value)?void 0:e.disabled.value))})),f=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:m,modifiers:f,disabled:v,title:n,content:i}}(a,i),S=e.ref(!1),k=e.computed({get:()=>{let e=A.value;return B.value?e=V.value&&Array.isArray(A.value)?A.value.includes(s.value):A.value===s.value:void 0===A.value&&(e=S.value),h.value?!e:e},set:e=>{if(h.value&&(e=!e),B.value)return V.value&&Array.isArray(A.value)?e?void A.value.push(s.value):void(A.value=A.value.filter((e=>e!==s.value))):void(A.value=e?s.value:null);void 0!==A.value||"boolean"!=typeof e?A.value=e:S.value=e}}),C=c("vv-accordion",p,e.computed((()=>({disabled:b.value})))),$=t.useToggle(k);return(o,t)=>(e.openBlock(),e.createElementBlock("details",{id:e.unref(s),class:e.normalizeClass(e.unref(C)),open:e.unref(k)},[e.createElementVNode("summary",{"aria-controls":e.unref(s),"aria-expanded":e.unref(k),class:"vv-accordion__summary",onClick:t[0]||(t[0]=e.withModifiers((o=>e.unref($)()),["prevent"]))},[e.createCommentVNode(" @slot Slot for title "),e.renderSlot(o.$slots,"summary",e.normalizeProps(e.guardReactiveProps({open:e.unref(k)})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)),1)]))],8,v),e.createElementVNode("div",{"aria-hidden":!e.unref(k),class:"vv-accordion__content"},[e.createCommentVNode(" @slot Slot for content "),e.renderSlot(o.$slots,"default",e.normalizeProps(e.guardReactiveProps({open:e.unref(k)})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)),1)]))],8,f)],10,m))}}),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:m,not:v}=e.toRefs(l);e.watchEffect((()=>{"string"==typeof l.modelValue&&i.value&&console.warn("[VvAccordionGroup]: modelValue is a string but collapse is true.")}));let f=e.ref([]);e.watch((()=>l.storeKey),(o=>{f=o?t.useStorage(o,f.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?f.value:null==(e=f.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);f.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:v});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.createCommentVNode(" @slot Default slot "),e.renderSlot(o.$slots,"default",{},(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),(t=>(e.openBlock(),e.createBlock(p,e.mergeProps({key:t.title},{name:t.name,title:t.title,content:t.content}),{header:e.withCtx((r=>[e.createCommentVNode(" @slot Slot for accordion header "),e.renderSlot(o.$slots,`header::${t.name}`,e.normalizeProps(e.guardReactiveProps(r)))])),details:e.withCtx((r=>[e.createCommentVNode(" @slot Slot for accordion details "),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").PublicProps, 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[];
@@ -1,4 +1,4 @@
1
- import { inject, defineComponent, ref, watch, computed, openBlock, createBlock, resolveDynamicComponent, unref, mergeProps, withCtx, renderSlot, createTextVNode, toDisplayString } from "vue";
1
+ import { inject, defineComponent, ref, watch, computed, openBlock, createBlock, resolveDynamicComponent, unref, mergeProps, withCtx, createCommentVNode, renderSlot, createTextVNode, toDisplayString } from "vue";
2
2
  var Strategy = /* @__PURE__ */ ((Strategy2) => {
3
3
  Strategy2["absolute"] = "absolute";
4
4
  Strategy2["fixed"] = "fixed";
@@ -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,18 +378,25 @@ 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,
347
386
  onMouseleavePassive: onMouseleave
348
387
  }), {
349
388
  default: withCtx(() => [
389
+ createCommentVNode(" @slot Default slot "),
350
390
  renderSlot(_ctx.$slots, "default", {}, () => [
351
- createTextVNode(toDisplayString(_ctx.label), 1)
391
+ createTextVNode(
392
+ toDisplayString(_ctx.label),
393
+ 1
394
+ /* TEXT */
395
+ )
352
396
  ])
353
397
  ]),
354
398
  _: 3
399
+ /* FORWARDED */
355
400
  }, 16, ["class"]);
356
401
  };
357
402
  }
@@ -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.createCommentVNode(" @slot Default slot "),e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}})}));