@reportportal/ui-kit 0.0.1-alpha.172 → 0.0.1-alpha.174

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