@reportportal/ui-kit 0.0.1-alpha.145 → 0.0.1-alpha.147

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