@volverjs/ui-vue 0.0.10-beta.74 → 0.0.10-beta.76

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 (95) hide show
  1. package/README.md +8 -8
  2. package/bin/icons.cjs +1 -1
  3. package/bin/icons.js +3 -3
  4. package/dist/components/VvAccordion/VvAccordion.es.js +9 -9
  5. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  6. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +14 -15
  7. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  8. package/dist/components/VvAction/VvAction.es.js +10 -13
  9. package/dist/components/VvAction/VvAction.umd.js +1 -1
  10. package/dist/components/VvAlert/VvAlert.es.js +19 -19
  11. package/dist/components/VvAlert/VvAlert.umd.js +1 -1
  12. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +19 -19
  13. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
  14. package/dist/components/VvAvatar/VvAvatar.es.js +1 -1
  15. package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
  16. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +7 -8
  17. package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
  18. package/dist/components/VvBadge/VvBadge.es.js +1 -1
  19. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  20. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +12 -18
  21. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  22. package/dist/components/VvButton/VvButton.es.js +32 -38
  23. package/dist/components/VvButton/VvButton.umd.js +1 -1
  24. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +1 -1
  25. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  26. package/dist/components/VvCard/VvCard.es.js +1 -1
  27. package/dist/components/VvCard/VvCard.umd.js +1 -1
  28. package/dist/components/VvCheckbox/VvCheckbox.es.js +10 -12
  29. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  30. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +18 -22
  31. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  32. package/dist/components/VvCombobox/VvCombobox.es.js +266 -285
  33. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  34. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +22 -14
  35. package/dist/components/VvCombobox/index.d.ts +22 -0
  36. package/dist/components/VvDialog/VvDialog.es.js +5 -7
  37. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  38. package/dist/components/VvDropdown/VvDropdown.es.js +10 -15
  39. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  40. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +2 -2
  41. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +2 -2
  42. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +11 -14
  43. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  44. package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
  45. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
  46. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +1 -1
  47. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
  48. package/dist/components/VvIcon/VvIcon.es.js +5 -5
  49. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  50. package/dist/components/VvInputFile/VvInputFile.es.js +6829 -72
  51. package/dist/components/VvInputFile/VvInputFile.umd.js +7 -1
  52. package/dist/components/VvInputFile/VvInputFile.vue.d.ts +1 -1
  53. package/dist/components/VvInputText/VvInputText.es.js +54 -66
  54. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  55. package/dist/components/VvInputText/VvInputText.vue.d.ts +1 -1
  56. package/dist/components/VvNav/VvNav.es.js +16 -21
  57. package/dist/components/VvNav/VvNav.umd.js +1 -1
  58. package/dist/components/VvNavItem/VvNavItem.es.js +10 -13
  59. package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
  60. package/dist/components/VvNavSeparator/VvNavSeparator.umd.js +1 -1
  61. package/dist/components/VvProgress/VvProgress.es.js +1 -1
  62. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  63. package/dist/components/VvRadio/VvRadio.es.js +10 -12
  64. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  65. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +18 -22
  66. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  67. package/dist/components/VvSelect/VvSelect.es.js +27 -30
  68. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  69. package/dist/components/VvSelect/VvSelect.vue.d.ts +3 -3
  70. package/dist/components/VvTab/VvTab.es.js +18 -25
  71. package/dist/components/VvTab/VvTab.umd.js +1 -1
  72. package/dist/components/VvTextarea/VvTextarea.es.js +47 -57
  73. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  74. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +1 -1
  75. package/dist/components/VvTooltip/VvTooltip.es.js +1 -1
  76. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  77. package/dist/components/index.es.js +7352 -629
  78. package/dist/components/index.umd.js +7 -1
  79. package/dist/composables/index.es.js +1787 -16
  80. package/dist/composables/index.umd.js +7 -1
  81. package/dist/directives/index.es.js +1782 -15
  82. package/dist/directives/index.umd.js +7 -1
  83. package/dist/directives/v-contextmenu.es.js +1781 -14
  84. package/dist/directives/v-contextmenu.umd.js +7 -1
  85. package/dist/directives/v-tooltip.es.js +1 -1
  86. package/dist/directives/v-tooltip.umd.js +1 -1
  87. package/dist/icons.es.js +3 -3
  88. package/dist/icons.umd.js +1 -1
  89. package/dist/index.es.js +9 -12
  90. package/dist/index.umd.js +1 -1
  91. package/dist/resolvers/unplugin.es.js +1 -1
  92. package/dist/resolvers/unplugin.umd.js +1 -1
  93. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +2 -2
  94. package/dist/stories/Combobox/Combobox.stories.d.ts +1 -0
  95. package/package.json +35 -32
@@ -1,7 +1,7 @@
1
1
  import { computed, isRef, defineComponent, h, inject, unref, mergeDefaults, ref, toRefs, createBlock, createCommentVNode, openBlock, mergeProps, watch, useId, useSlots, createElementBlock, normalizeClass, createElementVNode, createVNode, toDisplayString, renderSlot, normalizeProps, guardReactiveProps, withDirectives, Fragment, renderList, vModelSelect, createSlots, withCtx } from "vue";
2
2
  import { iconLoaded, Icon, addIcon } from "@iconify/vue";
3
3
  import { useFocus, useElementVisibility } from "@vueuse/core";
4
- import { get } from "ts-dot-prop";
4
+ import { getProperty } from "dot-prop";
5
5
  const ACTION_ICONS = {
6
6
  clear: "close"
7
7
  };
@@ -394,7 +394,6 @@ function HintSlotFactory(propsOrRef, slots) {
394
394
  };
395
395
  },
396
396
  render() {
397
- var _a, _b, _c, _d, _e, _f, _g, _h;
398
397
  if (this.isVisible) {
399
398
  let role;
400
399
  if (this.hasInvalidLabelOrSlot) {
@@ -409,7 +408,7 @@ function HintSlotFactory(propsOrRef, slots) {
409
408
  {
410
409
  role
411
410
  },
412
- ((_b = (_a = this.$slots).loading) == null ? void 0 : _b.call(_a)) ?? this.loadingLabel
411
+ this.$slots.loading?.() ?? this.loadingLabel
413
412
  );
414
413
  }
415
414
  if (this.hasInvalidLabelOrSlot) {
@@ -418,7 +417,7 @@ function HintSlotFactory(propsOrRef, slots) {
418
417
  {
419
418
  role
420
419
  },
421
- ((_d = (_c = this.$slots).invalid) == null ? void 0 : _d.call(_c)) ?? this.$slots.invalid ?? this.invalidLabel
420
+ this.$slots.invalid?.() ?? this.$slots.invalid ?? this.invalidLabel
422
421
  );
423
422
  }
424
423
  if (this.hasValidLabelOrSlot) {
@@ -427,7 +426,7 @@ function HintSlotFactory(propsOrRef, slots) {
427
426
  {
428
427
  role
429
428
  },
430
- ((_f = (_e = this.$slots).valid) == null ? void 0 : _f.call(_e)) ?? this.validLabel
429
+ this.$slots.valid?.() ?? this.validLabel
431
430
  );
432
431
  }
433
432
  return h(
@@ -435,7 +434,7 @@ function HintSlotFactory(propsOrRef, slots) {
435
434
  {
436
435
  role
437
436
  },
438
- ((_h = (_g = this.$slots).hint) == null ? void 0 : _h.call(_g)) ?? this.$slots.hint ?? this.hintLabel
437
+ this.$slots.hint?.() ?? this.$slots.hint ?? this.hintLabel
439
438
  );
440
439
  }
441
440
  return null;
@@ -458,7 +457,7 @@ function useModifiers(prefix, modifiers, others) {
458
457
  const toReturn = {
459
458
  [prefix]: true
460
459
  };
461
- const modifiersArray = typeof (modifiers == null ? void 0 : modifiers.value) === "string" ? modifiers.value.split(" ") : modifiers == null ? void 0 : modifiers.value;
460
+ const modifiersArray = typeof modifiers?.value === "string" ? modifiers.value.split(" ") : modifiers?.value;
462
461
  if (modifiersArray) {
463
462
  if (Array.isArray(modifiersArray)) {
464
463
  modifiersArray.forEach((modifier) => {
@@ -512,7 +511,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
512
511
  const { modifiers } = toRefs(props);
513
512
  const bemCssClasses = useModifiers("vv-icon", modifiers);
514
513
  const provider = computed(() => {
515
- return props.provider || (volver == null ? void 0 : volver.iconsProvider);
514
+ return props.provider || volver?.iconsProvider;
516
515
  });
517
516
  const icon = computed(() => {
518
517
  const name = props.name ?? "";
@@ -520,7 +519,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
520
519
  if (iconLoaded(iconName)) {
521
520
  return iconName;
522
521
  }
523
- const iconsCollection = volver == null ? void 0 : volver.iconsCollections.find(
522
+ const iconsCollection = volver?.iconsCollections.find(
524
523
  (iconsCollection2) => {
525
524
  const icon2 = `@${provider.value}:${iconsCollection2.prefix}:${name}`;
526
525
  return iconLoaded(icon2);
@@ -544,7 +543,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
544
543
  }
545
544
  function addIconFromSvg(svg) {
546
545
  const svgContentEl = getSvgContent(svg);
547
- const svgContent = (svgContentEl == null ? void 0 : svgContentEl.innerHTML.trim()) || "";
546
+ const svgContent = svgContentEl?.innerHTML.trim() || "";
548
547
  if (svgContentEl && svgContent) {
549
548
  addIcon(`@${provider.value}:${props.prefix}:${props.name}`, {
550
549
  body: svgContent,
@@ -563,7 +562,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
563
562
  show.value = true;
564
563
  }
565
564
  }).catch((e) => {
566
- throw new Error(`Error during fetch icon: ${e == null ? void 0 : e.message}`);
565
+ throw new Error(`Error during fetch icon: ${e?.message}`);
567
566
  });
568
567
  }
569
568
  }
@@ -590,28 +589,28 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
590
589
  });
591
590
  function useComponentIcon(icon, iconPosition) {
592
591
  const hasIcon = computed(() => {
593
- if (typeof (icon == null ? void 0 : icon.value) === "string") {
594
- return { name: icon == null ? void 0 : icon.value };
592
+ if (typeof icon?.value === "string") {
593
+ return { name: icon?.value };
595
594
  }
596
- return icon == null ? void 0 : icon.value;
595
+ return icon?.value;
597
596
  });
598
597
  const hasIconBefore = computed(
599
- () => (iconPosition == null ? void 0 : iconPosition.value) === Position.before ? hasIcon.value : void 0
598
+ () => iconPosition?.value === Position.before ? hasIcon.value : void 0
600
599
  );
601
600
  const hasIconAfter = computed(
602
- () => (iconPosition == null ? void 0 : iconPosition.value) === Position.after ? hasIcon.value : void 0
601
+ () => iconPosition?.value === Position.after ? hasIcon.value : void 0
603
602
  );
604
603
  const hasIconLeft = computed(
605
- () => (iconPosition == null ? void 0 : iconPosition.value) === Side.left ? hasIcon.value : void 0
604
+ () => iconPosition?.value === Side.left ? hasIcon.value : void 0
606
605
  );
607
606
  const hasIconRight = computed(
608
- () => (iconPosition == null ? void 0 : iconPosition.value) === Side.right ? hasIcon.value : void 0
607
+ () => iconPosition?.value === Side.right ? hasIcon.value : void 0
609
608
  );
610
609
  const hasIconTop = computed(
611
- () => (iconPosition == null ? void 0 : iconPosition.value) === Side.top ? hasIcon.value : void 0
610
+ () => iconPosition?.value === Side.top ? hasIcon.value : void 0
612
611
  );
613
612
  const hasIconBottom = computed(
614
- () => (iconPosition == null ? void 0 : iconPosition.value) === Side.bottom ? hasIcon.value : void 0
613
+ () => iconPosition?.value === Side.bottom ? hasIcon.value : void 0
615
614
  );
616
615
  return {
617
616
  hasIcon,
@@ -649,7 +648,7 @@ const VvInputClearAction = defineComponent({
649
648
  setup(props, { emit }) {
650
649
  const { hasIcon } = useComponentIcon(computed(() => props.icon));
651
650
  function onClick(e) {
652
- e == null ? void 0 : e.stopPropagation();
651
+ e?.stopPropagation();
653
652
  if (!props.disabled) {
654
653
  emit("clear");
655
654
  }
@@ -680,8 +679,7 @@ const VvInputClearAction = defineComponent({
680
679
  function useDefaults(componentName, propsDefinition, props) {
681
680
  const volver = useVolver();
682
681
  const volverComponentDefaults = computed(() => {
683
- var _a;
684
- if (!volver || !((_a = volver.defaults.value) == null ? void 0 : _a[componentName])) {
682
+ if (!volver || !volver.defaults.value?.[componentName]) {
685
683
  return void 0;
686
684
  }
687
685
  return volver.defaults.value[componentName];
@@ -740,7 +738,7 @@ function useComponentFocus(inputTemplateRef, emit) {
740
738
  };
741
739
  }
742
740
  function useUniqueId(id) {
743
- return computed(() => String((id == null ? void 0 : id.value) || useId()));
741
+ return computed(() => String(id?.value || useId()));
744
742
  }
745
743
  function useOptions(props) {
746
744
  const { options, labelKey, valueKey, disabledKey } = toRefs(props);
@@ -752,7 +750,7 @@ function useOptions(props) {
752
750
  return labelKey.value(option);
753
751
  }
754
752
  return String(
755
- labelKey.value ? get(option, labelKey.value) : option
753
+ labelKey.value ? getProperty(option, labelKey.value) : option
756
754
  );
757
755
  };
758
756
  const getOptionValue = (option) => {
@@ -762,7 +760,7 @@ function useOptions(props) {
762
760
  if (typeof valueKey.value === "function") {
763
761
  return valueKey.value(option);
764
762
  }
765
- return valueKey.value ? get(option, valueKey.value) : option;
763
+ return valueKey.value ? getProperty(option, valueKey.value) : option;
766
764
  };
767
765
  const isOptionDisabled = (option) => {
768
766
  if (typeof option === "string") {
@@ -771,7 +769,7 @@ function useOptions(props) {
771
769
  if (typeof disabledKey.value === "function") {
772
770
  return disabledKey.value(option);
773
771
  }
774
- return disabledKey.value ? get(option, disabledKey.value) : false;
772
+ return disabledKey.value ? Boolean(getProperty(option, disabledKey.value)) : false;
775
773
  };
776
774
  const getOptionGrouped = (option) => {
777
775
  if (typeof option == "string") {
@@ -832,11 +830,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
832
830
  } = HintSlotFactory(propsDefaults, slots);
833
831
  const { focused } = useComponentFocus(selectEl, emit);
834
832
  function isGroup(option) {
835
- var _a;
836
833
  if (typeof option === "string") {
837
834
  return false;
838
835
  }
839
- return (_a = option.options) == null ? void 0 : _a.length;
836
+ return option.options?.length;
840
837
  }
841
838
  const {
842
839
  id,
@@ -926,7 +923,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
926
923
  watch(
927
924
  () => props.options,
928
925
  (newValue) => {
929
- if ((newValue == null ? void 0 : newValue.length) && props.autoselectFirst && !isDirty.value) {
926
+ if (newValue?.length && props.autoselectFirst && !isDirty.value) {
930
927
  const firstOptionValue = getOptionValue(newValue[0]);
931
928
  localModelValue.value = props.multiple ? [firstOptionValue] : firstOptionValue;
932
929
  }
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@iconify/vue"),require("@vueuse/core"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","@vueuse/core","ts-dot-prop"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvSelect=t(e.vue,e.vue$1,e.core,e.tsDotProp)}(this,(function(e,t,l,o){"use strict";const a={prefix:"normal"};var n=(e=>(e.local="local",e.session="session",e))(n||{}),i=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(i||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{}),d=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(d||{});const s=Symbol.for("volver"),c={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},v={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},p={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},f={disabled:{type:Boolean,default:!1}},m={showClearAction:{type:Boolean,default:!1},iconClear:{type:[String,Object],default:"close"},labelClear:{type:String,default:"Clear"}},b={label:{type:[String,Number],default:void 0}},h={readonly:{type:Boolean,default:!1}},y={modifiers:{type:[String,Array],default:void 0}},g={hintLabel:{type:String,default:""}},S={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},B={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:r.before,validation:e=>Object.values(r).includes(e)}},k={tabindex:{type:[String,Number],default:0}},L={floating:{type:Boolean,default:!1}},$={unselectable:{type:Boolean,default:!0}},V={id:[String,Number]};i.bottom;const O={...V,name:{type:String,required:!0}},C={autofocus:{type:Boolean,default:!1}},w={autocomplete:{type:String,default:"off"}};u.button,d.button,n.local;const I={...O,...C,...w,...k,...c,...v,...g,...p,...f,...h,...y,...S,...B,...L,...$,...b,...m,multiple:Boolean,required:Boolean,size:[String,Number],modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},autoselectFirst:{type:Boolean,default:!1},placeholder:String};function P(){return{...I,options:{...I.options,type:Array,default:()=>[]}}}function x(e){return Array.isArray(e)?e.filter((e=>"string"==typeof e)).join(" "):e}function A(){return e.inject(s,void 0)}function _(t,l,o){return e.computed((()=>{const a={[t]:!0},n="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(a[`${t}--${e}`]=!0)})),o&&Object.keys(o.value).forEach((l=>{a[`${t}--${l}`]=e.unref(o.value[l])})),a}))}const E=e.defineComponent({name:"VvIcon",props:e.mergeDefaults({name:{},color:{},width:{},height:{},provider:{},prefix:{},src:{},horizontalFlip:{type:Boolean},verticalFlip:{type:Boolean},flip:{},mode:{},inline:{type:Boolean},rotate:{},onLoad:{type:Function},svg:{},modifiers:{}},a),setup(l){const o=l,a=e.computed((()=>"string"==typeof o.rotate?Number.parseFloat(o.rotate):o.rotate)),n=e.ref(!0),i=A(),{modifiers:r}=e.toRefs(o),u=_("vv-icon",r),d=e.computed((()=>o.provider||(null==i?void 0:i.iconsProvider))),s=e.computed((()=>{const e=o.name??"",l=`@${d.value}:${o.prefix}:${e}`;if(t.iconLoaded(l))return l;const a=null==i?void 0:i.iconsCollections.find((l=>{const o=`@${d.value}:${l.prefix}:${e}`;return t.iconLoaded(o)}));return a?`@${d.value}:${a.prefix}:${e}`:e}));function c(e){const l=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),a=(null==l?void 0:l.innerHTML.trim())||"";l&&a&&t.addIcon(`@${d.value}:${o.prefix}:${o.name}`,{body:a,height:l.viewBox.baseVal.height,width:l.viewBox.baseVal.width})}return i&&o.src&&!t.iconLoaded(`@${d.value}:${o.prefix}:${o.name}`)&&(n.value=!1,i.fetchIcon(o.src).then((e=>{e&&(c(e),n.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),o.svg&&c(o.svg),(l,o)=>e.unref(n)?(e.openBlock(),e.createBlock(e.unref(t.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:l.inline,width:l.width,height:l.height,horizontalFlip:l.horizontalFlip,verticalFlip:l.verticalFlip,flip:l.flip,rotate:e.unref(a),color:l.color,icon:e.unref(s)},{onLoad:l.onLoad}),null,16,["class","onLoad"])):e.createCommentVNode("v-if",!0)}});function N(t,l){const o=e.computed((()=>"string"==typeof(null==t?void 0:t.value)?{name:null==t?void 0:t.value}:null==t?void 0:t.value)),a=e.computed((()=>(null==l?void 0:l.value)===r.before?o.value:void 0)),n=e.computed((()=>(null==l?void 0:l.value)===r.after?o.value:void 0)),u=e.computed((()=>(null==l?void 0:l.value)===i.left?o.value:void 0)),d=e.computed((()=>(null==l?void 0:l.value)===i.right?o.value:void 0)),s=e.computed((()=>(null==l?void 0:l.value)===i.top?o.value:void 0)),c=e.computed((()=>(null==l?void 0:l.value)===i.bottom?o.value:void 0));return{hasIcon:o,hasIconLeft:u,hasIconRight:d,hasIconTop:s,hasIconBottom:c,hasIconBefore:a,hasIconAfter:n}}const F=e.defineComponent({components:{VvIcon:E},props:{inputType:{type:String,default:"input-text"},disabled:{type:Boolean,default:!1},label:{type:String,default:"Clear"},icon:{type:[String,Object],default:"close"}},emits:["clear"],setup(t,{emit:l}){const{hasIcon:o}=N(e.computed((()=>t.icon)));return{hasIcon:o,onClick:function(e){null==e||e.stopPropagation(),t.disabled||l("clear")}}},render(){const t=this.hasIcon?e.h(E,{...this.hasIcon,class:`vv-${this.inputType}__icon`}):void 0;return e.h("button",{disabled:this.disabled,class:`vv-${this.inputType}__action`,ariaLabel:this.label,type:"button",onClick:this.onClick},t)}});const j=["for"],z={class:"vv-select__wrapper"},D={key:0,class:"vv-select__input-before"},R={class:"vv-select__inner"},q=["id"],H=["disabled","hidden"],T=["disabled","value"],K=["disabled","label"],M=["disabled","value"],J={key:2,class:"vv-select__input-after"};return e.defineComponent({name:"VvSelect",props:P(),emits:["update:modelValue","focus","blur","clear"],setup(t,{emit:a}){const n=t,i=a,r=e.useSlots(),u=function(t,l,o){const a=A(),n=e.computed((()=>{var e;if(a&&(null==(e=a.defaults.value)?void 0:e[t]))return a.defaults.value[t]}));return e.computed((()=>{if(void 0===n.value)return o;const e=n.value,t=l,a=o;return Object.keys(t).reduce(((l,o)=>{const n=a[o];if(l[o]=n,o in e){if(Array.isArray(t[o])){const a=t[o];a.length&&a[0]===n&&(l[o]=e[o])}if("function"==typeof t[o]&&(0,t[o])()===n&&(l[o]=e[o]),"object"==typeof t[o]){let a=t[o].default;"function"==typeof a&&(a=a()),"object"==typeof a?JSON.stringify(a)===JSON.stringify(n)&&(l[o]=e[o]):a===n&&(l[o]=e[o])}}return l}),{})}))}("VvSelect",P(),n),d=e.ref(),{HintSlot:s,hasHintLabelOrSlot:c,hasInvalidLabelOrSlot:v,hintSlotScope:p}=function(t,l){const o=e.computed((()=>e.isRef(t)?t.value:t)),a=e.computed((()=>x(o.value.invalidLabel))),n=e.computed((()=>x(o.value.validLabel))),i=e.computed((()=>o.value.loadingLabel)),r=e.computed((()=>o.value.hintLabel)),u=e.computed((()=>Boolean(o.value.loading&&(l.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(o.value.invalid&&(l.invalid||a.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(o.value.valid&&(l.valid||n.value)))),c=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(l.hint||r.value))),v=e.computed((()=>d.value||s.value||u.value||c.value)),p=e.computed((()=>({modelValue:o.value.modelValue,valid:o.value.valid,invalid:o.value.invalid,loading:o.value.loading}))),f=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:v,invalidLabel:a,validLabel:n,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:c}),render(){var t,l,o,a,n,i,r,u;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(l=(t=this.$slots).loading)?void 0:l.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(a=(o=this.$slots).invalid)?void 0:a.call(o))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(n=this.$slots).valid)?void 0:i.call(n))??this.validLabel):e.h(this.tag,{role:d},(null==(u=(r=this.$slots).hint)?void 0:u.call(r))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:d,hasHintLabelOrSlot:c,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:p,HintSlot:f}}(u,r),{focused:f}=function(t,o){const{focused:a}=l.useFocus(t);return e.watch(a,(l=>{o(l?"focus":"blur",e.unref(t))})),{focused:a}}(d,i);function m(e){var t;return"string"!=typeof e&&(null==(t=e.options)?void 0:t.length)}const{id:b,modifiers:h,disabled:y,readonly:g,loading:S,icon:B,iconPosition:k,invalid:L,valid:$,floating:V,multiple:O}=e.toRefs(n),C=function(t){return e.computed((()=>String((null==t?void 0:t.value)||e.useId())))}(b),w=e.computed((()=>`${C.value}-hint`)),I=e.computed((()=>n.disabled||n.readonly)),G=e.computed((()=>I.value?-1:n.tabindex)),U=e.computed({get:()=>n.modelValue,set:e=>{Array.isArray(e)&&0===(e=e.filter((e=>void 0!==e))).length&&!n.unselectable&&d.value?d.value.value=String(n.modelValue):i("update:modelValue",e)}}),Q=e.computed((()=>Array.isArray(U.value)?U.value.length>0:void 0!==U.value&&null!==U.value)),W=e.computed((()=>!I.value&&n.unselectable)),X=l.useElementVisibility(d);e.watch(X,(e=>{e&&n.autofocus&&(f.value=!0)}));const{hasIconBefore:Y,hasIconAfter:Z}=N(B,k),ee=e.computed((()=>!0===n.invalid||!0!==n.valid&&void 0)),te=_("vv-select",h,e.computed((()=>({valid:$.value,invalid:L.value,loading:S.value,disabled:y.value,readonly:g.value,"icon-before":void 0!==Y.value,"icon-after":void 0!==Z.value,dirty:Q.value,focus:f.value&&!I.value,floating:V.value,multiple:O.value})))),{getOptionLabel:le,getOptionValue:oe,isOptionDisabled:ae,getOptionGrouped:ne}=function(t){const{options:l,labelKey:a,valueKey:n,disabledKey:i}=e.toRefs(t);return{options:l,getOptionLabel:e=>"string"==typeof e?e:"function"==typeof a.value?a.value(e):String(a.value?o.get(e,a.value):e),getOptionValue:e=>"string"==typeof e?e:"function"==typeof n.value?n.value(e):n.value?o.get(e,n.value):e,isOptionDisabled:e=>"string"!=typeof e&&("function"==typeof i.value?i.value(e):!!i.value&&o.get(e,i.value)),getOptionGrouped:e=>"string"==typeof e?[]:"object"==typeof e&&e&&"options"in e?e.options:[]}}(n);function ie(){Array.isArray(U.value)?U.value=[]:U.value=void 0,i("clear")}e.watch((()=>n.options),(e=>{if((null==e?void 0:e.length)&&n.autoselectFirst&&!Q.value){const t=oe(e[0]);U.value=n.multiple?[t]:t}}),{immediate:!0});const re=e.computed((()=>({name:n.name,tabindex:G.value,disabled:I.value,required:n.required,size:n.size,autocomplete:n.autocomplete,multiple:n.multiple,"aria-invalid":ee.value,"aria-describedby":c.value?w.value:void 0,"aria-errormessage":v.value?w.value:void 0}))),ue=e.computed((()=>({valid:n.valid,invalid:n.invalid,modelValue:n.modelValue})));return(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(te))},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(C)},e.toDisplayString(t.label),9,j)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",z,[t.$slots.before?(e.openBlock(),e.createElementBlock("div",D,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(ue))))])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",R,[e.unref(Y)?(e.openBlock(),e.createBlock(E,e.mergeProps({key:0},e.unref(Y),{class:"vv-select__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("select",e.mergeProps({id:e.unref(C),ref_key:"selectEl",ref:d},e.unref(re),{"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(U)?U.value=t:null)}),[t.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,value:void 0,disabled:!e.unref(W),hidden:!e.unref(W)},e.toDisplayString(t.placeholder),9,H)):e.createCommentVNode("v-if",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,((t,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[m(t)?(e.openBlock(),e.createElementBlock("optgroup",{key:`group-${l}`,disabled:e.unref(ae)(t),label:e.unref(le)(t)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ne)(t),((t,o)=>(e.openBlock(),e.createElementBlock("option",{key:`group-${l}-item-${o}`,disabled:e.unref(ae)(t),value:e.unref(oe)(t)},e.toDisplayString(e.unref(le)(t)),9,M)))),128))],8,K)):(e.openBlock(),e.createElementBlock("option",{key:l,disabled:e.unref(ae)(t),value:e.unref(oe)(t)},e.toDisplayString(e.unref(le)(t)),9,T))],64)))),256))],16,q),[[e.vModelSelect,e.unref(U)]]),e.unref(Z)?(e.openBlock(),e.createBlock(E,e.mergeProps({key:1},e.unref(Z),{class:"vv-select__icon vv-select__icon-after"}),null,16)):e.createCommentVNode("v-if",!0)]),e.unref(W)&&e.unref(u).showClearAction?(e.openBlock(),e.createBlock(e.unref(F),{key:1,"input-type":"select",label:t.labelClear,icon:t.iconClear,disabled:!e.unref(Q),onClear:ie},null,8,["label","icon","disabled"])):e.createCommentVNode("v-if",!0),t.$slots.after?(e.openBlock(),e.createElementBlock("div",J,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(ue))))])):e.createCommentVNode("v-if",!0)]),e.createVNode(e.unref(s),{id:e.unref(w),class:"vv-select__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(p))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(p))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(p))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(p))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@iconify/vue"),require("@vueuse/core"),require("dot-prop")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","@vueuse/core","dot-prop"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvSelect=t(e.Vue,e.Iconify,e.VueUse,e.dotProp)}(this,function(e,t,o,l){"use strict";const a={prefix:"normal"};var n=(e=>(e.local="local",e.session="session",e))(n||{}),i=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(i||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{}),d=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(d||{});const s=Symbol.for("volver"),c={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},v={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},p={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},f={disabled:{type:Boolean,default:!1}},m={showClearAction:{type:Boolean,default:!1},iconClear:{type:[String,Object],default:"close"},labelClear:{type:String,default:"Clear"}},b={label:{type:[String,Number],default:void 0}},y={readonly:{type:Boolean,default:!1}},h={modifiers:{type:[String,Array],default:void 0}},g={hintLabel:{type:String,default:""}},S={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},B={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:r.before,validation:e=>Object.values(r).includes(e)}},k={tabindex:{type:[String,Number],default:0}},L={floating:{type:Boolean,default:!1}},$={unselectable:{type:Boolean,default:!0}},V={id:[String,Number]};i.bottom;const O={...V,name:{type:String,required:!0}},C={autofocus:{type:Boolean,default:!1}},w={autocomplete:{type:String,default:"off"}};u.button,d.button,n.local;const P={...O,...C,...w,...k,...c,...v,...g,...p,...f,...y,...h,...S,...B,...L,...$,...b,...m,multiple:Boolean,required:Boolean,size:[String,Number],modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},autoselectFirst:{type:Boolean,default:!1},placeholder:String};function I(){return{...P,options:{...P.options,type:Array,default:()=>[]}}}function x(e){return Array.isArray(e)?e.filter(e=>"string"==typeof e).join(" "):e}function A(){return e.inject(s,void 0)}function _(t,o,l){return e.computed(()=>{const a={[t]:!0},n="string"==typeof o?.value?o.value.split(" "):o?.value;return n&&Array.isArray(n)&&n.forEach(e=>{e&&(a[`${t}--${e}`]=!0)}),l&&Object.keys(l.value).forEach(o=>{a[`${t}--${o}`]=e.unref(l.value[o])}),a})}const E=e.defineComponent({name:"VvIcon",props:e.mergeDefaults({name:{},color:{},width:{},height:{},provider:{},prefix:{},src:{},horizontalFlip:{type:Boolean},verticalFlip:{type:Boolean},flip:{},mode:{},inline:{type:Boolean},rotate:{},onLoad:{type:Function},svg:{},modifiers:{}},a),setup(o){const l=o,a=e.computed(()=>"string"==typeof l.rotate?Number.parseFloat(l.rotate):l.rotate),n=e.ref(!0),i=A(),{modifiers:r}=e.toRefs(l),u=_("vv-icon",r),d=e.computed(()=>l.provider||i?.iconsProvider),s=e.computed(()=>{const e=l.name??"",o=`@${d.value}:${l.prefix}:${e}`;if(t.iconLoaded(o))return o;const a=i?.iconsCollections.find(o=>{const l=`@${d.value}:${o.prefix}:${e}`;return t.iconLoaded(l)});return a?`@${d.value}:${a.prefix}:${e}`:e});function c(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),a=o?.innerHTML.trim()||"";o&&a&&t.addIcon(`@${d.value}:${l.prefix}:${l.name}`,{body:a,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return i&&l.src&&!t.iconLoaded(`@${d.value}:${l.prefix}:${l.name}`)&&(n.value=!1,i.fetchIcon(l.src).then(e=>{e&&(c(e),n.value=!0)}).catch(e=>{throw new Error(`Error during fetch icon: ${e?.message}`)})),l.svg&&c(l.svg),(o,l)=>e.unref(n)?(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(a),color:o.color,icon:e.unref(s)},{onLoad:o.onLoad}),null,16,["class","onLoad"])):e.createCommentVNode("v-if",!0)}});function N(t,o){const l=e.computed(()=>"string"==typeof t?.value?{name:t?.value}:t?.value),a=e.computed(()=>o?.value===r.before?l.value:void 0),n=e.computed(()=>o?.value===r.after?l.value:void 0),u=e.computed(()=>o?.value===i.left?l.value:void 0),d=e.computed(()=>o?.value===i.right?l.value:void 0),s=e.computed(()=>o?.value===i.top?l.value:void 0),c=e.computed(()=>o?.value===i.bottom?l.value:void 0);return{hasIcon:l,hasIconLeft:u,hasIconRight:d,hasIconTop:s,hasIconBottom:c,hasIconBefore:a,hasIconAfter:n}}const F=e.defineComponent({components:{VvIcon:E},props:{inputType:{type:String,default:"input-text"},disabled:{type:Boolean,default:!1},label:{type:String,default:"Clear"},icon:{type:[String,Object],default:"close"}},emits:["clear"],setup(t,{emit:o}){const{hasIcon:l}=N(e.computed(()=>t.icon));return{hasIcon:l,onClick:function(e){e?.stopPropagation(),t.disabled||o("clear")}}},render(){const t=this.hasIcon?e.h(E,{...this.hasIcon,class:`vv-${this.inputType}__icon`}):void 0;return e.h("button",{disabled:this.disabled,class:`vv-${this.inputType}__action`,ariaLabel:this.label,type:"button",onClick:this.onClick},t)}});const j=["for"],z={class:"vv-select__wrapper"},R={key:0,class:"vv-select__input-before"},D={class:"vv-select__inner"},q=["id"],H=["disabled","hidden"],T=["disabled","value"],K=["disabled","label"],M=["disabled","value"],J={key:2,class:"vv-select__input-after"};return e.defineComponent({name:"VvSelect",props:I(),emits:["update:modelValue","focus","blur","clear"],setup(t,{emit:a}){const n=t,i=a,r=e.useSlots(),u=function(t,o,l){const a=A(),n=e.computed(()=>{if(a&&a.defaults.value?.[t])return a.defaults.value[t]});return e.computed(()=>{if(void 0===n.value)return l;const e=n.value,t=o,a=l;return Object.keys(t).reduce((o,l)=>{const n=a[l];if(o[l]=n,l in e){if(Array.isArray(t[l])){const a=t[l];a.length&&a[0]===n&&(o[l]=e[l])}if("function"==typeof t[l]&&(0,t[l])()===n&&(o[l]=e[l]),"object"==typeof t[l]){let a=t[l].default;"function"==typeof a&&(a=a()),"object"==typeof a?JSON.stringify(a)===JSON.stringify(n)&&(o[l]=e[l]):a===n&&(o[l]=e[l])}}return o},{})})}("VvSelect",I(),n),d=e.ref(),{HintSlot:s,hasHintLabelOrSlot:c,hasInvalidLabelOrSlot:v,hintSlotScope:p}=function(t,o){const l=e.computed(()=>e.isRef(t)?t.value:t),a=e.computed(()=>x(l.value.invalidLabel)),n=e.computed(()=>x(l.value.validLabel)),i=e.computed(()=>l.value.loadingLabel),r=e.computed(()=>l.value.hintLabel),u=e.computed(()=>Boolean(l.value.loading&&(o.loading||i.value))),d=e.computed(()=>!u.value&&Boolean(l.value.invalid&&(o.invalid||a.value))),s=e.computed(()=>!u.value&&!d.value&&Boolean(l.value.valid&&(o.valid||n.value))),c=e.computed(()=>!u.value&&!d.value&&!s.value&&Boolean(o.hint||r.value)),v=e.computed(()=>d.value||s.value||u.value||c.value),p=e.computed(()=>({modelValue:l.value.modelValue,valid:l.value.valid,invalid:l.value.invalid,loading:l.value.loading})),f=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:v,invalidLabel:a,validLabel:n,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:c}),render(){if(this.isVisible){let t;return this.hasInvalidLabelOrSlot&&(t="alert"),this.hasValidLabelOrSlot&&(t="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:t},this.$slots.loading?.()??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:t},this.$slots.invalid?.()??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:t},this.$slots.valid?.()??this.validLabel):e.h(this.tag,{role:t},this.$slots.hint?.()??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:d,hasHintLabelOrSlot:c,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:p,HintSlot:f}}(u,r),{focused:f}=function(t,l){const{focused:a}=o.useFocus(t);return e.watch(a,o=>{l(o?"focus":"blur",e.unref(t))}),{focused:a}}(d,i);function m(e){return"string"!=typeof e&&e.options?.length}const{id:b,modifiers:y,disabled:h,readonly:g,loading:S,icon:B,iconPosition:k,invalid:L,valid:$,floating:V,multiple:O}=e.toRefs(n),C=function(t){return e.computed(()=>String(t?.value||e.useId()))}(b),w=e.computed(()=>`${C.value}-hint`),P=e.computed(()=>n.disabled||n.readonly),G=e.computed(()=>P.value?-1:n.tabindex),U=e.computed({get:()=>n.modelValue,set:e=>{Array.isArray(e)&&0===(e=e.filter(e=>void 0!==e)).length&&!n.unselectable&&d.value?d.value.value=String(n.modelValue):i("update:modelValue",e)}}),Q=e.computed(()=>Array.isArray(U.value)?U.value.length>0:void 0!==U.value&&null!==U.value),W=e.computed(()=>!P.value&&n.unselectable),X=o.useElementVisibility(d);e.watch(X,e=>{e&&n.autofocus&&(f.value=!0)});const{hasIconBefore:Y,hasIconAfter:Z}=N(B,k),ee=e.computed(()=>!0===n.invalid||!0!==n.valid&&void 0),te=_("vv-select",y,e.computed(()=>({valid:$.value,invalid:L.value,loading:S.value,disabled:h.value,readonly:g.value,"icon-before":void 0!==Y.value,"icon-after":void 0!==Z.value,dirty:Q.value,focus:f.value&&!P.value,floating:V.value,multiple:O.value}))),{getOptionLabel:oe,getOptionValue:le,isOptionDisabled:ae,getOptionGrouped:ne}=function(t){const{options:o,labelKey:a,valueKey:n,disabledKey:i}=e.toRefs(t);return{options:o,getOptionLabel:e=>"string"==typeof e?e:"function"==typeof a.value?a.value(e):String(a.value?l.getProperty(e,a.value):e),getOptionValue:e=>"string"==typeof e?e:"function"==typeof n.value?n.value(e):n.value?l.getProperty(e,n.value):e,isOptionDisabled:e=>"string"!=typeof e&&("function"==typeof i.value?i.value(e):!!i.value&&Boolean(l.getProperty(e,i.value))),getOptionGrouped:e=>"string"==typeof e?[]:"object"==typeof e&&e&&"options"in e?e.options:[]}}(n);function ie(){Array.isArray(U.value)?U.value=[]:U.value=void 0,i("clear")}e.watch(()=>n.options,e=>{if(e?.length&&n.autoselectFirst&&!Q.value){const t=le(e[0]);U.value=n.multiple?[t]:t}},{immediate:!0});const re=e.computed(()=>({name:n.name,tabindex:G.value,disabled:P.value,required:n.required,size:n.size,autocomplete:n.autocomplete,multiple:n.multiple,"aria-invalid":ee.value,"aria-describedby":c.value?w.value:void 0,"aria-errormessage":v.value?w.value:void 0})),ue=e.computed(()=>({valid:n.valid,invalid:n.invalid,modelValue:n.modelValue}));return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(te))},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(C)},e.toDisplayString(t.label),9,j)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",z,[t.$slots.before?(e.openBlock(),e.createElementBlock("div",R,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(ue))))])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",D,[e.unref(Y)?(e.openBlock(),e.createBlock(E,e.mergeProps({key:0},e.unref(Y),{class:"vv-select__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("select",e.mergeProps({id:e.unref(C),ref_key:"selectEl",ref:d},e.unref(re),{"onUpdate:modelValue":o[0]||(o[0]=t=>e.isRef(U)?U.value=t:null)}),[t.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,value:void 0,disabled:!e.unref(W),hidden:!e.unref(W)},e.toDisplayString(t.placeholder),9,H)):e.createCommentVNode("v-if",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,(t,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[m(t)?(e.openBlock(),e.createElementBlock("optgroup",{key:`group-${o}`,disabled:e.unref(ae)(t),label:e.unref(oe)(t)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ne)(t),(t,l)=>(e.openBlock(),e.createElementBlock("option",{key:`group-${o}-item-${l}`,disabled:e.unref(ae)(t),value:e.unref(le)(t)},e.toDisplayString(e.unref(oe)(t)),9,M))),128))],8,K)):(e.openBlock(),e.createElementBlock("option",{key:o,disabled:e.unref(ae)(t),value:e.unref(le)(t)},e.toDisplayString(e.unref(oe)(t)),9,T))],64))),256))],16,q),[[e.vModelSelect,e.unref(U)]]),e.unref(Z)?(e.openBlock(),e.createBlock(E,e.mergeProps({key:1},e.unref(Z),{class:"vv-select__icon vv-select__icon-after"}),null,16)):e.createCommentVNode("v-if",!0)]),e.unref(W)&&e.unref(u).showClearAction?(e.openBlock(),e.createBlock(e.unref(F),{key:1,"input-type":"select",label:t.labelClear,icon:t.iconClear,disabled:!e.unref(Q),onClear:ie},null,8,["label","icon","disabled"])):e.createCommentVNode("v-if",!0),t.$slots.after?(e.openBlock(),e.createElementBlock("div",J,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(ue))))])):e.createCommentVNode("v-if",!0)]),e.createVNode(e.unref(s),{id:e.unref(w),class:"vv-select__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(p))))]),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(p))))]),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(p))))]),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(p))))]),key:"3"}:void 0]),1032,["id"])],2))}})});
@@ -60,15 +60,15 @@ declare const _default: <T extends string | Option>(__VLS_props: NonNullable<Awa
60
60
  readonly modelValue?: string | number | boolean | unknown[] | Record<string, any> | undefined;
61
61
  readonly modifiers?: string | string[] | undefined;
62
62
  readonly id?: string | number | undefined;
63
+ readonly placeholder?: string | undefined;
63
64
  readonly icon?: string | import("../VvIcon").VvIconProps | undefined;
64
65
  readonly invalidLabel?: string | unknown[] | undefined;
65
66
  readonly validLabel?: string | unknown[] | undefined;
66
- readonly placeholder?: string | undefined;
67
67
  readonly onClear?: (() => any) | undefined;
68
68
  readonly "onUpdate:modelValue"?: ((args_0: any) => any) | undefined;
69
69
  readonly onBlur?: ((args_0: import("@vueuse/core").MaybeElement) => any) | undefined;
70
70
  readonly onFocus?: ((args_0: import("@vueuse/core").MaybeElement) => any) | undefined;
71
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "floating" | "label" | "disabled" | "modelValue" | "modifiers" | "icon" | "iconPosition" | "required" | "loading" | "loadingLabel" | "unselectable" | "multiple" | "readonly" | "hintLabel" | "invalid" | "invalidLabel" | "valid" | "validLabel" | "tabindex" | "options" | "labelKey" | "valueKey" | "disabledKey" | "autoselectFirst" | "showClearAction" | "iconClear" | "labelClear" | "autocomplete" | "autofocus">, "size" | "name" | "id" | "onFocus" | "onBlur" | "onClear" | "onUpdate:modelValue" | "placeholder" | ("floating" | "label" | "disabled" | "modelValue" | "modifiers" | "icon" | "iconPosition" | "required" | "loading" | "loadingLabel" | "unselectable" | "multiple" | "readonly" | "hintLabel" | "invalid" | "invalidLabel" | "valid" | "validLabel" | "tabindex" | "options" | "labelKey" | "valueKey" | "disabledKey" | "autoselectFirst" | "showClearAction" | "iconClear" | "labelClear" | "autocomplete" | "autofocus")> & {} & Partial<{}>> & import("vue").PublicProps;
71
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "floating" | "label" | "disabled" | "modelValue" | "modifiers" | "icon" | "iconPosition" | "required" | "loading" | "loadingLabel" | "unselectable" | "multiple" | "readonly" | "hintLabel" | "invalid" | "invalidLabel" | "valid" | "validLabel" | "tabindex" | "options" | "labelKey" | "valueKey" | "disabledKey" | "autoselectFirst" | "showClearAction" | "iconClear" | "labelClear" | "autocomplete" | "autofocus">, "size" | "name" | "id" | "onFocus" | "onBlur" | "placeholder" | "onClear" | "onUpdate:modelValue" | ("floating" | "label" | "disabled" | "modelValue" | "modifiers" | "icon" | "iconPosition" | "required" | "loading" | "loadingLabel" | "unselectable" | "multiple" | "readonly" | "hintLabel" | "invalid" | "invalidLabel" | "valid" | "validLabel" | "tabindex" | "options" | "labelKey" | "valueKey" | "disabledKey" | "autoselectFirst" | "showClearAction" | "iconClear" | "labelClear" | "autocomplete" | "autofocus")> & {} & {}> & import("vue").PublicProps;
72
72
  expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
73
73
  attrs: any;
74
74
  slots: {
@@ -118,5 +118,5 @@ declare const _default: <T extends string | Option>(__VLS_props: NonNullable<Awa
118
118
  };
119
119
  export default _default;
120
120
  type __VLS_PrettifyLocal<T> = {
121
- [K in keyof T]: T[K];
121
+ [K in keyof T as K]: T[K];
122
122
  } & {};
@@ -216,7 +216,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
216
216
  }
217
217
  );
218
218
  const pressed = computed(() => {
219
- return props.pressed || (dropdownExpanded == null ? void 0 : dropdownExpanded.value);
219
+ return props.pressed || dropdownExpanded?.value;
220
220
  });
221
221
  const { role } = useInjectedDropdownAction();
222
222
  const hasTag = computed(() => {
@@ -224,7 +224,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
224
224
  case props.disabled:
225
225
  return ActionTag.button;
226
226
  case props.to !== void 0:
227
- return (volver == null ? void 0 : volver.nuxt) ? resolveComponent(ActionTag.nuxtLink) : ActionTag.routerLink;
227
+ return volver?.nuxt ? resolveComponent(ActionTag.nuxtLink) : ActionTag.routerLink;
228
228
  case props.href !== void 0:
229
229
  return ActionTag.a;
230
230
  default:
@@ -233,10 +233,10 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
233
233
  });
234
234
  const hasProps = computed(() => {
235
235
  const toReturn = {
236
- ...dropdownAria == null ? void 0 : dropdownAria.value,
236
+ ...dropdownAria?.value,
237
237
  ariaPressed: pressed.value ? true : void 0,
238
238
  ariaLabel: props.ariaLabel,
239
- role: role == null ? void 0 : role.value
239
+ role: role?.value
240
240
  };
241
241
  switch (hasTag.value) {
242
242
  case ActionTag.a:
@@ -264,32 +264,29 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
264
264
  }
265
265
  });
266
266
  function onClick(e) {
267
- var _a;
268
267
  if (props.disabled) {
269
268
  e.preventDefault();
270
269
  return;
271
270
  }
272
- if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onClick) {
271
+ if (instance?.vnode.props?.onClick) {
273
272
  emit("click", e);
274
273
  return;
275
274
  }
276
- dropdownEventBus == null ? void 0 : dropdownEventBus.emit("click", e);
275
+ dropdownEventBus?.emit("click", e);
277
276
  }
278
277
  function onMouseover(e) {
279
- var _a;
280
- if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onMouseover) {
278
+ if (instance?.vnode.props?.onMouseover) {
281
279
  emit("mouseover", e);
282
280
  return;
283
281
  }
284
- dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseover", e);
282
+ dropdownEventBus?.emit("mouseover", e);
285
283
  }
286
284
  function onMouseleave(e) {
287
- var _a;
288
- if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onMouseleave) {
285
+ if (instance?.vnode.props?.onMouseleave) {
289
286
  emit("mouseleave", e);
290
287
  return;
291
288
  }
292
- dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseleave", e);
289
+ dropdownEventBus?.emit("mouseleave", e);
293
290
  }
294
291
  return (_ctx, _cache) => {
295
292
  return openBlock(), createBlock(resolveDynamicComponent(unref(hasTag)), mergeProps(unref(hasProps), {
@@ -360,7 +357,7 @@ function useModifiers(prefix, modifiers, others) {
360
357
  const toReturn = {
361
358
  [prefix]: true
362
359
  };
363
- const modifiersArray = typeof (modifiers == null ? void 0 : modifiers.value) === "string" ? modifiers.value.split(" ") : modifiers == null ? void 0 : modifiers.value;
360
+ const modifiersArray = typeof modifiers?.value === "string" ? modifiers.value.split(" ") : modifiers?.value;
364
361
  if (modifiersArray) {
365
362
  if (Array.isArray(modifiersArray)) {
366
363
  modifiersArray.forEach((modifier) => {
@@ -385,12 +382,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
385
382
  const emit = __emit;
386
383
  const { modifiers } = toRefs(props);
387
384
  function onClick(event) {
388
- var _a;
389
385
  const target = event.target;
390
- if (target == null ? void 0 : target.dataset.index) {
386
+ if (target?.dataset.index) {
391
387
  const index = Number.parseInt(target.dataset.index);
392
- const item = (_a = props.items) == null ? void 0 : _a[index];
393
- if (!item || (item == null ? void 0 : item.disabled)) {
388
+ const item = props.items?.[index];
389
+ if (!item || item?.disabled) {
394
390
  return;
395
391
  }
396
392
  emit("click", item);
@@ -416,9 +412,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
416
412
  renderList(_ctx.items, ({ on = {}, data, ...item }, index) => {
417
413
  return openBlock(), createBlock(_sfc_main$2, mergeProps({
418
414
  key: index,
419
- "data-index": index,
420
- ref_for: true
421
- }, item, toHandlers(on)), {
415
+ "data-index": index
416
+ }, { ref_for: true }, item, toHandlers(on)), {
422
417
  default: withCtx(() => [
423
418
  renderSlot(_ctx.$slots, "item", mergeProps({ ref_for: true }, { item, data, index }))
424
419
  ]),
@@ -475,8 +470,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
475
470
  const localModelValue = ref();
476
471
  const activeTabKey = computed({
477
472
  get: () => {
478
- var _a;
479
- return props.modelValue || localModelValue.value || ((_a = tabKeys.value) == null ? void 0 : _a[0]);
473
+ return props.modelValue || localModelValue.value || tabKeys.value?.[0];
480
474
  },
481
475
  set: (newValue) => {
482
476
  localModelValue.value = newValue;
@@ -484,10 +478,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
484
478
  }
485
479
  });
486
480
  const hasNavModifiers = computed(() => {
487
- var _a;
488
481
  return [
489
482
  "tabs",
490
- ...Array.isArray(props.navModifiers) ? props.navModifiers : ((_a = props.navModifiers) == null ? void 0 : _a.split(" ")) ?? []
483
+ ...Array.isArray(props.navModifiers) ? props.navModifiers : props.navModifiers?.split(" ") ?? []
491
484
  ];
492
485
  });
493
486
  function onNavClick(item) {
@@ -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).VvTab=t(e.vue)}(this,(function(e){"use strict";var t=(e=>(e.local="local",e.session="session",e))(t||{}),o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{}),l=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(l||{});const a=Symbol.for("volver"),i=Symbol.for("dropdownTrigger"),s=Symbol.for("dropdownAction"),u={to:{type:[String,Object]},href:String,target:String,rel:{type:String,default:"noopener noreferrer"}},d={disabled:{type:Boolean,default:!1}},c={active:{type:Boolean,default:!1}},v={current:{type:Boolean,default:!1}},m={pressed:{type:Boolean,default:!1}},f={label:{type:[String,Number],default:void 0}},p={modifiers:{type:[String,Array],default:void 0}};r.before,o.bottom;const b={...d,...f,...m,...c,...v,...u,type:{type:String,default:n.button,validator:e=>Object.values(n).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:l.button}},y={items:{type:Array,default:()=>[]}};t.local;const g={...p,...y},k=b;const S=e.defineComponent({name:"VvAction",props:k,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:r}){const n=t,u=r,d=e.getCurrentInstance(),c=e.inject(a,void 0),v=e.ref(null);o({$el:v});const{reference:m,bus:f,aria:p,expanded:b}=e.inject(i,{});e.watch((()=>v.value),(e=>{m&&(m.value=e)}));const y=e.computed((()=>n.pressed||(null==b?void 0:b.value))),{role:g}=e.inject(s,{}),k=e.computed((()=>{switch(!0){case n.disabled:return l.button;case void 0!==n.to:return(null==c?void 0:c.nuxt)?e.resolveComponent(l.nuxtLink):l.routerLink;case void 0!==n.href:return l.a;default:return n.defaultTag}})),S=e.computed((()=>{const e={...null==p?void 0:p.value,ariaPressed:!!y.value||void 0,ariaLabel:n.ariaLabel,role:null==g?void 0:g.value};switch(k.value){case l.a:return{...e,href:n.href,target:n.target,rel:n.rel};case l.routerLink:case l.nuxtLink:return{...e,to:n.to,target:n.target};case l.button:return{...e,type:n.type,disabled:n.disabled};default:return e}}));function B(e){var t;n.disabled?e.preventDefault():(null==(t=null==d?void 0:d.vnode.props)?void 0:t.onClick)?u("click",e):null==f||f.emit("click",e)}function x(e){var t;(null==(t=null==d?void 0:d.vnode.props)?void 0:t.onMouseover)?u("mouseover",e):null==f||f.emit("mouseover",e)}function h(e){var t;(null==(t=null==d?void 0:d.vnode.props)?void 0:t.onMouseleave)?u("mouseleave",e):null==f||f.emit("mouseleave",e)}return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(S),{ref_key:"element",ref:v,class:{active:t.active,pressed:e.unref(y),disabled:t.disabled,current:t.current},onClickPassive:B,onMouseoverPassive:x,onMouseleavePassive:h}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}}),B={class:"vv-nav__item",role:"presentation"},x=e.defineComponent({name:"VvNavItem",inheritAttrs:!1,setup:t=>(t,o)=>(e.openBlock(),e.createElementBlock("li",B,[e.renderSlot(t.$slots,"before"),e.createVNode(S,e.mergeProps(t.$attrs,{class:"vv-nav__item-label",role:"menuitem"}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default")])),_:3},16),e.renderSlot(t.$slots,"after")]))});function h(t,o,r){return e.computed((()=>{const e={[t]:!0},r="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return r&&Array.isArray(r)&&r.forEach((o=>{o&&(e[`${t}--${o}`]=!0)})),e}))}const C=e.defineComponent({name:"VvNav",props:g,emits:["click"],setup(t,{emit:o}){const r=t,n=o,{modifiers:l}=e.toRefs(r);function a(e){var t;const o=e.target;if(null==o?void 0:o.dataset.index){const e=Number.parseInt(o.dataset.index),l=null==(t=r.items)?void 0:t[e];if(!l||(null==l?void 0:l.disabled))return;n("click",l)}}const i=h("vv-nav",l);return(t,o)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(i))},[e.createElementVNode("ul",{class:"vv-nav__menu",role:"menu",onClick:e.withModifiers(a,["stop"])},[e.renderSlot(t.$slots,"default",{},(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(({on:o={},data:r,...n},l)=>(e.openBlock(),e.createBlock(x,e.mergeProps({key:l,"data-index":l,ref_for:!0},n,e.toHandlers(o)),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"item",e.mergeProps({ref_for:!0},{item:n,data:r,index:l}))])),_:2},1040,["data-index"])))),128))]))])],2))}}),_={...p,navModifiers:{type:[String,Array]},modelValue:{type:String,default:""},items:{type:Array,default:()=>[]}};return e.defineComponent({name:"VvTab",props:_,emits:["update:modelValue"],setup(t,{emit:o}){const r=t,n=o,{modifiers:l,items:a}=e.toRefs(r),i=e.computed((()=>a.value.reduce(((e,t)=>(t.tab&&e.push(t.tab),e)),[]))),s=e.ref(),u=e.computed({get:()=>{var e;return r.modelValue||s.value||(null==(e=i.value)?void 0:e[0])},set:e=>{s.value=e,n("update:modelValue",e)}}),d=e.computed((()=>{var e;return["tabs",...Array.isArray(r.navModifiers)?r.navModifiers:(null==(e=r.navModifiers)?void 0:e.split(" "))??[]]}));function c(e){e.tab&&(u.value=e.tab)}const v=e.computed((()=>r.items.map((e=>({current:e.tab===u.value,...e}))))),m=h("vv-tab",l);return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(m))},[e.createVNode(C,e.mergeProps({items:e.unref(v),modifiers:e.unref(d)},{onClick:c}),{item:e.withCtx((({item:o,data:r,index:n})=>[e.renderSlot(t.$slots,"nav-item",e.normalizeProps(e.guardReactiveProps({item:o,data:r,index:n})))])),_:3},16),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a),((o,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[o.tab?(e.openBlock(),e.createElementBlock("article",{key:0,class:e.normalizeClass([{target:e.unref(u)===o.tab},"vv-tab__panel"])},[e.renderSlot(t.$slots,`panel::${o.tab}`)],2)):e.createCommentVNode("v-if",!0)],64)))),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).VvTab=t(e.Vue)}(this,function(e){"use strict";var t=(e=>(e.local="local",e.session="session",e))(t||{}),o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{}),a=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(a||{});const l=Symbol.for("volver"),s=Symbol.for("dropdownTrigger"),i=Symbol.for("dropdownAction"),u={to:{type:[String,Object]},href:String,target:String,rel:{type:String,default:"noopener noreferrer"}},d={disabled:{type:Boolean,default:!1}},c={active:{type:Boolean,default:!1}},m={current:{type:Boolean,default:!1}},f={pressed:{type:Boolean,default:!1}},p={label:{type:[String,Number],default:void 0}},v={modifiers:{type:[String,Array],default:void 0}};r.before,o.bottom;const b={...d,...p,...f,...c,...m,...u,type:{type:String,default:n.button,validator:e=>Object.values(n).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:a.button}},y={items:{type:Array,default:()=>[]}};t.local;const g={...v,...y},k=b;const S=e.defineComponent({name:"VvAction",props:k,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:r}){const n=t,u=r,d=e.getCurrentInstance(),c=e.inject(l,void 0),m=e.ref(null);o({$el:m});const{reference:f,bus:p,aria:v,expanded:b}=e.inject(s,{});e.watch(()=>m.value,e=>{f&&(f.value=e)});const y=e.computed(()=>n.pressed||b?.value),{role:g}=e.inject(i,{}),k=e.computed(()=>{switch(!0){case n.disabled:return a.button;case void 0!==n.to:return c?.nuxt?e.resolveComponent(a.nuxtLink):a.routerLink;case void 0!==n.href:return a.a;default:return n.defaultTag}}),S=e.computed(()=>{const e={...v?.value,ariaPressed:!!y.value||void 0,ariaLabel:n.ariaLabel,role:g?.value};switch(k.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}});function B(e){n.disabled?e.preventDefault():d?.vnode.props?.onClick?u("click",e):p?.emit("click",e)}function x(e){d?.vnode.props?.onMouseover?u("mouseover",e):p?.emit("mouseover",e)}function h(e){d?.vnode.props?.onMouseleave?u("mouseleave",e):p?.emit("mouseleave",e)}return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(S),{ref_key:"element",ref:m,class:{active:t.active,pressed:e.unref(y),disabled:t.disabled,current:t.current},onClickPassive:B,onMouseoverPassive:x,onMouseleavePassive:h}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)])]),_:3},16,["class"]))}}),B={class:"vv-nav__item",role:"presentation"},x=e.defineComponent({name:"VvNavItem",inheritAttrs:!1,setup:t=>(t,o)=>(e.openBlock(),e.createElementBlock("li",B,[e.renderSlot(t.$slots,"before"),e.createVNode(S,e.mergeProps(t.$attrs,{class:"vv-nav__item-label",role:"menuitem"}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16),e.renderSlot(t.$slots,"after")]))});function h(t,o,r){return e.computed(()=>{const e={[t]:!0},r="string"==typeof o?.value?o.value.split(" "):o?.value;return r&&Array.isArray(r)&&r.forEach(o=>{o&&(e[`${t}--${o}`]=!0)}),e})}const C=e.defineComponent({name:"VvNav",props:g,emits:["click"],setup(t,{emit:o}){const r=t,n=o,{modifiers:a}=e.toRefs(r);function l(e){const t=e.target;if(t?.dataset.index){const e=Number.parseInt(t.dataset.index),o=r.items?.[e];if(!o||o?.disabled)return;n("click",o)}}const s=h("vv-nav",a);return(t,o)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(s))},[e.createElementVNode("ul",{class:"vv-nav__menu",role:"menu",onClick:e.withModifiers(l,["stop"])},[e.renderSlot(t.$slots,"default",{},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,({on:o={},data:r,...n},a)=>(e.openBlock(),e.createBlock(x,e.mergeProps({key:a,"data-index":a},{ref_for:!0},n,e.toHandlers(o)),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"item",e.mergeProps({ref_for:!0},{item:n,data:r,index:a}))]),_:2},1040,["data-index"]))),128))])])],2))}}),V={...v,navModifiers:{type:[String,Array]},modelValue:{type:String,default:""},items:{type:Array,default:()=>[]}};return e.defineComponent({name:"VvTab",props:V,emits:["update:modelValue"],setup(t,{emit:o}){const r=t,n=o,{modifiers:a,items:l}=e.toRefs(r),s=e.computed(()=>l.value.reduce((e,t)=>(t.tab&&e.push(t.tab),e),[])),i=e.ref(),u=e.computed({get:()=>r.modelValue||i.value||s.value?.[0],set:e=>{i.value=e,n("update:modelValue",e)}}),d=e.computed(()=>["tabs",...Array.isArray(r.navModifiers)?r.navModifiers:r.navModifiers?.split(" ")??[]]);function c(e){e.tab&&(u.value=e.tab)}const m=e.computed(()=>r.items.map(e=>({current:e.tab===u.value,...e}))),f=h("vv-tab",a);return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(f))},[e.createVNode(C,e.mergeProps({items:e.unref(m),modifiers:e.unref(d)},{onClick:c}),{item:e.withCtx(({item:o,data:r,index:n})=>[e.renderSlot(t.$slots,"nav-item",e.normalizeProps(e.guardReactiveProps({item:o,data:r,index:n})))]),_:3},16),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l),(o,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[o.tab?(e.openBlock(),e.createElementBlock("article",{key:0,class:e.normalizeClass([{target:e.unref(u)===o.tab},"vv-tab__panel"])},[e.renderSlot(t.$slots,`panel::${o.tab}`)],2)):e.createCommentVNode("v-if",!0)],64))),128))],2))}})});