@reportportal/ui-kit 0.0.1-alpha.129 → 0.0.1-alpha.130

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,41 +1,41 @@
1
- import { jsxs as L, jsx as d, Fragment as Te } from "react/jsx-runtime";
2
- import { forwardRef as or, useState as ie, useRef as K, useMemo as O, useCallback as N, useLayoutEffect as Ie, useEffect as Q } from "react";
3
- import { createPortal as ar } from "react-dom";
1
+ import { jsxs as L, jsx as d, Fragment as Ie } from "react/jsx-runtime";
2
+ import { forwardRef as sr, useState as le, useRef as K, useMemo as O, useCallback as N, useLayoutEffect as Te, useEffect as J } from "react";
3
+ import { createPortal as or } from "react-dom";
4
4
  import { c as Le } from "./bind-06a7ff84.js";
5
- import { useFloating as lr, offset as ir, flip as cr, size as dr, autoUpdate as ur } from "@floating-ui/react-dom";
6
- import { useSelect as ce } from "downshift";
7
- import { Scrollbars as fr } from "rc-scrollbars";
5
+ import { useFloating as ar, offset as lr, flip as ir, size as cr, autoUpdate as dr } from "@floating-ui/react-dom";
6
+ import { useSelect as ie } from "downshift";
7
+ import { Scrollbars as ur } from "rc-scrollbars";
8
8
  import { K as E } from "./keyCodes-f63c0e11.js";
9
- import { B as hr } from "./baseIconButton-251479f7.js";
10
- import { S as _r } from "./clear-53660571.js";
11
- import { S as pr } from "./dropdown-0260bb66.js";
12
- import { Tooltip as gr } from "./tooltip.js";
13
- import { FieldLabel as wr } from "./fieldLabel.js";
14
- import { C as mr } from "./checkbox-ed6cc375.js";
15
- const yr = "_disabled_14s7v_12", Er = "_hidden_14s7v_16", vr = "_hover_14s7v_22", Cr = "_selected_14s7v_38", Or = {
9
+ import { B as fr } from "./baseIconButton-251479f7.js";
10
+ import { S as hr } from "./clear-53660571.js";
11
+ import { S as _r } from "./dropdown-0260bb66.js";
12
+ import { Tooltip as pr } from "./tooltip.js";
13
+ import { FieldLabel as gr } from "./fieldLabel.js";
14
+ import { C as wr } from "./checkbox-ed6cc375.js";
15
+ const mr = "_disabled_14s7v_12", yr = "_hidden_14s7v_16", Er = "_hover_14s7v_22", vr = "_selected_14s7v_38", Cr = {
16
16
  "dropdown-option": "_dropdown-option_14s7v_1",
17
- disabled: yr,
18
- hidden: Er,
19
- hover: vr,
17
+ disabled: mr,
18
+ hidden: yr,
19
+ hover: Er,
20
20
  "depth-1": "_depth-1_14s7v_32",
21
- selected: Cr,
21
+ selected: vr,
22
22
  "multi-select": "_multi-select_14s7v_38",
23
23
  "single-option": "_single-option_14s7v_43",
24
24
  "sub-option": "_sub-option_14s7v_50"
25
- }, xe = Le.bind(Or), Ke = or(
25
+ }, xe = Le.bind(Cr), Ke = sr(
26
26
  (n, t) => {
27
27
  const {
28
- option: { value: l, disabled: a, hidden: u, label: _, title: v, groupRef: g },
28
+ option: { value: l, disabled: o, hidden: u, label: _, title: v, groupRef: g },
29
29
  selected: V,
30
30
  onChange: Y,
31
31
  render: W,
32
32
  highlightHovered: S,
33
- onMouseEnter: Z,
33
+ onMouseEnter: Q,
34
34
  multiSelect: D,
35
35
  isPartiallyChecked: H = !1,
36
36
  depth: $ = 0,
37
- hasChildren: ee = !1
38
- } = n, re = (z) => {
37
+ hasChildren: Z = !1
38
+ } = n, ee = (z) => {
39
39
  (z.target instanceof HTMLDivElement || z.target instanceof HTMLInputElement) && (Y == null || Y(l));
40
40
  };
41
41
  return /* @__PURE__ */ L(
@@ -43,19 +43,19 @@ const yr = "_disabled_14s7v_12", Er = "_hidden_14s7v_16", vr = "_hover_14s7v_22"
43
43
  {
44
44
  className: xe("dropdown-option", {
45
45
  selected: V,
46
- disabled: a,
46
+ disabled: o,
47
47
  hidden: u,
48
48
  hover: S,
49
49
  "multi-select": D,
50
- "has-children": ee,
50
+ "has-children": Z,
51
51
  [`depth-${$}`]: $ > 0
52
52
  }),
53
53
  title: v,
54
- onClick: re,
54
+ onClick: ee,
55
55
  ref: t,
56
- onMouseEnter: Z,
56
+ onMouseEnter: Q,
57
57
  children: [
58
- D && /* @__PURE__ */ d(mr, { value: !!V, partiallyChecked: H }),
58
+ D && /* @__PURE__ */ d(wr, { value: !!V, partiallyChecked: H }),
59
59
  /* @__PURE__ */ d(
60
60
  "div",
61
61
  {
@@ -69,62 +69,62 @@ const yr = "_disabled_14s7v_12", Er = "_hidden_14s7v_16", vr = "_hover_14s7v_22"
69
69
  }
70
70
  );
71
71
  }
72
- ), Nr = [
72
+ ), Or = [
73
73
  E.ENTER_KEY_CODE,
74
74
  E.SPACE_KEY_CODE,
75
75
  E.ARROW_DOWN_KEY_CODE
76
- ], Dr = [E.ESCAPE_KEY_CODE, E.TAB_KEY_CODE];
76
+ ], Nr = [E.ESCAPE_KEY_CODE, E.TAB_KEY_CODE];
77
77
  var k = /* @__PURE__ */ ((n) => (n.ON_KEY_DOWN = "onKeyDown", n.ON_CLICK = "onClick", n))(k || {});
78
- const br = 216, Ar = "data-dropdown-portal-menu", Tr = (n, t) => {
78
+ const Dr = 216, Ar = "data-dropdown-portal-menu", br = (n, t) => {
79
79
  const l = Array.isArray(t) ? t : [t];
80
- return n.findIndex(({ value: a }) => l.includes(a));
81
- }, Ir = (n, t) => (n % t + t) % t, de = (n, t = 0, l = 1) => {
80
+ return n.findIndex(({ value: o }) => l.includes(o));
81
+ }, Ir = (n, t) => (n % t + t) % t, ce = (n, t = 0, l = 1) => {
82
82
  var u;
83
83
  if (n.length === 0)
84
84
  return 0;
85
85
  if (!((u = n[t]) != null && u.disabled))
86
86
  return t;
87
- const a = n.length;
88
- return de(
87
+ const o = n.length;
88
+ return ce(
89
89
  n,
90
- Ir(t + l, a),
90
+ Ir(t + l, o),
91
91
  l
92
92
  );
93
- }, xr = (n, t) => de(n, t), Kr = (n, t) => de(n, t, -1), ke = (n, t = 0, l) => !n || n.length === 0 ? [] : n.reduce((a, u) => {
93
+ }, Tr = (n, t) => ce(n, t), xr = (n, t) => ce(n, t, -1), ke = (n, t = 0, l) => !n || n.length === 0 ? [] : n.reduce((o, u) => {
94
94
  var _;
95
- return u && (a.push({ option: u, depth: t, parent: l }), (_ = u.children) != null && _.length && a.push(...ke(u.children, t + 1, u))), a;
95
+ return u && (o.push({ option: u, depth: t, parent: l }), (_ = u.children) != null && _.length && o.push(...ke(u.children, t + 1, u))), o;
96
96
  }, []), Ye = (n) => !n || n.length === 0 ? [] : n.reduce((t, l) => {
97
- var a;
98
- return l && ((a = l.children) != null && a.length ? t.push(...Ye(l.children)) : t.push(l)), t;
97
+ var o;
98
+ return l && ((o = l.children) != null && o.length ? t.push(...Ye(l.children)) : t.push(l)), t;
99
99
  }, []), Pe = (n) => {
100
100
  var t;
101
- return n ? (t = n.children) != null && t.length ? n.children.reduce((l, a) => (a && l.push(...Pe(a)), l), []) : [n.value] : [];
102
- }, Lr = "_container_owe49_1", kr = "_icon_owe49_7", Yr = "_arrow_owe49_13", Pr = "_dropdown_owe49_27", Mr = "_disabled_owe49_44", Rr = "_value_owe49_51", Vr = "_error_owe49_54", Wr = "_touched_owe49_54", Sr = "_opened_owe49_58", Hr = "_placeholder_owe49_93", $r = "_ghost_owe49_139", zr = "_divider_owe49_160", Br = {
103
- container: Lr,
104
- icon: kr,
105
- arrow: Yr,
101
+ return n ? (t = n.children) != null && t.length ? n.children.reduce((l, o) => (o && l.push(...Pe(o)), l), []) : [n.value] : [];
102
+ }, Kr = "_container_owe49_1", Lr = "_icon_owe49_7", kr = "_arrow_owe49_13", Yr = "_dropdown_owe49_27", Pr = "_disabled_owe49_44", Mr = "_value_owe49_51", Rr = "_error_owe49_54", Vr = "_touched_owe49_54", Wr = "_opened_owe49_58", Sr = "_placeholder_owe49_93", Hr = "_ghost_owe49_139", $r = "_divider_owe49_160", zr = {
103
+ container: Kr,
104
+ icon: Lr,
105
+ arrow: kr,
106
106
  "clear-button": "_clear-button_owe49_19",
107
- dropdown: Pr,
107
+ dropdown: Yr,
108
108
  "transparent-background": "_transparent-background_owe49_41",
109
- disabled: Mr,
110
- value: Rr,
111
- error: Vr,
112
- touched: Wr,
113
- opened: Sr,
114
- placeholder: Hr,
109
+ disabled: Pr,
110
+ value: Mr,
111
+ error: Rr,
112
+ touched: Vr,
113
+ opened: Wr,
114
+ placeholder: Sr,
115
115
  "mobile-disabled": "_mobile-disabled_owe49_97",
116
116
  "value-wrapper": "_value-wrapper_owe49_102",
117
117
  "value-tooltip": "_value-tooltip_owe49_108",
118
118
  "select-list": "_select-list_owe49_113",
119
119
  "limited-width": "_limited-width_owe49_130",
120
120
  "options-container": "_options-container_owe49_134",
121
- ghost: $r,
122
- divider: zr
123
- }, f = Le.bind(Br), at = ({
121
+ ghost: Hr,
122
+ divider: $r
123
+ }, f = Le.bind(zr), ot = ({
124
124
  multiSelect: n = !1,
125
125
  value: t = n ? [] : "",
126
126
  options: l = [],
127
- disabled: a = !1,
127
+ disabled: o = !1,
128
128
  error: u,
129
129
  onChange: _,
130
130
  onFocus: v,
@@ -133,40 +133,40 @@ const br = 216, Ar = "data-dropdown-portal-menu", Tr = (n, t) => {
133
133
  title: Y,
134
134
  touched: W = !1,
135
135
  icon: S,
136
- variant: Z,
136
+ variant: Q,
137
137
  placeholder: D = "",
138
138
  label: H = "",
139
139
  renderOption: $,
140
- transparentBackground: ee = !1,
141
- className: re,
140
+ transparentBackground: Z = !1,
141
+ className: ee,
142
142
  toggleButtonClassName: z,
143
143
  selectListClassName: Me,
144
144
  isListWidthLimited: Re = !1,
145
- optionAll: te = { value: "all", label: "All" },
146
- isOptionAllVisible: ue = !1,
145
+ optionAll: re = { value: "all", label: "All" },
146
+ isOptionAllVisible: de = !1,
147
147
  onSelectAll: Ve = () => {
148
148
  },
149
- formatDisplayedValue: fe,
149
+ formatDisplayedValue: ue,
150
150
  notScrollable: P = !1,
151
151
  footer: B,
152
- includeGroupValue: he = !1,
152
+ includeGroupValue: fe = !1,
153
153
  clearable: We = !1,
154
- onClear: _e = () => {
154
+ onClear: he = () => {
155
155
  },
156
156
  clearButtonAriaLabel: Se = "Clear selection",
157
157
  tooltipPortalRoot: He,
158
158
  tooltipZIndex: $e,
159
159
  menuPortalRoot: h
160
160
  }) => {
161
- const [i, U] = ie(!1), pe = K(null), ge = K(null), M = K(null), ne = K(0), se = K(null), [ze, we] = ie(!1), [Be, j] = ie(null), b = K(null), R = O(() => ke(l), [l]), p = O(
161
+ const [i, U] = le(!1), _e = K(null), pe = K(null), M = K(null), te = K(0), ne = K(null), [ze, ge] = le(!1), [Be, j] = le(null), A = K(null), R = O(() => ke(l), [l]), p = O(
162
162
  () => R.map(({ option: e }) => e),
163
163
  [R]
164
164
  ), q = O(() => R.filter(({ option: e }) => {
165
165
  var r;
166
166
  return (r = e.children) == null ? void 0 : r.length;
167
- }).map(({ option: e }) => e), [R]), me = O(() => Ye(l), [l]), w = O(
168
- () => me.map(({ value: e }) => e),
169
- [me]
167
+ }).map(({ option: e }) => e), [R]), we = O(() => Ye(l), [l]), w = O(
168
+ () => we.map(({ value: e }) => e),
169
+ [we]
170
170
  ), F = O(() => {
171
171
  const e = /* @__PURE__ */ new Map();
172
172
  return q.forEach((r) => {
@@ -174,28 +174,28 @@ const br = 216, Ar = "data-dropdown-portal-menu", Tr = (n, t) => {
174
174
  }), e;
175
175
  }, [q]), X = N(
176
176
  (e) => (q.forEach((r) => {
177
- const s = F.get(r.value) ?? [], o = s.length > 0 && s.every((c) => e.has(c));
178
- he && o ? e.add(r.value) : e.delete(r.value);
177
+ const s = F.get(r.value) ?? [], a = s.length > 0 && s.every((c) => e.has(c));
178
+ fe && a ? e.add(r.value) : e.delete(r.value);
179
179
  }), e),
180
- [q, he, F]
181
- ), A = O(() => !n || !Array.isArray(t) ? /* @__PURE__ */ new Set() : X(new Set(t)), [n, t, X]), ye = n ? Array.isArray(t) && t.length > 0 : t || t === !1 || t === 0, Ue = We && ye && !a, je = N((e) => {
182
- ne.current = e.scrollTop;
180
+ [q, fe, F]
181
+ ), b = O(() => !n || !Array.isArray(t) ? /* @__PURE__ */ new Set() : X(new Set(t)), [n, t, X]), me = n ? Array.isArray(t) && t.length > 0 : t || t === !1 || t === 0, Ue = We && me && !o, je = N((e) => {
182
+ te.current = e.scrollTop;
183
183
  }, []);
184
- Ie(() => {
185
- i && !P && M.current && !(n && b.current !== null) && M.current.scrollTop(ne.current);
184
+ Te(() => {
185
+ i && !P && M.current && !(n && A.current !== null) && M.current.scrollTop(te.current);
186
186
  }, [i, P, t, n]);
187
- const { refs: I, floatingStyles: Ee } = lr({
187
+ const { refs: T, floatingStyles: ye } = ar({
188
188
  placement: "bottom-start",
189
189
  middleware: [
190
- ir(5),
191
- cr({
190
+ lr(5),
191
+ ir({
192
192
  fallbackPlacements: ["bottom-start", "top-start", "bottom", "top"],
193
193
  ...h && {
194
194
  boundary: document.documentElement,
195
195
  rootBoundary: "viewport"
196
196
  }
197
197
  }),
198
- h ? dr({
198
+ h ? cr({
199
199
  apply({ rects: e, elements: r }) {
200
200
  const s = e.reference.width;
201
201
  Object.assign(r.floating.style, {
@@ -206,33 +206,33 @@ const br = 216, Ar = "data-dropdown-portal-menu", Tr = (n, t) => {
206
206
  }
207
207
  }) : null
208
208
  ].filter(Boolean),
209
- whileElementsMounted: i && h ? (e, r, s) => ur(e, r, s, {
209
+ whileElementsMounted: i && h ? (e, r, s) => dr(e, r, s, {
210
210
  animationFrame: !0
211
211
  }) : void 0
212
212
  }), qe = () => {
213
- if (!ue)
213
+ if (!de)
214
214
  return;
215
215
  const e = Array.isArray(t) ? t : [], r = new Set(e), s = w.some((c) => !r.has(c));
216
216
  w.forEach((c) => {
217
217
  s ? r.add(c) : r.delete(c);
218
218
  });
219
- const o = X(r);
220
- _(Array.from(o)), Ve();
219
+ const a = X(r);
220
+ _(Array.from(a)), Ve();
221
221
  }, m = N(() => {
222
222
  U(!1), g == null || g();
223
- }, [g]), oe = N(() => {
224
- if (a)
223
+ }, [g]), se = N(() => {
224
+ if (o)
225
225
  return;
226
- _(n ? [] : ""), _e(), m(), requestAnimationFrame(() => {
227
- const r = I.reference.current;
226
+ _(n ? [] : ""), he(), m(), requestAnimationFrame(() => {
227
+ const r = T.reference.current;
228
228
  r && r instanceof HTMLElement && r.focus();
229
229
  });
230
- }, [a, n, _, _e, m, I]), Fe = N(
230
+ }, [o, n, _, he, m, T]), Fe = N(
231
231
  (e) => {
232
- e.preventDefault(), e.stopPropagation(), oe();
232
+ e.preventDefault(), e.stopPropagation(), se();
233
233
  },
234
- [oe]
235
- ), ve = N(
234
+ [se]
235
+ ), Ee = N(
236
236
  (e) => {
237
237
  var c, y;
238
238
  if (!i)
@@ -240,98 +240,97 @@ const br = 216, Ar = "data-dropdown-portal-menu", Tr = (n, t) => {
240
240
  const r = e == null ? void 0 : e.target;
241
241
  if (!r)
242
242
  return;
243
- const s = (c = pe.current) == null ? void 0 : c.contains(r), o = (y = ge.current) == null ? void 0 : y.contains(r);
244
- !s && !o && m();
243
+ const s = (c = _e.current) == null ? void 0 : c.contains(r), a = (y = pe.current) == null ? void 0 : y.contains(r);
244
+ !s && !a && m();
245
245
  },
246
246
  [i, m]
247
247
  );
248
- Q(() => {
248
+ J(() => {
249
249
  if (!i)
250
250
  return;
251
251
  const e = (r) => {
252
- ve(r);
252
+ Ee(r);
253
253
  };
254
254
  return document.addEventListener("pointerdown", e), () => {
255
255
  document.removeEventListener("pointerdown", e);
256
256
  };
257
- }, [i, ve]);
258
- const Ce = (e) => {
257
+ }, [i, Ee]);
258
+ const ve = (e) => {
259
259
  var r;
260
260
  if (!e.disabled) {
261
261
  if (n) {
262
- const s = Array.isArray(t) ? t : [], o = new Set(s);
262
+ const s = Array.isArray(t) ? t : [], a = new Set(s);
263
263
  if ((r = e.children) != null && r.length) {
264
- const y = F.get(e.value) ?? [], C = y.some((T) => !o.has(T));
265
- y.forEach((T) => {
266
- C ? o.add(T) : o.delete(T);
264
+ const y = F.get(e.value) ?? [], C = y.some((I) => !a.has(I));
265
+ y.forEach((I) => {
266
+ C ? a.add(I) : a.delete(I);
267
267
  });
268
268
  } else
269
- o.has(e.value) ? o.delete(e.value) : o.add(e.value);
270
- const c = X(o);
269
+ a.has(e.value) ? a.delete(e.value) : a.add(e.value);
270
+ const c = X(a);
271
271
  _(Array.from(c));
272
272
  } else
273
273
  _(e.value);
274
274
  U((s) => n || !s);
275
275
  }
276
- }, Xe = () => p.find(({ value: e }) => e === t), Oe = Tr(p, t), {
276
+ }, Xe = () => p.find(({ value: e }) => e === t), Ce = br(p, t), {
277
277
  getToggleButtonProps: Ge,
278
278
  getLabelProps: Je,
279
- getMenuProps: Ne,
279
+ getMenuProps: Oe,
280
280
  getItemProps: Qe,
281
281
  setHighlightedIndex: x,
282
- highlightedIndex: ae,
283
- selectedItem: G
284
- } = ce({
282
+ highlightedIndex: oe
283
+ } = ie({
285
284
  items: p,
286
285
  itemToString: (e) => (e != null && e.label ? String(e.label) : D) || "",
287
286
  selectedItem: Xe(),
288
287
  isOpen: i,
289
288
  circularNavigation: !0,
290
- defaultHighlightedIndex: Oe,
289
+ defaultHighlightedIndex: Ce,
291
290
  onHighlightedIndexChange: (e) => {
292
291
  switch (e.type) {
293
- case ce.stateChangeTypes.MenuKeyDownArrowUp:
294
- return j(k.ON_KEY_DOWN), x(Kr(p, e.highlightedIndex)), e;
295
- case ce.stateChangeTypes.MenuKeyDownArrowDown:
292
+ case ie.stateChangeTypes.MenuKeyDownArrowUp:
296
293
  return j(k.ON_KEY_DOWN), x(xr(p, e.highlightedIndex)), e;
294
+ case ie.stateChangeTypes.MenuKeyDownArrowDown:
295
+ return j(k.ON_KEY_DOWN), x(Tr(p, e.highlightedIndex)), e;
297
296
  default:
298
297
  return e;
299
298
  }
300
299
  }
301
- }), De = N(
300
+ }), Ne = N(
302
301
  (e) => {
303
- ge.current = e, I.setFloating(e);
302
+ pe.current = e, T.setFloating(e);
304
303
  },
305
- [I]
304
+ [T]
306
305
  ), Ze = N(
307
306
  (e = {}) => {
308
- const r = Ne(e), s = r.ref;
307
+ const r = Oe(e), s = r.ref;
309
308
  return {
310
309
  ...r,
311
- ref: (o) => {
312
- De(o), typeof s == "function" ? s(o) : s && (s.current = o);
310
+ ref: (a) => {
311
+ Ne(a), typeof s == "function" ? s(a) : s && (s.current = a);
313
312
  }
314
313
  };
315
314
  },
316
- [Ne, De]
315
+ [Oe, Ne]
317
316
  );
318
- Q(() => {
319
- n && i && b.current !== null && b.current >= 0 && b.current < p.length && (x(b.current), b.current = null, requestAnimationFrame(() => {
320
- M.current && !P && M.current.scrollTop(ne.current);
317
+ J(() => {
318
+ n && i && A.current !== null && A.current >= 0 && A.current < p.length && (x(A.current), A.current = null, requestAnimationFrame(() => {
319
+ M.current && !P && M.current.scrollTop(te.current);
321
320
  }));
322
- }, [n, i, t, p.length, x, P]), Ie(() => {
321
+ }, [n, i, t, p.length, x, P]), Te(() => {
323
322
  if (!i || !h)
324
323
  return;
325
324
  let e = window.scrollY, r = !0;
326
- const s = 300, o = () => {
325
+ const s = 300, a = () => {
327
326
  if (!r)
328
327
  return;
329
328
  window.scrollY !== e && window.scrollTo(0, e);
330
329
  }, c = (C) => {
331
- r && (C.preventDefault(), C.stopImmediatePropagation(), o());
330
+ r && (C.preventDefault(), C.stopImmediatePropagation(), a());
332
331
  };
333
332
  e = window.scrollY, window.addEventListener("scroll", c, { passive: !1, capture: !0 }), requestAnimationFrame(() => {
334
- e = window.scrollY, o();
333
+ e = window.scrollY, a();
335
334
  });
336
335
  const y = setTimeout(() => {
337
336
  r = !1;
@@ -339,7 +338,7 @@ const br = 216, Ar = "data-dropdown-portal-menu", Tr = (n, t) => {
339
338
  return () => {
340
339
  clearTimeout(y), window.removeEventListener("scroll", c, { capture: !0 });
341
340
  };
342
- }, [i, h]), Q(() => {
341
+ }, [i, h]), J(() => {
343
342
  if (!i || !h)
344
343
  return;
345
344
  const e = () => {
@@ -349,11 +348,11 @@ const br = 216, Ar = "data-dropdown-portal-menu", Tr = (n, t) => {
349
348
  window.removeEventListener("resize", e);
350
349
  };
351
350
  }, [i, h, m]);
352
- const er = () => {
353
- a || (U((e) => !e), i ? g == null || g() : v == null || v(), j(k.ON_CLICK));
354
- }, J = O(() => {
355
- if (n && Array.isArray(t) && w.length > 0 && w.every((r) => A.has(r)))
356
- return te.label;
351
+ const De = () => {
352
+ o || (U((e) => !e), i ? g == null || g() : v == null || v(), j(k.ON_CLICK));
353
+ }, G = O(() => {
354
+ if (n && Array.isArray(t) && w.length > 0 && w.every((r) => b.has(r)))
355
+ return re.label;
357
356
  const e = p.reduce((r, s) => ((Array.isArray(t) && t.includes(s.value) || s.value === t) && r.push(s.label), r), []);
358
357
  if (e.length > 0)
359
358
  return e.join(", ");
@@ -363,49 +362,49 @@ const br = 216, Ar = "data-dropdown-portal-menu", Tr = (n, t) => {
363
362
  n,
364
363
  t,
365
364
  w,
366
- A,
367
- te.label,
365
+ b,
366
+ re.label,
368
367
  p,
369
368
  D
370
369
  ]);
371
- Q(() => {
372
- if (se.current) {
373
- const { offsetWidth: e, scrollWidth: r } = se.current;
374
- we(r > e);
370
+ J(() => {
371
+ if (ne.current) {
372
+ const { offsetWidth: e, scrollWidth: r } = ne.current;
373
+ ge(r > e);
375
374
  } else
376
- we(!1);
377
- }, [J]);
378
- const rr = (e) => {
375
+ ge(!1);
376
+ }, [G]);
377
+ const er = (e) => {
379
378
  const { keyCode: r } = e;
380
- Nr.includes(r) && e.target === e.currentTarget && (e.preventDefault(), e.stopPropagation(), !i && (x(Oe), U(!0), v == null || v(), j(k.ON_KEY_DOWN)));
381
- }, tr = (e) => {
379
+ Or.includes(r) && e.target === e.currentTarget && (e.preventDefault(), e.stopPropagation(), !i && (x(Ce), U(!0), v == null || v(), j(k.ON_KEY_DOWN)));
380
+ }, rr = (e) => {
382
381
  const { keyCode: r } = e;
383
382
  if (r === E.ENTER_KEY_CODE || r === E.SPACE_KEY_CODE) {
384
- const s = p[ae];
383
+ const s = p[oe];
385
384
  if (!s)
386
385
  return;
387
- n && (b.current = ae), Ce(s), n || m();
386
+ n && (A.current = oe), ve(s), n || m();
388
387
  return;
389
388
  }
390
- Dr.includes(r) && (e.stopPropagation(), m());
391
- }, be = () => /* @__PURE__ */ L("div", { className: f("options-container"), children: [
392
- n && ue && /* @__PURE__ */ L(Te, { children: [
389
+ Nr.includes(r) && (e.stopPropagation(), m());
390
+ }, Ae = () => /* @__PURE__ */ L("div", { className: f("options-container"), children: [
391
+ n && de && /* @__PURE__ */ L(Ie, { children: [
393
392
  /* @__PURE__ */ d(
394
393
  Ke,
395
394
  {
396
- option: te,
397
- selected: Array.isArray(t) && w.length > 0 && w.every((e) => A.has(e)),
395
+ option: re,
396
+ selected: Array.isArray(t) && w.length > 0 && w.every((e) => b.has(e)),
398
397
  onChange: qe,
399
398
  multiSelect: n,
400
- isPartiallyChecked: w.some((e) => A.has(e)) && !w.every((e) => A.has(e))
399
+ isPartiallyChecked: w.some((e) => b.has(e)) && !w.every((e) => b.has(e))
401
400
  }
402
401
  ),
403
402
  /* @__PURE__ */ d("div", { className: f("divider") }),
404
403
  " "
405
404
  ] }),
406
405
  R.map(({ option: e, depth: r }, s) => {
407
- var C, T;
408
- const o = F.get(e.value) ?? [e.value], c = n && o.every((le) => A.has(le)), y = n && ((C = e.children) == null ? void 0 : C.length) && o.some((le) => A.has(le)) && !c;
406
+ var C, I;
407
+ const a = F.get(e.value) ?? [e.value], c = n && a.every((ae) => b.has(ae)), y = n && ((C = e.children) == null ? void 0 : C.length) && a.some((ae) => b.has(ae)) && !c;
409
408
  return /* @__PURE__ */ d(
410
409
  Ke,
411
410
  {
@@ -414,36 +413,36 @@ const br = 216, Ar = "data-dropdown-portal-menu", Tr = (n, t) => {
414
413
  index: s
415
414
  }),
416
415
  multiSelect: n,
417
- selected: n ? c : e.value === ((G == null ? void 0 : G.value) ?? G),
416
+ selected: n ? c : e.value === t,
418
417
  option: { title: e.label, ...e },
419
- highlightHovered: ae === s && Be !== k.ON_CLICK,
418
+ highlightHovered: oe === s && Be !== k.ON_CLICK,
420
419
  render: $,
421
- onChange: e.disabled ? null : () => Ce(e),
420
+ onChange: e.disabled ? null : () => ve(e),
422
421
  onMouseEnter: () => x(s),
423
422
  depth: r,
424
- hasChildren: !!((T = e.children) != null && T.length),
423
+ hasChildren: !!((I = e.children) != null && I.length),
425
424
  isPartiallyChecked: y
426
425
  },
427
426
  e.value
428
427
  );
429
428
  }),
430
- B && /* @__PURE__ */ L(Te, { children: [
429
+ B && /* @__PURE__ */ L(Ie, { children: [
431
430
  /* @__PURE__ */ d("div", { className: f("divider") }),
432
431
  typeof B == "function" ? B(m) : B
433
432
  ] })
434
- ] }), nr = () => {
435
- const e = fe ? fe(J) : J, r = /* @__PURE__ */ d(
433
+ ] }), tr = () => {
434
+ const e = ue ? ue(G) : G, r = /* @__PURE__ */ d(
436
435
  "span",
437
436
  {
438
- ref: se,
437
+ ref: ne,
439
438
  className: f("value", {
440
- placeholder: J === D
439
+ placeholder: G === D
441
440
  }),
442
441
  children: e
443
442
  }
444
443
  );
445
- return ye && !!e && ze ? /* @__PURE__ */ d(
446
- gr,
444
+ return me && !!e && ze ? /* @__PURE__ */ d(
445
+ pr,
447
446
  {
448
447
  content: e,
449
448
  placement: "top",
@@ -453,56 +452,64 @@ const br = 216, Ar = "data-dropdown-portal-menu", Tr = (n, t) => {
453
452
  children: r
454
453
  }
455
454
  ) : r;
456
- }, sr = Ge({
457
- className: f("dropdown", Z, z, {
458
- "transparent-background": ee,
455
+ }, nr = Ge({
456
+ className: f("dropdown", Q, z, {
457
+ "transparent-background": Z,
459
458
  opened: i,
460
- disabled: a,
459
+ disabled: o,
461
460
  error: u,
462
461
  touched: W,
463
462
  "mobile-disabled": V
464
463
  }),
465
- onClick: er,
466
- onKeyDown: rr,
467
- ref: I.setReference
468
- }), { type: Ur, ...Ae } = sr;
469
- return /* @__PURE__ */ L("div", { ref: pe, className: f("container", re), title: Y, children: [
470
- H && /* @__PURE__ */ d(wr, { ...Je(), children: H }),
464
+ onClick: De,
465
+ onKeyDown: er,
466
+ ref: T.setReference
467
+ }), { type: Br, ...be } = nr;
468
+ return /* @__PURE__ */ L("div", { ref: _e, className: f("container", ee), title: Y, children: [
469
+ H && /* @__PURE__ */ d(
470
+ gr,
471
+ {
472
+ ...Je(),
473
+ onClick: () => !o && De(),
474
+ style: { cursor: o ? "default" : "pointer" },
475
+ children: H
476
+ }
477
+ ),
471
478
  /* @__PURE__ */ L(
472
479
  "div",
473
480
  {
474
- ...Ae,
481
+ ...be,
475
482
  role: "button",
476
- "aria-disabled": a,
477
- tabIndex: a ? -1 : Ae.tabIndex ?? 0,
483
+ "aria-disabled": o,
484
+ tabIndex: o ? -1 : be.tabIndex ?? 0,
478
485
  children: [
479
486
  S && /* @__PURE__ */ d("span", { className: f("icon"), children: S }),
480
- /* @__PURE__ */ d("div", { className: f("value-wrapper"), children: nr() }),
487
+ /* @__PURE__ */ d("div", { className: f("value-wrapper"), children: tr() }),
481
488
  Ue && /* @__PURE__ */ d(
482
- hr,
489
+ fr,
483
490
  {
484
491
  className: f("clear-button"),
485
492
  onClick: Fe,
486
493
  onKeyDown: (e) => {
487
494
  const { keyCode: r } = e;
488
- (r === E.ENTER_KEY_CODE || r === E.SPACE_KEY_CODE) && (e.preventDefault(), e.stopPropagation(), oe());
495
+ (r === E.ENTER_KEY_CODE || r === E.SPACE_KEY_CODE) && (e.preventDefault(), e.stopPropagation(), se());
489
496
  },
490
497
  "aria-label": Se,
491
- children: /* @__PURE__ */ d(_r, {})
498
+ children: /* @__PURE__ */ d(hr, {})
492
499
  }
493
500
  ),
494
- /* @__PURE__ */ d("span", { className: f("arrow"), "aria-hidden": "true", children: /* @__PURE__ */ d(pr, {}) })
501
+ /* @__PURE__ */ d("span", { className: f("arrow"), "aria-hidden": "true", children: /* @__PURE__ */ d(_r, {}) })
495
502
  ]
496
503
  }
497
504
  ),
498
505
  i && (() => {
499
- var o;
500
- const e = (o = I.reference.current) == null ? void 0 : o.getBoundingClientRect().width, r = h && e ? {
501
- ...Ee,
506
+ var a;
507
+ const e = (a = T.reference.current) == null ? void 0 : a.getBoundingClientRect().width, r = h && e ? {
508
+ ...ye,
502
509
  width: `${e}px`,
503
510
  minWidth: `${e}px`,
504
511
  maxWidth: `${e}px`
505
- } : Ee, s = /* @__PURE__ */ d(
512
+ } : ye, s = /* @__PURE__ */ d(
506
513
  "div",
507
514
  {
508
515
  style: r,
@@ -516,28 +523,28 @@ const br = 216, Ar = "data-dropdown-portal-menu", Tr = (n, t) => {
516
523
  ),
517
524
  ...h && { [Ar]: "" },
518
525
  ...Ze({
519
- onKeyDown: tr
526
+ onKeyDown: rr
520
527
  }),
521
- children: P ? be() : /* @__PURE__ */ d(
522
- fr,
528
+ children: P ? Ae() : /* @__PURE__ */ d(
529
+ ur,
523
530
  {
524
531
  autoHeight: !0,
525
- autoHeightMax: br,
532
+ autoHeightMax: Dr,
526
533
  hideTracksWhenNotNeeded: !0,
527
534
  ref: (c) => {
528
535
  M.current = c;
529
536
  },
530
537
  onScrollFrame: je,
531
- children: be()
538
+ children: Ae()
532
539
  }
533
540
  )
534
541
  }
535
542
  );
536
- return h ? ar(s, h) : s;
543
+ return h ? or(s, h) : s;
537
544
  })()
538
545
  ] });
539
546
  };
540
547
  export {
541
- at as D,
548
+ ot as D,
542
549
  Ar as a
543
550
  };