@reportportal/ui-kit 0.0.1-alpha.68 → 0.0.1-alpha.69
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/button-33bc880f.js +64 -0
- package/dist/button.js +1 -1
- package/dist/{checkbox-9a6c7ce1.js → checkbox-aa91985d.js} +15 -15
- package/dist/checkbox.js +1 -1
- package/dist/{datePicker-06e90999.js → datePicker-382ef010.js} +57 -57
- package/dist/datePicker.js +6 -6
- package/dist/dropdown-13d7d50e.js +278 -0
- package/dist/dropdown.js +2 -2
- package/dist/fieldLabel.js +8 -8
- package/dist/{fieldNumber-01efb16e.js → fieldNumber-2542b311.js} +43 -43
- package/dist/fieldNumber.js +1 -1
- package/dist/fieldText-e605a521.js +158 -0
- package/dist/fieldText.js +2 -2
- package/dist/fieldTextFlex-9e616f66.js +78 -0
- package/dist/fieldTextFlex.js +1 -1
- package/dist/fonts/OpenSans/OpenSans-Bold.ttf +0 -0
- package/dist/fonts/OpenSans/OpenSans-Medium.ttf +0 -0
- package/dist/index.js +12 -12
- package/dist/modal.js +81 -81
- package/dist/{pagination-91729c7d.js → pagination-ecbc9940.js} +53 -53
- package/dist/pagination.js +3 -3
- package/dist/popover.js +15 -15
- package/dist/{radio-bccc84f2.js → radio-62546efa.js} +27 -27
- package/dist/radio.js +1 -1
- package/dist/style.css +1 -1
- package/dist/systemAlert.js +28 -28
- package/dist/systemMessage-924fdaa6.js +30 -0
- package/dist/systemMessage.js +1 -1
- package/dist/table-20aa2cdf.js +142 -0
- package/dist/table.js +2 -2
- package/dist/toggle-304107fa.js +59 -0
- package/dist/toggle.js +1 -1
- package/dist/tooltip.js +15 -15
- package/package.json +1 -1
- package/dist/button-770f7b20.js +0 -64
- package/dist/dropdown-29285346.js +0 -278
- package/dist/fieldText-94e2c8eb.js +0 -158
- package/dist/fieldTextFlex-c55452d5.js +0 -78
- package/dist/systemMessage-1ced6079.js +0 -30
- package/dist/table-02e40724.js +0 -142
- package/dist/toggle-1a3aacb5.js +0 -59
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { jsxs as r, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as N, useMemo as G } from "react";
|
|
3
|
+
import { c as J } from "./bind-06a7ff84.js";
|
|
4
|
+
import { a as w, S as K } from "./arrowUp-4a5caee7.js";
|
|
5
|
+
import { C as g } from "./checkbox-aa91985d.js";
|
|
6
|
+
const O = "_table_qun9e_1", P = "_label_qun9e_87", Q = {
|
|
7
|
+
table: O,
|
|
8
|
+
"table-header": "_table-header_qun9e_9",
|
|
9
|
+
"table-row": "_table-row_qun9e_16",
|
|
10
|
+
"table-row-content": "_table-row-content_qun9e_21",
|
|
11
|
+
"size-small": "_size-small_qun9e_31",
|
|
12
|
+
"size-large": "_size-large_qun9e_34",
|
|
13
|
+
"table-body": "_table-body_qun9e_38",
|
|
14
|
+
"table-header-cell": "_table-header-cell_qun9e_45",
|
|
15
|
+
"table-cell": "_table-cell_qun9e_45",
|
|
16
|
+
"action-menu-cell": "_action-menu-cell_qun9e_50",
|
|
17
|
+
"checkbox-cell": "_checkbox-cell_qun9e_60",
|
|
18
|
+
"primary-cell": "_primary-cell_qun9e_71",
|
|
19
|
+
label: P,
|
|
20
|
+
"sortable-cell": "_sortable-cell_qun9e_91",
|
|
21
|
+
"align-right": "_align-right_qun9e_94",
|
|
22
|
+
"align-center": "_align-center_qun9e_100"
|
|
23
|
+
}, f = "asc", V = (s) => s.toLowerCase() === f, W = (s) => s.map((t) => t.key), l = J.bind(Q), le = ({
|
|
24
|
+
data: s,
|
|
25
|
+
primaryColumn: t,
|
|
26
|
+
fixedColumns: i,
|
|
27
|
+
renderRowActions: d,
|
|
28
|
+
className: x = "",
|
|
29
|
+
rowClassName: z = "",
|
|
30
|
+
headerClassName: M = "",
|
|
31
|
+
selectable: y = !1,
|
|
32
|
+
selectedRowIds: o = [],
|
|
33
|
+
sortingDirection: k = f,
|
|
34
|
+
sortingColumn: n = t,
|
|
35
|
+
sortableColumns: h = W([t, ...i]),
|
|
36
|
+
onChangeSorting: S = () => {
|
|
37
|
+
},
|
|
38
|
+
onToggleRowSelection: m = () => {
|
|
39
|
+
},
|
|
40
|
+
onToggleAllRowsSelection: A = () => {
|
|
41
|
+
}
|
|
42
|
+
}) => {
|
|
43
|
+
const [L, v] = N(null), [E, u] = N(null), p = G(() => [{ ...t, primary: !0 }, ...i], [t, i]), j = (e) => {
|
|
44
|
+
h.includes(e) && S({ key: e, direction: k });
|
|
45
|
+
}, q = (e) => ({
|
|
46
|
+
width: e.width,
|
|
47
|
+
textAlign: e.align
|
|
48
|
+
}), C = (e) => {
|
|
49
|
+
v(e);
|
|
50
|
+
}, H = () => {
|
|
51
|
+
v(null);
|
|
52
|
+
}, T = (e) => {
|
|
53
|
+
u(e);
|
|
54
|
+
}, $ = () => {
|
|
55
|
+
u(null);
|
|
56
|
+
}, D = (e) => {
|
|
57
|
+
m(e);
|
|
58
|
+
}, R = () => {
|
|
59
|
+
A();
|
|
60
|
+
}, U = s.every((e) => o.includes(e.id)), _ = s.some((e) => o.includes(e.id)), B = (e) => {
|
|
61
|
+
var c;
|
|
62
|
+
return `size-${((c = e.rowConfigs) == null ? void 0 : c.size) ?? "default"}`;
|
|
63
|
+
}, F = (e) => {
|
|
64
|
+
if (h.includes(e))
|
|
65
|
+
return (n == null ? void 0 : n.key) === e ? V(k) ? /* @__PURE__ */ a(w, {}) : /* @__PURE__ */ a(K, {}) : /* @__PURE__ */ a(w, {});
|
|
66
|
+
};
|
|
67
|
+
return /* @__PURE__ */ r("div", { className: l("table", x), children: [
|
|
68
|
+
/* @__PURE__ */ r("div", { className: l("table-header", M), children: [
|
|
69
|
+
y && /* @__PURE__ */ a("div", { className: l("table-header-cell", "checkbox-cell"), children: _ && /* @__PURE__ */ a(
|
|
70
|
+
g,
|
|
71
|
+
{
|
|
72
|
+
value: U,
|
|
73
|
+
partiallyChecked: _,
|
|
74
|
+
onChange: R,
|
|
75
|
+
className: l("checkbox-cell")
|
|
76
|
+
}
|
|
77
|
+
) }),
|
|
78
|
+
p.map((e) => /* @__PURE__ */ a(
|
|
79
|
+
"button",
|
|
80
|
+
{
|
|
81
|
+
className: l("table-header-cell", {
|
|
82
|
+
[`align-${e.align}`]: "align" in e,
|
|
83
|
+
"primary-cell": "primary" in e && e.primary,
|
|
84
|
+
"sortable-cell": h.includes(e.key)
|
|
85
|
+
}),
|
|
86
|
+
style: q(e),
|
|
87
|
+
children: /* @__PURE__ */ r(
|
|
88
|
+
"div",
|
|
89
|
+
{
|
|
90
|
+
className: l("label"),
|
|
91
|
+
onClick: () => j(e.key),
|
|
92
|
+
onMouseEnter: () => C(e.key),
|
|
93
|
+
onMouseLeave: H,
|
|
94
|
+
children: [
|
|
95
|
+
/* @__PURE__ */ a("span", { children: e.header }),
|
|
96
|
+
(L === e.key || (n == null ? void 0 : n.key) === e.key) && F(e.key)
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
},
|
|
101
|
+
e.key
|
|
102
|
+
)),
|
|
103
|
+
d && /* @__PURE__ */ a("div", { className: l("table-header-cell", "action-menu-cell") })
|
|
104
|
+
] }),
|
|
105
|
+
/* @__PURE__ */ a("div", { className: l("table-body"), children: s.map((e, b) => /* @__PURE__ */ r(
|
|
106
|
+
"div",
|
|
107
|
+
{
|
|
108
|
+
className: l("table-row", B(e), z),
|
|
109
|
+
onMouseEnter: () => T(b),
|
|
110
|
+
onMouseLeave: $,
|
|
111
|
+
children: [
|
|
112
|
+
y && /* @__PURE__ */ a("div", { className: l("table-cell", "checkbox-cell"), children: (_ || E === b) && /* @__PURE__ */ a(
|
|
113
|
+
g,
|
|
114
|
+
{
|
|
115
|
+
value: o.includes(e.id),
|
|
116
|
+
onChange: () => D(e.id),
|
|
117
|
+
className: l("checkbox-cell")
|
|
118
|
+
}
|
|
119
|
+
) }),
|
|
120
|
+
/* @__PURE__ */ r("div", { className: l("table-row-content"), children: [
|
|
121
|
+
p.map((c) => /* @__PURE__ */ a(
|
|
122
|
+
"div",
|
|
123
|
+
{
|
|
124
|
+
className: l("table-cell", {
|
|
125
|
+
"primary-cell": "primary" in c && c.primary
|
|
126
|
+
}),
|
|
127
|
+
style: q(c),
|
|
128
|
+
children: e[c.key].component || e[c.key].content || e[c.key]
|
|
129
|
+
},
|
|
130
|
+
c.key
|
|
131
|
+
)),
|
|
132
|
+
d && /* @__PURE__ */ a("div", { className: l("table-cell", "action-menu-cell"), children: d(e.metaData) })
|
|
133
|
+
] })
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
e.id
|
|
137
|
+
)) })
|
|
138
|
+
] });
|
|
139
|
+
};
|
|
140
|
+
export {
|
|
141
|
+
le as T
|
|
142
|
+
};
|
package/dist/table.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { T as r } from "./table-
|
|
1
|
+
import { T as r } from "./table-20aa2cdf.js";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
4
|
import "./bind-06a7ff84.js";
|
|
5
5
|
import "./arrowUp-4a5caee7.js";
|
|
6
|
-
import "./checkbox-
|
|
6
|
+
import "./checkbox-aa91985d.js";
|
|
7
7
|
import "./keyCodes-f63c0e11.js";
|
|
8
8
|
export {
|
|
9
9
|
r as Table,
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsxs as b, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { c as h } from "./bind-06a7ff84.js";
|
|
3
|
+
import { useRef as k, useId as x } from "react";
|
|
4
|
+
import { K as _ } from "./keyCodes-f63c0e11.js";
|
|
5
|
+
const y = "_toggle_1c7gt_1", E = "_slider_1c7gt_27", D = "_round_1c7gt_47", K = "_input_1c7gt_51", N = "_disabled_1c7gt_92", C = {
|
|
6
|
+
toggle: y,
|
|
7
|
+
"children-container": "_children-container_1c7gt_14",
|
|
8
|
+
slider: E,
|
|
9
|
+
round: D,
|
|
10
|
+
input: K,
|
|
11
|
+
disabled: N
|
|
12
|
+
}, e = h.bind(C), w = ({
|
|
13
|
+
children: s,
|
|
14
|
+
value: r,
|
|
15
|
+
onChange: g,
|
|
16
|
+
className: u,
|
|
17
|
+
disabled: t = !1,
|
|
18
|
+
title: p,
|
|
19
|
+
...m
|
|
20
|
+
}) => {
|
|
21
|
+
const c = k(null), l = x(), f = (n) => {
|
|
22
|
+
var a, d;
|
|
23
|
+
const { keyCode: i } = n;
|
|
24
|
+
if (i === _.SPACE_KEY_CODE) {
|
|
25
|
+
n.preventDefault(), (a = c.current) == null || a.click();
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
i === _.ENTER_KEY_CODE && (n.preventDefault(), (d = c.current) == null || d.click());
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ b("label", { id: l, title: p, className: e("toggle", u, { disabled: t }), children: [
|
|
31
|
+
/* @__PURE__ */ o(
|
|
32
|
+
"input",
|
|
33
|
+
{
|
|
34
|
+
ref: c,
|
|
35
|
+
tabIndex: t ? -1 : 0,
|
|
36
|
+
onChange: g,
|
|
37
|
+
checked: r,
|
|
38
|
+
disabled: t,
|
|
39
|
+
onKeyDown: f,
|
|
40
|
+
className: e("input"),
|
|
41
|
+
type: "checkbox",
|
|
42
|
+
...m
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
/* @__PURE__ */ o(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
"aria-labelledby": l,
|
|
49
|
+
role: "checkbox",
|
|
50
|
+
"aria-checked": r,
|
|
51
|
+
className: e("slider", "round")
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
s && /* @__PURE__ */ o("span", { className: e("children-container"), children: s })
|
|
55
|
+
] });
|
|
56
|
+
};
|
|
57
|
+
export {
|
|
58
|
+
w as T
|
|
59
|
+
};
|
package/dist/toggle.js
CHANGED
package/dist/tooltip.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as p, Fragment as D, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { useState as H, useRef as d } from "react";
|
|
3
3
|
import { createPortal as R } from "react-dom";
|
|
4
4
|
import { c as G } from "./bind-06a7ff84.js";
|
|
5
|
-
import { useFloating as P, offset as j, flip as k, arrow as
|
|
6
|
-
const
|
|
7
|
-
"tooltip-wrapper": "_tooltip-
|
|
8
|
-
"tooltip-content": "_tooltip-
|
|
9
|
-
}, n = G.bind(
|
|
5
|
+
import { useFloating as P, offset as j, flip as k, arrow as $, autoUpdate as C, FloatingArrow as U } from "@floating-ui/react";
|
|
6
|
+
const Y = {
|
|
7
|
+
"tooltip-wrapper": "_tooltip-wrapper_lwpn2_16",
|
|
8
|
+
"tooltip-content": "_tooltip-content_lwpn2_23"
|
|
9
|
+
}, n = G.bind(Y), Z = 300, q = 100, z = 16, f = 8, B = ["top", "right", "bottom", "left"], tt = ({
|
|
10
10
|
content: u,
|
|
11
11
|
wrapperClassName: h,
|
|
12
12
|
tooltipClassName: w,
|
|
@@ -36,16 +36,16 @@ const U = {
|
|
|
36
36
|
fallbackAxisSideDirection: "start",
|
|
37
37
|
fallbackPlacements: B
|
|
38
38
|
}),
|
|
39
|
-
|
|
39
|
+
$({
|
|
40
40
|
element: r
|
|
41
41
|
})
|
|
42
42
|
],
|
|
43
|
-
whileElementsMounted:
|
|
44
|
-
}), e = T ? null : { width: `${_}px` }, M = document.documentElement.clientWidth, O = e || M -
|
|
43
|
+
whileElementsMounted: C
|
|
44
|
+
}), e = T ? null : { width: `${_}px` }, M = document.documentElement.clientWidth, O = e || M - q, a = () => {
|
|
45
45
|
t.current && clearTimeout(t.current), l(!1);
|
|
46
46
|
}, v = () => {
|
|
47
|
-
t.current = setTimeout(() => l(!0),
|
|
48
|
-
},
|
|
47
|
+
t.current = setTimeout(() => l(!0), Z);
|
|
48
|
+
}, m = () => /* @__PURE__ */ p(
|
|
49
49
|
"div",
|
|
50
50
|
{
|
|
51
51
|
ref: c.setFloating,
|
|
@@ -59,11 +59,11 @@ const U = {
|
|
|
59
59
|
className: n(w),
|
|
60
60
|
children: [
|
|
61
61
|
/* @__PURE__ */ o(
|
|
62
|
-
|
|
62
|
+
U,
|
|
63
63
|
{
|
|
64
64
|
ref: r,
|
|
65
65
|
context: L,
|
|
66
|
-
width:
|
|
66
|
+
width: z,
|
|
67
67
|
height: f,
|
|
68
68
|
fill: b
|
|
69
69
|
}
|
|
@@ -81,7 +81,7 @@ const U = {
|
|
|
81
81
|
]
|
|
82
82
|
}
|
|
83
83
|
);
|
|
84
|
-
return /* @__PURE__ */
|
|
84
|
+
return /* @__PURE__ */ p(D, { children: [
|
|
85
85
|
/* @__PURE__ */ o(
|
|
86
86
|
"div",
|
|
87
87
|
{
|
|
@@ -93,7 +93,7 @@ const U = {
|
|
|
93
93
|
children: W
|
|
94
94
|
}
|
|
95
95
|
),
|
|
96
|
-
i && (s ? R(
|
|
96
|
+
i && (s ? R(m(), s) : m())
|
|
97
97
|
] });
|
|
98
98
|
};
|
|
99
99
|
export {
|
package/package.json
CHANGED
package/dist/button-770f7b20.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { jsxs as w, jsx as z } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as p } from "react";
|
|
3
|
-
import { c as b } from "./bind-06a7ff84.js";
|
|
4
|
-
const l = "_button_giz4s_1", u = "_primary_giz4s_18", x = "_disabled_giz4s_23", f = "_ghost_giz4s_38", y = "_danger_giz4s_59", N = "_text_giz4s_79", B = "_icon_giz4s_133", $ = {
|
|
5
|
-
button: l,
|
|
6
|
-
primary: u,
|
|
7
|
-
disabled: x,
|
|
8
|
-
ghost: f,
|
|
9
|
-
danger: y,
|
|
10
|
-
text: N,
|
|
11
|
-
"width-min-width": "_width-min-width_giz4s_115",
|
|
12
|
-
"width-content": "_width-content_giz4s_119",
|
|
13
|
-
"width-wide-content": "_width-wide-content_giz4s_123",
|
|
14
|
-
"width-parent": "_width-parent_giz4s_128",
|
|
15
|
-
icon: B,
|
|
16
|
-
"icon-start": "_icon-start_giz4s_139",
|
|
17
|
-
"icon-end": "_icon-end_giz4s_143"
|
|
18
|
-
}, o = b.bind($), q = p(
|
|
19
|
-
({
|
|
20
|
-
variant: _ = "primary",
|
|
21
|
-
icon: t,
|
|
22
|
-
iconPlace: i = "start",
|
|
23
|
-
adjustWidthOn: s = "min-width",
|
|
24
|
-
type: c = "button",
|
|
25
|
-
children: r,
|
|
26
|
-
disabled: n = !1,
|
|
27
|
-
onClick: e,
|
|
28
|
-
title: d,
|
|
29
|
-
className: a,
|
|
30
|
-
...g
|
|
31
|
-
}, h) => {
|
|
32
|
-
const m = o("button", _, a, {
|
|
33
|
-
disabled: n,
|
|
34
|
-
[`width-${s}`]: s
|
|
35
|
-
});
|
|
36
|
-
return /* @__PURE__ */ w(
|
|
37
|
-
"button",
|
|
38
|
-
{
|
|
39
|
-
ref: h,
|
|
40
|
-
type: c,
|
|
41
|
-
disabled: n,
|
|
42
|
-
className: m,
|
|
43
|
-
onClick: e,
|
|
44
|
-
title: d,
|
|
45
|
-
...g,
|
|
46
|
-
children: [
|
|
47
|
-
t && /* @__PURE__ */ z(
|
|
48
|
-
"i",
|
|
49
|
-
{
|
|
50
|
-
className: o("icon", {
|
|
51
|
-
[`icon-${i}`]: i
|
|
52
|
-
}),
|
|
53
|
-
children: t
|
|
54
|
-
}
|
|
55
|
-
),
|
|
56
|
-
r
|
|
57
|
-
]
|
|
58
|
-
}
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
);
|
|
62
|
-
export {
|
|
63
|
-
q as B
|
|
64
|
-
};
|
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
import { jsxs as f, jsx as d, Fragment as U } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as _e, useState as q, useRef as he } from "react";
|
|
3
|
-
import { c as J } from "./bind-06a7ff84.js";
|
|
4
|
-
import { useFloating as fe, offset as ge, flip as ue } from "@floating-ui/react-dom";
|
|
5
|
-
import { useSelect as j } from "downshift";
|
|
6
|
-
import { Scrollbars as ye } from "rc-scrollbars";
|
|
7
|
-
import { u as pe } from "./useOnClickOutside-c332f7d3.js";
|
|
8
|
-
import { K as u } from "./keyCodes-f63c0e11.js";
|
|
9
|
-
import { B as me } from "./baseIconButton-251479f7.js";
|
|
10
|
-
import { S as be } from "./dropdown-0260bb66.js";
|
|
11
|
-
import { FieldLabel as Ce } from "./fieldLabel.js";
|
|
12
|
-
import { C as Oe } from "./checkbox-9a6c7ce1.js";
|
|
13
|
-
const Ne = "_disabled_t3cjj_12", De = "_hidden_t3cjj_16", Ee = "_hover_t3cjj_22", we = {
|
|
14
|
-
"dropdown-option": "_dropdown-option_t3cjj_1",
|
|
15
|
-
disabled: Ne,
|
|
16
|
-
hidden: De,
|
|
17
|
-
hover: Ee,
|
|
18
|
-
"single-option": "_single-option_t3cjj_35",
|
|
19
|
-
"sub-option": "_sub-option_t3cjj_42"
|
|
20
|
-
}, z = J.bind(we), G = _e(
|
|
21
|
-
(r, t) => {
|
|
22
|
-
const {
|
|
23
|
-
option: { value: n, disabled: l, hidden: v, label: y, title: c, groupRef: a },
|
|
24
|
-
selected: K,
|
|
25
|
-
onChange: p,
|
|
26
|
-
render: b,
|
|
27
|
-
highlightHovered: C,
|
|
28
|
-
onMouseEnter: A,
|
|
29
|
-
multiSelect: m,
|
|
30
|
-
isPartiallyChecked: O = !1
|
|
31
|
-
} = r, x = (N) => {
|
|
32
|
-
(N.target instanceof HTMLDivElement || N.target instanceof HTMLInputElement) && (p == null || p(n));
|
|
33
|
-
};
|
|
34
|
-
return /* @__PURE__ */ f(
|
|
35
|
-
"div",
|
|
36
|
-
{
|
|
37
|
-
className: z("dropdown-option", {
|
|
38
|
-
disabled: l,
|
|
39
|
-
hidden: v,
|
|
40
|
-
hover: C
|
|
41
|
-
}),
|
|
42
|
-
title: c,
|
|
43
|
-
onClick: x,
|
|
44
|
-
ref: t,
|
|
45
|
-
onMouseEnter: A,
|
|
46
|
-
children: [
|
|
47
|
-
m && /* @__PURE__ */ d(Oe, { value: !!K, partiallyChecked: O }),
|
|
48
|
-
/* @__PURE__ */ d("div", { className: z("single-option", { "sub-option": !!a }), children: b ? b(r) : y })
|
|
49
|
-
]
|
|
50
|
-
}
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
), ve = [
|
|
54
|
-
u.ENTER_KEY_CODE,
|
|
55
|
-
u.SPACE_KEY_CODE,
|
|
56
|
-
u.ARROW_DOWN_KEY_CODE
|
|
57
|
-
], Ke = [u.ESCAPE_KEY_CODE, u.TAB_KEY_CODE];
|
|
58
|
-
var g = /* @__PURE__ */ ((r) => (r.ON_KEY_DOWN = "onKeyDown", r.ON_CLICK = "onClick", r))(g || {});
|
|
59
|
-
const Ae = (r, t) => {
|
|
60
|
-
const n = Array.isArray(t) ? t : [t];
|
|
61
|
-
return r.findIndex(({ value: l }) => n.includes(l));
|
|
62
|
-
}, xe = (r, t) => (r % t + t) % t, P = (r, t = 0, n = 1) => {
|
|
63
|
-
if (!r[t].disabled)
|
|
64
|
-
return t;
|
|
65
|
-
const l = r.length;
|
|
66
|
-
return P(
|
|
67
|
-
r,
|
|
68
|
-
xe(t + n, l),
|
|
69
|
-
n
|
|
70
|
-
);
|
|
71
|
-
}, Ie = (r, t) => P(r, t), ke = (r, t) => P(r, t, -1), je = "_container_1yr7u_1", Pe = "_icon_1yr7u_7", Ye = "_arrow_1yr7u_13", Re = "_dropdown_1yr7u_19", Te = "_disabled_1yr7u_36", He = "_value_1yr7u_43", Me = "_error_1yr7u_46", We = "_touched_1yr7u_46", Le = "_opened_1yr7u_50", Se = "_placeholder_1yr7u_83", Ve = "_ghost_1yr7u_118", $e = "_divider_1yr7u_132", Ue = {
|
|
72
|
-
container: je,
|
|
73
|
-
icon: Pe,
|
|
74
|
-
arrow: Ye,
|
|
75
|
-
dropdown: Re,
|
|
76
|
-
"transparent-background": "_transparent-background_1yr7u_33",
|
|
77
|
-
disabled: Te,
|
|
78
|
-
value: He,
|
|
79
|
-
error: Me,
|
|
80
|
-
touched: We,
|
|
81
|
-
opened: Le,
|
|
82
|
-
placeholder: Se,
|
|
83
|
-
"mobile-disabled": "_mobile-disabled_1yr7u_87",
|
|
84
|
-
"select-list": "_select-list_1yr7u_92",
|
|
85
|
-
"limited-width": "_limited-width_1yr7u_109",
|
|
86
|
-
"options-container": "_options-container_1yr7u_113",
|
|
87
|
-
ghost: Ve,
|
|
88
|
-
divider: $e
|
|
89
|
-
}, o = J.bind(Ue), at = ({
|
|
90
|
-
multiSelect: r = !1,
|
|
91
|
-
value: t = r ? [] : "",
|
|
92
|
-
options: n = [],
|
|
93
|
-
disabled: l = !1,
|
|
94
|
-
error: v,
|
|
95
|
-
onChange: y,
|
|
96
|
-
onFocus: c,
|
|
97
|
-
onBlur: a,
|
|
98
|
-
mobileDisabled: K,
|
|
99
|
-
title: p,
|
|
100
|
-
touched: b = !1,
|
|
101
|
-
icon: C,
|
|
102
|
-
variant: A,
|
|
103
|
-
placeholder: m = "",
|
|
104
|
-
label: O = "",
|
|
105
|
-
renderOption: x,
|
|
106
|
-
transparentBackground: N = !1,
|
|
107
|
-
className: Q,
|
|
108
|
-
toggleButtonClassName: X,
|
|
109
|
-
isListWidthLimited: Z = !1,
|
|
110
|
-
optionAll: Y = { value: "all", label: "All" },
|
|
111
|
-
isOptionAllVisible: R = !1,
|
|
112
|
-
onSelectAll: F = () => {
|
|
113
|
-
},
|
|
114
|
-
formatDisplayedValue: T,
|
|
115
|
-
notScrollable: B = !1,
|
|
116
|
-
footer: H
|
|
117
|
-
}) => {
|
|
118
|
-
const [_, h] = q(!1), M = he(null), [ee, D] = q(null), I = r && Array.isArray(t) ? n.filter((e) => t.includes(e.value)) : null, { refs: W, floatingStyles: te } = fe({
|
|
119
|
-
placement: "bottom-start",
|
|
120
|
-
middleware: [
|
|
121
|
-
ge(5),
|
|
122
|
-
ue({
|
|
123
|
-
fallbackPlacements: ["bottom-start", "top-start", "bottom", "top"]
|
|
124
|
-
})
|
|
125
|
-
]
|
|
126
|
-
}), re = () => {
|
|
127
|
-
if (R && Array.isArray(t)) {
|
|
128
|
-
const e = n.map((s) => s.value);
|
|
129
|
-
y(t.length === n.length ? [] : e), F();
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
pe(M, () => {
|
|
133
|
-
_ && (h(!1), a == null || a());
|
|
134
|
-
});
|
|
135
|
-
const L = (e) => {
|
|
136
|
-
if (!e.disabled) {
|
|
137
|
-
if (r) {
|
|
138
|
-
const s = Array.isArray(t) ? [...t] : [], i = s.indexOf(e.value);
|
|
139
|
-
i === -1 ? s.push(e.value) : s.splice(i, 1), y(s);
|
|
140
|
-
} else
|
|
141
|
-
y(e.value);
|
|
142
|
-
h((s) => r || !s);
|
|
143
|
-
}
|
|
144
|
-
}, ne = () => n.find(({ value: e }) => e === t), S = Ae(n, t), {
|
|
145
|
-
getToggleButtonProps: se,
|
|
146
|
-
getLabelProps: ae,
|
|
147
|
-
getMenuProps: de,
|
|
148
|
-
getItemProps: ie,
|
|
149
|
-
setHighlightedIndex: E,
|
|
150
|
-
highlightedIndex: V,
|
|
151
|
-
selectedItem: w
|
|
152
|
-
} = j({
|
|
153
|
-
items: n,
|
|
154
|
-
itemToString: (e) => (e != null && e.label ? String(e.label) : m) || "",
|
|
155
|
-
selectedItem: ne(),
|
|
156
|
-
isOpen: _,
|
|
157
|
-
circularNavigation: !0,
|
|
158
|
-
defaultHighlightedIndex: S,
|
|
159
|
-
onHighlightedIndexChange: (e) => {
|
|
160
|
-
switch (e.type) {
|
|
161
|
-
case j.stateChangeTypes.MenuKeyDownArrowUp:
|
|
162
|
-
return D(g.ON_KEY_DOWN), E(ke(n, e.highlightedIndex)), e;
|
|
163
|
-
case j.stateChangeTypes.MenuKeyDownArrowDown:
|
|
164
|
-
return D(g.ON_KEY_DOWN), E(Ie(n, e.highlightedIndex)), e;
|
|
165
|
-
default:
|
|
166
|
-
return e;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}), le = () => {
|
|
170
|
-
l || (h((e) => !e), _ ? a == null || a() : c == null || c(), D(g.ON_CLICK));
|
|
171
|
-
}, k = (() => {
|
|
172
|
-
if (r && Array.isArray(t) && n.length === t.length)
|
|
173
|
-
return Y.label;
|
|
174
|
-
const e = n.reduce((s, i) => ((Array.isArray(t) && t.includes(i.value) || i.value === t) && s.push(i.label), s), []);
|
|
175
|
-
if (e.length > 0)
|
|
176
|
-
return e.join(", ");
|
|
177
|
-
if (!t && t !== !1 && t !== 0 || Array.isArray(t) && !t.length)
|
|
178
|
-
return m;
|
|
179
|
-
})(), oe = (e) => {
|
|
180
|
-
const { keyCode: s } = e;
|
|
181
|
-
ve.includes(s) && !_ && (e.preventDefault(), E(S), h(!0), c == null || c(), D(g.ON_KEY_DOWN));
|
|
182
|
-
}, ce = (e) => {
|
|
183
|
-
const { keyCode: s } = e;
|
|
184
|
-
if (s === u.ENTER_KEY_CODE) {
|
|
185
|
-
const i = n[V];
|
|
186
|
-
L(i), r || (h(!1), a == null || a());
|
|
187
|
-
return;
|
|
188
|
-
}
|
|
189
|
-
Ke.includes(s) && (e.stopPropagation(), h(!1), a == null || a());
|
|
190
|
-
}, $ = () => /* @__PURE__ */ f("div", { className: o("options-container"), children: [
|
|
191
|
-
r && R && Array.isArray(t) && /* @__PURE__ */ f(U, { children: [
|
|
192
|
-
/* @__PURE__ */ d(
|
|
193
|
-
G,
|
|
194
|
-
{
|
|
195
|
-
option: Y,
|
|
196
|
-
selected: t.length === n.length,
|
|
197
|
-
onChange: re,
|
|
198
|
-
multiSelect: r,
|
|
199
|
-
isPartiallyChecked: !!t.length
|
|
200
|
-
}
|
|
201
|
-
),
|
|
202
|
-
/* @__PURE__ */ d("div", { className: o("divider") }),
|
|
203
|
-
" "
|
|
204
|
-
] }),
|
|
205
|
-
n.map((e, s) => /* @__PURE__ */ d(
|
|
206
|
-
G,
|
|
207
|
-
{
|
|
208
|
-
...ie({
|
|
209
|
-
item: e,
|
|
210
|
-
index: s
|
|
211
|
-
}),
|
|
212
|
-
multiSelect: r,
|
|
213
|
-
selected: r ? I == null ? void 0 : I.some((i) => i.value === e.value) : e.value === ((w == null ? void 0 : w.value) ?? w),
|
|
214
|
-
option: { title: e.label, ...e },
|
|
215
|
-
highlightHovered: V === s && ee !== g.ON_CLICK,
|
|
216
|
-
render: x,
|
|
217
|
-
onChange: e.disabled ? null : () => L(e),
|
|
218
|
-
onMouseEnter: () => E(s)
|
|
219
|
-
},
|
|
220
|
-
e.value
|
|
221
|
-
)),
|
|
222
|
-
H && /* @__PURE__ */ f(U, { children: [
|
|
223
|
-
/* @__PURE__ */ d("div", { className: o("divider") }),
|
|
224
|
-
H
|
|
225
|
-
] })
|
|
226
|
-
] });
|
|
227
|
-
return /* @__PURE__ */ f("div", { ref: M, className: o("container", Q), title: p, children: [
|
|
228
|
-
O && /* @__PURE__ */ d(Ce, { ...ae(), children: O }),
|
|
229
|
-
/* @__PURE__ */ f(
|
|
230
|
-
"button",
|
|
231
|
-
{
|
|
232
|
-
disabled: l,
|
|
233
|
-
...se({
|
|
234
|
-
className: o("dropdown", A, X, {
|
|
235
|
-
"transparent-background": N,
|
|
236
|
-
opened: _,
|
|
237
|
-
disabled: l,
|
|
238
|
-
error: v,
|
|
239
|
-
touched: b,
|
|
240
|
-
"mobile-disabled": K
|
|
241
|
-
}),
|
|
242
|
-
onClick: le,
|
|
243
|
-
onKeyDown: oe,
|
|
244
|
-
ref: W.setReference
|
|
245
|
-
}),
|
|
246
|
-
type: "button",
|
|
247
|
-
children: [
|
|
248
|
-
C && /* @__PURE__ */ d("span", { className: o("icon"), children: C }),
|
|
249
|
-
/* @__PURE__ */ d(
|
|
250
|
-
"span",
|
|
251
|
-
{
|
|
252
|
-
className: o("value", {
|
|
253
|
-
placeholder: k === m
|
|
254
|
-
}),
|
|
255
|
-
children: T ? T(k) : k
|
|
256
|
-
}
|
|
257
|
-
),
|
|
258
|
-
/* @__PURE__ */ d(me, { className: o("arrow"), tabIndex: -1, children: /* @__PURE__ */ d(be, {}) })
|
|
259
|
-
]
|
|
260
|
-
}
|
|
261
|
-
),
|
|
262
|
-
_ && /* @__PURE__ */ d(
|
|
263
|
-
"div",
|
|
264
|
-
{
|
|
265
|
-
style: te,
|
|
266
|
-
className: o("select-list", { opened: _, "limited-width": Z }),
|
|
267
|
-
...de({
|
|
268
|
-
onKeyDown: ce,
|
|
269
|
-
ref: W.setFloating
|
|
270
|
-
}),
|
|
271
|
-
children: B ? $() : /* @__PURE__ */ d(ye, { autoHeight: !0, autoHeightMax: 216, hideTracksWhenNotNeeded: !0, children: $() })
|
|
272
|
-
}
|
|
273
|
-
)
|
|
274
|
-
] });
|
|
275
|
-
};
|
|
276
|
-
export {
|
|
277
|
-
at as D
|
|
278
|
-
};
|