@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,4 +1,4 @@
1
- import { inject, defineComponent, ref, watch, computed, openBlock, createBlock, resolveDynamicComponent, unref, mergeProps, withCtx, renderSlot, createTextVNode, toDisplayString, toRefs, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, createVNode, toHandlers } from "vue";
1
+ import { inject, defineComponent, ref, watch, computed, openBlock, createBlock, resolveDynamicComponent, unref, mergeProps, withCtx, createCommentVNode, renderSlot, createTextVNode, toDisplayString, createElementBlock, createVNode, toRefs, normalizeClass, createElementVNode, withModifiers, Fragment, renderList, toHandlers, normalizeProps, guardReactiveProps } 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,38 +86,65 @@ 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
  const ModifiersProps = {
109
131
  /**
110
132
  * Component BEM modifiers
111
133
  */
112
- modifiers: [String, Array]
134
+ modifiers: {
135
+ type: [String, Array],
136
+ default: void 0
137
+ }
113
138
  };
114
139
  ({
115
140
  /**
116
141
  * VvIcon name or props
117
142
  * @see VVIcon
118
143
  */
119
- icon: { type: [String, Object] },
144
+ icon: {
145
+ type: [String, Object],
146
+ default: void 0
147
+ },
120
148
  /**
121
149
  * VvIcon position
122
150
  */
@@ -147,7 +175,8 @@ const ModifiersProps = {
147
175
  * Dropdown show / hide transition name
148
176
  */
149
177
  transitionName: {
150
- type: String
178
+ type: String,
179
+ default: void 0
151
180
  },
152
181
  /**
153
182
  * Offset of the dropdown from the trigger
@@ -215,7 +244,8 @@ const ModifiersProps = {
215
244
  * Set dropdown width to the same as the trigger
216
245
  */
217
246
  triggerWidth: {
218
- type: Boolean
247
+ type: Boolean,
248
+ default: false
219
249
  }
220
250
  });
221
251
  const ActionProps = {
@@ -223,6 +253,7 @@ const ActionProps = {
223
253
  ...LabelProps,
224
254
  ...PressedProps,
225
255
  ...ActiveProps,
256
+ ...CurrentProps,
226
257
  ...LinkProps,
227
258
  /**
228
259
  * Button type
@@ -238,16 +269,25 @@ const ActionProps = {
238
269
  ariaLabel: {
239
270
  type: String,
240
271
  default: void 0
272
+ },
273
+ /**
274
+ * Default tag for the action
275
+ */
276
+ defaultTag: {
277
+ type: String,
278
+ default: ActionTag.button
241
279
  }
242
280
  };
243
- const VvNavProps = {
244
- ...ModifiersProps,
281
+ const NavProps = {
245
282
  items: {
246
283
  type: Array,
247
- required: true,
248
284
  default: () => []
249
285
  }
250
286
  };
287
+ const VvNavProps = {
288
+ ...ModifiersProps,
289
+ ...NavProps
290
+ };
251
291
  const VvNavEvents = ["click"];
252
292
  const VvActionEvents = ["click", "mouseover", "mouseleave"];
253
293
  const VvActionProps = ActionProps;
@@ -260,15 +300,16 @@ function useInjectedDropdownTrigger() {
260
300
  function useInjectedDropdownAction() {
261
301
  return inject(INJECTION_KEY_DROPDOWN_ACTION, {});
262
302
  }
263
- const __default__ = {
303
+ const __default__$1 = {
264
304
  name: "VvAction"
265
305
  };
266
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
267
- ...__default__,
306
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
307
+ ...__default__$1,
268
308
  props: VvActionProps,
269
309
  emits: VvActionEvents,
270
- setup(__props, { expose: __expose, emit }) {
310
+ setup(__props, { expose: __expose, emit: __emit }) {
271
311
  const props = __props;
312
+ const emit = __emit;
272
313
  const volver = useVolver();
273
314
  const element = ref(null);
274
315
  __expose({ $el: element });
@@ -299,7 +340,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
299
340
  case props.href !== void 0:
300
341
  return ActionTag.a;
301
342
  default:
302
- return ActionTag.button;
343
+ return props.defaultTag;
303
344
  }
304
345
  });
305
346
  const hasProps = computed(() => {
@@ -324,12 +365,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
324
365
  to: props.to,
325
366
  target: props.target
326
367
  };
327
- default:
368
+ case ActionTag.button:
328
369
  return {
329
370
  ...toReturn,
330
371
  type: props.type,
331
372
  disabled: props.disabled
332
373
  };
374
+ default:
375
+ return toReturn;
333
376
  }
334
377
  });
335
378
  const onClick = (e) => {
@@ -355,22 +398,59 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
355
398
  class: {
356
399
  active: _ctx.active,
357
400
  pressed: unref(pressed),
358
- disabled: _ctx.disabled
401
+ disabled: _ctx.disabled,
402
+ current: _ctx.current
359
403
  },
360
404
  onClickPassive: onClick,
361
405
  onMouseoverPassive: onMouseover,
362
406
  onMouseleavePassive: onMouseleave
363
407
  }), {
364
408
  default: withCtx(() => [
409
+ createCommentVNode(" @slot Default slot "),
365
410
  renderSlot(_ctx.$slots, "default", {}, () => [
366
- createTextVNode(toDisplayString(_ctx.label), 1)
411
+ createTextVNode(
412
+ toDisplayString(_ctx.label),
413
+ 1
414
+ /* TEXT */
415
+ )
367
416
  ])
368
417
  ]),
369
418
  _: 3
419
+ /* FORWARDED */
370
420
  }, 16, ["class"]);
371
421
  };
372
422
  }
373
423
  });
424
+ const _hoisted_1 = {
425
+ class: "vv-nav__item",
426
+ role: "presentation"
427
+ };
428
+ const __default__ = {
429
+ name: "VvNavItem",
430
+ inheritAttrs: false
431
+ };
432
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
433
+ ...__default__,
434
+ setup(__props) {
435
+ return (_ctx, _cache) => {
436
+ return openBlock(), createElementBlock("li", _hoisted_1, [
437
+ createVNode(
438
+ _sfc_main$2,
439
+ mergeProps(_ctx.$attrs, { class: "vv-nav__item-label" }),
440
+ {
441
+ default: withCtx(() => [
442
+ renderSlot(_ctx.$slots, "default")
443
+ ]),
444
+ _: 3
445
+ /* FORWARDED */
446
+ },
447
+ 16
448
+ /* FULL_PROPS */
449
+ )
450
+ ]);
451
+ };
452
+ }
453
+ });
374
454
  function useModifiers(prefix, modifiers, others) {
375
455
  return computed(() => {
376
456
  const toReturn = {
@@ -394,67 +474,65 @@ function useModifiers(prefix, modifiers, others) {
394
474
  return toReturn;
395
475
  });
396
476
  }
397
- const _hoisted_1 = {
398
- class: "vv-nav__menu",
399
- role: "menu",
400
- "aria-busy": "true"
401
- };
402
477
  const _sfc_main = /* @__PURE__ */ defineComponent({
403
478
  __name: "VvNav",
404
479
  props: VvNavProps,
405
480
  emits: VvNavEvents,
406
- setup(__props, { emit }) {
481
+ setup(__props, { emit: __emit }) {
407
482
  const props = __props;
408
- const { modifiers, items } = toRefs(props);
409
- const activeItem = ref(null);
410
- const bemCssClasses = useModifiers("vv-nav", modifiers);
411
- const localItems = computed(() => {
412
- return items.value.map((item, index) => {
413
- return {
414
- ...item,
415
- id: item.id || `nav-item_${index}`
416
- };
417
- });
418
- });
419
- function onClick(item) {
420
- if (!item.disabled) {
483
+ const { modifiers } = toRefs(props);
484
+ const emit = __emit;
485
+ const onClick = (event) => {
486
+ var _a;
487
+ const target = event.target;
488
+ if (target == null ? void 0 : target.dataset.index) {
489
+ const index = parseInt(target.dataset.index);
490
+ const item = (_a = props.items) == null ? void 0 : _a[index];
491
+ if (!item || (item == null ? void 0 : item.disabled)) {
492
+ return;
493
+ }
421
494
  emit("click", item);
422
- activeItem.value = item.id;
423
495
  }
424
- }
496
+ };
497
+ const bemCssClasses = useModifiers("vv-nav", modifiers);
425
498
  return (_ctx, _cache) => {
426
- return openBlock(), createElementBlock("nav", {
427
- class: normalizeClass(unref(bemCssClasses))
428
- }, [
429
- createElementVNode("ul", _hoisted_1, [
430
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(localItems), (navItem) => {
431
- return openBlock(), createElementBlock("li", {
432
- key: navItem.id,
433
- class: "vv-nav__item",
434
- role: "presentation"
435
- }, [
436
- createVNode(_sfc_main$1, mergeProps({
437
- disabled: navItem.disabled,
438
- to: navItem.to,
439
- href: navItem.href,
440
- tabindex: 0
441
- }, {
442
- class: [{
443
- current: unref(activeItem) == navItem.id,
444
- disabled: navItem.disabled
445
- }, "vv-nav__item-label"]
446
- }, toHandlers(navItem.on), {
447
- onClick: ($event) => onClick(navItem)
448
- }), {
449
- default: withCtx(() => [
450
- createTextVNode(toDisplayString(navItem.title), 1)
451
- ]),
452
- _: 2
453
- }, 1040, ["class", "onClick"])
454
- ]);
455
- }), 128))
456
- ])
457
- ], 2);
499
+ return openBlock(), createElementBlock(
500
+ "nav",
501
+ {
502
+ class: normalizeClass(unref(bemCssClasses))
503
+ },
504
+ [
505
+ createElementVNode("ul", {
506
+ class: "vv-nav__menu",
507
+ role: "menu",
508
+ "aria-busy": "true",
509
+ onClick: withModifiers(onClick, ["stop"])
510
+ }, [
511
+ renderSlot(_ctx.$slots, "default", {}, () => [
512
+ (openBlock(true), createElementBlock(
513
+ Fragment,
514
+ null,
515
+ renderList(_ctx.items, ({ on = {}, data, ...item }, index) => {
516
+ return openBlock(), createBlock(_sfc_main$1, mergeProps({
517
+ key: index,
518
+ "data-index": index
519
+ }, item, toHandlers(on)), {
520
+ default: withCtx(() => [
521
+ renderSlot(_ctx.$slots, "item", normalizeProps(guardReactiveProps({ item, data, index })))
522
+ ]),
523
+ _: 2
524
+ /* DYNAMIC */
525
+ }, 1040, ["data-index"]);
526
+ }),
527
+ 128
528
+ /* KEYED_FRAGMENT */
529
+ ))
530
+ ])
531
+ ])
532
+ ],
533
+ 2
534
+ /* CLASS */
535
+ );
458
536
  };
459
537
  }
460
538
  });
@@ -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).VvNav=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"),i=Symbol.for("dropdownTrigger"),s=Symbol.for("dropdownAction"),u={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},v={pressed:Boolean},f={label:[String,Number]},p={modifiers:[String,Array]};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const m={...d,...f,...v,...c,...u,type:{type:String,default:r.button,validator:e=>Object.values(r).includes(e)},ariaLabel:{type:String,default:void 0}},b={...p,items:{type:Array,required:!0,default:()=>[]}},k=m;const y=e.defineComponent({name:"VvAction",props:k,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:r}){const l=t,u=e.inject(a),d=e.ref(null);o({$el:d});const{reference:c,bus:v,aria:f,expanded:p}=e.inject(i,{});e.watch((()=>d.value),(e=>{c&&(c.value=e)}));const m=e.computed((()=>l.pressed||(null==p?void 0:p.value))),{role:b}=e.inject(s,{}),k=e.computed((()=>{switch(!0){case l.disabled:return n.button;case void 0!==l.to:return(null==u?void 0:u.nuxt)?n.nuxtLink:n.routerLink;case void 0!==l.href:return n.a;default:return n.button}})),y=e.computed((()=>{const e={...null==f?void 0:f.value,ariaPressed:!!m.value||void 0,ariaLabel:l.ariaLabel,role:null==b?void 0:b.value};switch(k.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};default:return{...e,type:l.type,disabled:l.disabled}}})),g=e=>{l.disabled?e.preventDefault():(null==v||v.emit("click",e),r("click",e))},_=e=>{null==v||v.emit("mouseover",e),r("mouseover",e)},B=e=>{null==v||v.emit("mouseleave",e),r("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(y),{ref_key:"element",ref:d,class:{active:t.active,pressed:e.unref(m),disabled:t.disabled},onClickPassive:g,onMouseoverPassive:_,onMouseleavePassive:B}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}});const g={class:"vv-nav__menu",role:"menu","aria-busy":"true"};return e.defineComponent({__name:"VvNav",props:b,emits:["click"],setup(t,{emit:o}){const r=t,{modifiers:n,items:l}=e.toRefs(r),a=e.ref(null),i=function(t,o,r){return e.computed((()=>{const n={[t]:!0},l="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(n[`${t}--${e}`]=!0)})),r&&Object.keys(r.value).forEach((o=>{n[`${t}--${o}`]=e.unref(r.value[o])})),n}))}("vv-nav",n),s=e.computed((()=>l.value.map(((e,t)=>({...e,id:e.id||`nav-item_${t}`})))));return(t,r)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(i))},[e.createElementVNode("ul",g,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),(t=>(e.openBlock(),e.createElementBlock("li",{key:t.id,class:"vv-nav__item",role:"presentation"},[e.createVNode(y,e.mergeProps({disabled:t.disabled,to:t.to,href:t.href,tabindex:0},{class:[{current:e.unref(a)==t.id,disabled:t.disabled},"vv-nav__item-label"]},e.toHandlers(t.on),{onClick:e=>{var r;(r=t).disabled||(o("click",r),a.value=r.id)}}),{default:e.withCtx((()=>[e.createTextVNode(e.toDisplayString(t.title),1)])),_:2},1040,["class","onClick"])])))),128))])],2))}})}));
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).VvNav=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||{}),a=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(a||{});const l=Symbol.for("volver"),i=Symbol.for("dropdownTrigger"),u=Symbol.for("dropdownAction"),s={to:{type:[String,Object]},href:String,target:{type:String,default:void 0,validator:e=>Object.values(a).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}},v={pressed:{type:Boolean,default:!1}},p={label:{type:[String,Number],default:void 0}},m={modifiers:{type:[String,Array],default:void 0}};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const b={...d,...p,...v,...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}},y={...m,...{items:{type:Array,default:()=>[]}}},g=b;const k=e.defineComponent({name:"VvAction",props:g,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:r}){const a=t,s=r,d=e.inject(l),c=e.ref(null);o({$el:c});const{reference:f,bus:v,aria:p,expanded:m}=e.inject(i,{});e.watch((()=>c.value),(e=>{f&&(f.value=e)}));const b=e.computed((()=>a.pressed||(null==m?void 0:m.value))),{role:y}=e.inject(u,{}),g=e.computed((()=>{switch(!0){case a.disabled:return n.button;case void 0!==a.to:return(null==d?void 0:d.nuxt)?n.nuxtLink:n.routerLink;case void 0!==a.href:return n.a;default:return a.defaultTag}})),k=e.computed((()=>{const e={...null==p?void 0:p.value,ariaPressed:!!b.value||void 0,ariaLabel:a.ariaLabel,role:null==y?void 0:y.value};switch(g.value){case n.a:return{...e,href:a.href,target:a.target,rel:a.rel};case n.routerLink:case n.nuxtLink:return{...e,to:a.to,target:a.target};case n.button:return{...e,type:a.type,disabled:a.disabled};default:return e}})),B=e=>{a.disabled?e.preventDefault():(null==v||v.emit("click",e),s("click",e))},_=e=>{null==v||v.emit("mouseover",e),s("mouseover",e)},h=e=>{null==v||v.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(b),disabled:t.disabled,current:t.current},onClickPassive:B,onMouseoverPassive:_,onMouseleavePassive:h}),{default:e.withCtx((()=>[e.createCommentVNode(" @slot Default slot "),e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}}),B={class:"vv-nav__item",role:"presentation"},_=e.defineComponent({name:"VvNavItem",inheritAttrs:!1,setup:t=>(t,o)=>(e.openBlock(),e.createElementBlock("li",B,[e.createVNode(k,e.mergeProps(t.$attrs,{class:"vv-nav__item-label"}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default")])),_:3},16)]))});return e.defineComponent({__name:"VvNav",props:y,emits:["click"],setup(t,{emit:o}){const r=t,{modifiers:n}=e.toRefs(r),a=o,l=e=>{var t;const o=e.target;if(null==o?void 0:o.dataset.index){const e=parseInt(o.dataset.index),n=null==(t=r.items)?void 0:t[e];if(!n||(null==n?void 0:n.disabled))return;a("click",n)}},i=function(t,o,r){return e.computed((()=>{const n={[t]:!0},a="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return a&&Array.isArray(a)&&a.forEach((e=>{e&&(n[`${t}--${e}`]=!0)})),r&&Object.keys(r.value).forEach((o=>{n[`${t}--${o}`]=e.unref(r.value[o])})),n}))}("vv-nav",n);return(t,o)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(i))},[e.createElementVNode("ul",{class:"vv-nav__menu",role:"menu","aria-busy":"true",onClick:e.withModifiers(l,["stop"])},[e.renderSlot(t.$slots,"default",{},(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(({on:o={},data:r,...n},a)=>(e.openBlock(),e.createBlock(_,e.mergeProps({key:a,"data-index":a},n,e.toHandlers(o)),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"item",e.normalizeProps(e.guardReactiveProps({item:n,data:r,index:a})))])),_:2},1040,["data-index"])))),128))]))])],2))}})}));
@@ -1,21 +1,48 @@
1
- import { type NavItem } from '@/components/VvNav';
2
- declare const _default: import("vue").DefineComponent<{
1
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
3
2
  items: {
4
- type: globalThis.PropType<NavItem[]>;
5
- required: boolean;
3
+ type: globalThis.PropType<import("../..").NavItem[]>;
6
4
  default: () => never[];
7
5
  };
8
- modifiers: globalThis.PropType<string | string[]>;
9
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
6
+ modifiers: {
7
+ type: globalThis.PropType<string | string[]>;
8
+ default: undefined;
9
+ };
10
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
+ [x: string]: (...args: any[]) => void;
12
+ }, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{
10
13
  items: {
11
- type: globalThis.PropType<NavItem[]>;
12
- required: boolean;
14
+ type: globalThis.PropType<import("../..").NavItem[]>;
13
15
  default: () => never[];
14
16
  };
15
- modifiers: globalThis.PropType<string | string[]>;
16
- }>> & {
17
- [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
18
- }, {
19
- items: NavItem[];
20
- }, {}>;
17
+ modifiers: {
18
+ type: globalThis.PropType<string | string[]>;
19
+ default: undefined;
20
+ };
21
+ }>>, {
22
+ modifiers: string | string[];
23
+ items: import("../..").NavItem[];
24
+ }, {}>, {
25
+ default?(_: {}): any;
26
+ item?(_: {
27
+ item: {
28
+ label: string;
29
+ ariaLabel?: string | undefined;
30
+ title?: string | undefined;
31
+ to?: string | Record<string, unknown> | undefined;
32
+ href?: string | undefined;
33
+ target?: "_blank" | "_self" | "_parent" | "_top" | undefined;
34
+ rel?: string | undefined;
35
+ disabled?: boolean | undefined;
36
+ current?: boolean | undefined;
37
+ class?: string | string[] | undefined;
38
+ };
39
+ data: Record<string, unknown> | undefined;
40
+ index: number;
41
+ }): any;
42
+ }>;
21
43
  export default _default;
44
+ type __VLS_WithTemplateSlots<T, S> = T & {
45
+ new (): {
46
+ $slots: S;
47
+ };
48
+ };
@@ -0,0 +1,9 @@
1
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{}>>, {}, {}>, {
2
+ default?(_: {}): any;
3
+ }>;
4
+ export default _default;
5
+ type __VLS_WithTemplateSlots<T, S> = T & {
6
+ new (): {
7
+ $slots: S;
8
+ };
9
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{}>>, {}, {}>;
2
+ export default _default;
@@ -1,19 +1,11 @@
1
- export type NavItem = {
2
- id?: string;
3
- title: string;
4
- to?: string | {
5
- [key: string]: unknown;
6
- };
7
- href?: string;
8
- disabled?: boolean;
9
- on?: Record<string, () => void>;
10
- };
11
1
  export declare const VvNavProps: {
12
2
  items: {
13
- type: globalThis.PropType<NavItem[]>;
14
- required: boolean;
3
+ type: globalThis.PropType<import("../..").NavItem[]>;
15
4
  default: () => never[];
16
5
  };
17
- modifiers: globalThis.PropType<string | string[]>;
6
+ modifiers: {
7
+ type: globalThis.PropType<string | string[]>;
8
+ default: undefined;
9
+ };
18
10
  };
19
11
  export declare const VvNavEvents: string[];