mimir-ui-kit 1.43.11 → 1.43.12
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/Input-BU_6U1CW.js +227 -0
- package/dist/assets/Accordion.css +1 -1
- package/dist/assets/AccordionItem.css +1 -1
- package/dist/assets/Avatar.css +1 -1
- package/dist/assets/Button.css +1 -1
- package/dist/assets/CheckboxMimir.css +1 -1
- package/dist/assets/Chip.css +1 -1
- package/dist/assets/ClearButton.css +1 -0
- package/dist/assets/Drawer.css +1 -1
- package/dist/assets/GosZnak.css +1 -1
- package/dist/assets/Input.css +1 -1
- package/dist/assets/InputPassword.css +1 -1
- package/dist/assets/InputRangeSlider.css +1 -1
- package/dist/assets/Link.css +1 -1
- package/dist/assets/ListFiles.css +1 -1
- package/dist/assets/ListPhotos.css +1 -1
- package/dist/assets/MessageShortReply.css +1 -1
- package/dist/assets/MultiSelectSearch.css +1 -1
- package/dist/assets/NotificationBadge.css +1 -1
- package/dist/assets/OtpInput.css +1 -1
- package/dist/assets/Pagination.css +1 -1
- package/dist/assets/SelectSearch.css +1 -1
- package/dist/assets/hooks.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/assets/styles.css +1 -1
- package/dist/components/Accordion/Accordion.d.ts +3 -10
- package/dist/components/Accordion/Accordion.js +212 -286
- package/dist/components/Accordion/AccordionItem/AccordionItem.js +3 -3
- package/dist/components/Accordion/constants.d.ts +4 -0
- package/dist/components/Accordion/constants.js +5 -4
- package/dist/components/AnchorLink/Link.js +20 -21
- package/dist/components/Avatar/Avatar.js +26 -26
- package/dist/components/Button/Button.js +87 -110
- package/dist/components/Button/constants.d.ts +2 -8
- package/dist/components/Button/constants.js +5 -6
- package/dist/components/CheckboxMimir/CheckboxMimir.d.ts +0 -2
- package/dist/components/CheckboxMimir/CheckboxMimir.js +35 -37
- package/dist/components/Chip/Chip.js +17 -17
- package/dist/components/DatePicker/DatePicker.d.ts +0 -8
- package/dist/components/DatePicker/DatePicker.js +169 -182
- package/dist/components/DatePicker/DatePickerModal.js +98 -134
- package/dist/components/DatePicker/MonthPickerModal.js +95 -115
- package/dist/components/DatePicker/YearPickerModal.js +89 -109
- package/dist/components/DatePicker/constants.d.ts +1 -1
- package/dist/components/DatePicker/constants.js +7 -6
- package/dist/components/DatePicker/hooks.d.ts +1 -2
- package/dist/components/DatePicker/hooks.js +13 -13
- package/dist/components/Drawer/Drawer.js +138 -172
- package/dist/components/Dropdown/Dropdown.js +1 -1
- package/dist/components/Dropdown/hooks.js +1 -1
- package/dist/components/GosZnak/GosZnak.js +38 -47
- package/dist/components/Input/Input.d.ts +0 -4
- package/dist/components/Input/Input.js +2 -2
- package/dist/components/Input/index.js +1 -1
- package/dist/components/{MiniButton/MiniButton.d.ts → InputClearButton/ClearButton.d.ts} +8 -17
- package/dist/components/InputClearButton/ClearButton.js +41 -0
- package/dist/components/InputClearButton/constants.d.ts +8 -0
- package/dist/components/InputClearButton/constants.js +5 -0
- package/dist/components/InputClearButton/index.d.ts +4 -0
- package/dist/components/InputClearButton/index.js +6 -0
- package/dist/components/InputPassword/InputPassword.js +42 -38
- package/dist/components/InputPhoneNumber/InputPhoneNumber.js +1 -1
- package/dist/components/InputRangeSlider/InputRangeSlider.js +139 -159
- package/dist/components/InputRangeSlider/constants.d.ts +0 -5
- package/dist/components/InputRangeSlider/constants.js +6 -11
- package/dist/components/ListFiles/ListFiles.js +39 -41
- package/dist/components/ListPhotos/ListPhotos.js +18 -17
- package/dist/components/MessageShortReply/MessageShortReply.js +34 -34
- package/dist/components/MultiSelectSearch/MultiSelectSearch.js +152 -153
- package/dist/components/MultiSelectSearch/constants.d.ts +0 -1
- package/dist/components/MultiSelectSearch/constants.js +7 -7
- package/dist/components/MultiSelectSearch/utils.d.ts +1 -1
- package/dist/components/MultiSelectSearch/utils.js +16 -18
- package/dist/components/NotificationBadge/NotificationBadge.js +33 -49
- package/dist/components/NotificationBadge/constants.d.ts +2 -9
- package/dist/components/NotificationBadge/constants.js +2 -3
- package/dist/components/NotificationBadge/types.d.ts +1 -11
- package/dist/components/OtpInput/OtpInput.js +40 -44
- package/dist/components/OtpInput/constants.d.ts +0 -4
- package/dist/components/OtpInput/constants.js +4 -6
- package/dist/components/OtpInput/index.d.ts +0 -1
- package/dist/components/OtpInput/index.js +0 -2
- package/dist/components/Pagination/Pagination.js +23 -23
- package/dist/components/SelectSearch/SelectSearch.js +241 -241
- package/dist/components/SelectSearch/utils.d.ts +1 -1
- package/dist/components/SelectSearch/utils.js +1 -1
- package/dist/components/Slider/Slider.d.ts +5 -1
- package/dist/components/Slider/Slider.js +36 -34
- package/dist/components/TextArea/TextArea.js +1 -1
- package/dist/components/index.d.ts +1 -3
- package/dist/components/index.js +51 -55
- package/dist/hooks-HgN6Yauq.js +117 -0
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/components/64px/AdvancePaymentDiscount64px.js +59 -0
- package/dist/icons/components/64px/AtsVendors64px.js +37 -0
- package/dist/icons/components/64px/ButtonOn64px.js +31 -0
- package/dist/icons/components/64px/BuyoutAuto64px.js +45 -0
- package/dist/icons/components/64px/CarAssistance64px.js +44 -0
- package/dist/icons/components/64px/CarDelivery64px.js +37 -0
- package/dist/icons/components/64px/CarSearchReturn64px.js +45 -0
- package/dist/icons/components/64px/CarService64px.js +37 -0
- package/dist/icons/components/64px/Case64px.js +33 -0
- package/dist/icons/components/64px/CoatOfArms64px.js +149 -0
- package/dist/icons/components/64px/CoffeeCup64px.js +44 -0
- package/dist/icons/components/64px/Cup64px.js +38 -0
- package/dist/icons/components/64px/ExpertAdvice64px.js +40 -0
- package/dist/icons/components/64px/Fines64px.js +88 -0
- package/dist/icons/components/64px/Fuel64px.js +38 -0
- package/dist/icons/components/64px/GazprombankIcon24px.js +21 -0
- package/dist/icons/components/64px/Kasko64px.js +44 -0
- package/dist/icons/components/64px/LegalSupport64px.js +58 -0
- package/dist/icons/components/64px/Microphone64px.js +37 -0
- package/dist/icons/components/64px/Money64px.js +60 -0
- package/dist/icons/components/64px/PaymentSchedule64px.js +39 -0
- package/dist/icons/components/64px/PersonalManager64px.js +100 -0
- package/dist/icons/components/64px/PreApproval64px.js +44 -0
- package/dist/icons/components/64px/Questions64px.js +37 -0
- package/dist/icons/components/64px/SupportGeography64px.js +51 -0
- package/dist/icons/components/64px/Timer64px.js +45 -0
- package/dist/icons/components/64px/Twogis64px.js +51 -0
- package/dist/icons/components/64px/Vehicles64px.js +45 -0
- package/dist/icons/components/64px/Workplace64px.js +38 -0
- package/dist/icons/components/index.js +591 -564
- package/dist/{index-DrVFMaBi.js → index-C2dQUuc9.js} +1346 -1184
- package/dist/index.js +69 -73
- package/dist/styles.module-Cuqm31CO.js +28 -0
- package/package.json +1 -1
- package/dist/Input-CGZoshMl.js +0 -224
- package/dist/assets/CarBodyButton.css +0 -1
- package/dist/assets/MiniButton.css +0 -1
- package/dist/assets/RoundButton.css +0 -1
- package/dist/assets/ScrollWrapper.css +0 -1
- package/dist/components/CarBodyButton/CarBodyButton.d.ts +0 -26
- package/dist/components/CarBodyButton/CarBodyButton.js +0 -40
- package/dist/components/CarBodyButton/index.d.ts +0 -1
- package/dist/components/CarBodyButton/index.js +0 -4
- package/dist/components/Drawer/ScrollWrapper/ScrollWrapper.d.ts +0 -11
- package/dist/components/Drawer/ScrollWrapper/ScrollWrapper.js +0 -27
- package/dist/components/GosZnak/utils.d.ts +0 -6
- package/dist/components/GosZnak/utils.js +0 -15
- package/dist/components/MiniButton/MiniButton.js +0 -44
- package/dist/components/MiniButton/constants.d.ts +0 -9
- package/dist/components/MiniButton/constants.js +0 -5
- package/dist/components/MiniButton/index.d.ts +0 -4
- package/dist/components/MiniButton/index.js +0 -6
- package/dist/components/NotificationBadge/utils.d.ts +0 -8
- package/dist/components/NotificationBadge/utils.js +0 -4
- package/dist/components/RoundButton/RoundButton.d.ts +0 -82
- package/dist/components/RoundButton/RoundButton.js +0 -69
- package/dist/components/RoundButton/constants.d.ts +0 -11
- package/dist/components/RoundButton/constants.js +0 -5
- package/dist/components/RoundButton/index.d.ts +0 -2
- package/dist/components/RoundButton/index.js +0 -7
- package/dist/components/RoundButton/types.d.ts +0 -20
- package/dist/hooks-Cd4Ez6_j.js +0 -117
- package/dist/icons/components/16px/DropdownArrowDown16px.js +0 -23
- package/dist/icons/components/24px/EyeClosed24px.js +0 -65
- package/dist/styles.module-BfkM1-KJ.js +0 -32
@@ -1,146 +1,145 @@
|
|
1
|
-
import { jsxs as
|
1
|
+
import { jsxs as u, jsx as i, Fragment as ee } from "react/jsx-runtime";
|
2
2
|
import { u as Qe } from "../../index-D5H8gPPn.js";
|
3
|
-
import { c
|
3
|
+
import { c } from "../../index-DIxK0V-G.js";
|
4
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
5
|
import { EMultiSelectSearchSize as D, ELoadingIndicatorPlacement as P } from "./constants.js";
|
6
|
-
import { getInitialInputValue as
|
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
7
|
import { Icon as ot } from "../../icons/Icon.js";
|
8
8
|
import { Button as st } from "../Button/Button.js";
|
9
|
-
import { CheckboxMimir as
|
9
|
+
import { CheckboxMimir as we } from "../CheckboxMimir/CheckboxMimir.js";
|
10
10
|
import { Chip as rt } from "../Chip/Chip.js";
|
11
|
-
import { I as
|
12
|
-
import { EInputVariant as
|
13
|
-
import { Loader as
|
14
|
-
import { H as
|
15
|
-
import '../../assets/MultiSelectSearch.css';const
|
16
|
-
"multi-select-search": "_multi-select-
|
17
|
-
disabled:
|
18
|
-
container:
|
19
|
-
"container-open": "_container-
|
20
|
-
"group-header": "_group-
|
21
|
-
"sticky-active": "_sticky-
|
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
22
|
loader: pt,
|
23
|
-
"input-container": "_input-
|
23
|
+
"input-container": "_input-container_1b2pk_42",
|
24
24
|
full: mt,
|
25
|
-
"selected-icon": "_selected-
|
26
|
-
"selector-icon-open": "_selector-icon-
|
25
|
+
"selected-icon": "_selected-icon_1b2pk_51",
|
26
|
+
"selector-icon-open": "_selector-icon-open_1b2pk_55",
|
27
27
|
button: ft,
|
28
|
-
"selector-icon": "_selector-
|
28
|
+
"selector-icon": "_selector-icon_1b2pk_55",
|
29
29
|
options: ht,
|
30
30
|
visible: _t,
|
31
|
-
top:
|
32
|
-
bottom:
|
33
|
-
"no-options": "_no-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
"multi-select-input
|
38
|
-
|
39
|
-
|
40
|
-
option:
|
41
|
-
"option-
|
42
|
-
|
43
|
-
chip:
|
44
|
-
"chip-
|
45
|
-
"
|
46
|
-
"
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
(ke, Ee) => {
|
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) => {
|
52
51
|
const {
|
53
52
|
placeholder: ne,
|
54
53
|
size: s = D.L,
|
55
54
|
value: h,
|
56
|
-
onChange:
|
55
|
+
onChange: a,
|
57
56
|
full: Me,
|
58
57
|
showArrow: Te = !0,
|
59
|
-
items:
|
58
|
+
items: v = [],
|
60
59
|
classNameOption: ie,
|
61
|
-
displayValue:
|
60
|
+
displayValue: g = "name",
|
62
61
|
filterOnSearch: oe = !0,
|
63
62
|
onSearch: W,
|
64
|
-
variant: se =
|
63
|
+
variant: se = at.DefaultGray,
|
65
64
|
menuPlacement: C = "bottom",
|
66
65
|
disabled: p = !1,
|
67
66
|
searchProps: re,
|
68
67
|
withClearButton: K = !1,
|
69
68
|
withChip: Oe = !1,
|
70
69
|
chipVariant: ze = "sapphire",
|
71
|
-
disableInput:
|
72
|
-
autocomplete:
|
70
|
+
disableInput: L = !1,
|
71
|
+
autocomplete: ae = "on",
|
73
72
|
id: Ve,
|
74
73
|
autoPlacement: Y = !1,
|
75
|
-
onIsOpen:
|
74
|
+
onIsOpen: d,
|
76
75
|
noOptionsText: Ae = "Нет данных",
|
77
76
|
noMatchText: De = "Ничего не найдено",
|
78
77
|
loadOnOpen: B,
|
79
|
-
loading:
|
78
|
+
loading: le,
|
80
79
|
loadingIndicatorPlacement: q = P.Both,
|
81
80
|
groupBy: _,
|
82
|
-
getGroupTitle:
|
83
|
-
} =
|
84
|
-
() =>
|
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)
|
85
84
|
), [r, O] = f(
|
86
85
|
h || []
|
87
|
-
), [F,
|
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;
|
88
87
|
A(() => {
|
89
|
-
h && (O(h), JSON.stringify(h) !== JSON.stringify(r) && T(
|
90
|
-
}, [h,
|
88
|
+
h && (O(h), JSON.stringify(h) !== JSON.stringify(r) && T(ve(h, g)));
|
89
|
+
}, [h, g, r]);
|
91
90
|
const z = te(() => {
|
92
91
|
var n;
|
93
|
-
if (!oe) return
|
92
|
+
if (!oe) return v;
|
94
93
|
const e = ((n = M.split(",").pop()) == null ? void 0 : n.trim().toLowerCase()) ?? "";
|
95
|
-
return r.length > 0 && r[r.length - 1].name.toLowerCase() === e ?
|
94
|
+
return r.length > 0 && r[r.length - 1].name.toLowerCase() === e ? v : v.filter(
|
96
95
|
(o) => o.name.toLowerCase().includes(e)
|
97
96
|
);
|
98
|
-
}, [oe,
|
99
|
-
O(e),
|
100
|
-
const n =
|
101
|
-
T(n),
|
102
|
-
if (
|
103
|
-
|
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;
|
104
103
|
const o = n.length;
|
105
|
-
|
104
|
+
I.current.setSelectionRange(o, o);
|
106
105
|
}
|
107
106
|
}, 0);
|
108
107
|
}, fe = async (e) => {
|
109
|
-
var
|
110
|
-
if (
|
108
|
+
var b;
|
109
|
+
if (L) return;
|
111
110
|
const n = e.target.value;
|
112
111
|
T(n), W == null || W(n);
|
113
|
-
const o = n.split(",").map((
|
114
|
-
(
|
112
|
+
const o = n.split(",").map((x) => x.trim()).filter(Boolean), N = v.filter(
|
113
|
+
(x) => o.includes(x[g])
|
115
114
|
);
|
116
|
-
if (JSON.stringify(
|
115
|
+
if (JSON.stringify(N) !== JSON.stringify(r) && (O(N), a == null || a(N)), !l && (w(!0), U(k), B))
|
117
116
|
try {
|
118
117
|
H(!0), await B();
|
119
118
|
} finally {
|
120
119
|
H(!1);
|
121
120
|
}
|
122
|
-
const
|
121
|
+
const S = (b = E.current) == null ? void 0 : b.querySelector(
|
123
122
|
`.${t.options}`
|
124
123
|
);
|
125
|
-
|
124
|
+
S && typeof S.scrollTo == "function" && S.scrollTo({ top: 0, behavior: "smooth" });
|
126
125
|
}, Re = (e) => {
|
127
126
|
const n = r.filter(
|
128
127
|
(o) => o.id !== e.id
|
129
128
|
);
|
130
|
-
O(n),
|
129
|
+
O(n), a == null || a(n), T(Ie(n, g));
|
131
130
|
}, m = et(() => {
|
132
131
|
if (!Y) {
|
133
|
-
|
132
|
+
de(C);
|
134
133
|
return;
|
135
134
|
}
|
136
135
|
const e = tt(E, s);
|
137
|
-
|
136
|
+
de(e ? "top" : C);
|
138
137
|
}, [Y, C, s]), He = (e) => {
|
139
138
|
e.preventDefault(), e.currentTarget.focus();
|
140
139
|
const n = e.currentTarget.value.length;
|
141
140
|
e.currentTarget.setSelectionRange(n, n);
|
142
141
|
}, Je = () => {
|
143
|
-
T(""), O([]),
|
142
|
+
T(""), O([]), a == null || a([]);
|
144
143
|
}, $e = (e) => {
|
145
144
|
e.stopPropagation(), Je();
|
146
145
|
}, he = async () => {
|
@@ -151,65 +150,65 @@ import '../../assets/MultiSelectSearch.css';const ut = "_disabled_uc668_5", dt =
|
|
151
150
|
H(!1);
|
152
151
|
}
|
153
152
|
}, _e = async () => {
|
154
|
-
m(),
|
153
|
+
m(), w(!0), U(k), await he();
|
155
154
|
}, je = async (e) => {
|
156
|
-
if (
|
155
|
+
if (L) {
|
157
156
|
e.target.blur();
|
158
157
|
return;
|
159
158
|
}
|
160
159
|
await _e();
|
161
|
-
},
|
162
|
-
const e = !
|
163
|
-
e && (m(), U(
|
160
|
+
}, be = async () => {
|
161
|
+
const e = !l;
|
162
|
+
e && (m(), U(k), await he()), w(e), d == null || d(e);
|
164
163
|
};
|
165
164
|
A(() => {
|
166
|
-
if (
|
165
|
+
if (l) {
|
167
166
|
const e = (n) => {
|
168
|
-
E.current && !E.current.contains(n.target) && !n.defaultPrevented && (
|
167
|
+
E.current && !E.current.contains(n.target) && !n.defaultPrevented && (w(!1), d == null || d(!1));
|
169
168
|
};
|
170
169
|
return document.addEventListener("mousedown", e), () => {
|
171
170
|
document.removeEventListener("mousedown", e);
|
172
171
|
};
|
173
172
|
}
|
174
|
-
}, [
|
173
|
+
}, [l, d]), A(() => {
|
175
174
|
const n = (o) => {
|
176
|
-
o.detail ===
|
175
|
+
o.detail === k || !l || Q.current || (Q.current = !0, w(!1), d == null || d(!1), queueMicrotask(() => {
|
177
176
|
Q.current = !1;
|
178
177
|
}));
|
179
178
|
};
|
180
|
-
return window.addEventListener(
|
181
|
-
}, [
|
182
|
-
if (
|
179
|
+
return window.addEventListener(ge, n), () => window.removeEventListener(ge, n);
|
180
|
+
}, [k, d, l]), A(() => {
|
181
|
+
if (l) {
|
183
182
|
m(), window.addEventListener("scroll", m), window.addEventListener("resize", m);
|
184
183
|
const e = requestAnimationFrame(() => {
|
185
|
-
pe(!0),
|
184
|
+
pe(!0), ue(!0);
|
186
185
|
});
|
187
186
|
return () => {
|
188
187
|
window.removeEventListener("scroll", m), window.removeEventListener("resize", m), cancelAnimationFrame(e);
|
189
188
|
};
|
190
189
|
} else
|
191
|
-
|
192
|
-
}, [
|
190
|
+
ue(!1), pe(!1);
|
191
|
+
}, [l, C, Y, s, m]);
|
193
192
|
const Ue = () => {
|
194
193
|
if (Te)
|
195
194
|
return {
|
196
195
|
addonType: "react-node",
|
197
|
-
addonContent: /* @__PURE__ */
|
198
|
-
me && (q === P.Input || q === P.Both) && /* @__PURE__ */ i(
|
196
|
+
addonContent: /* @__PURE__ */ u(ee, { children: [
|
197
|
+
me && (q === P.Input || q === P.Both) && /* @__PURE__ */ i(Ne, { size: "s" }),
|
199
198
|
/* @__PURE__ */ i(
|
200
|
-
|
199
|
+
Se,
|
201
200
|
{
|
202
|
-
className:
|
201
|
+
className: c(t.button, {
|
203
202
|
[t.disabled]: p
|
204
203
|
}),
|
205
204
|
disabled: p,
|
206
|
-
onMouseDown:
|
205
|
+
onMouseDown: be,
|
207
206
|
children: /* @__PURE__ */ i(
|
208
207
|
ot,
|
209
208
|
{
|
210
|
-
iconName: s == D.
|
211
|
-
className:
|
212
|
-
[t["selector-icon-open"]]:
|
209
|
+
iconName: s == D.M ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
|
210
|
+
className: c(t["selector-icon"], {
|
211
|
+
[t["selector-icon-open"]]: l
|
213
212
|
})
|
214
213
|
}
|
215
214
|
)
|
@@ -217,28 +216,28 @@ import '../../assets/MultiSelectSearch.css';const ut = "_disabled_uc668_5", dt =
|
|
217
216
|
)
|
218
217
|
] })
|
219
218
|
};
|
220
|
-
}, We = () => me && (q === P.Dropdown || q === P.Both) ? /* @__PURE__ */
|
221
|
-
/* @__PURE__ */ i(
|
219
|
+
}, We = () => me && (q === P.Dropdown || q === P.Both) ? /* @__PURE__ */ u("div", { className: t.loader, children: [
|
220
|
+
/* @__PURE__ */ i(Ne, { size: "s" }),
|
222
221
|
"Загрузка..."
|
223
222
|
] }) : Ae, V = te(() => _ ? nt(
|
224
223
|
z,
|
225
224
|
_,
|
226
|
-
|
227
|
-
) : z, [z, _,
|
225
|
+
ce || ((e) => e)
|
226
|
+
) : z, [z, _, ce]), J = te(() => {
|
228
227
|
const e = [];
|
229
228
|
return V.forEach((n, o) => {
|
230
229
|
n.isGroupHeader && e.push(o);
|
231
230
|
}), e;
|
232
|
-
}, [V]),
|
231
|
+
}, [V]), y = Qe({
|
233
232
|
count: V.length,
|
234
233
|
getScrollElement: () => G.current,
|
235
234
|
estimateSize: () => s === D.L ? 65 : 49,
|
236
235
|
overscan: 10
|
237
|
-
}), Ke = () =>
|
236
|
+
}), Ke = () => v.length ? z.length ? _ ? /* @__PURE__ */ u(
|
238
237
|
"div",
|
239
238
|
{
|
240
239
|
ref: G,
|
241
|
-
className:
|
240
|
+
className: c(
|
242
241
|
t.options,
|
243
242
|
t[s],
|
244
243
|
t[F],
|
@@ -265,16 +264,16 @@ import '../../assets/MultiSelectSearch.css';const ut = "_disabled_uc668_5", dt =
|
|
265
264
|
"div",
|
266
265
|
{
|
267
266
|
style: {
|
268
|
-
height: `${
|
267
|
+
height: `${y.getTotalSize()}px`,
|
269
268
|
width: "100%"
|
270
269
|
},
|
271
|
-
children:
|
270
|
+
children: y.getVirtualItems().map((e) => {
|
272
271
|
const n = V[e.index];
|
273
272
|
return /* @__PURE__ */ i(
|
274
273
|
"div",
|
275
274
|
{
|
276
275
|
"data-index": e.index,
|
277
|
-
ref:
|
276
|
+
ref: y.measureElement,
|
278
277
|
style: {
|
279
278
|
position: "absolute",
|
280
279
|
top: 0,
|
@@ -295,7 +294,7 @@ import '../../assets/MultiSelectSearch.css';const ut = "_disabled_uc668_5", dt =
|
|
295
294
|
Ce,
|
296
295
|
{
|
297
296
|
value: n,
|
298
|
-
className: ({ focus: o }) =>
|
297
|
+
className: ({ focus: o }) => c(
|
299
298
|
t.option,
|
300
299
|
ie,
|
301
300
|
s && t[s],
|
@@ -303,13 +302,13 @@ import '../../assets/MultiSelectSearch.css';const ut = "_disabled_uc668_5", dt =
|
|
303
302
|
[t["option-active"]]: o
|
304
303
|
}
|
305
304
|
),
|
306
|
-
children: /* @__PURE__ */
|
307
|
-
/* @__PURE__ */
|
305
|
+
children: /* @__PURE__ */ u(ee, { children: [
|
306
|
+
/* @__PURE__ */ u("div", { className: t["option-inner"], children: [
|
308
307
|
n.name,
|
309
308
|
n.bottom && /* @__PURE__ */ i("div", { children: n.bottom })
|
310
309
|
] }),
|
311
310
|
/* @__PURE__ */ i(
|
312
|
-
|
311
|
+
we,
|
313
312
|
{
|
314
313
|
isInteractive: !1,
|
315
314
|
checked: r.some(
|
@@ -330,9 +329,9 @@ import '../../assets/MultiSelectSearch.css';const ut = "_disabled_uc668_5", dt =
|
|
330
329
|
]
|
331
330
|
}
|
332
331
|
) : /* @__PURE__ */ i(
|
333
|
-
|
332
|
+
ct,
|
334
333
|
{
|
335
|
-
className:
|
334
|
+
className: c(
|
336
335
|
t.options,
|
337
336
|
t[s],
|
338
337
|
t[F],
|
@@ -344,16 +343,16 @@ import '../../assets/MultiSelectSearch.css';const ut = "_disabled_uc668_5", dt =
|
|
344
343
|
Ce,
|
345
344
|
{
|
346
345
|
value: e,
|
347
|
-
className: ({ focus: n }) =>
|
346
|
+
className: ({ focus: n }) => c(t.option, ie, s && t[s], {
|
348
347
|
[t["option-active"]]: n
|
349
348
|
}),
|
350
|
-
children: /* @__PURE__ */
|
351
|
-
/* @__PURE__ */
|
349
|
+
children: /* @__PURE__ */ u(ee, { children: [
|
350
|
+
/* @__PURE__ */ u("div", { className: t["option-inner"], children: [
|
352
351
|
e.name,
|
353
352
|
e.bottom && /* @__PURE__ */ i("div", { children: e.bottom })
|
354
353
|
] }),
|
355
354
|
/* @__PURE__ */ i(
|
356
|
-
|
355
|
+
we,
|
357
356
|
{
|
358
357
|
isInteractive: !1,
|
359
358
|
checked: r.some(
|
@@ -369,7 +368,7 @@ import '../../assets/MultiSelectSearch.css';const ut = "_disabled_uc668_5", dt =
|
|
369
368
|
) : /* @__PURE__ */ i(
|
370
369
|
"div",
|
371
370
|
{
|
372
|
-
className:
|
371
|
+
className: c(
|
373
372
|
t.options,
|
374
373
|
t[s],
|
375
374
|
t["no-options"],
|
@@ -381,7 +380,7 @@ import '../../assets/MultiSelectSearch.css';const ut = "_disabled_uc668_5", dt =
|
|
381
380
|
) : /* @__PURE__ */ i(
|
382
381
|
"div",
|
383
382
|
{
|
384
|
-
className:
|
383
|
+
className: c(
|
385
384
|
t.options,
|
386
385
|
t[s],
|
387
386
|
t["no-options"],
|
@@ -395,30 +394,30 @@ import '../../assets/MultiSelectSearch.css';const ut = "_disabled_uc668_5", dt =
|
|
395
394
|
const e = G.current;
|
396
395
|
if (!e || !_) return;
|
397
396
|
const n = () => {
|
398
|
-
var Z,
|
397
|
+
var Z, S;
|
399
398
|
const o = e.scrollTop;
|
400
|
-
let
|
401
|
-
for (let
|
402
|
-
const
|
403
|
-
if ((((Z =
|
404
|
-
|
405
|
-
const $ = J[
|
406
|
-
if ($ !== void 0 && (((
|
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)
|
407
406
|
continue;
|
408
407
|
} else
|
409
408
|
break;
|
410
409
|
}
|
411
|
-
Ge(
|
410
|
+
Ge(N);
|
412
411
|
};
|
413
412
|
return e.addEventListener("scroll", n), () => e.removeEventListener("scroll", n);
|
414
|
-
}, [
|
413
|
+
}, [y, J, _, G.current]), /* @__PURE__ */ u("div", { ref: E, children: [
|
415
414
|
/* @__PURE__ */ i(
|
416
|
-
|
415
|
+
lt,
|
417
416
|
{
|
418
417
|
multiple: !0,
|
419
418
|
as: "div",
|
420
419
|
value: r,
|
421
|
-
className:
|
420
|
+
className: c(t["multi-select-search"], {
|
422
421
|
[t.full]: Me,
|
423
422
|
[t.disabled]: p
|
424
423
|
}),
|
@@ -426,28 +425,28 @@ import '../../assets/MultiSelectSearch.css';const ut = "_disabled_uc668_5", dt =
|
|
426
425
|
ref: Ee,
|
427
426
|
disabled: p,
|
428
427
|
virtual: _ ? void 0 : { options: z },
|
429
|
-
children: /* @__PURE__ */
|
428
|
+
children: /* @__PURE__ */ u(
|
430
429
|
"div",
|
431
430
|
{
|
432
|
-
className:
|
433
|
-
[t["container-open"]]:
|
431
|
+
className: c(t.container, t[s], {
|
432
|
+
[t["container-open"]]: l
|
434
433
|
}),
|
435
434
|
children: [
|
436
|
-
|
435
|
+
L && /* @__PURE__ */ u("div", { className: t["input-container"], children: [
|
437
436
|
/* @__PURE__ */ i(
|
438
|
-
|
437
|
+
Se,
|
439
438
|
{
|
440
439
|
disabled: p,
|
441
440
|
style: { width: "100%" },
|
442
|
-
onClick:
|
441
|
+
onClick: be,
|
443
442
|
children: /* @__PURE__ */ i(
|
444
|
-
|
443
|
+
xe,
|
445
444
|
{
|
446
|
-
as:
|
445
|
+
as: ye,
|
447
446
|
label: ne,
|
448
|
-
size:
|
449
|
-
className:
|
450
|
-
[t["multi-select-input-disabled"]]:
|
447
|
+
size: ke(s),
|
448
|
+
className: c(t["multi-select-input"], {
|
449
|
+
[t["multi-select-input-disabled"]]: L && K
|
451
450
|
}),
|
452
451
|
onChange: fe,
|
453
452
|
value: M,
|
@@ -459,9 +458,9 @@ import '../../assets/MultiSelectSearch.css';const ut = "_disabled_uc668_5", dt =
|
|
459
458
|
onFocus: je,
|
460
459
|
rightAddon: {
|
461
460
|
addonType: "icon",
|
462
|
-
addonContent: it(
|
461
|
+
addonContent: it(l, s)
|
463
462
|
},
|
464
|
-
autocomplete:
|
463
|
+
autocomplete: ae,
|
465
464
|
...re
|
466
465
|
}
|
467
466
|
)
|
@@ -471,7 +470,7 @@ import '../../assets/MultiSelectSearch.css';const ut = "_disabled_uc668_5", dt =
|
|
471
470
|
st,
|
472
471
|
{
|
473
472
|
tabIndex: -1,
|
474
|
-
className:
|
473
|
+
className: c(t.clear, {
|
475
474
|
[t.disabled]: p
|
476
475
|
}),
|
477
476
|
iconButtonClassName: t["icon-button"],
|
@@ -486,12 +485,12 @@ import '../../assets/MultiSelectSearch.css';const ut = "_disabled_uc668_5", dt =
|
|
486
485
|
}
|
487
486
|
)
|
488
487
|
] }),
|
489
|
-
!
|
490
|
-
|
488
|
+
!L && /* @__PURE__ */ i(
|
489
|
+
xe,
|
491
490
|
{
|
492
|
-
as:
|
491
|
+
as: ye,
|
493
492
|
label: ne,
|
494
|
-
size:
|
493
|
+
size: ke(s),
|
495
494
|
className: t["multi-select-input"],
|
496
495
|
rightSlotClassName: t["right-slot"],
|
497
496
|
requiredMarkClassName: t["required-mark"],
|
@@ -502,14 +501,14 @@ import '../../assets/MultiSelectSearch.css';const ut = "_disabled_uc668_5", dt =
|
|
502
501
|
onFocus: _e,
|
503
502
|
onMouseDown: He,
|
504
503
|
onChange: fe,
|
505
|
-
ref:
|
504
|
+
ref: I,
|
506
505
|
rightAddon: Ue(),
|
507
506
|
"data-testid": "select-search-input",
|
508
|
-
autocomplete:
|
507
|
+
autocomplete: ae,
|
509
508
|
...re
|
510
509
|
}
|
511
510
|
),
|
512
|
-
|
511
|
+
l && Be && Ke()
|
513
512
|
]
|
514
513
|
}
|
515
514
|
)
|
@@ -531,5 +530,5 @@ import '../../assets/MultiSelectSearch.css';const ut = "_disabled_uc668_5", dt =
|
|
531
530
|
}
|
532
531
|
);
|
533
532
|
export {
|
534
|
-
|
533
|
+
Ft as MultiSelectSearch
|
535
534
|
};
|
@@ -1,10 +1,10 @@
|
|
1
|
-
var p = /* @__PURE__ */ ((o) => (o.
|
2
|
-
const
|
3
|
-
var
|
1
|
+
var p = /* @__PURE__ */ ((o) => (o.M = "m", o.L = "l", o))(p || {});
|
2
|
+
const _ = 767, B = 264, E = 320;
|
3
|
+
var r = /* @__PURE__ */ ((o) => (o.Input = "input", o.Dropdown = "dropdown", o.Both = "both", o.None = "none", o))(r || {});
|
4
4
|
export {
|
5
|
-
|
6
|
-
|
5
|
+
E as DESKTOP_MENU_HEIGHT,
|
6
|
+
r as ELoadingIndicatorPlacement,
|
7
7
|
p as EMultiSelectSearchSize,
|
8
|
-
|
9
|
-
|
8
|
+
_ as MOBILE_BREAKPOINT,
|
9
|
+
B as MOBILE_MENU_HEIGHT
|
10
10
|
};
|
@@ -3,7 +3,7 @@ import { TMultiSelectOption } from './types';
|
|
3
3
|
import { EInputSize } from '../Input';
|
4
4
|
|
5
5
|
export declare const mapSizeToInputSize: (size: EMultiSelectSearchSize) => EInputSize;
|
6
|
-
export declare const getDropdownArrowIcon: (isOpen: boolean, size: EMultiSelectSearchSize) => "DropdownArrowBottom16px" | "
|
6
|
+
export declare const getDropdownArrowIcon: (isOpen: boolean, size: EMultiSelectSearchSize) => "DropdownArrowBottom16px" | "DropdownArrowUp16px" | "DropdownArrowUp24px" | "DropdownArrowDown24px";
|
7
7
|
export declare const getInitialInputValue: (value: TMultiSelectOption[] | undefined | null, displayValue: string) => string;
|
8
8
|
export declare const joinSelectedItems: (items: TMultiSelectOption[], displayValue: string) => string;
|
9
9
|
export declare const MULTISELECT_OPEN_EVENT = "multiselectOpen";
|