@reportportal/ui-kit 0.0.1-alpha.220 → 0.0.1-alpha.221

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