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

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 (135) hide show
  1. package/dist/components/VvAccordion/VvAccordion.es.js +9 -2
  2. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  3. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +9 -2
  4. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  5. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +1 -1
  6. package/dist/components/VvAction/VvAction.es.js +9 -1
  7. package/dist/components/VvAction/VvAction.umd.js +1 -1
  8. package/dist/components/VvAction/VvAction.vue.d.ts +3 -0
  9. package/dist/components/VvAction/index.d.ts +1 -0
  10. package/dist/components/VvAlert/VvAlert.es.js +9 -2
  11. package/dist/components/VvAlert/VvAlert.umd.js +1 -1
  12. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +9 -2
  13. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
  14. package/dist/components/VvAvatar/VvAvatar.es.js +7 -0
  15. package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
  16. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +9 -2
  17. package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
  18. package/dist/components/VvBadge/VvBadge.es.js +7 -0
  19. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  20. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +7 -0
  21. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  22. package/dist/components/VvButton/VvButton.es.js +11 -3
  23. package/dist/components/VvButton/VvButton.umd.js +1 -1
  24. package/dist/components/VvButton/VvButton.vue.d.ts +6 -3
  25. package/dist/components/VvButton/index.d.ts +1 -0
  26. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +7 -0
  27. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  28. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +2 -2
  29. package/dist/components/VvCard/VvCard.es.js +7 -0
  30. package/dist/components/VvCard/VvCard.umd.js +1 -1
  31. package/dist/components/VvCheckbox/VvCheckbox.es.js +9 -2
  32. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  33. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +3 -3
  34. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +9 -2
  35. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  36. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +3 -3
  37. package/dist/components/VvCombobox/VvCombobox.es.js +18 -4
  38. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  39. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +37 -37
  40. package/dist/components/VvCombobox/index.d.ts +13 -11
  41. package/dist/components/VvDialog/VvDialog.es.js +7 -0
  42. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  43. package/dist/components/VvDropdown/VvDropdown.es.js +9 -2
  44. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  45. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +31 -31
  46. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +3 -0
  47. package/dist/components/VvDropdown/index.d.ts +10 -10
  48. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +9 -1
  49. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  50. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +7 -0
  51. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
  52. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +7 -0
  53. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
  54. package/dist/components/VvInputText/VvInputClearAction.d.ts +1 -1
  55. package/dist/components/VvInputText/VvInputText.es.js +9 -2
  56. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  57. package/dist/components/VvInputText/VvInputText.vue.d.ts +4 -4
  58. package/dist/components/VvNav/VvNav.es.js +69 -56
  59. package/dist/components/VvNav/VvNav.umd.js +1 -1
  60. package/dist/components/VvNav/VvNav.vue.d.ts +12 -8
  61. package/dist/components/VvNav/VvNavItem.vue.d.ts +9 -0
  62. package/dist/components/VvNav/index.d.ts +1 -12
  63. package/dist/components/VvNavItem/VvNavItem.es.js +392 -0
  64. package/dist/components/VvNavItem/VvNavItem.umd.js +1 -0
  65. package/dist/components/VvNavSeparator/VvNavSeparator.es.js +24 -0
  66. package/dist/components/VvNavSeparator/VvNavSeparator.umd.js +1 -0
  67. package/dist/components/VvProgress/VvProgress.es.js +7 -0
  68. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  69. package/dist/components/VvRadio/VvRadio.es.js +9 -2
  70. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  71. package/dist/components/VvRadio/VvRadio.vue.d.ts +3 -3
  72. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +9 -2
  73. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  74. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +3 -3
  75. package/dist/components/VvSelect/VvSelect.es.js +9 -2
  76. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  77. package/dist/components/VvSelect/VvSelect.vue.d.ts +7 -7
  78. package/dist/components/VvTab/VvTab.es.js +127 -87
  79. package/dist/components/VvTab/VvTab.umd.js +1 -1
  80. package/dist/components/VvTab/VvTab.vue.d.ts +19 -6
  81. package/dist/components/VvTab/index.d.ts +9 -3
  82. package/dist/components/VvTextarea/VvTextarea.es.js +9 -2
  83. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  84. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +3 -3
  85. package/dist/components/VvTooltip/VvTooltip.es.js +7 -0
  86. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  87. package/dist/components/index.es.js +249 -203
  88. package/dist/components/index.umd.js +1 -1
  89. package/dist/directives/index.es.js +7 -0
  90. package/dist/directives/index.umd.js +1 -1
  91. package/dist/directives/v-tooltip.es.js +7 -0
  92. package/dist/directives/v-tooltip.umd.js +1 -1
  93. package/dist/icons.es.js +3 -3
  94. package/dist/icons.umd.js +1 -1
  95. package/dist/props/index.d.ts +29 -12
  96. package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +5 -5
  97. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +31 -31
  98. package/dist/stories/Tab/Tab.settings.d.ts +3 -23
  99. package/dist/types/alert.d.ts +13 -0
  100. package/dist/types/floating-ui.d.ts +6 -0
  101. package/dist/types/generic.d.ts +5 -0
  102. package/dist/types/group.d.ts +37 -0
  103. package/dist/types/nav.d.ts +17 -0
  104. package/package.json +51 -43
  105. package/src/assets/icons/detailed.json +1 -1
  106. package/src/assets/icons/normal.json +1 -1
  107. package/src/assets/icons/simple.json +1 -1
  108. package/src/components/VvAccordion/VvAccordion.vue +2 -2
  109. package/src/components/VvAction/VvAction.vue +1 -0
  110. package/src/components/VvCombobox/VvCombobox.vue +11 -4
  111. package/src/components/VvNav/VvNav.vue +29 -51
  112. package/src/components/VvNav/VvNavItem.vue +18 -0
  113. package/src/components/VvNav/VvNavSeparator.vue +11 -0
  114. package/src/components/VvNav/index.ts +2 -15
  115. package/src/components/VvTab/VvTab.vue +60 -36
  116. package/src/components/VvTab/index.ts +10 -4
  117. package/src/composables/useUniqueId.ts +2 -2
  118. package/src/props/index.ts +19 -3
  119. package/src/stories/Nav/Nav.settings.ts +3 -4
  120. package/src/stories/Nav/Nav.test.ts +4 -15
  121. package/src/stories/Tab/Tab.settings.ts +8 -8
  122. package/src/stories/Tab/Tab.stories.ts +2 -2
  123. package/src/stories/Tab/Tab.test.ts +6 -14
  124. package/src/stories/argTypes.ts +1 -1
  125. package/src/types/nav.ts +19 -0
  126. package/dist/components/VvNav/VvNavItemTitle.vue.d.ts +0 -6
  127. package/dist/components/VvNavItemTitle/VvNavItemTitle.es.js +0 -19
  128. package/dist/components/VvNavItemTitle/VvNavItemTitle.umd.js +0 -1
  129. package/src/components/VvNav/VvNavItemTitle.vue +0 -11
  130. package/src/components/VvNav/VvNavSeparator.ts +0 -8
  131. /package/dist/components/VvNav/{VvNavSeparator.d.ts → VvNavSeparator.vue.d.ts} +0 -0
  132. /package/src/types/{alert.d.ts → alert.ts} +0 -0
  133. /package/src/types/{floating-ui.d.ts → floating-ui.ts} +0 -0
  134. /package/src/types/{generic.d.ts → generic.ts} +0 -0
  135. /package/src/types/{group.d.ts → group.ts} +0 -0
@@ -82,14 +82,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
82
82
  }>> & {
83
83
  [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
84
84
  }, {
85
+ readonly: boolean;
85
86
  disabled: boolean;
87
+ valid: boolean;
88
+ invalid: boolean;
86
89
  options: (string | Option)[];
87
90
  loading: boolean;
88
91
  loadingLabel: string;
89
- readonly: boolean;
90
92
  hintLabel: string;
91
- invalid: boolean;
92
- valid: boolean;
93
93
  vertical: boolean;
94
94
  labelKey: string | Function;
95
95
  valueKey: string | Function;
@@ -1,6 +1,6 @@
1
1
  import { inject, computed, unref, defineComponent, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, isRef, h, watch, useSlots, createElementBlock, normalizeClass, toDisplayString, createElementVNode, renderSlot, normalizeProps, guardReactiveProps, withDirectives, Fragment, renderList, vModelSelect, createVNode, createSlots, withCtx } from "vue";
2
2
  import { iconExists, Icon, addIcon } from "@iconify/vue";
3
- import { nanoid } from "nanoid";
3
+ import { uid } from "uid";
4
4
  import { useFocus, useElementVisibility } from "@vueuse/core";
5
5
  import { get } from "ts-dot-prop";
6
6
  const VvIconProps = {
@@ -457,6 +457,12 @@ const ActiveProps = {
457
457
  */
458
458
  active: Boolean
459
459
  };
460
+ const CurrentProps = {
461
+ /**
462
+ * Whether the item is current
463
+ */
464
+ current: Boolean
465
+ };
460
466
  const PressedProps = {
461
467
  /**
462
468
  * Whether the item is pressed
@@ -666,6 +672,7 @@ const AutocompleteProps = {
666
672
  ...LabelProps,
667
673
  ...PressedProps,
668
674
  ...ActiveProps,
675
+ ...CurrentProps,
669
676
  ...LinkProps,
670
677
  /**
671
678
  * Button type
@@ -785,7 +792,7 @@ function useDefaults(componentName, propsDefinition, props) {
785
792
  }, {});
786
793
  });
787
794
  }
788
- const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || nanoid()));
795
+ const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || uid()));
789
796
  function useComponentFocus(inputTemplateRef, emit) {
790
797
  const { focused } = useFocus(inputTemplateRef);
791
798
  watch(focused, (newValue) => {
@@ -1 +1 @@
1
- !function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("@iconify/vue"),require("nanoid"),require("@vueuse/core"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","nanoid","@vueuse/core","ts-dot-prop"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvSelect=l(e.vue,e.vue$1,e.nanoid,e.core,e.tsDotProp)}(this,(function(e,l,o,t,n){"use strict";const a={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 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||{});const d=Symbol.for("volver");function s(){return e.inject(d)}function c(l,o,t){return e.computed((()=>{const n={[l]:!0},a="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return a&&Array.isArray(a)&&a.forEach((e=>{e&&(n[`${l}--${e}`]=!0)})),t&&Object.keys(t.value).forEach((o=>{n[`${l}--${o}`]=e.unref(t.value[o])})),n}))}const v=e.defineComponent({name:"VvIcon",props:a,setup(o){const t=o,n=e.computed((()=>"string"==typeof t.rotate?parseFloat(t.rotate):t.rotate)),a=e.ref(!0),i=s(),{modifiers:r}=e.toRefs(t),u=c("vv-icon",r),d=e.computed((()=>t.provider||(null==i?void 0:i.iconsProvider))),v=e.computed((()=>{const e=t.name??"",o=`@${d.value}:${t.prefix}:${e}`;if(l.iconExists(o))return o;const n=null==i?void 0:i.iconsCollections.find((o=>{const t=`@${d.value}:${o.prefix}:${e}`;return l.iconExists(t)}));return n?`@${d.value}:${n.prefix}:${e}`:e}));function p(e){const o=function(e){let l;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");l=(new e).window}return(l?new l.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),n=(null==o?void 0:o.innerHTML.trim())||"";o&&n&&l.addIcon(`@${d.value}:${t.prefix}:${t.name}`,{body:n,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return i&&t.src&&!l.iconExists(`@${d.value}:${t.prefix}:${t.name}`)&&(a.value=!1,i.fetchIcon(t.src).then((e=>{e&&(p(e),a.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),t.svg&&p(t.svg),(o,t)=>e.unref(a)?(e.openBlock(),e.createBlock(e.unref(l.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(n),color:o.color,onLoad:o.onLoad,icon:e.unref(v)}),null,16,["class"])):e.createCommentVNode("",!0)}});function p(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}const f={valid:Boolean,validLabel:[String,Array]},m={invalid:Boolean,invalidLabel:[String,Array]},g={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},b={disabled:Boolean},h=(Boolean,Boolean,{label:[String,Number]}),y={readonly:Boolean},S={modifiers:[String,Array]},B={hintLabel:{type:String,default:""}},k={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},L={icon:{type:[String,Object]},iconPosition:{type:String,default:r.before,validation:e=>Object.values(r).includes(e)}},$={tabindex:{type:[String,Number],default:0}},V={floating:Boolean},O={unselectable:{type:Boolean,default:!0}},w={id:[String,Number]};i.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const E={...w,name:{type:String,required:!0}},P={autofocus:Boolean},x={autocomplete:{type:String,default:"off"}};u.button;const N={...E,...P,...x,...$,...f,...m,...B,...g,...b,...y,...S,...k,...L,...V,...O,...h,multiple:Boolean,required:Boolean,size:[String,Number],modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},placeholder:String};const I=["for"],A={class:"vv-select__wrapper"},_={key:0,class:"vv-select__input-before"},j={class:"vv-select__inner"},C=["id"],F=["disabled","hidden"],z=["disabled","value"],q=["disabled","label"],D=["disabled","value"],R={key:1,class:"vv-select__input-after"};return e.defineComponent({name:"VvSelect",props:N,emits:["update:modelValue","focus","blur"],setup(l,{emit:a}){const u=l,d=e.useSlots(),f=function(l,o,t){const n=s(),a=e.computed((()=>{var e;if(n&&(null==(e=n.defaults.value)?void 0:e[l]))return n.defaults.value[l]}));return e.computed((()=>{if(void 0===a.value)return t;const e=a.value,l=o,n=t;return Object.keys(l).reduce(((o,t)=>{const a=n[t];if(o[t]=a,t in e){if(Array.isArray(l[t])){const n=l[t];n.length&&n[0]===a&&(o[t]=e[t])}if("function"==typeof l[t]&&(0,l[t])()===a&&(o[t]=e[t]),"object"==typeof l[t]){let n=l[t].default;"function"==typeof n&&(n=n()),"object"==typeof n?JSON.stringify(n)===JSON.stringify(a)&&(o[t]=e[t]):n===a&&(o[t]=e[t])}}return o}),{})}))}("VvSelect",N,u),m=e.ref(),{HintSlot:g,hasHintLabelOrSlot:b,hasInvalidLabelOrSlot:h,hintSlotScope:y}=function(l,o){const t=e.computed((()=>e.isRef(l)?l.value:l)),n=e.computed((()=>p(t.value.invalidLabel))),a=e.computed((()=>p(t.value.validLabel))),i=e.computed((()=>t.value.loadingLabel)),r=e.computed((()=>t.value.hintLabel)),u=e.computed((()=>Boolean(t.value.loading&&(o.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(t.value.invalid&&(o.invalid||n.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(t.value.valid&&(o.valid||a.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)),f=e.computed((()=>({modelValue:t.value.modelValue,valid:t.value.valid,invalid:t.value.invalid,loading:t.value.loading}))),m=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:v,invalidLabel:n,validLabel:a,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:c}),render(){var l,o,t,n,a,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==(o=(l=this.$slots).loading)?void 0:o.call(l))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(n=(t=this.$slots).invalid)?void 0:n.call(t))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(a=this.$slots).valid)?void 0:i.call(a))??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:f,HintSlot:m}}(f,d),{id:S,modifiers:B,disabled:k,readonly:L,loading:$,icon:V,iconPosition:O,invalid:w,valid:E,floating:P,multiple:x}=e.toRefs(u),H=(l=>e.computed((()=>String((null==l?void 0:l.value)||o.nanoid()))))(S),K=e.computed((()=>`${H.value}-hint`)),{focused:M}=function(l,o){const{focused:n}=t.useFocus(l);return e.watch(n,(t=>{o(t?"focus":"blur",e.unref(l))})),{focused:n}}(m,a),T=t.useElementVisibility(m);e.watch(T,(e=>{e&&u.autofocus&&(M.value=!0)}));const{hasIcon:J,hasIconBefore:G,hasIconAfter:U}=function(l,o){const t=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===r.before))),n=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===r.after))),a=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.left))),u=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.right))),d=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.top))),s=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.bottom)));return{hasIcon:e.computed((()=>"string"==typeof(null==l?void 0:l.value)?{name:null==l?void 0:l.value}:null==l?void 0:l.value)),hasIconLeft:a,hasIconRight:u,hasIconTop:d,hasIconBottom:s,hasIconBefore:t,hasIconAfter:n}}(V,O),Q=e.computed((()=>{return l=u.modelValue,!(null==(o=e.unref(l))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length);var l,o})),W=e.computed((()=>u.disabled||u.readonly)),X=e.computed((()=>W.value?-1:u.tabindex)),Y=e.computed((()=>!0===u.invalid||!0!==u.valid&&void 0)),Z=c("vv-select",B,e.computed((()=>({valid:E.value,invalid:w.value,loading:$.value,disabled:k.value,readonly:L.value,"icon-before":G.value,"icon-after":U.value,dirty:Q.value,focus:M.value,floating:P.value,multiple:x.value})))),ee=e.computed((()=>({name:u.name,tabindex:X.value,disabled:W.value,required:u.required,size:u.size,autocomplete:u.autocomplete,multiple:u.multiple,"aria-invalid":Y.value,"aria-describedby":b.value?K.value:void 0,"aria-errormessage":h.value?K.value:void 0}))),le=e.computed((()=>({valid:u.valid,invalid:u.invalid,modelValue:u.modelValue}))),{getOptionLabel:oe,getOptionValue:te,isOptionDisabled:ne,getOptionGrouped:ae}=function(l){const{options:o,labelKey:t,valueKey:a,disabledKey:i}=e.toRefs(l);return{options:o,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof t.value?t.value(e):n.get(e,t.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof a.value?a.value(e):n.get(e,a.value),isOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof i.value?i.value(e):n.get(e,i.value)),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(u),ie=e.computed({get:()=>u.modelValue,set:e=>{Array.isArray(e)&&(e=e.filter((e=>void 0!==e))),a("update:modelValue",e)}}),re=e=>"string"!=typeof e&&(e&&e.options&&e.options.length>0);return(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Z))},[l.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(H)},e.toDisplayString(l.label),9,I)):e.createCommentVNode("",!0),e.createElementVNode("div",A,[l.$slots.before?(e.openBlock(),e.createElementBlock("div",_,[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(le))))])):e.createCommentVNode("",!0),e.createElementVNode("div",j,[e.unref(G)?(e.openBlock(),e.createBlock(v,e.mergeProps({key:0,class:"vv-select__icon"},e.unref(J)),null,16)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("select",e.mergeProps({id:e.unref(H),ref_key:"select",ref:m,"onUpdate:modelValue":o[0]||(o[0]=l=>e.isRef(ie)?ie.value=l:null)},e.unref(ee)),[l.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,value:void 0,disabled:!l.unselectable,hidden:!l.unselectable},e.toDisplayString(l.placeholder),9,F)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options,((l,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[re(l)?(e.openBlock(),e.createElementBlock("optgroup",{key:`group-${o}`,disabled:e.unref(ne)(l),label:e.unref(oe)(l)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ae)(l),((l,t)=>(e.openBlock(),e.createElementBlock("option",{key:`group-${o}-item-${t}`,disabled:e.unref(ne)(l),value:e.unref(te)(l)},e.toDisplayString(e.unref(oe)(l)),9,D)))),128))],8,q)):(e.openBlock(),e.createElementBlock("option",{key:o,disabled:e.unref(ne)(l),value:e.unref(te)(l)},e.toDisplayString(e.unref(oe)(l)),9,z))],64)))),256))],16,C),[[e.vModelSelect,e.unref(ie)]]),e.unref(U)?(e.openBlock(),e.createBlock(v,e.mergeProps({key:1,class:"vv-select__icon vv-select__icon-after"},e.unref(J)),null,16)):e.createCommentVNode("",!0)]),l.$slots.after?(e.openBlock(),e.createElementBlock("div",R,[e.renderSlot(l.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(le))))])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(g),{id:e.unref(K),class:"vv-select__hint"},e.createSlots({_:2},[l.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"0"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"1"}:void 0,l.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"2"}:void 0,l.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
1
+ !function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("@iconify/vue"),require("uid"),require("@vueuse/core"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","uid","@vueuse/core","ts-dot-prop"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvSelect=l(e.vue,e.vue$1,e.uid,e.core,e.tsDotProp)}(this,(function(e,l,o,t,n){"use strict";const a={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 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||{});const d=Symbol.for("volver");function s(){return e.inject(d)}function c(l,o,t){return e.computed((()=>{const n={[l]:!0},a="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return a&&Array.isArray(a)&&a.forEach((e=>{e&&(n[`${l}--${e}`]=!0)})),t&&Object.keys(t.value).forEach((o=>{n[`${l}--${o}`]=e.unref(t.value[o])})),n}))}const v=e.defineComponent({name:"VvIcon",props:a,setup(o){const t=o,n=e.computed((()=>"string"==typeof t.rotate?parseFloat(t.rotate):t.rotate)),a=e.ref(!0),i=s(),{modifiers:r}=e.toRefs(t),u=c("vv-icon",r),d=e.computed((()=>t.provider||(null==i?void 0:i.iconsProvider))),v=e.computed((()=>{const e=t.name??"",o=`@${d.value}:${t.prefix}:${e}`;if(l.iconExists(o))return o;const n=null==i?void 0:i.iconsCollections.find((o=>{const t=`@${d.value}:${o.prefix}:${e}`;return l.iconExists(t)}));return n?`@${d.value}:${n.prefix}:${e}`:e}));function p(e){const o=function(e){let l;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");l=(new e).window}return(l?new l.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),n=(null==o?void 0:o.innerHTML.trim())||"";o&&n&&l.addIcon(`@${d.value}:${t.prefix}:${t.name}`,{body:n,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return i&&t.src&&!l.iconExists(`@${d.value}:${t.prefix}:${t.name}`)&&(a.value=!1,i.fetchIcon(t.src).then((e=>{e&&(p(e),a.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),t.svg&&p(t.svg),(o,t)=>e.unref(a)?(e.openBlock(),e.createBlock(e.unref(l.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(n),color:o.color,onLoad:o.onLoad,icon:e.unref(v)}),null,16,["class"])):e.createCommentVNode("",!0)}});function p(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}const f={valid:Boolean,validLabel:[String,Array]},m={invalid:Boolean,invalidLabel:[String,Array]},g={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},b={disabled:Boolean},h=(Boolean,Boolean,Boolean,{label:[String,Number]}),y={readonly:Boolean},S={modifiers:[String,Array]},B={hintLabel:{type:String,default:""}},k={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},L={icon:{type:[String,Object]},iconPosition:{type:String,default:r.before,validation:e=>Object.values(r).includes(e)}},$={tabindex:{type:[String,Number],default:0}},V={floating:Boolean},O={unselectable:{type:Boolean,default:!0}},w={id:[String,Number]};i.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const E={...w,name:{type:String,required:!0}},P={autofocus:Boolean},x={autocomplete:{type:String,default:"off"}};u.button;const N={...E,...P,...x,...$,...f,...m,...B,...g,...b,...y,...S,...k,...L,...V,...O,...h,multiple:Boolean,required:Boolean,size:[String,Number],modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},placeholder:String};const I=["for"],A={class:"vv-select__wrapper"},_={key:0,class:"vv-select__input-before"},j={class:"vv-select__inner"},C=["id"],F=["disabled","hidden"],z=["disabled","value"],q=["disabled","label"],D=["disabled","value"],R={key:1,class:"vv-select__input-after"};return e.defineComponent({name:"VvSelect",props:N,emits:["update:modelValue","focus","blur"],setup(l,{emit:a}){const u=l,d=e.useSlots(),f=function(l,o,t){const n=s(),a=e.computed((()=>{var e;if(n&&(null==(e=n.defaults.value)?void 0:e[l]))return n.defaults.value[l]}));return e.computed((()=>{if(void 0===a.value)return t;const e=a.value,l=o,n=t;return Object.keys(l).reduce(((o,t)=>{const a=n[t];if(o[t]=a,t in e){if(Array.isArray(l[t])){const n=l[t];n.length&&n[0]===a&&(o[t]=e[t])}if("function"==typeof l[t]&&(0,l[t])()===a&&(o[t]=e[t]),"object"==typeof l[t]){let n=l[t].default;"function"==typeof n&&(n=n()),"object"==typeof n?JSON.stringify(n)===JSON.stringify(a)&&(o[t]=e[t]):n===a&&(o[t]=e[t])}}return o}),{})}))}("VvSelect",N,u),m=e.ref(),{HintSlot:g,hasHintLabelOrSlot:b,hasInvalidLabelOrSlot:h,hintSlotScope:y}=function(l,o){const t=e.computed((()=>e.isRef(l)?l.value:l)),n=e.computed((()=>p(t.value.invalidLabel))),a=e.computed((()=>p(t.value.validLabel))),i=e.computed((()=>t.value.loadingLabel)),r=e.computed((()=>t.value.hintLabel)),u=e.computed((()=>Boolean(t.value.loading&&(o.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(t.value.invalid&&(o.invalid||n.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(t.value.valid&&(o.valid||a.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)),f=e.computed((()=>({modelValue:t.value.modelValue,valid:t.value.valid,invalid:t.value.invalid,loading:t.value.loading}))),m=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:v,invalidLabel:n,validLabel:a,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:c}),render(){var l,o,t,n,a,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==(o=(l=this.$slots).loading)?void 0:o.call(l))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(n=(t=this.$slots).invalid)?void 0:n.call(t))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(a=this.$slots).valid)?void 0:i.call(a))??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:f,HintSlot:m}}(f,d),{id:S,modifiers:B,disabled:k,readonly:L,loading:$,icon:V,iconPosition:O,invalid:w,valid:E,floating:P,multiple:x}=e.toRefs(u),H=(l=>e.computed((()=>String((null==l?void 0:l.value)||o.uid()))))(S),K=e.computed((()=>`${H.value}-hint`)),{focused:M}=function(l,o){const{focused:n}=t.useFocus(l);return e.watch(n,(t=>{o(t?"focus":"blur",e.unref(l))})),{focused:n}}(m,a),T=t.useElementVisibility(m);e.watch(T,(e=>{e&&u.autofocus&&(M.value=!0)}));const{hasIcon:J,hasIconBefore:G,hasIconAfter:U}=function(l,o){const t=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===r.before))),n=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===r.after))),a=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.left))),u=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.right))),d=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.top))),s=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.bottom)));return{hasIcon:e.computed((()=>"string"==typeof(null==l?void 0:l.value)?{name:null==l?void 0:l.value}:null==l?void 0:l.value)),hasIconLeft:a,hasIconRight:u,hasIconTop:d,hasIconBottom:s,hasIconBefore:t,hasIconAfter:n}}(V,O),Q=e.computed((()=>{return l=u.modelValue,!(null==(o=e.unref(l))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length);var l,o})),W=e.computed((()=>u.disabled||u.readonly)),X=e.computed((()=>W.value?-1:u.tabindex)),Y=e.computed((()=>!0===u.invalid||!0!==u.valid&&void 0)),Z=c("vv-select",B,e.computed((()=>({valid:E.value,invalid:w.value,loading:$.value,disabled:k.value,readonly:L.value,"icon-before":G.value,"icon-after":U.value,dirty:Q.value,focus:M.value,floating:P.value,multiple:x.value})))),ee=e.computed((()=>({name:u.name,tabindex:X.value,disabled:W.value,required:u.required,size:u.size,autocomplete:u.autocomplete,multiple:u.multiple,"aria-invalid":Y.value,"aria-describedby":b.value?K.value:void 0,"aria-errormessage":h.value?K.value:void 0}))),le=e.computed((()=>({valid:u.valid,invalid:u.invalid,modelValue:u.modelValue}))),{getOptionLabel:oe,getOptionValue:te,isOptionDisabled:ne,getOptionGrouped:ae}=function(l){const{options:o,labelKey:t,valueKey:a,disabledKey:i}=e.toRefs(l);return{options:o,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof t.value?t.value(e):n.get(e,t.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof a.value?a.value(e):n.get(e,a.value),isOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof i.value?i.value(e):n.get(e,i.value)),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(u),ie=e.computed({get:()=>u.modelValue,set:e=>{Array.isArray(e)&&(e=e.filter((e=>void 0!==e))),a("update:modelValue",e)}}),re=e=>"string"!=typeof e&&(e&&e.options&&e.options.length>0);return(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Z))},[l.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(H)},e.toDisplayString(l.label),9,I)):e.createCommentVNode("",!0),e.createElementVNode("div",A,[l.$slots.before?(e.openBlock(),e.createElementBlock("div",_,[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(le))))])):e.createCommentVNode("",!0),e.createElementVNode("div",j,[e.unref(G)?(e.openBlock(),e.createBlock(v,e.mergeProps({key:0,class:"vv-select__icon"},e.unref(J)),null,16)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("select",e.mergeProps({id:e.unref(H),ref_key:"select",ref:m,"onUpdate:modelValue":o[0]||(o[0]=l=>e.isRef(ie)?ie.value=l:null)},e.unref(ee)),[l.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,value:void 0,disabled:!l.unselectable,hidden:!l.unselectable},e.toDisplayString(l.placeholder),9,F)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options,((l,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[re(l)?(e.openBlock(),e.createElementBlock("optgroup",{key:`group-${o}`,disabled:e.unref(ne)(l),label:e.unref(oe)(l)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ae)(l),((l,t)=>(e.openBlock(),e.createElementBlock("option",{key:`group-${o}-item-${t}`,disabled:e.unref(ne)(l),value:e.unref(te)(l)},e.toDisplayString(e.unref(oe)(l)),9,D)))),128))],8,q)):(e.openBlock(),e.createElementBlock("option",{key:o,disabled:e.unref(ne)(l),value:e.unref(te)(l)},e.toDisplayString(e.unref(oe)(l)),9,z))],64)))),256))],16,C),[[e.vModelSelect,e.unref(ie)]]),e.unref(U)?(e.openBlock(),e.createBlock(v,e.mergeProps({key:1,class:"vv-select__icon vv-select__icon-after"},e.unref(J)),null,16)):e.createCommentVNode("",!0)]),l.$slots.after?(e.openBlock(),e.createElementBlock("div",R,[e.renderSlot(l.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(le))))])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(g),{id:e.unref(K),class:"vv-select__hint"},e.createSlots({_:2},[l.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"0"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"1"}:void 0,l.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"2"}:void 0,l.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
@@ -140,22 +140,22 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
140
140
  }>> & {
141
141
  [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
142
142
  }, {
143
+ readonly: boolean;
143
144
  disabled: boolean;
144
- floating: boolean;
145
- options: (string | Option)[];
145
+ valid: boolean;
146
+ invalid: boolean;
146
147
  modelValue: string | number | boolean | unknown[] | Record<string, any>;
147
- tabindex: string | number;
148
+ multiple: boolean;
148
149
  unselectable: boolean;
150
+ options: (string | Option)[];
151
+ floating: boolean;
152
+ tabindex: string | number;
149
153
  required: boolean;
150
154
  iconPosition: "before" | "after";
151
155
  autofocus: boolean;
152
156
  loading: boolean;
153
157
  loadingLabel: string;
154
- multiple: boolean;
155
- readonly: boolean;
156
158
  hintLabel: string;
157
- invalid: boolean;
158
- valid: boolean;
159
159
  autocomplete: string;
160
160
  labelKey: string | Function;
161
161
  valueKey: string | Function;
@@ -1,4 +1,4 @@
1
- import { inject, defineComponent, ref, watch, computed, openBlock, createBlock, resolveDynamicComponent, unref, mergeProps, withCtx, renderSlot, createTextVNode, toDisplayString, toRefs, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, createVNode, toHandlers } from "vue";
1
+ import { inject, defineComponent, ref, watch, computed, openBlock, createBlock, resolveDynamicComponent, unref, mergeProps, withCtx, renderSlot, createTextVNode, toDisplayString, createElementBlock, createVNode, toRefs, normalizeClass, createElementVNode, withModifiers, Fragment, renderList, toHandlers, createCommentVNode } from "vue";
2
2
  var Strategy = /* @__PURE__ */ ((Strategy2) => {
3
3
  Strategy2["absolute"] = "absolute";
4
4
  Strategy2["fixed"] = "fixed";
@@ -93,6 +93,12 @@ const ActiveProps = {
93
93
  */
94
94
  active: Boolean
95
95
  };
96
+ const CurrentProps = {
97
+ /**
98
+ * Whether the item is current
99
+ */
100
+ current: Boolean
101
+ };
96
102
  const PressedProps = {
97
103
  /**
98
104
  * Whether the item is pressed
@@ -223,6 +229,7 @@ const ActionProps = {
223
229
  ...LabelProps,
224
230
  ...PressedProps,
225
231
  ...ActiveProps,
232
+ ...CurrentProps,
226
233
  ...LinkProps,
227
234
  /**
228
235
  * Button type
@@ -240,23 +247,31 @@ const ActionProps = {
240
247
  default: void 0
241
248
  }
242
249
  };
243
- const VvTabProps = {
244
- ...ModifiersProps,
250
+ const NavProps = {
245
251
  items: {
246
252
  type: Array,
247
- required: true,
248
253
  default: () => []
249
254
  }
250
255
  };
251
- const VvTabEvents = ["click"];
252
- const VvNavProps = {
256
+ const VvTabProps = {
253
257
  ...ModifiersProps,
258
+ navModifiers: {
259
+ type: [String, Array]
260
+ },
261
+ modelValue: {
262
+ type: String,
263
+ default: ""
264
+ },
254
265
  items: {
255
266
  type: Array,
256
- required: true,
257
267
  default: () => []
258
268
  }
259
269
  };
270
+ const VvTabEvents = ["update:modelValue"];
271
+ const VvNavProps = {
272
+ ...ModifiersProps,
273
+ ...NavProps
274
+ };
260
275
  const VvNavEvents = ["click"];
261
276
  const VvActionEvents = ["click", "mouseover", "mouseleave"];
262
277
  const VvActionProps = ActionProps;
@@ -269,11 +284,11 @@ function useInjectedDropdownTrigger() {
269
284
  function useInjectedDropdownAction() {
270
285
  return inject(INJECTION_KEY_DROPDOWN_ACTION, {});
271
286
  }
272
- const __default__ = {
287
+ const __default__$1 = {
273
288
  name: "VvAction"
274
289
  };
275
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
276
- ...__default__,
290
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
291
+ ...__default__$1,
277
292
  props: VvActionProps,
278
293
  emits: VvActionEvents,
279
294
  setup(__props, { expose: __expose, emit }) {
@@ -364,7 +379,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
364
379
  class: {
365
380
  active: _ctx.active,
366
381
  pressed: unref(pressed),
367
- disabled: _ctx.disabled
382
+ disabled: _ctx.disabled,
383
+ current: _ctx.current
368
384
  },
369
385
  onClickPassive: onClick,
370
386
  onMouseoverPassive: onMouseover,
@@ -380,6 +396,29 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
380
396
  };
381
397
  }
382
398
  });
399
+ const _hoisted_1$1 = {
400
+ class: "vv-nav__item",
401
+ role: "presentation"
402
+ };
403
+ const __default__ = {
404
+ name: "VvNavItem",
405
+ inheritAttrs: false
406
+ };
407
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
408
+ ...__default__,
409
+ setup(__props) {
410
+ return (_ctx, _cache) => {
411
+ return openBlock(), createElementBlock("li", _hoisted_1$1, [
412
+ createVNode(_sfc_main$3, mergeProps(_ctx.$attrs, { class: "vv-nav__item-label" }), {
413
+ default: withCtx(() => [
414
+ renderSlot(_ctx.$slots, "default")
415
+ ]),
416
+ _: 3
417
+ }, 16)
418
+ ]);
419
+ };
420
+ }
421
+ });
383
422
  function useModifiers(prefix, modifiers, others) {
384
423
  return computed(() => {
385
424
  const toReturn = {
@@ -403,71 +442,50 @@ function useModifiers(prefix, modifiers, others) {
403
442
  return toReturn;
404
443
  });
405
444
  }
406
- const _hoisted_1$1 = {
407
- class: "vv-nav__menu",
408
- role: "menu",
409
- "aria-busy": "true"
410
- };
445
+ const _hoisted_1 = ["onClick"];
411
446
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
412
447
  __name: "VvNav",
413
448
  props: VvNavProps,
414
449
  emits: VvNavEvents,
415
450
  setup(__props, { emit }) {
416
451
  const props = __props;
417
- const { modifiers, items } = toRefs(props);
418
- const activeItem = ref(null);
419
- const bemCssClasses = useModifiers("vv-nav", modifiers);
420
- const localItems = computed(() => {
421
- return items.value.map((item, index) => {
422
- return {
423
- ...item,
424
- id: item.id || `nav-item_${index}`
425
- };
426
- });
427
- });
428
- function onClick(item) {
429
- if (!item.disabled) {
452
+ const { modifiers } = toRefs(props);
453
+ const onClick = (event) => {
454
+ var _a;
455
+ const target = event.target;
456
+ if (target == null ? void 0 : target.dataset.index) {
457
+ const index = parseInt(target.dataset.index);
458
+ const item = (_a = props.items) == null ? void 0 : _a[index];
459
+ if (!item || (item == null ? void 0 : item.disabled)) {
460
+ return;
461
+ }
430
462
  emit("click", item);
431
- activeItem.value = item.id;
432
463
  }
433
- }
464
+ };
465
+ const bemCssClasses = useModifiers("vv-nav", modifiers);
434
466
  return (_ctx, _cache) => {
435
467
  return openBlock(), createElementBlock("nav", {
436
468
  class: normalizeClass(unref(bemCssClasses))
437
469
  }, [
438
- createElementVNode("ul", _hoisted_1$1, [
439
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(localItems), (navItem) => {
440
- return openBlock(), createElementBlock("li", {
441
- key: navItem.id,
442
- class: "vv-nav__item",
443
- role: "presentation"
444
- }, [
445
- createVNode(_sfc_main$2, mergeProps({
446
- disabled: navItem.disabled,
447
- to: navItem.to,
448
- href: navItem.href,
449
- tabindex: 0
450
- }, {
451
- class: [{
452
- current: unref(activeItem) == navItem.id,
453
- disabled: navItem.disabled
454
- }, "vv-nav__item-label"]
455
- }, toHandlers(navItem.on), {
456
- onClick: ($event) => onClick(navItem)
457
- }), {
458
- default: withCtx(() => [
459
- createTextVNode(toDisplayString(navItem.title), 1)
460
- ]),
461
- _: 2
462
- }, 1040, ["class", "onClick"])
463
- ]);
464
- }), 128))
465
- ])
470
+ createElementVNode("ul", {
471
+ class: "vv-nav__menu",
472
+ role: "menu",
473
+ "aria-busy": "true",
474
+ onClick: withModifiers(onClick, ["stop"])
475
+ }, [
476
+ renderSlot(_ctx.$slots, "default", {}, () => [
477
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.items, ({ on = {}, ...item }, index) => {
478
+ return openBlock(), createBlock(_sfc_main$2, mergeProps({
479
+ key: index,
480
+ "data-index": index
481
+ }, item, toHandlers(on)), null, 16, ["data-index"]);
482
+ }), 128))
483
+ ])
484
+ ], 8, _hoisted_1)
466
485
  ], 2);
467
486
  };
468
487
  }
469
488
  });
470
- const _hoisted_1 = ["id"];
471
489
  const _sfc_main = /* @__PURE__ */ defineComponent({
472
490
  __name: "VvTab",
473
491
  props: VvTabProps,
@@ -475,39 +493,61 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
475
493
  setup(__props, { emit }) {
476
494
  const props = __props;
477
495
  const { modifiers, items } = toRefs(props);
478
- const activeTab = ref(null);
479
- const bemCssClasses = useModifiers("vv-tab", modifiers);
480
- const localItems = computed(() => {
481
- return items.value.map((item, index) => {
482
- return {
483
- ...item,
484
- id: item.id || `tab-item_${index}`
485
- };
486
- });
496
+ const tabKeys = computed(() => {
497
+ return items.value.reduce((acc, item) => {
498
+ if (item.tab) {
499
+ acc.push(item.tab);
500
+ }
501
+ return acc;
502
+ }, []);
487
503
  });
488
- function onClick(item) {
489
- if (!item.disabled) {
490
- emit("click", item);
491
- activeTab.value = item.id;
504
+ const localModelValue = ref();
505
+ const activeTabKey = computed({
506
+ get: () => {
507
+ var _a;
508
+ return props.modelValue || localModelValue.value || ((_a = tabKeys.value) == null ? void 0 : _a[0]);
509
+ },
510
+ set: (newValue) => {
511
+ localModelValue.value = newValue;
512
+ emit("update:modelValue", newValue);
492
513
  }
493
- }
514
+ });
515
+ const hasNavModifiers = computed(() => {
516
+ var _a;
517
+ return [
518
+ "tabs",
519
+ ...Array.isArray(props.navModifiers) ? props.navModifiers : ((_a = props.navModifiers) == null ? void 0 : _a.split(" ")) ?? []
520
+ ];
521
+ });
522
+ const onNavClick = (item) => {
523
+ if (item.tab) {
524
+ activeTabKey.value = item.tab;
525
+ }
526
+ };
527
+ const navItems = computed(
528
+ () => props.items.map((item) => ({
529
+ current: item.tab === activeTabKey.value,
530
+ ...item
531
+ }))
532
+ );
533
+ const bemCssClasses = useModifiers("vv-tab", modifiers);
494
534
  return (_ctx, _cache) => {
495
535
  return openBlock(), createElementBlock("div", {
496
536
  class: normalizeClass(unref(bemCssClasses))
497
537
  }, [
498
- createVNode(_sfc_main$1, {
499
- items: unref(localItems),
500
- modifiers: "tabs full",
501
- onClick
502
- }, null, 8, ["items"]),
503
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(localItems), (item) => {
504
- return openBlock(), createElementBlock("article", {
505
- id: item.id,
506
- key: item.id,
507
- class: normalizeClass([{ target: unref(activeTab) === item.id }, "vv-tab__panel"])
508
- }, [
509
- renderSlot(_ctx.$slots, `${item.id}`)
510
- ], 10, _hoisted_1);
538
+ createVNode(_sfc_main$1, mergeProps({
539
+ items: unref(navItems),
540
+ modifiers: unref(hasNavModifiers)
541
+ }, { onClick: onNavClick }), null, 16),
542
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(items), (item, index) => {
543
+ return openBlock(), createElementBlock(Fragment, { key: index }, [
544
+ item.tab ? (openBlock(), createElementBlock("article", {
545
+ key: 0,
546
+ class: normalizeClass([{ target: unref(activeTabKey) === item.tab }, "vv-tab__panel"])
547
+ }, [
548
+ renderSlot(_ctx.$slots, `panel::${item.tab}`)
549
+ ], 2)) : createCommentVNode("", true)
550
+ ], 64);
511
551
  }), 128))
512
552
  ], 2);
513
553
  };
@@ -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.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),l=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(l||{}),r=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(r||{}),n=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(n||{});const a=Symbol.for("volver"),i=Symbol.for("dropdownTrigger"),s=Symbol.for("dropdownAction"),u={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(n).includes(e)},rel:{type:String,default:"noopener noreferrer"}},d={disabled:Boolean},c={active:Boolean},v={pressed:Boolean},f={label:[String,Number]},m={modifiers:[String,Array]};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const p={...d,...f,...v,...c,...u,type:{type:String,default:l.button,validator:e=>Object.values(l).includes(e)},ariaLabel:{type:String,default:void 0}},b={...m,items:{type:Array,required:!0,default:()=>[]}},k={...m,items:{type:Array,required:!0,default:()=>[]}},y=p;const g=e.defineComponent({name:"VvAction",props:y,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:l}){const n=t,u=e.inject(a),d=e.ref(null);o({$el:d});const{reference:c,bus:v,aria:f,expanded:m}=e.inject(i,{});e.watch((()=>d.value),(e=>{c&&(c.value=e)}));const p=e.computed((()=>n.pressed||(null==m?void 0:m.value))),{role:b}=e.inject(s,{}),k=e.computed((()=>{switch(!0){case n.disabled:return r.button;case void 0!==n.to:return(null==u?void 0:u.nuxt)?r.nuxtLink:r.routerLink;case void 0!==n.href:return r.a;default:return r.button}})),y=e.computed((()=>{const e={...null==f?void 0:f.value,ariaPressed:!!p.value||void 0,ariaLabel:n.ariaLabel,role:null==b?void 0:b.value};switch(k.value){case r.a:return{...e,href:n.href,target:n.target,rel:n.rel};case r.routerLink:case r.nuxtLink:return{...e,to:n.to,target:n.target};default:return{...e,type:n.type,disabled:n.disabled}}})),g=e=>{n.disabled?e.preventDefault():(null==v||v.emit("click",e),l("click",e))},B=e=>{null==v||v.emit("mouseover",e),l("mouseover",e)},_=e=>{null==v||v.emit("mouseleave",e),l("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(y),{ref_key:"element",ref:d,class:{active:t.active,pressed:e.unref(p),disabled:t.disabled},onClickPassive:g,onMouseoverPassive:B,onMouseleavePassive:_}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}});function B(t,o,l){return e.computed((()=>{const r={[t]:!0},n="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(r[`${t}--${e}`]=!0)})),l&&Object.keys(l.value).forEach((o=>{r[`${t}--${o}`]=e.unref(l.value[o])})),r}))}const _={class:"vv-nav__menu",role:"menu","aria-busy":"true"},h=e.defineComponent({__name:"VvNav",props:k,emits:["click"],setup(t,{emit:o}){const l=t,{modifiers:r,items:n}=e.toRefs(l),a=e.ref(null),i=B("vv-nav",r),s=e.computed((()=>n.value.map(((e,t)=>({...e,id:e.id||`nav-item_${t}`})))));return(t,l)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(i))},[e.createElementVNode("ul",_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),(t=>(e.openBlock(),e.createElementBlock("li",{key:t.id,class:"vv-nav__item",role:"presentation"},[e.createVNode(g,e.mergeProps({disabled:t.disabled,to:t.to,href:t.href,tabindex:0},{class:[{current:e.unref(a)==t.id,disabled:t.disabled},"vv-nav__item-label"]},e.toHandlers(t.on),{onClick:e=>{var l;(l=t).disabled||(o("click",l),a.value=l.id)}}),{default:e.withCtx((()=>[e.createTextVNode(e.toDisplayString(t.title),1)])),_:2},1040,["class","onClick"])])))),128))])],2))}}),S=["id"];return e.defineComponent({__name:"VvTab",props:b,emits:["click"],setup(t,{emit:o}){const l=t,{modifiers:r,items:n}=e.toRefs(l),a=e.ref(null),i=B("vv-tab",r),s=e.computed((()=>n.value.map(((e,t)=>({...e,id:e.id||`tab-item_${t}`})))));function u(e){e.disabled||(o("click",e),a.value=e.id)}return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(i))},[e.createVNode(h,{items:e.unref(s),modifiers:"tabs full",onClick:u},null,8,["items"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),(o=>(e.openBlock(),e.createElementBlock("article",{id:o.id,key:o.id,class:e.normalizeClass([{target:e.unref(a)===o.id},"vv-tab__panel"])},[e.renderSlot(t.$slots,`${o.id}`)],10,S)))),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.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),n=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(n||{}),l=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(l||{});const a=Symbol.for("volver"),i=Symbol.for("dropdownTrigger"),s=Symbol.for("dropdownAction"),u={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(l).includes(e)},rel:{type:String,default:"noopener noreferrer"}},d={disabled:Boolean},c={active:Boolean},v={current:Boolean},m={pressed:Boolean},p={label:[String,Number]},f={modifiers:[String,Array]};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const b={...d,...p,...m,...c,...v,...u,type:{type:String,default:r.button,validator:e=>Object.values(r).includes(e)},ariaLabel:{type:String,default:void 0}},k={items:{type:Array,default:()=>[]}},y={...f,navModifiers:{type:[String,Array]},modelValue:{type:String,default:""},items:{type:Array,default:()=>[]}},g={...f,...k},B=b;const _=e.defineComponent({name:"VvAction",props:B,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:r}){const l=t,u=e.inject(a),d=e.ref(null);o({$el:d});const{reference:c,bus:v,aria:m,expanded:p}=e.inject(i,{});e.watch((()=>d.value),(e=>{c&&(c.value=e)}));const f=e.computed((()=>l.pressed||(null==p?void 0:p.value))),{role:b}=e.inject(s,{}),k=e.computed((()=>{switch(!0){case l.disabled:return n.button;case void 0!==l.to:return(null==u?void 0:u.nuxt)?n.nuxtLink:n.routerLink;case void 0!==l.href:return n.a;default:return n.button}})),y=e.computed((()=>{const e={...null==m?void 0:m.value,ariaPressed:!!f.value||void 0,ariaLabel:l.ariaLabel,role:null==b?void 0:b.value};switch(k.value){case n.a:return{...e,href:l.href,target:l.target,rel:l.rel};case n.routerLink:case n.nuxtLink:return{...e,to:l.to,target:l.target};default:return{...e,type:l.type,disabled:l.disabled}}})),g=e=>{l.disabled?e.preventDefault():(null==v||v.emit("click",e),r("click",e))},B=e=>{null==v||v.emit("mouseover",e),r("mouseover",e)},_=e=>{null==v||v.emit("mouseleave",e),r("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(y),{ref_key:"element",ref:d,class:{active:t.active,pressed:e.unref(f),disabled:t.disabled,current:t.current},onClickPassive:g,onMouseoverPassive:B,onMouseleavePassive:_}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}}),h={class:"vv-nav__item",role:"presentation"},S=e.defineComponent({name:"VvNavItem",inheritAttrs:!1,setup:t=>(t,o)=>(e.openBlock(),e.createElementBlock("li",h,[e.createVNode(_,e.mergeProps(t.$attrs,{class:"vv-nav__item-label"}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default")])),_:3},16)]))});function x(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}))}const C=["onClick"],V=e.defineComponent({__name:"VvNav",props:g,emits:["click"],setup(t,{emit:o}){const r=t,{modifiers:n}=e.toRefs(r),l=e=>{var t;const n=e.target;if(null==n?void 0:n.dataset.index){const e=parseInt(n.dataset.index),l=null==(t=r.items)?void 0:t[e];if(!l||(null==l?void 0:l.disabled))return;o("click",l)}},a=x("vv-nav",n);return(t,o)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(a))},[e.createElementVNode("ul",{class:"vv-nav__menu",role:"menu","aria-busy":"true",onClick:e.withModifiers(l,["stop"])},[e.renderSlot(t.$slots,"default",{},(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(({on:t={},...o},r)=>(e.openBlock(),e.createBlock(S,e.mergeProps({key:r,"data-index":r},o,e.toHandlers(t)),null,16,["data-index"])))),128))]))],8,C)],2))}});return e.defineComponent({__name:"VvTab",props:y,emits:["update:modelValue"],setup(t,{emit:o}){const r=t,{modifiers:n,items:l}=e.toRefs(r),a=e.computed((()=>l.value.reduce(((e,t)=>(t.tab&&e.push(t.tab),e)),[]))),i=e.ref(),s=e.computed({get:()=>{var e;return r.modelValue||i.value||(null==(e=a.value)?void 0:e[0])},set:e=>{i.value=e,o("update:modelValue",e)}}),u=e.computed((()=>{var e;return["tabs",...Array.isArray(r.navModifiers)?r.navModifiers:(null==(e=r.navModifiers)?void 0:e.split(" "))??[]]})),d=e=>{e.tab&&(s.value=e.tab)},c=e.computed((()=>r.items.map((e=>({current:e.tab===s.value,...e}))))),v=x("vv-tab",n);return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(v))},[e.createVNode(V,e.mergeProps({items:e.unref(c),modifiers:e.unref(u)},{onClick:d}),null,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(s)===o.tab},"vv-tab__panel"])},[e.renderSlot(t.$slots,`panel::${o.tab}`)],2)):e.createCommentVNode("",!0)],64)))),128))],2))}})}));
@@ -1,22 +1,35 @@
1
- import type { NavItem } from '@/components/VvNav';
1
+ import type { NavItemTab } from '@/types/nav';
2
2
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
3
+ navModifiers: {
4
+ type: globalThis.PropType<string | string[]>;
5
+ };
6
+ modelValue: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ };
3
10
  items: {
4
- type: globalThis.PropType<NavItem[]>;
5
- required: boolean;
11
+ type: globalThis.PropType<NavItemTab[]>;
6
12
  default: () => never[];
7
13
  };
8
14
  modifiers: globalThis.PropType<string | string[]>;
9
15
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
16
+ navModifiers: {
17
+ type: globalThis.PropType<string | string[]>;
18
+ };
19
+ modelValue: {
20
+ type: StringConstructor;
21
+ default: string;
22
+ };
10
23
  items: {
11
- type: globalThis.PropType<NavItem[]>;
12
- required: boolean;
24
+ type: globalThis.PropType<NavItemTab[]>;
13
25
  default: () => never[];
14
26
  };
15
27
  modifiers: globalThis.PropType<string | string[]>;
16
28
  }>> & {
17
29
  [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
18
30
  }, {
19
- items: NavItem[];
31
+ modelValue: string;
32
+ items: NavItemTab[];
20
33
  }, {}>, Partial<Record<string, (_: {}) => any>>>;
21
34
  export default _default;
22
35
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -1,8 +1,14 @@
1
- import type { NavItem } from '../VvNav';
1
+ import type { NavItemTab } from '@/types/nav';
2
2
  export declare const VvTabProps: {
3
+ navModifiers: {
4
+ type: globalThis.PropType<string | string[]>;
5
+ };
6
+ modelValue: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ };
3
10
  items: {
4
- type: globalThis.PropType<NavItem[]>;
5
- required: boolean;
11
+ type: globalThis.PropType<NavItemTab[]>;
6
12
  default: () => never[];
7
13
  };
8
14
  modifiers: globalThis.PropType<string | string[]>;
@@ -1,6 +1,6 @@
1
1
  import { unref, computed, isRef, defineComponent, h, inject, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, watch, useSlots, createElementBlock, normalizeClass, toDisplayString, createElementVNode, renderSlot, normalizeProps, guardReactiveProps, withDirectives, vModelText, createTextVNode, createVNode, createSlots, withCtx } from "vue";
2
2
  import { iconExists, Icon, addIcon } from "@iconify/vue";
3
- import { nanoid } from "nanoid";
3
+ import { uid } from "uid";
4
4
  import { useFocus, useElementVisibility } from "@vueuse/core";
5
5
  function isEmpty(value) {
6
6
  return ((value2) => value2 === null || value2 === void 0 || value2 === "" || Array.isArray(value2) && value2.length === 0 || !(value2 instanceof Date) && typeof value2 === "object" && Object.keys(value2).length === 0)(unref(value));
@@ -456,6 +456,12 @@ const ActiveProps = {
456
456
  */
457
457
  active: Boolean
458
458
  };
459
+ const CurrentProps = {
460
+ /**
461
+ * Whether the item is current
462
+ */
463
+ current: Boolean
464
+ };
459
465
  const PressedProps = {
460
466
  /**
461
467
  * Whether the item is pressed
@@ -700,6 +706,7 @@ const InputTextareaProps = {
700
706
  ...LabelProps,
701
707
  ...PressedProps,
702
708
  ...ActiveProps,
709
+ ...CurrentProps,
703
710
  ...LinkProps,
704
711
  /**
705
712
  * Button type
@@ -812,7 +819,7 @@ function useDefaults(componentName, propsDefinition, props) {
812
819
  }, {});
813
820
  });
814
821
  }
815
- const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || nanoid()));
822
+ const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || uid()));
816
823
  function useDebouncedInput(modelValue, emit, ms = 0, {
817
824
  getter = (value) => value,
818
825
  setter = (value) => value