@volverjs/ui-vue 0.0.10-beta.75 → 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.
- package/README.md +8 -8
- package/bin/icons.cjs +1 -1
- package/bin/icons.js +3 -3
- package/dist/components/VvAccordion/VvAccordion.es.js +9 -9
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +14 -15
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAction/VvAction.es.js +10 -13
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.es.js +19 -19
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +19 -19
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAvatar/VvAvatar.es.js +1 -1
- package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +7 -8
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.es.js +1 -1
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +12 -18
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvButton/VvButton.es.js +32 -38
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvCard/VvCard.es.js +1 -1
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +10 -12
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +15 -20
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +266 -285
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +22 -14
- package/dist/components/VvCombobox/index.d.ts +22 -0
- package/dist/components/VvDialog/VvDialog.es.js +5 -7
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +10 -15
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +2 -2
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +2 -2
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +11 -14
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +5 -5
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.es.js +6829 -72
- package/dist/components/VvInputFile/VvInputFile.umd.js +7 -1
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +54 -66
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +1 -1
- package/dist/components/VvNav/VvNav.es.js +16 -21
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNavItem/VvNavItem.es.js +10 -13
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
- package/dist/components/VvNavSeparator/VvNavSeparator.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.es.js +1 -1
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +10 -12
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +15 -20
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.es.js +27 -30
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +3 -3
- package/dist/components/VvTab/VvTab.es.js +18 -25
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +47 -57
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +1 -1
- package/dist/components/VvTooltip/VvTooltip.es.js +1 -1
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/index.es.js +7349 -628
- package/dist/components/index.umd.js +7 -1
- package/dist/composables/index.es.js +1787 -16
- package/dist/composables/index.umd.js +7 -1
- package/dist/directives/index.es.js +1782 -15
- package/dist/directives/index.umd.js +7 -1
- package/dist/directives/v-contextmenu.es.js +1781 -14
- package/dist/directives/v-contextmenu.umd.js +7 -1
- package/dist/directives/v-tooltip.es.js +1 -1
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +9 -12
- package/dist/index.umd.js +1 -1
- package/dist/resolvers/unplugin.es.js +1 -1
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +2 -2
- package/dist/stories/Combobox/Combobox.stories.d.ts +1 -0
- package/package.json +35 -32
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@iconify/vue"),require("@floating-ui/vue"),require("@vueuse/core"),require("mitt"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","@floating-ui/vue","@vueuse/core","mitt","ts-dot-prop"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCombobox=t(e.vue,e.vue$1,e.vue$2,e.core,e.mitt,e.tsDotProp)}(this,(function(e,t,l,o,a,n){"use strict";const r={prefix:"normal"};var i=(e=>(e.local="local",e.session="session",e))(i||{}),u=(e=>(e.absolute="absolute",e.fixed="fixed",e))(u||{}),s=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(s||{}),d=(e=>(e.topStart="top-start",e.topEnd="top-end",e.bottomStart="bottom-start",e.bottomEnd="bottom-end",e.leftStart="left-start",e.leftEnd="left-end",e.rightStart="right-start",e.rightEnd="right-end",e))(d||{}),c=(e=>(e.before="before",e.after="after",e))(c||{}),v=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(v||{}),f=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(f||{}),p=(e=>(e.button="button",e.link="link",e.menuitem="menuitem",e))(p||{}),m=(e=>(e.listbox="listbox",e.menu="menu",e))(m||{}),b=(e=>(e.option="option",e.presentation="presentation",e))(b||{});const g=Symbol.for("volver"),y=Symbol.for("buttonGroup"),h=Symbol.for("dropdownTrigger"),k=Symbol.for("dropdownItem"),S=Symbol.for("dropdownAction"),B={to:{type:[String,Object]},href:String,target:String,rel:{type:String,default:"noopener noreferrer"}},w={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}},x={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},L={disabled:{type:Boolean,default:!1}},C={required:{type:Boolean,default:!1}},P={selected:{type:Boolean,default:!1}},O={active:{type:Boolean,default:!1}},$={current:{type:Boolean,default:!1}},N={showClearAction:{type:Boolean,default:!1},iconClear:{type:[String,Object],default:"close"},labelClear:{type:String,default:"Clear"}},_={pressed:{type:Boolean,default:!1}},E={label:{type:[String,Number],default:void 0}},A={readonly:{type:Boolean,default:!1}},F={modifiers:{type:[String,Array],default:void 0}},D={hintLabel:{type:String,default:""}},H={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},j={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:c.before,validation:e=>Object.values(c).includes(e)}},R={tabindex:{type:[String,Number],default:0}},I={floating:{type:Boolean,default:!1}},z={unselectable:{type:Boolean,default:!0}},T={id:[String,Number]},M={placement:{type:String,default:s.bottom,validator:e=>Object.values(s).includes(e)||Object.values(d).includes(e)},strategy:{type:String,default:void 0,validator:e=>Object.values(u).includes(e)},transitionName:{type:String,default:void 0},offset:{type:[Number,String,Object],default:0},shift:{type:[Boolean,Object],default:!1},flip:{type:[Boolean,Object],default:!0},size:{type:[Boolean,Object],default:()=>({padding:10})},autoPlacement:{type:[Boolean,Object],default:!1},arrow:{type:Boolean,default:!1},keepOpen:{type:Boolean,default:!1},autofocusFirst:{type:Boolean,default:!0},triggerWidth:{type:Boolean,default:!1}},K={...T,name:{type:String,required:!0}},q={autofocus:{type:Boolean,default:!1}},W={autocomplete:{type:String,default:"off"}},G={...L,...E,..._,...O,...$,...B,type:{type:String,default:v.button,validator:e=>Object.values(v).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:f.button}};i.local;const J={...K,...R,...w,...V,...D,...x,...L,...A,...F,...H,...j,...I,...M,...E,...C,...N,transitionName:{type:String,default:"vv-dropdown--mobile-fade-block"},modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},noResultsLabel:{type:String,default:"No results"},noOptionsLabel:{type:String,default:"No options available"},selectedHintLabel:{type:String,default:"Selected"},deselectActionLabel:{type:String,default:"Deselect"},selectHintLabel:{type:String,default:"Press enter to select"},deselectHintLabel:{type:String,default:"Press enter to remove"},addOptionHintLabel:{type:String,default:"Press enter to add"},closeLabel:{type:String,default:"Close"},placeholder:String,addable:Boolean,searchable:Boolean,searchFunction:{type:Function,default:void 0},searchPlaceholder:{type:String,default:"Search..."},debounceSearch:{type:[Number,String],default:0},multiple:Boolean,minValues:{type:[Number,String],default:0},maxValues:[Number,String],unselectable:{type:Boolean,default:!0},separator:{type:String,default:", "},native:Boolean,badges:Boolean,badgeModifiers:{type:[String,Array],default:"action sm"},triggerWidth:{...M.triggerWidth,default:!0},dropdownModifiers:{type:[String,Array],default:"mobile"},autoOpen:{type:Boolean,default:!1},autoselectFirst:{type:Boolean,default:!1},keepOpen:{type:Boolean,default:!1},focusOnHover:{type:Boolean,default:!0}};function U(){return{...J,options:{...J.options,type:Array},searchFunction:{...J.searchFunction,type:Function}}}function Q(e,t,l){return X(e,t)}function X(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const l=Array.isArray(e),o=Array.isArray(t);let a,n,r;if(l&&o){if(n=e.length,n!==t.length)return!1;for(a=n;0!==a--;)if(!X(e[a],t[a]))return!1;return!0}if(l!==o)return!1;const i=e instanceof Date,u=t instanceof Date;if(i!==u)return!1;if(i&&u)return e.getTime()===t.getTime();const s=e instanceof RegExp,d=t instanceof RegExp;if(s!==d)return!1;if(s&&d)return e.toString()===t.toString();const c=Object.keys(e);if(n=c.length,n!==Object.keys(t).length)return!1;for(a=n;0!==a--;)if(!Object.prototype.hasOwnProperty.call(t,c[a]))return!1;for(a=n;0!==a--;)if(r=c[a],!X(e[r],t[r]))return!1;return!0}return Number.isNaN(e)&&Number.isNaN(t)}function Y(e,t){if(null!=e&&t&&t.length)for(const l of t)if(Q(e,l))return!0;return!1}function Z(e){return Array.isArray(e)?e.filter((e=>"string"==typeof e)).join(" "):e}function ee(t,l){const o=e.computed((()=>e.isRef(t)?t.value:t)),a=e.computed((()=>Z(o.value.invalidLabel))),n=e.computed((()=>Z(o.value.validLabel))),r=e.computed((()=>o.value.loadingLabel)),i=e.computed((()=>o.value.hintLabel)),u=e.computed((()=>Boolean(o.value.loading&&(l.loading||r.value)))),s=e.computed((()=>!u.value&&Boolean(o.value.invalid&&(l.invalid||a.value)))),d=e.computed((()=>!u.value&&!s.value&&Boolean(o.value.valid&&(l.valid||n.value)))),c=e.computed((()=>!u.value&&!s.value&&!d.value&&Boolean(l.hint||i.value))),v=e.computed((()=>s.value||d.value||u.value||c.value)),f=e.computed((()=>({modelValue:o.value.modelValue,valid:o.value.valid,invalid:o.value.invalid,loading:o.value.loading}))),p=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:v,invalidLabel:a,validLabel:n,loadingLabel:r,hintLabel:i,hasInvalidLabelOrSlot:s,hasValidLabelOrSlot:d,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:c}),render(){var t,l,o,a,n,r,i,u;if(this.isVisible){let s;return this.hasInvalidLabelOrSlot&&(s="alert"),this.hasValidLabelOrSlot&&(s="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:s},(null==(l=(t=this.$slots).loading)?void 0:l.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:s},(null==(a=(o=this.$slots).invalid)?void 0:a.call(o))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:s},(null==(r=(n=this.$slots).valid)?void 0:r.call(n))??this.validLabel):e.h(this.tag,{role:s},(null==(u=(i=this.$slots).hint)?void 0:u.call(i))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:s,hasHintLabelOrSlot:c,hasValidLabelOrSlot:d,hasLoadingLabelOrSlot:u,hintSlotScope:f,HintSlot:p}}function te(){return e.inject(g,void 0)}function le(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 oe=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:{}},r),setup(l){const o=l,a=e.computed((()=>"string"==typeof o.rotate?Number.parseFloat(o.rotate):o.rotate)),n=e.ref(!0),r=te(),{modifiers:i}=e.toRefs(o),u=le("vv-icon",i),s=e.computed((()=>o.provider||(null==r?void 0:r.iconsProvider))),d=e.computed((()=>{const e=o.name??"",l=`@${s.value}:${o.prefix}:${e}`;if(t.iconLoaded(l))return l;const a=null==r?void 0:r.iconsCollections.find((l=>{const o=`@${s.value}:${l.prefix}:${e}`;return t.iconLoaded(o)}));return a?`@${s.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(`@${s.value}:${o.prefix}:${o.name}`,{body:a,height:l.viewBox.baseVal.height,width:l.viewBox.baseVal.width})}return r&&o.src&&!t.iconLoaded(`@${s.value}:${o.prefix}:${o.name}`)&&(n.value=!1,r.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(d)},{onLoad:l.onLoad}),null,16,["class","onLoad"])):e.createCommentVNode("v-if",!0)}});function ae(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)===c.before?o.value:void 0)),n=e.computed((()=>(null==l?void 0:l.value)===c.after?o.value:void 0)),r=e.computed((()=>(null==l?void 0:l.value)===s.left?o.value:void 0)),i=e.computed((()=>(null==l?void 0:l.value)===s.right?o.value:void 0)),u=e.computed((()=>(null==l?void 0:l.value)===s.top?o.value:void 0)),d=e.computed((()=>(null==l?void 0:l.value)===s.bottom?o.value:void 0));return{hasIcon:o,hasIconLeft:r,hasIconRight:i,hasIconTop:u,hasIconBottom:d,hasIconBefore:a,hasIconAfter:n}}const ne=e.defineComponent({components:{VvIcon:oe},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}=ae(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(oe,{...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)}}),re={...F,value:[String,Number]},ie=e.defineComponent({name:"VvBadge",props:re,setup(t){const l=t,{modifiers:o}=e.toRefs(l),a=le("vv-badge",o);return(t,l)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(a))},[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.value),1)]))],2))}});const ue={...G,...T,...F,...z,...x,...j,iconPosition:{type:String,default:s.left,validator:e=>Object.values(s).includes(e)},loadingIcon:{type:String,default:"eos-icons:bubble-loading"},toggle:{type:Boolean,default:!1},value:{type:[String,Number,Boolean],default:void 0},uncheckedValue:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[String,Number,Boolean],default:void 0}};function se(t,l){const{group:o,isInGroup:a,getGroupOrLocalRef:n}=function(t){const l=e.inject(t,void 0),o=e.computed((()=>void 0!==l));return{group:l,isInGroup:o,getGroupOrLocalRef:function(t,o,a){const n=null==l?void 0:l[t];if(n)return e.computed({get:()=>n.value,set(e){n.value=e}});const r=e.toRef(o,t);return e.computed({get:()=>r.value,set(e){a&&a(`update:${t}`,e)}})}}}(y),{id:r,iconPosition:i,icon:u,label:s,pressed:d}=e.toRefs(t),c=n("modelValue",t,l),v=n("toggle",t),f=n("unselectable",t),p=e.computed((()=>(null==o?void 0:o.multiple.value)??!1)),m=e.computed((()=>{let e=t.modifiers,l=null==o?void 0:o.modifiers.value;const a=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>a.add(e)))),l&&(Array.isArray(l)||(l=l.split(" ")),l.forEach((e=>a.add(e)))),Array.from(a)})),b=e.computed((()=>Boolean(t.disabled||(null==o?void 0:o.disabled.value))));return{group:o,isInGroup:a,modelValue:c,toggle:v,unselectable:f,multiple:p,modifiers:m,disabled:b,id:r,pressed:d,iconPosition:i,icon:u,label:s}}const de=G;const ce=e.defineComponent({name:"VvAction",props:de,emits:["click","mouseover","mouseleave"],setup(t,{expose:l,emit:o}){const a=t,n=o,r=e.getCurrentInstance(),i=te(),u=e.ref(null);l({$el:u});const{reference:s,bus:d,aria:c,expanded:v}=e.inject(h,{});e.watch((()=>u.value),(e=>{s&&(s.value=e)}));const p=e.computed((()=>a.pressed||(null==v?void 0:v.value))),{role:m}=e.inject(S,{}),b=e.computed((()=>{switch(!0){case a.disabled:return f.button;case void 0!==a.to:return(null==i?void 0:i.nuxt)?e.resolveComponent(f.nuxtLink):f.routerLink;case void 0!==a.href:return f.a;default:return a.defaultTag}})),g=e.computed((()=>{const e={...null==c?void 0:c.value,ariaPressed:!!p.value||void 0,ariaLabel:a.ariaLabel,role:null==m?void 0:m.value};switch(b.value){case f.a:return{...e,href:a.href,target:a.target,rel:a.rel};case f.routerLink:case f.nuxtLink:return{...e,to:a.to,target:a.target};case f.button:return{...e,type:a.type,disabled:a.disabled};default:return e}}));function y(e){var t;a.disabled?e.preventDefault():(null==(t=null==r?void 0:r.vnode.props)?void 0:t.onClick)?n("click",e):null==d||d.emit("click",e)}function k(e){var t;(null==(t=null==r?void 0:r.vnode.props)?void 0:t.onMouseover)?n("mouseover",e):null==d||d.emit("mouseover",e)}function B(e){var t;(null==(t=null==r?void 0:r.vnode.props)?void 0:t.onMouseleave)?n("mouseleave",e):null==d||d.emit("mouseleave",e)}return(t,l)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(b)),e.mergeProps(e.unref(g),{ref_key:"element",ref:u,class:{active:t.active,pressed:e.unref(p),disabled:t.disabled,current:t.current},onClickPassive:y,onMouseoverPassive:k,onMouseleavePassive:B}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}});function ve(t){return e.computed((()=>String((null==t?void 0:t.value)||e.useId())))}const fe={key:1,class:"vv-button__label"},pe={key:1,class:"vv-button__label"},me=e.defineComponent({name:"VvButton",inheritAttrs:!1,props:ue,emits:["update:modelValue"],setup(t,{expose:l,emit:o}){const a=t,n=o,r=e.useAttrs(),i=e.useSlots(),{id:u,modifiers:d,iconPosition:c,icon:v,label:f,modelValue:p,disabled:m,toggle:b,unselectable:g}=se(a,n),y=ve(u),h=e.computed((()=>(null==r?void 0:r.name)||y.value)),k=e.ref(null);l({$el:e.computed((()=>{var e;return null==(e=k.value)?void 0:e.$el}))});const S=e.computed((()=>b.value?Array.isArray(p.value)?Y(h.value,p.value):Q(h.value,p.value):a.pressed)),B=le("vv-button",d,e.computed((()=>({reverse:[s.right,s.bottom].includes(c.value),column:[s.top,s.bottom].includes(c.value),"icon-only":Boolean((null==v?void 0:v.value)&&!(null==f?void 0:f.value)&&!i.default)})))),{hasIcon:w}=ae(v),V=e.computed((()=>void 0!==a.value?a.value:h.value)),x=e.computed((()=>{if(b.value)return{onClick:L}}));function L(){if(b.value){if(Array.isArray(p.value))return Y(V.value,p.value)?void(g.value&&(p.value=p.value.filter((e=>e!==V.value)))):void p.value.push(V.value);if(V.value===p.value&&g.value)return void(p.value=a.uncheckedValue);p.value=V.value}}return(t,l)=>(e.openBlock(),e.createBlock(ce,e.mergeProps({...e.unref(r),...e.unref(x),disabled:e.unref(m),pressed:e.unref(S),active:t.active,type:t.type,to:t.to,href:t.href,target:t.target,rel:t.rel,ariaLabel:t.ariaLabel},{id:e.unref(y),ref_key:"element",ref:k,class:e.unref(B)}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[t.loading?e.renderSlot(t.$slots,"loading",{key:0},(()=>[t.loadingIcon?(e.openBlock(),e.createBlock(oe,{key:0,class:"vv-button__loading-icon",name:t.loadingIcon},null,8,["name"])):e.createCommentVNode("v-if",!0),t.loadingLabel?(e.openBlock(),e.createElementBlock("span",fe,e.toDisplayString(t.loadingLabel),1)):e.createCommentVNode("v-if",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(t.$slots,"before"),e.unref(w)?(e.openBlock(),e.createBlock(oe,e.mergeProps({key:0},e.unref(w),{class:"vv-button__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.unref(f)?(e.openBlock(),e.createElementBlock("span",pe,[e.renderSlot(t.$slots,"label",{},(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)),1)]))])):e.createCommentVNode("v-if",!0),e.renderSlot(t.$slots,"after")],64))]))])),_:3},16,["id","class"]))}}),be={...T,...M,...F,modelValue:{type:Boolean,default:void 0},reference:{type:Object,default:null},role:{type:String,default:m.menu,validator:e=>Object.values(m).includes(e)}},ge={focusOnHover:{type:Boolean,default:!1}},ye={...L,...P,...z,...F,deselectHintLabel:{type:String},selectHintLabel:{type:String},selectedHintLabel:{type:String},focusOnHover:{type:Boolean,default:!1}};const he=["id","tabindex","role","aria-labelledby"],ke=e.defineComponent({name:"VvDropdown",inheritAttrs:!1,props:be,emits:["update:modelValue","beforeEnter","afterLeave","beforeExpand","beforeCollapse","afterExpand","afterCollapse","before-enter","after-leave","enter","afterEnter","enterCancelled","beforeLeave","leave","leaveCancelled"],setup(t,{expose:n,emit:r}){const i=t,d=r,{id:c}=e.toRefs(i),v=ve(c),f=e.useAttrs(),p=e.ref("auto"),g=e.ref("auto"),y=e.ref(),S=e.ref(),B=e.ref(),w=e.ref(),V=e.computed({get:()=>i.reference??y.value,set:e=>{y.value=e}}),x=e.ref(!1);e.onMounted((()=>{o.useMutationObserver(S.value,(()=>{var e;x.value="true"===(null==(e=window.getComputedStyle(S.value).getPropertyValue("--dropdown-custom-position"))?void 0:e.trim())}),{attributeFilter:["style"],window:window})}));const L=e.computed((()=>{const e=[];if(i.autoPlacement?"boolean"==typeof i.autoPlacement?e.push(l.autoPlacement()):e.push(l.autoPlacement(i.autoPlacement)):i.flip&&("boolean"==typeof i.flip?e.push(l.flip({fallbackStrategy:"initialPlacement"})):e.push(l.flip(i.flip))),i.shift&&("boolean"==typeof i.shift?e.push(l.shift()):e.push(l.shift(i.shift))),i.size){const t=({availableWidth:e,availableHeight:t})=>{p.value=`${e}px`,g.value=`${t}px`};"boolean"==typeof i.size?e.push(l.size({apply:t})):e.push(l.size({...i.size,apply:t}))}return i.offset&&(e.push(l.offset(Number(i.offset))),["string","number"].includes(typeof i.offset)?e.push(l.offset(Number(i.offset))):e.push(l.offset(i.offset))),i.arrow&&e.push(l.arrow({element:B})),e})),{x:C,y:P,middlewareData:O,placement:$,strategy:N}=l.useFloating(V,S,{whileElementsMounted:(...e)=>l.autoUpdate(...e,{animationFrame:i.strategy===u.fixed}),placement:e.computed((()=>i.placement)),strategy:e.computed((()=>i.strategy)),middleware:L}),_=e.computed((()=>{var e;if(x.value)return;const t=i.triggerWidth&&V.value?`${null==(e=V.value)?void 0:e.offsetWidth}px`:void 0;return{position:N.value,top:`${P.value??0}px`,left:`${C.value??0}px`,maxWidth:t?void 0:p.value,maxHeight:g.value,width:t}})),E=e.computed((()=>$.value.split("-")[0])),A=e.computed((()=>{var e,t,l,o,a;if(x.value)return;const n={[s.top]:s.bottom,[s.right]:s.left,[s.bottom]:s.top,[s.left]:s.right}[E.value];return{left:void 0!==(null==(e=O.value.arrow)?void 0:e.x)?`${null==(t=O.value.arrow)?void 0:t.x}px`:void 0,top:void 0!==(null==(l=O.value.arrow)?void 0:l.y)?`${null==(o=O.value.arrow)?void 0:o.y}px`:void 0,[n]:-((null==(a=B.value)?void 0:a.offsetWidth)??0)/2+"px"}})),F=o.useVModel(i,"modelValue",d),D=e.ref(!1),H=e.computed({get:()=>F.value??D.value,set:e=>{void 0!==F.value?F.value=e:D.value=e}});function j(){H.value=!0}function R(){H.value=!1}function I(){H.value=!H.value}function z(e){V.value=e}o.onClickOutside(S,(()=>{!i.keepOpen&&H.value&&(H.value=!1)}),{ignore:[V]});const T=e.computed((()=>{var e,t;return(null==(t=null==(e=V.value)?void 0:e.getAttribute)?void 0:t.call(e,"id"))??void 0})),M=e.computed((()=>({"aria-controls":v.value,"aria-haspopup":!0,"aria-expanded":H.value}))),{component:K,bus:q}=function({reference:t,id:l,expanded:o,aria:n}){const r=a(),i=e.defineComponent({name:"VvDropdownTriggerProvider",setup(){e.provide(h,{reference:t,id:l,expanded:o,aria:n,bus:r})},render(){var t,l;return e.h(e.Fragment,{},null==(l=(t=this.$slots).default)?void 0:l.call(t))}});return{bus:r,component:i}}({reference:V,id:v,expanded:H,aria:M});q.on("click",I);const{role:W,modifiers:G}=e.toRefs(i),J=le("vv-dropdown",G,e.computed((()=>({arrow:i.arrow})))),{focused:U}=o.useFocusWithin(S);function Q(e){return e?[...e.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')].filter((e=>!e.hasAttribute("disabled")&&!e.getAttribute("aria-hidden"))):[]}function X(){e.nextTick((()=>{const e=Q(S.value);e.length>0&&e[0].focus({preventScroll:!0})}))}function Y(){e.nextTick((()=>{if(U.value){const e=Q(S.value);if(0===e.length||!document.activeElement)return;const t=e.indexOf(document.activeElement);t<e.length-1?e[t+1].focus({preventScroll:!0}):e[0].focus({preventScroll:!0})}}))}function Z(){e.nextTick((()=>{if(U.value){const e=Q(S.value);if(0===e.length||!document.activeElement)return;const t=e.indexOf(document.activeElement);t>0?e[t-1].focus({preventScroll:!0}):e[e.length-1].focus({preventScroll:!0})}}))}e.watch(H,(e=>{e&&i.autofocusFirst&&X()})),n({toggle:I,show:j,hide:R,init:z,focusFirst:X,focusFirstListElement:function(){e.nextTick((()=>{const e=Q(w.value);e.length>0&&e[0].focus({preventScroll:!0})}))},focusNext:Y,focusPrev:Z,customPosition:x});const ee=o.useElementHover(S),{itemRole:te}=function({role:t,...l}){const o=e.computed((()=>t.value===m.listbox?b.option:b.presentation));return e.provide(k,{role:o,...l}),{itemRole:o}}({role:W,expanded:H,focused:U,hovered:ee});o.onKeyStroke("Escape",(e=>{H.value&&(e.preventDefault(),R())})),o.onKeyStroke("ArrowDown",(e=>{H.value&&U.value&&(e.preventDefault(),Y())})),o.onKeyStroke("ArrowUp",(e=>{H.value&&U.value&&(e.preventDefault(),Z())})),o.onKeyStroke([" ","Enter"],(e=>{const t=e.target;H.value&&U.value&&t&&(null==t||t.click())}));const oe={"before-enter":()=>{d(H.value?"beforeExpand":"beforeCollapse"),d("beforeEnter")},"after-leave":()=>{d(H.value?"afterExpand":"afterCollapse"),d("afterLeave")},enter:()=>{d("enter")},"after-enter":()=>{d("afterEnter")},"enter-cancelled":()=>{d("enterCancelled")},"before-leave":()=>{d("beforeLeave")},leave:()=>{d("leave")},"leave-cancelled":()=>{d("leaveCancelled")}};return(t,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(K),null,{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps({init:z,show:j,hide:R,toggle:I,expanded:e.unref(H),aria:e.unref(M)})))])),_:3}),e.createVNode(e.Transition,e.mergeProps({name:t.transitionName},e.toHandlers(oe),{persisted:""}),{default:e.withCtx((()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"floatingEl",ref:S,style:e.normalizeStyle(e.unref(_)),class:e.normalizeClass(e.unref(J))},[i.arrow?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"arrowEl",ref:B,style:e.normalizeStyle(e.unref(A)),class:"vv-dropdown__arrow"},null,4)):e.createCommentVNode("v-if",!0),e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps({expanded:e.unref(H)}))),e.createElementVNode("div",e.mergeProps(e.unref(f),{id:e.unref(v),ref_key:"listEl",ref:w,tabindex:e.unref(H)?void 0:-1,role:e.unref(W),"aria-labelledby":e.unref(T),class:"vv-dropdown__list"}),[e.renderSlot(t.$slots,"items",e.normalizeProps(e.guardReactiveProps({role:e.unref(te)})))],16,he),e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps({expanded:e.unref(H)})))],6),[[e.vShow,e.unref(H)]])])),_:3},16,["name"])],64))}}),Se={class:"vv-dropdown-optgroup",role:"presentation",tabindex:"-1"},Be=e.defineComponent({name:"VvDropdownOptgroup",props:{...E},setup(t){const l=t;return(t,o)=>(e.openBlock(),e.createElementBlock("li",Se,e.toDisplayString(l.label),1))}}),we=e.defineComponent({name:"VvDropdownItem",props:ge,setup(t){const l=t,{role:a,expanded:n}=e.inject(k,{}),r=e.ref(null);!function({expanded:t}){e.provide(S,{role:e.ref(p.menuitem),expanded:t})}({expanded:n});const i=o.useElementHover(r),{focused:u}=o.useFocus(r),{focused:s}=o.useFocusWithin(r);return e.watch(i,(e=>{e&&l.focusOnHover&&(u.value=!0)})),(t,l)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({role:e.unref(a)},{ref_key:"element",ref:r,class:["vv-dropdown__item",{"focus-visible":e.unref(u)||e.unref(s)}]}),[e.renderSlot(t.$slots,"default")],16))}}),Ve=["title"],xe=e.defineComponent({name:"VvDropdownOption",props:ye,setup(t){const l=t,{modifiers:o}=e.toRefs(l),a=le("vv-dropdown-option",o,e.computed((()=>({disabled:l.disabled,selected:l.selected,unselectable:l.unselectable&&l.selected})))),n=e.computed((()=>l.selected?l.unselectable?l.deselectHintLabel:l.selectedHintLabel:l.disabled?"":l.selectHintLabel));return(t,l)=>(e.openBlock(),e.createBlock(we,{class:e.normalizeClass(e.unref(a)),tabindex:t.disabled?-1:0,"aria-selected":t.selected,"aria-disabled":t.disabled,"focus-on-hover":t.focusOnHover},{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default"),e.createElementVNode("span",{class:"vv-dropdown-option__hint",title:e.unref(n)},[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps({disabled:t.disabled,selected:t.selected,unselectable:t.unselectable})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)),1)]))],8,Ve)])),_:3},8,["class","tabindex","aria-selected","aria-disabled","focus-on-hover"]))}}),Le={...K,...q,...W,...R,...w,...V,...D,...x,...L,...A,...F,...H,...j,...I,...z,...E,...N,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 Ce(){return{...Le,options:{...Le.options,type:Array,default:()=>[]}}}function Pe(t,l,o){const a=te(),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];if(a.length){a[0]===n&&(l[o]=e[o])}}if("function"==typeof t[o]){(0,t[o])()===n&&(l[o]=e[o])}if("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}),{})}))}function Oe(t,l){const{focused:a}=o.useFocus(t);return e.watch(a,(o=>{l(o?"focus":"blur",e.unref(t))})),{focused:a}}function $e(t){const{options:l,labelKey:o,valueKey:a,disabledKey:r}=e.toRefs(t);return{options:l,getOptionLabel:e=>"string"==typeof e?e:"function"==typeof o.value?o.value(e):String(o.value?n.get(e,o.value):e),getOptionValue:e=>"string"==typeof e?e:"function"==typeof a.value?a.value(e):a.value?n.get(e,a.value):e,isOptionDisabled:e=>"string"!=typeof e&&("function"==typeof r.value?r.value(e):!!r.value&&n.get(e,r.value)),getOptionGrouped:e=>"string"==typeof e?[]:"object"==typeof e&&e&&"options"in e?e.options:[]}}const Ne=["for"],_e={class:"vv-select__wrapper"},Ee={key:0,class:"vv-select__input-before"},Ae={class:"vv-select__inner"},Fe=["id"],De=["disabled","hidden"],He=["disabled","value"],je=["disabled","label"],Re=["disabled","value"],Ie={key:2,class:"vv-select__input-after"},ze=e.defineComponent({name:"VvSelect",props:Ce(),emits:["update:modelValue","focus","blur","clear"],setup(t,{emit:l}){const a=t,n=l,r=e.useSlots(),i=Pe("VvSelect",Ce(),a),u=e.ref(),{HintSlot:s,hasHintLabelOrSlot:d,hasInvalidLabelOrSlot:c,hintSlotScope:v}=ee(i,r),{focused:f}=Oe(u,n);function p(e){var t;return"string"!=typeof e&&(null==(t=e.options)?void 0:t.length)}const{id:m,modifiers:b,disabled:g,readonly:y,loading:h,icon:k,iconPosition:S,invalid:B,valid:w,floating:V,multiple:x}=e.toRefs(a),L=ve(m),C=e.computed((()=>`${L.value}-hint`)),P=e.computed((()=>a.disabled||a.readonly)),O=e.computed((()=>P.value?-1:a.tabindex)),$=e.computed({get:()=>a.modelValue,set:e=>{Array.isArray(e)&&0===(e=e.filter((e=>void 0!==e))).length&&!a.unselectable&&u.value?u.value.value=String(a.modelValue):n("update:modelValue",e)}}),N=e.computed((()=>Array.isArray($.value)?$.value.length>0:void 0!==$.value&&null!==$.value)),_=e.computed((()=>!P.value&&a.unselectable)),E=o.useElementVisibility(u);e.watch(E,(e=>{e&&a.autofocus&&(f.value=!0)}));const{hasIconBefore:A,hasIconAfter:F}=ae(k,S),D=e.computed((()=>!0===a.invalid||!0!==a.valid&&void 0)),H=le("vv-select",b,e.computed((()=>({valid:w.value,invalid:B.value,loading:h.value,disabled:g.value,readonly:y.value,"icon-before":void 0!==A.value,"icon-after":void 0!==F.value,dirty:N.value,focus:f.value&&!P.value,floating:V.value,multiple:x.value})))),{getOptionLabel:j,getOptionValue:R,isOptionDisabled:I,getOptionGrouped:z}=$e(a);function T(){Array.isArray($.value)?$.value=[]:$.value=void 0,n("clear")}e.watch((()=>a.options),(e=>{if((null==e?void 0:e.length)&&a.autoselectFirst&&!N.value){const t=R(e[0]);$.value=a.multiple?[t]:t}}),{immediate:!0});const M=e.computed((()=>({name:a.name,tabindex:O.value,disabled:P.value,required:a.required,size:a.size,autocomplete:a.autocomplete,multiple:a.multiple,"aria-invalid":D.value,"aria-describedby":d.value?C.value:void 0,"aria-errormessage":c.value?C.value:void 0}))),K=e.computed((()=>({valid:a.valid,invalid:a.invalid,modelValue:a.modelValue})));return(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(H))},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(L)},e.toDisplayString(t.label),9,Ne)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",_e,[t.$slots.before?(e.openBlock(),e.createElementBlock("div",Ee,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(K))))])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",Ae,[e.unref(A)?(e.openBlock(),e.createBlock(oe,e.mergeProps({key:0},e.unref(A),{class:"vv-select__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("select",e.mergeProps({id:e.unref(L),ref_key:"selectEl",ref:u},e.unref(M),{"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef($)?$.value=t:null)}),[t.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,value:void 0,disabled:!e.unref(_),hidden:!e.unref(_)},e.toDisplayString(t.placeholder),9,De)):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,[p(t)?(e.openBlock(),e.createElementBlock("optgroup",{key:`group-${l}`,disabled:e.unref(I)(t),label:e.unref(j)(t)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(z)(t),((t,o)=>(e.openBlock(),e.createElementBlock("option",{key:`group-${l}-item-${o}`,disabled:e.unref(I)(t),value:e.unref(R)(t)},e.toDisplayString(e.unref(j)(t)),9,Re)))),128))],8,je)):(e.openBlock(),e.createElementBlock("option",{key:l,disabled:e.unref(I)(t),value:e.unref(R)(t)},e.toDisplayString(e.unref(j)(t)),9,He))],64)))),256))],16,Fe),[[e.vModelSelect,e.unref($)]]),e.unref(F)?(e.openBlock(),e.createBlock(oe,e.mergeProps({key:1},e.unref(F),{class:"vv-select__icon vv-select__icon-after"}),null,16)):e.createCommentVNode("v-if",!0)]),e.unref(_)&&e.unref(i).showClearAction?(e.openBlock(),e.createBlock(e.unref(ne),{key:1,"input-type":"select",label:t.labelClear,icon:t.iconClear,disabled:!e.unref(N),onClear:T},null,8,["label","icon","disabled"])):e.createCommentVNode("v-if",!0),t.$slots.after?(e.openBlock(),e.createElementBlock("div",Ie,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(K))))])):e.createCommentVNode("v-if",!0)]),e.createVNode(e.unref(s),{id:e.unref(C),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(v))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(v))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(v))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(v))))])),key:"3"}:void 0]),1032,["id"])],2))}}),Te=["id"],Me=["id","for"],Ke=["id","aria-controls","placeholder"],qe={key:0,class:"vv-select__input-before"},We={class:"vv-select__inner"},Ge=["aria-controls","aria-expanded","aria-labelledby","aria-describedby","aria-errormessage","tabindex"],Je={key:0,class:"vv-select__value"},Ue=["aria-label","onClick"],Qe={key:2,class:"vv-select__input-after"},Xe={name:"VvCombobox",components:{VvDropdown:ke,VvDropdownOption:xe,VvDropdownOptgroup:Be,VvButton:me}};return e.defineComponent({...Xe,props:U(),emits:["update:modelValue","update:search","update:options","focus","blur","clear","change:search"],setup(t,{emit:l}){const a=t,n=l,r=e.useSlots(),i=Pe("VvCombobox",U(),a),u=e.ref(null),s=e.ref(null),d=e.ref(null),c=e.ref(),{HintSlot:v,hasHintLabelOrSlot:f,hasInvalidLabelOrSlot:p,hintSlotScope:b}=ee(i,r),{focused:g}=Oe(u,n),{focused:y}=o.useFocusWithin(d);e.watch(g,(e=>{a.autoOpen&&(!e||S.value?e||!S.value||y.value||V():w())})),e.watch(y,(e=>{g.value||e||!S.value||V()}));const h=e.ref(""),k=o.refDebounced(h,e.computed((()=>Number(a.debounceSearch))));e.watch(k,(()=>{n("update:search",k.value),n("change:search",k.value)}));const S=e.ref(!1);function B(){K.value||(S.value=!S.value)}function w(){K.value||S.value||(S.value=!0)}function V(){!K.value&&S.value&&(S.value=!1)}function x(){i.value.searchable&&s.value&&s.value.focus({preventScroll:!0})}function L(){i.value.searchable&&(h.value="")}function C(e){var t;return"string"!=typeof e&&(null==(t=e.options)?void 0:t.length)}const{id:P,icon:O,iconPosition:$,modifiers:N,disabled:_,required:E,readonly:A,loading:F,valid:D,invalid:H,floating:j}=e.toRefs(a),R=ve(P),I=e.computed((()=>`${R.value}-hint`)),z=e.computed((()=>`${R.value}-dropdown`)),T=e.computed((()=>`${R.value}-search`)),M=e.computed((()=>`${R.value}-label`)),K=e.computed((()=>a.disabled||a.readonly)),q=e.computed((()=>K.value?-1:a.tabindex)),W=e.computed({get:()=>Array.isArray(a.modelValue)?a.modelValue:void 0!==a.modelValue&&null!==a.modelValue?[a.modelValue]:[],set:e=>{n("update:modelValue",a.multiple||Array.isArray(a.modelValue)?e:e.pop())}}),G=e.computed((()=>W.value.length)),J=e.computed((()=>G.value>0)),Q=e.computed((()=>a.multiple?void 0===a.maxValues?1/0:Number(a.maxValues):1)),X=e.computed((()=>!K.value&&(!!a.unselectable&&(0===Number(a.minValues)||G.value>Number(a.minValues))))),Y=e.computed((()=>!K.value&&(!a.multiple||G.value<Q.value))),Z=e.ref(!1),te=e.computed((()=>Z.value||F.value)),{hasIconBefore:re,hasIconAfter:ue}=ae(O,$),se=le("vv-select",N,e.computed((()=>({disabled:_.value,required:E.value,loading:te.value,readonly:A.value,"icon-before":void 0!==re.value,"icon-after":void 0!==ue.value,valid:D.value,invalid:H.value,dirty:J.value,focus:(g.value||y.value||S.value)&&!K.value,floating:j.value,badges:a.badges})))),de=e.ref(new Set),{getOptionLabel:ce,getOptionValue:fe,getOptionGrouped:pe,isOptionDisabled:be}=$e(a),ge=e.computed((()=>{const e=[...a.options,...de.value];for(const t of W.value)e.some((e=>{const l=fe(e);return"object"==typeof l?JSON.stringify(l)===JSON.stringify(t):l===t}))||e.push(t);return e}));function ye(e){return be(e)||!Y.value&&!Se(e)}e.watch(de,(e=>{e.size>0&&n("update:options",ge.value)}));const he=o.computedAsync((async()=>{var e;if(i.value.searchFunction){Z.value=!0;const e=await Promise.resolve(i.value.searchFunction(k.value,ge.value));return Z.value=!1,e}return null==(e=ge.value)?void 0:e.filter((e=>ce(e).toLowerCase().includes(k.value.toLowerCase().trim())))}));function Se(e){const t=fe(e);return"object"==typeof t?W.value.some((e=>"object"==typeof e&&JSON.stringify(e)===JSON.stringify(t))):W.value.includes(t)}const we=e.computed((()=>ge.value.reduce(((e,t)=>C(t)?[...e,...pe(t)]:[...e,t]),[]).filter((e=>Se(e))))),Ve=e.computed((()=>we.value.map((e=>ce(e))).join(a.separator)));function Le(){a.autoOpen?w():B()}function Ce(e){const t=Se(e),l=fe(e);t&&X.value?W.value=W.value.filter((e=>"object"==typeof l&&"object"==typeof e?JSON.stringify(e)!==JSON.stringify(l):e!==l)):!t&&Y.value&&(a.multiple?W.value=[...W.value,l]:W.value=[l]),a.multiple||a.keepOpen||V()}function Ne(){W.value=[],n("update:search",""),n("clear")}e.watch(ge,(e=>{(null==e?void 0:e.length)&&a.autoselectFirst&&!J.value&&Ce(e[0])}),{immediate:!0});const _e=e.computed((()=>({id:R.value,name:a.name,tabindex:q.value,valid:D.value,validLabel:i.value.validLabel,invalid:H.value,invalidLabel:i.value.invalidLabel,hintLabel:i.value.hintLabel,loading:te.value,loadingLabel:i.value.loadingLabel,disabled:_.value,readonly:A.value,modifiers:i.value.modifiers,options:i.value.options,labelKey:i.value.labelKey,valueKey:i.value.valueKey,icon:i.value.icon,iconPosition:i.value.iconPosition,floating:i.value.floating,unselectable:X.value,autoselectFirst:i.value.autoselectFirst,multiple:i.value.multiple,label:i.value.label,placeholder:i.value.placeholder,modelValue:a.modelValue}))),Ee=e.computed((()=>({id:z.value,reference:d.value,placement:i.value.placement,strategy:i.value.strategy,transitionName:i.value.transitionName,offset:i.value.offset,shift:i.value.shift,flip:i.value.flip,autoPlacement:i.value.autoPlacement,arrow:i.value.arrow,autofocusFirst:!!i.value.searchable||i.value.autofocusFirst,triggerWidth:i.value.triggerWidth,modifiers:i.value.dropdownModifiers}))),Ae=e.computed((()=>({valid:a.valid,invalid:a.invalid,modelValue:a.modelValue})));function Fe(){var e,t;if(null==(e=he.value)?void 0:e.length)return 1===he.value.length?void Ce(he.value[0]):void(null==(t=c.value)||t.focusFirstListElement());if(i.value.addable){const e=h.value.trim();if(!e)return;if(ge.value.some((t=>ce(t).toLowerCase()===e.toLowerCase())))return;de.value.add(e),Ce(e)}}return o.onKeyStroke([" ","Enter"],(e=>{a.autoOpen||!S.value&&g.value&&(e.preventDefault(),e.stopImmediatePropagation(),B())}),{target:u}),(t,l)=>t.native?(e.openBlock(),e.createBlock(ze,e.mergeProps({key:1},e.unref(_e),{"onUpdate:modelValue":l[3]||(l[3]=e=>n("update:modelValue",e))}),null,16)):(e.openBlock(),e.createElementBlock("div",{key:0,id:e.unref(R),class:e.normalizeClass(e.unref(se))},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,id:e.unref(M),for:e.unref(i).searchable?e.unref(T):void 0},e.toDisplayString(t.label),9,Me)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{ref_key:"wrapperEl",ref:d,class:"vv-select__wrapper"},[e.createVNode(ke,e.mergeProps({ref_key:"dropdownEl",ref:c,modelValue:e.unref(S),"onUpdate:modelValue":l[2]||(l[2]=t=>e.isRef(S)?S.value=t:null)},e.unref(Ee),{role:e.unref(m).listbox,onAfterExpand:x,onAfterCollapse:L}),e.createSlots({default:e.withCtx((({aria:l})=>[t.$slots.before?(e.openBlock(),e.createElementBlock("div",qe,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(Ae))))])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",We,[e.unref(re)?(e.openBlock(),e.createBlock(oe,e.mergeProps({key:0},e.unref(re),{class:"vv-select__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",e.mergeProps({ref_key:"inputEl",ref:u},l,{class:"vv-select__input",role:"combobox","aria-controls":e.unref(z),"aria-expanded":e.unref(S),"aria-labelledby":e.unref(M),"aria-describedby":e.unref(f)?e.unref(I):void 0,"aria-errormessage":e.unref(p)?e.unref(I):void 0,tabindex:e.unref(q),onClickPassive:Le}),[e.renderSlot(t.$slots,"value",e.normalizeProps(e.guardReactiveProps({selectedOptions:e.unref(we),onInput:Ce})),(()=>[e.unref(Ve)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.badges?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(e.unref(we),((l,o)=>(e.openBlock(),e.createBlock(ie,{key:o,modifiers:t.badgeModifiers,class:"vv-select__badge"},{default:e.withCtx((()=>[e.createTextVNode(e.toDisplayString(e.unref(ce)(l))+" ",1),e.unref(X)?(e.openBlock(),e.createElementBlock("button",{key:0,"aria-label":e.unref(i).deselectActionLabel,type:"button",onClick:e.withModifiers((e=>Ce(l)),["stop"])},[e.createVNode(oe,{name:"close"})],8,Ue)):e.createCommentVNode("v-if",!0)])),_:2},1032,["modifiers"])))),128)):(e.openBlock(),e.createElementBlock("div",Je,e.toDisplayString(e.unref(Ve)),1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.placeholder),1)],64))]))],16,Ge),e.unref(ue)?(e.openBlock(),e.createBlock(oe,e.mergeProps({key:1},e.unref(ue),{class:"vv-select__icon vv-select__icon-after"}),null,16)):e.createCommentVNode("v-if",!0)]),e.unref(X)&&e.unref(i).showClearAction?(e.openBlock(),e.createBlock(e.unref(ne),{key:1,"input-type":"select",label:t.labelClear,icon:t.iconClear,disabled:!e.unref(J),onClear:Ne},null,8,["label","icon","disabled"])):e.createCommentVNode("v-if",!0),t.$slots.after?(e.openBlock(),e.createElementBlock("div",Qe,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(Ae))))])):e.createCommentVNode("v-if",!0)])),items:e.withCtx((()=>{var l;return[!e.unref(_)&&(null==(l=e.unref(he))?void 0:l.length)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(he),((l,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:o},[C(l)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(Be,{label:e.unref(ce)(l)},null,8,["label"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(pe)(l),((o,a)=>(e.openBlock(),e.createBlock(xe,e.mergeProps({ref_for:!0},{selected:Se(o),disabled:ye(o),unselectable:e.unref(X),deselectHintLabel:e.unref(i).deselectHintLabel,selectHintLabel:e.unref(i).selectHintLabel,selectedHintLabel:e.unref(i).selectedHintLabel,focusOnHover:t.focusOnHover},{key:a,class:"vv-dropdown-option",onClickPassive:e=>Ce(o)}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"option",e.mergeProps({ref_for:!0},{option:l,selectedOptions:e.unref(we),selected:Se(o),disabled:ye(o)}),(()=>[e.createTextVNode(e.toDisplayString(e.unref(ce)(o)),1)]))])),_:2},1040,["onClickPassive"])))),128))],64)):(e.openBlock(),e.createBlock(xe,e.mergeProps({key:1,ref_for:!0},{selected:Se(l),disabled:ye(l),unselectable:e.unref(X),deselectHintLabel:e.unref(i).deselectHintLabel,selectHintLabel:e.unref(i).selectHintLabel,selectedHintLabel:e.unref(i).selectedHintLabel,focusOnHover:t.focusOnHover},{class:"vv-dropdown-option",onClickPassive:e=>Ce(l)}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"option",e.mergeProps({ref_for:!0},{option:l,selectedOptions:e.unref(we),selected:Se(l),disabled:ye(l)}),(()=>[e.createTextVNode(e.toDisplayString(e.unref(ce)(l)),1)]))])),_:2},1040,["onClickPassive"]))],64)))),128)):t.options.length?e.unref(_)?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock(xe,{key:2,modifiers:"inert"},{default:e.withCtx((()=>[e.renderSlot(t.$slots,"no-results",{},(()=>[e.createTextVNode(e.toDisplayString(e.unref(i).addable?e.unref(i).addOptionHintLabel:e.unref(i).noResultsLabel),1)]))])),_:3})):(e.openBlock(),e.createBlock(xe,{key:1,modifiers:"inert"},{default:e.withCtx((()=>[e.renderSlot(t.$slots,"no-options",{},(()=>[e.createTextVNode(e.toDisplayString(e.unref(i).noOptionsLabel),1)]))])),_:3}))]})),after:e.withCtx((()=>[e.renderSlot(t.$slots,"dropdown::after",{},(()=>{var t;return[(null==(t=e.unref(c))?void 0:t.customPosition)?(e.openBlock(),e.createBlock(me,{key:0,label:e.unref(i).closeLabel,modifiers:"secondary",onClick:l[1]||(l[1]=t=>e.unref(c).hide())},null,8,["label"])):e.createCommentVNode("v-if",!0)]}))])),_:2},[e.unref(i).searchable||t.$slots["dropdown::before"]?{name:"before",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"dropdown::before"),e.unref(i).searchable&&!e.unref(_)?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,id:e.unref(T),ref_key:"inputSearchEl",ref:s,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(h)?h.value=t:null),"aria-autocomplete":"list","aria-controls":e.unref(z),autocomplete:"off",spellcheck:"false",type:"search",class:"vv-dropdown__search",placeholder:e.unref(i).searchPlaceholder,onKeyup:e.withKeys(Fe,["enter"])},null,40,Ke)),[[e.vModelText,e.unref(h)]]):e.createCommentVNode("v-if",!0)])),key:"0"}:void 0]),1040,["modelValue","role"])],512),e.createVNode(e.unref(v),{id:e.unref(I),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(b))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(b))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(b))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(b))))])),key:"3"}:void 0]),1032,["id"])],10,Te))}})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@iconify/vue"),require("@floating-ui/vue"),require("@vueuse/core"),require("mitt"),require("dot-prop")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","@floating-ui/vue","@vueuse/core","mitt","dot-prop"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCombobox=t(e.Vue,e.Iconify,e.FloatingVue,e.VueUse,e.mitt,e.dotProp)}(this,function(e,t,o,l,a,n){"use strict";const r={prefix:"normal"};var i=(e=>(e.local="local",e.session="session",e))(i||{}),u=(e=>(e.absolute="absolute",e.fixed="fixed",e))(u||{}),s=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(s||{}),d=(e=>(e.topStart="top-start",e.topEnd="top-end",e.bottomStart="bottom-start",e.bottomEnd="bottom-end",e.leftStart="left-start",e.leftEnd="left-end",e.rightStart="right-start",e.rightEnd="right-end",e))(d||{}),c=(e=>(e.before="before",e.after="after",e))(c||{}),f=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(f||{}),p=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(p||{}),v=(e=>(e.button="button",e.link="link",e.menuitem="menuitem",e))(v||{}),m=(e=>(e.listbox="listbox",e.menu="menu",e))(m||{}),b=(e=>(e.option="option",e.presentation="presentation",e))(b||{});const g=Symbol.for("volver"),y=Symbol.for("buttonGroup"),h=Symbol.for("dropdownTrigger"),k=Symbol.for("dropdownItem"),S=Symbol.for("dropdownAction"),B={to:{type:[String,Object]},href:String,target:String,rel:{type:String,default:"noopener noreferrer"}},w={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}},x={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},L={disabled:{type:Boolean,default:!1}},C={required:{type:Boolean,default:!1}},P={selected:{type:Boolean,default:!1}},O={active:{type:Boolean,default:!1}},$={current:{type:Boolean,default:!1}},N={showClearAction:{type:Boolean,default:!1},iconClear:{type:[String,Object],default:"close"},labelClear:{type:String,default:"Clear"}},_={pressed:{type:Boolean,default:!1}},E={label:{type:[String,Number],default:void 0}},A={readonly:{type:Boolean,default:!1}},F={modifiers:{type:[String,Array],default:void 0}},D={hintLabel:{type:String,default:""}},H={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},j={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:c.before,validation:e=>Object.values(c).includes(e)}},I={tabindex:{type:[String,Number],default:0}},R={floating:{type:Boolean,default:!1}},z={unselectable:{type:Boolean,default:!0}},T={id:[String,Number]},M={placement:{type:String,default:s.bottom,validator:e=>Object.values(s).includes(e)||Object.values(d).includes(e)},strategy:{type:String,default:void 0,validator:e=>Object.values(u).includes(e)},transitionName:{type:String,default:void 0},offset:{type:[Number,String,Object],default:0},shift:{type:[Boolean,Object],default:!1},flip:{type:[Boolean,Object],default:!0},size:{type:[Boolean,Object],default:()=>({padding:10})},autoPlacement:{type:[Boolean,Object],default:!1},arrow:{type:Boolean,default:!1},keepOpen:{type:Boolean,default:!1},autofocusFirst:{type:Boolean,default:!0},triggerWidth:{type:Boolean,default:!1}},q={...T,name:{type:String,required:!0}},K={autofocus:{type:Boolean,default:!1}},W={autocomplete:{type:String,default:"off"}},G={...L,...E,..._,...O,...$,...B,type:{type:String,default:f.button,validator:e=>Object.values(f).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:p.button}};i.local;const J={...q,...I,...w,...V,...D,...x,...L,...A,...F,...H,...j,...R,...M,...E,...C,...N,transitionName:{type:String,default:"vv-dropdown--mobile-fade-block"},modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},noResultsLabel:{type:String,default:"No results"},noOptionsLabel:{type:String,default:"No options available"},selectedOptionNotFoundLabel:{type:String,default:"Selected option not found"},selectedHintLabel:{type:String,default:"Selected"},deselectActionLabel:{type:String,default:"Deselect"},selectHintLabel:{type:String,default:"Press enter to select"},deselectHintLabel:{type:String,default:"Press enter to remove"},addOptionHintLabel:{type:String,default:"Press enter to add"},closeLabel:{type:String,default:"Close"},placeholder:String,addable:Boolean,searchable:Boolean,keepSearch:Boolean,searchFunction:{type:Function,default:void 0},searchPlaceholder:{type:String,default:"Search..."},debounceSearch:{type:[Number,String],default:0},multiple:Boolean,minValues:{type:[Number,String],default:0},maxValues:[Number,String],unselectable:{type:Boolean,default:!0},separator:{type:String,default:", "},native:Boolean,badges:Boolean,badgeModifiers:{type:[String,Array],default:"action sm"},triggerWidth:{...M.triggerWidth,default:!0},dropdownModifiers:{type:[String,Array],default:"mobile"},autoOpen:{type:Boolean,default:!1},autoselectFirst:{type:Boolean,default:!1},keepOpen:{type:Boolean,default:!1},focusOnHover:{type:Boolean,default:!0}};function U(){return{...J,options:{...J.options,type:Array},searchFunction:{...J.searchFunction,type:Function}}}function Q(e,t,o){return X(e,t)}function X(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const o=Array.isArray(e),l=Array.isArray(t);let a,n,r;if(o&&l){if(n=e.length,n!==t.length)return!1;for(a=n;0!==a--;)if(!X(e[a],t[a]))return!1;return!0}if(o!==l)return!1;const i=e instanceof Date,u=t instanceof Date;if(i!==u)return!1;if(i&&u)return e.getTime()===t.getTime();const s=e instanceof RegExp,d=t instanceof RegExp;if(s!==d)return!1;if(s&&d)return e.toString()===t.toString();const c=Object.keys(e);if(n=c.length,n!==Object.keys(t).length)return!1;for(a=n;0!==a--;)if(!Object.prototype.hasOwnProperty.call(t,c[a]))return!1;for(a=n;0!==a--;)if(r=c[a],!X(e[r],t[r]))return!1;return!0}return Number.isNaN(e)&&Number.isNaN(t)}function Y(e,t){if(null!=e&&t&&t.length)for(const o of t)if(Q(e,o))return!0;return!1}function Z(e){return Array.isArray(e)?e.filter(e=>"string"==typeof e).join(" "):e}function ee(t,o){const l=e.computed(()=>e.isRef(t)?t.value:t),a=e.computed(()=>Z(l.value.invalidLabel)),n=e.computed(()=>Z(l.value.validLabel)),r=e.computed(()=>l.value.loadingLabel),i=e.computed(()=>l.value.hintLabel),u=e.computed(()=>Boolean(l.value.loading&&(o.loading||r.value))),s=e.computed(()=>!u.value&&Boolean(l.value.invalid&&(o.invalid||a.value))),d=e.computed(()=>!u.value&&!s.value&&Boolean(l.value.valid&&(o.valid||n.value))),c=e.computed(()=>!u.value&&!s.value&&!d.value&&Boolean(o.hint||i.value)),f=e.computed(()=>s.value||d.value||u.value||c.value),p=e.computed(()=>({modelValue:l.value.modelValue,valid:l.value.valid,invalid:l.value.invalid,loading:l.value.loading})),v=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:f,invalidLabel:a,validLabel:n,loadingLabel:r,hintLabel:i,hasInvalidLabelOrSlot:s,hasValidLabelOrSlot:d,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:s,hasHintLabelOrSlot:c,hasValidLabelOrSlot:d,hasLoadingLabelOrSlot:u,hintSlotScope:p,HintSlot:v}}function te(){return e.inject(g,void 0)}function oe(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 le=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:{}},r),setup(o){const l=o,a=e.computed(()=>"string"==typeof l.rotate?Number.parseFloat(l.rotate):l.rotate),n=e.ref(!0),r=te(),{modifiers:i}=e.toRefs(l),u=oe("vv-icon",i),s=e.computed(()=>l.provider||r?.iconsProvider),d=e.computed(()=>{const e=l.name??"",o=`@${s.value}:${l.prefix}:${e}`;if(t.iconLoaded(o))return o;const a=r?.iconsCollections.find(o=>{const l=`@${s.value}:${o.prefix}:${e}`;return t.iconLoaded(l)});return a?`@${s.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(`@${s.value}:${l.prefix}:${l.name}`,{body:a,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return r&&l.src&&!t.iconLoaded(`@${s.value}:${l.prefix}:${l.name}`)&&(n.value=!1,r.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(d)},{onLoad:o.onLoad}),null,16,["class","onLoad"])):e.createCommentVNode("v-if",!0)}});function ae(t,o){const l=e.computed(()=>"string"==typeof t?.value?{name:t?.value}:t?.value),a=e.computed(()=>o?.value===c.before?l.value:void 0),n=e.computed(()=>o?.value===c.after?l.value:void 0),r=e.computed(()=>o?.value===s.left?l.value:void 0),i=e.computed(()=>o?.value===s.right?l.value:void 0),u=e.computed(()=>o?.value===s.top?l.value:void 0),d=e.computed(()=>o?.value===s.bottom?l.value:void 0);return{hasIcon:l,hasIconLeft:r,hasIconRight:i,hasIconTop:u,hasIconBottom:d,hasIconBefore:a,hasIconAfter:n}}const ne=e.defineComponent({components:{VvIcon:le},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}=ae(e.computed(()=>t.icon));return{hasIcon:l,onClick:function(e){e?.stopPropagation(),t.disabled||o("clear")}}},render(){const t=this.hasIcon?e.h(le,{...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)}}),re={...F,value:[String,Number]},ie=e.defineComponent({name:"VvBadge",props:re,setup(t){const o=t,{modifiers:l}=e.toRefs(o),a=oe("vv-badge",l);return(t,o)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(a))},[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.value),1)])],2))}});const ue={...G,...T,...F,...z,...x,...j,iconPosition:{type:String,default:s.left,validator:e=>Object.values(s).includes(e)},loadingIcon:{type:String,default:"eos-icons:bubble-loading"},toggle:{type:Boolean,default:!1},value:{type:[String,Number,Boolean],default:void 0},uncheckedValue:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[String,Number,Boolean],default:void 0}};function se(t,o){const{group:l,isInGroup:a,getGroupOrLocalRef:n}=function(t){const o=e.inject(t,void 0),l=e.computed(()=>void 0!==o);return{group:o,isInGroup:l,getGroupOrLocalRef:function(t,l,a){const n=o?.[t];if(n)return e.computed({get:()=>n.value,set(e){n.value=e}});const r=e.toRef(l,t);return e.computed({get:()=>r.value,set(e){a&&a(`update:${t}`,e)}})}}}(y),{id:r,iconPosition:i,icon:u,label:s,pressed:d}=e.toRefs(t),c=n("modelValue",t,o),f=n("toggle",t),p=n("unselectable",t),v=e.computed(()=>l?.multiple.value??!1),m=e.computed(()=>{let e=t.modifiers,o=l?.modifiers.value;const a=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach(e=>a.add(e))),o&&(Array.isArray(o)||(o=o.split(" ")),o.forEach(e=>a.add(e))),Array.from(a)}),b=e.computed(()=>Boolean(t.disabled||l?.disabled.value));return{group:l,isInGroup:a,modelValue:c,toggle:f,unselectable:p,multiple:v,modifiers:m,disabled:b,id:r,pressed:d,iconPosition:i,icon:u,label:s}}const de=G;const ce=e.defineComponent({name:"VvAction",props:de,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:l}){const a=t,n=l,r=e.getCurrentInstance(),i=te(),u=e.ref(null);o({$el:u});const{reference:s,bus:d,aria:c,expanded:f}=e.inject(h,{});e.watch(()=>u.value,e=>{s&&(s.value=e)});const v=e.computed(()=>a.pressed||f?.value),{role:m}=e.inject(S,{}),b=e.computed(()=>{switch(!0){case a.disabled:return p.button;case void 0!==a.to:return i?.nuxt?e.resolveComponent(p.nuxtLink):p.routerLink;case void 0!==a.href:return p.a;default:return a.defaultTag}}),g=e.computed(()=>{const e={...c?.value,ariaPressed:!!v.value||void 0,ariaLabel:a.ariaLabel,role:m?.value};switch(b.value){case p.a:return{...e,href:a.href,target:a.target,rel:a.rel};case p.routerLink:case p.nuxtLink:return{...e,to:a.to,target:a.target};case p.button:return{...e,type:a.type,disabled:a.disabled};default:return e}});function y(e){a.disabled?e.preventDefault():r?.vnode.props?.onClick?n("click",e):d?.emit("click",e)}function k(e){r?.vnode.props?.onMouseover?n("mouseover",e):d?.emit("mouseover",e)}function B(e){r?.vnode.props?.onMouseleave?n("mouseleave",e):d?.emit("mouseleave",e)}return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(b)),e.mergeProps(e.unref(g),{ref_key:"element",ref:u,class:{active:t.active,pressed:e.unref(v),disabled:t.disabled,current:t.current},onClickPassive:y,onMouseoverPassive:k,onMouseleavePassive:B}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)])]),_:3},16,["class"]))}});function fe(t){return e.computed(()=>String(t?.value||e.useId()))}const pe={key:1,class:"vv-button__label"},ve={key:1,class:"vv-button__label"},me=e.defineComponent({name:"VvButton",inheritAttrs:!1,props:ue,emits:["update:modelValue"],setup(t,{expose:o,emit:l}){const a=t,n=l,r=e.useAttrs(),i=e.useSlots(),{id:u,modifiers:d,iconPosition:c,icon:f,label:p,modelValue:v,disabled:m,toggle:b,unselectable:g}=se(a,n),y=fe(u),h=e.computed(()=>r?.name||y.value),k=e.ref(null);o({$el:e.computed(()=>k.value?.$el)});const S=e.computed(()=>b.value?Array.isArray(v.value)?Y(h.value,v.value):Q(h.value,v.value):a.pressed),B=oe("vv-button",d,e.computed(()=>({reverse:[s.right,s.bottom].includes(c.value),column:[s.top,s.bottom].includes(c.value),"icon-only":Boolean(f?.value&&!p?.value&&!i.default)}))),{hasIcon:w}=ae(f),V=e.computed(()=>void 0!==a.value?a.value:h.value),x=e.computed(()=>{if(b.value)return{onClick:L}});function L(){if(b.value){if(Array.isArray(v.value))return Y(V.value,v.value)?void(g.value&&(v.value=v.value.filter(e=>e!==V.value))):void v.value.push(V.value);if(V.value===v.value&&g.value)return void(v.value=a.uncheckedValue);v.value=V.value}}return(t,o)=>(e.openBlock(),e.createBlock(ce,e.mergeProps({...e.unref(r),...e.unref(x),disabled:e.unref(m),pressed:e.unref(S),active:t.active,type:t.type,to:t.to,href:t.href,target:t.target,rel:t.rel,ariaLabel:t.ariaLabel},{id:e.unref(y),ref_key:"element",ref:k,class:e.unref(B)}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[t.loading?e.renderSlot(t.$slots,"loading",{key:0},()=>[t.loadingIcon?(e.openBlock(),e.createBlock(le,{key:0,class:"vv-button__loading-icon",name:t.loadingIcon},null,8,["name"])):e.createCommentVNode("v-if",!0),t.loadingLabel?(e.openBlock(),e.createElementBlock("span",pe,e.toDisplayString(t.loadingLabel),1)):e.createCommentVNode("v-if",!0)]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(t.$slots,"before"),e.unref(w)?(e.openBlock(),e.createBlock(le,e.mergeProps({key:0},e.unref(w),{class:"vv-button__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.unref(p)?(e.openBlock(),e.createElementBlock("span",ve,[e.renderSlot(t.$slots,"label",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(p)),1)])])):e.createCommentVNode("v-if",!0),e.renderSlot(t.$slots,"after")],64))])]),_:3},16,["id","class"]))}}),be={...T,...M,...F,modelValue:{type:Boolean,default:void 0},reference:{type:Object,default:null},role:{type:String,default:m.menu,validator:e=>Object.values(m).includes(e)}},ge={focusOnHover:{type:Boolean,default:!1}},ye={...L,...P,...z,...F,deselectHintLabel:{type:String},selectHintLabel:{type:String},selectedHintLabel:{type:String},focusOnHover:{type:Boolean,default:!1}};const he=["id","tabindex","role","aria-labelledby"],ke=e.defineComponent({name:"VvDropdown",inheritAttrs:!1,props:be,emits:["update:modelValue","beforeEnter","afterLeave","beforeExpand","beforeCollapse","afterExpand","afterCollapse","before-enter","after-leave","enter","afterEnter","enterCancelled","beforeLeave","leave","leaveCancelled"],setup(t,{expose:n,emit:r}){const i=t,d=r,{id:c}=e.toRefs(i),f=fe(c),p=e.useAttrs(),v=e.ref("auto"),g=e.ref("auto"),y=e.ref(),S=e.ref(),B=e.ref(),w=e.ref(),V=e.computed({get:()=>i.reference??y.value,set:e=>{y.value=e}}),x=e.ref(!1);e.onMounted(()=>{l.useMutationObserver(S.value,()=>{x.value="true"===window.getComputedStyle(S.value).getPropertyValue("--dropdown-custom-position")?.trim()},{attributeFilter:["style"],window:window})});const L=e.computed(()=>{const e=[];if(i.autoPlacement?"boolean"==typeof i.autoPlacement?e.push(o.autoPlacement()):e.push(o.autoPlacement(i.autoPlacement)):i.flip&&("boolean"==typeof i.flip?e.push(o.flip({fallbackStrategy:"initialPlacement"})):e.push(o.flip(i.flip))),i.shift&&("boolean"==typeof i.shift?e.push(o.shift()):e.push(o.shift(i.shift))),i.size){const t=({availableWidth:e,availableHeight:t})=>{v.value=`${e}px`,g.value=`${t}px`};"boolean"==typeof i.size?e.push(o.size({apply:t})):e.push(o.size({...i.size,apply:t}))}return i.offset&&(e.push(o.offset(Number(i.offset))),["string","number"].includes(typeof i.offset)?e.push(o.offset(Number(i.offset))):e.push(o.offset(i.offset))),i.arrow&&e.push(o.arrow({element:B})),e}),{x:C,y:P,middlewareData:O,placement:$,strategy:N}=o.useFloating(V,S,{whileElementsMounted:(...e)=>o.autoUpdate(...e,{animationFrame:i.strategy===u.fixed}),placement:e.computed(()=>i.placement),strategy:e.computed(()=>i.strategy),middleware:L}),_=e.computed(()=>{if(x.value)return;const e=i.triggerWidth&&V.value?`${V.value?.offsetWidth}px`:void 0;return{position:N.value,top:`${P.value??0}px`,left:`${C.value??0}px`,maxWidth:e?void 0:v.value,maxHeight:g.value,width:e}}),E=e.computed(()=>$.value.split("-")[0]),A=e.computed(()=>{if(x.value)return;const e={[s.top]:s.bottom,[s.right]:s.left,[s.bottom]:s.top,[s.left]:s.right}[E.value];return{left:void 0!==O.value.arrow?.x?`${O.value.arrow?.x}px`:void 0,top:void 0!==O.value.arrow?.y?`${O.value.arrow?.y}px`:void 0,[e]:-(B.value?.offsetWidth??0)/2+"px"}}),F=l.useVModel(i,"modelValue",d),D=e.ref(!1),H=e.computed({get:()=>F.value??D.value,set:e=>{void 0!==F.value?F.value=e:D.value=e}});function j(){H.value=!0}function I(){H.value=!1}function R(){H.value=!H.value}function z(e){V.value=e}l.onClickOutside(S,()=>{!i.keepOpen&&H.value&&(H.value=!1)},{ignore:[V]});const T=e.computed(()=>V.value?.getAttribute?.("id")??void 0),M=e.computed(()=>({"aria-controls":f.value,"aria-haspopup":!0,"aria-expanded":H.value})),{component:q,bus:K}=function({reference:t,id:o,expanded:l,aria:n}){const r=a(),i=e.defineComponent({name:"VvDropdownTriggerProvider",setup(){e.provide(h,{reference:t,id:o,expanded:l,aria:n,bus:r})},render(){return e.h(e.Fragment,{},this.$slots.default?.())}});return{bus:r,component:i}}({reference:V,id:f,expanded:H,aria:M});K.on("click",R);const{role:W,modifiers:G}=e.toRefs(i),J=oe("vv-dropdown",G,e.computed(()=>({arrow:i.arrow}))),{focused:U}=l.useFocusWithin(S);function Q(e){return e?[...e.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')].filter(e=>!e.hasAttribute("disabled")&&!e.getAttribute("aria-hidden")):[]}function X(){e.nextTick(()=>{const e=Q(S.value);e.length>0&&e[0].focus({preventScroll:!0})})}function Y(){e.nextTick(()=>{if(U.value){const e=Q(S.value);if(0===e.length||!document.activeElement)return;const t=e.indexOf(document.activeElement);t<e.length-1?e[t+1].focus({preventScroll:!0}):e[0].focus({preventScroll:!0})}})}function Z(){e.nextTick(()=>{if(U.value){const e=Q(S.value);if(0===e.length||!document.activeElement)return;const t=e.indexOf(document.activeElement);t>0?e[t-1].focus({preventScroll:!0}):e[e.length-1].focus({preventScroll:!0})}})}e.watch(H,e=>{e&&i.autofocusFirst&&X()}),n({toggle:R,show:j,hide:I,init:z,focusFirst:X,focusFirstListElement:function(){e.nextTick(()=>{const e=Q(w.value);e.length>0&&e[0].focus({preventScroll:!0})})},focusNext:Y,focusPrev:Z,customPosition:x});const ee=l.useElementHover(S),{itemRole:te}=function({role:t,...o}){const l=e.computed(()=>t.value===m.listbox?b.option:b.presentation);return e.provide(k,{role:l,...o}),{itemRole:l}}({role:W,expanded:H,focused:U,hovered:ee});l.onKeyStroke("Escape",e=>{H.value&&(e.preventDefault(),I())}),l.onKeyStroke("ArrowDown",e=>{H.value&&U.value&&(e.preventDefault(),Y())}),l.onKeyStroke("ArrowUp",e=>{H.value&&U.value&&(e.preventDefault(),Z())}),l.onKeyStroke([" ","Enter"],e=>{const t=e.target;H.value&&U.value&&t&&t?.click()});const le={"before-enter":()=>{d(H.value?"beforeExpand":"beforeCollapse"),d("beforeEnter")},"after-leave":()=>{d(H.value?"afterExpand":"afterCollapse"),d("afterLeave")},enter:()=>{d("enter")},"after-enter":()=>{d("afterEnter")},"enter-cancelled":()=>{d("enterCancelled")},"before-leave":()=>{d("beforeLeave")},leave:()=>{d("leave")},"leave-cancelled":()=>{d("leaveCancelled")}};return(t,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(q),null,{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps({init:z,show:j,hide:I,toggle:R,expanded:e.unref(H),aria:e.unref(M)})))]),_:3}),e.createVNode(e.Transition,e.mergeProps({name:t.transitionName},e.toHandlers(le),{persisted:""}),{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"floatingEl",ref:S,style:e.normalizeStyle(e.unref(_)),class:e.normalizeClass(e.unref(J))},[i.arrow?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"arrowEl",ref:B,style:e.normalizeStyle(e.unref(A)),class:"vv-dropdown__arrow"},null,4)):e.createCommentVNode("v-if",!0),e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps({expanded:e.unref(H)}))),e.createElementVNode("div",e.mergeProps(e.unref(p),{id:e.unref(f),ref_key:"listEl",ref:w,tabindex:e.unref(H)?void 0:-1,role:e.unref(W),"aria-labelledby":e.unref(T),class:"vv-dropdown__list"}),[e.renderSlot(t.$slots,"items",e.normalizeProps(e.guardReactiveProps({role:e.unref(te)})))],16,he),e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps({expanded:e.unref(H)})))],6),[[e.vShow,e.unref(H)]])]),_:3},16,["name"])],64))}}),Se={class:"vv-dropdown-optgroup",role:"presentation",tabindex:"-1"},Be=e.defineComponent({name:"VvDropdownOptgroup",props:{...E},setup(t){const o=t;return(t,l)=>(e.openBlock(),e.createElementBlock("li",Se,e.toDisplayString(o.label),1))}}),we=e.defineComponent({name:"VvDropdownItem",props:ge,setup(t){const o=t,{role:a,expanded:n}=e.inject(k,{}),r=e.ref(null);!function({expanded:t}){e.provide(S,{role:e.ref(v.menuitem),expanded:t})}({expanded:n});const i=l.useElementHover(r),{focused:u}=l.useFocus(r),{focused:s}=l.useFocusWithin(r);return e.watch(i,e=>{e&&o.focusOnHover&&(u.value=!0)}),(t,o)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({role:e.unref(a)},{ref_key:"element",ref:r,class:["vv-dropdown__item",{"focus-visible":e.unref(u)||e.unref(s)}]}),[e.renderSlot(t.$slots,"default")],16))}}),Ve=["title"],xe=e.defineComponent({name:"VvDropdownOption",props:ye,setup(t){const o=t,{modifiers:l}=e.toRefs(o),a=oe("vv-dropdown-option",l,e.computed(()=>({disabled:o.disabled,selected:o.selected,unselectable:o.unselectable&&o.selected}))),n=e.computed(()=>o.selected?o.unselectable?o.deselectHintLabel:o.selectedHintLabel:o.disabled?"":o.selectHintLabel);return(t,o)=>(e.openBlock(),e.createBlock(we,{class:e.normalizeClass(e.unref(a)),tabindex:t.disabled?-1:0,"aria-selected":t.selected,"aria-disabled":t.disabled,"focus-on-hover":t.focusOnHover},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default"),e.createElementVNode("span",{class:"vv-dropdown-option__hint",title:e.unref(n)},[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps({disabled:t.disabled,selected:t.selected,unselectable:t.unselectable})),()=>[e.createTextVNode(e.toDisplayString(e.unref(n)),1)])],8,Ve)]),_:3},8,["class","tabindex","aria-selected","aria-disabled","focus-on-hover"]))}}),Le={...q,...K,...W,...I,...w,...V,...D,...x,...L,...A,...F,...H,...j,...R,...z,...E,...N,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 Ce(){return{...Le,options:{...Le.options,type:Array,default:()=>[]}}}function Pe(t,o,l){const a=te(),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];if(a.length){a[0]===n&&(o[l]=e[l])}}if("function"==typeof t[l]){(0,t[l])()===n&&(o[l]=e[l])}if("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},{})})}function Oe(t,o){const{focused:a}=l.useFocus(t);return e.watch(a,l=>{o(l?"focus":"blur",e.unref(t))}),{focused:a}}function $e(t){const{options:o,labelKey:l,valueKey:a,disabledKey:r}=e.toRefs(t);return{options:o,getOptionLabel:e=>"string"==typeof e?e:"function"==typeof l.value?l.value(e):String(l.value?n.getProperty(e,l.value):e),getOptionValue:e=>"string"==typeof e?e:"function"==typeof a.value?a.value(e):a.value?n.getProperty(e,a.value):e,isOptionDisabled:e=>"string"!=typeof e&&("function"==typeof r.value?r.value(e):!!r.value&&Boolean(n.getProperty(e,r.value))),getOptionGrouped:e=>"string"==typeof e?[]:"object"==typeof e&&e&&"options"in e?e.options:[]}}const Ne=["for"],_e={class:"vv-select__wrapper"},Ee={key:0,class:"vv-select__input-before"},Ae={class:"vv-select__inner"},Fe=["id"],De=["disabled","hidden"],He=["disabled","value"],je=["disabled","label"],Ie=["disabled","value"],Re={key:2,class:"vv-select__input-after"},ze=e.defineComponent({name:"VvSelect",props:Ce(),emits:["update:modelValue","focus","blur","clear"],setup(t,{emit:o}){const a=t,n=o,r=e.useSlots(),i=Pe("VvSelect",Ce(),a),u=e.ref(),{HintSlot:s,hasHintLabelOrSlot:d,hasInvalidLabelOrSlot:c,hintSlotScope:f}=ee(i,r),{focused:p}=Oe(u,n);function v(e){return"string"!=typeof e&&e.options?.length}const{id:m,modifiers:b,disabled:g,readonly:y,loading:h,icon:k,iconPosition:S,invalid:B,valid:w,floating:V,multiple:x}=e.toRefs(a),L=fe(m),C=e.computed(()=>`${L.value}-hint`),P=e.computed(()=>a.disabled||a.readonly),O=e.computed(()=>P.value?-1:a.tabindex),$=e.computed({get:()=>a.modelValue,set:e=>{Array.isArray(e)&&0===(e=e.filter(e=>void 0!==e)).length&&!a.unselectable&&u.value?u.value.value=String(a.modelValue):n("update:modelValue",e)}}),N=e.computed(()=>Array.isArray($.value)?$.value.length>0:void 0!==$.value&&null!==$.value),_=e.computed(()=>!P.value&&a.unselectable),E=l.useElementVisibility(u);e.watch(E,e=>{e&&a.autofocus&&(p.value=!0)});const{hasIconBefore:A,hasIconAfter:F}=ae(k,S),D=e.computed(()=>!0===a.invalid||!0!==a.valid&&void 0),H=oe("vv-select",b,e.computed(()=>({valid:w.value,invalid:B.value,loading:h.value,disabled:g.value,readonly:y.value,"icon-before":void 0!==A.value,"icon-after":void 0!==F.value,dirty:N.value,focus:p.value&&!P.value,floating:V.value,multiple:x.value}))),{getOptionLabel:j,getOptionValue:I,isOptionDisabled:R,getOptionGrouped:z}=$e(a);function T(){Array.isArray($.value)?$.value=[]:$.value=void 0,n("clear")}e.watch(()=>a.options,e=>{if(e?.length&&a.autoselectFirst&&!N.value){const t=I(e[0]);$.value=a.multiple?[t]:t}},{immediate:!0});const M=e.computed(()=>({name:a.name,tabindex:O.value,disabled:P.value,required:a.required,size:a.size,autocomplete:a.autocomplete,multiple:a.multiple,"aria-invalid":D.value,"aria-describedby":d.value?C.value:void 0,"aria-errormessage":c.value?C.value:void 0})),q=e.computed(()=>({valid:a.valid,invalid:a.invalid,modelValue:a.modelValue}));return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(H))},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(L)},e.toDisplayString(t.label),9,Ne)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",_e,[t.$slots.before?(e.openBlock(),e.createElementBlock("div",Ee,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(q))))])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",Ae,[e.unref(A)?(e.openBlock(),e.createBlock(le,e.mergeProps({key:0},e.unref(A),{class:"vv-select__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("select",e.mergeProps({id:e.unref(L),ref_key:"selectEl",ref:u},e.unref(M),{"onUpdate:modelValue":o[0]||(o[0]=t=>e.isRef($)?$.value=t:null)}),[t.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,value:void 0,disabled:!e.unref(_),hidden:!e.unref(_)},e.toDisplayString(t.placeholder),9,De)):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,[v(t)?(e.openBlock(),e.createElementBlock("optgroup",{key:`group-${o}`,disabled:e.unref(R)(t),label:e.unref(j)(t)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(z)(t),(t,l)=>(e.openBlock(),e.createElementBlock("option",{key:`group-${o}-item-${l}`,disabled:e.unref(R)(t),value:e.unref(I)(t)},e.toDisplayString(e.unref(j)(t)),9,Ie))),128))],8,je)):(e.openBlock(),e.createElementBlock("option",{key:o,disabled:e.unref(R)(t),value:e.unref(I)(t)},e.toDisplayString(e.unref(j)(t)),9,He))],64))),256))],16,Fe),[[e.vModelSelect,e.unref($)]]),e.unref(F)?(e.openBlock(),e.createBlock(le,e.mergeProps({key:1},e.unref(F),{class:"vv-select__icon vv-select__icon-after"}),null,16)):e.createCommentVNode("v-if",!0)]),e.unref(_)&&e.unref(i).showClearAction?(e.openBlock(),e.createBlock(e.unref(ne),{key:1,"input-type":"select",label:t.labelClear,icon:t.iconClear,disabled:!e.unref(N),onClear:T},null,8,["label","icon","disabled"])):e.createCommentVNode("v-if",!0),t.$slots.after?(e.openBlock(),e.createElementBlock("div",Re,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(q))))])):e.createCommentVNode("v-if",!0)]),e.createVNode(e.unref(s),{id:e.unref(C),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(f))))]),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(f))))]),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(f))))]),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(f))))]),key:"3"}:void 0]),1032,["id"])],2))}}),Te=["id"],Me=["id","for"],qe=["id","aria-controls","placeholder"],Ke={key:0,class:"vv-select__input-before"},We={class:"vv-select__inner"},Ge=["aria-controls","aria-expanded","aria-labelledby","aria-describedby","aria-errormessage","tabindex"],Je={key:0,class:"vv-select__value"},Ue=["aria-label","onClick"],Qe={key:2,class:"vv-select__input-after"},Xe={name:"VvCombobox",components:{VvDropdown:ke,VvDropdownOption:xe,VvDropdownOptgroup:Be,VvButton:me}};return e.defineComponent({...Xe,props:e.mergeModels(U(),{search:{type:String,default:"",required:!1},searchModifiers:{}}),emits:e.mergeModels(["update:modelValue","update:search","update:options","focus","blur","clear","change:search"],["update:search"]),setup(t,{emit:o}){const a=t,n=o,r=e.useSlots(),i=Pe("VvCombobox",U(),a),u=e.ref(null),s=e.ref(null),d=e.ref(null),c=e.ref(),{HintSlot:f,hasHintLabelOrSlot:p,hasInvalidLabelOrSlot:v,hintSlotScope:b}=ee(i,r),{focused:g}=Oe(u,n),{focused:y}=l.useFocusWithin(d);e.watch(g,e=>{a.autoOpen&&(!e||S.value?e||!S.value||y.value||V():w())}),e.watch(y,e=>{g.value||e||!S.value||V()});const h=e.useModel(t,"search"),k=l.refDebounced(h,e.computed(()=>Number(a.debounceSearch)));e.watch(k,()=>{n("update:search",k.value),n("change:search",k.value)});const S=e.ref(!1);function B(){q.value||(S.value=!S.value)}function w(){q.value||S.value||(S.value=!0)}function V(){!q.value&&S.value&&(S.value=!1)}function x(){i.value.searchable&&s.value&&s.value.focus({preventScroll:!0})}function L(){i.value.keepSearch||(h.value="")}function C(e){return"string"!=typeof e&&e.options?.length}const{id:P,icon:O,iconPosition:$,modifiers:N,disabled:_,required:E,readonly:A,loading:F,valid:D,invalid:H,floating:j}=e.toRefs(a),I=fe(P),R=e.computed(()=>`${I.value}-hint`),z=e.computed(()=>`${I.value}-dropdown`),T=e.computed(()=>`${I.value}-search`),M=e.computed(()=>`${I.value}-label`),q=e.computed(()=>a.disabled||a.readonly),K=e.computed(()=>q.value?-1:a.tabindex),W=e.computed({get:()=>Array.isArray(a.modelValue)?a.modelValue:void 0!==a.modelValue&&null!==a.modelValue?[a.modelValue]:[],set:e=>{n("update:modelValue",a.multiple||Array.isArray(a.modelValue)?e:e.pop())}}),G=e.computed(()=>W.value.length),J=e.computed(()=>G.value>0),Q=e.computed(()=>a.multiple?void 0===a.maxValues?1/0:Number(a.maxValues):1),X=e.computed(()=>!q.value&&(!!a.unselectable&&(0===Number(a.minValues)||G.value>Number(a.minValues)))),Y=e.computed(()=>!q.value&&(!a.multiple||G.value<Q.value)),Z=e.ref(!1),te=e.computed(()=>Z.value||F.value),{hasIconBefore:re,hasIconAfter:ue}=ae(O,$),se=oe("vv-select",N,e.computed(()=>({disabled:_.value,required:E.value,loading:te.value,readonly:A.value,"icon-before":void 0!==re.value,"icon-after":void 0!==ue.value,valid:D.value,invalid:H.value,dirty:J.value,focus:(g.value||y.value||S.value)&&!q.value,floating:j.value,badges:a.badges}))),de=e.ref(new Set),{getOptionLabel:ce,getOptionValue:pe,getOptionGrouped:ve,isOptionDisabled:be}=$e(a),ge=e.computed(()=>{const e=[...a.options,...de.value];for(const t of W.value)e.some(e=>{const o=pe(e);return"object"==typeof o&&"object"==typeof t?JSON.stringify(o)===JSON.stringify(t):o===t})||e.push(t);return e});function ye(e){return be(e)||!Y.value&&!Se(e)}e.watch(de,e=>{e.size>0&&n("update:options",ge.value)});const he=l.computedAsync(async()=>{if(i.value.searchFunction){Z.value=!0;const e=await Promise.resolve(i.value.searchFunction(k.value,ge.value));return Z.value=!1,e}return ge.value?.filter(e=>ce(e).toLowerCase().includes(k.value.toLowerCase().trim()))});function Se(e){const t=pe(e);return"object"==typeof t?W.value.some(e=>"object"==typeof e&&JSON.stringify(e)===JSON.stringify(t)):W.value.includes(t)}const we=e.computed(()=>ge.value.reduce((e,t)=>C(t)?[...e,...ve(t)]:[...e,t],[]).filter(e=>Se(e))),Ve=e.computed(()=>we.value.map(e=>ce(e)).join(a.separator));function Le(){a.autoOpen?w():B()}function Ce(e){const t=Se(e),o=pe(e);t&&X.value?W.value=W.value.filter(e=>"object"==typeof o&&"object"==typeof e?JSON.stringify(e)!==JSON.stringify(o):e!==o):!t&&Y.value&&(a.multiple?W.value=[...W.value,o]:W.value=[o]),a.multiple||a.keepOpen||V()}function Ne(){W.value=[],n("update:search",""),n("clear")}e.watch(ge,e=>{e?.length&&a.autoselectFirst&&!J.value&&Ce(e[0])},{immediate:!0});const _e=e.computed(()=>({id:I.value,name:a.name,tabindex:K.value,valid:D.value,validLabel:i.value.validLabel,invalid:H.value,invalidLabel:i.value.invalidLabel,hintLabel:i.value.hintLabel,loading:te.value,loadingLabel:i.value.loadingLabel,disabled:_.value,readonly:A.value,modifiers:i.value.modifiers,options:i.value.options,labelKey:i.value.labelKey,valueKey:i.value.valueKey,icon:i.value.icon,iconPosition:i.value.iconPosition,floating:i.value.floating,unselectable:X.value,autoselectFirst:i.value.autoselectFirst,multiple:i.value.multiple,label:i.value.label,placeholder:i.value.placeholder,modelValue:a.modelValue})),Ee=e.computed(()=>({id:z.value,reference:d.value,placement:i.value.placement,strategy:i.value.strategy,transitionName:i.value.transitionName,offset:i.value.offset,shift:i.value.shift,flip:i.value.flip,autoPlacement:i.value.autoPlacement,arrow:i.value.arrow,autofocusFirst:!!i.value.searchable||i.value.autofocusFirst,triggerWidth:i.value.triggerWidth,modifiers:i.value.dropdownModifiers})),Ae=e.computed(()=>({valid:a.valid,invalid:a.invalid,modelValue:a.modelValue}));function Fe(){if(he.value?.length)return 1===he.value.length?void Ce(he.value[0]):void c.value?.focusFirstListElement();if(i.value.addable){const e=h.value.trim();if(!e)return;if(ge.value.some(t=>ce(t).toLowerCase()===e.toLowerCase()))return;de.value.add(e),Ce(e)}}return l.onKeyStroke([" ","Enter"],e=>{a.autoOpen||!S.value&&g.value&&(e.preventDefault(),e.stopImmediatePropagation(),B())},{target:u}),(t,o)=>t.native?(e.openBlock(),e.createBlock(ze,e.mergeProps({key:1},e.unref(_e),{"onUpdate:modelValue":o[3]||(o[3]=e=>n("update:modelValue",e))}),null,16)):(e.openBlock(),e.createElementBlock("div",{key:0,id:e.unref(I),class:e.normalizeClass(e.unref(se))},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,id:e.unref(M),for:e.unref(i).searchable?e.unref(T):void 0},e.toDisplayString(t.label),9,Me)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{ref_key:"wrapperEl",ref:d,class:"vv-select__wrapper"},[e.createVNode(ke,e.mergeProps({ref_key:"dropdownEl",ref:c,modelValue:e.unref(S),"onUpdate:modelValue":o[2]||(o[2]=t=>e.isRef(S)?S.value=t:null)},e.unref(Ee),{role:e.unref(m).listbox,onAfterExpand:x,onAfterCollapse:L}),e.createSlots({default:e.withCtx(({aria:o})=>[t.$slots.before?(e.openBlock(),e.createElementBlock("div",Ke,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(Ae))))])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",We,[e.unref(re)?(e.openBlock(),e.createBlock(le,e.mergeProps({key:0},e.unref(re),{class:"vv-select__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",e.mergeProps({ref_key:"inputEl",ref:u},o,{class:"vv-select__input",role:"combobox","aria-controls":e.unref(z),"aria-expanded":e.unref(S),"aria-labelledby":e.unref(M),"aria-describedby":e.unref(p)?e.unref(R):void 0,"aria-errormessage":e.unref(v)?e.unref(R):void 0,tabindex:e.unref(K),onClickPassive:Le}),[e.unref(Ve)?e.renderSlot(t.$slots,"value",e.normalizeProps(e.mergeProps({key:0},{selectedOptions:e.unref(we),onInput:Ce})),()=>[t.badges?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(e.unref(we),(o,l)=>(e.openBlock(),e.createBlock(ie,{key:l,modifiers:t.badgeModifiers,class:"vv-select__badge"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(ce)(o))+" ",1),e.unref(X)?(e.openBlock(),e.createElementBlock("button",{key:0,"aria-label":e.unref(i).deselectActionLabel,type:"button",onClick:e.withModifiers(e=>Ce(o),["stop"])},[e.createVNode(le,{name:"close"})],8,Ue)):e.createCommentVNode("v-if",!0)]),_:2},1032,["modifiers"]))),128)):(e.openBlock(),e.createElementBlock("div",Je,e.toDisplayString(e.unref(Ve)),1))]):e.renderSlot(t.$slots,"placeholder",{key:1},()=>[e.createTextVNode(e.toDisplayString(t.placeholder),1)])],16,Ge),e.unref(ue)?(e.openBlock(),e.createBlock(le,e.mergeProps({key:1},e.unref(ue),{class:"vv-select__icon vv-select__icon-after"}),null,16)):e.createCommentVNode("v-if",!0)]),e.unref(X)&&e.unref(i).showClearAction?(e.openBlock(),e.createBlock(e.unref(ne),{key:1,"input-type":"select",label:t.labelClear,icon:t.iconClear,disabled:!e.unref(J),onClear:Ne},null,8,["label","icon","disabled"])):e.createCommentVNode("v-if",!0),t.$slots.after?(e.openBlock(),e.createElementBlock("div",Qe,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(Ae))))])):e.createCommentVNode("v-if",!0)]),items:e.withCtx(()=>[!e.unref(_)&&e.unref(he)?.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(he),(o,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l},[C(o)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(Be,{label:e.unref(ce)(o)},null,8,["label"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ve)(o),(l,a)=>(e.openBlock(),e.createBlock(xe,e.mergeProps({ref_for:!0},{selected:Se(l),disabled:ye(l),unselectable:e.unref(X),deselectHintLabel:e.unref(i).deselectHintLabel,selectHintLabel:e.unref(i).selectHintLabel,selectedHintLabel:e.unref(i).selectedHintLabel,focusOnHover:t.focusOnHover},{key:a,class:"vv-dropdown-option",onClickPassive:e=>Ce(l)}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"option",e.mergeProps({ref_for:!0},{option:o,selectedOptions:e.unref(we),selected:Se(l),disabled:ye(l)}),()=>[e.createTextVNode(e.toDisplayString(e.unref(ce)(l)),1)])]),_:2},1040,["onClickPassive"]))),128))],64)):(e.openBlock(),e.createBlock(xe,e.mergeProps({key:1,ref_for:!0},{selected:Se(o),disabled:ye(o),unselectable:e.unref(X),deselectHintLabel:e.unref(i).deselectHintLabel,selectHintLabel:e.unref(i).selectHintLabel,selectedHintLabel:e.unref(i).selectedHintLabel,focusOnHover:t.focusOnHover},{class:"vv-dropdown-option",onClickPassive:e=>Ce(o)}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"option",e.mergeProps({ref_for:!0},{option:o,selectedOptions:e.unref(we),selected:Se(o),disabled:ye(o)}),()=>[e.createTextVNode(e.toDisplayString(e.unref(ce)(o)),1)])]),_:2},1040,["onClickPassive"]))],64))),128)):t.options.length?(e.openBlock(),e.createBlock(xe,{key:2,modifiers:"inert"},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"no-results",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(i).addable?e.unref(i).addOptionHintLabel:e.unref(i).noResultsLabel),1)])]),_:3})):(e.openBlock(),e.createBlock(xe,{key:1,modifiers:"inert"},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"no-options",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(i).addable&&h.value.length?e.unref(i).addOptionHintLabel:e.unref(i).noOptionsLabel),1)])]),_:3}))]),after:e.withCtx(()=>[e.renderSlot(t.$slots,"dropdown::after",{},()=>[e.unref(c)?.customPosition?(e.openBlock(),e.createBlock(me,{key:0,label:e.unref(i).closeLabel,modifiers:"secondary",onClick:o[1]||(o[1]=t=>e.unref(c).hide())},null,8,["label"])):e.createCommentVNode("v-if",!0)])]),_:2},[e.unref(i).searchable||t.$slots["dropdown::before"]?{name:"before",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"dropdown::before"),e.unref(i).searchable&&!e.unref(_)?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,id:e.unref(T),ref_key:"inputSearchEl",ref:s,"onUpdate:modelValue":o[0]||(o[0]=e=>h.value=e),"aria-autocomplete":"list","aria-controls":e.unref(z),autocomplete:"off",spellcheck:"false",type:"search",class:"vv-dropdown__search",placeholder:e.unref(i).searchPlaceholder,onKeyup:e.withKeys(Fe,["enter"])},null,40,qe)),[[e.vModelText,h.value]]):e.createCommentVNode("v-if",!0)]),key:"0"}:void 0]),1040,["modelValue","role"])],512),e.createVNode(e.unref(f),{id:e.unref(R),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(b))))]),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(b))))]),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(b))))]),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(b))))]),key:"3"}:void 0]),1032,["id"])],10,Te))}})});
|
|
@@ -58,7 +58,7 @@ declare const _default: <T extends string | Option>(__VLS_props: NonNullable<Awa
|
|
|
58
58
|
icon: string | import("../VvIcon").VvIconProps;
|
|
59
59
|
iconPosition: "before" | "after";
|
|
60
60
|
flip: boolean | {
|
|
61
|
-
crossAxis?: boolean | undefined;
|
|
61
|
+
crossAxis?: boolean | "alignment" | undefined;
|
|
62
62
|
rootBoundary?: import("@floating-ui/core").RootBoundary | undefined;
|
|
63
63
|
elementContext?: import("@floating-ui/core").ElementContext | undefined;
|
|
64
64
|
altBoundary?: boolean | undefined;
|
|
@@ -70,7 +70,7 @@ declare const _default: <T extends string | Option>(__VLS_props: NonNullable<Awa
|
|
|
70
70
|
flipAlignment?: boolean | undefined;
|
|
71
71
|
boundary?: import("@floating-ui/dom").Boundary | undefined;
|
|
72
72
|
} | import("@floating-ui/dom").Derivable<{
|
|
73
|
-
crossAxis?: boolean | undefined;
|
|
73
|
+
crossAxis?: boolean | "alignment" | undefined;
|
|
74
74
|
rootBoundary?: import("@floating-ui/core").RootBoundary | undefined;
|
|
75
75
|
elementContext?: import("@floating-ui/core").ElementContext | undefined;
|
|
76
76
|
altBoundary?: boolean | undefined;
|
|
@@ -136,10 +136,12 @@ declare const _default: <T extends string | Option>(__VLS_props: NonNullable<Awa
|
|
|
136
136
|
searchFunction: (search: string, options: T[]) => T[] | Promise<T[]>;
|
|
137
137
|
noResultsLabel: string;
|
|
138
138
|
noOptionsLabel: string;
|
|
139
|
+
selectedOptionNotFoundLabel: string;
|
|
139
140
|
deselectActionLabel: string;
|
|
140
141
|
addOptionHintLabel: string;
|
|
141
142
|
addable: boolean;
|
|
142
143
|
searchable: boolean;
|
|
144
|
+
keepSearch: boolean;
|
|
143
145
|
searchPlaceholder: string;
|
|
144
146
|
debounceSearch: string | number;
|
|
145
147
|
minValues: string | number;
|
|
@@ -172,7 +174,7 @@ declare const _default: <T extends string | Option>(__VLS_props: NonNullable<Awa
|
|
|
172
174
|
availableWidth: number;
|
|
173
175
|
availableHeight: number;
|
|
174
176
|
}) => void | Promise<void>) | undefined;
|
|
175
|
-
}
|
|
177
|
+
}>;
|
|
176
178
|
readonly shift: boolean | {
|
|
177
179
|
crossAxis?: boolean | undefined;
|
|
178
180
|
rootBoundary?: import("@floating-ui/core").RootBoundary | undefined;
|
|
@@ -197,12 +199,12 @@ declare const _default: <T extends string | Option>(__VLS_props: NonNullable<Awa
|
|
|
197
199
|
options?: any;
|
|
198
200
|
} | undefined;
|
|
199
201
|
boundary?: import("@floating-ui/dom").Boundary | undefined;
|
|
200
|
-
}
|
|
202
|
+
}>;
|
|
201
203
|
readonly disabled: boolean;
|
|
202
204
|
readonly closeLabel: string;
|
|
203
205
|
readonly iconPosition: "before" | "after";
|
|
204
206
|
readonly flip: boolean | {
|
|
205
|
-
crossAxis?: boolean | undefined;
|
|
207
|
+
crossAxis?: boolean | "alignment" | undefined;
|
|
206
208
|
rootBoundary?: import("@floating-ui/core").RootBoundary | undefined;
|
|
207
209
|
elementContext?: import("@floating-ui/core").ElementContext | undefined;
|
|
208
210
|
altBoundary?: boolean | undefined;
|
|
@@ -214,7 +216,7 @@ declare const _default: <T extends string | Option>(__VLS_props: NonNullable<Awa
|
|
|
214
216
|
flipAlignment?: boolean | undefined;
|
|
215
217
|
boundary?: import("@floating-ui/dom").Boundary | undefined;
|
|
216
218
|
} | import("@floating-ui/dom").Derivable<{
|
|
217
|
-
crossAxis?: boolean | undefined;
|
|
219
|
+
crossAxis?: boolean | "alignment" | undefined;
|
|
218
220
|
rootBoundary?: import("@floating-ui/core").RootBoundary | undefined;
|
|
219
221
|
elementContext?: import("@floating-ui/core").ElementContext | undefined;
|
|
220
222
|
altBoundary?: boolean | undefined;
|
|
@@ -225,7 +227,7 @@ declare const _default: <T extends string | Option>(__VLS_props: NonNullable<Awa
|
|
|
225
227
|
fallbackAxisSideDirection?: "none" | "start" | "end" | undefined;
|
|
226
228
|
flipAlignment?: boolean | undefined;
|
|
227
229
|
boundary?: import("@floating-ui/dom").Boundary | undefined;
|
|
228
|
-
}
|
|
230
|
+
}>;
|
|
229
231
|
readonly required: boolean;
|
|
230
232
|
readonly loading: boolean;
|
|
231
233
|
readonly loadingLabel: string;
|
|
@@ -241,7 +243,7 @@ declare const _default: <T extends string | Option>(__VLS_props: NonNullable<Awa
|
|
|
241
243
|
readonly valueKey: string | Function;
|
|
242
244
|
readonly disabledKey: string | Function;
|
|
243
245
|
readonly transitionName: string;
|
|
244
|
-
readonly offset: string | import("@floating-ui/dom").OffsetOptions
|
|
246
|
+
readonly offset: string | import("@floating-ui/dom").OffsetOptions;
|
|
245
247
|
readonly autoPlacement: boolean | {
|
|
246
248
|
crossAxis?: boolean | undefined;
|
|
247
249
|
alignment?: (import("@floating-ui/utils").Alignment | null) | undefined;
|
|
@@ -262,7 +264,7 @@ declare const _default: <T extends string | Option>(__VLS_props: NonNullable<Awa
|
|
|
262
264
|
altBoundary?: boolean | undefined;
|
|
263
265
|
padding?: import("@floating-ui/utils").Padding | undefined;
|
|
264
266
|
boundary?: import("@floating-ui/dom").Boundary | undefined;
|
|
265
|
-
}
|
|
267
|
+
}>;
|
|
266
268
|
readonly arrow: boolean;
|
|
267
269
|
readonly keepOpen: boolean;
|
|
268
270
|
readonly autofocusFirst: boolean;
|
|
@@ -277,10 +279,12 @@ declare const _default: <T extends string | Option>(__VLS_props: NonNullable<Awa
|
|
|
277
279
|
readonly labelClear: string;
|
|
278
280
|
readonly noResultsLabel: string;
|
|
279
281
|
readonly noOptionsLabel: string;
|
|
282
|
+
readonly selectedOptionNotFoundLabel: string;
|
|
280
283
|
readonly deselectActionLabel: string;
|
|
281
284
|
readonly addOptionHintLabel: string;
|
|
282
285
|
readonly addable: boolean;
|
|
283
286
|
readonly searchable: boolean;
|
|
287
|
+
readonly keepSearch: boolean;
|
|
284
288
|
readonly searchPlaceholder: string;
|
|
285
289
|
readonly debounceSearch: string | number;
|
|
286
290
|
readonly minValues: string | number;
|
|
@@ -296,20 +300,22 @@ declare const _default: <T extends string | Option>(__VLS_props: NonNullable<Awa
|
|
|
296
300
|
readonly modelValue?: string | number | boolean | unknown[] | Record<string, any> | undefined;
|
|
297
301
|
readonly modifiers?: string | string[] | undefined;
|
|
298
302
|
readonly id?: string | number | undefined;
|
|
303
|
+
readonly placeholder?: string | undefined;
|
|
299
304
|
readonly icon?: string | import("../VvIcon").VvIconProps | undefined;
|
|
300
305
|
readonly invalidLabel?: string | unknown[] | undefined;
|
|
301
306
|
readonly validLabel?: string | unknown[] | undefined;
|
|
302
|
-
readonly placeholder?: string | undefined;
|
|
303
307
|
readonly searchFunction?: ((search: string, options: T[]) => T[] | Promise<T[]>) | undefined;
|
|
304
308
|
readonly maxValues?: string | number | undefined;
|
|
305
309
|
readonly onClear?: (() => any) | undefined;
|
|
306
310
|
readonly "onUpdate:modelValue"?: ((args_0: any) => any) | undefined;
|
|
307
311
|
readonly onBlur?: ((args_0: import("@vueuse/core").MaybeElement) => any) | undefined;
|
|
308
312
|
readonly onFocus?: ((args_0: import("@vueuse/core").MaybeElement) => any) | undefined;
|
|
309
|
-
readonly "onUpdate:search"?: ((
|
|
313
|
+
readonly "onUpdate:search"?: ((...args: unknown[]) => any) | undefined;
|
|
310
314
|
readonly "onUpdate:options"?: ((args_0: (string | Option)[]) => any) | undefined;
|
|
311
315
|
readonly "onChange:search"?: ((args_0: string) => any) | undefined;
|
|
312
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "floating" | "placement" | "strategy" | "size" | "shift" | "label" | "disabled" | "modelValue" | "modifiers" | "closeLabel" | "icon" | "iconPosition" | "flip" | "required" | "loading" | "loadingLabel" | "unselectable" | "multiple" | "readonly" | "hintLabel" | "invalid" | "invalidLabel" | "valid" | "validLabel" | "tabindex" | "options" | "labelKey" | "valueKey" | "disabledKey" | "transitionName" | "offset" | "autoPlacement" | "arrow" | "keepOpen" | "autofocusFirst" | "triggerWidth" | "focusOnHover" | "deselectHintLabel" | "selectHintLabel" | "selectedHintLabel" | "autoselectFirst" | "showClearAction" | "iconClear" | "labelClear" | "searchFunction" | "noResultsLabel" | "noOptionsLabel" | "deselectActionLabel" | "addOptionHintLabel" | "addable" | "searchable" | "searchPlaceholder" | "debounceSearch" | "minValues" | "separator" | "native" | "badges" | "badgeModifiers" | "dropdownModifiers" | "autoOpen">, "name" | "id" | "onFocus" | "onBlur" | "
|
|
316
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "floating" | "placement" | "strategy" | "size" | "shift" | "label" | "disabled" | "modelValue" | "modifiers" | "closeLabel" | "icon" | "iconPosition" | "flip" | "required" | "loading" | "loadingLabel" | "unselectable" | "multiple" | "readonly" | "hintLabel" | "invalid" | "invalidLabel" | "valid" | "validLabel" | "tabindex" | "options" | "labelKey" | "valueKey" | "disabledKey" | "transitionName" | "offset" | "autoPlacement" | "arrow" | "keepOpen" | "autofocusFirst" | "triggerWidth" | "focusOnHover" | "deselectHintLabel" | "selectHintLabel" | "selectedHintLabel" | "autoselectFirst" | "showClearAction" | "iconClear" | "labelClear" | "searchFunction" | "noResultsLabel" | "noOptionsLabel" | "selectedOptionNotFoundLabel" | "deselectActionLabel" | "addOptionHintLabel" | "addable" | "searchable" | "keepSearch" | "searchPlaceholder" | "debounceSearch" | "minValues" | "separator" | "native" | "badges" | "badgeModifiers" | "dropdownModifiers" | "autoOpen">, "name" | "id" | "onFocus" | "onBlur" | "placeholder" | "onClear" | "onUpdate:modelValue" | "maxValues" | "onUpdate:search" | "onUpdate:options" | "onChange:search" | ("floating" | "placement" | "strategy" | "size" | "shift" | "label" | "disabled" | "modelValue" | "modifiers" | "closeLabel" | "icon" | "iconPosition" | "flip" | "required" | "loading" | "loadingLabel" | "unselectable" | "multiple" | "readonly" | "hintLabel" | "invalid" | "invalidLabel" | "valid" | "validLabel" | "tabindex" | "options" | "labelKey" | "valueKey" | "disabledKey" | "transitionName" | "offset" | "autoPlacement" | "arrow" | "keepOpen" | "autofocusFirst" | "triggerWidth" | "focusOnHover" | "deselectHintLabel" | "selectHintLabel" | "selectedHintLabel" | "autoselectFirst" | "showClearAction" | "iconClear" | "labelClear" | "searchFunction" | "noResultsLabel" | "noOptionsLabel" | "selectedOptionNotFoundLabel" | "deselectActionLabel" | "addOptionHintLabel" | "addable" | "searchable" | "keepSearch" | "searchPlaceholder" | "debounceSearch" | "minValues" | "separator" | "native" | "badges" | "badgeModifiers" | "dropdownModifiers" | "autoOpen")> & {
|
|
317
|
+
search?: string;
|
|
318
|
+
} & {}> & import("vue").PublicProps;
|
|
313
319
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
314
320
|
attrs: any;
|
|
315
321
|
slots: {
|
|
@@ -325,6 +331,8 @@ declare const _default: <T extends string | Option>(__VLS_props: NonNullable<Awa
|
|
|
325
331
|
selectedOptions: T[];
|
|
326
332
|
onInput: (option: string | Option) => void;
|
|
327
333
|
}) => any;
|
|
334
|
+
} & {
|
|
335
|
+
placeholder?: (props: {}) => any;
|
|
328
336
|
} & {
|
|
329
337
|
after?: (props: {
|
|
330
338
|
valid: boolean;
|
|
@@ -380,11 +388,11 @@ declare const _default: <T extends string | Option>(__VLS_props: NonNullable<Awa
|
|
|
380
388
|
loading: boolean;
|
|
381
389
|
}) => any;
|
|
382
390
|
};
|
|
383
|
-
emit: ((evt: "clear") => void) & ((evt: "update:modelValue", args_0: any) => void) & ((evt: "blur", args_0: import("@vueuse/core").MaybeElement) => void) & ((evt: "focus", args_0: import("@vueuse/core").MaybeElement) => void) & ((evt: "update:search", args_0: string) => void) & ((evt: "update:options", args_0: (string | Option)[]) => void) & ((evt: "change:search", args_0: string) => void);
|
|
391
|
+
emit: (((evt: "clear") => void) & ((evt: "update:modelValue", args_0: any) => void) & ((evt: "blur", args_0: import("@vueuse/core").MaybeElement) => void) & ((evt: "focus", args_0: import("@vueuse/core").MaybeElement) => void) & ((evt: "update:search", args_0: string) => void) & ((evt: "update:options", args_0: (string | Option)[]) => void) & ((evt: "change:search", args_0: string) => void)) & ((evt: "update:search", value: string) => void);
|
|
384
392
|
}>) => import("vue").VNode & {
|
|
385
393
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
386
394
|
};
|
|
387
395
|
export default _default;
|
|
388
396
|
type __VLS_PrettifyLocal<T> = {
|
|
389
|
-
[K in keyof T]: T[K];
|
|
397
|
+
[K in keyof T as K]: T[K];
|
|
390
398
|
} & {};
|
|
@@ -42,6 +42,13 @@ export declare const VvComboboxProps: {
|
|
|
42
42
|
type: StringConstructor;
|
|
43
43
|
default: string;
|
|
44
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* Label for selected option not found
|
|
47
|
+
*/
|
|
48
|
+
selectedOptionNotFoundLabel: {
|
|
49
|
+
type: StringConstructor;
|
|
50
|
+
default: string;
|
|
51
|
+
};
|
|
45
52
|
/**
|
|
46
53
|
* Label for selected option hint
|
|
47
54
|
*/
|
|
@@ -96,6 +103,10 @@ export declare const VvComboboxProps: {
|
|
|
96
103
|
* Use input text to search on options
|
|
97
104
|
*/
|
|
98
105
|
searchable: BooleanConstructor;
|
|
106
|
+
/**
|
|
107
|
+
* If true, the search input will retain its value even when the dropdown is closed
|
|
108
|
+
*/
|
|
109
|
+
keepSearch: BooleanConstructor;
|
|
99
110
|
/**
|
|
100
111
|
* Search function to filter options
|
|
101
112
|
*/
|
|
@@ -380,6 +391,13 @@ export declare function useVvComboboxProps<T extends Option | string>(): {
|
|
|
380
391
|
type: StringConstructor;
|
|
381
392
|
default: string;
|
|
382
393
|
};
|
|
394
|
+
/**
|
|
395
|
+
* Label for selected option not found
|
|
396
|
+
*/
|
|
397
|
+
selectedOptionNotFoundLabel: {
|
|
398
|
+
type: StringConstructor;
|
|
399
|
+
default: string;
|
|
400
|
+
};
|
|
383
401
|
/**
|
|
384
402
|
* Label for selected option hint
|
|
385
403
|
*/
|
|
@@ -434,6 +452,10 @@ export declare function useVvComboboxProps<T extends Option | string>(): {
|
|
|
434
452
|
* Use input text to search on options
|
|
435
453
|
*/
|
|
436
454
|
searchable: BooleanConstructor;
|
|
455
|
+
/**
|
|
456
|
+
* If true, the search input will retain its value even when the dropdown is closed
|
|
457
|
+
*/
|
|
458
|
+
keepSearch: BooleanConstructor;
|
|
437
459
|
/**
|
|
438
460
|
* On searchable select is the input search placeholder
|
|
439
461
|
*/
|
|
@@ -131,7 +131,7 @@ function useModifiers(prefix, modifiers, others) {
|
|
|
131
131
|
const toReturn = {
|
|
132
132
|
[prefix]: true
|
|
133
133
|
};
|
|
134
|
-
const modifiersArray = typeof
|
|
134
|
+
const modifiersArray = typeof modifiers?.value === "string" ? modifiers.value.split(" ") : modifiers?.value;
|
|
135
135
|
if (modifiersArray) {
|
|
136
136
|
if (Array.isArray(modifiersArray)) {
|
|
137
137
|
modifiersArray.forEach((modifier) => {
|
|
@@ -204,17 +204,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
204
204
|
const transitioName = computed(() => `vv-dialog--${props.transition}`);
|
|
205
205
|
const dialogTransitionHandlers = {
|
|
206
206
|
"before-enter": () => {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
(_b = dialogEl.value) == null ? void 0 : _b.showModal();
|
|
207
|
+
if (!dialogEl.value?.open) {
|
|
208
|
+
dialogEl.value?.showModal();
|
|
210
209
|
}
|
|
211
210
|
emit("open");
|
|
212
211
|
emit("beforeEnter");
|
|
213
212
|
},
|
|
214
213
|
"after-leave": () => {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
(_b = dialogEl.value) == null ? void 0 : _b.close();
|
|
214
|
+
if (dialogEl.value?.open) {
|
|
215
|
+
dialogEl.value?.close();
|
|
218
216
|
}
|
|
219
217
|
emit("close");
|
|
220
218
|
emit("afterLeave");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","@vueuse/core"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvDialog=t(e.
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","@vueuse/core"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvDialog=t(e.Vue,e.VueUse)}(this,function(e,t){"use strict";var o=(e=>(e.local="local",e.session="session",e))(o||{}),l=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(l||{}),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 i={modifiers:{type:[String,Array],default:void 0}};r.before;const s={id:[String,Number]};l.bottom,n.button,a.button,o.local;const u={...i,...s,title:String,modelValue:{type:Boolean,default:void 0},transition:{type:String,default:"fade-block"},size:String,keepOpen:{type:Boolean,default:!1},labelClose:{type:String,default:"Close"}};const d={key:0,class:"vv-dialog__header"},c=["aria-label","title"],f={class:"vv-dialog__content"},v={key:1,class:"vv-dialog__footer"};return e.defineComponent({name:"VvDialog",props:u,emits:["open","close","update:modelValue","beforeEnter","afterLeave","enter","afterEnter","enterCancelled","beforeLeave","leave","leaveCancelled"],setup(o,{expose:l,emit:r}){const n=o,a=r,i=e.ref(),s=t.useVModel(n,"modelValue",a),u=e.ref(!1),p=e.computed({get:()=>s.value??u.value,set:e=>{void 0!==s.value?s.value=e:u.value=e}}),m=e.ref(null),{modifiers:b}=e.toRefs(n),g=function(t,o,l){return e.computed(()=>{const r={[t]:!0},n="string"==typeof o?.value?o.value.split(" "):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})}("vv-dialog",b,e.computed(()=>n.size?{[n.size]:!!n.size}:{})),k=e.computed(()=>{const{id:e}=n;return{id:e}}),y=e.computed(()=>`vv-dialog--${n.transition}`),h={"before-enter":()=>{i.value?.open||i.value?.showModal(),a("open"),a("beforeEnter")},"after-leave":()=>{i.value?.open&&i.value?.close(),a("close"),a("afterLeave")},enter:()=>{a("enter")},"after-enter":()=>{a("afterEnter")},"enter-cancelled":()=>{a("enterCancelled")},"before-leave":()=>{a("beforeLeave")},leave:()=>{a("leave")},"leave-cancelled":()=>{a("leaveCancelled")}};function C(){p.value=!1}function V(){n.keepOpen||C()}return t.onClickOutside(m,()=>{n.keepOpen||C()}),l({close:C,open:function(){p.value=!0}}),(t,o)=>(e.openBlock(),e.createBlock(e.Transition,e.mergeProps({name:e.unref(y)},e.toHandlers(h),{persisted:""}),{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("dialog",e.mergeProps(e.unref(k),{ref_key:"dialogEl",ref:i,class:e.unref(g),onCancel:e.withModifiers(V,["stop","prevent"])}),[e.createElementVNode("article",{ref_key:"modalWrapper",ref:m,class:"vv-dialog__wrapper"},[t.$slots.header||t.title?(e.openBlock(),e.createElementBlock("header",d,[e.renderSlot(t.$slots,"header",{},()=>[e.createTextVNode(e.toDisplayString(t.title)+" ",1),e.createElementVNode("button",{type:"button","aria-label":t.labelClose,title:t.labelClose,class:"vv-dialog__close",onClickPassive:C},null,40,c)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",f,[e.renderSlot(t.$slots,"default")]),t.$slots.footer?(e.openBlock(),e.createElementBlock("footer",v,[e.renderSlot(t.$slots,"footer")])):e.createCommentVNode("v-if",!0)],512)],16),[[e.vShow,e.unref(p)]])]),_:3},16,["name"]))}})});
|
|
@@ -229,7 +229,7 @@ const VvDropdownProps = {
|
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
231
|
function useUniqueId(id) {
|
|
232
|
-
return computed(() => String(
|
|
232
|
+
return computed(() => String(id?.value || useId()));
|
|
233
233
|
}
|
|
234
234
|
function useDropdownProvideTrigger({
|
|
235
235
|
reference,
|
|
@@ -250,8 +250,7 @@ function useDropdownProvideTrigger({
|
|
|
250
250
|
});
|
|
251
251
|
},
|
|
252
252
|
render() {
|
|
253
|
-
|
|
254
|
-
return h(Fragment, {}, (_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a));
|
|
253
|
+
return h(Fragment, {}, this.$slots.default?.());
|
|
255
254
|
}
|
|
256
255
|
});
|
|
257
256
|
return {
|
|
@@ -277,7 +276,7 @@ function useModifiers(prefix, modifiers, others) {
|
|
|
277
276
|
const toReturn = {
|
|
278
277
|
[prefix]: true
|
|
279
278
|
};
|
|
280
|
-
const modifiersArray = typeof
|
|
279
|
+
const modifiersArray = typeof modifiers?.value === "string" ? modifiers.value.split(" ") : modifiers?.value;
|
|
281
280
|
if (modifiersArray) {
|
|
282
281
|
if (Array.isArray(modifiersArray)) {
|
|
283
282
|
modifiersArray.forEach((modifier) => {
|
|
@@ -343,8 +342,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
343
342
|
useMutationObserver(
|
|
344
343
|
floatingEl.value,
|
|
345
344
|
() => {
|
|
346
|
-
|
|
347
|
-
hasCustomPosition.value = ((_a = window.getComputedStyle(floatingEl.value).getPropertyValue("--dropdown-custom-position")) == null ? void 0 : _a.trim()) === "true";
|
|
345
|
+
hasCustomPosition.value = window.getComputedStyle(floatingEl.value).getPropertyValue("--dropdown-custom-position")?.trim() === "true";
|
|
348
346
|
},
|
|
349
347
|
{
|
|
350
348
|
attributeFilter: ["style"],
|
|
@@ -431,11 +429,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
431
429
|
}
|
|
432
430
|
);
|
|
433
431
|
const dropdownPlacement = computed(() => {
|
|
434
|
-
var _a;
|
|
435
432
|
if (hasCustomPosition.value) {
|
|
436
433
|
return void 0;
|
|
437
434
|
}
|
|
438
|
-
const width = props.triggerWidth && referenceEl.value ? `${
|
|
435
|
+
const width = props.triggerWidth && referenceEl.value ? `${referenceEl.value?.offsetWidth}px` : void 0;
|
|
439
436
|
return {
|
|
440
437
|
position: strategy.value,
|
|
441
438
|
top: `${y.value ?? 0}px`,
|
|
@@ -449,7 +446,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
449
446
|
() => placement.value.split("-")[0]
|
|
450
447
|
);
|
|
451
448
|
const arrowPlacement = computed(() => {
|
|
452
|
-
var _a, _b, _c, _d, _e;
|
|
453
449
|
if (hasCustomPosition.value) {
|
|
454
450
|
return void 0;
|
|
455
451
|
}
|
|
@@ -460,9 +456,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
460
456
|
[Side.left]: Side.right
|
|
461
457
|
}[side.value];
|
|
462
458
|
return {
|
|
463
|
-
left:
|
|
464
|
-
top:
|
|
465
|
-
[staticSide]: `${-(
|
|
459
|
+
left: middlewareData.value.arrow?.x !== void 0 ? `${middlewareData.value.arrow?.x}px` : void 0,
|
|
460
|
+
top: middlewareData.value.arrow?.y !== void 0 ? `${middlewareData.value.arrow?.y}px` : void 0,
|
|
461
|
+
[staticSide]: `${-(arrowEl.value?.offsetWidth ?? 0) / 2}px`
|
|
466
462
|
};
|
|
467
463
|
});
|
|
468
464
|
const modelValue = useVModel(props, "modelValue", emit);
|
|
@@ -499,8 +495,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
499
495
|
{ ignore: [referenceEl] }
|
|
500
496
|
);
|
|
501
497
|
const hasAriaLabelledby = computed(() => {
|
|
502
|
-
|
|
503
|
-
return ((_b = (_a = referenceEl.value) == null ? void 0 : _a.getAttribute) == null ? void 0 : _b.call(_a, "id")) ?? void 0;
|
|
498
|
+
return referenceEl.value?.getAttribute?.("id") ?? void 0;
|
|
504
499
|
});
|
|
505
500
|
const referenceAria = computed(() => ({
|
|
506
501
|
"aria-controls": hasId.value,
|
|
@@ -651,7 +646,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
651
646
|
onKeyStroke([" ", "Enter"], (e) => {
|
|
652
647
|
const htmlEl = e.target;
|
|
653
648
|
if (expanded.value && focused.value && htmlEl) {
|
|
654
|
-
htmlEl
|
|
649
|
+
htmlEl?.click();
|
|
655
650
|
}
|
|
656
651
|
});
|
|
657
652
|
const dropdownTransitionHandlers = {
|