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