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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +98 -3
  3. package/auto-imports.d.ts +6 -2
  4. package/bin/icons.cjs +1 -1
  5. package/bin/icons.js +23 -16
  6. package/dist/Volver.d.ts +1 -1
  7. package/dist/components/VvAccordion/VvAccordion.es.js +70 -14
  8. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  9. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +13 -6
  10. package/dist/components/VvAccordion/index.d.ts +4 -1
  11. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +117 -38
  12. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  13. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +15 -8
  14. package/dist/components/VvAccordionGroup/index.d.ts +4 -1
  15. package/dist/components/VvAction/VvAction.es.js +58 -13
  16. package/dist/components/VvAction/VvAction.umd.js +1 -1
  17. package/dist/components/VvAction/VvAction.vue.d.ts +59 -12
  18. package/dist/components/VvAction/index.d.ts +25 -4
  19. package/dist/components/VvAlert/VvAlert.es.js +195 -152
  20. package/dist/components/VvAlert/VvAlert.umd.js +1 -1
  21. package/dist/components/VvAlert/VvAlert.vue.d.ts +18 -8
  22. package/dist/components/VvAlert/index.d.ts +9 -5
  23. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +240 -174
  24. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
  25. package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +13 -6
  26. package/dist/components/VvAlertGroup/index.d.ts +6 -2
  27. package/dist/components/VvAvatar/VvAvatar.es.js +54 -9
  28. package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
  29. package/dist/components/VvAvatar/VvAvatar.vue.d.ts +12 -4
  30. package/dist/components/VvAvatar/index.d.ts +4 -1
  31. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +111 -36
  32. package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
  33. package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +10 -3
  34. package/dist/components/VvAvatarGroup/index.d.ts +4 -1
  35. package/dist/components/VvBadge/VvBadge.es.js +73 -17
  36. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  37. package/dist/components/VvBadge/VvBadge.vue.d.ts +12 -4
  38. package/dist/components/VvBadge/index.d.ts +4 -1
  39. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +259 -49
  40. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  41. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +27 -7
  42. package/dist/components/VvBreadcrumb/index.d.ts +6 -10
  43. package/dist/components/VvButton/VvButton.es.js +187 -141
  44. package/dist/components/VvButton/VvButton.umd.js +1 -1
  45. package/dist/components/VvButton/VvButton.vue.d.ts +101 -27
  46. package/dist/components/VvButton/index.d.ts +41 -14
  47. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +69 -16
  48. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  49. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +23 -10
  50. package/dist/components/VvButtonGroup/index.d.ts +8 -2
  51. package/dist/components/VvCard/VvCard.es.js +84 -25
  52. package/dist/components/VvCard/VvCard.umd.js +1 -1
  53. package/dist/components/VvCard/VvCard.vue.d.ts +12 -4
  54. package/dist/components/VvCard/index.d.ts +4 -1
  55. package/dist/components/VvCheckbox/VvCheckbox.es.js +91 -22
  56. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  57. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +104 -32
  58. package/dist/components/VvCheckbox/index.d.ts +45 -12
  59. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +180 -67
  60. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  61. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +100 -29
  62. package/dist/components/VvCheckboxGroup/index.d.ts +45 -12
  63. package/dist/components/VvCombobox/VvCombobox.es.js +758 -531
  64. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  65. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +181 -108
  66. package/dist/components/VvCombobox/index.d.ts +53 -22
  67. package/dist/components/VvDialog/VvDialog.es.js +136 -141
  68. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  69. package/dist/components/VvDialog/VvDialog.vue.d.ts +4 -4
  70. package/dist/components/VvDropdown/VvDropdown.es.js +121 -55
  71. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  72. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +101 -75
  73. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +72 -11
  74. package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +1 -1
  75. package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +12 -4
  76. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +26 -7
  77. package/dist/components/VvDropdown/index.d.ts +16 -11
  78. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +82 -22
  79. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  80. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +13 -7
  81. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +56 -8
  82. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
  83. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +76 -17
  84. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
  85. package/dist/components/VvIcon/VvIcon.es.js +23 -96
  86. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  87. package/dist/components/VvIcon/VvIcon.vue.d.ts +23 -66
  88. package/dist/components/VvIcon/index.d.ts +33 -48
  89. package/dist/components/VvInputFile/VvInputFile.es.js +1734 -0
  90. package/dist/components/VvInputFile/VvInputFile.umd.js +1 -0
  91. package/dist/components/VvInputFile/VvInputFile.vue.d.ts +313 -0
  92. package/dist/components/VvInputFile/index.d.ts +179 -0
  93. package/dist/components/VvInputText/VvInputClearAction.d.ts +7 -5
  94. package/dist/components/VvInputText/VvInputPasswordAction.d.ts +10 -8
  95. package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
  96. package/dist/components/VvInputText/VvInputText.es.js +331 -293
  97. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  98. package/dist/components/VvInputText/VvInputText.vue.d.ts +162 -55
  99. package/dist/components/VvInputText/index.d.ts +71 -29
  100. package/dist/components/VvNav/VvNav.es.js +151 -73
  101. package/dist/components/VvNav/VvNav.umd.js +1 -1
  102. package/dist/components/VvNav/VvNav.vue.d.ts +41 -14
  103. package/dist/components/VvNav/VvNavItem.vue.d.ts +9 -0
  104. package/dist/components/VvNav/VvNavSeparator.vue.d.ts +2 -0
  105. package/dist/components/VvNav/index.d.ts +5 -13
  106. package/dist/components/VvNavItem/VvNavItem.es.js +436 -0
  107. package/dist/components/VvNavItem/VvNavItem.umd.js +1 -0
  108. package/dist/components/VvNavSeparator/VvNavSeparator.es.js +24 -0
  109. package/dist/components/VvNavSeparator/VvNavSeparator.umd.js +1 -0
  110. package/dist/components/VvProgress/VvProgress.es.js +65 -14
  111. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  112. package/dist/components/VvProgress/VvProgress.vue.d.ts +10 -3
  113. package/dist/components/VvProgress/index.d.ts +4 -1
  114. package/dist/components/VvRadio/VvRadio.es.js +89 -21
  115. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  116. package/dist/components/VvRadio/VvRadio.vue.d.ts +102 -30
  117. package/dist/components/VvRadio/index.d.ts +44 -11
  118. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +180 -66
  119. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  120. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +100 -29
  121. package/dist/components/VvRadioGroup/index.d.ts +45 -12
  122. package/dist/components/VvSelect/VvSelect.es.js +248 -226
  123. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  124. package/dist/components/VvSelect/VvSelect.vue.d.ts +112 -39
  125. package/dist/components/VvSelect/index.d.ts +48 -14
  126. package/dist/components/VvTab/VvTab.es.js +256 -110
  127. package/dist/components/VvTab/VvTab.umd.js +1 -1
  128. package/dist/components/VvTab/VvTab.vue.d.ts +50 -13
  129. package/dist/components/VvTab/index.d.ts +13 -4
  130. package/dist/components/VvTextarea/VvTextarea.es.js +229 -212
  131. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  132. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +155 -48
  133. package/dist/components/VvTextarea/index.d.ts +68 -19
  134. package/dist/components/VvTooltip/VvTooltip.es.js +72 -17
  135. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  136. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +10 -3
  137. package/dist/components/VvTooltip/index.d.ts +4 -1
  138. package/dist/components/common/HintSlot.d.ts +1 -1
  139. package/dist/components/index.d.ts +10 -0
  140. package/dist/components/index.es.js +2902 -1329
  141. package/dist/components/index.umd.js +1 -1
  142. package/dist/composables/alert/useAlert.d.ts +37 -4
  143. package/dist/composables/dropdown/useProvideDropdown.d.ts +1 -1
  144. package/dist/composables/index.d.ts +1 -0
  145. package/dist/composables/index.es.js +88 -1
  146. package/dist/composables/index.umd.js +1 -1
  147. package/dist/composables/useBlurhash.d.ts +7 -0
  148. package/dist/composables/useComponentIcon.d.ts +9 -8
  149. package/dist/composables/useVolver.d.ts +1 -1
  150. package/dist/directives/index.d.ts +3 -5
  151. package/dist/directives/index.es.js +92 -31
  152. package/dist/directives/index.umd.js +1 -1
  153. package/dist/directives/v-tooltip.es.js +90 -26
  154. package/dist/directives/v-tooltip.umd.js +1 -1
  155. package/dist/icons.es.js +210 -210
  156. package/dist/icons.umd.js +1 -1
  157. package/dist/index.d.ts +3 -1
  158. package/dist/index.es.js +81 -16
  159. package/dist/index.umd.js +1 -1
  160. package/dist/props/index.d.ts +287 -73
  161. package/dist/resolvers/unplugin.d.ts +6 -1
  162. package/dist/resolvers/unplugin.es.js +78 -10
  163. package/dist/resolvers/unplugin.umd.js +1 -1
  164. package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +72 -84
  165. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +623 -461
  166. package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +1 -1
  167. package/dist/stories/Blurhash/BlurhashComposable.stories.d.ts +4 -0
  168. package/dist/stories/Combobox/Combobox.settings.d.ts +8 -0
  169. package/dist/stories/Icon/Icon.settings.d.ts +1 -0
  170. package/dist/stories/InputFile/InputFile.settings.d.ts +56 -0
  171. package/dist/stories/InputFile/InputFile.stories.d.ts +12 -0
  172. package/dist/stories/InputFile/InputFileDropArea.stories.d.ts +9 -0
  173. package/dist/stories/InputFile/InputFileIconPosition.stories.d.ts +8 -0
  174. package/dist/stories/InputFile/InputFileSlots.stories.d.ts +7 -0
  175. package/dist/stories/Tab/Tab.settings.d.ts +4 -37
  176. package/dist/types/alert.d.ts +13 -0
  177. package/dist/types/blurhash.d.ts +12 -0
  178. package/dist/types/floating-ui.d.ts +6 -0
  179. package/dist/types/generic.d.ts +4 -0
  180. package/dist/types/group.d.ts +37 -0
  181. package/dist/types/index.d.ts +7 -0
  182. package/dist/types/input-file.d.ts +16 -0
  183. package/dist/types/nav.d.ts +18 -0
  184. package/dist/utils/ObjectUtilities.d.ts +0 -1
  185. package/dist/workers/blurhash.d.ts +1 -0
  186. package/package.json +97 -80
  187. package/src/Volver.ts +31 -20
  188. package/src/assets/icons/detailed.json +1 -1
  189. package/src/assets/icons/normal.json +1 -1
  190. package/src/assets/icons/simple.json +1 -1
  191. package/src/components/VvAccordion/VvAccordion.vue +2 -2
  192. package/src/components/VvAction/VvAction.vue +5 -2
  193. package/src/components/VvAlert/index.ts +1 -3
  194. package/src/components/VvAlertGroup/index.ts +2 -1
  195. package/src/components/VvBreadcrumb/VvBreadcrumb.vue +20 -19
  196. package/src/components/VvBreadcrumb/index.ts +2 -8
  197. package/src/components/VvButton/VvButton.vue +6 -6
  198. package/src/components/VvButton/index.ts +2 -4
  199. package/src/components/VvCombobox/VvCombobox.vue +24 -16
  200. package/src/components/VvCombobox/index.ts +4 -0
  201. package/src/components/VvIcon/VvIcon.vue +2 -2
  202. package/src/components/VvIcon/index.ts +35 -48
  203. package/src/components/VvInputFile/VvInputFile.vue +365 -0
  204. package/src/components/VvInputFile/index.ts +116 -0
  205. package/src/components/VvInputText/VvInputClearAction.ts +10 -6
  206. package/src/components/VvInputText/VvInputPasswordAction.ts +13 -9
  207. package/src/components/VvInputText/VvInputText.vue +17 -18
  208. package/src/components/VvInputText/index.ts +7 -15
  209. package/src/components/VvNav/VvNav.vue +30 -50
  210. package/src/components/VvNav/VvNavItem.vue +18 -0
  211. package/src/components/VvNav/VvNavSeparator.vue +11 -0
  212. package/src/components/VvNav/index.ts +2 -15
  213. package/src/components/VvSelect/VvSelect.vue +5 -8
  214. package/src/components/VvTab/VvTab.vue +63 -35
  215. package/src/components/VvTab/index.ts +10 -4
  216. package/src/components/VvTextarea/VvTextarea.vue +6 -9
  217. package/src/components/index.ts +10 -0
  218. package/src/composables/index.ts +1 -0
  219. package/src/composables/useBlurhash.ts +76 -0
  220. package/src/composables/useComponentIcon.ts +15 -14
  221. package/src/composables/useUniqueId.ts +2 -2
  222. package/src/directives/index.ts +3 -6
  223. package/src/directives/v-tooltip.ts +19 -10
  224. package/src/index.ts +3 -1
  225. package/src/props/index.ts +115 -27
  226. package/src/resolvers/unplugin.ts +24 -14
  227. package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +2 -2
  228. package/src/stories/Blurhash/BlurhashComposable.stories.ts +195 -0
  229. package/src/stories/Combobox/Combobox.settings.ts +8 -0
  230. package/src/stories/Icon/Icon.settings.ts +3 -3
  231. package/src/stories/InputFile/InputFile.settings.ts +36 -0
  232. package/src/stories/InputFile/InputFile.stories.ts +89 -0
  233. package/src/stories/InputFile/InputFileDropArea.stories.ts +56 -0
  234. package/src/stories/InputFile/InputFileIconPosition.stories.ts +43 -0
  235. package/src/stories/InputFile/InputFileSlots.stories.ts +33 -0
  236. package/src/stories/Nav/Nav.settings.ts +3 -4
  237. package/src/stories/Nav/Nav.test.ts +4 -15
  238. package/src/stories/Tab/Tab.settings.ts +9 -9
  239. package/src/stories/Tab/Tab.stories.ts +2 -2
  240. package/src/stories/Tab/Tab.test.ts +6 -14
  241. package/src/stories/argTypes.ts +1 -1
  242. package/src/types/blurhash.ts +21 -0
  243. package/src/types/generic.ts +6 -0
  244. package/src/types/index.ts +7 -0
  245. package/src/types/input-file.ts +18 -0
  246. package/src/types/nav.ts +20 -0
  247. package/src/utils/ObjectUtilities.ts +0 -11
  248. package/src/workers/blurhash.ts +9 -0
  249. package/dist/components/VvNav/VvNavItemTitle.vue.d.ts +0 -6
  250. package/dist/components/VvNav/VvNavSeparator.d.ts +0 -2
  251. package/dist/components/VvNavItemTitle/VvNavItemTitle.es.js +0 -19
  252. package/dist/components/VvNavItemTitle/VvNavItemTitle.umd.js +0 -1
  253. package/src/components/VvNav/VvNavItemTitle.vue +0 -11
  254. package/src/components/VvNav/VvNavSeparator.ts +0 -8
  255. package/src/types/generic.d.ts +0 -6
  256. /package/src/types/{alert.d.ts → alert.ts} +0 -0
  257. /package/src/types/{floating-ui.d.ts → floating-ui.ts} +0 -0
  258. /package/src/types/{group.d.ts → group.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import { computed, unref, defineComponent, toRefs, openBlock, createElementBlock, normalizeClass, renderSlot, createTextVNode, toDisplayString, createCommentVNode } from "vue";
1
+ import { computed, unref, defineComponent, toRefs, openBlock, createElementBlock, normalizeClass, createCommentVNode, renderSlot, createTextVNode, toDisplayString } from "vue";
2
2
  var Strategy = /* @__PURE__ */ ((Strategy2) => {
3
3
  Strategy2["absolute"] = "absolute";
4
4
  Strategy2["fixed"] = "fixed";
@@ -33,6 +33,13 @@ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
33
33
  ButtonType2["reset"] = "reset";
34
34
  return ButtonType2;
35
35
  })(ButtonType || {});
36
+ var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
37
+ ActionTag2["nuxtLink"] = "nuxt-link";
38
+ ActionTag2["routerLink"] = "router-link";
39
+ ActionTag2["a"] = "a";
40
+ ActionTag2["button"] = "button";
41
+ return ActionTag2;
42
+ })(ActionTag || {});
36
43
  var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
37
44
  AnchorTarget2["_blank"] = "_blank";
38
45
  AnchorTarget2["_self"] = "_self";
@@ -57,6 +64,7 @@ const LinkProps = {
57
64
  */
58
65
  target: {
59
66
  type: String,
67
+ default: void 0,
60
68
  validator: (value) => Object.values(AnchorTarget).includes(value)
61
69
  },
62
70
  /**
@@ -71,38 +79,65 @@ const DisabledProps = {
71
79
  /**
72
80
  * Whether the form control is disabled
73
81
  */
74
- disabled: Boolean
82
+ disabled: {
83
+ type: Boolean,
84
+ default: false
85
+ }
75
86
  };
76
87
  const ActiveProps = {
77
88
  /**
78
89
  * Whether the item is active
79
90
  */
80
- active: Boolean
91
+ active: {
92
+ type: Boolean,
93
+ default: false
94
+ }
95
+ };
96
+ const CurrentProps = {
97
+ /**
98
+ * Whether the item is current
99
+ */
100
+ current: {
101
+ type: Boolean,
102
+ default: false
103
+ }
81
104
  };
82
105
  const PressedProps = {
83
106
  /**
84
107
  * Whether the item is pressed
85
108
  */
86
- pressed: Boolean
109
+ pressed: {
110
+ type: Boolean,
111
+ default: false
112
+ }
87
113
  };
88
114
  const LabelProps = {
89
115
  /**
90
116
  * The item label
91
117
  */
92
- label: [String, Number]
118
+ label: {
119
+ type: [String, Number],
120
+ default: void 0
121
+ }
93
122
  };
94
123
  const ModifiersProps = {
95
124
  /**
96
125
  * Component BEM modifiers
97
126
  */
98
- modifiers: [String, Array]
127
+ modifiers: {
128
+ type: [String, Array],
129
+ default: void 0
130
+ }
99
131
  };
100
132
  ({
101
133
  /**
102
134
  * VvIcon name or props
103
135
  * @see VVIcon
104
136
  */
105
- icon: { type: [String, Object] },
137
+ icon: {
138
+ type: [String, Object],
139
+ default: void 0
140
+ },
106
141
  /**
107
142
  * VvIcon position
108
143
  */
@@ -133,7 +168,8 @@ const ModifiersProps = {
133
168
  * Dropdown show / hide transition name
134
169
  */
135
170
  transitionName: {
136
- type: String
171
+ type: String,
172
+ default: void 0
137
173
  },
138
174
  /**
139
175
  * Offset of the dropdown from the trigger
@@ -201,7 +237,8 @@ const ModifiersProps = {
201
237
  * Set dropdown width to the same as the trigger
202
238
  */
203
239
  triggerWidth: {
204
- type: Boolean
240
+ type: Boolean,
241
+ default: false
205
242
  }
206
243
  });
207
244
  ({
@@ -209,6 +246,7 @@ const ModifiersProps = {
209
246
  ...LabelProps,
210
247
  ...PressedProps,
211
248
  ...ActiveProps,
249
+ ...CurrentProps,
212
250
  ...LinkProps,
213
251
  /**
214
252
  * Button type
@@ -224,6 +262,13 @@ const ModifiersProps = {
224
262
  ariaLabel: {
225
263
  type: String,
226
264
  default: void 0
265
+ },
266
+ /**
267
+ * Default tag for the action
268
+ */
269
+ defaultTag: {
270
+ type: String,
271
+ default: ActionTag.button
227
272
  }
228
273
  });
229
274
  const VvCardProps = {
@@ -276,22 +321,36 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
276
321
  const { modifiers } = toRefs(props);
277
322
  const bemCssClasses = useModifiers("vv-card", modifiers);
278
323
  return (_ctx, _cache) => {
279
- return openBlock(), createElementBlock("article", {
280
- class: normalizeClass(unref(bemCssClasses))
281
- }, [
282
- _ctx.$slots.header || _ctx.title ? (openBlock(), createElementBlock("header", _hoisted_1, [
283
- renderSlot(_ctx.$slots, "header", {}, () => [
284
- createTextVNode(toDisplayString(_ctx.title), 1)
285
- ])
286
- ])) : createCommentVNode("", true),
287
- renderSlot(_ctx.$slots, "default"),
288
- _ctx.$slots.content ? (openBlock(), createElementBlock("div", _hoisted_2, [
289
- renderSlot(_ctx.$slots, "content")
290
- ])) : createCommentVNode("", true),
291
- _ctx.$slots.footer ? (openBlock(), createElementBlock("footer", _hoisted_3, [
292
- renderSlot(_ctx.$slots, "footer")
293
- ])) : createCommentVNode("", true)
294
- ], 2);
324
+ return openBlock(), createElementBlock(
325
+ "article",
326
+ {
327
+ class: normalizeClass(unref(bemCssClasses))
328
+ },
329
+ [
330
+ _ctx.$slots.header || _ctx.title ? (openBlock(), createElementBlock("header", _hoisted_1, [
331
+ createCommentVNode(" @slot Title slot "),
332
+ renderSlot(_ctx.$slots, "header", {}, () => [
333
+ createTextVNode(
334
+ toDisplayString(_ctx.title),
335
+ 1
336
+ /* TEXT */
337
+ )
338
+ ])
339
+ ])) : createCommentVNode("v-if", true),
340
+ createCommentVNode(" @slot Default slot "),
341
+ renderSlot(_ctx.$slots, "default"),
342
+ _ctx.$slots.content ? (openBlock(), createElementBlock("div", _hoisted_2, [
343
+ createCommentVNode(" @slot Content slot "),
344
+ renderSlot(_ctx.$slots, "content")
345
+ ])) : createCommentVNode("v-if", true),
346
+ _ctx.$slots.footer ? (openBlock(), createElementBlock("footer", _hoisted_3, [
347
+ createCommentVNode(" @slot Footer slot "),
348
+ renderSlot(_ctx.$slots, "footer")
349
+ ])) : createCommentVNode("v-if", true)
350
+ ],
351
+ 2
352
+ /* CLASS */
353
+ );
295
354
  };
296
355
  }
297
356
  });
@@ -1 +1 @@
1
- !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue")):"function"==typeof define&&define.amd?define(["vue"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCard=o(e.vue)}(this,(function(e){"use strict";var o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),t=(e=>(e.before="before",e.after="after",e))(t||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{});Boolean,Boolean,Boolean;const r={modifiers:[String,Array]};t.before,o.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,n.button;const l={...r,title:String};const a={key:0,class:"vv-card__header"},s={key:1,class:"vv-card__content"},c={key:2,class:"vv-card__footer"};return e.defineComponent({name:"VvCard",props:l,setup(o){const t=o,{modifiers:n}=e.toRefs(t),r=function(o,t,n){return e.computed((()=>{const r={[o]:!0},l="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(r[`${o}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((t=>{r[`${o}--${t}`]=e.unref(n.value[t])})),r}))}("vv-card",n);return(o,t)=>(e.openBlock(),e.createElementBlock("article",{class:e.normalizeClass(e.unref(r))},[o.$slots.header||o.title?(e.openBlock(),e.createElementBlock("header",a,[e.renderSlot(o.$slots,"header",{},(()=>[e.createTextVNode(e.toDisplayString(o.title),1)]))])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"default"),o.$slots.content?(e.openBlock(),e.createElementBlock("div",s,[e.renderSlot(o.$slots,"content")])):e.createCommentVNode("",!0),o.$slots.footer?(e.openBlock(),e.createElementBlock("footer",c,[e.renderSlot(o.$slots,"footer")])):e.createCommentVNode("",!0)],2))}})}));
1
+ !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue")):"function"==typeof define&&define.amd?define(["vue"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCard=o(e.vue)}(this,(function(e){"use strict";var o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),t=(e=>(e.before="before",e.after="after",e))(t||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{}),r=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(r||{});Boolean,Boolean,Boolean,Boolean;const l={modifiers:{type:[String,Array],default:void 0}};t.before,o.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,n.button,r.button;const a={...l,title:String};const s={key:0,class:"vv-card__header"},c={key:1,class:"vv-card__content"},i={key:2,class:"vv-card__footer"};return e.defineComponent({name:"VvCard",props:a,setup(o){const t=o,{modifiers:n}=e.toRefs(t),r=function(o,t,n){return e.computed((()=>{const r={[o]:!0},l="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(r[`${o}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((t=>{r[`${o}--${t}`]=e.unref(n.value[t])})),r}))}("vv-card",n);return(o,t)=>(e.openBlock(),e.createElementBlock("article",{class:e.normalizeClass(e.unref(r))},[o.$slots.header||o.title?(e.openBlock(),e.createElementBlock("header",s,[e.createCommentVNode(" @slot Title slot "),e.renderSlot(o.$slots,"header",{},(()=>[e.createTextVNode(e.toDisplayString(o.title),1)]))])):e.createCommentVNode("v-if",!0),e.createCommentVNode(" @slot Default slot "),e.renderSlot(o.$slots,"default"),o.$slots.content?(e.openBlock(),e.createElementBlock("div",c,[e.createCommentVNode(" @slot Content slot "),e.renderSlot(o.$slots,"content")])):e.createCommentVNode("v-if",!0),o.$slots.footer?(e.openBlock(),e.createElementBlock("footer",i,[e.createCommentVNode(" @slot Footer slot "),e.renderSlot(o.$slots,"footer")])):e.createCommentVNode("v-if",!0)],2))}})}));
@@ -1,10 +1,18 @@
1
1
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
2
2
  title: StringConstructor;
3
- modifiers: globalThis.PropType<string | string[]>;
4
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
3
+ modifiers: {
4
+ type: globalThis.PropType<string | string[]>;
5
+ default: undefined;
6
+ };
7
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{
5
8
  title: StringConstructor;
6
- modifiers: globalThis.PropType<string | string[]>;
7
- }>>, {}, {}>, {
9
+ modifiers: {
10
+ type: globalThis.PropType<string | string[]>;
11
+ default: undefined;
12
+ };
13
+ }>>, {
14
+ modifiers: string | string[];
15
+ }, {}>, {
8
16
  header?(_: {}): any;
9
17
  default?(_: {}): any;
10
18
  content?(_: {}): any;
@@ -1,4 +1,7 @@
1
1
  export declare const VvCardProps: {
2
2
  title: StringConstructor;
3
- modifiers: globalThis.PropType<string | string[]>;
3
+ modifiers: {
4
+ type: globalThis.PropType<string | string[]>;
5
+ default: undefined;
6
+ };
4
7
  };
@@ -1,5 +1,5 @@
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 { unref, inject, computed, toRef, toRefs, isRef, defineComponent, h, useSlots, ref, watchEffect, watch, onMounted, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode, vModelCheckbox, createCommentVNode, renderSlot, createTextVNode, toDisplayString, createVNode, createSlots, withCtx, normalizeProps, guardReactiveProps } from "vue";
2
+ import { uid } from "uid";
3
3
  var Strategy = /* @__PURE__ */ ((Strategy2) => {
4
4
  Strategy2["absolute"] = "absolute";
5
5
  Strategy2["fixed"] = "fixed";
@@ -34,6 +34,13 @@ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
34
34
  ButtonType2["reset"] = "reset";
35
35
  return ButtonType2;
36
36
  })(ButtonType || {});
37
+ var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
38
+ ActionTag2["nuxtLink"] = "nuxt-link";
39
+ ActionTag2["routerLink"] = "router-link";
40
+ ActionTag2["a"] = "a";
41
+ ActionTag2["button"] = "button";
42
+ return ActionTag2;
43
+ })(ActionTag || {});
37
44
  var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
38
45
  AnchorTarget2["_blank"] = "_blank";
39
46
  AnchorTarget2["_self"] = "_self";
@@ -60,6 +67,7 @@ const LinkProps = {
60
67
  */
61
68
  target: {
62
69
  type: String,
70
+ default: void 0,
63
71
  validator: (value) => Object.values(AnchorTarget).includes(value)
64
72
  },
65
73
  /**
@@ -74,27 +82,33 @@ const ValidProps = {
74
82
  /**
75
83
  * Valid status
76
84
  */
77
- valid: Boolean,
85
+ valid: { type: Boolean, default: false },
78
86
  /**
79
87
  * Valid label
80
88
  */
81
- validLabel: [String, Array]
89
+ validLabel: { type: [String, Array], default: void 0 }
82
90
  };
83
91
  const InvalidProps = {
84
92
  /**
85
93
  * Invalid status
86
94
  */
87
- invalid: Boolean,
95
+ invalid: {
96
+ type: Boolean,
97
+ default: false
98
+ },
88
99
  /**
89
100
  * Invalid label
90
101
  */
91
- invalidLabel: [String, Array]
102
+ invalidLabel: { type: [String, Array], default: void 0 }
92
103
  };
93
104
  const LoadingProps = {
94
105
  /**
95
106
  * Loading status
96
107
  */
97
- loading: Boolean,
108
+ loading: {
109
+ type: Boolean,
110
+ default: false
111
+ },
98
112
  /**
99
113
  * Loading label
100
114
  */
@@ -107,37 +121,64 @@ const DisabledProps = {
107
121
  /**
108
122
  * Whether the form control is disabled
109
123
  */
110
- disabled: Boolean
124
+ disabled: {
125
+ type: Boolean,
126
+ default: false
127
+ }
111
128
  };
112
129
  const ActiveProps = {
113
130
  /**
114
131
  * Whether the item is active
115
132
  */
116
- active: Boolean
133
+ active: {
134
+ type: Boolean,
135
+ default: false
136
+ }
137
+ };
138
+ const CurrentProps = {
139
+ /**
140
+ * Whether the item is current
141
+ */
142
+ current: {
143
+ type: Boolean,
144
+ default: false
145
+ }
117
146
  };
118
147
  const PressedProps = {
119
148
  /**
120
149
  * Whether the item is pressed
121
150
  */
122
- pressed: Boolean
151
+ pressed: {
152
+ type: Boolean,
153
+ default: false
154
+ }
123
155
  };
124
156
  const LabelProps = {
125
157
  /**
126
158
  * The item label
127
159
  */
128
- label: [String, Number]
160
+ label: {
161
+ type: [String, Number],
162
+ default: void 0
163
+ }
129
164
  };
130
165
  const ReadonlyProps = {
131
166
  /**
132
167
  * The value is not editable
133
168
  */
134
- readonly: Boolean
169
+ readonly: {
170
+ type: Boolean,
171
+ default: false
172
+ }
135
173
  };
136
174
  const ModifiersProps = {
137
175
  /**
138
176
  * Component BEM modifiers
139
177
  */
140
- modifiers: [String, Array]
178
+ modifiers: {
179
+ type: [String, Array],
180
+ default: void 0
181
+ }
141
182
  };
142
183
  const HintProps = {
143
184
  hintLabel: { type: String, default: "" }
@@ -147,7 +188,10 @@ const HintProps = {
147
188
  * VvIcon name or props
148
189
  * @see VVIcon
149
190
  */
150
- icon: { type: [String, Object] },
191
+ icon: {
192
+ type: [String, Object],
193
+ default: void 0
194
+ },
151
195
  /**
152
196
  * VvIcon position
153
197
  */
@@ -192,7 +236,8 @@ const IdProps = {
192
236
  * Dropdown show / hide transition name
193
237
  */
194
238
  transitionName: {
195
- type: String
239
+ type: String,
240
+ default: void 0
196
241
  },
197
242
  /**
198
243
  * Offset of the dropdown from the trigger
@@ -260,7 +305,8 @@ const IdProps = {
260
305
  * Set dropdown width to the same as the trigger
261
306
  */
262
307
  triggerWidth: {
263
- type: Boolean
308
+ type: Boolean,
309
+ default: false
264
310
  }
265
311
  });
266
312
  const IdNameProps = {
@@ -287,17 +333,24 @@ const CheckboxRadioProps = {
287
333
  * Input value
288
334
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value
289
335
  */
290
- value: [String, Number, Boolean],
336
+ value: {
337
+ type: [String, Number, Boolean],
338
+ default: void 0
339
+ },
291
340
  /**
292
341
  * Input value
293
342
  */
294
- modelValue: [Object, Number, Boolean, String]
343
+ modelValue: {
344
+ type: [Object, Number, Boolean, String],
345
+ default: void 0
346
+ }
295
347
  };
296
348
  ({
297
349
  ...DisabledProps,
298
350
  ...LabelProps,
299
351
  ...PressedProps,
300
352
  ...ActiveProps,
353
+ ...CurrentProps,
301
354
  ...LinkProps,
302
355
  /**
303
356
  * Button type
@@ -313,6 +366,13 @@ const CheckboxRadioProps = {
313
366
  ariaLabel: {
314
367
  type: String,
315
368
  default: void 0
369
+ },
370
+ /**
371
+ * Default tag for the action
372
+ */
373
+ defaultTag: {
374
+ type: String,
375
+ default: ActionTag.button
316
376
  }
317
377
  });
318
378
  function equals(obj1, obj2, field) {
@@ -656,7 +716,7 @@ function useDefaults(componentName, propsDefinition, props) {
656
716
  }, {});
657
717
  });
658
718
  }
659
- const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || nanoid()));
719
+ const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || uid()));
660
720
  function useModifiers(prefix, modifiers, others) {
661
721
  return computed(() => {
662
722
  const toReturn = {
@@ -689,8 +749,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
689
749
  ...__default__,
690
750
  props: VvCheckboxProps,
691
751
  emits: VvCheckboxEvents,
692
- setup(__props, { emit }) {
752
+ setup(__props, { emit: __emit }) {
693
753
  const props = __props;
754
+ const emit = __emit;
694
755
  const slots = useSlots();
695
756
  const propsDefaults = useDefaults(
696
757
  "VvCheckbox",
@@ -832,13 +893,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
832
893
  }, null, 8, _hoisted_2), [
833
894
  [vModelCheckbox, unref(localModelValue)]
834
895
  ]),
896
+ createCommentVNode(" @slot Use this slot for check label "),
835
897
  renderSlot(_ctx.$slots, "default", { value: unref(modelValue) }, () => [
836
- createTextVNode(toDisplayString(_ctx.label), 1)
898
+ createTextVNode(
899
+ toDisplayString(_ctx.label),
900
+ 1
901
+ /* TEXT */
902
+ )
837
903
  ]),
838
904
  createVNode(unref(HintSlot), {
839
905
  id: unref(hasHintId),
840
906
  class: "vv-checkbox__hint"
841
- }, createSlots({ _: 2 }, [
907
+ }, createSlots({
908
+ _: 2
909
+ /* DYNAMIC */
910
+ }, [
842
911
  _ctx.$slots.hint ? {
843
912
  name: "hint",
844
913
  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 t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),a=(e=>(e.before="before",e.after="after",e))(a||{}),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,{label:[String,Number]}),c={readonly:Boolean},f={modifiers:[String,Array]},p={hintLabel:{type:String,default:""}};a.before;const b={tabindex:{type:[String,Number],default:0}},h={id:[String,Number]};t.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,t){return t?S(e,t)===S(l,t):y(e,l)}function y(e,l){if(e===l)return!0;if(e&&l&&"object"==typeof e&&"object"==typeof l){const t=Array.isArray(e),a=Array.isArray(l);let n,o,i;if(t&&a){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(t!=a)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 t=l.split(".");let a=e;for(let l=0,n=t.length;l<n;++l){if(null==e)return null;a=a[t[l]]}return a}}return null}function L(l){const t=e.inject(l,void 0),a=e.computed((()=>{return l=t,!(null==(a=e.unref(l))||""===a||Array.isArray(a)&&0===a.length||!(a instanceof Date)&&"object"==typeof a&&0===Object.keys(a).length);var l,a}));return{group:t,isInGroup:a,getGroupOrLocalRef:function(l,a,n){if(null==t?void 0:t.value){const a=e.unref(t.value)[l];return e.computed({get:()=>null==a?void 0:a.value,set(e){a.value=e}})}const o=e.toRef(a,l);return e.computed({get:()=>o.value,set(e){n&&n(`update:${l}`,e)}})}}}n.button;const O={...m,...f,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function k(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}function B(l,t,a){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 a;const e=i.value,l=t,n=a;return Object.keys(l).reduce(((t,a)=>{const o=n[a];if(t[a]=o,a in e){if(Array.isArray(l[a])){const n=l[a];if(n.length){n[0]===o&&(t[a]=e[a])}}if("function"==typeof l[a]){(0,l[a])()===o&&(t[a]=e[a])}if("object"==typeof l[a]){let n=l[a].default;"function"==typeof n&&(n=n()),"object"==typeof n?JSON.stringify(n)===JSON.stringify(o)&&(t[a]=e[a]):n===o&&(t[a]=e[a])}}return t}),{})}))}const V=["for"],x=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"];return e.defineComponent({name:"VvCheckbox",props:O,emits:["click","update:modelValue","change","blur"],setup(t,{emit:a}){const n=t,o=e.useSlots(),r=B("VvCheckbox",O,n),{id:u,disabled:d,readonly:s,valid:v,invalid:c,propsSwitch:f,modelValue:p,indeterminate:b,isInGroup:h}=function(l,t){const{group:a,isInGroup:n,getGroupOrLocalRef:o}=L(i),{id:r,switch:u,indeterminate:d}=e.toRefs(l),s=o("modelValue",l,t),v=o("valid",l),c=o("invalid",l),f=e.computed((()=>{var e;return Boolean(l.readonly||(null==(e=null==a?void 0:a.value)?void 0:e.readonly.value))})),p=e.computed((()=>{var e;return Boolean(l.disabled||(null==(e=null==a?void 0:a.value)?void 0:e.disabled.value))}));return{id:r,propsSwitch:u,indeterminate:d,group:a,isInGroup:n,modelValue:s,valid:v,invalid:c,readonly:f,disabled:p}}(n,a),m=(t=>e.computed((()=>String((null==t?void 0:t.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 t of l)if(g(e,t))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;a("change",e)}}),{modifiers:P}=e.toRefs(n),E=function(l,t,a){return e.computed((()=>{const n={[l]:!0},o="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return o&&Array.isArray(o)&&o.forEach((e=>{e&&(n[`${l}--${e}`]=!0)})),a&&Object.keys(a.value).forEach((t=>{n[`${l}--${t}`]=e.unref(a.value[t])})),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,t){const a=e.computed((()=>e.isRef(l)?l.value:l)),n=e.computed((()=>k(a.value.invalidLabel))),o=e.computed((()=>k(a.value.validLabel))),i=e.computed((()=>a.value.loadingLabel)),r=e.computed((()=>a.value.hintLabel)),u=e.computed((()=>Boolean(a.value.loading&&(t.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(a.value.invalid&&(t.invalid||n.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(a.value.valid&&(t.valid||o.value)))),v=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(t.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 l,t,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==(t=(l=this.$slots).loading)?void 0:t.call(l))??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,o);return(l,t)=>(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":t[0]||(t[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.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(l||{}),a=(e=>(e.before="before",e.after="after",e))(a||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{}),o=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(o||{});const i=Symbol.for("volver"),r=Symbol.for("checkGroup"),u={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},d={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},s={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},v={disabled:{type:Boolean,default:!1}},c=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),f={readonly:{type:Boolean,default:!1}},p={modifiers:{type:[String,Array],default:void 0}},b={hintLabel:{type:String,default:""}};a.before;const h={tabindex:{type:[String,Number],default:0}},m={id:[String,Number]};l.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const y={...{...m,name:{type:String,required:!0}},...h,...u,...d,...b,...v,...f,...p,...c,...s,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}};function g(e,t,l){return l?L(e,l)===L(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),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(!S(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],!S(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function L(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 k(t){const l=e.inject(t,void 0),a=e.computed((()=>{return t=l,!(null==(a=e.unref(t))||""===a||Array.isArray(a)&&0===a.length||!(a instanceof Date)&&"object"==typeof a&&0===Object.keys(a).length);var t,a}));return{group:l,isInGroup:a,getGroupOrLocalRef:function(t,a,n){if(null==l?void 0:l.value){const a=e.unref(l.value)[t];return e.computed({get:()=>null==a?void 0:a.value,set(e){a.value=e}})}const o=e.toRef(a,t);return e.computed({get:()=>o.value,set(e){n&&n(`update:${t}`,e)}})}}}n.button,o.button;const B={...y,...p,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function O(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(i),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 x=["for"],A=["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(l,{emit:a}){const n=l,o=a,i=e.useSlots(),u=V("VvCheckbox",B,n),{id:d,disabled:s,readonly:v,valid:c,invalid:f,propsSwitch:p,modelValue:b,indeterminate:h,isInGroup:m}=function(t,l){const{group:a,isInGroup:n,getGroupOrLocalRef:o}=k(r),{id:i,switch:u,indeterminate:d}=e.toRefs(t),s=o("modelValue",t,l),v=o("valid",t),c=o("invalid",t),f=e.computed((()=>{var e;return Boolean(t.readonly||(null==(e=null==a?void 0:a.value)?void 0:e.readonly.value))})),p=e.computed((()=>{var e;return Boolean(t.disabled||(null==(e=null==a?void 0:a.value)?void 0:e.disabled.value))}));return{id:i,propsSwitch:u,indeterminate:d,group:a,isInGroup:n,modelValue:s,valid:v,invalid:c,readonly:f,disabled:p}}(n,o),y=(l=>e.computed((()=>String((null==l?void 0:l.value)||t.uid()))))(d),S=e.computed((()=>`${y.value}-hint`)),L=e.computed((()=>w.value?-1:n.tabindex)),$=e.ref(),j=e.computed((()=>void 0!==n.uncheckedValue&&!m.value)),w=e.computed((()=>s.value||v.value)),C=e.computed((()=>!0===f.value||!0!==c.value&&void 0)),R=e.computed((()=>j.value?b.value===n.value:Array.isArray(b.value)?function(e,t){if(null!=e&&t&&t.length)for(const l of t)if(g(e,l))return!0;return!1}(n.value,b.value):g(n.value,b.value))),N=e.computed((()=>!!h.value||!(R.value||!j.value||n.uncheckedValue===b.value))),I=e.computed((()=>{if(!j.value)return!["string","number","boolean"].includes(typeof n.value)||n.value})),P=e.computed({get:()=>R.value,set(e){if(j.value)b.value=e?n.value:n.uncheckedValue;else if(Array.isArray(b.value)||m.value){const t=new Set(Array.isArray(b.value)?b.value:void 0!==b.value?[b.value]:[]);e?t.add(n.value):t.delete(n.value),b.value=[...t]}else b.value=e?n.value:void 0;o("change",e)}}),{modifiers:E}=e.toRefs(n),G=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",E,e.computed((()=>({switch:p.value,valid:c.value,invalid:f.value,disabled:s.value,readonly:v.value,indeterminate:h.value}))));e.watchEffect((()=>{j.value&&Array.isArray(b.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")})),e.watch((()=>N.value),(e=>{$.value.indeterminate=!!e})),e.onMounted((()=>{N.value&&($.value.indeterminate=!0)}));const{HintSlot:H,hasHintLabelOrSlot:T,hasInvalidLabelOrSlot:_,hintSlotScope:z}=function(t,l){const a=e.computed((()=>e.isRef(t)?t.value:t)),n=e.computed((()=>O(a.value.invalidLabel))),o=e.computed((()=>O(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}}(u,i);return(t,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(G)),for:e.unref(y)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(y),ref_key:"input",ref:$,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(P)?P.value=t:null),type:"checkbox",class:"vv-checkbox__input",name:t.name,disabled:e.unref(w),value:e.unref(I),tabindex:e.unref(L),"aria-invalid":e.unref(C),"aria-describedby":e.unref(T)?e.unref(S):void 0,"aria-errormessage":e.unref(_)?e.unref(S):void 0},null,8,A),[[e.vModelCheckbox,e.unref(P)]]),e.createCommentVNode(" @slot Use this slot for check label "),e.renderSlot(t.$slots,"default",{value:e.unref(b)},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)])),e.createVNode(e.unref(H),{id:e.unref(S),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(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,x))}})}));