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