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