@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,215 +1,58 @@
1
- import { unref as a, computed as c, toRefs as T, watch as ie, defineComponent as Y, openBlock as y, createElementBlock as I, normalizeClass as ue, createElementVNode as B, toDisplayString as N, createCommentVNode as w, Fragment as de, renderList as $e, withModifiers as Te, createTextVNode as Ie, ref as j, inject as Ee, createBlock as F, mergeProps as P, h as Ke, useSlots as ke, renderSlot as J, normalizeProps as he, withDirectives as Ae, isRef as xe, vModelSelect as He, createVNode as ae, withKeys as ye, vModelText as Me } from "vue";
2
- import { nanoid as ce } from "nanoid";
3
- import { useFocus as ze, toReactive as qe, useElementVisibility as Ue, refDebounced as Ze, onClickOutside as Ge } from "@vueuse/core";
4
- import { iconExists as U, Icon as Je, addIcon as Xe } from "@iconify/vue";
5
- function X(n, t, e) {
6
- return e ? Q(n, e) === Q(t, e) : se(n, t);
7
- }
8
- function se(n, t) {
9
- if (n === t)
10
- return !0;
11
- if (n && t && typeof n == "object" && typeof t == "object") {
12
- const e = Array.isArray(n), i = Array.isArray(t);
13
- let r, u, l;
14
- if (e && i) {
15
- if (u = n.length, u != t.length)
16
- return !1;
17
- for (r = u; r-- !== 0; )
18
- if (!se(n[r], t[r]))
19
- return !1;
20
- return !0;
21
- }
22
- if (e != i)
23
- return !1;
24
- const b = n instanceof Date, m = t instanceof Date;
25
- if (b != m)
26
- return !1;
27
- if (b && m)
28
- return n.getTime() == t.getTime();
29
- const p = n instanceof RegExp, o = t instanceof RegExp;
30
- if (p != o)
31
- return !1;
32
- if (p && o)
33
- return n.toString() == t.toString();
34
- const s = Object.keys(n);
35
- if (u = s.length, u !== Object.keys(t).length)
36
- return !1;
37
- for (r = u; r-- !== 0; )
38
- if (!Object.prototype.hasOwnProperty.call(t, s[r]))
39
- return !1;
40
- for (r = u; r-- !== 0; )
41
- if (l = s[r], !se(n[l], t[l]))
42
- return !1;
43
- return !0;
44
- }
45
- return n !== n && t !== t;
46
- }
47
- function Q(n, t) {
48
- if (n && Object.keys(n).length && t) {
49
- if (t.indexOf(".") === -1)
50
- return n[t];
51
- {
52
- const e = t.split(".");
53
- let i = n;
54
- for (let r = 0, u = e.length; r < u; ++r) {
55
- if (n == null)
56
- return null;
57
- i = i[e[r]];
58
- }
59
- return i;
60
- }
61
- } else
62
- return null;
63
- }
64
- function Qe(n, t) {
65
- let e = -1;
66
- if (t) {
67
- for (let i = 0; i < t.length; i++)
68
- if (X(t[i], n)) {
69
- e = i;
70
- break;
71
- }
72
- }
73
- return e;
74
- }
75
- function Z(n, t) {
76
- if (n != null && t && t.length) {
77
- for (const e of t)
78
- if (X(n, e))
79
- return !0;
80
- }
81
- return !1;
82
- }
83
- function fe(n) {
84
- return ((t) => t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && typeof t == "object" && Object.keys(t).length === 0)(a(n));
85
- }
86
- function We(n, t) {
87
- const e = Qe(n, t);
88
- return e > -1 ? t.filter((i, r) => r !== e) : t;
89
- }
90
- function Ye(n) {
91
- return typeof n == "string" || n instanceof String;
92
- }
93
- function Ve(n) {
94
- var t, e;
95
- if (n)
96
- return (e = (t = n.match(
97
- /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
98
- )) == null ? void 0 : t.join("-")) == null ? void 0 : e.toLowerCase();
99
- }
100
- function ee(n, t) {
101
- const e = { [`${n}`]: !0 };
102
- return {
103
- bemCssClasses: c(() => Object.keys(t).reduce((r, u) => {
104
- const l = a(t[u]) || !1;
105
- if (!l)
106
- return r;
107
- if (u === "modifiers") {
108
- const b = Array.isArray(l) ? l : l.split(" ");
109
- return {
110
- ...r,
111
- ...b.reduce(
112
- (m, p) => ({
113
- ...m,
114
- [`${n}--${Ve(p)}`]: !0
115
- }),
116
- {}
117
- )
118
- };
119
- } else
120
- return {
121
- ...r,
122
- [`${n}--${Ve(u)}`]: l
123
- };
124
- }, e) || {})
125
- };
126
- }
127
- function Oe(n, t, e) {
128
- const i = c(
129
- () => !!(n != null && n.value && t.value === "left" || e != null && e.iconLeft)
130
- ), r = c(
131
- () => !!(n != null && n.value && t.value === "right" || e != null && e.iconRight)
132
- ), u = c(
133
- () => !!(n != null && n.value && t.value === "top" || e != null && e.iconTop)
134
- ), l = c(
135
- () => !!(n != null && n.value && t.value === "bottom" || e != null && e.iconBottom)
136
- );
137
- return {
138
- hasIcon: c(() => typeof (n == null ? void 0 : n.value) == "string" ? { name: n == null ? void 0 : n.value } : n == null ? void 0 : n.value),
139
- hasIconLeft: i,
140
- hasIconRight: r,
141
- hasIconTop: u,
142
- hasIconBottom: l
143
- };
144
- }
145
- function pe(n) {
146
- const { options: t, labelKey: e, valueKey: i } = T(n);
147
- return {
148
- options: t,
149
- getOptionLabel: (l) => typeof l != "object" && l !== null ? l : typeof e.value == "function" ? e.value(l) : l[e.value],
150
- getOptionValue: (l) => typeof l != "object" && l !== null ? l : typeof i.value == "function" ? i.value(l) : l[i.value]
151
- };
152
- }
153
- function we(n, t) {
154
- const { focused: e } = ze(n);
155
- return ie(e, (i) => {
156
- t(i ? "focus" : "blur", a(n));
157
- }), {
158
- focused: e
159
- };
160
- }
161
- const Ce = {
1
+ import { defineComponent as J, openBlock as f, createElementBlock as P, unref as t, normalizeClass as te, createElementVNode as O, toDisplayString as A, createCommentVNode as B, Fragment as oe, renderList as ce, withModifiers as _e, createTextVNode as pe, createBlock as L, mergeProps as N, renderSlot as U, normalizeProps as ie, withDirectives as me, isRef as fe, vModelSelect as Ie, createVNode as ee, withKeys as ue, vModelText as Be } from "vue";
2
+ import { nanoid as le } from "nanoid";
3
+ import { iconExists as z, Icon as Ce, addIcon as ke } from "@iconify/vue";
4
+ const ve = {
162
5
  valid: Boolean,
163
6
  validLabel: [String, Array]
164
- }, _e = {
7
+ }, be = {
165
8
  invalid: Boolean,
166
9
  invalidLabel: [String, Array]
167
- }, Pe = {
10
+ }, he = {
168
11
  loading: Boolean,
169
12
  loadingLabel: String
170
- }, ve = {
13
+ }, ne = {
171
14
  disabled: Boolean
172
- }, Be = {
15
+ }, ge = {
173
16
  readonly: Boolean
174
- }, me = {
17
+ }, se = {
175
18
  modifiers: [String, Array]
176
- }, Ne = {
19
+ }, ye = {
177
20
  hintLabel: { type: String, default: "" }
178
- }, ge = {
21
+ }, ae = {
179
22
  options: {
180
23
  type: Array,
181
24
  default: () => []
182
25
  },
183
26
  labelKey: { type: [String, Function], default: "label" },
184
27
  valueKey: { type: [String, Function], default: "value" }
185
- }, Se = {
28
+ }, de = {
186
29
  LEFT: "left",
187
30
  RIGHT: "right"
188
- }, De = {
31
+ }, Ve = {
189
32
  icon: { type: [String, Object] },
190
33
  iconPosition: {
191
34
  type: String,
192
- validation: (n) => Object.values(Se).includes(n),
193
- default: Se.RIGHT
35
+ validation: (y) => Object.values(de).includes(y),
36
+ default: de.RIGHT
194
37
  }
195
- }, Le = {
38
+ }, Se = {
196
39
  tabindex: { type: [String, Number], default: 0 }
197
- }, Re = {
40
+ }, $e = {
198
41
  floating: Boolean
199
- }, je = {
42
+ }, Pe = {
200
43
  unselectable: { type: Boolean, default: !0 }
201
- }, be = {
44
+ }, re = {
202
45
  id: [String, Number],
203
46
  name: { type: String, required: !0 }
204
- }, et = {
47
+ }, Ne = {
205
48
  autofocus: Boolean
206
- }, tt = {
49
+ }, Oe = {
207
50
  autocomplete: { type: String, default: "off" }
208
- }, nt = {
209
- ...be,
210
- ...ge,
211
- ...ve,
212
- ...me,
51
+ }, Ae = {
52
+ ...re,
53
+ ...ae,
54
+ ...ne,
55
+ ...se,
213
56
  modelValue: {
214
57
  type: [String, Number, Boolean, Object, Array]
215
58
  },
@@ -217,78 +60,78 @@ const Ce = {
217
60
  multiple: Boolean,
218
61
  maxValues: [Number, String],
219
62
  unselectable: { type: Boolean, default: !0 }
220
- }, lt = ["id"], rt = {
63
+ }, De = ["id"], Re = {
221
64
  key: 0,
222
65
  role: "option"
223
- }, ot = ["aria-selected"], at = ["for", "onClick"], st = ["id", "type", "value", "checked", "disabled", "name"], it = {
66
+ }, Fe = ["aria-selected"], Le = ["for", "onClick"], Ee = ["id", "type", "value", "checked", "disabled", "name"], Ke = {
224
67
  name: "VvDropdown"
225
- }, ut = /* @__PURE__ */ Y({
226
- ...it,
227
- props: nt,
68
+ }, Me = /* @__PURE__ */ J({
69
+ ...Ke,
70
+ props: Ae,
228
71
  emits: ["update:modelValue"],
229
- setup(n, { emit: t }) {
230
- const e = n, i = c(() => String(e.id || ce())), { modifiers: r, disabled: u } = T(e), { getOptionLabel: l, getOptionValue: b } = pe(e), { bemCssClasses: m } = ee("vv-dropdown", {
231
- modifiers: r,
232
- disabled: u
72
+ setup(y, { emit: r }) {
73
+ const e = y, V = computed(() => String(e.id || le())), { modifiers: d, disabled: p } = toRefs(e), { getOptionLabel: s, getOptionValue: S } = useOptions(e), { bemCssClasses: g } = useBemModifiers("vv-dropdown", {
74
+ modifiers: d,
75
+ disabled: p
233
76
  });
234
- function p(d) {
235
- return Array.isArray(e.modelValue) ? Z(d, e.modelValue) || Z(b(d), e.modelValue) : X(d, e.modelValue) || X(b(d), e.modelValue);
77
+ function c(n) {
78
+ return Array.isArray(e.modelValue) ? contains(n, e.modelValue) || contains(S(n), e.modelValue) : equals(n, e.modelValue) || equals(S(n), e.modelValue);
236
79
  }
237
- function o(d) {
238
- return typeof d == "string" || d.disabled === void 0 ? u.value : d.disabled;
80
+ function o(n) {
81
+ return typeof n == "string" || n.disabled === void 0 ? p.value : n.disabled;
239
82
  }
240
- function s(d) {
241
- var V;
83
+ function l(n) {
84
+ var v;
242
85
  if (e.disabled)
243
86
  return;
244
- let v = d;
87
+ let i = n;
245
88
  if (e.multiple)
246
89
  if (Array.isArray(e.modelValue)) {
247
- if (e.maxValues !== void 0 && e.maxValues >= 0 && ((V = e.modelValue) == null ? void 0 : V.length) >= e.maxValues && !Z(d, e.modelValue))
90
+ if (e.maxValues !== void 0 && e.maxValues >= 0 && ((v = e.modelValue) == null ? void 0 : v.length) >= e.maxValues && !contains(n, e.modelValue))
248
91
  return;
249
- v = Z(d, e.modelValue) ? We(d, e.modelValue) : [...e.modelValue, d];
92
+ i = contains(n, e.modelValue) ? removeFromList(n, e.modelValue) : [...e.modelValue, n];
250
93
  } else
251
- v = [d];
94
+ i = [n];
252
95
  else
253
- e.unselectable && d === e.modelValue && (v = void 0);
254
- t("update:modelValue", v);
96
+ e.unselectable && n === e.modelValue && (i = void 0);
97
+ r("update:modelValue", i);
255
98
  }
256
- return (d, v) => {
257
- var V;
258
- return y(), I("ul", {
259
- id: a(i),
260
- class: ue(a(m)),
99
+ return (n, i) => {
100
+ var v;
101
+ return f(), P("ul", {
102
+ id: t(V),
103
+ class: te(t(g)),
261
104
  role: "listbox"
262
105
  }, [
263
- (V = d.options) != null && V.length ? w("", !0) : (y(), I("li", rt, [
264
- B("label", null, N(d.labelNoResults), 1)
106
+ (v = n.options) != null && v.length ? B("", !0) : (f(), P("li", Re, [
107
+ O("label", null, A(n.labelNoResults), 1)
265
108
  ])),
266
- (y(!0), I(de, null, $e(d.options, (h, $) => (y(), I("li", {
109
+ (f(!0), P(oe, null, ce(n.options, (m, $) => (f(), P("li", {
267
110
  key: $,
268
111
  role: "option",
269
- "aria-selected": p(h)
112
+ "aria-selected": c(m)
270
113
  }, [
271
- B("label", {
272
- for: `dropdown-${$}-${a(i)}`,
273
- onClick: Te((A) => s(a(b)(h)), ["prevent"])
114
+ O("label", {
115
+ for: `dropdown-${$}-${t(V)}`,
116
+ onClick: _e((_) => l(t(S)(m)), ["prevent"])
274
117
  }, [
275
- B("input", {
276
- id: `dropdown-${$}-${a(i)}`,
277
- type: d.multiple ? "checkbox" : "radio",
278
- value: a(b)(h),
279
- checked: p(h),
280
- disabled: o(h),
281
- name: d.name,
118
+ O("input", {
119
+ id: `dropdown-${$}-${t(V)}`,
120
+ type: n.multiple ? "checkbox" : "radio",
121
+ value: t(S)(m),
122
+ checked: c(m),
123
+ disabled: o(m),
124
+ name: n.name,
282
125
  tabindex: "-1",
283
126
  "aria-hidden": "true"
284
- }, null, 8, st),
285
- Ie(" " + N(a(l)(h)), 1)
286
- ], 8, at)
287
- ], 8, ot))), 128))
288
- ], 10, lt);
127
+ }, null, 8, Ee),
128
+ pe(" " + A(t(s)(m)), 1)
129
+ ], 8, Le)
130
+ ], 8, Fe))), 128))
131
+ ], 10, De);
289
132
  };
290
133
  }
291
- }), dt = "ds", ct = {
134
+ }), Te = "ds", He = {
292
135
  color: String,
293
136
  width: {
294
137
  type: [String, Number]
@@ -319,45 +162,45 @@ const Ce = {
319
162
  modifiers: {
320
163
  type: [String, Array]
321
164
  }
322
- }, ft = {
165
+ }, je = {
323
166
  name: "VvIcon"
324
- }, W = /* @__PURE__ */ Y({
325
- ...ft,
326
- props: ct,
327
- setup(n) {
328
- const t = n, e = j(!0), { modifiers: i } = T(t), r = Ee(dt), { bemCssClasses: u } = ee("vv-icon", {
329
- modifiers: i
330
- }), l = c(() => t.provider || (r == null ? void 0 : r.provider)), b = c(() => {
331
- const o = t.name ?? "", s = `@${l.value}:${t.prefix}:${t.name}`;
332
- return U(o) ? o : U(s) ? s : (r == null ? void 0 : r.iconsCollections.find((d) => {
333
- const v = `@${l.value}:${d.prefix}:${o}`;
334
- if (U(v))
335
- return v;
167
+ }, G = /* @__PURE__ */ J({
168
+ ...je,
169
+ props: He,
170
+ setup(y) {
171
+ const r = y, e = ref(!0), { modifiers: V } = toRefs(r), d = inject(Te), { bemCssClasses: p } = useBemModifiers("vv-icon", {
172
+ modifiers: V
173
+ }), s = computed(() => r.provider || (d == null ? void 0 : d.provider)), S = computed(() => {
174
+ const o = r.name ?? "", l = `@${s.value}:${r.prefix}:${r.name}`;
175
+ return z(o) ? o : z(l) ? l : (d == null ? void 0 : d.iconsCollections.find((n) => {
176
+ const i = `@${s.value}:${n.prefix}:${o}`;
177
+ if (z(i))
178
+ return i;
336
179
  })) || o;
337
180
  });
338
- function m(o) {
339
- let s = null;
181
+ function g(o) {
182
+ let l = null;
340
183
  if (typeof window > "u") {
341
- const { JSDOM: h } = require("jsdom");
342
- s = new h().window;
184
+ const { JSDOM: m } = require("jsdom");
185
+ l = new m().window;
343
186
  }
344
- return (s ? new s.DOMParser() : new window.DOMParser()).parseFromString(o, "text/html").querySelector("svg");
187
+ return (l ? new l.DOMParser() : new window.DOMParser()).parseFromString(o, "text/html").querySelector("svg");
345
188
  }
346
- function p(o) {
347
- const s = m(o), d = (s == null ? void 0 : s.innerHTML.trim()) || "";
348
- s && d && Xe(`@${l.value}:${t.prefix}:${t.name}`, {
349
- body: d,
350
- height: s.viewBox.baseVal.height,
351
- width: s.viewBox.baseVal.width
189
+ function c(o) {
190
+ const l = g(o), n = (l == null ? void 0 : l.innerHTML.trim()) || "";
191
+ l && n && ke(`@${s.value}:${r.prefix}:${r.name}`, {
192
+ body: n,
193
+ height: l.viewBox.baseVal.height,
194
+ width: l.viewBox.baseVal.width
352
195
  });
353
196
  }
354
- return r && (t.src && !U(`@${l.value}:${t.prefix}:${t.name}`) ? (e.value = !1, r.fetchIcon(t.src).then((o) => {
355
- o && (p(o), e.value = !0);
197
+ return d && (r.src && !z(`@${s.value}:${r.prefix}:${r.name}`) ? (e.value = !1, d.fetchIcon(r.src).then((o) => {
198
+ o && (c(o), e.value = !0);
356
199
  }).catch((o) => {
357
200
  throw new Error(`During fetch icon: ${o == null ? void 0 : o.message}`);
358
- })) : t.svg && p(t.svg)), (o, s) => e.value ? (y(), F(a(Je), P({
201
+ })) : r.svg && c(r.svg)), (o, l) => t(e) ? (f(), L(t(Ce), N({
359
202
  key: 0,
360
- class: a(u)
203
+ class: t(p)
361
204
  }, {
362
205
  inline: o.inline,
363
206
  width: o.width,
@@ -368,41 +211,41 @@ const Ce = {
368
211
  rotate: o.rotate,
369
212
  color: o.color,
370
213
  onLoad: o.onLoad,
371
- icon: a(b)
372
- }), null, 16, ["class"])) : w("", !0);
214
+ icon: t(S)
215
+ }), null, 16, ["class"])) : B("", !0);
373
216
  }
374
217
  });
375
- function G(n) {
376
- return Array.isArray(n) ? n.filter((t) => Ye(t)).join(" ") : n;
218
+ function x(y) {
219
+ return Array.isArray(y) ? y.filter((r) => isString(r)).join(" ") : y;
377
220
  }
378
- function Fe(n, t) {
221
+ function we(y, r) {
379
222
  const {
380
223
  invalid: e,
381
- valid: i,
382
- hint: r,
383
- loading: u
384
- } = t, {
385
- hintLabel: l,
386
- modelValue: b,
387
- valid: m,
388
- validLabel: p,
224
+ valid: V,
225
+ hint: d,
226
+ loading: p
227
+ } = r, {
228
+ hintLabel: s,
229
+ modelValue: S,
230
+ valid: g,
231
+ validLabel: c,
389
232
  invalid: o,
390
- invalidLabel: s,
391
- ...d
392
- } = T(n), v = Q(d, "loading"), V = Q(d, "loadingLabel"), h = c(() => o.value ? !!(o.value && e || s != null && s.value && Array.isArray(s.value) && s.value.length > 0 || s != null && s.value && !fe(s)) : !1), $ = c(
393
- () => !!(l && l.value || r)
394
- ), A = c(
395
- () => !!(p && p.value || i)
396
- ), O = c(
397
- () => !!(v != null && v.value && u || v != null && v.value && (V != null && V.value))
398
- ), C = c(
399
- () => $.value || A.value || h.value || O.value
233
+ invalidLabel: l,
234
+ ...n
235
+ } = toRefs(y), i = resolveFieldData(n, "loading"), v = resolveFieldData(n, "loadingLabel"), m = computed(() => o.value ? !!(o.value && e || l != null && l.value && Array.isArray(l.value) && l.value.length > 0 || l != null && l.value && !isEmpty(l)) : !1), $ = computed(
236
+ () => !!(s && s.value || d)
237
+ ), _ = computed(
238
+ () => !!(c && c.value || V)
239
+ ), I = computed(
240
+ () => !!(i != null && i.value && p || i != null && i.value && (v != null && v.value))
241
+ ), C = computed(
242
+ () => $.value || _.value || m.value || I.value
400
243
  );
401
244
  return {
402
- hasInvalid: h,
245
+ hasInvalid: m,
403
246
  hasHint: $,
404
- hasValid: A,
405
- hasLoading: O,
247
+ hasValid: _,
248
+ hasLoading: I,
406
249
  HintSlot: {
407
250
  name: "HintSlot",
408
251
  props: {
@@ -412,30 +255,30 @@ function Fe(n, t) {
412
255
  }
413
256
  },
414
257
  setup(D) {
415
- const L = c(() => {
416
- const k = qe({
417
- hintLabel: l,
418
- modelValue: b,
419
- valid: m,
420
- validLabel: p,
258
+ const R = computed(() => {
259
+ const w = toReactive({
260
+ hintLabel: s,
261
+ modelValue: S,
262
+ valid: g,
263
+ validLabel: c,
421
264
  invalid: o,
422
- invalidLabel: s,
423
- loading: v,
424
- loadingLabel: V,
265
+ invalidLabel: l,
266
+ loading: i,
267
+ loadingLabel: v,
425
268
  ...D.params
426
269
  });
427
- return o != null && o.value ? (e == null ? void 0 : e(k)) || G(s == null ? void 0 : s.value) || (l == null ? void 0 : l.value) : m != null && m.value ? (i == null ? void 0 : i(k)) || G(p == null ? void 0 : p.value) || (l == null ? void 0 : l.value) : v != null && v.value ? (u == null ? void 0 : u(k)) || G(V == null ? void 0 : V.value) || (l == null ? void 0 : l.value) : (r == null ? void 0 : r(k)) || G(l == null ? void 0 : l.value) || (l == null ? void 0 : l.value);
270
+ return o != null && o.value ? (e == null ? void 0 : e(w)) || x(l == null ? void 0 : l.value) || (s == null ? void 0 : s.value) : g != null && g.value ? (V == null ? void 0 : V(w)) || x(c == null ? void 0 : c.value) || (s == null ? void 0 : s.value) : i != null && i.value ? (p == null ? void 0 : p(w)) || x(v == null ? void 0 : v.value) || (s == null ? void 0 : s.value) : (d == null ? void 0 : d(w)) || x(s == null ? void 0 : s.value) || (s == null ? void 0 : s.value);
428
271
  });
429
272
  return {
430
273
  isVisible: C,
431
- hasInvalid: h,
432
- hasValid: A,
433
- hintContent: L
274
+ hasInvalid: m,
275
+ hasValid: _,
276
+ hintContent: R
434
277
  };
435
278
  },
436
279
  render() {
437
280
  if (this.isVisible)
438
- return Ke(
281
+ return h(
439
282
  "small",
440
283
  {
441
284
  role: this.hasInvalid || this.hasValid ? "alert" : void 0
@@ -446,22 +289,22 @@ function Fe(n, t) {
446
289
  }
447
290
  };
448
291
  }
449
- const pt = {
450
- ...be,
451
- ...et,
452
- ...tt,
453
- ...Le,
454
- ...Ce,
455
- ..._e,
292
+ const qe = {
293
+ ...re,
456
294
  ...Ne,
457
- ...Pe,
295
+ ...Oe,
296
+ ...Se,
458
297
  ...ve,
459
- ...Be,
460
- ...me,
298
+ ...be,
299
+ ...ye,
300
+ ...he,
301
+ ...ne,
461
302
  ...ge,
462
- ...De,
463
- ...Re,
464
- ...je,
303
+ ...se,
304
+ ...ae,
305
+ ...Ve,
306
+ ...$e,
307
+ ...Pe,
465
308
  multiple: Boolean,
466
309
  required: Boolean,
467
310
  size: [String, Number],
@@ -471,130 +314,130 @@ const pt = {
471
314
  },
472
315
  label: String,
473
316
  placeholder: String
474
- }, vt = ["update:modelValue", "focus", "blur"], mt = ["for"], gt = { class: "vv-select__wrapper" }, bt = ["id"], ht = ["disabled", "hidden"], yt = ["disabled", "value"], Vt = {
317
+ }, ze = ["update:modelValue", "focus", "blur"], xe = ["for"], Ue = { class: "vv-select__wrapper" }, Ge = ["id"], Je = ["disabled", "hidden"], Xe = ["disabled", "value"], Qe = {
475
318
  name: "VvSelect"
476
- }, St = /* @__PURE__ */ Y({
477
- ...Vt,
478
- props: pt,
479
- emits: vt,
480
- setup(n, { emit: t }) {
481
- const e = n, i = ke(), r = j(), { HintSlot: u, hasHint: l, hasInvalid: b } = Fe(e, i), {
482
- modifiers: m,
483
- disabled: p,
319
+ }, We = /* @__PURE__ */ J({
320
+ ...Qe,
321
+ props: qe,
322
+ emits: ze,
323
+ setup(y, { emit: r }) {
324
+ const e = y, V = useSlots(), d = ref(), { HintSlot: p, hasHint: s, hasInvalid: S } = we(e, V), {
325
+ modifiers: g,
326
+ disabled: c,
484
327
  readonly: o,
485
- loading: s,
486
- icon: d,
487
- iconPosition: v,
488
- invalid: V,
489
- valid: h,
328
+ loading: l,
329
+ icon: n,
330
+ iconPosition: i,
331
+ invalid: v,
332
+ valid: m,
490
333
  floating: $,
491
- multiple: A
492
- } = T(e), O = c(() => String(e.id || ce())), C = c(() => `${O.value}-hint`), { focused: D } = we(r, t), L = Ue(r);
493
- ie(L, (g) => {
494
- g && e.autofocus && (D.value = !0);
334
+ multiple: _
335
+ } = toRefs(e), I = computed(() => String(e.id || le())), C = computed(() => `${I.value}-hint`), { focused: D } = useComponentFocus(d, r), R = useElementVisibility(d);
336
+ watch(R, (u) => {
337
+ u && e.autofocus && (D.value = !0);
495
338
  });
496
- const { hasIcon: k, hasIconLeft: E, hasIconRight: x } = Oe(
497
- d,
498
- v
499
- ), H = c(() => !fe(e.modelValue)), M = c(() => e.disabled || e.readonly), z = c(() => M.value ? -1 : e.tabindex), q = c(() => {
339
+ const { hasIcon: w, hasIconLeft: E, hasIconRight: M } = useComponentIcon(
340
+ n,
341
+ i
342
+ ), T = computed(() => !isEmpty(e.modelValue)), H = computed(() => e.disabled || e.readonly), j = computed(() => H.value ? -1 : e.tabindex), q = computed(() => {
500
343
  if (e.invalid === !0)
501
344
  return !0;
502
345
  if (e.valid === !0)
503
346
  return !1;
504
- }), { bemCssClasses: te } = ee("vv-select", {
505
- modifiers: m,
506
- valid: h,
507
- invalid: V,
508
- loading: s,
509
- disabled: p,
347
+ }), { bemCssClasses: X } = useBemModifiers("vv-select", {
348
+ modifiers: g,
349
+ valid: m,
350
+ invalid: v,
351
+ loading: l,
352
+ disabled: c,
510
353
  readonly: o,
511
354
  iconLeft: E,
512
- iconRight: x,
513
- dirty: H,
355
+ iconRight: M,
356
+ dirty: T,
514
357
  focus: D,
515
358
  floating: $,
516
- multiple: A
517
- }), ne = c(() => ({
359
+ multiple: _
360
+ }), Q = computed(() => ({
518
361
  name: e.name,
519
- tabindex: z.value,
520
- disabled: M.value,
362
+ tabindex: j.value,
363
+ disabled: H.value,
521
364
  required: e.required,
522
365
  size: e.size,
523
366
  autocomplete: e.autocomplete,
524
367
  multiple: e.multiple,
525
368
  "aria-invalid": q.value,
526
- "aria-describedby": !b.value && l.value ? C.value : void 0,
527
- "aria-errormessage": b.value ? C.value : void 0
528
- })), { getOptionLabel: le, getOptionValue: re } = pe(e);
529
- function oe(g) {
530
- return typeof g == "string" || g.disabled === void 0 ? p.value : g.disabled;
369
+ "aria-describedby": !S.value && s.value ? C.value : void 0,
370
+ "aria-errormessage": S.value ? C.value : void 0
371
+ })), { getOptionLabel: W, getOptionValue: Y } = useOptions(e);
372
+ function Z(u) {
373
+ return typeof u == "string" || u.disabled === void 0 ? c.value : u.disabled;
531
374
  }
532
- const K = c({
375
+ const K = computed({
533
376
  get: () => e.modelValue,
534
- set: (g) => {
535
- Array.isArray(g) && (g = g.filter((R) => R !== void 0)), t("update:modelValue", g);
377
+ set: (u) => {
378
+ Array.isArray(u) && (u = u.filter((F) => F !== void 0)), r("update:modelValue", u);
536
379
  }
537
380
  });
538
- return (g, R) => (y(), I("div", {
539
- class: ue(a(te))
381
+ return (u, F) => (f(), P("div", {
382
+ class: te(t(X))
540
383
  }, [
541
- g.label ? (y(), I("label", {
384
+ u.label ? (f(), P("label", {
542
385
  key: 0,
543
- for: a(O)
544
- }, N(g.label), 9, mt)) : w("", !0),
545
- B("div", gt, [
546
- J(g.$slots, "before", {}, () => [
547
- a(E) ? (y(), F(W, he(P({ key: 0 }, a(k))), null, 16)) : w("", !0)
386
+ for: t(I)
387
+ }, A(u.label), 9, xe)) : B("", !0),
388
+ O("div", Ue, [
389
+ U(u.$slots, "before", {}, () => [
390
+ t(E) ? (f(), L(G, ie(N({ key: 0 }, t(w))), null, 16)) : B("", !0)
548
391
  ]),
549
- Ae(B("select", P({
550
- id: a(O),
392
+ me(O("select", N({
393
+ id: t(I),
551
394
  ref_key: "select",
552
- ref: r,
553
- "onUpdate:modelValue": R[0] || (R[0] = (f) => xe(K) ? K.value = f : null)
554
- }, a(ne)), [
555
- g.placeholder ? (y(), I("option", {
395
+ ref: d,
396
+ "onUpdate:modelValue": F[0] || (F[0] = (a) => fe(K) ? K.value = a : null)
397
+ }, t(Q)), [
398
+ u.placeholder ? (f(), P("option", {
556
399
  key: 0,
557
400
  value: void 0,
558
- disabled: !g.unselectable,
559
- hidden: !g.unselectable
560
- }, N(g.placeholder), 9, ht)) : w("", !0),
561
- (y(!0), I(de, null, $e(g.options, (f, S) => (y(), I("option", {
562
- key: S,
563
- disabled: oe(f),
564
- value: a(re)(f)
565
- }, N(a(le)(f)), 9, yt))), 128))
566
- ], 16, bt), [
567
- [He, a(K)]
401
+ disabled: !u.unselectable,
402
+ hidden: !u.unselectable
403
+ }, A(u.placeholder), 9, Je)) : B("", !0),
404
+ (f(!0), P(oe, null, ce(u.options, (a, b) => (f(), P("option", {
405
+ key: b,
406
+ disabled: Z(a),
407
+ value: t(Y)(a)
408
+ }, A(t(W)(a)), 9, Xe))), 128))
409
+ ], 16, Ge), [
410
+ [Ie, t(K)]
568
411
  ]),
569
- J(g.$slots, "after", {}, () => [
570
- a(x) ? (y(), F(W, he(P({ key: 0 }, a(k))), null, 16)) : w("", !0)
412
+ U(u.$slots, "after", {}, () => [
413
+ t(M) ? (f(), L(G, ie(N({ key: 0 }, t(w))), null, 16)) : B("", !0)
571
414
  ])
572
415
  ]),
573
- ae(a(u), {
574
- id: a(C),
416
+ ee(t(p), {
417
+ id: t(C),
575
418
  class: "vv-select__hint"
576
419
  }, null, 8, ["id"])
577
420
  ], 2));
578
421
  }
579
- }), $t = [
422
+ }), Ye = [
580
423
  "update:modelValue",
581
424
  "change:search",
582
425
  "focus",
583
426
  "blur"
584
- ], It = {
585
- ...be,
586
- ...Le,
587
- ...Ce,
588
- ..._e,
589
- ...Ne,
590
- ...Pe,
427
+ ], Ze = {
428
+ ...re,
429
+ ...Se,
591
430
  ...ve,
592
- ...Be,
593
- ...me,
431
+ ...be,
432
+ ...ye,
433
+ ...he,
434
+ ...ne,
594
435
  ...ge,
595
- ...De,
596
- ...Re,
597
- ...je,
436
+ ...se,
437
+ ...ae,
438
+ ...Ve,
439
+ ...$e,
440
+ ...Pe,
598
441
  modelValue: {
599
442
  type: [String, Number, Boolean, Object, Array],
600
443
  default: void 0
@@ -612,70 +455,70 @@ const pt = {
612
455
  maxValues: [Number, String],
613
456
  separator: { type: String, default: ", " },
614
457
  native: Boolean
615
- }, kt = ["id"], At = ["id", "for"], Ot = ["tabindex"], wt = ["id", "placeholder"], Ct = {
458
+ }, et = ["id"], tt = ["id", "for"], ot = ["tabindex"], lt = ["id", "placeholder"], nt = {
616
459
  name: "VvCombobox"
617
- }, Dt = /* @__PURE__ */ Y({
618
- ...Ct,
619
- props: It,
620
- emits: $t,
621
- setup(n, { emit: t }) {
622
- const e = n, i = ke(), { HintSlot: r } = Fe(e, i), u = j(), l = j(), { focused: b } = we(u, t), m = c(() => String(e.id || ce())), p = j(""), o = Ze(
623
- p,
460
+ }, it = /* @__PURE__ */ J({
461
+ ...nt,
462
+ props: Ze,
463
+ emits: Ye,
464
+ setup(y, { emit: r }) {
465
+ const e = y, V = useSlots(), { HintSlot: d } = we(e, V), p = ref(), s = ref(), { focused: S } = useComponentFocus(p, r), g = computed(() => String(e.id || le())), c = ref(""), o = refDebounced(
466
+ c,
624
467
  Number(e.debounceSearch)
625
- ), s = j(!1), {
626
- icon: d,
627
- iconPosition: v,
628
- modifiers: V,
629
- disabled: h,
468
+ ), l = ref(!1), {
469
+ icon: n,
470
+ iconPosition: i,
471
+ modifiers: v,
472
+ disabled: m,
630
473
  readonly: $,
631
- loading: A,
632
- valid: O,
474
+ loading: _,
475
+ valid: I,
633
476
  invalid: C,
634
477
  floating: D
635
- } = T(e);
636
- ie(
478
+ } = toRefs(e);
479
+ watch(
637
480
  o,
638
- () => t("change:search", o.value)
481
+ () => r("change:search", o.value)
639
482
  );
640
- const { hasIcon: L, hasIconLeft: k, hasIconRight: E } = Oe(
641
- d,
642
- v
643
- ), x = c(() => !fe(e.modelValue)), H = c(() => h.value || $.value ? -1 : e.tabindex), { bemCssClasses: M } = ee("vv-select", {
644
- modifiers: V,
645
- disabled: h,
646
- loading: A,
483
+ const { hasIcon: R, hasIconLeft: w, hasIconRight: E } = useComponentIcon(
484
+ n,
485
+ i
486
+ ), M = computed(() => !isEmpty(e.modelValue)), T = computed(() => m.value || $.value ? -1 : e.tabindex), { bemCssClasses: H } = useBemModifiers("vv-select", {
487
+ modifiers: v,
488
+ disabled: m,
489
+ loading: _,
647
490
  readonly: $,
648
- iconLeft: k,
491
+ iconLeft: w,
649
492
  iconRight: E,
650
- valid: O,
493
+ valid: I,
651
494
  invalid: C,
652
- dirty: x,
653
- focus: b,
495
+ dirty: M,
496
+ focus: S,
654
497
  floating: D
655
- }), z = c(
656
- () => e.searchable ? ne.value : e.options
657
- ), { getOptionLabel: q, getOptionValue: te } = pe(e), ne = c(() => {
658
- var f;
659
- return (f = e.options) == null ? void 0 : f.filter((S) => q(S).toLowerCase().includes(o.value.toLowerCase().trim()));
660
- }), le = c(() => {
661
- let f = [];
662
- return Array.isArray(e.modelValue) ? f = e.modelValue : e.modelValue && (f = [e.modelValue]), e.options.filter(
663
- (S) => f.includes(te(S))
498
+ }), j = computed(
499
+ () => e.searchable ? Q.value : e.options
500
+ ), { getOptionLabel: q, getOptionValue: X } = useOptions(e), Q = computed(() => {
501
+ var a;
502
+ return (a = e.options) == null ? void 0 : a.filter((b) => q(b).toLowerCase().includes(o.value.toLowerCase().trim()));
503
+ }), W = computed(() => {
504
+ let a = [];
505
+ return Array.isArray(e.modelValue) ? a = e.modelValue : e.modelValue && (a = [e.modelValue]), e.options.filter(
506
+ (b) => a.includes(X(b))
664
507
  );
665
- }), re = c(() => le.value.map((f) => q(f)).join(e.separator));
666
- Ge(u, () => {
667
- u.value.open = !1;
508
+ }), Y = computed(() => W.value.map((a) => q(a)).join(e.separator));
509
+ onClickOutside(p, () => {
510
+ p.value.open = !1;
668
511
  });
669
- function oe(f) {
670
- const S = f.target;
671
- s.value = S.open;
512
+ function Z(a) {
513
+ const b = a.target;
514
+ l.value = b.open;
672
515
  }
673
- function K(f) {
674
- u.value && !e.multiple && (u.value.open = !1), t("update:modelValue", f);
516
+ function K(a) {
517
+ p.value && !e.multiple && (p.value.open = !1), r("update:modelValue", a);
675
518
  }
676
- const g = c(() => ({
519
+ const u = computed(() => ({
677
520
  name: e.name,
678
- options: z.value,
521
+ options: j.value,
679
522
  labelKey: e.labelKey,
680
523
  valueKey: e.valueKey,
681
524
  disabled: e.disabled,
@@ -684,21 +527,21 @@ const pt = {
684
527
  maxValues: e.maxValues,
685
528
  modelValue: e.modelValue,
686
529
  unselectable: e.unselectable
687
- })), R = c(() => ({
688
- id: m.value,
530
+ })), F = computed(() => ({
531
+ id: g.value,
689
532
  name: e.name,
690
- tabindex: H.value,
691
- valid: O.value,
533
+ tabindex: T.value,
534
+ valid: I.value,
692
535
  validLabel: e.validLabel,
693
536
  invalid: C.value,
694
537
  invalidLabel: e.invalidLabel,
695
538
  hintLabel: e.hintLabel,
696
- loading: A.value,
539
+ loading: _.value,
697
540
  loadingLabel: e.loadingLabel,
698
- disabled: h.value,
541
+ disabled: m.value,
699
542
  readonly: $.value,
700
543
  modifiers: e.modifiers,
701
- options: z.value,
544
+ options: j.value,
702
545
  labelKey: e.labelKey,
703
546
  valueKey: e.valueKey,
704
547
  icon: e.icon,
@@ -710,66 +553,66 @@ const pt = {
710
553
  placeholder: e.placeholder,
711
554
  modelValue: e.modelValue
712
555
  }));
713
- return (f, S) => f.native ? (y(), F(St, P({ key: 1 }, a(R), {
714
- "onUpdate:modelValue": S[4] || (S[4] = (_) => t("update:modelValue", _))
715
- }), null, 16)) : (y(), I("div", {
556
+ return (a, b) => a.native ? (f(), L(We, N({ key: 1 }, t(F), {
557
+ "onUpdate:modelValue": b[4] || (b[4] = (k) => r("update:modelValue", k))
558
+ }), null, 16)) : (f(), P("div", {
716
559
  key: 0,
717
- id: a(m),
718
- class: ue(a(M))
560
+ id: t(g),
561
+ class: te(t(H))
719
562
  }, [
720
- f.label ? (y(), I("label", {
563
+ a.label ? (f(), P("label", {
721
564
  key: 0,
722
- id: `${a(m)}-label`,
723
- for: f.searchable && s.value ? `${a(m)}-input` : void 0
724
- }, N(f.label), 9, At)) : w("", !0),
725
- B("details", {
565
+ id: `${t(g)}-label`,
566
+ for: a.searchable && t(l) ? `${t(g)}-input` : void 0
567
+ }, A(a.label), 9, tt)) : B("", !0),
568
+ O("details", {
726
569
  ref_key: "dropdown",
727
- ref: u,
570
+ ref: p,
728
571
  class: "vv-select__wrapper",
729
- onClick: S[2] || (S[2] = (_) => a(h) || a($) ? _.preventDefault() : null),
730
- onKeyup: S[3] || (S[3] = ye((_) => u.value.open = !1, ["esc"])),
731
- onToggle: oe
572
+ onClick: b[2] || (b[2] = (k) => t(m) || t($) ? k.preventDefault() : null),
573
+ onKeyup: b[3] || (b[3] = ue((k) => t(p).open = !1, ["esc"])),
574
+ onToggle: Z
732
575
  }, [
733
- B("summary", {
576
+ O("summary", {
734
577
  class: "vv-select__input",
735
- tabindex: a(H),
736
- onKeyup: S[1] || (S[1] = ye((_) => f.searchable ? _.preventDefault() : null, ["space"]))
578
+ tabindex: t(T),
579
+ onKeyup: b[1] || (b[1] = ue((k) => a.searchable ? k.preventDefault() : null, ["space"]))
737
580
  }, [
738
- J(f.$slots, "before", {}, () => [
739
- a(k) ? (y(), F(W, P({
581
+ U(a.$slots, "before", {}, () => [
582
+ t(w) ? (f(), L(G, N({
740
583
  key: 0,
741
584
  class: "vv-select__icon-left"
742
- }, a(L)), null, 16)) : w("", !0)
585
+ }, t(R)), null, 16)) : B("", !0)
743
586
  ]),
744
- f.searchable && s.value ? Ae((y(), I("input", {
587
+ a.searchable && t(l) ? me((f(), P("input", {
745
588
  key: 0,
746
- id: `${a(m)}-input`,
589
+ id: `${t(g)}-input`,
747
590
  ref_key: "inputSearch",
748
- ref: l,
749
- "onUpdate:modelValue": S[0] || (S[0] = (_) => p.value = _),
591
+ ref: s,
592
+ "onUpdate:modelValue": b[0] || (b[0] = (k) => fe(c) ? c.value = k : null),
750
593
  role: "combobox",
751
594
  type: "search",
752
- placeholder: f.searchPlaceholder
753
- }, null, 8, wt)), [
754
- [Me, p.value]
755
- ]) : (y(), I(de, { key: 1 }, [
756
- Ie(N(a(re) || f.placeholder), 1)
595
+ placeholder: a.searchPlaceholder
596
+ }, null, 8, lt)), [
597
+ [Be, t(c)]
598
+ ]) : (f(), P(oe, { key: 1 }, [
599
+ pe(A(t(Y) || a.placeholder), 1)
757
600
  ], 64)),
758
- J(f.$slots, "after", {}, () => [
759
- a(E) ? (y(), F(W, P({
601
+ U(a.$slots, "after", {}, () => [
602
+ t(E) ? (f(), L(G, N({
760
603
  key: 0,
761
604
  class: "vv-select__icon-right"
762
- }, a(L)), null, 16)) : w("", !0)
605
+ }, t(R)), null, 16)) : B("", !0)
763
606
  ])
764
- ], 40, Ot),
765
- ae(ut, P({
766
- id: `${a(m)}-dropdown`
767
- }, a(g), { "onUpdate:modelValue": K }), null, 16, ["id"])
607
+ ], 40, ot),
608
+ ee(Me, N({
609
+ id: `${t(g)}-dropdown`
610
+ }, t(u), { "onUpdate:modelValue": K }), null, 16, ["id"])
768
611
  ], 544),
769
- ae(a(r), { class: "vv-select__hint" })
770
- ], 10, kt));
612
+ ee(t(d), { class: "vv-select__hint" })
613
+ ], 10, et));
771
614
  }
772
615
  });
773
616
  export {
774
- Dt as default
617
+ it as default
775
618
  };