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