@volverjs/ui-vue 0.0.3 → 0.0.4

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 (145) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +52 -13
  3. package/dist/Volver.d.ts +5 -1
  4. package/dist/components/VvAccordion/VvAccordion.es.js +113 -66
  5. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  6. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +159 -101
  7. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  8. package/dist/components/VvAction/VvAction.es.js +170 -0
  9. package/dist/components/VvAction/VvAction.umd.js +1 -0
  10. package/dist/components/VvAction/VvAction.vue.d.ts +63 -0
  11. package/dist/components/VvAction/index.d.ts +24 -0
  12. package/dist/components/VvBadge/VvBadge.es.js +86 -16
  13. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  14. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +97 -41
  15. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  16. package/dist/components/VvButton/VvButton.es.js +434 -251
  17. package/dist/components/VvButton/VvButton.umd.js +1 -1
  18. package/dist/components/VvButton/VvButton.vue.d.ts +50 -50
  19. package/dist/components/VvButton/index.d.ts +22 -67
  20. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +118 -43
  21. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  22. package/dist/components/VvCard/VvCard.es.js +38 -25
  23. package/dist/components/VvCard/VvCard.umd.js +1 -1
  24. package/dist/components/VvCheckbox/VvCheckbox.es.js +334 -154
  25. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  26. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +2 -2
  27. package/dist/components/VvCheckbox/index.d.ts +1 -1
  28. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +401 -204
  29. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  30. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +2 -2
  31. package/dist/components/VvCheckboxGroup/index.d.ts +1 -1
  32. package/dist/components/VvCombobox/VvCombobox.es.js +950 -594
  33. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  34. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +54 -30
  35. package/dist/components/VvCombobox/index.d.ts +18 -13
  36. package/dist/components/VvDialog/VvDialog.es.js +139 -64
  37. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  38. package/dist/components/VvDropdown/VvDropdown.es.js +276 -158
  39. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  40. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +9 -9
  41. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +61 -0
  42. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +52 -0
  43. package/dist/components/VvDropdown/index.d.ts +6 -9
  44. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +251 -0
  45. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -0
  46. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +30 -15
  47. package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
  48. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +176 -0
  49. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -0
  50. package/dist/components/VvIcon/VvIcon.es.js +48 -32
  51. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  52. package/dist/components/VvInputText/VvInputText.es.js +508 -344
  53. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  54. package/dist/components/VvInputText/VvInputText.vue.d.ts +11 -4
  55. package/dist/components/VvInputText/index.d.ts +13 -2
  56. package/dist/components/VvProgress/VvProgress.es.js +90 -20
  57. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  58. package/dist/components/VvRadio/VvRadio.es.js +305 -125
  59. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  60. package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
  61. package/dist/components/VvRadio/index.d.ts +1 -1
  62. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +372 -175
  63. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  64. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +2 -2
  65. package/dist/components/VvRadioGroup/index.d.ts +1 -1
  66. package/dist/components/VvSelect/VvSelect.es.js +371 -216
  67. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  68. package/dist/components/VvSelect/VvSelect.vue.d.ts +11 -4
  69. package/dist/components/VvSelect/index.d.ts +5 -5
  70. package/dist/components/VvTextarea/VvTextarea.es.js +408 -244
  71. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  72. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +11 -4
  73. package/dist/components/VvTextarea/index.d.ts +5 -5
  74. package/dist/components/VvTooltip/VvTooltip.es.js +88 -18
  75. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  76. package/dist/components/index.es.js +1913 -1521
  77. package/dist/components/index.umd.js +1 -1
  78. package/dist/composables/dropdown/useInjectDropdown.d.ts +1 -1
  79. package/dist/composables/dropdown/useProvideDropdown.d.ts +2 -2
  80. package/dist/constants.d.ts +30 -0
  81. package/dist/directives/index.es.js +128 -0
  82. package/dist/directives/index.umd.js +1 -0
  83. package/dist/directives/v-tooltip.es.js +126 -0
  84. package/dist/directives/v-tooltip.umd.js +1 -0
  85. package/dist/icons.es.js +3 -3
  86. package/dist/icons.umd.js +1 -1
  87. package/dist/index.es.js +2102 -1761
  88. package/dist/index.umd.js +1 -1
  89. package/dist/props/index.d.ts +179 -11
  90. package/dist/resolvers/unplugin.d.ts +8 -8
  91. package/dist/resolvers/unplugin.es.js +51 -30
  92. package/dist/resolvers/unplugin.umd.js +1 -1
  93. package/dist/stories/Combobox/Combobox.settings.d.ts +44 -0
  94. package/dist/stories/Dropdown/Dropdown.settings.d.ts +3 -2
  95. package/package.json +60 -34
  96. package/src/Volver.ts +12 -5
  97. package/src/assets/icons/detailed.json +1 -1
  98. package/src/assets/icons/normal.json +1 -1
  99. package/src/assets/icons/simple.json +1 -1
  100. package/src/components/VvAction/VvAction.vue +144 -0
  101. package/src/components/VvAction/index.ts +5 -0
  102. package/src/components/VvButton/VvButton.vue +31 -114
  103. package/src/components/VvButton/index.ts +6 -79
  104. package/src/components/VvCombobox/VvCombobox.vue +54 -42
  105. package/src/components/VvCombobox/index.ts +11 -9
  106. package/src/components/VvDropdown/VvDropdownAction.vue +44 -0
  107. package/src/components/VvDropdown/VvDropdownOption.vue +65 -0
  108. package/src/components/VvDropdown/index.ts +4 -9
  109. package/src/components/VvSelect/index.ts +2 -4
  110. package/src/composables/dropdown/useInjectDropdown.ts +1 -1
  111. package/src/composables/dropdown/useProvideDropdown.ts +7 -9
  112. package/src/composables/useModifiers.ts +4 -7
  113. package/src/constants.ts +36 -0
  114. package/src/props/index.ts +106 -14
  115. package/src/resolvers/unplugin.ts +81 -48
  116. package/src/stories/Accordion/AccordionSlots.stories.mdx +2 -2
  117. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +2 -1
  118. package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +2 -1
  119. package/src/stories/Button/Button.stories.mdx +4 -2
  120. package/src/stories/Button/Button.test.ts +3 -1
  121. package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
  122. package/src/stories/Button/ButtonSlots.stories.mdx +8 -7
  123. package/src/stories/Button/ButtonState.stories.mdx +2 -11
  124. package/src/stories/Card/Card.stories.mdx +2 -1
  125. package/src/stories/Checkbox/Checkbox.stories.mdx +2 -1
  126. package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +2 -1
  127. package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +2 -1
  128. package/src/stories/Combobox/Combobox.settings.ts +44 -0
  129. package/src/stories/Combobox/Combobox.stories.mdx +40 -1
  130. package/src/stories/Dialog/Dialog.stories.mdx +2 -1
  131. package/src/stories/Dropdown/Dropdown.settings.ts +3 -2
  132. package/src/stories/Dropdown/Dropdown.stories.mdx +14 -12
  133. package/src/stories/Dropdown/DropdownMultilevel.stories.mdx +56 -0
  134. package/src/stories/Dropdown/DropdownSlots.stories.mdx +14 -13
  135. package/src/stories/Icon/Icon.stories.mdx +2 -1
  136. package/src/stories/Icon/IconsCollection.stories.mdx +2 -1
  137. package/src/stories/InputText/InputText.stories.mdx +2 -1
  138. package/src/stories/Progress/Progress.stories.mdx +2 -1
  139. package/src/stories/Radio/Radio.stories.mdx +2 -1
  140. package/src/stories/RadioGroup/RadioGroup.stories.mdx +2 -1
  141. package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +2 -1
  142. package/src/stories/Select/Select.stories.mdx +2 -1
  143. package/src/stories/Textarea/Textarea.stories.mdx +2 -1
  144. package/src/stories/Tooltip/Tooltip.stories.mdx +2 -1
  145. package/src/stories/Tooltip/TooltipDirective.stories.mdx +2 -1
@@ -1,34 +1,104 @@
1
- import { defineComponent as ce, unref as t, openBlock as u, createBlock as Y, mergeProps as N, createCommentVNode as k, createElementBlock as v, Fragment as q, createVNode as de, withCtx as ne, renderSlot as A, normalizeProps as T, guardReactiveProps as R, Transition as tt, withDirectives as ke, createElementVNode as H, normalizeStyle as Be, normalizeClass as ve, vShow as xe, toDisplayString as F, isRef as _e, renderList as Se, vModelSelect as ot, createTextVNode as se, createSlots as lt, withModifiers as at, vModelText as st } from "vue";
2
- import { iconExists as me, Icon as nt, addIcon as rt } from "@iconify/vue";
3
- import { autoPlacement as De, flip as Ie, shift as Oe, size as Ce, offset as ge, arrow as it, useFloating as ut, autoUpdate as dt } from "@floating-ui/vue";
4
- var we = /* @__PURE__ */ ((s) => (s.left = "left", s.right = "right", s.top = "top", s.bottom = "bottom", s))(we || {}), Fe = /* @__PURE__ */ ((s) => (s.topStart = "top-start", s.topEnd = "top-end", s.bottomStart = "bottom-start", s.bottomEnd = "bottom-end", s.leftStart = "left-start", s.leftEnd = "left-end", s.rightStart = "right-start", s.rightEnd = "right-end", s))(Fe || {}), Ve = /* @__PURE__ */ ((s) => (s.before = "before", s.after = "after", s))(Ve || {});
5
- const Ne = {
1
+ import { inject as Ze, computed as i, unref as o, defineComponent as ne, ref as P, toRefs as Q, openBlock as p, createBlock as x, mergeProps as j, createCommentVNode as k, h as et, Fragment as K, provide as tt, useAttrs as Pt, watch as Y, nextTick as Ee, createElementBlock as g, createVNode as pe, withCtx as F, renderSlot as O, normalizeProps as T, guardReactiveProps as M, Transition as It, withDirectives as Te, createElementVNode as G, normalizeStyle as Je, normalizeClass as _e, vShow as lt, createTextVNode as J, toDisplayString as D, useSlots as ot, isRef as Ne, renderList as Le, vModelSelect as Bt, createSlots as At, withModifiers as Dt, vModelText as Ct } from "vue";
2
+ import { iconExists as $e, Icon as Nt, addIcon as Lt } from "@iconify/vue";
3
+ import { autoPlacement as Ye, flip as Ge, shift as Qe, size as Xe, offset as Ce, arrow as jt, useFloating as Ht, autoUpdate as Ft } from "@floating-ui/vue";
4
+ import { nanoid as xt } from "nanoid";
5
+ import { useVModel as Tt, onClickOutside as Mt, useFocusWithin as Me, onKeyStroke as ye, useElementHover as Rt, useFocus as nt, toReactive as Wt, useElementVisibility as Kt, refDebounced as zt } from "@vueuse/core";
6
+ import qt from "mitt";
7
+ var de = /* @__PURE__ */ ((t) => (t.left = "left", t.right = "right", t.top = "top", t.bottom = "bottom", t))(de || {}), at = /* @__PURE__ */ ((t) => (t.topStart = "top-start", t.topEnd = "top-end", t.bottomStart = "bottom-start", t.bottomEnd = "bottom-end", t.leftStart = "left-start", t.leftEnd = "left-end", t.rightStart = "right-start", t.rightEnd = "right-end", t))(at || {}), he = /* @__PURE__ */ ((t) => (t.before = "before", t.after = "after", t))(he || {}), je = /* @__PURE__ */ ((t) => (t.button = "button", t.submit = "submit", t.reset = "reset", t))(je || {}), st = /* @__PURE__ */ ((t) => (t.button = "button", t.link = "link", t.menuitem = "menuitem", t))(st || {}), Se = /* @__PURE__ */ ((t) => (t.listbox = "listbox", t.menu = "menu", t))(Se || {}), He = /* @__PURE__ */ ((t) => (t.option = "option", t.presentation = "presentation", t))(He || {}), rt = /* @__PURE__ */ ((t) => (t._blank = "_blank", t._self = "_self", t._parent = "_parent", t._top = "_top", t))(rt || {});
8
+ const Ut = Symbol.for("volver"), Jt = Symbol.for("dropdownTrigger"), it = Symbol.for("dropdownItem"), Yt = Symbol.for("dropdownAction"), Gt = {
9
+ /**
10
+ * The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
11
+ * @see Documentation of [router-link](https://router.vuejs.org/api/#router-link) and [nuxt-link](https://nuxtjs.org/api/components-nuxt-link/)
12
+ */
13
+ to: {
14
+ type: [String, Object]
15
+ },
16
+ /**
17
+ * Anchor href
18
+ */
19
+ href: String,
20
+ /**
21
+ * Anchor target
22
+ */
23
+ target: {
24
+ type: String,
25
+ validator: (t) => Object.values(rt).includes(t)
26
+ },
27
+ /**
28
+ * Anchor rel
29
+ */
30
+ rel: {
31
+ type: String,
32
+ default: "noopener noreferrer"
33
+ }
34
+ }, ut = {
35
+ /**
36
+ * Valid status
37
+ */
6
38
  valid: Boolean,
39
+ /**
40
+ * Valid label
41
+ */
7
42
  validLabel: [String, Array]
8
- }, Le = {
43
+ }, dt = {
44
+ /**
45
+ * Invalid status
46
+ */
9
47
  invalid: Boolean,
48
+ /**
49
+ * Invalid label
50
+ */
10
51
  invalidLabel: [String, Array]
11
- }, Me = {
52
+ }, ct = {
53
+ /**
54
+ * Loading status
55
+ */
12
56
  loading: Boolean,
13
- loadingLabel: String
14
- }, Te = {
57
+ /**
58
+ * Loading label
59
+ */
60
+ loadingLabel: {
61
+ type: String,
62
+ default: "Loading..."
63
+ }
64
+ }, Ae = {
15
65
  /**
16
66
  * Whether the form control is disabled
17
67
  */
18
68
  disabled: Boolean
69
+ }, Qt = {
70
+ /**
71
+ * Whether the item is selected
72
+ */
73
+ selected: Boolean
74
+ }, Xt = {
75
+ /**
76
+ * Whether the item is active
77
+ */
78
+ active: Boolean
79
+ }, Zt = {
80
+ /**
81
+ * Whether the item is pressed
82
+ */
83
+ pressed: Boolean
19
84
  }, Re = {
85
+ /**
86
+ * The item label
87
+ */
88
+ label: [String, Number]
89
+ }, ft = {
20
90
  /**
21
91
  * The value is not editable
22
92
  */
23
93
  readonly: Boolean
24
- }, he = {
94
+ }, Ve = {
25
95
  /**
26
96
  * Component BEM modifiers
27
97
  */
28
98
  modifiers: [String, Array]
29
- }, je = {
99
+ }, vt = {
30
100
  hintLabel: { type: String, default: "" }
31
- }, We = {
101
+ }, pt = {
32
102
  /**
33
103
  * List of options, can be string[] or object[]
34
104
  */
@@ -48,7 +118,7 @@ const Ne = {
48
118
  * Used when options are objects: key to use for option disabled
49
119
  */
50
120
  disabledKey: { type: [String, Function], default: "disabled" }
51
- }, ze = {
121
+ }, mt = {
52
122
  /**
53
123
  * VvIcon name or props
54
124
  * @see VVIcon
@@ -59,39 +129,39 @@ const Ne = {
59
129
  */
60
130
  iconPosition: {
61
131
  type: String,
62
- default: Ve.before,
63
- validation: (s) => Object.values(Ve).includes(s)
132
+ default: he.before,
133
+ validation: (t) => Object.values(he).includes(t)
64
134
  }
65
- }, qe = {
135
+ }, bt = {
66
136
  /**
67
137
  * Global attribute tabindex
68
138
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex
69
139
  */
70
140
  tabindex: { type: [String, Number], default: 0 }
71
- }, He = {
141
+ }, yt = {
72
142
  /**
73
143
  * If true the label will be floating
74
144
  */
75
145
  floating: Boolean
76
- }, Ke = {
146
+ }, We = {
77
147
  /**
78
148
  * If true the input will be unselectable
79
149
  */
80
150
  unselectable: { type: Boolean, default: !0 }
81
- }, Ue = {
151
+ }, gt = {
82
152
  /**
83
153
  * Global attribute id
84
154
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
85
155
  */
86
156
  id: [String, Number]
87
- }, $e = {
157
+ }, Fe = {
88
158
  /**
89
159
  * Dropdown placement
90
160
  */
91
161
  placement: {
92
162
  type: String,
93
- default: we.bottom,
94
- validator: (s) => Object.values(we).includes(s) || Object.values(Fe).includes(s)
163
+ default: de.bottom,
164
+ validator: (t) => Object.values(de).includes(t) || Object.values(at).includes(t)
95
165
  },
96
166
  /**
97
167
  * Dropdown show / hide transition name
@@ -167,46 +237,59 @@ const Ne = {
167
237
  triggerWidth: {
168
238
  type: Boolean
169
239
  }
170
- }, Je = {
171
- ...Ue,
240
+ }, ht = {
241
+ ...gt,
172
242
  /**
173
243
  * Input / Textarea name
174
244
  * Name of the form control. Submitted with the form as part of a name/value pair
175
245
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name
176
246
  */
177
247
  name: { type: String, required: !0 }
178
- }, ct = {
248
+ }, el = {
179
249
  /**
180
250
  * Global attribute autofocus
181
251
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus
182
252
  */
183
253
  autofocus: Boolean
184
- }, ft = {
254
+ }, tl = {
185
255
  /**
186
256
  * Global attribute autocomplete
187
257
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
188
258
  */
189
259
  autocomplete: { type: String, default: "off" }
190
- }, pt = [
260
+ };
261
+ ({
262
+ ...Ae,
263
+ ...Re,
264
+ ...Zt,
265
+ ...Xt,
266
+ ...Gt,
267
+ /**
268
+ * Button type
269
+ */
270
+ type: je.button
271
+ });
272
+ const ll = [
191
273
  "update:modelValue",
192
274
  "change:search",
193
275
  "focus",
194
276
  "blur"
195
- ], vt = {
196
- ...Je,
197
- ...qe,
198
- ...Ne,
199
- ...Le,
200
- ...je,
201
- ...Me,
202
- ...Te,
203
- ...Re,
204
- ...he,
277
+ ], ol = {
278
+ ...ht,
279
+ ...bt,
280
+ ...ut,
281
+ ...dt,
282
+ ...vt,
283
+ ...ct,
284
+ ...Ae,
285
+ ...ft,
286
+ ...Ve,
287
+ ...pt,
288
+ ...mt,
289
+ ...yt,
205
290
  ...We,
206
- ...ze,
207
- ...He,
208
- ...Ke,
209
- ...$e,
291
+ ...Fe,
292
+ ...Re,
210
293
  /**
211
294
  * modelValue can be a string, number, boolean, object or array of string, number, boolean, object
212
295
  */
@@ -214,30 +297,30 @@ const Ne = {
214
297
  type: [String, Number, Boolean, Object, Array],
215
298
  default: void 0
216
299
  },
217
- /**
218
- * Select input label
219
- */
220
- label: String,
221
300
  /**
222
301
  * Label for no search results
223
302
  */
224
303
  noResultsLabel: { type: String, default: "No results" },
304
+ /**
305
+ * Label for no options available
306
+ */
307
+ noOptionsLabel: { type: String, default: "No options available" },
225
308
  /**
226
309
  * Label for selected option hint
227
310
  */
228
- selectedLabel: { type: String, default: "Selected" },
311
+ selectedHintLabel: { type: String, default: "Selected" },
229
312
  /**
230
- * Label for deselect button
313
+ * Label for deselect action button
231
314
  */
232
- deselectLabel: { type: String, default: "Deselect" },
315
+ deselectActionLabel: { type: String, default: "Deselect" },
233
316
  /**
234
317
  * Label for select option hint
235
318
  */
236
- pressToSelectLabel: { type: String, default: "Press enter to select" },
319
+ selectHintLabel: { type: String, default: "Press enter to select" },
237
320
  /**
238
321
  * Label for deselected option hint
239
322
  */
240
- pressToDeselectLabel: { type: String, default: "Press enter to remove" },
323
+ deselectHintLabel: { type: String, default: "Press enter to remove" },
241
324
  /**
242
325
  * Select input placeholder
243
326
  */
@@ -291,7 +374,7 @@ const Ne = {
291
374
  * Set dropdown width to the same as the trigger
292
375
  */
293
376
  triggerWidth: {
294
- ...$e.triggerWidth,
377
+ ...Fe.triggerWidth,
295
378
  default: !0
296
379
  },
297
380
  /**
@@ -308,7 +391,7 @@ const Ne = {
308
391
  * Close dropdown on select (not multiple)
309
392
  */
310
393
  autoClose: Boolean
311
- }, mt = {
394
+ }, nl = {
312
395
  /**
313
396
  * Color
314
397
  */
@@ -401,63 +484,79 @@ const Ne = {
401
484
  modifiers: {
402
485
  type: [String, Array]
403
486
  }
404
- }, bt = {
487
+ };
488
+ function al() {
489
+ return Ze(Ut);
490
+ }
491
+ function me(t, l, e) {
492
+ return i(() => {
493
+ const s = {
494
+ [t]: !0
495
+ }, n = typeof (l == null ? void 0 : l.value) == "string" ? l.value.split(" ") : l == null ? void 0 : l.value;
496
+ return n && Array.isArray(n) && n.forEach((f) => {
497
+ s[`${t}--${f}`] = !0;
498
+ }), e && Object.keys(e.value).forEach((f) => {
499
+ s[`${t}--${f}`] = o(e.value[f]);
500
+ }), s;
501
+ });
502
+ }
503
+ const sl = {
405
504
  name: "VvIcon"
406
- }, pe = /* @__PURE__ */ ce({
407
- ...bt,
408
- props: mt,
409
- setup(s) {
410
- const d = s, e = ref(!0), c = useVolver(), { modifiers: g } = toRefs(d), w = useBemModifiers("vv-icon", g), r = computed(() => d.provider || (c == null ? void 0 : c.provider)), V = computed(() => {
411
- const a = d.name ?? "", n = `@${r.value}:${d.prefix}:${d.name}`;
412
- return me(a) ? a : me(n) ? n : (c == null ? void 0 : c.iconsCollections.find(
413
- (i) => {
414
- const _ = `@${r.value}:${i.prefix}:${a}`;
415
- if (me(_))
416
- return _;
505
+ }, ge = /* @__PURE__ */ ne({
506
+ ...sl,
507
+ props: nl,
508
+ setup(t) {
509
+ const l = t, e = P(!0), s = al(), { modifiers: n } = Q(l), f = me("vv-icon", n), d = i(() => l.provider || (s == null ? void 0 : s.provider)), b = i(() => {
510
+ const u = l.name ?? "", c = `@${d.value}:${l.prefix}:${l.name}`;
511
+ return $e(u) ? u : $e(c) ? c : (s == null ? void 0 : s.iconsCollections.find(
512
+ (m) => {
513
+ const V = `@${d.value}:${m.prefix}:${u}`;
514
+ if ($e(V))
515
+ return V;
417
516
  }
418
- )) || a;
517
+ )) || u;
419
518
  });
420
- function $(a) {
421
- let n = null;
519
+ function v(u) {
520
+ let c = null;
422
521
  if (typeof window > "u") {
423
522
  const { JSDOM: B } = require("jsdom");
424
- n = new B().window;
523
+ c = new B().window;
425
524
  }
426
- return (n ? new n.DOMParser() : new window.DOMParser()).parseFromString(a, "text/html").querySelector("svg");
525
+ return (c ? new c.DOMParser() : new window.DOMParser()).parseFromString(u, "text/html").querySelector("svg");
427
526
  }
428
- function b(a) {
429
- const n = $(a), i = (n == null ? void 0 : n.innerHTML.trim()) || "";
430
- n && i && rt(`@${r.value}:${d.prefix}:${d.name}`, {
431
- body: i,
527
+ function y(u) {
528
+ const c = v(u), m = (c == null ? void 0 : c.innerHTML.trim()) || "";
529
+ c && m && Lt(`@${d.value}:${l.prefix}:${l.name}`, {
530
+ body: m,
432
531
  // Set height and width from svg content
433
- height: n.viewBox.baseVal.height,
434
- width: n.viewBox.baseVal.width
532
+ height: c.viewBox.baseVal.height,
533
+ width: c.viewBox.baseVal.width
435
534
  });
436
535
  }
437
- return c && (d.src && !me(`@${r.value}:${d.prefix}:${d.name}`) ? (e.value = !1, c.fetchIcon(d.src).then((a) => {
438
- a && (b(a), e.value = !0);
439
- }).catch((a) => {
440
- throw new Error(`During fetch icon: ${a == null ? void 0 : a.message}`);
441
- })) : d.svg && b(d.svg)), (a, n) => t(e) ? (u(), Y(t(nt), N({
536
+ return s && (l.src && !$e(`@${d.value}:${l.prefix}:${l.name}`) ? (e.value = !1, s.fetchIcon(l.src).then((u) => {
537
+ u && (y(u), e.value = !0);
538
+ }).catch((u) => {
539
+ throw new Error(`During fetch icon: ${u == null ? void 0 : u.message}`);
540
+ })) : l.svg && y(l.svg)), (u, c) => o(e) ? (p(), x(o(Nt), j({
442
541
  key: 0,
443
- class: t(w)
542
+ class: o(f)
444
543
  }, {
445
- inline: a.inline,
446
- width: a.width,
447
- height: a.height,
448
- horizontalFlip: a.horizontalFlip,
449
- verticalFlip: a.verticalFlip,
450
- flip: a.flip,
451
- rotate: a.rotate,
452
- color: a.color,
453
- onLoad: a.onLoad,
454
- icon: t(V)
544
+ inline: u.inline,
545
+ width: u.width,
546
+ height: u.height,
547
+ horizontalFlip: u.horizontalFlip,
548
+ verticalFlip: u.verticalFlip,
549
+ flip: u.flip,
550
+ rotate: u.rotate,
551
+ color: u.color,
552
+ onLoad: u.onLoad,
553
+ icon: o(b)
455
554
  }), null, 16, ["class"])) : k("", !0);
456
555
  }
457
- }), Ae = ["listbox", "menu"], ht = {
458
- ...Ue,
459
- ...he,
460
- ...$e,
556
+ }), rl = {
557
+ ...gt,
558
+ ...Ve,
559
+ ...Fe,
461
560
  /**
462
561
  * Show / hide dropdown programmatically
463
562
  */
@@ -477,274 +576,469 @@ const Ne = {
477
576
  */
478
577
  role: {
479
578
  type: String,
480
- default: Ae[1],
481
- validator: (s) => Ae.includes(s)
579
+ default: Se.menu,
580
+ validator: (t) => Object.values(Se).includes(t)
482
581
  }
483
- }, yt = ["id", "tabindex", "role", "aria-labelledby"], gt = {
582
+ }, Ke = (t) => i(() => String((t == null ? void 0 : t.value) || xt()));
583
+ function il({
584
+ reference: t,
585
+ id: l,
586
+ expanded: e,
587
+ aria: s
588
+ }) {
589
+ const n = qt(), f = ne({
590
+ name: "VvDropdownTriggerProvider",
591
+ provide() {
592
+ return {
593
+ [Jt]: {
594
+ reference: t,
595
+ id: l,
596
+ expanded: e,
597
+ aria: s,
598
+ bus: n
599
+ }
600
+ };
601
+ },
602
+ setup() {
603
+ return {};
604
+ },
605
+ render() {
606
+ var d, b;
607
+ return et(K, {}, (b = (d = this.$slots).default) == null ? void 0 : b.call(d));
608
+ }
609
+ });
610
+ return {
611
+ bus: n,
612
+ component: f
613
+ };
614
+ }
615
+ function ul({
616
+ role: t,
617
+ expanded: l
618
+ }) {
619
+ const e = i(
620
+ () => t.value === Se.listbox ? He.option : He.presentation
621
+ );
622
+ return tt(it, {
623
+ role: e,
624
+ expanded: l
625
+ }), { itemRole: e };
626
+ }
627
+ function dl({
628
+ expanded: t
629
+ }) {
630
+ tt(Yt, {
631
+ role: st.menuitem,
632
+ expanded: t
633
+ });
634
+ }
635
+ const cl = ["id", "tabindex", "role", "aria-labelledby"], fl = {
484
636
  name: "VvDropdown",
485
637
  inheritAttrs: !1
486
- }, Ge = /* @__PURE__ */ ce({
487
- ...gt,
488
- props: ht,
638
+ }, St = /* @__PURE__ */ ne({
639
+ ...fl,
640
+ props: rl,
489
641
  emits: ["update:modelValue"],
490
- setup(s, { emit: d }) {
491
- const e = s, { id: c } = toRefs(e), g = useUniqueId(c), w = useAttrs(), r = ref("auto"), V = ref("auto"), $ = ref(null), b = ref(null), a = ref(null), n = ref(null), i = computed({
492
- get: () => e.reference ?? $.value,
493
- set: (o) => {
494
- $.value = o;
642
+ setup(t, { emit: l }) {
643
+ const e = t, { id: s } = Q(e), n = Ke(s), f = Pt(), d = P("auto"), b = P("auto"), v = P(null), y = P(null), u = P(null), c = P(null), m = i({
644
+ get: () => e.reference ?? v.value,
645
+ set: (a) => {
646
+ v.value = a;
495
647
  }
496
- }), _ = computed(() => {
497
- const o = [];
498
- if (e.autoPlacement ? typeof e.autoPlacement == "boolean" ? o.push(De()) : o.push(
499
- De(e.autoPlacement)
500
- ) : e.flip && (typeof e.flip == "boolean" ? o.push(Ie()) : o.push(Ie(e.flip))), e.shift && (typeof e.shift == "boolean" ? o.push(Oe()) : o.push(Oe(e.shift))), e.size) {
501
- const p = ({
502
- availableWidth: M,
503
- availableHeight: le
648
+ }), V = i(() => {
649
+ const a = [];
650
+ if (e.autoPlacement ? typeof e.autoPlacement == "boolean" ? a.push(Ye()) : a.push(
651
+ Ye(e.autoPlacement)
652
+ ) : e.flip && (typeof e.flip == "boolean" ? a.push(Ge()) : a.push(Ge(e.flip))), e.shift && (typeof e.shift == "boolean" ? a.push(Qe()) : a.push(Qe(e.shift))), e.size) {
653
+ const _ = ({
654
+ availableWidth: W,
655
+ availableHeight: ie
504
656
  }) => {
505
- r.value = `${M}px`, V.value = `${le}px`;
657
+ d.value = `${W}px`, b.value = `${ie}px`;
506
658
  };
507
- typeof e.size == "boolean" ? o.push(
508
- Ce({
509
- apply: p
659
+ typeof e.size == "boolean" ? a.push(
660
+ Xe({
661
+ apply: _
510
662
  })
511
- ) : o.push(
512
- Ce({
663
+ ) : a.push(
664
+ Xe({
513
665
  ...e.size,
514
- apply: p
666
+ apply: _
515
667
  })
516
668
  );
517
669
  }
518
- return e.offset && (o.push(ge(Number(e.offset))), ["string", "number"].includes(typeof e.offset) ? o.push(ge(Number(e.offset))) : o.push(ge(e.offset))), e.arrow && o.push(
519
- it({
520
- element: a
670
+ return e.offset && (a.push(Ce(Number(e.offset))), ["string", "number"].includes(typeof e.offset) ? a.push(Ce(Number(e.offset))) : a.push(Ce(e.offset))), e.arrow && a.push(
671
+ jt({
672
+ element: u
521
673
  })
522
- ), o;
523
- }), { x: P, y: B, strategy: K, middlewareData: L, placement: U } = ut(
524
- i,
525
- b,
674
+ ), a;
675
+ }), { x: E, y: B, strategy: X, middlewareData: R, placement: Z } = Ht(
676
+ m,
677
+ y,
526
678
  {
527
- whileElementsMounted: dt,
679
+ whileElementsMounted: Ft,
528
680
  placement: e.placement,
529
- middleware: _
681
+ middleware: V
530
682
  }
531
- ), j = computed(() => ({
532
- position: K.value,
683
+ ), z = i(() => ({
684
+ position: X.value,
533
685
  top: `${B.value ?? 0}px`,
534
- left: `${P.value ?? 0}px`,
535
- maxWidth: r.value,
536
- maxHeight: V.value,
537
- width: e.triggerWidth && i.value ? `${i.value.offsetWidth}px` : void 0
538
- })), I = computed(() => U.value.split("-")[0]), D = computed(
686
+ left: `${E.value ?? 0}px`,
687
+ maxWidth: d.value,
688
+ maxHeight: b.value,
689
+ width: e.triggerWidth && m.value ? `${m.value.offsetWidth}px` : void 0
690
+ })), C = i(() => Z.value.split("-")[0]), A = i(
539
691
  () => ({
540
692
  top: "bottom",
541
693
  right: "left",
542
694
  bottom: "top",
543
695
  left: "right"
544
- })[I.value] ?? "bottom"
545
- ), x = computed(() => {
546
- var o, p, M, le;
547
- return ["bottom", "top"].includes(D.value) ? {
548
- right: `${((o = L.value.arrow) == null ? void 0 : o.x) ?? 0}px`,
549
- [D.value]: `${-(((p = a.value) == null ? void 0 : p.offsetWidth) ?? 0) / 2}px`
696
+ })[C.value] ?? "bottom"
697
+ ), H = i(() => {
698
+ var a, _, W, ie;
699
+ return ["bottom", "top"].includes(A.value) ? {
700
+ right: `${((a = R.value.arrow) == null ? void 0 : a.x) ?? 0}px`,
701
+ [A.value]: `${-(((_ = u.value) == null ? void 0 : _.offsetWidth) ?? 0) / 2}px`
550
702
  } : {
551
- top: `${((M = L.value.arrow) == null ? void 0 : M.y) ?? 0}px`,
552
- [D.value]: `${-(((le = a.value) == null ? void 0 : le.offsetWidth) ?? 0) / 2}px`
703
+ top: `${((W = R.value.arrow) == null ? void 0 : W.y) ?? 0}px`,
704
+ [A.value]: `${-(((ie = u.value) == null ? void 0 : ie.offsetWidth) ?? 0) / 2}px`
553
705
  };
554
- }), W = useVModel(e, "modelValue", d), J = ref(!1), m = computed({
555
- get: () => W.value ?? J.value,
556
- set: (o) => {
557
- if (W.value === void 0) {
558
- J.value = o;
706
+ }), q = Tt(e, "modelValue", l), ee = P(!1), h = i({
707
+ get: () => q.value ?? ee.value,
708
+ set: (a) => {
709
+ if (q.value === void 0) {
710
+ ee.value = a;
559
711
  return;
560
712
  }
561
- W.value = o;
713
+ q.value = a;
562
714
  }
563
- }), z = () => {
564
- m.value = !0;
565
- }, O = () => {
566
- m.value = !1;
567
- }, Z = () => {
568
- m.value = !m.value;
569
- }, re = (o) => {
570
- i.value = o;
715
+ }), U = () => {
716
+ h.value = !0;
717
+ }, N = () => {
718
+ h.value = !1;
719
+ }, ae = () => {
720
+ h.value = !h.value;
721
+ }, ce = (a) => {
722
+ m.value = a;
571
723
  };
572
- watch(m, (o) => {
573
- o && e.autofocusFirst && nextTick(() => {
574
- const p = E(
575
- b.value
724
+ Y(h, (a) => {
725
+ a && e.autofocusFirst && Ee(() => {
726
+ const _ = I(
727
+ y.value
576
728
  );
577
- p.length > 0 && p[0].focus();
729
+ _.length > 0 && _[0].focus();
578
730
  });
579
- }), onClickOutside(
580
- b,
731
+ }), Mt(
732
+ y,
581
733
  () => {
582
- e.autoClose && (m.value = !1);
734
+ e.autoClose && (h.value = !1);
583
735
  },
584
- { ignore: [i] }
736
+ { ignore: [m] }
585
737
  );
586
- const ie = computed(() => {
587
- var o;
588
- return ((o = i.value) == null ? void 0 : o.getAttribute("id")) ?? void 0;
589
- }), G = computed(() => ({
590
- "aria-controls": g.value,
738
+ const fe = i(() => {
739
+ var a;
740
+ return ((a = m.value) == null ? void 0 : a.getAttribute("id")) ?? void 0;
741
+ }), te = i(() => ({
742
+ "aria-controls": n.value,
591
743
  "aria-haspopup": !0,
592
- "aria-expanded": m.value
593
- })), { component: ee, bus: ue } = useProvideDropdownTrigger({
594
- reference: i,
595
- id: g,
596
- expanded: m,
597
- aria: G
744
+ "aria-expanded": h.value
745
+ })), { component: se, bus: ve } = il({
746
+ reference: m,
747
+ id: n,
748
+ expanded: h,
749
+ aria: te
598
750
  });
599
- ue.on("click", Z);
600
- const { role: te, modifiers: fe } = toRefs(e), { itemRole: Q } = useProvideDropdownItem({ role: te, expanded: m }), y = useBemModifiers(
751
+ ve.on("click", ae);
752
+ const { role: re, modifiers: be } = Q(e), { itemRole: le } = ul({ role: re, expanded: h }), S = me(
601
753
  "vv-dropdown",
602
- fe,
603
- computed(() => ({
754
+ be,
755
+ i(() => ({
604
756
  arrow: e.arrow
605
757
  }))
606
- ), { focused: C } = useFocusWithin(b);
607
- function E(o) {
608
- return o ? [
609
- ...o.querySelectorAll(
758
+ ), { focused: L } = Me(y);
759
+ function I(a) {
760
+ return a ? [
761
+ ...a.querySelectorAll(
610
762
  'a[href], button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])'
611
763
  )
612
764
  ].filter(
613
- (p) => !p.hasAttribute("disabled") && !p.getAttribute("aria-hidden")
765
+ (_) => !_.hasAttribute("disabled") && !_.getAttribute("aria-hidden")
614
766
  ) : [];
615
767
  }
616
- const X = () => {
617
- nextTick(() => {
618
- if (C.value) {
619
- const o = E(
620
- b.value
768
+ const oe = () => {
769
+ Ee(() => {
770
+ if (L.value) {
771
+ const a = I(
772
+ y.value
621
773
  );
622
- if (o.length === 0 || !document.activeElement)
774
+ if (a.length === 0 || !document.activeElement)
623
775
  return;
624
- const p = o.indexOf(
776
+ const _ = a.indexOf(
625
777
  document.activeElement
626
778
  );
627
- p < o.length - 1 ? o[p + 1].focus() : o[0].focus();
779
+ _ < a.length - 1 ? a[_ + 1].focus() : a[0].focus();
628
780
  }
629
781
  });
630
- }, oe = () => {
631
- nextTick(() => {
632
- if (C.value) {
633
- const o = E(
634
- b.value
782
+ }, we = () => {
783
+ Ee(() => {
784
+ if (L.value) {
785
+ const a = I(
786
+ y.value
635
787
  );
636
- if (o.length === 0 || !document.activeElement)
788
+ if (a.length === 0 || !document.activeElement)
637
789
  return;
638
- const p = o.indexOf(
790
+ const _ = a.indexOf(
639
791
  document.activeElement
640
792
  );
641
- p > 0 ? o[p - 1].focus() : o[o.length - 1].focus();
793
+ _ > 0 ? a[_ - 1].focus() : a[a.length - 1].focus();
642
794
  }
643
795
  });
644
796
  };
645
- return onKeyStroke("Escape", (o) => {
646
- m.value && (o.preventDefault(), O());
647
- }), onKeyStroke("ArrowDown", (o) => {
648
- m.value && C.value && (o.preventDefault(), X());
649
- }), onKeyStroke("ArrowUp", (o) => {
650
- m.value && C.value && (o.preventDefault(), oe());
651
- }), onKeyStroke([" ", "Enter"], (o) => {
652
- m.value && C.value && (o.preventDefault(), document.activeElement.click());
653
- }), (o, p) => (u(), v(q, null, [
654
- de(t(ee), null, {
655
- default: ne(() => [
656
- A(o.$slots, "default", T(R({ init: re, show: z, hide: O, toggle: Z, expanded: t(m), aria: t(G) })))
797
+ return ye("Escape", (a) => {
798
+ h.value && (a.preventDefault(), N());
799
+ }), ye("ArrowDown", (a) => {
800
+ h.value && L.value && (a.preventDefault(), oe());
801
+ }), ye("ArrowUp", (a) => {
802
+ h.value && L.value && (a.preventDefault(), we());
803
+ }), ye([" ", "Enter"], (a) => {
804
+ h.value && L.value && (a.preventDefault(), document.activeElement.click());
805
+ }), (a, _) => (p(), g(K, null, [
806
+ pe(o(se), null, {
807
+ default: F(() => [
808
+ O(a.$slots, "default", T(M({ init: ce, show: U, hide: N, toggle: ae, expanded: o(h), aria: o(te) })))
657
809
  ]),
658
810
  _: 3
659
811
  }),
660
- de(tt, { name: o.transitionName }, {
661
- default: ne(() => [
662
- ke(H("div", {
812
+ pe(It, { name: a.transitionName }, {
813
+ default: F(() => [
814
+ Te(G("div", {
663
815
  ref_key: "floatingEl",
664
- ref: b,
665
- style: Be(t(j)),
666
- class: ve(t(y))
816
+ ref: y,
817
+ style: Je(o(z)),
818
+ class: _e(o(S))
667
819
  }, [
668
- e.arrow ? (u(), v("div", {
820
+ e.arrow ? (p(), g("div", {
669
821
  key: 0,
670
822
  ref_key: "arrowEl",
671
- ref: a,
672
- style: Be(t(x)),
823
+ ref: u,
824
+ style: Je(o(H)),
673
825
  class: "vv-dropdown__arrow"
674
826
  }, null, 4)) : k("", !0),
675
- A(o.$slots, "before", T(R({ expanded: t(m) }))),
676
- H("ul", N(t(w), {
677
- id: t(g),
827
+ O(a.$slots, "before", T(M({ expanded: o(h) }))),
828
+ G("ul", j(o(f), {
829
+ id: o(n),
678
830
  ref_key: "listEl",
679
- ref: n,
680
- tabindex: t(m) ? void 0 : -1,
681
- role: t(te),
682
- "aria-labelledby": t(ie),
831
+ ref: c,
832
+ tabindex: o(h) ? void 0 : -1,
833
+ role: o(re),
834
+ "aria-labelledby": o(fe),
683
835
  class: "vv-dropdown__list"
684
836
  }), [
685
- A(o.$slots, "items", T(R({
686
- role: t(Q)
837
+ O(a.$slots, "items", T(M({
838
+ role: o(le)
687
839
  })))
688
- ], 16, yt),
689
- A(o.$slots, "after", T(R({ expanded: t(m) })))
840
+ ], 16, cl),
841
+ O(a.$slots, "after", T(M({ expanded: o(h) })))
690
842
  ], 6), [
691
- [xe, t(m)]
843
+ [lt, o(h)]
692
844
  ])
693
845
  ]),
694
846
  _: 3
695
847
  }, 8, ["name"])
696
848
  ], 64));
697
849
  }
698
- }), _t = {
850
+ });
851
+ function vl() {
852
+ return Ze(it, {});
853
+ }
854
+ const pl = {
699
855
  name: "VvDropdownItem"
700
- }, Qe = /* @__PURE__ */ ce({
701
- ..._t,
702
- setup(s) {
703
- const { role: d, expanded: e } = useInjectedDropdownItem(), c = ref(null);
704
- useProvideDropdownAction({ expanded: e });
705
- const g = useElementHover(c), { focused: w } = useFocus(c), { focused: r } = useFocusWithin(c);
706
- return watch(g, (V) => {
707
- V && (w.value = !0);
708
- }), (V, $) => (u(), v("li", N({ role: t(d) }, {
856
+ }, ml = /* @__PURE__ */ ne({
857
+ ...pl,
858
+ setup(t) {
859
+ const { role: l, expanded: e } = vl(), s = P(null);
860
+ dl({ expanded: e });
861
+ const n = Rt(s), { focused: f } = nt(s), { focused: d } = Me(s);
862
+ return Y(n, (b) => {
863
+ b && (f.value = !0);
864
+ }), (b, v) => (p(), g("li", j({ role: o(l) }, {
709
865
  ref_key: "element",
710
- ref: c,
711
- class: ["vv-dropdown__item", { "focus-visible": t(w) || t(r) }]
866
+ ref: s,
867
+ class: ["vv-dropdown__item", { "focus-visible": o(f) || o(d) }]
712
868
  }), [
713
- A(V.$slots, "default")
869
+ O(b.$slots, "default")
714
870
  ], 16));
715
871
  }
872
+ }), bl = { class: "vv-dropdown-option__hint" }, yl = {
873
+ name: "VvDropdownOption"
874
+ }, Pe = /* @__PURE__ */ ne({
875
+ ...yl,
876
+ props: {
877
+ ...Ae,
878
+ ...Qt,
879
+ ...We,
880
+ ...Ve,
881
+ deselectHintLabel: {
882
+ type: String
883
+ },
884
+ selectHintLabel: {
885
+ type: String
886
+ },
887
+ selectedHintLabel: {
888
+ type: String
889
+ }
890
+ },
891
+ setup(t) {
892
+ const l = t, { modifiers: e } = Q(l), s = me(
893
+ "vv-dropdown-option",
894
+ e,
895
+ i(() => ({
896
+ disabled: l.disabled,
897
+ selected: l.selected,
898
+ unselectable: l.unselectable && l.selected
899
+ }))
900
+ );
901
+ return (n, f) => (p(), x(ml, {
902
+ class: _e(o(s)),
903
+ tabindex: n.disabled ? -1 : 0,
904
+ "aria-selected": n.selected,
905
+ "aria-disabled": n.disabled
906
+ }, {
907
+ default: F(() => [
908
+ O(n.$slots, "default"),
909
+ G("span", bl, [
910
+ O(n.$slots, "hint", T(M({ disabled: n.disabled, selected: n.selected, unselectable: n.unselectable })), () => [
911
+ n.selected ? (p(), g(K, { key: 0 }, [
912
+ J(D(n.unselectable ? t.deselectHintLabel : t.selectedHintLabel), 1)
913
+ ], 64)) : n.disabled ? k("", !0) : (p(), g(K, { key: 1 }, [
914
+ J(D(t.selectHintLabel), 1)
915
+ ], 64))
916
+ ])
917
+ ])
918
+ ]),
919
+ _: 3
920
+ }, 8, ["class", "tabindex", "aria-selected", "aria-disabled"]));
921
+ }
716
922
  });
717
- function be(s) {
718
- return Array.isArray(s) ? s.filter((d) => isString(d)).join(" ") : s;
923
+ function Ie(t, l, e) {
924
+ return e ? Be(t, e) === Be(l, e) : xe(t, l);
925
+ }
926
+ function xe(t, l) {
927
+ if (t === l)
928
+ return !0;
929
+ if (t && l && typeof t == "object" && typeof l == "object") {
930
+ const e = Array.isArray(t), s = Array.isArray(l);
931
+ let n, f, d;
932
+ if (e && s) {
933
+ if (f = t.length, f != l.length)
934
+ return !1;
935
+ for (n = f; n-- !== 0; )
936
+ if (!xe(t[n], l[n]))
937
+ return !1;
938
+ return !0;
939
+ }
940
+ if (e != s)
941
+ return !1;
942
+ const b = t instanceof Date, v = l instanceof Date;
943
+ if (b != v)
944
+ return !1;
945
+ if (b && v)
946
+ return t.getTime() == l.getTime();
947
+ const y = t instanceof RegExp, u = l instanceof RegExp;
948
+ if (y != u)
949
+ return !1;
950
+ if (y && u)
951
+ return t.toString() == l.toString();
952
+ const c = Object.keys(t);
953
+ if (f = c.length, f !== Object.keys(l).length)
954
+ return !1;
955
+ for (n = f; n-- !== 0; )
956
+ if (!Object.prototype.hasOwnProperty.call(l, c[n]))
957
+ return !1;
958
+ for (n = f; n-- !== 0; )
959
+ if (d = c[n], !xe(t[d], l[d]))
960
+ return !1;
961
+ return !0;
962
+ }
963
+ return t !== t && l !== l;
964
+ }
965
+ function Be(t, l) {
966
+ if (t && Object.keys(t).length && l) {
967
+ if (l.indexOf(".") === -1)
968
+ return t[l];
969
+ {
970
+ const e = l.split(".");
971
+ let s = t;
972
+ for (let n = 0, f = e.length; n < f; ++n) {
973
+ if (t == null)
974
+ return null;
975
+ s = s[e[n]];
976
+ }
977
+ return s;
978
+ }
979
+ } else
980
+ return null;
981
+ }
982
+ function gl(t, l) {
983
+ let e = -1;
984
+ if (l) {
985
+ for (let s = 0; s < l.length; s++)
986
+ if (Ie(l[s], t)) {
987
+ e = s;
988
+ break;
989
+ }
990
+ }
991
+ return e;
992
+ }
993
+ function Oe(t, l) {
994
+ if (t != null && l && l.length) {
995
+ for (const e of l)
996
+ if (Ie(t, e))
997
+ return !0;
998
+ }
999
+ return !1;
1000
+ }
1001
+ function ze(t) {
1002
+ return ((l) => l == null || l === "" || Array.isArray(l) && l.length === 0 || !(l instanceof Date) && typeof l == "object" && Object.keys(l).length === 0)(o(t));
1003
+ }
1004
+ function hl(t, l) {
1005
+ const e = gl(t, l);
1006
+ return e > -1 ? l.filter((s, n) => n !== e) : l;
1007
+ }
1008
+ function Sl(t) {
1009
+ return typeof t == "string" || t instanceof String;
719
1010
  }
720
- function Xe(s, d) {
1011
+ function ke(t) {
1012
+ return Array.isArray(t) ? t.filter((l) => Sl(l)).join(" ") : t;
1013
+ }
1014
+ function _t(t, l) {
721
1015
  const {
722
1016
  invalid: e,
723
- valid: c,
724
- hint: g,
725
- loading: w
726
- } = d, {
727
- hintLabel: r,
728
- modelValue: V,
729
- valid: $,
730
- validLabel: b,
731
- invalid: a,
732
- invalidLabel: n,
733
- ...i
734
- } = toRefs(s), _ = resolveFieldData(i, "loading"), P = resolveFieldData(i, "loadingLabel"), B = computed(() => a.value ? !!(a.value && e || n != null && n.value && Array.isArray(n.value) && n.value.length > 0 || n != null && n.value && !isEmpty(n)) : !1), K = computed(
735
- () => !!(r && r.value || g)
736
- ), L = computed(
737
- () => !!(b && b.value || c)
738
- ), U = computed(
739
- () => !!(_ != null && _.value && w || _ != null && _.value && (P != null && P.value))
740
- ), j = computed(
741
- () => K.value || L.value || B.value || U.value
1017
+ valid: s,
1018
+ hint: n,
1019
+ loading: f
1020
+ } = l, {
1021
+ hintLabel: d,
1022
+ modelValue: b,
1023
+ valid: v,
1024
+ validLabel: y,
1025
+ invalid: u,
1026
+ invalidLabel: c,
1027
+ ...m
1028
+ } = Q(t), V = Be(m, "loading"), E = Be(m, "loadingLabel"), B = i(() => u.value ? !!(u.value && e || c != null && c.value && Array.isArray(c.value) && c.value.length > 0 || c != null && c.value && !ze(c)) : !1), X = i(
1029
+ () => !!(d && d.value || n)
1030
+ ), R = i(
1031
+ () => !!(y && y.value || s)
1032
+ ), Z = i(
1033
+ () => !!(V != null && V.value && f || V != null && V.value && (E != null && E.value))
1034
+ ), z = i(
1035
+ () => X.value || R.value || B.value || Z.value
742
1036
  );
743
1037
  return {
744
1038
  hasInvalid: B,
745
- hasHint: K,
746
- hasValid: L,
747
- hasLoading: U,
1039
+ hasHint: X,
1040
+ hasValid: R,
1041
+ hasLoading: Z,
748
1042
  HintSlot: {
749
1043
  name: "HintSlot",
750
1044
  props: {
@@ -753,31 +1047,31 @@ function Xe(s, d) {
753
1047
  default: () => ({})
754
1048
  }
755
1049
  },
756
- setup(I) {
757
- const D = computed(() => {
758
- const x = toReactive({
759
- hintLabel: r,
760
- modelValue: V,
761
- valid: $,
762
- validLabel: b,
763
- invalid: a,
764
- invalidLabel: n,
765
- loading: _,
766
- loadingLabel: P,
767
- ...I.params
1050
+ setup(C) {
1051
+ const A = i(() => {
1052
+ const H = Wt({
1053
+ hintLabel: d,
1054
+ modelValue: b,
1055
+ valid: v,
1056
+ validLabel: y,
1057
+ invalid: u,
1058
+ invalidLabel: c,
1059
+ loading: V,
1060
+ loadingLabel: E,
1061
+ ...C.params
768
1062
  });
769
- return a != null && a.value ? (e == null ? void 0 : e(x)) || be(n == null ? void 0 : n.value) || (r == null ? void 0 : r.value) : $ != null && $.value ? (c == null ? void 0 : c(x)) || be(b == null ? void 0 : b.value) || (r == null ? void 0 : r.value) : _ != null && _.value ? (w == null ? void 0 : w(x)) || be(P == null ? void 0 : P.value) || (r == null ? void 0 : r.value) : (g == null ? void 0 : g(x)) || be(r == null ? void 0 : r.value) || (r == null ? void 0 : r.value);
1063
+ return u != null && u.value ? (e == null ? void 0 : e(H)) || ke(c == null ? void 0 : c.value) || (d == null ? void 0 : d.value) : v != null && v.value ? (s == null ? void 0 : s(H)) || ke(y == null ? void 0 : y.value) || (d == null ? void 0 : d.value) : V != null && V.value ? (f == null ? void 0 : f(H)) || ke(E == null ? void 0 : E.value) || (d == null ? void 0 : d.value) : (n == null ? void 0 : n(H)) || ke(d == null ? void 0 : d.value) || (d == null ? void 0 : d.value);
770
1064
  });
771
1065
  return {
772
- isVisible: j,
1066
+ isVisible: z,
773
1067
  hasInvalid: B,
774
- hasValid: L,
775
- hintContent: D
1068
+ hasValid: R,
1069
+ hintContent: A
776
1070
  };
777
1071
  },
778
1072
  render() {
779
1073
  if (this.isVisible)
780
- return h(
1074
+ return et(
781
1075
  "small",
782
1076
  {
783
1077
  role: this.hasInvalid ? "alert" : this.hasValid ? "status" : void 0
@@ -788,22 +1082,23 @@ function Xe(s, d) {
788
1082
  }
789
1083
  };
790
1084
  }
791
- const St = {
792
- ...Je,
1085
+ const _l = {
1086
+ ...ht,
1087
+ ...el,
1088
+ ...tl,
1089
+ ...bt,
1090
+ ...ut,
1091
+ ...dt,
1092
+ ...vt,
793
1093
  ...ct,
1094
+ ...Ae,
794
1095
  ...ft,
795
- ...qe,
796
- ...Ne,
797
- ...Le,
798
- ...je,
799
- ...Me,
800
- ...Te,
801
- ...Re,
802
- ...he,
1096
+ ...Ve,
1097
+ ...pt,
1098
+ ...mt,
1099
+ ...yt,
803
1100
  ...We,
804
- ...ze,
805
- ...He,
806
- ...Ke,
1101
+ ...Re,
807
1102
  /**
808
1103
  * This Boolean attribute indicates that multiple options can be selected in the list.
809
1104
  * If it is not specified, then only one option can be selected at a time.
@@ -830,289 +1125,327 @@ const St = {
830
1125
  type: [String, Number, Boolean, Object, Array],
831
1126
  default: void 0
832
1127
  },
833
- /**
834
- * <label> value for the select
835
- */
836
- label: String,
837
1128
  /**
838
1129
  * Select placeholder
839
1130
  */
840
1131
  placeholder: String
841
- }, wt = ["update:modelValue", "focus", "blur"], Vt = ["for"], $t = { class: "vv-select__wrapper" }, kt = {
1132
+ }, Vl = ["update:modelValue", "focus", "blur"];
1133
+ function Vt(t, l) {
1134
+ const { focused: e } = nt(t);
1135
+ return Y(e, (s) => {
1136
+ l(s ? "focus" : "blur", o(t));
1137
+ }), {
1138
+ focused: e
1139
+ };
1140
+ }
1141
+ function wt(t, l) {
1142
+ const e = i(
1143
+ () => Boolean((t == null ? void 0 : t.value) && l.value === he.before)
1144
+ ), s = i(
1145
+ () => Boolean((t == null ? void 0 : t.value) && l.value === he.after)
1146
+ ), n = i(
1147
+ () => Boolean((t == null ? void 0 : t.value) && l.value === de.left)
1148
+ ), f = i(
1149
+ () => Boolean((t == null ? void 0 : t.value) && l.value === de.right)
1150
+ ), d = i(
1151
+ () => Boolean((t == null ? void 0 : t.value) && l.value === de.top)
1152
+ ), b = i(
1153
+ () => Boolean((t == null ? void 0 : t.value) && l.value === de.bottom)
1154
+ );
1155
+ return {
1156
+ hasIcon: i(() => typeof (t == null ? void 0 : t.value) == "string" ? { name: t == null ? void 0 : t.value } : t == null ? void 0 : t.value),
1157
+ hasIconLeft: n,
1158
+ hasIconRight: f,
1159
+ hasIconTop: d,
1160
+ hasIconBottom: b,
1161
+ hasIconBefore: e,
1162
+ hasIconAfter: s
1163
+ };
1164
+ }
1165
+ function $t(t) {
1166
+ const { options: l, labelKey: e, valueKey: s, disabledKey: n } = Q(t);
1167
+ return {
1168
+ options: l,
1169
+ getOptionLabel: (v) => typeof v != "object" && v !== null ? v : typeof e.value == "function" ? e.value(v) : v[e.value],
1170
+ getOptionValue: (v) => typeof v != "object" && v !== null ? v : typeof s.value == "function" ? s.value(v) : v[s.value],
1171
+ getOptionDisabled: (v) => typeof v != "object" && v !== null ? !1 : typeof n.value == "function" ? n.value(v) : v[n.value]
1172
+ };
1173
+ }
1174
+ const wl = ["for"], $l = { class: "vv-select__wrapper" }, Ol = {
842
1175
  key: 0,
843
1176
  class: "vv-select__input-before"
844
- }, Pt = { class: "vv-select__inner" }, Et = ["id"], Bt = ["disabled", "hidden"], Dt = ["disabled", "value"], It = {
1177
+ }, kl = { class: "vv-select__inner" }, El = ["id"], Pl = ["disabled", "hidden"], Il = ["disabled", "value"], Bl = {
845
1178
  key: 1,
846
1179
  class: "vv-select__input-after"
847
- }, Ot = {
1180
+ }, Al = {
848
1181
  name: "VvSelect"
849
- }, Ct = /* @__PURE__ */ ce({
850
- ...Ot,
851
- props: St,
852
- emits: wt,
853
- setup(s, { emit: d }) {
854
- const e = s, c = useSlots(), g = ref(), { HintSlot: w, hasHint: r, hasInvalid: V } = Xe(e, c), {
855
- id: $,
856
- modifiers: b,
857
- disabled: a,
858
- readonly: n,
859
- loading: i,
860
- icon: _,
861
- iconPosition: P,
1182
+ }, Dl = /* @__PURE__ */ ne({
1183
+ ...Al,
1184
+ props: _l,
1185
+ emits: Vl,
1186
+ setup(t, { emit: l }) {
1187
+ const e = t, s = ot(), n = P(), { HintSlot: f, hasHint: d, hasInvalid: b } = _t(e, s), {
1188
+ id: v,
1189
+ modifiers: y,
1190
+ disabled: u,
1191
+ readonly: c,
1192
+ loading: m,
1193
+ icon: V,
1194
+ iconPosition: E,
862
1195
  invalid: B,
863
- valid: K,
864
- floating: L,
865
- multiple: U
866
- } = toRefs(e), j = useUniqueId($), I = computed(() => `${j.value}-hint`), { focused: D } = useComponentFocus(g, d), x = useElementVisibility(g);
867
- watch(x, (y) => {
868
- y && e.autofocus && (D.value = !0);
1196
+ valid: X,
1197
+ floating: R,
1198
+ multiple: Z
1199
+ } = Q(e), z = Ke(v), C = i(() => `${z.value}-hint`), { focused: A } = Vt(n, l), H = Kt(n);
1200
+ Y(H, (S) => {
1201
+ S && e.autofocus && (A.value = !0);
869
1202
  });
870
- const { hasIcon: W, hasIconBefore: J, hasIconAfter: m } = useComponentIcon(
871
- _,
872
- P
873
- ), z = computed(() => !isEmpty(e.modelValue)), O = computed(() => e.disabled || e.readonly), Z = computed(() => O.value ? -1 : e.tabindex), re = computed(() => {
1203
+ const { hasIcon: q, hasIconBefore: ee, hasIconAfter: h } = wt(
1204
+ V,
1205
+ E
1206
+ ), U = i(() => !ze(e.modelValue)), N = i(() => e.disabled || e.readonly), ae = i(() => N.value ? -1 : e.tabindex), ce = i(() => {
874
1207
  if (e.invalid === !0)
875
1208
  return !0;
876
1209
  if (e.valid === !0)
877
1210
  return !1;
878
- }), ie = useBemModifiers(
1211
+ }), fe = me(
879
1212
  "vv-select",
880
- b,
881
- computed(() => ({
882
- valid: K.value,
1213
+ y,
1214
+ i(() => ({
1215
+ valid: X.value,
883
1216
  invalid: B.value,
884
- loading: i.value,
885
- disabled: a.value,
886
- readonly: n.value,
887
- "icon-before": J.value,
888
- "icon-after": m.value,
889
- dirty: z.value,
890
- focus: D.value,
891
- floating: L.value,
892
- multiple: U.value
1217
+ loading: m.value,
1218
+ disabled: u.value,
1219
+ readonly: c.value,
1220
+ "icon-before": ee.value,
1221
+ "icon-after": h.value,
1222
+ dirty: U.value,
1223
+ focus: A.value,
1224
+ floating: R.value,
1225
+ multiple: Z.value
893
1226
  }))
894
- ), G = computed(() => ({
1227
+ ), te = i(() => ({
895
1228
  name: e.name,
896
- tabindex: Z.value,
897
- disabled: O.value,
1229
+ tabindex: ae.value,
1230
+ disabled: N.value,
898
1231
  required: e.required,
899
1232
  size: e.size,
900
1233
  autocomplete: e.autocomplete,
901
1234
  multiple: e.multiple,
902
- "aria-invalid": re.value,
903
- "aria-describedby": !V.value && r.value ? I.value : void 0,
904
- "aria-errormessage": V.value ? I.value : void 0
905
- })), ee = computed(() => ({
1235
+ "aria-invalid": ce.value,
1236
+ "aria-describedby": !b.value && d.value ? C.value : void 0,
1237
+ "aria-errormessage": b.value ? C.value : void 0
1238
+ })), se = i(() => ({
906
1239
  valid: e.valid,
907
1240
  invalid: e.invalid,
908
1241
  modelValue: e.modelValue
909
- })), { getOptionLabel: ue, getOptionValue: te, getOptionDisabled: fe } = useOptions(e), Q = computed({
1242
+ })), { getOptionLabel: ve, getOptionValue: re, getOptionDisabled: be } = $t(e), le = i({
910
1243
  get: () => e.modelValue,
911
- set: (y) => {
912
- Array.isArray(y) && (y = y.filter((C) => C !== void 0)), d("update:modelValue", y);
1244
+ set: (S) => {
1245
+ Array.isArray(S) && (S = S.filter((L) => L !== void 0)), l("update:modelValue", S);
913
1246
  }
914
1247
  });
915
- return (y, C) => (u(), v("div", {
916
- class: ve(t(ie))
1248
+ return (S, L) => (p(), g("div", {
1249
+ class: _e(o(fe))
917
1250
  }, [
918
- y.label ? (u(), v("label", {
1251
+ S.label ? (p(), g("label", {
919
1252
  key: 0,
920
- for: t(j)
921
- }, F(y.label), 9, Vt)) : k("", !0),
922
- H("div", $t, [
923
- y.$slots.before ? (u(), v("div", kt, [
924
- A(y.$slots, "before", T(R(t(ee))))
1253
+ for: o(z)
1254
+ }, D(S.label), 9, wl)) : k("", !0),
1255
+ G("div", $l, [
1256
+ S.$slots.before ? (p(), g("div", Ol, [
1257
+ O(S.$slots, "before", T(M(o(se))))
925
1258
  ])) : k("", !0),
926
- H("div", Pt, [
927
- t(J) ? (u(), Y(pe, N({
1259
+ G("div", kl, [
1260
+ o(ee) ? (p(), x(ge, j({
928
1261
  key: 0,
929
1262
  class: "vv-select__icon"
930
- }, t(W)), null, 16)) : k("", !0),
931
- ke(H("select", N({
932
- id: t(j),
1263
+ }, o(q)), null, 16)) : k("", !0),
1264
+ Te(G("select", j({
1265
+ id: o(z),
933
1266
  ref_key: "select",
934
- ref: g,
935
- "onUpdate:modelValue": C[0] || (C[0] = (E) => _e(Q) ? Q.value = E : null)
936
- }, t(G)), [
937
- y.placeholder ? (u(), v("option", {
1267
+ ref: n,
1268
+ "onUpdate:modelValue": L[0] || (L[0] = (I) => Ne(le) ? le.value = I : null)
1269
+ }, o(te)), [
1270
+ S.placeholder ? (p(), g("option", {
938
1271
  key: 0,
939
1272
  value: void 0,
940
- disabled: !y.unselectable,
941
- hidden: !y.unselectable
942
- }, F(y.placeholder), 9, Bt)) : k("", !0),
943
- (u(!0), v(q, null, Se(y.options, (E, X) => (u(), v("option", {
944
- key: X,
945
- disabled: t(fe)(E),
946
- value: t(te)(E)
947
- }, F(t(ue)(E)), 9, Dt))), 128))
948
- ], 16, Et), [
949
- [ot, t(Q)]
1273
+ disabled: !S.unselectable,
1274
+ hidden: !S.unselectable
1275
+ }, D(S.placeholder), 9, Pl)) : k("", !0),
1276
+ (p(!0), g(K, null, Le(S.options, (I, oe) => (p(), g("option", {
1277
+ key: oe,
1278
+ disabled: o(be)(I),
1279
+ value: o(re)(I)
1280
+ }, D(o(ve)(I)), 9, Il))), 128))
1281
+ ], 16, El), [
1282
+ [Bt, o(le)]
950
1283
  ]),
951
- t(m) ? (u(), Y(pe, N({
1284
+ o(h) ? (p(), x(ge, j({
952
1285
  key: 1,
953
1286
  class: "vv-select__icon vv-select__icon-after"
954
- }, t(W)), null, 16)) : k("", !0)
1287
+ }, o(q)), null, 16)) : k("", !0)
955
1288
  ]),
956
- y.$slots.after ? (u(), v("div", It, [
957
- A(y.$slots, "after", T(R(t(ee))))
1289
+ S.$slots.after ? (p(), g("div", Bl, [
1290
+ O(S.$slots, "after", T(M(o(se))))
958
1291
  ])) : k("", !0)
959
1292
  ]),
960
- de(t(w), {
961
- id: t(I),
1293
+ pe(o(f), {
1294
+ id: o(C),
962
1295
  class: "vv-select__hint"
963
1296
  }, null, 8, ["id"])
964
1297
  ], 2));
965
1298
  }
966
- }), At = {
967
- ...he,
1299
+ }), Cl = {
1300
+ ...Ve,
968
1301
  value: [String, Number]
969
- }, xt = {
1302
+ }, Nl = {
970
1303
  name: "VvBadge"
971
- }, Ft = /* @__PURE__ */ ce({
972
- ...xt,
973
- props: At,
974
- setup(s) {
975
- const d = s, { modifiers: e } = toRefs(d), c = useBemModifiers("vv-badge", e);
976
- return (g, w) => (u(), v("span", {
977
- class: ve(t(c)),
1304
+ }, Ll = /* @__PURE__ */ ne({
1305
+ ...Nl,
1306
+ props: Cl,
1307
+ setup(t) {
1308
+ const l = t, { modifiers: e } = Q(l), s = me("vv-badge", e);
1309
+ return (n, f) => (p(), g("span", {
1310
+ class: _e(o(s)),
978
1311
  role: "status"
979
1312
  }, [
980
- A(g.$slots, "default", {}, () => [
981
- se(F(g.value), 1)
1313
+ O(n.$slots, "default", {}, () => [
1314
+ J(D(n.value), 1)
982
1315
  ])
983
1316
  ], 2));
984
1317
  }
985
- }), Nt = ["id"], Lt = ["id", "for"], Mt = ["id", "aria-controls", "aria-labelledby", "aria-describedby", "placeholder"], Tt = {
1318
+ }), jl = ["id"], Hl = ["id", "for"], Fl = ["id", "aria-controls", "aria-labelledby", "aria-describedby", "placeholder"], xl = {
986
1319
  key: 0,
987
1320
  class: "vv-select__input-before"
988
- }, Rt = { class: "vv-select__inner" }, jt = ["aria-labelledby", "tabindex"], Wt = ["aria-label", "onClick"], zt = {
1321
+ }, Tl = { class: "vv-select__inner" }, Ml = ["aria-labelledby", "tabindex"], Rl = ["aria-label", "onClick"], Wl = {
989
1322
  key: 1,
990
1323
  class: "vv-select__input-after"
991
- }, qt = { class: "vv-dropdown-action__hint" }, Ht = {
1324
+ }, Kl = {
992
1325
  name: "VvCombobox",
993
- components: { VvDropdown: Ge, VvDropdownItem: Qe }
994
- }, Qt = /* @__PURE__ */ ce({
995
- ...Ht,
996
- props: vt,
997
- emits: pt,
998
- setup(s, { emit: d }) {
999
- const e = s, c = useSlots(), { HintSlot: g } = Xe(e, c), w = ref(null), r = ref(null), V = ref(null), { focused: $ } = useComponentFocus(w, d), { focused: b } = useFocusWithin(V);
1000
- watch($, (l) => {
1326
+ components: { VvDropdown: St, VvDropdownOption: Pe }
1327
+ }, Xl = /* @__PURE__ */ ne({
1328
+ ...Kl,
1329
+ props: ol,
1330
+ emits: ll,
1331
+ setup(t, { emit: l }) {
1332
+ const e = t, s = ot(), { HintSlot: n } = _t(e, s), f = P(null), d = P(null), b = P(null), { focused: v } = Vt(f, l), { focused: y } = Me(b);
1333
+ Y(v, (r) => {
1001
1334
  if (e.autoOpen) {
1002
- if (l && !i.value) {
1003
- P();
1335
+ if (r && !m.value) {
1336
+ E();
1004
1337
  return;
1005
1338
  }
1006
- !l && i.value && !b.value && B();
1339
+ !r && m.value && !y.value && B();
1007
1340
  }
1008
- }), watch(b, (l) => {
1009
- !$.value && !l && i.value && B();
1341
+ }), Y(y, (r) => {
1342
+ !v.value && !r && m.value && B();
1010
1343
  });
1011
- const a = ref(""), n = refDebounced(
1012
- a,
1344
+ const u = P(""), c = zt(
1345
+ u,
1013
1346
  Number(e.debounceSearch)
1014
1347
  );
1015
- watch(
1016
- n,
1017
- () => d("change:search", n.value)
1348
+ Y(
1349
+ c,
1350
+ () => l("change:search", c.value)
1018
1351
  );
1019
- const i = ref(!1), _ = () => {
1020
- e.disabled || e.readonly || (i.value = !i.value);
1021
- }, P = () => {
1022
- e.disabled || e.readonly || i.value || (i.value = !0);
1352
+ const m = P(!1), V = () => {
1353
+ e.disabled || e.readonly || (m.value = !m.value);
1354
+ }, E = () => {
1355
+ e.disabled || e.readonly || m.value || (m.value = !0);
1023
1356
  }, B = () => {
1024
- e.disabled || e.readonly || !i.value || (i.value = !1);
1357
+ e.disabled || e.readonly || !m.value || (m.value = !1);
1025
1358
  };
1026
- watch(i, (l) => {
1027
- z.value && nextTick(() => {
1028
- if (l) {
1029
- r.value && r.value.focus();
1359
+ Y(m, (r) => {
1360
+ U.value && Ee(() => {
1361
+ if (r) {
1362
+ d.value && d.value.focus();
1030
1363
  return;
1031
1364
  }
1032
- a.value = "";
1365
+ u.value = "";
1033
1366
  });
1034
1367
  });
1035
1368
  const {
1036
- id: K,
1037
- icon: L,
1038
- iconPosition: U,
1039
- modifiers: j,
1040
- disabled: I,
1041
- readonly: D,
1042
- loading: x,
1043
- valid: W,
1044
- invalid: J,
1045
- floating: m,
1046
- searchable: z
1047
- } = toRefs(e), O = useUniqueId(K), Z = computed(() => `${O.value}-hint`), re = computed(() => `${O.value}-dropdown`), ie = computed(() => `${O.value}-search`), G = computed(() => `${O.value}-label`), { hasIcon: ee, hasIconBefore: ue, hasIconAfter: te } = useComponentIcon(
1048
- L,
1049
- U
1050
- ), fe = computed(() => !isEmpty(e.modelValue)), Q = computed(() => I.value || D.value ? -1 : e.tabindex), y = useBemModifiers(
1369
+ id: X,
1370
+ icon: R,
1371
+ iconPosition: Z,
1372
+ modifiers: z,
1373
+ disabled: C,
1374
+ readonly: A,
1375
+ loading: H,
1376
+ valid: q,
1377
+ invalid: ee,
1378
+ floating: h,
1379
+ searchable: U
1380
+ } = Q(e), N = Ke(X), ae = i(() => `${N.value}-hint`), ce = i(() => `${N.value}-dropdown`), fe = i(() => `${N.value}-search`), te = i(() => `${N.value}-label`), { hasIcon: se, hasIconBefore: ve, hasIconAfter: re } = wt(
1381
+ R,
1382
+ Z
1383
+ ), be = i(() => !ze(e.modelValue)), le = i(() => C.value || A.value ? -1 : e.tabindex), S = me(
1051
1384
  "vv-select",
1052
- j,
1053
- computed(() => ({
1054
- disabled: I.value,
1055
- loading: x.value,
1056
- readonly: D.value,
1057
- "icon-before": Boolean(ue.value),
1058
- "icon-after": Boolean(te.value),
1059
- valid: W.value,
1060
- invalid: J.value,
1061
- dirty: fe.value,
1062
- focus: $.value,
1063
- floating: m.value
1385
+ z,
1386
+ i(() => ({
1387
+ disabled: C.value,
1388
+ loading: H.value,
1389
+ readonly: A.value,
1390
+ "icon-before": Boolean(ve.value),
1391
+ "icon-after": Boolean(re.value),
1392
+ valid: q.value,
1393
+ invalid: ee.value,
1394
+ dirty: be.value,
1395
+ focus: v.value,
1396
+ floating: h.value
1064
1397
  }))
1065
- ), C = computed(
1066
- () => e.searchable ? o.value : e.options
1067
- ), { getOptionLabel: E, getOptionValue: X, getOptionDisabled: oe } = useOptions(e), o = computed(() => {
1068
- var l;
1069
- return (l = e.options) == null ? void 0 : l.filter((S) => E(S).toLowerCase().includes(n.value.toLowerCase().trim()));
1398
+ ), L = i(
1399
+ () => e.searchable ? a.value : e.options
1400
+ ), { getOptionLabel: I, getOptionValue: oe, getOptionDisabled: we } = $t(e), a = i(() => {
1401
+ var r;
1402
+ return (r = e.options) == null ? void 0 : r.filter(($) => I($).toLowerCase().includes(c.value.toLowerCase().trim()));
1070
1403
  });
1071
- function p(l) {
1072
- return Array.isArray(e.modelValue) ? contains(l, e.modelValue) || contains(X(l), e.modelValue) : equals(l, e.modelValue) || equals(X(l), e.modelValue);
1404
+ function _(r) {
1405
+ return Array.isArray(e.modelValue) ? Oe(r, e.modelValue) || Oe(oe(r), e.modelValue) : Ie(r, e.modelValue) || Ie(oe(r), e.modelValue);
1073
1406
  }
1074
- const M = computed(() => {
1075
- let l = [];
1076
- return Array.isArray(e.modelValue) ? l = e.modelValue : e.modelValue && (l = [e.modelValue]), e.options.filter(
1077
- (S) => l.includes(X(S))
1407
+ const W = i(() => {
1408
+ let r = [];
1409
+ return Array.isArray(e.modelValue) ? r = e.modelValue : e.modelValue && (r = [e.modelValue]), e.options.filter(
1410
+ ($) => r.includes(oe($))
1078
1411
  );
1079
- }), le = computed(() => M.value.map((l) => E(l)).join(e.separator));
1080
- watch(M, () => {
1412
+ }), ie = i(() => W.value.map((r) => I(r)).join(e.separator));
1413
+ Y(W, () => {
1081
1414
  !e.multiple && e.autoClose && B();
1082
1415
  });
1083
- const Ye = () => {
1084
- e.autoOpen ? P() : _();
1085
- }, ye = (l) => {
1086
- var ae;
1416
+ const Ot = () => {
1417
+ e.autoOpen ? E() : V();
1418
+ }, De = (r) => {
1419
+ var ue;
1087
1420
  if (e.disabled || e.readonly)
1088
1421
  return;
1089
- const S = X(l);
1090
- let f = S;
1422
+ const $ = oe(r);
1423
+ let w = $;
1091
1424
  if (e.multiple)
1092
1425
  if (Array.isArray(e.modelValue)) {
1093
- if (e.maxValues !== void 0 && e.maxValues >= 0 && ((ae = e.modelValue) == null ? void 0 : ae.length) >= e.maxValues && !contains(S, e.modelValue))
1426
+ if (e.maxValues !== void 0 && e.maxValues >= 0 && ((ue = e.modelValue) == null ? void 0 : ue.length) >= e.maxValues && !Oe($, e.modelValue))
1094
1427
  return;
1095
- f = contains(S, e.modelValue) ? removeFromList(S, e.modelValue) : [...e.modelValue, S];
1428
+ w = Oe($, e.modelValue) ? hl($, e.modelValue) : [...e.modelValue, $];
1096
1429
  } else
1097
- f = [S];
1430
+ w = [$];
1098
1431
  else
1099
- e.unselectable && S === e.modelValue && (f = void 0);
1100
- d("update:modelValue", f);
1101
- }, Ze = computed(() => ({
1102
- id: O.value,
1432
+ e.unselectable && $ === e.modelValue && (w = void 0);
1433
+ l("update:modelValue", w);
1434
+ }, kt = i(() => ({
1435
+ id: N.value,
1103
1436
  name: e.name,
1104
- tabindex: Q.value,
1105
- valid: W.value,
1437
+ tabindex: le.value,
1438
+ valid: q.value,
1106
1439
  validLabel: e.validLabel,
1107
- invalid: J.value,
1440
+ invalid: ee.value,
1108
1441
  invalidLabel: e.invalidLabel,
1109
1442
  hintLabel: e.hintLabel,
1110
- loading: x.value,
1443
+ loading: H.value,
1111
1444
  loadingLabel: e.loadingLabel,
1112
- disabled: I.value,
1113
- readonly: D.value,
1445
+ disabled: C.value,
1446
+ readonly: A.value,
1114
1447
  modifiers: e.modifiers,
1115
- options: C.value,
1448
+ options: L.value,
1116
1449
  labelKey: e.labelKey,
1117
1450
  valueKey: e.valueKey,
1118
1451
  icon: e.icon,
@@ -1123,9 +1456,9 @@ const St = {
1123
1456
  label: e.label,
1124
1457
  placeholder: e.placeholder,
1125
1458
  modelValue: e.modelValue
1126
- })), et = computed(() => ({
1127
- id: re.value,
1128
- reference: V.value,
1459
+ })), Et = i(() => ({
1460
+ id: ce.value,
1461
+ reference: b.value,
1129
1462
  placement: e.placement,
1130
1463
  transitionName: e.transitionName,
1131
1464
  offset: e.offset,
@@ -1134,160 +1467,183 @@ const St = {
1134
1467
  autoPlacement: e.autoPlacement,
1135
1468
  arrow: e.arrow,
1136
1469
  autoClose: e.autoClose,
1137
- autofocusFirst: z.value ? !1 : e.autofocusFirst,
1470
+ autofocusFirst: U.value ? !1 : e.autofocusFirst,
1138
1471
  triggerWidth: e.triggerWidth,
1139
1472
  modifiers: e.dropdownModifiers
1140
- })), Pe = computed(() => ({
1473
+ })), qe = i(() => ({
1141
1474
  valid: e.valid,
1142
1475
  invalid: e.invalid,
1143
1476
  modelValue: e.modelValue
1144
1477
  }));
1145
- return onKeyStroke([" ", "Enter"], (l) => {
1146
- e.autoOpen || !i.value && $.value && (l.preventDefault(), l.stopImmediatePropagation(), _());
1147
- }), (l, S) => l.native ? (u(), Y(Ct, N({ key: 1 }, t(Ze), {
1148
- "onUpdate:modelValue": S[2] || (S[2] = (f) => d("update:modelValue", f))
1149
- }), null, 16)) : (u(), v("div", {
1478
+ return ye([" ", "Enter"], (r) => {
1479
+ e.autoOpen || !m.value && v.value && (r.preventDefault(), r.stopImmediatePropagation(), V());
1480
+ }), (r, $) => r.native ? (p(), x(Dl, j({ key: 1 }, o(kt), {
1481
+ "onUpdate:modelValue": $[2] || ($[2] = (w) => l("update:modelValue", w))
1482
+ }), null, 16)) : (p(), g("div", {
1150
1483
  key: 0,
1151
- id: t(O),
1152
- class: ve(t(y))
1484
+ id: o(N),
1485
+ class: _e(o(S))
1153
1486
  }, [
1154
- l.label ? (u(), v("label", {
1487
+ r.label ? (p(), g("label", {
1155
1488
  key: 0,
1156
- id: t(G),
1157
- for: t(z) ? t(ie) : void 0
1158
- }, F(l.label), 9, Lt)) : k("", !0),
1159
- H("div", {
1489
+ id: o(te),
1490
+ for: o(U) ? o(fe) : void 0
1491
+ }, D(r.label), 9, Hl)) : k("", !0),
1492
+ G("div", {
1160
1493
  ref_key: "wrapperEl",
1161
- ref: V,
1494
+ ref: b,
1162
1495
  class: "vv-select__wrapper"
1163
1496
  }, [
1164
- de(Ge, N({
1165
- modelValue: t(i),
1166
- "onUpdate:modelValue": S[1] || (S[1] = (f) => _e(i) ? i.value = f : null)
1167
- }, t(et), { role: "listbox" }), lt({
1168
- default: ne(({ aria: f }) => [
1169
- l.$slots.before ? (u(), v("div", Tt, [
1170
- A(l.$slots, "before", T(R(t(Pe))))
1497
+ pe(St, j({
1498
+ modelValue: o(m),
1499
+ "onUpdate:modelValue": $[1] || ($[1] = (w) => Ne(m) ? m.value = w : null)
1500
+ }, o(Et), {
1501
+ role: o(Se).listbox
1502
+ }), At({
1503
+ default: F(({ aria: w }) => [
1504
+ r.$slots.before ? (p(), g("div", xl, [
1505
+ O(r.$slots, "before", T(M(o(qe))))
1171
1506
  ])) : k("", !0),
1172
- H("div", Rt, [
1173
- t(ue) ? (u(), Y(pe, N({
1507
+ G("div", Tl, [
1508
+ o(ve) ? (p(), x(ge, j({
1174
1509
  key: 0,
1175
1510
  class: "vv-select__icon"
1176
- }, t(ee)), null, 16)) : k("", !0),
1177
- H("div", N({
1511
+ }, o(se)), null, 16)) : k("", !0),
1512
+ G("div", j({
1178
1513
  ref_key: "inputEl",
1179
- ref: w
1180
- }, f, {
1181
- "aria-labelledby": t(G),
1514
+ ref: f
1515
+ }, w, {
1516
+ "aria-labelledby": o(te),
1182
1517
  class: "vv-select__input",
1183
1518
  role: "combobox",
1184
- tabindex: t(Q),
1185
- onClickPassive: Ye
1519
+ tabindex: o(le),
1520
+ onClickPassive: Ot
1186
1521
  }), [
1187
- A(l.$slots, "value", T(R({ selectedOptions: t(M), onInput: ye })), () => [
1188
- t(le) ? (u(), v(q, { key: 0 }, [
1189
- l.badges ? (u(!0), v(q, { key: 1 }, Se(t(M), (ae, Ee) => (u(), Y(Ft, {
1190
- key: Ee,
1191
- modifiers: l.badgeModifiers,
1522
+ O(r.$slots, "value", T(M({ selectedOptions: o(W), onInput: De })), () => [
1523
+ o(ie) ? (p(), g(K, { key: 0 }, [
1524
+ r.badges ? (p(!0), g(K, { key: 1 }, Le(o(W), (ue, Ue) => (p(), x(Ll, {
1525
+ key: Ue,
1526
+ modifiers: r.badgeModifiers,
1192
1527
  class: "vv-select__badge"
1193
1528
  }, {
1194
- default: ne(() => [
1195
- se(F(t(E)(ae)) + " ", 1),
1196
- l.unselectable && !t(D) && !t(I) ? (u(), v("button", {
1529
+ default: F(() => [
1530
+ J(D(o(I)(ue)) + " ", 1),
1531
+ r.unselectable && !o(A) && !o(C) ? (p(), g("button", {
1197
1532
  key: 0,
1198
- "aria-label": l.deselectLabel,
1199
- onClick: at((Kt) => ye(ae), ["stop"])
1533
+ "aria-label": r.deselectActionLabel,
1534
+ onClick: Dt((zl) => De(ue), ["stop"])
1200
1535
  }, [
1201
- de(pe, { name: "close" })
1202
- ], 8, Wt)) : k("", !0)
1536
+ pe(ge, { name: "close" })
1537
+ ], 8, Rl)) : k("", !0)
1203
1538
  ]),
1204
1539
  _: 2
1205
- }, 1032, ["modifiers"]))), 128)) : (u(), v(q, { key: 0 }, [
1206
- se(F(t(le)), 1)
1540
+ }, 1032, ["modifiers"]))), 128)) : (p(), g(K, { key: 0 }, [
1541
+ J(D(o(ie)), 1)
1207
1542
  ], 64))
1208
- ], 64)) : (u(), v(q, { key: 1 }, [
1209
- se(F(l.placeholder), 1)
1543
+ ], 64)) : (p(), g(K, { key: 1 }, [
1544
+ J(D(r.placeholder), 1)
1210
1545
  ], 64))
1211
1546
  ])
1212
- ], 16, jt),
1213
- t(te) ? (u(), Y(pe, N({
1547
+ ], 16, Ml),
1548
+ o(re) ? (p(), x(ge, j({
1214
1549
  key: 1,
1215
1550
  class: "vv-select__icon vv-select__icon-after"
1216
- }, t(ee)), null, 16)) : k("", !0)
1551
+ }, o(se)), null, 16)) : k("", !0)
1217
1552
  ]),
1218
- l.$slots.after ? (u(), v("div", zt, [
1219
- A(l.$slots, "after", T(R(t(Pe))))
1553
+ r.$slots.after ? (p(), g("div", Wl, [
1554
+ O(r.$slots, "after", T(M(o(qe))))
1220
1555
  ])) : k("", !0)
1221
1556
  ]),
1222
- items: ne(() => [
1223
- (u(!0), v(q, null, Se(t(o), (f, ae) => (u(), Y(Qe, {
1224
- key: ae,
1225
- class: ve(["vv-dropdown-action", {
1226
- disabled: t(oe)(f),
1227
- selected: p(f),
1228
- "vv-dropdown-action--unselectable": l.unselectable && p(f)
1229
- }]),
1230
- tabindex: t(oe)(f) ? -1 : 0,
1231
- "aria-selected": p(f),
1232
- "aria-disabled": t(oe)(f),
1233
- onClickPassive: (Ee) => ye(f)
1557
+ items: F(() => [
1558
+ o(a).length ? (p(!0), g(K, { key: 0 }, Le(o(a), (w, ue) => (p(), x(Pe, j({
1559
+ disabled: o(we)(w),
1560
+ selected: _(w),
1561
+ unselectable: r.unselectable,
1562
+ deselectHintLabel: r.deselectHintLabel,
1563
+ selectHintLabel: r.selectHintLabel,
1564
+ selectedHintLabel: r.selectedHintLabel
1234
1565
  }, {
1235
- default: ne(() => [
1236
- A(l.$slots, "option", T(R({
1237
- option: f,
1238
- selectedOptions: t(M),
1239
- selected: p(f),
1240
- disabled: t(oe)(f)
1566
+ key: ue,
1567
+ class: "vv-dropdown-option",
1568
+ onClickPassive: (Ue) => De(w)
1569
+ }), {
1570
+ default: F(() => [
1571
+ O(r.$slots, "option", T(M({
1572
+ option: w,
1573
+ selectedOptions: o(W),
1574
+ selected: _(w),
1575
+ disabled: o(we)(w)
1241
1576
  })), () => [
1242
- se(F(t(E)(f)) + " ", 1),
1243
- H("span", qt, [
1244
- p(f) ? (u(), v(q, { key: 0 }, [
1245
- se(F(l.unselectable ? l.pressToDeselectLabel : l.selectedLabel), 1)
1246
- ], 64)) : t(oe)(f) ? k("", !0) : (u(), v(q, { key: 1 }, [
1247
- se(F(l.pressToSelectLabel), 1)
1248
- ], 64))
1249
- ])
1577
+ J(D(o(I)(w)), 1)
1250
1578
  ])
1251
1579
  ]),
1252
1580
  _: 2
1253
- }, 1032, ["tabindex", "class", "aria-selected", "aria-disabled", "onClickPassive"]))), 128))
1581
+ }, 1040, ["onClickPassive"]))), 128)) : r.options.length ? (p(), x(Pe, {
1582
+ key: 2,
1583
+ modifiers: "inert"
1584
+ }, {
1585
+ default: F(() => [
1586
+ O(r.$slots, "no-results", {}, () => [
1587
+ J(D(r.noResultsLabel), 1)
1588
+ ])
1589
+ ]),
1590
+ _: 3
1591
+ })) : (p(), x(Pe, {
1592
+ key: 1,
1593
+ modifiers: "inert"
1594
+ }, {
1595
+ default: F(() => [
1596
+ O(r.$slots, "no-options", {}, () => [
1597
+ J(D(r.noOptionsLabel), 1)
1598
+ ])
1599
+ ]),
1600
+ _: 3
1601
+ }))
1254
1602
  ]),
1255
1603
  _: 2
1256
1604
  }, [
1257
- t(z) ? {
1605
+ o(U) || r.$slots["dropdown::before"] ? {
1258
1606
  name: "before",
1259
- fn: ne(() => [
1260
- t(z) ? ke((u(), v("input", {
1607
+ fn: F(() => [
1608
+ O(r.$slots, "dropdown::before"),
1609
+ o(U) ? Te((p(), g("input", {
1261
1610
  key: 0,
1262
- id: t(ie),
1611
+ id: o(fe),
1263
1612
  ref_key: "inputSearchEl",
1264
- ref: r,
1265
- "onUpdate:modelValue": S[0] || (S[0] = (f) => _e(a) ? a.value = f : null),
1613
+ ref: d,
1614
+ "onUpdate:modelValue": $[0] || ($[0] = (w) => Ne(u) ? u.value = w : null),
1266
1615
  "aria-autocomplete": "list",
1267
- "aria-controls": t(re),
1268
- "aria-labelledby": t(G),
1269
- "aria-describedby": t(Z),
1616
+ "aria-controls": o(ce),
1617
+ "aria-labelledby": o(te),
1618
+ "aria-describedby": o(ae),
1270
1619
  autocomplete: "off",
1271
1620
  spellcheck: "false",
1272
1621
  type: "search",
1273
1622
  class: "vv-dropdown__search",
1274
- placeholder: l.searchPlaceholder
1275
- }, null, 8, Mt)), [
1276
- [xe, t(i)],
1277
- [st, t(a)]
1623
+ placeholder: r.searchPlaceholder
1624
+ }, null, 8, Fl)), [
1625
+ [lt, o(m)],
1626
+ [Ct, o(u)]
1278
1627
  ]) : k("", !0)
1279
1628
  ]),
1280
1629
  key: "0"
1630
+ } : void 0,
1631
+ r.$slots["dropdown::after"] ? {
1632
+ name: "after",
1633
+ fn: F(() => [
1634
+ O(r.$slots, "dropdown::after")
1635
+ ]),
1636
+ key: "1"
1281
1637
  } : void 0
1282
- ]), 1040, ["modelValue"])
1638
+ ]), 1040, ["modelValue", "role"])
1283
1639
  ], 512),
1284
- de(t(g), {
1285
- id: t(Z),
1640
+ pe(o(n), {
1641
+ id: o(ae),
1286
1642
  class: "vv-select__hint"
1287
1643
  }, null, 8, ["id"])
1288
- ], 10, Nt));
1644
+ ], 10, jl));
1289
1645
  }
1290
1646
  });
1291
1647
  export {
1292
- Qt as default
1648
+ Xl as default
1293
1649
  };