@reportportal/ui-kit 0.0.1-alpha.231 → 0.0.1-alpha.232

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