@reportportal/ui-kit 0.0.1-alpha.209 → 0.0.1-alpha.210

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