mimir-ui-kit 1.36.8 → 1.36.10
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{Input-WnjLXNpw.js → Input-CbgqYgLo.js} +65 -63
- package/dist/{combobox-CDU06zJj.js → combobox-BpYucpxz.js} +1121 -1080
- package/dist/components/Accordion/Accordion.js +15 -15
- package/dist/components/CheckboxMimir/CheckboxMimir.js +4 -4
- package/dist/components/DatePicker/DatePicker.js +1 -1
- package/dist/components/Drawer/Drawer.d.ts +9 -1
- package/dist/components/Drawer/Drawer.js +76 -72
- package/dist/components/Input/Input.d.ts +4 -0
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/index.js +1 -1
- package/dist/components/InputPassword/InputPassword.js +1 -1
- package/dist/components/InputPhoneNumber/InputPhoneNumber.js +1 -1
- package/dist/components/MultiSelectSearch/MultiSelectSearch.d.ts +1 -0
- package/dist/components/MultiSelectSearch/MultiSelectSearch.js +108 -105
- package/dist/components/MultiSelectSearch/types.d.ts +2 -0
- package/dist/components/MultiSelectSearch/utils.js +1 -1
- package/dist/components/OtpInput/OtpInput.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +3 -3
- package/dist/components/SelectSearch/SelectSearch.d.ts +1 -0
- package/dist/components/SelectSearch/SelectSearch.js +96 -92
- package/dist/components/SelectSearch/types.d.ts +2 -0
- package/dist/components/SelectSearch/utils.js +1 -1
- package/dist/components/Switcher/Switcher.js +4 -4
- package/dist/components/TabTrail/TabTrail.js +4 -4
- package/dist/components/TextArea/TextArea.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{field-FJ34aSs4.js → field-C1kt7aNM.js} +2 -2
- package/dist/{focus-management-XwV-9qkO.js → focus-management-DOYCPyGg.js} +1 -1
- package/dist/{hidden-DbgtYPOH.js → hidden-PvGXrYUY.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/{keyboard-B0lm_zyn.js → keyboard-mgWkd2Vh.js} +114 -111
- package/dist/{label-y3ANLTNC.js → label-D4GFpe5F.js} +2 -2
- package/dist/open-closed-D2VjDhAN.js +86 -0
- package/dist/{use-active-press-86hajhdd.js → use-active-press-CqLGIFz7.js} +1 -1
- package/package.json +1 -1
- package/dist/open-closed-CdldUPoq.js +0 -86
@@ -1,138 +1,139 @@
|
|
1
|
-
import { jsxs as g, jsx as
|
1
|
+
import { jsxs as g, jsx as n, Fragment as B } from "react/jsx-runtime";
|
2
2
|
import { c as l } from "../../index-DIxK0V-G.js";
|
3
|
-
import { forwardRef as
|
3
|
+
import { forwardRef as ie, useRef as R, useState as S, useEffect as j, useMemo as le } from "react";
|
4
4
|
import { EMultiSelectSearchSize as M } from "./constants.js";
|
5
|
-
import { getInitialInputValue as E, mapSizeToInputSize as F, getDropdownArrowIcon as
|
6
|
-
import { Icon as
|
7
|
-
import { Button as
|
8
|
-
import { CheckboxMimir as
|
9
|
-
import { Chip as
|
10
|
-
import { I as
|
11
|
-
import { EInputVariant as
|
12
|
-
import { H as
|
13
|
-
import '../../assets/MultiSelectSearch.css';const
|
5
|
+
import { getInitialInputValue as E, mapSizeToInputSize as F, getDropdownArrowIcon as re, joinSelectedItems as P } from "./utils.js";
|
6
|
+
import { Icon as ce } from "../../icons/Icon.js";
|
7
|
+
import { Button as ae } from "../Button/Button.js";
|
8
|
+
import { CheckboxMimir as ue } from "../CheckboxMimir/CheckboxMimir.js";
|
9
|
+
import { Chip as de } from "../Chip/Chip.js";
|
10
|
+
import { I as G } from "../../Input-CbgqYgLo.js";
|
11
|
+
import { EInputVariant as pe } from "../Input/constants.js";
|
12
|
+
import { H as me, U as H, G as J, K as _e, j as he } from "../../combobox-BpYucpxz.js";
|
13
|
+
import '../../assets/MultiSelectSearch.css';const fe = "_disabled_17kql_5", ke = "_container_17kql_9", qe = "_full_17kql_27", ge = "_button_17kql_39", be = "_options_17kql_53", ve = "_top_17kql_64", Ne = "_bottom_17kql_69", Ie = "_m_17kql_2", we = "_l_17kql_111", Ce = "_focused_17kql_129", Se = "_option_17kql_53", Me = "_chip_17kql_158", xe = "_clear_17kql_183", e = {
|
14
14
|
"multi-select-search": "_multi-select-search_17kql_2",
|
15
|
-
disabled:
|
16
|
-
container:
|
15
|
+
disabled: fe,
|
16
|
+
container: ke,
|
17
17
|
"container-open": "_container-open_17kql_18",
|
18
18
|
"input-container": "_input-container_17kql_22",
|
19
|
-
full:
|
19
|
+
full: qe,
|
20
20
|
"selected-icon": "_selected-icon_17kql_31",
|
21
21
|
"selector-icon-open": "_selector-icon-open_17kql_35",
|
22
|
-
button:
|
22
|
+
button: ge,
|
23
23
|
"selector-icon": "_selector-icon_17kql_35",
|
24
|
-
options:
|
25
|
-
top:
|
26
|
-
bottom:
|
24
|
+
options: be,
|
25
|
+
top: ve,
|
26
|
+
bottom: Ne,
|
27
27
|
"no-options": "_no-options_17kql_90",
|
28
|
-
m:
|
29
|
-
l:
|
28
|
+
m: Ie,
|
29
|
+
l: we,
|
30
30
|
"multi-select-input-disabled": "_multi-select-input-disabled_17kql_126",
|
31
31
|
"multi-select-input": "_multi-select-input_17kql_126",
|
32
|
-
focused:
|
33
|
-
option:
|
32
|
+
focused: Ce,
|
33
|
+
option: Se,
|
34
34
|
"option-active": "_option-active_17kql_148",
|
35
35
|
"option-inner": "_option-inner_17kql_151",
|
36
|
-
chip:
|
36
|
+
chip: Me,
|
37
37
|
"chip-container": "_chip-container_17kql_163",
|
38
38
|
"chip-root": "_chip-root_17kql_169",
|
39
39
|
"right-slot": "_right-slot_17kql_173",
|
40
40
|
"required-mark": "_required-mark_17kql_178",
|
41
|
-
clear:
|
41
|
+
clear: xe,
|
42
42
|
"icon-button": "_icon-button_17kql_192"
|
43
|
-
}, Fe =
|
44
|
-
(
|
43
|
+
}, Fe = ie(
|
44
|
+
(K, U) => {
|
45
45
|
const {
|
46
46
|
placeholder: x,
|
47
47
|
size: i = M.L,
|
48
48
|
value: a,
|
49
49
|
onChange: s,
|
50
|
-
full:
|
51
|
-
showArrow:
|
50
|
+
full: W,
|
51
|
+
showArrow: Q = !0,
|
52
52
|
items: m = [],
|
53
|
-
classNameOption:
|
53
|
+
classNameOption: X,
|
54
54
|
displayValue: d = "name",
|
55
55
|
filterOnSearch: y = !0,
|
56
56
|
onSearch: v,
|
57
|
-
variant: D =
|
57
|
+
variant: D = pe.DefaultGray,
|
58
58
|
menuPlacement: N = "bottom",
|
59
59
|
disabled: r = !1,
|
60
60
|
searchProps: z,
|
61
61
|
withClearButton: I = !1,
|
62
|
-
withChip:
|
63
|
-
chipVariant:
|
64
|
-
disableInput: _ = !1
|
65
|
-
|
62
|
+
withChip: Y = !1,
|
63
|
+
chipVariant: Z = "sapphire",
|
64
|
+
disableInput: _ = !1,
|
65
|
+
autocomplete: O = "on"
|
66
|
+
} = K, w = R(null), p = R(null), [b, h] = S(!1), [f, k] = S(
|
66
67
|
() => E(a, d)
|
67
68
|
), [u, q] = S(
|
68
69
|
a || []
|
69
70
|
);
|
70
|
-
|
71
|
+
j(() => {
|
71
72
|
a && (q(a), JSON.stringify(a) !== JSON.stringify(u) && k(E(a, d)));
|
72
73
|
}, [a, d, u]);
|
73
|
-
const
|
74
|
-
var
|
74
|
+
const A = le(() => {
|
75
|
+
var o;
|
75
76
|
if (!y) return m;
|
76
|
-
const t = ((
|
77
|
+
const t = ((o = f.split(",").pop()) == null ? void 0 : o.trim().toLowerCase()) ?? "";
|
77
78
|
return m.filter(
|
78
79
|
(c) => c.name.toLowerCase().includes(t)
|
79
80
|
);
|
80
|
-
}, [y, m, f]),
|
81
|
+
}, [y, m, f]), $ = (t) => {
|
81
82
|
q(t), s == null || s(t);
|
82
|
-
const
|
83
|
-
k(
|
83
|
+
const o = P(t, d);
|
84
|
+
k(o), h(!0), setTimeout(() => {
|
84
85
|
if (p.current) {
|
85
86
|
p.current.focus(), p.current.scrollLeft = p.current.scrollWidth;
|
86
|
-
const c =
|
87
|
+
const c = o.length;
|
87
88
|
p.current.setSelectionRange(c, c);
|
88
89
|
}
|
89
90
|
}, 0);
|
90
|
-
},
|
91
|
+
}, L = (t) => {
|
91
92
|
if (_) return;
|
92
|
-
const
|
93
|
-
k(
|
94
|
-
const c =
|
93
|
+
const o = t.target.value;
|
94
|
+
k(o), v == null || v(o);
|
95
|
+
const c = o.split(",").map((C) => C.trim()).filter(Boolean), V = m.filter(
|
95
96
|
(C) => c.includes(C[d])
|
96
97
|
);
|
97
|
-
q(
|
98
|
-
},
|
99
|
-
const
|
98
|
+
q(V), s == null || s(V), h(!0);
|
99
|
+
}, ee = (t) => {
|
100
|
+
const o = u.filter(
|
100
101
|
(c) => c.id !== t.id
|
101
102
|
);
|
102
|
-
q(
|
103
|
-
},
|
103
|
+
q(o), s == null || s(o), k(P(o, d));
|
104
|
+
}, T = () => h((t) => !t), te = (t) => {
|
104
105
|
t.preventDefault(), t.currentTarget.focus();
|
105
|
-
const
|
106
|
-
t.currentTarget.setSelectionRange(
|
107
|
-
},
|
106
|
+
const o = t.currentTarget.value.length;
|
107
|
+
t.currentTarget.setSelectionRange(o, o);
|
108
|
+
}, oe = () => {
|
108
109
|
k(""), q([]), s == null || s([]);
|
109
110
|
}, ne = (t) => {
|
110
|
-
t.stopPropagation(),
|
111
|
-
},
|
111
|
+
t.stopPropagation(), oe();
|
112
|
+
}, se = (t) => {
|
112
113
|
_ && t.target.blur();
|
113
114
|
};
|
114
|
-
return
|
115
|
-
const t = (
|
116
|
-
w.current && !w.current.contains(
|
115
|
+
return j(() => {
|
116
|
+
const t = (o) => {
|
117
|
+
w.current && !w.current.contains(o.target) && !o.defaultPrevented && h(!1);
|
117
118
|
};
|
118
119
|
return document.addEventListener("mousedown", t), () => {
|
119
120
|
document.removeEventListener("mousedown", t);
|
120
121
|
};
|
121
122
|
}, []), /* @__PURE__ */ g("div", { ref: w, children: [
|
122
|
-
/* @__PURE__ */
|
123
|
-
|
123
|
+
/* @__PURE__ */ n(
|
124
|
+
me,
|
124
125
|
{
|
125
126
|
multiple: !0,
|
126
127
|
as: "div",
|
127
128
|
value: u,
|
128
129
|
className: l(e["multi-select-search"], {
|
129
|
-
[e.full]:
|
130
|
+
[e.full]: W,
|
130
131
|
[e.disabled]: r
|
131
132
|
}),
|
132
|
-
onChange:
|
133
|
-
ref:
|
133
|
+
onChange: $,
|
134
|
+
ref: U,
|
134
135
|
disabled: r,
|
135
|
-
virtual: { options:
|
136
|
+
virtual: { options: A },
|
136
137
|
children: /* @__PURE__ */ g(
|
137
138
|
"div",
|
138
139
|
{
|
@@ -141,40 +142,41 @@ import '../../assets/MultiSelectSearch.css';const he = "_disabled_17kql_5", fe =
|
|
141
142
|
}),
|
142
143
|
children: [
|
143
144
|
_ && /* @__PURE__ */ g("div", { className: e["input-container"], children: [
|
144
|
-
/* @__PURE__ */
|
145
|
-
|
145
|
+
/* @__PURE__ */ n(
|
146
|
+
H,
|
146
147
|
{
|
147
148
|
disabled: r,
|
148
149
|
style: { width: "100%" },
|
149
|
-
onClick:
|
150
|
-
children: /* @__PURE__ */
|
151
|
-
|
150
|
+
onClick: T,
|
151
|
+
children: /* @__PURE__ */ n(
|
152
|
+
J,
|
152
153
|
{
|
153
|
-
as:
|
154
|
+
as: G,
|
154
155
|
label: x,
|
155
156
|
size: F(i),
|
156
157
|
className: l(e["multi-select-input"], {
|
157
158
|
[e["multi-select-input-disabled"]]: _ && I
|
158
159
|
}),
|
159
|
-
onChange:
|
160
|
+
onChange: L,
|
160
161
|
value: f,
|
161
162
|
disabled: r,
|
162
163
|
variant: D,
|
163
164
|
rightSlotClassName: e["right-slot"],
|
164
165
|
requiredMarkClassName: e["required-mark"],
|
165
166
|
"data-testid": "select-search-input",
|
166
|
-
onFocus:
|
167
|
+
onFocus: se,
|
167
168
|
rightAddon: {
|
168
169
|
addonType: "icon",
|
169
|
-
addonContent:
|
170
|
+
addonContent: re(b, i)
|
170
171
|
},
|
172
|
+
autocomplete: O,
|
171
173
|
...z
|
172
174
|
}
|
173
175
|
)
|
174
176
|
}
|
175
177
|
),
|
176
|
-
I && f && /* @__PURE__ */
|
177
|
-
|
178
|
+
I && f && /* @__PURE__ */ n(
|
179
|
+
ae,
|
178
180
|
{
|
179
181
|
tabIndex: -1,
|
180
182
|
className: l(e.clear, {
|
@@ -192,10 +194,10 @@ import '../../assets/MultiSelectSearch.css';const he = "_disabled_17kql_5", fe =
|
|
192
194
|
}
|
193
195
|
)
|
194
196
|
] }),
|
195
|
-
!_ && /* @__PURE__ */
|
196
|
-
|
197
|
+
!_ && /* @__PURE__ */ n(
|
198
|
+
J,
|
197
199
|
{
|
198
|
-
as:
|
200
|
+
as: G,
|
199
201
|
label: x,
|
200
202
|
size: F(i),
|
201
203
|
className: e["multi-select-input"],
|
@@ -206,21 +208,21 @@ import '../../assets/MultiSelectSearch.css';const he = "_disabled_17kql_5", fe =
|
|
206
208
|
variant: D,
|
207
209
|
withClearButton: I,
|
208
210
|
onFocus: () => h(!0),
|
209
|
-
onMouseDown:
|
210
|
-
onChange:
|
211
|
+
onMouseDown: te,
|
212
|
+
onChange: L,
|
211
213
|
ref: p,
|
212
214
|
rightAddon: {
|
213
215
|
addonType: "react-node",
|
214
|
-
addonContent:
|
215
|
-
|
216
|
+
addonContent: Q && /* @__PURE__ */ n(
|
217
|
+
H,
|
216
218
|
{
|
217
219
|
className: l(e.button, {
|
218
220
|
[e.disabled]: r
|
219
221
|
}),
|
220
222
|
disabled: r,
|
221
|
-
onMouseDown:
|
222
|
-
children: /* @__PURE__ */
|
223
|
-
|
223
|
+
onMouseDown: T,
|
224
|
+
children: /* @__PURE__ */ n(
|
225
|
+
ce,
|
224
226
|
{
|
225
227
|
iconName: i == M.M ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
|
226
228
|
className: l(e["selector-icon"], {
|
@@ -232,11 +234,12 @@ import '../../assets/MultiSelectSearch.css';const he = "_disabled_17kql_5", fe =
|
|
232
234
|
)
|
233
235
|
},
|
234
236
|
"data-testid": "select-search-input",
|
237
|
+
autocomplete: O,
|
235
238
|
...z
|
236
239
|
}
|
237
240
|
),
|
238
|
-
b && /* @__PURE__ */
|
239
|
-
|
241
|
+
b && /* @__PURE__ */ n(B, { children: m.length ? A.length ? /* @__PURE__ */ n(
|
242
|
+
_e,
|
240
243
|
{
|
241
244
|
className: l(
|
242
245
|
e.options,
|
@@ -245,29 +248,29 @@ import '../../assets/MultiSelectSearch.css';const he = "_disabled_17kql_5", fe =
|
|
245
248
|
),
|
246
249
|
modal: !1,
|
247
250
|
static: !0,
|
248
|
-
children: ({ option: t }) => /* @__PURE__ */
|
249
|
-
|
251
|
+
children: ({ option: t }) => /* @__PURE__ */ n(
|
252
|
+
he,
|
250
253
|
{
|
251
254
|
value: t,
|
252
|
-
className: ({ focus:
|
255
|
+
className: ({ focus: o }) => l(
|
253
256
|
e.option,
|
254
|
-
|
257
|
+
X,
|
255
258
|
i && e[i],
|
256
259
|
{
|
257
|
-
[e["option-active"]]:
|
260
|
+
[e["option-active"]]: o
|
258
261
|
}
|
259
262
|
),
|
260
|
-
children: /* @__PURE__ */ g(
|
263
|
+
children: /* @__PURE__ */ g(B, { children: [
|
261
264
|
/* @__PURE__ */ g("div", { className: e["option-inner"], children: [
|
262
265
|
t.name,
|
263
|
-
t.bottom && /* @__PURE__ */
|
266
|
+
t.bottom && /* @__PURE__ */ n("div", { children: t.bottom })
|
264
267
|
] }),
|
265
|
-
/* @__PURE__ */
|
266
|
-
|
268
|
+
/* @__PURE__ */ n(
|
269
|
+
ue,
|
267
270
|
{
|
268
271
|
isInteractive: !1,
|
269
272
|
checked: u.some(
|
270
|
-
(
|
273
|
+
(o) => o.id === t.id
|
271
274
|
)
|
272
275
|
}
|
273
276
|
)
|
@@ -276,7 +279,7 @@ import '../../assets/MultiSelectSearch.css';const he = "_disabled_17kql_5", fe =
|
|
276
279
|
t.id
|
277
280
|
)
|
278
281
|
}
|
279
|
-
) : /* @__PURE__ */
|
282
|
+
) : /* @__PURE__ */ n(
|
280
283
|
"div",
|
281
284
|
{
|
282
285
|
className: l(
|
@@ -287,7 +290,7 @@ import '../../assets/MultiSelectSearch.css';const he = "_disabled_17kql_5", fe =
|
|
287
290
|
),
|
288
291
|
children: "Ничего не найдено"
|
289
292
|
}
|
290
|
-
) : /* @__PURE__ */
|
293
|
+
) : /* @__PURE__ */ n(
|
291
294
|
"div",
|
292
295
|
{
|
293
296
|
className: l(
|
@@ -304,15 +307,15 @@ import '../../assets/MultiSelectSearch.css';const he = "_disabled_17kql_5", fe =
|
|
304
307
|
)
|
305
308
|
}
|
306
309
|
),
|
307
|
-
|
308
|
-
|
310
|
+
Y && u.length > 0 && /* @__PURE__ */ n("div", { className: e["chip-container"], children: u.map((t) => /* @__PURE__ */ n(
|
311
|
+
de,
|
309
312
|
{
|
310
313
|
size: i === M.L ? "s" : "xs",
|
311
|
-
variant:
|
314
|
+
variant: Z,
|
312
315
|
className: e["chip-root"],
|
313
316
|
withAction: !0,
|
314
|
-
onClose: () =>
|
315
|
-
children: /* @__PURE__ */
|
317
|
+
onClose: () => ee(t),
|
318
|
+
children: /* @__PURE__ */ n("span", { className: e.chip, children: t.name })
|
316
319
|
},
|
317
320
|
t.id
|
318
321
|
)) })
|
@@ -57,4 +57,6 @@ export type TMultiSelectSearchProps = Pick<TInputProps, 'withClearButton' | 'var
|
|
57
57
|
chipVariant?: EChipVariant | `${EChipVariant}`;
|
58
58
|
/** Отключает инпут, но позволяет открывать меню*/
|
59
59
|
disableInput?: boolean;
|
60
|
+
/** Управляет поведением автозаполнения браузера */
|
61
|
+
autocomplete?: 'on' | 'off';
|
60
62
|
};
|
@@ -3,7 +3,7 @@ import { c as u } from "../../index-DIxK0V-G.js";
|
|
3
3
|
import { forwardRef as P, useImperativeHandle as R, Fragment as T } from "react";
|
4
4
|
import { ITEMS_PER_SEPARATOR as q, DEFAULT_VALUE_LENGTH as v } from "./constants.js";
|
5
5
|
import { useOTPInput as y } from "./hooks.js";
|
6
|
-
import { I as A } from "../../Input-
|
6
|
+
import { I as A } from "../../Input-CbgqYgLo.js";
|
7
7
|
import '../../assets/OtpInput.css';const C = "_otp_1shq3_3", F = "_input_1shq3_14", L = "_separator_1shq3_28", r = {
|
8
8
|
otp: C,
|
9
9
|
"input-wrapper": "_input-wrapper_1shq3_14",
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { jsxs as ee, jsx as L, Fragment as _e } from "react/jsx-runtime";
|
2
|
-
import { K as V, w as ye, a as oe, z as te, U as ie, b as ke, T as Oe, j as we, u as Pe, I as Ee, G as Te, p as De } from "../../label-
|
3
|
-
import { W, y as z, o as U, H as K, s as se, n as ne, $ as le, b as de, D as ue, a as Ce, u as Ge, c as N } from "../../keyboard-
|
2
|
+
import { K as V, w as ye, a as oe, z as te, U as ie, b as ke, T as Oe, j as we, u as Pe, I as Ee, G as Te, p as De } from "../../label-D4GFpe5F.js";
|
3
|
+
import { W, y as z, o as U, H as K, s as se, n as ne, $ as le, b as de, D as ue, a as Ce, u as Ge, c as N } from "../../keyboard-mgWkd2Vh.js";
|
4
4
|
import E, { createContext as ce, useId as q, useReducer as xe, useRef as B, useMemo as T, useCallback as Fe, useContext as pe, forwardRef as Ne } from "react";
|
5
5
|
import { u as Ae } from "../../use-by-comparator-CVuf9KBq.js";
|
6
6
|
import { r as fe } from "../../bugs-diTMAGNw.js";
|
7
|
-
import { P as re, F as H, T as ae, _ as Ie } from "../../focus-management-
|
7
|
+
import { P as re, F as H, T as ae, _ as Ie } from "../../focus-management-DOYCPyGg.js";
|
8
8
|
import { c as M } from "../../index-DIxK0V-G.js";
|
9
9
|
import '../../assets/RadioGroup.css';var Se = ((e) => (e[e.RegisterOption = 0] = "RegisterOption", e[e.UnregisterOption = 1] = "UnregisterOption", e))(Se || {});
|
10
10
|
let Le = { 0(e, r) {
|
@@ -17,4 +17,5 @@ export declare const SelectSearch: import('react').ForwardRefExoticComponent<Pic
|
|
17
17
|
disabled?: boolean;
|
18
18
|
searchProps?: Pick<import('../Input').TInputProps, "numbersOnly" | "maxLength" | "required">;
|
19
19
|
disableInput?: boolean;
|
20
|
+
autocomplete?: "on" | "off";
|
20
21
|
} & import('react').RefAttributes<HTMLElement>>;
|