@profitliga/ui 2.0.0 → 2.0.2

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 (37) hide show
  1. package/dist/components/BottomSheet/BottomSheet.css +1 -1
  2. package/dist/components/BottomSheet/BottomSheet.vue.js +1 -1
  3. package/dist/components/BottomSheet/BottomSheet.vue2.js +56 -56
  4. package/dist/components/Drawer/Drawer.vue.d.ts +1 -1
  5. package/dist/components/Drawer/Drawer.vue.js +4 -4
  6. package/dist/components/RangeCalendar/RangeCalendar.css +1 -1
  7. package/dist/components/RangeCalendar/RangeCalendar.vue.js +2 -2
  8. package/dist/components/RangeCalendar/RangeCalendar.vue2.js +42 -42
  9. package/dist/components/v2/Checkbox/Checkbox.css +1 -1
  10. package/dist/components/v2/Checkbox/Checkbox.vue.js +2 -2
  11. package/dist/components/v2/Checkbox/Checkbox.vue2.js +26 -26
  12. package/dist/components/v2/Combobox/Combobox.css +1 -1
  13. package/dist/components/v2/Combobox/Combobox.types.d.ts +49 -3
  14. package/dist/components/v2/Combobox/Combobox.vue.d.ts +23 -52
  15. package/dist/components/v2/Combobox/Combobox.vue.js +2 -2
  16. package/dist/components/v2/Combobox/Combobox.vue2.js +219 -193
  17. package/dist/components/v2/DatePicker/DatePicker.vue.d.ts +2 -2
  18. package/dist/components/v2/Divider/Divider.css +1 -1
  19. package/dist/components/v2/Divider/Divider.vue.js +1 -1
  20. package/dist/components/v2/Divider/Divider.vue2.js +10 -10
  21. package/dist/components/v2/DropdownMenu/DropdownMenu.vue.d.ts +2 -2
  22. package/dist/components/v2/File/FilePreviewDialog.vue.d.ts +1 -1
  23. package/dist/components/v2/FileUpload/FileUpload.vue.d.ts +1 -1
  24. package/dist/components/v2/FileUpload/FileUploadInline.vue.d.ts +1 -1
  25. package/dist/components/v2/InputNumber/InputNumber.css +1 -1
  26. package/dist/components/v2/InputNumber/InputNumber.vue.js +2 -2
  27. package/dist/components/v2/InputNumber/InputNumber.vue2.js +2 -2
  28. package/dist/components/v2/InputSelect/InputSelect.vue.d.ts +1 -1
  29. package/dist/components/v2/Popover/Popover.vue.d.ts +1 -1
  30. package/dist/components/v2/Select/Select.css +1 -1
  31. package/dist/components/v2/Select/Select.types.d.ts +50 -3
  32. package/dist/components/v2/Select/Select.vue.d.ts +20 -40
  33. package/dist/components/v2/Select/Select.vue.js +1 -1
  34. package/dist/components/v2/Select/Select.vue2.js +187 -164
  35. package/dist/components/v2/Tooltip/Tooltip.vue.d.ts +1 -1
  36. package/dist/components/v2/Tooltip/TooltipContent.vue.d.ts +1 -1
  37. package/package.json +1 -1
@@ -1,18 +1,18 @@
1
- import { defineComponent as Ee, useModel as ve, useId as Ne, useAttrs as Ve, computed as d, ref as F, useTemplateRef as C, onMounted as De, nextTick as j, onBeforeUnmount as Fe, watch as T, openBlock as r, createElementBlock as f, mergeProps as v, unref as s, toDisplayString as _, createCommentVNode as x, createVNode as S, withCtx as H, createElementVNode as h, Fragment as me, renderList as he, createBlock as Q, resolveDynamicComponent as Le, withModifiers as pe, mergeModels as xe } from "vue";
2
- import { Search as Oe, CircleX as Pe, ChevronDown as We } from "@lucide/vue";
3
- import { breakpoints as Ge } from "../../../utils/breakpoints.util.js";
4
- import ze from "../Input/Input.vue.js";
5
- import Ue from "../Popover/Popover.vue.js";
6
- import Xe from "../Radio/RadioMarker.vue.js";
7
- import qe from "../Select/SelectCheckMarker.vue.js";
8
- import { useTestId as Ke } from "../shared/useTestId.util.js";
9
- const je = ["value", "placeholder", "disabled", "readonly", "aria-labelledby", "aria-label", "aria-describedby", "aria-activedescendant"], He = ["aria-hidden"], Qe = ["src"], Je = { class: "combobox__chip-label" }, Ye = ["disabled", "tabindex", "aria-label", "onClick"], Ze = ["aria-hidden"], ea = ["disabled"], aa = { class: "combobox-list" }, la = {
1
+ import { defineComponent as Ve, useModel as me, useId as De, useAttrs as Fe, computed as d, ref as F, useTemplateRef as C, onMounted as Le, nextTick as H, onBeforeUnmount as Oe, watch as S, openBlock as r, createElementBlock as f, mergeProps as v, unref as s, toDisplayString as _, createCommentVNode as x, createVNode as $, withCtx as Q, createElementVNode as h, renderSlot as L, createTextVNode as he, Fragment as pe, renderList as xe, createBlock as J, resolveDynamicComponent as Pe, withModifiers as ke, mergeModels as ye } from "vue";
2
+ import { Search as We, CircleX as Ge, ChevronDown as ze } from "@lucide/vue";
3
+ import { breakpoints as Ue } from "../../../utils/breakpoints.util.js";
4
+ import Xe from "../Input/Input.vue.js";
5
+ import qe from "../Popover/Popover.vue.js";
6
+ import Ke from "../Radio/RadioMarker.vue.js";
7
+ import je from "../Select/SelectCheckMarker.vue.js";
8
+ import { useTestId as He } from "../shared/useTestId.util.js";
9
+ const Qe = ["value", "placeholder", "disabled", "readonly", "aria-labelledby", "aria-label", "aria-describedby", "aria-activedescendant"], Je = ["aria-hidden"], Ye = ["src"], Ze = { class: "combobox__chip-label" }, ea = ["disabled", "tabindex", "aria-label", "onClick"], aa = ["aria-hidden"], la = ["disabled"], ta = { class: "combobox-list" }, oa = {
10
10
  key: 0,
11
11
  class: "combobox-list__search"
12
- }, ta = ["aria-label", "aria-multiselectable"], oa = ["id", "aria-selected", "aria-disabled", "onClick", "onMouseenter"], ia = { class: "combobox-list__label" }, sa = 64, ma = /* @__PURE__ */ Ee({
12
+ }, ia = ["aria-label", "aria-multiselectable"], sa = ["id", "aria-selected", "aria-disabled", "onClick", "onMouseenter"], na = { class: "combobox-list__label" }, ua = 64, pa = /* @__PURE__ */ Ve({
13
13
  inheritAttrs: !1,
14
14
  __name: "Combobox",
15
- props: /* @__PURE__ */ xe({
15
+ props: /* @__PURE__ */ ye({
16
16
  options: {},
17
17
  multiple: { type: Boolean, default: !1 },
18
18
  filter: { type: Boolean, default: !0 },
@@ -44,35 +44,35 @@ const je = ["value", "placeholder", "disabled", "readonly", "aria-labelledby", "
44
44
  search: { default: "" },
45
45
  searchModifiers: {}
46
46
  }),
47
- emits: /* @__PURE__ */ xe(["change", "select", "search"], ["update:modelValue", "update:search"]),
48
- setup(t, { emit: ke }) {
49
- const o = t, k = ke, A = ve(t, "modelValue"), n = ve(t, "search"), $ = Ne(), J = `combobox-input-${$}`, Y = `combobox-label-${$}`, w = `combobox-list-${$}`, Z = `combobox-message-${$}`, b = Ke(() => o.testId), L = Ve(), ye = d(() => ({
50
- class: L.class,
51
- style: L.style
52
- })), ge = d(() => {
53
- const { class: e, style: a, ...l } = L;
47
+ emits: /* @__PURE__ */ ye(["change", "select", "search"], ["update:modelValue", "update:search"]),
48
+ setup(t, { emit: ge }) {
49
+ const o = t, k = ge, A = me(t, "modelValue"), u = me(t, "search"), B = De(), Y = `combobox-input-${B}`, Z = `combobox-label-${B}`, w = `combobox-list-${B}`, ee = `combobox-message-${B}`, b = He(() => o.testId), O = Fe(), _e = d(() => ({
50
+ class: O.class,
51
+ style: O.style
52
+ })), we = d(() => {
53
+ const { class: e, style: a, ...l } = O;
54
54
  return l;
55
- }), I = Ge.smaller(o.breakpointMobile), c = F(!1), ee = C("fieldRef"), B = C("contentRef"), ae = C("chipsRef"), le = C("counterRef"), O = C("inputRef"), te = C("listRef"), y = F(Number.MAX_SAFE_INTEGER), P = F(0), u = F(-1), g = d(() => {
55
+ }), I = Ue.smaller(o.breakpointMobile), c = F(!1), ae = C("fieldRef"), E = C("contentRef"), le = C("chipsRef"), te = C("counterRef"), P = C("inputRef"), oe = C("listRef"), y = F(Number.MAX_SAFE_INTEGER), W = F(0), n = F(-1), g = d(() => {
56
56
  const e = A.value;
57
57
  return e == null ? [] : Array.isArray(e) ? e : [e];
58
58
  }), R = d(
59
59
  () => o.options.filter((e) => g.value.includes(e.value))
60
- ), W = d(
61
- () => R.value.map((e) => e.label).join(", ")
62
60
  ), G = d(
61
+ () => R.value.map((e) => e.label).join(", ")
62
+ ), z = d(
63
63
  () => o.multiple && R.value.length > 0
64
- ), E = d(
64
+ ), N = d(
65
65
  () => Math.max(0, R.value.length - y.value)
66
- ), _e = d(() => c.value ? n.value : o.multiple ? "" : W.value), we = d(() => G.value ? "" : c.value && !o.multiple && W.value ? W.value : o.placeholder), p = d(() => {
67
- const e = n.value.trim().toLowerCase();
66
+ ), Ce = d(() => c.value ? u.value : o.multiple ? "" : G.value), Ie = d(() => z.value ? "" : c.value && !o.multiple && G.value ? G.value : o.placeholder), p = d(() => {
67
+ const e = u.value.trim().toLowerCase();
68
68
  return !o.filter || !e ? o.options : o.options.filter(
69
69
  (a) => a.label.toLowerCase().includes(e)
70
70
  );
71
- }), z = d(
71
+ }), U = d(
72
72
  () => o.invalid ? o.errorText ?? o.supportText : o.supportText
73
- ), Ce = d(() => o.width ?? P.value), oe = d(
74
- () => c.value && u.value !== -1 ? `${w}-option-${u.value}` : void 0
75
- ), Ie = d(() => [
73
+ ), Re = d(() => o.width ?? W.value), ie = d(
74
+ () => c.value && n.value !== -1 ? `${w}-option-${n.value}` : void 0
75
+ ), Me = d(() => [
76
76
  "combobox",
77
77
  `combobox--${o.size}`,
78
78
  {
@@ -82,120 +82,120 @@ const je = ["value", "placeholder", "disabled", "readonly", "aria-labelledby", "
82
82
  "combobox--multiple": o.multiple
83
83
  }
84
84
  ]);
85
- function N(e) {
85
+ function M(e) {
86
86
  return g.value.includes(e);
87
87
  }
88
- function U(e) {
88
+ function X(e) {
89
89
  const a = p.value[e];
90
90
  return !!a && !a?.disabled;
91
91
  }
92
- function ie() {
93
- return p.value.findIndex((e, a) => U(a));
92
+ function se() {
93
+ return p.value.findIndex((e, a) => X(a));
94
94
  }
95
- function Re() {
95
+ function Te() {
96
96
  for (let e = p.value.length - 1; e >= 0; e -= 1)
97
- if (U(e)) return e;
97
+ if (X(e)) return e;
98
98
  return -1;
99
99
  }
100
- function se(e, a) {
100
+ function ne(e, a) {
101
101
  const l = p.value.length;
102
102
  if (l === 0) return -1;
103
103
  let i = e;
104
104
  for (let m = 0; m < l; m += 1)
105
- if (i = (i + a + l) % l, U(i)) return i;
105
+ if (i = (i + a + l) % l, X(i)) return i;
106
106
  return -1;
107
107
  }
108
- function X() {
109
- I.value || O.value?.focus();
108
+ function q() {
109
+ I.value || P.value?.focus();
110
110
  }
111
- function M() {
111
+ function T() {
112
112
  o.disabled || c.value || (c.value = !0);
113
113
  }
114
114
  function V() {
115
115
  c.value = !1;
116
116
  }
117
- function Me(e) {
118
- e.stopPropagation(), !o.disabled && (M(), X());
117
+ function Se(e) {
118
+ e.stopPropagation(), !o.disabled && (T(), q());
119
119
  }
120
- function Te() {
120
+ function $e() {
121
121
  if (!o.disabled) {
122
122
  if (c.value) {
123
123
  V();
124
124
  return;
125
125
  }
126
- M(), X();
126
+ T(), q();
127
127
  }
128
128
  }
129
- function ne(e) {
129
+ function ue(e) {
130
130
  const a = e.target.value;
131
- n.value = a, k("search", a), M();
131
+ u.value = a, k("search", a), T();
132
132
  }
133
- function Se(e) {
133
+ function Ae(e) {
134
134
  I.value || e.preventDefault();
135
135
  }
136
- function Ae(e, a) {
137
- a || (u.value = e);
136
+ function Be(e, a) {
137
+ a || (n.value = e);
138
138
  }
139
- function ue(e) {
139
+ function re(e) {
140
140
  switch (e.key) {
141
141
  case "ArrowDown":
142
142
  if (e.preventDefault(), !c.value) {
143
- M();
143
+ T();
144
144
  break;
145
145
  }
146
- u.value = se(u.value, 1);
146
+ n.value = ne(n.value, 1);
147
147
  break;
148
148
  case "ArrowUp":
149
149
  if (e.preventDefault(), !c.value) {
150
- M();
150
+ T();
151
151
  break;
152
152
  }
153
- u.value = u.value === -1 ? Re() : se(u.value, -1);
153
+ n.value = n.value === -1 ? Te() : ne(n.value, -1);
154
154
  break;
155
155
  case "Enter": {
156
156
  if (!c.value) break;
157
- const a = p.value[u.value];
157
+ const a = p.value[n.value];
158
158
  if (!a) break;
159
- e.preventDefault(), re(a);
159
+ e.preventDefault(), ce(a);
160
160
  break;
161
161
  }
162
162
  case "Escape":
163
163
  if (c.value) {
164
- n.value = "";
164
+ u.value = "";
165
165
  break;
166
166
  }
167
- n.value && (n.value = "");
167
+ u.value && (u.value = "");
168
168
  break;
169
169
  case "Tab":
170
170
  V();
171
171
  break;
172
172
  case "Backspace": {
173
- if (!o.multiple || n.value) break;
173
+ if (!o.multiple || u.value) break;
174
174
  const a = g.value[g.value.length - 1];
175
175
  if (a === void 0) break;
176
- ce(a);
176
+ de(a);
177
177
  break;
178
178
  }
179
179
  }
180
180
  }
181
- function re(e) {
181
+ function ce(e) {
182
182
  if (!(e.disabled || o.disabled)) {
183
183
  if (o.multiple) {
184
- const a = N(e.value) ? g.value.filter((l) => l !== e.value) : [...g.value, e.value];
185
- A.value = a, k("change", a), n.value && (n.value = "", k("search", "")), X();
184
+ const a = M(e.value) ? g.value.filter((l) => l !== e.value) : [...g.value, e.value];
185
+ A.value = a, k("change", a), u.value && (u.value = "", k("search", "")), q();
186
186
  } else
187
- A.value = e.value, k("change", e.value), V(), I.value || O.value?.focus();
187
+ A.value = e.value, k("change", e.value), V(), I.value || P.value?.focus();
188
188
  k("select", e);
189
189
  }
190
190
  }
191
- function ce(e) {
191
+ function de(e) {
192
192
  if (o.disabled) return;
193
193
  const a = g.value.filter((l) => l !== e);
194
194
  A.value = a, k("change", a);
195
195
  }
196
- function q() {
196
+ function K() {
197
197
  if (!o.multiple) return;
198
- const e = B.value, a = ae.value;
198
+ const e = E.value, a = le.value;
199
199
  if (!e || !a) return;
200
200
  const l = Array.from(
201
201
  a.querySelectorAll('[data-chip="item"]')
@@ -204,58 +204,58 @@ const je = ["value", "placeholder", "disabled", "readonly", "aria-labelledby", "
204
204
  y.value = Number.MAX_SAFE_INTEGER;
205
205
  return;
206
206
  }
207
- const i = Number.parseFloat(getComputedStyle(a).columnGap) || 0, m = Number.parseFloat(getComputedStyle(e).columnGap) || 0, de = E.value ? (le.value?.offsetWidth ?? 0) + m : 0, $e = e.clientWidth - de - sa - m;
208
- let be = 0, K = 0;
209
- for (const Be of l) {
210
- const fe = be + (K ? i : 0) + Be.offsetWidth;
211
- if (fe > $e) break;
212
- be = fe, K += 1;
207
+ const i = Number.parseFloat(getComputedStyle(a).columnGap) || 0, m = Number.parseFloat(getComputedStyle(e).columnGap) || 0, be = N.value ? (te.value?.offsetWidth ?? 0) + m : 0, Ee = e.clientWidth - be - ua - m;
208
+ let fe = 0, j = 0;
209
+ for (const Ne of l) {
210
+ const ve = fe + (j ? i : 0) + Ne.offsetWidth;
211
+ if (ve > Ee) break;
212
+ fe = ve, j += 1;
213
213
  }
214
- y.value = Math.max(K, 1);
214
+ y.value = Math.max(j, 1);
215
215
  }
216
216
  let D;
217
- return De(() => {
218
- const e = ee.value;
219
- e && (P.value = e.getBoundingClientRect().width, j(q), D = new ResizeObserver((a) => {
217
+ return Le(() => {
218
+ const e = ae.value;
219
+ e && (W.value = e.getBoundingClientRect().width, H(K), D = new ResizeObserver((a) => {
220
220
  for (const l of a)
221
- l.target === e && (P.value = l.borderBoxSize?.[0]?.inlineSize ?? e.getBoundingClientRect().width);
222
- q();
223
- }), D.observe(e), B.value && D.observe(B.value));
224
- }), Fe(() => D?.disconnect()), T(
221
+ l.target === e && (W.value = l.borderBoxSize?.[0]?.inlineSize ?? e.getBoundingClientRect().width);
222
+ K();
223
+ }), D.observe(e), E.value && D.observe(E.value));
224
+ }), Oe(() => D?.disconnect()), S(
225
225
  () => R.value.map((e) => e.value).join("|"),
226
226
  () => {
227
- y.value = Number.MAX_SAFE_INTEGER, j(q);
227
+ y.value = Number.MAX_SAFE_INTEGER, H(K);
228
228
  }
229
- ), T([p, n], () => {
230
- u.value = n.value ? ie() : -1;
231
- }), T(c, (e) => {
229
+ ), S([p, u], () => {
230
+ n.value = u.value ? se() : -1;
231
+ }), S(c, (e) => {
232
232
  if (e) {
233
- u.value = n.value ? ie() : -1;
233
+ n.value = u.value ? se() : -1;
234
234
  return;
235
235
  }
236
- u.value = -1, n.value && (n.value = "", k("search", ""));
237
- }), T(u, (e) => {
238
- e !== -1 && j(() => {
239
- te.value?.querySelector(
236
+ n.value = -1, u.value && (u.value = "", k("search", ""));
237
+ }), S(n, (e) => {
238
+ e !== -1 && H(() => {
239
+ oe.value?.querySelector(
240
240
  `#${CSS.escape(`${w}-option-${e}`)}`
241
241
  )?.scrollIntoView({ block: "nearest" });
242
242
  });
243
- }), T(
243
+ }), S(
244
244
  () => o.disabled,
245
245
  (e) => {
246
246
  e && V();
247
247
  }
248
- ), (e, a) => (r(), f("div", v({ class: Ie.value }, { ...ye.value, ...s(b)("root") }), [
248
+ ), (e, a) => (r(), f("div", v({ class: Me.value }, { ..._e.value, ...s(b)("root") }), [
249
249
  t.label ? (r(), f("label", v({
250
250
  key: 0,
251
- id: Y,
251
+ id: Z,
252
252
  class: "combobox__label",
253
- for: J
253
+ for: Y
254
254
  }, s(b)("label")), _(t.label), 17)) : x("", !0),
255
- S(s(Ue), {
255
+ $(s(qe), {
256
256
  open: c.value,
257
257
  "onUpdate:open": a[1] || (a[1] = (l) => c.value = l),
258
- width: Ce.value,
258
+ width: Re.value,
259
259
  side: t.side,
260
260
  "side-offset": t.sideOffset,
261
261
  align: t.align,
@@ -267,50 +267,50 @@ const je = ["value", "placeholder", "disabled", "readonly", "aria-labelledby", "
267
267
  "trap-focus": !1,
268
268
  "test-id": t.testId
269
269
  }, {
270
- trigger: H(({ props: l }) => [
270
+ trigger: Q(({ props: l }) => [
271
271
  h("div", v({
272
272
  ref_key: "fieldRef",
273
- ref: ee,
273
+ ref: ae,
274
274
  class: "combobox__field"
275
- }, s(b)("field"), { onClick: Me }), [
275
+ }, s(b)("field"), { onClick: Se }), [
276
276
  h("div", {
277
277
  ref_key: "contentRef",
278
- ref: B,
278
+ ref: E,
279
279
  class: "combobox__content"
280
280
  }, [
281
281
  h("input", v({
282
- id: J,
282
+ id: Y,
283
283
  ref_key: "inputRef",
284
- ref: O,
284
+ ref: P,
285
285
  role: "combobox",
286
286
  type: "text",
287
287
  class: "combobox__input",
288
288
  autocomplete: "off",
289
289
  spellcheck: "false",
290
290
  "aria-autocomplete": "list",
291
- value: _e.value,
292
- placeholder: we.value,
291
+ value: Ce.value,
292
+ placeholder: Ie.value,
293
293
  disabled: t.disabled,
294
294
  readonly: s(I),
295
- "aria-labelledby": t.label ? Y : void 0,
295
+ "aria-labelledby": t.label ? Z : void 0,
296
296
  "aria-label": t.label ? void 0 : t.ariaLabel,
297
- "aria-describedby": z.value ? Z : void 0,
298
- "aria-activedescendant": oe.value
297
+ "aria-describedby": U.value ? ee : void 0,
298
+ "aria-activedescendant": ie.value
299
299
  }, {
300
300
  ...l,
301
- ...ge.value,
301
+ ...we.value,
302
302
  ...s(b)("input")
303
303
  }, {
304
- onInput: ne,
305
- onKeydown: ue
306
- }), null, 16, je),
307
- G.value ? (r(), f("span", {
304
+ onInput: ue,
305
+ onKeydown: re
306
+ }), null, 16, Qe),
307
+ z.value ? (r(), f("span", {
308
308
  key: 0,
309
309
  ref_key: "chipsRef",
310
- ref: ae,
310
+ ref: le,
311
311
  class: "combobox__chips"
312
312
  }, [
313
- (r(!0), f(me, null, he(R.value, (i, m) => (r(), f("span", v({
313
+ (r(!0), f(pe, null, xe(R.value, (i, m) => (r(), f("span", v({
314
314
  key: i.value,
315
315
  "data-chip": "item",
316
316
  class: ["combobox__chip", {
@@ -318,17 +318,22 @@ const je = ["value", "placeholder", "disabled", "readonly", "aria-labelledby", "
318
318
  }],
319
319
  "aria-hidden": m >= y.value || void 0
320
320
  }, { ref_for: !0 }, s(b)("chip", i.value)), [
321
- i.avatar ? (r(), f("img", {
322
- key: 0,
323
- class: "combobox__chip-avatar",
324
- src: i.avatar,
325
- alt: ""
326
- }, null, 8, Qe)) : i.icon ? (r(), Q(Le(i.icon), {
327
- key: 1,
328
- class: "combobox__chip-icon",
329
- "aria-hidden": "true"
330
- })) : x("", !0),
331
- h("span", Je, _(i.label), 1),
321
+ L(e.$slots, "chip", {
322
+ option: i,
323
+ index: m
324
+ }, () => [
325
+ i.avatar ? (r(), f("img", {
326
+ key: 0,
327
+ class: "combobox__chip-avatar",
328
+ src: i.avatar,
329
+ alt: ""
330
+ }, null, 8, Ye)) : i.icon ? (r(), J(Pe(i.icon), {
331
+ key: 1,
332
+ class: "combobox__chip-icon",
333
+ "aria-hidden": "true"
334
+ })) : x("", !0),
335
+ h("span", Ze, _(i.label), 1)
336
+ ], !0),
332
337
  h("button", v({
333
338
  type: "button",
334
339
  class: "combobox__chip-remove",
@@ -336,24 +341,24 @@ const je = ["value", "placeholder", "disabled", "readonly", "aria-labelledby", "
336
341
  tabindex: m >= y.value ? -1 : void 0,
337
342
  "aria-label": `Убрать ${i.label}`
338
343
  }, { ref_for: !0 }, s(b)("chip-remove", i.value), {
339
- onClick: pe((de) => ce(i.value), ["stop"])
344
+ onClick: ke((be) => de(i.value), ["stop"])
340
345
  }), [
341
- S(s(Pe), {
346
+ $(s(Ge), {
342
347
  class: "combobox__chip-icon",
343
348
  "aria-hidden": "true"
344
349
  })
345
- ], 16, Ye)
346
- ], 16, He))), 128))
350
+ ], 16, ea)
351
+ ], 16, Je))), 128))
347
352
  ], 512)) : x("", !0),
348
- G.value ? (r(), f("span", v({
353
+ z.value ? (r(), f("span", v({
349
354
  key: 1,
350
355
  ref_key: "counterRef",
351
- ref: le,
356
+ ref: te,
352
357
  class: ["combobox__chip combobox__chip--counter", {
353
- "combobox__chip--measured": !E.value
358
+ "combobox__chip--measured": !N.value
354
359
  }],
355
- "aria-hidden": !E.value || void 0
356
- }, s(b)("chip-counter")), " +" + _(E.value || 1), 17, Ze)) : x("", !0)
360
+ "aria-hidden": !N.value || void 0
361
+ }, s(b)("chip-counter")), " +" + _(N.value || 1), 17, aa)) : x("", !0)
357
362
  ], 512),
358
363
  h("button", v({
359
364
  type: "button",
@@ -362,94 +367,115 @@ const je = ["value", "placeholder", "disabled", "readonly", "aria-labelledby", "
362
367
  "aria-hidden": "true",
363
368
  disabled: t.disabled
364
369
  }, s(b)("arrow"), {
365
- onClick: pe(Te, ["stop"])
370
+ onClick: ke($e, ["stop"])
366
371
  }), [
367
- S(s(We), { class: "combobox__arrow" })
368
- ], 16, ea)
372
+ $(s(ze), { class: "combobox__arrow" })
373
+ ], 16, la)
369
374
  ], 16)
370
375
  ]),
371
- default: H(() => [
372
- h("div", aa, [
373
- s(I) ? (r(), f("div", la, [
374
- S(s(ze), v({
375
- modelValue: n.value,
376
- "onUpdate:modelValue": a[0] || (a[0] = (l) => n.value = l),
376
+ default: Q(() => [
377
+ h("div", ta, [
378
+ s(I) ? (r(), f("div", oa, [
379
+ $(s(Xe), v({
380
+ modelValue: u.value,
381
+ "onUpdate:modelValue": a[0] || (a[0] = (l) => u.value = l),
377
382
  "native-type": "search",
378
383
  placeholder: t.searchPlaceholder,
379
384
  "aria-label": t.searchPlaceholder,
380
385
  "aria-controls": w,
381
- "aria-activedescendant": oe.value,
386
+ "aria-activedescendant": ie.value,
382
387
  "aria-autocomplete": "list",
383
388
  autocomplete: "off",
384
389
  spellcheck: "false"
385
390
  }, s(b)("search"), {
386
- onInput: ne,
387
- onKeydown: ue
391
+ onInput: ue,
392
+ onKeydown: re
388
393
  }), {
389
- prefix: H(() => [
390
- S(s(Oe), { "aria-hidden": "true" })
394
+ prefix: Q(() => [
395
+ $(s(We), { "aria-hidden": "true" })
391
396
  ]),
392
397
  _: 1
393
398
  }, 16, ["modelValue", "placeholder", "aria-label", "aria-activedescendant"])
394
399
  ])) : x("", !0),
395
400
  h("div", {
396
- id: w,
397
401
  ref_key: "listRef",
398
- ref: te,
399
- role: "listbox",
400
- "aria-label": t.label ?? t.ariaLabel,
401
- "aria-multiselectable": t.multiple || void 0,
402
- class: "combobox-list__options",
403
- onMousedown: Se
402
+ ref: oe,
403
+ class: "combobox-list__scroll",
404
+ onMousedown: Ae
404
405
  }, [
405
- t.loading ? (r(), f("p", v({
406
- key: 0,
407
- class: "combobox-list__status"
408
- }, s(b)("loading")), _(t.loadingText), 17)) : x("", !0),
409
- (r(!0), f(me, null, he(p.value, (l, i) => (r(), f("div", v({
410
- id: `${w}-option-${i}`,
411
- key: l.value,
412
- role: "option",
413
- class: ["combobox-list__option", {
414
- "combobox-list__option--active": u.value === i,
415
- "combobox-list__option--disabled": l.disabled
416
- }],
417
- "aria-selected": N(l.value),
418
- "aria-disabled": l.disabled || void 0
419
- }, { ref_for: !0 }, s(b)("option", l.value), {
420
- onClick: (m) => re(l),
421
- onMouseenter: (m) => Ae(i, l.disabled)
422
- }), [
423
- t.multiple ? (r(), Q(qe, {
406
+ h("div", {
407
+ id: w,
408
+ role: "listbox",
409
+ "aria-label": t.label ?? t.ariaLabel,
410
+ "aria-multiselectable": t.multiple || void 0,
411
+ class: "combobox-list__options"
412
+ }, [
413
+ t.loading ? (r(), f("p", v({
424
414
  key: 0,
425
- checked: N(l.value),
426
- disabled: l.disabled,
427
- state: u.value === i ? "hover" : "default"
428
- }, null, 8, ["checked", "disabled", "state"])) : (r(), Q(s(Xe), {
415
+ class: "combobox-list__status"
416
+ }, s(b)("loading")), [
417
+ L(e.$slots, "loading", {}, () => [
418
+ he(_(t.loadingText), 1)
419
+ ], !0)
420
+ ], 16)) : x("", !0),
421
+ (r(!0), f(pe, null, xe(p.value, (l, i) => (r(), f("div", v({
422
+ id: `${w}-option-${i}`,
423
+ key: l.value,
424
+ role: "option",
425
+ class: ["combobox-list__option", {
426
+ "combobox-list__option--active": n.value === i,
427
+ "combobox-list__option--disabled": l.disabled
428
+ }],
429
+ "aria-selected": M(l.value),
430
+ "aria-disabled": l.disabled || void 0
431
+ }, { ref_for: !0 }, s(b)("option", l.value), {
432
+ onClick: (m) => ce(l),
433
+ onMouseenter: (m) => Be(i, l.disabled)
434
+ }), [
435
+ t.multiple ? (r(), J(je, {
436
+ key: 0,
437
+ checked: M(l.value),
438
+ disabled: l.disabled,
439
+ state: n.value === i ? "hover" : "default"
440
+ }, null, 8, ["checked", "disabled", "state"])) : (r(), J(s(Ke), {
441
+ key: 1,
442
+ checked: M(l.value),
443
+ disabled: l.disabled,
444
+ state: n.value === i ? "hover" : "default"
445
+ }, null, 8, ["checked", "disabled", "state"])),
446
+ L(e.$slots, "option", {
447
+ option: l,
448
+ selected: M(l.value),
449
+ active: n.value === i,
450
+ index: i
451
+ }, () => [
452
+ h("span", na, _(l.label), 1)
453
+ ], !0)
454
+ ], 16, sa))), 128)),
455
+ !t.loading && !p.value.length ? (r(), f("p", v({
429
456
  key: 1,
430
- checked: N(l.value),
431
- disabled: l.disabled,
432
- state: u.value === i ? "hover" : "default"
433
- }, null, 8, ["checked", "disabled", "state"])),
434
- h("span", ia, _(l.label), 1)
435
- ], 16, oa))), 128)),
436
- !t.loading && !p.value.length ? (r(), f("p", v({
437
- key: 1,
438
- class: "combobox-list__status"
439
- }, s(b)("empty")), _(t.options.length ? t.notFoundText : t.emptyText), 17)) : x("", !0)
440
- ], 40, ta)
457
+ class: "combobox-list__status"
458
+ }, s(b)("empty")), [
459
+ L(e.$slots, "empty", {
460
+ notFound: !!t.options.length
461
+ }, () => [
462
+ he(_(t.options.length ? t.notFoundText : t.emptyText), 1)
463
+ ], !0)
464
+ ], 16)) : x("", !0)
465
+ ], 8, ia)
466
+ ], 544)
441
467
  ])
442
468
  ]),
443
- _: 1
469
+ _: 3
444
470
  }, 8, ["open", "width", "side", "side-offset", "align", "align-offset", "breakpoint-mobile", "test-id"]),
445
- z.value ? (r(), f("p", v({
471
+ U.value ? (r(), f("p", v({
446
472
  key: 1,
447
- id: Z,
473
+ id: ee,
448
474
  class: "combobox__message"
449
- }, s(b)("message")), _(z.value), 17)) : x("", !0)
475
+ }, s(b)("message")), _(U.value), 17)) : x("", !0)
450
476
  ], 16));
451
477
  }
452
478
  });
453
479
  export {
454
- ma as default
480
+ pa as default
455
481
  };