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