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