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