@volverjs/ui-vue 0.0.9 → 0.0.10-beta.10

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 (184) hide show
  1. package/README.md +64 -1
  2. package/auto-imports.d.ts +1 -1
  3. package/bin/icons.cjs +1 -1
  4. package/bin/icons.js +34 -19
  5. package/dist/components/VvAccordion/VvAccordion.es.js +33 -4
  6. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  7. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +4 -4
  8. package/dist/components/VvAccordion/index.d.ts +1 -1
  9. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +75 -27
  10. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  11. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +5 -5
  12. package/dist/components/VvAction/VvAction.es.js +26 -4
  13. package/dist/components/VvAction/VvAction.umd.js +1 -1
  14. package/dist/components/VvAction/VvAction.vue.d.ts +17 -4
  15. package/dist/components/VvAction/index.d.ts +5 -0
  16. package/dist/components/VvAlert/VvAlert.es.js +96 -45
  17. package/dist/components/VvAlert/VvAlert.umd.js +1 -1
  18. package/dist/components/VvAlert/VvAlert.vue.d.ts +4 -4
  19. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +136 -66
  20. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
  21. package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +4 -4
  22. package/dist/components/VvAvatar/VvAvatar.es.js +22 -1
  23. package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
  24. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +79 -28
  25. package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
  26. package/dist/components/VvBadge/VvBadge.es.js +39 -8
  27. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  28. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +224 -41
  29. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  30. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +14 -3
  31. package/dist/components/VvBreadcrumb/index.d.ts +2 -9
  32. package/dist/components/VvButton/VvButton.es.js +70 -25
  33. package/dist/components/VvButton/VvButton.umd.js +1 -1
  34. package/dist/components/VvButton/VvButton.vue.d.ts +25 -9
  35. package/dist/components/VvButton/index.d.ts +5 -0
  36. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +33 -6
  37. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  38. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +6 -6
  39. package/dist/components/VvCard/VvCard.es.js +47 -16
  40. package/dist/components/VvCard/VvCard.umd.js +1 -1
  41. package/dist/components/VvCheckbox/VvCheckbox.es.js +35 -7
  42. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  43. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +8 -8
  44. package/dist/components/VvCheckbox/index.d.ts +1 -1
  45. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +106 -51
  46. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  47. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +7 -7
  48. package/dist/components/VvCheckboxGroup/index.d.ts +1 -1
  49. package/dist/components/VvCombobox/VvCombobox.es.js +635 -400
  50. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  51. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +112 -112
  52. package/dist/components/VvCombobox/index.d.ts +32 -32
  53. package/dist/components/VvDialog/VvDialog.es.js +65 -27
  54. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  55. package/dist/components/VvDialog/VvDialog.vue.d.ts +4 -4
  56. package/dist/components/VvDropdown/VvDropdown.es.js +87 -46
  57. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  58. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +203 -189
  59. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +12 -0
  60. package/dist/components/VvDropdown/index.d.ts +32 -32
  61. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +46 -12
  62. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  63. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +13 -7
  64. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +28 -1
  65. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
  66. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +40 -8
  67. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
  68. package/dist/components/VvIcon/VvIcon.es.js +1 -1
  69. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  70. package/dist/components/VvInputText/VvInputClearAction.d.ts +1 -1
  71. package/dist/components/VvInputText/VvInputText.es.js +149 -99
  72. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  73. package/dist/components/VvInputText/VvInputText.vue.d.ts +10 -10
  74. package/dist/components/VvInputText/index.d.ts +8 -2
  75. package/dist/components/VvNav/VvNav.es.js +115 -63
  76. package/dist/components/VvNav/VvNav.umd.js +1 -1
  77. package/dist/components/VvNav/VvNav.vue.d.ts +31 -12
  78. package/dist/components/VvNav/VvNavItem.vue.d.ts +9 -0
  79. package/dist/components/VvNav/index.d.ts +1 -12
  80. package/dist/components/VvNavItem/VvNavItem.es.js +413 -0
  81. package/dist/components/VvNavItem/VvNavItem.umd.js +1 -0
  82. package/dist/components/VvNavSeparator/VvNavSeparator.es.js +24 -0
  83. package/dist/components/VvNavSeparator/VvNavSeparator.umd.js +1 -0
  84. package/dist/components/VvProgress/VvProgress.es.js +33 -6
  85. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  86. package/dist/components/VvRadio/VvRadio.es.js +35 -7
  87. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  88. package/dist/components/VvRadio/VvRadio.vue.d.ts +8 -8
  89. package/dist/components/VvRadio/index.d.ts +1 -1
  90. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +106 -51
  91. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  92. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +7 -7
  93. package/dist/components/VvRadioGroup/index.d.ts +1 -1
  94. package/dist/components/VvSelect/VvSelect.es.js +159 -99
  95. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  96. package/dist/components/VvSelect/VvSelect.vue.d.ts +13 -13
  97. package/dist/components/VvSelect/index.d.ts +1 -1
  98. package/dist/components/VvTab/VvTab.es.js +214 -99
  99. package/dist/components/VvTab/VvTab.umd.js +1 -1
  100. package/dist/components/VvTab/VvTab.vue.d.ts +40 -11
  101. package/dist/components/VvTab/index.d.ts +9 -3
  102. package/dist/components/VvTextarea/VvTextarea.es.js +123 -77
  103. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  104. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +10 -10
  105. package/dist/components/VvTooltip/VvTooltip.es.js +40 -9
  106. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  107. package/dist/components/index.es.js +1593 -1012
  108. package/dist/components/index.umd.js +1 -1
  109. package/dist/composables/group/useInjectedGroupState.d.ts +1 -1
  110. package/dist/composables/useOptions.d.ts +1 -1
  111. package/dist/composables/useVolver.d.ts +1 -1
  112. package/dist/directives/index.d.ts +3 -5
  113. package/dist/directives/index.es.js +60 -23
  114. package/dist/directives/index.umd.js +1 -1
  115. package/dist/directives/v-tooltip.es.js +58 -18
  116. package/dist/directives/v-tooltip.umd.js +1 -1
  117. package/dist/icons.es.js +3 -3
  118. package/dist/icons.umd.js +1 -1
  119. package/dist/index.d.ts +3 -1
  120. package/dist/index.es.js +19 -16
  121. package/dist/index.umd.js +1 -1
  122. package/dist/props/index.d.ts +58 -34
  123. package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +50 -15
  124. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +332 -83
  125. package/dist/stories/Combobox/Combobox.settings.d.ts +8 -0
  126. package/dist/stories/Combobox/ComboboxOptions.stories.d.ts +1 -0
  127. package/dist/stories/InputText/InputTextMask.stories.d.ts +1 -1
  128. package/dist/stories/Tab/Tab.settings.d.ts +4 -37
  129. package/dist/types/alert.d.ts +13 -0
  130. package/dist/types/floating-ui.d.ts +6 -0
  131. package/dist/types/generic.d.ts +4 -0
  132. package/dist/types/group.d.ts +37 -0
  133. package/dist/types/index.d.ts +5 -0
  134. package/dist/types/nav.d.ts +17 -0
  135. package/package.json +61 -52
  136. package/src/Volver.ts +22 -16
  137. package/src/assets/icons/detailed.json +1 -1
  138. package/src/assets/icons/normal.json +1 -1
  139. package/src/assets/icons/simple.json +1 -1
  140. package/src/components/VvAccordion/VvAccordion.vue +2 -2
  141. package/src/components/VvAction/VvAction.vue +5 -2
  142. package/src/components/VvBreadcrumb/VvBreadcrumb.vue +20 -19
  143. package/src/components/VvBreadcrumb/index.ts +2 -8
  144. package/src/components/VvCombobox/VvCombobox.vue +32 -33
  145. package/src/components/VvCombobox/index.ts +4 -0
  146. package/src/components/VvInputText/VvInputText.vue +2 -2
  147. package/src/components/VvNav/VvNav.vue +30 -50
  148. package/src/components/VvNav/VvNavItem.vue +18 -0
  149. package/src/components/VvNav/VvNavSeparator.vue +11 -0
  150. package/src/components/VvNav/index.ts +2 -15
  151. package/src/components/VvSelect/VvSelect.vue +4 -4
  152. package/src/components/VvTab/VvTab.vue +63 -35
  153. package/src/components/VvTab/index.ts +10 -4
  154. package/src/components/VvTextarea/VvTextarea.vue +1 -1
  155. package/src/composables/useOptions.ts +2 -2
  156. package/src/composables/useUniqueId.ts +2 -2
  157. package/src/directives/index.ts +1 -4
  158. package/src/directives/v-tooltip.ts +19 -10
  159. package/src/index.ts +3 -1
  160. package/src/props/index.ts +27 -3
  161. package/src/stories/Button/ButtonModifiers.stories.ts +4 -14
  162. package/src/stories/Combobox/Combobox.settings.ts +8 -0
  163. package/src/stories/Combobox/ComboboxOptions.stories.ts +18 -0
  164. package/src/stories/InputText/InputTextMask.stories.ts +1 -1
  165. package/src/stories/Nav/Nav.settings.ts +3 -4
  166. package/src/stories/Nav/Nav.test.ts +4 -15
  167. package/src/stories/Tab/Tab.settings.ts +9 -9
  168. package/src/stories/Tab/Tab.stories.ts +2 -2
  169. package/src/stories/Tab/Tab.test.ts +6 -14
  170. package/src/stories/argTypes.ts +1 -1
  171. package/src/types/generic.ts +6 -0
  172. package/src/types/index.ts +5 -0
  173. package/src/types/nav.ts +19 -0
  174. package/src/utils/ObjectUtilities.ts +3 -2
  175. package/dist/components/VvNav/VvNavItemTitle.vue.d.ts +0 -6
  176. package/dist/components/VvNavItemTitle/VvNavItemTitle.es.js +0 -19
  177. package/dist/components/VvNavItemTitle/VvNavItemTitle.umd.js +0 -1
  178. package/src/components/VvNav/VvNavItemTitle.vue +0 -11
  179. package/src/components/VvNav/VvNavSeparator.ts +0 -8
  180. package/src/types/generic.d.ts +0 -6
  181. /package/dist/components/VvNav/{VvNavSeparator.d.ts → VvNavSeparator.vue.d.ts} +0 -0
  182. /package/src/types/{alert.d.ts → alert.ts} +0 -0
  183. /package/src/types/{floating-ui.d.ts → floating-ui.ts} +0 -0
  184. /package/src/types/{group.d.ts → group.ts} +0 -0
@@ -0,0 +1,413 @@
1
+ import { inject, defineComponent, ref, watch, computed, openBlock, createBlock, resolveDynamicComponent, unref, mergeProps, withCtx, renderSlot, createTextVNode, toDisplayString, createElementBlock, createVNode } from "vue";
2
+ var Strategy = /* @__PURE__ */ ((Strategy2) => {
3
+ Strategy2["absolute"] = "absolute";
4
+ Strategy2["fixed"] = "fixed";
5
+ return Strategy2;
6
+ })(Strategy || {});
7
+ var Side = /* @__PURE__ */ ((Side2) => {
8
+ Side2["left"] = "left";
9
+ Side2["right"] = "right";
10
+ Side2["top"] = "top";
11
+ Side2["bottom"] = "bottom";
12
+ return Side2;
13
+ })(Side || {});
14
+ var Placement = /* @__PURE__ */ ((Placement2) => {
15
+ Placement2["topStart"] = "top-start";
16
+ Placement2["topEnd"] = "top-end";
17
+ Placement2["bottomStart"] = "bottom-start";
18
+ Placement2["bottomEnd"] = "bottom-end";
19
+ Placement2["leftStart"] = "left-start";
20
+ Placement2["leftEnd"] = "left-end";
21
+ Placement2["rightStart"] = "right-start";
22
+ Placement2["rightEnd"] = "right-end";
23
+ return Placement2;
24
+ })(Placement || {});
25
+ var Position = /* @__PURE__ */ ((Position2) => {
26
+ Position2["before"] = "before";
27
+ Position2["after"] = "after";
28
+ return Position2;
29
+ })(Position || {});
30
+ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
31
+ ButtonType2["button"] = "button";
32
+ ButtonType2["submit"] = "submit";
33
+ ButtonType2["reset"] = "reset";
34
+ return ButtonType2;
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 || {});
43
+ var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
44
+ AnchorTarget2["_blank"] = "_blank";
45
+ AnchorTarget2["_self"] = "_self";
46
+ AnchorTarget2["_parent"] = "_parent";
47
+ AnchorTarget2["_top"] = "_top";
48
+ return AnchorTarget2;
49
+ })(AnchorTarget || {});
50
+ const INJECTION_KEY_VOLVER = Symbol.for("volver");
51
+ const INJECTION_KEY_DROPDOWN_TRIGGER = Symbol.for(
52
+ "dropdownTrigger"
53
+ );
54
+ const INJECTION_KEY_DROPDOWN_ACTION = Symbol.for(
55
+ "dropdownAction"
56
+ );
57
+ const LinkProps = {
58
+ /**
59
+ * The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
60
+ * @see Documentation of [router-link](https://router.vuejs.org/api/#router-link) and [nuxt-link](https://nuxtjs.org/api/components-nuxt-link/)
61
+ */
62
+ to: {
63
+ type: [String, Object]
64
+ },
65
+ /**
66
+ * Anchor href
67
+ */
68
+ href: String,
69
+ /**
70
+ * Anchor target
71
+ */
72
+ target: {
73
+ type: String,
74
+ validator: (value) => Object.values(AnchorTarget).includes(value)
75
+ },
76
+ /**
77
+ * Anchor rel
78
+ */
79
+ rel: {
80
+ type: String,
81
+ default: "noopener noreferrer"
82
+ }
83
+ };
84
+ const DisabledProps = {
85
+ /**
86
+ * Whether the form control is disabled
87
+ */
88
+ disabled: Boolean
89
+ };
90
+ const ActiveProps = {
91
+ /**
92
+ * Whether the item is active
93
+ */
94
+ active: Boolean
95
+ };
96
+ const CurrentProps = {
97
+ /**
98
+ * Whether the item is current
99
+ */
100
+ current: Boolean
101
+ };
102
+ const PressedProps = {
103
+ /**
104
+ * Whether the item is pressed
105
+ */
106
+ pressed: Boolean
107
+ };
108
+ const LabelProps = {
109
+ /**
110
+ * The item label
111
+ */
112
+ label: [String, Number]
113
+ };
114
+ ({
115
+ /**
116
+ * VvIcon name or props
117
+ * @see VVIcon
118
+ */
119
+ icon: { type: [String, Object] },
120
+ /**
121
+ * VvIcon position
122
+ */
123
+ iconPosition: {
124
+ type: String,
125
+ default: Position.before,
126
+ validation: (value) => Object.values(Position).includes(value)
127
+ }
128
+ });
129
+ ({
130
+ /**
131
+ * Dropdown placement
132
+ */
133
+ placement: {
134
+ type: String,
135
+ default: Side.bottom,
136
+ validator: (value) => Object.values(Side).includes(value) || Object.values(Placement).includes(value)
137
+ },
138
+ /**
139
+ * Dropdown strategy
140
+ */
141
+ strategy: {
142
+ type: String,
143
+ default: void 0,
144
+ validator: (value) => Object.values(Strategy).includes(value)
145
+ },
146
+ /**
147
+ * Dropdown show / hide transition name
148
+ */
149
+ transitionName: {
150
+ type: String
151
+ },
152
+ /**
153
+ * Offset of the dropdown from the trigger
154
+ * @see https://floating-ui.com/docs/offset
155
+ */
156
+ offset: {
157
+ type: [Number, String, Object],
158
+ default: 0
159
+ },
160
+ /**
161
+ * Move dropdown to the side if there is no space in the default position
162
+ * @see https://floating-ui.com/docs/shift
163
+ */
164
+ shift: {
165
+ type: [Boolean, Object],
166
+ default: false
167
+ },
168
+ /**
169
+ * Flip dropdown position if there is no space in the default position
170
+ * @see https://floating-ui.com/docs/flip
171
+ */
172
+ flip: {
173
+ type: [Boolean, Object],
174
+ default: true
175
+ },
176
+ /**
177
+ * Size of the dropdown
178
+ * @see https://floating-ui.com/docs/size
179
+ */
180
+ size: {
181
+ type: [Boolean, Object],
182
+ default: () => ({ padding: 10 })
183
+ },
184
+ /**
185
+ * Automatically change the position of the dropdown
186
+ * @see https://floating-ui.com/docs/autoPlacement
187
+ */
188
+ autoPlacement: {
189
+ type: [Boolean, Object],
190
+ default: false
191
+ },
192
+ /**
193
+ * Add arrow to the dropdown
194
+ * @see https://floating-ui.com/docs/arrow
195
+ */
196
+ arrow: {
197
+ type: Boolean,
198
+ default: false
199
+ },
200
+ /**
201
+ * Keep open dropdown on click outside
202
+ */
203
+ keepOpen: {
204
+ type: Boolean,
205
+ default: false
206
+ },
207
+ /**
208
+ * Autofocus first item on dropdown open
209
+ */
210
+ autofocusFirst: {
211
+ type: Boolean,
212
+ default: true
213
+ },
214
+ /**
215
+ * Set dropdown width to the same as the trigger
216
+ */
217
+ triggerWidth: {
218
+ type: Boolean
219
+ }
220
+ });
221
+ const ActionProps = {
222
+ ...DisabledProps,
223
+ ...LabelProps,
224
+ ...PressedProps,
225
+ ...ActiveProps,
226
+ ...CurrentProps,
227
+ ...LinkProps,
228
+ /**
229
+ * Button type
230
+ */
231
+ type: {
232
+ type: String,
233
+ default: ButtonType.button,
234
+ validator: (value) => Object.values(ButtonType).includes(value)
235
+ },
236
+ /**
237
+ * Button aria-label
238
+ */
239
+ ariaLabel: {
240
+ type: String,
241
+ default: void 0
242
+ },
243
+ /**
244
+ * Default tag for the action
245
+ */
246
+ defaultTag: {
247
+ type: String,
248
+ default: ActionTag.button
249
+ }
250
+ };
251
+ const VvActionEvents = ["click", "mouseover", "mouseleave"];
252
+ const VvActionProps = ActionProps;
253
+ function useVolver() {
254
+ return inject(INJECTION_KEY_VOLVER);
255
+ }
256
+ function useInjectedDropdownTrigger() {
257
+ return inject(INJECTION_KEY_DROPDOWN_TRIGGER, {});
258
+ }
259
+ function useInjectedDropdownAction() {
260
+ return inject(INJECTION_KEY_DROPDOWN_ACTION, {});
261
+ }
262
+ const __default__$1 = {
263
+ name: "VvAction"
264
+ };
265
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
266
+ ...__default__$1,
267
+ props: VvActionProps,
268
+ emits: VvActionEvents,
269
+ setup(__props, { expose: __expose, emit }) {
270
+ const props = __props;
271
+ const volver = useVolver();
272
+ const element = ref(null);
273
+ __expose({ $el: element });
274
+ const {
275
+ reference: dropdownTriggerReference,
276
+ bus: dropdownEventBus,
277
+ aria: dropdownAria,
278
+ expanded: dropdownExpanded
279
+ } = useInjectedDropdownTrigger();
280
+ watch(
281
+ () => element.value,
282
+ (newValue) => {
283
+ if (dropdownTriggerReference) {
284
+ dropdownTriggerReference.value = newValue;
285
+ }
286
+ }
287
+ );
288
+ const pressed = computed(() => {
289
+ return props.pressed || (dropdownExpanded == null ? void 0 : dropdownExpanded.value);
290
+ });
291
+ const { role } = useInjectedDropdownAction();
292
+ const hasTag = computed(() => {
293
+ switch (true) {
294
+ case props.disabled:
295
+ return ActionTag.button;
296
+ case props.to !== void 0:
297
+ return (volver == null ? void 0 : volver.nuxt) ? ActionTag.nuxtLink : ActionTag.routerLink;
298
+ case props.href !== void 0:
299
+ return ActionTag.a;
300
+ default:
301
+ return props.defaultTag;
302
+ }
303
+ });
304
+ const hasProps = computed(() => {
305
+ const toReturn = {
306
+ ...dropdownAria == null ? void 0 : dropdownAria.value,
307
+ ariaPressed: pressed.value ? true : void 0,
308
+ ariaLabel: props.ariaLabel,
309
+ role: role == null ? void 0 : role.value
310
+ };
311
+ switch (hasTag.value) {
312
+ case ActionTag.a:
313
+ return {
314
+ ...toReturn,
315
+ href: props.href,
316
+ target: props.target,
317
+ rel: props.rel
318
+ };
319
+ case ActionTag.routerLink:
320
+ case ActionTag.nuxtLink:
321
+ return {
322
+ ...toReturn,
323
+ to: props.to,
324
+ target: props.target
325
+ };
326
+ case ActionTag.button:
327
+ return {
328
+ ...toReturn,
329
+ type: props.type,
330
+ disabled: props.disabled
331
+ };
332
+ default:
333
+ return toReturn;
334
+ }
335
+ });
336
+ const onClick = (e) => {
337
+ if (props.disabled) {
338
+ e.preventDefault();
339
+ return;
340
+ }
341
+ dropdownEventBus == null ? void 0 : dropdownEventBus.emit("click", e);
342
+ emit("click", e);
343
+ };
344
+ const onMouseover = (e) => {
345
+ dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseover", e);
346
+ emit("mouseover", e);
347
+ };
348
+ const onMouseleave = (e) => {
349
+ dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseleave", e);
350
+ emit("mouseleave", e);
351
+ };
352
+ return (_ctx, _cache) => {
353
+ return openBlock(), createBlock(resolveDynamicComponent(unref(hasTag)), mergeProps(unref(hasProps), {
354
+ ref_key: "element",
355
+ ref: element,
356
+ class: {
357
+ active: _ctx.active,
358
+ pressed: unref(pressed),
359
+ disabled: _ctx.disabled,
360
+ current: _ctx.current
361
+ },
362
+ onClickPassive: onClick,
363
+ onMouseoverPassive: onMouseover,
364
+ onMouseleavePassive: onMouseleave
365
+ }), {
366
+ default: withCtx(() => [
367
+ renderSlot(_ctx.$slots, "default", {}, () => [
368
+ createTextVNode(
369
+ toDisplayString(_ctx.label),
370
+ 1
371
+ /* TEXT */
372
+ )
373
+ ])
374
+ ]),
375
+ _: 3
376
+ /* FORWARDED */
377
+ }, 16, ["class"]);
378
+ };
379
+ }
380
+ });
381
+ const _hoisted_1 = {
382
+ class: "vv-nav__item",
383
+ role: "presentation"
384
+ };
385
+ const __default__ = {
386
+ name: "VvNavItem",
387
+ inheritAttrs: false
388
+ };
389
+ const _sfc_main = /* @__PURE__ */ defineComponent({
390
+ ...__default__,
391
+ setup(__props) {
392
+ return (_ctx, _cache) => {
393
+ return openBlock(), createElementBlock("li", _hoisted_1, [
394
+ createVNode(
395
+ _sfc_main$1,
396
+ mergeProps(_ctx.$attrs, { class: "vv-nav__item-label" }),
397
+ {
398
+ default: withCtx(() => [
399
+ renderSlot(_ctx.$slots, "default")
400
+ ]),
401
+ _: 3
402
+ /* FORWARDED */
403
+ },
404
+ 16
405
+ /* FULL_PROPS */
406
+ )
407
+ ]);
408
+ };
409
+ }
410
+ });
411
+ export {
412
+ _sfc_main as default
413
+ };
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvNavItem=t(e.vue)}(this,(function(e){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),n=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(n||{}),l=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(l||{});const a=Symbol.for("volver"),u=Symbol.for("dropdownTrigger"),i=Symbol.for("dropdownAction"),s={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(l).includes(e)},rel:{type:String,default:"noopener noreferrer"}},d={disabled:Boolean},c={active:Boolean},f={current:Boolean},v={pressed:Boolean},p={label:[String,Number]};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const b={...d,...p,...v,...c,...f,...s,type:{type:String,default:r.button,validator:e=>Object.values(r).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:n.button}};const m=e.defineComponent({name:"VvAction",props:b,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:r}){const l=t,s=e.inject(a),d=e.ref(null);o({$el:d});const{reference:c,bus:f,aria:v,expanded:p}=e.inject(u,{});e.watch((()=>d.value),(e=>{c&&(c.value=e)}));const b=e.computed((()=>l.pressed||(null==p?void 0:p.value))),{role:m}=e.inject(i,{}),g=e.computed((()=>{switch(!0){case l.disabled:return n.button;case void 0!==l.to:return(null==s?void 0:s.nuxt)?n.nuxtLink:n.routerLink;case void 0!==l.href:return n.a;default:return l.defaultTag}})),k=e.computed((()=>{const e={...null==v?void 0:v.value,ariaPressed:!!b.value||void 0,ariaLabel:l.ariaLabel,role:null==m?void 0:m.value};switch(g.value){case n.a:return{...e,href:l.href,target:l.target,rel:l.rel};case n.routerLink:case n.nuxtLink:return{...e,to:l.to,target:l.target};case n.button:return{...e,type:l.type,disabled:l.disabled};default:return e}})),y=e=>{l.disabled?e.preventDefault():(null==f||f.emit("click",e),r("click",e))},B=e=>{null==f||f.emit("mouseover",e),r("mouseover",e)},h=e=>{null==f||f.emit("mouseleave",e),r("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(g)),e.mergeProps(e.unref(k),{ref_key:"element",ref:d,class:{active:t.active,pressed:e.unref(b),disabled:t.disabled,current:t.current},onClickPassive:y,onMouseoverPassive:B,onMouseleavePassive:h}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}}),g={class:"vv-nav__item",role:"presentation"};return e.defineComponent({name:"VvNavItem",inheritAttrs:!1,setup:t=>(t,o)=>(e.openBlock(),e.createElementBlock("li",g,[e.createVNode(m,e.mergeProps(t.$attrs,{class:"vv-nav__item-label"}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default")])),_:3},16)]))})}));
@@ -0,0 +1,24 @@
1
+ import { openBlock, createElementBlock, renderSlot } from "vue";
2
+ const _sfc_main = {
3
+ name: "VvNavSeparator"
4
+ };
5
+ const _export_sfc = (sfc, props) => {
6
+ const target = sfc.__vccOpts || sfc;
7
+ for (const [key, val] of props) {
8
+ target[key] = val;
9
+ }
10
+ return target;
11
+ };
12
+ const _hoisted_1 = {
13
+ class: "vv-nav__separator",
14
+ role: "separator"
15
+ };
16
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
17
+ return openBlock(), createElementBlock("li", _hoisted_1, [
18
+ renderSlot(_ctx.$slots, "default")
19
+ ]);
20
+ }
21
+ const VvNavSeparator = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
22
+ export {
23
+ VvNavSeparator as default
24
+ };
@@ -0,0 +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).VvNavSeparator=o(e.vue)}(this,(function(e){"use strict";const o={class:"vv-nav__separator",role:"separator"};return((e,o)=>{const t=e.__vccOpts||e;for(const[n,r]of o)t[n]=r;return t})({name:"VvNavSeparator"},[["render",function(t,n,r,a,s,f){return e.openBlock(),e.createElementBlock("li",o,[e.renderSlot(t.$slots,"default")])}]])}));
@@ -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";
@@ -79,6 +86,12 @@ const ActiveProps = {
79
86
  */
80
87
  active: Boolean
81
88
  };
89
+ const CurrentProps = {
90
+ /**
91
+ * Whether the item is current
92
+ */
93
+ current: Boolean
94
+ };
82
95
  const PressedProps = {
83
96
  /**
84
97
  * Whether the item is pressed
@@ -209,6 +222,7 @@ const ModifiersProps = {
209
222
  ...LabelProps,
210
223
  ...PressedProps,
211
224
  ...ActiveProps,
225
+ ...CurrentProps,
212
226
  ...LinkProps,
213
227
  /**
214
228
  * Button type
@@ -224,6 +238,13 @@ const ModifiersProps = {
224
238
  ariaLabel: {
225
239
  type: String,
226
240
  default: void 0
241
+ },
242
+ /**
243
+ * Default tag for the action
244
+ */
245
+ defaultTag: {
246
+ type: String,
247
+ default: ActionTag.button
227
248
  }
228
249
  });
229
250
  const VvProgressProps = {
@@ -296,12 +317,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
296
317
  computed(() => ({ indeterminate: indeterminate.value }))
297
318
  );
298
319
  return (_ctx, _cache) => {
299
- return openBlock(), createElementBlock("progress", mergeProps({ role: "progressbar" }, {
300
- class: unref(bemCssClasses),
301
- ariaLabel: unref(ariaLabel),
302
- max: unref(max),
303
- value: unref(value)
304
- }), null, 16);
320
+ return openBlock(), createElementBlock(
321
+ "progress",
322
+ mergeProps({ role: "progressbar" }, {
323
+ class: unref(bemCssClasses),
324
+ ariaLabel: unref(ariaLabel),
325
+ max: unref(max),
326
+ value: unref(value)
327
+ }),
328
+ null,
329
+ 16
330
+ /* FULL_PROPS */
331
+ );
305
332
  };
306
333
  }
307
334
  });
@@ -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).VvProgress=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||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{});Boolean,Boolean,Boolean;const n={modifiers:[String,Array]};t.before,o.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,r.button;const l={...n,value:{type:[Number,String],default:void 0},max:{type:[Number,String]},label:{type:String,required:!0}};return e.defineComponent({name:"VvProgress",props:l,setup(o){const t=o,{value:r,max:n,label:l}=e.toRefs(t),u=e.computed((()=>void 0===t.value)),{modifiers:a}=e.toRefs(t),s=function(o,t,r){return e.computed((()=>{const n={[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&&(n[`${o}--${e}`]=!0)})),r&&Object.keys(r.value).forEach((t=>{n[`${o}--${t}`]=e.unref(r.value[t])})),n}))}("vv-progress",a,e.computed((()=>({indeterminate:u.value}))));return(o,t)=>(e.openBlock(),e.createElementBlock("progress",e.mergeProps({role:"progressbar"},{class:e.unref(s),ariaLabel:e.unref(l),max:e.unref(n),value:e.unref(r)}),null,16))}})}));
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).VvProgress=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||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),n=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(n||{});Boolean,Boolean,Boolean,Boolean;const u={modifiers:[String,Array]};t.before,o.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,r.button,n.button;const l={...u,value:{type:[Number,String],default:void 0},max:{type:[Number,String]},label:{type:String,required:!0}};return e.defineComponent({name:"VvProgress",props:l,setup(o){const t=o,{value:r,max:n,label:u}=e.toRefs(t),l=e.computed((()=>void 0===t.value)),{modifiers:a}=e.toRefs(t),i=function(o,t,r){return e.computed((()=>{const n={[o]:!0},u="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return u&&Array.isArray(u)&&u.forEach((e=>{e&&(n[`${o}--${e}`]=!0)})),r&&Object.keys(r.value).forEach((t=>{n[`${o}--${t}`]=e.unref(r.value[t])})),n}))}("vv-progress",a,e.computed((()=>({indeterminate:l.value}))));return(o,t)=>(e.openBlock(),e.createElementBlock("progress",e.mergeProps({role:"progressbar"},{class:e.unref(i),ariaLabel:e.unref(u),max:e.unref(n),value:e.unref(r)}),null,16))}})}));
@@ -1,5 +1,5 @@
1
1
  import { unref, inject, computed, toRef, toRefs, isRef, defineComponent, h, useSlots, ref, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode, vModelRadio, renderSlot, createTextVNode, toDisplayString, createVNode, createSlots, withCtx, normalizeProps, guardReactiveProps } from "vue";
2
- import { nanoid } from "nanoid";
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";
@@ -115,6 +122,12 @@ const ActiveProps = {
115
122
  */
116
123
  active: Boolean
117
124
  };
125
+ const CurrentProps = {
126
+ /**
127
+ * Whether the item is current
128
+ */
129
+ current: Boolean
130
+ };
118
131
  const PressedProps = {
119
132
  /**
120
133
  * Whether the item is pressed
@@ -298,6 +311,7 @@ const CheckboxRadioProps = {
298
311
  ...LabelProps,
299
312
  ...PressedProps,
300
313
  ...ActiveProps,
314
+ ...CurrentProps,
301
315
  ...LinkProps,
302
316
  /**
303
317
  * Button type
@@ -313,13 +327,20 @@ const CheckboxRadioProps = {
313
327
  ariaLabel: {
314
328
  type: String,
315
329
  default: void 0
330
+ },
331
+ /**
332
+ * Default tag for the action
333
+ */
334
+ defaultTag: {
335
+ type: String,
336
+ default: ActionTag.button
316
337
  }
317
338
  });
318
339
  function equals(obj1, obj2, field) {
319
- if (field)
340
+ if (field) {
320
341
  return resolveFieldData(obj1, field) === resolveFieldData(obj2, field);
321
- else
322
- return deepEquals(obj1, obj2);
342
+ }
343
+ return deepEquals(obj1, obj2);
323
344
  }
324
345
  function deepEquals(a, b) {
325
346
  if (a === b)
@@ -639,7 +660,7 @@ function useDefaults(componentName, propsDefinition, props) {
639
660
  }, {});
640
661
  });
641
662
  }
642
- const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || nanoid()));
663
+ const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || uid()));
643
664
  function useModifiers(prefix, modifiers, others) {
644
665
  return computed(() => {
645
666
  const toReturn = {
@@ -754,12 +775,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
754
775
  [vModelRadio, unref(localModelValue)]
755
776
  ]),
756
777
  renderSlot(_ctx.$slots, "default", { value: unref(modelValue) }, () => [
757
- createTextVNode(toDisplayString(_ctx.label), 1)
778
+ createTextVNode(
779
+ toDisplayString(_ctx.label),
780
+ 1
781
+ /* TEXT */
782
+ )
758
783
  ]),
759
784
  createVNode(unref(HintSlot), {
760
785
  id: unref(hasHintId),
761
786
  class: "vv-radio__hint"
762
- }, createSlots({ _: 2 }, [
787
+ }, createSlots({
788
+ _: 2
789
+ /* DYNAMIC */
790
+ }, [
763
791
  _ctx.$slots.hint ? {
764
792
  name: "hint",
765
793
  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).VvRadio=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("radioGroup"),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]}),f={readonly:Boolean},c={modifiers:[String,Array]},p={hintLabel:{type:String,default:""}};a.before;const b={tabindex:{type:[String,Number],default:0}},m={id:[String,Number]};t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const g={...{...m,name:{type:String,required:!0}},...b,...r,...u,...p,...s,...f,...c,...v,...d,value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String]};function h(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=g;function B(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}function $(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"],A=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"];return e.defineComponent({name:"VvRadio",props:O,emits:["click","update:modelValue","change","blur"],setup(t,{emit:a}){const n=t,o=e.useSlots(),r=$("VvRadio",O,n),{id:u,disabled:d,readonly:s,modelValue:v,valid:f,invalid:c}=function(l,t){const{id:a}=e.toRefs(l),{group:n,isInGroup:o,getGroupOrLocalRef:r}=L(i),u=r("modelValue",l,t),d=r("valid",l),s=r("invalid",l),v=e.computed((()=>{var e;return Boolean(l.readonly||(null==(e=null==n?void 0:n.value)?void 0:e.readonly.value))})),f=e.computed((()=>{var e;return Boolean(l.disabled||(null==(e=null==n?void 0:n.value)?void 0:e.disabled.value))}));return{id:a,group:n,isInGroup:o,modelValue:u,valid:d,invalid:s,readonly:v,disabled:f}}(n,a),p=(t=>e.computed((()=>String((null==t?void 0:t.value)||l.nanoid()))))(u),b=e.computed((()=>`${p.value}-hint`)),m=e.computed((()=>y.value?-1:n.tabindex)),g=e.ref(),y=e.computed((()=>d.value||s.value)),S=e.computed((()=>!0===c.value||!0!==f.value&&void 0)),j=e.computed((()=>Array.isArray(v.value)?function(e,l){if(null!=e&&l&&l.length)for(const t of l)if(h(e,t))return!0;return!1}(n.value,v.value):h(n.value,v.value))),R=e.computed((()=>!["string","number","boolean"].includes(typeof n.value)||n.value)),k=e.computed({get:()=>j.value?R.value:null,set(e){Array.isArray(v.value)?v.value=[n.value]:v.value=n.value,a("change",e)}}),{modifiers:x}=e.toRefs(n),N=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-radio",x,e.computed((()=>({valid:f.value,invalid:c.value,disabled:d.value,readonly:s.value})))),{HintSlot:P,hasHintLabelOrSlot:I,hasInvalidLabelOrSlot:C,hintSlotScope:w}=function(l,t){const a=e.computed((()=>e.isRef(l)?l.value:l)),n=e.computed((()=>B(a.value.invalidLabel))),o=e.computed((()=>B(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))),f=e.computed((()=>d.value||s.value||u.value||v.value)),c=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:f,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:c,HintSlot:p}}(r,o);return(l,t)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(N)),for:e.unref(p)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(p),ref_key:"input",ref:g,"onUpdate:modelValue":t[0]||(t[0]=l=>e.isRef(k)?k.value=l:null),type:"radio",class:"vv-radio__input",name:l.name,disabled:e.unref(y),value:e.unref(R),tabindex:e.unref(m),"aria-invalid":e.unref(S),"aria-describedby":e.unref(I)?e.unref(b):void 0,"aria-errormessage":e.unref(C)?e.unref(b):void 0},null,8,A),[[e.vModelRadio,e.unref(k)]]),e.renderSlot(l.$slots,"default",{value:e.unref(v)},(()=>[e.createTextVNode(e.toDisplayString(l.label),1)])),e.createVNode(e.unref(P),{id:e.unref(b),class:"vv-radio__hint"},e.createSlots({_:2},[l.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(w))))])),key:"0"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(w))))])),key:"1"}:void 0,l.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(w))))])),key:"2"}:void 0,l.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(w))))])),key:"3"}:void 0]),1032,["id"])],10,V))}})}));
1
+ !function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("uid")):"function"==typeof define&&define.amd?define(["vue","uid"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvRadio=l(e.vue,e.uid)}(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||{}),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("radioGroup"),u={valid:Boolean,validLabel:[String,Array]},d={invalid:Boolean,invalidLabel:[String,Array]},s={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},v={disabled:Boolean},f=(Boolean,Boolean,Boolean,{label:[String,Number]}),c={readonly:Boolean},p={modifiers:[String,Array]},b={hintLabel:{type:String,default:""}};a.before;const m={tabindex:{type:[String,Number],default:0}},g={id:[String,Number]};t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const h={...{...g,name:{type:String,required:!0}},...m,...u,...d,...b,...v,...c,...p,...f,...s,value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String]};function y(e,l,t){return t?L(e,t)===L(l,t):S(e,l)}function S(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(!S(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],!S(e[i],l[i]))return!1;return!0}return e!=e&&l!=l}function L(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 O(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,o.button;const B=h;function $(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}function V(l,t,a){const n=e.inject(i),o=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===o.value)return a;const e=o.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 A=["for"],k=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"];return e.defineComponent({name:"VvRadio",props:B,emits:["click","update:modelValue","change","blur"],setup(t,{emit:a}){const n=t,o=e.useSlots(),i=V("VvRadio",B,n),{id:u,disabled:d,readonly:s,modelValue:v,valid:f,invalid:c}=function(l,t){const{id:a}=e.toRefs(l),{group:n,isInGroup:o,getGroupOrLocalRef:i}=O(r),u=i("modelValue",l,t),d=i("valid",l),s=i("invalid",l),v=e.computed((()=>{var e;return Boolean(l.readonly||(null==(e=null==n?void 0:n.value)?void 0:e.readonly.value))})),f=e.computed((()=>{var e;return Boolean(l.disabled||(null==(e=null==n?void 0:n.value)?void 0:e.disabled.value))}));return{id:a,group:n,isInGroup:o,modelValue:u,valid:d,invalid:s,readonly:v,disabled:f}}(n,a),p=(t=>e.computed((()=>String((null==t?void 0:t.value)||l.uid()))))(u),b=e.computed((()=>`${p.value}-hint`)),m=e.computed((()=>h.value?-1:n.tabindex)),g=e.ref(),h=e.computed((()=>d.value||s.value)),S=e.computed((()=>!0===c.value||!0!==f.value&&void 0)),L=e.computed((()=>Array.isArray(v.value)?function(e,l){if(null!=e&&l&&l.length)for(const t of l)if(y(e,t))return!0;return!1}(n.value,v.value):y(n.value,v.value))),j=e.computed((()=>!["string","number","boolean"].includes(typeof n.value)||n.value)),R=e.computed({get:()=>L.value?j.value:null,set(e){Array.isArray(v.value)?v.value=[n.value]:v.value=n.value,a("change",e)}}),{modifiers:x}=e.toRefs(n),N=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-radio",x,e.computed((()=>({valid:f.value,invalid:c.value,disabled:d.value,readonly:s.value})))),{HintSlot:P,hasHintLabelOrSlot:I,hasInvalidLabelOrSlot:C,hintSlotScope:w}=function(l,t){const a=e.computed((()=>e.isRef(l)?l.value:l)),n=e.computed((()=>$(a.value.invalidLabel))),o=e.computed((()=>$(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))),f=e.computed((()=>d.value||s.value||u.value||v.value)),c=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:f,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:c,HintSlot:p}}(i,o);return(l,t)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(N)),for:e.unref(p)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(p),ref_key:"input",ref:g,"onUpdate:modelValue":t[0]||(t[0]=l=>e.isRef(R)?R.value=l:null),type:"radio",class:"vv-radio__input",name:l.name,disabled:e.unref(h),value:e.unref(j),tabindex:e.unref(m),"aria-invalid":e.unref(S),"aria-describedby":e.unref(I)?e.unref(b):void 0,"aria-errormessage":e.unref(C)?e.unref(b):void 0},null,8,k),[[e.vModelRadio,e.unref(R)]]),e.renderSlot(l.$slots,"default",{value:e.unref(v)},(()=>[e.createTextVNode(e.toDisplayString(l.label),1)])),e.createVNode(e.unref(P),{id:e.unref(b),class:"vv-radio__hint"},e.createSlots({_:2},[l.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(w))))])),key:"0"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(w))))])),key:"1"}:void 0,l.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(w))))])),key:"2"}:void 0,l.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(w))))])),key:"3"}:void 0]),1032,["id"])],10,A))}})}));