@volverjs/ui-vue 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/dist/components/VvButton/VvButton.es.js +159 -147
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +0 -8
- package/dist/components/VvButton/index.d.ts +4 -4
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +36 -37
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +10 -10
- package/dist/components/VvButtonGroup/index.d.ts +5 -5
- package/dist/components/VvCombobox/VvCombobox.es.js +526 -345
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +22 -0
- package/dist/components/VvCombobox/index.d.ts +13 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +118 -109
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +19 -0
- package/dist/components/VvDropdown/index.d.ts +12 -0
- package/dist/components/VvInputText/VvInputText.es.js +221 -213
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +13 -13
- package/dist/components/VvInputText/index.d.ts +5 -5
- package/dist/components/VvSelect/VvSelect.es.js +186 -167
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +23 -11
- package/dist/components/VvSelect/index.d.ts +10 -17
- package/dist/components/VvTextarea/VvTextarea.es.js +112 -104
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +12 -12
- package/dist/components/VvTextarea/index.d.ts +5 -5
- package/dist/components/index.es.js +1045 -975
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/group/types/IButtonGroupState.d.ts +1 -1
- package/dist/composables/group/types/IGroupState.d.ts +1 -1
- package/dist/composables/group/useInjectedGroupState.d.ts +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +1065 -995
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +35 -4
- package/dist/resolvers/unplugin.es.js +26 -24
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/Button/Button.settings.d.ts +9 -11
- package/dist/stories/ButtonGroup/ButtonGroup.settings.d.ts +9 -0
- package/dist/stories/Combobox/Combobox.settings.d.ts +19 -0
- package/dist/stories/Dropdown/Dropdown.settings.d.ts +10 -0
- package/dist/stories/InputText/InputText.settings.d.ts +23 -23
- package/dist/stories/Select/Select.settings.d.ts +42 -23
- package/dist/stories/Textarea/Textarea.settings.d.ts +23 -23
- package/dist/stories/argTypes.d.ts +50 -1
- package/package.json +5 -4
- 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/VvButton/index.ts +28 -10
- package/src/components/VvButtonGroup/VvButtonGroup.vue +1 -1
- package/src/components/VvButtonGroup/index.ts +3 -6
- package/src/components/VvCombobox/VvCombobox.vue +45 -11
- package/src/components/VvCombobox/index.ts +6 -0
- package/src/components/VvDropdown/VvDropdown.vue +9 -6
- package/src/components/VvDropdown/index.ts +11 -1
- package/src/components/VvInputText/VvInputText.vue +10 -8
- package/src/components/VvSelect/VvSelect.vue +23 -1
- package/src/components/VvSelect/index.ts +8 -11
- package/src/components/VvTextarea/VvTextarea.vue +10 -8
- package/src/composables/group/types/IButtonGroupState.ts +1 -1
- package/src/composables/group/types/IGroupState.ts +1 -1
- package/src/composables/group/useInjectedGroupState.ts +3 -3
- package/src/composables/useTextCount.ts +1 -1
- package/src/props/index.ts +33 -15
- package/src/resolvers/unplugin.ts +22 -13
- package/src/stories/Button/Button.settings.ts +2 -7
- package/src/stories/ButtonGroup/ButtonGroup.settings.ts +6 -1
- package/src/stories/ButtonGroup/ButtonGroupSlots.stories.mdx +37 -0
- package/src/stories/ButtonGroup/ButtonGroupToggle.stories.mdx +12 -1
- package/src/stories/Combobox/Combobox.settings.ts +5 -0
- package/src/stories/Combobox/Combobox.stories.mdx +51 -0
- package/src/stories/Combobox/Combobox.test.ts +7 -0
- package/src/stories/Dropdown/Dropdown.settings.ts +10 -1
- package/src/stories/Dropdown/Dropdown.stories.mdx +17 -0
- package/src/stories/Select/Select.settings.ts +9 -23
- package/src/stories/Select/Select.stories.mdx +60 -0
- package/src/stories/argTypes.ts +46 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,k){typeof exports=="object"&&typeof module<"u"?module.exports=k(require("vue"),require("nanoid"),require("@vueuse/core"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","nanoid","@vueuse/core","@iconify/vue"],k):(e=typeof globalThis<"u"?globalThis:e||self,e.VvCombobox=k(e.vue,e.nanoid,e.core,e.vue$1))})(this,function(e,k,N,B){"use strict";function O(n,r,t){return t?$(n,t)===$(r,t):x(n,r)}function x(n,r){if(n===r)return!0;if(n&&r&&typeof n=="object"&&typeof r=="object"){const t=Array.isArray(n),c=Array.isArray(r);let l,i,o;if(t&&c){if(i=n.length,i!=r.length)return!1;for(l=i;l--!==0;)if(!x(n[l],r[l]))return!1;return!0}if(t!=c)return!1;const g=n instanceof Date,m=r instanceof Date;if(g!=m)return!1;if(g&&m)return n.getTime()==r.getTime();const f=n instanceof RegExp,s=r instanceof RegExp;if(f!=s)return!1;if(f&&s)return n.toString()==r.toString();const a=Object.keys(n);if(i=a.length,i!==Object.keys(r).length)return!1;for(l=i;l--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[l]))return!1;for(l=i;l--!==0;)if(o=a[l],!x(n[o],r[o]))return!1;return!0}return n!==n&&r!==r}function $(n,r){if(n&&Object.keys(n).length&&r){if(r.indexOf(".")===-1)return n[r];{const t=r.split(".");let c=n;for(let l=0,i=t.length;l<i;++l){if(n==null)return null;c=c[t[l]]}return c}}else return null}function z(n,r){let t=-1;if(r){for(let c=0;c<r.length;c++)if(O(r[c],n)){t=c;break}}return t}function A(n,r){if(n!=null&&r&&r.length){for(const t of r)if(O(n,t))return!0}return!1}function j(n){return(r=>r==null||r===""||Array.isArray(r)&&r.length===0||!(r instanceof Date)&&typeof r=="object"&&Object.keys(r).length===0)(e.unref(n))}function Z(n,r){const t=z(n,r);return t>-1?r.filter((c,l)=>l!==t):r}function G(n){return typeof n=="string"||n instanceof String}function F(n){var r,t;if(n)return(t=(r=n.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:r.join("-"))==null?void 0:t.toLowerCase()}function D(n,r){const t={[`${n}`]:!0};return{bemCssClasses:e.computed(()=>Object.keys(r).reduce((l,i)=>{const o=e.unref(r[i])||!1;if(!o)return l;if(i==="modifiers"){const g=Array.isArray(o)?o:o.split(" ");return{...l,...g.reduce((m,f)=>({...m,[`${n}--${F(f)}`]:!0}),{})}}else return{...l,[`${n}--${F(i)}`]:o}},t)||{})}}function U(n,r,t){const c=e.computed(()=>!!(n!=null&&n.value&&r.value==="left"||t!=null&&t.iconLeft)),l=e.computed(()=>!!(n!=null&&n.value&&r.value==="right"||t!=null&&t.iconRight)),i=e.computed(()=>!!(n!=null&&n.value&&r.value==="top"||t!=null&&t.iconTop)),o=e.computed(()=>!!(n!=null&&n.value&&r.value==="bottom"||t!=null&&t.iconBottom));return{hasIcon:e.computed(()=>typeof(n==null?void 0:n.value)=="string"?{name:n==null?void 0:n.value}:n==null?void 0:n.value),hasIconLeft:c,hasIconRight:l,hasIconTop:i,hasIconBottom:o}}function T(n){const{options:r,labelKey:t,valueKey:c}=e.toRefs(n);return{options:r,getOptionLabel:o=>typeof o!="object"&&o!==null?o:typeof t.value=="function"?t.value(o):o[t.value],getOptionValue:o=>typeof o!="object"&&o!==null?o:typeof c.value=="function"?c.value(o):o[c.value]}}function J(n,r){const{focused:t}=N.useFocus(n);return e.watch(t,c=>{r(c?"focus":"blur",e.unref(n))}),{focused:t}}const X={valid:Boolean,validLabel:[String,Array]},Q={invalid:Boolean,invalidLabel:[String,Array]},W={loading:Boolean,loadingLabel:String},K={disabled:Boolean},Y={readonly:Boolean},L={modifiers:[String,Array]},ee={hintLabel:{type:String,default:""}},q={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"}},H={LEFT:"left",RIGHT:"right"},te={icon:{type:[String,Object]},iconPosition:{type:String,validation:n=>Object.values(H).includes(n),default:H.RIGHT}},ne={tabindex:{type:[String,Number],default:0}},re={...q,...K,...L,modelValue:{type:[String,Number,Boolean,Object,Array]},labelNoResults:{type:String,default:"No results"},multiple:Boolean,maxValues:[Number,String]},oe={key:0,role:"option"},le=["aria-selected"],se=["for","onClick"],ae=["id","type","value","checked","disabled"],ie={name:"VvDropdown"},ce=e.defineComponent({...ie,props:re,emits:["update:modelValue"],setup(n,{emit:r}){const t=n,c=k.nanoid(),{modifiers:l,disabled:i}=e.toRefs(t),{getOptionLabel:o,getOptionValue:g}=T(t),{bemCssClasses:m}=D("vv-dropdown",{modifiers:l,disabled:i});function f(u){return Array.isArray(t.modelValue)?A(u,t.modelValue)||A(g(u),t.modelValue):O(u,t.modelValue)||O(g(u),t.modelValue)}function s(u){return typeof u=="string"||u.disabled===void 0?i.value:u.disabled}function a(u){var y;if(t.disabled)return;let p=u;if(t.multiple)if(Array.isArray(t.modelValue)){if(t.maxValues!==void 0&&t.maxValues>=0&&((y=t.modelValue)==null?void 0:y.length)>=t.maxValues&&!A(u,t.modelValue))return;p=A(u,t.modelValue)?Z(u,t.modelValue):[...t.modelValue,u]}else p=[u];r("update:modelValue",p)}return(u,p)=>{var y;return e.openBlock(),e.createElementBlock("ul",{class:e.normalizeClass(e.unref(m)),role:"listbox"},[(y=u.options)!=null&&y.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("li",oe,[e.createElementVNode("label",null,e.toDisplayString(u.labelNoResults),1)])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.options,(h,V)=>(e.openBlock(),e.createElementBlock("li",{key:V,role:"option","aria-selected":f(h)},[e.createElementVNode("label",{for:`dropdown-${V}-${e.unref(c)}`,onClick:e.withModifiers(C=>a(e.unref(g)(h)),["prevent"])},[e.createElementVNode("input",{id:`dropdown-${V}-${e.unref(c)}`,type:u.multiple?"checkbox":"radio",value:e.unref(g)(h),checked:f(h),disabled:s(h),tabindex:"-1","aria-hidden":"true"},null,8,ae),e.createTextVNode(" "+e.toDisplayString(e.unref(o)(h)),1)],8,se)],8,le))),128))],2)}}}),ue="ds",de={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]}},fe={name:"VvIcon"},M=e.defineComponent({...fe,props:de,setup(n){const r=n,t=e.ref(!0),{modifiers:c}=e.toRefs(r),l=e.inject(ue),{bemCssClasses:i}=D("vv-icon",{modifiers:c}),o=e.computed(()=>r.provider||(l==null?void 0:l.provider)),g=e.computed(()=>{const s=r.name??"",a=`@${o.value}:${r.prefix}:${r.name}`;return B.iconExists(s)?s:B.iconExists(a)?a:(l==null?void 0:l.iconsCollections.find(u=>{const p=`@${o.value}:${u.prefix}:${s}`;if(B.iconExists(p))return p}))||s});function m(s){let a=null;if(typeof window>"u"){const{JSDOM:h}=require("jsdom");a=new h().window}return(a?new a.DOMParser:new window.DOMParser).parseFromString(s,"text/html").querySelector("svg")}function f(s){const a=m(s),u=(a==null?void 0:a.innerHTML.trim())||"";a&&u&&B.addIcon(`@${o.value}:${r.prefix}:${r.name}`,{body:u,height:a.viewBox.baseVal.height,width:a.viewBox.baseVal.width})}return l&&(r.src&&!B.iconExists(`@${o.value}:${r.prefix}:${r.name}`)?(t.value=!1,l.fetchIcon(r.src).then(s=>{s&&(f(s),t.value=!0)}).catch(s=>{throw new Error(`During fetch icon: ${s==null?void 0:s.message}`)})):r.svg&&f(r.svg)),(s,a)=>t.value?(e.openBlock(),e.createBlock(e.unref(B.Icon),e.mergeProps({key:0,class:e.unref(i)},{inline:s.inline,width:s.width,height:s.height,horizontalFlip:s.horizontalFlip,verticalFlip:s.verticalFlip,flip:s.flip,rotate:s.rotate,color:s.color,onLoad:s.onLoad,icon:e.unref(g)}),null,16,["class"])):e.createCommentVNode("",!0)}});function I(n){return Array.isArray(n)?n.filter(r=>G(r)).join(" "):n}function pe(n,r){const{invalid:t,valid:c,hint:l,loading:i}=r,{hintLabel:o,modelValue:g,valid:m,validLabel:f,invalid:s,invalidLabel:a,...u}=e.toRefs(n),p=$(u,"loading"),y=$(u,"loadingLabel"),h=e.computed(()=>s.value?!!(s.value&&t||a!=null&&a.value&&Array.isArray(a.value)&&a.value.length>0||a!=null&&a.value&&!j(a)):!1),V=e.computed(()=>!!(o&&o.value||l)),C=e.computed(()=>!!(f&&f.value||c)),E=e.computed(()=>!!(p!=null&&p.value&&i||p!=null&&p.value&&(y!=null&&y.value))),R=e.computed(()=>V.value||C.value||h.value||E.value);return{hasInvalid:h,hasHint:V,hasValid:C,hasLoading:E,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(P){const _=e.computed(()=>{const S=N.toReactive({hintLabel:o,modelValue:g,valid:m,validLabel:f,invalid:s,invalidLabel:a,loading:p,loadingLabel:y,...P.params});return s!=null&&s.value?(t==null?void 0:t(S))||I(a==null?void 0:a.value)||(o==null?void 0:o.value):m!=null&&m.value?(c==null?void 0:c(S))||I(f==null?void 0:f.value)||(o==null?void 0:o.value):p!=null&&p.value?(i==null?void 0:i(S))||I(y==null?void 0:y.value)||(o==null?void 0:o.value):(l==null?void 0:l(S))||I(o==null?void 0:o.value)||(o==null?void 0:o.value)});return{isVisible:R,hasInvalid:h,hasValid:C,hintContent:_}},render(){if(this.isVisible)return e.h("small",{role:this.hasInvalid||this.hasValid?"alert":void 0},this.hintContent)}}}}const me=["update:modelValue","change:search","focus","blur"],ge={...ne,...X,...Q,...ee,...W,...K,...Y,...L,...q,...te,modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},label:String,labelNoResults:{type:String,default:"No results"},placeholder:String,searchable:Boolean,searchPlaceholder:String,debounceSearch:{type:[Number,String],default:0},multiple:Boolean,maxValues:[Number,String],separator:{type:String,default:", "},native:Boolean},ye=["id"],he=["id","for"],be=["tabindex"],Ve=["id","placeholder"],Se={name:"VvCombobox"};return e.defineComponent({...Se,props:ge,emits:me,setup(n,{emit:r}){const t=n,c=e.useSlots(),{HintSlot:l}=pe(t,c),i=e.ref(),o=e.ref(),{focused:g}=J(i,r),m=k.nanoid(),f=e.ref(""),s=N.refDebounced(f,Number(t.debounceSearch)),a=e.ref(!1),{icon:u,iconPosition:p,modifiers:y,disabled:h,readonly:V,loading:C,valid:E,invalid:R}=e.toRefs(t);e.watch(s,()=>r("change:search",s.value));const{hasIcon:P,hasIconLeft:_,hasIconRight:S}=U(u,p),ke=e.computed(()=>!j(t.modelValue)),Be=e.computed(()=>h.value||V.value?-1:t.tabindex),{bemCssClasses:Ce}=D("vv-select",{modifiers:y,disabled:h,loading:C,readonly:V,iconLeft:_,iconRight:S,valid:E,invalid:R,dirty:ke,focus:g}),we=e.computed(()=>t.searchable?Oe.value:t.options),{getOptionLabel:Ne,getOptionValue:v}=T(t),Oe=e.computed(()=>{var d;return(d=t.options)==null?void 0:d.filter(b=>Ne(b).toLowerCase().includes(s.value.toLowerCase().trim()))}),$e=e.computed(()=>{let d=[];return Array.isArray(t.modelValue)?d=t.modelValue:t.modelValue&&(d=[t.modelValue]),t.options.filter(b=>d.includes(v(b)))}),Ae=e.computed(()=>$e.value.map(d=>v(d)).join(t.separator));N.onClickOutside(i,()=>{i.value.open=!1});function Ie(d){const b=d.target;a.value=b.open}function Ee(d){i.value&&!t.multiple&&(i.value.open=!1),r("update:modelValue",d)}const Pe=e.computed(()=>({options:we.value,labelKey:t.labelKey,valueKey:t.valueKey,disabled:t.disabled,labelNoResults:t.labelNoResults,multiple:t.multiple,maxValues:t.maxValues,modelValue:t.modelValue}));return(d,b)=>d.native?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,id:e.unref(m),class:e.normalizeClass(e.unref(Ce))},[d.label?(e.openBlock(),e.createElementBlock("label",{key:0,id:`${e.unref(m)}-label`,for:d.searchable&&a.value?`${e.unref(m)}-input`:void 0},e.toDisplayString(d.label),9,he)):e.createCommentVNode("",!0),e.createElementVNode("details",{ref_key:"dropdown",ref:i,class:"vv-select__wrapper",onClick:b[2]||(b[2]=w=>e.unref(h)||e.unref(V)?w.preventDefault():null),onKeyup:b[3]||(b[3]=e.withKeys(w=>i.value.open=!1,["esc"])),onToggle:Ie},[e.createElementVNode("summary",{class:"vv-select__input",tabindex:e.unref(Be),onKeyup:b[1]||(b[1]=e.withKeys(w=>d.searchable?w.preventDefault():null,["space"]))},[e.renderSlot(d.$slots,"before",{},()=>[e.unref(_)?(e.openBlock(),e.createBlock(M,e.mergeProps({key:0,class:"vv-select__icon-left"},e.unref(P)),null,16)):e.createCommentVNode("",!0)]),d.searchable&&a.value?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,id:`${e.unref(m)}-input`,ref_key:"inputSearch",ref:o,"onUpdate:modelValue":b[0]||(b[0]=w=>f.value=w),role:"combobox",type:"search",placeholder:d.searchPlaceholder},null,8,Ve)),[[e.vModelText,f.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(e.unref(Ae)||d.placeholder),1)],64)),e.renderSlot(d.$slots,"after",{},()=>[e.unref(S)?(e.openBlock(),e.createBlock(M,e.mergeProps({key:0,class:"vv-select__icon-right"},e.unref(P)),null,16)):e.createCommentVNode("",!0)])],40,be),e.createVNode(ce,e.mergeProps({id:`${e.unref(m)}-dropdown`},e.unref(Pe),{"onUpdate:modelValue":Ee}),null,16,["id"])],544),e.createVNode(e.unref(l),{class:"vv-select__hint"})],10,ye))}})});
|
|
1
|
+
(function(e,$){typeof exports=="object"&&typeof module<"u"?module.exports=$(require("vue"),require("nanoid"),require("@vueuse/core"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","nanoid","@vueuse/core","@iconify/vue"],$):(e=typeof globalThis<"u"?globalThis:e||self,e.VvCombobox=$(e.vue,e.nanoid,e.core,e.vue$1))})(this,function(e,$,O,w){"use strict";function R(o,n,t){return t?L(o,t)===L(n,t):U(o,n)}function U(o,n){if(o===n)return!0;if(o&&n&&typeof o=="object"&&typeof n=="object"){const t=Array.isArray(o),i=Array.isArray(n);let l,c,r;if(t&&i){if(c=o.length,c!=n.length)return!1;for(l=c;l--!==0;)if(!U(o[l],n[l]))return!1;return!0}if(t!=i)return!1;const y=o instanceof Date,m=n instanceof Date;if(y!=m)return!1;if(y&&m)return o.getTime()==n.getTime();const f=o instanceof RegExp,a=n instanceof RegExp;if(f!=a)return!1;if(f&&a)return o.toString()==n.toString();const s=Object.keys(o);if(c=s.length,c!==Object.keys(n).length)return!1;for(l=c;l--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[l]))return!1;for(l=c;l--!==0;)if(r=s[l],!U(o[r],n[r]))return!1;return!0}return o!==o&&n!==n}function L(o,n){if(o&&Object.keys(o).length&&n){if(n.indexOf(".")===-1)return o[n];{const t=n.split(".");let i=o;for(let l=0,c=t.length;l<c;++l){if(o==null)return null;i=i[t[l]]}return i}}else return null}function he(o,n){let t=-1;if(n){for(let i=0;i<n.length;i++)if(R(n[i],o)){t=i;break}}return t}function j(o,n){if(o!=null&&n&&n.length){for(const t of n)if(R(o,t))return!0}return!1}function Z(o){return(n=>n==null||n===""||Array.isArray(n)&&n.length===0||!(n instanceof Date)&&typeof n=="object"&&Object.keys(n).length===0)(e.unref(o))}function be(o,n){const t=he(o,n);return t>-1?n.filter((i,l)=>l!==t):n}function Ve(o){return typeof o=="string"||o instanceof String}function oe(o){var n,t;if(o)return(t=(n=o.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:n.join("-"))==null?void 0:t.toLowerCase()}function F(o,n){const t={[`${o}`]:!0};return{bemCssClasses:e.computed(()=>Object.keys(n).reduce((l,c)=>{const r=e.unref(n[c])||!1;if(!r)return l;if(c==="modifiers"){const y=Array.isArray(r)?r:r.split(" ");return{...l,...y.reduce((m,f)=>({...m,[`${o}--${oe(f)}`]:!0}),{})}}else return{...l,[`${o}--${oe(c)}`]:r}},t)||{})}}function re(o,n,t){const i=e.computed(()=>!!(o!=null&&o.value&&n.value==="left"||t!=null&&t.iconLeft)),l=e.computed(()=>!!(o!=null&&o.value&&n.value==="right"||t!=null&&t.iconRight)),c=e.computed(()=>!!(o!=null&&o.value&&n.value==="top"||t!=null&&t.iconTop)),r=e.computed(()=>!!(o!=null&&o.value&&n.value==="bottom"||t!=null&&t.iconBottom));return{hasIcon:e.computed(()=>typeof(o==null?void 0:o.value)=="string"?{name:o==null?void 0:o.value}:o==null?void 0:o.value),hasIconLeft:i,hasIconRight:l,hasIconTop:c,hasIconBottom:r}}function G(o){const{options:n,labelKey:t,valueKey:i}=e.toRefs(o);return{options:n,getOptionLabel:r=>typeof r!="object"&&r!==null?r:typeof t.value=="function"?t.value(r):r[t.value],getOptionValue:r=>typeof r!="object"&&r!==null?r:typeof i.value=="function"?i.value(r):r[i.value]}}function le(o,n){const{focused:t}=O.useFocus(o);return e.watch(t,i=>{n(i?"focus":"blur",e.unref(o))}),{focused:t}}const ae={valid:Boolean,validLabel:[String,Array]},se={invalid:Boolean,invalidLabel:[String,Array]},ie={loading:Boolean,loadingLabel:String},J={disabled:Boolean},ce={readonly:Boolean},X={modifiers:[String,Array]},de={hintLabel:{type:String,default:""}},Q={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"}},ue={LEFT:"left",RIGHT:"right"},fe={icon:{type:[String,Object]},iconPosition:{type:String,validation:o=>Object.values(ue).includes(o),default:ue.RIGHT}},pe={tabindex:{type:[String,Number],default:0}},me={floating:Boolean},ge={unselectable:{type:Boolean,default:!0}},W={id:[String,Number],name:{type:String,required:!0}},Se={autofocus:Boolean},ke={autocomplete:{type:String,default:"off"}},Be={...W,...Q,...J,...X,modelValue:{type:[String,Number,Boolean,Object,Array]},labelNoResults:{type:String,default:"No results"},multiple:Boolean,maxValues:[Number,String],unselectable:{type:Boolean,default:!0}},Ce=["id"],Ne={key:0,role:"option"},Pe=["aria-selected"],$e=["for","onClick"],we=["id","type","value","checked","disabled","name"],Ie={name:"VvDropdown"},_e=e.defineComponent({...Ie,props:Be,emits:["update:modelValue"],setup(o,{emit:n}){const t=o,i=e.computed(()=>String(t.id||$.nanoid())),{modifiers:l,disabled:c}=e.toRefs(t),{getOptionLabel:r,getOptionValue:y}=G(t),{bemCssClasses:m}=F("vv-dropdown",{modifiers:l,disabled:c});function f(d){return Array.isArray(t.modelValue)?j(d,t.modelValue)||j(y(d),t.modelValue):R(d,t.modelValue)||R(y(d),t.modelValue)}function a(d){return typeof d=="string"||d.disabled===void 0?c.value:d.disabled}function s(d){var b;if(t.disabled)return;let p=d;if(t.multiple)if(Array.isArray(t.modelValue)){if(t.maxValues!==void 0&&t.maxValues>=0&&((b=t.modelValue)==null?void 0:b.length)>=t.maxValues&&!j(d,t.modelValue))return;p=j(d,t.modelValue)?be(d,t.modelValue):[...t.modelValue,d]}else p=[d];else t.unselectable&&d===t.modelValue&&(p=void 0);n("update:modelValue",p)}return(d,p)=>{var b;return e.openBlock(),e.createElementBlock("ul",{id:e.unref(i),class:e.normalizeClass(e.unref(m)),role:"listbox"},[(b=d.options)!=null&&b.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("li",Ne,[e.createElementVNode("label",null,e.toDisplayString(d.labelNoResults),1)])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.options,(h,S)=>(e.openBlock(),e.createElementBlock("li",{key:S,role:"option","aria-selected":f(h)},[e.createElementVNode("label",{for:`dropdown-${S}-${e.unref(i)}`,onClick:e.withModifiers(B=>s(e.unref(y)(h)),["prevent"])},[e.createElementVNode("input",{id:`dropdown-${S}-${e.unref(i)}`,type:d.multiple?"checkbox":"radio",value:e.unref(y)(h),checked:f(h),disabled:a(h),name:d.name,tabindex:"-1","aria-hidden":"true"},null,8,we),e.createTextVNode(" "+e.toDisplayString(e.unref(r)(h)),1)],8,$e)],8,Pe))),128))],10,Ce)}}}),Ae="ds",Oe={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]}},Ee={name:"VvIcon"},T=e.defineComponent({...Ee,props:Oe,setup(o){const n=o,t=e.ref(!0),{modifiers:i}=e.toRefs(n),l=e.inject(Ae),{bemCssClasses:c}=F("vv-icon",{modifiers:i}),r=e.computed(()=>n.provider||(l==null?void 0:l.provider)),y=e.computed(()=>{const a=n.name??"",s=`@${r.value}:${n.prefix}:${n.name}`;return w.iconExists(a)?a:w.iconExists(s)?s:(l==null?void 0:l.iconsCollections.find(d=>{const p=`@${r.value}:${d.prefix}:${a}`;if(w.iconExists(p))return p}))||a});function m(a){let s=null;if(typeof window>"u"){const{JSDOM:h}=require("jsdom");s=new h().window}return(s?new s.DOMParser:new window.DOMParser).parseFromString(a,"text/html").querySelector("svg")}function f(a){const s=m(a),d=(s==null?void 0:s.innerHTML.trim())||"";s&&d&&w.addIcon(`@${r.value}:${n.prefix}:${n.name}`,{body:d,height:s.viewBox.baseVal.height,width:s.viewBox.baseVal.width})}return l&&(n.src&&!w.iconExists(`@${r.value}:${n.prefix}:${n.name}`)?(t.value=!1,l.fetchIcon(n.src).then(a=>{a&&(f(a),t.value=!0)}).catch(a=>{throw new Error(`During fetch icon: ${a==null?void 0:a.message}`)})):n.svg&&f(n.svg)),(a,s)=>t.value?(e.openBlock(),e.createBlock(e.unref(w.Icon),e.mergeProps({key:0,class:e.unref(c)},{inline:a.inline,width:a.width,height:a.height,horizontalFlip:a.horizontalFlip,verticalFlip:a.verticalFlip,flip:a.flip,rotate:a.rotate,color:a.color,onLoad:a.onLoad,icon:e.unref(y)}),null,16,["class"])):e.createCommentVNode("",!0)}});function x(o){return Array.isArray(o)?o.filter(n=>Ve(n)).join(" "):o}function ye(o,n){const{invalid:t,valid:i,hint:l,loading:c}=n,{hintLabel:r,modelValue:y,valid:m,validLabel:f,invalid:a,invalidLabel:s,...d}=e.toRefs(o),p=L(d,"loading"),b=L(d,"loadingLabel"),h=e.computed(()=>a.value?!!(a.value&&t||s!=null&&s.value&&Array.isArray(s.value)&&s.value.length>0||s!=null&&s.value&&!Z(s)):!1),S=e.computed(()=>!!(r&&r.value||l)),B=e.computed(()=>!!(f&&f.value||i)),C=e.computed(()=>!!(p!=null&&p.value&&c||p!=null&&p.value&&(b!=null&&b.value))),N=e.computed(()=>S.value||B.value||h.value||C.value);return{hasInvalid:h,hasHint:S,hasValid:B,hasLoading:C,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(I){const _=e.computed(()=>{const k=O.toReactive({hintLabel:r,modelValue:y,valid:m,validLabel:f,invalid:a,invalidLabel:s,loading:p,loadingLabel:b,...I.params});return a!=null&&a.value?(t==null?void 0:t(k))||x(s==null?void 0:s.value)||(r==null?void 0:r.value):m!=null&&m.value?(i==null?void 0:i(k))||x(f==null?void 0:f.value)||(r==null?void 0:r.value):p!=null&&p.value?(c==null?void 0:c(k))||x(b==null?void 0:b.value)||(r==null?void 0:r.value):(l==null?void 0:l(k))||x(r==null?void 0:r.value)||(r==null?void 0:r.value)});return{isVisible:N,hasInvalid:h,hasValid:B,hintContent:_}},render(){if(this.isVisible)return e.h("small",{role:this.hasInvalid||this.hasValid?"alert":void 0},this.hintContent)}}}}const De={...W,...Se,...ke,...pe,...ae,...se,...de,...ie,...J,...ce,...X,...Q,...fe,...me,...ge,multiple:Boolean,required:Boolean,size:[String,Number],modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},label:String,placeholder:String},Re=["update:modelValue","focus","blur"],Le=["for"],je={class:"vv-select__wrapper"},Fe=["id"],Te=["disabled","hidden"],xe=["disabled","value"],Ke={name:"VvSelect"},qe=e.defineComponent({...Ke,props:De,emits:Re,setup(o,{emit:n}){const t=o,i=e.useSlots(),l=e.ref(),{HintSlot:c,hasHint:r,hasInvalid:y}=ye(t,i),{modifiers:m,disabled:f,readonly:a,loading:s,icon:d,iconPosition:p,invalid:b,valid:h,floating:S,multiple:B}=e.toRefs(t),C=e.computed(()=>String(t.id||$.nanoid())),N=e.computed(()=>`${C.value}-hint`),{focused:I}=le(l,n),_=O.useElementVisibility(l);e.watch(_,g=>{g&&t.autofocus&&(I.value=!0)});const{hasIcon:k,hasIconLeft:E,hasIconRight:K}=re(d,p),q=e.computed(()=>!Z(t.modelValue)),z=e.computed(()=>t.disabled||t.readonly),H=e.computed(()=>z.value?-1:t.tabindex),M=e.computed(()=>{if(t.invalid===!0)return!0;if(t.valid===!0)return!1}),{bemCssClasses:Y}=F("vv-select",{modifiers:m,valid:h,invalid:b,loading:s,disabled:f,readonly:a,iconLeft:E,iconRight:K,dirty:q,focus:I,floating:S,multiple:B}),v=e.computed(()=>({name:t.name,tabindex:H.value,disabled:z.value,required:t.required,size:t.size,autocomplete:t.autocomplete,multiple:t.multiple,"aria-invalid":M.value,"aria-describedby":!y.value&&r.value?N.value:void 0,"aria-errormessage":y.value?N.value:void 0})),{getOptionLabel:ee,getOptionValue:te}=G(t);function ne(g){return typeof g=="string"||g.disabled===void 0?f.value:g.disabled}const D=e.computed({get:()=>t.modelValue,set:g=>{Array.isArray(g)&&(g=g.filter(A=>A!==void 0)),n("update:modelValue",g)}});return(g,A)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Y))},[g.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(C)},e.toDisplayString(g.label),9,Le)):e.createCommentVNode("",!0),e.createElementVNode("div",je,[e.renderSlot(g.$slots,"before",{},()=>[e.unref(E)?(e.openBlock(),e.createBlock(T,e.normalizeProps(e.mergeProps({key:0},e.unref(k))),null,16)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("select",e.mergeProps({id:e.unref(C),ref_key:"select",ref:l,"onUpdate:modelValue":A[0]||(A[0]=u=>e.isRef(D)?D.value=u:null)},e.unref(v)),[g.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,value:void 0,disabled:!g.unselectable,hidden:!g.unselectable},e.toDisplayString(g.placeholder),9,Te)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.options,(u,V)=>(e.openBlock(),e.createElementBlock("option",{key:V,disabled:ne(u),value:e.unref(te)(u)},e.toDisplayString(e.unref(ee)(u)),9,xe))),128))],16,Fe),[[e.vModelSelect,e.unref(D)]]),e.renderSlot(g.$slots,"after",{},()=>[e.unref(K)?(e.openBlock(),e.createBlock(T,e.normalizeProps(e.mergeProps({key:0},e.unref(k))),null,16)):e.createCommentVNode("",!0)])]),e.createVNode(e.unref(c),{id:e.unref(N),class:"vv-select__hint"},null,8,["id"])],2))}}),ze=["update:modelValue","change:search","focus","blur"],He={...W,...pe,...ae,...se,...de,...ie,...J,...ce,...X,...Q,...fe,...me,...ge,modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},label:String,labelNoResults:{type:String,default:"No results"},placeholder:String,searchable:Boolean,searchPlaceholder:String,debounceSearch:{type:[Number,String],default:0},multiple:Boolean,maxValues:[Number,String],separator:{type:String,default:", "},native:Boolean},Me=["id"],Ue=["id","for"],Ze=["tabindex"],Ge=["id","placeholder"],Je={name:"VvCombobox"};return e.defineComponent({...Je,props:He,emits:ze,setup(o,{emit:n}){const t=o,i=e.useSlots(),{HintSlot:l}=ye(t,i),c=e.ref(),r=e.ref(),{focused:y}=le(c,n),m=e.computed(()=>String(t.id||$.nanoid())),f=e.ref(""),a=O.refDebounced(f,Number(t.debounceSearch)),s=e.ref(!1),{icon:d,iconPosition:p,modifiers:b,disabled:h,readonly:S,loading:B,valid:C,invalid:N,floating:I}=e.toRefs(t);e.watch(a,()=>n("change:search",a.value));const{hasIcon:_,hasIconLeft:k,hasIconRight:E}=re(d,p),K=e.computed(()=>!Z(t.modelValue)),q=e.computed(()=>h.value||S.value?-1:t.tabindex),{bemCssClasses:z}=F("vv-select",{modifiers:b,disabled:h,loading:B,readonly:S,iconLeft:k,iconRight:E,valid:C,invalid:N,dirty:K,focus:y,floating:I}),H=e.computed(()=>t.searchable?v.value:t.options),{getOptionLabel:M,getOptionValue:Y}=G(t),v=e.computed(()=>{var u;return(u=t.options)==null?void 0:u.filter(V=>M(V).toLowerCase().includes(a.value.toLowerCase().trim()))}),ee=e.computed(()=>{let u=[];return Array.isArray(t.modelValue)?u=t.modelValue:t.modelValue&&(u=[t.modelValue]),t.options.filter(V=>u.includes(Y(V)))}),te=e.computed(()=>ee.value.map(u=>M(u)).join(t.separator));O.onClickOutside(c,()=>{c.value.open=!1});function ne(u){const V=u.target;s.value=V.open}function D(u){c.value&&!t.multiple&&(c.value.open=!1),n("update:modelValue",u)}const g=e.computed(()=>({name:t.name,options:H.value,labelKey:t.labelKey,valueKey:t.valueKey,disabled:t.disabled,labelNoResults:t.labelNoResults,multiple:t.multiple,maxValues:t.maxValues,modelValue:t.modelValue,unselectable:t.unselectable})),A=e.computed(()=>({id:m.value,name:t.name,tabindex:q.value,valid:C.value,validLabel:t.validLabel,invalid:N.value,invalidLabel:t.invalidLabel,hintLabel:t.hintLabel,loading:B.value,loadingLabel:t.loadingLabel,disabled:h.value,readonly:S.value,modifiers:t.modifiers,options:H.value,labelKey:t.labelKey,valueKey:t.valueKey,icon:t.icon,iconPosition:t.iconPosition,floating:t.floating,unselectable:t.unselectable,multiple:t.multiple,label:t.label,placeholder:t.placeholder,modelValue:t.modelValue}));return(u,V)=>u.native?(e.openBlock(),e.createBlock(qe,e.mergeProps({key:1},e.unref(A),{"onUpdate:modelValue":V[4]||(V[4]=P=>n("update:modelValue",P))}),null,16)):(e.openBlock(),e.createElementBlock("div",{key:0,id:e.unref(m),class:e.normalizeClass(e.unref(z))},[u.label?(e.openBlock(),e.createElementBlock("label",{key:0,id:`${e.unref(m)}-label`,for:u.searchable&&s.value?`${e.unref(m)}-input`:void 0},e.toDisplayString(u.label),9,Ue)):e.createCommentVNode("",!0),e.createElementVNode("details",{ref_key:"dropdown",ref:c,class:"vv-select__wrapper",onClick:V[2]||(V[2]=P=>e.unref(h)||e.unref(S)?P.preventDefault():null),onKeyup:V[3]||(V[3]=e.withKeys(P=>c.value.open=!1,["esc"])),onToggle:ne},[e.createElementVNode("summary",{class:"vv-select__input",tabindex:e.unref(q),onKeyup:V[1]||(V[1]=e.withKeys(P=>u.searchable?P.preventDefault():null,["space"]))},[e.renderSlot(u.$slots,"before",{},()=>[e.unref(k)?(e.openBlock(),e.createBlock(T,e.mergeProps({key:0,class:"vv-select__icon-left"},e.unref(_)),null,16)):e.createCommentVNode("",!0)]),u.searchable&&s.value?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,id:`${e.unref(m)}-input`,ref_key:"inputSearch",ref:r,"onUpdate:modelValue":V[0]||(V[0]=P=>f.value=P),role:"combobox",type:"search",placeholder:u.searchPlaceholder},null,8,Ge)),[[e.vModelText,f.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(e.unref(te)||u.placeholder),1)],64)),e.renderSlot(u.$slots,"after",{},()=>[e.unref(E)?(e.openBlock(),e.createBlock(T,e.mergeProps({key:0,class:"vv-select__icon-right"},e.unref(_)),null,16)):e.createCommentVNode("",!0)])],40,Ze),e.createVNode(_e,e.mergeProps({id:`${e.unref(m)}-dropdown`},e.unref(g),{"onUpdate:modelValue":D}),null,16,["id"])],544),e.createVNode(e.unref(l),{class:"vv-select__hint"})],10,Me))}})});
|
|
@@ -22,6 +22,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
22
22
|
default: string;
|
|
23
23
|
};
|
|
24
24
|
native: BooleanConstructor;
|
|
25
|
+
unselectable: {
|
|
26
|
+
type: BooleanConstructor;
|
|
27
|
+
default: boolean;
|
|
28
|
+
};
|
|
29
|
+
floating: BooleanConstructor;
|
|
25
30
|
icon: {
|
|
26
31
|
type: (ObjectConstructor | StringConstructor)[];
|
|
27
32
|
};
|
|
@@ -59,6 +64,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
59
64
|
type: (StringConstructor | NumberConstructor)[];
|
|
60
65
|
default: number;
|
|
61
66
|
};
|
|
67
|
+
id: (StringConstructor | NumberConstructor)[];
|
|
68
|
+
name: {
|
|
69
|
+
type: StringConstructor;
|
|
70
|
+
required: boolean;
|
|
71
|
+
};
|
|
62
72
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
63
73
|
modelValue: {
|
|
64
74
|
type: (ArrayConstructor | ObjectConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
@@ -83,6 +93,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
83
93
|
default: string;
|
|
84
94
|
};
|
|
85
95
|
native: BooleanConstructor;
|
|
96
|
+
unselectable: {
|
|
97
|
+
type: BooleanConstructor;
|
|
98
|
+
default: boolean;
|
|
99
|
+
};
|
|
100
|
+
floating: BooleanConstructor;
|
|
86
101
|
icon: {
|
|
87
102
|
type: (ObjectConstructor | StringConstructor)[];
|
|
88
103
|
};
|
|
@@ -120,12 +135,18 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
120
135
|
type: (StringConstructor | NumberConstructor)[];
|
|
121
136
|
default: number;
|
|
122
137
|
};
|
|
138
|
+
id: (StringConstructor | NumberConstructor)[];
|
|
139
|
+
name: {
|
|
140
|
+
type: StringConstructor;
|
|
141
|
+
required: boolean;
|
|
142
|
+
};
|
|
123
143
|
}>> & {
|
|
124
144
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
125
145
|
}, {
|
|
126
146
|
modelValue: string | number | boolean | unknown[] | Record<string, any>;
|
|
127
147
|
disabled: boolean;
|
|
128
148
|
multiple: boolean;
|
|
149
|
+
unselectable: boolean;
|
|
129
150
|
iconPosition: import("../../props/index.js").IconPosition;
|
|
130
151
|
loading: boolean;
|
|
131
152
|
readonly: boolean;
|
|
@@ -137,6 +158,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
137
158
|
labelKey: string | Function;
|
|
138
159
|
valueKey: string | Function;
|
|
139
160
|
labelNoResults: string;
|
|
161
|
+
floating: boolean;
|
|
140
162
|
searchable: boolean;
|
|
141
163
|
debounceSearch: string | number;
|
|
142
164
|
separator: string;
|
|
@@ -56,6 +56,11 @@ export declare const VvComboboxProps: {
|
|
|
56
56
|
* Show native select
|
|
57
57
|
*/
|
|
58
58
|
native: BooleanConstructor;
|
|
59
|
+
unselectable: {
|
|
60
|
+
type: BooleanConstructor;
|
|
61
|
+
default: boolean;
|
|
62
|
+
};
|
|
63
|
+
floating: BooleanConstructor;
|
|
59
64
|
icon: {
|
|
60
65
|
type: (ObjectConstructor | StringConstructor)[];
|
|
61
66
|
};
|
|
@@ -75,7 +80,9 @@ export declare const VvComboboxProps: {
|
|
|
75
80
|
valueKey: {
|
|
76
81
|
type: (StringConstructor | FunctionConstructor)[];
|
|
77
82
|
default: string;
|
|
78
|
-
};
|
|
83
|
+
}; /**
|
|
84
|
+
* The input search debounce time in ms
|
|
85
|
+
*/
|
|
79
86
|
modifiers: import("vue").PropType<string | string[]>;
|
|
80
87
|
readonly: BooleanConstructor;
|
|
81
88
|
disabled: BooleanConstructor;
|
|
@@ -93,4 +100,9 @@ export declare const VvComboboxProps: {
|
|
|
93
100
|
type: (StringConstructor | NumberConstructor)[];
|
|
94
101
|
default: number;
|
|
95
102
|
};
|
|
103
|
+
id: (StringConstructor | NumberConstructor)[];
|
|
104
|
+
name: {
|
|
105
|
+
type: StringConstructor;
|
|
106
|
+
required: boolean;
|
|
107
|
+
};
|
|
96
108
|
};
|
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
import { computed as
|
|
1
|
+
import { computed as B, unref as a, toRefs as N, defineComponent as $, openBlock as b, createElementBlock as V, normalizeClass as j, createElementVNode as v, toDisplayString as O, createCommentVNode as w, Fragment as x, renderList as D, withModifiers as L, createTextVNode as R } from "vue";
|
|
2
2
|
import { nanoid as E } from "nanoid";
|
|
3
|
-
function A(r,
|
|
4
|
-
return
|
|
3
|
+
function A(r, t, e) {
|
|
4
|
+
return e ? _(r, e) === _(t, e) : C(r, t);
|
|
5
5
|
}
|
|
6
|
-
function C(r,
|
|
7
|
-
if (r ===
|
|
6
|
+
function C(r, t) {
|
|
7
|
+
if (r === t)
|
|
8
8
|
return !0;
|
|
9
|
-
if (r &&
|
|
10
|
-
const
|
|
9
|
+
if (r && t && typeof r == "object" && typeof t == "object") {
|
|
10
|
+
const e = Array.isArray(r), s = Array.isArray(t);
|
|
11
11
|
let n, u, l;
|
|
12
|
-
if (
|
|
13
|
-
if (u = r.length, u !=
|
|
12
|
+
if (e && s) {
|
|
13
|
+
if (u = r.length, u != t.length)
|
|
14
14
|
return !1;
|
|
15
15
|
for (n = u; n-- !== 0; )
|
|
16
|
-
if (!C(r[n],
|
|
16
|
+
if (!C(r[n], t[n]))
|
|
17
17
|
return !1;
|
|
18
18
|
return !0;
|
|
19
19
|
}
|
|
20
|
-
if (
|
|
20
|
+
if (e != s)
|
|
21
21
|
return !1;
|
|
22
|
-
const i = r instanceof Date, d =
|
|
22
|
+
const i = r instanceof Date, d = t instanceof Date;
|
|
23
23
|
if (i != d)
|
|
24
24
|
return !1;
|
|
25
25
|
if (i && d)
|
|
26
|
-
return r.getTime() ==
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
26
|
+
return r.getTime() == t.getTime();
|
|
27
|
+
const f = r instanceof RegExp, g = t instanceof RegExp;
|
|
28
|
+
if (f != g)
|
|
29
29
|
return !1;
|
|
30
|
-
if (
|
|
31
|
-
return r.toString() ==
|
|
30
|
+
if (f && g)
|
|
31
|
+
return r.toString() == t.toString();
|
|
32
32
|
const m = Object.keys(r);
|
|
33
|
-
if (u = m.length, u !== Object.keys(
|
|
33
|
+
if (u = m.length, u !== Object.keys(t).length)
|
|
34
34
|
return !1;
|
|
35
35
|
for (n = u; n-- !== 0; )
|
|
36
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
36
|
+
if (!Object.prototype.hasOwnProperty.call(t, m[n]))
|
|
37
37
|
return !1;
|
|
38
38
|
for (n = u; n-- !== 0; )
|
|
39
|
-
if (l = m[n], !C(r[l],
|
|
39
|
+
if (l = m[n], !C(r[l], t[l]))
|
|
40
40
|
return !1;
|
|
41
41
|
return !0;
|
|
42
42
|
}
|
|
43
|
-
return r !== r &&
|
|
43
|
+
return r !== r && t !== t;
|
|
44
44
|
}
|
|
45
|
-
function _(r,
|
|
46
|
-
if (r && Object.keys(r).length &&
|
|
47
|
-
if (
|
|
48
|
-
return r[
|
|
45
|
+
function _(r, t) {
|
|
46
|
+
if (r && Object.keys(r).length && t) {
|
|
47
|
+
if (t.indexOf(".") === -1)
|
|
48
|
+
return r[t];
|
|
49
49
|
{
|
|
50
|
-
const
|
|
51
|
-
let
|
|
52
|
-
for (let n = 0, u =
|
|
50
|
+
const e = t.split(".");
|
|
51
|
+
let s = r;
|
|
52
|
+
for (let n = 0, u = e.length; n < u; ++n) {
|
|
53
53
|
if (r == null)
|
|
54
54
|
return null;
|
|
55
|
-
|
|
55
|
+
s = s[e[n]];
|
|
56
56
|
}
|
|
57
|
-
return
|
|
57
|
+
return s;
|
|
58
58
|
}
|
|
59
59
|
} else
|
|
60
60
|
return null;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
let
|
|
64
|
-
if (
|
|
65
|
-
for (let
|
|
66
|
-
if (A(
|
|
67
|
-
|
|
62
|
+
function P(r, t) {
|
|
63
|
+
let e = -1;
|
|
64
|
+
if (t) {
|
|
65
|
+
for (let s = 0; s < t.length; s++)
|
|
66
|
+
if (A(t[s], r)) {
|
|
67
|
+
e = s;
|
|
68
68
|
break;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
return
|
|
71
|
+
return e;
|
|
72
72
|
}
|
|
73
|
-
function h(r,
|
|
74
|
-
if (r != null &&
|
|
75
|
-
for (const
|
|
76
|
-
if (A(r,
|
|
73
|
+
function h(r, t) {
|
|
74
|
+
if (r != null && t && t.length) {
|
|
75
|
+
for (const e of t)
|
|
76
|
+
if (A(r, e))
|
|
77
77
|
return !0;
|
|
78
78
|
}
|
|
79
79
|
return !1;
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
const
|
|
83
|
-
return
|
|
81
|
+
function F(r, t) {
|
|
82
|
+
const e = P(r, t);
|
|
83
|
+
return e > -1 ? t.filter((s, n) => n !== e) : t;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
var
|
|
85
|
+
function S(r) {
|
|
86
|
+
var t, e;
|
|
87
87
|
if (r)
|
|
88
|
-
return (
|
|
88
|
+
return (e = (t = r.match(
|
|
89
89
|
/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
|
|
90
|
-
)) == null ? void 0 :
|
|
90
|
+
)) == null ? void 0 : t.join("-")) == null ? void 0 : e.toLowerCase();
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
const
|
|
92
|
+
function I(r, t) {
|
|
93
|
+
const e = { [`${r}`]: !0 };
|
|
94
94
|
return {
|
|
95
|
-
bemCssClasses:
|
|
96
|
-
const l =
|
|
95
|
+
bemCssClasses: B(() => Object.keys(t).reduce((n, u) => {
|
|
96
|
+
const l = a(t[u]) || !1;
|
|
97
97
|
if (!l)
|
|
98
98
|
return n;
|
|
99
99
|
if (u === "modifiers") {
|
|
@@ -101,9 +101,9 @@ function K(r, e) {
|
|
|
101
101
|
return {
|
|
102
102
|
...n,
|
|
103
103
|
...i.reduce(
|
|
104
|
-
(d,
|
|
104
|
+
(d, f) => ({
|
|
105
105
|
...d,
|
|
106
|
-
[`${r}--${
|
|
106
|
+
[`${r}--${S(f)}`]: !0
|
|
107
107
|
}),
|
|
108
108
|
{}
|
|
109
109
|
)
|
|
@@ -111,108 +111,117 @@ function K(r, e) {
|
|
|
111
111
|
} else
|
|
112
112
|
return {
|
|
113
113
|
...n,
|
|
114
|
-
[`${r}--${
|
|
114
|
+
[`${r}--${S(u)}`]: l
|
|
115
115
|
};
|
|
116
|
-
},
|
|
116
|
+
}, e) || {})
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
|
-
function
|
|
120
|
-
const { options:
|
|
119
|
+
function K(r) {
|
|
120
|
+
const { options: t, labelKey: e, valueKey: s } = N(r);
|
|
121
121
|
return {
|
|
122
|
-
options:
|
|
123
|
-
getOptionLabel: (l) => typeof l != "object" && l !== null ? l : typeof
|
|
124
|
-
getOptionValue: (l) => typeof l != "object" && l !== null ? l : typeof
|
|
122
|
+
options: t,
|
|
123
|
+
getOptionLabel: (l) => typeof l != "object" && l !== null ? l : typeof e.value == "function" ? e.value(l) : l[e.value],
|
|
124
|
+
getOptionValue: (l) => typeof l != "object" && l !== null ? l : typeof s.value == "function" ? s.value(l) : l[s.value]
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
const
|
|
127
|
+
const M = {
|
|
128
128
|
disabled: Boolean
|
|
129
|
-
},
|
|
129
|
+
}, T = {
|
|
130
130
|
modifiers: [String, Array]
|
|
131
|
-
},
|
|
131
|
+
}, Z = {
|
|
132
132
|
options: {
|
|
133
133
|
type: Array,
|
|
134
134
|
default: () => []
|
|
135
135
|
},
|
|
136
136
|
labelKey: { type: [String, Function], default: "label" },
|
|
137
137
|
valueKey: { type: [String, Function], default: "value" }
|
|
138
|
-
},
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
}, q = {
|
|
139
|
+
id: [String, Number],
|
|
140
|
+
name: { type: String, required: !0 }
|
|
141
|
+
}, z = {
|
|
142
|
+
...q,
|
|
141
143
|
...Z,
|
|
144
|
+
...M,
|
|
145
|
+
...T,
|
|
142
146
|
modelValue: {
|
|
143
147
|
type: [String, Number, Boolean, Object, Array]
|
|
144
148
|
},
|
|
145
149
|
labelNoResults: { type: String, default: "No results" },
|
|
146
150
|
multiple: Boolean,
|
|
147
|
-
maxValues: [Number, String]
|
|
148
|
-
|
|
151
|
+
maxValues: [Number, String],
|
|
152
|
+
unselectable: { type: Boolean, default: !0 }
|
|
153
|
+
}, G = ["id"], H = {
|
|
149
154
|
key: 0,
|
|
150
155
|
role: "option"
|
|
151
|
-
},
|
|
156
|
+
}, J = ["aria-selected"], Q = ["for", "onClick"], U = ["id", "type", "value", "checked", "disabled", "name"], W = {
|
|
152
157
|
name: "VvDropdown"
|
|
153
|
-
},
|
|
154
|
-
...
|
|
155
|
-
props:
|
|
158
|
+
}, te = /* @__PURE__ */ $({
|
|
159
|
+
...W,
|
|
160
|
+
props: z,
|
|
156
161
|
emits: ["update:modelValue"],
|
|
157
|
-
setup(r, { emit:
|
|
158
|
-
const
|
|
162
|
+
setup(r, { emit: t }) {
|
|
163
|
+
const e = r, s = B(() => String(e.id || E())), { modifiers: n, disabled: u } = N(e), { getOptionLabel: l, getOptionValue: i } = K(e), { bemCssClasses: d } = I("vv-dropdown", {
|
|
159
164
|
modifiers: n,
|
|
160
165
|
disabled: u
|
|
161
166
|
});
|
|
162
|
-
function
|
|
163
|
-
return Array.isArray(
|
|
167
|
+
function f(o) {
|
|
168
|
+
return Array.isArray(e.modelValue) ? h(o, e.modelValue) || h(i(o), e.modelValue) : A(o, e.modelValue) || A(i(o), e.modelValue);
|
|
164
169
|
}
|
|
165
|
-
function
|
|
166
|
-
return typeof
|
|
170
|
+
function g(o) {
|
|
171
|
+
return typeof o == "string" || o.disabled === void 0 ? u.value : o.disabled;
|
|
167
172
|
}
|
|
168
|
-
function m(
|
|
169
|
-
var
|
|
170
|
-
if (
|
|
173
|
+
function m(o) {
|
|
174
|
+
var y;
|
|
175
|
+
if (e.disabled)
|
|
171
176
|
return;
|
|
172
|
-
let
|
|
173
|
-
if (
|
|
174
|
-
if (Array.isArray(
|
|
175
|
-
if (
|
|
177
|
+
let p = o;
|
|
178
|
+
if (e.multiple)
|
|
179
|
+
if (Array.isArray(e.modelValue)) {
|
|
180
|
+
if (e.maxValues !== void 0 && e.maxValues >= 0 && ((y = e.modelValue) == null ? void 0 : y.length) >= e.maxValues && !h(o, e.modelValue))
|
|
176
181
|
return;
|
|
177
|
-
|
|
182
|
+
p = h(o, e.modelValue) ? F(o, e.modelValue) : [...e.modelValue, o];
|
|
178
183
|
} else
|
|
179
|
-
|
|
180
|
-
|
|
184
|
+
p = [o];
|
|
185
|
+
else
|
|
186
|
+
e.unselectable && o === e.modelValue && (p = void 0);
|
|
187
|
+
t("update:modelValue", p);
|
|
181
188
|
}
|
|
182
|
-
return (
|
|
183
|
-
var
|
|
189
|
+
return (o, p) => {
|
|
190
|
+
var y;
|
|
184
191
|
return b(), V("ul", {
|
|
185
|
-
|
|
192
|
+
id: a(s),
|
|
193
|
+
class: j(a(d)),
|
|
186
194
|
role: "listbox"
|
|
187
195
|
}, [
|
|
188
|
-
(
|
|
189
|
-
v("label", null, O(
|
|
196
|
+
(y = o.options) != null && y.length ? w("", !0) : (b(), V("li", H, [
|
|
197
|
+
v("label", null, O(o.labelNoResults), 1)
|
|
190
198
|
])),
|
|
191
|
-
(b(!0), V(
|
|
199
|
+
(b(!0), V(x, null, D(o.options, (c, k) => (b(), V("li", {
|
|
192
200
|
key: k,
|
|
193
201
|
role: "option",
|
|
194
|
-
"aria-selected":
|
|
202
|
+
"aria-selected": f(c)
|
|
195
203
|
}, [
|
|
196
204
|
v("label", {
|
|
197
|
-
for: `dropdown-${k}-${
|
|
198
|
-
onClick: L((
|
|
205
|
+
for: `dropdown-${k}-${a(s)}`,
|
|
206
|
+
onClick: L((X) => m(a(i)(c)), ["prevent"])
|
|
199
207
|
}, [
|
|
200
208
|
v("input", {
|
|
201
|
-
id: `dropdown-${k}-${
|
|
202
|
-
type:
|
|
203
|
-
value:
|
|
204
|
-
checked:
|
|
205
|
-
disabled:
|
|
209
|
+
id: `dropdown-${k}-${a(s)}`,
|
|
210
|
+
type: o.multiple ? "checkbox" : "radio",
|
|
211
|
+
value: a(i)(c),
|
|
212
|
+
checked: f(c),
|
|
213
|
+
disabled: g(c),
|
|
214
|
+
name: o.name,
|
|
206
215
|
tabindex: "-1",
|
|
207
216
|
"aria-hidden": "true"
|
|
208
|
-
}, null, 8,
|
|
209
|
-
R(" " + O(
|
|
210
|
-
], 8,
|
|
211
|
-
], 8,
|
|
212
|
-
],
|
|
217
|
+
}, null, 8, U),
|
|
218
|
+
R(" " + O(a(l)(c)), 1)
|
|
219
|
+
], 8, Q)
|
|
220
|
+
], 8, J))), 128))
|
|
221
|
+
], 10, G);
|
|
213
222
|
};
|
|
214
223
|
}
|
|
215
224
|
});
|
|
216
225
|
export {
|
|
217
|
-
|
|
226
|
+
te as default
|
|
218
227
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(r,p){typeof exports=="object"&&typeof module<"u"?module.exports=p(require("vue"),require("nanoid")):typeof define=="function"&&define.amd?define(["vue","nanoid"],p):(r=typeof globalThis<"u"?globalThis:r||self,r.VvDropdown=p(r.vue,r.nanoid))})(this,function(r,p){"use strict";function V(n,t,e){return e?C(n,e)===C(t,e):k(n,t)}function k(n,t){if(n===t)return!0;if(n&&t&&typeof n=="object"&&typeof t=="object"){const e=Array.isArray(n),i=Array.isArray(t);let o,u,l;if(e&&i){if(u=n.length,u!=t.length)return!1;for(o=u;o--!==0;)if(!k(n[o],t[o]))return!1;return!0}if(e!=i)return!1;const a=n instanceof Date,d=t instanceof Date;if(a!=d)return!1;if(a&&d)return n.getTime()==t.getTime();const f=n instanceof RegExp,h=t instanceof RegExp;if(f!=h)return!1;if(f&&h)return n.toString()==t.toString();const m=Object.keys(n);if(u=m.length,u!==Object.keys(t).length)return!1;for(o=u;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,m[o]))return!1;for(o=u;o--!==0;)if(l=m[o],!k(n[l],t[l]))return!1;return!0}return n!==n&&t!==t}function C(n,t){if(n&&Object.keys(n).length&&t){if(t.indexOf(".")===-1)return n[t];{const e=t.split(".");let i=n;for(let o=0,u=e.length;o<u;++o){if(n==null)return null;i=i[e[o]]}return i}}else return null}function _(n,t){let e=-1;if(t){for(let i=0;i<t.length;i++)if(V(t[i],n)){e=i;break}}return e}function b(n,t){if(n!=null&&t&&t.length){for(const e of t)if(V(n,e))return!0}return!1}function B(n,t){const e=_(n,t);return e>-1?t.filter((i,o)=>o!==e):t}function O(n){var t,e;if(n)return(e=(t=n.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:t.join("-"))==null?void 0:e.toLowerCase()}function N(n,t){const e={[`${n}`]:!0};return{bemCssClasses:r.computed(()=>Object.keys(t).reduce((o,u)=>{const l=r.unref(t[u])||!1;if(!l)return o;if(u==="modifiers"){const a=Array.isArray(l)?l:l.split(" ");return{...o,...a.reduce((d,f)=>({...d,[`${n}--${O(f)}`]:!0}),{})}}else return{...o,[`${n}--${O(u)}`]:l}},e)||{})}}function S(n){const{options:t,labelKey:e,valueKey:i}=r.toRefs(n);return{options:t,getOptionLabel:l=>typeof l!="object"&&l!==null?l:typeof e.value=="function"?e.value(l):l[e.value],getOptionValue:l=>typeof l!="object"&&l!==null?l:typeof i.value=="function"?i.value(l):l[i.value]}}const D={...{id:[String,Number],name:{type:String,required:!0}},...{options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"}},...{disabled:Boolean},...{modifiers:[String,Array]},modelValue:{type:[String,Number,Boolean,Object,Array]},labelNoResults:{type:String,default:"No results"},multiple:Boolean,maxValues:[Number,String],unselectable:{type:Boolean,default:!0}},E=["id"],j={key:0,role:"option"},w=["aria-selected"],x=["for","onClick"],P=["id","type","value","checked","disabled","name"],$={name:"VvDropdown"};return r.defineComponent({...$,props:D,emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=r.computed(()=>String(e.id||p.nanoid())),{modifiers:o,disabled:u}=r.toRefs(e),{getOptionLabel:l,getOptionValue:a}=S(e),{bemCssClasses:d}=N("vv-dropdown",{modifiers:o,disabled:u});function f(s){return Array.isArray(e.modelValue)?b(s,e.modelValue)||b(a(s),e.modelValue):V(s,e.modelValue)||V(a(s),e.modelValue)}function h(s){return typeof s=="string"||s.disabled===void 0?u.value:s.disabled}function m(s){var g;if(e.disabled)return;let y=s;if(e.multiple)if(Array.isArray(e.modelValue)){if(e.maxValues!==void 0&&e.maxValues>=0&&((g=e.modelValue)==null?void 0:g.length)>=e.maxValues&&!b(s,e.modelValue))return;y=b(s,e.modelValue)?B(s,e.modelValue):[...e.modelValue,s]}else y=[s];else e.unselectable&&s===e.modelValue&&(y=void 0);t("update:modelValue",y)}return(s,y)=>{var g;return r.openBlock(),r.createElementBlock("ul",{id:r.unref(i),class:r.normalizeClass(r.unref(d)),role:"listbox"},[(g=s.options)!=null&&g.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("li",j,[r.createElementVNode("label",null,r.toDisplayString(s.labelNoResults),1)])),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.options,(c,A)=>(r.openBlock(),r.createElementBlock("li",{key:A,role:"option","aria-selected":f(c)},[r.createElementVNode("label",{for:`dropdown-${A}-${r.unref(i)}`,onClick:r.withModifiers(F=>m(r.unref(a)(c)),["prevent"])},[r.createElementVNode("input",{id:`dropdown-${A}-${r.unref(i)}`,type:s.multiple?"checkbox":"radio",value:r.unref(a)(c),checked:f(c),disabled:h(c),name:s.name,tabindex:"-1","aria-hidden":"true"},null,8,P),r.createTextVNode(" "+r.toDisplayString(r.unref(l)(c)),1)],8,x)],8,w))),128))],10,E)}}})});
|
|
@@ -9,6 +9,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
9
9
|
};
|
|
10
10
|
multiple: BooleanConstructor;
|
|
11
11
|
maxValues: (StringConstructor | NumberConstructor)[];
|
|
12
|
+
unselectable: {
|
|
13
|
+
type: BooleanConstructor;
|
|
14
|
+
default: boolean;
|
|
15
|
+
};
|
|
12
16
|
modifiers: import("vue").PropType<string | string[]>;
|
|
13
17
|
disabled: BooleanConstructor;
|
|
14
18
|
options: {
|
|
@@ -23,6 +27,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
23
27
|
type: (StringConstructor | FunctionConstructor)[];
|
|
24
28
|
default: string;
|
|
25
29
|
};
|
|
30
|
+
id: (StringConstructor | NumberConstructor)[];
|
|
31
|
+
name: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
required: boolean;
|
|
34
|
+
};
|
|
26
35
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
27
36
|
modelValue: {
|
|
28
37
|
type: (ArrayConstructor | ObjectConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
@@ -33,6 +42,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
33
42
|
};
|
|
34
43
|
multiple: BooleanConstructor;
|
|
35
44
|
maxValues: (StringConstructor | NumberConstructor)[];
|
|
45
|
+
unselectable: {
|
|
46
|
+
type: BooleanConstructor;
|
|
47
|
+
default: boolean;
|
|
48
|
+
};
|
|
36
49
|
modifiers: import("vue").PropType<string | string[]>;
|
|
37
50
|
disabled: BooleanConstructor;
|
|
38
51
|
options: {
|
|
@@ -47,11 +60,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
47
60
|
type: (StringConstructor | FunctionConstructor)[];
|
|
48
61
|
default: string;
|
|
49
62
|
};
|
|
63
|
+
id: (StringConstructor | NumberConstructor)[];
|
|
64
|
+
name: {
|
|
65
|
+
type: StringConstructor;
|
|
66
|
+
required: boolean;
|
|
67
|
+
};
|
|
50
68
|
}>> & {
|
|
51
69
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
52
70
|
}, {
|
|
53
71
|
disabled: boolean;
|
|
54
72
|
multiple: boolean;
|
|
73
|
+
unselectable: boolean;
|
|
55
74
|
options: (string | Option)[];
|
|
56
75
|
labelKey: string | Function;
|
|
57
76
|
valueKey: string | Function;
|
|
@@ -20,6 +20,13 @@ export declare const VvDropdownProps: {
|
|
|
20
20
|
* The max number of selected values
|
|
21
21
|
*/
|
|
22
22
|
maxValues: (StringConstructor | NumberConstructor)[];
|
|
23
|
+
/**
|
|
24
|
+
* If true the input will be unselectable
|
|
25
|
+
*/
|
|
26
|
+
unselectable: {
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
default: boolean;
|
|
29
|
+
};
|
|
23
30
|
modifiers: import("vue").PropType<string | string[]>;
|
|
24
31
|
disabled: BooleanConstructor;
|
|
25
32
|
options: {
|
|
@@ -34,4 +41,9 @@ export declare const VvDropdownProps: {
|
|
|
34
41
|
type: (StringConstructor | FunctionConstructor)[];
|
|
35
42
|
default: string;
|
|
36
43
|
};
|
|
44
|
+
id: (StringConstructor | NumberConstructor)[];
|
|
45
|
+
name: {
|
|
46
|
+
type: StringConstructor;
|
|
47
|
+
required: boolean;
|
|
48
|
+
};
|
|
37
49
|
};
|