@reportportal/ui-kit 0.0.1-alpha.135 → 0.0.1-alpha.137
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.
- package/dist/adaptiveTagList.js +189 -0
- package/dist/common/constants/sortable.d.ts +1 -0
- package/dist/common/hooks/index.d.ts +1 -0
- package/dist/common/hooks/useSortable.d.ts +3 -0
- package/dist/common/types/index.d.ts +2 -0
- package/dist/common/types/sortableTypes.d.ts +69 -0
- package/dist/common/utils/testUtils.d.ts +3 -0
- package/dist/components/adaptiveTagList/adaptiveTagList.d.ts +11 -0
- package/dist/components/adaptiveTagList/constants.d.ts +6 -0
- package/dist/components/adaptiveTagList/index.d.ts +2 -0
- package/dist/components/autocompletes/multipleAutocomplete/selectedItems/selectedItems.d.ts +1 -1
- package/dist/components/dropdown/constants.d.ts +1 -0
- package/dist/components/dropdown/dropdown.d.ts +2 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/sortable/dragLayer/dragLayer.d.ts +3 -0
- package/dist/components/sortable/dragLayer/index.d.ts +1 -0
- package/dist/components/sortable/helpers.d.ts +4 -0
- package/dist/components/sortable/index.d.ts +3 -0
- package/dist/components/sortable/sortableItem/index.d.ts +1 -0
- package/dist/components/sortable/sortableItem/sortableItem.d.ts +3 -0
- package/dist/components/sortable/sortableList/index.d.ts +1 -0
- package/dist/components/sortable/sortableList/sortableList.d.ts +5 -0
- package/dist/{datePicker-926c9cae.js → datePicker-341db7a5.js} +1 -1
- package/dist/datePicker.js +8 -4
- package/dist/dropdown-0a043606.js +586 -0
- package/dist/dropdown.js +7 -3
- package/dist/index.js +148 -140
- package/dist/modal.js +17 -13
- package/dist/sortable.js +160 -0
- package/dist/style.css +1 -1
- package/package.json +3 -1
- package/dist/dropdown-360803d5.js +0 -550
- /package/dist/common/{types.d.ts → types/commonTypes.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reportportal/ui-kit",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.137",
|
|
4
4
|
"description": "The UI-kit library for ReportPortal Design System.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -51,6 +51,8 @@
|
|
|
51
51
|
"framer-motion": "^10.15.2",
|
|
52
52
|
"rc-scrollbars": "^1.1.6",
|
|
53
53
|
"react-datepicker": "^7.6.0",
|
|
54
|
+
"react-dnd": "^16.0.1",
|
|
55
|
+
"react-dnd-html5-backend": "^16.0.1",
|
|
54
56
|
"react-dropzone": "^14.3.8"
|
|
55
57
|
},
|
|
56
58
|
"devDependencies": {
|
|
@@ -1,550 +0,0 @@
|
|
|
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
|
-
import { c as Le } from "./bind-06a7ff84.js";
|
|
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
|
-
import { K as E } from "./keyCodes-f63c0e11.js";
|
|
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
|
-
"dropdown-option": "_dropdown-option_14s7v_1",
|
|
17
|
-
disabled: mr,
|
|
18
|
-
hidden: yr,
|
|
19
|
-
hover: Er,
|
|
20
|
-
"depth-1": "_depth-1_14s7v_32",
|
|
21
|
-
selected: vr,
|
|
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(Cr), Ke = sr(
|
|
26
|
-
(n, t) => {
|
|
27
|
-
const {
|
|
28
|
-
option: { value: l, disabled: o, hidden: u, label: _, title: v, groupRef: g },
|
|
29
|
-
selected: V,
|
|
30
|
-
onChange: Y,
|
|
31
|
-
render: W,
|
|
32
|
-
highlightHovered: S,
|
|
33
|
-
onMouseEnter: Q,
|
|
34
|
-
multiSelect: D,
|
|
35
|
-
isPartiallyChecked: H = !1,
|
|
36
|
-
depth: $ = 0,
|
|
37
|
-
hasChildren: Z = !1
|
|
38
|
-
} = n, ee = (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: o,
|
|
47
|
-
hidden: u,
|
|
48
|
-
hover: S,
|
|
49
|
-
"multi-select": D,
|
|
50
|
-
"has-children": Z,
|
|
51
|
-
[`depth-${$}`]: $ > 0
|
|
52
|
-
}),
|
|
53
|
-
title: v,
|
|
54
|
-
onClick: ee,
|
|
55
|
-
ref: t,
|
|
56
|
-
onMouseEnter: Q,
|
|
57
|
-
children: [
|
|
58
|
-
D && /* @__PURE__ */ d(wr, { 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
|
-
), Or = [
|
|
73
|
-
E.ENTER_KEY_CODE,
|
|
74
|
-
E.SPACE_KEY_CODE,
|
|
75
|
-
E.ARROW_DOWN_KEY_CODE
|
|
76
|
-
], Nr = [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 Dr = 216, Ar = "data-dropdown-portal-menu", br = (n, t) => {
|
|
79
|
-
const l = Array.isArray(t) ? t : [t];
|
|
80
|
-
return n.findIndex(({ value: o }) => l.includes(o));
|
|
81
|
-
}, Ir = (n, t) => (n % t + t) % t, ce = (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 o = n.length;
|
|
88
|
-
return ce(
|
|
89
|
-
n,
|
|
90
|
-
Ir(t + l, o),
|
|
91
|
-
l
|
|
92
|
-
);
|
|
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
|
-
var _;
|
|
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
|
-
}, []), Ye = (n) => !n || n.length === 0 ? [] : n.reduce((t, l) => {
|
|
97
|
-
var o;
|
|
98
|
-
return l && ((o = l.children) != null && o.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, 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
|
-
"clear-button": "_clear-button_owe49_19",
|
|
107
|
-
dropdown: Yr,
|
|
108
|
-
"transparent-background": "_transparent-background_owe49_41",
|
|
109
|
-
disabled: Pr,
|
|
110
|
-
value: Mr,
|
|
111
|
-
error: Rr,
|
|
112
|
-
touched: Vr,
|
|
113
|
-
opened: Wr,
|
|
114
|
-
placeholder: Sr,
|
|
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: Hr,
|
|
122
|
-
divider: $r
|
|
123
|
-
}, f = Le.bind(zr), ot = ({
|
|
124
|
-
multiSelect: n = !1,
|
|
125
|
-
value: t = n ? [] : "",
|
|
126
|
-
options: l = [],
|
|
127
|
-
disabled: o = !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: Q,
|
|
137
|
-
placeholder: D = "",
|
|
138
|
-
label: H = "",
|
|
139
|
-
renderOption: $,
|
|
140
|
-
transparentBackground: Z = !1,
|
|
141
|
-
className: ee,
|
|
142
|
-
toggleButtonClassName: z,
|
|
143
|
-
selectListClassName: Me,
|
|
144
|
-
isListWidthLimited: Re = !1,
|
|
145
|
-
optionAll: re = { value: "all", label: "All" },
|
|
146
|
-
isOptionAllVisible: de = !1,
|
|
147
|
-
onSelectAll: Ve = () => {
|
|
148
|
-
},
|
|
149
|
-
formatDisplayedValue: ue,
|
|
150
|
-
notScrollable: P = !1,
|
|
151
|
-
footer: B,
|
|
152
|
-
includeGroupValue: fe = !1,
|
|
153
|
-
clearable: We = !1,
|
|
154
|
-
onClear: he = () => {
|
|
155
|
-
},
|
|
156
|
-
clearButtonAriaLabel: Se = "Clear selection",
|
|
157
|
-
tooltipPortalRoot: He,
|
|
158
|
-
tooltipZIndex: $e,
|
|
159
|
-
menuPortalRoot: h
|
|
160
|
-
}) => {
|
|
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
|
-
() => 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]), we = O(() => Ye(l), [l]), w = O(
|
|
168
|
-
() => we.map(({ value: e }) => e),
|
|
169
|
-
[we]
|
|
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) ?? [], a = s.length > 0 && s.every((c) => e.has(c));
|
|
178
|
-
fe && a ? e.add(r.value) : e.delete(r.value);
|
|
179
|
-
}), e),
|
|
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
|
-
}, []);
|
|
184
|
-
Te(() => {
|
|
185
|
-
i && !P && M.current && !(n && A.current !== null) && M.current.scrollTop(te.current);
|
|
186
|
-
}, [i, P, t, n]);
|
|
187
|
-
const { refs: T, floatingStyles: ye } = ar({
|
|
188
|
-
placement: "bottom-start",
|
|
189
|
-
middleware: [
|
|
190
|
-
lr(5),
|
|
191
|
-
ir({
|
|
192
|
-
fallbackPlacements: ["bottom-start", "top-start", "bottom", "top"],
|
|
193
|
-
...h && {
|
|
194
|
-
boundary: document.documentElement,
|
|
195
|
-
rootBoundary: "viewport"
|
|
196
|
-
}
|
|
197
|
-
}),
|
|
198
|
-
h ? cr({
|
|
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) => dr(e, r, s, {
|
|
210
|
-
animationFrame: !0
|
|
211
|
-
}) : void 0
|
|
212
|
-
}), qe = () => {
|
|
213
|
-
if (!de)
|
|
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 a = X(r);
|
|
220
|
-
_(Array.from(a)), Ve();
|
|
221
|
-
}, m = N(() => {
|
|
222
|
-
U(!1), g == null || g();
|
|
223
|
-
}, [g]), se = N(() => {
|
|
224
|
-
if (o)
|
|
225
|
-
return;
|
|
226
|
-
_(n ? [] : ""), he(), m(), requestAnimationFrame(() => {
|
|
227
|
-
const r = T.reference.current;
|
|
228
|
-
r && r instanceof HTMLElement && r.focus();
|
|
229
|
-
});
|
|
230
|
-
}, [o, n, _, he, m, T]), Fe = N(
|
|
231
|
-
(e) => {
|
|
232
|
-
e.preventDefault(), e.stopPropagation(), se();
|
|
233
|
-
},
|
|
234
|
-
[se]
|
|
235
|
-
), Ee = 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 = _e.current) == null ? void 0 : c.contains(r), a = (y = pe.current) == null ? void 0 : y.contains(r);
|
|
244
|
-
!s && !a && m();
|
|
245
|
-
},
|
|
246
|
-
[i, m]
|
|
247
|
-
);
|
|
248
|
-
J(() => {
|
|
249
|
-
if (!i)
|
|
250
|
-
return;
|
|
251
|
-
const e = (r) => {
|
|
252
|
-
Ee(r);
|
|
253
|
-
};
|
|
254
|
-
return document.addEventListener("pointerdown", e), () => {
|
|
255
|
-
document.removeEventListener("pointerdown", e);
|
|
256
|
-
};
|
|
257
|
-
}, [i, Ee]);
|
|
258
|
-
const ve = (e) => {
|
|
259
|
-
var r;
|
|
260
|
-
if (!e.disabled) {
|
|
261
|
-
if (n) {
|
|
262
|
-
const s = Array.isArray(t) ? t : [], a = new Set(s);
|
|
263
|
-
if ((r = e.children) != null && r.length) {
|
|
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
|
-
});
|
|
268
|
-
} else
|
|
269
|
-
a.has(e.value) ? a.delete(e.value) : a.add(e.value);
|
|
270
|
-
const c = X(a);
|
|
271
|
-
_(Array.from(c));
|
|
272
|
-
} else
|
|
273
|
-
_(e.value);
|
|
274
|
-
U((s) => n || !s);
|
|
275
|
-
}
|
|
276
|
-
}, Xe = () => p.find(({ value: e }) => e === t), Ce = br(p, t), {
|
|
277
|
-
getToggleButtonProps: Ge,
|
|
278
|
-
getLabelProps: Je,
|
|
279
|
-
getMenuProps: Oe,
|
|
280
|
-
getItemProps: Qe,
|
|
281
|
-
setHighlightedIndex: x,
|
|
282
|
-
highlightedIndex: oe
|
|
283
|
-
} = ie({
|
|
284
|
-
items: p,
|
|
285
|
-
itemToString: (e) => (e != null && e.label ? String(e.label) : D) || "",
|
|
286
|
-
selectedItem: Xe(),
|
|
287
|
-
isOpen: i,
|
|
288
|
-
circularNavigation: !0,
|
|
289
|
-
defaultHighlightedIndex: Ce,
|
|
290
|
-
onHighlightedIndexChange: (e) => {
|
|
291
|
-
switch (e.type) {
|
|
292
|
-
case ie.stateChangeTypes.MenuKeyDownArrowUp:
|
|
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;
|
|
296
|
-
default:
|
|
297
|
-
return e;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
}), Ne = N(
|
|
301
|
-
(e) => {
|
|
302
|
-
pe.current = e, T.setFloating(e);
|
|
303
|
-
},
|
|
304
|
-
[T]
|
|
305
|
-
), Ze = N(
|
|
306
|
-
(e = {}) => {
|
|
307
|
-
const r = Oe(e), s = r.ref;
|
|
308
|
-
return {
|
|
309
|
-
...r,
|
|
310
|
-
ref: (a) => {
|
|
311
|
-
Ne(a), typeof s == "function" ? s(a) : s && (s.current = a);
|
|
312
|
-
}
|
|
313
|
-
};
|
|
314
|
-
},
|
|
315
|
-
[Oe, Ne]
|
|
316
|
-
);
|
|
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);
|
|
320
|
-
}));
|
|
321
|
-
}, [n, i, t, p.length, x, P]), Te(() => {
|
|
322
|
-
if (!i || !h)
|
|
323
|
-
return;
|
|
324
|
-
let e = window.scrollY, r = !0;
|
|
325
|
-
const s = 300, a = () => {
|
|
326
|
-
if (!r)
|
|
327
|
-
return;
|
|
328
|
-
window.scrollY !== e && window.scrollTo(0, e);
|
|
329
|
-
}, c = (C) => {
|
|
330
|
-
r && (C.preventDefault(), C.stopImmediatePropagation(), a());
|
|
331
|
-
};
|
|
332
|
-
e = window.scrollY, window.addEventListener("scroll", c, { passive: !1, capture: !0 }), requestAnimationFrame(() => {
|
|
333
|
-
e = window.scrollY, a();
|
|
334
|
-
});
|
|
335
|
-
const y = setTimeout(() => {
|
|
336
|
-
r = !1;
|
|
337
|
-
}, s);
|
|
338
|
-
return () => {
|
|
339
|
-
clearTimeout(y), window.removeEventListener("scroll", c, { capture: !0 });
|
|
340
|
-
};
|
|
341
|
-
}, [i, h]), J(() => {
|
|
342
|
-
if (!i || !h)
|
|
343
|
-
return;
|
|
344
|
-
const e = () => {
|
|
345
|
-
m();
|
|
346
|
-
};
|
|
347
|
-
return window.addEventListener("resize", e), () => {
|
|
348
|
-
window.removeEventListener("resize", e);
|
|
349
|
-
};
|
|
350
|
-
}, [i, h, m]);
|
|
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;
|
|
356
|
-
const e = p.reduce((r, s) => ((Array.isArray(t) && t.includes(s.value) || s.value === t) && r.push(s.label), r), []);
|
|
357
|
-
if (e.length > 0)
|
|
358
|
-
return e.join(", ");
|
|
359
|
-
if (!t && t !== !1 && t !== 0 || Array.isArray(t) && !t.length)
|
|
360
|
-
return D;
|
|
361
|
-
}, [
|
|
362
|
-
n,
|
|
363
|
-
t,
|
|
364
|
-
w,
|
|
365
|
-
b,
|
|
366
|
-
re.label,
|
|
367
|
-
p,
|
|
368
|
-
D
|
|
369
|
-
]);
|
|
370
|
-
J(() => {
|
|
371
|
-
if (ne.current) {
|
|
372
|
-
const { offsetWidth: e, scrollWidth: r } = ne.current;
|
|
373
|
-
ge(r > e);
|
|
374
|
-
} else
|
|
375
|
-
ge(!1);
|
|
376
|
-
}, [G]);
|
|
377
|
-
const er = (e) => {
|
|
378
|
-
const { keyCode: r } = 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) => {
|
|
381
|
-
const { keyCode: r } = e;
|
|
382
|
-
if (r === E.ENTER_KEY_CODE || r === E.SPACE_KEY_CODE) {
|
|
383
|
-
const s = p[oe];
|
|
384
|
-
if (!s)
|
|
385
|
-
return;
|
|
386
|
-
n && (A.current = oe), ve(s), n || m();
|
|
387
|
-
return;
|
|
388
|
-
}
|
|
389
|
-
Nr.includes(r) && (e.stopPropagation(), m());
|
|
390
|
-
}, Ae = () => /* @__PURE__ */ L("div", { className: f("options-container"), children: [
|
|
391
|
-
n && de && /* @__PURE__ */ L(Ie, { children: [
|
|
392
|
-
/* @__PURE__ */ d(
|
|
393
|
-
Ke,
|
|
394
|
-
{
|
|
395
|
-
option: re,
|
|
396
|
-
selected: Array.isArray(t) && w.length > 0 && w.every((e) => b.has(e)),
|
|
397
|
-
onChange: qe,
|
|
398
|
-
multiSelect: n,
|
|
399
|
-
isPartiallyChecked: w.some((e) => b.has(e)) && !w.every((e) => b.has(e))
|
|
400
|
-
}
|
|
401
|
-
),
|
|
402
|
-
/* @__PURE__ */ d("div", { className: f("divider") }),
|
|
403
|
-
" "
|
|
404
|
-
] }),
|
|
405
|
-
R.map(({ option: e, depth: r }, s) => {
|
|
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;
|
|
408
|
-
return /* @__PURE__ */ d(
|
|
409
|
-
Ke,
|
|
410
|
-
{
|
|
411
|
-
...Qe({
|
|
412
|
-
item: e,
|
|
413
|
-
index: s
|
|
414
|
-
}),
|
|
415
|
-
multiSelect: n,
|
|
416
|
-
selected: n ? c : e.value === t,
|
|
417
|
-
option: { title: e.label, ...e },
|
|
418
|
-
highlightHovered: oe === s && Be !== k.ON_CLICK,
|
|
419
|
-
render: $,
|
|
420
|
-
onChange: e.disabled ? null : () => ve(e),
|
|
421
|
-
onMouseEnter: () => x(s),
|
|
422
|
-
depth: r,
|
|
423
|
-
hasChildren: !!((I = e.children) != null && I.length),
|
|
424
|
-
isPartiallyChecked: y
|
|
425
|
-
},
|
|
426
|
-
e.value
|
|
427
|
-
);
|
|
428
|
-
}),
|
|
429
|
-
B && /* @__PURE__ */ L(Ie, { children: [
|
|
430
|
-
/* @__PURE__ */ d("div", { className: f("divider") }),
|
|
431
|
-
typeof B == "function" ? B(m) : B
|
|
432
|
-
] })
|
|
433
|
-
] }), tr = () => {
|
|
434
|
-
const e = ue ? ue(G) : G, r = /* @__PURE__ */ d(
|
|
435
|
-
"span",
|
|
436
|
-
{
|
|
437
|
-
ref: ne,
|
|
438
|
-
className: f("value", {
|
|
439
|
-
placeholder: G === D
|
|
440
|
-
}),
|
|
441
|
-
children: e
|
|
442
|
-
}
|
|
443
|
-
);
|
|
444
|
-
return me && !!e && ze ? /* @__PURE__ */ d(
|
|
445
|
-
pr,
|
|
446
|
-
{
|
|
447
|
-
content: e,
|
|
448
|
-
placement: "top",
|
|
449
|
-
wrapperClassName: f("value-tooltip"),
|
|
450
|
-
portalRoot: He,
|
|
451
|
-
zIndex: $e,
|
|
452
|
-
children: r
|
|
453
|
-
}
|
|
454
|
-
) : r;
|
|
455
|
-
}, nr = Ge({
|
|
456
|
-
className: f("dropdown", Q, z, {
|
|
457
|
-
"transparent-background": Z,
|
|
458
|
-
opened: i,
|
|
459
|
-
disabled: o,
|
|
460
|
-
error: u,
|
|
461
|
-
touched: W,
|
|
462
|
-
"mobile-disabled": V
|
|
463
|
-
}),
|
|
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
|
-
),
|
|
478
|
-
/* @__PURE__ */ L(
|
|
479
|
-
"div",
|
|
480
|
-
{
|
|
481
|
-
...be,
|
|
482
|
-
role: "button",
|
|
483
|
-
"aria-disabled": o,
|
|
484
|
-
tabIndex: o ? -1 : be.tabIndex ?? 0,
|
|
485
|
-
children: [
|
|
486
|
-
S && /* @__PURE__ */ d("span", { className: f("icon"), children: S }),
|
|
487
|
-
/* @__PURE__ */ d("div", { className: f("value-wrapper"), children: tr() }),
|
|
488
|
-
Ue && /* @__PURE__ */ d(
|
|
489
|
-
fr,
|
|
490
|
-
{
|
|
491
|
-
className: f("clear-button"),
|
|
492
|
-
onClick: Fe,
|
|
493
|
-
onKeyDown: (e) => {
|
|
494
|
-
const { keyCode: r } = e;
|
|
495
|
-
(r === E.ENTER_KEY_CODE || r === E.SPACE_KEY_CODE) && (e.preventDefault(), e.stopPropagation(), se());
|
|
496
|
-
},
|
|
497
|
-
"aria-label": Se,
|
|
498
|
-
children: /* @__PURE__ */ d(hr, {})
|
|
499
|
-
}
|
|
500
|
-
),
|
|
501
|
-
/* @__PURE__ */ d("span", { className: f("arrow"), "aria-hidden": "true", children: /* @__PURE__ */ d(_r, {}) })
|
|
502
|
-
]
|
|
503
|
-
}
|
|
504
|
-
),
|
|
505
|
-
i && (() => {
|
|
506
|
-
var a;
|
|
507
|
-
const e = (a = T.reference.current) == null ? void 0 : a.getBoundingClientRect().width, r = h && e ? {
|
|
508
|
-
...ye,
|
|
509
|
-
width: `${e}px`,
|
|
510
|
-
minWidth: `${e}px`,
|
|
511
|
-
maxWidth: `${e}px`
|
|
512
|
-
} : ye, s = /* @__PURE__ */ d(
|
|
513
|
-
"div",
|
|
514
|
-
{
|
|
515
|
-
style: r,
|
|
516
|
-
className: f(
|
|
517
|
-
"select-list",
|
|
518
|
-
{
|
|
519
|
-
opened: i,
|
|
520
|
-
"limited-width": Re
|
|
521
|
-
},
|
|
522
|
-
Me
|
|
523
|
-
),
|
|
524
|
-
...h && { [Ar]: "" },
|
|
525
|
-
...Ze({
|
|
526
|
-
onKeyDown: rr
|
|
527
|
-
}),
|
|
528
|
-
children: P ? Ae() : /* @__PURE__ */ d(
|
|
529
|
-
ur,
|
|
530
|
-
{
|
|
531
|
-
autoHeight: !0,
|
|
532
|
-
autoHeightMax: Dr,
|
|
533
|
-
hideTracksWhenNotNeeded: !0,
|
|
534
|
-
ref: (c) => {
|
|
535
|
-
M.current = c;
|
|
536
|
-
},
|
|
537
|
-
onScrollFrame: je,
|
|
538
|
-
children: Ae()
|
|
539
|
-
}
|
|
540
|
-
)
|
|
541
|
-
}
|
|
542
|
-
);
|
|
543
|
-
return h ? or(s, h) : s;
|
|
544
|
-
})()
|
|
545
|
-
] });
|
|
546
|
-
};
|
|
547
|
-
export {
|
|
548
|
-
ot as D,
|
|
549
|
-
Ar as a
|
|
550
|
-
};
|
|
File without changes
|