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