@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
@@ -1,4 +1,4 @@
1
- import { computed, unref, defineComponent, toRefs, openBlock, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, createBlock, resolveDynamicComponent, mergeProps, withCtx, renderSlot, normalizeProps, guardReactiveProps, createTextVNode, toDisplayString } from "vue";
1
+ import { computed, unref, inject, defineComponent, ref, watch, openBlock, createBlock, resolveDynamicComponent, mergeProps, withCtx, renderSlot, createTextVNode, toDisplayString, toRefs, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, createVNode, normalizeProps, guardReactiveProps } from "vue";
2
2
  function useModifiers(prefix, modifiers, others) {
3
3
  return computed(() => {
4
4
  const toReturn = {
@@ -56,6 +56,13 @@ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
56
56
  ButtonType2["reset"] = "reset";
57
57
  return ButtonType2;
58
58
  })(ButtonType || {});
59
+ var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
60
+ ActionTag2["nuxtLink"] = "nuxt-link";
61
+ ActionTag2["routerLink"] = "router-link";
62
+ ActionTag2["a"] = "a";
63
+ ActionTag2["button"] = "button";
64
+ return ActionTag2;
65
+ })(ActionTag || {});
59
66
  var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
60
67
  AnchorTarget2["_blank"] = "_blank";
61
68
  AnchorTarget2["_self"] = "_self";
@@ -63,6 +70,13 @@ var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
63
70
  AnchorTarget2["_top"] = "_top";
64
71
  return AnchorTarget2;
65
72
  })(AnchorTarget || {});
73
+ const INJECTION_KEY_VOLVER = Symbol.for("volver");
74
+ const INJECTION_KEY_DROPDOWN_TRIGGER = Symbol.for(
75
+ "dropdownTrigger"
76
+ );
77
+ const INJECTION_KEY_DROPDOWN_ACTION = Symbol.for(
78
+ "dropdownAction"
79
+ );
66
80
  const LinkProps = {
67
81
  /**
68
82
  * The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
@@ -102,6 +116,12 @@ const ActiveProps = {
102
116
  */
103
117
  active: Boolean
104
118
  };
119
+ const CurrentProps = {
120
+ /**
121
+ * Whether the item is current
122
+ */
123
+ current: Boolean
124
+ };
105
125
  const PressedProps = {
106
126
  /**
107
127
  * Whether the item is pressed
@@ -227,11 +247,12 @@ const ModifiersProps = {
227
247
  type: Boolean
228
248
  }
229
249
  });
230
- ({
250
+ const ActionProps = {
231
251
  ...DisabledProps,
232
252
  ...LabelProps,
233
253
  ...PressedProps,
234
254
  ...ActiveProps,
255
+ ...CurrentProps,
235
256
  ...LinkProps,
236
257
  /**
237
258
  * Button type
@@ -247,12 +268,149 @@ const ModifiersProps = {
247
268
  ariaLabel: {
248
269
  type: String,
249
270
  default: void 0
271
+ },
272
+ /**
273
+ * Default tag for the action
274
+ */
275
+ defaultTag: {
276
+ type: String,
277
+ default: ActionTag.button
250
278
  }
251
- });
279
+ };
252
280
  const VvBreadcrumbProps = {
253
281
  ...ModifiersProps,
254
282
  routes: Array
255
283
  };
284
+ const VvActionEvents = ["click", "mouseover", "mouseleave"];
285
+ const VvActionProps = ActionProps;
286
+ function useVolver() {
287
+ return inject(INJECTION_KEY_VOLVER);
288
+ }
289
+ function useInjectedDropdownTrigger() {
290
+ return inject(INJECTION_KEY_DROPDOWN_TRIGGER, {});
291
+ }
292
+ function useInjectedDropdownAction() {
293
+ return inject(INJECTION_KEY_DROPDOWN_ACTION, {});
294
+ }
295
+ const __default__$1 = {
296
+ name: "VvAction"
297
+ };
298
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
299
+ ...__default__$1,
300
+ props: VvActionProps,
301
+ emits: VvActionEvents,
302
+ setup(__props, { expose: __expose, emit }) {
303
+ const props = __props;
304
+ const volver = useVolver();
305
+ const element = ref(null);
306
+ __expose({ $el: element });
307
+ const {
308
+ reference: dropdownTriggerReference,
309
+ bus: dropdownEventBus,
310
+ aria: dropdownAria,
311
+ expanded: dropdownExpanded
312
+ } = useInjectedDropdownTrigger();
313
+ watch(
314
+ () => element.value,
315
+ (newValue) => {
316
+ if (dropdownTriggerReference) {
317
+ dropdownTriggerReference.value = newValue;
318
+ }
319
+ }
320
+ );
321
+ const pressed = computed(() => {
322
+ return props.pressed || (dropdownExpanded == null ? void 0 : dropdownExpanded.value);
323
+ });
324
+ const { role } = useInjectedDropdownAction();
325
+ const hasTag = computed(() => {
326
+ switch (true) {
327
+ case props.disabled:
328
+ return ActionTag.button;
329
+ case props.to !== void 0:
330
+ return (volver == null ? void 0 : volver.nuxt) ? ActionTag.nuxtLink : ActionTag.routerLink;
331
+ case props.href !== void 0:
332
+ return ActionTag.a;
333
+ default:
334
+ return props.defaultTag;
335
+ }
336
+ });
337
+ const hasProps = computed(() => {
338
+ const toReturn = {
339
+ ...dropdownAria == null ? void 0 : dropdownAria.value,
340
+ ariaPressed: pressed.value ? true : void 0,
341
+ ariaLabel: props.ariaLabel,
342
+ role: role == null ? void 0 : role.value
343
+ };
344
+ switch (hasTag.value) {
345
+ case ActionTag.a:
346
+ return {
347
+ ...toReturn,
348
+ href: props.href,
349
+ target: props.target,
350
+ rel: props.rel
351
+ };
352
+ case ActionTag.routerLink:
353
+ case ActionTag.nuxtLink:
354
+ return {
355
+ ...toReturn,
356
+ to: props.to,
357
+ target: props.target
358
+ };
359
+ case ActionTag.button:
360
+ return {
361
+ ...toReturn,
362
+ type: props.type,
363
+ disabled: props.disabled
364
+ };
365
+ default:
366
+ return toReturn;
367
+ }
368
+ });
369
+ const onClick = (e) => {
370
+ if (props.disabled) {
371
+ e.preventDefault();
372
+ return;
373
+ }
374
+ dropdownEventBus == null ? void 0 : dropdownEventBus.emit("click", e);
375
+ emit("click", e);
376
+ };
377
+ const onMouseover = (e) => {
378
+ dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseover", e);
379
+ emit("mouseover", e);
380
+ };
381
+ const onMouseleave = (e) => {
382
+ dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseleave", e);
383
+ emit("mouseleave", e);
384
+ };
385
+ return (_ctx, _cache) => {
386
+ return openBlock(), createBlock(resolveDynamicComponent(unref(hasTag)), mergeProps(unref(hasProps), {
387
+ ref_key: "element",
388
+ ref: element,
389
+ class: {
390
+ active: _ctx.active,
391
+ pressed: unref(pressed),
392
+ disabled: _ctx.disabled,
393
+ current: _ctx.current
394
+ },
395
+ onClickPassive: onClick,
396
+ onMouseoverPassive: onMouseover,
397
+ onMouseleavePassive: onMouseleave
398
+ }), {
399
+ default: withCtx(() => [
400
+ renderSlot(_ctx.$slots, "default", {}, () => [
401
+ createTextVNode(
402
+ toDisplayString(_ctx.label),
403
+ 1
404
+ /* TEXT */
405
+ )
406
+ ])
407
+ ]),
408
+ _: 3
409
+ /* FORWARDED */
410
+ }, 16, ["class"]);
411
+ };
412
+ }
413
+ });
256
414
  const _hoisted_1 = { class: "vv-breadcrumb__list" };
257
415
  const _hoisted_2 = ["content"];
258
416
  const __default__ = {
@@ -265,46 +423,71 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
265
423
  const props = __props;
266
424
  const { modifiers } = toRefs(props);
267
425
  const bemCssClasses = useModifiers("vv-breadcrumb", modifiers);
426
+ const length = computed(() => {
427
+ var _a;
428
+ return ((_a = props.routes) == null ? void 0 : _a.length) ?? 0;
429
+ });
430
+ const isLast = (index) => index === length.value - 1;
268
431
  return (_ctx, _cache) => {
269
- return openBlock(), createElementBlock("nav", {
270
- class: normalizeClass(unref(bemCssClasses)),
271
- "aria-label": "breadcrumbs"
272
- }, [
273
- createElementVNode("ol", _hoisted_1, [
274
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.routes, (route, index) => {
275
- var _a, _b, _c, _d;
276
- return openBlock(), createElementBlock("li", {
277
- key: `${route.label}-${index}`,
278
- class: normalizeClass({
279
- "vv-breadcrumb__item": index < Number((_a = _ctx.routes) == null ? void 0 : _a.length) - 1,
280
- "vv-breadcrumb__item-active": index === Number((_b = _ctx.routes) == null ? void 0 : _b.length) - 1
432
+ return openBlock(), createElementBlock(
433
+ "nav",
434
+ {
435
+ class: normalizeClass(unref(bemCssClasses)),
436
+ "aria-label": "breadcrumbs"
437
+ },
438
+ [
439
+ createElementVNode("ol", _hoisted_1, [
440
+ (openBlock(true), createElementBlock(
441
+ Fragment,
442
+ null,
443
+ renderList(_ctx.routes, ({ label, ...route }, index) => {
444
+ return openBlock(), createElementBlock(
445
+ "li",
446
+ {
447
+ key: `${label}-${index}`,
448
+ class: normalizeClass(
449
+ !isLast(index) ? "vv-breadcrumb__item" : "vv-breadcrumb__item-active"
450
+ ),
451
+ itemprop: "itemListElement",
452
+ itemtype: "https://schema.org/ListItem",
453
+ itemscope: ""
454
+ },
455
+ [
456
+ createVNode(_sfc_main$1, mergeProps(route, {
457
+ class: !isLast(index) ? "vv-breadcrumb__link" : "vv-breadcrumb__label",
458
+ "aria-current": isLast(index) ? "page" : void 0,
459
+ itemprop: "item",
460
+ "default-tag": "span"
461
+ }), {
462
+ default: withCtx(() => [
463
+ renderSlot(_ctx.$slots, "label", normalizeProps(guardReactiveProps({ route, index })), () => [
464
+ createTextVNode(
465
+ toDisplayString(label),
466
+ 1
467
+ /* TEXT */
468
+ )
469
+ ])
470
+ ]),
471
+ _: 2
472
+ /* DYNAMIC */
473
+ }, 1040, ["class", "aria-current"]),
474
+ createElementVNode("meta", {
475
+ itemprop: "position",
476
+ content: `${index + 1}`
477
+ }, null, 8, _hoisted_2)
478
+ ],
479
+ 2
480
+ /* CLASS */
481
+ );
281
482
  }),
282
- itemprop: "itemListElement",
283
- itemtype: "https://schema.org/ListItem",
284
- itemscope: ""
285
- }, [
286
- (openBlock(), createBlock(resolveDynamicComponent(route.to ? "router-link" : route.href ? "a" : "span"), mergeProps(route, {
287
- class: {
288
- "vv-breadcrumb__link": index < Number((_c = _ctx.routes) == null ? void 0 : _c.length) - 1
289
- },
290
- "aria-current": index === Number((_d = _ctx.routes) == null ? void 0 : _d.length) - 1 ? "page" : void 0,
291
- itemprop: "item"
292
- }), {
293
- default: withCtx(() => [
294
- renderSlot(_ctx.$slots, "label", normalizeProps(guardReactiveProps({ route, index })), () => [
295
- createTextVNode(toDisplayString(route.label), 1)
296
- ])
297
- ]),
298
- _: 2
299
- }, 1040, ["class", "aria-current"])),
300
- createElementVNode("meta", {
301
- itemprop: "position",
302
- content: `${index + 1}`
303
- }, null, 8, _hoisted_2)
304
- ], 2);
305
- }), 128))
306
- ])
307
- ], 2);
483
+ 128
484
+ /* KEYED_FRAGMENT */
485
+ ))
486
+ ])
487
+ ],
488
+ 2
489
+ /* CLASS */
490
+ );
308
491
  };
309
492
  }
310
493
  });
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvBreadcrumb=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||{});Boolean,Boolean,Boolean;const n={modifiers:[String,Array]};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,r.button;const l={...n,routes:Array},a={class:"vv-breadcrumb__list"},i=["content"];return e.defineComponent({name:"VvBreadcrumb",props:l,setup(t){const o=t,{modifiers:r}=e.toRefs(o),n=function(t,o,r){return e.computed((()=>{const n={[t]:!0},l="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(n[`${t}--${e}`]=!0)})),r&&Object.keys(r.value).forEach((o=>{n[`${t}--${o}`]=e.unref(r.value[o])})),n}))}("vv-breadcrumb",r);return(t,o)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(n)),"aria-label":"breadcrumbs"},[e.createElementVNode("ol",a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.routes,((o,r)=>{var n,l,a,u;return e.openBlock(),e.createElementBlock("li",{key:`${o.label}-${r}`,class:e.normalizeClass({"vv-breadcrumb__item":r<Number(null==(n=t.routes)?void 0:n.length)-1,"vv-breadcrumb__item-active":r===Number(null==(l=t.routes)?void 0:l.length)-1}),itemprop:"itemListElement",itemtype:"https://schema.org/ListItem",itemscope:""},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.to?"router-link":o.href?"a":"span"),e.mergeProps(o,{class:{"vv-breadcrumb__link":r<Number(null==(a=t.routes)?void 0:a.length)-1},"aria-current":r===Number(null==(u=t.routes)?void 0:u.length)-1?"page":void 0,itemprop:"item"}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"label",e.normalizeProps(e.guardReactiveProps({route:o,index:r})),(()=>[e.createTextVNode(e.toDisplayString(o.label),1)]))])),_:2},1040,["class","aria-current"])),e.createElementVNode("meta",{itemprop:"position",content:`${r+1}`},null,8,i)],2)})),128))])],2))}})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvBreadcrumb=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||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),o=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(o||{}),a=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(a||{}),n=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(n||{});const l=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(n).includes(e)},rel:{type:String,default:"noopener noreferrer"}},c={disabled:Boolean},d={active:Boolean},m={current:Boolean},v={pressed:Boolean},p={label:[String,Number]},b={modifiers:[String,Array]};r.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const f={...c,...p,...v,...d,...m,...s,type:{type:String,default:o.button,validator:e=>Object.values(o).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:a.button}},g={...b,routes:Array},y=f;const k=e.defineComponent({name:"VvAction",props:y,emits:["click","mouseover","mouseleave"],setup(t,{expose:r,emit:o}){const n=t,s=e.inject(l),c=e.ref(null);r({$el:c});const{reference:d,bus:m,aria:v,expanded:p}=e.inject(u,{});e.watch((()=>c.value),(e=>{d&&(d.value=e)}));const b=e.computed((()=>n.pressed||(null==p?void 0:p.value))),{role:f}=e.inject(i,{}),g=e.computed((()=>{switch(!0){case n.disabled:return a.button;case void 0!==n.to:return(null==s?void 0:s.nuxt)?a.nuxtLink:a.routerLink;case void 0!==n.href:return a.a;default:return n.defaultTag}})),y=e.computed((()=>{const e={...null==v?void 0:v.value,ariaPressed:!!b.value||void 0,ariaLabel:n.ariaLabel,role:null==f?void 0:f.value};switch(g.value){case a.a:return{...e,href:n.href,target:n.target,rel:n.rel};case a.routerLink:case a.nuxtLink:return{...e,to:n.to,target:n.target};case a.button:return{...e,type:n.type,disabled:n.disabled};default:return e}})),k=e=>{n.disabled?e.preventDefault():(null==m||m.emit("click",e),o("click",e))},B=e=>{null==m||m.emit("mouseover",e),o("mouseover",e)},_=e=>{null==m||m.emit("mouseleave",e),o("mouseleave",e)};return(t,r)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(g)),e.mergeProps(e.unref(y),{ref_key:"element",ref:c,class:{active:t.active,pressed:e.unref(b),disabled:t.disabled,current:t.current},onClickPassive:k,onMouseoverPassive:B,onMouseleavePassive:_}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}}),B={class:"vv-breadcrumb__list"},_=["content"];return e.defineComponent({name:"VvBreadcrumb",props:g,setup(t){const r=t,{modifiers:o}=e.toRefs(r),a=function(t,r,o){return e.computed((()=>{const a={[t]:!0},n="string"==typeof(null==r?void 0:r.value)?r.value.split(" "):null==r?void 0:r.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(a[`${t}--${e}`]=!0)})),o&&Object.keys(o.value).forEach((r=>{a[`${t}--${r}`]=e.unref(o.value[r])})),a}))}("vv-breadcrumb",o),n=e.computed((()=>{var e;return(null==(e=r.routes)?void 0:e.length)??0})),l=e=>e===n.value-1;return(t,r)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(a)),"aria-label":"breadcrumbs"},[e.createElementVNode("ol",B,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.routes,(({label:r,...o},a)=>(e.openBlock(),e.createElementBlock("li",{key:`${r}-${a}`,class:e.normalizeClass(l(a)?"vv-breadcrumb__item-active":"vv-breadcrumb__item"),itemprop:"itemListElement",itemtype:"https://schema.org/ListItem",itemscope:""},[e.createVNode(k,e.mergeProps(o,{class:l(a)?"vv-breadcrumb__label":"vv-breadcrumb__link","aria-current":l(a)?"page":void 0,itemprop:"item","default-tag":"span"}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"label",e.normalizeProps(e.guardReactiveProps({route:o,index:a})),(()=>[e.createTextVNode(e.toDisplayString(r),1)]))])),_:2},1040,["class","aria-current"]),e.createElementVNode("meta",{itemprop:"position",content:`${a+1}`},null,8,_)],2)))),128))])],2))}})}));
@@ -1,12 +1,23 @@
1
1
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
2
- routes: globalThis.PropType<import(".").Route[]>;
2
+ routes: globalThis.PropType<import("../..").NavItem[]>;
3
3
  modifiers: globalThis.PropType<string | string[]>;
4
4
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
5
- routes: globalThis.PropType<import(".").Route[]>;
5
+ routes: globalThis.PropType<import("../..").NavItem[]>;
6
6
  modifiers: globalThis.PropType<string | string[]>;
7
7
  }>>, {}, {}>, {
8
8
  label?(_: {
9
- route: import(".").Route;
9
+ route: {
10
+ ariaLabel?: string | undefined;
11
+ title?: string | undefined;
12
+ to?: string | Record<string, unknown> | undefined;
13
+ href?: string | undefined;
14
+ target?: "_blank" | "_self" | "_parent" | "_top" | undefined;
15
+ rel?: string | undefined;
16
+ disabled?: boolean | undefined;
17
+ current?: boolean | undefined;
18
+ class?: string | string[] | undefined;
19
+ on?: Record<string, () => void> | undefined;
20
+ };
10
21
  index: number;
11
22
  }): any;
12
23
  }>;
@@ -1,12 +1,5 @@
1
- export interface Route {
2
- label: string;
3
- to?: string | {
4
- [key: string]: unknown;
5
- };
6
- title?: string;
7
- href?: string;
8
- }
1
+ import type { NavItem } from '../../types';
9
2
  export declare const VvBreadcrumbProps: {
10
- routes: globalThis.PropType<Route[]>;
3
+ routes: globalThis.PropType<NavItem[]>;
11
4
  modifiers: globalThis.PropType<string | string[]>;
12
5
  };
@@ -1,6 +1,6 @@
1
1
  import { inject, computed, unref, defineComponent, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, watch, resolveDynamicComponent, withCtx, renderSlot, createTextVNode, toDisplayString, toRef, useAttrs, useSlots, createElementBlock, Fragment } from "vue";
2
2
  import { iconExists, Icon, addIcon } from "@iconify/vue";
3
- import { nanoid } from "nanoid";
3
+ import { uid } from "uid";
4
4
  const VvIconProps = {
5
5
  /**
6
6
  * Color
@@ -269,7 +269,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
269
269
  color: _ctx.color,
270
270
  onLoad: _ctx.onLoad,
271
271
  icon: unref(icon)
272
- }), null, 16, ["class"])) : createCommentVNode("", true);
272
+ }), null, 16, ["class"])) : createCommentVNode("v-if", true);
273
273
  };
274
274
  }
275
275
  });
@@ -325,6 +325,12 @@ const ActiveProps = {
325
325
  */
326
326
  active: Boolean
327
327
  };
328
+ const CurrentProps = {
329
+ /**
330
+ * Whether the item is current
331
+ */
332
+ current: Boolean
333
+ };
328
334
  const PressedProps = {
329
335
  /**
330
336
  * Whether the item is pressed
@@ -468,6 +474,7 @@ const ActionProps = {
468
474
  ...LabelProps,
469
475
  ...PressedProps,
470
476
  ...ActiveProps,
477
+ ...CurrentProps,
471
478
  ...LinkProps,
472
479
  /**
473
480
  * Button type
@@ -483,6 +490,13 @@ const ActionProps = {
483
490
  ariaLabel: {
484
491
  type: String,
485
492
  default: void 0
493
+ },
494
+ /**
495
+ * Default tag for the action
496
+ */
497
+ defaultTag: {
498
+ type: String,
499
+ default: ActionTag.button
486
500
  }
487
501
  };
488
502
  const VvActionEvents = ["click", "mouseover", "mouseleave"];
@@ -532,7 +546,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
532
546
  case props.href !== void 0:
533
547
  return ActionTag.a;
534
548
  default:
535
- return ActionTag.button;
549
+ return props.defaultTag;
536
550
  }
537
551
  });
538
552
  const hasProps = computed(() => {
@@ -557,12 +571,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
557
571
  to: props.to,
558
572
  target: props.target
559
573
  };
560
- default:
574
+ case ActionTag.button:
561
575
  return {
562
576
  ...toReturn,
563
577
  type: props.type,
564
578
  disabled: props.disabled
565
579
  };
580
+ default:
581
+ return toReturn;
566
582
  }
567
583
  });
568
584
  const onClick = (e) => {
@@ -588,7 +604,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
588
604
  class: {
589
605
  active: _ctx.active,
590
606
  pressed: unref(pressed),
591
- disabled: _ctx.disabled
607
+ disabled: _ctx.disabled,
608
+ current: _ctx.current
592
609
  },
593
610
  onClickPassive: onClick,
594
611
  onMouseoverPassive: onMouseover,
@@ -596,19 +613,24 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
596
613
  }), {
597
614
  default: withCtx(() => [
598
615
  renderSlot(_ctx.$slots, "default", {}, () => [
599
- createTextVNode(toDisplayString(_ctx.label), 1)
616
+ createTextVNode(
617
+ toDisplayString(_ctx.label),
618
+ 1
619
+ /* TEXT */
620
+ )
600
621
  ])
601
622
  ]),
602
623
  _: 3
624
+ /* FORWARDED */
603
625
  }, 16, ["class"]);
604
626
  };
605
627
  }
606
628
  });
607
629
  function equals(obj1, obj2, field) {
608
- if (field)
630
+ if (field) {
609
631
  return resolveFieldData(obj1, field) === resolveFieldData(obj2, field);
610
- else
611
- return deepEquals(obj1, obj2);
632
+ }
633
+ return deepEquals(obj1, obj2);
612
634
  }
613
635
  function deepEquals(a, b) {
614
636
  if (a === b)
@@ -822,7 +844,7 @@ function useGroupProps(props, emit) {
822
844
  label
823
845
  };
824
846
  }
825
- const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || nanoid()));
847
+ const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || uid()));
826
848
  const _hoisted_1 = {
827
849
  key: 1,
828
850
  class: "vv-button__label"
@@ -937,24 +959,47 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
937
959
  key: 0,
938
960
  class: "vv-button__loading-icon",
939
961
  name: _ctx.loadingIcon
940
- }, null, 8, ["name"])) : createCommentVNode("", true),
941
- _ctx.loadingLabel ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(_ctx.loadingLabel), 1)) : createCommentVNode("", true)
942
- ]) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
943
- renderSlot(_ctx.$slots, "before"),
944
- unref(icon) ? (openBlock(), createBlock(_sfc_main$2, mergeProps({
945
- key: 0,
946
- class: "vv-button__icon"
947
- }, unref(hasIconProps)), null, 16)) : createCommentVNode("", true),
948
- unref(label) ? (openBlock(), createElementBlock("span", _hoisted_2, [
949
- renderSlot(_ctx.$slots, "label", {}, () => [
950
- createTextVNode(toDisplayString(unref(label)), 1)
951
- ])
952
- ])) : createCommentVNode("", true),
953
- renderSlot(_ctx.$slots, "after")
954
- ], 64))
962
+ }, null, 8, ["name"])) : createCommentVNode("v-if", true),
963
+ _ctx.loadingLabel ? (openBlock(), createElementBlock(
964
+ "span",
965
+ _hoisted_1,
966
+ toDisplayString(_ctx.loadingLabel),
967
+ 1
968
+ /* TEXT */
969
+ )) : createCommentVNode("v-if", true)
970
+ ]) : (openBlock(), createElementBlock(
971
+ Fragment,
972
+ { key: 1 },
973
+ [
974
+ renderSlot(_ctx.$slots, "before"),
975
+ unref(icon) ? (openBlock(), createBlock(
976
+ _sfc_main$2,
977
+ mergeProps({
978
+ key: 0,
979
+ class: "vv-button__icon"
980
+ }, unref(hasIconProps)),
981
+ null,
982
+ 16
983
+ /* FULL_PROPS */
984
+ )) : createCommentVNode("v-if", true),
985
+ unref(label) ? (openBlock(), createElementBlock("span", _hoisted_2, [
986
+ renderSlot(_ctx.$slots, "label", {}, () => [
987
+ createTextVNode(
988
+ toDisplayString(unref(label)),
989
+ 1
990
+ /* TEXT */
991
+ )
992
+ ])
993
+ ])) : createCommentVNode("v-if", true),
994
+ renderSlot(_ctx.$slots, "after")
995
+ ],
996
+ 64
997
+ /* STABLE_FRAGMENT */
998
+ ))
955
999
  ])
956
1000
  ]),
957
1001
  _: 3
1002
+ /* FORWARDED */
958
1003
  }, 16, ["id", "class"]);
959
1004
  };
960
1005
  }
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@iconify/vue"),require("nanoid")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","nanoid"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvButton=t(e.vue,e.vue$1,e.nanoid)}(this,(function(e,t,o){"use strict";const n={color:String,width:{type:[String,Number]},height:{type:[String,Number]},name:{type:String,required:!0},provider:{type:String},prefix:{type:String,default:"normal"},src:String,horizontalFlip:Boolean,verticalFlip:Boolean,flip:String,mode:String,inline:Boolean,rotate:[Number,String],onLoad:Function,svg:String,modifiers:{type:[String,Array]}};var r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),l=(e=>(e.before="before",e.after="after",e))(l||{}),i=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(i||{}),a=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(a||{}),u=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(u||{});const s=Symbol.for("volver"),c=Symbol.for("buttonGroup"),d=Symbol.for("dropdownTrigger"),f=Symbol.for("dropdownAction");function v(){return e.inject(s)}function p(t,o,n){return e.computed((()=>{const r={[t]:!0},l="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(r[`${t}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((o=>{r[`${t}--${o}`]=e.unref(n.value[o])})),r}))}const m=e.defineComponent({name:"VvIcon",props:n,setup(o){const n=o,r=e.computed((()=>"string"==typeof n.rotate?parseFloat(n.rotate):n.rotate)),l=e.ref(!0),i=v(),{modifiers:a}=e.toRefs(n),u=p("vv-icon",a),s=e.computed((()=>n.provider||(null==i?void 0:i.iconsProvider))),c=e.computed((()=>{const e=n.name??"",o=`@${s.value}:${n.prefix}:${e}`;if(t.iconExists(o))return o;const r=null==i?void 0:i.iconsCollections.find((o=>{const n=`@${s.value}:${o.prefix}:${e}`;return t.iconExists(n)}));return r?`@${s.value}:${r.prefix}:${e}`:e}));function d(e){const o=function(e){let t;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");t=(new e).window}return(t?new t.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),r=(null==o?void 0:o.innerHTML.trim())||"";o&&r&&t.addIcon(`@${s.value}:${n.prefix}:${n.name}`,{body:r,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return i&&n.src&&!t.iconExists(`@${s.value}:${n.prefix}:${n.name}`)&&(l.value=!1,i.fetchIcon(n.src).then((e=>{e&&(d(e),l.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),n.svg&&d(n.svg),(o,n)=>e.unref(l)?(e.openBlock(),e.createBlock(e.unref(t.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:o.inline,width:o.width,height:o.height,horizontalFlip:o.horizontalFlip,verticalFlip:o.verticalFlip,flip:o.flip,rotate:e.unref(r),color:o.color,onLoad:o.onLoad,icon:e.unref(c)}),null,16,["class"])):e.createCommentVNode("",!0)}}),g={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(u).includes(e)},rel:{type:String,default:"noopener noreferrer"}},b={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},y={disabled:Boolean},h={active:Boolean},S={pressed:Boolean},k={label:[String,Number]},B={modifiers:[String,Array]};l.before;const $={unselectable:{type:Boolean,default:!0}},x={id:[String,Number]};r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const w={...y,...k,...S,...h,...g,type:{type:String,default:i.button,validator:e=>Object.values(i).includes(e)},ariaLabel:{type:String,default:void 0}},A=w;const L=e.defineComponent({name:"VvAction",props:A,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:n}){const r=t,l=v(),i=e.ref(null);o({$el:i});const{reference:u,bus:s,aria:c,expanded:p}=e.inject(d,{});e.watch((()=>i.value),(e=>{u&&(u.value=e)}));const m=e.computed((()=>r.pressed||(null==p?void 0:p.value))),{role:g}=e.inject(f,{}),b=e.computed((()=>{switch(!0){case r.disabled:return a.button;case void 0!==r.to:return(null==l?void 0:l.nuxt)?a.nuxtLink:a.routerLink;case void 0!==r.href:return a.a;default:return a.button}})),y=e.computed((()=>{const e={...null==c?void 0:c.value,ariaPressed:!!m.value||void 0,ariaLabel:r.ariaLabel,role:null==g?void 0:g.value};switch(b.value){case a.a:return{...e,href:r.href,target:r.target,rel:r.rel};case a.routerLink:case a.nuxtLink:return{...e,to:r.to,target:r.target};default:return{...e,type:r.type,disabled:r.disabled}}})),h=e=>{r.disabled?e.preventDefault():(null==s||s.emit("click",e),n("click",e))},S=e=>{null==s||s.emit("mouseover",e),n("mouseover",e)},k=e=>{null==s||s.emit("mouseleave",e),n("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(b)),e.mergeProps(e.unref(y),{ref_key:"element",ref:i,class:{active:t.active,pressed:e.unref(m),disabled:t.disabled},onClickPassive:h,onMouseoverPassive:S,onMouseleavePassive:k}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}});function j(e,t,o){return o?_(e,o)===_(t,o):V(e,t)}function V(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const o=Array.isArray(e),n=Array.isArray(t);let r,l,i;if(o&&n){if(l=e.length,l!=t.length)return!1;for(r=l;0!=r--;)if(!V(e[r],t[r]))return!1;return!0}if(o!=n)return!1;const a=e instanceof Date,u=t instanceof Date;if(a!=u)return!1;if(a&&u)return e.getTime()==t.getTime();const s=e instanceof RegExp,c=t instanceof RegExp;if(s!=c)return!1;if(s&&c)return e.toString()==t.toString();const d=Object.keys(e);if(l=d.length,l!==Object.keys(t).length)return!1;for(r=l;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,d[r]))return!1;for(r=l;0!=r--;)if(i=d[r],!V(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function _(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const o=t.split(".");let n=e;for(let t=0,r=o.length;t<r;++t){if(null==e)return null;n=n[o[t]]}return n}}return null}function O(e,t){if(null!=e&&t&&t.length)for(const o of t)if(j(e,o))return!0;return!1}function P(t){const o=e.inject(t,void 0),n=e.computed((()=>{return t=o,!(null==(n=e.unref(t))||""===n||Array.isArray(n)&&0===n.length||!(n instanceof Date)&&"object"==typeof n&&0===Object.keys(n).length);var t,n}));return{group:o,isInGroup:n,getGroupOrLocalRef:function(t,n,r){if(null==o?void 0:o.value){const n=e.unref(o.value)[t];return e.computed({get:()=>null==n?void 0:n.value,set(e){n.value=e}})}const l=e.toRef(n,t);return e.computed({get:()=>l.value,set(e){r&&r(`update:${t}`,e)}})}}}const N={...w,...x,...B,...$,...b,icon:[String,Object],iconPosition:{type:String,default:r.left,validator:e=>Object.values(r).includes(e)},loadingIcon:{type:String,default:"eos-icons:bubble-loading"},toggle:{type:Boolean,default:!1},value:{type:[String,Number,Boolean],default:void 0},uncheckedValue:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[String,Number,Boolean],default:void 0}};const C={key:1,class:"vv-button__label"},E={key:1,class:"vv-button__label"};return e.defineComponent({name:"VvButton",props:N,emits:["update:modelValue"],setup(t,{expose:n,emit:l}){const i=t,a=e.useAttrs(),u=e.useSlots(),{id:s,modifiers:d,iconPosition:f,icon:v,label:g,modelValue:b,disabled:y,toggle:h,unselectable:S}=function(t,o){const{group:n,isInGroup:r,getGroupOrLocalRef:l}=P(c),{id:i,iconPosition:a,icon:u,label:s,pressed:d}=e.toRefs(t),f=l("modelValue",t,o),v=l("toggle",t),p=l("unselectable",t),m=e.computed((()=>(null==n?void 0:n.value.multiple.value)??!1)),g=e.computed((()=>{let e=t.modifiers,o=null==n?void 0:n.value.modifiers.value;const r=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>r.add(e)))),o&&(Array.isArray(o)||(o=o.split(" ")),o.forEach((e=>r.add(e)))),Array.from(r)})),b=e.computed((()=>{var e;return Boolean(t.disabled||(null==(e=null==n?void 0:n.value)?void 0:e.disabled.value))}));return{group:n,isInGroup:r,modelValue:f,toggle:v,unselectable:p,multiple:m,modifiers:g,disabled:b,id:i,pressed:d,iconPosition:a,icon:u,label:s}}(i,l),k=(t=>e.computed((()=>String((null==t?void 0:t.value)||o.nanoid()))))(s),B=e.computed((()=>(null==a?void 0:a.name)||k.value)),$=e.ref(null);n({$el:e.computed((()=>{var e;return null==(e=$.value)?void 0:e.$el}))});const x=e.computed((()=>h.value?Array.isArray(b.value)?O(B.value,b.value):j(B.value,b.value):i.pressed)),w=p("vv-button",d,e.computed((()=>({reverse:[r.right,r.bottom].includes(f.value),column:[r.top,r.bottom].includes(f.value),"icon-only":Boolean((null==v?void 0:v.value)&&!(null==g?void 0:g.value)&&!u.default)})))),A=e.computed((()=>"string"==typeof(null==v?void 0:v.value)?{name:null==v?void 0:v.value}:null==v?void 0:v.value)),V=e.computed((()=>void 0!==i.value?i.value:B.value)),_=()=>{if(h.value){if(Array.isArray(b.value))return O(V.value,b.value)?void(S.value&&(b.value=b.value.filter((e=>e!==V.value)))):void b.value.push(V.value);if(V.value===b.value&&S.value)return void(b.value=i.uncheckedValue);b.value=V.value}};return(t,o)=>(e.openBlock(),e.createBlock(L,e.mergeProps({disabled:e.unref(y),pressed:e.unref(x),active:t.active,type:t.type,to:t.to,href:t.href,target:t.target,rel:t.rel,ariaLabel:t.ariaLabel},{id:e.unref(k),ref_key:"element",ref:$,class:e.unref(w),onClick:_}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[t.loading?e.renderSlot(t.$slots,"loading",{key:0},(()=>[t.loadingIcon?(e.openBlock(),e.createBlock(m,{key:0,class:"vv-button__loading-icon",name:t.loadingIcon},null,8,["name"])):e.createCommentVNode("",!0),t.loadingLabel?(e.openBlock(),e.createElementBlock("span",C,e.toDisplayString(t.loadingLabel),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(t.$slots,"before"),e.unref(v)?(e.openBlock(),e.createBlock(m,e.mergeProps({key:0,class:"vv-button__icon"},e.unref(A)),null,16)):e.createCommentVNode("",!0),e.unref(g)?(e.openBlock(),e.createElementBlock("span",E,[e.renderSlot(t.$slots,"label",{},(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)),1)]))])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"after")],64))]))])),_:3},16,["id","class"]))}})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@iconify/vue"),require("uid")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","uid"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvButton=t(e.vue,e.vue$1,e.uid)}(this,(function(e,t,o){"use strict";const n={color:String,width:{type:[String,Number]},height:{type:[String,Number]},name:{type:String,required:!0},provider:{type:String},prefix:{type:String,default:"normal"},src:String,horizontalFlip:Boolean,verticalFlip:Boolean,flip:String,mode:String,inline:Boolean,rotate:[Number,String],onLoad:Function,svg:String,modifiers:{type:[String,Array]}};var r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),l=(e=>(e.before="before",e.after="after",e))(l||{}),i=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(i||{}),a=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(a||{}),u=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(u||{});const s=Symbol.for("volver"),c=Symbol.for("buttonGroup"),d=Symbol.for("dropdownTrigger"),f=Symbol.for("dropdownAction");function v(){return e.inject(s)}function p(t,o,n){return e.computed((()=>{const r={[t]:!0},l="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(r[`${t}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((o=>{r[`${t}--${o}`]=e.unref(n.value[o])})),r}))}const m=e.defineComponent({name:"VvIcon",props:n,setup(o){const n=o,r=e.computed((()=>"string"==typeof n.rotate?parseFloat(n.rotate):n.rotate)),l=e.ref(!0),i=v(),{modifiers:a}=e.toRefs(n),u=p("vv-icon",a),s=e.computed((()=>n.provider||(null==i?void 0:i.iconsProvider))),c=e.computed((()=>{const e=n.name??"",o=`@${s.value}:${n.prefix}:${e}`;if(t.iconExists(o))return o;const r=null==i?void 0:i.iconsCollections.find((o=>{const n=`@${s.value}:${o.prefix}:${e}`;return t.iconExists(n)}));return r?`@${s.value}:${r.prefix}:${e}`:e}));function d(e){const o=function(e){let t;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");t=(new e).window}return(t?new t.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),r=(null==o?void 0:o.innerHTML.trim())||"";o&&r&&t.addIcon(`@${s.value}:${n.prefix}:${n.name}`,{body:r,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return i&&n.src&&!t.iconExists(`@${s.value}:${n.prefix}:${n.name}`)&&(l.value=!1,i.fetchIcon(n.src).then((e=>{e&&(d(e),l.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),n.svg&&d(n.svg),(o,n)=>e.unref(l)?(e.openBlock(),e.createBlock(e.unref(t.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:o.inline,width:o.width,height:o.height,horizontalFlip:o.horizontalFlip,verticalFlip:o.verticalFlip,flip:o.flip,rotate:e.unref(r),color:o.color,onLoad:o.onLoad,icon:e.unref(c)}),null,16,["class"])):e.createCommentVNode("v-if",!0)}}),g={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(u).includes(e)},rel:{type:String,default:"noopener noreferrer"}},b={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},y={disabled:Boolean},h={active:Boolean},S={current:Boolean},k={pressed:Boolean},B={label:[String,Number]},$={modifiers:[String,Array]};l.before;const x={unselectable:{type:Boolean,default:!0}},w={id:[String,Number]};r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const A={...y,...B,...k,...h,...S,...g,type:{type:String,default:i.button,validator:e=>Object.values(i).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:a.button}},L=A;const j=e.defineComponent({name:"VvAction",props:L,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:n}){const r=t,l=v(),i=e.ref(null);o({$el:i});const{reference:u,bus:s,aria:c,expanded:p}=e.inject(d,{});e.watch((()=>i.value),(e=>{u&&(u.value=e)}));const m=e.computed((()=>r.pressed||(null==p?void 0:p.value))),{role:g}=e.inject(f,{}),b=e.computed((()=>{switch(!0){case r.disabled:return a.button;case void 0!==r.to:return(null==l?void 0:l.nuxt)?a.nuxtLink:a.routerLink;case void 0!==r.href:return a.a;default:return r.defaultTag}})),y=e.computed((()=>{const e={...null==c?void 0:c.value,ariaPressed:!!m.value||void 0,ariaLabel:r.ariaLabel,role:null==g?void 0:g.value};switch(b.value){case a.a:return{...e,href:r.href,target:r.target,rel:r.rel};case a.routerLink:case a.nuxtLink:return{...e,to:r.to,target:r.target};case a.button:return{...e,type:r.type,disabled:r.disabled};default:return e}})),h=e=>{r.disabled?e.preventDefault():(null==s||s.emit("click",e),n("click",e))},S=e=>{null==s||s.emit("mouseover",e),n("mouseover",e)},k=e=>{null==s||s.emit("mouseleave",e),n("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(b)),e.mergeProps(e.unref(y),{ref_key:"element",ref:i,class:{active:t.active,pressed:e.unref(m),disabled:t.disabled,current:t.current},onClickPassive:h,onMouseoverPassive:S,onMouseleavePassive:k}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}});function V(e,t,o){return o?O(e,o)===O(t,o):_(e,t)}function _(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const o=Array.isArray(e),n=Array.isArray(t);let r,l,i;if(o&&n){if(l=e.length,l!=t.length)return!1;for(r=l;0!=r--;)if(!_(e[r],t[r]))return!1;return!0}if(o!=n)return!1;const a=e instanceof Date,u=t instanceof Date;if(a!=u)return!1;if(a&&u)return e.getTime()==t.getTime();const s=e instanceof RegExp,c=t instanceof RegExp;if(s!=c)return!1;if(s&&c)return e.toString()==t.toString();const d=Object.keys(e);if(l=d.length,l!==Object.keys(t).length)return!1;for(r=l;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,d[r]))return!1;for(r=l;0!=r--;)if(i=d[r],!_(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function O(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const o=t.split(".");let n=e;for(let t=0,r=o.length;t<r;++t){if(null==e)return null;n=n[o[t]]}return n}}return null}function P(e,t){if(null!=e&&t&&t.length)for(const o of t)if(V(e,o))return!0;return!1}function N(t){const o=e.inject(t,void 0),n=e.computed((()=>{return t=o,!(null==(n=e.unref(t))||""===n||Array.isArray(n)&&0===n.length||!(n instanceof Date)&&"object"==typeof n&&0===Object.keys(n).length);var t,n}));return{group:o,isInGroup:n,getGroupOrLocalRef:function(t,n,r){if(null==o?void 0:o.value){const n=e.unref(o.value)[t];return e.computed({get:()=>null==n?void 0:n.value,set(e){n.value=e}})}const l=e.toRef(n,t);return e.computed({get:()=>l.value,set(e){r&&r(`update:${t}`,e)}})}}}const C={...A,...w,...$,...x,...b,icon:[String,Object],iconPosition:{type:String,default:r.left,validator:e=>Object.values(r).includes(e)},loadingIcon:{type:String,default:"eos-icons:bubble-loading"},toggle:{type:Boolean,default:!1},value:{type:[String,Number,Boolean],default:void 0},uncheckedValue:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[String,Number,Boolean],default:void 0}};const E={key:1,class:"vv-button__label"},D={key:1,class:"vv-button__label"};return e.defineComponent({name:"VvButton",props:C,emits:["update:modelValue"],setup(t,{expose:n,emit:l}){const i=t,a=e.useAttrs(),u=e.useSlots(),{id:s,modifiers:d,iconPosition:f,icon:v,label:g,modelValue:b,disabled:y,toggle:h,unselectable:S}=function(t,o){const{group:n,isInGroup:r,getGroupOrLocalRef:l}=N(c),{id:i,iconPosition:a,icon:u,label:s,pressed:d}=e.toRefs(t),f=l("modelValue",t,o),v=l("toggle",t),p=l("unselectable",t),m=e.computed((()=>(null==n?void 0:n.value.multiple.value)??!1)),g=e.computed((()=>{let e=t.modifiers,o=null==n?void 0:n.value.modifiers.value;const r=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>r.add(e)))),o&&(Array.isArray(o)||(o=o.split(" ")),o.forEach((e=>r.add(e)))),Array.from(r)})),b=e.computed((()=>{var e;return Boolean(t.disabled||(null==(e=null==n?void 0:n.value)?void 0:e.disabled.value))}));return{group:n,isInGroup:r,modelValue:f,toggle:v,unselectable:p,multiple:m,modifiers:g,disabled:b,id:i,pressed:d,iconPosition:a,icon:u,label:s}}(i,l),k=(t=>e.computed((()=>String((null==t?void 0:t.value)||o.uid()))))(s),B=e.computed((()=>(null==a?void 0:a.name)||k.value)),$=e.ref(null);n({$el:e.computed((()=>{var e;return null==(e=$.value)?void 0:e.$el}))});const x=e.computed((()=>h.value?Array.isArray(b.value)?P(B.value,b.value):V(B.value,b.value):i.pressed)),w=p("vv-button",d,e.computed((()=>({reverse:[r.right,r.bottom].includes(f.value),column:[r.top,r.bottom].includes(f.value),"icon-only":Boolean((null==v?void 0:v.value)&&!(null==g?void 0:g.value)&&!u.default)})))),A=e.computed((()=>"string"==typeof(null==v?void 0:v.value)?{name:null==v?void 0:v.value}:null==v?void 0:v.value)),L=e.computed((()=>void 0!==i.value?i.value:B.value)),_=()=>{if(h.value){if(Array.isArray(b.value))return P(L.value,b.value)?void(S.value&&(b.value=b.value.filter((e=>e!==L.value)))):void b.value.push(L.value);if(L.value===b.value&&S.value)return void(b.value=i.uncheckedValue);b.value=L.value}};return(t,o)=>(e.openBlock(),e.createBlock(j,e.mergeProps({disabled:e.unref(y),pressed:e.unref(x),active:t.active,type:t.type,to:t.to,href:t.href,target:t.target,rel:t.rel,ariaLabel:t.ariaLabel},{id:e.unref(k),ref_key:"element",ref:$,class:e.unref(w),onClick:_}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[t.loading?e.renderSlot(t.$slots,"loading",{key:0},(()=>[t.loadingIcon?(e.openBlock(),e.createBlock(m,{key:0,class:"vv-button__loading-icon",name:t.loadingIcon},null,8,["name"])):e.createCommentVNode("v-if",!0),t.loadingLabel?(e.openBlock(),e.createElementBlock("span",E,e.toDisplayString(t.loadingLabel),1)):e.createCommentVNode("v-if",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(t.$slots,"before"),e.unref(v)?(e.openBlock(),e.createBlock(m,e.mergeProps({key:0,class:"vv-button__icon"},e.unref(A)),null,16)):e.createCommentVNode("v-if",!0),e.unref(g)?(e.openBlock(),e.createElementBlock("span",D,[e.renderSlot(t.$slots,"label",{},(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)),1)]))])):e.createCommentVNode("v-if",!0),e.renderSlot(t.$slots,"after")],64))]))])),_:3},16,["id","class"]))}})}));