@reportportal/ui-kit 0.0.1-alpha.230 → 0.0.1-alpha.231
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/autocompletes.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { c as
|
|
1
|
+
import { jsx as r, jsxs as T, Fragment as he } from "react/jsx-runtime";
|
|
2
|
+
import { useState as ne, useRef as Ce, useEffect as we, useCallback as Y, forwardRef as De, useLayoutEffect as je, useMemo as He } from "react";
|
|
3
|
+
import { c as J } from "./bind-06a7ff84.js";
|
|
4
4
|
import { Scrollbars as We } from "rc-scrollbars";
|
|
5
5
|
import { B as Ye } from "./bubblesLoader-f3ffa240.js";
|
|
6
6
|
import { B as Ke } from "./button-7ab874f3.js";
|
|
7
7
|
import { S as Xe } from "./plus-199fb2a8.js";
|
|
8
|
-
import { i as
|
|
8
|
+
import { i as Me } from "./isEmpty-ccacb5ff.js";
|
|
9
9
|
import { createPortal as Ge } from "react-dom";
|
|
10
|
-
import
|
|
11
|
-
import { useFloating as
|
|
10
|
+
import _e from "downshift";
|
|
11
|
+
import { useFloating as Pe, autoUpdate as Be, flip as Je, size as Qe } from "@floating-ui/react";
|
|
12
12
|
import { F as Ze } from "./fieldText-1749da7a.js";
|
|
13
|
-
import { S as
|
|
14
|
-
import { E as
|
|
13
|
+
import { S as Oe } from "./dropdown-0260bb66.js";
|
|
14
|
+
import { E as Te, A as qe, T as Ue } from "./constants-85822a6b.js";
|
|
15
15
|
import { S as Ve } from "./close-4d480ef7.js";
|
|
16
16
|
import { S as et } from "./clear-53660571.js";
|
|
17
17
|
import "./openEye-950159cb.js";
|
|
@@ -29,7 +29,7 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
29
29
|
"single-line": "_single-line_1rpph_58",
|
|
30
30
|
"cross-icon": "_cross-icon_1rpph_64",
|
|
31
31
|
input: ot
|
|
32
|
-
},
|
|
32
|
+
}, fe = J.bind(st), nt = (t) => t.scrollWidth > t.clientWidth, rt = ({
|
|
33
33
|
item: t,
|
|
34
34
|
onRemoveItem: e,
|
|
35
35
|
disabled: n = !1,
|
|
@@ -37,87 +37,87 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
37
37
|
parseValueToString: s,
|
|
38
38
|
error: l = !1,
|
|
39
39
|
editItem: h,
|
|
40
|
-
editable:
|
|
41
|
-
getAdditionalCreationCondition:
|
|
42
|
-
storedOption:
|
|
40
|
+
editable: d = !1,
|
|
41
|
+
getAdditionalCreationCondition: b = () => !0,
|
|
42
|
+
storedOption: x = !0,
|
|
43
43
|
highlightUnStoredItem: p = !1,
|
|
44
|
-
variant:
|
|
45
|
-
getItemName:
|
|
46
|
-
singleLine:
|
|
47
|
-
className:
|
|
48
|
-
textClassName:
|
|
44
|
+
variant: L = "light",
|
|
45
|
+
getItemName: M,
|
|
46
|
+
singleLine: u = !1,
|
|
47
|
+
className: P,
|
|
48
|
+
textClassName: O
|
|
49
49
|
}) => {
|
|
50
|
-
const [
|
|
51
|
-
!n &&
|
|
52
|
-
},
|
|
53
|
-
F
|
|
54
|
-
},
|
|
55
|
-
const
|
|
56
|
-
|
|
50
|
+
const [y, N] = ne(!1), [B, $] = ne(""), [c, i] = ne(!1), a = Ce(null), m = () => {
|
|
51
|
+
!n && d && !x && ($((M == null ? void 0 : M(t)) || (s == null ? void 0 : s(t)) || ""), N(!0));
|
|
52
|
+
}, g = (F) => {
|
|
53
|
+
$(F.target.value);
|
|
54
|
+
}, E = (F) => {
|
|
55
|
+
const D = b(B);
|
|
56
|
+
F.key === "Enter" && D && (h(t, B), N(!1), $(""));
|
|
57
57
|
}, _ = () => {
|
|
58
|
-
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
},
|
|
58
|
+
N(!1), $("");
|
|
59
|
+
}, I = (F) => {
|
|
60
|
+
F.stopPropagation(), e(t);
|
|
61
|
+
}, z = (s == null ? void 0 : s(t)) || "";
|
|
62
62
|
we(() => {
|
|
63
|
-
if (a.current &&
|
|
64
|
-
const
|
|
63
|
+
if (a.current && u) {
|
|
64
|
+
const F = () => {
|
|
65
65
|
a.current && i(nt(a.current));
|
|
66
66
|
};
|
|
67
|
-
if (
|
|
68
|
-
const
|
|
69
|
-
return
|
|
67
|
+
if (F(), typeof ResizeObserver < "u") {
|
|
68
|
+
const D = new ResizeObserver(F);
|
|
69
|
+
return D.observe(a.current), () => D.disconnect();
|
|
70
70
|
}
|
|
71
71
|
} else
|
|
72
72
|
i(!1);
|
|
73
|
-
}, [
|
|
74
|
-
const
|
|
73
|
+
}, [z, u]);
|
|
74
|
+
const S = fe(
|
|
75
75
|
"selected-item-text",
|
|
76
76
|
{
|
|
77
|
-
"single-line":
|
|
77
|
+
"single-line": u
|
|
78
78
|
},
|
|
79
|
-
|
|
80
|
-
),
|
|
79
|
+
O
|
|
80
|
+
), R = fe(
|
|
81
81
|
"selected-item",
|
|
82
|
-
|
|
82
|
+
L,
|
|
83
83
|
{
|
|
84
84
|
[`validation-${l}`]: l,
|
|
85
85
|
disabled: n,
|
|
86
86
|
"mobile-disabled": o,
|
|
87
|
-
"highlight-un-stored-item": p && !
|
|
87
|
+
"highlight-un-stored-item": p && !x
|
|
88
88
|
},
|
|
89
|
-
|
|
89
|
+
P
|
|
90
90
|
);
|
|
91
|
-
return
|
|
91
|
+
return y ? /* @__PURE__ */ r(
|
|
92
92
|
"input",
|
|
93
93
|
{
|
|
94
94
|
autoFocus: !0,
|
|
95
|
-
value:
|
|
96
|
-
onChange:
|
|
97
|
-
onKeyDown:
|
|
95
|
+
value: B,
|
|
96
|
+
onChange: g,
|
|
97
|
+
onKeyDown: E,
|
|
98
98
|
onBlur: _,
|
|
99
|
-
className:
|
|
99
|
+
className: fe("input")
|
|
100
100
|
}
|
|
101
|
-
) : /* @__PURE__ */
|
|
101
|
+
) : /* @__PURE__ */ T("div", { className: R, onClick: m, children: [
|
|
102
102
|
/* @__PURE__ */ r(
|
|
103
103
|
"span",
|
|
104
104
|
{
|
|
105
105
|
ref: a,
|
|
106
|
-
className:
|
|
107
|
-
title:
|
|
108
|
-
children:
|
|
106
|
+
className: S,
|
|
107
|
+
title: u && c ? z : void 0,
|
|
108
|
+
children: z
|
|
109
109
|
}
|
|
110
110
|
),
|
|
111
111
|
!n && /* @__PURE__ */ r(
|
|
112
112
|
"button",
|
|
113
113
|
{
|
|
114
114
|
type: "button",
|
|
115
|
-
className:
|
|
115
|
+
className: fe("cross-icon", {
|
|
116
116
|
[`validation-${l}`]: l,
|
|
117
117
|
"mobile-disabled": o,
|
|
118
118
|
disabled: n
|
|
119
119
|
}),
|
|
120
|
-
onClick:
|
|
120
|
+
onClick: I,
|
|
121
121
|
children: /* @__PURE__ */ r(Ve, {})
|
|
122
122
|
}
|
|
123
123
|
)
|
|
@@ -130,9 +130,9 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
130
130
|
highlightUnStoredItem: s = !1,
|
|
131
131
|
renderCustomSelectedItem: l,
|
|
132
132
|
selectedItemSingleLine: h,
|
|
133
|
-
selectedItemClassName:
|
|
134
|
-
selectedItemTextClassName:
|
|
135
|
-
...
|
|
133
|
+
selectedItemClassName: d,
|
|
134
|
+
selectedItemTextClassName: b,
|
|
135
|
+
...x
|
|
136
136
|
}) => t.map((p) => l ? l(p) : /* @__PURE__ */ r(
|
|
137
137
|
rt,
|
|
138
138
|
{
|
|
@@ -142,14 +142,14 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
142
142
|
storedOption: !!o[e(p)],
|
|
143
143
|
highlightUnStoredItem: s,
|
|
144
144
|
singleLine: h,
|
|
145
|
-
className:
|
|
146
|
-
textClassName:
|
|
147
|
-
...
|
|
145
|
+
className: d,
|
|
146
|
+
textClassName: b,
|
|
147
|
+
...x
|
|
148
148
|
},
|
|
149
149
|
e == null ? void 0 : e(p)
|
|
150
150
|
)), ct = "_prompt_1xfmd_16", it = {
|
|
151
151
|
prompt: ct
|
|
152
|
-
}, at =
|
|
152
|
+
}, at = J.bind(it), dt = ({ children: t = null }) => /* @__PURE__ */ r("div", { className: at("prompt"), children: t }), ut = "_item_zw4ux_16", mt = "_divider_zw4ux_24", ft = "_active_zw4ux_49", pt = "_value_zw4ux_55", _t = "_tag_zw4ux_69", ht = "_disabled_zw4ux_80", wt = {
|
|
153
153
|
item: ut,
|
|
154
154
|
divider: mt,
|
|
155
155
|
"new-item": "_new-item_zw4ux_31",
|
|
@@ -160,7 +160,7 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
160
160
|
"button-active": "_button-active_zw4ux_80",
|
|
161
161
|
disabled: ht,
|
|
162
162
|
"value-variant": "_value-variant_zw4ux_100"
|
|
163
|
-
}, V =
|
|
163
|
+
}, V = J.bind(wt), Re = ({
|
|
164
164
|
isActive: t = !1,
|
|
165
165
|
isSelected: e = !1,
|
|
166
166
|
isNew: n = !1,
|
|
@@ -168,12 +168,12 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
168
168
|
disabled: s = !1,
|
|
169
169
|
optionVariant: l = "",
|
|
170
170
|
newItemButtonText: h = "",
|
|
171
|
-
...
|
|
171
|
+
...d
|
|
172
172
|
}) => {
|
|
173
|
-
const
|
|
174
|
-
return n ? /* @__PURE__ */
|
|
173
|
+
const b = () => h || (l === "key-variant" ? "New key" : "New value");
|
|
174
|
+
return n ? /* @__PURE__ */ T(he, { children: [
|
|
175
175
|
/* @__PURE__ */ r("div", { className: V("divider") }),
|
|
176
|
-
/* @__PURE__ */
|
|
176
|
+
/* @__PURE__ */ T(
|
|
177
177
|
"li",
|
|
178
178
|
{
|
|
179
179
|
className: V("new-item", l, {
|
|
@@ -181,17 +181,17 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
181
181
|
selected: e,
|
|
182
182
|
disabled: s
|
|
183
183
|
}),
|
|
184
|
-
...
|
|
184
|
+
...d,
|
|
185
185
|
children: [
|
|
186
186
|
/* @__PURE__ */ r("span", { className: V("value"), children: o }),
|
|
187
187
|
/* @__PURE__ */ r(
|
|
188
188
|
Ke,
|
|
189
189
|
{
|
|
190
|
-
...!s &&
|
|
190
|
+
...!s && d,
|
|
191
191
|
className: V({ "button-active": t }),
|
|
192
192
|
icon: /* @__PURE__ */ r(Xe, {}),
|
|
193
193
|
variant: "text",
|
|
194
|
-
children:
|
|
194
|
+
children: b()
|
|
195
195
|
}
|
|
196
196
|
)
|
|
197
197
|
]
|
|
@@ -205,7 +205,7 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
205
205
|
selected: e,
|
|
206
206
|
disabled: s
|
|
207
207
|
}),
|
|
208
|
-
...s ? {} :
|
|
208
|
+
...s ? {} : d,
|
|
209
209
|
children: /* @__PURE__ */ r("span", { className: V("label", "tag"), children: o })
|
|
210
210
|
}
|
|
211
211
|
);
|
|
@@ -213,7 +213,7 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
213
213
|
container: vt,
|
|
214
214
|
"empty-list-message": "_empty-list-message_12uzd_20",
|
|
215
215
|
"limitation-item": "_limitation-item_12uzd_28"
|
|
216
|
-
},
|
|
216
|
+
}, pe = J.bind(bt), yt = (t) => {
|
|
217
217
|
const {
|
|
218
218
|
options: e,
|
|
219
219
|
async: n,
|
|
@@ -221,73 +221,73 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
221
221
|
loading: s,
|
|
222
222
|
createWithoutConfirmation: l,
|
|
223
223
|
customEmptyListMessage: h,
|
|
224
|
-
customNoMatchesMessage:
|
|
225
|
-
optionVariant:
|
|
226
|
-
newItemButtonText:
|
|
224
|
+
customNoMatchesMessage: d,
|
|
225
|
+
optionVariant: b,
|
|
226
|
+
newItemButtonText: x,
|
|
227
227
|
renderOption: p,
|
|
228
|
-
getUniqKey:
|
|
229
|
-
getItemProps:
|
|
230
|
-
parseValueToString:
|
|
231
|
-
limitationText:
|
|
232
|
-
optionsLimit:
|
|
233
|
-
shouldShowEmptyListMessage:
|
|
234
|
-
} = t,
|
|
235
|
-
(_,
|
|
228
|
+
getUniqKey: L,
|
|
229
|
+
getItemProps: M,
|
|
230
|
+
parseValueToString: u,
|
|
231
|
+
limitationText: P = "Too many results. Type to search",
|
|
232
|
+
optionsLimit: O = 0,
|
|
233
|
+
shouldShowEmptyListMessage: y = !0
|
|
234
|
+
} = t, N = Y(() => (e || []).filter((_) => u(_).toUpperCase().indexOf((o.toUpperCase() || "").trim()) > -1), [o, e, u]), B = Y(
|
|
235
|
+
(_, I, z = !1) => p ? p(_, I, z, M) : /* @__PURE__ */ r(
|
|
236
236
|
Re,
|
|
237
237
|
{
|
|
238
|
-
optionVariant:
|
|
239
|
-
...
|
|
240
|
-
isNew:
|
|
241
|
-
newItemButtonText:
|
|
242
|
-
children:
|
|
238
|
+
optionVariant: b,
|
|
239
|
+
...M({ item: _, index: I }),
|
|
240
|
+
isNew: z,
|
|
241
|
+
newItemButtonText: x,
|
|
242
|
+
children: u(_)
|
|
243
243
|
},
|
|
244
|
-
(
|
|
244
|
+
(L == null ? void 0 : L(_)) || u(_)
|
|
245
245
|
),
|
|
246
|
-
[
|
|
247
|
-
),
|
|
248
|
-
(_) => _.length ? _.map((
|
|
249
|
-
[
|
|
246
|
+
[M, L, x, b, u, p]
|
|
247
|
+
), $ = Y(
|
|
248
|
+
(_) => _.length ? _.map((I, z) => B(I, z)) : "",
|
|
249
|
+
[B]
|
|
250
250
|
), c = Y(
|
|
251
251
|
(_) => {
|
|
252
|
-
const
|
|
253
|
-
return /* @__PURE__ */ r("div", { className:
|
|
252
|
+
const I = _.length;
|
|
253
|
+
return /* @__PURE__ */ r("div", { className: pe({ container: !I }), children: /* @__PURE__ */ r(
|
|
254
254
|
Re,
|
|
255
255
|
{
|
|
256
|
-
optionVariant:
|
|
256
|
+
optionVariant: b,
|
|
257
257
|
isNew: !0,
|
|
258
|
-
newItemButtonText:
|
|
259
|
-
...
|
|
260
|
-
children:
|
|
258
|
+
newItemButtonText: x,
|
|
259
|
+
...M({ item: o, index: I }),
|
|
260
|
+
children: u(o)
|
|
261
261
|
},
|
|
262
|
-
|
|
262
|
+
u(o)
|
|
263
263
|
) });
|
|
264
264
|
},
|
|
265
|
-
[
|
|
265
|
+
[M, o, x, b, u]
|
|
266
266
|
), i = Y(
|
|
267
|
-
(_) => s ? /* @__PURE__ */
|
|
267
|
+
(_) => s ? /* @__PURE__ */ T(he, { children: [
|
|
268
268
|
/* @__PURE__ */ r(dt, { children: /* @__PURE__ */ r(Ye, {}) }),
|
|
269
269
|
!l && c(_)
|
|
270
270
|
] }) : "",
|
|
271
271
|
[l, s, c]
|
|
272
272
|
), a = Y(() => {
|
|
273
|
-
const _ = (e == null ? void 0 : e.length) === 0 ? h || "No available options" :
|
|
274
|
-
return /* @__PURE__ */ r("div", { className:
|
|
275
|
-
}, [h,
|
|
276
|
-
if (
|
|
277
|
-
return
|
|
278
|
-
const
|
|
279
|
-
return
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
|
|
282
|
-
(
|
|
273
|
+
const _ = (e == null ? void 0 : e.length) === 0 ? h || "No available options" : d || "No matches found";
|
|
274
|
+
return /* @__PURE__ */ r("div", { className: pe("empty-list-message"), children: _ });
|
|
275
|
+
}, [h, d, e == null ? void 0 : e.length]), m = n ? e : N(), g = i(e);
|
|
276
|
+
if (g)
|
|
277
|
+
return g;
|
|
278
|
+
const E = Me(m);
|
|
279
|
+
return E && !y && l ? null : /* @__PURE__ */ T("div", { className: pe({ container: e.length }), children: [
|
|
280
|
+
/* @__PURE__ */ T(We, { autoHeight: !0, autoHeightMax: 216, hideTracksWhenNotNeeded: !0, children: [
|
|
281
|
+
E ? y && a() : $(m),
|
|
282
|
+
(m == null ? void 0 : m.length) > O && O > 0 && P ? /* @__PURE__ */ r("li", { className: pe("limitation-item"), "aria-hidden": "true", children: P }) : null
|
|
283
283
|
] }),
|
|
284
|
-
!l && c(
|
|
284
|
+
!l && c(m)
|
|
285
285
|
] });
|
|
286
286
|
}, gt = "_menu_f64z5_16", xt = "_opened_f64z5_34", Nt = "_dark_f64z5_37", Et = {
|
|
287
287
|
menu: gt,
|
|
288
288
|
opened: xt,
|
|
289
289
|
dark: Nt
|
|
290
|
-
},
|
|
290
|
+
}, It = J.bind(Et), St = (t, e) => !t || t <= e.trim().length, $e = De(
|
|
291
291
|
({
|
|
292
292
|
isOpen: t = !1,
|
|
293
293
|
style: e = {},
|
|
@@ -296,28 +296,28 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
296
296
|
inputValue: s = "",
|
|
297
297
|
className: l = "",
|
|
298
298
|
portalMenuAttribute: h = null,
|
|
299
|
-
...
|
|
300
|
-
},
|
|
299
|
+
...d
|
|
300
|
+
}, b) => /* @__PURE__ */ r(
|
|
301
301
|
"ul",
|
|
302
302
|
{
|
|
303
|
-
ref:
|
|
304
|
-
className:
|
|
303
|
+
ref: b,
|
|
304
|
+
className: It(
|
|
305
305
|
"menu",
|
|
306
|
-
{ opened: t && (o ||
|
|
306
|
+
{ opened: t && (o || St(n, s)) },
|
|
307
307
|
l
|
|
308
308
|
),
|
|
309
309
|
style: e,
|
|
310
310
|
...h ? { [h]: "" } : {},
|
|
311
|
-
children: /* @__PURE__ */ r(yt, { inputValue: s, ...
|
|
311
|
+
children: /* @__PURE__ */ r(yt, { inputValue: s, ...d })
|
|
312
312
|
}
|
|
313
313
|
)
|
|
314
|
-
),
|
|
314
|
+
), Fe = (t, e) => typeof t == "string" ? t : e ? String(t[e(t)]) : "", ee = (t, e) => {
|
|
315
315
|
var o;
|
|
316
|
-
return t === e ? !0 : !!(t && e && typeof t == "object" && typeof e == "object" && Object.keys(t).length === Object.keys(e).length && ((o = Object.entries(t)) != null && o.every(([s, l]) =>
|
|
316
|
+
return t === e ? !0 : !!(t && e && typeof t == "object" && typeof e == "object" && Object.keys(t).length === Object.keys(e).length && ((o = Object.entries(t)) != null && o.every(([s, l]) => ee(l, e[s]))));
|
|
317
317
|
}, kt = (t, e, n) => typeof t == "string" ? t === e : n ? (() => {
|
|
318
318
|
const o = n(t);
|
|
319
319
|
return t[o] === e[o];
|
|
320
|
-
})() : !1,
|
|
320
|
+
})() : !1, At = ({
|
|
321
321
|
options: t = [],
|
|
322
322
|
onChange: e,
|
|
323
323
|
selectedItems: n = [],
|
|
@@ -325,54 +325,64 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
325
325
|
existingItemsMap: s = {},
|
|
326
326
|
children: l,
|
|
327
327
|
customizeNewSelectedValue: h = (p) => p,
|
|
328
|
-
getOptionUniqKey:
|
|
329
|
-
getOptionUniqKeyValue:
|
|
330
|
-
...
|
|
328
|
+
getOptionUniqKey: d,
|
|
329
|
+
getOptionUniqKeyValue: b,
|
|
330
|
+
...x
|
|
331
331
|
}) => {
|
|
332
|
-
const [p,
|
|
332
|
+
const [p, L] = ne(s), M = (c, i) => {
|
|
333
333
|
const a = {
|
|
334
334
|
...p
|
|
335
335
|
};
|
|
336
|
-
c.forEach((
|
|
337
|
-
if (t.find((
|
|
338
|
-
const
|
|
339
|
-
a[
|
|
336
|
+
c.forEach((m) => {
|
|
337
|
+
if (t.find((g) => kt(g, m, d))) {
|
|
338
|
+
const g = Fe(m, d);
|
|
339
|
+
a[g] = !0;
|
|
340
340
|
}
|
|
341
|
-
}),
|
|
342
|
-
},
|
|
343
|
-
const a =
|
|
341
|
+
}), L(a), i(a);
|
|
342
|
+
}, u = (c, i) => {
|
|
343
|
+
const a = Fe(c, d);
|
|
344
344
|
if (a in p) {
|
|
345
|
-
const
|
|
346
|
-
delete
|
|
345
|
+
const m = { ...p };
|
|
346
|
+
delete m[a], L(m), i(m);
|
|
347
347
|
} else
|
|
348
348
|
i(p);
|
|
349
|
-
}, L = (c, i) => {
|
|
350
|
-
const a = h(c), d = Array.isArray(a) ? a : [a], C = [...n.filter((N) => d.indexOf(N) < 0), ...d];
|
|
351
|
-
e == null || e(C, i), k(d, (N) => o == null ? void 0 : o(C, N));
|
|
352
349
|
}, P = (c, i) => {
|
|
353
|
-
const
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
350
|
+
const E = (Array.isArray(c) ? c : [c]).map((S) => h(S)).flatMap((S) => Array.isArray(S) ? S : [S]).filter(
|
|
351
|
+
(S, R, F) => F.findIndex((D) => ee(D, S)) === R
|
|
352
|
+
);
|
|
353
|
+
if (!E || E.length === 0)
|
|
354
|
+
return;
|
|
355
|
+
const I = [...n.filter(
|
|
356
|
+
(S) => !E.some((R) => ee(R, S))
|
|
357
|
+
), ...E];
|
|
358
|
+
e == null || e(I, i), M(E, (S) => o == null ? void 0 : o(I, S));
|
|
359
|
+
}, O = (c, i) => {
|
|
360
|
+
const a = n.indexOf(c), m = [...n];
|
|
361
|
+
m.splice(a, 1, i), e == null || e(m, null);
|
|
362
|
+
}, y = (c, i) => {
|
|
363
|
+
const a = n.filter((g) => !ee(g, c));
|
|
364
|
+
e == null || e(a, i), u(c, (g) => o == null ? void 0 : o(a, g));
|
|
365
|
+
}, N = (c, i) => {
|
|
366
|
+
c && P(c, i);
|
|
367
|
+
}, B = (c) => ({
|
|
368
|
+
removeItem: y,
|
|
369
|
+
editItem: O,
|
|
363
370
|
handleChange: e,
|
|
364
|
-
getOptionUniqKeyValue:
|
|
371
|
+
getOptionUniqKeyValue: b,
|
|
365
372
|
storedItemsMap: p,
|
|
373
|
+
batchAddItems: (a) => {
|
|
374
|
+
P(a, c);
|
|
375
|
+
},
|
|
366
376
|
...c
|
|
367
377
|
});
|
|
368
378
|
return /* @__PURE__ */ r(
|
|
369
|
-
|
|
379
|
+
_e,
|
|
370
380
|
{
|
|
371
|
-
...
|
|
381
|
+
...x,
|
|
372
382
|
stateReducer: (c, i) => {
|
|
373
383
|
switch (i.type) {
|
|
374
|
-
case
|
|
375
|
-
case
|
|
384
|
+
case _e.stateChangeTypes.keyDownEnter:
|
|
385
|
+
case _e.stateChangeTypes.clickItem:
|
|
376
386
|
return {
|
|
377
387
|
...i,
|
|
378
388
|
highlightedIndex: c.highlightedIndex,
|
|
@@ -382,28 +392,28 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
382
392
|
return i;
|
|
383
393
|
}
|
|
384
394
|
},
|
|
385
|
-
onChange:
|
|
395
|
+
onChange: N,
|
|
386
396
|
selectedItem: null,
|
|
387
|
-
children: (c) => l == null ? void 0 : l(
|
|
397
|
+
children: (c) => l == null ? void 0 : l(B(c))
|
|
388
398
|
}
|
|
389
399
|
);
|
|
390
|
-
},
|
|
391
|
-
autocomplete:
|
|
400
|
+
}, Ct = "_autocomplete_1so4a_16", Mt = "_disabled_1so4a_32", zt = "_error_1so4a_35", Rt = "_touched_1so4a_35", Ft = "_input_1so4a_77", Lt = {
|
|
401
|
+
autocomplete: Ct,
|
|
392
402
|
"autocomplete-wrapper": "_autocomplete-wrapper_1so4a_28",
|
|
393
|
-
disabled:
|
|
394
|
-
error:
|
|
403
|
+
disabled: Mt,
|
|
404
|
+
error: zt,
|
|
395
405
|
touched: Rt,
|
|
396
406
|
"clear-icon": "_clear-icon_1so4a_46",
|
|
397
407
|
"clear-icon--disabled": "_clear-icon--disabled_1so4a_56",
|
|
398
408
|
"autocomplete-input": "_autocomplete-input_1so4a_60",
|
|
399
409
|
"single-line-mode": "_single-line-mode_1so4a_68",
|
|
400
410
|
"mobile-disabled": "_mobile-disabled_1so4a_72",
|
|
401
|
-
input:
|
|
411
|
+
input: Ft,
|
|
402
412
|
"type-number": "_type-number_1so4a_101",
|
|
403
413
|
"error-text": "_error-text_1so4a_112",
|
|
404
414
|
"dropdown-button": "_dropdown-button_1so4a_121",
|
|
405
415
|
"icon-reversed": "_icon-reversed_1so4a_129"
|
|
406
|
-
},
|
|
416
|
+
}, G = J.bind(Lt), ao = (t) => {
|
|
407
417
|
const {
|
|
408
418
|
options: e = [],
|
|
409
419
|
loading: n = !1,
|
|
@@ -412,145 +422,147 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
412
422
|
value: s = [],
|
|
413
423
|
placeholder: l = "",
|
|
414
424
|
error: h = "",
|
|
415
|
-
touched:
|
|
416
|
-
creatable:
|
|
417
|
-
editable:
|
|
425
|
+
touched: d = !1,
|
|
426
|
+
creatable: b = !1,
|
|
427
|
+
editable: x = !1,
|
|
418
428
|
onChange: p = () => {
|
|
419
429
|
},
|
|
420
|
-
onFocus:
|
|
430
|
+
onFocus: L = () => {
|
|
421
431
|
},
|
|
422
|
-
onBlur:
|
|
432
|
+
onBlur: M = () => {
|
|
423
433
|
},
|
|
424
|
-
disabled:
|
|
425
|
-
isDropdownMode:
|
|
426
|
-
mobileDisabled:
|
|
427
|
-
inputProps:
|
|
428
|
-
parseValueToString:
|
|
429
|
-
maxLength:
|
|
430
|
-
async:
|
|
434
|
+
disabled: u = !1,
|
|
435
|
+
isDropdownMode: P = !1,
|
|
436
|
+
mobileDisabled: O = !1,
|
|
437
|
+
inputProps: y = {},
|
|
438
|
+
parseValueToString: N = (f) => f == null ? "" : String(f),
|
|
439
|
+
maxLength: B = null,
|
|
440
|
+
async: $ = !1,
|
|
431
441
|
customClass: c = "",
|
|
432
442
|
createWithoutConfirmation: i = !1,
|
|
433
443
|
getItemValidationErrorType: a = null,
|
|
434
|
-
clearItemsError:
|
|
444
|
+
clearItemsError: m = () => {
|
|
435
445
|
},
|
|
436
|
-
getAdditionalCreationCondition:
|
|
437
|
-
highlightUnStoredItem:
|
|
446
|
+
getAdditionalCreationCondition: g = () => !0,
|
|
447
|
+
highlightUnStoredItem: E = !1,
|
|
438
448
|
parseInputValueFn: _ = null,
|
|
439
|
-
handleUnStoredItemCb:
|
|
440
|
-
dataAutomationId:
|
|
441
|
-
existingItemsMap:
|
|
442
|
-
customizeNewSelectedValue:
|
|
443
|
-
renderCustomSelectedItem:
|
|
444
|
-
useFixedPositioning:
|
|
449
|
+
handleUnStoredItemCb: I = null,
|
|
450
|
+
dataAutomationId: z = "",
|
|
451
|
+
existingItemsMap: S = {},
|
|
452
|
+
customizeNewSelectedValue: R = (f) => f,
|
|
453
|
+
renderCustomSelectedItem: F,
|
|
454
|
+
useFixedPositioning: D,
|
|
445
455
|
newItemButtonText: ve = "",
|
|
446
456
|
menuClassName: K = "",
|
|
447
|
-
selectedItemSingleLine:
|
|
448
|
-
selectedItemClassName:
|
|
449
|
-
selectedItemTextClassName:
|
|
457
|
+
selectedItemSingleLine: re,
|
|
458
|
+
selectedItemClassName: le,
|
|
459
|
+
selectedItemTextClassName: ce,
|
|
450
460
|
...be
|
|
451
|
-
} = t, { refs:
|
|
461
|
+
} = t, { refs: ie, floatingStyles: Q } = Pe({
|
|
452
462
|
placement: "bottom-start",
|
|
453
|
-
strategy:
|
|
454
|
-
whileElementsMounted:
|
|
455
|
-
}), ye = s.length === 0 && !
|
|
463
|
+
strategy: D ? "fixed" : "absolute",
|
|
464
|
+
whileElementsMounted: Be
|
|
465
|
+
}), ye = s.length === 0 && !u ? l : "", te = Ce(null);
|
|
456
466
|
we(() => {
|
|
457
|
-
|
|
458
|
-
}, [
|
|
459
|
-
const ge = (f,
|
|
460
|
-
p(f,
|
|
461
|
-
}, xe = (f,
|
|
462
|
-
item:
|
|
463
|
-
index:
|
|
464
|
-
isSelected:
|
|
465
|
-
...
|
|
466
|
-
isActive:
|
|
467
|
-
}),
|
|
467
|
+
m();
|
|
468
|
+
}, [m, s]);
|
|
469
|
+
const ge = (f, k) => {
|
|
470
|
+
p(f, k);
|
|
471
|
+
}, xe = (f, k, A) => ({ item: C, index: H, ...q }) => f({
|
|
472
|
+
item: C,
|
|
473
|
+
index: H,
|
|
474
|
+
isSelected: A.some((W) => ee(W, C)),
|
|
475
|
+
...q,
|
|
476
|
+
isActive: k === H
|
|
477
|
+
}), v = ({
|
|
468
478
|
event: f,
|
|
469
|
-
removeItem:
|
|
470
|
-
inputValue:
|
|
479
|
+
removeItem: k,
|
|
480
|
+
inputValue: A
|
|
471
481
|
}) => {
|
|
472
|
-
f.key === "Backspace" && !
|
|
473
|
-
},
|
|
482
|
+
f.key === "Backspace" && !A && s.length && k(s[s.length - 1], null);
|
|
483
|
+
}, j = ({
|
|
474
484
|
inputValue: f,
|
|
475
|
-
selectItem:
|
|
476
|
-
clearSelection:
|
|
485
|
+
selectItem: k,
|
|
486
|
+
clearSelection: A,
|
|
487
|
+
batchAddItems: C
|
|
477
488
|
}) => {
|
|
478
489
|
if (_) {
|
|
479
|
-
const
|
|
480
|
-
(
|
|
490
|
+
const H = _(f);
|
|
491
|
+
C(H.length ? H : [f]), A();
|
|
481
492
|
} else
|
|
482
|
-
|
|
483
|
-
},
|
|
484
|
-
f(
|
|
485
|
-
}, X = e.filter((f) => s.every((
|
|
493
|
+
k(f), A();
|
|
494
|
+
}, Z = (f) => (k) => {
|
|
495
|
+
f(k, null), te.current && te.current.focus();
|
|
496
|
+
}, X = e.filter((f) => s.every((k) => !ee(k, f)));
|
|
486
497
|
return /* @__PURE__ */ r(
|
|
487
|
-
|
|
498
|
+
At,
|
|
488
499
|
{
|
|
489
500
|
onChange: ge,
|
|
490
|
-
itemToString:
|
|
501
|
+
itemToString: N,
|
|
491
502
|
selectedItems: s,
|
|
492
503
|
onStateChange: o,
|
|
493
504
|
options: e,
|
|
494
|
-
existingItemsMap:
|
|
495
|
-
handleUnStoredItemCb:
|
|
496
|
-
customizeNewSelectedValue:
|
|
505
|
+
existingItemsMap: S,
|
|
506
|
+
handleUnStoredItemCb: I,
|
|
507
|
+
customizeNewSelectedValue: R,
|
|
497
508
|
children: ({
|
|
498
509
|
getInputProps: f,
|
|
499
|
-
getItemProps:
|
|
500
|
-
isOpen:
|
|
501
|
-
inputValue:
|
|
502
|
-
highlightedIndex:
|
|
503
|
-
removeItem:
|
|
510
|
+
getItemProps: k,
|
|
511
|
+
isOpen: A,
|
|
512
|
+
inputValue: C = "",
|
|
513
|
+
highlightedIndex: H,
|
|
514
|
+
removeItem: q,
|
|
504
515
|
editItem: W,
|
|
505
|
-
openMenu:
|
|
506
|
-
selectItem:
|
|
507
|
-
clearSelection:
|
|
516
|
+
openMenu: ae,
|
|
517
|
+
selectItem: de,
|
|
518
|
+
clearSelection: ue,
|
|
508
519
|
toggleMenu: U,
|
|
509
520
|
storedItemsMap: Ne,
|
|
510
|
-
getRootProps: Ee
|
|
521
|
+
getRootProps: Ee,
|
|
522
|
+
batchAddItems: Ie
|
|
511
523
|
}) => {
|
|
512
|
-
const
|
|
513
|
-
...
|
|
514
|
-
ref: (
|
|
515
|
-
},
|
|
516
|
-
return /* @__PURE__ */
|
|
517
|
-
/* @__PURE__ */
|
|
518
|
-
/* @__PURE__ */
|
|
524
|
+
const oe = Ee(void 0, { suppressRefError: !0 }), Se = {
|
|
525
|
+
...oe,
|
|
526
|
+
ref: (w) => (ie.setReference(w), oe.ref(w))
|
|
527
|
+
}, me = C ?? "";
|
|
528
|
+
return /* @__PURE__ */ T("div", { ...Se, className: G("autocomplete-wrapper"), children: [
|
|
529
|
+
/* @__PURE__ */ T(he, { children: [
|
|
530
|
+
/* @__PURE__ */ T(
|
|
519
531
|
"div",
|
|
520
532
|
{
|
|
521
|
-
className:
|
|
522
|
-
"mobile-disabled":
|
|
533
|
+
className: G("autocomplete", c, {
|
|
534
|
+
"mobile-disabled": O,
|
|
523
535
|
error: h,
|
|
524
|
-
touched:
|
|
525
|
-
disabled:
|
|
536
|
+
touched: d,
|
|
537
|
+
disabled: u
|
|
526
538
|
}),
|
|
527
539
|
children: [
|
|
528
|
-
/* @__PURE__ */
|
|
540
|
+
/* @__PURE__ */ T(
|
|
529
541
|
"div",
|
|
530
542
|
{
|
|
531
|
-
className:
|
|
532
|
-
"mobile-disabled":
|
|
533
|
-
"single-line-mode":
|
|
543
|
+
className: G("autocomplete-input", {
|
|
544
|
+
"mobile-disabled": O,
|
|
545
|
+
"single-line-mode": re
|
|
534
546
|
}),
|
|
535
547
|
children: [
|
|
536
548
|
/* @__PURE__ */ r(
|
|
537
549
|
lt,
|
|
538
550
|
{
|
|
539
551
|
items: s,
|
|
540
|
-
onRemoveItem: q
|
|
541
|
-
disabled:
|
|
542
|
-
mobileDisabled:
|
|
543
|
-
parseValueToString:
|
|
552
|
+
onRemoveItem: Z(q),
|
|
553
|
+
disabled: u,
|
|
554
|
+
mobileDisabled: O,
|
|
555
|
+
parseValueToString: N,
|
|
544
556
|
getItemValidationErrorType: a,
|
|
545
|
-
renderCustomSelectedItem:
|
|
557
|
+
renderCustomSelectedItem: F,
|
|
546
558
|
editItem: W,
|
|
547
|
-
editable:
|
|
548
|
-
getAdditionalCreationCondition:
|
|
559
|
+
editable: x,
|
|
560
|
+
getAdditionalCreationCondition: g,
|
|
549
561
|
storedItemsMap: Ne,
|
|
550
|
-
highlightUnStoredItem:
|
|
551
|
-
selectedItemSingleLine:
|
|
552
|
-
selectedItemClassName:
|
|
553
|
-
selectedItemTextClassName:
|
|
562
|
+
highlightUnStoredItem: E,
|
|
563
|
+
selectedItemSingleLine: re,
|
|
564
|
+
selectedItemClassName: le,
|
|
565
|
+
selectedItemTextClassName: ce
|
|
554
566
|
}
|
|
555
567
|
),
|
|
556
568
|
/* @__PURE__ */ r(
|
|
@@ -559,76 +571,78 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
559
571
|
...f({
|
|
560
572
|
ref: te,
|
|
561
573
|
placeholder: ye,
|
|
562
|
-
maxLength:
|
|
574
|
+
maxLength: B,
|
|
563
575
|
onFocus: () => {
|
|
564
|
-
|
|
576
|
+
P && ae(), L();
|
|
565
577
|
},
|
|
566
|
-
onKeyDown: (
|
|
567
|
-
|
|
568
|
-
inputValue:
|
|
569
|
-
selectItem:
|
|
570
|
-
clearSelection:
|
|
571
|
-
|
|
578
|
+
onKeyDown: (w) => {
|
|
579
|
+
w.key === Te && C && b && g(C) && j({
|
|
580
|
+
inputValue: C,
|
|
581
|
+
selectItem: de,
|
|
582
|
+
clearSelection: ue,
|
|
583
|
+
batchAddItems: Ie
|
|
584
|
+
}), v({ event: w, removeItem: q, inputValue: C });
|
|
572
585
|
},
|
|
573
586
|
onBlur: () => {
|
|
574
|
-
|
|
575
|
-
inputValue:
|
|
576
|
-
selectItem:
|
|
577
|
-
clearSelection:
|
|
587
|
+
M(), C && b && g(C) && j({
|
|
588
|
+
inputValue: C,
|
|
589
|
+
selectItem: de,
|
|
590
|
+
clearSelection: ue,
|
|
591
|
+
batchAddItems: Ie
|
|
578
592
|
});
|
|
579
593
|
},
|
|
580
|
-
disabled:
|
|
581
|
-
...
|
|
594
|
+
disabled: u,
|
|
595
|
+
...y
|
|
582
596
|
}),
|
|
583
|
-
className:
|
|
584
|
-
"data-automation-id":
|
|
597
|
+
className: G("input", { disabled: u }, y.className),
|
|
598
|
+
"data-automation-id": z
|
|
585
599
|
}
|
|
586
600
|
)
|
|
587
601
|
]
|
|
588
602
|
}
|
|
589
603
|
),
|
|
590
|
-
(
|
|
604
|
+
(y == null ? void 0 : y.clearable) && !Me(s) && /* @__PURE__ */ r(
|
|
591
605
|
"button",
|
|
592
606
|
{
|
|
593
607
|
type: "button",
|
|
594
|
-
className:
|
|
608
|
+
className: G("clear-icon", { "clear-icon--disabled": u }),
|
|
595
609
|
onClick: () => {
|
|
596
|
-
var
|
|
597
|
-
return !
|
|
610
|
+
var w;
|
|
611
|
+
return !u && ((w = y == null ? void 0 : y.onClear) == null ? void 0 : w.call(y));
|
|
598
612
|
},
|
|
599
|
-
onMouseDown: (
|
|
613
|
+
onMouseDown: (w) => w.preventDefault(),
|
|
600
614
|
children: /* @__PURE__ */ r(et, {})
|
|
601
615
|
}
|
|
602
616
|
),
|
|
603
|
-
|
|
617
|
+
P && /* @__PURE__ */ r(
|
|
604
618
|
"button",
|
|
605
619
|
{
|
|
606
620
|
type: "button",
|
|
607
|
-
className:
|
|
621
|
+
className: G("dropdown-button", { "icon-reversed": A }),
|
|
608
622
|
onClick: () => U(),
|
|
609
623
|
"aria-label": "Toggle dropdown",
|
|
610
|
-
"aria-expanded":
|
|
611
|
-
children: /* @__PURE__ */ r(
|
|
624
|
+
"aria-expanded": A,
|
|
625
|
+
children: /* @__PURE__ */ r(Oe, {})
|
|
612
626
|
}
|
|
613
627
|
)
|
|
614
628
|
]
|
|
615
629
|
}
|
|
616
630
|
),
|
|
617
|
-
h &&
|
|
631
|
+
h && d && /* @__PURE__ */ r("span", { className: G("error-text"), children: h })
|
|
618
632
|
] }),
|
|
619
633
|
/* @__PURE__ */ r(
|
|
620
634
|
$e,
|
|
621
635
|
{
|
|
622
|
-
isOpen:
|
|
636
|
+
isOpen: A,
|
|
623
637
|
loading: n,
|
|
624
|
-
async:
|
|
625
|
-
ref:
|
|
638
|
+
async: $,
|
|
639
|
+
ref: ie.setFloating,
|
|
626
640
|
newItemButtonText: ve,
|
|
627
|
-
isDropdownMode:
|
|
628
|
-
style:
|
|
629
|
-
inputValue:
|
|
630
|
-
getItemProps: xe(
|
|
631
|
-
parseValueToString:
|
|
641
|
+
isDropdownMode: P,
|
|
642
|
+
style: Q,
|
|
643
|
+
inputValue: me.trim(),
|
|
644
|
+
getItemProps: xe(k, H, s),
|
|
645
|
+
parseValueToString: N,
|
|
632
646
|
createWithoutConfirmation: i,
|
|
633
647
|
options: X,
|
|
634
648
|
className: K,
|
|
@@ -639,7 +653,7 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
639
653
|
}
|
|
640
654
|
}
|
|
641
655
|
);
|
|
642
|
-
},
|
|
656
|
+
}, Pt = ({ skip: t }) => {
|
|
643
657
|
je(() => {
|
|
644
658
|
if (t)
|
|
645
659
|
return;
|
|
@@ -648,8 +662,8 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
648
662
|
if (!n)
|
|
649
663
|
return;
|
|
650
664
|
window.scrollY !== e && window.scrollTo(0, e);
|
|
651
|
-
}, l = (
|
|
652
|
-
n && (
|
|
665
|
+
}, l = (d) => {
|
|
666
|
+
n && (d.preventDefault(), d.stopImmediatePropagation(), s());
|
|
653
667
|
};
|
|
654
668
|
e = window.scrollY, window.addEventListener("scroll", l, { passive: !1, capture: !0 }), requestAnimationFrame(() => {
|
|
655
669
|
e = window.scrollY, s();
|
|
@@ -661,7 +675,7 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
661
675
|
clearTimeout(h), window.removeEventListener("scroll", l, { capture: !0 });
|
|
662
676
|
};
|
|
663
677
|
}, [t]);
|
|
664
|
-
},
|
|
678
|
+
}, Bt = ({ skip: t, reference: e }) => {
|
|
665
679
|
we(() => {
|
|
666
680
|
if (t)
|
|
667
681
|
return;
|
|
@@ -673,7 +687,7 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
673
687
|
window.removeEventListener("resize", n);
|
|
674
688
|
};
|
|
675
689
|
}, [t, e]);
|
|
676
|
-
},
|
|
690
|
+
}, Ot = ({ skip: t, onClose: e, menuRef: n }) => {
|
|
677
691
|
we(() => {
|
|
678
692
|
if (t)
|
|
679
693
|
return;
|
|
@@ -685,11 +699,11 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
685
699
|
window.removeEventListener("scroll", o, !0);
|
|
686
700
|
};
|
|
687
701
|
}, [t, e, n]);
|
|
688
|
-
},
|
|
702
|
+
}, Tt = {
|
|
689
703
|
"input-wrapper": "_input-wrapper_d9vma_1",
|
|
690
704
|
"dropdown-button": "_dropdown-button_d9vma_6",
|
|
691
705
|
"icon-reversed": "_icon-reversed_d9vma_14"
|
|
692
|
-
},
|
|
706
|
+
}, Le = J.bind(Tt), $t = 0, Dt = Je({
|
|
693
707
|
fallbackPlacements: ["bottom-start", "top-start", "bottom", "top"],
|
|
694
708
|
boundary: document == null ? void 0 : document.documentElement,
|
|
695
709
|
rootBoundary: "viewport"
|
|
@@ -710,162 +724,162 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
710
724
|
},
|
|
711
725
|
onBlur: h = () => {
|
|
712
726
|
},
|
|
713
|
-
disabled:
|
|
714
|
-
inputProps:
|
|
715
|
-
parseValueToString:
|
|
727
|
+
disabled: d = !1,
|
|
728
|
+
inputProps: b = {},
|
|
729
|
+
parseValueToString: x = (v) => v === null ? "" : String(v),
|
|
716
730
|
minLength: p = 1,
|
|
717
|
-
skipOptionCreation:
|
|
718
|
-
maxLength:
|
|
719
|
-
optionVariant:
|
|
720
|
-
isRequired:
|
|
721
|
-
error:
|
|
722
|
-
touched:
|
|
723
|
-
setTouch:
|
|
731
|
+
skipOptionCreation: L = !1,
|
|
732
|
+
maxLength: M = null,
|
|
733
|
+
optionVariant: u = "",
|
|
734
|
+
isRequired: P = !1,
|
|
735
|
+
error: O = "",
|
|
736
|
+
touched: y = !1,
|
|
737
|
+
setTouch: N = () => {
|
|
724
738
|
},
|
|
725
|
-
createWithoutConfirmation:
|
|
726
|
-
menuClassName:
|
|
739
|
+
createWithoutConfirmation: B = !1,
|
|
740
|
+
menuClassName: $ = "",
|
|
727
741
|
icon: c,
|
|
728
742
|
isDropdownMode: i = !1,
|
|
729
743
|
isOptionUnique: a,
|
|
730
|
-
refFunction:
|
|
731
|
-
stateReducer:
|
|
732
|
-
onStateChange:
|
|
744
|
+
refFunction: m,
|
|
745
|
+
stateReducer: g,
|
|
746
|
+
onStateChange: E,
|
|
733
747
|
useFixedPositioning: _,
|
|
734
|
-
dropdownMatchInputWidth:
|
|
735
|
-
withMenuFlip:
|
|
736
|
-
newItemButtonText:
|
|
737
|
-
menuPortalRoot:
|
|
738
|
-
...
|
|
739
|
-
} = t, [
|
|
740
|
-
var
|
|
741
|
-
return (
|
|
742
|
-
}, []),
|
|
748
|
+
dropdownMatchInputWidth: I = !1,
|
|
749
|
+
withMenuFlip: z = !1,
|
|
750
|
+
newItemButtonText: S = "",
|
|
751
|
+
menuPortalRoot: R,
|
|
752
|
+
...F
|
|
753
|
+
} = t, [D, ve] = ne(!1), K = Ce(null), re = Y(() => {
|
|
754
|
+
var v;
|
|
755
|
+
return (v = K.current) == null ? void 0 : v.call(K);
|
|
756
|
+
}, []), le = !D || !R, ce = R || _ ? "fixed" : "absolute", be = !D || ce === "absolute", ie = He(
|
|
743
757
|
() => [
|
|
744
|
-
...
|
|
745
|
-
...
|
|
758
|
+
...z ? [Dt] : [],
|
|
759
|
+
...I ? [jt] : []
|
|
746
760
|
],
|
|
747
|
-
[
|
|
748
|
-
), { refs:
|
|
761
|
+
[z, I]
|
|
762
|
+
), { refs: Q, floatingStyles: ye } = Pe({
|
|
749
763
|
placement: "bottom-start",
|
|
750
|
-
whileElementsMounted:
|
|
751
|
-
strategy:
|
|
752
|
-
middleware:
|
|
764
|
+
whileElementsMounted: Be,
|
|
765
|
+
strategy: ce,
|
|
766
|
+
middleware: ie
|
|
753
767
|
});
|
|
754
|
-
|
|
768
|
+
Pt({ skip: le }), Bt({ skip: le, reference: Q.reference }), Ot({
|
|
755
769
|
skip: be,
|
|
756
|
-
onClose:
|
|
757
|
-
menuRef:
|
|
770
|
+
onClose: re,
|
|
771
|
+
menuRef: Q.floating
|
|
758
772
|
});
|
|
759
|
-
const te = (
|
|
773
|
+
const te = (v, j, Z) => ({ item: X, index: f, ...k }) => v({
|
|
760
774
|
item: X,
|
|
761
775
|
index: f,
|
|
762
|
-
isSelected:
|
|
763
|
-
...
|
|
764
|
-
isActive:
|
|
765
|
-
}), ge = (
|
|
766
|
-
|
|
776
|
+
isSelected: Z !== null && Z === X,
|
|
777
|
+
...k,
|
|
778
|
+
isActive: j === f
|
|
779
|
+
}), ge = (v, j) => {
|
|
780
|
+
v.key === Ue && (v.preventDefault(), j(e.length));
|
|
767
781
|
}, xe = Y(
|
|
768
|
-
(
|
|
769
|
-
(
|
|
782
|
+
(v, ...j) => {
|
|
783
|
+
(v == null ? void 0 : v.isOpen) !== void 0 && ve(v.isOpen), E == null || E(v, ...j);
|
|
770
784
|
},
|
|
771
|
-
[
|
|
785
|
+
[E]
|
|
772
786
|
);
|
|
773
787
|
return /* @__PURE__ */ r(
|
|
774
|
-
|
|
788
|
+
_e,
|
|
775
789
|
{
|
|
776
790
|
onChange: s,
|
|
777
|
-
itemToString:
|
|
791
|
+
itemToString: x,
|
|
778
792
|
selectedItem: n,
|
|
779
793
|
onStateChange: xe,
|
|
780
794
|
defaultHighlightedIndex: $t,
|
|
781
|
-
stateReducer:
|
|
795
|
+
stateReducer: g,
|
|
782
796
|
children: ({
|
|
783
|
-
getInputProps:
|
|
784
|
-
getItemProps:
|
|
785
|
-
setHighlightedIndex:
|
|
797
|
+
getInputProps: v,
|
|
798
|
+
getItemProps: j,
|
|
799
|
+
setHighlightedIndex: Z,
|
|
786
800
|
toggleMenu: X,
|
|
787
801
|
openMenu: f,
|
|
788
|
-
closeMenu:
|
|
789
|
-
isOpen:
|
|
790
|
-
inputValue:
|
|
791
|
-
highlightedIndex:
|
|
792
|
-
getRootProps:
|
|
802
|
+
closeMenu: k,
|
|
803
|
+
isOpen: A,
|
|
804
|
+
inputValue: C,
|
|
805
|
+
highlightedIndex: H,
|
|
806
|
+
getRootProps: q,
|
|
793
807
|
selectItem: W
|
|
794
808
|
}) => {
|
|
795
|
-
const
|
|
796
|
-
...
|
|
797
|
-
ref: (
|
|
809
|
+
const ae = q(void 0, { suppressRefError: !0 }), de = {
|
|
810
|
+
...ae,
|
|
811
|
+
ref: (w) => (Q.setReference(w), ae.ref(w))
|
|
798
812
|
};
|
|
799
|
-
K.current || (K.current =
|
|
800
|
-
const
|
|
801
|
-
W(null), U == null || U(...
|
|
802
|
-
},
|
|
813
|
+
K.current || (K.current = k);
|
|
814
|
+
const ue = C ?? "", { onClear: U, clearable: Ne, ...Ee } = b, oe = Ne && n !== null, Se = (...w) => {
|
|
815
|
+
W(null), U == null || U(...w);
|
|
816
|
+
}, me = /* @__PURE__ */ r(
|
|
803
817
|
$e,
|
|
804
818
|
{
|
|
805
|
-
isOpen:
|
|
819
|
+
isOpen: A,
|
|
806
820
|
isDropdownMode: i,
|
|
807
821
|
style: ye,
|
|
808
|
-
ref:
|
|
809
|
-
portalMenuAttribute:
|
|
822
|
+
ref: Q.setFloating,
|
|
823
|
+
portalMenuAttribute: R ? qe : null,
|
|
810
824
|
minLength: p,
|
|
811
|
-
inputValue: (
|
|
812
|
-
getItemProps: te(
|
|
813
|
-
parseValueToString:
|
|
814
|
-
optionVariant:
|
|
815
|
-
createWithoutConfirmation:
|
|
816
|
-
className:
|
|
825
|
+
inputValue: (C || "").trim(),
|
|
826
|
+
getItemProps: te(j, H, n),
|
|
827
|
+
parseValueToString: x,
|
|
828
|
+
optionVariant: u,
|
|
829
|
+
createWithoutConfirmation: B,
|
|
830
|
+
className: $,
|
|
817
831
|
options: e,
|
|
818
|
-
newItemButtonText:
|
|
819
|
-
...
|
|
832
|
+
newItemButtonText: S,
|
|
833
|
+
...F
|
|
820
834
|
}
|
|
821
835
|
);
|
|
822
|
-
return /* @__PURE__ */
|
|
823
|
-
/* @__PURE__ */
|
|
836
|
+
return /* @__PURE__ */ T(he, { children: [
|
|
837
|
+
/* @__PURE__ */ T("div", { className: Le("input-wrapper"), ...de, children: [
|
|
824
838
|
/* @__PURE__ */ r(
|
|
825
839
|
Ze,
|
|
826
840
|
{
|
|
827
|
-
...
|
|
828
|
-
placeholder:
|
|
829
|
-
maxLength:
|
|
841
|
+
...v({
|
|
842
|
+
placeholder: d ? "" : o,
|
|
843
|
+
maxLength: M || void 0,
|
|
830
844
|
onFocus: () => {
|
|
831
|
-
i && !
|
|
845
|
+
i && !A && (f(), N == null || N(!0)), l();
|
|
832
846
|
},
|
|
833
|
-
ref:
|
|
834
|
-
onKeyDown: (
|
|
835
|
-
|
|
847
|
+
ref: m,
|
|
848
|
+
onKeyDown: (w) => {
|
|
849
|
+
w.key === Te && w.preventDefault(), C && A && ge(w, Z);
|
|
836
850
|
},
|
|
837
|
-
onBlur: (
|
|
838
|
-
const
|
|
839
|
-
W(
|
|
840
|
-
ke ? !e.some((
|
|
841
|
-
), i &&
|
|
851
|
+
onBlur: (w) => {
|
|
852
|
+
const se = ue.trim(), ke = !Me(se), ze = ke ? e.find((Ae) => x(Ae) === se) : void 0;
|
|
853
|
+
W(ze || (!L && B && ke ? se : null)), h(w), a == null || a(
|
|
854
|
+
ke ? !e.some((Ae) => x(Ae) === se) : null
|
|
855
|
+
), i && A && X(), N == null || N(!0);
|
|
842
856
|
},
|
|
843
|
-
disabled:
|
|
857
|
+
disabled: d,
|
|
844
858
|
defaultWidth: !1,
|
|
845
|
-
isRequired:
|
|
846
|
-
touched:
|
|
847
|
-
error:
|
|
859
|
+
isRequired: P,
|
|
860
|
+
touched: y,
|
|
861
|
+
error: O,
|
|
848
862
|
...Ee,
|
|
849
|
-
clearable:
|
|
850
|
-
onClear:
|
|
863
|
+
clearable: oe,
|
|
864
|
+
onClear: oe ? Se : U,
|
|
851
865
|
endIcon: i && !c ? /* @__PURE__ */ r(
|
|
852
866
|
"button",
|
|
853
867
|
{
|
|
854
868
|
type: "button",
|
|
855
|
-
className:
|
|
869
|
+
className: Le("dropdown-button", { "icon-reversed": A }),
|
|
856
870
|
onClick: () => X(),
|
|
857
871
|
"aria-label": "Toggle dropdown",
|
|
858
|
-
"aria-expanded":
|
|
859
|
-
children: /* @__PURE__ */ r(
|
|
872
|
+
"aria-expanded": A,
|
|
873
|
+
children: /* @__PURE__ */ r(Oe, {})
|
|
860
874
|
}
|
|
861
875
|
) : c,
|
|
862
876
|
minLength: i ? 0 : p
|
|
863
877
|
})
|
|
864
878
|
}
|
|
865
879
|
),
|
|
866
|
-
|
|
880
|
+
!R && me
|
|
867
881
|
] }),
|
|
868
|
-
|
|
882
|
+
R && Ge(me, R)
|
|
869
883
|
] });
|
|
870
884
|
}
|
|
871
885
|
}
|
|
@@ -21,5 +21,6 @@ export type GetStateAndHelpersT<T> = ControllerStateAndHelpers<T> & {
|
|
|
21
21
|
handleChange: MultipleDownshiftProps<T>['onChange'];
|
|
22
22
|
getOptionUniqKeyValue?: (option: T) => string;
|
|
23
23
|
storedItemsMap: MultipleDownshiftProps<T>['existingItemsMap'];
|
|
24
|
+
batchAddItems: (items: T[]) => void;
|
|
24
25
|
};
|
|
25
26
|
export declare const MultipleDownshift: <T>({ options, onChange, selectedItems, handleUnStoredItemCb, existingItemsMap, children, customizeNewSelectedValue, getOptionUniqKey, getOptionUniqKeyValue, ...props }: MultipleDownshiftProps<T>) => import("react/jsx-runtime").JSX.Element;
|