@reportportal/ui-kit 0.0.1-alpha.162 → 0.0.1-alpha.164

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,7 +1,7 @@
1
- import { jsxs as R, jsx as u, Fragment as Ve } from "react/jsx-runtime";
2
- import { forwardRef as wr, useState as ne, useRef as K, useMemo as C, useCallback as N, useLayoutEffect as Se, useEffect as V } from "react";
1
+ import { jsxs as k, jsx as u, Fragment as Ye } from "react/jsx-runtime";
2
+ import { forwardRef as gr, useState as ne, useRef as K, useMemo as C, useCallback as N, useLayoutEffect as Ve, useEffect as Y } from "react";
3
3
  import { createPortal as Er } from "react-dom";
4
- import { c as We } from "./bind-06a7ff84.js";
4
+ import { c as $e } from "./bind-06a7ff84.js";
5
5
  import { useFloating as yr, offset as Cr, flip as Ar, size as Or, autoUpdate as vr } from "@floating-ui/react-dom";
6
6
  import { useSelect as pe } from "downshift";
7
7
  import { Scrollbars as Dr } from "rc-scrollbars";
@@ -11,9 +11,9 @@ import { S as Nr } from "./clear-53660571.js";
11
11
  import { S as Ir } from "./dropdown-0260bb66.js";
12
12
  import { FieldLabel as Kr } from "./fieldLabel.js";
13
13
  import { AdaptiveTagList as Lr } from "./adaptiveTagList.js";
14
- import { C as Tr } from "./checkbox-493fdc63.js";
14
+ import { C as zr } from "./checkbox-493fdc63.js";
15
15
  import { i as se } from "./isEmpty-ccacb5ff.js";
16
- const xr = (n) => {
16
+ const Tr = (n) => {
17
17
  const r = {}, c = {};
18
18
  return Object.entries(n).forEach(([a, h]) => {
19
19
  if (/^data[A-Z]/.test(a) || /^aria[A-Z]/.test(a)) {
@@ -22,41 +22,41 @@ const xr = (n) => {
22
22
  } else
23
23
  c[a] = h;
24
24
  }), { transformed: r, remaining: c };
25
- }, kr = "_disabled_14s7v_12", Rr = "_hidden_14s7v_16", Pr = "_hover_14s7v_22", Yr = "_selected_14s7v_38", Vr = {
25
+ }, xr = "_disabled_14s7v_12", kr = "_hidden_14s7v_16", Rr = "_hover_14s7v_22", Pr = "_selected_14s7v_38", Yr = {
26
26
  "dropdown-option": "_dropdown-option_14s7v_1",
27
- disabled: kr,
28
- hidden: Rr,
29
- hover: Pr,
27
+ disabled: xr,
28
+ hidden: kr,
29
+ hover: Rr,
30
30
  "depth-1": "_depth-1_14s7v_32",
31
- selected: Yr,
31
+ selected: Pr,
32
32
  "multi-select": "_multi-select_14s7v_38",
33
33
  "single-option": "_single-option_14s7v_43",
34
34
  "sub-option": "_sub-option_14s7v_50"
35
- }, He = We.bind(Vr), $e = wr(
35
+ }, Se = $e.bind(Yr), He = gr(
36
36
  (n, r) => {
37
37
  const {
38
38
  option: { value: c, disabled: a, hidden: h, label: m, title: A, groupRef: O },
39
39
  selected: F,
40
- onChange: H,
40
+ onChange: S,
41
41
  render: U,
42
42
  highlightHovered: B,
43
43
  onMouseEnter: ae,
44
- multiSelect: g,
44
+ multiSelect: w,
45
45
  isPartiallyChecked: j = !1,
46
46
  depth: q = 0,
47
47
  hasChildren: oe = !1
48
48
  } = n, ie = (Z) => {
49
- (Z.target instanceof HTMLDivElement || Z.target instanceof HTMLInputElement) && (H == null || H(c));
49
+ (Z.target instanceof HTMLDivElement || Z.target instanceof HTMLInputElement) && (S == null || S(c));
50
50
  };
51
- return /* @__PURE__ */ R(
51
+ return /* @__PURE__ */ k(
52
52
  "div",
53
53
  {
54
- className: He("dropdown-option", {
54
+ className: Se("dropdown-option", {
55
55
  selected: F,
56
56
  disabled: a,
57
57
  hidden: h,
58
58
  hover: B,
59
- "multi-select": g,
59
+ "multi-select": w,
60
60
  "has-children": oe,
61
61
  [`depth-${q}`]: q > 0
62
62
  }),
@@ -65,11 +65,11 @@ const xr = (n) => {
65
65
  ref: r,
66
66
  onMouseEnter: ae,
67
67
  children: [
68
- g && /* @__PURE__ */ u(Tr, { value: !!F, partiallyChecked: j }),
68
+ w && /* @__PURE__ */ u(zr, { value: !!F, partiallyChecked: j }),
69
69
  /* @__PURE__ */ u(
70
70
  "div",
71
71
  {
72
- className: He("single-option", {
72
+ className: Se("single-option", {
73
73
  "sub-option": !!O
74
74
  }),
75
75
  children: U ? U(n) : m
@@ -79,13 +79,13 @@ const xr = (n) => {
79
79
  }
80
80
  );
81
81
  }
82
- ), Sr = [
82
+ ), Vr = [
83
83
  p.ENTER_KEY_CODE,
84
84
  p.SPACE_KEY_CODE,
85
85
  p.ARROW_DOWN_KEY_CODE
86
- ], Hr = [p.ESCAPE_KEY_CODE, p.TAB_KEY_CODE];
87
- var S = /* @__PURE__ */ ((n) => (n.ON_KEY_DOWN = "onKeyDown", n.ON_CLICK = "onClick", n))(S || {});
88
- const $r = 240, Wr = "data-dropdown-portal-menu", Mr = 10, zr = (n, r) => {
86
+ ], Sr = [p.ESCAPE_KEY_CODE, p.TAB_KEY_CODE];
87
+ var V = /* @__PURE__ */ ((n) => (n.ON_KEY_DOWN = "onKeyDown", n.ON_CLICK = "onClick", n))(V || {});
88
+ const Hr = 240, $r = "data-dropdown-portal-menu", Wr = 10, Mr = (n, r) => {
89
89
  const c = Array.isArray(r) ? r : [r];
90
90
  return n.findIndex(({ value: a }) => c.includes(a));
91
91
  }, Fr = (n, r) => (n % r + r) % r, me = (n, r = 0, c = 1) => {
@@ -100,41 +100,41 @@ const $r = 240, Wr = "data-dropdown-portal-menu", Mr = 10, zr = (n, r) => {
100
100
  Fr(r + c, a),
101
101
  c
102
102
  );
103
- }, Ur = (n, r) => me(n, r), Br = (n, r) => me(n, r, -1), Me = (n, r = 0, c) => !n || n.length === 0 ? [] : n.reduce((a, h) => {
103
+ }, Ur = (n, r) => me(n, r), Br = (n, r) => me(n, r, -1), We = (n, r = 0, c) => !n || n.length === 0 ? [] : n.reduce((a, h) => {
104
104
  var m;
105
- return h && (a.push({ option: h, depth: r, parent: c }), (m = h.children) != null && m.length && a.push(...Me(h.children, r + 1, h))), a;
106
- }, []), ze = (n) => !n || n.length === 0 ? [] : n.reduce((r, c) => {
105
+ return h && (a.push({ option: h, depth: r, parent: c }), (m = h.children) != null && m.length && a.push(...We(h.children, r + 1, h))), a;
106
+ }, []), Me = (n) => !n || n.length === 0 ? [] : n.reduce((r, c) => {
107
107
  var a;
108
- return c && ((a = c.children) != null && a.length ? r.push(...ze(c.children)) : r.push(c)), r;
108
+ return c && ((a = c.children) != null && a.length ? r.push(...Me(c.children)) : r.push(c)), r;
109
109
  }, []), Fe = (n) => {
110
110
  var r;
111
111
  return n ? (r = n.children) != null && r.length ? n.children.reduce((c, a) => (a && c.push(...Fe(a)), c), []) : [n.value] : [];
112
- }, jr = "_container_1lti6_1", qr = "_icon_1lti6_7", Zr = "_arrow_1lti6_15", Gr = "_dropdown_1lti6_33", Xr = "_disabled_1lti6_53", Jr = "_value_1lti6_60", Qr = "_error_1lti6_63", et = "_touched_1lti6_63", rt = "_opened_1lti6_67", tt = "_placeholder_1lti6_101", nt = "_ghost_1lti6_184", st = "_divider_1lti6_202", at = {
112
+ }, jr = "_container_18w0z_1", qr = "_icon_18w0z_7", Zr = "_arrow_18w0z_15", Gr = "_dropdown_18w0z_33", Xr = "_disabled_18w0z_53", Jr = "_value_18w0z_60", Qr = "_error_18w0z_63", et = "_touched_18w0z_63", rt = "_opened_18w0z_67", tt = "_placeholder_18w0z_101", nt = "_ghost_18w0z_184", st = "_divider_18w0z_202", at = {
113
113
  container: jr,
114
114
  icon: qr,
115
115
  arrow: Zr,
116
- "clear-button": "_clear-button_1lti6_23",
116
+ "clear-button": "_clear-button_18w0z_23",
117
117
  dropdown: Gr,
118
- "multi-select-with-tags": "_multi-select-with-tags_1lti6_47",
119
- "transparent-background": "_transparent-background_1lti6_50",
118
+ "multi-select-with-tags": "_multi-select-with-tags_18w0z_47",
119
+ "transparent-background": "_transparent-background_18w0z_50",
120
120
  disabled: Xr,
121
121
  value: Jr,
122
122
  error: Qr,
123
123
  touched: et,
124
124
  opened: rt,
125
125
  placeholder: tt,
126
- "mobile-disabled": "_mobile-disabled_1lti6_105",
127
- "value-wrapper": "_value-wrapper_1lti6_110",
128
- "tags-wrapper": "_tags-wrapper_1lti6_116",
129
- "with-search": "_with-search_1lti6_121",
130
- "search-input": "_search-input_1lti6_128",
131
- "select-list": "_select-list_1lti6_146",
132
- "limited-width": "_limited-width_1lti6_163",
133
- "options-container": "_options-container_1lti6_167",
134
- "empty-list-message": "_empty-list-message_1lti6_172",
126
+ "mobile-disabled": "_mobile-disabled_18w0z_105",
127
+ "value-wrapper": "_value-wrapper_18w0z_110",
128
+ "tags-wrapper": "_tags-wrapper_18w0z_116",
129
+ "with-search": "_with-search_18w0z_121",
130
+ "search-input": "_search-input_18w0z_128",
131
+ "select-list": "_select-list_18w0z_146",
132
+ "limited-width": "_limited-width_18w0z_163",
133
+ "options-container": "_options-container_18w0z_167",
134
+ "empty-list-message": "_empty-list-message_18w0z_172",
135
135
  ghost: nt,
136
136
  divider: st
137
- }, _ = We.bind(at), At = ({
137
+ }, _ = $e.bind(at), At = ({
138
138
  multiSelect: n = !1,
139
139
  value: r = n ? [] : "",
140
140
  options: c = [],
@@ -144,11 +144,11 @@ const $r = 240, Wr = "data-dropdown-portal-menu", Mr = 10, zr = (n, r) => {
144
144
  onFocus: A,
145
145
  onBlur: O,
146
146
  mobileDisabled: F,
147
- title: H,
147
+ title: S,
148
148
  touched: U = !1,
149
149
  icon: B,
150
150
  variant: ae,
151
- placeholder: g = "",
151
+ placeholder: w = "",
152
152
  label: j = "",
153
153
  renderOption: q,
154
154
  transparentBackground: oe = !1,
@@ -157,39 +157,39 @@ const $r = 240, Wr = "data-dropdown-portal-menu", Mr = 10, zr = (n, r) => {
157
157
  selectListClassName: Ue,
158
158
  isListWidthLimited: Be = !1,
159
159
  optionAll: le = { value: "all", label: "All" },
160
- isOptionAllVisible: ge = !1,
160
+ isOptionAllVisible: we = !1,
161
161
  onSelectAll: je = () => {
162
162
  },
163
- formatDisplayedValue: we,
164
- notScrollable: $ = !1,
163
+ formatDisplayedValue: ge,
164
+ notScrollable: H = !1,
165
165
  footer: G,
166
166
  includeGroupValue: Ee = !1,
167
167
  clearable: qe = !1,
168
168
  onClear: ye = () => {
169
169
  },
170
170
  clearButtonAriaLabel: Ze = "Clear selection",
171
- menuPortalRoot: w,
171
+ menuPortalRoot: g,
172
172
  isMultiSelectWithTags: v = !1,
173
173
  noMatchesMessage: Ge = "No matches found",
174
174
  ...Xe
175
175
  }) => {
176
- const { transformed: Je, remaining: Qe } = xr(Xe), [l, X] = ne(!1), [I, Ce] = ne(""), Ae = K(null), Oe = K(null), W = K(null), ce = K(0), de = K(null), ue = K(null), fe = K(""), [er, ve] = ne(!1), [rr, J] = ne(null), L = K(null), M = C(() => Me(c), [c]), T = C(() => {
176
+ const { transformed: Je, remaining: Qe } = Tr(Xe), [l, X] = ne(!1), [I, Ce] = ne(""), Ae = K(null), Oe = K(null), $ = K(null), ce = K(0), de = K(null), ue = K(null), fe = K(""), [er, ve] = ne(!1), [rr, J] = ne(null), L = K(null), W = C(() => We(c), [c]), z = C(() => {
177
177
  if (!v || !I.trim())
178
- return M;
178
+ return W;
179
179
  const e = I.toLowerCase();
180
- return M.filter(
180
+ return W.filter(
181
181
  ({ option: t }) => t.label.toLowerCase().includes(e)
182
182
  );
183
- }, [M, I, v]), E = C(
184
- () => T.map(({ option: e }) => e),
185
- [T]
183
+ }, [W, I, v]), E = C(
184
+ () => z.map(({ option: e }) => e),
185
+ [z]
186
186
  ), De = C(
187
- () => M.map(({ option: e }) => e),
188
- [M]
189
- ), Q = C(() => T.filter(({ option: e }) => {
187
+ () => W.map(({ option: e }) => e),
188
+ [W]
189
+ ), Q = C(() => z.filter(({ option: e }) => {
190
190
  var t;
191
191
  return (t = e.children) == null ? void 0 : t.length;
192
- }).map(({ option: e }) => e), [T]), be = C(() => ze(c), [c]), D = C(
192
+ }).map(({ option: e }) => e), [z]), be = C(() => Me(c), [c]), D = C(
193
193
  () => be.map(({ value: e }) => e),
194
194
  [be]
195
195
  ), ee = C(() => {
@@ -197,30 +197,30 @@ const $r = 240, Wr = "data-dropdown-portal-menu", Mr = 10, zr = (n, r) => {
197
197
  return Q.forEach((t) => {
198
198
  e.set(t.value, Fe(t));
199
199
  }), e;
200
- }, [Q]), z = N(
200
+ }, [Q]), M = N(
201
201
  (e) => (Q.forEach((t) => {
202
202
  const s = ee.get(t.value) ?? [], i = s.length > 0 && s.every((d) => e.has(d));
203
203
  Ee && i ? e.add(t.value) : e.delete(t.value);
204
204
  }), e),
205
205
  [Q, Ee, ee]
206
- ), x = C(() => !n || !Array.isArray(r) ? /* @__PURE__ */ new Set() : z(new Set(r)), [n, r, z]), Ne = n ? Array.isArray(r) && r.length > 0 : r || r === !1 || r === 0, tr = qe && Ne && !a, nr = N((e) => {
206
+ ), T = C(() => !n || !Array.isArray(r) ? /* @__PURE__ */ new Set() : M(new Set(r)), [n, r, M]), Ne = n ? Array.isArray(r) && r.length > 0 : r || r === !1 || r === 0, tr = qe && Ne && !a, nr = N((e) => {
207
207
  ce.current = e.scrollTop;
208
208
  }, []);
209
- Se(() => {
210
- l && !$ && W.current && !(n && L.current !== null) && W.current.scrollTop(ce.current);
211
- }, [l, $, r, n]);
212
- const { refs: P, floatingStyles: Ie } = yr({
209
+ Ve(() => {
210
+ l && !H && $.current && !(n && L.current !== null) && $.current.scrollTop(ce.current);
211
+ }, [l, H, r, n]);
212
+ const { refs: R, floatingStyles: Ie } = yr({
213
213
  placement: "bottom-start",
214
214
  middleware: [
215
215
  Cr(5),
216
216
  Ar({
217
217
  fallbackPlacements: ["bottom-start", "top-start", "bottom", "top"],
218
- ...w && {
218
+ ...g && {
219
219
  boundary: document.documentElement,
220
220
  rootBoundary: "viewport"
221
221
  }
222
222
  }),
223
- w ? Or({
223
+ g ? Or({
224
224
  apply({ rects: e, elements: t }) {
225
225
  const s = e.reference.width;
226
226
  Object.assign(t.floating.style, {
@@ -235,13 +235,13 @@ const $r = 240, Wr = "data-dropdown-portal-menu", Mr = 10, zr = (n, r) => {
235
235
  animationFrame: !0
236
236
  }) : void 0
237
237
  }), sr = () => {
238
- if (!ge)
238
+ if (!we)
239
239
  return;
240
240
  const e = Array.isArray(r) ? r : [], t = new Set(e), s = D.some((d) => !t.has(d));
241
241
  D.forEach((d) => {
242
242
  s ? t.add(d) : t.delete(d);
243
243
  });
244
- const i = z(t);
244
+ const i = M(t);
245
245
  m(Array.from(i)), je();
246
246
  }, re = N(() => {
247
247
  l || (X(!0), A == null || A());
@@ -251,10 +251,10 @@ const $r = 240, Wr = "data-dropdown-portal-menu", Mr = 10, zr = (n, r) => {
251
251
  if (a)
252
252
  return;
253
253
  m(n ? [] : ""), ye(), y(), requestAnimationFrame(() => {
254
- const t = P.reference.current;
254
+ const t = R.reference.current;
255
255
  t && t instanceof HTMLElement && t.focus();
256
256
  });
257
- }, [a, n, m, ye, y, P]), ar = N(
257
+ }, [a, n, m, ye, y, R]), ar = N(
258
258
  (e) => {
259
259
  e.preventDefault(), e.stopPropagation(), he();
260
260
  },
@@ -272,7 +272,7 @@ const $r = 240, Wr = "data-dropdown-portal-menu", Mr = 10, zr = (n, r) => {
272
272
  },
273
273
  [l, y]
274
274
  );
275
- V(() => {
275
+ Y(() => {
276
276
  if (!l)
277
277
  return;
278
278
  const e = (t) => {
@@ -294,66 +294,66 @@ const $r = 240, Wr = "data-dropdown-portal-menu", Mr = 10, zr = (n, r) => {
294
294
  });
295
295
  } else
296
296
  i.has(e.value) ? i.delete(e.value) : i.add(e.value);
297
- const d = z(i);
297
+ const d = M(i);
298
298
  m(Array.from(d));
299
299
  } else
300
300
  m(e.value);
301
301
  X((s) => n || !s);
302
302
  }
303
- }, or = () => E.find(({ value: e }) => e === r), Te = zr(E, r), {
303
+ }, or = () => E.find(({ value: e }) => e === r), ze = Mr(E, r), {
304
304
  getToggleButtonProps: ir,
305
305
  getLabelProps: lr,
306
- getMenuProps: xe,
306
+ getMenuProps: Te,
307
307
  getItemProps: cr,
308
- setHighlightedIndex: k,
308
+ setHighlightedIndex: x,
309
309
  highlightedIndex: _e
310
310
  } = pe({
311
311
  items: E,
312
- itemToString: (e) => (e != null && e.label ? String(e.label) : g) || "",
312
+ itemToString: (e) => (e != null && e.label ? String(e.label) : w) || "",
313
313
  selectedItem: or(),
314
314
  isOpen: l,
315
315
  circularNavigation: !0,
316
- defaultHighlightedIndex: Te,
316
+ defaultHighlightedIndex: ze,
317
317
  onHighlightedIndexChange: (e) => {
318
318
  switch (e.type) {
319
319
  case pe.stateChangeTypes.MenuKeyDownArrowUp:
320
- return J(S.ON_KEY_DOWN), k(Br(E, e.highlightedIndex)), e;
320
+ return J(V.ON_KEY_DOWN), x(Br(E, e.highlightedIndex)), e;
321
321
  case pe.stateChangeTypes.MenuKeyDownArrowDown:
322
- return J(S.ON_KEY_DOWN), k(Ur(E, e.highlightedIndex)), e;
322
+ return J(V.ON_KEY_DOWN), x(Ur(E, e.highlightedIndex)), e;
323
323
  default:
324
324
  return e;
325
325
  }
326
326
  }
327
- }), ke = N(
327
+ }), xe = N(
328
328
  (e) => {
329
- Oe.current = e, P.setFloating(e);
329
+ Oe.current = e, R.setFloating(e);
330
330
  },
331
- [P]
331
+ [R]
332
332
  ), dr = N(
333
333
  (e = {}) => {
334
- const t = xe(e), s = t.ref;
334
+ const t = Te(e), s = t.ref;
335
335
  return {
336
336
  ...t,
337
337
  ref: (i) => {
338
- ke(i), typeof s == "function" ? s(i) : s && (s.current = i);
338
+ xe(i), typeof s == "function" ? s(i) : s && (s.current = i);
339
339
  }
340
340
  };
341
341
  },
342
- [xe, ke]
342
+ [Te, xe]
343
343
  );
344
- V(() => {
345
- n && l && L.current !== null && L.current >= 0 && L.current < E.length && (k(L.current), L.current = null, requestAnimationFrame(() => {
346
- W.current && !$ && W.current.scrollTop(ce.current);
344
+ Y(() => {
345
+ n && l && L.current !== null && L.current >= 0 && L.current < E.length && (x(L.current), L.current = null, requestAnimationFrame(() => {
346
+ $.current && !H && $.current.scrollTop(ce.current);
347
347
  }));
348
- }, [n, l, r, E.length, k, $]), V(() => {
348
+ }, [n, l, r, E.length, x, H]), Y(() => {
349
349
  l && v && requestAnimationFrame(() => {
350
350
  var e;
351
351
  (e = ue.current) == null || e.focus();
352
352
  });
353
- }, [l, v]), V(() => {
354
- v && l && I !== fe.current && (fe.current = I, I && k(0));
355
- }, [I, v, l]), Se(() => {
356
- if (!l || !w)
353
+ }, [l, v]), Y(() => {
354
+ v && l && I !== fe.current && (fe.current = I, I && x(0));
355
+ }, [I, v, l]), Ve(() => {
356
+ if (!l || !g)
357
357
  return;
358
358
  let e = window.scrollY, t = !0;
359
359
  const s = 300, i = () => {
@@ -372,8 +372,8 @@ const $r = 240, Wr = "data-dropdown-portal-menu", Mr = 10, zr = (n, r) => {
372
372
  return () => {
373
373
  clearTimeout(o), window.removeEventListener("scroll", d, { capture: !0 });
374
374
  };
375
- }, [l, w]), V(() => {
376
- if (!l || !w)
375
+ }, [l, g]), Y(() => {
376
+ if (!l || !g)
377
377
  return;
378
378
  const e = () => {
379
379
  y();
@@ -381,24 +381,24 @@ const $r = 240, Wr = "data-dropdown-portal-menu", Mr = 10, zr = (n, r) => {
381
381
  return window.addEventListener("resize", e), () => {
382
382
  window.removeEventListener("resize", e);
383
383
  };
384
- }, [l, w, y]);
385
- const Re = () => {
386
- a || (X((e) => !e), l ? O == null || O() : A == null || A(), J(S.ON_CLICK));
384
+ }, [l, g, y]);
385
+ const ke = () => {
386
+ a || (X((e) => !e), l ? O == null || O() : A == null || A(), J(V.ON_CLICK));
387
387
  }, te = C(() => {
388
- if (n && Array.isArray(r) && D.length > 0 && D.every((t) => x.has(t)))
388
+ if (n && Array.isArray(r) && D.length > 0 && D.every((t) => T.has(t)))
389
389
  return le.label;
390
390
  const e = E.reduce((t, s) => ((Array.isArray(r) && r.includes(s.value) || s.value === r) && t.push(s.label), t), []);
391
- return e.length > 0 ? e.join(", ") : !r && r !== !1 && r !== 0 || Array.isArray(r) && !r.length ? g : typeof r == "string" && r.length > 0 && !g ? r : g || void 0;
391
+ return e.length > 0 ? e.join(", ") : !r && r !== !1 && r !== 0 || Array.isArray(r) && !r.length ? w : typeof r == "string" && r.length > 0 && !w ? r : w || void 0;
392
392
  }, [
393
393
  n,
394
394
  r,
395
395
  D,
396
- x,
396
+ T,
397
397
  le.label,
398
398
  E,
399
- g
399
+ w
400
400
  ]);
401
- V(() => {
401
+ Y(() => {
402
402
  if (de.current) {
403
403
  const { offsetWidth: e, scrollWidth: t } = de.current;
404
404
  ve(t > e);
@@ -407,7 +407,7 @@ const $r = 240, Wr = "data-dropdown-portal-menu", Mr = 10, zr = (n, r) => {
407
407
  }, [te]);
408
408
  const ur = (e) => {
409
409
  const { keyCode: t } = e;
410
- Sr.includes(t) && e.target === e.currentTarget && (e.preventDefault(), e.stopPropagation(), !l && (k(Te), re(), J(S.ON_KEY_DOWN)));
410
+ Vr.includes(t) && e.target === e.currentTarget && (e.preventDefault(), e.stopPropagation(), !l && (x(ze), re(), J(V.ON_KEY_DOWN)));
411
411
  }, fr = (e) => {
412
412
  const { keyCode: t } = e;
413
413
  if (t === p.ENTER_KEY_CODE || t === p.SPACE_KEY_CODE) {
@@ -417,27 +417,27 @@ const $r = 240, Wr = "data-dropdown-portal-menu", Mr = 10, zr = (n, r) => {
417
417
  n && (L.current = _e), Le(s), n || y();
418
418
  return;
419
419
  }
420
- Hr.includes(t) && (e.stopPropagation(), y());
421
- }, Pe = () => /* @__PURE__ */ R("div", { className: _("options-container"), children: [
422
- n && ge && !se(T) && /* @__PURE__ */ R(Ve, { children: [
420
+ Sr.includes(t) && (e.stopPropagation(), y());
421
+ }, Re = () => /* @__PURE__ */ k("div", { className: _("options-container"), children: [
422
+ n && we && !se(z) && /* @__PURE__ */ k(Ye, { children: [
423
423
  /* @__PURE__ */ u(
424
- $e,
424
+ He,
425
425
  {
426
426
  option: le,
427
- selected: Array.isArray(r) && D.length > 0 && D.every((e) => x.has(e)),
427
+ selected: Array.isArray(r) && D.length > 0 && D.every((e) => T.has(e)),
428
428
  onChange: sr,
429
429
  multiSelect: n,
430
- isPartiallyChecked: D.some((e) => x.has(e)) && !D.every((e) => x.has(e))
430
+ isPartiallyChecked: D.some((e) => T.has(e)) && !D.every((e) => T.has(e))
431
431
  }
432
432
  ),
433
433
  /* @__PURE__ */ u("div", { className: _("divider") }),
434
434
  " "
435
435
  ] }),
436
- se(T) ? /* @__PURE__ */ u("div", { className: _("empty-list-message"), children: Ge }) : T.map(({ option: e, depth: t }, s) => {
436
+ se(z) ? /* @__PURE__ */ u("div", { className: _("empty-list-message"), children: Ge }) : z.map(({ option: e, depth: t }, s) => {
437
437
  var f, b;
438
- const i = ee.get(e.value) ?? [e.value], d = n && i.every((Y) => x.has(Y)), o = n && ((f = e.children) == null ? void 0 : f.length) && i.some((Y) => x.has(Y)) && !d;
438
+ const i = ee.get(e.value) ?? [e.value], d = n && i.every((P) => T.has(P)), o = n && ((f = e.children) == null ? void 0 : f.length) && i.some((P) => T.has(P)) && !d;
439
439
  return /* @__PURE__ */ u(
440
- $e,
440
+ He,
441
441
  {
442
442
  ...cr({
443
443
  item: e,
@@ -446,10 +446,10 @@ const $r = 240, Wr = "data-dropdown-portal-menu", Mr = 10, zr = (n, r) => {
446
446
  multiSelect: n,
447
447
  selected: n ? d : e.value === r,
448
448
  option: { title: e.label, ...e },
449
- highlightHovered: _e === s && rr !== S.ON_CLICK,
449
+ highlightHovered: _e === s && rr !== V.ON_CLICK,
450
450
  render: q,
451
451
  onChange: e.disabled ? null : () => Le(e),
452
- onMouseEnter: () => k(s),
452
+ onMouseEnter: () => x(s),
453
453
  depth: t,
454
454
  hasChildren: !!((b = e.children) != null && b.length),
455
455
  isPartiallyChecked: o
@@ -457,20 +457,20 @@ const $r = 240, Wr = "data-dropdown-portal-menu", Mr = 10, zr = (n, r) => {
457
457
  e.value
458
458
  );
459
459
  }),
460
- G && /* @__PURE__ */ R(Ve, { children: [
460
+ G && /* @__PURE__ */ k(Ye, { children: [
461
461
  /* @__PURE__ */ u("div", { className: _("divider") }),
462
462
  typeof G == "function" ? G(y) : G
463
463
  ] })
464
464
  ] }), hr = () => {
465
465
  const e = De.reduce((o, f) => (Array.isArray(r) && r.includes(f.value) && o.push(f.label), o), []), t = (o) => {
466
466
  const f = De.find(
467
- ({ label: gr }) => gr === o
467
+ ({ label: wr }) => wr === o
468
468
  );
469
469
  if (!f)
470
470
  return;
471
- const b = Array.isArray(r) ? r : [], Y = new Set(b);
472
- Y.delete(f.value);
473
- const mr = z(Y);
471
+ const b = Array.isArray(r) ? r : [], P = new Set(b);
472
+ P.delete(f.value);
473
+ const mr = M(P);
474
474
  m(Array.from(mr));
475
475
  }, s = (o) => {
476
476
  const f = o.target;
@@ -495,18 +495,18 @@ const $r = 240, Wr = "data-dropdown-portal-menu", Mr = 10, zr = (n, r) => {
495
495
  onClick: (o) => {
496
496
  o.stopPropagation(), re();
497
497
  },
498
- placeholder: se(e) ? g : "",
498
+ placeholder: se(e) ? w : "",
499
499
  autoComplete: "off"
500
500
  }
501
501
  );
502
- return se(e) ? /* @__PURE__ */ u("div", { className: _("tags-wrapper", "with-search"), children: d }) : /* @__PURE__ */ R("div", { className: _("tags-wrapper", "with-search"), children: [
502
+ return se(e) ? /* @__PURE__ */ u("div", { className: _("tags-wrapper", "with-search"), children: d }) : /* @__PURE__ */ k("div", { className: _("tags-wrapper", "with-search"), children: [
503
503
  /* @__PURE__ */ u(
504
504
  Lr,
505
505
  {
506
506
  tags: e,
507
507
  onRemoveTag: t,
508
508
  isShowAllView: !0,
509
- defaultVisibleLines: Mr
509
+ defaultVisibleLines: Wr
510
510
  }
511
511
  ),
512
512
  d
@@ -514,13 +514,13 @@ const $r = 240, Wr = "data-dropdown-portal-menu", Mr = 10, zr = (n, r) => {
514
514
  }, _r = () => {
515
515
  if (v && n && Array.isArray(r))
516
516
  return hr();
517
- const e = we ? we(te) : te, t = Ne && !!e && er;
517
+ const e = ge ? ge(te) : te, t = Ne && !!e && er;
518
518
  return /* @__PURE__ */ u(
519
519
  "span",
520
520
  {
521
521
  ref: de,
522
522
  className: _("value", {
523
- placeholder: te === g
523
+ placeholder: te === w
524
524
  }),
525
525
  title: t ? e : void 0,
526
526
  children: e
@@ -536,16 +536,16 @@ const $r = 240, Wr = "data-dropdown-portal-menu", Mr = 10, zr = (n, r) => {
536
536
  "mobile-disabled": F,
537
537
  "multi-select-with-tags": v
538
538
  }),
539
- onClick: Re,
539
+ onClick: ke,
540
540
  onKeyDown: ur,
541
- ref: P.setReference
542
- }), { type: ot, ...Ye } = pr;
543
- return /* @__PURE__ */ R(
541
+ ref: R.setReference
542
+ }), { type: ot, ...Pe } = pr;
543
+ return /* @__PURE__ */ k(
544
544
  "div",
545
545
  {
546
546
  ref: Ae,
547
547
  className: _("container", ie),
548
- title: H,
548
+ title: S,
549
549
  ...Qe,
550
550
  ...Je,
551
551
  children: [
@@ -553,18 +553,18 @@ const $r = 240, Wr = "data-dropdown-portal-menu", Mr = 10, zr = (n, r) => {
553
553
  Kr,
554
554
  {
555
555
  ...lr(),
556
- onClick: () => !a && Re(),
556
+ onClick: () => !a && ke(),
557
557
  style: { cursor: a ? "default" : "pointer" },
558
558
  children: j
559
559
  }
560
560
  ),
561
- /* @__PURE__ */ R(
561
+ /* @__PURE__ */ k(
562
562
  "div",
563
563
  {
564
- ...Ye,
564
+ ...Pe,
565
565
  role: "button",
566
566
  "aria-disabled": a,
567
- tabIndex: a ? -1 : Ye.tabIndex ?? 0,
567
+ tabIndex: a ? -1 : Pe.tabIndex ?? 0,
568
568
  children: [
569
569
  B && /* @__PURE__ */ u("span", { className: _("icon"), children: B }),
570
570
  /* @__PURE__ */ u("div", { className: _("value-wrapper"), children: _r() }),
@@ -587,7 +587,7 @@ const $r = 240, Wr = "data-dropdown-portal-menu", Mr = 10, zr = (n, r) => {
587
587
  ),
588
588
  l && (() => {
589
589
  var i;
590
- const e = (i = P.reference.current) == null ? void 0 : i.getBoundingClientRect().width, t = w && e ? {
590
+ const e = (i = R.reference.current) == null ? void 0 : i.getBoundingClientRect().width, t = g && e ? {
591
591
  ...Ie,
592
592
  width: `${e}px`,
593
593
  minWidth: `${e}px`,
@@ -604,7 +604,7 @@ const $r = 240, Wr = "data-dropdown-portal-menu", Mr = 10, zr = (n, r) => {
604
604
  },
605
605
  Ue
606
606
  ),
607
- ...w && { [Wr]: "" },
607
+ ...g && { [$r]: "" },
608
608
  ...dr({
609
609
  onKeyDown: fr,
610
610
  ...v && {
@@ -615,22 +615,22 @@ const $r = 240, Wr = "data-dropdown-portal-menu", Mr = 10, zr = (n, r) => {
615
615
  }
616
616
  }
617
617
  }),
618
- children: $ ? Pe() : /* @__PURE__ */ u(
618
+ children: H ? Re() : /* @__PURE__ */ u(
619
619
  Dr,
620
620
  {
621
621
  autoHeight: !0,
622
- autoHeightMax: $r,
622
+ autoHeightMax: Hr,
623
623
  hideTracksWhenNotNeeded: !0,
624
624
  ref: (d) => {
625
- W.current = d;
625
+ $.current = d;
626
626
  },
627
627
  onScrollFrame: nr,
628
- children: Pe()
628
+ children: Re()
629
629
  }
630
630
  )
631
631
  }
632
632
  );
633
- return w ? Er(s, w) : s;
633
+ return g ? Er(s, g) : s;
634
634
  })()
635
635
  ]
636
636
  }
@@ -638,5 +638,5 @@ const $r = 240, Wr = "data-dropdown-portal-menu", Mr = 10, zr = (n, r) => {
638
638
  };
639
639
  export {
640
640
  At as D,
641
- Wr as a
641
+ $r as a
642
642
  };