@volverjs/ui-vue 0.0.5-beta.2 → 0.0.5-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +7 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +171 -64
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +0 -8
- package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +6 -0
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +237 -0
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -0
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +7 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.es.js +42 -10
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +4 -3
- package/dist/components/index.es.js +241 -134
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/useOptions.d.ts +1 -0
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/resolvers/unplugin.es.js +2 -1
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/package.json +9 -1
- 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/VvCombobox/VvCombobox.vue +95 -28
- package/src/components/VvDropdown/VvDropdownOptgroup.vue +18 -0
- package/src/components/VvSelect/VvSelect.vue +38 -10
- package/src/composables/useOptions.ts +6 -0
- package/src/resolvers/unplugin.ts +2 -1
- package/src/stories/Combobox/ComboboxOptions.stories.mdx +35 -0
- package/src/stories/Select/SelectOptions.stories.mdx +35 -0
- package/src/types/generic.d.ts +2 -1
|
@@ -813,11 +813,17 @@ function useOptions(props) {
|
|
|
813
813
|
return false;
|
|
814
814
|
return typeof disabledKey.value === "function" ? disabledKey.value(option) : option[disabledKey.value];
|
|
815
815
|
};
|
|
816
|
+
const getOptionGrouped = (option) => {
|
|
817
|
+
if (typeof option !== "object" && option !== null)
|
|
818
|
+
return [];
|
|
819
|
+
return option.options || [];
|
|
820
|
+
};
|
|
816
821
|
return {
|
|
817
822
|
options,
|
|
818
823
|
getOptionLabel,
|
|
819
824
|
getOptionValue,
|
|
820
|
-
getOptionDisabled
|
|
825
|
+
getOptionDisabled,
|
|
826
|
+
getOptionGrouped
|
|
821
827
|
};
|
|
822
828
|
}
|
|
823
829
|
const _hoisted_1 = ["textContent"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("@vueuse/core"),require("nanoid")):"function"==typeof define&&define.amd?define(["vue","@vueuse/core","nanoid"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckboxGroup=l(e.vue,e.core,e.nanoid)}(this,(function(e,l,n){"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||{}),o=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(o||{});const u=Symbol.for("checkGroup");function i(e,l,n){return n?d(e,n)===d(l,n):r(e,l)}function r(e,l){if(e===l)return!0;if(e&&l&&"object"==typeof e&&"object"==typeof l){const n=Array.isArray(e),t=Array.isArray(l);let a,o,u;if(n&&t){if(o=e.length,o!=l.length)return!1;for(a=o;0!=a--;)if(!r(e[a],l[a]))return!1;return!0}if(n!=t)return!1;const i=e instanceof Date,d=l instanceof Date;if(i!=d)return!1;if(i&&d)return e.getTime()==l.getTime();const v=e instanceof RegExp,s=l instanceof RegExp;if(v!=s)return!1;if(v&&s)return e.toString()==l.toString();const c=Object.keys(e);if(o=c.length,o!==Object.keys(l).length)return!1;for(a=o;0!=a--;)if(!Object.prototype.hasOwnProperty.call(l,c[a]))return!1;for(a=o;0!=a--;)if(u=c[a],!r(e[u],l[u]))return!1;return!0}return e!=e&&l!=l}function d(e,l){if(e&&Object.keys(e).length&&l){if(-1===l.indexOf("."))return e[l];{const n=l.split(".");let t=e;for(let l=0,a=n.length;l<a;++l){if(null==e)return null;t=t[n[l]]}return t}}return null}function v(l){return null==(n=e.unref(l))||""===n||Array.isArray(n)&&0===n.length||!(n instanceof Date)&&"object"==typeof n&&0===Object.keys(n).length;var n}function s(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}function c(n,t){const{invalid:a,valid:o,hint:u,loading:i}=t,{hintLabel:r,modelValue:c,valid:f,validLabel:p,invalid:m,invalidLabel:b,...y}=e.toRefs(n),g=d(y,"loading"),h=d(y,"loadingLabel"),k=e.computed((()=>!!m.value&&(!(!m.value||!a)||(!!((null==b?void 0:b.value)&&Array.isArray(b.value)&&b.value.length>0)||!(!(null==b?void 0:b.value)||v(b)))))),S=e.computed((()=>!!(r&&r.value||u))),V=e.computed((()=>!!(p&&p.value||o))),B=e.computed((()=>!!((null==g?void 0:g.value)&&i||(null==g?void 0:g.value)&&(null==h?void 0:h.value)))),A=e.computed((()=>S.value||V.value||k.value||B.value));return{hasInvalid:k,hasHint:S,hasValid:V,hasLoading:B,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(n){const t=e.computed((()=>{const e=l.toReactive({hintLabel:r,modelValue:c,valid:f,validLabel:p,invalid:m,invalidLabel:b,loading:g,loadingLabel:h,...n.params});return(null==m?void 0:m.value)?(null==a?void 0:a(e))||s(null==b?void 0:b.value)||(null==r?void 0:r.value):(null==f?void 0:f.value)?(null==o?void 0:o(e))||s(null==p?void 0:p.value)||(null==r?void 0:r.value):(null==g?void 0:g.value)?(null==i?void 0:i(e))||s(null==h?void 0:h.value)||(null==r?void 0:r.value):(null==u?void 0:u(e))||s(null==r?void 0:r.value)||(null==r?void 0:r.value)}));return{isVisible:A,hasInvalid:k,hasValid:V,hintContent:t}},render(){if(this.isVisible)return e.h("small",{role:this.hasInvalid?"alert":this.hasValid?"status":void 0},this.hintContent)}}}}const f={valid:Boolean,validLabel:[String,Array]},p={invalid:Boolean,invalidLabel:[String,Array]},m={disabled:Boolean},b=(Boolean,Boolean,{label:[String,Number]}),y={readonly:Boolean},g={modifiers:[String,Array]},h={hintLabel:{type:String,default:""}},k={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}};a.before;const S={tabindex:{type:[String,Number],default:0}},V={id:[String,Number]};t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const B={...{...V,name:{type:String,required:!0}},...S,...f,...p,...h,...m,...y,...g,...b,value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String]},A={...f,...p,...k,...h,...m,...y,...g,...b,modelValue:[String,Array,Boolean,Number,Symbol],name:{type:String,required:!0},vertical:Boolean};o.button;const x={...B,...g,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function O(l,n){const{group:t,isInGroup:a,getGroupOrLocalRef:o}=function(l){const n=e.inject(l,void 0),t=e.computed((()=>!v(n)));return{group:n,isInGroup:t,getGroupOrLocalRef:function(l,t,a){if(null==n?void 0:n.value){const t=e.unref(n.value)[l];return e.computed({get:()=>null==t?void 0:t.value,set(e){t.value=e}})}const o=e.toRef(t,l);return e.computed({get:()=>o.value,set(e){a&&a(`update:${l}`,e)}})}}}(u),{id:i,switch:r,indeterminate:d}=e.toRefs(l),s=o("modelValue",l,n),c=o("valid",l),f=o("invalid",l),p=e.computed((()=>{var e;return Boolean(l.readonly||(null==(e=null==t?void 0:t.value)?void 0:e.disabled.value))})),m=e.computed((()=>{var e;return Boolean(l.disabled||(null==(e=null==t?void 0:t.value)?void 0:e.disabled.value))}));return{id:i,propsSwitch:r,indeterminate:d,group:t,isInGroup:a,modelValue:s,valid:c,invalid:f,readonly:p,disabled:m}}function j(l,n,t){return e.computed((()=>{const a={[l]:!0},o="string"==typeof(null==n?void 0:n.value)?n.value.split(" "):null==n?void 0:n.value;return o&&Array.isArray(o)&&o.forEach((e=>{e&&(a[`${l}--${e}`]=!0)})),t&&Object.keys(t.value).forEach((n=>{a[`${l}--${n}`]=e.unref(t.value[n])})),a}))}const L=["for"],C=["id","name","disabled","value","tabindex","aria-invalid"],w=e.defineComponent({name:"VvCheckbox",props:x,emits:["click","update:modelValue","change","blur"],setup(l,{emit:t}){const a=l,o=e.useSlots(),{id:u,disabled:r,readonly:d,valid:v,invalid:s,propsSwitch:f,modelValue:p,indeterminate:m,isInGroup:b}=O(a,t),y=(l=>e.computed((()=>String((null==l?void 0:l.value)||n.nanoid()))))(u),g=e.computed((()=>S.value?-1:a.tabindex)),h=e.ref(),k=e.computed((()=>void 0!==a.uncheckedValue&&!b.value)),S=e.computed((()=>r.value||d.value)),V=e.computed((()=>!0===s.value||!0!==v.value&&void 0)),B=e.computed((()=>k.value?p.value===a.value:Array.isArray(p.value)?function(e,l){if(null!=e&&l&&l.length)for(const n of l)if(i(e,n))return!0;return!1}(a.value,p.value):i(a.value,p.value))),A=e.computed((()=>!!m.value||!(B.value||!k.value||a.uncheckedValue===p.value))),x=e.computed((()=>{if(!k.value)return!["string","number","boolean"].includes(typeof a.value)||a.value})),w=e.computed({get:()=>B.value,set(e){if(k.value)p.value=e?a.value:a.uncheckedValue;else if(Array.isArray(p.value)||b.value){const l=new Set(Array.isArray(p.value)?p.value:void 0!==p.value?[p.value]:[]);e?l.add(a.value):l.delete(a.value),p.value=[...l]}else p.value=e?a.value:void 0;t("change",e)}}),{modifiers:N}=e.toRefs(a),R=j("vv-checkbox",N,e.computed((()=>({switch:f.value,valid:v.value,invalid:s.value,disabled:r.value,readonly:d.value,indeterminate:m.value}))));e.watchEffect((()=>{k.value&&Array.isArray(p.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")})),e.watch((()=>A.value),(e=>{h.value.indeterminate=!!e})),e.onMounted((()=>{A.value&&(h.value.indeterminate=!0)}));const{HintSlot:E}=c(a,o);return(l,n)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(R)),for:e.unref(y)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(y),ref_key:"input",ref:h,"onUpdate:modelValue":n[0]||(n[0]=l=>e.isRef(w)?w.value=l:null),type:"checkbox",class:"vv-checkbox__input",name:l.name,disabled:e.unref(S),value:e.unref(x),tabindex:e.unref(g),"aria-invalid":e.unref(V)},null,8,C),[[e.vModelCheckbox,e.unref(w)]]),e.renderSlot(l.$slots,"default",{value:e.unref(p)},(()=>[e.createTextVNode(e.toDisplayString(l.label),1)])),e.createVNode(e.unref(E),{class:"vv-checkbox__hint",params:{value:e.unref(p)}},null,8,["params"])],10,L))}}),N=A;const R=["textContent"],E={class:"vv-checkbox-group__wrapper"};return e.defineComponent({name:"VvCheckboxGroup",props:N,emits:["update:modelValue","change"],setup(n,{emit:t}){const a=n,o=e.useSlots(),i=l.useVModel(a,"modelValue",t),{disabled:r,readonly:d,vertical:v,valid:s,invalid:f,modifiers:p}=e.toRefs(a);!function(l){if(Object.keys(l).some((n=>"key"!==n&&!e.isRef(l[n]))))throw Error("One or more groupState props aren't ref.");e.provide(l.key,e.computed((()=>l)))}({key:u,modelValue:i,disabled:r,readonly:d,valid:s,invalid:f});const{getOptionLabel:m,getOptionValue:b}=function(l){const{options:n,labelKey:t,valueKey:a,disabledKey:o}=e.toRefs(l);return{options:n,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:"function"==typeof t.value?t.value(e):e[t.value],getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof a.value?a.value(e):e[a.value],getOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof o.value?o.value(e):e[o.value])}}(a),y=j("vv-checkbox-group",p,e.computed((()=>({disabled:r.value,readonly:d.value,horizontal:!v.value,valid:s.value,invalid:f.value})))),{HintSlot:g}=c(a,o);return(l,n)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(y))},[l.label?(e.openBlock(),e.createElementBlock("legend",{key:0,textContent:e.toDisplayString(l.label)},null,8,R)):e.createCommentVNode("",!0),e.createElementVNode("div",E,[l.options.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.options,((l,n)=>(e.openBlock(),e.createBlock(w,e.mergeProps({key:n},((e,l)=>({id:`${a.name}_opt${l}`,name:a.name,label:m(e),value:b(e)}))(l,n)),null,16)))),128)):e.renderSlot(l.$slots,"default",{key:1})]),e.createVNode(e.unref(g),{class:"vv-checkbox-group__hint"})],2))}})}));
|
|
1
|
+
!function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("@vueuse/core"),require("nanoid")):"function"==typeof define&&define.amd?define(["vue","@vueuse/core","nanoid"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckboxGroup=l(e.vue,e.core,e.nanoid)}(this,(function(e,l,n){"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||{}),o=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(o||{});const u=Symbol.for("checkGroup");function i(e,l,n){return n?d(e,n)===d(l,n):r(e,l)}function r(e,l){if(e===l)return!0;if(e&&l&&"object"==typeof e&&"object"==typeof l){const n=Array.isArray(e),t=Array.isArray(l);let a,o,u;if(n&&t){if(o=e.length,o!=l.length)return!1;for(a=o;0!=a--;)if(!r(e[a],l[a]))return!1;return!0}if(n!=t)return!1;const i=e instanceof Date,d=l instanceof Date;if(i!=d)return!1;if(i&&d)return e.getTime()==l.getTime();const v=e instanceof RegExp,s=l instanceof RegExp;if(v!=s)return!1;if(v&&s)return e.toString()==l.toString();const c=Object.keys(e);if(o=c.length,o!==Object.keys(l).length)return!1;for(a=o;0!=a--;)if(!Object.prototype.hasOwnProperty.call(l,c[a]))return!1;for(a=o;0!=a--;)if(u=c[a],!r(e[u],l[u]))return!1;return!0}return e!=e&&l!=l}function d(e,l){if(e&&Object.keys(e).length&&l){if(-1===l.indexOf("."))return e[l];{const n=l.split(".");let t=e;for(let l=0,a=n.length;l<a;++l){if(null==e)return null;t=t[n[l]]}return t}}return null}function v(l){return null==(n=e.unref(l))||""===n||Array.isArray(n)&&0===n.length||!(n instanceof Date)&&"object"==typeof n&&0===Object.keys(n).length;var n}function s(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}function c(n,t){const{invalid:a,valid:o,hint:u,loading:i}=t,{hintLabel:r,modelValue:c,valid:f,validLabel:p,invalid:m,invalidLabel:b,...y}=e.toRefs(n),g=d(y,"loading"),h=d(y,"loadingLabel"),k=e.computed((()=>!!m.value&&(!(!m.value||!a)||(!!((null==b?void 0:b.value)&&Array.isArray(b.value)&&b.value.length>0)||!(!(null==b?void 0:b.value)||v(b)))))),S=e.computed((()=>!!(r&&r.value||u))),V=e.computed((()=>!!(p&&p.value||o))),B=e.computed((()=>!!((null==g?void 0:g.value)&&i||(null==g?void 0:g.value)&&(null==h?void 0:h.value)))),A=e.computed((()=>S.value||V.value||k.value||B.value));return{hasInvalid:k,hasHint:S,hasValid:V,hasLoading:B,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(n){const t=e.computed((()=>{const e=l.toReactive({hintLabel:r,modelValue:c,valid:f,validLabel:p,invalid:m,invalidLabel:b,loading:g,loadingLabel:h,...n.params});return(null==m?void 0:m.value)?(null==a?void 0:a(e))||s(null==b?void 0:b.value)||(null==r?void 0:r.value):(null==f?void 0:f.value)?(null==o?void 0:o(e))||s(null==p?void 0:p.value)||(null==r?void 0:r.value):(null==g?void 0:g.value)?(null==i?void 0:i(e))||s(null==h?void 0:h.value)||(null==r?void 0:r.value):(null==u?void 0:u(e))||s(null==r?void 0:r.value)||(null==r?void 0:r.value)}));return{isVisible:A,hasInvalid:k,hasValid:V,hintContent:t}},render(){if(this.isVisible)return e.h("small",{role:this.hasInvalid?"alert":this.hasValid?"status":void 0},this.hintContent)}}}}const f={valid:Boolean,validLabel:[String,Array]},p={invalid:Boolean,invalidLabel:[String,Array]},m={disabled:Boolean},b=(Boolean,Boolean,{label:[String,Number]}),y={readonly:Boolean},g={modifiers:[String,Array]},h={hintLabel:{type:String,default:""}},k={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}};a.before;const S={tabindex:{type:[String,Number],default:0}},V={id:[String,Number]};t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const B={...{...V,name:{type:String,required:!0}},...S,...f,...p,...h,...m,...y,...g,...b,value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String]},A={...f,...p,...k,...h,...m,...y,...g,...b,modelValue:[String,Array,Boolean,Number,Symbol],name:{type:String,required:!0},vertical:Boolean};o.button;const x={...B,...g,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function O(l,n){const{group:t,isInGroup:a,getGroupOrLocalRef:o}=function(l){const n=e.inject(l,void 0),t=e.computed((()=>!v(n)));return{group:n,isInGroup:t,getGroupOrLocalRef:function(l,t,a){if(null==n?void 0:n.value){const t=e.unref(n.value)[l];return e.computed({get:()=>null==t?void 0:t.value,set(e){t.value=e}})}const o=e.toRef(t,l);return e.computed({get:()=>o.value,set(e){a&&a(`update:${l}`,e)}})}}}(u),{id:i,switch:r,indeterminate:d}=e.toRefs(l),s=o("modelValue",l,n),c=o("valid",l),f=o("invalid",l),p=e.computed((()=>{var e;return Boolean(l.readonly||(null==(e=null==t?void 0:t.value)?void 0:e.disabled.value))})),m=e.computed((()=>{var e;return Boolean(l.disabled||(null==(e=null==t?void 0:t.value)?void 0:e.disabled.value))}));return{id:i,propsSwitch:r,indeterminate:d,group:t,isInGroup:a,modelValue:s,valid:c,invalid:f,readonly:p,disabled:m}}function j(l,n,t){return e.computed((()=>{const a={[l]:!0},o="string"==typeof(null==n?void 0:n.value)?n.value.split(" "):null==n?void 0:n.value;return o&&Array.isArray(o)&&o.forEach((e=>{e&&(a[`${l}--${e}`]=!0)})),t&&Object.keys(t.value).forEach((n=>{a[`${l}--${n}`]=e.unref(t.value[n])})),a}))}const L=["for"],C=["id","name","disabled","value","tabindex","aria-invalid"],w=e.defineComponent({name:"VvCheckbox",props:x,emits:["click","update:modelValue","change","blur"],setup(l,{emit:t}){const a=l,o=e.useSlots(),{id:u,disabled:r,readonly:d,valid:v,invalid:s,propsSwitch:f,modelValue:p,indeterminate:m,isInGroup:b}=O(a,t),y=(l=>e.computed((()=>String((null==l?void 0:l.value)||n.nanoid()))))(u),g=e.computed((()=>S.value?-1:a.tabindex)),h=e.ref(),k=e.computed((()=>void 0!==a.uncheckedValue&&!b.value)),S=e.computed((()=>r.value||d.value)),V=e.computed((()=>!0===s.value||!0!==v.value&&void 0)),B=e.computed((()=>k.value?p.value===a.value:Array.isArray(p.value)?function(e,l){if(null!=e&&l&&l.length)for(const n of l)if(i(e,n))return!0;return!1}(a.value,p.value):i(a.value,p.value))),A=e.computed((()=>!!m.value||!(B.value||!k.value||a.uncheckedValue===p.value))),x=e.computed((()=>{if(!k.value)return!["string","number","boolean"].includes(typeof a.value)||a.value})),w=e.computed({get:()=>B.value,set(e){if(k.value)p.value=e?a.value:a.uncheckedValue;else if(Array.isArray(p.value)||b.value){const l=new Set(Array.isArray(p.value)?p.value:void 0!==p.value?[p.value]:[]);e?l.add(a.value):l.delete(a.value),p.value=[...l]}else p.value=e?a.value:void 0;t("change",e)}}),{modifiers:N}=e.toRefs(a),R=j("vv-checkbox",N,e.computed((()=>({switch:f.value,valid:v.value,invalid:s.value,disabled:r.value,readonly:d.value,indeterminate:m.value}))));e.watchEffect((()=>{k.value&&Array.isArray(p.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")})),e.watch((()=>A.value),(e=>{h.value.indeterminate=!!e})),e.onMounted((()=>{A.value&&(h.value.indeterminate=!0)}));const{HintSlot:E}=c(a,o);return(l,n)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(R)),for:e.unref(y)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(y),ref_key:"input",ref:h,"onUpdate:modelValue":n[0]||(n[0]=l=>e.isRef(w)?w.value=l:null),type:"checkbox",class:"vv-checkbox__input",name:l.name,disabled:e.unref(S),value:e.unref(x),tabindex:e.unref(g),"aria-invalid":e.unref(V)},null,8,C),[[e.vModelCheckbox,e.unref(w)]]),e.renderSlot(l.$slots,"default",{value:e.unref(p)},(()=>[e.createTextVNode(e.toDisplayString(l.label),1)])),e.createVNode(e.unref(E),{class:"vv-checkbox__hint",params:{value:e.unref(p)}},null,8,["params"])],10,L))}}),N=A;const R=["textContent"],E={class:"vv-checkbox-group__wrapper"};return e.defineComponent({name:"VvCheckboxGroup",props:N,emits:["update:modelValue","change"],setup(n,{emit:t}){const a=n,o=e.useSlots(),i=l.useVModel(a,"modelValue",t),{disabled:r,readonly:d,vertical:v,valid:s,invalid:f,modifiers:p}=e.toRefs(a);!function(l){if(Object.keys(l).some((n=>"key"!==n&&!e.isRef(l[n]))))throw Error("One or more groupState props aren't ref.");e.provide(l.key,e.computed((()=>l)))}({key:u,modelValue:i,disabled:r,readonly:d,valid:s,invalid:f});const{getOptionLabel:m,getOptionValue:b}=function(l){const{options:n,labelKey:t,valueKey:a,disabledKey:o}=e.toRefs(l);return{options:n,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:"function"==typeof t.value?t.value(e):e[t.value],getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof a.value?a.value(e):e[a.value],getOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof o.value?o.value(e):e[o.value]),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(a),y=j("vv-checkbox-group",p,e.computed((()=>({disabled:r.value,readonly:d.value,horizontal:!v.value,valid:s.value,invalid:f.value})))),{HintSlot:g}=c(a,o);return(l,n)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(y))},[l.label?(e.openBlock(),e.createElementBlock("legend",{key:0,textContent:e.toDisplayString(l.label)},null,8,R)):e.createCommentVNode("",!0),e.createElementVNode("div",E,[l.options.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.options,((l,n)=>(e.openBlock(),e.createBlock(w,e.mergeProps({key:n},((e,l)=>({id:`${a.name}_opt${l}`,name:a.name,label:m(e),value:b(e)}))(l,n)),null,16)))),128)):e.renderSlot(l.$slots,"default",{key:1})]),e.createVNode(e.unref(g),{class:"vv-checkbox-group__hint"})],2))}})}));
|
|
@@ -605,11 +605,11 @@ function useModifiers(prefix, modifiers, others) {
|
|
|
605
605
|
return toReturn;
|
|
606
606
|
});
|
|
607
607
|
}
|
|
608
|
-
const __default__$
|
|
608
|
+
const __default__$7 = {
|
|
609
609
|
name: "VvIcon"
|
|
610
610
|
};
|
|
611
|
-
const _sfc_main$
|
|
612
|
-
...__default__$
|
|
611
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
612
|
+
...__default__$7,
|
|
613
613
|
props: VvIconProps,
|
|
614
614
|
setup(__props) {
|
|
615
615
|
const props = __props;
|
|
@@ -777,13 +777,13 @@ function useProvideDropdownAction({
|
|
|
777
777
|
expanded
|
|
778
778
|
});
|
|
779
779
|
}
|
|
780
|
-
const _hoisted_1$
|
|
781
|
-
const __default__$
|
|
780
|
+
const _hoisted_1$4 = ["id", "tabindex", "role", "aria-labelledby"];
|
|
781
|
+
const __default__$6 = {
|
|
782
782
|
name: "VvDropdown",
|
|
783
783
|
inheritAttrs: false
|
|
784
784
|
};
|
|
785
|
-
const _sfc_main$
|
|
786
|
-
...__default__$
|
|
785
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
786
|
+
...__default__$6,
|
|
787
787
|
props: VvDropdownProps,
|
|
788
788
|
emits: ["update:modelValue"],
|
|
789
789
|
setup(__props, { expose, emit }) {
|
|
@@ -1092,7 +1092,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1092
1092
|
renderSlot(_ctx.$slots, "items", normalizeProps(guardReactiveProps({
|
|
1093
1093
|
role: unref(itemRole)
|
|
1094
1094
|
})))
|
|
1095
|
-
], 16, _hoisted_1$
|
|
1095
|
+
], 16, _hoisted_1$4),
|
|
1096
1096
|
renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps({ expanded: unref(expanded) })))
|
|
1097
1097
|
], 6), [
|
|
1098
1098
|
[vShow, unref(expanded)]
|
|
@@ -1107,11 +1107,11 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1107
1107
|
function useInjectedDropdownItem() {
|
|
1108
1108
|
return inject(INJECTION_KEY_DROPDOWN_ITEM, {});
|
|
1109
1109
|
}
|
|
1110
|
-
const __default__$
|
|
1110
|
+
const __default__$5 = {
|
|
1111
1111
|
name: "VvDropdownItem"
|
|
1112
1112
|
};
|
|
1113
|
-
const _sfc_main$
|
|
1114
|
-
...__default__$
|
|
1113
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
1114
|
+
...__default__$5,
|
|
1115
1115
|
setup(__props) {
|
|
1116
1116
|
const { role, expanded } = useInjectedDropdownItem();
|
|
1117
1117
|
const element = ref(null);
|
|
@@ -1135,12 +1135,12 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1135
1135
|
};
|
|
1136
1136
|
}
|
|
1137
1137
|
});
|
|
1138
|
-
const _hoisted_1$
|
|
1139
|
-
const __default__$
|
|
1138
|
+
const _hoisted_1$3 = ["title"];
|
|
1139
|
+
const __default__$4 = {
|
|
1140
1140
|
name: "VvDropdownOption"
|
|
1141
1141
|
};
|
|
1142
|
-
const _sfc_main$
|
|
1143
|
-
...__default__$
|
|
1142
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
1143
|
+
...__default__$4,
|
|
1144
1144
|
props: {
|
|
1145
1145
|
...DisabledProps,
|
|
1146
1146
|
...SelectedProps,
|
|
@@ -1177,7 +1177,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
1177
1177
|
}
|
|
1178
1178
|
});
|
|
1179
1179
|
return (_ctx, _cache) => {
|
|
1180
|
-
return openBlock(), createBlock(_sfc_main$
|
|
1180
|
+
return openBlock(), createBlock(_sfc_main$5, {
|
|
1181
1181
|
class: normalizeClass(unref(bemCssClasses)),
|
|
1182
1182
|
tabindex: _ctx.disabled ? -1 : 0,
|
|
1183
1183
|
"aria-selected": _ctx.selected,
|
|
@@ -1192,13 +1192,33 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
1192
1192
|
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps({ disabled: _ctx.disabled, selected: _ctx.selected, unselectable: _ctx.unselectable })), () => [
|
|
1193
1193
|
createTextVNode(toDisplayString(unref(hintLabel)), 1)
|
|
1194
1194
|
])
|
|
1195
|
-
], 8, _hoisted_1$
|
|
1195
|
+
], 8, _hoisted_1$3)
|
|
1196
1196
|
]),
|
|
1197
1197
|
_: 3
|
|
1198
1198
|
}, 8, ["class", "tabindex", "aria-selected", "aria-disabled"]);
|
|
1199
1199
|
};
|
|
1200
1200
|
}
|
|
1201
1201
|
});
|
|
1202
|
+
const _hoisted_1$2 = {
|
|
1203
|
+
class: "vv-dropdown-optgroup",
|
|
1204
|
+
role: "presentation",
|
|
1205
|
+
tabindex: "-1"
|
|
1206
|
+
};
|
|
1207
|
+
const __default__$3 = {
|
|
1208
|
+
name: "VvDropdownOptgroup"
|
|
1209
|
+
};
|
|
1210
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
1211
|
+
...__default__$3,
|
|
1212
|
+
props: {
|
|
1213
|
+
...LabelProps
|
|
1214
|
+
},
|
|
1215
|
+
setup(__props) {
|
|
1216
|
+
const props = __props;
|
|
1217
|
+
return (_ctx, _cache) => {
|
|
1218
|
+
return openBlock(), createElementBlock("li", _hoisted_1$2, toDisplayString(props.label), 1);
|
|
1219
|
+
};
|
|
1220
|
+
}
|
|
1221
|
+
});
|
|
1202
1222
|
function equals(obj1, obj2, field) {
|
|
1203
1223
|
if (field)
|
|
1204
1224
|
return resolveFieldData(obj1, field) === resolveFieldData(obj2, field);
|
|
@@ -1521,11 +1541,17 @@ function useOptions(props) {
|
|
|
1521
1541
|
return false;
|
|
1522
1542
|
return typeof disabledKey.value === "function" ? disabledKey.value(option) : option[disabledKey.value];
|
|
1523
1543
|
};
|
|
1544
|
+
const getOptionGrouped = (option) => {
|
|
1545
|
+
if (typeof option !== "object" && option !== null)
|
|
1546
|
+
return [];
|
|
1547
|
+
return option.options || [];
|
|
1548
|
+
};
|
|
1524
1549
|
return {
|
|
1525
1550
|
options,
|
|
1526
1551
|
getOptionLabel,
|
|
1527
1552
|
getOptionValue,
|
|
1528
|
-
getOptionDisabled
|
|
1553
|
+
getOptionDisabled,
|
|
1554
|
+
getOptionGrouped
|
|
1529
1555
|
};
|
|
1530
1556
|
}
|
|
1531
1557
|
const _hoisted_1$1 = ["for"];
|
|
@@ -1538,7 +1564,9 @@ const _hoisted_4$1 = { class: "vv-select__inner" };
|
|
|
1538
1564
|
const _hoisted_5$1 = ["id"];
|
|
1539
1565
|
const _hoisted_6$1 = ["disabled", "hidden"];
|
|
1540
1566
|
const _hoisted_7$1 = ["disabled", "value"];
|
|
1541
|
-
const _hoisted_8$1 =
|
|
1567
|
+
const _hoisted_8$1 = ["disabled", "label"];
|
|
1568
|
+
const _hoisted_9 = ["disabled", "value"];
|
|
1569
|
+
const _hoisted_10 = {
|
|
1542
1570
|
key: 1,
|
|
1543
1571
|
class: "vv-select__input-after"
|
|
1544
1572
|
};
|
|
@@ -1630,7 +1658,12 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1630
1658
|
invalid: props.invalid,
|
|
1631
1659
|
modelValue: props.modelValue
|
|
1632
1660
|
}));
|
|
1633
|
-
const {
|
|
1661
|
+
const {
|
|
1662
|
+
getOptionLabel,
|
|
1663
|
+
getOptionValue,
|
|
1664
|
+
getOptionDisabled,
|
|
1665
|
+
getOptionGrouped
|
|
1666
|
+
} = useOptions(props);
|
|
1634
1667
|
const localModelValue = computed({
|
|
1635
1668
|
get: () => {
|
|
1636
1669
|
return props.modelValue;
|
|
@@ -1642,6 +1675,11 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1642
1675
|
emit("update:modelValue", newValue);
|
|
1643
1676
|
}
|
|
1644
1677
|
});
|
|
1678
|
+
const isGroup = (option) => {
|
|
1679
|
+
if (typeof option === "string")
|
|
1680
|
+
return false;
|
|
1681
|
+
return option && option.options && option.options.length > 0;
|
|
1682
|
+
};
|
|
1645
1683
|
return (_ctx, _cache) => {
|
|
1646
1684
|
return openBlock(), createElementBlock("div", {
|
|
1647
1685
|
class: normalizeClass(unref(bemCssClasses))
|
|
@@ -1655,7 +1693,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1655
1693
|
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
1656
1694
|
])) : createCommentVNode("", true),
|
|
1657
1695
|
createElementVNode("div", _hoisted_4$1, [
|
|
1658
|
-
unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$
|
|
1696
|
+
unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$7, mergeProps({
|
|
1659
1697
|
key: 0,
|
|
1660
1698
|
class: "vv-select__icon"
|
|
1661
1699
|
}, unref(hasIcon)), null, 16)) : createCommentVNode("", true),
|
|
@@ -1672,21 +1710,35 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1672
1710
|
hidden: !_ctx.unselectable
|
|
1673
1711
|
}, toDisplayString(_ctx.placeholder), 9, _hoisted_6$1)) : createCommentVNode("", true),
|
|
1674
1712
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (option, index) => {
|
|
1675
|
-
return openBlock(), createElementBlock(
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1713
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
1714
|
+
!isGroup(option) ? (openBlock(), createElementBlock("option", {
|
|
1715
|
+
key: index,
|
|
1716
|
+
disabled: unref(getOptionDisabled)(option),
|
|
1717
|
+
value: unref(getOptionValue)(option)
|
|
1718
|
+
}, toDisplayString(unref(getOptionLabel)(option)), 9, _hoisted_7$1)) : (openBlock(), createElementBlock("optgroup", {
|
|
1719
|
+
key: `group-${index}`,
|
|
1720
|
+
disabled: unref(getOptionDisabled)(option),
|
|
1721
|
+
label: unref(getOptionLabel)(option)
|
|
1722
|
+
}, [
|
|
1723
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(getOptionGrouped)(option), (item, i) => {
|
|
1724
|
+
return openBlock(), createElementBlock("option", {
|
|
1725
|
+
key: `group-${index}-item-${i}`,
|
|
1726
|
+
disabled: unref(getOptionDisabled)(item),
|
|
1727
|
+
value: unref(getOptionValue)(item)
|
|
1728
|
+
}, toDisplayString(unref(getOptionLabel)(item)), 9, _hoisted_9);
|
|
1729
|
+
}), 128))
|
|
1730
|
+
], 8, _hoisted_8$1))
|
|
1731
|
+
], 64);
|
|
1732
|
+
}), 256))
|
|
1681
1733
|
], 16, _hoisted_5$1), [
|
|
1682
1734
|
[vModelSelect, unref(localModelValue)]
|
|
1683
1735
|
]),
|
|
1684
|
-
unref(hasIconAfter) ? (openBlock(), createBlock(_sfc_main$
|
|
1736
|
+
unref(hasIconAfter) ? (openBlock(), createBlock(_sfc_main$7, mergeProps({
|
|
1685
1737
|
key: 1,
|
|
1686
1738
|
class: "vv-select__icon vv-select__icon-after"
|
|
1687
1739
|
}, unref(hasIcon)), null, 16)) : createCommentVNode("", true)
|
|
1688
1740
|
]),
|
|
1689
|
-
_ctx.$slots.after ? (openBlock(), createElementBlock("div",
|
|
1741
|
+
_ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_10, [
|
|
1690
1742
|
renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
1691
1743
|
])) : createCommentVNode("", true)
|
|
1692
1744
|
]),
|
|
@@ -1793,7 +1845,7 @@ const _hoisted_8 = {
|
|
|
1793
1845
|
};
|
|
1794
1846
|
const __default__ = {
|
|
1795
1847
|
name: "VvCombobox",
|
|
1796
|
-
components: { VvDropdown: _sfc_main$
|
|
1848
|
+
components: { VvDropdown: _sfc_main$6, VvDropdownOption: _sfc_main$4, VvDropdownOptgroup: _sfc_main$3 }
|
|
1797
1849
|
};
|
|
1798
1850
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
1799
1851
|
...__default__,
|
|
@@ -1807,6 +1859,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1807
1859
|
VvComboboxProps,
|
|
1808
1860
|
props
|
|
1809
1861
|
);
|
|
1862
|
+
const isGroup = (option) => {
|
|
1863
|
+
if (typeof option === "string") {
|
|
1864
|
+
return false;
|
|
1865
|
+
}
|
|
1866
|
+
return option.options && option.options.length > 0;
|
|
1867
|
+
};
|
|
1810
1868
|
const { HintSlot } = HintSlotFactory(props, slots);
|
|
1811
1869
|
const inputEl = ref(null);
|
|
1812
1870
|
const inputSearchEl = ref(null);
|
|
@@ -1913,7 +1971,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1913
1971
|
const hasOptions = computed(
|
|
1914
1972
|
() => props.searchable ? filteredOptions.value : props.options
|
|
1915
1973
|
);
|
|
1916
|
-
const {
|
|
1974
|
+
const {
|
|
1975
|
+
getOptionLabel,
|
|
1976
|
+
getOptionValue,
|
|
1977
|
+
getOptionDisabled,
|
|
1978
|
+
getOptionGrouped
|
|
1979
|
+
} = useOptions(props);
|
|
1917
1980
|
const filteredOptions = computed(() => {
|
|
1918
1981
|
var _a;
|
|
1919
1982
|
return (_a = props.options) == null ? void 0 : _a.filter((option) => {
|
|
@@ -1933,9 +1996,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1933
1996
|
} else if (props.modelValue) {
|
|
1934
1997
|
selectedValues = [props.modelValue];
|
|
1935
1998
|
}
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1999
|
+
const options = props.options.reduce((acc, value) => {
|
|
2000
|
+
if (isGroup(value)) {
|
|
2001
|
+
return [...acc, ...getOptionGrouped(value)];
|
|
2002
|
+
}
|
|
2003
|
+
return [...acc, value];
|
|
2004
|
+
}, []);
|
|
2005
|
+
return options.filter((option) => {
|
|
2006
|
+
if (isGroup(option)) {
|
|
2007
|
+
return getOptionGrouped(option).some(
|
|
2008
|
+
(item) => selectedValues.includes(getOptionValue(item))
|
|
2009
|
+
);
|
|
2010
|
+
}
|
|
2011
|
+
return selectedValues.includes(getOptionValue(option));
|
|
2012
|
+
});
|
|
1939
2013
|
});
|
|
1940
2014
|
const hasValue = computed(() => {
|
|
1941
2015
|
return selectedOptions.value.map((option) => getOptionLabel(option)).join(props.separator);
|
|
@@ -2050,7 +2124,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2050
2124
|
ref: wrapperEl,
|
|
2051
2125
|
class: "vv-select__wrapper"
|
|
2052
2126
|
}, [
|
|
2053
|
-
createVNode(_sfc_main$
|
|
2127
|
+
createVNode(_sfc_main$6, mergeProps({
|
|
2054
2128
|
modelValue: unref(expanded),
|
|
2055
2129
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(expanded) ? expanded.value = $event : null)
|
|
2056
2130
|
}, unref(dropdownProps), {
|
|
@@ -2061,7 +2135,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2061
2135
|
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
2062
2136
|
])) : createCommentVNode("", true),
|
|
2063
2137
|
createElementVNode("div", _hoisted_5, [
|
|
2064
|
-
unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$
|
|
2138
|
+
unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$7, mergeProps({
|
|
2065
2139
|
key: 0,
|
|
2066
2140
|
class: "vv-select__icon"
|
|
2067
2141
|
}, unref(hasIcon)), null, 16)) : createCommentVNode("", true),
|
|
@@ -2092,7 +2166,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2092
2166
|
"aria-label": unref(propsDefaults).deselectActionLabel,
|
|
2093
2167
|
onClick: withModifiers(($event) => onInput(option), ["stop"])
|
|
2094
2168
|
}, [
|
|
2095
|
-
createVNode(_sfc_main$
|
|
2169
|
+
createVNode(_sfc_main$7, { name: "close" })
|
|
2096
2170
|
], 8, _hoisted_7)) : createCommentVNode("", true)
|
|
2097
2171
|
]),
|
|
2098
2172
|
_: 2
|
|
@@ -2103,7 +2177,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2103
2177
|
], 64))
|
|
2104
2178
|
])
|
|
2105
2179
|
], 16, _hoisted_6),
|
|
2106
|
-
unref(hasIconAfter) ? (openBlock(), createBlock(_sfc_main$
|
|
2180
|
+
unref(hasIconAfter) ? (openBlock(), createBlock(_sfc_main$7, mergeProps({
|
|
2107
2181
|
key: 1,
|
|
2108
2182
|
class: "vv-select__icon vv-select__icon-after"
|
|
2109
2183
|
}, unref(hasIcon)), null, 16)) : createCommentVNode("", true)
|
|
@@ -2114,31 +2188,64 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2114
2188
|
]),
|
|
2115
2189
|
items: withCtx(() => [
|
|
2116
2190
|
unref(filteredOptions).length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(unref(filteredOptions), (option, index) => {
|
|
2117
|
-
return openBlock(),
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2191
|
+
return openBlock(), createElementBlock(Fragment, { key: index }, [
|
|
2192
|
+
isGroup(option) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2193
|
+
createVNode(_sfc_main$3, {
|
|
2194
|
+
label: unref(getOptionLabel)(option)
|
|
2195
|
+
}, null, 8, ["label"]),
|
|
2196
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(getOptionGrouped)(
|
|
2197
|
+
option
|
|
2198
|
+
), (item, i) => {
|
|
2199
|
+
return openBlock(), createBlock(_sfc_main$4, mergeProps({
|
|
2200
|
+
disabled: unref(getOptionDisabled)(item),
|
|
2201
|
+
selected: getOptionSelected(item),
|
|
2202
|
+
unselectable: _ctx.unselectable,
|
|
2203
|
+
deselectHintLabel: unref(propsDefaults).deselectHintLabel,
|
|
2204
|
+
selectHintLabel: unref(propsDefaults).selectHintLabel,
|
|
2205
|
+
selectedHintLabel: unref(propsDefaults).selectedHintLabel
|
|
2206
|
+
}, {
|
|
2207
|
+
key: i,
|
|
2208
|
+
class: "vv-dropdown-option",
|
|
2209
|
+
onClickPassive: ($event) => onInput(item)
|
|
2210
|
+
}), {
|
|
2211
|
+
default: withCtx(() => [
|
|
2212
|
+
renderSlot(_ctx.$slots, "option", normalizeProps(guardReactiveProps({
|
|
2213
|
+
option,
|
|
2214
|
+
selectedOptions: unref(selectedOptions),
|
|
2215
|
+
selected: getOptionSelected(item),
|
|
2216
|
+
disabled: unref(getOptionDisabled)(item)
|
|
2217
|
+
})), () => [
|
|
2218
|
+
createTextVNode(toDisplayString(unref(getOptionLabel)(item)), 1)
|
|
2219
|
+
])
|
|
2220
|
+
]),
|
|
2221
|
+
_: 2
|
|
2222
|
+
}, 1040, ["onClickPassive"]);
|
|
2223
|
+
}), 128))
|
|
2224
|
+
], 64)) : (openBlock(), createBlock(_sfc_main$4, mergeProps({ key: 1 }, {
|
|
2225
|
+
disabled: unref(getOptionDisabled)(option),
|
|
2226
|
+
selected: getOptionSelected(option),
|
|
2227
|
+
unselectable: _ctx.unselectable,
|
|
2228
|
+
deselectHintLabel: unref(propsDefaults).deselectHintLabel,
|
|
2229
|
+
selectHintLabel: unref(propsDefaults).selectHintLabel,
|
|
2230
|
+
selectedHintLabel: unref(propsDefaults).selectedHintLabel
|
|
2231
|
+
}, {
|
|
2232
|
+
class: "vv-dropdown-option",
|
|
2233
|
+
onClickPassive: ($event) => onInput(option)
|
|
2234
|
+
}), {
|
|
2235
|
+
default: withCtx(() => [
|
|
2236
|
+
renderSlot(_ctx.$slots, "option", normalizeProps(guardReactiveProps({
|
|
2237
|
+
option,
|
|
2238
|
+
selectedOptions: unref(selectedOptions),
|
|
2239
|
+
selected: getOptionSelected(option),
|
|
2240
|
+
disabled: unref(getOptionDisabled)(option)
|
|
2241
|
+
})), () => [
|
|
2242
|
+
createTextVNode(toDisplayString(unref(getOptionLabel)(option)), 1)
|
|
2243
|
+
])
|
|
2244
|
+
]),
|
|
2245
|
+
_: 2
|
|
2246
|
+
}, 1040, ["onClickPassive"]))
|
|
2247
|
+
], 64);
|
|
2248
|
+
}), 128)) : !_ctx.options.length ? (openBlock(), createBlock(_sfc_main$4, {
|
|
2142
2249
|
key: 1,
|
|
2143
2250
|
modifiers: "inert"
|
|
2144
2251
|
}, {
|
|
@@ -2148,7 +2255,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2148
2255
|
])
|
|
2149
2256
|
]),
|
|
2150
2257
|
_: 3
|
|
2151
|
-
})) : (openBlock(), createBlock(_sfc_main$
|
|
2258
|
+
})) : (openBlock(), createBlock(_sfc_main$4, {
|
|
2152
2259
|
key: 2,
|
|
2153
2260
|
modifiers: "inert"
|
|
2154
2261
|
}, {
|