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