@volverjs/ui-vue 0.0.5-beta.2 → 0.0.5-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 (32) hide show
  1. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +7 -1
  2. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  3. package/dist/components/VvCombobox/VvCombobox.es.js +171 -64
  4. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  5. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +0 -8
  6. package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +6 -0
  7. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +237 -0
  8. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -0
  9. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +7 -1
  10. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  11. package/dist/components/VvSelect/VvSelect.es.js +42 -10
  12. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  13. package/dist/components/VvSelect/VvSelect.vue.d.ts +4 -3
  14. package/dist/components/index.es.js +241 -134
  15. package/dist/components/index.umd.js +1 -1
  16. package/dist/composables/useOptions.d.ts +1 -0
  17. package/dist/icons.es.js +3 -3
  18. package/dist/icons.umd.js +1 -1
  19. package/dist/resolvers/unplugin.es.js +2 -1
  20. package/dist/resolvers/unplugin.umd.js +1 -1
  21. package/package.json +9 -1
  22. package/src/assets/icons/detailed.json +1 -1
  23. package/src/assets/icons/normal.json +1 -1
  24. package/src/assets/icons/simple.json +1 -1
  25. package/src/components/VvCombobox/VvCombobox.vue +95 -28
  26. package/src/components/VvDropdown/VvDropdownOptgroup.vue +18 -0
  27. package/src/components/VvSelect/VvSelect.vue +38 -10
  28. package/src/composables/useOptions.ts +6 -0
  29. package/src/resolvers/unplugin.ts +2 -1
  30. package/src/stories/Combobox/ComboboxOptions.stories.mdx +35 -0
  31. package/src/stories/Select/SelectOptions.stories.mdx +35 -0
  32. package/src/types/generic.d.ts +2 -1
@@ -1 +1 @@
1
- !function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("@iconify/vue"),require("@vueuse/core"),require("nanoid")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","@vueuse/core","nanoid"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvSelect=l(e.vue,e.vue$1,e.core,e.nanoid)}(this,(function(e,l,o,n){"use strict";const t={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 a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),i=(e=>(e.before="before",e.after="after",e))(i||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{});const r=Symbol.for("volver");function d(l,o,n){return e.computed((()=>{const t={[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&&(t[`${l}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((o=>{t[`${l}--${o}`]=e.unref(n.value[o])})),t}))}const c=e.defineComponent({name:"VvIcon",props:t,setup(o){const n=o,t=e.ref(!0),a=e.inject(r),{modifiers:i}=e.toRefs(n),u=d("vv-icon",i),c=e.computed((()=>n.provider||(null==a?void 0:a.iconsProvider))),s=e.computed((()=>{const e=n.name??"",o=`@${c.value}:${n.prefix}:${n.name}`;return l.iconExists(e)?e:l.iconExists(o)?o:(null==a?void 0:a.iconsCollections.find((o=>{const n=`@${c.value}:${o.prefix}:${e}`;if(l.iconExists(n))return n})))||e}));function v(e){const o=function(e){let l=null;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),t=(null==o?void 0:o.innerHTML.trim())||"";o&&t&&l.addIcon(`@${c.value}:${n.prefix}:${n.name}`,{body:t,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return a&&(n.src&&!l.iconExists(`@${c.value}:${n.prefix}:${n.name}`)?(t.value=!1,a.fetchIcon(n.src).then((e=>{e&&(v(e),t.value=!0)})).catch((e=>{throw new Error(`During fetch icon: ${null==e?void 0:e.message}`)}))):n.svg&&v(n.svg)),(o,n)=>e.unref(t)?(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:o.rotate,color:o.color,onLoad:o.onLoad,icon:e.unref(s)}),null,16,["class"])):e.createCommentVNode("",!0)}});function s(e,l){if(e&&Object.keys(e).length&&l){if(-1===l.indexOf("."))return e[l];{const o=l.split(".");let n=e;for(let l=0,t=o.length;l<t;++l){if(null==e)return null;n=n[o[l]]}return n}}return null}function v(l){return null==(o=e.unref(l))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length;var o}function f(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}const p={valid:Boolean,validLabel:[String,Array]},m={invalid:Boolean,invalidLabel:[String,Array]},b={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},g={disabled:Boolean},y=(Boolean,Boolean,{label:[String,Number]}),h={readonly:Boolean},B={modifiers:[String,Array]},S={hintLabel:{type:String,default:""}},V={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},k={icon:{type:[String,Object]},iconPosition:{type:String,default:i.before,validation:e=>Object.values(i).includes(e)}},$={tabindex:{type:[String,Number],default:0}},w={floating:Boolean},L={unselectable:{type:Boolean,default:!0}},N={id:[String,Number]};a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const x={...N,name:{type:String,required:!0}},A={autofocus:Boolean},E={autocomplete:{type:String,default:"off"}};u.button;const I={...x,...A,...E,...$,...p,...m,...S,...b,...g,...h,...B,...V,...k,...w,...L,...y,multiple:Boolean,required:Boolean,size:[String,Number],modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},placeholder:String};const O=["for"],_={class:"vv-select__wrapper"},j={key:0,class:"vv-select__input-before"},C={class:"vv-select__inner"},F=["id"],P=["disabled","hidden"],q=["disabled","value"],D={key:1,class:"vv-select__input-after"};return e.defineComponent({name:"VvSelect",props:I,emits:["update:modelValue","focus","blur"],setup(l,{emit:t}){const u=l,r=e.useSlots(),p=e.ref(),{HintSlot:m,hasHint:b,hasInvalid:g}=function(l,n){const{invalid:t,valid:a,hint:i,loading:u}=n,{hintLabel:r,modelValue:d,valid:c,validLabel:p,invalid:m,invalidLabel:b,...g}=e.toRefs(l),y=s(g,"loading"),h=s(g,"loadingLabel"),B=e.computed((()=>!(!m.value||(!m.value||!t)&&!((null==b?void 0:b.value)&&Array.isArray(b.value)&&b.value.length>0)&&(!(null==b?void 0:b.value)||v(b))))),S=e.computed((()=>!!(r&&r.value||i))),V=e.computed((()=>!!(p&&p.value||a))),k=e.computed((()=>!!((null==y?void 0:y.value)&&u||(null==y?void 0:y.value)&&(null==h?void 0:h.value)))),$=e.computed((()=>S.value||V.value||B.value||k.value));return{hasInvalid:B,hasHint:S,hasValid:V,hasLoading:k,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(l){const n=e.computed((()=>{const e=o.toReactive({hintLabel:r,modelValue:d,valid:c,validLabel:p,invalid:m,invalidLabel:b,loading:y,loadingLabel:h,...l.params});return(null==m?void 0:m.value)?(null==t?void 0:t(e))||f(null==b?void 0:b.value)||(null==r?void 0:r.value):(null==c?void 0:c.value)?(null==a?void 0:a(e))||f(null==p?void 0:p.value)||(null==r?void 0:r.value):(null==y?void 0:y.value)?(null==u?void 0:u(e))||f(null==h?void 0:h.value)||(null==r?void 0:r.value):(null==i?void 0:i(e))||f(null==r?void 0:r.value)||(null==r?void 0:r.value)}));return{isVisible:$,hasInvalid:B,hasValid:V,hintContent:n}},render(){if(this.isVisible)return e.h("small",{role:this.hasInvalid?"alert":this.hasValid?"status":void 0},this.hintContent)}}}}(u,r),{id:y,modifiers:h,disabled:B,readonly:S,loading:V,icon:k,iconPosition:$,invalid:w,valid:L,floating:N,multiple:x}=e.toRefs(u),A=(l=>e.computed((()=>String((null==l?void 0:l.value)||n.nanoid()))))(y),E=e.computed((()=>`${A.value}-hint`)),{focused:I}=function(l,n){const{focused:t}=o.useFocus(l);return e.watch(t,(o=>{n(o?"focus":"blur",e.unref(l))})),{focused:t}}(p,t),z=o.useElementVisibility(p);e.watch(z,(e=>{e&&u.autofocus&&(I.value=!0)}));const{hasIcon:R,hasIconBefore:H,hasIconAfter:K}=function(l,o){const n=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.before))),t=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.after))),u=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===a.left))),r=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===a.right))),d=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===a.top))),c=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===a.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:u,hasIconRight:r,hasIconTop:d,hasIconBottom:c,hasIconBefore:n,hasIconAfter:t}}(k,$),M=e.computed((()=>!v(u.modelValue))),T=e.computed((()=>u.disabled||u.readonly)),J=e.computed((()=>T.value?-1:u.tabindex)),U=e.computed((()=>!0===u.invalid||!0!==u.valid&&void 0)),G=d("vv-select",h,e.computed((()=>({valid:L.value,invalid:w.value,loading:V.value,disabled:B.value,readonly:S.value,"icon-before":H.value,"icon-after":K.value,dirty:M.value,focus:I.value,floating:N.value,multiple:x.value})))),Q=e.computed((()=>({name:u.name,tabindex:J.value,disabled:T.value,required:u.required,size:u.size,autocomplete:u.autocomplete,multiple:u.multiple,"aria-invalid":U.value,"aria-describedby":!g.value&&b.value?E.value:void 0,"aria-errormessage":g.value?E.value:void 0}))),W=e.computed((()=>({valid:u.valid,invalid:u.invalid,modelValue:u.modelValue}))),{getOptionLabel:X,getOptionValue:Y,getOptionDisabled:Z}=function(l){const{options:o,labelKey:n,valueKey:t,disabledKey:a}=e.toRefs(l);return{options:o,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:"function"==typeof n.value?n.value(e):e[n.value],getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof t.value?t.value(e):e[t.value],getOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof a.value?a.value(e):e[a.value])}}(u),ee=e.computed({get:()=>u.modelValue,set:e=>{Array.isArray(e)&&(e=e.filter((e=>void 0!==e))),t("update:modelValue",e)}});return(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(G))},[l.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(A)},e.toDisplayString(l.label),9,O)):e.createCommentVNode("",!0),e.createElementVNode("div",_,[l.$slots.before?(e.openBlock(),e.createElementBlock("div",j,[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(W))))])):e.createCommentVNode("",!0),e.createElementVNode("div",C,[e.unref(H)?(e.openBlock(),e.createBlock(c,e.mergeProps({key:0,class:"vv-select__icon"},e.unref(R)),null,16)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("select",e.mergeProps({id:e.unref(A),ref_key:"select",ref:p,"onUpdate:modelValue":o[0]||(o[0]=l=>e.isRef(ee)?ee.value=l:null)},e.unref(Q)),[l.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,value:void 0,disabled:!l.unselectable,hidden:!l.unselectable},e.toDisplayString(l.placeholder),9,P)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options,((l,o)=>(e.openBlock(),e.createElementBlock("option",{key:o,disabled:e.unref(Z)(l),value:e.unref(Y)(l)},e.toDisplayString(e.unref(X)(l)),9,q)))),128))],16,F),[[e.vModelSelect,e.unref(ee)]]),e.unref(K)?(e.openBlock(),e.createBlock(c,e.mergeProps({key:1,class:"vv-select__icon vv-select__icon-after"},e.unref(R)),null,16)):e.createCommentVNode("",!0)]),l.$slots.after?(e.openBlock(),e.createElementBlock("div",D,[e.renderSlot(l.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(W))))])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(m),{id:e.unref(E),class:"vv-select__hint"},null,8,["id"])],2))}})}));
1
+ !function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("@iconify/vue"),require("@vueuse/core"),require("nanoid")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","@vueuse/core","nanoid"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvSelect=l(e.vue,e.vue$1,e.core,e.nanoid)}(this,(function(e,l,o,n){"use strict";const t={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 a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),i=(e=>(e.before="before",e.after="after",e))(i||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{});const u=Symbol.for("volver");function d(l,o,n){return e.computed((()=>{const t={[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&&(t[`${l}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((o=>{t[`${l}--${o}`]=e.unref(n.value[o])})),t}))}const c=e.defineComponent({name:"VvIcon",props:t,setup(o){const n=o,t=e.ref(!0),a=e.inject(u),{modifiers:i}=e.toRefs(n),r=d("vv-icon",i),c=e.computed((()=>n.provider||(null==a?void 0:a.iconsProvider))),s=e.computed((()=>{const e=n.name??"",o=`@${c.value}:${n.prefix}:${n.name}`;return l.iconExists(e)?e:l.iconExists(o)?o:(null==a?void 0:a.iconsCollections.find((o=>{const n=`@${c.value}:${o.prefix}:${e}`;if(l.iconExists(n))return n})))||e}));function v(e){const o=function(e){let l=null;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),t=(null==o?void 0:o.innerHTML.trim())||"";o&&t&&l.addIcon(`@${c.value}:${n.prefix}:${n.name}`,{body:t,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return a&&(n.src&&!l.iconExists(`@${c.value}:${n.prefix}:${n.name}`)?(t.value=!1,a.fetchIcon(n.src).then((e=>{e&&(v(e),t.value=!0)})).catch((e=>{throw new Error(`During fetch icon: ${null==e?void 0:e.message}`)}))):n.svg&&v(n.svg)),(o,n)=>e.unref(t)?(e.openBlock(),e.createBlock(e.unref(l.Icon),e.mergeProps({key:0,class:e.unref(r)},{inline:o.inline,width:o.width,height:o.height,horizontalFlip:o.horizontalFlip,verticalFlip:o.verticalFlip,flip:o.flip,rotate:o.rotate,color:o.color,onLoad:o.onLoad,icon:e.unref(s)}),null,16,["class"])):e.createCommentVNode("",!0)}});function s(e,l){if(e&&Object.keys(e).length&&l){if(-1===l.indexOf("."))return e[l];{const o=l.split(".");let n=e;for(let l=0,t=o.length;l<t;++l){if(null==e)return null;n=n[o[l]]}return n}}return null}function v(l){return null==(o=e.unref(l))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length;var o}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},y=(Boolean,Boolean,{label:[String,Number]}),h={readonly:Boolean},B={modifiers:[String,Array]},S={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"}},V={icon:{type:[String,Object]},iconPosition:{type:String,default:i.before,validation:e=>Object.values(i).includes(e)}},$={tabindex:{type:[String,Number],default:0}},L={floating:Boolean},w={unselectable:{type:Boolean,default:!0}},E={id:[String,Number]};a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const N={...E,name:{type:String,required:!0}},O={autofocus:Boolean},x={autocomplete:{type:String,default:"off"}};r.button;const A={...N,...O,...x,...$,...f,...m,...S,...g,...b,...h,...B,...k,...V,...L,...w,...y,multiple:Boolean,required:Boolean,size:[String,Number],modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},placeholder:String};const I=["for"],_={class:"vv-select__wrapper"},j={key:0,class:"vv-select__input-before"},F={class:"vv-select__inner"},C=["id"],P=["disabled","hidden"],D=["disabled","value"],q=["disabled","label"],z=["disabled","value"],R={key:1,class:"vv-select__input-after"};return e.defineComponent({name:"VvSelect",props:A,emits:["update:modelValue","focus","blur"],setup(l,{emit:t}){const r=l,u=e.useSlots(),f=e.ref(),{HintSlot:m,hasHint:g,hasInvalid:b}=function(l,n){const{invalid:t,valid:a,hint:i,loading:r}=n,{hintLabel:u,modelValue:d,valid:c,validLabel:f,invalid:m,invalidLabel:g,...b}=e.toRefs(l),y=s(b,"loading"),h=s(b,"loadingLabel"),B=e.computed((()=>!(!m.value||(!m.value||!t)&&!((null==g?void 0:g.value)&&Array.isArray(g.value)&&g.value.length>0)&&(!(null==g?void 0:g.value)||v(g))))),S=e.computed((()=>!!(u&&u.value||i))),k=e.computed((()=>!!(f&&f.value||a))),V=e.computed((()=>!!((null==y?void 0:y.value)&&r||(null==y?void 0:y.value)&&(null==h?void 0:h.value)))),$=e.computed((()=>S.value||k.value||B.value||V.value));return{hasInvalid:B,hasHint:S,hasValid:k,hasLoading:V,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(l){const n=e.computed((()=>{const e=o.toReactive({hintLabel:u,modelValue:d,valid:c,validLabel:f,invalid:m,invalidLabel:g,loading:y,loadingLabel:h,...l.params});return(null==m?void 0:m.value)?(null==t?void 0:t(e))||p(null==g?void 0:g.value)||(null==u?void 0:u.value):(null==c?void 0:c.value)?(null==a?void 0:a(e))||p(null==f?void 0:f.value)||(null==u?void 0:u.value):(null==y?void 0:y.value)?(null==r?void 0:r(e))||p(null==h?void 0:h.value)||(null==u?void 0:u.value):(null==i?void 0:i(e))||p(null==u?void 0:u.value)||(null==u?void 0:u.value)}));return{isVisible:$,hasInvalid:B,hasValid:k,hintContent:n}},render(){if(this.isVisible)return e.h("small",{role:this.hasInvalid?"alert":this.hasValid?"status":void 0},this.hintContent)}}}}(r,u),{id:y,modifiers:h,disabled:B,readonly:S,loading:k,icon:V,iconPosition:$,invalid:L,valid:w,floating:E,multiple:N}=e.toRefs(r),O=(l=>e.computed((()=>String((null==l?void 0:l.value)||n.nanoid()))))(y),x=e.computed((()=>`${O.value}-hint`)),{focused:A}=function(l,n){const{focused:t}=o.useFocus(l);return e.watch(t,(o=>{n(o?"focus":"blur",e.unref(l))})),{focused:t}}(f,t),H=o.useElementVisibility(f);e.watch(H,(e=>{e&&r.autofocus&&(A.value=!0)}));const{hasIcon:K,hasIconBefore:M,hasIconAfter:T}=function(l,o){const n=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.before))),t=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.after))),r=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===a.left))),u=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===a.right))),d=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===a.top))),c=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===a.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:r,hasIconRight:u,hasIconTop:d,hasIconBottom:c,hasIconBefore:n,hasIconAfter:t}}(V,$),G=e.computed((()=>!v(r.modelValue))),J=e.computed((()=>r.disabled||r.readonly)),U=e.computed((()=>J.value?-1:r.tabindex)),Q=e.computed((()=>!0===r.invalid||!0!==r.valid&&void 0)),W=d("vv-select",h,e.computed((()=>({valid:w.value,invalid:L.value,loading:k.value,disabled:B.value,readonly:S.value,"icon-before":M.value,"icon-after":T.value,dirty:G.value,focus:A.value,floating:E.value,multiple:N.value})))),X=e.computed((()=>({name:r.name,tabindex:U.value,disabled:J.value,required:r.required,size:r.size,autocomplete:r.autocomplete,multiple:r.multiple,"aria-invalid":Q.value,"aria-describedby":!b.value&&g.value?x.value:void 0,"aria-errormessage":b.value?x.value:void 0}))),Y=e.computed((()=>({valid:r.valid,invalid:r.invalid,modelValue:r.modelValue}))),{getOptionLabel:Z,getOptionValue:ee,getOptionDisabled:le,getOptionGrouped:oe}=function(l){const{options:o,labelKey:n,valueKey:t,disabledKey:a}=e.toRefs(l);return{options:o,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:"function"==typeof n.value?n.value(e):e[n.value],getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof t.value?t.value(e):e[t.value],getOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof a.value?a.value(e):e[a.value]),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(r),ne=e.computed({get:()=>r.modelValue,set:e=>{Array.isArray(e)&&(e=e.filter((e=>void 0!==e))),t("update:modelValue",e)}}),te=e=>"string"!=typeof e&&(e&&e.options&&e.options.length>0);return(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(W))},[l.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(O)},e.toDisplayString(l.label),9,I)):e.createCommentVNode("",!0),e.createElementVNode("div",_,[l.$slots.before?(e.openBlock(),e.createElementBlock("div",j,[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(Y))))])):e.createCommentVNode("",!0),e.createElementVNode("div",F,[e.unref(M)?(e.openBlock(),e.createBlock(c,e.mergeProps({key:0,class:"vv-select__icon"},e.unref(K)),null,16)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("select",e.mergeProps({id:e.unref(O),ref_key:"select",ref:f,"onUpdate:modelValue":o[0]||(o[0]=l=>e.isRef(ne)?ne.value=l:null)},e.unref(X)),[l.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,value:void 0,disabled:!l.unselectable,hidden:!l.unselectable},e.toDisplayString(l.placeholder),9,P)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options,((l,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[te(l)?(e.openBlock(),e.createElementBlock("optgroup",{key:`group-${o}`,disabled:e.unref(le)(l),label:e.unref(Z)(l)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(oe)(l),((l,n)=>(e.openBlock(),e.createElementBlock("option",{key:`group-${o}-item-${n}`,disabled:e.unref(le)(l),value:e.unref(ee)(l)},e.toDisplayString(e.unref(Z)(l)),9,z)))),128))],8,q)):(e.openBlock(),e.createElementBlock("option",{key:o,disabled:e.unref(le)(l),value:e.unref(ee)(l)},e.toDisplayString(e.unref(Z)(l)),9,D))],64)))),256))],16,C),[[e.vModelSelect,e.unref(ne)]]),e.unref(T)?(e.openBlock(),e.createBlock(c,e.mergeProps({key:1,class:"vv-select__icon vv-select__icon-after"},e.unref(K)),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(Y))))])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(m),{id:e.unref(x),class:"vv-select__hint"},null,8,["id"])],2))}})}));
@@ -1,3 +1,4 @@
1
+ import type { Option } from '@/types/generic';
1
2
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
2
3
  multiple: BooleanConstructor;
3
4
  required: BooleanConstructor;
@@ -22,7 +23,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
22
23
  validation: (value: import("../../constants").Position) => boolean;
23
24
  };
24
25
  options: {
25
- type: globalThis.PropType<(string | import("../../types/generic").Option)[]>;
26
+ type: globalThis.PropType<(string | Option)[]>;
26
27
  default: () => never[];
27
28
  };
28
29
  labelKey: {
@@ -91,7 +92,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
91
92
  validation: (value: import("../../constants").Position) => boolean;
92
93
  };
93
94
  options: {
94
- type: globalThis.PropType<(string | import("../../types/generic").Option)[]>;
95
+ type: globalThis.PropType<(string | Option)[]>;
95
96
  default: () => never[];
96
97
  };
97
98
  labelKey: {
@@ -141,7 +142,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
141
142
  }, {
142
143
  modelValue: string | number | boolean | unknown[] | Record<string, any>;
143
144
  disabled: boolean;
144
- options: (string | import("../../types/generic").Option)[];
145
+ options: (string | Option)[];
145
146
  floating: boolean;
146
147
  required: boolean;
147
148
  iconPosition: "before" | "after";