@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.
- package/dist/components/BottomSheet/BottomSheet.css +1 -1
- package/dist/components/BottomSheet/BottomSheet.vue.js +1 -1
- package/dist/components/BottomSheet/BottomSheet.vue2.js +56 -56
- package/dist/components/Drawer/Drawer.vue.d.ts +1 -1
- package/dist/components/Drawer/Drawer.vue.js +4 -4
- package/dist/components/RangeCalendar/RangeCalendar.css +1 -1
- package/dist/components/RangeCalendar/RangeCalendar.vue.js +2 -2
- package/dist/components/RangeCalendar/RangeCalendar.vue2.js +42 -42
- package/dist/components/v2/Checkbox/Checkbox.css +1 -1
- package/dist/components/v2/Checkbox/Checkbox.vue.js +2 -2
- package/dist/components/v2/Checkbox/Checkbox.vue2.js +26 -26
- package/dist/components/v2/Combobox/Combobox.css +1 -1
- package/dist/components/v2/Combobox/Combobox.types.d.ts +49 -3
- package/dist/components/v2/Combobox/Combobox.vue.d.ts +23 -52
- package/dist/components/v2/Combobox/Combobox.vue.js +2 -2
- package/dist/components/v2/Combobox/Combobox.vue2.js +219 -193
- package/dist/components/v2/DatePicker/DatePicker.vue.d.ts +2 -2
- package/dist/components/v2/Divider/Divider.css +1 -1
- package/dist/components/v2/Divider/Divider.vue.js +1 -1
- package/dist/components/v2/Divider/Divider.vue2.js +10 -10
- package/dist/components/v2/DropdownMenu/DropdownMenu.vue.d.ts +2 -2
- package/dist/components/v2/File/FilePreviewDialog.vue.d.ts +1 -1
- package/dist/components/v2/FileUpload/FileUpload.vue.d.ts +1 -1
- package/dist/components/v2/FileUpload/FileUploadInline.vue.d.ts +1 -1
- package/dist/components/v2/InputNumber/InputNumber.css +1 -1
- package/dist/components/v2/InputNumber/InputNumber.vue.js +2 -2
- package/dist/components/v2/InputNumber/InputNumber.vue2.js +2 -2
- package/dist/components/v2/InputSelect/InputSelect.vue.d.ts +1 -1
- package/dist/components/v2/Popover/Popover.vue.d.ts +1 -1
- package/dist/components/v2/Select/Select.css +1 -1
- package/dist/components/v2/Select/Select.types.d.ts +50 -3
- package/dist/components/v2/Select/Select.vue.d.ts +20 -40
- package/dist/components/v2/Select/Select.vue.js +1 -1
- package/dist/components/v2/Select/Select.vue2.js +187 -164
- package/dist/components/v2/Tooltip/Tooltip.vue.d.ts +1 -1
- package/dist/components/v2/Tooltip/TooltipContent.vue.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Search as
|
|
3
|
-
import { breakpoints as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { useTestId as
|
|
9
|
-
const
|
|
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
|
-
},
|
|
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__ */
|
|
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__ */
|
|
48
|
-
setup(t, { emit:
|
|
49
|
-
const o = t, k =
|
|
50
|
-
class:
|
|
51
|
-
style:
|
|
52
|
-
})),
|
|
53
|
-
const { class: e, style: a, ...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 =
|
|
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
|
-
),
|
|
64
|
+
), N = d(
|
|
65
65
|
() => Math.max(0, R.value.length - y.value)
|
|
66
|
-
),
|
|
67
|
-
const e =
|
|
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
|
-
}),
|
|
71
|
+
}), U = d(
|
|
72
72
|
() => o.invalid ? o.errorText ?? o.supportText : o.supportText
|
|
73
|
-
),
|
|
74
|
-
() => c.value &&
|
|
75
|
-
),
|
|
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
|
|
85
|
+
function M(e) {
|
|
86
86
|
return g.value.includes(e);
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function X(e) {
|
|
89
89
|
const a = p.value[e];
|
|
90
90
|
return !!a && !a?.disabled;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
return p.value.findIndex((e, a) =>
|
|
92
|
+
function se() {
|
|
93
|
+
return p.value.findIndex((e, a) => X(a));
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function Te() {
|
|
96
96
|
for (let e = p.value.length - 1; e >= 0; e -= 1)
|
|
97
|
-
if (
|
|
97
|
+
if (X(e)) return e;
|
|
98
98
|
return -1;
|
|
99
99
|
}
|
|
100
|
-
function
|
|
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,
|
|
105
|
+
if (i = (i + a + l) % l, X(i)) return i;
|
|
106
106
|
return -1;
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
I.value ||
|
|
108
|
+
function q() {
|
|
109
|
+
I.value || P.value?.focus();
|
|
110
110
|
}
|
|
111
|
-
function
|
|
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
|
|
118
|
-
e.stopPropagation(), !o.disabled && (
|
|
117
|
+
function Se(e) {
|
|
118
|
+
e.stopPropagation(), !o.disabled && (T(), q());
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function $e() {
|
|
121
121
|
if (!o.disabled) {
|
|
122
122
|
if (c.value) {
|
|
123
123
|
V();
|
|
124
124
|
return;
|
|
125
125
|
}
|
|
126
|
-
|
|
126
|
+
T(), q();
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function ue(e) {
|
|
130
130
|
const a = e.target.value;
|
|
131
|
-
|
|
131
|
+
u.value = a, k("search", a), T();
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function Ae(e) {
|
|
134
134
|
I.value || e.preventDefault();
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
a || (
|
|
136
|
+
function Be(e, a) {
|
|
137
|
+
a || (n.value = e);
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function re(e) {
|
|
140
140
|
switch (e.key) {
|
|
141
141
|
case "ArrowDown":
|
|
142
142
|
if (e.preventDefault(), !c.value) {
|
|
143
|
-
|
|
143
|
+
T();
|
|
144
144
|
break;
|
|
145
145
|
}
|
|
146
|
-
|
|
146
|
+
n.value = ne(n.value, 1);
|
|
147
147
|
break;
|
|
148
148
|
case "ArrowUp":
|
|
149
149
|
if (e.preventDefault(), !c.value) {
|
|
150
|
-
|
|
150
|
+
T();
|
|
151
151
|
break;
|
|
152
152
|
}
|
|
153
|
-
|
|
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[
|
|
157
|
+
const a = p.value[n.value];
|
|
158
158
|
if (!a) break;
|
|
159
|
-
e.preventDefault(),
|
|
159
|
+
e.preventDefault(), ce(a);
|
|
160
160
|
break;
|
|
161
161
|
}
|
|
162
162
|
case "Escape":
|
|
163
163
|
if (c.value) {
|
|
164
|
-
|
|
164
|
+
u.value = "";
|
|
165
165
|
break;
|
|
166
166
|
}
|
|
167
|
-
|
|
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 ||
|
|
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
|
-
|
|
176
|
+
de(a);
|
|
177
177
|
break;
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function ce(e) {
|
|
182
182
|
if (!(e.disabled || o.disabled)) {
|
|
183
183
|
if (o.multiple) {
|
|
184
|
-
const a =
|
|
185
|
-
A.value = a, k("change", a),
|
|
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 ||
|
|
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
|
|
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
|
|
196
|
+
function K() {
|
|
197
197
|
if (!o.multiple) return;
|
|
198
|
-
const e =
|
|
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,
|
|
208
|
-
let
|
|
209
|
-
for (const
|
|
210
|
-
const
|
|
211
|
-
if (
|
|
212
|
-
|
|
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(
|
|
214
|
+
y.value = Math.max(j, 1);
|
|
215
215
|
}
|
|
216
216
|
let D;
|
|
217
|
-
return
|
|
218
|
-
const e =
|
|
219
|
-
e && (
|
|
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 && (
|
|
222
|
-
|
|
223
|
-
}), D.observe(e),
|
|
224
|
-
}),
|
|
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,
|
|
227
|
+
y.value = Number.MAX_SAFE_INTEGER, H(K);
|
|
228
228
|
}
|
|
229
|
-
),
|
|
230
|
-
|
|
231
|
-
}),
|
|
229
|
+
), S([p, u], () => {
|
|
230
|
+
n.value = u.value ? se() : -1;
|
|
231
|
+
}), S(c, (e) => {
|
|
232
232
|
if (e) {
|
|
233
|
-
|
|
233
|
+
n.value = u.value ? se() : -1;
|
|
234
234
|
return;
|
|
235
235
|
}
|
|
236
|
-
|
|
237
|
-
}),
|
|
238
|
-
e !== -1 &&
|
|
239
|
-
|
|
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
|
-
}),
|
|
243
|
+
}), S(
|
|
244
244
|
() => o.disabled,
|
|
245
245
|
(e) => {
|
|
246
246
|
e && V();
|
|
247
247
|
}
|
|
248
|
-
), (e, a) => (r(), f("div", v({ class:
|
|
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:
|
|
251
|
+
id: Z,
|
|
252
252
|
class: "combobox__label",
|
|
253
|
-
for:
|
|
253
|
+
for: Y
|
|
254
254
|
}, s(b)("label")), _(t.label), 17)) : x("", !0),
|
|
255
|
-
|
|
255
|
+
$(s(qe), {
|
|
256
256
|
open: c.value,
|
|
257
257
|
"onUpdate:open": a[1] || (a[1] = (l) => c.value = l),
|
|
258
|
-
width:
|
|
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:
|
|
270
|
+
trigger: Q(({ props: l }) => [
|
|
271
271
|
h("div", v({
|
|
272
272
|
ref_key: "fieldRef",
|
|
273
|
-
ref:
|
|
273
|
+
ref: ae,
|
|
274
274
|
class: "combobox__field"
|
|
275
|
-
}, s(b)("field"), { onClick:
|
|
275
|
+
}, s(b)("field"), { onClick: Se }), [
|
|
276
276
|
h("div", {
|
|
277
277
|
ref_key: "contentRef",
|
|
278
|
-
ref:
|
|
278
|
+
ref: E,
|
|
279
279
|
class: "combobox__content"
|
|
280
280
|
}, [
|
|
281
281
|
h("input", v({
|
|
282
|
-
id:
|
|
282
|
+
id: Y,
|
|
283
283
|
ref_key: "inputRef",
|
|
284
|
-
ref:
|
|
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:
|
|
292
|
-
placeholder:
|
|
291
|
+
value: Ce.value,
|
|
292
|
+
placeholder: Ie.value,
|
|
293
293
|
disabled: t.disabled,
|
|
294
294
|
readonly: s(I),
|
|
295
|
-
"aria-labelledby": t.label ?
|
|
295
|
+
"aria-labelledby": t.label ? Z : void 0,
|
|
296
296
|
"aria-label": t.label ? void 0 : t.ariaLabel,
|
|
297
|
-
"aria-describedby":
|
|
298
|
-
"aria-activedescendant":
|
|
297
|
+
"aria-describedby": U.value ? ee : void 0,
|
|
298
|
+
"aria-activedescendant": ie.value
|
|
299
299
|
}, {
|
|
300
300
|
...l,
|
|
301
|
-
...
|
|
301
|
+
...we.value,
|
|
302
302
|
...s(b)("input")
|
|
303
303
|
}, {
|
|
304
|
-
onInput:
|
|
305
|
-
onKeydown:
|
|
306
|
-
}), null, 16,
|
|
307
|
-
|
|
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:
|
|
310
|
+
ref: le,
|
|
311
311
|
class: "combobox__chips"
|
|
312
312
|
}, [
|
|
313
|
-
(r(!0), f(
|
|
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
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
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:
|
|
344
|
+
onClick: ke((be) => de(i.value), ["stop"])
|
|
340
345
|
}), [
|
|
341
|
-
|
|
346
|
+
$(s(Ge), {
|
|
342
347
|
class: "combobox__chip-icon",
|
|
343
348
|
"aria-hidden": "true"
|
|
344
349
|
})
|
|
345
|
-
], 16,
|
|
346
|
-
], 16,
|
|
350
|
+
], 16, ea)
|
|
351
|
+
], 16, Je))), 128))
|
|
347
352
|
], 512)) : x("", !0),
|
|
348
|
-
|
|
353
|
+
z.value ? (r(), f("span", v({
|
|
349
354
|
key: 1,
|
|
350
355
|
ref_key: "counterRef",
|
|
351
|
-
ref:
|
|
356
|
+
ref: te,
|
|
352
357
|
class: ["combobox__chip combobox__chip--counter", {
|
|
353
|
-
"combobox__chip--measured": !
|
|
358
|
+
"combobox__chip--measured": !N.value
|
|
354
359
|
}],
|
|
355
|
-
"aria-hidden": !
|
|
356
|
-
}, s(b)("chip-counter")), " +" + _(
|
|
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:
|
|
370
|
+
onClick: ke($e, ["stop"])
|
|
366
371
|
}), [
|
|
367
|
-
|
|
368
|
-
], 16,
|
|
372
|
+
$(s(ze), { class: "combobox__arrow" })
|
|
373
|
+
], 16, la)
|
|
369
374
|
], 16)
|
|
370
375
|
]),
|
|
371
|
-
default:
|
|
372
|
-
h("div",
|
|
373
|
-
s(I) ? (r(), f("div",
|
|
374
|
-
|
|
375
|
-
modelValue:
|
|
376
|
-
"onUpdate:modelValue": a[0] || (a[0] = (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":
|
|
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:
|
|
387
|
-
onKeydown:
|
|
391
|
+
onInput: ue,
|
|
392
|
+
onKeydown: re
|
|
388
393
|
}), {
|
|
389
|
-
prefix:
|
|
390
|
-
|
|
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:
|
|
399
|
-
|
|
400
|
-
|
|
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
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
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
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
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
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
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
|
-
_:
|
|
469
|
+
_: 3
|
|
444
470
|
}, 8, ["open", "width", "side", "side-offset", "align", "align-offset", "breakpoint-mobile", "test-id"]),
|
|
445
|
-
|
|
471
|
+
U.value ? (r(), f("p", v({
|
|
446
472
|
key: 1,
|
|
447
|
-
id:
|
|
473
|
+
id: ee,
|
|
448
474
|
class: "combobox__message"
|
|
449
|
-
}, s(b)("message")), _(
|
|
475
|
+
}, s(b)("message")), _(U.value), 17)) : x("", !0)
|
|
450
476
|
], 16));
|
|
451
477
|
}
|
|
452
478
|
});
|
|
453
479
|
export {
|
|
454
|
-
|
|
480
|
+
pa as default
|
|
455
481
|
};
|