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