@volverjs/ui-vue 0.0.10-beta.3 → 0.0.10-beta.31

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 (294) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +106 -10
  3. package/auto-imports.d.ts +7 -2
  4. package/bin/icons.cjs +1 -1
  5. package/bin/icons.js +22 -15
  6. package/dist/Volver.d.ts +1 -1
  7. package/dist/components/VvAccordion/VvAccordion.es.js +192 -103
  8. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  9. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +160 -8
  10. package/dist/components/VvAccordion/index.d.ts +8 -9
  11. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +451 -172
  12. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  13. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +58 -13
  14. package/dist/components/VvAccordionGroup/index.d.ts +14 -6
  15. package/dist/components/VvAction/VvAction.es.js +78 -27
  16. package/dist/components/VvAction/VvAction.umd.js +1 -1
  17. package/dist/components/VvAction/VvAction.vue.d.ts +57 -22
  18. package/dist/components/VvAction/index.d.ts +25 -9
  19. package/dist/components/VvAlert/VvAlert.es.js +204 -171
  20. package/dist/components/VvAlert/VvAlert.umd.js +1 -1
  21. package/dist/components/VvAlert/VvAlert.vue.d.ts +24 -14
  22. package/dist/components/VvAlert/index.d.ts +17 -9
  23. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +250 -188
  24. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
  25. package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +16 -9
  26. package/dist/components/VvAlertGroup/index.d.ts +6 -14
  27. package/dist/components/VvAvatar/VvAvatar.es.js +61 -21
  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 +118 -48
  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 +78 -28
  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 +276 -60
  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 +291 -252
  44. package/dist/components/VvButton/VvButton.umd.js +1 -1
  45. package/dist/components/VvButton/VvButton.vue.d.ts +94 -40
  46. package/dist/components/VvButton/index.d.ts +51 -29
  47. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +81 -40
  48. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  49. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +24 -11
  50. package/dist/components/VvButtonGroup/index.d.ts +8 -2
  51. package/dist/components/VvCard/VvCard.es.js +86 -36
  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 +177 -120
  56. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  57. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +105 -33
  58. package/dist/components/VvCheckbox/index.d.ts +47 -14
  59. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +190 -107
  60. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  61. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +101 -30
  62. package/dist/components/VvCheckboxGroup/index.d.ts +45 -12
  63. package/dist/components/VvCombobox/VvCombobox.es.js +806 -581
  64. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  65. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +171 -104
  66. package/dist/components/VvCombobox/index.d.ts +62 -26
  67. package/dist/components/VvDialog/VvDialog.es.js +140 -153
  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 +138 -71
  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 +66 -25
  74. package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +13 -1
  75. package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +12 -4
  76. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +35 -7
  77. package/dist/components/VvDropdown/index.d.ts +52 -10
  78. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +152 -39
  79. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  80. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +335 -8
  81. package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
  82. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +63 -20
  83. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
  84. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +188 -80
  85. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
  86. package/dist/components/VvIcon/VvIcon.es.js +23 -96
  87. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  88. package/dist/components/VvIcon/VvIcon.vue.d.ts +23 -66
  89. package/dist/components/VvIcon/index.d.ts +33 -48
  90. package/dist/components/VvInputFile/VvInputFile.es.js +1777 -0
  91. package/dist/components/VvInputFile/VvInputFile.umd.js +1 -0
  92. package/dist/components/VvInputFile/VvInputFile.vue.d.ts +359 -0
  93. package/dist/components/VvInputFile/index.d.ts +200 -0
  94. package/dist/components/VvInputText/VvInputClearAction.d.ts +7 -5
  95. package/dist/components/VvInputText/VvInputPasswordAction.d.ts +10 -8
  96. package/dist/components/VvInputText/VvInputStepAction.d.ts +2 -2
  97. package/dist/components/VvInputText/VvInputText.es.js +1237 -324
  98. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  99. package/dist/components/VvInputText/VvInputText.vue.d.ts +207 -57
  100. package/dist/components/VvInputText/index.d.ts +99 -29
  101. package/dist/components/VvNav/VvNav.es.js +135 -56
  102. package/dist/components/VvNav/VvNav.umd.js +1 -1
  103. package/dist/components/VvNav/VvNav.vue.d.ts +32 -9
  104. package/dist/components/VvNav/VvNavItem.vue.d.ts +1 -1
  105. package/dist/components/VvNav/VvNavSeparator.vue.d.ts +1 -1
  106. package/dist/components/VvNav/index.d.ts +5 -2
  107. package/dist/components/VvNavItem/VvNavItem.es.js +91 -33
  108. package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
  109. package/dist/components/VvProgress/VvProgress.es.js +72 -26
  110. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  111. package/dist/components/VvProgress/VvProgress.vue.d.ts +10 -3
  112. package/dist/components/VvProgress/index.d.ts +4 -1
  113. package/dist/components/VvRadio/VvRadio.es.js +160 -103
  114. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  115. package/dist/components/VvRadio/VvRadio.vue.d.ts +103 -31
  116. package/dist/components/VvRadio/index.d.ts +50 -17
  117. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +190 -107
  118. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  119. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +101 -30
  120. package/dist/components/VvRadioGroup/index.d.ts +45 -12
  121. package/dist/components/VvSelect/VvSelect.es.js +251 -238
  122. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  123. package/dist/components/VvSelect/VvSelect.vue.d.ts +117 -44
  124. package/dist/components/VvSelect/index.d.ts +48 -14
  125. package/dist/components/VvTab/VvTab.es.js +191 -75
  126. package/dist/components/VvTab/VvTab.umd.js +1 -1
  127. package/dist/components/VvTab/VvTab.vue.d.ts +31 -7
  128. package/dist/components/VvTab/index.d.ts +4 -1
  129. package/dist/components/VvTextarea/VvTextarea.es.js +232 -224
  130. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  131. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +156 -49
  132. package/dist/components/VvTextarea/index.d.ts +68 -19
  133. package/dist/components/VvTooltip/VvTooltip.es.js +79 -29
  134. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  135. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +13 -6
  136. package/dist/components/VvTooltip/index.d.ts +5 -2
  137. package/dist/components/common/HintSlot.d.ts +1 -1
  138. package/dist/components/index.d.ts +10 -0
  139. package/dist/components/index.es.js +3534 -1650
  140. package/dist/components/index.umd.js +1 -1
  141. package/dist/composables/alert/useAlert.d.ts +99 -4
  142. package/dist/composables/alert/useInjectAlert.d.ts +1 -6
  143. package/dist/composables/dropdown/useInjectDropdown.d.ts +3 -23
  144. package/dist/composables/dropdown/useProvideDropdown.d.ts +3 -4
  145. package/dist/composables/group/useInjectedGroupState.d.ts +4 -5
  146. package/dist/composables/group/useProvideGroupState.d.ts +3 -3
  147. package/dist/composables/index.d.ts +1 -0
  148. package/dist/composables/index.es.js +92 -3
  149. package/dist/composables/index.umd.js +1 -1
  150. package/dist/composables/useBlurhash.d.ts +7 -0
  151. package/dist/composables/useComponentIcon.d.ts +9 -8
  152. package/dist/composables/usePersistence.d.ts +2 -0
  153. package/dist/composables/useVolver.d.ts +1 -1
  154. package/dist/constants.d.ts +34 -32
  155. package/dist/directives/index.d.ts +3 -5
  156. package/dist/directives/index.es.js +99 -43
  157. package/dist/directives/index.umd.js +1 -1
  158. package/dist/directives/v-tooltip.es.js +97 -38
  159. package/dist/directives/v-tooltip.umd.js +1 -1
  160. package/dist/icons.es.js +267 -267
  161. package/dist/icons.umd.js +1 -1
  162. package/dist/index.d.ts +3 -1
  163. package/dist/index.es.js +90 -16
  164. package/dist/index.umd.js +1 -1
  165. package/dist/props/index.d.ts +272 -81
  166. package/dist/resolvers/unplugin.d.ts +6 -1
  167. package/dist/resolvers/unplugin.es.js +87 -10
  168. package/dist/resolvers/unplugin.umd.js +1 -1
  169. package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +143 -89
  170. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +1075 -492
  171. package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +1 -1
  172. package/dist/stories/Blurhash/BlurhashComposable.stories.d.ts +4 -0
  173. package/dist/stories/Button/Button.settings.d.ts +0 -1
  174. package/dist/stories/Combobox/Combobox.settings.d.ts +8 -0
  175. package/dist/stories/Icon/Icon.settings.d.ts +1 -0
  176. package/dist/stories/InputFile/InputFile.settings.d.ts +56 -0
  177. package/dist/stories/InputFile/InputFile.stories.d.ts +12 -0
  178. package/dist/stories/InputFile/InputFileDropArea.stories.d.ts +9 -0
  179. package/dist/stories/InputFile/InputFileIconPosition.stories.d.ts +8 -0
  180. package/dist/stories/InputFile/InputFileSlots.stories.d.ts +7 -0
  181. package/dist/stories/Tab/Tab.settings.d.ts +2 -15
  182. package/dist/test/expect.d.ts +1 -1
  183. package/dist/types/alert.d.ts +9 -7
  184. package/dist/types/blurhash.d.ts +12 -0
  185. package/dist/types/generic.d.ts +1 -2
  186. package/dist/types/group.d.ts +37 -15
  187. package/dist/types/index.d.ts +7 -0
  188. package/dist/types/input-file.d.ts +16 -0
  189. package/dist/types/nav.d.ts +2 -2
  190. package/dist/utils/ObjectUtilities.d.ts +0 -1
  191. package/dist/workers/blurhash.d.ts +1 -0
  192. package/package.json +78 -78
  193. package/src/Volver.ts +31 -20
  194. package/src/assets/icons/detailed.json +1 -1
  195. package/src/assets/icons/normal.json +1 -1
  196. package/src/assets/icons/simple.json +1 -1
  197. package/src/components/VvAccordion/VvAccordion.vue +121 -58
  198. package/src/components/VvAccordion/index.ts +8 -23
  199. package/src/components/VvAccordionGroup/VvAccordionGroup.vue +164 -47
  200. package/src/components/VvAccordionGroup/index.ts +6 -6
  201. package/src/components/VvAction/VvAction.vue +17 -5
  202. package/src/components/VvAlert/index.ts +14 -9
  203. package/src/components/VvAlertGroup/index.ts +3 -15
  204. package/src/components/VvBreadcrumb/VvBreadcrumb.vue +20 -19
  205. package/src/components/VvBreadcrumb/index.ts +2 -8
  206. package/src/components/VvButton/VvButton.vue +17 -7
  207. package/src/components/VvButton/index.ts +9 -16
  208. package/src/components/VvButtonGroup/VvButtonGroup.vue +1 -2
  209. package/src/components/VvCheckbox/index.ts +2 -2
  210. package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +1 -2
  211. package/src/components/VvCombobox/VvCombobox.vue +15 -12
  212. package/src/components/VvCombobox/index.ts +4 -0
  213. package/src/components/VvDropdown/VvDropdown.vue +11 -2
  214. package/src/components/VvDropdown/VvDropdownItem.vue +4 -1
  215. package/src/components/VvDropdown/VvDropdownOption.vue +4 -21
  216. package/src/components/VvDropdown/index.ts +35 -1
  217. package/src/components/VvIcon/VvIcon.vue +2 -2
  218. package/src/components/VvIcon/index.ts +35 -48
  219. package/src/components/VvInputFile/VvInputFile.vue +395 -0
  220. package/src/components/VvInputFile/index.ts +135 -0
  221. package/src/components/VvInputText/VvInputClearAction.ts +10 -6
  222. package/src/components/VvInputText/VvInputPasswordAction.ts +13 -9
  223. package/src/components/VvInputText/VvInputText.vue +141 -33
  224. package/src/components/VvInputText/index.ts +31 -16
  225. package/src/components/VvNav/VvNav.vue +4 -2
  226. package/src/components/VvRadio/index.ts +5 -5
  227. package/src/components/VvRadioGroup/VvRadioGroup.vue +1 -2
  228. package/src/components/VvSelect/VvSelect.vue +5 -8
  229. package/src/components/VvTab/VvTab.vue +5 -1
  230. package/src/components/VvTextarea/VvTextarea.vue +6 -9
  231. package/src/components/index.ts +10 -0
  232. package/src/composables/alert/useAlert.ts +12 -9
  233. package/src/composables/dropdown/useProvideDropdown.ts +4 -4
  234. package/src/composables/group/useInjectedGroupState.ts +20 -16
  235. package/src/composables/group/useProvideGroupState.ts +10 -15
  236. package/src/composables/index.ts +1 -0
  237. package/src/composables/useBlurhash.ts +76 -0
  238. package/src/composables/useComponentIcon.ts +15 -14
  239. package/src/composables/usePersistence.ts +76 -0
  240. package/src/composables/useUniqueId.ts +2 -2
  241. package/src/constants.ts +47 -32
  242. package/src/directives/index.ts +3 -6
  243. package/src/directives/v-tooltip.ts +19 -10
  244. package/src/index.ts +3 -1
  245. package/src/props/index.ts +108 -31
  246. package/src/resolvers/unplugin.ts +24 -14
  247. package/src/stories/Accordion/Accordion.test.ts +1 -1
  248. package/src/stories/AccordionGroup/AccordionGroup.settings.ts +2 -2
  249. package/src/stories/AccordionGroup/AccordionGroup.test.ts +17 -11
  250. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.ts +1 -1
  251. package/src/stories/Alert/Alert.test.ts +1 -1
  252. package/src/stories/AlertGroup/AlertGroup.test.ts +1 -1
  253. package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +2 -2
  254. package/src/stories/Avatar/Avatar.test.ts +1 -1
  255. package/src/stories/AvatarGroup/AvatarGroup.test.ts +1 -1
  256. package/src/stories/Badge/Badge.test.ts +1 -1
  257. package/src/stories/Blurhash/BlurhashComposable.stories.ts +195 -0
  258. package/src/stories/Button/Button.settings.ts +1 -4
  259. package/src/stories/Button/Button.test.ts +1 -1
  260. package/src/stories/ButtonGroup/ButtonGroup.test.ts +1 -1
  261. package/src/stories/Card/Card.test.ts +1 -1
  262. package/src/stories/Checkbox/Checkbox.test.ts +1 -1
  263. package/src/stories/CheckboxGroup/CheckboxGroup.test.ts +1 -1
  264. package/src/stories/Combobox/Combobox.settings.ts +8 -0
  265. package/src/stories/Combobox/Combobox.test.ts +1 -1
  266. package/src/stories/Dialog/Dialog.test.ts +2 -2
  267. package/src/stories/Dropdown/Dropdown.test.ts +1 -1
  268. package/src/stories/Icon/Icon.settings.ts +3 -3
  269. package/src/stories/InputFile/InputFile.settings.ts +36 -0
  270. package/src/stories/InputFile/InputFile.stories.ts +89 -0
  271. package/src/stories/InputFile/InputFileDropArea.stories.ts +56 -0
  272. package/src/stories/InputFile/InputFileIconPosition.stories.ts +43 -0
  273. package/src/stories/InputFile/InputFileSlots.stories.ts +33 -0
  274. package/src/stories/InputText/InputText.test.ts +1 -1
  275. package/src/stories/Nav/Nav.test.ts +1 -1
  276. package/src/stories/Progress/Progress.test.ts +1 -1
  277. package/src/stories/Radio/Radio.test.ts +1 -1
  278. package/src/stories/RadioGroup/RadioGroup.test.ts +1 -1
  279. package/src/stories/Select/Select.test.ts +1 -1
  280. package/src/stories/Tab/Tab.settings.ts +2 -2
  281. package/src/stories/Tab/Tab.test.ts +1 -1
  282. package/src/stories/Textarea/Textarea.test.ts +1 -1
  283. package/src/stories/Tooltip/Tooltip.test.ts +1 -1
  284. package/src/stories/argTypes.ts +1 -1
  285. package/src/test/expect.ts +2 -4
  286. package/src/types/alert.ts +11 -7
  287. package/src/types/blurhash.ts +21 -0
  288. package/src/types/generic.ts +3 -3
  289. package/src/types/group.ts +22 -14
  290. package/src/types/index.ts +7 -0
  291. package/src/types/input-file.ts +18 -0
  292. package/src/types/nav.ts +2 -3
  293. package/src/utils/ObjectUtilities.ts +0 -11
  294. package/src/workers/blurhash.ts +9 -0
@@ -1,5 +1,10 @@
1
- import { unref, inject, computed, toRef, toRefs, isRef, defineComponent, h, useSlots, ref, watchEffect, watch, onMounted, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode, vModelCheckbox, renderSlot, createTextVNode, toDisplayString, createVNode, createSlots, withCtx, normalizeProps, guardReactiveProps } from "vue";
2
- import { nanoid } from "nanoid";
1
+ import { inject, computed, toRef, toRefs, isRef, defineComponent, h, unref, useSlots, ref, watchEffect, watch, onMounted, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode, vModelCheckbox, renderSlot, createTextVNode, toDisplayString, createVNode, createSlots, withCtx, normalizeProps, guardReactiveProps } from "vue";
2
+ import { uid } from "uid";
3
+ var StorageType = /* @__PURE__ */ ((StorageType2) => {
4
+ StorageType2["local"] = "local";
5
+ StorageType2["session"] = "session";
6
+ return StorageType2;
7
+ })(StorageType || {});
3
8
  var Strategy = /* @__PURE__ */ ((Strategy2) => {
4
9
  Strategy2["absolute"] = "absolute";
5
10
  Strategy2["fixed"] = "fixed";
@@ -34,15 +39,17 @@ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
34
39
  ButtonType2["reset"] = "reset";
35
40
  return ButtonType2;
36
41
  })(ButtonType || {});
37
- var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
38
- AnchorTarget2["_blank"] = "_blank";
39
- AnchorTarget2["_self"] = "_self";
40
- AnchorTarget2["_parent"] = "_parent";
41
- AnchorTarget2["_top"] = "_top";
42
- return AnchorTarget2;
43
- })(AnchorTarget || {});
42
+ var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
43
+ ActionTag2["nuxtLink"] = "nuxt-link";
44
+ ActionTag2["routerLink"] = "router-link";
45
+ ActionTag2["a"] = "a";
46
+ ActionTag2["button"] = "button";
47
+ return ActionTag2;
48
+ })(ActionTag || {});
44
49
  const INJECTION_KEY_VOLVER = Symbol.for("volver");
45
- const INJECTION_KEY_CHECK_GROUP = Symbol.for("checkGroup");
50
+ const INJECTION_KEY_CHECK_GROUP = Symbol.for(
51
+ "checkGroup"
52
+ );
46
53
  const LinkProps = {
47
54
  /**
48
55
  * The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
@@ -58,10 +65,7 @@ const LinkProps = {
58
65
  /**
59
66
  * Anchor target
60
67
  */
61
- target: {
62
- type: String,
63
- validator: (value) => Object.values(AnchorTarget).includes(value)
64
- },
68
+ target: String,
65
69
  /**
66
70
  * Anchor rel
67
71
  */
@@ -74,27 +78,33 @@ const ValidProps = {
74
78
  /**
75
79
  * Valid status
76
80
  */
77
- valid: Boolean,
81
+ valid: { type: Boolean, default: false },
78
82
  /**
79
83
  * Valid label
80
84
  */
81
- validLabel: [String, Array]
85
+ validLabel: { type: [String, Array], default: void 0 }
82
86
  };
83
87
  const InvalidProps = {
84
88
  /**
85
89
  * Invalid status
86
90
  */
87
- invalid: Boolean,
91
+ invalid: {
92
+ type: Boolean,
93
+ default: false
94
+ },
88
95
  /**
89
96
  * Invalid label
90
97
  */
91
- invalidLabel: [String, Array]
98
+ invalidLabel: { type: [String, Array], default: void 0 }
92
99
  };
93
100
  const LoadingProps = {
94
101
  /**
95
102
  * Loading status
96
103
  */
97
- loading: Boolean,
104
+ loading: {
105
+ type: Boolean,
106
+ default: false
107
+ },
98
108
  /**
99
109
  * Loading label
100
110
  */
@@ -107,43 +117,64 @@ const DisabledProps = {
107
117
  /**
108
118
  * Whether the form control is disabled
109
119
  */
110
- disabled: Boolean
120
+ disabled: {
121
+ type: Boolean,
122
+ default: false
123
+ }
111
124
  };
112
125
  const ActiveProps = {
113
126
  /**
114
127
  * Whether the item is active
115
128
  */
116
- active: Boolean
129
+ active: {
130
+ type: Boolean,
131
+ default: false
132
+ }
117
133
  };
118
134
  const CurrentProps = {
119
135
  /**
120
136
  * Whether the item is current
121
137
  */
122
- current: Boolean
138
+ current: {
139
+ type: Boolean,
140
+ default: false
141
+ }
123
142
  };
124
143
  const PressedProps = {
125
144
  /**
126
145
  * Whether the item is pressed
127
146
  */
128
- pressed: Boolean
147
+ pressed: {
148
+ type: Boolean,
149
+ default: false
150
+ }
129
151
  };
130
152
  const LabelProps = {
131
153
  /**
132
154
  * The item label
133
155
  */
134
- label: [String, Number]
156
+ label: {
157
+ type: [String, Number],
158
+ default: void 0
159
+ }
135
160
  };
136
161
  const ReadonlyProps = {
137
162
  /**
138
163
  * The value is not editable
139
164
  */
140
- readonly: Boolean
165
+ readonly: {
166
+ type: Boolean,
167
+ default: false
168
+ }
141
169
  };
142
170
  const ModifiersProps = {
143
171
  /**
144
172
  * Component BEM modifiers
145
173
  */
146
- modifiers: [String, Array]
174
+ modifiers: {
175
+ type: [String, Array],
176
+ default: void 0
177
+ }
147
178
  };
148
179
  const HintProps = {
149
180
  hintLabel: { type: String, default: "" }
@@ -153,7 +184,10 @@ const HintProps = {
153
184
  * VvIcon name or props
154
185
  * @see VVIcon
155
186
  */
156
- icon: { type: [String, Object] },
187
+ icon: {
188
+ type: [String, Object],
189
+ default: void 0
190
+ },
157
191
  /**
158
192
  * VvIcon position
159
193
  */
@@ -198,7 +232,8 @@ const IdProps = {
198
232
  * Dropdown show / hide transition name
199
233
  */
200
234
  transitionName: {
201
- type: String
235
+ type: String,
236
+ default: void 0
202
237
  },
203
238
  /**
204
239
  * Offset of the dropdown from the trigger
@@ -266,7 +301,8 @@ const IdProps = {
266
301
  * Set dropdown width to the same as the trigger
267
302
  */
268
303
  triggerWidth: {
269
- type: Boolean
304
+ type: Boolean,
305
+ default: false
270
306
  }
271
307
  });
272
308
  const IdNameProps = {
@@ -293,11 +329,17 @@ const CheckboxRadioProps = {
293
329
  * Input value
294
330
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value
295
331
  */
296
- value: [String, Number, Boolean],
332
+ value: {
333
+ type: [String, Number, Boolean],
334
+ default: void 0
335
+ },
297
336
  /**
298
337
  * Input value
299
338
  */
300
- modelValue: [Object, Number, Boolean, String]
339
+ modelValue: {
340
+ type: [Object, Number, Boolean, String],
341
+ default: void 0
342
+ }
301
343
  };
302
344
  ({
303
345
  ...DisabledProps,
@@ -320,8 +362,100 @@ const CheckboxRadioProps = {
320
362
  ariaLabel: {
321
363
  type: String,
322
364
  default: void 0
365
+ },
366
+ /**
367
+ * Default tag for the action
368
+ */
369
+ defaultTag: {
370
+ type: String,
371
+ default: ActionTag.button
323
372
  }
324
373
  });
374
+ ({
375
+ storageType: {
376
+ type: String,
377
+ default: StorageType.local,
378
+ validator: (value) => Object.values(StorageType).includes(value)
379
+ },
380
+ storageKey: String
381
+ });
382
+ function useInjectedGroupState(groupKey) {
383
+ const group = inject(groupKey, void 0);
384
+ const isInGroup = computed(() => group !== void 0);
385
+ function getGroupOrLocalRef(propName, props, emit) {
386
+ const groupPropValue = group == null ? void 0 : group[propName];
387
+ if (groupPropValue) {
388
+ return computed({
389
+ get() {
390
+ return groupPropValue.value;
391
+ },
392
+ set(value) {
393
+ groupPropValue.value = value;
394
+ }
395
+ });
396
+ }
397
+ const propRef = toRef(props, propName);
398
+ return computed({
399
+ get() {
400
+ return propRef.value;
401
+ },
402
+ set(value) {
403
+ if (emit) {
404
+ emit(`update:${propName}`, value);
405
+ }
406
+ }
407
+ });
408
+ }
409
+ return {
410
+ group,
411
+ isInGroup,
412
+ getGroupOrLocalRef
413
+ };
414
+ }
415
+ const VvCheckboxProps = {
416
+ ...CheckboxRadioProps,
417
+ ...ModifiersProps,
418
+ /**
419
+ * If true, the input will be indeterminated
420
+ */
421
+ indeterminate: Boolean,
422
+ /**
423
+ * Value associated with the unchecked state
424
+ */
425
+ uncheckedValue: [String, Number, Boolean],
426
+ /**
427
+ * If true, the input will be displayed as a switch
428
+ */
429
+ switch: Boolean
430
+ };
431
+ const VvCheckboxEvents = ["click", "update:modelValue", "change", "blur"];
432
+ function useGroupProps(props, emit) {
433
+ const { group, isInGroup, getGroupOrLocalRef } = useInjectedGroupState(INJECTION_KEY_CHECK_GROUP);
434
+ const { id, switch: propsSwitch, indeterminate } = toRefs(props);
435
+ const modelValue = getGroupOrLocalRef("modelValue", props, emit);
436
+ const valid = getGroupOrLocalRef("valid", props);
437
+ const invalid = getGroupOrLocalRef("invalid", props);
438
+ const readonly = computed(
439
+ () => Boolean(props.readonly || (group == null ? void 0 : group.readonly.value))
440
+ );
441
+ const disabled = computed(
442
+ () => Boolean(props.disabled || (group == null ? void 0 : group.disabled.value))
443
+ );
444
+ return {
445
+ // local props
446
+ id,
447
+ propsSwitch,
448
+ indeterminate,
449
+ // global props
450
+ group,
451
+ isInGroup,
452
+ modelValue,
453
+ valid,
454
+ invalid,
455
+ readonly,
456
+ disabled
457
+ };
458
+ }
325
459
  function equals(obj1, obj2, field) {
326
460
  if (field) {
327
461
  return resolveFieldData(obj1, field) === resolveFieldData(obj2, field);
@@ -401,94 +535,9 @@ function contains(value, list) {
401
535
  }
402
536
  return false;
403
537
  }
404
- function isEmpty(value) {
405
- return ((value2) => value2 === null || value2 === void 0 || value2 === "" || Array.isArray(value2) && value2.length === 0 || !(value2 instanceof Date) && typeof value2 === "object" && Object.keys(value2).length === 0)(unref(value));
406
- }
407
538
  function isString(value) {
408
539
  return typeof value === "string" || value instanceof String;
409
540
  }
410
- function useInjectedGroupState(groupKey) {
411
- const group = inject(groupKey, void 0);
412
- const isInGroup = computed(() => !isEmpty(group));
413
- function getGroupOrLocalRef(propName, props, emit) {
414
- if (group == null ? void 0 : group.value) {
415
- const groupPropValue = unref(group.value)[propName];
416
- return computed({
417
- get() {
418
- return groupPropValue == null ? void 0 : groupPropValue.value;
419
- },
420
- set(value) {
421
- groupPropValue.value = value;
422
- }
423
- });
424
- }
425
- const propRef = toRef(props, propName);
426
- return computed({
427
- get() {
428
- return propRef.value;
429
- },
430
- set(value) {
431
- if (emit)
432
- emit(`update:${propName}`, value);
433
- }
434
- });
435
- }
436
- return {
437
- group,
438
- isInGroup,
439
- getGroupOrLocalRef
440
- };
441
- }
442
- const VvCheckboxProps = {
443
- ...CheckboxRadioProps,
444
- ...ModifiersProps,
445
- /**
446
- * If true, the input will be indeterminated
447
- */
448
- indeterminate: Boolean,
449
- /**
450
- * Value associated with the unchecked state
451
- */
452
- uncheckedValue: [String, Number, Boolean],
453
- /**
454
- * If true, the input will be displayed as a switch
455
- */
456
- switch: Boolean
457
- };
458
- const VvCheckboxEvents = ["click", "update:modelValue", "change", "blur"];
459
- function useGroupProps(props, emit) {
460
- const { group, isInGroup, getGroupOrLocalRef } = useInjectedGroupState(INJECTION_KEY_CHECK_GROUP);
461
- const { id, switch: propsSwitch, indeterminate } = toRefs(props);
462
- const modelValue = getGroupOrLocalRef("modelValue", props, emit);
463
- const valid = getGroupOrLocalRef("valid", props);
464
- const invalid = getGroupOrLocalRef("invalid", props);
465
- const readonly = computed(
466
- () => {
467
- var _a;
468
- return Boolean(props.readonly || ((_a = group == null ? void 0 : group.value) == null ? void 0 : _a.readonly.value));
469
- }
470
- );
471
- const disabled = computed(
472
- () => {
473
- var _a;
474
- return Boolean(props.disabled || ((_a = group == null ? void 0 : group.value) == null ? void 0 : _a.disabled.value));
475
- }
476
- );
477
- return {
478
- // local props
479
- id,
480
- propsSwitch,
481
- indeterminate,
482
- // global props
483
- group,
484
- isInGroup,
485
- modelValue,
486
- valid,
487
- invalid,
488
- readonly,
489
- disabled
490
- };
491
- }
492
541
  function joinLines(items) {
493
542
  if (Array.isArray(items)) {
494
543
  return items.filter((item) => isString(item)).join(" ");
@@ -663,7 +712,7 @@ function useDefaults(componentName, propsDefinition, props) {
663
712
  }, {});
664
713
  });
665
714
  }
666
- const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || nanoid()));
715
+ const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || uid()));
667
716
  function useModifiers(prefix, modifiers, others) {
668
717
  return computed(() => {
669
718
  const toReturn = {
@@ -696,8 +745,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
696
745
  ...__default__,
697
746
  props: VvCheckboxProps,
698
747
  emits: VvCheckboxEvents,
699
- setup(__props, { emit }) {
748
+ setup(__props, { emit: __emit }) {
700
749
  const props = __props;
750
+ const emit = __emit;
701
751
  const slots = useSlots();
702
752
  const propsDefaults = useDefaults(
703
753
  "VvCheckbox",
@@ -840,12 +890,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
840
890
  [vModelCheckbox, unref(localModelValue)]
841
891
  ]),
842
892
  renderSlot(_ctx.$slots, "default", { value: unref(modelValue) }, () => [
843
- createTextVNode(toDisplayString(_ctx.label), 1)
893
+ createTextVNode(
894
+ toDisplayString(_ctx.label),
895
+ 1
896
+ /* TEXT */
897
+ )
844
898
  ]),
845
899
  createVNode(unref(HintSlot), {
846
900
  id: unref(hasHintId),
847
901
  class: "vv-checkbox__hint"
848
- }, createSlots({ _: 2 }, [
902
+ }, createSlots({
903
+ _: 2
904
+ /* DYNAMIC */
905
+ }, [
849
906
  _ctx.$slots.hint ? {
850
907
  name: "hint",
851
908
  fn: withCtx(() => [
@@ -1 +1 @@
1
- !function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("nanoid")):"function"==typeof define&&define.amd?define(["vue","nanoid"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckbox=l(e.vue,e.nanoid)}(this,(function(e,l){"use strict";var a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),t=(e=>(e.before="before",e.after="after",e))(t||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{});const o=Symbol.for("volver"),i=Symbol.for("checkGroup"),r={valid:Boolean,validLabel:[String,Array]},u={invalid:Boolean,invalidLabel:[String,Array]},d={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},s={disabled:Boolean},v=(Boolean,Boolean,Boolean,{label:[String,Number]}),c={readonly:Boolean},f={modifiers:[String,Array]},p={hintLabel:{type:String,default:""}};t.before;const b={tabindex:{type:[String,Number],default:0}},h={id:[String,Number]};a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const m={...{...h,name:{type:String,required:!0}},...b,...r,...u,...p,...s,...c,...f,...v,...d,value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String]};function g(e,l,a){return a?S(e,a)===S(l,a):y(e,l)}function y(e,l){if(e===l)return!0;if(e&&l&&"object"==typeof e&&"object"==typeof l){const a=Array.isArray(e),t=Array.isArray(l);let n,o,i;if(a&&t){if(o=e.length,o!=l.length)return!1;for(n=o;0!=n--;)if(!y(e[n],l[n]))return!1;return!0}if(a!=t)return!1;const r=e instanceof Date,u=l instanceof Date;if(r!=u)return!1;if(r&&u)return e.getTime()==l.getTime();const d=e instanceof RegExp,s=l instanceof RegExp;if(d!=s)return!1;if(d&&s)return e.toString()==l.toString();const v=Object.keys(e);if(o=v.length,o!==Object.keys(l).length)return!1;for(n=o;0!=n--;)if(!Object.prototype.hasOwnProperty.call(l,v[n]))return!1;for(n=o;0!=n--;)if(i=v[n],!y(e[i],l[i]))return!1;return!0}return e!=e&&l!=l}function S(e,l){if(e&&Object.keys(e).length&&l){if(-1===l.indexOf("."))return e[l];{const a=l.split(".");let t=e;for(let l=0,n=a.length;l<n;++l){if(null==e)return null;t=t[a[l]]}return t}}return null}function L(l){const a=e.inject(l,void 0),t=e.computed((()=>{return l=a,!(null==(t=e.unref(l))||""===t||Array.isArray(t)&&0===t.length||!(t instanceof Date)&&"object"==typeof t&&0===Object.keys(t).length);var l,t}));return{group:a,isInGroup:t,getGroupOrLocalRef:function(l,t,n){if(null==a?void 0:a.value){const t=e.unref(a.value)[l];return e.computed({get:()=>null==t?void 0:t.value,set(e){t.value=e}})}const o=e.toRef(t,l);return e.computed({get:()=>o.value,set(e){n&&n(`update:${l}`,e)}})}}}n.button;const B={...m,...f,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function O(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}function k(l,a,t){const n=e.inject(o),i=e.computed((()=>{var e;if(n&&(null==(e=n.defaults.value)?void 0:e[l]))return n.defaults.value[l]}));return e.computed((()=>{if(void 0===i.value)return t;const e=i.value,l=a,n=t;return Object.keys(l).reduce(((a,t)=>{const o=n[t];if(a[t]=o,t in e){if(Array.isArray(l[t])){const n=l[t];if(n.length){n[0]===o&&(a[t]=e[t])}}if("function"==typeof l[t]){(0,l[t])()===o&&(a[t]=e[t])}if("object"==typeof l[t]){let n=l[t].default;"function"==typeof n&&(n=n()),"object"==typeof n?JSON.stringify(n)===JSON.stringify(o)&&(a[t]=e[t]):n===o&&(a[t]=e[t])}}return a}),{})}))}const V=["for"],x=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"];return e.defineComponent({name:"VvCheckbox",props:B,emits:["click","update:modelValue","change","blur"],setup(a,{emit:t}){const n=a,o=e.useSlots(),r=k("VvCheckbox",B,n),{id:u,disabled:d,readonly:s,valid:v,invalid:c,propsSwitch:f,modelValue:p,indeterminate:b,isInGroup:h}=function(l,a){const{group:t,isInGroup:n,getGroupOrLocalRef:o}=L(i),{id:r,switch:u,indeterminate:d}=e.toRefs(l),s=o("modelValue",l,a),v=o("valid",l),c=o("invalid",l),f=e.computed((()=>{var e;return Boolean(l.readonly||(null==(e=null==t?void 0:t.value)?void 0:e.readonly.value))})),p=e.computed((()=>{var e;return Boolean(l.disabled||(null==(e=null==t?void 0:t.value)?void 0:e.disabled.value))}));return{id:r,propsSwitch:u,indeterminate:d,group:t,isInGroup:n,modelValue:s,valid:v,invalid:c,readonly:f,disabled:p}}(n,t),m=(a=>e.computed((()=>String((null==a?void 0:a.value)||l.nanoid()))))(u),y=e.computed((()=>`${m.value}-hint`)),S=e.computed((()=>j.value?-1:n.tabindex)),A=e.ref(),$=e.computed((()=>void 0!==n.uncheckedValue&&!h.value)),j=e.computed((()=>d.value||s.value)),w=e.computed((()=>!0===c.value||!0!==v.value&&void 0)),R=e.computed((()=>$.value?p.value===n.value:Array.isArray(p.value)?function(e,l){if(null!=e&&l&&l.length)for(const a of l)if(g(e,a))return!0;return!1}(n.value,p.value):g(n.value,p.value))),C=e.computed((()=>!!b.value||!(R.value||!$.value||n.uncheckedValue===p.value))),N=e.computed((()=>{if(!$.value)return!["string","number","boolean"].includes(typeof n.value)||n.value})),I=e.computed({get:()=>R.value,set(e){if($.value)p.value=e?n.value:n.uncheckedValue;else if(Array.isArray(p.value)||h.value){const l=new Set(Array.isArray(p.value)?p.value:void 0!==p.value?[p.value]:[]);e?l.add(n.value):l.delete(n.value),p.value=[...l]}else p.value=e?n.value:void 0;t("change",e)}}),{modifiers:P}=e.toRefs(n),E=function(l,a,t){return e.computed((()=>{const n={[l]:!0},o="string"==typeof(null==a?void 0:a.value)?a.value.split(" "):null==a?void 0:a.value;return o&&Array.isArray(o)&&o.forEach((e=>{e&&(n[`${l}--${e}`]=!0)})),t&&Object.keys(t.value).forEach((a=>{n[`${l}--${a}`]=e.unref(t.value[a])})),n}))}("vv-checkbox",P,e.computed((()=>({switch:f.value,valid:v.value,invalid:c.value,disabled:d.value,readonly:s.value,indeterminate:b.value}))));e.watchEffect((()=>{$.value&&Array.isArray(p.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")})),e.watch((()=>C.value),(e=>{A.value.indeterminate=!!e})),e.onMounted((()=>{C.value&&(A.value.indeterminate=!0)}));const{HintSlot:G,hasHintLabelOrSlot:H,hasInvalidLabelOrSlot:T,hintSlotScope:_}=function(l,a){const t=e.computed((()=>e.isRef(l)?l.value:l)),n=e.computed((()=>O(t.value.invalidLabel))),o=e.computed((()=>O(t.value.validLabel))),i=e.computed((()=>t.value.loadingLabel)),r=e.computed((()=>t.value.hintLabel)),u=e.computed((()=>Boolean(t.value.loading&&(a.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(t.value.invalid&&(a.invalid||n.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(t.value.valid&&(a.valid||o.value)))),v=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(a.hint||r.value))),c=e.computed((()=>d.value||s.value||u.value||v.value)),f=e.computed((()=>({modelValue:t.value.modelValue,valid:t.value.valid,invalid:t.value.invalid,loading:t.value.loading}))),p=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:c,invalidLabel:n,validLabel:o,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:v}),render(){var l,a,t,n,o,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==(a=(l=this.$slots).loading)?void 0:a.call(l))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(n=(t=this.$slots).invalid)?void 0:n.call(t))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(o=this.$slots).valid)?void 0:i.call(o))??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:f,HintSlot:p}}(r,o);return(l,a)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(E)),for:e.unref(m)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(m),ref_key:"input",ref:A,"onUpdate:modelValue":a[0]||(a[0]=l=>e.isRef(I)?I.value=l:null),type:"checkbox",class:"vv-checkbox__input",name:l.name,disabled:e.unref(j),value:e.unref(N),tabindex:e.unref(S),"aria-invalid":e.unref(w),"aria-describedby":e.unref(H)?e.unref(y):void 0,"aria-errormessage":e.unref(T)?e.unref(y):void 0},null,8,x),[[e.vModelCheckbox,e.unref(I)]]),e.renderSlot(l.$slots,"default",{value:e.unref(p)},(()=>[e.createTextVNode(e.toDisplayString(l.label),1)])),e.createVNode(e.unref(G),{id:e.unref(y),class:"vv-checkbox__hint"},e.createSlots({_:2},[l.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"0"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"1"}:void 0,l.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"2"}:void 0,l.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"3"}:void 0]),1032,["id"])],10,V))}})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("uid")):"function"==typeof define&&define.amd?define(["vue","uid"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckbox=t(e.vue,e.uid)}(this,(function(e,t){"use strict";var l=(e=>(e.local="local",e.session="session",e))(l||{}),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||{}),o=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(o||{}),i=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(i||{});const r=Symbol.for("volver"),u=Symbol.for("checkGroup"),d={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},s={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},v={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},c={disabled:{type:Boolean,default:!1}},f=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),p={readonly:{type:Boolean,default:!1}},b={modifiers:{type:[String,Array],default:void 0}},h={hintLabel:{type:String,default:""}};n.before;const m={tabindex:{type:[String,Number],default:0}},y={id:[String,Number]};a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const g={...{...y,name:{type:String,required:!0}},...m,...d,...s,...h,...c,...p,...b,...f,...v,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}};o.button,i.button,l.local;const S={...g,...b,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function L(t,l){const{group:a,isInGroup:n,getGroupOrLocalRef:o}=function(t){const l=e.inject(t,void 0),a=e.computed((()=>void 0!==l));return{group:l,isInGroup:a,getGroupOrLocalRef:function(t,a,n){const o=null==l?void 0:l[t];if(o)return e.computed({get:()=>o.value,set(e){o.value=e}});const i=e.toRef(a,t);return e.computed({get:()=>i.value,set(e){n&&n(`update:${t}`,e)}})}}}(u),{id:i,switch:r,indeterminate:d}=e.toRefs(t),s=o("modelValue",t,l),v=o("valid",t),c=o("invalid",t),f=e.computed((()=>Boolean(t.readonly||(null==a?void 0:a.readonly.value)))),p=e.computed((()=>Boolean(t.disabled||(null==a?void 0:a.disabled.value))));return{id:i,propsSwitch:r,indeterminate:d,group:a,isInGroup:n,modelValue:s,valid:v,invalid:c,readonly:f,disabled:p}}function k(e,t,l){return l?O(e,l)===O(t,l):B(e,t)}function B(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const l=Array.isArray(e),a=Array.isArray(t);let n,o,i;if(l&&a){if(o=e.length,o!=t.length)return!1;for(n=o;0!=n--;)if(!B(e[n],t[n]))return!1;return!0}if(l!=a)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 v=Object.keys(e);if(o=v.length,o!==Object.keys(t).length)return!1;for(n=o;0!=n--;)if(!Object.prototype.hasOwnProperty.call(t,v[n]))return!1;for(n=o;0!=n--;)if(i=v[n],!B(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function O(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const l=t.split(".");let a=e;for(let t=0,n=l.length;t<n;++t){if(null==e)return null;a=a[l[t]]}return a}}return null}function x(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}function V(t,l,a){const n=e.inject(r),o=e.computed((()=>{var e;if(n&&(null==(e=n.defaults.value)?void 0:e[t]))return n.defaults.value[t]}));return e.computed((()=>{if(void 0===o.value)return a;const e=o.value,t=l,n=a;return Object.keys(t).reduce(((l,a)=>{const o=n[a];if(l[a]=o,a in e){if(Array.isArray(t[a])){const n=t[a];if(n.length){n[0]===o&&(l[a]=e[a])}}if("function"==typeof t[a]){(0,t[a])()===o&&(l[a]=e[a])}if("object"==typeof t[a]){let n=t[a].default;"function"==typeof n&&(n=n()),"object"==typeof n?JSON.stringify(n)===JSON.stringify(o)&&(l[a]=e[a]):n===o&&(l[a]=e[a])}}return l}),{})}))}const A=["for"],$=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"];return e.defineComponent({name:"VvCheckbox",props:S,emits:["click","update:modelValue","change","blur"],setup(l,{emit:a}){const n=l,o=a,i=e.useSlots(),r=V("VvCheckbox",S,n),{id:u,disabled:d,readonly:s,valid:v,invalid:c,propsSwitch:f,modelValue:p,indeterminate:b,isInGroup:h}=L(n,o),m=(l=>e.computed((()=>String((null==l?void 0:l.value)||t.uid()))))(u),y=e.computed((()=>`${m.value}-hint`)),g=e.computed((()=>j.value?-1:n.tabindex)),B=e.ref(),O=e.computed((()=>void 0!==n.uncheckedValue&&!h.value)),j=e.computed((()=>d.value||s.value)),w=e.computed((()=>!0===c.value||!0!==v.value&&void 0)),R=e.computed((()=>O.value?p.value===n.value:Array.isArray(p.value)?function(e,t){if(null!=e&&t&&t.length)for(const l of t)if(k(e,l))return!0;return!1}(n.value,p.value):k(n.value,p.value))),C=e.computed((()=>!!b.value||!(R.value||!O.value||n.uncheckedValue===p.value))),N=e.computed((()=>{if(!O.value)return!["string","number","boolean"].includes(typeof n.value)||n.value})),I=e.computed({get:()=>R.value,set(e){if(O.value)p.value=e?n.value:n.uncheckedValue;else if(Array.isArray(p.value)||h.value){const t=new Set(Array.isArray(p.value)?p.value:void 0!==p.value?[p.value]:[]);e?t.add(n.value):t.delete(n.value),p.value=[...t]}else p.value=e?n.value:void 0;o("change",e)}}),{modifiers:P}=e.toRefs(n),E=function(t,l,a){return e.computed((()=>{const n={[t]:!0},o="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return o&&Array.isArray(o)&&o.forEach((e=>{e&&(n[`${t}--${e}`]=!0)})),a&&Object.keys(a.value).forEach((l=>{n[`${t}--${l}`]=e.unref(a.value[l])})),n}))}("vv-checkbox",P,e.computed((()=>({switch:f.value,valid:v.value,invalid:c.value,disabled:d.value,readonly:s.value,indeterminate:b.value}))));e.watchEffect((()=>{O.value&&Array.isArray(p.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")})),e.watch((()=>C.value),(e=>{B.value.indeterminate=!!e})),e.onMounted((()=>{C.value&&(B.value.indeterminate=!0)}));const{HintSlot:G,hasHintLabelOrSlot:H,hasInvalidLabelOrSlot:T,hintSlotScope:_}=function(t,l){const a=e.computed((()=>e.isRef(t)?t.value:t)),n=e.computed((()=>x(a.value.invalidLabel))),o=e.computed((()=>x(a.value.validLabel))),i=e.computed((()=>a.value.loadingLabel)),r=e.computed((()=>a.value.hintLabel)),u=e.computed((()=>Boolean(a.value.loading&&(l.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(a.value.invalid&&(l.invalid||n.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(a.value.valid&&(l.valid||o.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)),f=e.computed((()=>({modelValue:a.value.modelValue,valid:a.value.valid,invalid:a.value.invalid,loading:a.value.loading}))),p=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:c,invalidLabel:n,validLabel:o,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:v}),render(){var t,l,a,n,o,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==(n=(a=this.$slots).invalid)?void 0:n.call(a))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(o=this.$slots).valid)?void 0:i.call(o))??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:f,HintSlot:p}}(r,i);return(t,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(E)),for:e.unref(m)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(m),ref_key:"input",ref:B,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(I)?I.value=t:null),type:"checkbox",class:"vv-checkbox__input",name:t.name,disabled:e.unref(j),value:e.unref(N),tabindex:e.unref(g),"aria-invalid":e.unref(w),"aria-describedby":e.unref(H)?e.unref(y):void 0,"aria-errormessage":e.unref(T)?e.unref(y):void 0},null,8,$),[[e.vModelCheckbox,e.unref(I)]]),e.renderSlot(t.$slots,"default",{value:e.unref(p)},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)])),e.createVNode(e.unref(G),{id:e.unref(y),class:"vv-checkbox__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"3"}:void 0]),1032,["id"])],10,A))}})}));
@@ -1,26 +1,59 @@
1
1
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
2
2
  indeterminate: BooleanConstructor;
3
- uncheckedValue: (StringConstructor | BooleanConstructor | NumberConstructor)[];
3
+ uncheckedValue: (BooleanConstructor | StringConstructor | NumberConstructor)[];
4
4
  switch: BooleanConstructor;
5
- modifiers: globalThis.PropType<string | string[]>;
6
- value: (StringConstructor | BooleanConstructor | NumberConstructor)[];
7
- modelValue: (ObjectConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
8
- loading: BooleanConstructor;
5
+ modifiers: {
6
+ type: globalThis.PropType<string | string[]>;
7
+ default: undefined;
8
+ };
9
+ value: {
10
+ type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
11
+ default: undefined;
12
+ };
13
+ modelValue: {
14
+ type: (ObjectConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
15
+ default: undefined;
16
+ };
17
+ loading: {
18
+ type: BooleanConstructor;
19
+ default: boolean;
20
+ };
9
21
  loadingLabel: {
10
22
  type: StringConstructor;
11
23
  default: string;
12
24
  };
13
- label: (StringConstructor | NumberConstructor)[];
14
- readonly: BooleanConstructor;
15
- disabled: BooleanConstructor;
25
+ label: {
26
+ type: (StringConstructor | NumberConstructor)[];
27
+ default: undefined;
28
+ };
29
+ readonly: {
30
+ type: BooleanConstructor;
31
+ default: boolean;
32
+ };
33
+ disabled: {
34
+ type: BooleanConstructor;
35
+ default: boolean;
36
+ };
16
37
  hintLabel: {
17
38
  type: StringConstructor;
18
39
  default: string;
19
40
  };
20
- invalid: BooleanConstructor;
21
- invalidLabel: (ArrayConstructor | StringConstructor)[];
22
- valid: BooleanConstructor;
23
- validLabel: (ArrayConstructor | StringConstructor)[];
41
+ invalid: {
42
+ type: BooleanConstructor;
43
+ default: boolean;
44
+ };
45
+ invalidLabel: {
46
+ type: (ArrayConstructor | StringConstructor)[];
47
+ default: undefined;
48
+ };
49
+ valid: {
50
+ type: BooleanConstructor;
51
+ default: boolean;
52
+ };
53
+ validLabel: {
54
+ type: (ArrayConstructor | StringConstructor)[];
55
+ default: undefined;
56
+ };
24
57
  tabindex: {
25
58
  type: (StringConstructor | NumberConstructor)[];
26
59
  default: number;
@@ -30,29 +63,64 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
30
63
  required: boolean;
31
64
  };
32
65
  id: (StringConstructor | NumberConstructor)[];
33
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
66
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
67
+ [x: string]: (...args: any[]) => void;
68
+ }, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{
34
69
  indeterminate: BooleanConstructor;
35
- uncheckedValue: (StringConstructor | BooleanConstructor | NumberConstructor)[];
70
+ uncheckedValue: (BooleanConstructor | StringConstructor | NumberConstructor)[];
36
71
  switch: BooleanConstructor;
37
- modifiers: globalThis.PropType<string | string[]>;
38
- value: (StringConstructor | BooleanConstructor | NumberConstructor)[];
39
- modelValue: (ObjectConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
40
- loading: BooleanConstructor;
72
+ modifiers: {
73
+ type: globalThis.PropType<string | string[]>;
74
+ default: undefined;
75
+ };
76
+ value: {
77
+ type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
78
+ default: undefined;
79
+ };
80
+ modelValue: {
81
+ type: (ObjectConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
82
+ default: undefined;
83
+ };
84
+ loading: {
85
+ type: BooleanConstructor;
86
+ default: boolean;
87
+ };
41
88
  loadingLabel: {
42
89
  type: StringConstructor;
43
90
  default: string;
44
91
  };
45
- label: (StringConstructor | NumberConstructor)[];
46
- readonly: BooleanConstructor;
47
- disabled: BooleanConstructor;
92
+ label: {
93
+ type: (StringConstructor | NumberConstructor)[];
94
+ default: undefined;
95
+ };
96
+ readonly: {
97
+ type: BooleanConstructor;
98
+ default: boolean;
99
+ };
100
+ disabled: {
101
+ type: BooleanConstructor;
102
+ default: boolean;
103
+ };
48
104
  hintLabel: {
49
105
  type: StringConstructor;
50
106
  default: string;
51
107
  };
52
- invalid: BooleanConstructor;
53
- invalidLabel: (ArrayConstructor | StringConstructor)[];
54
- valid: BooleanConstructor;
55
- validLabel: (ArrayConstructor | StringConstructor)[];
108
+ invalid: {
109
+ type: BooleanConstructor;
110
+ default: boolean;
111
+ };
112
+ invalidLabel: {
113
+ type: (ArrayConstructor | StringConstructor)[];
114
+ default: undefined;
115
+ };
116
+ valid: {
117
+ type: BooleanConstructor;
118
+ default: boolean;
119
+ };
120
+ validLabel: {
121
+ type: (ArrayConstructor | StringConstructor)[];
122
+ default: undefined;
123
+ };
56
124
  tabindex: {
57
125
  type: (StringConstructor | NumberConstructor)[];
58
126
  default: number;
@@ -62,22 +130,26 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
62
130
  required: boolean;
63
131
  };
64
132
  id: (StringConstructor | NumberConstructor)[];
65
- }>> & {
66
- [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
67
- }, {
68
- readonly: boolean;
133
+ }>>, {
134
+ label: string | number;
135
+ value: string | number | boolean;
69
136
  disabled: boolean;
70
- valid: boolean;
71
- invalid: boolean;
137
+ modelValue: string | number | boolean | Record<string, any>;
138
+ modifiers: string | string[];
72
139
  switch: boolean;
73
- tabindex: string | number;
140
+ readonly: boolean;
74
141
  loading: boolean;
75
142
  loadingLabel: string;
76
143
  indeterminate: boolean;
77
144
  hintLabel: string;
145
+ invalid: boolean;
146
+ invalidLabel: string | unknown[];
147
+ valid: boolean;
148
+ validLabel: string | unknown[];
149
+ tabindex: string | number;
78
150
  }, {}>, {
79
151
  default?(_: {
80
- value: any;
152
+ value: unknown;
81
153
  }): any;
82
154
  hint?(_: {
83
155
  modelValue: unknown;