@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,5 +1,5 @@
1
1
  export declare const VvRadioGroupProps: {
2
- modelValue: (ArrayConstructor | StringConstructor)[];
2
+ modelValue: (StringConstructor | ArrayConstructor)[];
3
3
  label: StringConstructor;
4
4
  name: {
5
5
  type: StringConstructor;
@@ -25,8 +25,8 @@ export declare const VvRadioGroupProps: {
25
25
  default: string;
26
26
  };
27
27
  invalid: BooleanConstructor;
28
- invalidLabel: (ArrayConstructor | StringConstructor)[];
28
+ invalidLabel: (StringConstructor | ArrayConstructor)[];
29
29
  valid: BooleanConstructor;
30
- validLabel: (ArrayConstructor | StringConstructor)[];
30
+ validLabel: (StringConstructor | ArrayConstructor)[];
31
31
  };
32
32
  export declare const VvRadioGroupEvents: string[];
@@ -1,99 +1,7 @@
1
- import { unref as c, computed as i, toRefs as j, watch as J, defineComponent as X, ref as Q, inject as ae, openBlock as y, createBlock as R, mergeProps as D, createCommentVNode as O, h as ue, useSlots as ce, createElementBlock as B, normalizeClass as de, toDisplayString as E, createElementVNode as T, renderSlot as q, normalizeProps as L, withDirectives as fe, isRef as ve, Fragment as pe, renderList as me, vModelSelect as ge, createVNode as he } from "vue";
2
- import { nanoid as ye } from "nanoid";
3
- import { useFocus as be, toReactive as Se, useElementVisibility as Ie } from "@vueuse/core";
4
- import { iconExists as F, Icon as Ve, addIcon as Pe } from "@iconify/vue";
5
- function K(e, r) {
6
- if (e && Object.keys(e).length && r) {
7
- if (r.indexOf(".") === -1)
8
- return e[r];
9
- {
10
- const t = r.split(".");
11
- let a = e;
12
- for (let l = 0, d = t.length; l < d; ++l) {
13
- if (e == null)
14
- return null;
15
- a = a[t[l]];
16
- }
17
- return a;
18
- }
19
- } else
20
- return null;
21
- }
22
- function W(e) {
23
- return ((r) => r == null || r === "" || Array.isArray(r) && r.length === 0 || !(r instanceof Date) && typeof r == "object" && Object.keys(r).length === 0)(c(e));
24
- }
25
- function Ae(e) {
26
- return typeof e == "string" || e instanceof String;
27
- }
28
- function Z(e) {
29
- var r, t;
30
- if (e)
31
- return (t = (r = e.match(
32
- /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
33
- )) == null ? void 0 : r.join("-")) == null ? void 0 : t.toLowerCase();
34
- }
35
- function Y(e, r) {
36
- const t = { [`${e}`]: !0 };
37
- return {
38
- bemCssClasses: i(() => Object.keys(r).reduce((l, d) => {
39
- const n = c(r[d]) || !1;
40
- if (!n)
41
- return l;
42
- if (d === "modifiers") {
43
- const h = Array.isArray(n) ? n : n.split(" ");
44
- return {
45
- ...l,
46
- ...h.reduce(
47
- (p, v) => ({
48
- ...p,
49
- [`${e}--${Z(v)}`]: !0
50
- }),
51
- {}
52
- )
53
- };
54
- } else
55
- return {
56
- ...l,
57
- [`${e}--${Z(d)}`]: n
58
- };
59
- }, t) || {})
60
- };
61
- }
62
- function Be(e, r, t) {
63
- const a = i(
64
- () => !!(e != null && e.value && r.value === "left" || t != null && t.iconLeft)
65
- ), l = i(
66
- () => !!(e != null && e.value && r.value === "right" || t != null && t.iconRight)
67
- ), d = i(
68
- () => !!(e != null && e.value && r.value === "top" || t != null && t.iconTop)
69
- ), n = i(
70
- () => !!(e != null && e.value && r.value === "bottom" || t != null && t.iconBottom)
71
- );
72
- return {
73
- hasIcon: i(() => typeof (e == null ? void 0 : e.value) == "string" ? { name: e == null ? void 0 : e.value } : e == null ? void 0 : e.value),
74
- hasIconLeft: a,
75
- hasIconRight: l,
76
- hasIconTop: d,
77
- hasIconBottom: n
78
- };
79
- }
80
- function Oe(e) {
81
- const { options: r, labelKey: t, valueKey: a } = j(e);
82
- return {
83
- options: r,
84
- getOptionLabel: (n) => typeof n != "object" && n !== null ? n : typeof t.value == "function" ? t.value(n) : n[t.value],
85
- getOptionValue: (n) => typeof n != "object" && n !== null ? n : typeof a.value == "function" ? a.value(n) : n[a.value]
86
- };
87
- }
88
- function $e(e, r) {
89
- const { focused: t } = be(e);
90
- return J(t, (a) => {
91
- r(a ? "focus" : "blur", c(e));
92
- }), {
93
- focused: t
94
- };
95
- }
96
- const Ce = "ds", we = {
1
+ import { defineComponent as U, unref as l, openBlock as g, createBlock as k, mergeProps as N, createCommentVNode as F, createElementBlock as w, normalizeClass as te, toDisplayString as R, createElementVNode as j, renderSlot as q, normalizeProps as T, withDirectives as oe, isRef as ne, Fragment as re, renderList as ie, vModelSelect as se, createVNode as le } from "vue";
2
+ import { nanoid as ae } from "nanoid";
3
+ import { iconExists as O, Icon as ue, addIcon as ce } from "@iconify/vue";
4
+ const de = "ds", pe = {
97
5
  color: String,
98
6
  width: {
99
7
  type: [String, Number]
@@ -124,90 +32,90 @@ const Ce = "ds", we = {
124
32
  modifiers: {
125
33
  type: [String, Array]
126
34
  }
127
- }, Fe = {
35
+ }, ve = {
128
36
  name: "VvIcon"
129
- }, G = /* @__PURE__ */ X({
130
- ...Fe,
131
- props: we,
132
- setup(e) {
133
- const r = e, t = Q(!0), { modifiers: a } = j(r), l = ae(Ce), { bemCssClasses: d } = Y("vv-icon", {
134
- modifiers: a
135
- }), n = i(() => r.provider || (l == null ? void 0 : l.provider)), h = i(() => {
136
- const o = r.name ?? "", s = `@${n.value}:${r.prefix}:${r.name}`;
137
- return F(o) ? o : F(s) ? s : (l == null ? void 0 : l.iconsCollections.find((m) => {
138
- const f = `@${n.value}:${m.prefix}:${o}`;
139
- if (F(f))
140
- return f;
141
- })) || o;
37
+ }, G = /* @__PURE__ */ U({
38
+ ...ve,
39
+ props: pe,
40
+ setup(c) {
41
+ const r = c, o = ref(!0), { modifiers: v } = toRefs(r), s = inject(de), { bemCssClasses: f } = useBemModifiers("vv-icon", {
42
+ modifiers: v
43
+ }), n = computed(() => r.provider || (s == null ? void 0 : s.provider)), b = computed(() => {
44
+ const e = r.name ?? "", t = `@${n.value}:${r.prefix}:${r.name}`;
45
+ return O(e) ? e : O(t) ? t : (s == null ? void 0 : s.iconsCollections.find((d) => {
46
+ const a = `@${n.value}:${d.prefix}:${e}`;
47
+ if (O(a))
48
+ return a;
49
+ })) || e;
142
50
  });
143
- function p(o) {
144
- let s = null;
51
+ function m(e) {
52
+ let t = null;
145
53
  if (typeof window > "u") {
146
- const { JSDOM: b } = require("jsdom");
147
- s = new b().window;
54
+ const { JSDOM: y } = require("jsdom");
55
+ t = new y().window;
148
56
  }
149
- return (s ? new s.DOMParser() : new window.DOMParser()).parseFromString(o, "text/html").querySelector("svg");
57
+ return (t ? new t.DOMParser() : new window.DOMParser()).parseFromString(e, "text/html").querySelector("svg");
150
58
  }
151
- function v(o) {
152
- const s = p(o), m = (s == null ? void 0 : s.innerHTML.trim()) || "";
153
- s && m && Pe(`@${n.value}:${r.prefix}:${r.name}`, {
154
- body: m,
155
- height: s.viewBox.baseVal.height,
156
- width: s.viewBox.baseVal.width
59
+ function u(e) {
60
+ const t = m(e), d = (t == null ? void 0 : t.innerHTML.trim()) || "";
61
+ t && d && ce(`@${n.value}:${r.prefix}:${r.name}`, {
62
+ body: d,
63
+ height: t.viewBox.baseVal.height,
64
+ width: t.viewBox.baseVal.width
157
65
  });
158
66
  }
159
- return l && (r.src && !F(`@${n.value}:${r.prefix}:${r.name}`) ? (t.value = !1, l.fetchIcon(r.src).then((o) => {
160
- o && (v(o), t.value = !0);
161
- }).catch((o) => {
162
- throw new Error(`During fetch icon: ${o == null ? void 0 : o.message}`);
163
- })) : r.svg && v(r.svg)), (o, s) => t.value ? (y(), R(c(Ve), D({
67
+ return s && (r.src && !O(`@${n.value}:${r.prefix}:${r.name}`) ? (o.value = !1, s.fetchIcon(r.src).then((e) => {
68
+ e && (u(e), o.value = !0);
69
+ }).catch((e) => {
70
+ throw new Error(`During fetch icon: ${e == null ? void 0 : e.message}`);
71
+ })) : r.svg && u(r.svg)), (e, t) => l(o) ? (g(), k(l(ue), N({
164
72
  key: 0,
165
- class: c(d)
73
+ class: l(f)
166
74
  }, {
167
- inline: o.inline,
168
- width: o.width,
169
- height: o.height,
170
- horizontalFlip: o.horizontalFlip,
171
- verticalFlip: o.verticalFlip,
172
- flip: o.flip,
173
- rotate: o.rotate,
174
- color: o.color,
175
- onLoad: o.onLoad,
176
- icon: c(h)
177
- }), null, 16, ["class"])) : O("", !0);
75
+ inline: e.inline,
76
+ width: e.width,
77
+ height: e.height,
78
+ horizontalFlip: e.horizontalFlip,
79
+ verticalFlip: e.verticalFlip,
80
+ flip: e.flip,
81
+ rotate: e.rotate,
82
+ color: e.color,
83
+ onLoad: e.onLoad,
84
+ icon: l(b)
85
+ }), null, 16, ["class"])) : F("", !0);
178
86
  }
179
87
  });
180
- function _(e) {
181
- return Array.isArray(e) ? e.filter((r) => Ae(r)).join(" ") : e;
88
+ function C(c) {
89
+ return Array.isArray(c) ? c.filter((r) => isString(r)).join(" ") : c;
182
90
  }
183
- function _e(e, r) {
91
+ function fe(c, r) {
184
92
  const {
185
- invalid: t,
186
- valid: a,
187
- hint: l,
188
- loading: d
93
+ invalid: o,
94
+ valid: v,
95
+ hint: s,
96
+ loading: f
189
97
  } = r, {
190
98
  hintLabel: n,
191
- modelValue: h,
192
- valid: p,
193
- validLabel: v,
194
- invalid: o,
195
- invalidLabel: s,
196
- ...m
197
- } = j(e), f = K(m, "loading"), g = K(m, "loadingLabel"), b = i(() => o.value ? !!(o.value && t || s != null && s.value && Array.isArray(s.value) && s.value.length > 0 || s != null && s.value && !W(s)) : !1), $ = i(
198
- () => !!(n && n.value || l)
199
- ), V = i(
200
- () => !!(v && v.value || a)
201
- ), I = i(
202
- () => !!(f != null && f.value && d || f != null && f.value && (g != null && g.value))
203
- ), P = i(
204
- () => $.value || V.value || b.value || I.value
99
+ modelValue: b,
100
+ valid: m,
101
+ validLabel: u,
102
+ invalid: e,
103
+ invalidLabel: t,
104
+ ...d
105
+ } = toRefs(c), a = resolveFieldData(d, "loading"), p = resolveFieldData(d, "loadingLabel"), y = computed(() => e.value ? !!(e.value && o || t != null && t.value && Array.isArray(t.value) && t.value.length > 0 || t != null && t.value && !isEmpty(t)) : !1), $ = computed(
106
+ () => !!(n && n.value || s)
107
+ ), V = computed(
108
+ () => !!(u && u.value || v)
109
+ ), P = computed(
110
+ () => !!(a != null && a.value && f || a != null && a.value && (p != null && p.value))
111
+ ), I = computed(
112
+ () => $.value || V.value || y.value || P.value
205
113
  );
206
114
  return {
207
- hasInvalid: b,
115
+ hasInvalid: y,
208
116
  hasHint: $,
209
117
  hasValid: V,
210
- hasLoading: I,
118
+ hasLoading: P,
211
119
  HintSlot: {
212
120
  name: "HintSlot",
213
121
  props: {
@@ -216,31 +124,31 @@ function _e(e, r) {
216
124
  default: () => ({})
217
125
  }
218
126
  },
219
- setup(C) {
220
- const k = i(() => {
221
- const S = Se({
127
+ setup(A) {
128
+ const _ = computed(() => {
129
+ const S = toReactive({
222
130
  hintLabel: n,
223
- modelValue: h,
224
- valid: p,
225
- validLabel: v,
226
- invalid: o,
227
- invalidLabel: s,
228
- loading: f,
229
- loadingLabel: g,
230
- ...C.params
131
+ modelValue: b,
132
+ valid: m,
133
+ validLabel: u,
134
+ invalid: e,
135
+ invalidLabel: t,
136
+ loading: a,
137
+ loadingLabel: p,
138
+ ...A.params
231
139
  });
232
- return o != null && o.value ? (t == null ? void 0 : t(S)) || _(s == null ? void 0 : s.value) || (n == null ? void 0 : n.value) : p != null && p.value ? (a == null ? void 0 : a(S)) || _(v == null ? void 0 : v.value) || (n == null ? void 0 : n.value) : f != null && f.value ? (d == null ? void 0 : d(S)) || _(g == null ? void 0 : g.value) || (n == null ? void 0 : n.value) : (l == null ? void 0 : l(S)) || _(n == null ? void 0 : n.value) || (n == null ? void 0 : n.value);
140
+ return e != null && e.value ? (o == null ? void 0 : o(S)) || C(t == null ? void 0 : t.value) || (n == null ? void 0 : n.value) : m != null && m.value ? (v == null ? void 0 : v(S)) || C(u == null ? void 0 : u.value) || (n == null ? void 0 : n.value) : a != null && a.value ? (f == null ? void 0 : f(S)) || C(p == null ? void 0 : p.value) || (n == null ? void 0 : n.value) : (s == null ? void 0 : s(S)) || C(n == null ? void 0 : n.value) || (n == null ? void 0 : n.value);
233
141
  });
234
142
  return {
235
- isVisible: P,
236
- hasInvalid: b,
143
+ isVisible: I,
144
+ hasInvalid: y,
237
145
  hasValid: V,
238
- hintContent: k
146
+ hintContent: _
239
147
  };
240
148
  },
241
149
  render() {
242
150
  if (this.isVisible)
243
- return ue(
151
+ return h(
244
152
  "small",
245
153
  {
246
154
  role: this.hasInvalid || this.hasValid ? "alert" : void 0
@@ -251,69 +159,69 @@ function _e(e, r) {
251
159
  }
252
160
  };
253
161
  }
254
- const De = {
162
+ const me = {
255
163
  valid: Boolean,
256
164
  validLabel: [String, Array]
257
- }, je = {
165
+ }, ge = {
258
166
  invalid: Boolean,
259
167
  invalidLabel: [String, Array]
260
- }, ke = {
168
+ }, he = {
261
169
  loading: Boolean,
262
170
  loadingLabel: String
263
- }, Ne = {
171
+ }, ye = {
264
172
  disabled: Boolean
265
- }, Ee = {
173
+ }, Se = {
266
174
  readonly: Boolean
267
- }, Re = {
175
+ }, be = {
268
176
  modifiers: [String, Array]
269
- }, ze = {
177
+ }, Pe = {
270
178
  hintLabel: { type: String, default: "" }
271
- }, He = {
179
+ }, Ve = {
272
180
  options: {
273
181
  type: Array,
274
182
  default: () => []
275
183
  },
276
184
  labelKey: { type: [String, Function], default: "label" },
277
185
  valueKey: { type: [String, Function], default: "value" }
278
- }, U = {
186
+ }, K = {
279
187
  LEFT: "left",
280
188
  RIGHT: "right"
281
- }, Me = {
189
+ }, Ie = {
282
190
  icon: { type: [String, Object] },
283
191
  iconPosition: {
284
192
  type: String,
285
- validation: (e) => Object.values(U).includes(e),
286
- default: U.RIGHT
193
+ validation: (c) => Object.values(K).includes(c),
194
+ default: K.RIGHT
287
195
  }
288
- }, Te = {
196
+ }, Be = {
289
197
  tabindex: { type: [String, Number], default: 0 }
290
- }, qe = {
198
+ }, we = {
291
199
  floating: Boolean
292
- }, Le = {
200
+ }, Fe = {
293
201
  unselectable: { type: Boolean, default: !0 }
294
- }, Ke = {
202
+ }, $e = {
295
203
  id: [String, Number],
296
204
  name: { type: String, required: !0 }
297
- }, Ze = {
205
+ }, Ae = {
298
206
  autofocus: Boolean
299
- }, Ge = {
207
+ }, De = {
300
208
  autocomplete: { type: String, default: "off" }
301
- }, Ue = {
302
- ...Ke,
303
- ...Ze,
304
- ...Ge,
305
- ...Te,
209
+ }, Oe = {
210
+ ...$e,
211
+ ...Ae,
306
212
  ...De,
307
- ...je,
308
- ...ze,
309
- ...ke,
310
- ...Ne,
311
- ...Ee,
312
- ...Re,
313
- ...He,
314
- ...Me,
315
- ...qe,
316
- ...Le,
213
+ ...Be,
214
+ ...me,
215
+ ...ge,
216
+ ...Pe,
217
+ ...he,
218
+ ...ye,
219
+ ...Se,
220
+ ...be,
221
+ ...Ve,
222
+ ...Ie,
223
+ ...we,
224
+ ...Fe,
317
225
  multiple: Boolean,
318
226
  required: Boolean,
319
227
  size: [String, Number],
@@ -323,112 +231,112 @@ const De = {
323
231
  },
324
232
  label: String,
325
233
  placeholder: String
326
- }, Je = ["update:modelValue", "focus", "blur"], Xe = ["for"], Qe = { class: "vv-select__wrapper" }, We = ["id"], Ye = ["disabled", "hidden"], xe = ["disabled", "value"], et = {
234
+ }, Ce = ["update:modelValue", "focus", "blur"], Ne = ["for"], _e = { class: "vv-select__wrapper" }, Ee = ["id"], Re = ["disabled", "hidden"], ke = ["disabled", "value"], He = {
327
235
  name: "VvSelect"
328
- }, st = /* @__PURE__ */ X({
329
- ...et,
330
- props: Ue,
331
- emits: Je,
332
- setup(e, { emit: r }) {
333
- const t = e, a = ce(), l = Q(), { HintSlot: d, hasHint: n, hasInvalid: h } = _e(t, a), {
334
- modifiers: p,
335
- disabled: v,
336
- readonly: o,
337
- loading: s,
338
- icon: m,
339
- iconPosition: f,
340
- invalid: g,
341
- valid: b,
236
+ }, qe = /* @__PURE__ */ U({
237
+ ...He,
238
+ props: Oe,
239
+ emits: Ce,
240
+ setup(c, { emit: r }) {
241
+ const o = c, v = useSlots(), s = ref(), { HintSlot: f, hasHint: n, hasInvalid: b } = fe(o, v), {
242
+ modifiers: m,
243
+ disabled: u,
244
+ readonly: e,
245
+ loading: t,
246
+ icon: d,
247
+ iconPosition: a,
248
+ invalid: p,
249
+ valid: y,
342
250
  floating: $,
343
251
  multiple: V
344
- } = j(t), I = i(() => String(t.id || ye())), P = i(() => `${I.value}-hint`), { focused: C } = $e(l, r), k = Ie(l);
345
- J(k, (u) => {
346
- u && t.autofocus && (C.value = !0);
252
+ } = toRefs(o), P = computed(() => String(o.id || ae())), I = computed(() => `${P.value}-hint`), { focused: A } = useComponentFocus(s, r), _ = useElementVisibility(s);
253
+ watch(_, (i) => {
254
+ i && o.autofocus && (A.value = !0);
347
255
  });
348
- const { hasIcon: S, hasIconLeft: z, hasIconRight: H } = Be(
349
- m,
350
- f
351
- ), x = i(() => !W(t.modelValue)), M = i(() => t.disabled || t.readonly), ee = i(() => M.value ? -1 : t.tabindex), te = i(() => {
352
- if (t.invalid === !0)
256
+ const { hasIcon: S, hasIconLeft: H, hasIconRight: M } = useComponentIcon(
257
+ d,
258
+ a
259
+ ), J = computed(() => !isEmpty(o.modelValue)), z = computed(() => o.disabled || o.readonly), X = computed(() => z.value ? -1 : o.tabindex), L = computed(() => {
260
+ if (o.invalid === !0)
353
261
  return !0;
354
- if (t.valid === !0)
262
+ if (o.valid === !0)
355
263
  return !1;
356
- }), { bemCssClasses: re } = Y("vv-select", {
357
- modifiers: p,
358
- valid: b,
359
- invalid: g,
360
- loading: s,
361
- disabled: v,
362
- readonly: o,
363
- iconLeft: z,
364
- iconRight: H,
365
- dirty: x,
366
- focus: C,
264
+ }), { bemCssClasses: Q } = useBemModifiers("vv-select", {
265
+ modifiers: m,
266
+ valid: y,
267
+ invalid: p,
268
+ loading: t,
269
+ disabled: u,
270
+ readonly: e,
271
+ iconLeft: H,
272
+ iconRight: M,
273
+ dirty: J,
274
+ focus: A,
367
275
  floating: $,
368
276
  multiple: V
369
- }), ne = i(() => ({
370
- name: t.name,
371
- tabindex: ee.value,
372
- disabled: M.value,
373
- required: t.required,
374
- size: t.size,
375
- autocomplete: t.autocomplete,
376
- multiple: t.multiple,
377
- "aria-invalid": te.value,
378
- "aria-describedby": !h.value && n.value ? P.value : void 0,
379
- "aria-errormessage": h.value ? P.value : void 0
380
- })), { getOptionLabel: oe, getOptionValue: se } = Oe(t);
381
- function le(u) {
382
- return typeof u == "string" || u.disabled === void 0 ? v.value : u.disabled;
277
+ }), W = computed(() => ({
278
+ name: o.name,
279
+ tabindex: X.value,
280
+ disabled: z.value,
281
+ required: o.required,
282
+ size: o.size,
283
+ autocomplete: o.autocomplete,
284
+ multiple: o.multiple,
285
+ "aria-invalid": L.value,
286
+ "aria-describedby": !b.value && n.value ? I.value : void 0,
287
+ "aria-errormessage": b.value ? I.value : void 0
288
+ })), { getOptionLabel: Y, getOptionValue: Z } = useOptions(o);
289
+ function x(i) {
290
+ return typeof i == "string" || i.disabled === void 0 ? u.value : i.disabled;
383
291
  }
384
- const N = i({
385
- get: () => t.modelValue,
386
- set: (u) => {
387
- Array.isArray(u) && (u = u.filter((w) => w !== void 0)), r("update:modelValue", u);
292
+ const E = computed({
293
+ get: () => o.modelValue,
294
+ set: (i) => {
295
+ Array.isArray(i) && (i = i.filter((D) => D !== void 0)), r("update:modelValue", i);
388
296
  }
389
297
  });
390
- return (u, w) => (y(), B("div", {
391
- class: de(c(re))
298
+ return (i, D) => (g(), w("div", {
299
+ class: te(l(Q))
392
300
  }, [
393
- u.label ? (y(), B("label", {
301
+ i.label ? (g(), w("label", {
394
302
  key: 0,
395
- for: c(I)
396
- }, E(u.label), 9, Xe)) : O("", !0),
397
- T("div", Qe, [
398
- q(u.$slots, "before", {}, () => [
399
- c(z) ? (y(), R(G, L(D({ key: 0 }, c(S))), null, 16)) : O("", !0)
303
+ for: l(P)
304
+ }, R(i.label), 9, Ne)) : F("", !0),
305
+ j("div", _e, [
306
+ q(i.$slots, "before", {}, () => [
307
+ l(H) ? (g(), k(G, T(N({ key: 0 }, l(S))), null, 16)) : F("", !0)
400
308
  ]),
401
- fe(T("select", D({
402
- id: c(I),
309
+ oe(j("select", N({
310
+ id: l(P),
403
311
  ref_key: "select",
404
- ref: l,
405
- "onUpdate:modelValue": w[0] || (w[0] = (A) => ve(N) ? N.value = A : null)
406
- }, c(ne)), [
407
- u.placeholder ? (y(), B("option", {
312
+ ref: s,
313
+ "onUpdate:modelValue": D[0] || (D[0] = (B) => ne(E) ? E.value = B : null)
314
+ }, l(W)), [
315
+ i.placeholder ? (g(), w("option", {
408
316
  key: 0,
409
317
  value: void 0,
410
- disabled: !u.unselectable,
411
- hidden: !u.unselectable
412
- }, E(u.placeholder), 9, Ye)) : O("", !0),
413
- (y(!0), B(pe, null, me(u.options, (A, ie) => (y(), B("option", {
414
- key: ie,
415
- disabled: le(A),
416
- value: c(se)(A)
417
- }, E(c(oe)(A)), 9, xe))), 128))
418
- ], 16, We), [
419
- [ge, c(N)]
318
+ disabled: !i.unselectable,
319
+ hidden: !i.unselectable
320
+ }, R(i.placeholder), 9, Re)) : F("", !0),
321
+ (g(!0), w(re, null, ie(i.options, (B, ee) => (g(), w("option", {
322
+ key: ee,
323
+ disabled: x(B),
324
+ value: l(Z)(B)
325
+ }, R(l(Y)(B)), 9, ke))), 128))
326
+ ], 16, Ee), [
327
+ [se, l(E)]
420
328
  ]),
421
- q(u.$slots, "after", {}, () => [
422
- c(H) ? (y(), R(G, L(D({ key: 0 }, c(S))), null, 16)) : O("", !0)
329
+ q(i.$slots, "after", {}, () => [
330
+ l(M) ? (g(), k(G, T(N({ key: 0 }, l(S))), null, 16)) : F("", !0)
423
331
  ])
424
332
  ]),
425
- he(c(d), {
426
- id: c(P),
333
+ le(l(f), {
334
+ id: l(I),
427
335
  class: "vv-select__hint"
428
336
  }, null, 8, ["id"])
429
337
  ], 2));
430
338
  }
431
339
  });
432
340
  export {
433
- st as default
341
+ qe as default
434
342
  };