@volverjs/ui-vue 0.0.2 → 0.0.3-beta.3

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 (171) hide show
  1. package/auto-imports.d.ts +289 -0
  2. package/dist/components/VvAccordion/VvAccordion.es.js +63 -131
  3. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  4. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +2 -2
  5. package/dist/components/VvAccordion/index.d.ts +2 -2
  6. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +97 -176
  7. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  8. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +4 -4
  9. package/dist/components/VvAccordionGroup/index.d.ts +2 -2
  10. package/dist/components/VvBadge/VvBadge.es.js +16 -50
  11. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  12. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +38 -45
  13. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  14. package/dist/components/VvButton/VvButton.es.js +170 -306
  15. package/dist/components/VvButton/VvButton.umd.js +1 -1
  16. package/dist/components/VvButton/VvButton.vue.d.ts +4 -4
  17. package/dist/components/VvButton/index.d.ts +3 -3
  18. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +39 -84
  19. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  20. package/dist/components/VvCard/VvCard.es.js +26 -60
  21. package/dist/components/VvCard/VvCard.umd.js +1 -1
  22. package/dist/components/VvCard/VvCard.vue.d.ts +2 -2
  23. package/dist/components/VvCard/index.d.ts +1 -1
  24. package/dist/components/VvCheckbox/VvCheckbox.es.js +144 -282
  25. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  26. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +6 -6
  27. package/dist/components/VvCheckbox/index.d.ts +10 -4
  28. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +190 -346
  29. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  30. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +7 -7
  31. package/dist/components/VvCheckboxGroup/index.d.ts +3 -3
  32. package/dist/components/VvCombobox/VvCombobox.es.js +330 -487
  33. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  34. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +8 -8
  35. package/dist/components/VvCombobox/index.d.ts +4 -4
  36. package/dist/components/VvDialog/VvDialog.es.js +66 -102
  37. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  38. package/dist/components/VvDropdown/VvDropdown.es.js +61 -185
  39. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  40. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +2 -2
  41. package/dist/components/VvDropdown/index.d.ts +1 -1
  42. package/dist/components/VvIcon/VvIcon.es.js +30 -65
  43. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  44. package/dist/components/VvInputText/VvInputText.es.js +304 -407
  45. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  46. package/dist/components/VvInputText/VvInputText.vue.d.ts +10 -10
  47. package/dist/components/VvInputText/VvInputTextActions.d.ts +1 -1
  48. package/dist/components/VvInputText/index.d.ts +5 -5
  49. package/dist/components/VvProgress/VvProgress.es.js +17 -51
  50. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  51. package/dist/components/VvRadio/VvRadio.es.js +110 -249
  52. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  53. package/dist/components/VvRadio/VvRadio.vue.d.ts +6 -6
  54. package/dist/components/VvRadio/index.d.ts +3 -3
  55. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +161 -318
  56. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  57. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +7 -7
  58. package/dist/components/VvRadioGroup/index.d.ts +3 -3
  59. package/dist/components/VvSelect/VvSelect.es.js +200 -292
  60. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  61. package/dist/components/VvSelect/VvSelect.vue.d.ts +8 -8
  62. package/dist/components/VvSelect/index.d.ts +4 -4
  63. package/dist/components/VvTextarea/VvTextarea.es.js +196 -299
  64. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  65. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +6 -6
  66. package/dist/components/VvTextarea/index.d.ts +3 -3
  67. package/dist/components/VvTooltip/VvTooltip.es.js +28 -0
  68. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -0
  69. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +23 -0
  70. package/dist/components/VvTooltip/index.d.ts +18 -0
  71. package/dist/components/common/HintSlot.d.ts +1 -1
  72. package/dist/components/index.es.js +1179 -1371
  73. package/dist/components/index.umd.js +1 -1
  74. package/dist/composables/group/useInjectedGroupState.d.ts +1 -1
  75. package/dist/composables/useComponentFocus.d.ts +1 -1
  76. package/dist/composables/useComponentIcons.d.ts +1 -1
  77. package/dist/composables/useDebouncedInput.d.ts +1 -1
  78. package/dist/composables/useModifiers.d.ts +1 -1
  79. package/dist/composables/useTextCount.d.ts +1 -1
  80. package/dist/icons.es.js +3 -3
  81. package/dist/icons.umd.js +1 -1
  82. package/dist/index.es.js +1211 -1404
  83. package/dist/index.umd.js +1 -1
  84. package/dist/props/index.d.ts +12 -12
  85. package/dist/stories/Tooltip/Tooltip.settings.d.ts +42 -0
  86. package/dist/stories/Tooltip/Tooltip.test.d.ts +2 -0
  87. package/dist/utils/ObjectUtilities.d.ts +1 -1
  88. package/package.json +27 -20
  89. package/src/assets/icons/detailed.json +1 -1
  90. package/src/assets/icons/normal.json +1 -1
  91. package/src/assets/icons/simple.json +1 -1
  92. package/src/components/VvAccordion/VvAccordion.vue +0 -3
  93. package/src/components/VvAccordion/index.ts +1 -2
  94. package/src/components/VvAccordionGroup/VvAccordionGroup.vue +1 -3
  95. package/src/components/VvBadge/VvBadge.vue +0 -1
  96. package/src/components/VvButton/VvButton.vue +0 -3
  97. package/src/components/VvButton/index.ts +2 -10
  98. package/src/components/VvButtonGroup/VvButtonGroup.vue +0 -3
  99. package/src/components/VvCard/VvCard.vue +0 -1
  100. package/src/components/VvCheckbox/VvCheckbox.vue +0 -3
  101. package/src/components/VvCheckbox/index.ts +1 -2
  102. package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +0 -5
  103. package/src/components/VvCombobox/VvCombobox.vue +0 -7
  104. package/src/components/VvDialog/VvDialog.vue +1 -2
  105. package/src/components/VvDropdown/VvDropdown.vue +0 -4
  106. package/src/components/VvIcon/VvIcon.vue +0 -2
  107. package/src/components/VvInputText/VvInputClearAction.ts +0 -1
  108. package/src/components/VvInputText/VvInputPasswordAction.ts +0 -1
  109. package/src/components/VvInputText/VvInputStepAction.ts +0 -1
  110. package/src/components/VvInputText/VvInputText.vue +1 -16
  111. package/src/components/VvInputText/VvInputTextActions.ts +1 -1
  112. package/src/components/VvProgress/VvProgress.vue +0 -2
  113. package/src/components/VvRadio/VvRadio.vue +0 -3
  114. package/src/components/VvRadio/index.ts +0 -1
  115. package/src/components/VvRadioGroup/VvRadioGroup.vue +0 -5
  116. package/src/components/VvSelect/VvSelect.vue +1 -14
  117. package/src/components/VvTextarea/VvTextarea.vue +1 -15
  118. package/src/components/VvTooltip/VvTooltip.vue +17 -0
  119. package/src/components/VvTooltip/index.ts +21 -0
  120. package/src/components/common/HintSlot.ts +1 -11
  121. package/src/composables/group/types/IAccordionGroupState.ts +0 -1
  122. package/src/composables/group/types/IButtonGroupState.ts +0 -1
  123. package/src/composables/group/types/IInputGroup.ts +0 -1
  124. package/src/composables/group/useInjectedGroupState.ts +1 -2
  125. package/src/composables/group/useProvideGroupState.ts +0 -1
  126. package/src/composables/useComponentFocus.ts +1 -2
  127. package/src/composables/useComponentIcons.ts +1 -1
  128. package/src/composables/useDebouncedInput.ts +1 -1
  129. package/src/composables/useModifiers.ts +1 -2
  130. package/src/composables/useOptions.ts +0 -1
  131. package/src/composables/useTextCount.ts +1 -1
  132. package/src/stories/Accordion/Accordion.stories.mdx +1 -1
  133. package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +1 -1
  134. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +1 -1
  135. package/src/stories/Badge/Badge.stories.mdx +1 -1
  136. package/src/stories/Breadcrumb/Breadcrumb.settings.ts +0 -1
  137. package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +1 -1
  138. package/src/stories/Breadcrumb/BreadcrumbSlots.stories.mdx +1 -1
  139. package/src/stories/Button/Button.stories.mdx +1 -1
  140. package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
  141. package/src/stories/Button/ButtonSlots.stories.mdx +3 -3
  142. package/src/stories/ButtonGroup/ButtonGroup.settings.ts +0 -1
  143. package/src/stories/ButtonGroup/ButtonGroup.stories.mdx +1 -1
  144. package/src/stories/ButtonGroup/ButtonGroupSlots.stories.mdx +1 -1
  145. package/src/stories/Card/Card.stories.mdx +1 -1
  146. package/src/stories/Card/CardSlots.stories.mdx +1 -1
  147. package/src/stories/Checkbox/Checkbox.stories.mdx +1 -1
  148. package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +1 -1
  149. package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +1 -1
  150. package/src/stories/Combobox/Combobox.settings.ts +0 -1
  151. package/src/stories/Combobox/Combobox.stories.mdx +1 -1
  152. package/src/stories/Dialog/Dialog.stories.mdx +1 -1
  153. package/src/stories/Dropdown/Dropdown.settings.ts +0 -1
  154. package/src/stories/Dropdown/Dropdown.stories.mdx +1 -1
  155. package/src/stories/Icon/Icon.settings.ts +0 -1
  156. package/src/stories/Icon/Icon.stories.mdx +1 -1
  157. package/src/stories/Icon/IconsCollection.stories.mdx +1 -1
  158. package/src/stories/InputText/InputText.settings.ts +0 -1
  159. package/src/stories/InputText/InputText.stories.mdx +1 -1
  160. package/src/stories/Progress/Progress.stories.mdx +1 -1
  161. package/src/stories/Radio/Radio.stories.mdx +1 -1
  162. package/src/stories/RadioGroup/RadioGroup.stories.mdx +1 -1
  163. package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +1 -1
  164. package/src/stories/Select/Select.settings.ts +0 -1
  165. package/src/stories/Select/Select.stories.mdx +1 -1
  166. package/src/stories/Textarea/Textarea.settings.ts +0 -1
  167. package/src/stories/Textarea/Textarea.stories.mdx +1 -1
  168. package/src/stories/Tooltip/Tooltip.settings.ts +25 -0
  169. package/src/stories/Tooltip/Tooltip.stories.mdx +98 -0
  170. package/src/stories/Tooltip/Tooltip.test.ts +49 -0
  171. package/src/utils/ObjectUtilities.ts +1 -1
@@ -1,216 +1,77 @@
1
- import { unref as f, computed as c, inject as x, toRef as D, toRefs as I, h as G, defineComponent as E, useSlots as $, ref as H, openBlock as N, createElementBlock as M, normalizeClass as T, withDirectives as Z, createElementVNode as q, isRef as w, vModelRadio as z, renderSlot as U, createTextVNode as F, toDisplayString as J, createVNode as K } from "vue";
2
- import { nanoid as Q } from "nanoid";
3
- import { toReactive as W } from "@vueuse/core";
4
- function P(t, e, n) {
5
- return n ? O(t, n) === O(e, n) : j(t, e);
6
- }
7
- function j(t, e) {
8
- if (t === e)
9
- return !0;
10
- if (t && e && typeof t == "object" && typeof e == "object") {
11
- const n = Array.isArray(t), l = Array.isArray(e);
12
- let s, o, r;
13
- if (n && l) {
14
- if (o = t.length, o != e.length)
15
- return !1;
16
- for (s = o; s-- !== 0; )
17
- if (!j(t[s], e[s]))
18
- return !1;
19
- return !0;
20
- }
21
- if (n != l)
22
- return !1;
23
- const d = t instanceof Date, u = e instanceof Date;
24
- if (d != u)
25
- return !1;
26
- if (d && u)
27
- return t.getTime() == e.getTime();
28
- const i = t instanceof RegExp, p = e instanceof RegExp;
29
- if (i != p)
30
- return !1;
31
- if (i && p)
32
- return t.toString() == e.toString();
33
- const a = Object.keys(t);
34
- if (o = a.length, o !== Object.keys(e).length)
35
- return !1;
36
- for (s = o; s-- !== 0; )
37
- if (!Object.prototype.hasOwnProperty.call(e, a[s]))
38
- return !1;
39
- for (s = o; s-- !== 0; )
40
- if (r = a[s], !j(t[r], e[r]))
41
- return !1;
42
- return !0;
43
- }
44
- return t !== t && e !== e;
45
- }
46
- function O(t, e) {
47
- if (t && Object.keys(t).length && e) {
48
- if (e.indexOf(".") === -1)
49
- return t[e];
50
- {
51
- const n = e.split(".");
52
- let l = t;
53
- for (let s = 0, o = n.length; s < o; ++s) {
54
- if (t == null)
55
- return null;
56
- l = l[n[s]];
57
- }
58
- return l;
59
- }
60
- } else
61
- return null;
62
- }
63
- function X(t, e) {
64
- if (t != null && e && e.length) {
65
- for (const n of e)
66
- if (P(t, n))
67
- return !0;
68
- }
69
- return !1;
70
- }
71
- function B(t) {
72
- return ((e) => e == null || e === "" || Array.isArray(e) && e.length === 0 || !(e instanceof Date) && typeof e == "object" && Object.keys(e).length === 0)(f(t));
73
- }
74
- function Y(t) {
75
- return typeof t == "string" || t instanceof String;
76
- }
77
- function k(t) {
78
- var e, n;
79
- if (t)
80
- return (n = (e = t.match(
81
- /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
82
- )) == null ? void 0 : e.join("-")) == null ? void 0 : n.toLowerCase();
83
- }
84
- function L(t, e) {
85
- const n = { [`${t}`]: !0 };
86
- return {
87
- bemCssClasses: c(() => Object.keys(e).reduce((s, o) => {
88
- const r = f(e[o]) || !1;
89
- if (!r)
90
- return s;
91
- if (o === "modifiers") {
92
- const d = Array.isArray(r) ? r : r.split(" ");
93
- return {
94
- ...s,
95
- ...d.reduce(
96
- (u, i) => ({
97
- ...u,
98
- [`${t}--${k(i)}`]: !0
99
- }),
100
- {}
101
- )
102
- };
103
- } else
104
- return {
105
- ...s,
106
- [`${t}--${k(o)}`]: r
107
- };
108
- }, n) || {})
109
- };
110
- }
111
- const ee = {
1
+ import { defineComponent as B, openBlock as I, createElementBlock as C, normalizeClass as D, unref as s, withDirectives as N, createElementVNode as x, isRef as O, vModelRadio as k, renderSlot as G, createTextVNode as H, toDisplayString as j, createVNode as E } from "vue";
2
+ import { nanoid as F } from "nanoid";
3
+ const M = {
112
4
  valid: Boolean,
113
5
  validLabel: [String, Array]
114
- }, te = {
6
+ }, U = {
115
7
  invalid: Boolean,
116
8
  invalidLabel: [String, Array]
117
- }, re = {
9
+ }, q = {
118
10
  disabled: Boolean
119
- }, ne = {
11
+ }, T = {
120
12
  readonly: Boolean
121
- }, se = {
13
+ }, w = {
122
14
  hintLabel: { type: String, default: "" }
123
- }, oe = {
15
+ }, z = {
124
16
  tabindex: { type: [String, Number], default: 0 }
125
- }, ue = {
17
+ }, $ = {
126
18
  id: [String, Number],
127
19
  name: { type: String, required: !0 }
128
- }, ae = {
129
- ...ue,
130
- ...oe,
131
- ...ee,
132
- ...te,
133
- ...se,
134
- ...re,
135
- ...ne,
20
+ }, J = {
21
+ ...$,
22
+ ...z,
23
+ ...M,
24
+ ...U,
25
+ ...w,
26
+ ...q,
27
+ ...T,
136
28
  value: [String, Number, Boolean],
137
29
  modelValue: [Object, Number, Boolean, String],
138
30
  label: String
139
- };
140
- function le(t) {
141
- const e = x(t, void 0), n = c(() => !B(e));
142
- function l(s, o, r) {
143
- if (e != null && e.value) {
144
- const u = f(e.value)[s];
145
- return c({
146
- get() {
147
- return u == null ? void 0 : u.value;
148
- },
149
- set(i) {
150
- u.value = i;
151
- }
152
- });
153
- }
154
- const d = D(o, s);
155
- return c({
156
- get() {
157
- return d.value;
158
- },
159
- set(u) {
160
- r && r(`update:${s}`, u);
161
- }
162
- });
163
- }
31
+ }, K = "VV_RADIO_GROUP", Q = J, W = ["click", "update:modelValue", "change", "blur"];
32
+ function X(o, c) {
33
+ const { group: t, isInGroup: v, getGroupOrLocalRef: n } = useInjectedGroupState(K), l = n("modelValue", o, c), e = n("readonly", o), f = n("disabled", o), i = n("valid", o), u = n("invalid", o);
164
34
  return {
165
- group: e,
166
- isInGroup: n,
167
- getGroupOrLocalRef: l
35
+ group: t,
36
+ isInGroup: v,
37
+ modelValue: l,
38
+ readonly: e,
39
+ disabled: f,
40
+ valid: i,
41
+ invalid: u
168
42
  };
169
43
  }
170
- const ie = "VV_RADIO_GROUP", ce = ae, fe = ["click", "update:modelValue", "change", "blur"];
171
- function de(t, e) {
172
- const { group: n, isInGroup: l, getGroupOrLocalRef: s } = le(ie), o = s("modelValue", t, e), r = s("readonly", t), d = s("disabled", t), u = s("valid", t), i = s("invalid", t);
173
- return {
174
- group: n,
175
- isInGroup: l,
176
- modelValue: o,
177
- readonly: r,
178
- disabled: d,
179
- valid: u,
180
- invalid: i
181
- };
44
+ function R(o) {
45
+ return Array.isArray(o) ? o.filter((c) => isString(c)).join(" ") : o;
182
46
  }
183
- function C(t) {
184
- return Array.isArray(t) ? t.filter((e) => Y(e)).join(" ") : t;
185
- }
186
- function ve(t, e) {
47
+ function Y(o, c) {
187
48
  const {
188
- invalid: n,
189
- valid: l,
190
- hint: s,
191
- loading: o
192
- } = e, {
193
- hintLabel: r,
194
- modelValue: d,
195
- valid: u,
196
- validLabel: i,
49
+ invalid: t,
50
+ valid: v,
51
+ hint: n,
52
+ loading: l
53
+ } = c, {
54
+ hintLabel: e,
55
+ modelValue: f,
56
+ valid: i,
57
+ validLabel: u,
197
58
  invalid: p,
198
59
  invalidLabel: a,
199
- ...A
200
- } = I(t), v = O(A, "loading"), y = O(A, "loadingLabel"), g = c(() => p.value ? !!(p.value && n || a != null && a.value && Array.isArray(a.value) && a.value.length > 0 || a != null && a.value && !B(a)) : !1), h = c(
201
- () => !!(r && r.value || s)
202
- ), V = c(
203
- () => !!(i && i.value || l)
204
- ), R = c(
205
- () => !!(v != null && v.value && o || v != null && v.value && (y != null && y.value))
206
- ), m = c(
207
- () => h.value || V.value || g.value || R.value
60
+ ...b
61
+ } = toRefs(o), r = resolveFieldData(b, "loading"), d = resolveFieldData(b, "loadingLabel"), y = computed(() => p.value ? !!(p.value && t || a != null && a.value && Array.isArray(a.value) && a.value.length > 0 || a != null && a.value && !isEmpty(a)) : !1), V = computed(
62
+ () => !!(e && e.value || n)
63
+ ), _ = computed(
64
+ () => !!(u && u.value || v)
65
+ ), S = computed(
66
+ () => !!(r != null && r.value && l || r != null && r.value && (d != null && d.value))
67
+ ), m = computed(
68
+ () => V.value || _.value || y.value || S.value
208
69
  );
209
70
  return {
210
- hasInvalid: g,
211
- hasHint: h,
212
- hasValid: V,
213
- hasLoading: R,
71
+ hasInvalid: y,
72
+ hasHint: V,
73
+ hasValid: _,
74
+ hasLoading: S,
214
75
  HintSlot: {
215
76
  name: "HintSlot",
216
77
  props: {
@@ -219,31 +80,31 @@ function ve(t, e) {
219
80
  default: () => ({})
220
81
  }
221
82
  },
222
- setup(S) {
223
- const b = c(() => {
224
- const _ = W({
225
- hintLabel: r,
226
- modelValue: d,
227
- valid: u,
228
- validLabel: i,
83
+ setup(g) {
84
+ const A = computed(() => {
85
+ const P = toReactive({
86
+ hintLabel: e,
87
+ modelValue: f,
88
+ valid: i,
89
+ validLabel: u,
229
90
  invalid: p,
230
91
  invalidLabel: a,
231
- loading: v,
232
- loadingLabel: y,
233
- ...S.params
92
+ loading: r,
93
+ loadingLabel: d,
94
+ ...g.params
234
95
  });
235
- return p != null && p.value ? (n == null ? void 0 : n(_)) || C(a == null ? void 0 : a.value) || (r == null ? void 0 : r.value) : u != null && u.value ? (l == null ? void 0 : l(_)) || C(i == null ? void 0 : i.value) || (r == null ? void 0 : r.value) : v != null && v.value ? (o == null ? void 0 : o(_)) || C(y == null ? void 0 : y.value) || (r == null ? void 0 : r.value) : (s == null ? void 0 : s(_)) || C(r == null ? void 0 : r.value) || (r == null ? void 0 : r.value);
96
+ return p != null && p.value ? (t == null ? void 0 : t(P)) || R(a == null ? void 0 : a.value) || (e == null ? void 0 : e.value) : i != null && i.value ? (v == null ? void 0 : v(P)) || R(u == null ? void 0 : u.value) || (e == null ? void 0 : e.value) : r != null && r.value ? (l == null ? void 0 : l(P)) || R(d == null ? void 0 : d.value) || (e == null ? void 0 : e.value) : (n == null ? void 0 : n(P)) || R(e == null ? void 0 : e.value) || (e == null ? void 0 : e.value);
236
97
  });
237
98
  return {
238
99
  isVisible: m,
239
- hasInvalid: g,
240
- hasValid: V,
241
- hintContent: b
100
+ hasInvalid: y,
101
+ hasValid: _,
102
+ hintContent: A
242
103
  };
243
104
  },
244
105
  render() {
245
106
  if (this.isVisible)
246
- return G(
107
+ return h(
247
108
  "small",
248
109
  {
249
110
  role: this.hasInvalid || this.hasValid ? "alert" : void 0
@@ -254,67 +115,67 @@ function ve(t, e) {
254
115
  }
255
116
  };
256
117
  }
257
- const pe = ["for"], ye = ["id", "name", "disabled", "value", "tabindex", "aria-invalid"], me = {
118
+ const Z = ["for"], L = ["id", "name", "disabled", "value", "tabindex", "aria-invalid"], ee = {
258
119
  name: "VvRadio"
259
- }, Ve = /* @__PURE__ */ E({
260
- ...me,
261
- props: ce,
262
- emits: fe,
263
- setup(t, { emit: e }) {
264
- const n = t, l = $(), { disabled: s, readonly: o, modelValue: r, valid: d, invalid: u } = de(
265
- n,
266
- e
267
- ), i = c(() => String(n.id || Q())), p = c(() => A.value ? -1 : n.tabindex), a = H(), A = c(() => s.value || o.value), v = c(() => {
268
- if (u.value === !0)
120
+ }, oe = /* @__PURE__ */ B({
121
+ ...ee,
122
+ props: Q,
123
+ emits: W,
124
+ setup(o, { emit: c }) {
125
+ const t = o, v = useSlots(), { disabled: n, readonly: l, modelValue: e, valid: f, invalid: i } = X(
126
+ t,
127
+ c
128
+ ), u = computed(() => String(t.id || F())), p = computed(() => b.value ? -1 : t.tabindex), a = ref(), b = computed(() => n.value || l.value), r = computed(() => {
129
+ if (i.value === !0)
269
130
  return !0;
270
- if (d.value === !0)
131
+ if (f.value === !0)
271
132
  return !1;
272
- }), y = c(
273
- () => Array.isArray(r.value) ? X(n.value, r.value) : P(n.value, r.value)
274
- ), g = c(
275
- () => ["string", "number", "boolean"].includes(typeof n.value) ? n.value : !0
276
- ), h = c({
133
+ }), d = computed(
134
+ () => Array.isArray(e.value) ? contains(t.value, e.value) : equals(t.value, e.value)
135
+ ), y = computed(
136
+ () => ["string", "number", "boolean"].includes(typeof t.value) ? t.value : !0
137
+ ), V = computed({
277
138
  get() {
278
- return y.value ? g.value : null;
139
+ return d.value ? y.value : null;
279
140
  },
280
141
  set(m) {
281
- Array.isArray(r.value) ? r.value = [n.value] : r.value = n.value, e("change", m);
142
+ Array.isArray(e.value) ? e.value = [t.value] : e.value = t.value, c("change", m);
282
143
  }
283
- }), { bemCssClasses: V } = L("vv-radio", {
284
- valid: d,
285
- invalid: u,
286
- disabled: s,
287
- readonly: o
288
- }), { HintSlot: R } = ve(n, l);
289
- return (m, S) => (N(), M("label", {
290
- class: T(f(V)),
291
- for: f(i)
144
+ }), { bemCssClasses: _ } = useBemModifiers("vv-radio", {
145
+ valid: f,
146
+ invalid: i,
147
+ disabled: n,
148
+ readonly: l
149
+ }), { HintSlot: S } = Y(t, v);
150
+ return (m, g) => (I(), C("label", {
151
+ class: D(s(_)),
152
+ for: s(u)
292
153
  }, [
293
- Z(q("input", {
294
- id: f(i),
154
+ N(x("input", {
155
+ id: s(u),
295
156
  ref_key: "input",
296
157
  ref: a,
297
- "onUpdate:modelValue": S[0] || (S[0] = (b) => w(h) ? h.value = b : null),
158
+ "onUpdate:modelValue": g[0] || (g[0] = (A) => O(V) ? V.value = A : null),
298
159
  type: "radio",
299
160
  class: "vv-radio__input",
300
161
  name: m.name,
301
- disabled: f(A),
302
- value: f(g),
303
- tabindex: f(p),
304
- "aria-invalid": f(v)
305
- }, null, 8, ye), [
306
- [z, f(h)]
162
+ disabled: s(b),
163
+ value: s(y),
164
+ tabindex: s(p),
165
+ "aria-invalid": s(r)
166
+ }, null, 8, L), [
167
+ [k, s(V)]
307
168
  ]),
308
- U(m.$slots, "default", { value: f(r) }, () => [
309
- F(J(m.label), 1)
169
+ G(m.$slots, "default", { value: s(e) }, () => [
170
+ H(j(m.label), 1)
310
171
  ]),
311
- K(f(R), {
172
+ E(s(S), {
312
173
  class: "vv-radio__hint",
313
- params: { value: f(r) }
174
+ params: { value: s(e) }
314
175
  }, null, 8, ["params"])
315
- ], 10, pe));
176
+ ], 10, Z));
316
177
  }
317
178
  });
318
179
  export {
319
- Ve as default
180
+ oe as default
320
181
  };
@@ -1 +1 @@
1
- (function(t,h){typeof exports=="object"&&typeof module<"u"?module.exports=h(require("vue"),require("nanoid"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["vue","nanoid","@vueuse/core"],h):(t=typeof globalThis<"u"?globalThis:t||self,t.VvRadio=h(t.vue,t.nanoid,t.core))})(this,function(t,h,B){"use strict";function j(n,e,s){return s?P(n,s)===P(e,s):O(n,e)}function O(n,e){if(n===e)return!0;if(n&&e&&typeof n=="object"&&typeof e=="object"){const s=Array.isArray(n),l=Array.isArray(e);let o,i,r;if(s&&l){if(i=n.length,i!=e.length)return!1;for(o=i;o--!==0;)if(!O(n[o],e[o]))return!1;return!0}if(s!=l)return!1;const f=n instanceof Date,a=e instanceof Date;if(f!=a)return!1;if(f&&a)return n.getTime()==e.getTime();const c=n instanceof RegExp,p=e instanceof RegExp;if(c!=p)return!1;if(c&&p)return n.toString()==e.toString();const u=Object.keys(n);if(i=u.length,i!==Object.keys(e).length)return!1;for(o=i;o--!==0;)if(!Object.prototype.hasOwnProperty.call(e,u[o]))return!1;for(o=i;o--!==0;)if(r=u[o],!O(n[r],e[r]))return!1;return!0}return n!==n&&e!==e}function P(n,e){if(n&&Object.keys(n).length&&e){if(e.indexOf(".")===-1)return n[e];{const s=e.split(".");let l=n;for(let o=0,i=s.length;o<i;++o){if(n==null)return null;l=l[s[o]]}return l}}else return null}function I(n,e){if(n!=null&&e&&e.length){for(const s of e)if(j(n,s))return!0}return!1}function k(n){return(e=>e==null||e===""||Array.isArray(e)&&e.length===0||!(e instanceof Date)&&typeof e=="object"&&Object.keys(e).length===0)(t.unref(n))}function D(n){return typeof n=="string"||n instanceof String}function x(n){var e,s;if(n)return(s=(e=n.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:e.join("-"))==null?void 0:s.toLowerCase()}function G(n,e){const s={[`${n}`]:!0};return{bemCssClasses:t.computed(()=>Object.keys(e).reduce((o,i)=>{const r=t.unref(e[i])||!1;if(!r)return o;if(i==="modifiers"){const f=Array.isArray(r)?r:r.split(" ");return{...o,...f.reduce((a,c)=>({...a,[`${n}--${x(c)}`]:!0}),{})}}else return{...o,[`${n}--${x(i)}`]:r}},s)||{})}}const E={...{id:[String,Number],name:{type:String,required:!0}},...{tabindex:{type:[String,Number],default:0}},...{valid:Boolean,validLabel:[String,Array]},...{invalid:Boolean,invalidLabel:[String,Array]},...{hintLabel:{type:String,default:""}},...{disabled:Boolean},...{readonly:Boolean},value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String],label:String};function H(n){const e=t.inject(n,void 0),s=t.computed(()=>!k(e));function l(o,i,r){if(e!=null&&e.value){const a=t.unref(e.value)[o];return t.computed({get(){return a==null?void 0:a.value},set(c){a.value=c}})}const f=t.toRef(i,o);return t.computed({get(){return f.value},set(a){r&&r(`update:${o}`,a)}})}return{group:e,isInGroup:s,getGroupOrLocalRef:l}}const N="VV_RADIO_GROUP",T=E,$=["click","update:modelValue","change","blur"];function q(n,e){const{group:s,isInGroup:l,getGroupOrLocalRef:o}=H(N),i=o("modelValue",n,e),r=o("readonly",n),f=o("disabled",n),a=o("valid",n),c=o("invalid",n);return{group:s,isInGroup:l,modelValue:i,readonly:r,disabled:f,valid:a,invalid:c}}function R(n){return Array.isArray(n)?n.filter(e=>D(e)).join(" "):n}function M(n,e){const{invalid:s,valid:l,hint:o,loading:i}=e,{hintLabel:r,modelValue:f,valid:a,validLabel:c,invalid:p,invalidLabel:u,...A}=t.toRefs(n),d=P(A,"loading"),m=P(A,"loadingLabel"),g=t.computed(()=>p.value?!!(p.value&&s||u!=null&&u.value&&Array.isArray(u.value)&&u.value.length>0||u!=null&&u.value&&!k(u)):!1),v=t.computed(()=>!!(r&&r.value||o)),V=t.computed(()=>!!(c&&c.value||l)),_=t.computed(()=>!!(d!=null&&d.value&&i||d!=null&&d.value&&(m!=null&&m.value))),y=t.computed(()=>v.value||V.value||g.value||_.value);return{hasInvalid:g,hasHint:v,hasValid:V,hasLoading:_,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(S){const b=t.computed(()=>{const C=B.toReactive({hintLabel:r,modelValue:f,valid:a,validLabel:c,invalid:p,invalidLabel:u,loading:d,loadingLabel:m,...S.params});return p!=null&&p.value?(s==null?void 0:s(C))||R(u==null?void 0:u.value)||(r==null?void 0:r.value):a!=null&&a.value?(l==null?void 0:l(C))||R(c==null?void 0:c.value)||(r==null?void 0:r.value):d!=null&&d.value?(i==null?void 0:i(C))||R(m==null?void 0:m.value)||(r==null?void 0:r.value):(o==null?void 0:o(C))||R(r==null?void 0:r.value)||(r==null?void 0:r.value)});return{isVisible:y,hasInvalid:g,hasValid:V,hintContent:b}},render(){if(this.isVisible)return t.h("small",{role:this.hasInvalid||this.hasValid?"alert":void 0},this.hintContent)}}}}const Z=["for"],w=["id","name","disabled","value","tabindex","aria-invalid"],z={name:"VvRadio"};return t.defineComponent({...z,props:T,emits:$,setup(n,{emit:e}){const s=n,l=t.useSlots(),{disabled:o,readonly:i,modelValue:r,valid:f,invalid:a}=q(s,e),c=t.computed(()=>String(s.id||h.nanoid())),p=t.computed(()=>A.value?-1:s.tabindex),u=t.ref(),A=t.computed(()=>o.value||i.value),d=t.computed(()=>{if(a.value===!0)return!0;if(f.value===!0)return!1}),m=t.computed(()=>Array.isArray(r.value)?I(s.value,r.value):j(s.value,r.value)),g=t.computed(()=>["string","number","boolean"].includes(typeof s.value)?s.value:!0),v=t.computed({get(){return m.value?g.value:null},set(y){Array.isArray(r.value)?r.value=[s.value]:r.value=s.value,e("change",y)}}),{bemCssClasses:V}=G("vv-radio",{valid:f,invalid:a,disabled:o,readonly:i}),{HintSlot:_}=M(s,l);return(y,S)=>(t.openBlock(),t.createElementBlock("label",{class:t.normalizeClass(t.unref(V)),for:t.unref(c)},[t.withDirectives(t.createElementVNode("input",{id:t.unref(c),ref_key:"input",ref:u,"onUpdate:modelValue":S[0]||(S[0]=b=>t.isRef(v)?v.value=b:null),type:"radio",class:"vv-radio__input",name:y.name,disabled:t.unref(A),value:t.unref(g),tabindex:t.unref(p),"aria-invalid":t.unref(d)},null,8,w),[[t.vModelRadio,t.unref(v)]]),t.renderSlot(y.$slots,"default",{value:t.unref(r)},()=>[t.createTextVNode(t.toDisplayString(y.label),1)]),t.createVNode(t.unref(_),{class:"vv-radio__hint",params:{value:t.unref(r)}},null,8,["params"])],10,Z))}})});
1
+ (function(e,P){typeof exports=="object"&&typeof module<"u"?module.exports=P(require("vue"),require("nanoid")):typeof define=="function"&&define.amd?define(["vue","nanoid"],P):(e=typeof globalThis<"u"?globalThis:e||self,e.VvRadio=P(e.vue,e.nanoid))})(this,function(e,P){"use strict";const x={...{id:[String,Number],name:{type:String,required:!0}},...{tabindex:{type:[String,Number],default:0}},...{valid:Boolean,validLabel:[String,Array]},...{invalid:Boolean,invalidLabel:[String,Array]},...{hintLabel:{type:String,default:""}},...{disabled:Boolean},...{readonly:Boolean},value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String],label:String},B="VV_RADIO_GROUP",D=x,N=["click","update:modelValue","change","blur"];function C(o,c){const{group:n,isInGroup:p,getGroupOrLocalRef:r}=useInjectedGroupState(B),l=r("modelValue",o,c),t=r("readonly",o),m=r("disabled",o),i=r("valid",o),u=r("invalid",o);return{group:n,isInGroup:p,modelValue:l,readonly:t,disabled:m,valid:i,invalid:u}}function R(o){return Array.isArray(o)?o.filter(c=>isString(c)).join(" "):o}function H(o,c){const{invalid:n,valid:p,hint:r,loading:l}=c,{hintLabel:t,modelValue:m,valid:i,validLabel:u,invalid:f,invalidLabel:a,..._}=toRefs(o),s=resolveFieldData(_,"loading"),d=resolveFieldData(_,"loadingLabel"),y=computed(()=>f.value?!!(f.value&&n||a!=null&&a.value&&Array.isArray(a.value)&&a.value.length>0||a!=null&&a.value&&!isEmpty(a)):!1),V=computed(()=>!!(t&&t.value||r)),b=computed(()=>!!(u&&u.value||p)),S=computed(()=>!!(s!=null&&s.value&&l||s!=null&&s.value&&(d!=null&&d.value))),v=computed(()=>V.value||b.value||y.value||S.value);return{hasInvalid:y,hasHint:V,hasValid:b,hasLoading:S,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(g){const I=computed(()=>{const A=toReactive({hintLabel:t,modelValue:m,valid:i,validLabel:u,invalid:f,invalidLabel:a,loading:s,loadingLabel:d,...g.params});return f!=null&&f.value?(n==null?void 0:n(A))||R(a==null?void 0:a.value)||(t==null?void 0:t.value):i!=null&&i.value?(p==null?void 0:p(A))||R(u==null?void 0:u.value)||(t==null?void 0:t.value):s!=null&&s.value?(l==null?void 0:l(A))||R(d==null?void 0:d.value)||(t==null?void 0:t.value):(r==null?void 0:r(A))||R(t==null?void 0:t.value)||(t==null?void 0:t.value)});return{isVisible:v,hasInvalid:y,hasValid:b,hintContent:I}},render(){if(this.isVisible)return h("small",{role:this.hasInvalid||this.hasValid?"alert":void 0},this.hintContent)}}}}const O=["for"],j=["id","name","disabled","value","tabindex","aria-invalid"],k={name:"VvRadio"};return e.defineComponent({...k,props:D,emits:N,setup(o,{emit:c}){const n=o,p=useSlots(),{disabled:r,readonly:l,modelValue:t,valid:m,invalid:i}=C(n,c),u=computed(()=>String(n.id||P.nanoid())),f=computed(()=>_.value?-1:n.tabindex),a=ref(),_=computed(()=>r.value||l.value),s=computed(()=>{if(i.value===!0)return!0;if(m.value===!0)return!1}),d=computed(()=>Array.isArray(t.value)?contains(n.value,t.value):equals(n.value,t.value)),y=computed(()=>["string","number","boolean"].includes(typeof n.value)?n.value:!0),V=computed({get(){return d.value?y.value:null},set(v){Array.isArray(t.value)?t.value=[n.value]:t.value=n.value,c("change",v)}}),{bemCssClasses:b}=useBemModifiers("vv-radio",{valid:m,invalid:i,disabled:r,readonly:l}),{HintSlot:S}=H(n,p);return(v,g)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(b)),for:e.unref(u)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(u),ref_key:"input",ref:a,"onUpdate:modelValue":g[0]||(g[0]=I=>e.isRef(V)?V.value=I:null),type:"radio",class:"vv-radio__input",name:v.name,disabled:e.unref(_),value:e.unref(y),tabindex:e.unref(f),"aria-invalid":e.unref(s)},null,8,j),[[e.vModelRadio,e.unref(V)]]),e.renderSlot(v.$slots,"default",{value:e.unref(t)},()=>[e.createTextVNode(e.toDisplayString(v.label),1)]),e.createVNode(e.unref(S),{class:"vv-radio__hint",params:{value:e.unref(t)}},null,8,["params"])],10,O))}})});
@@ -1,6 +1,6 @@
1
1
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
2
2
  value: (StringConstructor | BooleanConstructor | NumberConstructor)[];
3
- modelValue: (ObjectConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
3
+ modelValue: (StringConstructor | BooleanConstructor | ObjectConstructor | NumberConstructor)[];
4
4
  label: StringConstructor;
5
5
  readonly: BooleanConstructor;
6
6
  disabled: BooleanConstructor;
@@ -9,9 +9,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
9
9
  default: string;
10
10
  };
11
11
  invalid: BooleanConstructor;
12
- invalidLabel: (ArrayConstructor | StringConstructor)[];
12
+ invalidLabel: (StringConstructor | ArrayConstructor)[];
13
13
  valid: BooleanConstructor;
14
- validLabel: (ArrayConstructor | StringConstructor)[];
14
+ validLabel: (StringConstructor | ArrayConstructor)[];
15
15
  tabindex: {
16
16
  type: (StringConstructor | NumberConstructor)[];
17
17
  default: number;
@@ -23,7 +23,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
23
23
  };
24
24
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
25
25
  value: (StringConstructor | BooleanConstructor | NumberConstructor)[];
26
- modelValue: (ObjectConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
26
+ modelValue: (StringConstructor | BooleanConstructor | ObjectConstructor | NumberConstructor)[];
27
27
  label: StringConstructor;
28
28
  readonly: BooleanConstructor;
29
29
  disabled: BooleanConstructor;
@@ -32,9 +32,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
32
32
  default: string;
33
33
  };
34
34
  invalid: BooleanConstructor;
35
- invalidLabel: (ArrayConstructor | StringConstructor)[];
35
+ invalidLabel: (StringConstructor | ArrayConstructor)[];
36
36
  valid: BooleanConstructor;
37
- validLabel: (ArrayConstructor | StringConstructor)[];
37
+ validLabel: (StringConstructor | ArrayConstructor)[];
38
38
  tabindex: {
39
39
  type: (StringConstructor | NumberConstructor)[];
40
40
  default: number;
@@ -2,7 +2,7 @@ import type { ExtractPropTypes, Ref } from 'vue';
2
2
  import type { IInputGroupState } from '@/composables/group/types/IInputGroup';
3
3
  export declare const VvRadioProps: {
4
4
  value: (StringConstructor | BooleanConstructor | NumberConstructor)[];
5
- modelValue: (ObjectConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
5
+ modelValue: (StringConstructor | BooleanConstructor | ObjectConstructor | NumberConstructor)[];
6
6
  label: StringConstructor;
7
7
  readonly: BooleanConstructor;
8
8
  disabled: BooleanConstructor;
@@ -11,9 +11,9 @@ export declare const VvRadioProps: {
11
11
  default: string;
12
12
  };
13
13
  invalid: BooleanConstructor;
14
- invalidLabel: (ArrayConstructor | StringConstructor)[];
14
+ invalidLabel: (StringConstructor | ArrayConstructor)[];
15
15
  valid: BooleanConstructor;
16
- validLabel: (ArrayConstructor | StringConstructor)[];
16
+ validLabel: (StringConstructor | ArrayConstructor)[];
17
17
  tabindex: {
18
18
  type: (StringConstructor | NumberConstructor)[];
19
19
  default: number;