@reportportal/ui-kit 0.0.1-alpha.177 → 0.0.1-alpha.178

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