@reportportal/ui-kit 0.0.1-alpha.230 → 0.0.1-alpha.232
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
|
|
1
|
+
import { jsx as r, jsxs as O, Fragment as he } from "react/jsx-runtime";
|
|
2
|
+
import { useState as se, useRef as Ce, useEffect as we, useCallback as K, forwardRef as De, useLayoutEffect as je, useMemo as He } from "react";
|
|
3
3
|
import { c as Q } 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 Be, autoUpdate as
|
|
10
|
+
import _e from "downshift";
|
|
11
|
+
import { useFloating as Be, autoUpdate as Pe, 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 = Q.bind(st), nt = (t) => t.scrollWidth > t.clientWidth, rt = ({
|
|
33
33
|
item: t,
|
|
34
34
|
onRemoveItem: e,
|
|
35
35
|
disabled: n = !1,
|
|
@@ -37,49 +37,49 @@ 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:
|
|
40
|
+
editable: d = !1,
|
|
41
41
|
getAdditionalCreationCondition: v = () => !0,
|
|
42
42
|
storedOption: g = !0,
|
|
43
43
|
highlightUnStoredItem: p = !1,
|
|
44
|
-
variant:
|
|
45
|
-
getItemName:
|
|
46
|
-
singleLine:
|
|
44
|
+
variant: F = "light",
|
|
45
|
+
getItemName: C,
|
|
46
|
+
singleLine: u = !1,
|
|
47
47
|
className: L,
|
|
48
48
|
textClassName: P
|
|
49
49
|
}) => {
|
|
50
|
-
const [b, x] =
|
|
51
|
-
!n &&
|
|
52
|
-
}, y = (
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
const
|
|
56
|
-
|
|
50
|
+
const [b, x] = se(!1), [B, T] = se(""), [c, i] = se(!1), a = Ce(null), m = () => {
|
|
51
|
+
!n && d && !g && (T((C == null ? void 0 : C(t)) || (s == null ? void 0 : s(t)) || ""), x(!0));
|
|
52
|
+
}, y = (R) => {
|
|
53
|
+
T(R.target.value);
|
|
54
|
+
}, N = (R) => {
|
|
55
|
+
const $ = v(B);
|
|
56
|
+
R.key === "Enter" && $ && (h(t, B), x(!1), T(""));
|
|
57
57
|
}, _ = () => {
|
|
58
|
-
x(!1),
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
},
|
|
58
|
+
x(!1), T("");
|
|
59
|
+
}, E = (R) => {
|
|
60
|
+
R.stopPropagation(), e(t);
|
|
61
|
+
}, M = (s == null ? void 0 : s(t)) || "";
|
|
62
62
|
we(() => {
|
|
63
|
-
if (a.current &&
|
|
64
|
-
const
|
|
63
|
+
if (a.current && u) {
|
|
64
|
+
const R = () => {
|
|
65
65
|
a.current && i(nt(a.current));
|
|
66
66
|
};
|
|
67
|
-
if (
|
|
68
|
-
const
|
|
69
|
-
return
|
|
67
|
+
if (R(), typeof ResizeObserver < "u") {
|
|
68
|
+
const $ = new ResizeObserver(R);
|
|
69
|
+
return $.observe(a.current), () => $.disconnect();
|
|
70
70
|
}
|
|
71
71
|
} else
|
|
72
72
|
i(!1);
|
|
73
|
-
}, [
|
|
74
|
-
const
|
|
73
|
+
}, [M, u]);
|
|
74
|
+
const I = fe(
|
|
75
75
|
"selected-item-text",
|
|
76
76
|
{
|
|
77
|
-
"single-line":
|
|
77
|
+
"single-line": u
|
|
78
78
|
},
|
|
79
79
|
P
|
|
80
|
-
),
|
|
80
|
+
), z = fe(
|
|
81
81
|
"selected-item",
|
|
82
|
-
|
|
82
|
+
F,
|
|
83
83
|
{
|
|
84
84
|
[`validation-${l}`]: l,
|
|
85
85
|
disabled: n,
|
|
@@ -92,32 +92,32 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
92
92
|
"input",
|
|
93
93
|
{
|
|
94
94
|
autoFocus: !0,
|
|
95
|
-
value:
|
|
95
|
+
value: B,
|
|
96
96
|
onChange: y,
|
|
97
|
-
onKeyDown:
|
|
97
|
+
onKeyDown: N,
|
|
98
98
|
onBlur: _,
|
|
99
|
-
className:
|
|
99
|
+
className: fe("input")
|
|
100
100
|
}
|
|
101
|
-
) : /* @__PURE__ */
|
|
101
|
+
) : /* @__PURE__ */ O("div", { className: z, onClick: m, children: [
|
|
102
102
|
/* @__PURE__ */ r(
|
|
103
103
|
"span",
|
|
104
104
|
{
|
|
105
105
|
ref: a,
|
|
106
|
-
className:
|
|
107
|
-
title:
|
|
108
|
-
children:
|
|
106
|
+
className: I,
|
|
107
|
+
title: u && c ? M : void 0,
|
|
108
|
+
children: M
|
|
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: E,
|
|
121
121
|
children: /* @__PURE__ */ r(Ve, {})
|
|
122
122
|
}
|
|
123
123
|
)
|
|
@@ -130,7 +130,7 @@ 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:
|
|
133
|
+
selectedItemClassName: d,
|
|
134
134
|
selectedItemTextClassName: v,
|
|
135
135
|
...g
|
|
136
136
|
}) => t.map((p) => l ? l(p) : /* @__PURE__ */ r(
|
|
@@ -142,7 +142,7 @@ 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:
|
|
145
|
+
className: d,
|
|
146
146
|
textClassName: v,
|
|
147
147
|
...g
|
|
148
148
|
},
|
|
@@ -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
|
-
},
|
|
163
|
+
}, ee = Q.bind(wt), Re = ({
|
|
164
164
|
isActive: t = !1,
|
|
165
165
|
isSelected: e = !1,
|
|
166
166
|
isNew: n = !1,
|
|
@@ -168,27 +168,27 @@ 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
173
|
const v = () => h || (l === "key-variant" ? "New key" : "New value");
|
|
174
|
-
return n ? /* @__PURE__ */
|
|
175
|
-
/* @__PURE__ */ r("div", { className:
|
|
176
|
-
/* @__PURE__ */
|
|
174
|
+
return n ? /* @__PURE__ */ O(he, { children: [
|
|
175
|
+
/* @__PURE__ */ r("div", { className: ee("divider") }),
|
|
176
|
+
/* @__PURE__ */ O(
|
|
177
177
|
"li",
|
|
178
178
|
{
|
|
179
|
-
className:
|
|
179
|
+
className: ee("new-item", l, {
|
|
180
180
|
active: t,
|
|
181
181
|
selected: e,
|
|
182
182
|
disabled: s
|
|
183
183
|
}),
|
|
184
|
-
...
|
|
184
|
+
...d,
|
|
185
185
|
children: [
|
|
186
|
-
/* @__PURE__ */ r("span", { className:
|
|
186
|
+
/* @__PURE__ */ r("span", { className: ee("value"), children: o }),
|
|
187
187
|
/* @__PURE__ */ r(
|
|
188
188
|
Ke,
|
|
189
189
|
{
|
|
190
|
-
...!s &&
|
|
191
|
-
className:
|
|
190
|
+
...!s && d,
|
|
191
|
+
className: ee({ "button-active": t }),
|
|
192
192
|
icon: /* @__PURE__ */ r(Xe, {}),
|
|
193
193
|
variant: "text",
|
|
194
194
|
children: v()
|
|
@@ -200,20 +200,20 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
200
200
|
] }) : /* @__PURE__ */ r(
|
|
201
201
|
"li",
|
|
202
202
|
{
|
|
203
|
-
className:
|
|
203
|
+
className: ee("item", l, {
|
|
204
204
|
active: t,
|
|
205
205
|
selected: e,
|
|
206
206
|
disabled: s
|
|
207
207
|
}),
|
|
208
|
-
...s ? {} :
|
|
209
|
-
children: /* @__PURE__ */ r("span", { className:
|
|
208
|
+
...s ? {} : d,
|
|
209
|
+
children: /* @__PURE__ */ r("span", { className: ee("label", "tag"), children: o })
|
|
210
210
|
}
|
|
211
211
|
);
|
|
212
212
|
}, vt = "_container_12uzd_16", bt = {
|
|
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 = Q.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:
|
|
224
|
+
customNoMatchesMessage: d,
|
|
225
225
|
optionVariant: v,
|
|
226
226
|
newItemButtonText: g,
|
|
227
227
|
renderOption: p,
|
|
228
|
-
getUniqKey:
|
|
229
|
-
getItemProps:
|
|
230
|
-
parseValueToString:
|
|
228
|
+
getUniqKey: F,
|
|
229
|
+
getItemProps: C,
|
|
230
|
+
parseValueToString: u,
|
|
231
231
|
limitationText: L = "Too many results. Type to search",
|
|
232
232
|
optionsLimit: P = 0,
|
|
233
233
|
shouldShowEmptyListMessage: b = !0
|
|
234
|
-
} = t, x =
|
|
235
|
-
(_,
|
|
234
|
+
} = t, x = K(() => (e || []).filter((_) => u(_).toUpperCase().indexOf((o.toUpperCase() || "").trim()) > -1), [o, e, u]), B = K(
|
|
235
|
+
(_, E, M = !1) => p ? p(_, E, M, C) : /* @__PURE__ */ r(
|
|
236
236
|
Re,
|
|
237
237
|
{
|
|
238
238
|
optionVariant: v,
|
|
239
|
-
...
|
|
240
|
-
isNew:
|
|
239
|
+
...C({ item: _, index: E }),
|
|
240
|
+
isNew: M,
|
|
241
241
|
newItemButtonText: g,
|
|
242
|
-
children:
|
|
242
|
+
children: u(_)
|
|
243
243
|
},
|
|
244
|
-
(
|
|
244
|
+
(F == null ? void 0 : F(_)) || u(_)
|
|
245
245
|
),
|
|
246
|
-
[
|
|
247
|
-
),
|
|
248
|
-
(_) => _.length ? _.map((
|
|
249
|
-
[
|
|
250
|
-
), c =
|
|
246
|
+
[C, F, g, v, u, p]
|
|
247
|
+
), T = K(
|
|
248
|
+
(_) => _.length ? _.map((E, M) => B(E, M)) : "",
|
|
249
|
+
[B]
|
|
250
|
+
), c = K(
|
|
251
251
|
(_) => {
|
|
252
|
-
const
|
|
253
|
-
return /* @__PURE__ */ r("div", { className:
|
|
252
|
+
const E = _.length;
|
|
253
|
+
return /* @__PURE__ */ r("div", { className: pe({ container: !E }), children: /* @__PURE__ */ r(
|
|
254
254
|
Re,
|
|
255
255
|
{
|
|
256
256
|
optionVariant: v,
|
|
257
257
|
isNew: !0,
|
|
258
258
|
newItemButtonText: g,
|
|
259
|
-
...
|
|
260
|
-
children:
|
|
259
|
+
...C({ item: o, index: E }),
|
|
260
|
+
children: u(o)
|
|
261
261
|
},
|
|
262
|
-
|
|
262
|
+
u(o)
|
|
263
263
|
) });
|
|
264
264
|
},
|
|
265
|
-
[
|
|
266
|
-
), i =
|
|
267
|
-
(_) => s ? /* @__PURE__ */
|
|
265
|
+
[C, o, g, v, u]
|
|
266
|
+
), i = K(
|
|
267
|
+
(_) => s ? /* @__PURE__ */ O(he, { children: [
|
|
268
268
|
/* @__PURE__ */ r(dt, { children: /* @__PURE__ */ r(Ye, {}) }),
|
|
269
269
|
!l && c(_)
|
|
270
270
|
] }) : "",
|
|
271
271
|
[l, s, c]
|
|
272
|
-
), a =
|
|
273
|
-
const _ = (e == null ? void 0 : e.length) === 0 ? h || "No available options" :
|
|
274
|
-
return /* @__PURE__ */ r("div", { className:
|
|
275
|
-
}, [h,
|
|
272
|
+
), a = K(() => {
|
|
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 : x(), y = i(e);
|
|
276
276
|
if (y)
|
|
277
277
|
return y;
|
|
278
|
-
const
|
|
279
|
-
return
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
|
|
282
|
-
(
|
|
278
|
+
const N = Me(m);
|
|
279
|
+
return N && !b && l ? null : /* @__PURE__ */ O("div", { className: pe({ container: e.length }), children: [
|
|
280
|
+
/* @__PURE__ */ O(We, { autoHeight: !0, autoHeightMax: 216, hideTracksWhenNotNeeded: !0, children: [
|
|
281
|
+
N ? b && a() : T(m),
|
|
282
|
+
(m == null ? void 0 : m.length) > P && P > 0 && L ? /* @__PURE__ */ r("li", { className: pe("limitation-item"), "aria-hidden": "true", children: L }) : 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 = Q.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
|
-
...
|
|
299
|
+
...d
|
|
300
300
|
}, v) => /* @__PURE__ */ r(
|
|
301
301
|
"ul",
|
|
302
302
|
{
|
|
303
303
|
ref: v,
|
|
304
|
-
className:
|
|
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)]) : "", te = (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]) => te(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:
|
|
328
|
+
getOptionUniqKey: d,
|
|
329
329
|
getOptionUniqKeyValue: v,
|
|
330
330
|
...g
|
|
331
331
|
}) => {
|
|
332
|
-
const [p,
|
|
332
|
+
const [p, F] = se(s), C = (c, i) => {
|
|
333
333
|
const a = {
|
|
334
334
|
...p
|
|
335
335
|
};
|
|
336
|
-
c.forEach((
|
|
337
|
-
if (t.find((y) => kt(y,
|
|
338
|
-
const y =
|
|
336
|
+
c.forEach((m) => {
|
|
337
|
+
if (t.find((y) => kt(y, m, d))) {
|
|
338
|
+
const y = Fe(m, d);
|
|
339
339
|
a[y] = !0;
|
|
340
340
|
}
|
|
341
|
-
}),
|
|
342
|
-
},
|
|
343
|
-
const a =
|
|
341
|
+
}), F(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], F(m), i(m);
|
|
347
347
|
} else
|
|
348
348
|
i(p);
|
|
349
349
|
}, L = (c, i) => {
|
|
350
|
-
const
|
|
351
|
-
|
|
350
|
+
const N = (Array.isArray(c) ? c : [c]).map((I) => h(I)).flatMap((I) => Array.isArray(I) ? I : [I]).filter(
|
|
351
|
+
(I, z, R) => R.findIndex(($) => te($, I)) === z
|
|
352
|
+
);
|
|
353
|
+
if (!N || N.length === 0)
|
|
354
|
+
return;
|
|
355
|
+
const E = [...n.filter(
|
|
356
|
+
(I) => !N.some((z) => te(z, I))
|
|
357
|
+
), ...N];
|
|
358
|
+
e == null || e(E, i), C(N, (I) => o == null ? void 0 : o(E, I));
|
|
352
359
|
}, P = (c, i) => {
|
|
353
|
-
const a = n.indexOf(c),
|
|
354
|
-
|
|
360
|
+
const a = n.indexOf(c), m = [...n];
|
|
361
|
+
m.splice(a, 1, i), e == null || e(m, null);
|
|
355
362
|
}, b = (c, i) => {
|
|
356
|
-
const a = n.filter((y) => !
|
|
357
|
-
e == null || e(a, i),
|
|
363
|
+
const a = n.filter((y) => !te(y, c));
|
|
364
|
+
e == null || e(a, i), u(c, (y) => o == null ? void 0 : o(a, y));
|
|
358
365
|
}, x = (c, i) => {
|
|
359
366
|
c && L(c, i);
|
|
360
|
-
},
|
|
367
|
+
}, B = (c) => ({
|
|
361
368
|
removeItem: b,
|
|
362
369
|
editItem: P,
|
|
363
370
|
handleChange: e,
|
|
364
371
|
getOptionUniqKeyValue: v,
|
|
365
372
|
storedItemsMap: p,
|
|
373
|
+
batchAddItems: (a) => {
|
|
374
|
+
L(a, c);
|
|
375
|
+
},
|
|
366
376
|
...c
|
|
367
377
|
});
|
|
368
378
|
return /* @__PURE__ */ r(
|
|
369
|
-
|
|
379
|
+
_e,
|
|
370
380
|
{
|
|
371
381
|
...g,
|
|
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,
|
|
@@ -384,26 +394,26 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
384
394
|
},
|
|
385
395
|
onChange: x,
|
|
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
|
-
}, J = Q.bind(
|
|
416
|
+
}, J = Q.bind(Lt), ao = (t) => {
|
|
407
417
|
const {
|
|
408
418
|
options: e = [],
|
|
409
419
|
loading: n = !1,
|
|
@@ -412,191 +422,193 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
412
422
|
value: s = [],
|
|
413
423
|
placeholder: l = "",
|
|
414
424
|
error: h = "",
|
|
415
|
-
touched:
|
|
425
|
+
touched: d = !1,
|
|
416
426
|
creatable: v = !1,
|
|
417
427
|
editable: g = !1,
|
|
418
428
|
onChange: p = () => {
|
|
419
429
|
},
|
|
420
|
-
onFocus:
|
|
430
|
+
onFocus: F = () => {
|
|
421
431
|
},
|
|
422
|
-
onBlur:
|
|
432
|
+
onBlur: C = () => {
|
|
423
433
|
},
|
|
424
|
-
disabled:
|
|
434
|
+
disabled: u = !1,
|
|
425
435
|
isDropdownMode: L = !1,
|
|
426
436
|
mobileDisabled: P = !1,
|
|
427
437
|
inputProps: b = {},
|
|
428
438
|
parseValueToString: x = (f) => f == null ? "" : String(f),
|
|
429
|
-
maxLength:
|
|
430
|
-
async:
|
|
439
|
+
maxLength: B = null,
|
|
440
|
+
async: T = !1,
|
|
431
441
|
customClass: c = "",
|
|
432
442
|
createWithoutConfirmation: i = !1,
|
|
433
443
|
getItemValidationErrorType: a = null,
|
|
434
|
-
clearItemsError:
|
|
444
|
+
clearItemsError: m = () => {
|
|
435
445
|
},
|
|
436
446
|
getAdditionalCreationCondition: y = () => !0,
|
|
437
|
-
highlightUnStoredItem:
|
|
447
|
+
highlightUnStoredItem: N = !1,
|
|
438
448
|
parseInputValueFn: _ = null,
|
|
439
|
-
handleUnStoredItemCb:
|
|
440
|
-
dataAutomationId:
|
|
441
|
-
existingItemsMap:
|
|
442
|
-
customizeNewSelectedValue:
|
|
443
|
-
renderCustomSelectedItem:
|
|
444
|
-
useFixedPositioning:
|
|
449
|
+
handleUnStoredItemCb: E = null,
|
|
450
|
+
dataAutomationId: M = "",
|
|
451
|
+
existingItemsMap: I = {},
|
|
452
|
+
customizeNewSelectedValue: z = (f) => f,
|
|
453
|
+
renderCustomSelectedItem: R,
|
|
454
|
+
useFixedPositioning: $,
|
|
445
455
|
newItemButtonText: ve = "",
|
|
446
|
-
menuClassName:
|
|
447
|
-
selectedItemSingleLine:
|
|
448
|
-
selectedItemClassName:
|
|
449
|
-
selectedItemTextClassName:
|
|
456
|
+
menuClassName: X = "",
|
|
457
|
+
selectedItemSingleLine: ne,
|
|
458
|
+
selectedItemClassName: re,
|
|
459
|
+
selectedItemTextClassName: le,
|
|
450
460
|
...be
|
|
451
|
-
} = t, { refs:
|
|
461
|
+
} = t, { refs: ce, floatingStyles: Z } = Be({
|
|
452
462
|
placement: "bottom-start",
|
|
453
|
-
strategy:
|
|
454
|
-
whileElementsMounted:
|
|
455
|
-
}), ye = s.length === 0 && !
|
|
463
|
+
strategy: $ ? "fixed" : "absolute",
|
|
464
|
+
whileElementsMounted: Pe
|
|
465
|
+
}), ye = s.length === 0 && !u ? l : "", oe = 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
|
+
m();
|
|
468
|
+
}, [m, s]);
|
|
469
|
+
const ge = (f, S) => {
|
|
470
|
+
p(f, S);
|
|
471
|
+
}, xe = (f, S, k) => ({ item: A, index: W, ...U }) => f({
|
|
472
|
+
item: A,
|
|
473
|
+
index: W,
|
|
474
|
+
isSelected: k.some((Y) => te(Y, A)),
|
|
475
|
+
...U,
|
|
476
|
+
isActive: S === W
|
|
467
477
|
}), w = ({
|
|
468
478
|
event: f,
|
|
469
|
-
removeItem:
|
|
470
|
-
inputValue:
|
|
479
|
+
removeItem: S,
|
|
480
|
+
inputValue: k
|
|
471
481
|
}) => {
|
|
472
|
-
f.key === "Backspace" && !
|
|
473
|
-
},
|
|
482
|
+
f.key === "Backspace" && !k && s.length && S(s[s.length - 1], null);
|
|
483
|
+
}, H = ({
|
|
474
484
|
inputValue: f,
|
|
475
|
-
selectItem:
|
|
476
|
-
clearSelection:
|
|
485
|
+
selectItem: S,
|
|
486
|
+
clearSelection: k,
|
|
487
|
+
batchAddItems: A
|
|
477
488
|
}) => {
|
|
478
489
|
if (_) {
|
|
479
|
-
const
|
|
480
|
-
(
|
|
490
|
+
const W = _(f);
|
|
491
|
+
A(W.length ? W : [f]), k();
|
|
481
492
|
} else
|
|
482
|
-
|
|
483
|
-
}, q = (f) => (
|
|
484
|
-
f(
|
|
485
|
-
},
|
|
493
|
+
S(f), k();
|
|
494
|
+
}, q = (f) => (S) => {
|
|
495
|
+
f(S, null), oe.current && oe.current.focus();
|
|
496
|
+
}, G = e.filter((f) => s.every((S) => !te(S, f)));
|
|
486
497
|
return /* @__PURE__ */ r(
|
|
487
|
-
|
|
498
|
+
At,
|
|
488
499
|
{
|
|
489
500
|
onChange: ge,
|
|
490
501
|
itemToString: x,
|
|
491
502
|
selectedItems: s,
|
|
492
503
|
onStateChange: o,
|
|
493
504
|
options: e,
|
|
494
|
-
existingItemsMap:
|
|
495
|
-
handleUnStoredItemCb:
|
|
496
|
-
customizeNewSelectedValue:
|
|
505
|
+
existingItemsMap: I,
|
|
506
|
+
handleUnStoredItemCb: E,
|
|
507
|
+
customizeNewSelectedValue: z,
|
|
497
508
|
children: ({
|
|
498
509
|
getInputProps: f,
|
|
499
|
-
getItemProps:
|
|
500
|
-
isOpen:
|
|
501
|
-
inputValue:
|
|
502
|
-
highlightedIndex:
|
|
503
|
-
removeItem:
|
|
504
|
-
editItem:
|
|
505
|
-
openMenu:
|
|
506
|
-
selectItem:
|
|
507
|
-
clearSelection:
|
|
508
|
-
toggleMenu:
|
|
510
|
+
getItemProps: S,
|
|
511
|
+
isOpen: k,
|
|
512
|
+
inputValue: A = "",
|
|
513
|
+
highlightedIndex: W,
|
|
514
|
+
removeItem: U,
|
|
515
|
+
editItem: Y,
|
|
516
|
+
openMenu: ie,
|
|
517
|
+
selectItem: ae,
|
|
518
|
+
clearSelection: de,
|
|
519
|
+
toggleMenu: V,
|
|
509
520
|
storedItemsMap: Ne,
|
|
510
|
-
getRootProps: Ee
|
|
521
|
+
getRootProps: Ee,
|
|
522
|
+
batchAddItems: Ie
|
|
511
523
|
}) => {
|
|
512
|
-
const
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
return /* @__PURE__ */ D("div", { ...de, className: J("autocomplete-wrapper"), children: [
|
|
517
|
-
/* @__PURE__ */ D(he, { children: [
|
|
518
|
-
/* @__PURE__ */ D(
|
|
524
|
+
const ue = Ee(void 0, { suppressRefError: !0 }), Se = A ?? "";
|
|
525
|
+
return /* @__PURE__ */ O("div", { ...ue, className: J("autocomplete-wrapper"), children: [
|
|
526
|
+
/* @__PURE__ */ O(he, { children: [
|
|
527
|
+
/* @__PURE__ */ O(
|
|
519
528
|
"div",
|
|
520
529
|
{
|
|
530
|
+
ref: ce.setReference,
|
|
521
531
|
className: J("autocomplete", c, {
|
|
522
532
|
"mobile-disabled": P,
|
|
523
533
|
error: h,
|
|
524
|
-
touched:
|
|
525
|
-
disabled:
|
|
534
|
+
touched: d,
|
|
535
|
+
disabled: u
|
|
526
536
|
}),
|
|
527
537
|
children: [
|
|
528
|
-
/* @__PURE__ */
|
|
538
|
+
/* @__PURE__ */ O(
|
|
529
539
|
"div",
|
|
530
540
|
{
|
|
531
541
|
className: J("autocomplete-input", {
|
|
532
542
|
"mobile-disabled": P,
|
|
533
|
-
"single-line-mode":
|
|
543
|
+
"single-line-mode": ne
|
|
534
544
|
}),
|
|
535
545
|
children: [
|
|
536
546
|
/* @__PURE__ */ r(
|
|
537
547
|
lt,
|
|
538
548
|
{
|
|
539
549
|
items: s,
|
|
540
|
-
onRemoveItem: q(
|
|
541
|
-
disabled:
|
|
550
|
+
onRemoveItem: q(U),
|
|
551
|
+
disabled: u,
|
|
542
552
|
mobileDisabled: P,
|
|
543
553
|
parseValueToString: x,
|
|
544
554
|
getItemValidationErrorType: a,
|
|
545
|
-
renderCustomSelectedItem:
|
|
546
|
-
editItem:
|
|
555
|
+
renderCustomSelectedItem: R,
|
|
556
|
+
editItem: Y,
|
|
547
557
|
editable: g,
|
|
548
558
|
getAdditionalCreationCondition: y,
|
|
549
559
|
storedItemsMap: Ne,
|
|
550
|
-
highlightUnStoredItem:
|
|
551
|
-
selectedItemSingleLine:
|
|
552
|
-
selectedItemClassName:
|
|
553
|
-
selectedItemTextClassName:
|
|
560
|
+
highlightUnStoredItem: N,
|
|
561
|
+
selectedItemSingleLine: ne,
|
|
562
|
+
selectedItemClassName: re,
|
|
563
|
+
selectedItemTextClassName: le
|
|
554
564
|
}
|
|
555
565
|
),
|
|
556
566
|
/* @__PURE__ */ r(
|
|
557
567
|
"input",
|
|
558
568
|
{
|
|
559
569
|
...f({
|
|
560
|
-
ref:
|
|
570
|
+
ref: oe,
|
|
561
571
|
placeholder: ye,
|
|
562
|
-
maxLength:
|
|
572
|
+
maxLength: B,
|
|
563
573
|
onFocus: () => {
|
|
564
|
-
L &&
|
|
574
|
+
L && ie(), F();
|
|
565
575
|
},
|
|
566
|
-
onKeyDown: (
|
|
567
|
-
|
|
568
|
-
inputValue:
|
|
569
|
-
selectItem:
|
|
570
|
-
clearSelection:
|
|
571
|
-
|
|
576
|
+
onKeyDown: (D) => {
|
|
577
|
+
D.key === Te && A && v && y(A) && H({
|
|
578
|
+
inputValue: A,
|
|
579
|
+
selectItem: ae,
|
|
580
|
+
clearSelection: de,
|
|
581
|
+
batchAddItems: Ie
|
|
582
|
+
}), w({ event: D, removeItem: U, inputValue: A });
|
|
572
583
|
},
|
|
573
584
|
onBlur: () => {
|
|
574
|
-
|
|
575
|
-
inputValue:
|
|
576
|
-
selectItem:
|
|
577
|
-
clearSelection:
|
|
585
|
+
C(), A && v && y(A) && H({
|
|
586
|
+
inputValue: A,
|
|
587
|
+
selectItem: ae,
|
|
588
|
+
clearSelection: de,
|
|
589
|
+
batchAddItems: Ie
|
|
578
590
|
});
|
|
579
591
|
},
|
|
580
|
-
disabled:
|
|
592
|
+
disabled: u,
|
|
581
593
|
...b
|
|
582
594
|
}),
|
|
583
|
-
className: J("input", { disabled:
|
|
584
|
-
"data-automation-id":
|
|
595
|
+
className: J("input", { disabled: u }, b.className),
|
|
596
|
+
"data-automation-id": M
|
|
585
597
|
}
|
|
586
598
|
)
|
|
587
599
|
]
|
|
588
600
|
}
|
|
589
601
|
),
|
|
590
|
-
(b == null ? void 0 : b.clearable) && !
|
|
602
|
+
(b == null ? void 0 : b.clearable) && !Me(s) && /* @__PURE__ */ r(
|
|
591
603
|
"button",
|
|
592
604
|
{
|
|
593
605
|
type: "button",
|
|
594
|
-
className: J("clear-icon", { "clear-icon--disabled":
|
|
606
|
+
className: J("clear-icon", { "clear-icon--disabled": u }),
|
|
595
607
|
onClick: () => {
|
|
596
|
-
var
|
|
597
|
-
return !
|
|
608
|
+
var D;
|
|
609
|
+
return !u && ((D = b == null ? void 0 : b.onClear) == null ? void 0 : D.call(b));
|
|
598
610
|
},
|
|
599
|
-
onMouseDown: (
|
|
611
|
+
onMouseDown: (D) => D.preventDefault(),
|
|
600
612
|
children: /* @__PURE__ */ r(et, {})
|
|
601
613
|
}
|
|
602
614
|
),
|
|
@@ -604,34 +616,34 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
604
616
|
"button",
|
|
605
617
|
{
|
|
606
618
|
type: "button",
|
|
607
|
-
className: J("dropdown-button", { "icon-reversed":
|
|
608
|
-
onClick: () =>
|
|
619
|
+
className: J("dropdown-button", { "icon-reversed": k }),
|
|
620
|
+
onClick: () => V(),
|
|
609
621
|
"aria-label": "Toggle dropdown",
|
|
610
|
-
"aria-expanded":
|
|
611
|
-
children: /* @__PURE__ */ r(
|
|
622
|
+
"aria-expanded": k,
|
|
623
|
+
children: /* @__PURE__ */ r(Oe, {})
|
|
612
624
|
}
|
|
613
625
|
)
|
|
614
626
|
]
|
|
615
627
|
}
|
|
616
628
|
),
|
|
617
|
-
h &&
|
|
629
|
+
h && d && /* @__PURE__ */ r("span", { className: J("error-text"), children: h })
|
|
618
630
|
] }),
|
|
619
631
|
/* @__PURE__ */ r(
|
|
620
632
|
$e,
|
|
621
633
|
{
|
|
622
|
-
isOpen:
|
|
634
|
+
isOpen: k,
|
|
623
635
|
loading: n,
|
|
624
|
-
async:
|
|
625
|
-
ref:
|
|
636
|
+
async: T,
|
|
637
|
+
ref: ce.setFloating,
|
|
626
638
|
newItemButtonText: ve,
|
|
627
639
|
isDropdownMode: L,
|
|
628
640
|
style: Z,
|
|
629
|
-
inputValue:
|
|
630
|
-
getItemProps: xe(
|
|
641
|
+
inputValue: Se.trim(),
|
|
642
|
+
getItemProps: xe(S, W, s),
|
|
631
643
|
parseValueToString: x,
|
|
632
644
|
createWithoutConfirmation: i,
|
|
633
|
-
options:
|
|
634
|
-
className:
|
|
645
|
+
options: G,
|
|
646
|
+
className: X,
|
|
635
647
|
...be
|
|
636
648
|
}
|
|
637
649
|
)
|
|
@@ -648,8 +660,8 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
648
660
|
if (!n)
|
|
649
661
|
return;
|
|
650
662
|
window.scrollY !== e && window.scrollTo(0, e);
|
|
651
|
-
}, l = (
|
|
652
|
-
n && (
|
|
663
|
+
}, l = (d) => {
|
|
664
|
+
n && (d.preventDefault(), d.stopImmediatePropagation(), s());
|
|
653
665
|
};
|
|
654
666
|
e = window.scrollY, window.addEventListener("scroll", l, { passive: !1, capture: !0 }), requestAnimationFrame(() => {
|
|
655
667
|
e = window.scrollY, s();
|
|
@@ -661,7 +673,7 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
661
673
|
clearTimeout(h), window.removeEventListener("scroll", l, { capture: !0 });
|
|
662
674
|
};
|
|
663
675
|
}, [t]);
|
|
664
|
-
},
|
|
676
|
+
}, Pt = ({ skip: t, reference: e }) => {
|
|
665
677
|
we(() => {
|
|
666
678
|
if (t)
|
|
667
679
|
return;
|
|
@@ -673,7 +685,7 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
673
685
|
window.removeEventListener("resize", n);
|
|
674
686
|
};
|
|
675
687
|
}, [t, e]);
|
|
676
|
-
},
|
|
688
|
+
}, Ot = ({ skip: t, onClose: e, menuRef: n }) => {
|
|
677
689
|
we(() => {
|
|
678
690
|
if (t)
|
|
679
691
|
return;
|
|
@@ -685,11 +697,11 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
685
697
|
window.removeEventListener("scroll", o, !0);
|
|
686
698
|
};
|
|
687
699
|
}, [t, e, n]);
|
|
688
|
-
},
|
|
700
|
+
}, Tt = {
|
|
689
701
|
"input-wrapper": "_input-wrapper_d9vma_1",
|
|
690
702
|
"dropdown-button": "_dropdown-button_d9vma_6",
|
|
691
703
|
"icon-reversed": "_icon-reversed_d9vma_14"
|
|
692
|
-
},
|
|
704
|
+
}, Le = Q.bind(Tt), $t = 0, Dt = Je({
|
|
693
705
|
fallbackPlacements: ["bottom-start", "top-start", "bottom", "top"],
|
|
694
706
|
boundary: document == null ? void 0 : document.documentElement,
|
|
695
707
|
rootBoundary: "viewport"
|
|
@@ -710,68 +722,68 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
710
722
|
},
|
|
711
723
|
onBlur: h = () => {
|
|
712
724
|
},
|
|
713
|
-
disabled:
|
|
725
|
+
disabled: d = !1,
|
|
714
726
|
inputProps: v = {},
|
|
715
727
|
parseValueToString: g = (w) => w === null ? "" : String(w),
|
|
716
728
|
minLength: p = 1,
|
|
717
|
-
skipOptionCreation:
|
|
718
|
-
maxLength:
|
|
719
|
-
optionVariant:
|
|
729
|
+
skipOptionCreation: F = !1,
|
|
730
|
+
maxLength: C = null,
|
|
731
|
+
optionVariant: u = "",
|
|
720
732
|
isRequired: L = !1,
|
|
721
733
|
error: P = "",
|
|
722
734
|
touched: b = !1,
|
|
723
735
|
setTouch: x = () => {
|
|
724
736
|
},
|
|
725
|
-
createWithoutConfirmation:
|
|
726
|
-
menuClassName:
|
|
737
|
+
createWithoutConfirmation: B = !1,
|
|
738
|
+
menuClassName: T = "",
|
|
727
739
|
icon: c,
|
|
728
740
|
isDropdownMode: i = !1,
|
|
729
741
|
isOptionUnique: a,
|
|
730
|
-
refFunction:
|
|
742
|
+
refFunction: m,
|
|
731
743
|
stateReducer: y,
|
|
732
|
-
onStateChange:
|
|
744
|
+
onStateChange: N,
|
|
733
745
|
useFixedPositioning: _,
|
|
734
|
-
dropdownMatchInputWidth:
|
|
735
|
-
withMenuFlip:
|
|
736
|
-
newItemButtonText:
|
|
737
|
-
menuPortalRoot:
|
|
738
|
-
...
|
|
739
|
-
} = t, [
|
|
746
|
+
dropdownMatchInputWidth: E = !1,
|
|
747
|
+
withMenuFlip: M = !1,
|
|
748
|
+
newItemButtonText: I = "",
|
|
749
|
+
menuPortalRoot: z,
|
|
750
|
+
...R
|
|
751
|
+
} = t, [$, ve] = se(!1), X = Ce(null), ne = K(() => {
|
|
740
752
|
var w;
|
|
741
|
-
return (w =
|
|
742
|
-
}, []),
|
|
753
|
+
return (w = X.current) == null ? void 0 : w.call(X);
|
|
754
|
+
}, []), re = !$ || !z, le = z || _ ? "fixed" : "absolute", be = !$ || le === "absolute", ce = He(
|
|
743
755
|
() => [
|
|
744
|
-
...
|
|
745
|
-
...
|
|
756
|
+
...M ? [Dt] : [],
|
|
757
|
+
...E ? [jt] : []
|
|
746
758
|
],
|
|
747
|
-
[
|
|
759
|
+
[M, E]
|
|
748
760
|
), { refs: Z, floatingStyles: ye } = Be({
|
|
749
761
|
placement: "bottom-start",
|
|
750
|
-
whileElementsMounted:
|
|
751
|
-
strategy:
|
|
752
|
-
middleware:
|
|
762
|
+
whileElementsMounted: Pe,
|
|
763
|
+
strategy: le,
|
|
764
|
+
middleware: ce
|
|
753
765
|
});
|
|
754
|
-
Bt({ skip:
|
|
766
|
+
Bt({ skip: re }), Pt({ skip: re, reference: Z.reference }), Ot({
|
|
755
767
|
skip: be,
|
|
756
|
-
onClose:
|
|
768
|
+
onClose: ne,
|
|
757
769
|
menuRef: Z.floating
|
|
758
770
|
});
|
|
759
|
-
const
|
|
760
|
-
item:
|
|
771
|
+
const oe = (w, H, q) => ({ item: G, index: f, ...S }) => w({
|
|
772
|
+
item: G,
|
|
761
773
|
index: f,
|
|
762
|
-
isSelected: q !== null && q ===
|
|
763
|
-
...
|
|
764
|
-
isActive:
|
|
765
|
-
}), ge = (w,
|
|
766
|
-
w.key === Ue && (w.preventDefault(),
|
|
767
|
-
}, xe =
|
|
768
|
-
(w, ...
|
|
769
|
-
(w == null ? void 0 : w.isOpen) !== void 0 && ve(w.isOpen),
|
|
774
|
+
isSelected: q !== null && q === G,
|
|
775
|
+
...S,
|
|
776
|
+
isActive: H === f
|
|
777
|
+
}), ge = (w, H) => {
|
|
778
|
+
w.key === Ue && (w.preventDefault(), H(e.length));
|
|
779
|
+
}, xe = K(
|
|
780
|
+
(w, ...H) => {
|
|
781
|
+
(w == null ? void 0 : w.isOpen) !== void 0 && ve(w.isOpen), N == null || N(w, ...H);
|
|
770
782
|
},
|
|
771
|
-
[
|
|
783
|
+
[N]
|
|
772
784
|
);
|
|
773
785
|
return /* @__PURE__ */ r(
|
|
774
|
-
|
|
786
|
+
_e,
|
|
775
787
|
{
|
|
776
788
|
onChange: s,
|
|
777
789
|
itemToString: g,
|
|
@@ -781,91 +793,91 @@ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
|
781
793
|
stateReducer: y,
|
|
782
794
|
children: ({
|
|
783
795
|
getInputProps: w,
|
|
784
|
-
getItemProps:
|
|
796
|
+
getItemProps: H,
|
|
785
797
|
setHighlightedIndex: q,
|
|
786
|
-
toggleMenu:
|
|
798
|
+
toggleMenu: G,
|
|
787
799
|
openMenu: f,
|
|
788
|
-
closeMenu:
|
|
789
|
-
isOpen:
|
|
790
|
-
inputValue:
|
|
791
|
-
highlightedIndex:
|
|
792
|
-
getRootProps:
|
|
793
|
-
selectItem:
|
|
800
|
+
closeMenu: S,
|
|
801
|
+
isOpen: k,
|
|
802
|
+
inputValue: A,
|
|
803
|
+
highlightedIndex: W,
|
|
804
|
+
getRootProps: U,
|
|
805
|
+
selectItem: Y
|
|
794
806
|
}) => {
|
|
795
|
-
const
|
|
796
|
-
...
|
|
797
|
-
ref: (
|
|
807
|
+
const ie = U(void 0, { suppressRefError: !0 }), ae = {
|
|
808
|
+
...ie,
|
|
809
|
+
ref: (j) => (Z.setReference(j), ie.ref(j))
|
|
798
810
|
};
|
|
799
|
-
|
|
800
|
-
const
|
|
801
|
-
|
|
802
|
-
},
|
|
811
|
+
X.current || (X.current = S);
|
|
812
|
+
const de = A ?? "", { onClear: V, clearable: Ne, ...Ee } = v, ue = Ne && n !== null, Se = (...j) => {
|
|
813
|
+
Y(null), V == null || V(...j);
|
|
814
|
+
}, D = /* @__PURE__ */ r(
|
|
803
815
|
$e,
|
|
804
816
|
{
|
|
805
|
-
isOpen:
|
|
817
|
+
isOpen: k,
|
|
806
818
|
isDropdownMode: i,
|
|
807
819
|
style: ye,
|
|
808
820
|
ref: Z.setFloating,
|
|
809
|
-
portalMenuAttribute:
|
|
821
|
+
portalMenuAttribute: z ? qe : null,
|
|
810
822
|
minLength: p,
|
|
811
|
-
inputValue: (
|
|
812
|
-
getItemProps:
|
|
823
|
+
inputValue: (A || "").trim(),
|
|
824
|
+
getItemProps: oe(H, W, n),
|
|
813
825
|
parseValueToString: g,
|
|
814
|
-
optionVariant:
|
|
815
|
-
createWithoutConfirmation:
|
|
816
|
-
className:
|
|
826
|
+
optionVariant: u,
|
|
827
|
+
createWithoutConfirmation: B,
|
|
828
|
+
className: T,
|
|
817
829
|
options: e,
|
|
818
|
-
newItemButtonText:
|
|
819
|
-
...
|
|
830
|
+
newItemButtonText: I,
|
|
831
|
+
...R
|
|
820
832
|
}
|
|
821
833
|
);
|
|
822
|
-
return /* @__PURE__ */
|
|
823
|
-
/* @__PURE__ */
|
|
834
|
+
return /* @__PURE__ */ O(he, { children: [
|
|
835
|
+
/* @__PURE__ */ O("div", { className: Le("input-wrapper"), ...ae, children: [
|
|
824
836
|
/* @__PURE__ */ r(
|
|
825
837
|
Ze,
|
|
826
838
|
{
|
|
827
839
|
...w({
|
|
828
|
-
placeholder:
|
|
829
|
-
maxLength:
|
|
840
|
+
placeholder: d ? "" : o,
|
|
841
|
+
maxLength: C || void 0,
|
|
830
842
|
onFocus: () => {
|
|
831
|
-
i && !
|
|
843
|
+
i && !k && (f(), x == null || x(!0)), l();
|
|
832
844
|
},
|
|
833
|
-
ref:
|
|
834
|
-
onKeyDown: (
|
|
835
|
-
|
|
845
|
+
ref: m,
|
|
846
|
+
onKeyDown: (j) => {
|
|
847
|
+
j.key === Te && j.preventDefault(), A && k && ge(j, q);
|
|
836
848
|
},
|
|
837
|
-
onBlur: (
|
|
838
|
-
const
|
|
839
|
-
|
|
840
|
-
ke ? !e.some((
|
|
841
|
-
), i &&
|
|
849
|
+
onBlur: (j) => {
|
|
850
|
+
const me = de.trim(), ke = !Me(me), ze = ke ? e.find((Ae) => g(Ae) === me) : void 0;
|
|
851
|
+
Y(ze || (!F && B && ke ? me : null)), h(j), a == null || a(
|
|
852
|
+
ke ? !e.some((Ae) => g(Ae) === me) : null
|
|
853
|
+
), i && k && G(), x == null || x(!0);
|
|
842
854
|
},
|
|
843
|
-
disabled:
|
|
855
|
+
disabled: d,
|
|
844
856
|
defaultWidth: !1,
|
|
845
857
|
isRequired: L,
|
|
846
858
|
touched: b,
|
|
847
859
|
error: P,
|
|
848
860
|
...Ee,
|
|
849
|
-
clearable:
|
|
850
|
-
onClear:
|
|
861
|
+
clearable: ue,
|
|
862
|
+
onClear: ue ? Se : V,
|
|
851
863
|
endIcon: i && !c ? /* @__PURE__ */ r(
|
|
852
864
|
"button",
|
|
853
865
|
{
|
|
854
866
|
type: "button",
|
|
855
|
-
className:
|
|
856
|
-
onClick: () =>
|
|
867
|
+
className: Le("dropdown-button", { "icon-reversed": k }),
|
|
868
|
+
onClick: () => G(),
|
|
857
869
|
"aria-label": "Toggle dropdown",
|
|
858
|
-
"aria-expanded":
|
|
859
|
-
children: /* @__PURE__ */ r(
|
|
870
|
+
"aria-expanded": k,
|
|
871
|
+
children: /* @__PURE__ */ r(Oe, {})
|
|
860
872
|
}
|
|
861
873
|
) : c,
|
|
862
874
|
minLength: i ? 0 : p
|
|
863
875
|
})
|
|
864
876
|
}
|
|
865
877
|
),
|
|
866
|
-
|
|
878
|
+
!z && D
|
|
867
879
|
] }),
|
|
868
|
-
|
|
880
|
+
z && Ge(D, z)
|
|
869
881
|
] });
|
|
870
882
|
}
|
|
871
883
|
}
|
|
@@ -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;
|