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

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,3 +1,6 @@
1
1
  import { RefObject } from 'react';
2
2
 
3
- export declare function useOnClickOutside<T extends HTMLElement = HTMLDivElement>(ref: RefObject<T>, handler?: (e?: MouseEvent) => void): void;
3
+ export interface UseOnClickOutsideOptions {
4
+ ignoreSelectors?: string[];
5
+ }
6
+ export declare function useOnClickOutside<T extends HTMLElement = HTMLDivElement>(ref: RefObject<T>, handler?: (e?: MouseEvent) => void, options?: UseOnClickOutsideOptions): void;
@@ -7,3 +7,4 @@ export declare enum EventName {
7
7
  ON_CLICK = "onClick"
8
8
  }
9
9
  export declare const SCROLLBARS_AUTO_HEIGHT_MAX = 216;
10
+ export declare const DROPDOWN_PORTAL_MENU_ATTR = "data-dropdown-portal-menu";
@@ -44,5 +44,12 @@ export interface DropdownProps {
44
44
  tooltipPortalRoot?: Element;
45
45
  /** Z-index for tooltip when rendered in portal (default: 9) */
46
46
  tooltipZIndex?: number;
47
+ /**
48
+ * Portal root element for dropdown menu rendering.
49
+ * When provided, the menu will be rendered in this element using React Portal.
50
+ * Useful for preventing clipping in containers with overflow: hidden (e.g., Modal, SidePanel).
51
+ * @example menuPortalRoot={document.body}
52
+ */
53
+ menuPortalRoot?: Element;
47
54
  }
48
55
  export declare const Dropdown: FC<DropdownProps>;
@@ -1,4 +1,5 @@
1
1
  import { Dropdown } from './dropdown';
2
2
 
3
3
  export { Dropdown };
4
+ export { DROPDOWN_PORTAL_MENU_ATTR } from './constants';
4
5
  export default Dropdown;
@@ -3,7 +3,7 @@ import B from "react-datepicker/dist/es/index.js";
3
3
  import { c as R } from "./bind-06a7ff84.js";
4
4
  import { useMemo as P, useRef as D } from "react";
5
5
  import { F as I } from "./fieldText-17fcba4f.js";
6
- import { D as E } from "./dropdown-18c58189.js";
6
+ import { D as E } from "./dropdown-a99520ba.js";
7
7
  import { S as T } from "./calendarArrow-44c7e60e.js";
8
8
  import { registerLocale as j } from "react-datepicker";
9
9
  const ie = (n, s) => {
@@ -1,5 +1,5 @@
1
- import { D as t } from "./datePicker-322bcafa.js";
2
- import { r as A } from "./datePicker-322bcafa.js";
1
+ import { D as t } from "./datePicker-12bb6fb4.js";
2
+ import { r as z } from "./datePicker-12bb6fb4.js";
3
3
  import "react/jsx-runtime";
4
4
  import "react-datepicker/dist/es/index.js";
5
5
  import "./bind-06a7ff84.js";
@@ -11,15 +11,14 @@ import "./baseIconButton-251479f7.js";
11
11
  import "./spinLoader-c4a53718.js";
12
12
  import "./maxValueDisplay-9be01a75.js";
13
13
  import "./fieldLabel.js";
14
- import "./dropdown-18c58189.js";
14
+ import "./dropdown-a99520ba.js";
15
+ import "react-dom";
15
16
  import "@floating-ui/react-dom";
16
17
  import "downshift";
17
18
  import "rc-scrollbars";
18
- import "./useOnClickOutside-c332f7d3.js";
19
19
  import "./keyCodes-f63c0e11.js";
20
20
  import "./dropdown-0260bb66.js";
21
21
  import "./tooltip.js";
22
- import "react-dom";
23
22
  import "@floating-ui/react";
24
23
  import "./floatingUi-41f8c7b5.js";
25
24
  import "./checkbox-ed6cc375.js";
@@ -28,5 +27,5 @@ import "react-datepicker";
28
27
  export {
29
28
  t as DatePicker,
30
29
  t as default,
31
- A as registerDatePickerLocale
30
+ z as registerDatePickerLocale
32
31
  };
@@ -0,0 +1,543 @@
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";
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";
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 = {
16
+ "dropdown-option": "_dropdown-option_14s7v_1",
17
+ disabled: yr,
18
+ hidden: Er,
19
+ hover: vr,
20
+ "depth-1": "_depth-1_14s7v_32",
21
+ selected: Cr,
22
+ "multi-select": "_multi-select_14s7v_38",
23
+ "single-option": "_single-option_14s7v_43",
24
+ "sub-option": "_sub-option_14s7v_50"
25
+ }, xe = Le.bind(Or), Ke = or(
26
+ (n, t) => {
27
+ const {
28
+ option: { value: l, disabled: a, hidden: u, label: _, title: v, groupRef: g },
29
+ selected: V,
30
+ onChange: Y,
31
+ render: W,
32
+ highlightHovered: S,
33
+ onMouseEnter: Z,
34
+ multiSelect: D,
35
+ isPartiallyChecked: H = !1,
36
+ depth: $ = 0,
37
+ hasChildren: ee = !1
38
+ } = n, re = (z) => {
39
+ (z.target instanceof HTMLDivElement || z.target instanceof HTMLInputElement) && (Y == null || Y(l));
40
+ };
41
+ return /* @__PURE__ */ L(
42
+ "div",
43
+ {
44
+ className: xe("dropdown-option", {
45
+ selected: V,
46
+ disabled: a,
47
+ hidden: u,
48
+ hover: S,
49
+ "multi-select": D,
50
+ "has-children": ee,
51
+ [`depth-${$}`]: $ > 0
52
+ }),
53
+ title: v,
54
+ onClick: re,
55
+ ref: t,
56
+ onMouseEnter: Z,
57
+ children: [
58
+ D && /* @__PURE__ */ d(mr, { value: !!V, partiallyChecked: H }),
59
+ /* @__PURE__ */ d(
60
+ "div",
61
+ {
62
+ className: xe("single-option", {
63
+ "sub-option": !!g
64
+ }),
65
+ children: W ? W(n) : _
66
+ }
67
+ )
68
+ ]
69
+ }
70
+ );
71
+ }
72
+ ), Nr = [
73
+ E.ENTER_KEY_CODE,
74
+ E.SPACE_KEY_CODE,
75
+ E.ARROW_DOWN_KEY_CODE
76
+ ], Dr = [E.ESCAPE_KEY_CODE, E.TAB_KEY_CODE];
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) => {
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) => {
82
+ var u;
83
+ if (n.length === 0)
84
+ return 0;
85
+ if (!((u = n[t]) != null && u.disabled))
86
+ return t;
87
+ const a = n.length;
88
+ return de(
89
+ n,
90
+ Ir(t + l, a),
91
+ l
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) => {
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;
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;
99
+ }, []), Pe = (n) => {
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,
106
+ "clear-button": "_clear-button_owe49_19",
107
+ dropdown: Pr,
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,
115
+ "mobile-disabled": "_mobile-disabled_owe49_97",
116
+ "value-wrapper": "_value-wrapper_owe49_102",
117
+ "value-tooltip": "_value-tooltip_owe49_108",
118
+ "select-list": "_select-list_owe49_113",
119
+ "limited-width": "_limited-width_owe49_130",
120
+ "options-container": "_options-container_owe49_134",
121
+ ghost: $r,
122
+ divider: zr
123
+ }, f = Le.bind(Br), at = ({
124
+ multiSelect: n = !1,
125
+ value: t = n ? [] : "",
126
+ options: l = [],
127
+ disabled: a = !1,
128
+ error: u,
129
+ onChange: _,
130
+ onFocus: v,
131
+ onBlur: g,
132
+ mobileDisabled: V,
133
+ title: Y,
134
+ touched: W = !1,
135
+ icon: S,
136
+ variant: Z,
137
+ placeholder: D = "",
138
+ label: H = "",
139
+ renderOption: $,
140
+ transparentBackground: ee = !1,
141
+ className: re,
142
+ toggleButtonClassName: z,
143
+ selectListClassName: Me,
144
+ isListWidthLimited: Re = !1,
145
+ optionAll: te = { value: "all", label: "All" },
146
+ isOptionAllVisible: ue = !1,
147
+ onSelectAll: Ve = () => {
148
+ },
149
+ formatDisplayedValue: fe,
150
+ notScrollable: P = !1,
151
+ footer: B,
152
+ includeGroupValue: he = !1,
153
+ clearable: We = !1,
154
+ onClear: _e = () => {
155
+ },
156
+ clearButtonAriaLabel: Se = "Clear selection",
157
+ tooltipPortalRoot: He,
158
+ tooltipZIndex: $e,
159
+ menuPortalRoot: h
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(
162
+ () => R.map(({ option: e }) => e),
163
+ [R]
164
+ ), q = O(() => R.filter(({ option: e }) => {
165
+ var r;
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]
170
+ ), F = O(() => {
171
+ const e = /* @__PURE__ */ new Map();
172
+ return q.forEach((r) => {
173
+ e.set(r.value, Pe(r));
174
+ }), e;
175
+ }, [q]), X = N(
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);
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;
183
+ }, []);
184
+ Ie(() => {
185
+ i && !P && M.current && !(n && b.current !== null) && M.current.scrollTop(ne.current);
186
+ }, [i, P, t, n]);
187
+ const { refs: I, floatingStyles: Ee } = lr({
188
+ placement: "bottom-start",
189
+ middleware: [
190
+ ir(5),
191
+ cr({
192
+ fallbackPlacements: ["bottom-start", "top-start", "bottom", "top"],
193
+ ...h && {
194
+ boundary: document.documentElement,
195
+ rootBoundary: "viewport"
196
+ }
197
+ }),
198
+ h ? dr({
199
+ apply({ rects: e, elements: r }) {
200
+ const s = e.reference.width;
201
+ Object.assign(r.floating.style, {
202
+ width: `${s}px`,
203
+ minWidth: `${s}px`,
204
+ maxWidth: `${s}px`
205
+ });
206
+ }
207
+ }) : null
208
+ ].filter(Boolean),
209
+ whileElementsMounted: i && h ? (e, r, s) => ur(e, r, s, {
210
+ animationFrame: !0
211
+ }) : void 0
212
+ }), qe = () => {
213
+ if (!ue)
214
+ return;
215
+ const e = Array.isArray(t) ? t : [], r = new Set(e), s = w.some((c) => !r.has(c));
216
+ w.forEach((c) => {
217
+ s ? r.add(c) : r.delete(c);
218
+ });
219
+ const o = X(r);
220
+ _(Array.from(o)), Ve();
221
+ }, m = N(() => {
222
+ U(!1), g == null || g();
223
+ }, [g]), oe = N(() => {
224
+ if (a)
225
+ return;
226
+ _(n ? [] : ""), _e(), m(), requestAnimationFrame(() => {
227
+ const r = I.reference.current;
228
+ r && r instanceof HTMLElement && r.focus();
229
+ });
230
+ }, [a, n, _, _e, m, I]), Fe = N(
231
+ (e) => {
232
+ e.preventDefault(), e.stopPropagation(), oe();
233
+ },
234
+ [oe]
235
+ ), ve = N(
236
+ (e) => {
237
+ var c, y;
238
+ if (!i)
239
+ return;
240
+ const r = e == null ? void 0 : e.target;
241
+ if (!r)
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();
245
+ },
246
+ [i, m]
247
+ );
248
+ Q(() => {
249
+ if (!i)
250
+ return;
251
+ const e = (r) => {
252
+ ve(r);
253
+ };
254
+ return document.addEventListener("pointerdown", e), () => {
255
+ document.removeEventListener("pointerdown", e);
256
+ };
257
+ }, [i, ve]);
258
+ const Ce = (e) => {
259
+ var r;
260
+ if (!e.disabled) {
261
+ if (n) {
262
+ const s = Array.isArray(t) ? t : [], o = new Set(s);
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);
267
+ });
268
+ } else
269
+ o.has(e.value) ? o.delete(e.value) : o.add(e.value);
270
+ const c = X(o);
271
+ _(Array.from(c));
272
+ } else
273
+ _(e.value);
274
+ U((s) => n || !s);
275
+ }
276
+ }, Xe = () => p.find(({ value: e }) => e === t), Oe = Tr(p, t), {
277
+ getToggleButtonProps: Ge,
278
+ getLabelProps: Je,
279
+ getMenuProps: Ne,
280
+ getItemProps: Qe,
281
+ setHighlightedIndex: x,
282
+ highlightedIndex: ae,
283
+ selectedItem: G
284
+ } = ce({
285
+ items: p,
286
+ itemToString: (e) => (e != null && e.label ? String(e.label) : D) || "",
287
+ selectedItem: Xe(),
288
+ isOpen: i,
289
+ circularNavigation: !0,
290
+ defaultHighlightedIndex: Oe,
291
+ onHighlightedIndexChange: (e) => {
292
+ 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:
296
+ return j(k.ON_KEY_DOWN), x(xr(p, e.highlightedIndex)), e;
297
+ default:
298
+ return e;
299
+ }
300
+ }
301
+ }), De = N(
302
+ (e) => {
303
+ ge.current = e, I.setFloating(e);
304
+ },
305
+ [I]
306
+ ), Ze = N(
307
+ (e = {}) => {
308
+ const r = Ne(e), s = r.ref;
309
+ return {
310
+ ...r,
311
+ ref: (o) => {
312
+ De(o), typeof s == "function" ? s(o) : s && (s.current = o);
313
+ }
314
+ };
315
+ },
316
+ [Ne, De]
317
+ );
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);
321
+ }));
322
+ }, [n, i, t, p.length, x, P]), Ie(() => {
323
+ if (!i || !h)
324
+ return;
325
+ let e = window.scrollY, r = !0;
326
+ const s = 300, o = () => {
327
+ if (!r)
328
+ return;
329
+ window.scrollY !== e && window.scrollTo(0, e);
330
+ }, c = (C) => {
331
+ r && (C.preventDefault(), C.stopImmediatePropagation(), o());
332
+ };
333
+ e = window.scrollY, window.addEventListener("scroll", c, { passive: !1, capture: !0 }), requestAnimationFrame(() => {
334
+ e = window.scrollY, o();
335
+ });
336
+ const y = setTimeout(() => {
337
+ r = !1;
338
+ }, s);
339
+ return () => {
340
+ clearTimeout(y), window.removeEventListener("scroll", c, { capture: !0 });
341
+ };
342
+ }, [i, h]), Q(() => {
343
+ if (!i || !h)
344
+ return;
345
+ const e = () => {
346
+ m();
347
+ };
348
+ return window.addEventListener("resize", e), () => {
349
+ window.removeEventListener("resize", e);
350
+ };
351
+ }, [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;
357
+ const e = p.reduce((r, s) => ((Array.isArray(t) && t.includes(s.value) || s.value === t) && r.push(s.label), r), []);
358
+ if (e.length > 0)
359
+ return e.join(", ");
360
+ if (!t && t !== !1 && t !== 0 || Array.isArray(t) && !t.length)
361
+ return D;
362
+ }, [
363
+ n,
364
+ t,
365
+ w,
366
+ A,
367
+ te.label,
368
+ p,
369
+ D
370
+ ]);
371
+ Q(() => {
372
+ if (se.current) {
373
+ const { offsetWidth: e, scrollWidth: r } = se.current;
374
+ we(r > e);
375
+ } else
376
+ we(!1);
377
+ }, [J]);
378
+ const rr = (e) => {
379
+ 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) => {
382
+ const { keyCode: r } = e;
383
+ if (r === E.ENTER_KEY_CODE || r === E.SPACE_KEY_CODE) {
384
+ const s = p[ae];
385
+ if (!s)
386
+ return;
387
+ n && (b.current = ae), Ce(s), n || m();
388
+ return;
389
+ }
390
+ Dr.includes(r) && (e.stopPropagation(), m());
391
+ }, be = () => /* @__PURE__ */ L("div", { className: f("options-container"), children: [
392
+ n && ue && /* @__PURE__ */ L(Te, { children: [
393
+ /* @__PURE__ */ d(
394
+ Ke,
395
+ {
396
+ option: te,
397
+ selected: Array.isArray(t) && w.length > 0 && w.every((e) => A.has(e)),
398
+ onChange: qe,
399
+ multiSelect: n,
400
+ isPartiallyChecked: w.some((e) => A.has(e)) && !w.every((e) => A.has(e))
401
+ }
402
+ ),
403
+ /* @__PURE__ */ d("div", { className: f("divider") }),
404
+ " "
405
+ ] }),
406
+ 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;
409
+ return /* @__PURE__ */ d(
410
+ Ke,
411
+ {
412
+ ...Qe({
413
+ item: e,
414
+ index: s
415
+ }),
416
+ multiSelect: n,
417
+ selected: n ? c : e.value === ((G == null ? void 0 : G.value) ?? G),
418
+ option: { title: e.label, ...e },
419
+ highlightHovered: ae === s && Be !== k.ON_CLICK,
420
+ render: $,
421
+ onChange: e.disabled ? null : () => Ce(e),
422
+ onMouseEnter: () => x(s),
423
+ depth: r,
424
+ hasChildren: !!((T = e.children) != null && T.length),
425
+ isPartiallyChecked: y
426
+ },
427
+ e.value
428
+ );
429
+ }),
430
+ B && /* @__PURE__ */ L(Te, { children: [
431
+ /* @__PURE__ */ d("div", { className: f("divider") }),
432
+ typeof B == "function" ? B(m) : B
433
+ ] })
434
+ ] }), nr = () => {
435
+ const e = fe ? fe(J) : J, r = /* @__PURE__ */ d(
436
+ "span",
437
+ {
438
+ ref: se,
439
+ className: f("value", {
440
+ placeholder: J === D
441
+ }),
442
+ children: e
443
+ }
444
+ );
445
+ return ye && !!e && ze ? /* @__PURE__ */ d(
446
+ gr,
447
+ {
448
+ content: e,
449
+ placement: "top",
450
+ wrapperClassName: f("value-tooltip"),
451
+ portalRoot: He,
452
+ zIndex: $e,
453
+ children: r
454
+ }
455
+ ) : r;
456
+ }, sr = Ge({
457
+ className: f("dropdown", Z, z, {
458
+ "transparent-background": ee,
459
+ opened: i,
460
+ disabled: a,
461
+ error: u,
462
+ touched: W,
463
+ "mobile-disabled": V
464
+ }),
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 }),
471
+ /* @__PURE__ */ L(
472
+ "div",
473
+ {
474
+ ...Ae,
475
+ role: "button",
476
+ "aria-disabled": a,
477
+ tabIndex: a ? -1 : Ae.tabIndex ?? 0,
478
+ children: [
479
+ S && /* @__PURE__ */ d("span", { className: f("icon"), children: S }),
480
+ /* @__PURE__ */ d("div", { className: f("value-wrapper"), children: nr() }),
481
+ Ue && /* @__PURE__ */ d(
482
+ hr,
483
+ {
484
+ className: f("clear-button"),
485
+ onClick: Fe,
486
+ onKeyDown: (e) => {
487
+ const { keyCode: r } = e;
488
+ (r === E.ENTER_KEY_CODE || r === E.SPACE_KEY_CODE) && (e.preventDefault(), e.stopPropagation(), oe());
489
+ },
490
+ "aria-label": Se,
491
+ children: /* @__PURE__ */ d(_r, {})
492
+ }
493
+ ),
494
+ /* @__PURE__ */ d("span", { className: f("arrow"), "aria-hidden": "true", children: /* @__PURE__ */ d(pr, {}) })
495
+ ]
496
+ }
497
+ ),
498
+ i && (() => {
499
+ var o;
500
+ const e = (o = I.reference.current) == null ? void 0 : o.getBoundingClientRect().width, r = h && e ? {
501
+ ...Ee,
502
+ width: `${e}px`,
503
+ minWidth: `${e}px`,
504
+ maxWidth: `${e}px`
505
+ } : Ee, s = /* @__PURE__ */ d(
506
+ "div",
507
+ {
508
+ style: r,
509
+ className: f(
510
+ "select-list",
511
+ {
512
+ opened: i,
513
+ "limited-width": Re
514
+ },
515
+ Me
516
+ ),
517
+ ...h && { [Ar]: "" },
518
+ ...Ze({
519
+ onKeyDown: tr
520
+ }),
521
+ children: P ? be() : /* @__PURE__ */ d(
522
+ fr,
523
+ {
524
+ autoHeight: !0,
525
+ autoHeightMax: br,
526
+ hideTracksWhenNotNeeded: !0,
527
+ ref: (c) => {
528
+ M.current = c;
529
+ },
530
+ onScrollFrame: je,
531
+ children: be()
532
+ }
533
+ )
534
+ }
535
+ );
536
+ return h ? ar(s, h) : s;
537
+ })()
538
+ ] });
539
+ };
540
+ export {
541
+ at as D,
542
+ Ar as a
543
+ };
package/dist/dropdown.js CHANGED
@@ -1,22 +1,23 @@
1
- import { D as r } from "./dropdown-18c58189.js";
1
+ import { D as r } from "./dropdown-a99520ba.js";
2
+ import { a as l } from "./dropdown-a99520ba.js";
2
3
  import "react/jsx-runtime";
3
4
  import "react";
5
+ import "react-dom";
4
6
  import "./bind-06a7ff84.js";
5
7
  import "@floating-ui/react-dom";
6
8
  import "downshift";
7
9
  import "rc-scrollbars";
8
- import "./useOnClickOutside-c332f7d3.js";
9
10
  import "./keyCodes-f63c0e11.js";
10
11
  import "./baseIconButton-251479f7.js";
11
12
  import "./clear-53660571.js";
12
13
  import "./dropdown-0260bb66.js";
13
14
  import "./tooltip.js";
14
- import "react-dom";
15
15
  import "@floating-ui/react";
16
16
  import "./floatingUi-41f8c7b5.js";
17
17
  import "./fieldLabel.js";
18
18
  import "./checkbox-ed6cc375.js";
19
19
  export {
20
+ l as DROPDOWN_PORTAL_MENU_ATTR,
20
21
  r as Dropdown,
21
22
  r as default
22
23
  };