@volverjs/ui-vue 0.0.9-beta.7 → 0.0.9-beta.8
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/dist/components/VvAlert/VvAlert.es.js +7 -6
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +6 -6
- package/dist/components/VvAlert/index.d.ts +3 -3
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +7 -6
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +65 -2
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +4 -4
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +71 -3
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +4 -4
- package/dist/components/VvCombobox/VvCombobox.es.js +62 -56
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +4 -4
- package/dist/components/VvInputText/VvInputText.es.js +61 -2
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +4 -4
- package/dist/components/VvRadio/VvRadio.es.js +65 -2
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +4 -4
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +71 -3
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +4 -4
- package/dist/components/VvSelect/VvSelect.es.js +61 -2
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +4 -4
- package/dist/components/VvTextarea/VvTextarea.es.js +61 -2
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +4 -4
- package/dist/components/common/HintSlot.d.ts +4 -3
- package/dist/components/index.es.js +104 -67
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/index.d.ts +1 -2
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/package.json +21 -21
- package/src/assets/icons/detailed.json +1 -1
- package/src/assets/icons/normal.json +1 -1
- package/src/assets/icons/simple.json +1 -1
- package/src/components/VvAlert/VvAlert.vue +5 -1
- package/src/components/VvAlert/index.ts +3 -3
- package/src/components/VvCheckbox/VvCheckbox.vue +8 -1
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +8 -1
- package/src/components/VvCombobox/VvCombobox.vue +1 -1
- package/src/components/VvInputText/VvInputText.vue +8 -1
- package/src/components/VvRadio/VvRadio.vue +8 -1
- package/src/components/VvRadioGroup/VvRadioGroup.vue +8 -1
- package/src/components/VvSelect/VvSelect.vue +8 -1
- package/src/components/VvTextarea/VvTextarea.vue +8 -1
- package/src/components/common/HintSlot.ts +7 -2
- package/src/composables/index.ts +1 -3
|
@@ -97,25 +97,25 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
97
97
|
}, {}>, {
|
|
98
98
|
default?(_: {}): any;
|
|
99
99
|
hint?(_: {
|
|
100
|
-
modelValue:
|
|
100
|
+
modelValue: unknown;
|
|
101
101
|
valid: boolean;
|
|
102
102
|
invalid: boolean;
|
|
103
103
|
loading: boolean;
|
|
104
104
|
}): any;
|
|
105
105
|
loading?(_: {
|
|
106
|
-
modelValue:
|
|
106
|
+
modelValue: unknown;
|
|
107
107
|
valid: boolean;
|
|
108
108
|
invalid: boolean;
|
|
109
109
|
loading: boolean;
|
|
110
110
|
}): any;
|
|
111
111
|
valid?(_: {
|
|
112
|
-
modelValue:
|
|
112
|
+
modelValue: unknown;
|
|
113
113
|
valid: boolean;
|
|
114
114
|
invalid: boolean;
|
|
115
115
|
loading: boolean;
|
|
116
116
|
}): any;
|
|
117
117
|
invalid?(_: {
|
|
118
|
-
modelValue:
|
|
118
|
+
modelValue: unknown;
|
|
119
119
|
valid: boolean;
|
|
120
120
|
invalid: boolean;
|
|
121
121
|
loading: boolean;
|
|
@@ -1455,7 +1455,8 @@ function joinLines(items) {
|
|
|
1455
1455
|
}
|
|
1456
1456
|
return items;
|
|
1457
1457
|
}
|
|
1458
|
-
function HintSlotFactory(
|
|
1458
|
+
function HintSlotFactory(propsOrRef, slots) {
|
|
1459
|
+
const props = unref(propsOrRef);
|
|
1459
1460
|
const invalidLabel = computed(() => joinLines(props.invalidLabel));
|
|
1460
1461
|
const validLabel = computed(() => joinLines(props.validLabel));
|
|
1461
1462
|
const loadingLabel = computed(() => props.loadingLabel);
|
|
@@ -1608,6 +1609,59 @@ const VvSelectProps = {
|
|
|
1608
1609
|
placeholder: String
|
|
1609
1610
|
};
|
|
1610
1611
|
const VvSelectEmits = ["update:modelValue", "focus", "blur"];
|
|
1612
|
+
function useDefaults(componentName, propsDefinition, props) {
|
|
1613
|
+
const volver = useVolver();
|
|
1614
|
+
const volverComponentDefaults = computed(() => {
|
|
1615
|
+
var _a;
|
|
1616
|
+
if (!volver || !((_a = volver.defaults.value) == null ? void 0 : _a[componentName])) {
|
|
1617
|
+
return void 0;
|
|
1618
|
+
}
|
|
1619
|
+
return volver.defaults.value[componentName];
|
|
1620
|
+
});
|
|
1621
|
+
return computed(() => {
|
|
1622
|
+
if (volverComponentDefaults.value === void 0) {
|
|
1623
|
+
return props;
|
|
1624
|
+
}
|
|
1625
|
+
const componentDefaults = volverComponentDefaults.value;
|
|
1626
|
+
const simplifiedPropsDefinition = propsDefinition;
|
|
1627
|
+
const simplifiedProps = props;
|
|
1628
|
+
return Object.keys(simplifiedPropsDefinition).reduce((acc, key) => {
|
|
1629
|
+
const propValue = simplifiedProps[key];
|
|
1630
|
+
acc[key] = propValue;
|
|
1631
|
+
if (key in componentDefaults) {
|
|
1632
|
+
if (Array.isArray(simplifiedPropsDefinition[key])) {
|
|
1633
|
+
const typeArray = simplifiedPropsDefinition[key];
|
|
1634
|
+
if (typeArray.length) {
|
|
1635
|
+
const typeFunction = typeArray[0];
|
|
1636
|
+
if (typeFunction === propValue) {
|
|
1637
|
+
acc[key] = componentDefaults[key];
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
}
|
|
1641
|
+
if (typeof simplifiedPropsDefinition[key] === "function") {
|
|
1642
|
+
const typeFunction = simplifiedPropsDefinition[key];
|
|
1643
|
+
if (typeFunction() === propValue) {
|
|
1644
|
+
acc[key] = componentDefaults[key];
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1647
|
+
if (typeof simplifiedPropsDefinition[key] === "object") {
|
|
1648
|
+
let defaultValue = simplifiedPropsDefinition[key].default;
|
|
1649
|
+
if (typeof defaultValue === "function") {
|
|
1650
|
+
defaultValue = defaultValue();
|
|
1651
|
+
}
|
|
1652
|
+
if (typeof defaultValue === "object") {
|
|
1653
|
+
if (JSON.stringify(defaultValue) === JSON.stringify(propValue)) {
|
|
1654
|
+
acc[key] = componentDefaults[key];
|
|
1655
|
+
}
|
|
1656
|
+
} else if (defaultValue === propValue) {
|
|
1657
|
+
acc[key] = componentDefaults[key];
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
return acc;
|
|
1662
|
+
}, {});
|
|
1663
|
+
});
|
|
1664
|
+
}
|
|
1611
1665
|
function useComponentFocus(inputTemplateRef, emit) {
|
|
1612
1666
|
const { focused } = useFocus(inputTemplateRef);
|
|
1613
1667
|
watch(focused, (newValue) => {
|
|
@@ -1710,13 +1764,18 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1710
1764
|
setup(__props, { emit }) {
|
|
1711
1765
|
const props = __props;
|
|
1712
1766
|
const slots = useSlots();
|
|
1767
|
+
const propsDefaults = useDefaults(
|
|
1768
|
+
"VvSelect",
|
|
1769
|
+
VvSelectProps,
|
|
1770
|
+
props
|
|
1771
|
+
);
|
|
1713
1772
|
const select = ref();
|
|
1714
1773
|
const {
|
|
1715
1774
|
HintSlot,
|
|
1716
1775
|
hasHintLabelOrSlot,
|
|
1717
1776
|
hasInvalidLabelOrSlot,
|
|
1718
1777
|
hintSlotScope
|
|
1719
|
-
} = HintSlotFactory(
|
|
1778
|
+
} = HintSlotFactory(propsDefaults, slots);
|
|
1720
1779
|
const {
|
|
1721
1780
|
id,
|
|
1722
1781
|
modifiers,
|
|
@@ -2325,59 +2384,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2325
2384
|
};
|
|
2326
2385
|
}
|
|
2327
2386
|
});
|
|
2328
|
-
function useDefaults(componentName, propsDefinition, props) {
|
|
2329
|
-
const volver = useVolver();
|
|
2330
|
-
const volverComponentDefaults = computed(() => {
|
|
2331
|
-
var _a;
|
|
2332
|
-
if (!volver || !((_a = volver.defaults.value) == null ? void 0 : _a[componentName])) {
|
|
2333
|
-
return void 0;
|
|
2334
|
-
}
|
|
2335
|
-
return volver.defaults.value[componentName];
|
|
2336
|
-
});
|
|
2337
|
-
return computed(() => {
|
|
2338
|
-
if (volverComponentDefaults.value === void 0) {
|
|
2339
|
-
return props;
|
|
2340
|
-
}
|
|
2341
|
-
const componentDefaults = volverComponentDefaults.value;
|
|
2342
|
-
const simplifiedPropsDefinition = propsDefinition;
|
|
2343
|
-
const simplifiedProps = props;
|
|
2344
|
-
return Object.keys(simplifiedPropsDefinition).reduce((acc, key) => {
|
|
2345
|
-
const propValue = simplifiedProps[key];
|
|
2346
|
-
acc[key] = propValue;
|
|
2347
|
-
if (key in componentDefaults) {
|
|
2348
|
-
if (Array.isArray(simplifiedPropsDefinition[key])) {
|
|
2349
|
-
const typeArray = simplifiedPropsDefinition[key];
|
|
2350
|
-
if (typeArray.length) {
|
|
2351
|
-
const typeFunction = typeArray[0];
|
|
2352
|
-
if (typeFunction === propValue) {
|
|
2353
|
-
acc[key] = componentDefaults[key];
|
|
2354
|
-
}
|
|
2355
|
-
}
|
|
2356
|
-
}
|
|
2357
|
-
if (typeof simplifiedPropsDefinition[key] === "function") {
|
|
2358
|
-
const typeFunction = simplifiedPropsDefinition[key];
|
|
2359
|
-
if (typeFunction() === propValue) {
|
|
2360
|
-
acc[key] = componentDefaults[key];
|
|
2361
|
-
}
|
|
2362
|
-
}
|
|
2363
|
-
if (typeof simplifiedPropsDefinition[key] === "object") {
|
|
2364
|
-
let defaultValue = simplifiedPropsDefinition[key].default;
|
|
2365
|
-
if (typeof defaultValue === "function") {
|
|
2366
|
-
defaultValue = defaultValue();
|
|
2367
|
-
}
|
|
2368
|
-
if (typeof defaultValue === "object") {
|
|
2369
|
-
if (JSON.stringify(defaultValue) === JSON.stringify(propValue)) {
|
|
2370
|
-
acc[key] = componentDefaults[key];
|
|
2371
|
-
}
|
|
2372
|
-
} else if (defaultValue === propValue) {
|
|
2373
|
-
acc[key] = componentDefaults[key];
|
|
2374
|
-
}
|
|
2375
|
-
}
|
|
2376
|
-
}
|
|
2377
|
-
return acc;
|
|
2378
|
-
}, {});
|
|
2379
|
-
});
|
|
2380
|
-
}
|
|
2381
2387
|
const _hoisted_1 = ["id"];
|
|
2382
2388
|
const _hoisted_2 = ["id", "for"];
|
|
2383
2389
|
const _hoisted_3 = ["id", "aria-controls", "placeholder"];
|
|
@@ -2428,7 +2434,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2428
2434
|
hasHintLabelOrSlot,
|
|
2429
2435
|
hasInvalidLabelOrSlot,
|
|
2430
2436
|
hintSlotScope
|
|
2431
|
-
} = HintSlotFactory(
|
|
2437
|
+
} = HintSlotFactory(propsDefaults, slots);
|
|
2432
2438
|
const inputEl = ref(null);
|
|
2433
2439
|
const inputSearchEl = ref(null);
|
|
2434
2440
|
const wrapperEl = ref(null);
|
|
@@ -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("nanoid"),require("@vueuse/core"),require("mitt"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","@floating-ui/vue","nanoid","@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.nanoid,e.core,e.mitt,e.tsDotProp)}(this,(function(e,t,l,o,a,n,r){"use strict";var i=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(i||{}),u=(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))(u||{}),d=(e=>(e.before="before",e.after="after",e))(d||{}),s=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(s||{}),c=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(c||{}),p=(e=>(e.button="button",e.link="link",e.menuitem="menuitem",e))(p||{}),v=(e=>(e.listbox="listbox",e.menu="menu",e))(v||{}),f=(e=>(e.option="option",e.presentation="presentation",e))(f||{}),m=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(m||{});const b=Symbol.for("volver"),g=Symbol.for("buttonGroup"),y=Symbol.for("dropdownTrigger"),h=Symbol.for("dropdownItem"),k=Symbol.for("dropdownAction"),S={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(m).includes(e)},rel:{type:String,default:"noopener noreferrer"}},B={valid:Boolean,validLabel:[String,Array]},V={invalid:Boolean,invalidLabel:[String,Array]},x={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},w={disabled:Boolean},L={selected:Boolean},P={active:Boolean},$={pressed:Boolean},_={label:[String,Number]},C={readonly:Boolean},O={modifiers:[String,Array]},E={hintLabel:{type:String,default:""}},N={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},A={icon:{type:[String,Object]},iconPosition:{type:String,default:d.before,validation:e=>Object.values(d).includes(e)}},D={tabindex:{type:[String,Number],default:0}},j={floating:Boolean},R={unselectable:{type:Boolean,default:!0}},z={id:[String,Number]},F={placement:{type:String,default:i.bottom,validator:e=>Object.values(i).includes(e)||Object.values(u).includes(e)},strategy:{type:String,default:"absolute",validator:e=>["fixed","absolute"].includes(e)},transitionName:{type:String},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}},H={...z,name:{type:String,required:!0}},I={autofocus:Boolean},T={autocomplete:{type:String,default:"off"}},M={...w,..._,...$,...P,...S,type:{type:String,default:s.button,validator:e=>Object.values(s).includes(e)},ariaLabel:{type:String,default:void 0}},q={...H,...D,...B,...V,...E,...x,...w,...C,...O,...N,...A,...j,...R,...F,..._,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"},closeLabel:{type:String,default:"Close"},placeholder:String,searchable:Boolean,searchPlaceholder:{type:String,default:"Search..."},debounceSearch:{type:[Number,String],default:0},multiple:Boolean,maxValues:[Number,String],separator:{type:String,default:", "},native:Boolean,badges:Boolean,badgeModifiers:{type:[String,Array],default:"action sm"},triggerWidth:{...F.triggerWidth,default:!0},dropdownModifiers:{type:[String,Array],default:"mobile"},autoOpen:{type:Boolean,default:!1},keepOpen:{type:Boolean,default:!1}},K={color:String,width:{type:[String,Number]},height:{type:[String,Number]},name:{type:String,required:!0},provider:{type:String},prefix:{type:String,default:"normal"},src:String,horizontalFlip:Boolean,verticalFlip:Boolean,flip:String,mode:String,inline:Boolean,rotate:[Number,String],onLoad:Function,svg:String,modifiers:{type:[String,Array]}};function W(){return e.inject(b)}function G(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 U=e.defineComponent({name:"VvIcon",props:K,setup(l){const o=l,a=e.computed((()=>"string"==typeof o.rotate?parseFloat(o.rotate):o.rotate)),n=e.ref(!0),r=W(),{modifiers:i}=e.toRefs(o),u=G("vv-icon",i),d=e.computed((()=>o.provider||(null==r?void 0:r.iconsProvider))),s=e.computed((()=>{const e=o.name??"",l=`@${d.value}:${o.prefix}:${e}`;if(t.iconExists(l))return l;const a=null==r?void 0:r.iconsCollections.find((l=>{const o=`@${d.value}:${l.prefix}:${e}`;return t.iconExists(o)}));return a?`@${d.value}:${a.prefix}:${e}`:e}));function c(e){const l=function(e){let t;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");t=(new e).window}return(t?new t.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),a=(null==l?void 0:l.innerHTML.trim())||"";l&&a&&t.addIcon(`@${d.value}:${o.prefix}:${o.name}`,{body:a,height:l.viewBox.baseVal.height,width:l.viewBox.baseVal.width})}return r&&o.src&&!t.iconExists(`@${d.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,onLoad:l.onLoad,icon:e.unref(s)}),null,16,["class"])):e.createCommentVNode("",!0)}}),J={...z,...F,...O,modelValue:{type:Boolean,default:void 0},reference:{type:Object,default:null},role:{type:String,default:v.menu,validator:e=>Object.values(v).includes(e)}},Q=t=>e.computed((()=>String((null==t?void 0:t.value)||o.nanoid())));const X=["id","tabindex","role","aria-labelledby"],Y=e.defineComponent({name:"VvDropdown",inheritAttrs:!1,props:J,emits:["update:modelValue","beforeExpand","beforeCollapse","afterExpand","afterCollapse","before-enter","after-leave","enter","after-enter","enter-cancelled","before-leave","leave","leave-cancelled"],setup(t,{expose:o,emit:r}){const i=t,{id:u}=e.toRefs(i),d=Q(u),s=e.useAttrs(),c=e.ref("auto"),p=e.ref("auto"),m=e.ref(null),b=e.ref(),g=e.ref(null),k=e.ref(null),S=e.computed({get:()=>i.reference??m.value,set:e=>{m.value=e}}),B=e.ref(!1);e.onMounted((()=>{a.useMutationObserver(b.value,(()=>{var e;B.value="true"===(null==(e=window.getComputedStyle(b.value).getPropertyValue("--dropdown-custom-position"))?void 0:e.trim())}),{attributeFilter:["style"],window:window})}));const V=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()):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})=>{c.value=`${e}px`,p.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:g})),e})),{x:x,y:w,strategy:L,middlewareData:P,placement:$}=l.useFloating(S,b,{whileElementsMounted:(...e)=>l.autoUpdate(...e,{animationFrame:"fixed"===i.strategy}),placement:e.computed((()=>i.placement)),strategy:e.computed((()=>i.strategy)),middleware:V}),_=e.computed((()=>{if(!B.value)return{position:L.value,top:`${w.value??0}px`,left:`${x.value??0}px`,maxWidth:c.value,maxHeight:p.value,width:i.triggerWidth&&S.value?`${S.value.offsetWidth}px`:void 0}})),C=e.computed((()=>$.value.split("-")[0])),O=e.computed((()=>{var e,t,l,o,a;if(B.value)return;const n={top:"bottom",right:"left",bottom:"top",left:"right"}[C.value];return{left:void 0!==(null==(e=P.value.arrow)?void 0:e.x)?`${null==(t=P.value.arrow)?void 0:t.x}px`:void 0,top:void 0!==(null==(l=P.value.arrow)?void 0:l.y)?`${null==(o=P.value.arrow)?void 0:o.y}px`:void 0,[n]:-((null==(a=g.value)?void 0:a.offsetWidth)??0)/2+"px"}})),E=a.useVModel(i,"modelValue",r),N=e.ref(!1),A=e.computed({get:()=>E.value??N.value,set:e=>{void 0!==E.value?E.value=e:N.value=e}}),D=()=>{A.value=!0},j=()=>{A.value=!1},R=()=>{A.value=!A.value},z=e=>{S.value=e};o({toggle:R,show:D,hide:j,init:z,customPosition:B}),e.watch(A,(t=>{t&&i.autofocusFirst&&e.nextTick((()=>{const e=J(b.value);e.length>0&&e[0].focus({preventScroll:!0})}))})),a.onClickOutside(b,(()=>{!i.keepOpen&&A.value&&(A.value=!1)}),{ignore:[S]});const F=e.computed((()=>{var e,t;return(null==(t=null==(e=S.value)?void 0:e.getAttribute)?void 0:t.call(e,"id"))??void 0})),H=e.computed((()=>({"aria-controls":d.value,"aria-haspopup":!0,"aria-expanded":A.value}))),{component:I,bus:T}=function({reference:t,id:l,expanded:o,aria:a}){const r=n(),i=e.defineComponent({name:"VvDropdownTriggerProvider",setup(){e.provide(y,{reference:t,id:l,expanded:o,aria:a,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:S,id:d,expanded:A,aria:H});T.on("click",R);const{role:M,modifiers:q}=e.toRefs(i),{itemRole:K}=function({role:t,expanded:l}){const o=e.computed((()=>t.value===v.listbox?f.option:f.presentation));return e.provide(h,{role:o,expanded:l}),{itemRole:o}}({role:M,expanded:A}),W=G("vv-dropdown",q,e.computed((()=>({arrow:i.arrow})))),{focused:U}=a.useFocusWithin(b);function J(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"))):[]}a.onKeyStroke("Escape",(e=>{A.value&&(e.preventDefault(),j())})),a.onKeyStroke("ArrowDown",(t=>{A.value&&U.value&&(t.preventDefault(),e.nextTick((()=>{if(U.value){const e=J(b.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})}})))})),a.onKeyStroke("ArrowUp",(t=>{A.value&&U.value&&(t.preventDefault(),e.nextTick((()=>{if(U.value){const e=J(b.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})}})))})),a.onKeyStroke([" ","Enter"],(e=>{const t=e.target;A.value&&U.value&&t&&(null==t||t.click())}));const Y={"before-enter":()=>{r(A.value?"beforeExpand":"beforeCollapse"),r("before-enter")},"after-leave":()=>{r(A.value?"afterExpand":"afterCollapse"),r("after-leave")},enter:()=>{r("enter")},"after-enter":()=>{r("after-enter")},"enter-cancelled":()=>{r("enter-cancelled")},"before-leave":()=>{r("before-leave")},leave:()=>{r("leave")},"leave-cancelled":()=>{r("leave-cancelled")}};return(t,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(I),null,{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps({init:z,show:D,hide:j,toggle:R,expanded:e.unref(A),aria:e.unref(H)})))])),_:3}),e.createVNode(e.Transition,e.mergeProps({name:t.transitionName},e.toHandlers(Y)),{default:e.withCtx((()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"floatingEl",ref:b,style:e.normalizeStyle(e.unref(_)),class:e.normalizeClass(e.unref(W))},[i.arrow?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"arrowEl",ref:g,style:e.normalizeStyle(e.unref(O)),class:"vv-dropdown__arrow"},null,4)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps({expanded:e.unref(A)}))),e.createElementVNode("div",e.mergeProps(e.unref(s),{id:e.unref(d),ref_key:"listEl",ref:k,tabindex:e.unref(A)?void 0:-1,role:e.unref(M),"aria-labelledby":e.unref(F),class:"vv-dropdown__list"}),[e.renderSlot(t.$slots,"items",e.normalizeProps(e.guardReactiveProps({role:e.unref(K)})))],16,X),e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps({expanded:e.unref(A)})))],6),[[e.vShow,e.unref(A)]])])),_:3},16,["name"])],64))}});const Z=e.defineComponent({name:"VvDropdownItem",setup(t){const{role:l,expanded:o}=e.inject(h,{}),n=e.ref(null);!function({expanded:t}){e.provide(k,{role:e.ref(p.menuitem),expanded:t})}({expanded:o});const r=a.useElementHover(n),{focused:i}=a.useFocus(n),{focused:u}=a.useFocusWithin(n);return e.watch(r,(e=>{e&&(i.value=!0)})),(t,o)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({role:e.unref(l)},{ref_key:"element",ref:n,class:["vv-dropdown__item",{"focus-visible":e.unref(i)||e.unref(u)}]}),[e.renderSlot(t.$slots,"default")],16))}}),ee=["title"],te=e.defineComponent({name:"VvDropdownOption",props:{...w,...L,...R,...O,deselectHintLabel:{type:String},selectHintLabel:{type:String},selectedHintLabel:{type:String}},setup(t){const l=t,{modifiers:o}=e.toRefs(l),a=G("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?void 0:l.selectHintLabel));return(t,l)=>(e.openBlock(),e.createBlock(Z,{class:e.normalizeClass(e.unref(a)),tabindex:t.disabled?-1:0,"aria-selected":t.selected,"aria-disabled":t.disabled},{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,ee)])),_:3},8,["class","tabindex","aria-selected","aria-disabled"]))}}),le={class:"vv-dropdown-optgroup",role:"presentation",tabindex:"-1"},oe=e.defineComponent({name:"VvDropdownOptgroup",props:{..._},setup(t){const l=t;return(t,o)=>(e.openBlock(),e.createElementBlock("li",le,e.toDisplayString(l.label),1))}});function ae(e,t,l){return l?re(e,l)===re(t,l):ne(e,t)}function ne(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(!ne(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 d=e instanceof RegExp,s=t instanceof RegExp;if(d!=s)return!1;if(d&&s)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],!ne(e[r],t[r]))return!1;return!0}return e!=e&&t!=t}function re(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const l=t.split(".");let o=e;for(let t=0,a=l.length;t<a;++t){if(null==e)return null;o=o[l[t]]}return o}}return null}function ie(e,t){if(null!=e&&t&&t.length)for(const l of t)if(ae(e,l))return!0;return!1}function ue(t){return null==(l=e.unref(t))||""===l||Array.isArray(l)&&0===l.length||!(l instanceof Date)&&"object"==typeof l&&0===Object.keys(l).length;var l}function de(e,t){const l=function(e,t){let l=-1;if(t)for(let o=0;o<t.length;o++)if(ae(t[o],e)){l=o;break}return l}(e,t);return l>-1?t.filter(((e,t)=>t!==l)):t}function se(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}function ce(t,l){const o=e.computed((()=>se(t.invalidLabel))),a=e.computed((()=>se(t.validLabel))),n=e.computed((()=>t.loadingLabel)),r=e.computed((()=>t.hintLabel)),i=e.computed((()=>Boolean(t.loading&&(l.loading||n.value)))),u=e.computed((()=>!i.value&&Boolean(t.invalid&&(l.invalid||o.value)))),d=e.computed((()=>!i.value&&!u.value&&Boolean(t.valid&&(l.valid||a.value)))),s=e.computed((()=>!i.value&&!u.value&&!d.value&&Boolean(l.hint||r.value))),c=e.computed((()=>u.value||d.value||i.value||s.value)),p=e.computed((()=>({modelValue:t.modelValue,valid:t.valid,invalid:t.invalid,loading:t.loading}))),v=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:c,invalidLabel:o,validLabel:a,loadingLabel:n,hintLabel:r,hasInvalidLabelOrSlot:u,hasValidLabelOrSlot:d,hasLoadingLabelOrSlot:i,hasHintLabelOrSlot:s}),render(){var t,l,o,a,n,r,i,u;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(l=(t=this.$slots).loading)?void 0:l.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(a=(o=this.$slots).invalid)?void 0:a.call(o))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(r=(n=this.$slots).valid)?void 0:r.call(n))??this.validLabel):e.h(this.tag,{role:d},(null==(u=(i=this.$slots).hint)?void 0:u.call(i))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:u,hasHintLabelOrSlot:s,hasValidLabelOrSlot:d,hasLoadingLabelOrSlot:i,hintSlotScope:p,HintSlot:v}}const pe={...H,...I,...T,...D,...B,...V,...E,...x,...w,...C,...O,...N,...A,...j,...R,..._,multiple:Boolean,required:Boolean,size:[String,Number],modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},placeholder:String};function ve(t,l){const{focused:o}=a.useFocus(t);return e.watch(o,(o=>{l(o?"focus":"blur",e.unref(t))})),{focused:o}}function fe(t,l){const o=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===d.before))),a=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===d.after))),n=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===i.left))),r=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===i.right))),u=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===i.top))),s=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===i.bottom)));return{hasIcon:e.computed((()=>"string"==typeof(null==t?void 0:t.value)?{name:null==t?void 0:t.value}:null==t?void 0:t.value)),hasIconLeft:n,hasIconRight:r,hasIconTop:u,hasIconBottom:s,hasIconBefore:o,hasIconAfter:a}}function me(t){const{options:l,labelKey:o,valueKey:a,disabledKey:n}=e.toRefs(t);return{options:l,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof o.value?o.value(e):r.get(e,o.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof a.value?a.value(e):r.get(e,a.value),getOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof n.value?n.value(e):r.get(e,n.value)),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}const be=["for"],ge={class:"vv-select__wrapper"},ye={key:0,class:"vv-select__input-before"},he={class:"vv-select__inner"},ke=["id"],Se=["disabled","hidden"],Be=["disabled","value"],Ve=["disabled","label"],xe=["disabled","value"],we={key:1,class:"vv-select__input-after"},Le=e.defineComponent({name:"VvSelect",props:pe,emits:["update:modelValue","focus","blur"],setup(t,{emit:l}){const o=t,n=e.useSlots(),r=e.ref(),{HintSlot:i,hasHintLabelOrSlot:u,hasInvalidLabelOrSlot:d,hintSlotScope:s}=ce(o,n),{id:c,modifiers:p,disabled:v,readonly:f,loading:m,icon:b,iconPosition:g,invalid:y,valid:h,floating:k,multiple:S}=e.toRefs(o),B=Q(c),V=e.computed((()=>`${B.value}-hint`)),{focused:x}=ve(r,l),w=a.useElementVisibility(r);e.watch(w,(e=>{e&&o.autofocus&&(x.value=!0)}));const{hasIcon:L,hasIconBefore:P,hasIconAfter:$}=fe(b,g),_=e.computed((()=>!ue(o.modelValue))),C=e.computed((()=>o.disabled||o.readonly)),O=e.computed((()=>C.value?-1:o.tabindex)),E=e.computed((()=>!0===o.invalid||!0!==o.valid&&void 0)),N=G("vv-select",p,e.computed((()=>({valid:h.value,invalid:y.value,loading:m.value,disabled:v.value,readonly:f.value,"icon-before":P.value,"icon-after":$.value,dirty:_.value,focus:x.value,floating:k.value,multiple:S.value})))),A=e.computed((()=>({name:o.name,tabindex:O.value,disabled:C.value,required:o.required,size:o.size,autocomplete:o.autocomplete,multiple:o.multiple,"aria-invalid":E.value,"aria-describedby":u.value?V.value:void 0,"aria-errormessage":d.value?V.value:void 0}))),D=e.computed((()=>({valid:o.valid,invalid:o.invalid,modelValue:o.modelValue}))),{getOptionLabel:j,getOptionValue:R,getOptionDisabled:z,getOptionGrouped:F}=me(o),H=e.computed({get:()=>o.modelValue,set:e=>{Array.isArray(e)&&(e=e.filter((e=>void 0!==e))),l("update:modelValue",e)}}),I=e=>"string"!=typeof e&&(e&&e.options&&e.options.length>0);return(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(N))},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(B)},e.toDisplayString(t.label),9,be)):e.createCommentVNode("",!0),e.createElementVNode("div",ge,[t.$slots.before?(e.openBlock(),e.createElementBlock("div",ye,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(D))))])):e.createCommentVNode("",!0),e.createElementVNode("div",he,[e.unref(P)?(e.openBlock(),e.createBlock(U,e.mergeProps({key:0,class:"vv-select__icon"},e.unref(L)),null,16)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("select",e.mergeProps({id:e.unref(B),ref_key:"select",ref:r,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(H)?H.value=t:null)},e.unref(A)),[t.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,value:void 0,disabled:!t.unselectable,hidden:!t.unselectable},e.toDisplayString(t.placeholder),9,Se)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,((t,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[I(t)?(e.openBlock(),e.createElementBlock("optgroup",{key:`group-${l}`,disabled:e.unref(z)(t),label:e.unref(j)(t)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(F)(t),((t,o)=>(e.openBlock(),e.createElementBlock("option",{key:`group-${l}-item-${o}`,disabled:e.unref(z)(t),value:e.unref(R)(t)},e.toDisplayString(e.unref(j)(t)),9,xe)))),128))],8,Ve)):(e.openBlock(),e.createElementBlock("option",{key:l,disabled:e.unref(z)(t),value:e.unref(R)(t)},e.toDisplayString(e.unref(j)(t)),9,Be))],64)))),256))],16,ke),[[e.vModelSelect,e.unref(H)]]),e.unref($)?(e.openBlock(),e.createBlock(U,e.mergeProps({key:1,class:"vv-select__icon vv-select__icon-after"},e.unref(L)),null,16)):e.createCommentVNode("",!0)]),t.$slots.after?(e.openBlock(),e.createElementBlock("div",we,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(D))))])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(i),{id:e.unref(V),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(s))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(s))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(s))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(s))))])),key:"3"}:void 0]),1032,["id"])],2))}}),Pe={...O,value:[String,Number]},$e=e.defineComponent({name:"VvBadge",props:Pe,setup(t){const l=t,{modifiers:o}=e.toRefs(l),a=G("vv-badge",o);return(t,l)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(a)),role:"status"},[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.value),1)]))],2))}}),_e=M,Ce=e.defineComponent({name:"VvAction",props:_e,emits:["click","mouseover","mouseleave"],setup(t,{expose:l,emit:o}){const a=t,n=W(),r=e.ref(null);l({$el:r});const{reference:i,bus:u,aria:d,expanded:s}=e.inject(y,{});e.watch((()=>r.value),(e=>{i&&(i.value=e)}));const p=e.computed((()=>a.pressed||(null==s?void 0:s.value))),{role:v}=e.inject(k,{}),f=e.computed((()=>{switch(!0){case a.disabled:return c.button;case void 0!==a.to:return(null==n?void 0:n.nuxt)?c.nuxtLink:c.routerLink;case void 0!==a.href:return c.a;default:return c.button}})),m=e.computed((()=>{const e={...null==d?void 0:d.value,ariaPressed:!!p.value||void 0,ariaLabel:a.ariaLabel,role:null==v?void 0:v.value};switch(f.value){case c.a:return{...e,href:a.href,target:a.target,rel:a.rel};case c.routerLink:case c.nuxtLink:return{...e,to:a.to,target:a.target};default:return{...e,type:a.type,disabled:a.disabled}}})),b=e=>{a.disabled?e.preventDefault():(null==u||u.emit("click",e),o("click",e))},g=e=>{null==u||u.emit("mouseover",e),o("mouseover",e)},h=e=>{null==u||u.emit("mouseleave",e),o("mouseleave",e)};return(t,l)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(f)),e.mergeProps(e.unref(m),{ref_key:"element",ref:r,class:{active:t.active,pressed:e.unref(p),disabled:t.disabled},onClickPassive:b,onMouseoverPassive:g,onMouseleavePassive:h}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}});const Oe={...M,...z,...O,...R,...x,icon:[String,Object],iconPosition:{type:String,default:i.left,validator:e=>Object.values(i).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 Ee(t,l){const{group:o,isInGroup:a,getGroupOrLocalRef:n}=function(t){const l=e.inject(t,void 0),o=e.computed((()=>!ue(l)));return{group:l,isInGroup:o,getGroupOrLocalRef:function(t,o,a){if(null==l?void 0:l.value){const o=e.unref(l.value)[t];return e.computed({get:()=>null==o?void 0:o.value,set(e){o.value=e}})}const n=e.toRef(o,t);return e.computed({get:()=>n.value,set(e){a&&a(`update:${t}`,e)}})}}}(g),{id:r,iconPosition:i,icon:u,label:d,pressed:s}=e.toRefs(t),c=n("modelValue",t,l),p=n("toggle",t),v=n("unselectable",t),f=e.computed((()=>(null==o?void 0:o.value.multiple.value)??!1)),m=e.computed((()=>{let e=t.modifiers,l=null==o?void 0:o.value.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((()=>{var e;return Boolean(t.disabled||(null==(e=null==o?void 0:o.value)?void 0:e.disabled.value))}));return{group:o,isInGroup:a,modelValue:c,toggle:p,unselectable:v,multiple:f,modifiers:m,disabled:b,id:r,pressed:s,iconPosition:i,icon:u,label:d}}const Ne={key:1,class:"vv-button__label"},Ae={key:1,class:"vv-button__label"},De=e.defineComponent({name:"VvButton",props:Oe,emits:["update:modelValue"],setup(t,{expose:l,emit:o}){const a=t,n=e.useAttrs(),r=e.useSlots(),{id:u,modifiers:d,iconPosition:s,icon:c,label:p,modelValue:v,disabled:f,toggle:m,unselectable:b}=Ee(a,o),g=Q(u),y=e.computed((()=>(null==n?void 0:n.name)||g.value)),h=e.ref(null);l({$el:e.computed((()=>{var e;return null==(e=h.value)?void 0:e.$el}))});const k=e.computed((()=>m.value?Array.isArray(v.value)?ie(y.value,v.value):ae(y.value,v.value):a.pressed)),S=G("vv-button",d,e.computed((()=>({reverse:[i.right,i.bottom].includes(s.value),column:[i.top,i.bottom].includes(s.value),"icon-only":Boolean((null==c?void 0:c.value)&&!(null==p?void 0:p.value)&&!r.default)})))),B=e.computed((()=>"string"==typeof(null==c?void 0:c.value)?{name:null==c?void 0:c.value}:null==c?void 0:c.value)),V=e.computed((()=>void 0!==a.value?a.value:y.value)),x=()=>{if(m.value){if(Array.isArray(v.value))return ie(V.value,v.value)?void(b.value&&(v.value=v.value.filter((e=>e!==V.value)))):void v.value.push(V.value);if(V.value===v.value&&b.value)return void(v.value=a.uncheckedValue);v.value=V.value}};return(t,l)=>(e.openBlock(),e.createBlock(Ce,e.mergeProps({disabled:e.unref(f),pressed:e.unref(k),active:t.active,type:t.type,to:t.to,href:t.href,target:t.target,rel:t.rel,ariaLabel:t.ariaLabel},{id:e.unref(g),ref_key:"element",ref:h,class:e.unref(S),onClick:x}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[t.loading?e.renderSlot(t.$slots,"loading",{key:0},(()=>[t.loadingIcon?(e.openBlock(),e.createBlock(U,{key:0,class:"vv-button__loading-icon",name:t.loadingIcon},null,8,["name"])):e.createCommentVNode("",!0),t.loadingLabel?(e.openBlock(),e.createElementBlock("span",Ne,e.toDisplayString(t.loadingLabel),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(t.$slots,"before"),e.unref(c)?(e.openBlock(),e.createBlock(U,e.mergeProps({key:0,class:"vv-button__icon"},e.unref(B)),null,16)):e.createCommentVNode("",!0),e.unref(p)?(e.openBlock(),e.createElementBlock("span",Ae,[e.renderSlot(t.$slots,"label",{},(()=>[e.createTextVNode(e.toDisplayString(e.unref(p)),1)]))])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"after")],64))]))])),_:3},16,["id","class"]))}});const je=["id"],Re=["id","for"],ze=["id","aria-controls","placeholder"],Fe={key:0,class:"vv-select__input-before"},He={class:"vv-select__inner"},Ie=["aria-expanded","aria-labelledby","aria-describedby","aria-errormessage","tabindex"],Te={key:0,class:"vv-select__value"},Me=["aria-label","onClick"],qe={key:1,class:"vv-select__input-after"},Ke={name:"VvCombobox",components:{VvDropdown:Y,VvDropdownOption:te,VvDropdownOptgroup:oe,VvButton:De}};return e.defineComponent({...Ke,props:q,emits:["update:modelValue","change:search","focus","blur"],setup(t,{emit:l}){const o=t,n=e.useSlots(),r=function(t,l,o){const a=W(),n=e.computed((()=>{var e;if(a&&(null==(e=a.defaults.value)?void 0:e[t]))return a.defaults.value[t]}));return e.computed((()=>{if(void 0===n.value)return o;const e=n.value,t=l,a=o;return Object.keys(t).reduce(((l,o)=>{const n=a[o];if(l[o]=n,o in e){if(Array.isArray(t[o])){const a=t[o];a.length&&a[0]===n&&(l[o]=e[o])}if("function"==typeof t[o]&&(0,t[o])()===n&&(l[o]=e[o]),"object"==typeof t[o]){let a=t[o].default;"function"==typeof a&&(a=a()),"object"==typeof a?JSON.stringify(a)===JSON.stringify(n)&&(l[o]=e[o]):a===n&&(l[o]=e[o])}}return l}),{})}))}("VvCombobox",q,o),i=e=>"string"!=typeof e&&(e.options&&e.options.length>0),{HintSlot:u,hasHintLabelOrSlot:d,hasInvalidLabelOrSlot:s,hintSlotScope:c}=ce(o,n),p=e.ref(null),f=e.ref(null),m=e.ref(null),{focused:b}=ve(p,l),{focused:g}=a.useFocusWithin(m);e.watch(b,(e=>{o.autoOpen&&(!e||k.value?e||!k.value||g.value||V():B())})),e.watch(g,(e=>{b.value||e||!k.value||V()}));const y=e.ref(""),h=a.refDebounced(y,Number(o.debounceSearch));e.watch(h,(()=>l("change:search",h.value)));const k=e.ref(!1),S=()=>{o.disabled||o.readonly||(k.value=!k.value)},B=()=>{o.disabled||o.readonly||k.value||(k.value=!0)},V=()=>{o.disabled||o.readonly||!k.value||(k.value=!1)},x=()=>{j.value&&f.value&&f.value.focus({preventScroll:!0})},w=()=>{j.value&&(y.value="")},{id:L,icon:P,iconPosition:$,modifiers:_,disabled:C,readonly:O,loading:E,valid:N,invalid:A,floating:D,searchable:j}=e.toRefs(o),R=Q(L),z=e.computed((()=>`${R.value}-hint`)),F=e.computed((()=>`${R.value}-dropdown`)),H=e.computed((()=>`${R.value}-search`)),I=e.computed((()=>`${R.value}-label`)),T=e.ref(),{hasIcon:M,hasIconBefore:K,hasIconAfter:J}=fe(P,$),X=e.computed((()=>!ue(o.modelValue))),Z=e.computed((()=>C.value||O.value?-1:o.tabindex)),ee=G("vv-select",_,e.computed((()=>({disabled:C.value,loading:E.value,readonly:O.value,"icon-before":Boolean(K.value),"icon-after":Boolean(J.value),valid:N.value,invalid:A.value,dirty:X.value,focus:b.value,floating:D.value,badges:o.badges})))),{getOptionLabel:le,getOptionValue:ne,getOptionDisabled:re,getOptionGrouped:se}=me(o),pe=e.computed((()=>{var e;return null==(e=o.options)?void 0:e.filter((e=>le(e).toLowerCase().includes(h.value.toLowerCase().trim())))}));function be(e){return Array.isArray(o.modelValue)?ie(e,o.modelValue)||ie(ne(e),o.modelValue):ae(e,o.modelValue)||ae(ne(e),o.modelValue)}const ge=e.computed((()=>{let e=[];Array.isArray(o.modelValue)?e=o.modelValue:o.modelValue&&(e=[o.modelValue]);return o.options.reduce(((e,t)=>i(t)?[...e,...se(t)]:[...e,t]),[]).filter((t=>i(t)?se(t).some((t=>e.includes(ne(t)))):e.includes(ne(t))))})),ye=e.computed((()=>ge.value.map((e=>le(e))).join(o.separator))),he=()=>{o.autoOpen?B():S()},ke=e=>{var t;if(o.disabled||o.readonly)return;const a=ne(e);let n=a;if(o.multiple)if(Array.isArray(o.modelValue)){const e=Number(o.maxValues);if(void 0!==o.maxValues&&e>=0&&(null==(t=o.modelValue)?void 0:t.length)>=e&&!ie(a,o.modelValue))return;n=ie(a,o.modelValue)?de(a,o.modelValue):[...o.modelValue,a]}else n=[a];else o.keepOpen||V(),o.unselectable&&a===o.modelValue&&(n=void 0);l("update:modelValue",n)},Se=e.computed((()=>({id:R.value,name:o.name,tabindex:Z.value,valid:N.value,validLabel:r.value.validLabel,invalid:A.value,invalidLabel:r.value.invalidLabel,hintLabel:r.value.hintLabel,loading:E.value,loadingLabel:r.value.loadingLabel,disabled:C.value,readonly:O.value,modifiers:r.value.modifiers,options:r.value.options,labelKey:r.value.labelKey,valueKey:r.value.valueKey,icon:r.value.icon,iconPosition:r.value.iconPosition,floating:r.value.floating,unselectable:r.value.unselectable,multiple:r.value.multiple,label:r.value.label,placeholder:r.value.placeholder,modelValue:o.modelValue}))),Be=e.computed((()=>({id:F.value,reference:m.value,placement:r.value.placement,strategy:r.value.strategy,transitionName:r.value.transitionName,offset:r.value.offset,shift:r.value.shift,flip:r.value.flip,autoPlacement:r.value.autoPlacement,arrow:r.value.arrow,autofocusFirst:!!j.value||r.value.autofocusFirst,triggerWidth:r.value.triggerWidth,modifiers:r.value.dropdownModifiers}))),Ve=e.computed((()=>({valid:o.valid,invalid:o.invalid,modelValue:o.modelValue})));return a.onKeyStroke([" ","Enter"],(e=>{o.autoOpen||!k.value&&b.value&&(e.preventDefault(),e.stopImmediatePropagation(),S())}),{target:p}),(t,o)=>t.native?(e.openBlock(),e.createBlock(Le,e.mergeProps({key:1},e.unref(Se),{"onUpdate:modelValue":o[3]||(o[3]=e=>l("update:modelValue",e))}),null,16)):(e.openBlock(),e.createElementBlock("div",{key:0,id:e.unref(R),class:e.normalizeClass(e.unref(ee))},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,id:e.unref(I),for:e.unref(j)?e.unref(H):void 0},e.toDisplayString(t.label),9,Re)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"wrapperEl",ref:m,class:"vv-select__wrapper"},[e.createVNode(Y,e.mergeProps({ref_key:"dropdownEl",ref:T,modelValue:e.unref(k),"onUpdate:modelValue":o[2]||(o[2]=t=>e.isRef(k)?k.value=t:null)},e.unref(Be),{role:e.unref(v).listbox,onAfterExpand:x,onAfterCollapse:w}),e.createSlots({default:e.withCtx((({aria:l})=>[t.$slots.before?(e.openBlock(),e.createElementBlock("div",Fe,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(Ve))))])):e.createCommentVNode("",!0),e.createElementVNode("div",He,[e.unref(K)?(e.openBlock(),e.createBlock(U,e.mergeProps({key:0,class:"vv-select__icon"},e.unref(M)),null,16)):e.createCommentVNode("",!0),e.createElementVNode("div",e.mergeProps({ref_key:"inputEl",ref:p},l,{class:"vv-select__input",role:"combobox","aria-expanded":e.unref(k),"aria-labelledby":e.unref(I),"aria-describedby":e.unref(d)?e.unref(z):void 0,"aria-errormessage":e.unref(s)?e.unref(z):void 0,tabindex:e.unref(Z),onClickPassive:he}),[e.renderSlot(t.$slots,"value",e.normalizeProps(e.guardReactiveProps({selectedOptions:e.unref(ge),onInput:ke})),(()=>[e.unref(ye)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.badges?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(e.unref(ge),((l,o)=>(e.openBlock(),e.createBlock($e,{key:o,modifiers:t.badgeModifiers,class:"vv-select__badge"},{default:e.withCtx((()=>[e.createTextVNode(e.toDisplayString(e.unref(le)(l))+" ",1),!t.unselectable||e.unref(O)||e.unref(C)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,"aria-label":e.unref(r).deselectActionLabel,onClick:e.withModifiers((e=>ke(l)),["stop"])},[e.createVNode(U,{name:"close"})],8,Me))])),_:2},1032,["modifiers"])))),128)):(e.openBlock(),e.createElementBlock("div",Te,e.toDisplayString(e.unref(ye)),1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.placeholder),1)],64))]))],16,Ie),e.unref(J)?(e.openBlock(),e.createBlock(U,e.mergeProps({key:1,class:"vv-select__icon vv-select__icon-after"},e.unref(M)),null,16)):e.createCommentVNode("",!0)]),t.$slots.after?(e.openBlock(),e.createElementBlock("div",qe,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(Ve))))])):e.createCommentVNode("",!0)])),items:e.withCtx((()=>[e.unref(pe).length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(pe),((l,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:o},[i(l)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(oe,{label:e.unref(le)(l)},null,8,["label"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(se)(l),((o,a)=>(e.openBlock(),e.createBlock(te,e.mergeProps({disabled:e.unref(re)(o),selected:be(o),unselectable:t.unselectable,deselectHintLabel:e.unref(r).deselectHintLabel,selectHintLabel:e.unref(r).selectHintLabel,selectedHintLabel:e.unref(r).selectedHintLabel},{key:a,class:"vv-dropdown-option",onClickPassive:e=>ke(o)}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"option",e.normalizeProps(e.guardReactiveProps({option:l,selectedOptions:e.unref(ge),selected:be(o),disabled:e.unref(re)(o)})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(le)(o)),1)]))])),_:2},1040,["onClickPassive"])))),128))],64)):(e.openBlock(),e.createBlock(te,e.mergeProps({key:1},{disabled:e.unref(re)(l),selected:be(l),unselectable:t.unselectable,deselectHintLabel:e.unref(r).deselectHintLabel,selectHintLabel:e.unref(r).selectHintLabel,selectedHintLabel:e.unref(r).selectedHintLabel},{class:"vv-dropdown-option",onClickPassive:e=>ke(l)}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"option",e.normalizeProps(e.guardReactiveProps({option:l,selectedOptions:e.unref(ge),selected:be(l),disabled:e.unref(re)(l)})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(le)(l)),1)]))])),_:2},1040,["onClickPassive"]))],64)))),128)):t.options.length?(e.openBlock(),e.createBlock(te,{key:2,modifiers:"inert"},{default:e.withCtx((()=>[e.renderSlot(t.$slots,"no-results",{},(()=>[e.createTextVNode(e.toDisplayString(e.unref(r).noResultsLabel),1)]))])),_:3})):(e.openBlock(),e.createBlock(te,{key:1,modifiers:"inert"},{default:e.withCtx((()=>[e.renderSlot(t.$slots,"no-options",{},(()=>[e.createTextVNode(e.toDisplayString(e.unref(r).noOptionsLabel),1)]))])),_:3}))])),after:e.withCtx((()=>[e.renderSlot(t.$slots,"dropdown::after",{},(()=>{var t;return[(null==(t=e.unref(T))?void 0:t.customPosition)?(e.openBlock(),e.createBlock(De,{key:0,label:e.unref(r).closeLabel,modifiers:"secondary",onClick:o[1]||(o[1]=t=>e.unref(T).hide())},null,8,["label"])):e.createCommentVNode("",!0)]}))])),_:2},[e.unref(j)||t.$slots["dropdown::before"]?{name:"before",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"dropdown::before"),e.unref(j)?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,id:e.unref(H),ref_key:"inputSearchEl",ref:f,"onUpdate:modelValue":o[0]||(o[0]=t=>e.isRef(y)?y.value=t:null),"aria-autocomplete":"list","aria-controls":e.unref(F),autocomplete:"off",spellcheck:"false",type:"search",class:"vv-dropdown__search",placeholder:e.unref(r).searchPlaceholder},null,8,ze)),[[e.vModelText,e.unref(y)]]):e.createCommentVNode("",!0)])),key:"0"}:void 0]),1040,["modelValue","role"])],512),e.createVNode(e.unref(u),{id:e.unref(z),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(c))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(c))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(c))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(c))))])),key:"3"}:void 0]),1032,["id"])],10,je))}})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@iconify/vue"),require("@floating-ui/vue"),require("nanoid"),require("@vueuse/core"),require("mitt"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","@floating-ui/vue","nanoid","@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.nanoid,e.core,e.mitt,e.tsDotProp)}(this,(function(e,t,l,o,a,n,r){"use strict";var i=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(i||{}),u=(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))(u||{}),d=(e=>(e.before="before",e.after="after",e))(d||{}),s=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(s||{}),c=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(c||{}),p=(e=>(e.button="button",e.link="link",e.menuitem="menuitem",e))(p||{}),v=(e=>(e.listbox="listbox",e.menu="menu",e))(v||{}),f=(e=>(e.option="option",e.presentation="presentation",e))(f||{}),m=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(m||{});const b=Symbol.for("volver"),g=Symbol.for("buttonGroup"),y=Symbol.for("dropdownTrigger"),h=Symbol.for("dropdownItem"),k=Symbol.for("dropdownAction"),S={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(m).includes(e)},rel:{type:String,default:"noopener noreferrer"}},B={valid:Boolean,validLabel:[String,Array]},V={invalid:Boolean,invalidLabel:[String,Array]},x={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},w={disabled:Boolean},L={selected:Boolean},P={active:Boolean},$={pressed:Boolean},_={label:[String,Number]},C={readonly:Boolean},O={modifiers:[String,Array]},E={hintLabel:{type:String,default:""}},N={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},A={icon:{type:[String,Object]},iconPosition:{type:String,default:d.before,validation:e=>Object.values(d).includes(e)}},D={tabindex:{type:[String,Number],default:0}},j={floating:Boolean},R={unselectable:{type:Boolean,default:!0}},z={id:[String,Number]},F={placement:{type:String,default:i.bottom,validator:e=>Object.values(i).includes(e)||Object.values(u).includes(e)},strategy:{type:String,default:"absolute",validator:e=>["fixed","absolute"].includes(e)},transitionName:{type:String},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}},H={...z,name:{type:String,required:!0}},I={autofocus:Boolean},T={autocomplete:{type:String,default:"off"}},M={...w,..._,...$,...P,...S,type:{type:String,default:s.button,validator:e=>Object.values(s).includes(e)},ariaLabel:{type:String,default:void 0}},q={...H,...D,...B,...V,...E,...x,...w,...C,...O,...N,...A,...j,...R,...F,..._,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"},closeLabel:{type:String,default:"Close"},placeholder:String,searchable:Boolean,searchPlaceholder:{type:String,default:"Search..."},debounceSearch:{type:[Number,String],default:0},multiple:Boolean,maxValues:[Number,String],separator:{type:String,default:", "},native:Boolean,badges:Boolean,badgeModifiers:{type:[String,Array],default:"action sm"},triggerWidth:{...F.triggerWidth,default:!0},dropdownModifiers:{type:[String,Array],default:"mobile"},autoOpen:{type:Boolean,default:!1},keepOpen:{type:Boolean,default:!1}},K={color:String,width:{type:[String,Number]},height:{type:[String,Number]},name:{type:String,required:!0},provider:{type:String},prefix:{type:String,default:"normal"},src:String,horizontalFlip:Boolean,verticalFlip:Boolean,flip:String,mode:String,inline:Boolean,rotate:[Number,String],onLoad:Function,svg:String,modifiers:{type:[String,Array]}};function W(){return e.inject(b)}function G(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 U=e.defineComponent({name:"VvIcon",props:K,setup(l){const o=l,a=e.computed((()=>"string"==typeof o.rotate?parseFloat(o.rotate):o.rotate)),n=e.ref(!0),r=W(),{modifiers:i}=e.toRefs(o),u=G("vv-icon",i),d=e.computed((()=>o.provider||(null==r?void 0:r.iconsProvider))),s=e.computed((()=>{const e=o.name??"",l=`@${d.value}:${o.prefix}:${e}`;if(t.iconExists(l))return l;const a=null==r?void 0:r.iconsCollections.find((l=>{const o=`@${d.value}:${l.prefix}:${e}`;return t.iconExists(o)}));return a?`@${d.value}:${a.prefix}:${e}`:e}));function c(e){const l=function(e){let t;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");t=(new e).window}return(t?new t.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),a=(null==l?void 0:l.innerHTML.trim())||"";l&&a&&t.addIcon(`@${d.value}:${o.prefix}:${o.name}`,{body:a,height:l.viewBox.baseVal.height,width:l.viewBox.baseVal.width})}return r&&o.src&&!t.iconExists(`@${d.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,onLoad:l.onLoad,icon:e.unref(s)}),null,16,["class"])):e.createCommentVNode("",!0)}}),J={...z,...F,...O,modelValue:{type:Boolean,default:void 0},reference:{type:Object,default:null},role:{type:String,default:v.menu,validator:e=>Object.values(v).includes(e)}},Q=t=>e.computed((()=>String((null==t?void 0:t.value)||o.nanoid())));const X=["id","tabindex","role","aria-labelledby"],Y=e.defineComponent({name:"VvDropdown",inheritAttrs:!1,props:J,emits:["update:modelValue","beforeExpand","beforeCollapse","afterExpand","afterCollapse","before-enter","after-leave","enter","after-enter","enter-cancelled","before-leave","leave","leave-cancelled"],setup(t,{expose:o,emit:r}){const i=t,{id:u}=e.toRefs(i),d=Q(u),s=e.useAttrs(),c=e.ref("auto"),p=e.ref("auto"),m=e.ref(null),b=e.ref(),g=e.ref(null),k=e.ref(null),S=e.computed({get:()=>i.reference??m.value,set:e=>{m.value=e}}),B=e.ref(!1);e.onMounted((()=>{a.useMutationObserver(b.value,(()=>{var e;B.value="true"===(null==(e=window.getComputedStyle(b.value).getPropertyValue("--dropdown-custom-position"))?void 0:e.trim())}),{attributeFilter:["style"],window:window})}));const V=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()):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})=>{c.value=`${e}px`,p.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:g})),e})),{x:x,y:w,strategy:L,middlewareData:P,placement:$}=l.useFloating(S,b,{whileElementsMounted:(...e)=>l.autoUpdate(...e,{animationFrame:"fixed"===i.strategy}),placement:e.computed((()=>i.placement)),strategy:e.computed((()=>i.strategy)),middleware:V}),_=e.computed((()=>{if(!B.value)return{position:L.value,top:`${w.value??0}px`,left:`${x.value??0}px`,maxWidth:c.value,maxHeight:p.value,width:i.triggerWidth&&S.value?`${S.value.offsetWidth}px`:void 0}})),C=e.computed((()=>$.value.split("-")[0])),O=e.computed((()=>{var e,t,l,o,a;if(B.value)return;const n={top:"bottom",right:"left",bottom:"top",left:"right"}[C.value];return{left:void 0!==(null==(e=P.value.arrow)?void 0:e.x)?`${null==(t=P.value.arrow)?void 0:t.x}px`:void 0,top:void 0!==(null==(l=P.value.arrow)?void 0:l.y)?`${null==(o=P.value.arrow)?void 0:o.y}px`:void 0,[n]:-((null==(a=g.value)?void 0:a.offsetWidth)??0)/2+"px"}})),E=a.useVModel(i,"modelValue",r),N=e.ref(!1),A=e.computed({get:()=>E.value??N.value,set:e=>{void 0!==E.value?E.value=e:N.value=e}}),D=()=>{A.value=!0},j=()=>{A.value=!1},R=()=>{A.value=!A.value},z=e=>{S.value=e};o({toggle:R,show:D,hide:j,init:z,customPosition:B}),e.watch(A,(t=>{t&&i.autofocusFirst&&e.nextTick((()=>{const e=J(b.value);e.length>0&&e[0].focus({preventScroll:!0})}))})),a.onClickOutside(b,(()=>{!i.keepOpen&&A.value&&(A.value=!1)}),{ignore:[S]});const F=e.computed((()=>{var e,t;return(null==(t=null==(e=S.value)?void 0:e.getAttribute)?void 0:t.call(e,"id"))??void 0})),H=e.computed((()=>({"aria-controls":d.value,"aria-haspopup":!0,"aria-expanded":A.value}))),{component:I,bus:T}=function({reference:t,id:l,expanded:o,aria:a}){const r=n(),i=e.defineComponent({name:"VvDropdownTriggerProvider",setup(){e.provide(y,{reference:t,id:l,expanded:o,aria:a,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:S,id:d,expanded:A,aria:H});T.on("click",R);const{role:M,modifiers:q}=e.toRefs(i),{itemRole:K}=function({role:t,expanded:l}){const o=e.computed((()=>t.value===v.listbox?f.option:f.presentation));return e.provide(h,{role:o,expanded:l}),{itemRole:o}}({role:M,expanded:A}),W=G("vv-dropdown",q,e.computed((()=>({arrow:i.arrow})))),{focused:U}=a.useFocusWithin(b);function J(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"))):[]}a.onKeyStroke("Escape",(e=>{A.value&&(e.preventDefault(),j())})),a.onKeyStroke("ArrowDown",(t=>{A.value&&U.value&&(t.preventDefault(),e.nextTick((()=>{if(U.value){const e=J(b.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})}})))})),a.onKeyStroke("ArrowUp",(t=>{A.value&&U.value&&(t.preventDefault(),e.nextTick((()=>{if(U.value){const e=J(b.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})}})))})),a.onKeyStroke([" ","Enter"],(e=>{const t=e.target;A.value&&U.value&&t&&(null==t||t.click())}));const Y={"before-enter":()=>{r(A.value?"beforeExpand":"beforeCollapse"),r("before-enter")},"after-leave":()=>{r(A.value?"afterExpand":"afterCollapse"),r("after-leave")},enter:()=>{r("enter")},"after-enter":()=>{r("after-enter")},"enter-cancelled":()=>{r("enter-cancelled")},"before-leave":()=>{r("before-leave")},leave:()=>{r("leave")},"leave-cancelled":()=>{r("leave-cancelled")}};return(t,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(I),null,{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps({init:z,show:D,hide:j,toggle:R,expanded:e.unref(A),aria:e.unref(H)})))])),_:3}),e.createVNode(e.Transition,e.mergeProps({name:t.transitionName},e.toHandlers(Y)),{default:e.withCtx((()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"floatingEl",ref:b,style:e.normalizeStyle(e.unref(_)),class:e.normalizeClass(e.unref(W))},[i.arrow?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"arrowEl",ref:g,style:e.normalizeStyle(e.unref(O)),class:"vv-dropdown__arrow"},null,4)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps({expanded:e.unref(A)}))),e.createElementVNode("div",e.mergeProps(e.unref(s),{id:e.unref(d),ref_key:"listEl",ref:k,tabindex:e.unref(A)?void 0:-1,role:e.unref(M),"aria-labelledby":e.unref(F),class:"vv-dropdown__list"}),[e.renderSlot(t.$slots,"items",e.normalizeProps(e.guardReactiveProps({role:e.unref(K)})))],16,X),e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps({expanded:e.unref(A)})))],6),[[e.vShow,e.unref(A)]])])),_:3},16,["name"])],64))}});const Z=e.defineComponent({name:"VvDropdownItem",setup(t){const{role:l,expanded:o}=e.inject(h,{}),n=e.ref(null);!function({expanded:t}){e.provide(k,{role:e.ref(p.menuitem),expanded:t})}({expanded:o});const r=a.useElementHover(n),{focused:i}=a.useFocus(n),{focused:u}=a.useFocusWithin(n);return e.watch(r,(e=>{e&&(i.value=!0)})),(t,o)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({role:e.unref(l)},{ref_key:"element",ref:n,class:["vv-dropdown__item",{"focus-visible":e.unref(i)||e.unref(u)}]}),[e.renderSlot(t.$slots,"default")],16))}}),ee=["title"],te=e.defineComponent({name:"VvDropdownOption",props:{...w,...L,...R,...O,deselectHintLabel:{type:String},selectHintLabel:{type:String},selectedHintLabel:{type:String}},setup(t){const l=t,{modifiers:o}=e.toRefs(l),a=G("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?void 0:l.selectHintLabel));return(t,l)=>(e.openBlock(),e.createBlock(Z,{class:e.normalizeClass(e.unref(a)),tabindex:t.disabled?-1:0,"aria-selected":t.selected,"aria-disabled":t.disabled},{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,ee)])),_:3},8,["class","tabindex","aria-selected","aria-disabled"]))}}),le={class:"vv-dropdown-optgroup",role:"presentation",tabindex:"-1"},oe=e.defineComponent({name:"VvDropdownOptgroup",props:{..._},setup(t){const l=t;return(t,o)=>(e.openBlock(),e.createElementBlock("li",le,e.toDisplayString(l.label),1))}});function ae(e,t,l){return l?re(e,l)===re(t,l):ne(e,t)}function ne(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(!ne(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 d=e instanceof RegExp,s=t instanceof RegExp;if(d!=s)return!1;if(d&&s)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],!ne(e[r],t[r]))return!1;return!0}return e!=e&&t!=t}function re(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const l=t.split(".");let o=e;for(let t=0,a=l.length;t<a;++t){if(null==e)return null;o=o[l[t]]}return o}}return null}function ie(e,t){if(null!=e&&t&&t.length)for(const l of t)if(ae(e,l))return!0;return!1}function ue(t){return null==(l=e.unref(t))||""===l||Array.isArray(l)&&0===l.length||!(l instanceof Date)&&"object"==typeof l&&0===Object.keys(l).length;var l}function de(e,t){const l=function(e,t){let l=-1;if(t)for(let o=0;o<t.length;o++)if(ae(t[o],e)){l=o;break}return l}(e,t);return l>-1?t.filter(((e,t)=>t!==l)):t}function se(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}function ce(t,l){const o=e.unref(t),a=e.computed((()=>se(o.invalidLabel))),n=e.computed((()=>se(o.validLabel))),r=e.computed((()=>o.loadingLabel)),i=e.computed((()=>o.hintLabel)),u=e.computed((()=>Boolean(o.loading&&(l.loading||r.value)))),d=e.computed((()=>!u.value&&Boolean(o.invalid&&(l.invalid||a.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(o.valid&&(l.valid||n.value)))),c=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(l.hint||i.value))),p=e.computed((()=>d.value||s.value||u.value||c.value)),v=e.computed((()=>({modelValue:o.modelValue,valid:o.valid,invalid:o.invalid,loading:o.loading}))),f=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:p,invalidLabel:a,validLabel:n,loadingLabel:r,hintLabel:i,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:c}),render(){var t,l,o,a,n,r,i,u;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(l=(t=this.$slots).loading)?void 0:l.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(a=(o=this.$slots).invalid)?void 0:a.call(o))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(r=(n=this.$slots).valid)?void 0:r.call(n))??this.validLabel):e.h(this.tag,{role:d},(null==(u=(i=this.$slots).hint)?void 0:u.call(i))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:d,hasHintLabelOrSlot:c,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:v,HintSlot:f}}const pe={...H,...I,...T,...D,...B,...V,...E,...x,...w,...C,...O,...N,...A,...j,...R,..._,multiple:Boolean,required:Boolean,size:[String,Number],modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},placeholder:String};function ve(t,l,o){const a=W(),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 fe(t,l){const{focused:o}=a.useFocus(t);return e.watch(o,(o=>{l(o?"focus":"blur",e.unref(t))})),{focused:o}}function me(t,l){const o=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===d.before))),a=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===d.after))),n=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===i.left))),r=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===i.right))),u=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===i.top))),s=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===i.bottom)));return{hasIcon:e.computed((()=>"string"==typeof(null==t?void 0:t.value)?{name:null==t?void 0:t.value}:null==t?void 0:t.value)),hasIconLeft:n,hasIconRight:r,hasIconTop:u,hasIconBottom:s,hasIconBefore:o,hasIconAfter:a}}function be(t){const{options:l,labelKey:o,valueKey:a,disabledKey:n}=e.toRefs(t);return{options:l,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof o.value?o.value(e):r.get(e,o.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof a.value?a.value(e):r.get(e,a.value),getOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof n.value?n.value(e):r.get(e,n.value)),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}const ge=["for"],ye={class:"vv-select__wrapper"},he={key:0,class:"vv-select__input-before"},ke={class:"vv-select__inner"},Se=["id"],Be=["disabled","hidden"],Ve=["disabled","value"],xe=["disabled","label"],we=["disabled","value"],Le={key:1,class:"vv-select__input-after"},Pe=e.defineComponent({name:"VvSelect",props:pe,emits:["update:modelValue","focus","blur"],setup(t,{emit:l}){const o=t,n=e.useSlots(),r=ve("VvSelect",pe,o),i=e.ref(),{HintSlot:u,hasHintLabelOrSlot:d,hasInvalidLabelOrSlot:s,hintSlotScope:c}=ce(r,n),{id:p,modifiers:v,disabled:f,readonly:m,loading:b,icon:g,iconPosition:y,invalid:h,valid:k,floating:S,multiple:B}=e.toRefs(o),V=Q(p),x=e.computed((()=>`${V.value}-hint`)),{focused:w}=fe(i,l),L=a.useElementVisibility(i);e.watch(L,(e=>{e&&o.autofocus&&(w.value=!0)}));const{hasIcon:P,hasIconBefore:$,hasIconAfter:_}=me(g,y),C=e.computed((()=>!ue(o.modelValue))),O=e.computed((()=>o.disabled||o.readonly)),E=e.computed((()=>O.value?-1:o.tabindex)),N=e.computed((()=>!0===o.invalid||!0!==o.valid&&void 0)),A=G("vv-select",v,e.computed((()=>({valid:k.value,invalid:h.value,loading:b.value,disabled:f.value,readonly:m.value,"icon-before":$.value,"icon-after":_.value,dirty:C.value,focus:w.value,floating:S.value,multiple:B.value})))),D=e.computed((()=>({name:o.name,tabindex:E.value,disabled:O.value,required:o.required,size:o.size,autocomplete:o.autocomplete,multiple:o.multiple,"aria-invalid":N.value,"aria-describedby":d.value?x.value:void 0,"aria-errormessage":s.value?x.value:void 0}))),j=e.computed((()=>({valid:o.valid,invalid:o.invalid,modelValue:o.modelValue}))),{getOptionLabel:R,getOptionValue:z,getOptionDisabled:F,getOptionGrouped:H}=be(o),I=e.computed({get:()=>o.modelValue,set:e=>{Array.isArray(e)&&(e=e.filter((e=>void 0!==e))),l("update:modelValue",e)}}),T=e=>"string"!=typeof e&&(e&&e.options&&e.options.length>0);return(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(A))},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(V)},e.toDisplayString(t.label),9,ge)):e.createCommentVNode("",!0),e.createElementVNode("div",ye,[t.$slots.before?(e.openBlock(),e.createElementBlock("div",he,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(j))))])):e.createCommentVNode("",!0),e.createElementVNode("div",ke,[e.unref($)?(e.openBlock(),e.createBlock(U,e.mergeProps({key:0,class:"vv-select__icon"},e.unref(P)),null,16)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("select",e.mergeProps({id:e.unref(V),ref_key:"select",ref:i,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(I)?I.value=t:null)},e.unref(D)),[t.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,value:void 0,disabled:!t.unselectable,hidden:!t.unselectable},e.toDisplayString(t.placeholder),9,Be)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,((t,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[T(t)?(e.openBlock(),e.createElementBlock("optgroup",{key:`group-${l}`,disabled:e.unref(F)(t),label:e.unref(R)(t)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(H)(t),((t,o)=>(e.openBlock(),e.createElementBlock("option",{key:`group-${l}-item-${o}`,disabled:e.unref(F)(t),value:e.unref(z)(t)},e.toDisplayString(e.unref(R)(t)),9,we)))),128))],8,xe)):(e.openBlock(),e.createElementBlock("option",{key:l,disabled:e.unref(F)(t),value:e.unref(z)(t)},e.toDisplayString(e.unref(R)(t)),9,Ve))],64)))),256))],16,Se),[[e.vModelSelect,e.unref(I)]]),e.unref(_)?(e.openBlock(),e.createBlock(U,e.mergeProps({key:1,class:"vv-select__icon vv-select__icon-after"},e.unref(P)),null,16)):e.createCommentVNode("",!0)]),t.$slots.after?(e.openBlock(),e.createElementBlock("div",Le,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(j))))])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(u),{id:e.unref(x),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(c))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(c))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(c))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(c))))])),key:"3"}:void 0]),1032,["id"])],2))}}),$e={...O,value:[String,Number]},_e=e.defineComponent({name:"VvBadge",props:$e,setup(t){const l=t,{modifiers:o}=e.toRefs(l),a=G("vv-badge",o);return(t,l)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(a)),role:"status"},[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.value),1)]))],2))}}),Ce=M,Oe=e.defineComponent({name:"VvAction",props:Ce,emits:["click","mouseover","mouseleave"],setup(t,{expose:l,emit:o}){const a=t,n=W(),r=e.ref(null);l({$el:r});const{reference:i,bus:u,aria:d,expanded:s}=e.inject(y,{});e.watch((()=>r.value),(e=>{i&&(i.value=e)}));const p=e.computed((()=>a.pressed||(null==s?void 0:s.value))),{role:v}=e.inject(k,{}),f=e.computed((()=>{switch(!0){case a.disabled:return c.button;case void 0!==a.to:return(null==n?void 0:n.nuxt)?c.nuxtLink:c.routerLink;case void 0!==a.href:return c.a;default:return c.button}})),m=e.computed((()=>{const e={...null==d?void 0:d.value,ariaPressed:!!p.value||void 0,ariaLabel:a.ariaLabel,role:null==v?void 0:v.value};switch(f.value){case c.a:return{...e,href:a.href,target:a.target,rel:a.rel};case c.routerLink:case c.nuxtLink:return{...e,to:a.to,target:a.target};default:return{...e,type:a.type,disabled:a.disabled}}})),b=e=>{a.disabled?e.preventDefault():(null==u||u.emit("click",e),o("click",e))},g=e=>{null==u||u.emit("mouseover",e),o("mouseover",e)},h=e=>{null==u||u.emit("mouseleave",e),o("mouseleave",e)};return(t,l)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(f)),e.mergeProps(e.unref(m),{ref_key:"element",ref:r,class:{active:t.active,pressed:e.unref(p),disabled:t.disabled},onClickPassive:b,onMouseoverPassive:g,onMouseleavePassive:h}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}});const Ee={...M,...z,...O,...R,...x,icon:[String,Object],iconPosition:{type:String,default:i.left,validator:e=>Object.values(i).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 Ne(t,l){const{group:o,isInGroup:a,getGroupOrLocalRef:n}=function(t){const l=e.inject(t,void 0),o=e.computed((()=>!ue(l)));return{group:l,isInGroup:o,getGroupOrLocalRef:function(t,o,a){if(null==l?void 0:l.value){const o=e.unref(l.value)[t];return e.computed({get:()=>null==o?void 0:o.value,set(e){o.value=e}})}const n=e.toRef(o,t);return e.computed({get:()=>n.value,set(e){a&&a(`update:${t}`,e)}})}}}(g),{id:r,iconPosition:i,icon:u,label:d,pressed:s}=e.toRefs(t),c=n("modelValue",t,l),p=n("toggle",t),v=n("unselectable",t),f=e.computed((()=>(null==o?void 0:o.value.multiple.value)??!1)),m=e.computed((()=>{let e=t.modifiers,l=null==o?void 0:o.value.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((()=>{var e;return Boolean(t.disabled||(null==(e=null==o?void 0:o.value)?void 0:e.disabled.value))}));return{group:o,isInGroup:a,modelValue:c,toggle:p,unselectable:v,multiple:f,modifiers:m,disabled:b,id:r,pressed:s,iconPosition:i,icon:u,label:d}}const Ae={key:1,class:"vv-button__label"},De={key:1,class:"vv-button__label"},je=e.defineComponent({name:"VvButton",props:Ee,emits:["update:modelValue"],setup(t,{expose:l,emit:o}){const a=t,n=e.useAttrs(),r=e.useSlots(),{id:u,modifiers:d,iconPosition:s,icon:c,label:p,modelValue:v,disabled:f,toggle:m,unselectable:b}=Ne(a,o),g=Q(u),y=e.computed((()=>(null==n?void 0:n.name)||g.value)),h=e.ref(null);l({$el:e.computed((()=>{var e;return null==(e=h.value)?void 0:e.$el}))});const k=e.computed((()=>m.value?Array.isArray(v.value)?ie(y.value,v.value):ae(y.value,v.value):a.pressed)),S=G("vv-button",d,e.computed((()=>({reverse:[i.right,i.bottom].includes(s.value),column:[i.top,i.bottom].includes(s.value),"icon-only":Boolean((null==c?void 0:c.value)&&!(null==p?void 0:p.value)&&!r.default)})))),B=e.computed((()=>"string"==typeof(null==c?void 0:c.value)?{name:null==c?void 0:c.value}:null==c?void 0:c.value)),V=e.computed((()=>void 0!==a.value?a.value:y.value)),x=()=>{if(m.value){if(Array.isArray(v.value))return ie(V.value,v.value)?void(b.value&&(v.value=v.value.filter((e=>e!==V.value)))):void v.value.push(V.value);if(V.value===v.value&&b.value)return void(v.value=a.uncheckedValue);v.value=V.value}};return(t,l)=>(e.openBlock(),e.createBlock(Oe,e.mergeProps({disabled:e.unref(f),pressed:e.unref(k),active:t.active,type:t.type,to:t.to,href:t.href,target:t.target,rel:t.rel,ariaLabel:t.ariaLabel},{id:e.unref(g),ref_key:"element",ref:h,class:e.unref(S),onClick:x}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[t.loading?e.renderSlot(t.$slots,"loading",{key:0},(()=>[t.loadingIcon?(e.openBlock(),e.createBlock(U,{key:0,class:"vv-button__loading-icon",name:t.loadingIcon},null,8,["name"])):e.createCommentVNode("",!0),t.loadingLabel?(e.openBlock(),e.createElementBlock("span",Ae,e.toDisplayString(t.loadingLabel),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(t.$slots,"before"),e.unref(c)?(e.openBlock(),e.createBlock(U,e.mergeProps({key:0,class:"vv-button__icon"},e.unref(B)),null,16)):e.createCommentVNode("",!0),e.unref(p)?(e.openBlock(),e.createElementBlock("span",De,[e.renderSlot(t.$slots,"label",{},(()=>[e.createTextVNode(e.toDisplayString(e.unref(p)),1)]))])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"after")],64))]))])),_:3},16,["id","class"]))}}),Re=["id"],ze=["id","for"],Fe=["id","aria-controls","placeholder"],He={key:0,class:"vv-select__input-before"},Ie={class:"vv-select__inner"},Te=["aria-expanded","aria-labelledby","aria-describedby","aria-errormessage","tabindex"],Me={key:0,class:"vv-select__value"},qe=["aria-label","onClick"],Ke={key:1,class:"vv-select__input-after"},We={name:"VvCombobox",components:{VvDropdown:Y,VvDropdownOption:te,VvDropdownOptgroup:oe,VvButton:je}};return e.defineComponent({...We,props:q,emits:["update:modelValue","change:search","focus","blur"],setup(t,{emit:l}){const o=t,n=e.useSlots(),r=ve("VvCombobox",q,o),i=e=>"string"!=typeof e&&(e.options&&e.options.length>0),{HintSlot:u,hasHintLabelOrSlot:d,hasInvalidLabelOrSlot:s,hintSlotScope:c}=ce(r,n),p=e.ref(null),f=e.ref(null),m=e.ref(null),{focused:b}=fe(p,l),{focused:g}=a.useFocusWithin(m);e.watch(b,(e=>{o.autoOpen&&(!e||k.value?e||!k.value||g.value||V():B())})),e.watch(g,(e=>{b.value||e||!k.value||V()}));const y=e.ref(""),h=a.refDebounced(y,Number(o.debounceSearch));e.watch(h,(()=>l("change:search",h.value)));const k=e.ref(!1),S=()=>{o.disabled||o.readonly||(k.value=!k.value)},B=()=>{o.disabled||o.readonly||k.value||(k.value=!0)},V=()=>{o.disabled||o.readonly||!k.value||(k.value=!1)},x=()=>{j.value&&f.value&&f.value.focus({preventScroll:!0})},w=()=>{j.value&&(y.value="")},{id:L,icon:P,iconPosition:$,modifiers:_,disabled:C,readonly:O,loading:E,valid:N,invalid:A,floating:D,searchable:j}=e.toRefs(o),R=Q(L),z=e.computed((()=>`${R.value}-hint`)),F=e.computed((()=>`${R.value}-dropdown`)),H=e.computed((()=>`${R.value}-search`)),I=e.computed((()=>`${R.value}-label`)),T=e.ref(),{hasIcon:M,hasIconBefore:K,hasIconAfter:W}=me(P,$),J=e.computed((()=>!ue(o.modelValue))),X=e.computed((()=>C.value||O.value?-1:o.tabindex)),Z=G("vv-select",_,e.computed((()=>({disabled:C.value,loading:E.value,readonly:O.value,"icon-before":Boolean(K.value),"icon-after":Boolean(W.value),valid:N.value,invalid:A.value,dirty:J.value,focus:b.value,floating:D.value,badges:o.badges})))),{getOptionLabel:ee,getOptionValue:le,getOptionDisabled:ne,getOptionGrouped:re}=be(o),se=e.computed((()=>{var e;return null==(e=o.options)?void 0:e.filter((e=>ee(e).toLowerCase().includes(h.value.toLowerCase().trim())))}));function pe(e){return Array.isArray(o.modelValue)?ie(e,o.modelValue)||ie(le(e),o.modelValue):ae(e,o.modelValue)||ae(le(e),o.modelValue)}const ge=e.computed((()=>{let e=[];Array.isArray(o.modelValue)?e=o.modelValue:o.modelValue&&(e=[o.modelValue]);return o.options.reduce(((e,t)=>i(t)?[...e,...re(t)]:[...e,t]),[]).filter((t=>i(t)?re(t).some((t=>e.includes(le(t)))):e.includes(le(t))))})),ye=e.computed((()=>ge.value.map((e=>ee(e))).join(o.separator))),he=()=>{o.autoOpen?B():S()},ke=e=>{var t;if(o.disabled||o.readonly)return;const a=le(e);let n=a;if(o.multiple)if(Array.isArray(o.modelValue)){const e=Number(o.maxValues);if(void 0!==o.maxValues&&e>=0&&(null==(t=o.modelValue)?void 0:t.length)>=e&&!ie(a,o.modelValue))return;n=ie(a,o.modelValue)?de(a,o.modelValue):[...o.modelValue,a]}else n=[a];else o.keepOpen||V(),o.unselectable&&a===o.modelValue&&(n=void 0);l("update:modelValue",n)},Se=e.computed((()=>({id:R.value,name:o.name,tabindex:X.value,valid:N.value,validLabel:r.value.validLabel,invalid:A.value,invalidLabel:r.value.invalidLabel,hintLabel:r.value.hintLabel,loading:E.value,loadingLabel:r.value.loadingLabel,disabled:C.value,readonly:O.value,modifiers:r.value.modifiers,options:r.value.options,labelKey:r.value.labelKey,valueKey:r.value.valueKey,icon:r.value.icon,iconPosition:r.value.iconPosition,floating:r.value.floating,unselectable:r.value.unselectable,multiple:r.value.multiple,label:r.value.label,placeholder:r.value.placeholder,modelValue:o.modelValue}))),Be=e.computed((()=>({id:F.value,reference:m.value,placement:r.value.placement,strategy:r.value.strategy,transitionName:r.value.transitionName,offset:r.value.offset,shift:r.value.shift,flip:r.value.flip,autoPlacement:r.value.autoPlacement,arrow:r.value.arrow,autofocusFirst:!!j.value||r.value.autofocusFirst,triggerWidth:r.value.triggerWidth,modifiers:r.value.dropdownModifiers}))),Ve=e.computed((()=>({valid:o.valid,invalid:o.invalid,modelValue:o.modelValue})));return a.onKeyStroke([" ","Enter"],(e=>{o.autoOpen||!k.value&&b.value&&(e.preventDefault(),e.stopImmediatePropagation(),S())}),{target:p}),(t,o)=>t.native?(e.openBlock(),e.createBlock(Pe,e.mergeProps({key:1},e.unref(Se),{"onUpdate:modelValue":o[3]||(o[3]=e=>l("update:modelValue",e))}),null,16)):(e.openBlock(),e.createElementBlock("div",{key:0,id:e.unref(R),class:e.normalizeClass(e.unref(Z))},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,id:e.unref(I),for:e.unref(j)?e.unref(H):void 0},e.toDisplayString(t.label),9,ze)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"wrapperEl",ref:m,class:"vv-select__wrapper"},[e.createVNode(Y,e.mergeProps({ref_key:"dropdownEl",ref:T,modelValue:e.unref(k),"onUpdate:modelValue":o[2]||(o[2]=t=>e.isRef(k)?k.value=t:null)},e.unref(Be),{role:e.unref(v).listbox,onAfterExpand:x,onAfterCollapse:w}),e.createSlots({default:e.withCtx((({aria:l})=>[t.$slots.before?(e.openBlock(),e.createElementBlock("div",He,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(Ve))))])):e.createCommentVNode("",!0),e.createElementVNode("div",Ie,[e.unref(K)?(e.openBlock(),e.createBlock(U,e.mergeProps({key:0,class:"vv-select__icon"},e.unref(M)),null,16)):e.createCommentVNode("",!0),e.createElementVNode("div",e.mergeProps({ref_key:"inputEl",ref:p},l,{class:"vv-select__input",role:"combobox","aria-expanded":e.unref(k),"aria-labelledby":e.unref(I),"aria-describedby":e.unref(d)?e.unref(z):void 0,"aria-errormessage":e.unref(s)?e.unref(z):void 0,tabindex:e.unref(X),onClickPassive:he}),[e.renderSlot(t.$slots,"value",e.normalizeProps(e.guardReactiveProps({selectedOptions:e.unref(ge),onInput:ke})),(()=>[e.unref(ye)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.badges?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(e.unref(ge),((l,o)=>(e.openBlock(),e.createBlock(_e,{key:o,modifiers:t.badgeModifiers,class:"vv-select__badge"},{default:e.withCtx((()=>[e.createTextVNode(e.toDisplayString(e.unref(ee)(l))+" ",1),!t.unselectable||e.unref(O)||e.unref(C)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,"aria-label":e.unref(r).deselectActionLabel,onClick:e.withModifiers((e=>ke(l)),["stop"])},[e.createVNode(U,{name:"close"})],8,qe))])),_:2},1032,["modifiers"])))),128)):(e.openBlock(),e.createElementBlock("div",Me,e.toDisplayString(e.unref(ye)),1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.placeholder),1)],64))]))],16,Te),e.unref(W)?(e.openBlock(),e.createBlock(U,e.mergeProps({key:1,class:"vv-select__icon vv-select__icon-after"},e.unref(M)),null,16)):e.createCommentVNode("",!0)]),t.$slots.after?(e.openBlock(),e.createElementBlock("div",Ke,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(Ve))))])):e.createCommentVNode("",!0)])),items:e.withCtx((()=>[e.unref(se).length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(se),((l,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:o},[i(l)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(oe,{label:e.unref(ee)(l)},null,8,["label"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(re)(l),((o,a)=>(e.openBlock(),e.createBlock(te,e.mergeProps({disabled:e.unref(ne)(o),selected:pe(o),unselectable:t.unselectable,deselectHintLabel:e.unref(r).deselectHintLabel,selectHintLabel:e.unref(r).selectHintLabel,selectedHintLabel:e.unref(r).selectedHintLabel},{key:a,class:"vv-dropdown-option",onClickPassive:e=>ke(o)}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"option",e.normalizeProps(e.guardReactiveProps({option:l,selectedOptions:e.unref(ge),selected:pe(o),disabled:e.unref(ne)(o)})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(ee)(o)),1)]))])),_:2},1040,["onClickPassive"])))),128))],64)):(e.openBlock(),e.createBlock(te,e.mergeProps({key:1},{disabled:e.unref(ne)(l),selected:pe(l),unselectable:t.unselectable,deselectHintLabel:e.unref(r).deselectHintLabel,selectHintLabel:e.unref(r).selectHintLabel,selectedHintLabel:e.unref(r).selectedHintLabel},{class:"vv-dropdown-option",onClickPassive:e=>ke(l)}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"option",e.normalizeProps(e.guardReactiveProps({option:l,selectedOptions:e.unref(ge),selected:pe(l),disabled:e.unref(ne)(l)})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(ee)(l)),1)]))])),_:2},1040,["onClickPassive"]))],64)))),128)):t.options.length?(e.openBlock(),e.createBlock(te,{key:2,modifiers:"inert"},{default:e.withCtx((()=>[e.renderSlot(t.$slots,"no-results",{},(()=>[e.createTextVNode(e.toDisplayString(e.unref(r).noResultsLabel),1)]))])),_:3})):(e.openBlock(),e.createBlock(te,{key:1,modifiers:"inert"},{default:e.withCtx((()=>[e.renderSlot(t.$slots,"no-options",{},(()=>[e.createTextVNode(e.toDisplayString(e.unref(r).noOptionsLabel),1)]))])),_:3}))])),after:e.withCtx((()=>[e.renderSlot(t.$slots,"dropdown::after",{},(()=>{var t;return[(null==(t=e.unref(T))?void 0:t.customPosition)?(e.openBlock(),e.createBlock(je,{key:0,label:e.unref(r).closeLabel,modifiers:"secondary",onClick:o[1]||(o[1]=t=>e.unref(T).hide())},null,8,["label"])):e.createCommentVNode("",!0)]}))])),_:2},[e.unref(j)||t.$slots["dropdown::before"]?{name:"before",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"dropdown::before"),e.unref(j)?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,id:e.unref(H),ref_key:"inputSearchEl",ref:f,"onUpdate:modelValue":o[0]||(o[0]=t=>e.isRef(y)?y.value=t:null),"aria-autocomplete":"list","aria-controls":e.unref(F),autocomplete:"off",spellcheck:"false",type:"search",class:"vv-dropdown__search",placeholder:e.unref(r).searchPlaceholder},null,8,Fe)),[[e.vModelText,e.unref(y)]]):e.createCommentVNode("",!0)])),key:"0"}:void 0]),1040,["modelValue","role"])],512),e.createVNode(e.unref(u),{id:e.unref(z),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(c))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(c))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(c))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(c))))])),key:"3"}:void 0]),1032,["id"])],10,Re))}})}));
|
|
@@ -530,25 +530,25 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
530
530
|
"no-results"?(_: {}): any;
|
|
531
531
|
"dropdown::after"?(_: {}): any;
|
|
532
532
|
hint?(_: {
|
|
533
|
-
modelValue:
|
|
533
|
+
modelValue: unknown;
|
|
534
534
|
valid: boolean;
|
|
535
535
|
invalid: boolean;
|
|
536
536
|
loading: boolean;
|
|
537
537
|
}): any;
|
|
538
538
|
loading?(_: {
|
|
539
|
-
modelValue:
|
|
539
|
+
modelValue: unknown;
|
|
540
540
|
valid: boolean;
|
|
541
541
|
invalid: boolean;
|
|
542
542
|
loading: boolean;
|
|
543
543
|
}): any;
|
|
544
544
|
valid?(_: {
|
|
545
|
-
modelValue:
|
|
545
|
+
modelValue: unknown;
|
|
546
546
|
valid: boolean;
|
|
547
547
|
invalid: boolean;
|
|
548
548
|
loading: boolean;
|
|
549
549
|
}): any;
|
|
550
550
|
invalid?(_: {
|
|
551
|
-
modelValue:
|
|
551
|
+
modelValue: unknown;
|
|
552
552
|
valid: boolean;
|
|
553
553
|
invalid: boolean;
|
|
554
554
|
loading: boolean;
|
|
@@ -15,7 +15,8 @@ function joinLines(items) {
|
|
|
15
15
|
}
|
|
16
16
|
return items;
|
|
17
17
|
}
|
|
18
|
-
function HintSlotFactory(
|
|
18
|
+
function HintSlotFactory(propsOrRef, slots) {
|
|
19
|
+
const props = unref(propsOrRef);
|
|
19
20
|
const invalidLabel = computed(() => joinLines(props.invalidLabel));
|
|
20
21
|
const validLabel = computed(() => joinLines(props.validLabel));
|
|
21
22
|
const loadingLabel = computed(() => props.loadingLabel);
|
|
@@ -1132,6 +1133,59 @@ function VvInputTextActionsFactory(type, parentProps) {
|
|
|
1132
1133
|
}
|
|
1133
1134
|
};
|
|
1134
1135
|
}
|
|
1136
|
+
function useDefaults(componentName, propsDefinition, props) {
|
|
1137
|
+
const volver = useVolver();
|
|
1138
|
+
const volverComponentDefaults = computed(() => {
|
|
1139
|
+
var _a;
|
|
1140
|
+
if (!volver || !((_a = volver.defaults.value) == null ? void 0 : _a[componentName])) {
|
|
1141
|
+
return void 0;
|
|
1142
|
+
}
|
|
1143
|
+
return volver.defaults.value[componentName];
|
|
1144
|
+
});
|
|
1145
|
+
return computed(() => {
|
|
1146
|
+
if (volverComponentDefaults.value === void 0) {
|
|
1147
|
+
return props;
|
|
1148
|
+
}
|
|
1149
|
+
const componentDefaults = volverComponentDefaults.value;
|
|
1150
|
+
const simplifiedPropsDefinition = propsDefinition;
|
|
1151
|
+
const simplifiedProps = props;
|
|
1152
|
+
return Object.keys(simplifiedPropsDefinition).reduce((acc, key) => {
|
|
1153
|
+
const propValue = simplifiedProps[key];
|
|
1154
|
+
acc[key] = propValue;
|
|
1155
|
+
if (key in componentDefaults) {
|
|
1156
|
+
if (Array.isArray(simplifiedPropsDefinition[key])) {
|
|
1157
|
+
const typeArray = simplifiedPropsDefinition[key];
|
|
1158
|
+
if (typeArray.length) {
|
|
1159
|
+
const typeFunction = typeArray[0];
|
|
1160
|
+
if (typeFunction === propValue) {
|
|
1161
|
+
acc[key] = componentDefaults[key];
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
if (typeof simplifiedPropsDefinition[key] === "function") {
|
|
1166
|
+
const typeFunction = simplifiedPropsDefinition[key];
|
|
1167
|
+
if (typeFunction() === propValue) {
|
|
1168
|
+
acc[key] = componentDefaults[key];
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
if (typeof simplifiedPropsDefinition[key] === "object") {
|
|
1172
|
+
let defaultValue = simplifiedPropsDefinition[key].default;
|
|
1173
|
+
if (typeof defaultValue === "function") {
|
|
1174
|
+
defaultValue = defaultValue();
|
|
1175
|
+
}
|
|
1176
|
+
if (typeof defaultValue === "object") {
|
|
1177
|
+
if (JSON.stringify(defaultValue) === JSON.stringify(propValue)) {
|
|
1178
|
+
acc[key] = componentDefaults[key];
|
|
1179
|
+
}
|
|
1180
|
+
} else if (defaultValue === propValue) {
|
|
1181
|
+
acc[key] = componentDefaults[key];
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
return acc;
|
|
1186
|
+
}, {});
|
|
1187
|
+
});
|
|
1188
|
+
}
|
|
1135
1189
|
const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || nanoid()));
|
|
1136
1190
|
function useDebouncedInput(modelValue, emit, ms = 0, {
|
|
1137
1191
|
getter = (value) => value,
|
|
@@ -1261,6 +1315,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1261
1315
|
setup(__props, { expose: __expose, emit }) {
|
|
1262
1316
|
const props = __props;
|
|
1263
1317
|
const slots = useSlots();
|
|
1318
|
+
const propsDefaults = useDefaults(
|
|
1319
|
+
"VvInputText",
|
|
1320
|
+
VvInputTextProps,
|
|
1321
|
+
props
|
|
1322
|
+
);
|
|
1264
1323
|
const inputEl = ref();
|
|
1265
1324
|
const innerEl = ref();
|
|
1266
1325
|
__expose({ $inner: innerEl });
|
|
@@ -1447,7 +1506,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1447
1506
|
hasHintLabelOrSlot,
|
|
1448
1507
|
hasInvalidLabelOrSlot,
|
|
1449
1508
|
hintSlotScope
|
|
1450
|
-
} = HintSlotFactory(
|
|
1509
|
+
} = HintSlotFactory(propsDefaults, slots);
|
|
1451
1510
|
const PasswordInputActions = VvInputTextActionsFactory(
|
|
1452
1511
|
INPUT_TYPES.PASSWORD,
|
|
1453
1512
|
props
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("maska"),require("@iconify/vue"),require("nanoid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","maska","@iconify/vue","nanoid","@vueuse/core"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvInputText=t(e.vue,e.maska,e.vue$1,e.nanoid,e.core)}(this,(function(e,t,o,l,n){"use strict";function a(t){return null==(o=e.unref(t))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length;var o}function i(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}const r={color:String,width:{type:[String,Number]},height:{type:[String,Number]},name:{type:String,required:!0},provider:{type:String},prefix:{type:String,default:"normal"},src:String,horizontalFlip:Boolean,verticalFlip:Boolean,flip:String,mode:String,inline:Boolean,rotate:[Number,String],onLoad:Function,svg:String,modifiers:{type:[String,Array]}};var u=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(u||{}),s=(e=>(e.before="before",e.after="after",e))(s||{}),d=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(d||{});const c=Symbol.for("volver");function p(t,o,l){return e.computed((()=>{const n={[t]:!0},a="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return a&&Array.isArray(a)&&a.forEach((e=>{e&&(n[`${t}--${e}`]=!0)})),l&&Object.keys(l.value).forEach((o=>{n[`${t}--${o}`]=e.unref(l.value[o])})),n}))}const v=e.defineComponent({name:"VvIcon",props:r,setup(t){const l=t,n=e.computed((()=>"string"==typeof l.rotate?parseFloat(l.rotate):l.rotate)),a=e.ref(!0),i=e.inject(c),{modifiers:r}=e.toRefs(l),u=p("vv-icon",r),s=e.computed((()=>l.provider||(null==i?void 0:i.iconsProvider))),d=e.computed((()=>{const e=l.name??"",t=`@${s.value}:${l.prefix}:${e}`;if(o.iconExists(t))return t;const n=null==i?void 0:i.iconsCollections.find((t=>{const l=`@${s.value}:${t.prefix}:${e}`;return o.iconExists(l)}));return n?`@${s.value}:${n.prefix}:${e}`:e}));function v(e){const t=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),n=(null==t?void 0:t.innerHTML.trim())||"";t&&n&&o.addIcon(`@${s.value}:${l.prefix}:${l.name}`,{body:n,height:t.viewBox.baseVal.height,width:t.viewBox.baseVal.width})}return i&&l.src&&!o.iconExists(`@${s.value}:${l.prefix}:${l.name}`)&&(a.value=!1,i.fetchIcon(l.src).then((e=>{e&&(v(e),a.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),l.svg&&v(l.svg),(t,l)=>e.unref(a)?(e.openBlock(),e.createBlock(e.unref(o.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:t.inline,width:t.width,height:t.height,horizontalFlip:t.horizontalFlip,verticalFlip:t.verticalFlip,flip:t.flip,rotate:e.unref(n),color:t.color,onLoad:t.onLoad,icon:e.unref(d)}),null,16,["class"])):e.createCommentVNode("",!0)}}),m={valid:Boolean,validLabel:[String,Array]},f={invalid:Boolean,invalidLabel:[String,Array]},h={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},b={disabled:Boolean},g=(Boolean,Boolean,{label:[String,Number]}),S={readonly:Boolean},y={modifiers:[String,Array]},w={hintLabel:{type:String,default:""}},k={count:{type:[Boolean,String],default:!1,validator:e=>[!0,!1,"limit","countdown"].includes(e)}},B={debounce:[Number,String]},L={icon:{type:[String,Object]},iconPosition:{type:String,default:s.before,validation:e=>Object.values(s).includes(e)}},E={tabindex:{type:[String,Number],default:0}},x={floating:Boolean},P={id:[String,Number]};u.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const T={...{...P,name:{type:String,required:!0}},...{autofocus:Boolean},...{autocomplete:{type:String,default:"off"}},...E,...b,...S,...m,...f,...w,...h,...y,...k,...B,...L,...x,...g,minlength:[String,Number],maxlength:[String,Number],placeholder:String,required:Boolean};d.button;const C={TEXT:"text",PASSWORD:"password",NUMBER:"number",EMAIL:"email",TEL:"tel",URL:"url",COLOR:"color",SEARCH:"search",DATE:"date",TIME:"time",DATETIME_LOCAL:"datetime-local",MONTH:"month",WEEK:"week"},$="eye-on",A="eye-off",I="calendar",V="time",_="color",O={...T,modelValue:[String,Number],type:{type:String,default:C.TEXT,validator:e=>Object.values(C).includes(e)},min:[Number,Date,String],max:[Number,Date,String],step:{type:[String,Number],default:1},pattern:String,multiple:Boolean,iconShowPassword:{type:String,default:$},iconHidePassword:{type:String,default:A},iconClear:{type:String,default:"close"},labelStepUp:{type:String,default:"Increase value"},labelStepDown:{type:String,default:"Decrease value"},labelShowPassword:{type:String,default:"Show password"},labelHidePassword:{type:String,default:"Hide password"},labelClear:{type:String,default:"Clear"},mask:{type:String,default:void 0},maskEager:{type:Boolean,default:!1},maskReversed:{type:Boolean,default:!1},maskTokens:{type:Object,default:void 0},maskTokensReplace:{type:Boolean,default:!1},autoWidth:{type:Boolean,default:!1},hideActions:{type:Boolean,default:!1},unit:{type:String}},R=e.defineComponent({components:{VvIcon:v},props:{disabled:{type:Boolean,default:!1},labelShow:{type:String,default:"Show password"},labelHide:{type:String,default:"Hide password"},iconShow:{type:String,default:$},iconHide:{type:String,default:A}},emits:["toggle-password"],setup(t,{emit:o}){const l=e.ref(!1),n=e.computed((()=>l.value?t.iconHide:t.iconShow));return{active:l,activeIcon:n,onClick:function(e){null==e||e.stopPropagation(),t.disabled||(l.value=!l.value,o("toggle-password",l.value))}}},render(){const t=e.h(v,{name:this.activeIcon,class:"vv-input-text__icon"});return e.h("button",{disabled:this.disabled,class:"vv-input-text__action",ariaLabel:this.active?this.labelHide:this.labelShow,type:"button",onClick:this.onClick},t)}}),D=e.defineComponent({components:{VvIcon:v},props:{disabled:{type:Boolean,default:!1},label:{type:String},mode:{type:String,validator:e=>["up","down"].includes(e),default:"up"}},emits:["step-up","step-down"],setup(t,{emit:o}){const l=e.computed((()=>"up"===t.mode));return{isUp:l,onClick:e=>{null==e||e.stopPropagation(),t.disabled||o(l.value?"step-up":"step-down")}}},render(){return e.h("button",{class:["vv-input-text__action vv-input-text__action-chevron",this.isUp&&"vv-input-text__action-chevron-up"],disabled:this.disabled,ariaLabel:this.label,type:"button",onClick:this.onClick})}}),N=e.defineComponent({components:{VvIcon:v},props:{disabled:{type:Boolean,default:!1},label:{type:String,default:"Clear"},icon:{type:String,default:"close"}},emits:["clear"],setup:(e,{emit:t})=>({onClick:function(o){null==o||o.stopPropagation(),e.disabled||t("clear")}}),render(){const t=e.h(v,{name:this.icon,class:"vv-input-text__icon"});return e.h("button",{disabled:this.disabled,class:"vv-input-text__action",ariaLabel:this.label,type:"button",onClick:this.onClick},t)}});function H(t,o){return{name:"VvInputTextActions",components:{VvIcon:v,VvInputPasswordAction:R,VvInputStepAction:D,VvInputClearAction:N},setup:()=>({isDisabled:e.computed((()=>o.disabled||o.readonly)),labelStepUp:o.labelStepUp,labelStepDown:o.labelStepDown,labelShowPassword:o.labelShowPassword,labelHidePassword:o.labelHidePassword,labelClear:o.labelClear,iconShowPassword:o.iconShowPassword,iconHidePassword:o.iconHidePassword}),render(){let l=null;switch(t){case C.SEARCH:{const{onClear:t}=this.$attrs;l=[e.h(N,{disabled:this.isDisabled,label:this.labelShowPassword,onClear:t})];break}case C.PASSWORD:{const{onTogglePassword:t}=this.$attrs;l=[e.h(R,{disabled:this.isDisabled,onTogglePassword:t,labelShow:this.labelShowPassword,labelHide:this.labelHidePassword,iconShow:this.iconShowPassword,iconHide:this.iconHidePassword})];break}case C.NUMBER:{const{onStepUp:t,onStepDown:n}=this.$attrs;l=[e.h(D,{mode:"up",disabled:this.isDisabled||void 0!==o.max&&o.modelValue===o.max,label:this.labelStepUp,onStepUp:t,onStepDown:n}),e.h(D,{mode:"down",disabled:this.isDisabled||void 0!==o.min&&o.modelValue===o.min,label:this.labelStepDown,onStepUp:t,onStepDown:n})];break}}return Array.isArray(l)?e.h("div",{class:"vv-input-text__actions-group"},l):l}}}const M=["for"],U={class:"vv-input-text__wrapper"},W={key:0,class:"vv-input-text__input-before"},q=["onClick"],z=["id"],j={key:1,class:"vv-input-text__unit"},F={key:5,class:"vv-input-text__input-after"},X={key:6,class:"vv-input-text__limit"};return e.defineComponent({name:"VvInputText",props:O,emits:["update:modelValue","focus","blur","keyup"],setup(o,{expose:r,emit:d}){const c=o,m=e.useSlots(),f=e.ref(),h=e.ref();r({$inner:h});const{id:b,icon:g,iconPosition:S,label:y,modelValue:w,count:k,valid:B,invalid:L,loading:E}=e.toRefs(c),x=(t=>e.computed((()=>String((null==t?void 0:t.value)||l.nanoid()))))(b),P=e.computed((()=>`${x.value}-hint`)),T=e.computed((()=>c.floating&&a(c.placeholder)?" ":c.placeholder)),$=function(t,o,l=0,{getter:n=(e=>e),setter:a=(e=>e)}={}){let i;return"string"==typeof l&&(l=parseInt(l)),e.computed({get:()=>n(null==t?void 0:t.value),set:e=>{i&&clearTimeout(i),i=setTimeout((()=>{o("update:modelValue",a(e))}),l)}})}(w,d,c.debounce,{getter:e=>we.value?we.value.masked(e??""):e,setter:e=>(we.value&&(e=we.value.unmasked(e)),c.type===C.NUMBER?Number(e):e)}),{focused:A}=function(t,o){const{focused:l}=n.useFocus(t);return e.watch(l,(l=>{o(l?"focus":"blur",e.unref(t))})),{focused:l}}(f,d),O=e.computed((()=>A.value&&!c.disabled&&!c.readonly)),R=n.useElementVisibility(f);e.watch(R,(e=>{e&&c.autofocus&&!c.disabled&&!c.readonly&&(A.value=!0)}));const D=e.ref(!1),N=e.computed((()=>c.type===C.PASSWORD)),K=()=>{D.value=!D.value},J=e.computed((()=>c.type===C.TIME||c.type===C.DATETIME_LOCAL||c.type===C.DATE||c.type===C.WEEK||c.type===C.MONTH)),G=e.computed((()=>c.type===C.NUMBER)),Q=()=>{ie.value&&(f.value.stepUp(),$.value=e.unref(f).value)},Y=()=>{ie.value&&(f.value.stepDown(),$.value=e.unref(f).value)},Z=e.computed((()=>c.type===C.SEARCH)),ee=()=>{$.value=void 0},{hasIcon:te,hasIconBefore:oe,hasIconAfter:le}=function(t,o){const l=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===s.before))),n=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===s.after))),a=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===u.left))),i=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===u.right))),r=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===u.top))),d=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===u.bottom)));return{hasIcon:e.computed((()=>"string"==typeof(null==t?void 0:t.value)?{name:null==t?void 0:t.value}:null==t?void 0:t.value)),hasIconLeft:a,hasIconRight:i,hasIconTop:r,hasIconBottom:d,hasIconBefore:l,hasIconAfter:n}}(g,S),ne=e.computed((()=>{switch(c.type){case C.COLOR:return{name:_};case C.DATE:case C.DATETIME_LOCAL:case C.WEEK:case C.MONTH:return{name:I};case C.TIME:return{name:V};default:return""}})),{formatted:ae}=function(t,o){const l=e.computed((()=>(e.unref(t)??"").length)),n=e.computed((()=>void 0!==(null==o?void 0:o.lowerLimit)&&l.value<(null==o?void 0:o.lowerLimit)?l.value-o.lowerLimit:void 0!==(null==o?void 0:o.upperLimit)&&l.value<(null==o?void 0:o.upperLimit)?o.upperLimit-l.value:0)),a=e.computed((()=>{if(!1===(null==o?void 0:o.mode))return"";if("limit"===(null==o?void 0:o.mode)&&(null==o?void 0:o.upperLimit))return`${l.value} / ${o.lowerLimit?`${o.lowerLimit}-`:""}${o.upperLimit}`;if("countdown"===(null==o?void 0:o.mode)){if(0===n.value)return;return n}return l.value}));return{length:l,gap:n,formatted:a}}($,{mode:c.count,upperLimit:Number(c.maxlength),lowerLimit:Number(c.minlength)}),ie=e.computed((()=>!c.disabled&&!c.readonly)),re=e.computed((()=>ie.value?c.tabindex:-1)),ue=e.computed((()=>!a(w))),se=e.computed((()=>!0===L.value||!0!==B.value&&void 0)),{modifiers:de}=e.toRefs(c),ce=p("vv-input-text",de,e.computed((()=>({valid:B.value,invalid:L.value,loading:E.value,disabled:c.disabled,readonly:c.readonly,"icon-before":oe.value,"icon-after":le.value||!a(ne),floating:c.floating&&!a(c.label),dirty:ue.value,focus:O.value,"auto-width":c.autoWidth})))),pe=e.computed((()=>{const e=N.value&&D.value?C.TEXT:!J.value||ue.value||A.value?c.type:C.TEXT,t={type:e,name:c.name,tabindex:re.value,disabled:c.disabled,readonly:c.readonly,required:c.required,autocomplete:c.autocomplete,"aria-invalid":se.value,"aria-describedby":fe.value?P.value:void 0,"aria-errormessage":he.value?P.value:void 0};return e!==C.DATE&&e!==C.MONTH&&e!==C.WEEK&&e!==C.TIME&&e!==C.DATETIME_LOCAL&&e!==C.NUMBER||(t.step=c.step,t.max=void 0!==c.max?String(c.max):void 0,t.min=void 0!==c.min?String(c.min):void 0),e!==C.TEXT&&e!==C.SEARCH&&e!==C.URL&&e!==C.TEL&&e!==C.EMAIL&&e!==C.PASSWORD&&e!==C.NUMBER||(t.placeholder=T.value),e!==C.TEXT&&e!==C.SEARCH&&e!==C.URL&&e!==C.TEL&&e!==C.EMAIL&&e!==C.PASSWORD||(t.minlength=c.minlength,t.maxlength=c.maxlength,t.pattern=c.pattern),e===C.EMAIL&&(t.multiple=c.multiple),t})),ve=e.computed((()=>({valid:c.valid,invalid:c.invalid,modelValue:c.modelValue,togglePassword:K,stepUp:Q,stepDown:Y,clear:ee}))),{HintSlot:me,hasHintLabelOrSlot:fe,hasInvalidLabelOrSlot:he,hintSlotScope:be}=function(t,o){const l=e.computed((()=>i(t.invalidLabel))),n=e.computed((()=>i(t.validLabel))),a=e.computed((()=>t.loadingLabel)),r=e.computed((()=>t.hintLabel)),u=e.computed((()=>Boolean(t.loading&&(o.loading||a.value)))),s=e.computed((()=>!u.value&&Boolean(t.invalid&&(o.invalid||l.value)))),d=e.computed((()=>!u.value&&!s.value&&Boolean(t.valid&&(o.valid||n.value)))),c=e.computed((()=>!u.value&&!s.value&&!d.value&&Boolean(o.hint||r.value))),p=e.computed((()=>s.value||d.value||u.value||c.value)),v=e.computed((()=>({modelValue:t.modelValue,valid:t.valid,invalid:t.invalid,loading:t.loading}))),m=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:p,invalidLabel:l,validLabel:n,loadingLabel:a,hintLabel:r,hasInvalidLabelOrSlot:s,hasValidLabelOrSlot:d,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:c}),render(){var t,o,l,n,a,i,r,u;if(this.isVisible){let s;return this.hasInvalidLabelOrSlot&&(s="alert"),this.hasValidLabelOrSlot&&(s="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:s},(null==(o=(t=this.$slots).loading)?void 0:o.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:s},(null==(n=(l=this.$slots).invalid)?void 0:n.call(l))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:s},(null==(i=(a=this.$slots).valid)?void 0:i.call(a))??this.validLabel):e.h(this.tag,{role:s},(null==(u=(r=this.$slots).hint)?void 0:u.call(r))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:s,hasHintLabelOrSlot:c,hasValidLabelOrSlot:d,hasLoadingLabelOrSlot:u,hintSlotScope:v,HintSlot:m}}(c,m),ge=H(C.PASSWORD,c),Se=H(C.NUMBER,c),ye=H(C.SEARCH,c),we=e.ref();e.watch([()=>c.mask,()=>c.type,()=>c.maskEager,()=>c.maskReversed,()=>c.maskTokens,()=>c.maskTokensReplace],(([e,o,l,n,a,i])=>{we.value=e&&o===C.TEXT?new t.Mask({mask:e,eager:l,reversed:n,tokens:a,tokensReplace:i}):void 0}),{immediate:!0});const ke=()=>{ie.value&&(A.value=!0)},Be=e.computed((()=>{if(c.autoWidth)return{width:void 0!==$.value?`${String($.value).length+1}ch`:void 0}}));return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(ce))},[e.unref(y)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(x),class:"vv-input-text__label"},e.toDisplayString(e.unref(y)),9,M)):e.createCommentVNode("",!0),e.createElementVNode("div",U,[t.$slots.before?(e.openBlock(),e.createElementBlock("div",W,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(ve))))])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"innerEl",ref:h,class:"vv-input-text__inner",onClick:e.withModifiers(ke,["stop"])},[e.unref(oe)?(e.openBlock(),e.createBlock(v,e.mergeProps({key:0,class:"vv-input-text__icon"},e.unref(te)),null,16)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:e.unref(x),ref_key:"inputEl",ref:f,"onUpdate:modelValue":o[0]||(o[0]=t=>e.isRef($)?$.value=t:null)},e.unref(pe),{style:e.unref(Be),onKeyup:o[1]||(o[1]=e=>d("keyup",e))}),null,16,z),[[e.vModelDynamic,e.unref($)]]),(t.unit||t.$slots.unit)&&e.unref(ue)?(e.openBlock(),e.createElementBlock("div",j,[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps(e.unref(ve))),(()=>[e.createTextVNode(e.toDisplayString(t.unit),1)]))])):e.createCommentVNode("",!0)],8,q),e.unref(le)||e.unref(ne)?(e.openBlock(),e.createBlock(v,e.mergeProps({key:1,class:"vv-input-text__icon vv-input-text__icon-after"},e.unref(le)?e.unref(te):e.unref(ne)),null,16)):e.unref(N)&&!t.hideActions&&e.unref(ie)?(e.openBlock(),e.createBlock(e.unref(ge),{key:2,onTogglePassword:K})):e.unref(G)&&!t.hideActions&&e.unref(ie)?(e.openBlock(),e.createBlock(e.unref(Se),{key:3,onStepUp:Q,onStepDown:Y})):e.unref(Z)&&!t.hideActions&&e.unref(ie)?(e.openBlock(),e.createBlock(e.unref(ye),{key:4,onClear:ee})):e.createCommentVNode("",!0),t.$slots.after?(e.openBlock(),e.createElementBlock("div",F,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(ve))))])):e.createCommentVNode("",!0),e.unref(k)?(e.openBlock(),e.createElementBlock("span",X,[e.renderSlot(t.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref(ve))),(()=>[e.createTextVNode(e.toDisplayString(e.unref(ae)),1)]))])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(me),{id:e.unref(P),class:"vv-input-text__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(be))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(be))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(be))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(be))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("maska"),require("@iconify/vue"),require("nanoid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","maska","@iconify/vue","nanoid","@vueuse/core"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvInputText=t(e.vue,e.maska,e.vue$1,e.nanoid,e.core)}(this,(function(e,t,o,l,n){"use strict";function a(t){return null==(o=e.unref(t))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length;var o}function i(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}const r={color:String,width:{type:[String,Number]},height:{type:[String,Number]},name:{type:String,required:!0},provider:{type:String},prefix:{type:String,default:"normal"},src:String,horizontalFlip:Boolean,verticalFlip:Boolean,flip:String,mode:String,inline:Boolean,rotate:[Number,String],onLoad:Function,svg:String,modifiers:{type:[String,Array]}};var u=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(u||{}),s=(e=>(e.before="before",e.after="after",e))(s||{}),d=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(d||{});const c=Symbol.for("volver");function p(){return e.inject(c)}function v(t,o,l){return e.computed((()=>{const n={[t]:!0},a="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return a&&Array.isArray(a)&&a.forEach((e=>{e&&(n[`${t}--${e}`]=!0)})),l&&Object.keys(l.value).forEach((o=>{n[`${t}--${o}`]=e.unref(l.value[o])})),n}))}const m=e.defineComponent({name:"VvIcon",props:r,setup(t){const l=t,n=e.computed((()=>"string"==typeof l.rotate?parseFloat(l.rotate):l.rotate)),a=e.ref(!0),i=p(),{modifiers:r}=e.toRefs(l),u=v("vv-icon",r),s=e.computed((()=>l.provider||(null==i?void 0:i.iconsProvider))),d=e.computed((()=>{const e=l.name??"",t=`@${s.value}:${l.prefix}:${e}`;if(o.iconExists(t))return t;const n=null==i?void 0:i.iconsCollections.find((t=>{const l=`@${s.value}:${t.prefix}:${e}`;return o.iconExists(l)}));return n?`@${s.value}:${n.prefix}:${e}`:e}));function c(e){const t=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),n=(null==t?void 0:t.innerHTML.trim())||"";t&&n&&o.addIcon(`@${s.value}:${l.prefix}:${l.name}`,{body:n,height:t.viewBox.baseVal.height,width:t.viewBox.baseVal.width})}return i&&l.src&&!o.iconExists(`@${s.value}:${l.prefix}:${l.name}`)&&(a.value=!1,i.fetchIcon(l.src).then((e=>{e&&(c(e),a.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),l.svg&&c(l.svg),(t,l)=>e.unref(a)?(e.openBlock(),e.createBlock(e.unref(o.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:t.inline,width:t.width,height:t.height,horizontalFlip:t.horizontalFlip,verticalFlip:t.verticalFlip,flip:t.flip,rotate:e.unref(n),color:t.color,onLoad:t.onLoad,icon:e.unref(d)}),null,16,["class"])):e.createCommentVNode("",!0)}}),f={valid:Boolean,validLabel:[String,Array]},h={invalid:Boolean,invalidLabel:[String,Array]},b={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},g={disabled:Boolean},S=(Boolean,Boolean,{label:[String,Number]}),y={readonly:Boolean},w={modifiers:[String,Array]},k={hintLabel:{type:String,default:""}},B={count:{type:[Boolean,String],default:!1,validator:e=>[!0,!1,"limit","countdown"].includes(e)}},L={debounce:[Number,String]},E={icon:{type:[String,Object]},iconPosition:{type:String,default:s.before,validation:e=>Object.values(s).includes(e)}},x={tabindex:{type:[String,Number],default:0}},P={floating:Boolean},T={id:[String,Number]};u.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const C={...{...T,name:{type:String,required:!0}},...{autofocus:Boolean},...{autocomplete:{type:String,default:"off"}},...x,...g,...y,...f,...h,...k,...b,...w,...B,...L,...E,...P,...S,minlength:[String,Number],maxlength:[String,Number],placeholder:String,required:Boolean};d.button;const A={TEXT:"text",PASSWORD:"password",NUMBER:"number",EMAIL:"email",TEL:"tel",URL:"url",COLOR:"color",SEARCH:"search",DATE:"date",TIME:"time",DATETIME_LOCAL:"datetime-local",MONTH:"month",WEEK:"week"},$="eye-on",I="eye-off",V="calendar",O="time",_="color",N={...C,modelValue:[String,Number],type:{type:String,default:A.TEXT,validator:e=>Object.values(A).includes(e)},min:[Number,Date,String],max:[Number,Date,String],step:{type:[String,Number],default:1},pattern:String,multiple:Boolean,iconShowPassword:{type:String,default:$},iconHidePassword:{type:String,default:I},iconClear:{type:String,default:"close"},labelStepUp:{type:String,default:"Increase value"},labelStepDown:{type:String,default:"Decrease value"},labelShowPassword:{type:String,default:"Show password"},labelHidePassword:{type:String,default:"Hide password"},labelClear:{type:String,default:"Clear"},mask:{type:String,default:void 0},maskEager:{type:Boolean,default:!1},maskReversed:{type:Boolean,default:!1},maskTokens:{type:Object,default:void 0},maskTokensReplace:{type:Boolean,default:!1},autoWidth:{type:Boolean,default:!1},hideActions:{type:Boolean,default:!1},unit:{type:String}},R=e.defineComponent({components:{VvIcon:m},props:{disabled:{type:Boolean,default:!1},labelShow:{type:String,default:"Show password"},labelHide:{type:String,default:"Hide password"},iconShow:{type:String,default:$},iconHide:{type:String,default:I}},emits:["toggle-password"],setup(t,{emit:o}){const l=e.ref(!1),n=e.computed((()=>l.value?t.iconHide:t.iconShow));return{active:l,activeIcon:n,onClick:function(e){null==e||e.stopPropagation(),t.disabled||(l.value=!l.value,o("toggle-password",l.value))}}},render(){const t=e.h(m,{name:this.activeIcon,class:"vv-input-text__icon"});return e.h("button",{disabled:this.disabled,class:"vv-input-text__action",ariaLabel:this.active?this.labelHide:this.labelShow,type:"button",onClick:this.onClick},t)}}),D=e.defineComponent({components:{VvIcon:m},props:{disabled:{type:Boolean,default:!1},label:{type:String},mode:{type:String,validator:e=>["up","down"].includes(e),default:"up"}},emits:["step-up","step-down"],setup(t,{emit:o}){const l=e.computed((()=>"up"===t.mode));return{isUp:l,onClick:e=>{null==e||e.stopPropagation(),t.disabled||o(l.value?"step-up":"step-down")}}},render(){return e.h("button",{class:["vv-input-text__action vv-input-text__action-chevron",this.isUp&&"vv-input-text__action-chevron-up"],disabled:this.disabled,ariaLabel:this.label,type:"button",onClick:this.onClick})}}),H=e.defineComponent({components:{VvIcon:m},props:{disabled:{type:Boolean,default:!1},label:{type:String,default:"Clear"},icon:{type:String,default:"close"}},emits:["clear"],setup:(e,{emit:t})=>({onClick:function(o){null==o||o.stopPropagation(),e.disabled||t("clear")}}),render(){const t=e.h(m,{name:this.icon,class:"vv-input-text__icon"});return e.h("button",{disabled:this.disabled,class:"vv-input-text__action",ariaLabel:this.label,type:"button",onClick:this.onClick},t)}});function M(t,o){return{name:"VvInputTextActions",components:{VvIcon:m,VvInputPasswordAction:R,VvInputStepAction:D,VvInputClearAction:H},setup:()=>({isDisabled:e.computed((()=>o.disabled||o.readonly)),labelStepUp:o.labelStepUp,labelStepDown:o.labelStepDown,labelShowPassword:o.labelShowPassword,labelHidePassword:o.labelHidePassword,labelClear:o.labelClear,iconShowPassword:o.iconShowPassword,iconHidePassword:o.iconHidePassword}),render(){let l=null;switch(t){case A.SEARCH:{const{onClear:t}=this.$attrs;l=[e.h(H,{disabled:this.isDisabled,label:this.labelShowPassword,onClear:t})];break}case A.PASSWORD:{const{onTogglePassword:t}=this.$attrs;l=[e.h(R,{disabled:this.isDisabled,onTogglePassword:t,labelShow:this.labelShowPassword,labelHide:this.labelHidePassword,iconShow:this.iconShowPassword,iconHide:this.iconHidePassword})];break}case A.NUMBER:{const{onStepUp:t,onStepDown:n}=this.$attrs;l=[e.h(D,{mode:"up",disabled:this.isDisabled||void 0!==o.max&&o.modelValue===o.max,label:this.labelStepUp,onStepUp:t,onStepDown:n}),e.h(D,{mode:"down",disabled:this.isDisabled||void 0!==o.min&&o.modelValue===o.min,label:this.labelStepDown,onStepUp:t,onStepDown:n})];break}}return Array.isArray(l)?e.h("div",{class:"vv-input-text__actions-group"},l):l}}}const U=["for"],j={class:"vv-input-text__wrapper"},W={key:0,class:"vv-input-text__input-before"},q=["onClick"],z=["id"],F={key:1,class:"vv-input-text__unit"},X={key:5,class:"vv-input-text__input-after"},K={key:6,class:"vv-input-text__limit"};return e.defineComponent({name:"VvInputText",props:N,emits:["update:modelValue","focus","blur","keyup"],setup(o,{expose:r,emit:d}){const c=o,f=e.useSlots(),h=function(t,o,l){const n=p(),a=e.computed((()=>{var e;if(n&&(null==(e=n.defaults.value)?void 0:e[t]))return n.defaults.value[t]}));return e.computed((()=>{if(void 0===a.value)return l;const e=a.value,t=o,n=l;return Object.keys(t).reduce(((o,l)=>{const a=n[l];if(o[l]=a,l in e){if(Array.isArray(t[l])){const n=t[l];n.length&&n[0]===a&&(o[l]=e[l])}if("function"==typeof t[l]&&(0,t[l])()===a&&(o[l]=e[l]),"object"==typeof t[l]){let n=t[l].default;"function"==typeof n&&(n=n()),"object"==typeof n?JSON.stringify(n)===JSON.stringify(a)&&(o[l]=e[l]):n===a&&(o[l]=e[l])}}return o}),{})}))}("VvInputText",N,c),b=e.ref(),g=e.ref();r({$inner:g});const{id:S,icon:y,iconPosition:w,label:k,modelValue:B,count:L,valid:E,invalid:x,loading:P}=e.toRefs(c),T=(t=>e.computed((()=>String((null==t?void 0:t.value)||l.nanoid()))))(S),C=e.computed((()=>`${T.value}-hint`)),$=e.computed((()=>c.floating&&a(c.placeholder)?" ":c.placeholder)),I=function(t,o,l=0,{getter:n=(e=>e),setter:a=(e=>e)}={}){let i;return"string"==typeof l&&(l=parseInt(l)),e.computed({get:()=>n(null==t?void 0:t.value),set:e=>{i&&clearTimeout(i),i=setTimeout((()=>{o("update:modelValue",a(e))}),l)}})}(B,d,c.debounce,{getter:e=>Le.value?Le.value.masked(e??""):e,setter:e=>(Le.value&&(e=Le.value.unmasked(e)),c.type===A.NUMBER?Number(e):e)}),{focused:R}=function(t,o){const{focused:l}=n.useFocus(t);return e.watch(l,(l=>{o(l?"focus":"blur",e.unref(t))})),{focused:l}}(b,d),D=e.computed((()=>R.value&&!c.disabled&&!c.readonly)),H=n.useElementVisibility(b);e.watch(H,(e=>{e&&c.autofocus&&!c.disabled&&!c.readonly&&(R.value=!0)}));const J=e.ref(!1),G=e.computed((()=>c.type===A.PASSWORD)),Q=()=>{J.value=!J.value},Y=e.computed((()=>c.type===A.TIME||c.type===A.DATETIME_LOCAL||c.type===A.DATE||c.type===A.WEEK||c.type===A.MONTH)),Z=e.computed((()=>c.type===A.NUMBER)),ee=()=>{se.value&&(b.value.stepUp(),I.value=e.unref(b).value)},te=()=>{se.value&&(b.value.stepDown(),I.value=e.unref(b).value)},oe=e.computed((()=>c.type===A.SEARCH)),le=()=>{I.value=void 0},{hasIcon:ne,hasIconBefore:ae,hasIconAfter:ie}=function(t,o){const l=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===s.before))),n=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===s.after))),a=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===u.left))),i=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===u.right))),r=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===u.top))),d=e.computed((()=>Boolean((null==t?void 0:t.value)&&o.value===u.bottom)));return{hasIcon:e.computed((()=>"string"==typeof(null==t?void 0:t.value)?{name:null==t?void 0:t.value}:null==t?void 0:t.value)),hasIconLeft:a,hasIconRight:i,hasIconTop:r,hasIconBottom:d,hasIconBefore:l,hasIconAfter:n}}(y,w),re=e.computed((()=>{switch(c.type){case A.COLOR:return{name:_};case A.DATE:case A.DATETIME_LOCAL:case A.WEEK:case A.MONTH:return{name:V};case A.TIME:return{name:O};default:return""}})),{formatted:ue}=function(t,o){const l=e.computed((()=>(e.unref(t)??"").length)),n=e.computed((()=>void 0!==(null==o?void 0:o.lowerLimit)&&l.value<(null==o?void 0:o.lowerLimit)?l.value-o.lowerLimit:void 0!==(null==o?void 0:o.upperLimit)&&l.value<(null==o?void 0:o.upperLimit)?o.upperLimit-l.value:0)),a=e.computed((()=>{if(!1===(null==o?void 0:o.mode))return"";if("limit"===(null==o?void 0:o.mode)&&(null==o?void 0:o.upperLimit))return`${l.value} / ${o.lowerLimit?`${o.lowerLimit}-`:""}${o.upperLimit}`;if("countdown"===(null==o?void 0:o.mode)){if(0===n.value)return;return n}return l.value}));return{length:l,gap:n,formatted:a}}(I,{mode:c.count,upperLimit:Number(c.maxlength),lowerLimit:Number(c.minlength)}),se=e.computed((()=>!c.disabled&&!c.readonly)),de=e.computed((()=>se.value?c.tabindex:-1)),ce=e.computed((()=>!a(B))),pe=e.computed((()=>!0===x.value||!0!==E.value&&void 0)),{modifiers:ve}=e.toRefs(c),me=v("vv-input-text",ve,e.computed((()=>({valid:E.value,invalid:x.value,loading:P.value,disabled:c.disabled,readonly:c.readonly,"icon-before":ae.value,"icon-after":ie.value||!a(re),floating:c.floating&&!a(c.label),dirty:ce.value,focus:D.value,"auto-width":c.autoWidth})))),fe=e.computed((()=>{const e=G.value&&J.value?A.TEXT:!Y.value||ce.value||R.value?c.type:A.TEXT,t={type:e,name:c.name,tabindex:de.value,disabled:c.disabled,readonly:c.readonly,required:c.required,autocomplete:c.autocomplete,"aria-invalid":pe.value,"aria-describedby":ge.value?C.value:void 0,"aria-errormessage":Se.value?C.value:void 0};return e!==A.DATE&&e!==A.MONTH&&e!==A.WEEK&&e!==A.TIME&&e!==A.DATETIME_LOCAL&&e!==A.NUMBER||(t.step=c.step,t.max=void 0!==c.max?String(c.max):void 0,t.min=void 0!==c.min?String(c.min):void 0),e!==A.TEXT&&e!==A.SEARCH&&e!==A.URL&&e!==A.TEL&&e!==A.EMAIL&&e!==A.PASSWORD&&e!==A.NUMBER||(t.placeholder=$.value),e!==A.TEXT&&e!==A.SEARCH&&e!==A.URL&&e!==A.TEL&&e!==A.EMAIL&&e!==A.PASSWORD||(t.minlength=c.minlength,t.maxlength=c.maxlength,t.pattern=c.pattern),e===A.EMAIL&&(t.multiple=c.multiple),t})),he=e.computed((()=>({valid:c.valid,invalid:c.invalid,modelValue:c.modelValue,togglePassword:Q,stepUp:ee,stepDown:te,clear:le}))),{HintSlot:be,hasHintLabelOrSlot:ge,hasInvalidLabelOrSlot:Se,hintSlotScope:ye}=function(t,o){const l=e.unref(t),n=e.computed((()=>i(l.invalidLabel))),a=e.computed((()=>i(l.validLabel))),r=e.computed((()=>l.loadingLabel)),u=e.computed((()=>l.hintLabel)),s=e.computed((()=>Boolean(l.loading&&(o.loading||r.value)))),d=e.computed((()=>!s.value&&Boolean(l.invalid&&(o.invalid||n.value)))),c=e.computed((()=>!s.value&&!d.value&&Boolean(l.valid&&(o.valid||a.value)))),p=e.computed((()=>!s.value&&!d.value&&!c.value&&Boolean(o.hint||u.value))),v=e.computed((()=>d.value||c.value||s.value||p.value)),m=e.computed((()=>({modelValue:l.modelValue,valid:l.valid,invalid:l.invalid,loading:l.loading}))),f=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:v,invalidLabel:n,validLabel:a,loadingLabel:r,hintLabel:u,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:c,hasLoadingLabelOrSlot:s,hasHintLabelOrSlot:p}),render(){var t,o,l,n,a,i,r,u;if(this.isVisible){let s;return this.hasInvalidLabelOrSlot&&(s="alert"),this.hasValidLabelOrSlot&&(s="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:s},(null==(o=(t=this.$slots).loading)?void 0:o.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:s},(null==(n=(l=this.$slots).invalid)?void 0:n.call(l))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:s},(null==(i=(a=this.$slots).valid)?void 0:i.call(a))??this.validLabel):e.h(this.tag,{role:s},(null==(u=(r=this.$slots).hint)?void 0:u.call(r))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:d,hasHintLabelOrSlot:p,hasValidLabelOrSlot:c,hasLoadingLabelOrSlot:s,hintSlotScope:m,HintSlot:f}}(h,f),we=M(A.PASSWORD,c),ke=M(A.NUMBER,c),Be=M(A.SEARCH,c),Le=e.ref();e.watch([()=>c.mask,()=>c.type,()=>c.maskEager,()=>c.maskReversed,()=>c.maskTokens,()=>c.maskTokensReplace],(([e,o,l,n,a,i])=>{Le.value=e&&o===A.TEXT?new t.Mask({mask:e,eager:l,reversed:n,tokens:a,tokensReplace:i}):void 0}),{immediate:!0});const Ee=()=>{se.value&&(R.value=!0)},xe=e.computed((()=>{if(c.autoWidth)return{width:void 0!==I.value?`${String(I.value).length+1}ch`:void 0}}));return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(me))},[e.unref(k)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(T),class:"vv-input-text__label"},e.toDisplayString(e.unref(k)),9,U)):e.createCommentVNode("",!0),e.createElementVNode("div",j,[t.$slots.before?(e.openBlock(),e.createElementBlock("div",W,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(he))))])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"innerEl",ref:g,class:"vv-input-text__inner",onClick:e.withModifiers(Ee,["stop"])},[e.unref(ae)?(e.openBlock(),e.createBlock(m,e.mergeProps({key:0,class:"vv-input-text__icon"},e.unref(ne)),null,16)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:e.unref(T),ref_key:"inputEl",ref:b,"onUpdate:modelValue":o[0]||(o[0]=t=>e.isRef(I)?I.value=t:null)},e.unref(fe),{style:e.unref(xe),onKeyup:o[1]||(o[1]=e=>d("keyup",e))}),null,16,z),[[e.vModelDynamic,e.unref(I)]]),(t.unit||t.$slots.unit)&&e.unref(ce)?(e.openBlock(),e.createElementBlock("div",F,[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps(e.unref(he))),(()=>[e.createTextVNode(e.toDisplayString(t.unit),1)]))])):e.createCommentVNode("",!0)],8,q),e.unref(ie)||e.unref(re)?(e.openBlock(),e.createBlock(m,e.mergeProps({key:1,class:"vv-input-text__icon vv-input-text__icon-after"},e.unref(ie)?e.unref(ne):e.unref(re)),null,16)):e.unref(G)&&!t.hideActions&&e.unref(se)?(e.openBlock(),e.createBlock(e.unref(we),{key:2,onTogglePassword:Q})):e.unref(Z)&&!t.hideActions&&e.unref(se)?(e.openBlock(),e.createBlock(e.unref(ke),{key:3,onStepUp:ee,onStepDown:te})):e.unref(oe)&&!t.hideActions&&e.unref(se)?(e.openBlock(),e.createBlock(e.unref(Be),{key:4,onClear:le})):e.createCommentVNode("",!0),t.$slots.after?(e.openBlock(),e.createElementBlock("div",X,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(he))))])):e.createCommentVNode("",!0),e.unref(L)?(e.openBlock(),e.createElementBlock("span",K,[e.renderSlot(t.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref(he))),(()=>[e.createTextVNode(e.toDisplayString(e.unref(ue)),1)]))])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(be),{id:e.unref(C),class:"vv-input-text__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(ye))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(ye))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(ye))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(ye))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
|