@volverjs/ui-vue 0.0.3 → 0.0.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.
Files changed (145) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +52 -13
  3. package/dist/Volver.d.ts +5 -1
  4. package/dist/components/VvAccordion/VvAccordion.es.js +113 -66
  5. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  6. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +159 -101
  7. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  8. package/dist/components/VvAction/VvAction.es.js +170 -0
  9. package/dist/components/VvAction/VvAction.umd.js +1 -0
  10. package/dist/components/VvAction/VvAction.vue.d.ts +63 -0
  11. package/dist/components/VvAction/index.d.ts +24 -0
  12. package/dist/components/VvBadge/VvBadge.es.js +86 -16
  13. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  14. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +97 -41
  15. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  16. package/dist/components/VvButton/VvButton.es.js +434 -251
  17. package/dist/components/VvButton/VvButton.umd.js +1 -1
  18. package/dist/components/VvButton/VvButton.vue.d.ts +50 -50
  19. package/dist/components/VvButton/index.d.ts +22 -67
  20. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +118 -43
  21. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  22. package/dist/components/VvCard/VvCard.es.js +38 -25
  23. package/dist/components/VvCard/VvCard.umd.js +1 -1
  24. package/dist/components/VvCheckbox/VvCheckbox.es.js +334 -154
  25. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  26. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +2 -2
  27. package/dist/components/VvCheckbox/index.d.ts +1 -1
  28. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +401 -204
  29. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  30. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +2 -2
  31. package/dist/components/VvCheckboxGroup/index.d.ts +1 -1
  32. package/dist/components/VvCombobox/VvCombobox.es.js +950 -594
  33. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  34. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +54 -30
  35. package/dist/components/VvCombobox/index.d.ts +18 -13
  36. package/dist/components/VvDialog/VvDialog.es.js +139 -64
  37. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  38. package/dist/components/VvDropdown/VvDropdown.es.js +276 -158
  39. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  40. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +9 -9
  41. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +61 -0
  42. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +52 -0
  43. package/dist/components/VvDropdown/index.d.ts +6 -9
  44. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +251 -0
  45. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -0
  46. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +30 -15
  47. package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
  48. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +176 -0
  49. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -0
  50. package/dist/components/VvIcon/VvIcon.es.js +48 -32
  51. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  52. package/dist/components/VvInputText/VvInputText.es.js +508 -344
  53. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  54. package/dist/components/VvInputText/VvInputText.vue.d.ts +11 -4
  55. package/dist/components/VvInputText/index.d.ts +13 -2
  56. package/dist/components/VvProgress/VvProgress.es.js +90 -20
  57. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  58. package/dist/components/VvRadio/VvRadio.es.js +305 -125
  59. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  60. package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
  61. package/dist/components/VvRadio/index.d.ts +1 -1
  62. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +372 -175
  63. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  64. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +2 -2
  65. package/dist/components/VvRadioGroup/index.d.ts +1 -1
  66. package/dist/components/VvSelect/VvSelect.es.js +371 -216
  67. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  68. package/dist/components/VvSelect/VvSelect.vue.d.ts +11 -4
  69. package/dist/components/VvSelect/index.d.ts +5 -5
  70. package/dist/components/VvTextarea/VvTextarea.es.js +408 -244
  71. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  72. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +11 -4
  73. package/dist/components/VvTextarea/index.d.ts +5 -5
  74. package/dist/components/VvTooltip/VvTooltip.es.js +88 -18
  75. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  76. package/dist/components/index.es.js +1913 -1521
  77. package/dist/components/index.umd.js +1 -1
  78. package/dist/composables/dropdown/useInjectDropdown.d.ts +1 -1
  79. package/dist/composables/dropdown/useProvideDropdown.d.ts +2 -2
  80. package/dist/constants.d.ts +30 -0
  81. package/dist/directives/index.es.js +128 -0
  82. package/dist/directives/index.umd.js +1 -0
  83. package/dist/directives/v-tooltip.es.js +126 -0
  84. package/dist/directives/v-tooltip.umd.js +1 -0
  85. package/dist/icons.es.js +3 -3
  86. package/dist/icons.umd.js +1 -1
  87. package/dist/index.es.js +2102 -1761
  88. package/dist/index.umd.js +1 -1
  89. package/dist/props/index.d.ts +179 -11
  90. package/dist/resolvers/unplugin.d.ts +8 -8
  91. package/dist/resolvers/unplugin.es.js +51 -30
  92. package/dist/resolvers/unplugin.umd.js +1 -1
  93. package/dist/stories/Combobox/Combobox.settings.d.ts +44 -0
  94. package/dist/stories/Dropdown/Dropdown.settings.d.ts +3 -2
  95. package/package.json +60 -34
  96. package/src/Volver.ts +12 -5
  97. package/src/assets/icons/detailed.json +1 -1
  98. package/src/assets/icons/normal.json +1 -1
  99. package/src/assets/icons/simple.json +1 -1
  100. package/src/components/VvAction/VvAction.vue +144 -0
  101. package/src/components/VvAction/index.ts +5 -0
  102. package/src/components/VvButton/VvButton.vue +31 -114
  103. package/src/components/VvButton/index.ts +6 -79
  104. package/src/components/VvCombobox/VvCombobox.vue +54 -42
  105. package/src/components/VvCombobox/index.ts +11 -9
  106. package/src/components/VvDropdown/VvDropdownAction.vue +44 -0
  107. package/src/components/VvDropdown/VvDropdownOption.vue +65 -0
  108. package/src/components/VvDropdown/index.ts +4 -9
  109. package/src/components/VvSelect/index.ts +2 -4
  110. package/src/composables/dropdown/useInjectDropdown.ts +1 -1
  111. package/src/composables/dropdown/useProvideDropdown.ts +7 -9
  112. package/src/composables/useModifiers.ts +4 -7
  113. package/src/constants.ts +36 -0
  114. package/src/props/index.ts +106 -14
  115. package/src/resolvers/unplugin.ts +81 -48
  116. package/src/stories/Accordion/AccordionSlots.stories.mdx +2 -2
  117. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +2 -1
  118. package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +2 -1
  119. package/src/stories/Button/Button.stories.mdx +4 -2
  120. package/src/stories/Button/Button.test.ts +3 -1
  121. package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
  122. package/src/stories/Button/ButtonSlots.stories.mdx +8 -7
  123. package/src/stories/Button/ButtonState.stories.mdx +2 -11
  124. package/src/stories/Card/Card.stories.mdx +2 -1
  125. package/src/stories/Checkbox/Checkbox.stories.mdx +2 -1
  126. package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +2 -1
  127. package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +2 -1
  128. package/src/stories/Combobox/Combobox.settings.ts +44 -0
  129. package/src/stories/Combobox/Combobox.stories.mdx +40 -1
  130. package/src/stories/Dialog/Dialog.stories.mdx +2 -1
  131. package/src/stories/Dropdown/Dropdown.settings.ts +3 -2
  132. package/src/stories/Dropdown/Dropdown.stories.mdx +14 -12
  133. package/src/stories/Dropdown/DropdownMultilevel.stories.mdx +56 -0
  134. package/src/stories/Dropdown/DropdownSlots.stories.mdx +14 -13
  135. package/src/stories/Icon/Icon.stories.mdx +2 -1
  136. package/src/stories/Icon/IconsCollection.stories.mdx +2 -1
  137. package/src/stories/InputText/InputText.stories.mdx +2 -1
  138. package/src/stories/Progress/Progress.stories.mdx +2 -1
  139. package/src/stories/Radio/Radio.stories.mdx +2 -1
  140. package/src/stories/RadioGroup/RadioGroup.stories.mdx +2 -1
  141. package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +2 -1
  142. package/src/stories/Select/Select.stories.mdx +2 -1
  143. package/src/stories/Textarea/Textarea.stories.mdx +2 -1
  144. package/src/stories/Tooltip/Tooltip.stories.mdx +2 -1
  145. package/src/stories/Tooltip/TooltipDirective.stories.mdx +2 -1
@@ -1 +1 @@
1
- (function(e,V){typeof exports=="object"&&typeof module<"u"?module.exports=V(require("vue")):typeof define=="function"&&define.amd?define(["vue"],V):(e=typeof globalThis<"u"?globalThis:e||self,e.VvCheckboxGroup=V(e.vue))})(this,function(e){"use strict";var V=(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(V||{}),P=(t=>(t.topStart="top-start",t.topEnd="top-end",t.bottomStart="bottom-start",t.bottomEnd="bottom-end",t.leftStart="left-start",t.leftEnd="left-end",t.rightStart="right-start",t.rightEnd="right-end",t))(P||{}),A=(t=>(t.before="before",t.after="after",t))(A||{});const j=Symbol.for("checkGroup");function x(t){return Array.isArray(t)?t.filter(f=>isString(f)).join(" "):t}function I(t,f){const{invalid:o,valid:v,hint:u,loading:d}=f,{hintLabel:a,modelValue:k,valid:c,validLabel:i,invalid:n,invalidLabel:r,...y}=toRefs(t),s=resolveFieldData(y,"loading"),p=resolveFieldData(y,"loadingLabel"),m=computed(()=>n.value?!!(n.value&&o||r!=null&&r.value&&Array.isArray(r.value)&&r.value.length>0||r!=null&&r.value&&!isEmpty(r)):!1),l=computed(()=>!!(a&&a.value||u)),g=computed(()=>!!(i&&i.value||v)),C=computed(()=>!!(s!=null&&s.value&&d||s!=null&&s.value&&(p!=null&&p.value))),B=computed(()=>l.value||g.value||m.value||C.value);return{hasInvalid:m,hasHint:l,hasValid:g,hasLoading:C,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(O){const N=computed(()=>{const S=toReactive({hintLabel:a,modelValue:k,valid:c,validLabel:i,invalid:n,invalidLabel:r,loading:s,loadingLabel:p,...O.params});return n!=null&&n.value?(o==null?void 0:o(S))||x(r==null?void 0:r.value)||(a==null?void 0:a.value):c!=null&&c.value?(v==null?void 0:v(S))||x(i==null?void 0:i.value)||(a==null?void 0:a.value):s!=null&&s.value?(d==null?void 0:d(S))||x(p==null?void 0:p.value)||(a==null?void 0:a.value):(u==null?void 0:u(S))||x(a==null?void 0:a.value)||(a==null?void 0:a.value)});return{isVisible:B,hasInvalid:m,hasValid:g,hintContent:N}},render(){if(this.isVisible)return h("small",{role:this.hasInvalid?"alert":this.hasValid?"status":void 0},this.hintContent)}}}}const G={valid:Boolean,validLabel:[String,Array]},R={invalid:Boolean,invalidLabel:[String,Array]},w={disabled:Boolean},F={readonly:Boolean},E={modifiers:[String,Array]},H={hintLabel:{type:String,default:""}},$={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 D={tabindex:{type:[String,Number],default:0}},M={id:[String,Number]};V.bottom;const T={...{...M,name:{type:String,required:!0}},...D,...G,...R,...H,...w,...F,...E,value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String],label:String},q={...G,...R,...$,...H,...w,...F,...E,modelValue:[String,Array],label:String,name:{type:String,required:!0},vertical:Boolean},K={...T,...E,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean},z=["click","update:modelValue","change","blur"];function U(t,f){const{group:o,isInGroup:v,getGroupOrLocalRef:u}=useInjectedGroupState(j),{id:d,switch:a,indeterminate:k}=toRefs(t),c=u("modelValue",t,f),i=u("readonly",t),n=u("disabled",t),r=u("valid",t),y=u("invalid",t);return{id:d,propsSwitch:a,indeterminate:k,group:o,isInGroup:v,modelValue:c,readonly:i,disabled:n,valid:r,invalid:y}}const J=["for"],W=["id","name","disabled","value","tabindex","aria-invalid"],Y={name:"VvCheckbox"},Q=e.defineComponent({...Y,props:K,emits:z,setup(t,{emit:f}){const o=t,v=useSlots(),{id:u,disabled:d,readonly:a,valid:k,invalid:c,propsSwitch:i,modelValue:n,indeterminate:r,isInGroup:y}=U(o,f),s=useUniqueId(u),p=computed(()=>g.value?-1:o.tabindex),m=ref(),l=computed(()=>o.uncheckedValue!==void 0&&!y.value),g=computed(()=>d.value||a.value),C=computed(()=>{if(c.value===!0)return!0;if(k.value===!0)return!1}),B=computed(()=>l.value?n.value===o.value:Array.isArray(n.value)?contains(o.value,n.value):equals(o.value,n.value)),O=computed(()=>!!(r.value||!B.value&&l.value&&o.uncheckedValue!==n.value)),N=computed(()=>{if(!l.value)return["string","number","boolean"].includes(typeof o.value)?o.value:!0}),S=computed({get(){return B.value},set(b){if(l.value)n.value=b?o.value:o.uncheckedValue;else if(Array.isArray(n.value)||y.value){const _=new Set(Array.isArray(n.value)?n.value:n.value!==void 0?[n.value]:[]);b?_.add(o.value):_.delete(o.value),n.value=[..._]}else n.value=b?o.value:void 0;f("change",b)}}),{modifiers:oe}=toRefs(o),ne=useBemModifiers("vv-checkbox",oe,computed(()=>({switch:i.value,valid:k.value,invalid:c.value,disabled:d.value,readonly:a.value,indeterminate:r.value})));watchEffect(()=>{l.value&&Array.isArray(n.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")}),watch(()=>O.value,b=>{b?m.value.indeterminate=!0:m.value.indeterminate=!1}),onMounted(()=>{O.value&&(m.value.indeterminate=!0)});const{HintSlot:ae}=I(o,v);return(b,_)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(ne)),for:e.unref(s)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(s),ref_key:"input",ref:m,"onUpdate:modelValue":_[0]||(_[0]=re=>e.isRef(S)?S.value=re:null),type:"checkbox",class:"vv-checkbox__input",name:b.name,disabled:e.unref(g),value:e.unref(N),tabindex:e.unref(p),"aria-invalid":e.unref(C)},null,8,W),[[e.vModelCheckbox,e.unref(S)]]),e.renderSlot(b.$slots,"default",{value:e.unref(n)},()=>[e.createTextVNode(e.toDisplayString(b.label),1)]),e.createVNode(e.unref(ae),{class:"vv-checkbox__hint",params:{value:e.unref(n)}},null,8,["params"])],10,J))}}),X=q,Z=["update:modelValue","change"],L=["textContent"],ee={class:"vv-checkbox-group__wrapper"},te={name:"VvCheckboxGroup"};return e.defineComponent({...te,props:X,emits:Z,setup(t,{emit:f}){const o=t,v=useSlots(),u=useVModel(o,"modelValue",f),{disabled:d,readonly:a,vertical:k,valid:c,invalid:i,modifiers:n}=toRefs(o);useProvideGroupState({key:j,modelValue:u,disabled:d,readonly:a,valid:c,invalid:i});const{getOptionLabel:r,getOptionValue:y}=useOptions(o),s=useBemModifiers("vv-checkbox-group",n,computed(()=>({disabled:d.value,readonly:a.value,horizontal:!k.value,valid:c.value,invalid:i.value}))),p=(l,g)=>({id:`${o.name}_opt${g}`,name:o.name,label:r(l),value:y(l)}),{HintSlot:m}=I(o,v);return(l,g)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(s))},[l.label?(e.openBlock(),e.createElementBlock("legend",{key:0,textContent:e.toDisplayString(l.label)},null,8,L)):e.createCommentVNode("",!0),e.createElementVNode("div",ee,[l.options.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.options,(C,B)=>(e.openBlock(),e.createBlock(Q,e.mergeProps({key:B},p(C,B)),null,16))),128)):e.renderSlot(l.$slots,"default",{key:1})]),e.createVNode(e.unref(m),{class:"vv-checkbox-group__hint"})],2))}})});
1
+ (function(t,O){typeof exports=="object"&&typeof module<"u"?module.exports=O(require("vue"),require("@vueuse/core"),require("nanoid")):typeof define=="function"&&define.amd?define(["vue","@vueuse/core","nanoid"],O):(t=typeof globalThis<"u"?globalThis:t||self,t.VvCheckboxGroup=O(t.vue,t.core,t.nanoid))})(this,function(t,O,J){"use strict";var A=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(A||{}),$=(e=>(e.topStart="top-start",e.topEnd="top-end",e.bottomStart="bottom-start",e.bottomEnd="bottom-end",e.leftStart="left-start",e.leftEnd="left-end",e.rightStart="right-start",e.rightEnd="right-end",e))($||{}),x=(e=>(e.before="before",e.after="after",e))(x||{}),E=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(E||{}),w=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(w||{});const D=Symbol.for("checkGroup");function q(e,n,r){return r?B(e,r)===B(n,r):P(e,n)}function P(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){const r=Array.isArray(e),i=Array.isArray(n);let o,s,l;if(r&&i){if(s=e.length,s!=n.length)return!1;for(o=s;o--!==0;)if(!P(e[o],n[o]))return!1;return!0}if(r!=i)return!1;const y=e instanceof Date,a=n instanceof Date;if(y!=a)return!1;if(y&&a)return e.getTime()==n.getTime();const d=e instanceof RegExp,u=n instanceof RegExp;if(d!=u)return!1;if(d&&u)return e.toString()==n.toString();const c=Object.keys(e);if(s=c.length,s!==Object.keys(n).length)return!1;for(o=s;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,c[o]))return!1;for(o=s;o--!==0;)if(l=c[o],!P(e[l],n[l]))return!1;return!0}return e!==e&&n!==n}function B(e,n){if(e&&Object.keys(e).length&&n){if(n.indexOf(".")===-1)return e[n];{const r=n.split(".");let i=e;for(let o=0,s=r.length;o<s;++o){if(e==null)return null;i=i[r[o]]}return i}}else return null}function W(e,n){if(e!=null&&n&&n.length){for(const r of n)if(q(e,r))return!0}return!1}function H(e){return(n=>n==null||n===""||Array.isArray(n)&&n.length===0||!(n instanceof Date)&&typeof n=="object"&&Object.keys(n).length===0)(t.unref(e))}function Y(e){return typeof e=="string"||e instanceof String}function j(e){return Array.isArray(e)?e.filter(n=>Y(n)).join(" "):e}function K(e,n){const{invalid:r,valid:i,hint:o,loading:s}=n,{hintLabel:l,modelValue:y,valid:a,validLabel:d,invalid:u,invalidLabel:c,...h}=t.toRefs(e),p=B(h,"loading"),m=B(h,"loadingLabel"),v=t.computed(()=>u.value?!!(u.value&&r||c!=null&&c.value&&Array.isArray(c.value)&&c.value.length>0||c!=null&&c.value&&!H(c)):!1),f=t.computed(()=>!!(l&&l.value||o)),g=t.computed(()=>!!(d&&d.value||i)),_=t.computed(()=>!!(p!=null&&p.value&&s||p!=null&&p.value&&(m!=null&&m.value))),S=t.computed(()=>f.value||g.value||v.value||_.value);return{hasInvalid:v,hasHint:f,hasValid:g,hasLoading:_,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(C){const G=t.computed(()=>{const k=O.toReactive({hintLabel:l,modelValue:y,valid:a,validLabel:d,invalid:u,invalidLabel:c,loading:p,loadingLabel:m,...C.params});return u!=null&&u.value?(r==null?void 0:r(k))||j(c==null?void 0:c.value)||(l==null?void 0:l.value):a!=null&&a.value?(i==null?void 0:i(k))||j(d==null?void 0:d.value)||(l==null?void 0:l.value):p!=null&&p.value?(s==null?void 0:s(k))||j(m==null?void 0:m.value)||(l==null?void 0:l.value):(o==null?void 0:o(k))||j(l==null?void 0:l.value)||(l==null?void 0:l.value)});return{isVisible:S,hasInvalid:v,hasValid:g,hintContent:G}},render(){if(this.isVisible)return t.h("small",{role:this.hasInvalid?"alert":this.hasValid?"status":void 0},this.hintContent)}}}}const Q={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(w).includes(e)},rel:{type:String,default:"noopener noreferrer"}},F={valid:Boolean,validLabel:[String,Array]},M={invalid:Boolean,invalidLabel:[String,Array]},R={disabled:Boolean},X={active:Boolean},Z={pressed:Boolean},I={label:[String,Number]},z={readonly:Boolean},N={modifiers:[String,Array]},T={hintLabel:{type:String,default:""}},L={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}};x.before;const ee={tabindex:{type:[String,Number],default:0}},te={id:[String,Number]};A.bottom;const ne={...{...te,name:{type:String,required:!0}},...ee,...F,...M,...T,...R,...z,...N,...I,value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String]},re={...F,...M,...L,...T,...R,...z,...N,...I,modelValue:[String,Array],name:{type:String,required:!0},vertical:Boolean};({...R,...I,...Z,...X,...Q,type:E.button});function oe(e){const n=t.inject(e,void 0),r=t.computed(()=>!H(n));function i(o,s,l){if(n!=null&&n.value){const a=t.unref(n.value)[o];return t.computed({get(){return a==null?void 0:a.value},set(d){a.value=d}})}const y=t.toRef(s,o);return t.computed({get(){return y.value},set(a){l&&l(`update:${o}`,a)}})}return{group:n,isInGroup:r,getGroupOrLocalRef:i}}const ae={...ne,...N,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean},le=["click","update:modelValue","change","blur"];function se(e,n){const{group:r,isInGroup:i,getGroupOrLocalRef:o}=oe(D),{id:s,switch:l,indeterminate:y}=t.toRefs(e),a=o("modelValue",e,n),d=o("readonly",e),u=o("disabled",e),c=o("valid",e),h=o("invalid",e);return{id:s,propsSwitch:l,indeterminate:y,group:r,isInGroup:i,modelValue:a,readonly:d,disabled:u,valid:c,invalid:h}}const ue=e=>t.computed(()=>String((e==null?void 0:e.value)||J.nanoid()));function U(e,n,r){return t.computed(()=>{const i={[e]:!0},o=typeof(n==null?void 0:n.value)=="string"?n.value.split(" "):n==null?void 0:n.value;return o&&Array.isArray(o)&&o.forEach(s=>{i[`${e}--${s}`]=!0}),r&&Object.keys(r.value).forEach(s=>{i[`${e}--${s}`]=t.unref(r.value[s])}),i})}const ie=["for"],ce=["id","name","disabled","value","tabindex","aria-invalid"],de={name:"VvCheckbox"},fe=t.defineComponent({...de,props:ae,emits:le,setup(e,{emit:n}){const r=e,i=t.useSlots(),{id:o,disabled:s,readonly:l,valid:y,invalid:a,propsSwitch:d,modelValue:u,indeterminate:c,isInGroup:h}=se(r,n),p=ue(o),m=t.computed(()=>g.value?-1:r.tabindex),v=t.ref(),f=t.computed(()=>r.uncheckedValue!==void 0&&!h.value),g=t.computed(()=>s.value||l.value),_=t.computed(()=>{if(a.value===!0)return!0;if(y.value===!0)return!1}),S=t.computed(()=>f.value?u.value===r.value:Array.isArray(u.value)?W(r.value,u.value):q(r.value,u.value)),C=t.computed(()=>!!(c.value||!S.value&&f.value&&r.uncheckedValue!==u.value)),G=t.computed(()=>{if(!f.value)return["string","number","boolean"].includes(typeof r.value)?r.value:!0}),k=t.computed({get(){return S.value},set(b){if(f.value)u.value=b?r.value:r.uncheckedValue;else if(Array.isArray(u.value)||h.value){const V=new Set(Array.isArray(u.value)?u.value:u.value!==void 0?[u.value]:[]);b?V.add(r.value):V.delete(r.value),u.value=[...V]}else u.value=b?r.value:void 0;n("change",b)}}),{modifiers:ke}=t.toRefs(r),Se=U("vv-checkbox",ke,t.computed(()=>({switch:d.value,valid:y.value,invalid:a.value,disabled:s.value,readonly:l.value,indeterminate:c.value})));t.watchEffect(()=>{f.value&&Array.isArray(u.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")}),t.watch(()=>C.value,b=>{b?v.value.indeterminate=!0:v.value.indeterminate=!1}),t.onMounted(()=>{C.value&&(v.value.indeterminate=!0)});const{HintSlot:Oe}=K(r,i);return(b,V)=>(t.openBlock(),t.createElementBlock("label",{class:t.normalizeClass(t.unref(Se)),for:t.unref(p)},[t.withDirectives(t.createElementVNode("input",{id:t.unref(p),ref_key:"input",ref:v,"onUpdate:modelValue":V[0]||(V[0]=_e=>t.isRef(k)?k.value=_e:null),type:"checkbox",class:"vv-checkbox__input",name:b.name,disabled:t.unref(g),value:t.unref(G),tabindex:t.unref(m),"aria-invalid":t.unref(_)},null,8,ce),[[t.vModelCheckbox,t.unref(k)]]),t.renderSlot(b.$slots,"default",{value:t.unref(u)},()=>[t.createTextVNode(t.toDisplayString(b.label),1)]),t.createVNode(t.unref(Oe),{class:"vv-checkbox__hint",params:{value:t.unref(u)}},null,8,["params"])],10,ie))}}),pe=re,ye=["update:modelValue","change"];function me(e){if(Object.keys(e).some(n=>n!=="key"&&!t.isRef(e[n])))throw Error("One or more groupState props aren't ref.");t.provide(e.key,t.computed(()=>e))}function ve(e){const{options:n,labelKey:r,valueKey:i,disabledKey:o}=t.toRefs(e);return{options:n,getOptionLabel:a=>typeof a!="object"&&a!==null?a:typeof r.value=="function"?r.value(a):a[r.value],getOptionValue:a=>typeof a!="object"&&a!==null?a:typeof i.value=="function"?i.value(a):a[i.value],getOptionDisabled:a=>typeof a!="object"&&a!==null?!1:typeof o.value=="function"?o.value(a):a[o.value]}}const be=["textContent"],he={class:"vv-checkbox-group__wrapper"},ge={name:"VvCheckboxGroup"};return t.defineComponent({...ge,props:pe,emits:ye,setup(e,{emit:n}){const r=e,i=t.useSlots(),o=O.useVModel(r,"modelValue",n),{disabled:s,readonly:l,vertical:y,valid:a,invalid:d,modifiers:u}=t.toRefs(r);me({key:D,modelValue:o,disabled:s,readonly:l,valid:a,invalid:d});const{getOptionLabel:c,getOptionValue:h}=ve(r),p=U("vv-checkbox-group",u,t.computed(()=>({disabled:s.value,readonly:l.value,horizontal:!y.value,valid:a.value,invalid:d.value}))),m=(f,g)=>({id:`${r.name}_opt${g}`,name:r.name,label:c(f),value:h(f)}),{HintSlot:v}=K(r,i);return(f,g)=>(t.openBlock(),t.createElementBlock("fieldset",{class:t.normalizeClass(t.unref(p))},[f.label?(t.openBlock(),t.createElementBlock("legend",{key:0,textContent:t.toDisplayString(f.label)},null,8,be)):t.createCommentVNode("",!0),t.createElementVNode("div",he,[f.options.length>0?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(f.options,(_,S)=>(t.openBlock(),t.createBlock(fe,t.mergeProps({key:S},m(_,S)),null,16))),128)):t.renderSlot(f.$slots,"default",{key:1})]),t.createVNode(t.unref(v),{class:"vv-checkbox-group__hint"})],2))}})});
@@ -1,12 +1,12 @@
1
1
  import type { Option } from '@/types/generic';
2
2
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
3
3
  modelValue: (StringConstructor | ArrayConstructor)[];
4
- label: StringConstructor;
5
4
  name: {
6
5
  type: StringConstructor;
7
6
  required: boolean;
8
7
  };
9
8
  vertical: BooleanConstructor;
9
+ label: (StringConstructor | NumberConstructor)[];
10
10
  modifiers: import("vue").PropType<string | string[]>;
11
11
  readonly: BooleanConstructor;
12
12
  disabled: BooleanConstructor;
@@ -36,12 +36,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
36
36
  validLabel: (StringConstructor | ArrayConstructor)[];
37
37
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
38
38
  modelValue: (StringConstructor | ArrayConstructor)[];
39
- label: StringConstructor;
40
39
  name: {
41
40
  type: StringConstructor;
42
41
  required: boolean;
43
42
  };
44
43
  vertical: BooleanConstructor;
44
+ label: (StringConstructor | NumberConstructor)[];
45
45
  modifiers: import("vue").PropType<string | string[]>;
46
46
  readonly: BooleanConstructor;
47
47
  disabled: BooleanConstructor;
@@ -1,11 +1,11 @@
1
1
  export declare const VvCheckboxGroupProps: {
2
2
  modelValue: (StringConstructor | ArrayConstructor)[];
3
- label: StringConstructor;
4
3
  name: {
5
4
  type: StringConstructor;
6
5
  required: boolean;
7
6
  };
8
7
  vertical: BooleanConstructor;
8
+ label: (StringConstructor | NumberConstructor)[];
9
9
  modifiers: import("vue").PropType<string | string[]>;
10
10
  readonly: BooleanConstructor;
11
11
  disabled: BooleanConstructor;