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