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