@volverjs/ui-vue 0.0.4 → 0.0.5-beta.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.
Files changed (215) hide show
  1. package/README.md +2 -2
  2. package/auto-imports.d.ts +12 -3
  3. package/bin/icons.cjs +1 -73
  4. package/dist/Volver.d.ts +19 -11
  5. package/dist/components/VvAccordion/VvAccordion.es.js +165 -106
  6. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  7. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +4 -1
  8. package/dist/components/VvAccordion/index.d.ts +8 -3
  9. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +264 -164
  10. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  11. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +15 -12
  12. package/dist/components/VvAccordionGroup/index.d.ts +8 -0
  13. package/dist/components/VvAction/VvAction.es.js +276 -98
  14. package/dist/components/VvAction/VvAction.umd.js +1 -1
  15. package/dist/components/VvAction/VvAction.vue.d.ts +12 -12
  16. package/dist/components/VvAction/index.d.ts +2 -2
  17. package/dist/components/VvBadge/VvBadge.es.js +213 -44
  18. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  19. package/dist/components/VvBadge/VvBadge.vue.d.ts +2 -2
  20. package/dist/components/VvBadge/index.d.ts +1 -1
  21. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +247 -75
  22. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  23. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +11 -11
  24. package/dist/components/VvBreadcrumb/index.d.ts +1 -1
  25. package/dist/components/VvButton/VvButton.es.js +646 -360
  26. package/dist/components/VvButton/VvButton.umd.js +1 -1
  27. package/dist/components/VvButton/VvButton.vue.d.ts +18 -18
  28. package/dist/components/VvButton/index.d.ts +13 -13
  29. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +261 -79
  30. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  31. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +2 -2
  32. package/dist/components/VvButtonGroup/index.d.ts +1 -1
  33. package/dist/components/VvCard/VvCard.es.js +57 -38
  34. package/dist/components/VvCard/VvCard.umd.js +1 -1
  35. package/dist/components/VvCheckbox/VvCheckbox.es.js +562 -274
  36. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  37. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +2 -2
  38. package/dist/components/VvCheckbox/index.d.ts +5 -5
  39. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +661 -340
  40. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  41. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +7 -7
  42. package/dist/components/VvCheckboxGroup/index.d.ts +3 -3
  43. package/dist/components/VvCombobox/VvCombobox.es.js +1546 -983
  44. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  45. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +138 -51
  46. package/dist/components/VvCombobox/index.d.ts +41 -10
  47. package/dist/components/VvDialog/VvDialog.es.js +387 -141
  48. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  49. package/dist/components/VvDialog/VvDialog.vue.d.ts +12 -3
  50. package/dist/components/VvDialog/index.d.ts +4 -1
  51. package/dist/components/VvDropdown/VvDropdown.es.js +452 -244
  52. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  53. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +130 -42
  54. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +13 -13
  55. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +2 -2
  56. package/dist/components/VvDropdown/index.d.ts +40 -11
  57. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +373 -160
  58. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  59. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +43 -28
  60. package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
  61. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +285 -90
  62. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
  63. package/dist/components/VvIcon/VvIcon.es.js +113 -65
  64. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  65. package/dist/components/VvIcon/VvIcon.vue.d.ts +7 -7
  66. package/dist/components/VvIcon/index.d.ts +2 -2
  67. package/dist/components/VvInputText/VvInputPasswordAction.d.ts +2 -2
  68. package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
  69. package/dist/components/VvInputText/VvInputText.es.js +986 -462
  70. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  71. package/dist/components/VvInputText/VvInputText.vue.d.ts +100 -20
  72. package/dist/components/VvInputText/VvInputTextActions.d.ts +1 -1
  73. package/dist/components/VvInputText/index.d.ts +66 -13
  74. package/dist/components/VvProgress/VvProgress.es.js +216 -45
  75. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  76. package/dist/components/VvProgress/VvProgress.vue.d.ts +2 -2
  77. package/dist/components/VvProgress/index.d.ts +1 -1
  78. package/dist/components/VvRadio/VvRadio.es.js +499 -238
  79. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  80. package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
  81. package/dist/components/VvRadio/index.d.ts +5 -5
  82. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +598 -304
  83. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  84. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +7 -7
  85. package/dist/components/VvRadioGroup/index.d.ts +3 -3
  86. package/dist/components/VvSelect/VvSelect.es.js +631 -324
  87. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  88. package/dist/components/VvSelect/VvSelect.vue.d.ts +13 -13
  89. package/dist/components/VvSelect/index.d.ts +3 -3
  90. package/dist/components/VvTextarea/VvTextarea.es.js +676 -355
  91. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  92. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +20 -20
  93. package/dist/components/VvTextarea/index.d.ts +4 -4
  94. package/dist/components/VvTooltip/VvTooltip.es.js +215 -47
  95. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  96. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +7 -7
  97. package/dist/components/VvTooltip/index.d.ts +2 -2
  98. package/dist/components/index.es.js +3522 -2231
  99. package/dist/components/index.umd.js +1 -1
  100. package/dist/composables/dropdown/useInjectDropdown.d.ts +1 -1
  101. package/dist/composables/dropdown/useProvideDropdown.d.ts +3 -3
  102. package/dist/composables/group/useInjectedGroupState.d.ts +2 -2
  103. package/dist/composables/group/useProvideGroupState.d.ts +1 -1
  104. package/dist/composables/useComponentFocus.d.ts +1 -1
  105. package/dist/composables/useComponentIcon.d.ts +7 -7
  106. package/dist/composables/useDebouncedInput.d.ts +4 -1
  107. package/dist/composables/useDefaults.d.ts +2 -0
  108. package/dist/composables/useModifiers.d.ts +1 -1
  109. package/dist/composables/useOptions.d.ts +2 -2
  110. package/dist/composables/useTextCount.d.ts +3 -3
  111. package/dist/composables/useUniqueId.d.ts +1 -1
  112. package/dist/composables/useVolver.d.ts +1 -1
  113. package/dist/directives/index.d.ts +1 -0
  114. package/dist/directives/index.es.js +264 -55
  115. package/dist/directives/index.umd.js +1 -1
  116. package/dist/directives/v-contextmenu.d.ts +3 -0
  117. package/dist/directives/v-contextmenu.es.js +42 -0
  118. package/dist/directives/v-contextmenu.umd.js +1 -0
  119. package/dist/directives/v-tooltip.es.js +222 -53
  120. package/dist/directives/v-tooltip.umd.js +1 -1
  121. package/dist/icons.d.ts +3 -1
  122. package/dist/icons.es.js +40 -23
  123. package/dist/icons.umd.js +1 -1
  124. package/dist/index.d.ts +0 -1
  125. package/dist/index.es.js +112 -3607
  126. package/dist/index.umd.js +1 -1
  127. package/dist/props/index.d.ts +50 -18
  128. package/dist/resolvers/unplugin.d.ts +7 -1
  129. package/dist/resolvers/unplugin.es.js +77 -37
  130. package/dist/resolvers/unplugin.umd.js +1 -1
  131. package/dist/stories/Combobox/Combobox.settings.d.ts +12 -0
  132. package/dist/stories/Dropdown/Dropdown.settings.d.ts +12 -0
  133. package/dist/stories/InputText/InputText.settings.d.ts +53 -0
  134. package/dist/stories/argTypes.d.ts +13 -1
  135. package/package.json +126 -40
  136. package/src/Volver.ts +49 -22
  137. package/src/assets/icons/detailed.json +1 -1
  138. package/src/assets/icons/normal.json +1 -1
  139. package/src/assets/icons/simple.json +1 -1
  140. package/src/components/VvAccordion/VvAccordion.vue +19 -22
  141. package/src/components/VvAccordion/index.ts +12 -4
  142. package/src/components/VvAccordionGroup/VvAccordionGroup.vue +19 -10
  143. package/src/components/VvAccordionGroup/index.ts +8 -0
  144. package/src/components/VvAction/VvAction.vue +7 -7
  145. package/src/components/VvAction/index.ts +1 -1
  146. package/src/components/VvBadge/VvBadge.vue +2 -2
  147. package/src/components/VvBadge/index.ts +1 -1
  148. package/src/components/VvBreadcrumb/VvBreadcrumb.vue +3 -3
  149. package/src/components/VvButton/VvButton.vue +11 -11
  150. package/src/components/VvButton/index.ts +10 -9
  151. package/src/components/VvButtonGroup/VvButtonGroup.vue +4 -7
  152. package/src/components/VvButtonGroup/index.ts +1 -1
  153. package/src/components/VvCard/VvCard.vue +2 -2
  154. package/src/components/VvCheckbox/VvCheckbox.vue +3 -7
  155. package/src/components/VvCheckbox/index.ts +11 -7
  156. package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +7 -10
  157. package/src/components/VvCheckboxGroup/index.ts +1 -1
  158. package/src/components/VvCombobox/VvCombobox.vue +44 -26
  159. package/src/components/VvCombobox/index.ts +1 -1
  160. package/src/components/VvDialog/VvDialog.vue +28 -11
  161. package/src/components/VvDialog/index.ts +5 -2
  162. package/src/components/VvDropdown/VvDropdown.vue +7 -5
  163. package/src/components/VvDropdown/VvDropdownAction.vue +7 -5
  164. package/src/components/VvDropdown/VvDropdownOption.vue +17 -10
  165. package/src/components/VvDropdown/index.ts +3 -3
  166. package/src/components/VvIcon/VvIcon.vue +3 -3
  167. package/src/components/VvIcon/index.ts +3 -3
  168. package/src/components/VvInputText/VvInputClearAction.ts +2 -2
  169. package/src/components/VvInputText/VvInputPasswordAction.ts +3 -4
  170. package/src/components/VvInputText/VvInputStepAction.ts +3 -2
  171. package/src/components/VvInputText/VvInputText.vue +130 -37
  172. package/src/components/VvInputText/VvInputTextActions.ts +5 -8
  173. package/src/components/VvInputText/index.ts +62 -1
  174. package/src/components/VvProgress/VvProgress.vue +2 -2
  175. package/src/components/VvProgress/index.ts +1 -1
  176. package/src/components/VvRadio/VvRadio.vue +3 -7
  177. package/src/components/VvRadio/index.ts +11 -7
  178. package/src/components/VvRadioGroup/VvRadioGroup.vue +7 -10
  179. package/src/components/VvRadioGroup/index.ts +1 -1
  180. package/src/components/VvSelect/VvSelect.vue +4 -4
  181. package/src/components/VvSelect/index.ts +1 -1
  182. package/src/components/VvTextarea/VvTextarea.vue +6 -6
  183. package/src/components/VvTextarea/index.ts +1 -1
  184. package/src/components/VvTooltip/VvTooltip.vue +2 -2
  185. package/src/components/VvTooltip/index.ts +3 -3
  186. package/src/composables/dropdown/useInjectDropdown.ts +2 -2
  187. package/src/composables/dropdown/useProvideDropdown.ts +2 -2
  188. package/src/composables/group/useInjectedGroupState.ts +1 -1
  189. package/src/composables/group/useProvideGroupState.ts +1 -1
  190. package/src/composables/useComponentIcon.ts +1 -1
  191. package/src/composables/useDebouncedInput.ts +10 -3
  192. package/src/composables/useDefaults.ts +89 -0
  193. package/src/composables/useModifiers.ts +4 -2
  194. package/src/composables/useOptions.ts +1 -1
  195. package/src/composables/useVolver.ts +2 -2
  196. package/src/directives/index.ts +3 -1
  197. package/src/directives/v-contextmenu.ts +40 -0
  198. package/src/directives/v-tooltip.ts +2 -2
  199. package/src/icons.ts +1 -1
  200. package/src/index.ts +0 -2
  201. package/src/props/index.ts +20 -10
  202. package/src/resolvers/unplugin.ts +15 -1
  203. package/src/stories/Accordion/Accordion.stories.mdx +8 -2
  204. package/src/stories/Accordion/Accordion.test.ts +21 -15
  205. package/src/stories/Accordion/AccordionSlots.stories.mdx +8 -8
  206. package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +17 -1
  207. package/src/stories/AccordionGroup/AccordionGroup.test.ts +18 -12
  208. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +1 -1
  209. package/src/stories/Dropdown/DropdownContextmenuDirective.stories.mdx +41 -0
  210. package/src/stories/InputText/InputText.settings.ts +53 -0
  211. package/src/stories/InputText/InputText.stories.mdx +40 -0
  212. package/src/stories/InputText/InputText.test.ts +5 -2
  213. package/src/stories/Tooltip/TooltipDirective.stories.mdx +1 -1
  214. package/src/stories/argTypes.ts +12 -2
  215. package/src/types/group.d.ts +5 -0
@@ -1 +1 @@
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
+ !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,13 +1,13 @@
1
- import type { Option } from '@/types/generic';
1
+ import type { Option } from '../../types/generic';
2
2
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
3
- modelValue: (StringConstructor | ArrayConstructor)[];
3
+ modelValue: (SymbolConstructor | StringConstructor | BooleanConstructor | ArrayConstructor | NumberConstructor)[];
4
4
  name: {
5
5
  type: StringConstructor;
6
6
  required: boolean;
7
7
  };
8
8
  vertical: BooleanConstructor;
9
9
  label: (StringConstructor | NumberConstructor)[];
10
- modifiers: import("vue").PropType<string | string[]>;
10
+ modifiers: globalThis.PropType<string | string[]>;
11
11
  readonly: BooleanConstructor;
12
12
  disabled: BooleanConstructor;
13
13
  hintLabel: {
@@ -15,7 +15,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
15
15
  default: string;
16
16
  };
17
17
  options: {
18
- type: import("vue").PropType<(string | Option)[]>;
18
+ type: globalThis.PropType<(string | Option)[]>;
19
19
  default: () => never[];
20
20
  };
21
21
  labelKey: {
@@ -35,14 +35,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
35
35
  valid: BooleanConstructor;
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
- modelValue: (StringConstructor | ArrayConstructor)[];
38
+ modelValue: (SymbolConstructor | StringConstructor | BooleanConstructor | ArrayConstructor | NumberConstructor)[];
39
39
  name: {
40
40
  type: StringConstructor;
41
41
  required: boolean;
42
42
  };
43
43
  vertical: BooleanConstructor;
44
44
  label: (StringConstructor | NumberConstructor)[];
45
- modifiers: import("vue").PropType<string | string[]>;
45
+ modifiers: globalThis.PropType<string | string[]>;
46
46
  readonly: BooleanConstructor;
47
47
  disabled: BooleanConstructor;
48
48
  hintLabel: {
@@ -50,7 +50,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
50
50
  default: string;
51
51
  };
52
52
  options: {
53
- type: import("vue").PropType<(string | Option)[]>;
53
+ type: globalThis.PropType<(string | Option)[]>;
54
54
  default: () => never[];
55
55
  };
56
56
  labelKey: {
@@ -1,12 +1,12 @@
1
1
  export declare const VvCheckboxGroupProps: {
2
- modelValue: (StringConstructor | ArrayConstructor)[];
2
+ modelValue: (SymbolConstructor | StringConstructor | BooleanConstructor | ArrayConstructor | NumberConstructor)[];
3
3
  name: {
4
4
  type: StringConstructor;
5
5
  required: boolean;
6
6
  };
7
7
  vertical: BooleanConstructor;
8
8
  label: (StringConstructor | NumberConstructor)[];
9
- modifiers: import("vue").PropType<string | string[]>;
9
+ modifiers: globalThis.PropType<string | string[]>;
10
10
  readonly: BooleanConstructor;
11
11
  disabled: BooleanConstructor;
12
12
  hintLabel: {
@@ -14,7 +14,7 @@ export declare const VvCheckboxGroupProps: {
14
14
  default: string;
15
15
  };
16
16
  options: {
17
- type: import("vue").PropType<(string | import("../../types/generic").Option)[]>;
17
+ type: globalThis.PropType<(string | import("../../types/generic").Option)[]>;
18
18
  default: () => never[];
19
19
  };
20
20
  labelKey: {