@volverjs/ui-vue 0.0.10-beta.15 → 0.0.10-beta.16

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 (153) hide show
  1. package/README.md +96 -2
  2. package/auto-imports.d.ts +2 -0
  3. package/dist/components/VvAccordion/VvAccordion.es.js +33 -9
  4. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  5. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +9 -2
  6. package/dist/components/VvAccordion/index.d.ts +4 -1
  7. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +33 -9
  8. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  9. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +9 -2
  10. package/dist/components/VvAccordionGroup/index.d.ts +4 -1
  11. package/dist/components/VvAction/VvAction.es.js +29 -8
  12. package/dist/components/VvAction/VvAction.umd.js +1 -1
  13. package/dist/components/VvAction/VvAction.vue.d.ts +44 -10
  14. package/dist/components/VvAction/index.d.ts +21 -5
  15. package/dist/components/VvAlert/VvAlert.es.js +91 -107
  16. package/dist/components/VvAlert/VvAlert.umd.js +1 -1
  17. package/dist/components/VvAlert/VvAlert.vue.d.ts +14 -4
  18. package/dist/components/VvAlert/index.d.ts +7 -3
  19. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +91 -107
  20. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
  21. package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +9 -2
  22. package/dist/components/VvAlertGroup/index.d.ts +6 -2
  23. package/dist/components/VvAvatar/VvAvatar.es.js +33 -9
  24. package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
  25. package/dist/components/VvAvatar/VvAvatar.vue.d.ts +11 -3
  26. package/dist/components/VvAvatar/index.d.ts +4 -1
  27. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +33 -9
  28. package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
  29. package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +9 -2
  30. package/dist/components/VvAvatarGroup/index.d.ts +4 -1
  31. package/dist/components/VvBadge/VvBadge.es.js +33 -9
  32. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  33. package/dist/components/VvBadge/VvBadge.vue.d.ts +11 -3
  34. package/dist/components/VvBadge/index.d.ts +4 -1
  35. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +33 -9
  36. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  37. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +11 -3
  38. package/dist/components/VvBreadcrumb/index.d.ts +4 -1
  39. package/dist/components/VvButton/VvButton.es.js +100 -119
  40. package/dist/components/VvButton/VvButton.umd.js +1 -1
  41. package/dist/components/VvButton/VvButton.vue.d.ts +78 -20
  42. package/dist/components/VvButton/index.d.ts +34 -12
  43. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +33 -9
  44. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  45. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +17 -4
  46. package/dist/components/VvButtonGroup/index.d.ts +8 -2
  47. package/dist/components/VvCard/VvCard.es.js +33 -9
  48. package/dist/components/VvCard/VvCard.umd.js +1 -1
  49. package/dist/components/VvCard/VvCard.vue.d.ts +11 -3
  50. package/dist/components/VvCard/index.d.ts +4 -1
  51. package/dist/components/VvCheckbox/VvCheckbox.es.js +56 -17
  52. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  53. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +94 -22
  54. package/dist/components/VvCheckbox/index.d.ts +44 -11
  55. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +64 -19
  56. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  57. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +93 -22
  58. package/dist/components/VvCheckboxGroup/index.d.ts +44 -11
  59. package/dist/components/VvCombobox/VvCombobox.es.js +108 -165
  60. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  61. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +97 -24
  62. package/dist/components/VvCombobox/index.d.ts +42 -11
  63. package/dist/components/VvDialog/VvDialog.es.js +51 -103
  64. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  65. package/dist/components/VvDropdown/VvDropdown.es.js +33 -9
  66. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  67. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +14 -2
  68. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +61 -12
  69. package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +11 -3
  70. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +25 -6
  71. package/dist/components/VvDropdown/index.d.ts +6 -1
  72. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +33 -9
  73. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  74. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +29 -8
  75. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
  76. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +37 -10
  77. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
  78. package/dist/components/VvIcon/VvIcon.es.js +22 -95
  79. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  80. package/dist/components/VvIcon/VvIcon.vue.d.ts +81 -44
  81. package/dist/components/VvIcon/index.d.ts +21 -48
  82. package/dist/components/VvInputFile/VvInputFile.es.js +107 -123
  83. package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
  84. package/dist/components/VvInputFile/VvInputFile.vue.d.ts +52 -12
  85. package/dist/components/VvInputFile/index.d.ts +24 -6
  86. package/dist/components/VvInputText/VvInputText.es.js +115 -147
  87. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  88. package/dist/components/VvInputText/VvInputText.vue.d.ts +141 -34
  89. package/dist/components/VvInputText/index.d.ts +71 -26
  90. package/dist/components/VvNav/VvNav.es.js +33 -9
  91. package/dist/components/VvNav/VvNav.umd.js +1 -1
  92. package/dist/components/VvNav/VvNav.vue.d.ts +9 -2
  93. package/dist/components/VvNav/index.d.ts +4 -1
  94. package/dist/components/VvNavItem/VvNavItem.es.js +29 -8
  95. package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
  96. package/dist/components/VvProgress/VvProgress.es.js +33 -9
  97. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  98. package/dist/components/VvProgress/VvProgress.vue.d.ts +9 -2
  99. package/dist/components/VvProgress/index.d.ts +4 -1
  100. package/dist/components/VvRadio/VvRadio.es.js +56 -17
  101. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  102. package/dist/components/VvRadio/VvRadio.vue.d.ts +94 -22
  103. package/dist/components/VvRadio/index.d.ts +44 -11
  104. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +64 -19
  105. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  106. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +93 -22
  107. package/dist/components/VvRadioGroup/index.d.ts +44 -11
  108. package/dist/components/VvSelect/VvSelect.es.js +95 -138
  109. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  110. package/dist/components/VvSelect/VvSelect.vue.d.ts +97 -24
  111. package/dist/components/VvSelect/index.d.ts +46 -12
  112. package/dist/components/VvTab/VvTab.es.js +33 -9
  113. package/dist/components/VvTab/VvTab.umd.js +1 -1
  114. package/dist/components/VvTab/VvTab.vue.d.ts +9 -2
  115. package/dist/components/VvTab/index.d.ts +4 -1
  116. package/dist/components/VvTextarea/VvTextarea.es.js +109 -143
  117. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  118. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +141 -34
  119. package/dist/components/VvTextarea/index.d.ts +66 -17
  120. package/dist/components/VvTooltip/VvTooltip.es.js +33 -9
  121. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  122. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +9 -2
  123. package/dist/components/VvTooltip/index.d.ts +4 -1
  124. package/dist/components/index.es.js +178 -232
  125. package/dist/components/index.umd.js +1 -1
  126. package/dist/composables/useComponentIcon.d.ts +9 -8
  127. package/dist/directives/index.es.js +33 -9
  128. package/dist/directives/index.umd.js +1 -1
  129. package/dist/directives/v-tooltip.es.js +33 -9
  130. package/dist/directives/v-tooltip.umd.js +1 -1
  131. package/dist/icons.es.js +3 -3
  132. package/dist/icons.umd.js +1 -1
  133. package/dist/props/index.d.ts +251 -61
  134. package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +15 -4
  135. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +77 -22
  136. package/dist/stories/Icon/Icon.settings.d.ts +1 -0
  137. package/package.json +33 -33
  138. package/src/assets/icons/detailed.json +1 -1
  139. package/src/assets/icons/normal.json +1 -1
  140. package/src/assets/icons/simple.json +1 -1
  141. package/src/components/VvAlert/index.ts +1 -3
  142. package/src/components/VvAlertGroup/index.ts +2 -1
  143. package/src/components/VvButton/VvButton.vue +6 -6
  144. package/src/components/VvButton/index.ts +2 -4
  145. package/src/components/VvCombobox/VvCombobox.vue +5 -8
  146. package/src/components/VvIcon/VvIcon.vue +2 -2
  147. package/src/components/VvIcon/index.ts +22 -48
  148. package/src/components/VvInputText/VvInputText.vue +11 -12
  149. package/src/components/VvSelect/VvSelect.vue +5 -8
  150. package/src/components/VvTextarea/VvTextarea.vue +5 -8
  151. package/src/composables/useComponentIcon.ts +15 -14
  152. package/src/props/index.ts +89 -25
  153. package/src/stories/Icon/Icon.settings.ts +3 -3
@@ -67,6 +67,7 @@ const LinkProps = {
67
67
  */
68
68
  target: {
69
69
  type: String,
70
+ default: void 0,
70
71
  validator: (value) => Object.values(AnchorTarget).includes(value)
71
72
  },
72
73
  /**
@@ -81,27 +82,33 @@ const ValidProps = {
81
82
  /**
82
83
  * Valid status
83
84
  */
84
- valid: Boolean,
85
+ valid: { type: Boolean, default: false },
85
86
  /**
86
87
  * Valid label
87
88
  */
88
- validLabel: [String, Array]
89
+ validLabel: { type: [String, Array], default: void 0 }
89
90
  };
90
91
  const InvalidProps = {
91
92
  /**
92
93
  * Invalid status
93
94
  */
94
- invalid: Boolean,
95
+ invalid: {
96
+ type: Boolean,
97
+ default: false
98
+ },
95
99
  /**
96
100
  * Invalid label
97
101
  */
98
- invalidLabel: [String, Array]
102
+ invalidLabel: { type: [String, Array], default: void 0 }
99
103
  };
100
104
  const LoadingProps = {
101
105
  /**
102
106
  * Loading status
103
107
  */
104
- loading: Boolean,
108
+ loading: {
109
+ type: Boolean,
110
+ default: false
111
+ },
105
112
  /**
106
113
  * Loading label
107
114
  */
@@ -114,43 +121,64 @@ const DisabledProps = {
114
121
  /**
115
122
  * Whether the form control is disabled
116
123
  */
117
- disabled: Boolean
124
+ disabled: {
125
+ type: Boolean,
126
+ default: false
127
+ }
118
128
  };
119
129
  const ActiveProps = {
120
130
  /**
121
131
  * Whether the item is active
122
132
  */
123
- active: Boolean
133
+ active: {
134
+ type: Boolean,
135
+ default: false
136
+ }
124
137
  };
125
138
  const CurrentProps = {
126
139
  /**
127
140
  * Whether the item is current
128
141
  */
129
- current: Boolean
142
+ current: {
143
+ type: Boolean,
144
+ default: false
145
+ }
130
146
  };
131
147
  const PressedProps = {
132
148
  /**
133
149
  * Whether the item is pressed
134
150
  */
135
- pressed: Boolean
151
+ pressed: {
152
+ type: Boolean,
153
+ default: false
154
+ }
136
155
  };
137
156
  const LabelProps = {
138
157
  /**
139
158
  * The item label
140
159
  */
141
- label: [String, Number]
160
+ label: {
161
+ type: [String, Number],
162
+ default: void 0
163
+ }
142
164
  };
143
165
  const ReadonlyProps = {
144
166
  /**
145
167
  * The value is not editable
146
168
  */
147
- readonly: Boolean
169
+ readonly: {
170
+ type: Boolean,
171
+ default: false
172
+ }
148
173
  };
149
174
  const ModifiersProps = {
150
175
  /**
151
176
  * Component BEM modifiers
152
177
  */
153
- modifiers: [String, Array]
178
+ modifiers: {
179
+ type: [String, Array],
180
+ default: void 0
181
+ }
154
182
  };
155
183
  const HintProps = {
156
184
  hintLabel: { type: String, default: "" }
@@ -160,7 +188,10 @@ const HintProps = {
160
188
  * VvIcon name or props
161
189
  * @see VVIcon
162
190
  */
163
- icon: { type: [String, Object] },
191
+ icon: {
192
+ type: [String, Object],
193
+ default: void 0
194
+ },
164
195
  /**
165
196
  * VvIcon position
166
197
  */
@@ -205,7 +236,8 @@ const IdProps = {
205
236
  * Dropdown show / hide transition name
206
237
  */
207
238
  transitionName: {
208
- type: String
239
+ type: String,
240
+ default: void 0
209
241
  },
210
242
  /**
211
243
  * Offset of the dropdown from the trigger
@@ -273,7 +305,8 @@ const IdProps = {
273
305
  * Set dropdown width to the same as the trigger
274
306
  */
275
307
  triggerWidth: {
276
- type: Boolean
308
+ type: Boolean,
309
+ default: false
277
310
  }
278
311
  });
279
312
  const IdNameProps = {
@@ -300,11 +333,17 @@ const CheckboxRadioProps = {
300
333
  * Input value
301
334
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value
302
335
  */
303
- value: [String, Number, Boolean],
336
+ value: {
337
+ type: [String, Number, Boolean],
338
+ default: void 0
339
+ },
304
340
  /**
305
341
  * Input value
306
342
  */
307
- modelValue: [Object, Number, Boolean, String]
343
+ modelValue: {
344
+ type: [Object, Number, Boolean, String],
345
+ default: void 0
346
+ }
308
347
  };
309
348
  ({
310
349
  ...DisabledProps,
@@ -1 +1 @@
1
- !function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("uid")):"function"==typeof define&&define.amd?define(["vue","uid"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckbox=l(e.vue,e.uid)}(this,(function(e,l){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),a=(e=>(e.before="before",e.after="after",e))(a||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{}),o=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(o||{});const i=Symbol.for("volver"),r=Symbol.for("checkGroup"),u={valid:Boolean,validLabel:[String,Array]},d={invalid:Boolean,invalidLabel:[String,Array]},s={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},v={disabled:Boolean},c=(Boolean,Boolean,Boolean,{label:[String,Number]}),f={readonly:Boolean},b={modifiers:[String,Array]},p={hintLabel:{type:String,default:""}};a.before;const h={tabindex:{type:[String,Number],default:0}},m={id:[String,Number]};t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const g={...{...m,name:{type:String,required:!0}},...h,...u,...d,...p,...v,...f,...b,...c,...s,value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String]};function y(e,l,t){return t?L(e,t)===L(l,t):S(e,l)}function S(e,l){if(e===l)return!0;if(e&&l&&"object"==typeof e&&"object"==typeof l){const t=Array.isArray(e),a=Array.isArray(l);let n,o,i;if(t&&a){if(o=e.length,o!=l.length)return!1;for(n=o;0!=n--;)if(!S(e[n],l[n]))return!1;return!0}if(t!=a)return!1;const r=e instanceof Date,u=l instanceof Date;if(r!=u)return!1;if(r&&u)return e.getTime()==l.getTime();const d=e instanceof RegExp,s=l instanceof RegExp;if(d!=s)return!1;if(d&&s)return e.toString()==l.toString();const v=Object.keys(e);if(o=v.length,o!==Object.keys(l).length)return!1;for(n=o;0!=n--;)if(!Object.prototype.hasOwnProperty.call(l,v[n]))return!1;for(n=o;0!=n--;)if(i=v[n],!S(e[i],l[i]))return!1;return!0}return e!=e&&l!=l}function L(e,l){if(e&&Object.keys(e).length&&l){if(-1===l.indexOf("."))return e[l];{const t=l.split(".");let a=e;for(let l=0,n=t.length;l<n;++l){if(null==e)return null;a=a[t[l]]}return a}}return null}function k(l){const t=e.inject(l,void 0),a=e.computed((()=>{return l=t,!(null==(a=e.unref(l))||""===a||Array.isArray(a)&&0===a.length||!(a instanceof Date)&&"object"==typeof a&&0===Object.keys(a).length);var l,a}));return{group:t,isInGroup:a,getGroupOrLocalRef:function(l,a,n){if(null==t?void 0:t.value){const a=e.unref(t.value)[l];return e.computed({get:()=>null==a?void 0:a.value,set(e){a.value=e}})}const o=e.toRef(a,l);return e.computed({get:()=>o.value,set(e){n&&n(`update:${l}`,e)}})}}}n.button,o.button;const B={...g,...b,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function O(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}function x(l,t,a){const n=e.inject(i),o=e.computed((()=>{var e;if(n&&(null==(e=n.defaults.value)?void 0:e[l]))return n.defaults.value[l]}));return e.computed((()=>{if(void 0===o.value)return a;const e=o.value,l=t,n=a;return Object.keys(l).reduce(((t,a)=>{const o=n[a];if(t[a]=o,a in e){if(Array.isArray(l[a])){const n=l[a];if(n.length){n[0]===o&&(t[a]=e[a])}}if("function"==typeof l[a]){(0,l[a])()===o&&(t[a]=e[a])}if("object"==typeof l[a]){let n=l[a].default;"function"==typeof n&&(n=n()),"object"==typeof n?JSON.stringify(n)===JSON.stringify(o)&&(t[a]=e[a]):n===o&&(t[a]=e[a])}}return t}),{})}))}const V=["for"],A=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"];return e.defineComponent({name:"VvCheckbox",props:B,emits:["click","update:modelValue","change","blur"],setup(t,{emit:a}){const n=t,o=e.useSlots(),i=x("VvCheckbox",B,n),{id:u,disabled:d,readonly:s,valid:v,invalid:c,propsSwitch:f,modelValue:b,indeterminate:p,isInGroup:h}=function(l,t){const{group:a,isInGroup:n,getGroupOrLocalRef:o}=k(r),{id:i,switch:u,indeterminate:d}=e.toRefs(l),s=o("modelValue",l,t),v=o("valid",l),c=o("invalid",l),f=e.computed((()=>{var e;return Boolean(l.readonly||(null==(e=null==a?void 0:a.value)?void 0:e.readonly.value))})),b=e.computed((()=>{var e;return Boolean(l.disabled||(null==(e=null==a?void 0:a.value)?void 0:e.disabled.value))}));return{id:i,propsSwitch:u,indeterminate:d,group:a,isInGroup:n,modelValue:s,valid:v,invalid:c,readonly:f,disabled:b}}(n,a),m=(t=>e.computed((()=>String((null==t?void 0:t.value)||l.uid()))))(u),g=e.computed((()=>`${m.value}-hint`)),S=e.computed((()=>j.value?-1:n.tabindex)),L=e.ref(),$=e.computed((()=>void 0!==n.uncheckedValue&&!h.value)),j=e.computed((()=>d.value||s.value)),w=e.computed((()=>!0===c.value||!0!==v.value&&void 0)),R=e.computed((()=>$.value?b.value===n.value:Array.isArray(b.value)?function(e,l){if(null!=e&&l&&l.length)for(const t of l)if(y(e,t))return!0;return!1}(n.value,b.value):y(n.value,b.value))),C=e.computed((()=>!!p.value||!(R.value||!$.value||n.uncheckedValue===b.value))),N=e.computed((()=>{if(!$.value)return!["string","number","boolean"].includes(typeof n.value)||n.value})),I=e.computed({get:()=>R.value,set(e){if($.value)b.value=e?n.value:n.uncheckedValue;else if(Array.isArray(b.value)||h.value){const l=new Set(Array.isArray(b.value)?b.value:void 0!==b.value?[b.value]:[]);e?l.add(n.value):l.delete(n.value),b.value=[...l]}else b.value=e?n.value:void 0;a("change",e)}}),{modifiers:P}=e.toRefs(n),E=function(l,t,a){return e.computed((()=>{const n={[l]:!0},o="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return o&&Array.isArray(o)&&o.forEach((e=>{e&&(n[`${l}--${e}`]=!0)})),a&&Object.keys(a.value).forEach((t=>{n[`${l}--${t}`]=e.unref(a.value[t])})),n}))}("vv-checkbox",P,e.computed((()=>({switch:f.value,valid:v.value,invalid:c.value,disabled:d.value,readonly:s.value,indeterminate:p.value}))));e.watchEffect((()=>{$.value&&Array.isArray(b.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")})),e.watch((()=>C.value),(e=>{L.value.indeterminate=!!e})),e.onMounted((()=>{C.value&&(L.value.indeterminate=!0)}));const{HintSlot:G,hasHintLabelOrSlot:H,hasInvalidLabelOrSlot:T,hintSlotScope:_}=function(l,t){const a=e.computed((()=>e.isRef(l)?l.value:l)),n=e.computed((()=>O(a.value.invalidLabel))),o=e.computed((()=>O(a.value.validLabel))),i=e.computed((()=>a.value.loadingLabel)),r=e.computed((()=>a.value.hintLabel)),u=e.computed((()=>Boolean(a.value.loading&&(t.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(a.value.invalid&&(t.invalid||n.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(a.value.valid&&(t.valid||o.value)))),v=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(t.hint||r.value))),c=e.computed((()=>d.value||s.value||u.value||v.value)),f=e.computed((()=>({modelValue:a.value.modelValue,valid:a.value.valid,invalid:a.value.invalid,loading:a.value.loading}))),b=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:c,invalidLabel:n,validLabel:o,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:v}),render(){var l,t,a,n,o,i,r,u;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(t=(l=this.$slots).loading)?void 0:t.call(l))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(n=(a=this.$slots).invalid)?void 0:n.call(a))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(o=this.$slots).valid)?void 0:i.call(o))??this.validLabel):e.h(this.tag,{role:d},(null==(u=(r=this.$slots).hint)?void 0:u.call(r))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:d,hasHintLabelOrSlot:v,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:f,HintSlot:b}}(i,o);return(l,t)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(E)),for:e.unref(m)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(m),ref_key:"input",ref:L,"onUpdate:modelValue":t[0]||(t[0]=l=>e.isRef(I)?I.value=l:null),type:"checkbox",class:"vv-checkbox__input",name:l.name,disabled:e.unref(j),value:e.unref(N),tabindex:e.unref(S),"aria-invalid":e.unref(w),"aria-describedby":e.unref(H)?e.unref(g):void 0,"aria-errormessage":e.unref(T)?e.unref(g):void 0},null,8,A),[[e.vModelCheckbox,e.unref(I)]]),e.renderSlot(l.$slots,"default",{value:e.unref(b)},(()=>[e.createTextVNode(e.toDisplayString(l.label),1)])),e.createVNode(e.unref(G),{id:e.unref(g),class:"vv-checkbox__hint"},e.createSlots({_:2},[l.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"0"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"1"}:void 0,l.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"2"}:void 0,l.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"3"}:void 0]),1032,["id"])],10,V))}})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("uid")):"function"==typeof define&&define.amd?define(["vue","uid"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckbox=t(e.vue,e.uid)}(this,(function(e,t){"use strict";var l=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(l||{}),a=(e=>(e.before="before",e.after="after",e))(a||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{}),o=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(o||{});const i=Symbol.for("volver"),r=Symbol.for("checkGroup"),u={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},d={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},s={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},v={disabled:{type:Boolean,default:!1}},c=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),f={readonly:{type:Boolean,default:!1}},p={modifiers:{type:[String,Array],default:void 0}},b={hintLabel:{type:String,default:""}};a.before;const h={tabindex:{type:[String,Number],default:0}},m={id:[String,Number]};l.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const y={...{...m,name:{type:String,required:!0}},...h,...u,...d,...b,...v,...f,...p,...c,...s,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}};function g(e,t,l){return l?L(e,l)===L(t,l):S(e,t)}function S(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const l=Array.isArray(e),a=Array.isArray(t);let n,o,i;if(l&&a){if(o=e.length,o!=t.length)return!1;for(n=o;0!=n--;)if(!S(e[n],t[n]))return!1;return!0}if(l!=a)return!1;const r=e instanceof Date,u=t instanceof Date;if(r!=u)return!1;if(r&&u)return e.getTime()==t.getTime();const d=e instanceof RegExp,s=t instanceof RegExp;if(d!=s)return!1;if(d&&s)return e.toString()==t.toString();const v=Object.keys(e);if(o=v.length,o!==Object.keys(t).length)return!1;for(n=o;0!=n--;)if(!Object.prototype.hasOwnProperty.call(t,v[n]))return!1;for(n=o;0!=n--;)if(i=v[n],!S(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function L(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const l=t.split(".");let a=e;for(let t=0,n=l.length;t<n;++t){if(null==e)return null;a=a[l[t]]}return a}}return null}function k(t){const l=e.inject(t,void 0),a=e.computed((()=>{return t=l,!(null==(a=e.unref(t))||""===a||Array.isArray(a)&&0===a.length||!(a instanceof Date)&&"object"==typeof a&&0===Object.keys(a).length);var t,a}));return{group:l,isInGroup:a,getGroupOrLocalRef:function(t,a,n){if(null==l?void 0:l.value){const a=e.unref(l.value)[t];return e.computed({get:()=>null==a?void 0:a.value,set(e){a.value=e}})}const o=e.toRef(a,t);return e.computed({get:()=>o.value,set(e){n&&n(`update:${t}`,e)}})}}}n.button,o.button;const B={...y,...p,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function O(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}function x(t,l,a){const n=e.inject(i),o=e.computed((()=>{var e;if(n&&(null==(e=n.defaults.value)?void 0:e[t]))return n.defaults.value[t]}));return e.computed((()=>{if(void 0===o.value)return a;const e=o.value,t=l,n=a;return Object.keys(t).reduce(((l,a)=>{const o=n[a];if(l[a]=o,a in e){if(Array.isArray(t[a])){const n=t[a];if(n.length){n[0]===o&&(l[a]=e[a])}}if("function"==typeof t[a]){(0,t[a])()===o&&(l[a]=e[a])}if("object"==typeof t[a]){let n=t[a].default;"function"==typeof n&&(n=n()),"object"==typeof n?JSON.stringify(n)===JSON.stringify(o)&&(l[a]=e[a]):n===o&&(l[a]=e[a])}}return l}),{})}))}const V=["for"],A=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"];return e.defineComponent({name:"VvCheckbox",props:B,emits:["click","update:modelValue","change","blur"],setup(l,{emit:a}){const n=l,o=e.useSlots(),i=x("VvCheckbox",B,n),{id:u,disabled:d,readonly:s,valid:v,invalid:c,propsSwitch:f,modelValue:p,indeterminate:b,isInGroup:h}=function(t,l){const{group:a,isInGroup:n,getGroupOrLocalRef:o}=k(r),{id:i,switch:u,indeterminate:d}=e.toRefs(t),s=o("modelValue",t,l),v=o("valid",t),c=o("invalid",t),f=e.computed((()=>{var e;return Boolean(t.readonly||(null==(e=null==a?void 0:a.value)?void 0:e.readonly.value))})),p=e.computed((()=>{var e;return Boolean(t.disabled||(null==(e=null==a?void 0:a.value)?void 0:e.disabled.value))}));return{id:i,propsSwitch:u,indeterminate:d,group:a,isInGroup:n,modelValue:s,valid:v,invalid:c,readonly:f,disabled:p}}(n,a),m=(l=>e.computed((()=>String((null==l?void 0:l.value)||t.uid()))))(u),y=e.computed((()=>`${m.value}-hint`)),S=e.computed((()=>j.value?-1:n.tabindex)),L=e.ref(),$=e.computed((()=>void 0!==n.uncheckedValue&&!h.value)),j=e.computed((()=>d.value||s.value)),w=e.computed((()=>!0===c.value||!0!==v.value&&void 0)),R=e.computed((()=>$.value?p.value===n.value:Array.isArray(p.value)?function(e,t){if(null!=e&&t&&t.length)for(const l of t)if(g(e,l))return!0;return!1}(n.value,p.value):g(n.value,p.value))),C=e.computed((()=>!!b.value||!(R.value||!$.value||n.uncheckedValue===p.value))),N=e.computed((()=>{if(!$.value)return!["string","number","boolean"].includes(typeof n.value)||n.value})),I=e.computed({get:()=>R.value,set(e){if($.value)p.value=e?n.value:n.uncheckedValue;else if(Array.isArray(p.value)||h.value){const t=new Set(Array.isArray(p.value)?p.value:void 0!==p.value?[p.value]:[]);e?t.add(n.value):t.delete(n.value),p.value=[...t]}else p.value=e?n.value:void 0;a("change",e)}}),{modifiers:P}=e.toRefs(n),E=function(t,l,a){return e.computed((()=>{const n={[t]:!0},o="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return o&&Array.isArray(o)&&o.forEach((e=>{e&&(n[`${t}--${e}`]=!0)})),a&&Object.keys(a.value).forEach((l=>{n[`${t}--${l}`]=e.unref(a.value[l])})),n}))}("vv-checkbox",P,e.computed((()=>({switch:f.value,valid:v.value,invalid:c.value,disabled:d.value,readonly:s.value,indeterminate:b.value}))));e.watchEffect((()=>{$.value&&Array.isArray(p.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")})),e.watch((()=>C.value),(e=>{L.value.indeterminate=!!e})),e.onMounted((()=>{C.value&&(L.value.indeterminate=!0)}));const{HintSlot:G,hasHintLabelOrSlot:H,hasInvalidLabelOrSlot:T,hintSlotScope:_}=function(t,l){const a=e.computed((()=>e.isRef(t)?t.value:t)),n=e.computed((()=>O(a.value.invalidLabel))),o=e.computed((()=>O(a.value.validLabel))),i=e.computed((()=>a.value.loadingLabel)),r=e.computed((()=>a.value.hintLabel)),u=e.computed((()=>Boolean(a.value.loading&&(l.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(a.value.invalid&&(l.invalid||n.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(a.value.valid&&(l.valid||o.value)))),v=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(l.hint||r.value))),c=e.computed((()=>d.value||s.value||u.value||v.value)),f=e.computed((()=>({modelValue:a.value.modelValue,valid:a.value.valid,invalid:a.value.invalid,loading:a.value.loading}))),p=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:c,invalidLabel:n,validLabel:o,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:v}),render(){var t,l,a,n,o,i,r,u;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(l=(t=this.$slots).loading)?void 0:l.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(n=(a=this.$slots).invalid)?void 0:n.call(a))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(o=this.$slots).valid)?void 0:i.call(o))??this.validLabel):e.h(this.tag,{role:d},(null==(u=(r=this.$slots).hint)?void 0:u.call(r))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:d,hasHintLabelOrSlot:v,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:f,HintSlot:p}}(i,o);return(t,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(E)),for:e.unref(m)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(m),ref_key:"input",ref:L,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(I)?I.value=t:null),type:"checkbox",class:"vv-checkbox__input",name:t.name,disabled:e.unref(j),value:e.unref(N),tabindex:e.unref(S),"aria-invalid":e.unref(w),"aria-describedby":e.unref(H)?e.unref(y):void 0,"aria-errormessage":e.unref(T)?e.unref(y):void 0},null,8,A),[[e.vModelCheckbox,e.unref(I)]]),e.renderSlot(t.$slots,"default",{value:e.unref(p)},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)])),e.createVNode(e.unref(G),{id:e.unref(y),class:"vv-checkbox__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"3"}:void 0]),1032,["id"])],10,V))}})}));
@@ -2,25 +2,58 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
2
2
  indeterminate: BooleanConstructor;
3
3
  uncheckedValue: (StringConstructor | BooleanConstructor | NumberConstructor)[];
4
4
  switch: BooleanConstructor;
5
- modifiers: globalThis.PropType<string | string[]>;
6
- value: (StringConstructor | BooleanConstructor | NumberConstructor)[];
7
- modelValue: (ObjectConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
8
- loading: BooleanConstructor;
5
+ modifiers: {
6
+ type: globalThis.PropType<string | string[]>;
7
+ default: undefined;
8
+ };
9
+ value: {
10
+ type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
11
+ default: undefined;
12
+ };
13
+ modelValue: {
14
+ type: (ObjectConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
15
+ default: undefined;
16
+ };
17
+ loading: {
18
+ type: BooleanConstructor;
19
+ default: boolean;
20
+ };
9
21
  loadingLabel: {
10
22
  type: StringConstructor;
11
23
  default: string;
12
24
  };
13
- label: (StringConstructor | NumberConstructor)[];
14
- readonly: BooleanConstructor;
15
- disabled: BooleanConstructor;
25
+ label: {
26
+ type: (StringConstructor | NumberConstructor)[];
27
+ default: undefined;
28
+ };
29
+ readonly: {
30
+ type: BooleanConstructor;
31
+ default: boolean;
32
+ };
33
+ disabled: {
34
+ type: BooleanConstructor;
35
+ default: boolean;
36
+ };
16
37
  hintLabel: {
17
38
  type: StringConstructor;
18
39
  default: string;
19
40
  };
20
- invalid: BooleanConstructor;
21
- invalidLabel: (ArrayConstructor | StringConstructor)[];
22
- valid: BooleanConstructor;
23
- validLabel: (ArrayConstructor | StringConstructor)[];
41
+ invalid: {
42
+ type: BooleanConstructor;
43
+ default: boolean;
44
+ };
45
+ invalidLabel: {
46
+ type: (ArrayConstructor | StringConstructor)[];
47
+ default: undefined;
48
+ };
49
+ valid: {
50
+ type: BooleanConstructor;
51
+ default: boolean;
52
+ };
53
+ validLabel: {
54
+ type: (ArrayConstructor | StringConstructor)[];
55
+ default: undefined;
56
+ };
24
57
  tabindex: {
25
58
  type: (StringConstructor | NumberConstructor)[];
26
59
  default: number;
@@ -36,25 +69,58 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
36
69
  indeterminate: BooleanConstructor;
37
70
  uncheckedValue: (StringConstructor | BooleanConstructor | NumberConstructor)[];
38
71
  switch: BooleanConstructor;
39
- modifiers: globalThis.PropType<string | string[]>;
40
- value: (StringConstructor | BooleanConstructor | NumberConstructor)[];
41
- modelValue: (ObjectConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
42
- loading: BooleanConstructor;
72
+ modifiers: {
73
+ type: globalThis.PropType<string | string[]>;
74
+ default: undefined;
75
+ };
76
+ value: {
77
+ type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
78
+ default: undefined;
79
+ };
80
+ modelValue: {
81
+ type: (ObjectConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
82
+ default: undefined;
83
+ };
84
+ loading: {
85
+ type: BooleanConstructor;
86
+ default: boolean;
87
+ };
43
88
  loadingLabel: {
44
89
  type: StringConstructor;
45
90
  default: string;
46
91
  };
47
- label: (StringConstructor | NumberConstructor)[];
48
- readonly: BooleanConstructor;
49
- disabled: BooleanConstructor;
92
+ label: {
93
+ type: (StringConstructor | NumberConstructor)[];
94
+ default: undefined;
95
+ };
96
+ readonly: {
97
+ type: BooleanConstructor;
98
+ default: boolean;
99
+ };
100
+ disabled: {
101
+ type: BooleanConstructor;
102
+ default: boolean;
103
+ };
50
104
  hintLabel: {
51
105
  type: StringConstructor;
52
106
  default: string;
53
107
  };
54
- invalid: BooleanConstructor;
55
- invalidLabel: (ArrayConstructor | StringConstructor)[];
56
- valid: BooleanConstructor;
57
- validLabel: (ArrayConstructor | StringConstructor)[];
108
+ invalid: {
109
+ type: BooleanConstructor;
110
+ default: boolean;
111
+ };
112
+ invalidLabel: {
113
+ type: (ArrayConstructor | StringConstructor)[];
114
+ default: undefined;
115
+ };
116
+ valid: {
117
+ type: BooleanConstructor;
118
+ default: boolean;
119
+ };
120
+ validLabel: {
121
+ type: (ArrayConstructor | StringConstructor)[];
122
+ default: undefined;
123
+ };
58
124
  tabindex: {
59
125
  type: (StringConstructor | NumberConstructor)[];
60
126
  default: number;
@@ -69,11 +135,17 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
69
135
  disabled: boolean;
70
136
  valid: boolean;
71
137
  invalid: boolean;
138
+ modelValue: string | number | boolean | Record<string, any>;
139
+ modifiers: string | string[];
140
+ label: string | number;
141
+ value: string | number | boolean;
72
142
  switch: boolean;
73
143
  loading: boolean;
74
144
  loadingLabel: string;
75
145
  indeterminate: boolean;
76
146
  hintLabel: string;
147
+ invalidLabel: string | unknown[];
148
+ validLabel: string | unknown[];
77
149
  tabindex: string | number;
78
150
  }, {}>, {
79
151
  default?(_: {
@@ -13,25 +13,58 @@ export declare const VvCheckboxProps: {
13
13
  * If true, the input will be displayed as a switch
14
14
  */
15
15
  switch: BooleanConstructor;
16
- modifiers: globalThis.PropType<string | string[]>;
17
- value: (StringConstructor | BooleanConstructor | NumberConstructor)[];
18
- modelValue: (ObjectConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
19
- loading: BooleanConstructor;
16
+ modifiers: {
17
+ type: globalThis.PropType<string | string[]>;
18
+ default: undefined;
19
+ };
20
+ value: {
21
+ type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
22
+ default: undefined;
23
+ };
24
+ modelValue: {
25
+ type: (ObjectConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
26
+ default: undefined;
27
+ };
28
+ loading: {
29
+ type: BooleanConstructor;
30
+ default: boolean;
31
+ };
20
32
  loadingLabel: {
21
33
  type: StringConstructor;
22
34
  default: string;
23
35
  };
24
- label: (StringConstructor | NumberConstructor)[];
25
- readonly: BooleanConstructor;
26
- disabled: BooleanConstructor;
36
+ label: {
37
+ type: (StringConstructor | NumberConstructor)[];
38
+ default: undefined;
39
+ };
40
+ readonly: {
41
+ type: BooleanConstructor;
42
+ default: boolean;
43
+ };
44
+ disabled: {
45
+ type: BooleanConstructor;
46
+ default: boolean;
47
+ };
27
48
  hintLabel: {
28
49
  type: StringConstructor;
29
50
  default: string;
30
51
  };
31
- invalid: BooleanConstructor;
32
- invalidLabel: (ArrayConstructor | StringConstructor)[];
33
- valid: BooleanConstructor;
34
- validLabel: (ArrayConstructor | StringConstructor)[];
52
+ invalid: {
53
+ type: BooleanConstructor;
54
+ default: boolean;
55
+ };
56
+ invalidLabel: {
57
+ type: (ArrayConstructor | StringConstructor)[];
58
+ default: undefined;
59
+ };
60
+ valid: {
61
+ type: BooleanConstructor;
62
+ default: boolean;
63
+ };
64
+ validLabel: {
65
+ type: (ArrayConstructor | StringConstructor)[];
66
+ default: undefined;
67
+ };
35
68
  tabindex: {
36
69
  type: (StringConstructor | NumberConstructor)[];
37
70
  default: number;
@@ -272,6 +272,7 @@ const LinkProps = {
272
272
  */
273
273
  target: {
274
274
  type: String,
275
+ default: void 0,
275
276
  validator: (value) => Object.values(AnchorTarget).includes(value)
276
277
  },
277
278
  /**
@@ -286,27 +287,33 @@ const ValidProps = {
286
287
  /**
287
288
  * Valid status
288
289
  */
289
- valid: Boolean,
290
+ valid: { type: Boolean, default: false },
290
291
  /**
291
292
  * Valid label
292
293
  */
293
- validLabel: [String, Array]
294
+ validLabel: { type: [String, Array], default: void 0 }
294
295
  };
295
296
  const InvalidProps = {
296
297
  /**
297
298
  * Invalid status
298
299
  */
299
- invalid: Boolean,
300
+ invalid: {
301
+ type: Boolean,
302
+ default: false
303
+ },
300
304
  /**
301
305
  * Invalid label
302
306
  */
303
- invalidLabel: [String, Array]
307
+ invalidLabel: { type: [String, Array], default: void 0 }
304
308
  };
305
309
  const LoadingProps = {
306
310
  /**
307
311
  * Loading status
308
312
  */
309
- loading: Boolean,
313
+ loading: {
314
+ type: Boolean,
315
+ default: false
316
+ },
310
317
  /**
311
318
  * Loading label
312
319
  */
@@ -319,43 +326,64 @@ const DisabledProps = {
319
326
  /**
320
327
  * Whether the form control is disabled
321
328
  */
322
- disabled: Boolean
329
+ disabled: {
330
+ type: Boolean,
331
+ default: false
332
+ }
323
333
  };
324
334
  const ActiveProps = {
325
335
  /**
326
336
  * Whether the item is active
327
337
  */
328
- active: Boolean
338
+ active: {
339
+ type: Boolean,
340
+ default: false
341
+ }
329
342
  };
330
343
  const CurrentProps = {
331
344
  /**
332
345
  * Whether the item is current
333
346
  */
334
- current: Boolean
347
+ current: {
348
+ type: Boolean,
349
+ default: false
350
+ }
335
351
  };
336
352
  const PressedProps = {
337
353
  /**
338
354
  * Whether the item is pressed
339
355
  */
340
- pressed: Boolean
356
+ pressed: {
357
+ type: Boolean,
358
+ default: false
359
+ }
341
360
  };
342
361
  const LabelProps = {
343
362
  /**
344
363
  * The item label
345
364
  */
346
- label: [String, Number]
365
+ label: {
366
+ type: [String, Number],
367
+ default: void 0
368
+ }
347
369
  };
348
370
  const ReadonlyProps = {
349
371
  /**
350
372
  * The value is not editable
351
373
  */
352
- readonly: Boolean
374
+ readonly: {
375
+ type: Boolean,
376
+ default: false
377
+ }
353
378
  };
354
379
  const ModifiersProps = {
355
380
  /**
356
381
  * Component BEM modifiers
357
382
  */
358
- modifiers: [String, Array]
383
+ modifiers: {
384
+ type: [String, Array],
385
+ default: void 0
386
+ }
359
387
  };
360
388
  const HintProps = {
361
389
  hintLabel: { type: String, default: "" }
@@ -386,7 +414,10 @@ const OptionsProps = {
386
414
  * VvIcon name or props
387
415
  * @see VVIcon
388
416
  */
389
- icon: { type: [String, Object] },
417
+ icon: {
418
+ type: [String, Object],
419
+ default: void 0
420
+ },
390
421
  /**
391
422
  * VvIcon position
392
423
  */
@@ -431,7 +462,8 @@ const IdProps = {
431
462
  * Dropdown show / hide transition name
432
463
  */
433
464
  transitionName: {
434
- type: String
465
+ type: String,
466
+ default: void 0
435
467
  },
436
468
  /**
437
469
  * Offset of the dropdown from the trigger
@@ -499,7 +531,8 @@ const IdProps = {
499
531
  * Set dropdown width to the same as the trigger
500
532
  */
501
533
  triggerWidth: {
502
- type: Boolean
534
+ type: Boolean,
535
+ default: false
503
536
  }
504
537
  });
505
538
  const IdNameProps = {
@@ -526,11 +559,17 @@ const CheckboxRadioProps = {
526
559
  * Input value
527
560
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value
528
561
  */
529
- value: [String, Number, Boolean],
562
+ value: {
563
+ type: [String, Number, Boolean],
564
+ default: void 0
565
+ },
530
566
  /**
531
567
  * Input value
532
568
  */
533
- modelValue: [Object, Number, Boolean, String]
569
+ modelValue: {
570
+ type: [Object, Number, Boolean, String],
571
+ default: void 0
572
+ }
534
573
  };
535
574
  const CheckboxRadioGroupProps = {
536
575
  ...ValidProps,
@@ -545,7 +584,10 @@ const CheckboxRadioGroupProps = {
545
584
  /**
546
585
  * Input value
547
586
  */
548
- modelValue: [String, Array, Boolean, Number, Symbol],
587
+ modelValue: {
588
+ type: [String, Array, Boolean, Number, Symbol],
589
+ default: void 0
590
+ },
549
591
  /**
550
592
  * Input name
551
593
  */
@@ -553,7 +595,10 @@ const CheckboxRadioGroupProps = {
553
595
  /**
554
596
  * If true, the group will be displayed in a vertical column
555
597
  */
556
- vertical: Boolean
598
+ vertical: {
599
+ type: Boolean,
600
+ default: false
601
+ }
557
602
  };
558
603
  ({
559
604
  ...DisabledProps,