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