mimir-ui-kit 1.37.10 → 1.37.11
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/MultiSelectSearch/MultiSelectSearch.d.ts +1 -0
- package/dist/components/MultiSelectSearch/MultiSelectSearch.js +228 -209
- package/dist/components/MultiSelectSearch/types.d.ts +4 -0
- package/dist/components/MultiSelectSearch/utils.d.ts +2 -0
- package/dist/components/MultiSelectSearch/utils.js +12 -8
- package/package.json +1 -1
|
@@ -20,4 +20,5 @@ export declare const MultiSelectSearch: import('react').ForwardRefExoticComponen
|
|
|
20
20
|
chipVariant?: import('../Chip').EChipVariant | `${import('../Chip').EChipVariant}`;
|
|
21
21
|
disableInput?: boolean;
|
|
22
22
|
autocomplete?: "on" | "off";
|
|
23
|
+
id?: string;
|
|
23
24
|
} & import('react').RefAttributes<HTMLElement>>;
|
|
@@ -1,232 +1,251 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { EMultiSelectSearchSize as
|
|
5
|
-
import { getInitialInputValue 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
|
|
1
|
+
import { jsxs as b, jsx as o, Fragment as j } from "react/jsx-runtime";
|
|
2
|
+
import { c as r } from "../../index-DIxK0V-G.js";
|
|
3
|
+
import { forwardRef as ce, useRef as P, useState as E, useEffect as L, useMemo as ae } from "react";
|
|
4
|
+
import { EMultiSelectSearchSize as O } from "./constants.js";
|
|
5
|
+
import { getInitialInputValue as F, MULTISELECT_OPEN_EVENT as G, mapSizeToInputSize as U, getDropdownArrowIcon as ue, dispatchMultiselectOpen as I, joinSelectedItems as H } from "./utils.js";
|
|
6
|
+
import { Icon as de } from "../../icons/Icon.js";
|
|
7
|
+
import { Button as pe } from "../Button/Button.js";
|
|
8
|
+
import { CheckboxMimir as me } from "../CheckboxMimir/CheckboxMimir.js";
|
|
9
|
+
import { Chip as _e } from "../Chip/Chip.js";
|
|
10
|
+
import { I as J } from "../../Input-BYrIS5GU.js";
|
|
11
|
+
import { EInputVariant as he } from "../Input/constants.js";
|
|
12
|
+
import { H as fe, U as K, G as W, K as ke, j as qe } from "../../combobox-BpYucpxz.js";
|
|
13
|
+
import '../../assets/MultiSelectSearch.css';const ge = "_disabled_17kql_5", ve = "_container_17kql_9", be = "_full_17kql_27", Ie = "_button_17kql_39", we = "_options_17kql_53", Ne = "_top_17kql_64", Ce = "_bottom_17kql_69", Se = "_m_17kql_2", Me = "_l_17kql_111", Ee = "_focused_17kql_129", Le = "_option_17kql_53", Oe = "_chip_17kql_158", Te = "_clear_17kql_183", t = {
|
|
14
14
|
"multi-select-search": "_multi-select-search_17kql_2",
|
|
15
|
-
disabled:
|
|
16
|
-
container:
|
|
15
|
+
disabled: ge,
|
|
16
|
+
container: ve,
|
|
17
17
|
"container-open": "_container-open_17kql_18",
|
|
18
18
|
"input-container": "_input-container_17kql_22",
|
|
19
|
-
full:
|
|
19
|
+
full: be,
|
|
20
20
|
"selected-icon": "_selected-icon_17kql_31",
|
|
21
21
|
"selector-icon-open": "_selector-icon-open_17kql_35",
|
|
22
|
-
button:
|
|
22
|
+
button: Ie,
|
|
23
23
|
"selector-icon": "_selector-icon_17kql_35",
|
|
24
|
-
options:
|
|
25
|
-
top:
|
|
26
|
-
bottom:
|
|
24
|
+
options: we,
|
|
25
|
+
top: Ne,
|
|
26
|
+
bottom: Ce,
|
|
27
27
|
"no-options": "_no-options_17kql_90",
|
|
28
|
-
m:
|
|
29
|
-
l:
|
|
28
|
+
m: Se,
|
|
29
|
+
l: Me,
|
|
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: Ee,
|
|
33
|
+
option: Le,
|
|
34
34
|
"option-active": "_option-active_17kql_148",
|
|
35
35
|
"option-inner": "_option-inner_17kql_151",
|
|
36
|
-
chip:
|
|
36
|
+
chip: Oe,
|
|
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: Te,
|
|
42
42
|
"icon-button": "_icon-button_17kql_192"
|
|
43
|
-
},
|
|
44
|
-
(
|
|
43
|
+
}, Ue = ce(
|
|
44
|
+
($, Q) => {
|
|
45
45
|
const {
|
|
46
|
-
placeholder:
|
|
47
|
-
size: i =
|
|
48
|
-
value:
|
|
46
|
+
placeholder: T,
|
|
47
|
+
size: i = O.L,
|
|
48
|
+
value: u,
|
|
49
49
|
onChange: s,
|
|
50
|
-
full:
|
|
51
|
-
showArrow:
|
|
52
|
-
items:
|
|
53
|
-
classNameOption:
|
|
54
|
-
displayValue:
|
|
55
|
-
filterOnSearch:
|
|
56
|
-
onSearch:
|
|
57
|
-
variant:
|
|
50
|
+
full: X,
|
|
51
|
+
showArrow: Y = !0,
|
|
52
|
+
items: d = [],
|
|
53
|
+
classNameOption: Z,
|
|
54
|
+
displayValue: p = "name",
|
|
55
|
+
filterOnSearch: x = !0,
|
|
56
|
+
onSearch: w,
|
|
57
|
+
variant: y = he.DefaultGray,
|
|
58
58
|
menuPlacement: N = "bottom",
|
|
59
|
-
disabled:
|
|
60
|
-
searchProps:
|
|
61
|
-
withClearButton:
|
|
62
|
-
withChip:
|
|
63
|
-
chipVariant:
|
|
64
|
-
disableInput:
|
|
65
|
-
autocomplete:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
59
|
+
disabled: c = !1,
|
|
60
|
+
searchProps: D,
|
|
61
|
+
withClearButton: C = !1,
|
|
62
|
+
withChip: ee = !1,
|
|
63
|
+
chipVariant: te = "sapphire",
|
|
64
|
+
disableInput: f = !1,
|
|
65
|
+
autocomplete: z = "on",
|
|
66
|
+
id: m = `multiselect-${Math.random().toString(36).slice(2, 11)}`
|
|
67
|
+
} = $, S = P(null), _ = P(null), [k, h] = E(!1), [q, g] = E(
|
|
68
|
+
() => F(u, p)
|
|
69
|
+
), [l, v] = E(
|
|
70
|
+
u || []
|
|
70
71
|
);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}, [
|
|
74
|
-
const
|
|
75
|
-
var
|
|
76
|
-
if (!
|
|
77
|
-
const
|
|
78
|
-
return
|
|
79
|
-
(
|
|
72
|
+
L(() => {
|
|
73
|
+
u && (v(u), JSON.stringify(u) !== JSON.stringify(l) && g(F(u, p)));
|
|
74
|
+
}, [u, p, l]);
|
|
75
|
+
const V = ae(() => {
|
|
76
|
+
var n;
|
|
77
|
+
if (!x) return d;
|
|
78
|
+
const e = ((n = q.split(",").pop()) == null ? void 0 : n.trim().toLowerCase()) ?? "";
|
|
79
|
+
return l.length > 0 && l[l.length - 1].name.toLowerCase() === e ? d : d.filter(
|
|
80
|
+
(a) => a.name.toLowerCase().includes(e)
|
|
80
81
|
);
|
|
81
|
-
}, [
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
if (
|
|
86
|
-
|
|
87
|
-
const
|
|
88
|
-
|
|
82
|
+
}, [x, d, q, l]), ne = (e) => {
|
|
83
|
+
v(e), s == null || s(e);
|
|
84
|
+
const n = H(e, p);
|
|
85
|
+
g(n), h(!0), I(m), setTimeout(() => {
|
|
86
|
+
if (_.current) {
|
|
87
|
+
_.current.focus(), _.current.scrollLeft = _.current.scrollWidth;
|
|
88
|
+
const a = n.length;
|
|
89
|
+
_.current.setSelectionRange(a, a);
|
|
89
90
|
}
|
|
90
91
|
}, 0);
|
|
91
|
-
},
|
|
92
|
-
if (
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
(
|
|
92
|
+
}, A = (e) => {
|
|
93
|
+
if (f) return;
|
|
94
|
+
const n = e.target.value;
|
|
95
|
+
g(n), w == null || w(n);
|
|
96
|
+
const a = n.split(",").map((M) => M.trim()).filter(Boolean), R = d.filter(
|
|
97
|
+
(M) => a.includes(M[p])
|
|
97
98
|
);
|
|
98
|
-
|
|
99
|
-
},
|
|
100
|
-
const
|
|
101
|
-
(
|
|
99
|
+
v(R), s == null || s(R), h(!0), I(m);
|
|
100
|
+
}, oe = (e) => {
|
|
101
|
+
const n = l.filter(
|
|
102
|
+
(a) => a.id !== e.id
|
|
102
103
|
);
|
|
103
|
-
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
104
|
+
v(n), s == null || s(n), g(H(n, p));
|
|
105
|
+
}, B = () => {
|
|
106
|
+
const e = !k;
|
|
107
|
+
h(e), e && I(m);
|
|
108
|
+
}, se = (e) => {
|
|
109
|
+
e.preventDefault(), e.currentTarget.focus();
|
|
110
|
+
const n = e.currentTarget.value.length;
|
|
111
|
+
e.currentTarget.setSelectionRange(n, n);
|
|
112
|
+
}, ie = () => {
|
|
113
|
+
g(""), v([]), s == null || s([]);
|
|
114
|
+
}, le = (e) => {
|
|
115
|
+
e.stopPropagation(), ie();
|
|
116
|
+
}, re = (e) => {
|
|
117
|
+
f && e.target.blur();
|
|
114
118
|
};
|
|
115
|
-
return
|
|
116
|
-
const
|
|
117
|
-
|
|
119
|
+
return L(() => {
|
|
120
|
+
const e = (n) => {
|
|
121
|
+
S.current && !S.current.contains(n.target) && !n.defaultPrevented && h(!1);
|
|
118
122
|
};
|
|
119
|
-
return document.addEventListener("mousedown",
|
|
120
|
-
document.removeEventListener("mousedown",
|
|
123
|
+
return document.addEventListener("mousedown", e), () => {
|
|
124
|
+
document.removeEventListener("mousedown", e);
|
|
121
125
|
};
|
|
122
|
-
}, []),
|
|
123
|
-
|
|
124
|
-
|
|
126
|
+
}, []), L(() => {
|
|
127
|
+
const e = (n) => {
|
|
128
|
+
n.detail !== m && h(!1);
|
|
129
|
+
};
|
|
130
|
+
return window.addEventListener(
|
|
131
|
+
G,
|
|
132
|
+
e
|
|
133
|
+
), () => {
|
|
134
|
+
window.removeEventListener(
|
|
135
|
+
G,
|
|
136
|
+
e
|
|
137
|
+
);
|
|
138
|
+
};
|
|
139
|
+
}, [m]), /* @__PURE__ */ b("div", { ref: S, children: [
|
|
140
|
+
/* @__PURE__ */ o(
|
|
141
|
+
fe,
|
|
125
142
|
{
|
|
126
143
|
multiple: !0,
|
|
127
144
|
as: "div",
|
|
128
|
-
value:
|
|
129
|
-
className:
|
|
130
|
-
[
|
|
131
|
-
[
|
|
145
|
+
value: l,
|
|
146
|
+
className: r(t["multi-select-search"], {
|
|
147
|
+
[t.full]: X,
|
|
148
|
+
[t.disabled]: c
|
|
132
149
|
}),
|
|
133
|
-
onChange:
|
|
134
|
-
ref:
|
|
135
|
-
disabled:
|
|
136
|
-
virtual: { options:
|
|
137
|
-
children: /* @__PURE__ */
|
|
150
|
+
onChange: ne,
|
|
151
|
+
ref: Q,
|
|
152
|
+
disabled: c,
|
|
153
|
+
virtual: { options: V },
|
|
154
|
+
children: /* @__PURE__ */ b(
|
|
138
155
|
"div",
|
|
139
156
|
{
|
|
140
|
-
className:
|
|
141
|
-
[
|
|
157
|
+
className: r(t.container, t[i], {
|
|
158
|
+
[t["container-open"]]: k
|
|
142
159
|
}),
|
|
143
160
|
children: [
|
|
144
|
-
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
|
|
161
|
+
f && /* @__PURE__ */ b("div", { className: t["input-container"], children: [
|
|
162
|
+
/* @__PURE__ */ o(
|
|
163
|
+
K,
|
|
147
164
|
{
|
|
148
|
-
disabled:
|
|
165
|
+
disabled: c,
|
|
149
166
|
style: { width: "100%" },
|
|
150
|
-
onClick:
|
|
151
|
-
children: /* @__PURE__ */
|
|
152
|
-
|
|
167
|
+
onClick: B,
|
|
168
|
+
children: /* @__PURE__ */ o(
|
|
169
|
+
W,
|
|
153
170
|
{
|
|
154
|
-
as:
|
|
155
|
-
label:
|
|
156
|
-
size:
|
|
157
|
-
className:
|
|
158
|
-
[
|
|
171
|
+
as: J,
|
|
172
|
+
label: T,
|
|
173
|
+
size: U(i),
|
|
174
|
+
className: r(t["multi-select-input"], {
|
|
175
|
+
[t["multi-select-input-disabled"]]: f && C
|
|
159
176
|
}),
|
|
160
|
-
onChange:
|
|
161
|
-
value:
|
|
162
|
-
disabled:
|
|
163
|
-
variant:
|
|
164
|
-
rightSlotClassName:
|
|
165
|
-
requiredMarkClassName:
|
|
177
|
+
onChange: A,
|
|
178
|
+
value: q,
|
|
179
|
+
disabled: c,
|
|
180
|
+
variant: y,
|
|
181
|
+
rightSlotClassName: t["right-slot"],
|
|
182
|
+
requiredMarkClassName: t["required-mark"],
|
|
166
183
|
"data-testid": "select-search-input",
|
|
167
|
-
onFocus:
|
|
184
|
+
onFocus: re,
|
|
168
185
|
rightAddon: {
|
|
169
186
|
addonType: "icon",
|
|
170
|
-
addonContent:
|
|
187
|
+
addonContent: ue(k, i)
|
|
171
188
|
},
|
|
172
|
-
autocomplete:
|
|
173
|
-
...
|
|
189
|
+
autocomplete: z,
|
|
190
|
+
...D
|
|
174
191
|
}
|
|
175
192
|
)
|
|
176
193
|
}
|
|
177
194
|
),
|
|
178
|
-
|
|
179
|
-
|
|
195
|
+
C && q && /* @__PURE__ */ o(
|
|
196
|
+
pe,
|
|
180
197
|
{
|
|
181
198
|
tabIndex: -1,
|
|
182
|
-
className:
|
|
183
|
-
[
|
|
199
|
+
className: r(t.clear, {
|
|
200
|
+
[t.disabled]: c
|
|
184
201
|
}),
|
|
185
|
-
iconButtonClassName:
|
|
202
|
+
iconButtonClassName: t["icon-button"],
|
|
186
203
|
isIconButton: !0,
|
|
187
204
|
iconName: "Close16px",
|
|
188
205
|
size: "m-s",
|
|
189
206
|
clear: !0,
|
|
190
|
-
disabled:
|
|
207
|
+
disabled: c,
|
|
191
208
|
variant: "secondary-gray",
|
|
192
|
-
onClick:
|
|
209
|
+
onClick: le,
|
|
193
210
|
"data-testid": "clear-button"
|
|
194
211
|
}
|
|
195
212
|
)
|
|
196
213
|
] }),
|
|
197
|
-
!
|
|
198
|
-
|
|
214
|
+
!f && /* @__PURE__ */ o(
|
|
215
|
+
W,
|
|
199
216
|
{
|
|
200
|
-
as:
|
|
201
|
-
label:
|
|
202
|
-
size:
|
|
203
|
-
className:
|
|
204
|
-
rightSlotClassName:
|
|
205
|
-
requiredMarkClassName:
|
|
206
|
-
value:
|
|
207
|
-
disabled:
|
|
208
|
-
variant:
|
|
209
|
-
withClearButton:
|
|
210
|
-
onFocus: () =>
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
217
|
+
as: J,
|
|
218
|
+
label: T,
|
|
219
|
+
size: U(i),
|
|
220
|
+
className: t["multi-select-input"],
|
|
221
|
+
rightSlotClassName: t["right-slot"],
|
|
222
|
+
requiredMarkClassName: t["required-mark"],
|
|
223
|
+
value: q,
|
|
224
|
+
disabled: c,
|
|
225
|
+
variant: y,
|
|
226
|
+
withClearButton: C,
|
|
227
|
+
onFocus: () => {
|
|
228
|
+
h(!0), I(m);
|
|
229
|
+
},
|
|
230
|
+
onMouseDown: se,
|
|
231
|
+
onChange: A,
|
|
232
|
+
ref: _,
|
|
214
233
|
rightAddon: {
|
|
215
234
|
addonType: "react-node",
|
|
216
|
-
addonContent:
|
|
217
|
-
|
|
235
|
+
addonContent: Y && /* @__PURE__ */ o(
|
|
236
|
+
K,
|
|
218
237
|
{
|
|
219
|
-
className:
|
|
220
|
-
[
|
|
238
|
+
className: r(t.button, {
|
|
239
|
+
[t.disabled]: c
|
|
221
240
|
}),
|
|
222
|
-
disabled:
|
|
223
|
-
onMouseDown:
|
|
224
|
-
children: /* @__PURE__ */
|
|
225
|
-
|
|
241
|
+
disabled: c,
|
|
242
|
+
onMouseDown: B,
|
|
243
|
+
children: /* @__PURE__ */ o(
|
|
244
|
+
de,
|
|
226
245
|
{
|
|
227
|
-
iconName: i ==
|
|
228
|
-
className:
|
|
229
|
-
[
|
|
246
|
+
iconName: i == O.M ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
|
|
247
|
+
className: r(t["selector-icon"], {
|
|
248
|
+
[t["selector-icon-open"]]: k
|
|
230
249
|
})
|
|
231
250
|
}
|
|
232
251
|
)
|
|
@@ -234,70 +253,70 @@ import '../../assets/MultiSelectSearch.css';const fe = "_disabled_17kql_5", ke =
|
|
|
234
253
|
)
|
|
235
254
|
},
|
|
236
255
|
"data-testid": "select-search-input",
|
|
237
|
-
autocomplete:
|
|
238
|
-
...
|
|
256
|
+
autocomplete: z,
|
|
257
|
+
...D
|
|
239
258
|
}
|
|
240
259
|
),
|
|
241
|
-
|
|
242
|
-
|
|
260
|
+
k && /* @__PURE__ */ o(j, { children: d.length ? V.length ? /* @__PURE__ */ o(
|
|
261
|
+
ke,
|
|
243
262
|
{
|
|
244
|
-
className:
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
263
|
+
className: r(
|
|
264
|
+
t.options,
|
|
265
|
+
t[i],
|
|
266
|
+
t[N]
|
|
248
267
|
),
|
|
249
268
|
modal: !1,
|
|
250
269
|
static: !0,
|
|
251
|
-
children: ({ option:
|
|
252
|
-
|
|
270
|
+
children: ({ option: e }) => /* @__PURE__ */ o(
|
|
271
|
+
qe,
|
|
253
272
|
{
|
|
254
|
-
value:
|
|
255
|
-
className: ({ focus:
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
i &&
|
|
273
|
+
value: e,
|
|
274
|
+
className: ({ focus: n }) => r(
|
|
275
|
+
t.option,
|
|
276
|
+
Z,
|
|
277
|
+
i && t[i],
|
|
259
278
|
{
|
|
260
|
-
[
|
|
279
|
+
[t["option-active"]]: n
|
|
261
280
|
}
|
|
262
281
|
),
|
|
263
|
-
children: /* @__PURE__ */
|
|
264
|
-
/* @__PURE__ */
|
|
265
|
-
|
|
266
|
-
|
|
282
|
+
children: /* @__PURE__ */ b(j, { children: [
|
|
283
|
+
/* @__PURE__ */ b("div", { className: t["option-inner"], children: [
|
|
284
|
+
e.name,
|
|
285
|
+
e.bottom && /* @__PURE__ */ o("div", { children: e.bottom })
|
|
267
286
|
] }),
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
-
|
|
287
|
+
/* @__PURE__ */ o(
|
|
288
|
+
me,
|
|
270
289
|
{
|
|
271
290
|
isInteractive: !1,
|
|
272
|
-
checked:
|
|
273
|
-
(
|
|
291
|
+
checked: l.some(
|
|
292
|
+
(n) => n.id === e.id
|
|
274
293
|
)
|
|
275
294
|
}
|
|
276
295
|
)
|
|
277
296
|
] })
|
|
278
297
|
},
|
|
279
|
-
|
|
298
|
+
e.id
|
|
280
299
|
)
|
|
281
300
|
}
|
|
282
|
-
) : /* @__PURE__ */
|
|
301
|
+
) : /* @__PURE__ */ o(
|
|
283
302
|
"div",
|
|
284
303
|
{
|
|
285
|
-
className:
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
304
|
+
className: r(
|
|
305
|
+
t.options,
|
|
306
|
+
t[i],
|
|
307
|
+
t["no-options"],
|
|
308
|
+
t[N]
|
|
290
309
|
),
|
|
291
310
|
children: "Ничего не найдено"
|
|
292
311
|
}
|
|
293
|
-
) : /* @__PURE__ */
|
|
312
|
+
) : /* @__PURE__ */ o(
|
|
294
313
|
"div",
|
|
295
314
|
{
|
|
296
|
-
className:
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
315
|
+
className: r(
|
|
316
|
+
t.options,
|
|
317
|
+
t[i],
|
|
318
|
+
t["no-options"],
|
|
319
|
+
t[N]
|
|
301
320
|
),
|
|
302
321
|
children: "Нет данных"
|
|
303
322
|
}
|
|
@@ -307,21 +326,21 @@ import '../../assets/MultiSelectSearch.css';const fe = "_disabled_17kql_5", ke =
|
|
|
307
326
|
)
|
|
308
327
|
}
|
|
309
328
|
),
|
|
310
|
-
|
|
311
|
-
|
|
329
|
+
ee && l.length > 0 && /* @__PURE__ */ o("div", { className: t["chip-container"], children: l.map((e) => /* @__PURE__ */ o(
|
|
330
|
+
_e,
|
|
312
331
|
{
|
|
313
|
-
size: i ===
|
|
314
|
-
variant:
|
|
315
|
-
className:
|
|
332
|
+
size: i === O.L ? "s" : "xs",
|
|
333
|
+
variant: te,
|
|
334
|
+
className: t["chip-root"],
|
|
316
335
|
withAction: !0,
|
|
317
|
-
onClose: () =>
|
|
318
|
-
children: /* @__PURE__ */
|
|
336
|
+
onClose: () => oe(e),
|
|
337
|
+
children: /* @__PURE__ */ o("span", { className: t.chip, children: e.name })
|
|
319
338
|
},
|
|
320
|
-
|
|
339
|
+
e.id
|
|
321
340
|
)) })
|
|
322
341
|
] });
|
|
323
342
|
}
|
|
324
343
|
);
|
|
325
344
|
export {
|
|
326
|
-
|
|
345
|
+
Ue as MultiSelectSearch
|
|
327
346
|
};
|
|
@@ -59,4 +59,8 @@ export type TMultiSelectSearchProps = Pick<TInputProps, 'withClearButton' | 'var
|
|
|
59
59
|
disableInput?: boolean;
|
|
60
60
|
/** Управляет поведением автозаполнения браузера */
|
|
61
61
|
autocomplete?: 'on' | 'off';
|
|
62
|
+
/**
|
|
63
|
+
* Уникальный идентификатор мультиселекта
|
|
64
|
+
*/
|
|
65
|
+
id?: string;
|
|
62
66
|
};
|
|
@@ -6,3 +6,5 @@ export declare const mapSizeToInputSize: (size: EMultiSelectSearchSize) => EInpu
|
|
|
6
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
|
+
export declare const MULTISELECT_OPEN_EVENT = "multiselectOpen";
|
|
10
|
+
export declare const dispatchMultiselectOpen: (id: string) => void;
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import { EMultiSelectSearchSize as
|
|
1
|
+
import { EMultiSelectSearchSize as o } from "./constants.js";
|
|
2
2
|
import "../../Input-BYrIS5GU.js";
|
|
3
3
|
import { EInputSize as e } from "../Input/constants.js";
|
|
4
|
-
const w = (
|
|
5
|
-
switch (
|
|
6
|
-
case
|
|
4
|
+
const w = (t) => {
|
|
5
|
+
switch (t) {
|
|
6
|
+
case o.M:
|
|
7
7
|
return e.M;
|
|
8
|
-
case
|
|
8
|
+
case o.L:
|
|
9
9
|
return e.L;
|
|
10
10
|
default:
|
|
11
11
|
return e.M;
|
|
12
12
|
}
|
|
13
|
-
},
|
|
13
|
+
}, s = (t, r) => t ? r === o.L ? "DropdownArrowUp24px" : "DropdownArrowUp16px" : r === o.L ? "DropdownArrowDown24px" : "DropdownArrowBottom16px", m = (t, r) => t && t.length > 0 ? t.map((n) => n[r]).join(", ") : "", d = (t, r) => t.map((n) => n[r]).join(", "), p = "multiselectOpen", a = (t) => {
|
|
14
|
+
window.dispatchEvent(new CustomEvent(p, { detail: t }));
|
|
15
|
+
};
|
|
14
16
|
export {
|
|
15
|
-
|
|
17
|
+
p as MULTISELECT_OPEN_EVENT,
|
|
18
|
+
a as dispatchMultiselectOpen,
|
|
19
|
+
s as getDropdownArrowIcon,
|
|
16
20
|
m as getInitialInputValue,
|
|
17
|
-
|
|
21
|
+
d as joinSelectedItems,
|
|
18
22
|
w as mapSizeToInputSize
|
|
19
23
|
};
|