@volverjs/ui-vue 0.0.9-beta.8 → 0.0.9-beta.9
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/VvAlertGroup/VvAlertGroup.vue.d.ts +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +20 -13
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +20 -13
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +20 -13
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.es.js +21 -20
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +2 -2
- package/dist/components/VvInputText/VvInputText.es.js +20 -13
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +20 -13
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +20 -13
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.es.js +20 -13
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +20 -13
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/index.es.js +44 -36
- package/dist/components/index.umd.js +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/resolvers/unplugin.es.js +3 -0
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +1 -1
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +7 -7
- package/package.json +34 -34
- 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/VvAlertGroup/VvAlertGroup.vue +2 -0
- package/src/components/VvDialog/VvDialog.vue +10 -11
- package/src/components/common/HintSlot.ts +20 -12
- package/src/resolvers/unplugin.ts +3 -0
|
@@ -71,11 +71,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
71
71
|
}, {
|
|
72
72
|
reverse: boolean;
|
|
73
73
|
items: import(".").AlertItem[];
|
|
74
|
+
transition: string;
|
|
74
75
|
inline: "start" | "middle" | "end";
|
|
75
76
|
stack: boolean;
|
|
76
77
|
block: "top" | "bottom" | "center";
|
|
77
78
|
position: "fixed" | "absolute";
|
|
78
|
-
transition: string;
|
|
79
79
|
}, {}>, {
|
|
80
80
|
before?(_: {}): any;
|
|
81
81
|
default?(_: {}): any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { unref, inject, computed, toRef, toRefs, defineComponent, h, useSlots, ref, watchEffect, watch, onMounted, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode,
|
|
1
|
+
import { unref, inject, computed, toRef, toRefs, isRef, defineComponent, h, useSlots, ref, watchEffect, watch, onMounted, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode, vModelCheckbox, renderSlot, createTextVNode, toDisplayString, createVNode, createSlots, withCtx, normalizeProps, guardReactiveProps } from "vue";
|
|
2
2
|
import { nanoid } from "nanoid";
|
|
3
3
|
var Side = /* @__PURE__ */ ((Side2) => {
|
|
4
4
|
Side2["left"] = "left";
|
|
@@ -488,19 +488,26 @@ function joinLines(items) {
|
|
|
488
488
|
return items;
|
|
489
489
|
}
|
|
490
490
|
function HintSlotFactory(propsOrRef, slots) {
|
|
491
|
-
const props =
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
491
|
+
const props = computed(() => {
|
|
492
|
+
if (isRef(propsOrRef)) {
|
|
493
|
+
return propsOrRef.value;
|
|
494
|
+
}
|
|
495
|
+
return propsOrRef;
|
|
496
|
+
});
|
|
497
|
+
const invalidLabel = computed(() => joinLines(props.value.invalidLabel));
|
|
498
|
+
const validLabel = computed(() => joinLines(props.value.validLabel));
|
|
499
|
+
const loadingLabel = computed(() => props.value.loadingLabel);
|
|
500
|
+
const hintLabel = computed(() => props.value.hintLabel);
|
|
496
501
|
const hasLoadingLabelOrSlot = computed(
|
|
497
|
-
() => Boolean(props.loading && (slots.loading || loadingLabel.value))
|
|
502
|
+
() => Boolean(props.value.loading && (slots.loading || loadingLabel.value))
|
|
498
503
|
);
|
|
499
504
|
const hasInvalidLabelOrSlot = computed(
|
|
500
|
-
() => !hasLoadingLabelOrSlot.value && Boolean(
|
|
505
|
+
() => !hasLoadingLabelOrSlot.value && Boolean(
|
|
506
|
+
props.value.invalid && (slots.invalid || invalidLabel.value)
|
|
507
|
+
)
|
|
501
508
|
);
|
|
502
509
|
const hasValidLabelOrSlot = computed(
|
|
503
|
-
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.valid && (slots.valid || validLabel.value))
|
|
510
|
+
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.value.valid && (slots.valid || validLabel.value))
|
|
504
511
|
);
|
|
505
512
|
const hasHintLabelOrSlot = computed(
|
|
506
513
|
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && !hasValidLabelOrSlot.value && Boolean(slots.hint || hintLabel.value)
|
|
@@ -509,10 +516,10 @@ function HintSlotFactory(propsOrRef, slots) {
|
|
|
509
516
|
() => hasInvalidLabelOrSlot.value || hasValidLabelOrSlot.value || hasLoadingLabelOrSlot.value || hasHintLabelOrSlot.value
|
|
510
517
|
);
|
|
511
518
|
const hintSlotScope = computed(() => ({
|
|
512
|
-
modelValue: props.modelValue,
|
|
513
|
-
valid: props.valid,
|
|
514
|
-
invalid: props.invalid,
|
|
515
|
-
loading: props.loading
|
|
519
|
+
modelValue: props.value.modelValue,
|
|
520
|
+
valid: props.value.valid,
|
|
521
|
+
invalid: props.value.invalid,
|
|
522
|
+
loading: props.value.loading
|
|
516
523
|
}));
|
|
517
524
|
const HintSlot = defineComponent({
|
|
518
525
|
name: "HintSlot",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("nanoid")):"function"==typeof define&&define.amd?define(["vue","nanoid"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckbox=l(e.vue,e.nanoid)}(this,(function(e,l){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),a=(e=>(e.before="before",e.after="after",e))(a||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{});const o=Symbol.for("volver"),i=Symbol.for("checkGroup"),r={valid:Boolean,validLabel:[String,Array]},u={invalid:Boolean,invalidLabel:[String,Array]},d={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},s={disabled:Boolean},v=(Boolean,Boolean,{label:[String,Number]}),c={readonly:Boolean},f={modifiers:[String,Array]},
|
|
1
|
+
!function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("nanoid")):"function"==typeof define&&define.amd?define(["vue","nanoid"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckbox=l(e.vue,e.nanoid)}(this,(function(e,l){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),a=(e=>(e.before="before",e.after="after",e))(a||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{});const o=Symbol.for("volver"),i=Symbol.for("checkGroup"),r={valid:Boolean,validLabel:[String,Array]},u={invalid:Boolean,invalidLabel:[String,Array]},d={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},s={disabled:Boolean},v=(Boolean,Boolean,{label:[String,Number]}),c={readonly:Boolean},f={modifiers:[String,Array]},p={hintLabel:{type:String,default:""}};a.before;const b={tabindex:{type:[String,Number],default:0}},h={id:[String,Number]};t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const m={...{...h,name:{type:String,required:!0}},...b,...r,...u,...p,...s,...c,...f,...v,...d,value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String]};function g(e,l,t){return t?S(e,t)===S(l,t):y(e,l)}function y(e,l){if(e===l)return!0;if(e&&l&&"object"==typeof e&&"object"==typeof l){const t=Array.isArray(e),a=Array.isArray(l);let n,o,i;if(t&&a){if(o=e.length,o!=l.length)return!1;for(n=o;0!=n--;)if(!y(e[n],l[n]))return!1;return!0}if(t!=a)return!1;const r=e instanceof Date,u=l instanceof Date;if(r!=u)return!1;if(r&&u)return e.getTime()==l.getTime();const d=e instanceof RegExp,s=l instanceof RegExp;if(d!=s)return!1;if(d&&s)return e.toString()==l.toString();const v=Object.keys(e);if(o=v.length,o!==Object.keys(l).length)return!1;for(n=o;0!=n--;)if(!Object.prototype.hasOwnProperty.call(l,v[n]))return!1;for(n=o;0!=n--;)if(i=v[n],!y(e[i],l[i]))return!1;return!0}return e!=e&&l!=l}function S(e,l){if(e&&Object.keys(e).length&&l){if(-1===l.indexOf("."))return e[l];{const t=l.split(".");let a=e;for(let l=0,n=t.length;l<n;++l){if(null==e)return null;a=a[t[l]]}return a}}return null}function L(l){const t=e.inject(l,void 0),a=e.computed((()=>{return l=t,!(null==(a=e.unref(l))||""===a||Array.isArray(a)&&0===a.length||!(a instanceof Date)&&"object"==typeof a&&0===Object.keys(a).length);var l,a}));return{group:t,isInGroup:a,getGroupOrLocalRef:function(l,a,n){if(null==t?void 0:t.value){const a=e.unref(t.value)[l];return e.computed({get:()=>null==a?void 0:a.value,set(e){a.value=e}})}const o=e.toRef(a,l);return e.computed({get:()=>o.value,set(e){n&&n(`update:${l}`,e)}})}}}n.button;const O={...m,...f,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function k(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}function B(l,t,a){const n=e.inject(o),i=e.computed((()=>{var e;if(n&&(null==(e=n.defaults.value)?void 0:e[l]))return n.defaults.value[l]}));return e.computed((()=>{if(void 0===i.value)return a;const e=i.value,l=t,n=a;return Object.keys(l).reduce(((t,a)=>{const o=n[a];if(t[a]=o,a in e){if(Array.isArray(l[a])){const n=l[a];if(n.length){n[0]===o&&(t[a]=e[a])}}if("function"==typeof l[a]){(0,l[a])()===o&&(t[a]=e[a])}if("object"==typeof l[a]){let n=l[a].default;"function"==typeof n&&(n=n()),"object"==typeof n?JSON.stringify(n)===JSON.stringify(o)&&(t[a]=e[a]):n===o&&(t[a]=e[a])}}return t}),{})}))}const V=["for"],x=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"];return e.defineComponent({name:"VvCheckbox",props:O,emits:["click","update:modelValue","change","blur"],setup(t,{emit:a}){const n=t,o=e.useSlots(),r=B("VvCheckbox",O,n),{id:u,disabled:d,readonly:s,valid:v,invalid:c,propsSwitch:f,modelValue:p,indeterminate:b,isInGroup:h}=function(l,t){const{group:a,isInGroup:n,getGroupOrLocalRef:o}=L(i),{id:r,switch:u,indeterminate:d}=e.toRefs(l),s=o("modelValue",l,t),v=o("valid",l),c=o("invalid",l),f=e.computed((()=>{var e;return Boolean(l.readonly||(null==(e=null==a?void 0:a.value)?void 0:e.readonly.value))})),p=e.computed((()=>{var e;return Boolean(l.disabled||(null==(e=null==a?void 0:a.value)?void 0:e.disabled.value))}));return{id:r,propsSwitch:u,indeterminate:d,group:a,isInGroup:n,modelValue:s,valid:v,invalid:c,readonly:f,disabled:p}}(n,a),m=(t=>e.computed((()=>String((null==t?void 0:t.value)||l.nanoid()))))(u),y=e.computed((()=>`${m.value}-hint`)),S=e.computed((()=>j.value?-1:n.tabindex)),A=e.ref(),$=e.computed((()=>void 0!==n.uncheckedValue&&!h.value)),j=e.computed((()=>d.value||s.value)),w=e.computed((()=>!0===c.value||!0!==v.value&&void 0)),R=e.computed((()=>$.value?p.value===n.value:Array.isArray(p.value)?function(e,l){if(null!=e&&l&&l.length)for(const t of l)if(g(e,t))return!0;return!1}(n.value,p.value):g(n.value,p.value))),C=e.computed((()=>!!b.value||!(R.value||!$.value||n.uncheckedValue===p.value))),N=e.computed((()=>{if(!$.value)return!["string","number","boolean"].includes(typeof n.value)||n.value})),I=e.computed({get:()=>R.value,set(e){if($.value)p.value=e?n.value:n.uncheckedValue;else if(Array.isArray(p.value)||h.value){const l=new Set(Array.isArray(p.value)?p.value:void 0!==p.value?[p.value]:[]);e?l.add(n.value):l.delete(n.value),p.value=[...l]}else p.value=e?n.value:void 0;a("change",e)}}),{modifiers:P}=e.toRefs(n),E=function(l,t,a){return e.computed((()=>{const n={[l]:!0},o="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return o&&Array.isArray(o)&&o.forEach((e=>{e&&(n[`${l}--${e}`]=!0)})),a&&Object.keys(a.value).forEach((t=>{n[`${l}--${t}`]=e.unref(a.value[t])})),n}))}("vv-checkbox",P,e.computed((()=>({switch:f.value,valid:v.value,invalid:c.value,disabled:d.value,readonly:s.value,indeterminate:b.value}))));e.watchEffect((()=>{$.value&&Array.isArray(p.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")})),e.watch((()=>C.value),(e=>{A.value.indeterminate=!!e})),e.onMounted((()=>{C.value&&(A.value.indeterminate=!0)}));const{HintSlot:G,hasHintLabelOrSlot:H,hasInvalidLabelOrSlot:T,hintSlotScope:_}=function(l,t){const a=e.computed((()=>e.isRef(l)?l.value:l)),n=e.computed((()=>k(a.value.invalidLabel))),o=e.computed((()=>k(a.value.validLabel))),i=e.computed((()=>a.value.loadingLabel)),r=e.computed((()=>a.value.hintLabel)),u=e.computed((()=>Boolean(a.value.loading&&(t.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(a.value.invalid&&(t.invalid||n.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(a.value.valid&&(t.valid||o.value)))),v=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(t.hint||r.value))),c=e.computed((()=>d.value||s.value||u.value||v.value)),f=e.computed((()=>({modelValue:a.value.modelValue,valid:a.value.valid,invalid:a.value.invalid,loading:a.value.loading}))),p=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:c,invalidLabel:n,validLabel:o,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:v}),render(){var l,t,a,n,o,i,r,u;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(t=(l=this.$slots).loading)?void 0:t.call(l))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(n=(a=this.$slots).invalid)?void 0:n.call(a))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(o=this.$slots).valid)?void 0:i.call(o))??this.validLabel):e.h(this.tag,{role:d},(null==(u=(r=this.$slots).hint)?void 0:u.call(r))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:d,hasHintLabelOrSlot:v,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:f,HintSlot:p}}(r,o);return(l,t)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(E)),for:e.unref(m)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(m),ref_key:"input",ref:A,"onUpdate:modelValue":t[0]||(t[0]=l=>e.isRef(I)?I.value=l:null),type:"checkbox",class:"vv-checkbox__input",name:l.name,disabled:e.unref(j),value:e.unref(N),tabindex:e.unref(S),"aria-invalid":e.unref(w),"aria-describedby":e.unref(H)?e.unref(y):void 0,"aria-errormessage":e.unref(T)?e.unref(y):void 0},null,8,x),[[e.vModelCheckbox,e.unref(I)]]),e.renderSlot(l.$slots,"default",{value:e.unref(p)},(()=>[e.createTextVNode(e.toDisplayString(l.label),1)])),e.createVNode(e.unref(G),{id:e.unref(y),class:"vv-checkbox__hint"},e.createSlots({_:2},[l.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"0"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"1"}:void 0,l.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"2"}:void 0,l.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"3"}:void 0]),1032,["id"])],10,V))}})}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { unref, computed, defineComponent, h, inject, toRef, toRefs, useSlots, ref, watchEffect, watch, onMounted, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode,
|
|
1
|
+
import { unref, computed, isRef, defineComponent, h, inject, toRef, toRefs, useSlots, ref, watchEffect, watch, onMounted, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode, vModelCheckbox, renderSlot, createTextVNode, toDisplayString, createVNode, createSlots, withCtx, normalizeProps, guardReactiveProps, provide, createCommentVNode, Fragment, renderList, createBlock, mergeProps } from "vue";
|
|
2
2
|
import { nanoid } from "nanoid";
|
|
3
3
|
import { useVModel } from "@vueuse/core";
|
|
4
4
|
import { get } from "ts-dot-prop";
|
|
@@ -132,19 +132,26 @@ function joinLines(items) {
|
|
|
132
132
|
return items;
|
|
133
133
|
}
|
|
134
134
|
function HintSlotFactory(propsOrRef, slots) {
|
|
135
|
-
const props =
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
135
|
+
const props = computed(() => {
|
|
136
|
+
if (isRef(propsOrRef)) {
|
|
137
|
+
return propsOrRef.value;
|
|
138
|
+
}
|
|
139
|
+
return propsOrRef;
|
|
140
|
+
});
|
|
141
|
+
const invalidLabel = computed(() => joinLines(props.value.invalidLabel));
|
|
142
|
+
const validLabel = computed(() => joinLines(props.value.validLabel));
|
|
143
|
+
const loadingLabel = computed(() => props.value.loadingLabel);
|
|
144
|
+
const hintLabel = computed(() => props.value.hintLabel);
|
|
140
145
|
const hasLoadingLabelOrSlot = computed(
|
|
141
|
-
() => Boolean(props.loading && (slots.loading || loadingLabel.value))
|
|
146
|
+
() => Boolean(props.value.loading && (slots.loading || loadingLabel.value))
|
|
142
147
|
);
|
|
143
148
|
const hasInvalidLabelOrSlot = computed(
|
|
144
|
-
() => !hasLoadingLabelOrSlot.value && Boolean(
|
|
149
|
+
() => !hasLoadingLabelOrSlot.value && Boolean(
|
|
150
|
+
props.value.invalid && (slots.invalid || invalidLabel.value)
|
|
151
|
+
)
|
|
145
152
|
);
|
|
146
153
|
const hasValidLabelOrSlot = computed(
|
|
147
|
-
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.valid && (slots.valid || validLabel.value))
|
|
154
|
+
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.value.valid && (slots.valid || validLabel.value))
|
|
148
155
|
);
|
|
149
156
|
const hasHintLabelOrSlot = computed(
|
|
150
157
|
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && !hasValidLabelOrSlot.value && Boolean(slots.hint || hintLabel.value)
|
|
@@ -153,10 +160,10 @@ function HintSlotFactory(propsOrRef, slots) {
|
|
|
153
160
|
() => hasInvalidLabelOrSlot.value || hasValidLabelOrSlot.value || hasLoadingLabelOrSlot.value || hasHintLabelOrSlot.value
|
|
154
161
|
);
|
|
155
162
|
const hintSlotScope = computed(() => ({
|
|
156
|
-
modelValue: props.modelValue,
|
|
157
|
-
valid: props.valid,
|
|
158
|
-
invalid: props.invalid,
|
|
159
|
-
loading: props.loading
|
|
163
|
+
modelValue: props.value.modelValue,
|
|
164
|
+
valid: props.value.valid,
|
|
165
|
+
invalid: props.value.invalid,
|
|
166
|
+
loading: props.value.loading
|
|
160
167
|
}));
|
|
161
168
|
const HintSlot = defineComponent({
|
|
162
169
|
name: "HintSlot",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("nanoid"),require("@vueuse/core"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","nanoid","@vueuse/core","ts-dot-prop"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckboxGroup=t(e.vue,e.nanoid,e.core,e.tsDotProp)}(this,(function(e,t,l,o){"use strict";var a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),n=(e=>(e.before="before",e.after="after",e))(n||{}),i=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(i||{});const r=Symbol.for("volver"),u=Symbol.for("checkGroup");function d(e,t,l){return l?v(e,l)===v(t,l):s(e,t)}function s(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,i;if(l&&o){if(n=e.length,n!=t.length)return!1;for(a=n;0!=a--;)if(!s(e[a],t[a]))return!1;return!0}if(l!=o)return!1;const r=e instanceof Date,u=t instanceof Date;if(r!=u)return!1;if(r&&u)return e.getTime()==t.getTime();const d=e instanceof RegExp,v=t instanceof RegExp;if(d!=v)return!1;if(d&&v)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(i=c[a],!s(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function v(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 c(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}function f(t,l){const o=e.unref(t),a=e.computed((()=>c(o.invalidLabel))),n=e.computed((()=>c(o.validLabel))),i=e.computed((()=>o.loadingLabel)),r=e.computed((()=>o.hintLabel)),u=e.computed((()=>Boolean(o.loading&&(l.loading||i.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)))),v=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(l.hint||r.value))),f=e.computed((()=>d.value||s.value||u.value||v.value)),p=e.computed((()=>({modelValue:o.modelValue,valid:o.valid,invalid:o.invalid,loading:o.loading}))),b=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:f,invalidLabel:a,validLabel:n,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:v}),render(){var t,l,o,a,n,i,r,u;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(l=(t=this.$slots).loading)?void 0:l.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(a=(o=this.$slots).invalid)?void 0:a.call(o))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(n=this.$slots).valid)?void 0:i.call(n))??this.validLabel):e.h(this.tag,{role:d},(null==(u=(r=this.$slots).hint)?void 0:u.call(r))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:d,hasHintLabelOrSlot:v,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:p,HintSlot:b}}const p={valid:Boolean,validLabel:[String,Array]},b={invalid:Boolean,invalidLabel:[String,Array]},m={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},h={disabled:Boolean},g=(Boolean,Boolean,{label:[String,Number]}),y={readonly:Boolean},S={modifiers:[String,Array]},k={hintLabel:{type:String,default:""}},L={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}};n.before;const B={tabindex:{type:[String,Number],default:0}},O={id:[String,Number]};a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const V={...{...O,name:{type:String,required:!0}},...B,...p,...b,...k,...h,...y,...S,...g,...m,value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String]},x={...p,...b,...L,...k,...h,...y,...S,...g,...m,modelValue:[String,Array,Boolean,Number,Symbol],name:{type:String,required:!0},vertical:Boolean};function $(t){const l=e.inject(t,void 0),o=e.computed((()=>{return t=l,!(null==(o=e.unref(t))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length);var t,o}));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)}})}}}i.button;const A={...V,...S,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function C(t,l,o){const a=e.inject(r),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 j(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 w=["for"],P=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"],R=e.defineComponent({name:"VvCheckbox",props:A,emits:["click","update:modelValue","change","blur"],setup(l,{emit:o}){const a=l,n=e.useSlots(),i=C("VvCheckbox",A,a),{id:r,disabled:s,readonly:v,valid:c,invalid:p,propsSwitch:b,modelValue:m,indeterminate:h,isInGroup:g}=function(t,l){const{group:o,isInGroup:a,getGroupOrLocalRef:n}=$(u),{id:i,switch:r,indeterminate:d}=e.toRefs(t),s=n("modelValue",t,l),v=n("valid",t),c=n("invalid",t),f=e.computed((()=>{var e;return Boolean(t.readonly||(null==(e=null==o?void 0:o.value)?void 0:e.readonly.value))})),p=e.computed((()=>{var e;return Boolean(t.disabled||(null==(e=null==o?void 0:o.value)?void 0:e.disabled.value))}));return{id:i,propsSwitch:r,indeterminate:d,group:o,isInGroup:a,modelValue:s,valid:v,invalid:c,readonly:f,disabled:p}}(a,o),y=(l=>e.computed((()=>String((null==l?void 0:l.value)||t.nanoid()))))(r),S=e.computed((()=>`${y.value}-hint`)),k=e.computed((()=>O.value?-1:a.tabindex)),L=e.ref(),B=e.computed((()=>void 0!==a.uncheckedValue&&!g.value)),O=e.computed((()=>s.value||v.value)),V=e.computed((()=>!0===p.value||!0!==c.value&&void 0)),x=e.computed((()=>B.value?m.value===a.value:Array.isArray(m.value)?function(e,t){if(null!=e&&t&&t.length)for(const l of t)if(d(e,l))return!0;return!1}(a.value,m.value):d(a.value,m.value))),R=e.computed((()=>!!h.value||!(x.value||!B.value||a.uncheckedValue===m.value))),N=e.computed((()=>{if(!B.value)return!["string","number","boolean"].includes(typeof a.value)||a.value})),E=e.computed({get:()=>x.value,set(e){if(B.value)m.value=e?a.value:a.uncheckedValue;else if(Array.isArray(m.value)||g.value){const t=new Set(Array.isArray(m.value)?m.value:void 0!==m.value?[m.value]:[]);e?t.add(a.value):t.delete(a.value),m.value=[...t]}else m.value=e?a.value:void 0;o("change",e)}}),{modifiers:_}=e.toRefs(a),z=j("vv-checkbox",_,e.computed((()=>({switch:b.value,valid:c.value,invalid:p.value,disabled:s.value,readonly:v.value,indeterminate:h.value}))));e.watchEffect((()=>{B.value&&Array.isArray(m.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")})),e.watch((()=>R.value),(e=>{L.value.indeterminate=!!e})),e.onMounted((()=>{R.value&&(L.value.indeterminate=!0)}));const{HintSlot:G,hasHintLabelOrSlot:I,hasInvalidLabelOrSlot:D,hintSlotScope:H}=f(i,n);return(t,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(z)),for:e.unref(y)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(y),ref_key:"input",ref:L,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(E)?E.value=t:null),type:"checkbox",class:"vv-checkbox__input",name:t.name,disabled:e.unref(O),value:e.unref(N),tabindex:e.unref(k),"aria-invalid":e.unref(V),"aria-describedby":e.unref(I)?e.unref(S):void 0,"aria-errormessage":e.unref(D)?e.unref(S):void 0},null,8,P),[[e.vModelCheckbox,e.unref(E)]]),e.renderSlot(t.$slots,"default",{value:e.unref(m)},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)])),e.createVNode(e.unref(G),{id:e.unref(S),class:"vv-checkbox__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"3"}:void 0]),1032,["id"])],10,w))}}),N=x;const E=["textContent"],_={class:"vv-checkbox-group__wrapper"};return e.defineComponent({name:"VvCheckboxGroup",props:N,emits:["update:modelValue","change"],setup(t,{emit:a}){const n=t,i=e.useSlots(),r=C("VvCheckboxGroup",N,n),d=l.useVModel(n,"modelValue",a),{disabled:s,readonly:v,vertical:c,valid:p,invalid:b,modifiers:m}=e.toRefs(n);!function(t){if(Object.keys(t).some((l=>"key"!==l&&!e.isRef(t[l]))))throw Error("One or more groupState props aren't ref.");e.provide(t.key,e.computed((()=>t)))}({key:u,modelValue:d,disabled:s,readonly:v,valid:p,invalid:b});const{getOptionLabel:h,getOptionValue:g}=function(t){const{options:l,labelKey:a,valueKey:n,disabledKey:i}=e.toRefs(t);return{options:l,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof a.value?a.value(e):o.get(e,a.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof n.value?n.value(e):o.get(e,n.value),getOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof i.value?i.value(e):o.get(e,i.value)),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(n),y=j("vv-checkbox-group",m,e.computed((()=>({disabled:s.value,readonly:v.value,horizontal:!c.value,valid:p.value,invalid:b.value})))),{HintSlot:S,hintSlotScope:k}=f(r,i);return(t,l)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(y))},[t.label?(e.openBlock(),e.createElementBlock("legend",{key:0,textContent:e.toDisplayString(t.label)},null,8,E)):e.createCommentVNode("",!0),e.createElementVNode("div",_,[t.options.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.options,((t,l)=>(e.openBlock(),e.createBlock(R,e.mergeProps({key:l},((e,t)=>({id:`${n.name}_opt${t}`,name:n.name,label:h(e),value:g(e)}))(t,l)),null,16)))),128)):e.renderSlot(t.$slots,"default",{key:1})]),e.createVNode(e.unref(S),{class:"vv-checkbox-group__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"3"}:void 0]),1024)],2))}})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("nanoid"),require("@vueuse/core"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","nanoid","@vueuse/core","ts-dot-prop"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckboxGroup=t(e.vue,e.nanoid,e.core,e.tsDotProp)}(this,(function(e,t,l,a){"use strict";var o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),n=(e=>(e.before="before",e.after="after",e))(n||{}),i=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(i||{});const r=Symbol.for("volver"),u=Symbol.for("checkGroup");function d(e,t,l){return l?v(e,l)===v(t,l):s(e,t)}function s(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const l=Array.isArray(e),a=Array.isArray(t);let o,n,i;if(l&&a){if(n=e.length,n!=t.length)return!1;for(o=n;0!=o--;)if(!s(e[o],t[o]))return!1;return!0}if(l!=a)return!1;const r=e instanceof Date,u=t instanceof Date;if(r!=u)return!1;if(r&&u)return e.getTime()==t.getTime();const d=e instanceof RegExp,v=t instanceof RegExp;if(d!=v)return!1;if(d&&v)return e.toString()==t.toString();const c=Object.keys(e);if(n=c.length,n!==Object.keys(t).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(t,c[o]))return!1;for(o=n;0!=o--;)if(i=c[o],!s(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function v(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const l=t.split(".");let a=e;for(let t=0,o=l.length;t<o;++t){if(null==e)return null;a=a[l[t]]}return a}}return null}function c(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}function f(t,l){const a=e.computed((()=>e.isRef(t)?t.value:t)),o=e.computed((()=>c(a.value.invalidLabel))),n=e.computed((()=>c(a.value.validLabel))),i=e.computed((()=>a.value.loadingLabel)),r=e.computed((()=>a.value.hintLabel)),u=e.computed((()=>Boolean(a.value.loading&&(l.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(a.value.invalid&&(l.invalid||o.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(a.value.valid&&(l.valid||n.value)))),v=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(l.hint||r.value))),f=e.computed((()=>d.value||s.value||u.value||v.value)),p=e.computed((()=>({modelValue:a.value.modelValue,valid:a.value.valid,invalid:a.value.invalid,loading:a.value.loading}))),m=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:f,invalidLabel:o,validLabel:n,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:v}),render(){var t,l,a,o,n,i,r,u;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(l=(t=this.$slots).loading)?void 0:l.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(o=(a=this.$slots).invalid)?void 0:o.call(a))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(n=this.$slots).valid)?void 0:i.call(n))??this.validLabel):e.h(this.tag,{role:d},(null==(u=(r=this.$slots).hint)?void 0:u.call(r))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:d,hasHintLabelOrSlot:v,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:p,HintSlot:m}}const p={valid:Boolean,validLabel:[String,Array]},m={invalid:Boolean,invalidLabel:[String,Array]},b={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},h={disabled:Boolean},g=(Boolean,Boolean,{label:[String,Number]}),y={readonly:Boolean},S={modifiers:[String,Array]},k={hintLabel:{type:String,default:""}},L={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}};n.before;const B={tabindex:{type:[String,Number],default:0}},O={id:[String,Number]};o.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const V={...{...O,name:{type:String,required:!0}},...B,...p,...m,...k,...h,...y,...S,...g,...b,value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String]},x={...p,...m,...L,...k,...h,...y,...S,...g,...b,modelValue:[String,Array,Boolean,Number,Symbol],name:{type:String,required:!0},vertical:Boolean};function $(t){const l=e.inject(t,void 0),a=e.computed((()=>{return t=l,!(null==(a=e.unref(t))||""===a||Array.isArray(a)&&0===a.length||!(a instanceof Date)&&"object"==typeof a&&0===Object.keys(a).length);var t,a}));return{group:l,isInGroup:a,getGroupOrLocalRef:function(t,a,o){if(null==l?void 0:l.value){const a=e.unref(l.value)[t];return e.computed({get:()=>null==a?void 0:a.value,set(e){a.value=e}})}const n=e.toRef(a,t);return e.computed({get:()=>n.value,set(e){o&&o(`update:${t}`,e)}})}}}i.button;const A={...V,...S,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function C(t,l,a){const o=e.inject(r),n=e.computed((()=>{var e;if(o&&(null==(e=o.defaults.value)?void 0:e[t]))return o.defaults.value[t]}));return e.computed((()=>{if(void 0===n.value)return a;const e=n.value,t=l,o=a;return Object.keys(t).reduce(((l,a)=>{const n=o[a];if(l[a]=n,a in e){if(Array.isArray(t[a])){const o=t[a];if(o.length){o[0]===n&&(l[a]=e[a])}}if("function"==typeof t[a]){(0,t[a])()===n&&(l[a]=e[a])}if("object"==typeof t[a]){let o=t[a].default;"function"==typeof o&&(o=o()),"object"==typeof o?JSON.stringify(o)===JSON.stringify(n)&&(l[a]=e[a]):o===n&&(l[a]=e[a])}}return l}),{})}))}function j(t,l,a){return e.computed((()=>{const o={[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&&(o[`${t}--${e}`]=!0)})),a&&Object.keys(a.value).forEach((l=>{o[`${t}--${l}`]=e.unref(a.value[l])})),o}))}const w=["for"],R=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"],P=e.defineComponent({name:"VvCheckbox",props:A,emits:["click","update:modelValue","change","blur"],setup(l,{emit:a}){const o=l,n=e.useSlots(),i=C("VvCheckbox",A,o),{id:r,disabled:s,readonly:v,valid:c,invalid:p,propsSwitch:m,modelValue:b,indeterminate:h,isInGroup:g}=function(t,l){const{group:a,isInGroup:o,getGroupOrLocalRef:n}=$(u),{id:i,switch:r,indeterminate:d}=e.toRefs(t),s=n("modelValue",t,l),v=n("valid",t),c=n("invalid",t),f=e.computed((()=>{var e;return Boolean(t.readonly||(null==(e=null==a?void 0:a.value)?void 0:e.readonly.value))})),p=e.computed((()=>{var e;return Boolean(t.disabled||(null==(e=null==a?void 0:a.value)?void 0:e.disabled.value))}));return{id:i,propsSwitch:r,indeterminate:d,group:a,isInGroup:o,modelValue:s,valid:v,invalid:c,readonly:f,disabled:p}}(o,a),y=(l=>e.computed((()=>String((null==l?void 0:l.value)||t.nanoid()))))(r),S=e.computed((()=>`${y.value}-hint`)),k=e.computed((()=>O.value?-1:o.tabindex)),L=e.ref(),B=e.computed((()=>void 0!==o.uncheckedValue&&!g.value)),O=e.computed((()=>s.value||v.value)),V=e.computed((()=>!0===p.value||!0!==c.value&&void 0)),x=e.computed((()=>B.value?b.value===o.value:Array.isArray(b.value)?function(e,t){if(null!=e&&t&&t.length)for(const l of t)if(d(e,l))return!0;return!1}(o.value,b.value):d(o.value,b.value))),P=e.computed((()=>!!h.value||!(x.value||!B.value||o.uncheckedValue===b.value))),N=e.computed((()=>{if(!B.value)return!["string","number","boolean"].includes(typeof o.value)||o.value})),E=e.computed({get:()=>x.value,set(e){if(B.value)b.value=e?o.value:o.uncheckedValue;else if(Array.isArray(b.value)||g.value){const t=new Set(Array.isArray(b.value)?b.value:void 0!==b.value?[b.value]:[]);e?t.add(o.value):t.delete(o.value),b.value=[...t]}else b.value=e?o.value:void 0;a("change",e)}}),{modifiers:_}=e.toRefs(o),z=j("vv-checkbox",_,e.computed((()=>({switch:m.value,valid:c.value,invalid:p.value,disabled:s.value,readonly:v.value,indeterminate:h.value}))));e.watchEffect((()=>{B.value&&Array.isArray(b.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")})),e.watch((()=>P.value),(e=>{L.value.indeterminate=!!e})),e.onMounted((()=>{P.value&&(L.value.indeterminate=!0)}));const{HintSlot:G,hasHintLabelOrSlot:I,hasInvalidLabelOrSlot:D,hintSlotScope:H}=f(i,n);return(t,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(z)),for:e.unref(y)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(y),ref_key:"input",ref:L,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(E)?E.value=t:null),type:"checkbox",class:"vv-checkbox__input",name:t.name,disabled:e.unref(O),value:e.unref(N),tabindex:e.unref(k),"aria-invalid":e.unref(V),"aria-describedby":e.unref(I)?e.unref(S):void 0,"aria-errormessage":e.unref(D)?e.unref(S):void 0},null,8,R),[[e.vModelCheckbox,e.unref(E)]]),e.renderSlot(t.$slots,"default",{value:e.unref(b)},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)])),e.createVNode(e.unref(G),{id:e.unref(S),class:"vv-checkbox__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"3"}:void 0]),1032,["id"])],10,w))}}),N=x;const E=["textContent"],_={class:"vv-checkbox-group__wrapper"};return e.defineComponent({name:"VvCheckboxGroup",props:N,emits:["update:modelValue","change"],setup(t,{emit:o}){const n=t,i=e.useSlots(),r=C("VvCheckboxGroup",N,n),d=l.useVModel(n,"modelValue",o),{disabled:s,readonly:v,vertical:c,valid:p,invalid:m,modifiers:b}=e.toRefs(n);!function(t){if(Object.keys(t).some((l=>"key"!==l&&!e.isRef(t[l]))))throw Error("One or more groupState props aren't ref.");e.provide(t.key,e.computed((()=>t)))}({key:u,modelValue:d,disabled:s,readonly:v,valid:p,invalid:m});const{getOptionLabel:h,getOptionValue:g}=function(t){const{options:l,labelKey:o,valueKey:n,disabledKey:i}=e.toRefs(t);return{options:l,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof o.value?o.value(e):a.get(e,o.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof n.value?n.value(e):a.get(e,n.value),getOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof i.value?i.value(e):a.get(e,i.value)),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(n),y=j("vv-checkbox-group",b,e.computed((()=>({disabled:s.value,readonly:v.value,horizontal:!c.value,valid:p.value,invalid:m.value})))),{HintSlot:S,hintSlotScope:k}=f(r,i);return(t,l)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(y))},[t.label?(e.openBlock(),e.createElementBlock("legend",{key:0,textContent:e.toDisplayString(t.label)},null,8,E)):e.createCommentVNode("",!0),e.createElementVNode("div",_,[t.options.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.options,((t,l)=>(e.openBlock(),e.createBlock(P,e.mergeProps({key:l},((e,t)=>({id:`${n.name}_opt${t}`,name:n.name,label:h(e),value:g(e)}))(t,l)),null,16)))),128)):e.renderSlot(t.$slots,"default",{key:1})]),e.createVNode(e.unref(S),{class:"vv-checkbox-group__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"3"}:void 0]),1024)],2))}})}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { inject, computed, unref, defineComponent, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, provide, h, Fragment, useAttrs, onMounted, watch, nextTick, createElementBlock, createVNode, withCtx, renderSlot, normalizeProps, guardReactiveProps, Transition, toHandlers, withDirectives, createElementVNode, normalizeStyle, normalizeClass, vShow, createTextVNode, toDisplayString,
|
|
1
|
+
import { inject, computed, unref, defineComponent, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, provide, h, Fragment, useAttrs, onMounted, watch, nextTick, createElementBlock, createVNode, withCtx, renderSlot, normalizeProps, guardReactiveProps, Transition, toHandlers, withDirectives, createElementVNode, normalizeStyle, normalizeClass, vShow, createTextVNode, toDisplayString, isRef, useSlots, renderList, vModelSelect, createSlots, resolveDynamicComponent, toRef, withModifiers, vModelText } from "vue";
|
|
2
2
|
import { iconExists, Icon, addIcon } from "@iconify/vue";
|
|
3
3
|
import { autoPlacement, flip, shift, size, offset, arrow, useFloating, autoUpdate } from "@floating-ui/vue";
|
|
4
4
|
import { nanoid } from "nanoid";
|
|
@@ -1456,19 +1456,26 @@ function joinLines(items) {
|
|
|
1456
1456
|
return items;
|
|
1457
1457
|
}
|
|
1458
1458
|
function HintSlotFactory(propsOrRef, slots) {
|
|
1459
|
-
const props =
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1459
|
+
const props = computed(() => {
|
|
1460
|
+
if (isRef(propsOrRef)) {
|
|
1461
|
+
return propsOrRef.value;
|
|
1462
|
+
}
|
|
1463
|
+
return propsOrRef;
|
|
1464
|
+
});
|
|
1465
|
+
const invalidLabel = computed(() => joinLines(props.value.invalidLabel));
|
|
1466
|
+
const validLabel = computed(() => joinLines(props.value.validLabel));
|
|
1467
|
+
const loadingLabel = computed(() => props.value.loadingLabel);
|
|
1468
|
+
const hintLabel = computed(() => props.value.hintLabel);
|
|
1464
1469
|
const hasLoadingLabelOrSlot = computed(
|
|
1465
|
-
() => Boolean(props.loading && (slots.loading || loadingLabel.value))
|
|
1470
|
+
() => Boolean(props.value.loading && (slots.loading || loadingLabel.value))
|
|
1466
1471
|
);
|
|
1467
1472
|
const hasInvalidLabelOrSlot = computed(
|
|
1468
|
-
() => !hasLoadingLabelOrSlot.value && Boolean(
|
|
1473
|
+
() => !hasLoadingLabelOrSlot.value && Boolean(
|
|
1474
|
+
props.value.invalid && (slots.invalid || invalidLabel.value)
|
|
1475
|
+
)
|
|
1469
1476
|
);
|
|
1470
1477
|
const hasValidLabelOrSlot = computed(
|
|
1471
|
-
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.valid && (slots.valid || validLabel.value))
|
|
1478
|
+
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.value.valid && (slots.valid || validLabel.value))
|
|
1472
1479
|
);
|
|
1473
1480
|
const hasHintLabelOrSlot = computed(
|
|
1474
1481
|
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && !hasValidLabelOrSlot.value && Boolean(slots.hint || hintLabel.value)
|
|
@@ -1477,10 +1484,10 @@ function HintSlotFactory(propsOrRef, slots) {
|
|
|
1477
1484
|
() => hasInvalidLabelOrSlot.value || hasValidLabelOrSlot.value || hasLoadingLabelOrSlot.value || hasHintLabelOrSlot.value
|
|
1478
1485
|
);
|
|
1479
1486
|
const hintSlotScope = computed(() => ({
|
|
1480
|
-
modelValue: props.modelValue,
|
|
1481
|
-
valid: props.valid,
|
|
1482
|
-
invalid: props.invalid,
|
|
1483
|
-
loading: props.loading
|
|
1487
|
+
modelValue: props.value.modelValue,
|
|
1488
|
+
valid: props.value.valid,
|
|
1489
|
+
invalid: props.value.invalid,
|
|
1490
|
+
loading: props.value.loading
|
|
1484
1491
|
}));
|
|
1485
1492
|
const HintSlot = defineComponent({
|
|
1486
1493
|
name: "HintSlot",
|
|
@@ -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.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))}})}));
|
|
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||{}),v=(e=>(e.button="button",e.link="link",e.menuitem="menuitem",e))(v||{}),p=(e=>(e.listbox="listbox",e.menu="menu",e))(p||{}),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:p.menu,validator:e=>Object.values(p).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"),v=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`,v.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:v.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===p.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(v.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((()=>e.isRef(t)?t.value:t)),a=e.computed((()=>se(o.value.invalidLabel))),n=e.computed((()=>se(o.value.validLabel))),r=e.computed((()=>o.value.loadingLabel)),i=e.computed((()=>o.value.hintLabel)),u=e.computed((()=>Boolean(o.value.loading&&(l.loading||r.value)))),d=e.computed((()=>!u.value&&Boolean(o.value.invalid&&(l.invalid||a.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(o.value.valid&&(l.valid||n.value)))),c=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(l.hint||i.value))),v=e.computed((()=>d.value||s.value||u.value||c.value)),p=e.computed((()=>({modelValue:o.value.modelValue,valid:o.value.valid,invalid:o.value.invalid,loading:o.value.loading}))),f=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:v,invalidLabel:a,validLabel:n,loadingLabel: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:p,HintSlot:f}}const ve={...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 pe(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:ve,emits:["update:modelValue","focus","blur"],setup(t,{emit:l}){const o=t,n=e.useSlots(),r=pe("VvSelect",ve,o),i=e.ref(),{HintSlot:u,hasHintLabelOrSlot:d,hasInvalidLabelOrSlot:s,hintSlotScope:c}=ce(r,n),{id:v,modifiers:p,disabled:f,readonly:m,loading:b,icon:g,iconPosition:y,invalid:h,valid:k,floating:S,multiple:B}=e.toRefs(o),V=Q(v),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",p,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 v=e.computed((()=>a.pressed||(null==s?void 0:s.value))),{role:p}=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:!!v.value||void 0,ariaLabel:a.ariaLabel,role:null==p?void 0:p.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(v),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),v=n("toggle",t),p=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:v,unselectable:p,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:v,modelValue:p,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(p.value)?ie(y.value,p.value):ae(y.value,p.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==v?void 0:v.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(p.value))return ie(V.value,p.value)?void(b.value&&(p.value=p.value.filter((e=>e!==V.value)))):void p.value.push(V.value);if(V.value===p.value&&b.value)return void(p.value=a.uncheckedValue);p.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(v)?(e.openBlock(),e.createElementBlock("span",De,[e.renderSlot(t.$slots,"label",{},(()=>[e.createTextVNode(e.toDisplayString(e.unref(v)),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=pe("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),v=e.ref(null),f=e.ref(null),m=e.ref(null),{focused:b}=fe(v,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 ve(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:v}),(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(p).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:v},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:ve(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:ve(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:ve(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:ve(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))}})}));
|