@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
1
  import { unref, computed, isRef, defineComponent, h, inject, toRef, toRefs, useSlots, ref, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode, vModelRadio, renderSlot, createTextVNode, toDisplayString, createVNode, createSlots, withCtx, normalizeProps, guardReactiveProps, provide, createCommentVNode, Fragment, renderList, createBlock, mergeProps } from "vue";
2
- import { nanoid } from "nanoid";
2
+ import { uid } from "uid";
3
3
  import { useVModel } from "@vueuse/core";
4
4
  import { get } from "ts-dot-prop";
5
5
  var Strategy = /* @__PURE__ */ ((Strategy2) => {
@@ -36,6 +36,13 @@ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
36
36
  ButtonType2["reset"] = "reset";
37
37
  return ButtonType2;
38
38
  })(ButtonType || {});
39
+ var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
40
+ ActionTag2["nuxtLink"] = "nuxt-link";
41
+ ActionTag2["routerLink"] = "router-link";
42
+ ActionTag2["a"] = "a";
43
+ ActionTag2["button"] = "button";
44
+ return ActionTag2;
45
+ })(ActionTag || {});
39
46
  var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
40
47
  AnchorTarget2["_blank"] = "_blank";
41
48
  AnchorTarget2["_self"] = "_self";
@@ -265,6 +272,7 @@ const LinkProps = {
265
272
  */
266
273
  target: {
267
274
  type: String,
275
+ default: void 0,
268
276
  validator: (value) => Object.values(AnchorTarget).includes(value)
269
277
  },
270
278
  /**
@@ -279,27 +287,33 @@ const ValidProps = {
279
287
  /**
280
288
  * Valid status
281
289
  */
282
- valid: Boolean,
290
+ valid: { type: Boolean, default: false },
283
291
  /**
284
292
  * Valid label
285
293
  */
286
- validLabel: [String, Array]
294
+ validLabel: { type: [String, Array], default: void 0 }
287
295
  };
288
296
  const InvalidProps = {
289
297
  /**
290
298
  * Invalid status
291
299
  */
292
- invalid: Boolean,
300
+ invalid: {
301
+ type: Boolean,
302
+ default: false
303
+ },
293
304
  /**
294
305
  * Invalid label
295
306
  */
296
- invalidLabel: [String, Array]
307
+ invalidLabel: { type: [String, Array], default: void 0 }
297
308
  };
298
309
  const LoadingProps = {
299
310
  /**
300
311
  * Loading status
301
312
  */
302
- loading: Boolean,
313
+ loading: {
314
+ type: Boolean,
315
+ default: false
316
+ },
303
317
  /**
304
318
  * Loading label
305
319
  */
@@ -312,37 +326,64 @@ const DisabledProps = {
312
326
  /**
313
327
  * Whether the form control is disabled
314
328
  */
315
- disabled: Boolean
329
+ disabled: {
330
+ type: Boolean,
331
+ default: false
332
+ }
316
333
  };
317
334
  const ActiveProps = {
318
335
  /**
319
336
  * Whether the item is active
320
337
  */
321
- active: Boolean
338
+ active: {
339
+ type: Boolean,
340
+ default: false
341
+ }
342
+ };
343
+ const CurrentProps = {
344
+ /**
345
+ * Whether the item is current
346
+ */
347
+ current: {
348
+ type: Boolean,
349
+ default: false
350
+ }
322
351
  };
323
352
  const PressedProps = {
324
353
  /**
325
354
  * Whether the item is pressed
326
355
  */
327
- pressed: Boolean
356
+ pressed: {
357
+ type: Boolean,
358
+ default: false
359
+ }
328
360
  };
329
361
  const LabelProps = {
330
362
  /**
331
363
  * The item label
332
364
  */
333
- label: [String, Number]
365
+ label: {
366
+ type: [String, Number],
367
+ default: void 0
368
+ }
334
369
  };
335
370
  const ReadonlyProps = {
336
371
  /**
337
372
  * The value is not editable
338
373
  */
339
- readonly: Boolean
374
+ readonly: {
375
+ type: Boolean,
376
+ default: false
377
+ }
340
378
  };
341
379
  const ModifiersProps = {
342
380
  /**
343
381
  * Component BEM modifiers
344
382
  */
345
- modifiers: [String, Array]
383
+ modifiers: {
384
+ type: [String, Array],
385
+ default: void 0
386
+ }
346
387
  };
347
388
  const HintProps = {
348
389
  hintLabel: { type: String, default: "" }
@@ -373,7 +414,10 @@ const OptionsProps = {
373
414
  * VvIcon name or props
374
415
  * @see VVIcon
375
416
  */
376
- icon: { type: [String, Object] },
417
+ icon: {
418
+ type: [String, Object],
419
+ default: void 0
420
+ },
377
421
  /**
378
422
  * VvIcon position
379
423
  */
@@ -418,7 +462,8 @@ const IdProps = {
418
462
  * Dropdown show / hide transition name
419
463
  */
420
464
  transitionName: {
421
- type: String
465
+ type: String,
466
+ default: void 0
422
467
  },
423
468
  /**
424
469
  * Offset of the dropdown from the trigger
@@ -486,7 +531,8 @@ const IdProps = {
486
531
  * Set dropdown width to the same as the trigger
487
532
  */
488
533
  triggerWidth: {
489
- type: Boolean
534
+ type: Boolean,
535
+ default: false
490
536
  }
491
537
  });
492
538
  const IdNameProps = {
@@ -513,11 +559,17 @@ const CheckboxRadioProps = {
513
559
  * Input value
514
560
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value
515
561
  */
516
- value: [String, Number, Boolean],
562
+ value: {
563
+ type: [String, Number, Boolean],
564
+ default: void 0
565
+ },
517
566
  /**
518
567
  * Input value
519
568
  */
520
- modelValue: [Object, Number, Boolean, String]
569
+ modelValue: {
570
+ type: [Object, Number, Boolean, String],
571
+ default: void 0
572
+ }
521
573
  };
522
574
  const CheckboxRadioGroupProps = {
523
575
  ...ValidProps,
@@ -532,7 +584,10 @@ const CheckboxRadioGroupProps = {
532
584
  /**
533
585
  * Input value
534
586
  */
535
- modelValue: [String, Array, Boolean, Number, Symbol],
587
+ modelValue: {
588
+ type: [String, Array, Boolean, Number, Symbol],
589
+ default: void 0
590
+ },
536
591
  /**
537
592
  * Input name
538
593
  */
@@ -540,13 +595,17 @@ const CheckboxRadioGroupProps = {
540
595
  /**
541
596
  * If true, the group will be displayed in a vertical column
542
597
  */
543
- vertical: Boolean
598
+ vertical: {
599
+ type: Boolean,
600
+ default: false
601
+ }
544
602
  };
545
603
  ({
546
604
  ...DisabledProps,
547
605
  ...LabelProps,
548
606
  ...PressedProps,
549
607
  ...ActiveProps,
608
+ ...CurrentProps,
550
609
  ...LinkProps,
551
610
  /**
552
611
  * Button type
@@ -562,6 +621,13 @@ const CheckboxRadioGroupProps = {
562
621
  ariaLabel: {
563
622
  type: String,
564
623
  default: void 0
624
+ },
625
+ /**
626
+ * Default tag for the action
627
+ */
628
+ defaultTag: {
629
+ type: String,
630
+ default: ActionTag.button
565
631
  }
566
632
  });
567
633
  function useInjectedGroupState(groupKey) {
@@ -685,7 +751,7 @@ function useDefaults(componentName, propsDefinition, props) {
685
751
  }, {});
686
752
  });
687
753
  }
688
- const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || nanoid()));
754
+ const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || uid()));
689
755
  function useModifiers(prefix, modifiers, others) {
690
756
  return computed(() => {
691
757
  const toReturn = {
@@ -718,8 +784,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
718
784
  ...__default__$1,
719
785
  props: VvRadioProps,
720
786
  emits: VvRadioEvents,
721
- setup(__props, { emit }) {
787
+ setup(__props, { emit: __emit }) {
722
788
  const props = __props;
789
+ const emit = __emit;
723
790
  const slots = useSlots();
724
791
  const propsDefaults = useDefaults(
725
792
  "VvRadio",
@@ -800,12 +867,19 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
800
867
  [vModelRadio, unref(localModelValue)]
801
868
  ]),
802
869
  renderSlot(_ctx.$slots, "default", { value: unref(modelValue) }, () => [
803
- createTextVNode(toDisplayString(_ctx.label), 1)
870
+ createTextVNode(
871
+ toDisplayString(_ctx.label),
872
+ 1
873
+ /* TEXT */
874
+ )
804
875
  ]),
805
876
  createVNode(unref(HintSlot), {
806
877
  id: unref(hasHintId),
807
878
  class: "vv-radio__hint"
808
- }, createSlots({ _: 2 }, [
879
+ }, createSlots({
880
+ _: 2
881
+ /* DYNAMIC */
882
+ }, [
809
883
  _ctx.$slots.hint ? {
810
884
  name: "hint",
811
885
  fn: withCtx(() => [
@@ -892,8 +966,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
892
966
  ...__default__,
893
967
  props: VvRadioGroupProps,
894
968
  emits: VvRadioGroupEvents,
895
- setup(__props, { emit }) {
969
+ setup(__props, { emit: __emit }) {
896
970
  const props = __props;
971
+ const emit = __emit;
897
972
  const slots = useSlots();
898
973
  const propsDefaults = useDefaults(
899
974
  "VvRadioGroup",
@@ -932,49 +1007,88 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
932
1007
  };
933
1008
  const { HintSlot, hintSlotScope } = HintSlotFactory(propsDefaults, slots);
934
1009
  return (_ctx, _cache) => {
935
- return openBlock(), createElementBlock("fieldset", {
936
- class: normalizeClass(unref(bemCssClasses))
937
- }, [
938
- _ctx.label ? (openBlock(), createElementBlock("legend", {
939
- key: 0,
940
- textContent: toDisplayString(_ctx.label)
941
- }, null, 8, _hoisted_1)) : createCommentVNode("", true),
942
- createElementVNode("div", _hoisted_2, [
943
- _ctx.options.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.options, (option, index) => {
944
- return openBlock(), createBlock(_sfc_main$1, mergeProps({ key: index }, getOptionProps(option, index)), null, 16);
945
- }), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 })
946
- ]),
947
- createVNode(unref(HintSlot), { class: "vv-radio-group__hint" }, createSlots({ _: 2 }, [
948
- _ctx.$slots.hint ? {
949
- name: "hint",
950
- fn: withCtx(() => [
951
- renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
952
- ]),
953
- key: "0"
954
- } : void 0,
955
- _ctx.$slots.loading ? {
956
- name: "loading",
957
- fn: withCtx(() => [
958
- renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
959
- ]),
960
- key: "1"
961
- } : void 0,
962
- _ctx.$slots.valid ? {
963
- name: "valid",
964
- fn: withCtx(() => [
965
- renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
966
- ]),
967
- key: "2"
968
- } : void 0,
969
- _ctx.$slots.invalid ? {
970
- name: "invalid",
971
- fn: withCtx(() => [
972
- renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1010
+ return openBlock(), createElementBlock(
1011
+ "fieldset",
1012
+ {
1013
+ class: normalizeClass(unref(bemCssClasses))
1014
+ },
1015
+ [
1016
+ _ctx.label ? (openBlock(), createElementBlock("legend", {
1017
+ key: 0,
1018
+ textContent: toDisplayString(_ctx.label)
1019
+ }, null, 8, _hoisted_1)) : createCommentVNode("v-if", true),
1020
+ createElementVNode("div", _hoisted_2, [
1021
+ createCommentVNode(" #region options "),
1022
+ _ctx.options.length > 0 ? (openBlock(true), createElementBlock(
1023
+ Fragment,
1024
+ { key: 0 },
1025
+ renderList(_ctx.options, (option, index) => {
1026
+ return openBlock(), createBlock(
1027
+ _sfc_main$1,
1028
+ mergeProps({ key: index }, getOptionProps(option, index)),
1029
+ null,
1030
+ 16
1031
+ /* FULL_PROPS */
1032
+ );
1033
+ }),
1034
+ 128
1035
+ /* KEYED_FRAGMENT */
1036
+ )) : (openBlock(), createElementBlock(
1037
+ Fragment,
1038
+ { key: 1 },
1039
+ [
1040
+ createCommentVNode(" #endregion "),
1041
+ createCommentVNode(" #region default "),
1042
+ renderSlot(_ctx.$slots, "default")
1043
+ ],
1044
+ 2112
1045
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
1046
+ )),
1047
+ createCommentVNode(" #endregion ")
1048
+ ]),
1049
+ createVNode(
1050
+ unref(HintSlot),
1051
+ { class: "vv-radio-group__hint" },
1052
+ createSlots({
1053
+ _: 2
1054
+ /* DYNAMIC */
1055
+ }, [
1056
+ _ctx.$slots.hint ? {
1057
+ name: "hint",
1058
+ fn: withCtx(() => [
1059
+ renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1060
+ ]),
1061
+ key: "0"
1062
+ } : void 0,
1063
+ _ctx.$slots.loading ? {
1064
+ name: "loading",
1065
+ fn: withCtx(() => [
1066
+ renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1067
+ ]),
1068
+ key: "1"
1069
+ } : void 0,
1070
+ _ctx.$slots.valid ? {
1071
+ name: "valid",
1072
+ fn: withCtx(() => [
1073
+ renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1074
+ ]),
1075
+ key: "2"
1076
+ } : void 0,
1077
+ _ctx.$slots.invalid ? {
1078
+ name: "invalid",
1079
+ fn: withCtx(() => [
1080
+ renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1081
+ ]),
1082
+ key: "3"
1083
+ } : void 0
973
1084
  ]),
974
- key: "3"
975
- } : void 0
976
- ]), 1024)
977
- ], 2);
1085
+ 1024
1086
+ /* DYNAMIC_SLOTS */
1087
+ )
1088
+ ],
1089
+ 2
1090
+ /* CLASS */
1091
+ );
978
1092
  };
979
1093
  }
980
1094
  });
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("nanoid"),require("@vueuse/core"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","nanoid","@vueuse/core","ts-dot-prop"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvRadioGroup=t(e.vue,e.nanoid,e.core,e.tsDotProp)}(this,(function(e,t,l,o){"use strict";var a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),n=(e=>(e.before="before",e.after="after",e))(n||{}),i=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(i||{});const r=Symbol.for("volver"),u=Symbol.for("radioGroup");function d(e,t,l){return l?v(e,l)===v(t,l):s(e,t)}function s(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const l=Array.isArray(e),o=Array.isArray(t);let a,n,i;if(l&&o){if(n=e.length,n!=t.length)return!1;for(a=n;0!=a--;)if(!s(e[a],t[a]))return!1;return!0}if(l!=o)return!1;const r=e instanceof Date,u=t instanceof Date;if(r!=u)return!1;if(r&&u)return e.getTime()==t.getTime();const d=e instanceof RegExp,v=t instanceof RegExp;if(d!=v)return!1;if(d&&v)return e.toString()==t.toString();const f=Object.keys(e);if(n=f.length,n!==Object.keys(t).length)return!1;for(a=n;0!=a--;)if(!Object.prototype.hasOwnProperty.call(t,f[a]))return!1;for(a=n;0!=a--;)if(i=f[a],!s(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function v(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const l=t.split(".");let o=e;for(let t=0,a=l.length;t<a;++t){if(null==e)return null;o=o[l[t]]}return o}}return null}function f(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}function c(t,l){const o=e.computed((()=>e.isRef(t)?t.value:t)),a=e.computed((()=>f(o.value.invalidLabel))),n=e.computed((()=>f(o.value.validLabel))),i=e.computed((()=>o.value.loadingLabel)),r=e.computed((()=>o.value.hintLabel)),u=e.computed((()=>Boolean(o.value.loading&&(l.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(o.value.invalid&&(l.invalid||a.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(o.value.valid&&(l.valid||n.value)))),v=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(l.hint||r.value))),c=e.computed((()=>d.value||s.value||u.value||v.value)),p=e.computed((()=>({modelValue:o.value.modelValue,valid:o.value.valid,invalid:o.value.invalid,loading:o.value.loading}))),m=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:c,invalidLabel:a,validLabel:n,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:v}),render(){var t,l,o,a,n,i,r,u;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(l=(t=this.$slots).loading)?void 0:l.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(a=(o=this.$slots).invalid)?void 0:a.call(o))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(n=this.$slots).valid)?void 0:i.call(n))??this.validLabel):e.h(this.tag,{role:d},(null==(u=(r=this.$slots).hint)?void 0:u.call(r))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:d,hasHintLabelOrSlot:v,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:p,HintSlot:m}}const p={valid:Boolean,validLabel:[String,Array]},m={invalid:Boolean,invalidLabel:[String,Array]},b={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},g={disabled:Boolean},y=(Boolean,Boolean,{label:[String,Number]}),h={readonly:Boolean},S={modifiers:[String,Array]},L={hintLabel:{type:String,default:""}},O={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}};n.before;const B={tabindex:{type:[String,Number],default:0}},k={id:[String,Number]};a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const V={...{...k,name:{type:String,required:!0}},...B,...p,...m,...L,...g,...h,...S,...y,...b,value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String]},$={...p,...m,...O,...L,...g,...h,...S,...y,...b,modelValue:[String,Array,Boolean,Number,Symbol],name:{type:String,required:!0},vertical:Boolean};function R(t){const l=e.inject(t,void 0),o=e.computed((()=>{return t=l,!(null==(o=e.unref(t))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length);var t,o}));return{group:l,isInGroup:o,getGroupOrLocalRef:function(t,o,a){if(null==l?void 0:l.value){const o=e.unref(l.value)[t];return e.computed({get:()=>null==o?void 0:o.value,set(e){o.value=e}})}const n=e.toRef(o,t);return e.computed({get:()=>n.value,set(e){a&&a(`update:${t}`,e)}})}}}i.button;const j=V;function A(t,l,o){const a=e.inject(r),n=e.computed((()=>{var e;if(a&&(null==(e=a.defaults.value)?void 0:e[t]))return a.defaults.value[t]}));return e.computed((()=>{if(void 0===n.value)return o;const e=n.value,t=l,a=o;return Object.keys(t).reduce(((l,o)=>{const n=a[o];if(l[o]=n,o in e){if(Array.isArray(t[o])){const a=t[o];if(a.length){a[0]===n&&(l[o]=e[o])}}if("function"==typeof t[o]){(0,t[o])()===n&&(l[o]=e[o])}if("object"==typeof t[o]){let a=t[o].default;"function"==typeof a&&(a=a()),"object"==typeof a?JSON.stringify(a)===JSON.stringify(n)&&(l[o]=e[o]):a===n&&(l[o]=e[o])}}return l}),{})}))}function x(t,l,o){return e.computed((()=>{const a={[t]:!0},n="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(a[`${t}--${e}`]=!0)})),o&&Object.keys(o.value).forEach((l=>{a[`${t}--${l}`]=e.unref(o.value[l])})),a}))}const P=["for"],C=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"],N=e.defineComponent({name:"VvRadio",props:j,emits:["click","update:modelValue","change","blur"],setup(l,{emit:o}){const a=l,n=e.useSlots(),i=A("VvRadio",j,a),{id:r,disabled:s,readonly:v,modelValue:f,valid:p,invalid:m}=function(t,l){const{id:o}=e.toRefs(t),{group:a,isInGroup:n,getGroupOrLocalRef:i}=R(u),r=i("modelValue",t,l),d=i("valid",t),s=i("invalid",t),v=e.computed((()=>{var e;return Boolean(t.readonly||(null==(e=null==a?void 0:a.value)?void 0:e.readonly.value))})),f=e.computed((()=>{var e;return Boolean(t.disabled||(null==(e=null==a?void 0:a.value)?void 0:e.disabled.value))}));return{id:o,group:a,isInGroup:n,modelValue:r,valid:d,invalid:s,readonly:v,disabled:f}}(a,o),b=(l=>e.computed((()=>String((null==l?void 0:l.value)||t.nanoid()))))(r),g=e.computed((()=>`${b.value}-hint`)),y=e.computed((()=>S.value?-1:a.tabindex)),h=e.ref(),S=e.computed((()=>s.value||v.value)),L=e.computed((()=>!0===m.value||!0!==p.value&&void 0)),O=e.computed((()=>Array.isArray(f.value)?function(e,t){if(null!=e&&t&&t.length)for(const l of t)if(d(e,l))return!0;return!1}(a.value,f.value):d(a.value,f.value))),B=e.computed((()=>!["string","number","boolean"].includes(typeof a.value)||a.value)),k=e.computed({get:()=>O.value?B.value:null,set(e){Array.isArray(f.value)?f.value=[a.value]:f.value=a.value,o("change",e)}}),{modifiers:V}=e.toRefs(a),$=x("vv-radio",V,e.computed((()=>({valid:p.value,invalid:m.value,disabled:s.value,readonly:v.value})))),{HintSlot:N,hasHintLabelOrSlot:w,hasInvalidLabelOrSlot:_,hintSlotScope:z}=c(i,n);return(t,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref($)),for:e.unref(b)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(b),ref_key:"input",ref:h,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(k)?k.value=t:null),type:"radio",class:"vv-radio__input",name:t.name,disabled:e.unref(S),value:e.unref(B),tabindex:e.unref(y),"aria-invalid":e.unref(L),"aria-describedby":e.unref(w)?e.unref(g):void 0,"aria-errormessage":e.unref(_)?e.unref(g):void 0},null,8,C),[[e.vModelRadio,e.unref(k)]]),e.renderSlot(t.$slots,"default",{value:e.unref(f)},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)])),e.createVNode(e.unref(N),{id:e.unref(g),class:"vv-radio__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"3"}:void 0]),1032,["id"])],10,P))}}),w=$;const _=["textContent"],z={class:"vv-radio-group__wrapper"};return e.defineComponent({name:"VvRadioGroup",props:w,emits:["update:modelValue","change"],setup(t,{emit:a}){const n=t,i=e.useSlots(),r=A("VvRadioGroup",w,n),d=l.useVModel(n,"modelValue",a),{disabled:s,readonly:v,vertical:f,valid:p,invalid:m,modifiers:b}=e.toRefs(n);!function(t){if(Object.keys(t).some((l=>"key"!==l&&!e.isRef(t[l]))))throw Error("One or more groupState props aren't ref.");e.provide(t.key,e.computed((()=>t)))}({key:u,modelValue:d,disabled:s,readonly:v,valid:p,invalid:m});const{getOptionLabel:g,getOptionValue:y}=function(t){const{options:l,labelKey:a,valueKey:n,disabledKey:i}=e.toRefs(t);return{options:l,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof a.value?a.value(e):o.get(e,a.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof n.value?n.value(e):o.get(e,n.value),isOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof i.value?i.value(e):o.get(e,i.value)),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(n),h=x("vv-radio-group",b,e.computed((()=>({disabled:s.value,readonly:v.value,horizontal:!f.value,valid:p.value,invalid:m.value})))),{HintSlot:S,hintSlotScope:L}=c(r,i);return(t,l)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(h))},[t.label?(e.openBlock(),e.createElementBlock("legend",{key:0,textContent:e.toDisplayString(t.label)},null,8,_)):e.createCommentVNode("",!0),e.createElementVNode("div",z,[t.options.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.options,((t,l)=>(e.openBlock(),e.createBlock(N,e.mergeProps({key:l},((e,t)=>({id:`${n.name}_opt${t}`,name:n.name,label:g(e),value:y(e)}))(t,l)),null,16)))),128)):e.renderSlot(t.$slots,"default",{key:1})]),e.createVNode(e.unref(S),{class:"vv-radio-group__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(L))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(L))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(L))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(L))))])),key:"3"}:void 0]),1024)],2))}})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("uid"),require("@vueuse/core"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","uid","@vueuse/core","ts-dot-prop"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvRadioGroup=t(e.vue,e.uid,e.core,e.tsDotProp)}(this,(function(e,t,l,o){"use strict";var a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),n=(e=>(e.before="before",e.after="after",e))(n||{}),i=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(i||{}),r=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(r||{});const u=Symbol.for("volver"),d=Symbol.for("radioGroup");function s(e,t,l){return l?f(e,l)===f(t,l):v(e,t)}function v(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const l=Array.isArray(e),o=Array.isArray(t);let a,n,i;if(l&&o){if(n=e.length,n!=t.length)return!1;for(a=n;0!=a--;)if(!v(e[a],t[a]))return!1;return!0}if(l!=o)return!1;const r=e instanceof Date,u=t instanceof Date;if(r!=u)return!1;if(r&&u)return e.getTime()==t.getTime();const d=e instanceof RegExp,s=t instanceof RegExp;if(d!=s)return!1;if(d&&s)return e.toString()==t.toString();const f=Object.keys(e);if(n=f.length,n!==Object.keys(t).length)return!1;for(a=n;0!=a--;)if(!Object.prototype.hasOwnProperty.call(t,f[a]))return!1;for(a=n;0!=a--;)if(i=f[a],!v(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function f(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const l=t.split(".");let o=e;for(let t=0,a=l.length;t<a;++t){if(null==e)return null;o=o[l[t]]}return o}}return null}function c(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}function p(t,l){const o=e.computed((()=>e.isRef(t)?t.value:t)),a=e.computed((()=>c(o.value.invalidLabel))),n=e.computed((()=>c(o.value.validLabel))),i=e.computed((()=>o.value.loadingLabel)),r=e.computed((()=>o.value.hintLabel)),u=e.computed((()=>Boolean(o.value.loading&&(l.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(o.value.invalid&&(l.invalid||a.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(o.value.valid&&(l.valid||n.value)))),v=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(l.hint||r.value))),f=e.computed((()=>d.value||s.value||u.value||v.value)),p=e.computed((()=>({modelValue:o.value.modelValue,valid:o.value.valid,invalid:o.value.invalid,loading:o.value.loading}))),m=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:f,invalidLabel:a,validLabel:n,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:v}),render(){var t,l,o,a,n,i,r,u;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(l=(t=this.$slots).loading)?void 0:l.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(a=(o=this.$slots).invalid)?void 0:a.call(o))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(n=this.$slots).valid)?void 0:i.call(n))??this.validLabel):e.h(this.tag,{role:d},(null==(u=(r=this.$slots).hint)?void 0:u.call(r))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:d,hasHintLabelOrSlot:v,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:p,HintSlot:m}}const m={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},y={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},b={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},g={disabled:{type:Boolean,default:!1}},h=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),S={readonly:{type:Boolean,default:!1}},L={modifiers:{type:[String,Array],default:void 0}},k={hintLabel:{type:String,default:""}},B={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}};n.before;const O={tabindex:{type:[String,Number],default:0}},V={id:[String,Number]};a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const $={...{...V,name:{type:String,required:!0}},...O,...m,...y,...k,...g,...S,...L,...h,...b,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}},R={...m,...y,...B,...k,...g,...S,...L,...h,...b,modelValue:{type:[String,Array,Boolean,Number,Symbol],default:void 0},name:{type:String,required:!0},vertical:{type:Boolean,default:!1}};function j(t){const l=e.inject(t,void 0),o=e.computed((()=>{return t=l,!(null==(o=e.unref(t))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length);var t,o}));return{group:l,isInGroup:o,getGroupOrLocalRef:function(t,o,a){if(null==l?void 0:l.value){const o=e.unref(l.value)[t];return e.computed({get:()=>null==o?void 0:o.value,set(e){o.value=e}})}const n=e.toRef(o,t);return e.computed({get:()=>n.value,set(e){a&&a(`update:${t}`,e)}})}}}i.button,r.button;const x=$;function A(t,l,o){const a=e.inject(u),n=e.computed((()=>{var e;if(a&&(null==(e=a.defaults.value)?void 0:e[t]))return a.defaults.value[t]}));return e.computed((()=>{if(void 0===n.value)return o;const e=n.value,t=l,a=o;return Object.keys(t).reduce(((l,o)=>{const n=a[o];if(l[o]=n,o in e){if(Array.isArray(t[o])){const a=t[o];if(a.length){a[0]===n&&(l[o]=e[o])}}if("function"==typeof t[o]){(0,t[o])()===n&&(l[o]=e[o])}if("object"==typeof t[o]){let a=t[o].default;"function"==typeof a&&(a=a()),"object"==typeof a?JSON.stringify(a)===JSON.stringify(n)&&(l[o]=e[o]):a===n&&(l[o]=e[o])}}return l}),{})}))}function C(t,l,o){return e.computed((()=>{const a={[t]:!0},n="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(a[`${t}--${e}`]=!0)})),o&&Object.keys(o.value).forEach((l=>{a[`${t}--${l}`]=e.unref(o.value[l])})),a}))}const P=["for"],N=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"],w=e.defineComponent({name:"VvRadio",props:x,emits:["click","update:modelValue","change","blur"],setup(l,{emit:o}){const a=l,n=o,i=e.useSlots(),r=A("VvRadio",x,a),{id:u,disabled:v,readonly:f,modelValue:c,valid:m,invalid:y}=function(t,l){const{id:o}=e.toRefs(t),{group:a,isInGroup:n,getGroupOrLocalRef:i}=j(d),r=i("modelValue",t,l),u=i("valid",t),s=i("invalid",t),v=e.computed((()=>{var e;return Boolean(t.readonly||(null==(e=null==a?void 0:a.value)?void 0:e.readonly.value))})),f=e.computed((()=>{var e;return Boolean(t.disabled||(null==(e=null==a?void 0:a.value)?void 0:e.disabled.value))}));return{id:o,group:a,isInGroup:n,modelValue:r,valid:u,invalid:s,readonly:v,disabled:f}}(a,n),b=(l=>e.computed((()=>String((null==l?void 0:l.value)||t.uid()))))(u),g=e.computed((()=>`${b.value}-hint`)),h=e.computed((()=>L.value?-1:a.tabindex)),S=e.ref(),L=e.computed((()=>v.value||f.value)),k=e.computed((()=>!0===y.value||!0!==m.value&&void 0)),B=e.computed((()=>Array.isArray(c.value)?function(e,t){if(null!=e&&t&&t.length)for(const l of t)if(s(e,l))return!0;return!1}(a.value,c.value):s(a.value,c.value))),O=e.computed((()=>!["string","number","boolean"].includes(typeof a.value)||a.value)),V=e.computed({get:()=>B.value?O.value:null,set(e){Array.isArray(c.value)?c.value=[a.value]:c.value=a.value,n("change",e)}}),{modifiers:$}=e.toRefs(a),R=C("vv-radio",$,e.computed((()=>({valid:m.value,invalid:y.value,disabled:v.value,readonly:f.value})))),{HintSlot:w,hasHintLabelOrSlot:E,hasInvalidLabelOrSlot:_,hintSlotScope:z}=p(r,i);return(t,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(R)),for:e.unref(b)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(b),ref_key:"input",ref:S,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(V)?V.value=t:null),type:"radio",class:"vv-radio__input",name:t.name,disabled:e.unref(L),value:e.unref(O),tabindex:e.unref(h),"aria-invalid":e.unref(k),"aria-describedby":e.unref(E)?e.unref(g):void 0,"aria-errormessage":e.unref(_)?e.unref(g):void 0},null,8,N),[[e.vModelRadio,e.unref(V)]]),e.renderSlot(t.$slots,"default",{value:e.unref(c)},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)])),e.createVNode(e.unref(w),{id:e.unref(g),class:"vv-radio__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"3"}:void 0]),1032,["id"])],10,P))}}),E=R;const _=["textContent"],z={class:"vv-radio-group__wrapper"};return e.defineComponent({name:"VvRadioGroup",props:E,emits:["update:modelValue","change"],setup(t,{emit:a}){const n=t,i=a,r=e.useSlots(),u=A("VvRadioGroup",E,n),s=l.useVModel(n,"modelValue",i),{disabled:v,readonly:f,vertical:c,valid:m,invalid:y,modifiers:b}=e.toRefs(n);!function(t){if(Object.keys(t).some((l=>"key"!==l&&!e.isRef(t[l]))))throw Error("One or more groupState props aren't ref.");e.provide(t.key,e.computed((()=>t)))}({key:d,modelValue:s,disabled:v,readonly:f,valid:m,invalid:y});const{getOptionLabel:g,getOptionValue:h}=function(t){const{options:l,labelKey:a,valueKey:n,disabledKey:i}=e.toRefs(t);return{options:l,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof a.value?a.value(e):o.get(e,a.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof n.value?n.value(e):o.get(e,n.value),isOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof i.value?i.value(e):o.get(e,i.value)),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(n),S=C("vv-radio-group",b,e.computed((()=>({disabled:v.value,readonly:f.value,horizontal:!c.value,valid:m.value,invalid:y.value})))),{HintSlot:L,hintSlotScope:k}=p(u,r);return(t,l)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(S))},[t.label?(e.openBlock(),e.createElementBlock("legend",{key:0,textContent:e.toDisplayString(t.label)},null,8,_)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",z,[e.createCommentVNode(" #region options "),t.options.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.options,((t,l)=>(e.openBlock(),e.createBlock(w,e.mergeProps({key:l},((e,t)=>({id:`${n.name}_opt${t}`,name:n.name,label:g(e),value:h(e)}))(t,l)),null,16)))),128)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createCommentVNode(" #endregion "),e.createCommentVNode(" #region default "),e.renderSlot(t.$slots,"default")],2112)),e.createCommentVNode(" #endregion ")]),e.createVNode(e.unref(L),{class:"vv-radio-group__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"3"}:void 0]),1024)],2))}})}));
@@ -1,20 +1,41 @@
1
1
  import type { Option } from '../../types/generic';
2
2
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
3
- modelValue: (SymbolConstructor | ArrayConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
3
+ modelValue: {
4
+ type: (SymbolConstructor | ArrayConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
5
+ default: undefined;
6
+ };
4
7
  name: {
5
8
  type: StringConstructor;
6
9
  required: boolean;
7
10
  };
8
- vertical: BooleanConstructor;
9
- loading: BooleanConstructor;
11
+ vertical: {
12
+ type: BooleanConstructor;
13
+ default: boolean;
14
+ };
15
+ loading: {
16
+ type: BooleanConstructor;
17
+ default: boolean;
18
+ };
10
19
  loadingLabel: {
11
20
  type: StringConstructor;
12
21
  default: string;
13
22
  };
14
- label: (StringConstructor | NumberConstructor)[];
15
- modifiers: globalThis.PropType<string | string[]>;
16
- readonly: BooleanConstructor;
17
- disabled: BooleanConstructor;
23
+ label: {
24
+ type: (StringConstructor | NumberConstructor)[];
25
+ default: undefined;
26
+ };
27
+ modifiers: {
28
+ type: globalThis.PropType<string | string[]>;
29
+ default: undefined;
30
+ };
31
+ readonly: {
32
+ type: BooleanConstructor;
33
+ default: boolean;
34
+ };
35
+ disabled: {
36
+ type: BooleanConstructor;
37
+ default: boolean;
38
+ };
18
39
  hintLabel: {
19
40
  type: StringConstructor;
20
41
  default: string;
@@ -35,26 +56,61 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
35
56
  type: (StringConstructor | FunctionConstructor)[];
36
57
  default: string;
37
58
  };
38
- invalid: BooleanConstructor;
39
- invalidLabel: (ArrayConstructor | StringConstructor)[];
40
- valid: BooleanConstructor;
41
- validLabel: (ArrayConstructor | StringConstructor)[];
42
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
43
- modelValue: (SymbolConstructor | ArrayConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
59
+ invalid: {
60
+ type: BooleanConstructor;
61
+ default: boolean;
62
+ };
63
+ invalidLabel: {
64
+ type: (ArrayConstructor | StringConstructor)[];
65
+ default: undefined;
66
+ };
67
+ valid: {
68
+ type: BooleanConstructor;
69
+ default: boolean;
70
+ };
71
+ validLabel: {
72
+ type: (ArrayConstructor | StringConstructor)[];
73
+ default: undefined;
74
+ };
75
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
76
+ [x: string]: (...args: any[]) => void;
77
+ }, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{
78
+ modelValue: {
79
+ type: (SymbolConstructor | ArrayConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
80
+ default: undefined;
81
+ };
44
82
  name: {
45
83
  type: StringConstructor;
46
84
  required: boolean;
47
85
  };
48
- vertical: BooleanConstructor;
49
- loading: BooleanConstructor;
86
+ vertical: {
87
+ type: BooleanConstructor;
88
+ default: boolean;
89
+ };
90
+ loading: {
91
+ type: BooleanConstructor;
92
+ default: boolean;
93
+ };
50
94
  loadingLabel: {
51
95
  type: StringConstructor;
52
96
  default: string;
53
97
  };
54
- label: (StringConstructor | NumberConstructor)[];
55
- modifiers: globalThis.PropType<string | string[]>;
56
- readonly: BooleanConstructor;
57
- disabled: BooleanConstructor;
98
+ label: {
99
+ type: (StringConstructor | NumberConstructor)[];
100
+ default: undefined;
101
+ };
102
+ modifiers: {
103
+ type: globalThis.PropType<string | string[]>;
104
+ default: undefined;
105
+ };
106
+ readonly: {
107
+ type: BooleanConstructor;
108
+ default: boolean;
109
+ };
110
+ disabled: {
111
+ type: BooleanConstructor;
112
+ default: boolean;
113
+ };
58
114
  hintLabel: {
59
115
  type: StringConstructor;
60
116
  default: string;
@@ -75,21 +131,36 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
75
131
  type: (StringConstructor | FunctionConstructor)[];
76
132
  default: string;
77
133
  };
78
- invalid: BooleanConstructor;
79
- invalidLabel: (ArrayConstructor | StringConstructor)[];
80
- valid: BooleanConstructor;
81
- validLabel: (ArrayConstructor | StringConstructor)[];
82
- }>> & {
83
- [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
84
- }, {
134
+ invalid: {
135
+ type: BooleanConstructor;
136
+ default: boolean;
137
+ };
138
+ invalidLabel: {
139
+ type: (ArrayConstructor | StringConstructor)[];
140
+ default: undefined;
141
+ };
142
+ valid: {
143
+ type: BooleanConstructor;
144
+ default: boolean;
145
+ };
146
+ validLabel: {
147
+ type: (ArrayConstructor | StringConstructor)[];
148
+ default: undefined;
149
+ };
150
+ }>>, {
151
+ readonly: boolean;
85
152
  disabled: boolean;
153
+ valid: boolean;
154
+ invalid: boolean;
155
+ modelValue: string | number | boolean | symbol | unknown[];
156
+ modifiers: string | string[];
86
157
  options: (string | Option)[];
158
+ label: string | number;
87
159
  loading: boolean;
88
160
  loadingLabel: string;
89
- readonly: boolean;
90
161
  hintLabel: string;
91
- invalid: boolean;
92
- valid: boolean;
162
+ invalidLabel: string | unknown[];
163
+ validLabel: string | unknown[];
93
164
  vertical: boolean;
94
165
  labelKey: string | Function;
95
166
  valueKey: string | Function;