mimir-ui-kit 1.42.2 → 1.43.1
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/ProgressBar-COdzy3fY.js +67 -0
- package/dist/assets/MultiSelectSearch.css +1 -1
- package/dist/assets/Pagination.css +1 -1
- package/dist/assets/SelectSearch.css +1 -1
- package/dist/assets/Switcher.css +1 -1
- package/dist/assets/TabTrail.css +1 -1
- package/dist/assets/hooks.css +1 -0
- package/dist/{combobox-Dv6-ANkb.js → combobox-fIVOzEhl.js} +6 -6
- package/dist/components/Accordion/Accordion.d.ts +6 -0
- package/dist/components/Accordion/Accordion.js +202 -182
- package/dist/components/AnchorLink/Link.d.ts +2 -0
- package/dist/components/AnchorLink/Link.js +54 -42
- package/dist/components/CheckboxMimir/CheckboxMimir.js +4 -4
- package/dist/components/DatePicker/DatePicker.d.ts +32 -0
- package/dist/components/DatePicker/DatePicker.js +125 -111
- package/dist/components/DatePicker/DatePickerModal.d.ts +5 -1
- package/dist/components/DatePicker/DatePickerModal.js +97 -75
- package/dist/components/DatePicker/MonthPickerModal.d.ts +5 -1
- package/dist/components/DatePicker/MonthPickerModal.js +96 -58
- package/dist/components/DatePicker/YearPickerModal.d.ts +5 -1
- package/dist/components/DatePicker/YearPickerModal.js +75 -57
- package/dist/components/Drawer/Drawer.d.ts +7 -1
- package/dist/components/Drawer/Drawer.js +122 -106
- package/dist/components/Drawer/hooks.d.ts +9 -0
- package/dist/components/Drawer/hooks.js +24 -0
- package/dist/components/Dropdown/Dropdown.d.ts +18 -1
- package/dist/components/Dropdown/Dropdown.js +361 -343
- package/dist/components/Dropdown/constants.d.ts +11 -0
- package/dist/components/Dropdown/constants.js +5 -0
- package/dist/components/Dropdown/hooks.d.ts +19 -0
- package/dist/components/Dropdown/hooks.js +11 -0
- package/dist/components/Dropdown/index.d.ts +1 -0
- package/dist/components/Dropdown/index.js +5 -2
- package/dist/components/MultiSelectSearch/MultiSelectSearch.d.ts +8 -1
- package/dist/components/MultiSelectSearch/MultiSelectSearch.js +461 -302
- package/dist/components/MultiSelectSearch/constants.d.ts +6 -0
- package/dist/components/MultiSelectSearch/constants.js +7 -5
- package/dist/components/MultiSelectSearch/index.d.ts +1 -1
- package/dist/components/MultiSelectSearch/index.js +5 -4
- package/dist/components/MultiSelectSearch/types.d.ts +33 -1
- package/dist/components/MultiSelectSearch/utils.d.ts +1 -0
- package/dist/components/MultiSelectSearch/utils.js +31 -17
- package/dist/components/Pagination/Pagination.d.ts +23 -0
- package/dist/components/Pagination/Pagination.js +137 -99
- package/dist/components/RadioGroup/RadioGroup.js +3 -3
- package/dist/components/SelectSearch/SelectSearch.d.ts +8 -1
- package/dist/components/SelectSearch/SelectSearch.js +381 -220
- package/dist/components/SelectSearch/constants.d.ts +6 -0
- package/dist/components/SelectSearch/constants.js +3 -2
- package/dist/components/SelectSearch/index.d.ts +1 -1
- package/dist/components/SelectSearch/index.js +5 -4
- package/dist/components/SelectSearch/types.d.ts +32 -1
- package/dist/components/SelectSearch/utils.d.ts +2 -0
- package/dist/components/SelectSearch/utils.js +28 -14
- package/dist/components/Slider/Slider.d.ts +6 -2
- package/dist/components/Slider/Slider.js +123 -109
- package/dist/components/Slider/utils.d.ts +1 -0
- package/dist/components/Slider/utils.js +4 -0
- package/dist/components/Switcher/Switcher.js +66 -59
- package/dist/components/Switcher/types.d.ts +1 -0
- package/dist/components/TabTrail/TabTrail.d.ts +9 -0
- package/dist/components/TabTrail/TabTrail.js +198 -190
- package/dist/components/Toasts/ProgressBar.d.ts +4 -2
- package/dist/components/Toasts/ProgressBar.js +1 -1
- package/dist/components/Toasts/Toast.d.ts +5 -1
- package/dist/components/Toasts/Toast.js +59 -44
- package/dist/components/Toasts/ToastList.js +1 -1
- package/dist/components/Toasts/ToastsProvider.js +1 -1
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.js +154 -149
- package/dist/{field-BP5-U1Nr.js → field-BLi5834s.js} +2 -2
- package/dist/{focus-management-Dp2_vbQ3.js → focus-management-BAl0GmRk.js} +1 -1
- package/dist/{hidden-Dn4lM6EL.js → hidden-CkTYbiNM.js} +1 -1
- package/dist/hooks/useTimer/index.d.ts +2 -1
- package/dist/hooks/useTimer/index.js +55 -41
- package/dist/hooks-HgN6Yauq.js +117 -0
- package/dist/index.js +182 -177
- package/dist/{keyboard-CUMsrFX1.js → keyboard-wis2TUql.js} +2 -2
- package/dist/{label-DOlEWXBl.js → label-BmphTIGY.js} +2 -2
- package/dist/{open-closed-CkTbpRyi.js → open-closed-CJijMeI2.js} +1 -1
- package/dist/{portal-C_u5auU1.js → portal-BnEqSZwo.js} +2 -2
- package/dist/{use-active-press-BVQqDQ3V.js → use-active-press-CnDeVvQq.js} +1 -1
- package/dist/{use-is-mounted-D7cq4xsa.js → use-is-mounted-MBU4fiLr.js} +1 -1
- package/package.json +3 -1
- package/dist/ProgressBar-DEFs1tWq.js +0 -55
- package/dist/assets/Dropdown.css +0 -1
- package/dist/components/Pagination/types.d.ts +0 -0
@@ -1,375 +1,534 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
import
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
"
|
21
|
-
"
|
22
|
-
|
23
|
-
"
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
"
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
"
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
"
|
41
|
-
"
|
42
|
-
|
43
|
-
"
|
44
|
-
|
45
|
-
|
1
|
+
import { jsxs as u, jsx as i, Fragment as ee } from "react/jsx-runtime";
|
2
|
+
import { u as Qe } from "../../index-D5H8gPPn.js";
|
3
|
+
import { c } from "../../index-DIxK0V-G.js";
|
4
|
+
import { forwardRef as Xe, useId as Ze, useRef as j, useState as f, useEffect as A, useMemo as te, useCallback as et } from "react";
|
5
|
+
import { EMultiSelectSearchSize as D, ELoadingIndicatorPlacement as P } from "./constants.js";
|
6
|
+
import { getInitialInputValue as ve, shouldShowMenuOnTop as tt, MULTISELECT_OPEN_EVENT as ge, prepareGroupedItems as nt, mapSizeToInputSize as ke, getDropdownArrowIcon as it, joinSelectedItems as Ie, dispatchMultiselectOpen as U } from "./utils.js";
|
7
|
+
import { Icon as ot } from "../../icons/Icon.js";
|
8
|
+
import { Button as st } from "../Button/Button.js";
|
9
|
+
import { CheckboxMimir as we } from "../CheckboxMimir/CheckboxMimir.js";
|
10
|
+
import { Chip as rt } from "../Chip/Chip.js";
|
11
|
+
import { I as ye } from "../../Input-BU_6U1CW.js";
|
12
|
+
import { EInputVariant as at } from "../Input/constants.js";
|
13
|
+
import { Loader as Ne } from "../Loader/Loader.js";
|
14
|
+
import { H as lt, U as Se, G as xe, W as Ce, K as ct } from "../../combobox-fIVOzEhl.js";
|
15
|
+
import '../../assets/MultiSelectSearch.css';const dt = "_disabled_1b2pk_5", ut = "_container_1b2pk_9", pt = "_loader_1b2pk_37", mt = "_full_1b2pk_47", ft = "_button_1b2pk_59", ht = "_options_1b2pk_73", _t = "_visible_1b2pk_86", bt = "_top_1b2pk_89", vt = "_bottom_1b2pk_94", gt = "_m_1b2pk_2", kt = "_l_1b2pk_37", It = "_focused_1b2pk_154", wt = "_option_1b2pk_73", yt = "_chip_1b2pk_183", Nt = "_clear_1b2pk_208", t = {
|
16
|
+
"multi-select-search": "_multi-select-search_1b2pk_2",
|
17
|
+
disabled: dt,
|
18
|
+
container: ut,
|
19
|
+
"container-open": "_container-open_1b2pk_18",
|
20
|
+
"group-header": "_group-header_1b2pk_22",
|
21
|
+
"sticky-active": "_sticky-active_1b2pk_33",
|
22
|
+
loader: pt,
|
23
|
+
"input-container": "_input-container_1b2pk_42",
|
24
|
+
full: mt,
|
25
|
+
"selected-icon": "_selected-icon_1b2pk_51",
|
26
|
+
"selector-icon-open": "_selector-icon-open_1b2pk_55",
|
27
|
+
button: ft,
|
28
|
+
"selector-icon": "_selector-icon_1b2pk_55",
|
29
|
+
options: ht,
|
30
|
+
visible: _t,
|
31
|
+
top: bt,
|
32
|
+
bottom: vt,
|
33
|
+
"no-options": "_no-options_1b2pk_115",
|
34
|
+
m: gt,
|
35
|
+
l: kt,
|
36
|
+
"multi-select-input-disabled": "_multi-select-input-disabled_1b2pk_151",
|
37
|
+
"multi-select-input": "_multi-select-input_1b2pk_151",
|
38
|
+
focused: It,
|
39
|
+
option: wt,
|
40
|
+
"option-active": "_option-active_1b2pk_173",
|
41
|
+
"option-inner": "_option-inner_1b2pk_176",
|
42
|
+
chip: yt,
|
43
|
+
"chip-container": "_chip-container_1b2pk_188",
|
44
|
+
"chip-root": "_chip-root_1b2pk_194",
|
45
|
+
"right-slot": "_right-slot_1b2pk_198",
|
46
|
+
"required-mark": "_required-mark_1b2pk_203",
|
47
|
+
clear: Nt,
|
48
|
+
"icon-button": "_icon-button_1b2pk_217"
|
49
|
+
}, Ft = Xe(
|
50
|
+
(Le, Ee) => {
|
46
51
|
const {
|
47
|
-
placeholder:
|
48
|
-
size:
|
49
|
-
value:
|
50
|
-
onChange:
|
51
|
-
full:
|
52
|
-
showArrow:
|
53
|
-
items:
|
54
|
-
classNameOption:
|
55
|
-
displayValue:
|
56
|
-
filterOnSearch:
|
57
|
-
onSearch:
|
58
|
-
variant:
|
59
|
-
menuPlacement:
|
60
|
-
disabled:
|
61
|
-
searchProps:
|
62
|
-
withClearButton:
|
63
|
-
withChip:
|
64
|
-
chipVariant:
|
65
|
-
disableInput:
|
66
|
-
autocomplete:
|
67
|
-
id:
|
68
|
-
autoPlacement:
|
69
|
-
onIsOpen:
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
}, [
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
52
|
+
placeholder: ne,
|
53
|
+
size: s = D.L,
|
54
|
+
value: h,
|
55
|
+
onChange: a,
|
56
|
+
full: Me,
|
57
|
+
showArrow: Te = !0,
|
58
|
+
items: v = [],
|
59
|
+
classNameOption: ie,
|
60
|
+
displayValue: g = "name",
|
61
|
+
filterOnSearch: oe = !0,
|
62
|
+
onSearch: W,
|
63
|
+
variant: se = at.DefaultGray,
|
64
|
+
menuPlacement: C = "bottom",
|
65
|
+
disabled: p = !1,
|
66
|
+
searchProps: re,
|
67
|
+
withClearButton: K = !1,
|
68
|
+
withChip: Oe = !1,
|
69
|
+
chipVariant: ze = "sapphire",
|
70
|
+
disableInput: L = !1,
|
71
|
+
autocomplete: ae = "on",
|
72
|
+
id: Ve,
|
73
|
+
autoPlacement: Y = !1,
|
74
|
+
onIsOpen: d,
|
75
|
+
noOptionsText: Ae = "Нет данных",
|
76
|
+
noMatchText: De = "Ничего не найдено",
|
77
|
+
loadOnOpen: B,
|
78
|
+
loading: le,
|
79
|
+
loadingIndicatorPlacement: q = P.Both,
|
80
|
+
groupBy: _,
|
81
|
+
getGroupTitle: ce = (e) => e
|
82
|
+
} = Le, Pe = Ze(), k = Ve || `multiselect-${Pe}`, E = j(null), I = j(null), Q = j(!1), G = j(null), [l, w] = f(!1), [M, T] = f(
|
83
|
+
() => ve(h, g)
|
84
|
+
), [r, O] = f(
|
85
|
+
h || []
|
86
|
+
), [F, de] = f(C), [R, ue] = f(!1), [Be, pe] = f(!1), [qe, H] = f(!1), [X, Ge] = f(null), me = le !== void 0 ? le : qe;
|
87
|
+
A(() => {
|
88
|
+
h && (O(h), JSON.stringify(h) !== JSON.stringify(r) && T(ve(h, g)));
|
89
|
+
}, [h, g, r]);
|
90
|
+
const z = te(() => {
|
91
|
+
var n;
|
92
|
+
if (!oe) return v;
|
93
|
+
const e = ((n = M.split(",").pop()) == null ? void 0 : n.trim().toLowerCase()) ?? "";
|
94
|
+
return r.length > 0 && r[r.length - 1].name.toLowerCase() === e ? v : v.filter(
|
95
|
+
(o) => o.name.toLowerCase().includes(e)
|
84
96
|
);
|
85
|
-
}, [
|
86
|
-
|
87
|
-
const
|
88
|
-
|
89
|
-
if (
|
90
|
-
|
91
|
-
const
|
92
|
-
|
97
|
+
}, [oe, v, M, r]), Fe = (e) => {
|
98
|
+
O(e), a == null || a(e);
|
99
|
+
const n = Ie(e, g);
|
100
|
+
T(n), w(!0), U(k), setTimeout(() => {
|
101
|
+
if (I.current) {
|
102
|
+
I.current.focus(), I.current.scrollLeft = I.current.scrollWidth;
|
103
|
+
const o = n.length;
|
104
|
+
I.current.setSelectionRange(o, o);
|
93
105
|
}
|
94
106
|
}, 0);
|
95
|
-
},
|
96
|
-
var
|
97
|
-
if (
|
98
|
-
const
|
99
|
-
|
100
|
-
const
|
101
|
-
(
|
107
|
+
}, fe = async (e) => {
|
108
|
+
var b;
|
109
|
+
if (L) return;
|
110
|
+
const n = e.target.value;
|
111
|
+
T(n), W == null || W(n);
|
112
|
+
const o = n.split(",").map((x) => x.trim()).filter(Boolean), N = v.filter(
|
113
|
+
(x) => o.includes(x[g])
|
102
114
|
);
|
103
|
-
JSON.stringify(
|
104
|
-
|
105
|
-
|
115
|
+
if (JSON.stringify(N) !== JSON.stringify(r) && (O(N), a == null || a(N)), !l && (w(!0), U(k), B))
|
116
|
+
try {
|
117
|
+
H(!0), await B();
|
118
|
+
} finally {
|
119
|
+
H(!1);
|
120
|
+
}
|
121
|
+
const S = (b = E.current) == null ? void 0 : b.querySelector(
|
122
|
+
`.${t.options}`
|
106
123
|
);
|
107
|
-
|
108
|
-
},
|
109
|
-
const
|
110
|
-
(
|
124
|
+
S && typeof S.scrollTo == "function" && S.scrollTo({ top: 0, behavior: "smooth" });
|
125
|
+
}, Re = (e) => {
|
126
|
+
const n = r.filter(
|
127
|
+
(o) => o.id !== e.id
|
111
128
|
);
|
112
|
-
|
113
|
-
},
|
114
|
-
if (!
|
115
|
-
|
129
|
+
O(n), a == null || a(n), T(Ie(n, g));
|
130
|
+
}, m = et(() => {
|
131
|
+
if (!Y) {
|
132
|
+
de(C);
|
116
133
|
return;
|
117
134
|
}
|
118
|
-
const
|
119
|
-
|
120
|
-
}, [
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
135
|
+
const e = tt(E, s);
|
136
|
+
de(e ? "top" : C);
|
137
|
+
}, [Y, C, s]), He = (e) => {
|
138
|
+
e.preventDefault(), e.currentTarget.focus();
|
139
|
+
const n = e.currentTarget.value.length;
|
140
|
+
e.currentTarget.setSelectionRange(n, n);
|
141
|
+
}, Je = () => {
|
142
|
+
T(""), O([]), a == null || a([]);
|
143
|
+
}, $e = (e) => {
|
144
|
+
e.stopPropagation(), Je();
|
145
|
+
}, he = async () => {
|
146
|
+
if (B)
|
147
|
+
try {
|
148
|
+
H(!0), await B();
|
149
|
+
} finally {
|
150
|
+
H(!1);
|
151
|
+
}
|
152
|
+
}, _e = async () => {
|
153
|
+
m(), w(!0), U(k), await he();
|
154
|
+
}, je = async (e) => {
|
155
|
+
if (L) {
|
156
|
+
e.target.blur();
|
134
157
|
return;
|
135
158
|
}
|
136
|
-
|
159
|
+
await _e();
|
160
|
+
}, be = async () => {
|
161
|
+
const e = !l;
|
162
|
+
e && (m(), U(k), await he()), w(e), d == null || d(e);
|
137
163
|
};
|
138
|
-
|
164
|
+
A(() => {
|
139
165
|
if (l) {
|
140
|
-
const
|
141
|
-
|
166
|
+
const e = (n) => {
|
167
|
+
E.current && !E.current.contains(n.target) && !n.defaultPrevented && (w(!1), d == null || d(!1));
|
142
168
|
};
|
143
|
-
return document.addEventListener("mousedown",
|
144
|
-
document.removeEventListener("mousedown",
|
169
|
+
return document.addEventListener("mousedown", e), () => {
|
170
|
+
document.removeEventListener("mousedown", e);
|
145
171
|
};
|
146
172
|
}
|
147
|
-
}, [l,
|
148
|
-
const
|
149
|
-
|
150
|
-
|
173
|
+
}, [l, d]), A(() => {
|
174
|
+
const n = (o) => {
|
175
|
+
o.detail === k || !l || Q.current || (Q.current = !0, w(!1), d == null || d(!1), queueMicrotask(() => {
|
176
|
+
Q.current = !1;
|
151
177
|
}));
|
152
178
|
};
|
153
|
-
return window.addEventListener(
|
154
|
-
}, [
|
179
|
+
return window.addEventListener(ge, n), () => window.removeEventListener(ge, n);
|
180
|
+
}, [k, d, l]), A(() => {
|
155
181
|
if (l) {
|
156
|
-
|
157
|
-
const
|
158
|
-
|
182
|
+
m(), window.addEventListener("scroll", m), window.addEventListener("resize", m);
|
183
|
+
const e = requestAnimationFrame(() => {
|
184
|
+
pe(!0), ue(!0);
|
159
185
|
});
|
160
186
|
return () => {
|
161
|
-
window.removeEventListener("scroll",
|
187
|
+
window.removeEventListener("scroll", m), window.removeEventListener("resize", m), cancelAnimationFrame(e);
|
162
188
|
};
|
163
189
|
} else
|
164
|
-
|
165
|
-
}, [l,
|
166
|
-
|
167
|
-
|
190
|
+
ue(!1), pe(!1);
|
191
|
+
}, [l, C, Y, s, m]);
|
192
|
+
const Ue = () => {
|
193
|
+
if (Te)
|
194
|
+
return {
|
195
|
+
addonType: "react-node",
|
196
|
+
addonContent: /* @__PURE__ */ u(ee, { children: [
|
197
|
+
me && (q === P.Input || q === P.Both) && /* @__PURE__ */ i(Ne, { size: "s" }),
|
198
|
+
/* @__PURE__ */ i(
|
199
|
+
Se,
|
200
|
+
{
|
201
|
+
className: c(t.button, {
|
202
|
+
[t.disabled]: p
|
203
|
+
}),
|
204
|
+
disabled: p,
|
205
|
+
onMouseDown: be,
|
206
|
+
children: /* @__PURE__ */ i(
|
207
|
+
ot,
|
208
|
+
{
|
209
|
+
iconName: s == D.M ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
|
210
|
+
className: c(t["selector-icon"], {
|
211
|
+
[t["selector-icon-open"]]: l
|
212
|
+
})
|
213
|
+
}
|
214
|
+
)
|
215
|
+
}
|
216
|
+
)
|
217
|
+
] })
|
218
|
+
};
|
219
|
+
}, We = () => me && (q === P.Dropdown || q === P.Both) ? /* @__PURE__ */ u("div", { className: t.loader, children: [
|
220
|
+
/* @__PURE__ */ i(Ne, { size: "s" }),
|
221
|
+
"Загрузка..."
|
222
|
+
] }) : Ae, V = te(() => _ ? nt(
|
223
|
+
z,
|
224
|
+
_,
|
225
|
+
ce || ((e) => e)
|
226
|
+
) : z, [z, _, ce]), J = te(() => {
|
227
|
+
const e = [];
|
228
|
+
return V.forEach((n, o) => {
|
229
|
+
n.isGroupHeader && e.push(o);
|
230
|
+
}), e;
|
231
|
+
}, [V]), y = Qe({
|
232
|
+
count: V.length,
|
233
|
+
getScrollElement: () => G.current,
|
234
|
+
estimateSize: () => s === D.L ? 65 : 49,
|
235
|
+
overscan: 10
|
236
|
+
}), Ke = () => v.length ? z.length ? _ ? /* @__PURE__ */ u(
|
237
|
+
"div",
|
238
|
+
{
|
239
|
+
ref: G,
|
240
|
+
className: c(
|
241
|
+
t.options,
|
242
|
+
t[s],
|
243
|
+
t[F],
|
244
|
+
{ [t.visible]: R }
|
245
|
+
),
|
246
|
+
style: {
|
247
|
+
height: s === D.M ? "240px" : "320px",
|
248
|
+
overflow: "auto"
|
249
|
+
},
|
250
|
+
children: [
|
251
|
+
X !== null && /* @__PURE__ */ i(
|
252
|
+
"div",
|
253
|
+
{
|
254
|
+
className: t["group-header"],
|
255
|
+
style: {
|
256
|
+
position: "sticky",
|
257
|
+
top: 0,
|
258
|
+
zIndex: 3
|
259
|
+
},
|
260
|
+
children: V[X].name
|
261
|
+
}
|
262
|
+
),
|
263
|
+
/* @__PURE__ */ i(
|
264
|
+
"div",
|
265
|
+
{
|
266
|
+
style: {
|
267
|
+
height: `${y.getTotalSize()}px`,
|
268
|
+
width: "100%"
|
269
|
+
},
|
270
|
+
children: y.getVirtualItems().map((e) => {
|
271
|
+
const n = V[e.index];
|
272
|
+
return /* @__PURE__ */ i(
|
273
|
+
"div",
|
274
|
+
{
|
275
|
+
"data-index": e.index,
|
276
|
+
ref: y.measureElement,
|
277
|
+
style: {
|
278
|
+
position: "absolute",
|
279
|
+
top: 0,
|
280
|
+
left: 0,
|
281
|
+
width: "100%",
|
282
|
+
transform: `translateY(${e.start}px)`
|
283
|
+
},
|
284
|
+
children: n.isGroupHeader ? /* @__PURE__ */ i(
|
285
|
+
"div",
|
286
|
+
{
|
287
|
+
className: t["group-header"],
|
288
|
+
style: {
|
289
|
+
visibility: X === e.index ? "hidden" : "visible"
|
290
|
+
},
|
291
|
+
children: n.name
|
292
|
+
}
|
293
|
+
) : /* @__PURE__ */ i(
|
294
|
+
Ce,
|
295
|
+
{
|
296
|
+
value: n,
|
297
|
+
className: ({ focus: o }) => c(
|
298
|
+
t.option,
|
299
|
+
ie,
|
300
|
+
s && t[s],
|
301
|
+
{
|
302
|
+
[t["option-active"]]: o
|
303
|
+
}
|
304
|
+
),
|
305
|
+
children: /* @__PURE__ */ u(ee, { children: [
|
306
|
+
/* @__PURE__ */ u("div", { className: t["option-inner"], children: [
|
307
|
+
n.name,
|
308
|
+
n.bottom && /* @__PURE__ */ i("div", { children: n.bottom })
|
309
|
+
] }),
|
310
|
+
/* @__PURE__ */ i(
|
311
|
+
we,
|
312
|
+
{
|
313
|
+
isInteractive: !1,
|
314
|
+
checked: r.some(
|
315
|
+
(o) => o.id === n.id
|
316
|
+
)
|
317
|
+
}
|
318
|
+
)
|
319
|
+
] })
|
320
|
+
},
|
321
|
+
n.id
|
322
|
+
)
|
323
|
+
},
|
324
|
+
e.key
|
325
|
+
);
|
326
|
+
})
|
327
|
+
}
|
328
|
+
)
|
329
|
+
]
|
330
|
+
}
|
331
|
+
) : /* @__PURE__ */ i(
|
332
|
+
ct,
|
333
|
+
{
|
334
|
+
className: c(
|
335
|
+
t.options,
|
336
|
+
t[s],
|
337
|
+
t[F],
|
338
|
+
{ [t.visible]: R }
|
339
|
+
),
|
340
|
+
modal: !1,
|
341
|
+
static: !0,
|
342
|
+
children: ({ option: e }) => /* @__PURE__ */ i(
|
343
|
+
Ce,
|
344
|
+
{
|
345
|
+
value: e,
|
346
|
+
className: ({ focus: n }) => c(t.option, ie, s && t[s], {
|
347
|
+
[t["option-active"]]: n
|
348
|
+
}),
|
349
|
+
children: /* @__PURE__ */ u(ee, { children: [
|
350
|
+
/* @__PURE__ */ u("div", { className: t["option-inner"], children: [
|
351
|
+
e.name,
|
352
|
+
e.bottom && /* @__PURE__ */ i("div", { children: e.bottom })
|
353
|
+
] }),
|
354
|
+
/* @__PURE__ */ i(
|
355
|
+
we,
|
356
|
+
{
|
357
|
+
isInteractive: !1,
|
358
|
+
checked: r.some(
|
359
|
+
(n) => n.id === e.id
|
360
|
+
)
|
361
|
+
}
|
362
|
+
)
|
363
|
+
] })
|
364
|
+
},
|
365
|
+
e.id
|
366
|
+
)
|
367
|
+
}
|
368
|
+
) : /* @__PURE__ */ i(
|
369
|
+
"div",
|
370
|
+
{
|
371
|
+
className: c(
|
372
|
+
t.options,
|
373
|
+
t[s],
|
374
|
+
t["no-options"],
|
375
|
+
t[F],
|
376
|
+
{ [t.visible]: R }
|
377
|
+
),
|
378
|
+
children: De
|
379
|
+
}
|
380
|
+
) : /* @__PURE__ */ i(
|
381
|
+
"div",
|
382
|
+
{
|
383
|
+
className: c(
|
384
|
+
t.options,
|
385
|
+
t[s],
|
386
|
+
t["no-options"],
|
387
|
+
t[F],
|
388
|
+
{ [t.visible]: R }
|
389
|
+
),
|
390
|
+
children: We()
|
391
|
+
}
|
392
|
+
);
|
393
|
+
return A(() => {
|
394
|
+
const e = G.current;
|
395
|
+
if (!e || !_) return;
|
396
|
+
const n = () => {
|
397
|
+
var Z, S;
|
398
|
+
const o = e.scrollTop;
|
399
|
+
let N = null;
|
400
|
+
for (let b = 0; b < J.length; b++) {
|
401
|
+
const x = J[b];
|
402
|
+
if ((((Z = y.getVirtualItems().find(($) => $.index === x)) == null ? void 0 : Z.start) || 0) <= o) {
|
403
|
+
N = x;
|
404
|
+
const $ = J[b + 1];
|
405
|
+
if ($ !== void 0 && (((S = y.getVirtualItems().find((Ye) => Ye.index === $)) == null ? void 0 : S.start) || 0) <= o)
|
406
|
+
continue;
|
407
|
+
} else
|
408
|
+
break;
|
409
|
+
}
|
410
|
+
Ge(N);
|
411
|
+
};
|
412
|
+
return e.addEventListener("scroll", n), () => e.removeEventListener("scroll", n);
|
413
|
+
}, [y, J, _, G.current]), /* @__PURE__ */ u("div", { ref: E, children: [
|
414
|
+
/* @__PURE__ */ i(
|
415
|
+
lt,
|
168
416
|
{
|
169
417
|
multiple: !0,
|
170
418
|
as: "div",
|
171
|
-
value:
|
172
|
-
className:
|
173
|
-
[
|
174
|
-
[
|
419
|
+
value: r,
|
420
|
+
className: c(t["multi-select-search"], {
|
421
|
+
[t.full]: Me,
|
422
|
+
[t.disabled]: p
|
175
423
|
}),
|
176
|
-
onChange:
|
177
|
-
ref:
|
178
|
-
disabled:
|
179
|
-
virtual: { options:
|
180
|
-
children: /* @__PURE__ */
|
424
|
+
onChange: Fe,
|
425
|
+
ref: Ee,
|
426
|
+
disabled: p,
|
427
|
+
virtual: _ ? void 0 : { options: z },
|
428
|
+
children: /* @__PURE__ */ u(
|
181
429
|
"div",
|
182
430
|
{
|
183
|
-
className:
|
184
|
-
[
|
431
|
+
className: c(t.container, t[s], {
|
432
|
+
[t["container-open"]]: l
|
185
433
|
}),
|
186
434
|
children: [
|
187
|
-
|
188
|
-
/* @__PURE__ */
|
189
|
-
|
435
|
+
L && /* @__PURE__ */ u("div", { className: t["input-container"], children: [
|
436
|
+
/* @__PURE__ */ i(
|
437
|
+
Se,
|
190
438
|
{
|
191
|
-
disabled:
|
439
|
+
disabled: p,
|
192
440
|
style: { width: "100%" },
|
193
|
-
onClick:
|
194
|
-
children: /* @__PURE__ */
|
195
|
-
|
441
|
+
onClick: be,
|
442
|
+
children: /* @__PURE__ */ i(
|
443
|
+
xe,
|
196
444
|
{
|
197
|
-
as:
|
198
|
-
label:
|
199
|
-
size:
|
200
|
-
className:
|
201
|
-
[
|
445
|
+
as: ye,
|
446
|
+
label: ne,
|
447
|
+
size: ke(s),
|
448
|
+
className: c(t["multi-select-input"], {
|
449
|
+
[t["multi-select-input-disabled"]]: L && K
|
202
450
|
}),
|
203
|
-
onChange:
|
204
|
-
value:
|
205
|
-
disabled:
|
206
|
-
variant:
|
207
|
-
rightSlotClassName:
|
208
|
-
requiredMarkClassName:
|
451
|
+
onChange: fe,
|
452
|
+
value: M,
|
453
|
+
disabled: p,
|
454
|
+
variant: se,
|
455
|
+
rightSlotClassName: t["right-slot"],
|
456
|
+
requiredMarkClassName: t["required-mark"],
|
209
457
|
"data-testid": "select-search-input",
|
210
|
-
onFocus:
|
458
|
+
onFocus: je,
|
211
459
|
rightAddon: {
|
212
460
|
addonType: "icon",
|
213
|
-
addonContent:
|
461
|
+
addonContent: it(l, s)
|
214
462
|
},
|
215
|
-
autocomplete:
|
216
|
-
...
|
463
|
+
autocomplete: ae,
|
464
|
+
...re
|
217
465
|
}
|
218
466
|
)
|
219
467
|
}
|
220
468
|
),
|
221
|
-
|
222
|
-
|
469
|
+
K && M && /* @__PURE__ */ i(
|
470
|
+
st,
|
223
471
|
{
|
224
472
|
tabIndex: -1,
|
225
|
-
className:
|
226
|
-
[
|
473
|
+
className: c(t.clear, {
|
474
|
+
[t.disabled]: p
|
227
475
|
}),
|
228
|
-
iconButtonClassName:
|
476
|
+
iconButtonClassName: t["icon-button"],
|
229
477
|
isIconButton: !0,
|
230
478
|
iconName: "Close16px",
|
231
479
|
size: "m-s",
|
232
480
|
clear: !0,
|
233
|
-
disabled:
|
481
|
+
disabled: p,
|
234
482
|
variant: "secondary-gray",
|
235
|
-
onClick:
|
483
|
+
onClick: $e,
|
236
484
|
"data-testid": "clear-button"
|
237
485
|
}
|
238
486
|
)
|
239
487
|
] }),
|
240
|
-
!
|
241
|
-
|
488
|
+
!L && /* @__PURE__ */ i(
|
489
|
+
xe,
|
242
490
|
{
|
243
|
-
as:
|
244
|
-
label:
|
245
|
-
size:
|
246
|
-
className:
|
247
|
-
rightSlotClassName:
|
248
|
-
requiredMarkClassName:
|
249
|
-
value:
|
250
|
-
disabled:
|
251
|
-
variant:
|
252
|
-
withClearButton:
|
253
|
-
onFocus:
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
ref: b,
|
259
|
-
rightAddon: {
|
260
|
-
addonType: "react-node",
|
261
|
-
addonContent: ae && /* @__PURE__ */ n(
|
262
|
-
ie,
|
263
|
-
{
|
264
|
-
className: u(e.button, {
|
265
|
-
[e.disabled]: d
|
266
|
-
}),
|
267
|
-
disabled: d,
|
268
|
-
onMouseDown: Q,
|
269
|
-
children: /* @__PURE__ */ n(
|
270
|
-
ye,
|
271
|
-
{
|
272
|
-
iconName: i == R.M ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
|
273
|
-
className: u(e["selector-icon"], {
|
274
|
-
[e["selector-icon-open"]]: l
|
275
|
-
})
|
276
|
-
}
|
277
|
-
)
|
278
|
-
}
|
279
|
-
)
|
280
|
-
},
|
491
|
+
as: ye,
|
492
|
+
label: ne,
|
493
|
+
size: ke(s),
|
494
|
+
className: t["multi-select-input"],
|
495
|
+
rightSlotClassName: t["right-slot"],
|
496
|
+
requiredMarkClassName: t["required-mark"],
|
497
|
+
value: M,
|
498
|
+
disabled: p,
|
499
|
+
variant: se,
|
500
|
+
withClearButton: K,
|
501
|
+
onFocus: _e,
|
502
|
+
onMouseDown: He,
|
503
|
+
onChange: fe,
|
504
|
+
ref: I,
|
505
|
+
rightAddon: Ue(),
|
281
506
|
"data-testid": "select-search-input",
|
282
|
-
autocomplete:
|
283
|
-
...
|
507
|
+
autocomplete: ae,
|
508
|
+
...re
|
284
509
|
}
|
285
510
|
),
|
286
|
-
l &&
|
287
|
-
Ve,
|
288
|
-
{
|
289
|
-
className: u(
|
290
|
-
e.options,
|
291
|
-
e[i],
|
292
|
-
e[A],
|
293
|
-
{ [e.visible]: V }
|
294
|
-
),
|
295
|
-
modal: !1,
|
296
|
-
static: !0,
|
297
|
-
children: ({ option: t }) => /* @__PURE__ */ n(
|
298
|
-
qe,
|
299
|
-
{
|
300
|
-
value: t,
|
301
|
-
className: ({ focus: o }) => u(
|
302
|
-
e.option,
|
303
|
-
ue,
|
304
|
-
i && e[i],
|
305
|
-
{
|
306
|
-
[e["option-active"]]: o
|
307
|
-
}
|
308
|
-
),
|
309
|
-
children: /* @__PURE__ */ E(Y, { children: [
|
310
|
-
/* @__PURE__ */ E("div", { className: e["option-inner"], children: [
|
311
|
-
t.name,
|
312
|
-
t.bottom && /* @__PURE__ */ n("div", { children: t.bottom })
|
313
|
-
] }),
|
314
|
-
/* @__PURE__ */ n(
|
315
|
-
Te,
|
316
|
-
{
|
317
|
-
isInteractive: !1,
|
318
|
-
checked: c.some(
|
319
|
-
(o) => o.id === t.id
|
320
|
-
)
|
321
|
-
}
|
322
|
-
)
|
323
|
-
] })
|
324
|
-
},
|
325
|
-
t.id
|
326
|
-
)
|
327
|
-
}
|
328
|
-
) : /* @__PURE__ */ n(
|
329
|
-
"div",
|
330
|
-
{
|
331
|
-
className: u(
|
332
|
-
e.options,
|
333
|
-
e[i],
|
334
|
-
e["no-options"],
|
335
|
-
e[A],
|
336
|
-
{ [e.visible]: V }
|
337
|
-
),
|
338
|
-
children: "Ничего не найдено"
|
339
|
-
}
|
340
|
-
) : /* @__PURE__ */ n(
|
341
|
-
"div",
|
342
|
-
{
|
343
|
-
className: u(
|
344
|
-
e.options,
|
345
|
-
e[i],
|
346
|
-
e["no-options"],
|
347
|
-
e[A],
|
348
|
-
{ [e.visible]: V }
|
349
|
-
),
|
350
|
-
children: "Нет данных"
|
351
|
-
}
|
352
|
-
) })
|
511
|
+
l && Be && Ke()
|
353
512
|
]
|
354
513
|
}
|
355
514
|
)
|
356
515
|
}
|
357
516
|
),
|
358
|
-
|
359
|
-
|
517
|
+
Oe && r.length > 0 && /* @__PURE__ */ i("div", { className: t["chip-container"], children: r.map((e) => /* @__PURE__ */ i(
|
518
|
+
rt,
|
360
519
|
{
|
361
|
-
size:
|
362
|
-
variant:
|
363
|
-
className:
|
520
|
+
size: s === D.L ? "s" : "xs",
|
521
|
+
variant: ze,
|
522
|
+
className: t["chip-root"],
|
364
523
|
withAction: !0,
|
365
|
-
onClose: () =>
|
366
|
-
children: /* @__PURE__ */
|
524
|
+
onClose: () => Re(e),
|
525
|
+
children: /* @__PURE__ */ i("span", { className: t.chip, children: e.name })
|
367
526
|
},
|
368
|
-
|
527
|
+
e.id
|
369
528
|
)) })
|
370
529
|
] });
|
371
530
|
}
|
372
531
|
);
|
373
532
|
export {
|
374
|
-
|
533
|
+
Ft as MultiSelectSearch
|
375
534
|
};
|