@reportportal/ui-kit 0.0.1-alpha.116 → 0.0.1-alpha.118

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