@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,64 @@
|
|
|
1
|
+
import { jsxs as p, jsx as b } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as l } from "react";
|
|
3
|
+
import { c as u } from "./bind-06a7ff84.js";
|
|
4
|
+
const x = "_button_108em_1", f = "_primary_108em_18", g = "_disabled_108em_23", y = "_ghost_108em_38", N = "_danger_108em_59", B = "_text_108em_79", $ = "_icon_108em_133", j = {
|
|
5
|
+
button: x,
|
|
6
|
+
primary: f,
|
|
7
|
+
disabled: g,
|
|
8
|
+
ghost: y,
|
|
9
|
+
danger: N,
|
|
10
|
+
text: B,
|
|
11
|
+
"width-min-width": "_width-min-width_108em_115",
|
|
12
|
+
"width-content": "_width-content_108em_119",
|
|
13
|
+
"width-wide-content": "_width-wide-content_108em_123",
|
|
14
|
+
"width-parent": "_width-parent_108em_128",
|
|
15
|
+
icon: $,
|
|
16
|
+
"icon-start": "_icon-start_108em_139",
|
|
17
|
+
"icon-end": "_icon-end_108em_143"
|
|
18
|
+
}, _ = u.bind(j), v = l(
|
|
19
|
+
({
|
|
20
|
+
variant: i = "primary",
|
|
21
|
+
icon: t,
|
|
22
|
+
iconPlace: n = "start",
|
|
23
|
+
adjustWidthOn: e = "min-width",
|
|
24
|
+
type: s = "button",
|
|
25
|
+
children: c,
|
|
26
|
+
disabled: o = !1,
|
|
27
|
+
onClick: m,
|
|
28
|
+
title: r,
|
|
29
|
+
className: d,
|
|
30
|
+
...a
|
|
31
|
+
}, h) => {
|
|
32
|
+
const w = _("button", i, d, {
|
|
33
|
+
disabled: o,
|
|
34
|
+
[`width-${e}`]: e
|
|
35
|
+
});
|
|
36
|
+
return /* @__PURE__ */ p(
|
|
37
|
+
"button",
|
|
38
|
+
{
|
|
39
|
+
ref: h,
|
|
40
|
+
type: s,
|
|
41
|
+
disabled: o,
|
|
42
|
+
className: w,
|
|
43
|
+
onClick: m,
|
|
44
|
+
title: r,
|
|
45
|
+
...a,
|
|
46
|
+
children: [
|
|
47
|
+
t && /* @__PURE__ */ b(
|
|
48
|
+
"i",
|
|
49
|
+
{
|
|
50
|
+
className: _("icon", {
|
|
51
|
+
[`icon-${n}`]: n
|
|
52
|
+
}),
|
|
53
|
+
children: t
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
c
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
export {
|
|
63
|
+
v as B
|
|
64
|
+
};
|
package/dist/button.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { jsxs as x, jsx as
|
|
1
|
+
import { jsxs as x, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { c as f } from "./bind-06a7ff84.js";
|
|
3
3
|
import { useRef as y, useId as C } from "react";
|
|
4
4
|
import { K as p } from "./keyCodes-f63c0e11.js";
|
|
5
|
-
const E = "
|
|
5
|
+
const E = "_checkbox_1tbt5_1", D = "_disabled_1tbt5_11", K = "_input_1tbt5_16", N = "_control_1tbt5_23", I = "_children_1tbt5_149", R = {
|
|
6
6
|
checkbox: E,
|
|
7
7
|
disabled: D,
|
|
8
8
|
input: K,
|
|
9
9
|
control: N,
|
|
10
|
-
"partially-checked": "_partially-
|
|
10
|
+
"partially-checked": "_partially-checked_1tbt5_76",
|
|
11
11
|
children: I
|
|
12
12
|
}, e = f.bind(R), A = ({
|
|
13
|
-
children:
|
|
13
|
+
children: s,
|
|
14
14
|
disabled: c = !1,
|
|
15
15
|
onChange: d,
|
|
16
16
|
className: h,
|
|
17
17
|
value: r,
|
|
18
|
-
partiallyChecked:
|
|
18
|
+
partiallyChecked: k,
|
|
19
19
|
title: l,
|
|
20
20
|
...u
|
|
21
21
|
}) => {
|
|
22
|
-
const
|
|
23
|
-
var
|
|
24
|
-
const { keyCode: i } =
|
|
22
|
+
const t = y(null), a = C(), m = (o) => {
|
|
23
|
+
var _, b;
|
|
24
|
+
const { keyCode: i } = o;
|
|
25
25
|
if (i === p.SPACE_KEY_CODE) {
|
|
26
|
-
|
|
26
|
+
o.preventDefault(), (_ = t.current) == null || _.click();
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
-
i === p.ENTER_KEY_CODE && (
|
|
29
|
+
i === p.ENTER_KEY_CODE && (o.preventDefault(), (b = t.current) == null || b.click());
|
|
30
30
|
};
|
|
31
31
|
return /* @__PURE__ */ x(
|
|
32
32
|
"label",
|
|
@@ -37,14 +37,14 @@ const E = "_checkbox_189ko_1", D = "_disabled_189ko_11", K = "_input_189ko_16",
|
|
|
37
37
|
}),
|
|
38
38
|
title: l,
|
|
39
39
|
children: [
|
|
40
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ n(
|
|
41
41
|
"input",
|
|
42
42
|
{
|
|
43
|
-
ref:
|
|
43
|
+
ref: t,
|
|
44
44
|
tabIndex: 0,
|
|
45
45
|
type: "checkbox",
|
|
46
46
|
onKeyDown: m,
|
|
47
|
-
className: e("input", { "partially-checked":
|
|
47
|
+
className: e("input", { "partially-checked": k }),
|
|
48
48
|
disabled: c,
|
|
49
49
|
onChange: d,
|
|
50
50
|
checked: r,
|
|
@@ -52,7 +52,7 @@ const E = "_checkbox_189ko_1", D = "_disabled_189ko_11", K = "_input_189ko_16",
|
|
|
52
52
|
...u
|
|
53
53
|
}
|
|
54
54
|
),
|
|
55
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ n(
|
|
56
56
|
"span",
|
|
57
57
|
{
|
|
58
58
|
"aria-labelledby": a,
|
|
@@ -63,7 +63,7 @@ const E = "_checkbox_189ko_1", D = "_disabled_189ko_11", K = "_input_189ko_16",
|
|
|
63
63
|
})
|
|
64
64
|
}
|
|
65
65
|
),
|
|
66
|
-
|
|
66
|
+
s && /* @__PURE__ */ n("span", { className: e("children", { disabled: c }), children: s })
|
|
67
67
|
]
|
|
68
68
|
}
|
|
69
69
|
);
|
package/dist/checkbox.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as x, Fragment as U, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import $ from "react-datepicker/dist/es/index.js";
|
|
3
3
|
import { c as R } from "./bind-06a7ff84.js";
|
|
4
4
|
import { useMemo as P, useRef as B } from "react";
|
|
5
|
-
import { F as D } from "./fieldText-
|
|
6
|
-
import { a as E, S as
|
|
7
|
-
import { D as T } from "./dropdown-
|
|
8
|
-
import { registerLocale as
|
|
5
|
+
import { F as D } from "./fieldText-e605a521.js";
|
|
6
|
+
import { a as E, S as j } from "./calendarArrow-3e1339ea.js";
|
|
7
|
+
import { D as T } from "./dropdown-13d7d50e.js";
|
|
8
|
+
import { registerLocale as G } from "react-datepicker";
|
|
9
9
|
const pe = (r, s) => {
|
|
10
|
-
|
|
11
|
-
},
|
|
10
|
+
G(r, s);
|
|
11
|
+
}, H = (r, s = 20) => {
|
|
12
12
|
const l = r + s;
|
|
13
13
|
return new Array(l - r).fill(void 0).map((g, o) => r - o);
|
|
14
|
-
},
|
|
15
|
-
header:
|
|
16
|
-
"dropdowns-wrapper": "_dropdowns-
|
|
17
|
-
"button-prev": "_button-
|
|
18
|
-
"button-next": "_button-
|
|
19
|
-
disabled:
|
|
20
|
-
dropdown:
|
|
21
|
-
"month-dropdown": "_month-
|
|
22
|
-
"toggle-button": "_toggle-
|
|
14
|
+
}, V = "_header_1q16i_1", O = "_disabled_1q16i_25", W = "_dropdown_1q16i_8", z = {
|
|
15
|
+
header: V,
|
|
16
|
+
"dropdowns-wrapper": "_dropdowns-wrapper_1q16i_8",
|
|
17
|
+
"button-prev": "_button-prev_1q16i_13",
|
|
18
|
+
"button-next": "_button-next_1q16i_14",
|
|
19
|
+
disabled: O,
|
|
20
|
+
dropdown: W,
|
|
21
|
+
"month-dropdown": "_month-dropdown_1q16i_44",
|
|
22
|
+
"toggle-button": "_toggle-button_1q16i_47"
|
|
23
23
|
}, a = R.bind(z), J = ({
|
|
24
24
|
date: r = /* @__PURE__ */ new Date(),
|
|
25
25
|
changeYear: s = () => {
|
|
@@ -35,27 +35,27 @@ const pe = (r, s) => {
|
|
|
35
35
|
headerNodes: b = null,
|
|
36
36
|
customClassName: w = "",
|
|
37
37
|
yearsOptions: i = [],
|
|
38
|
-
locale:
|
|
38
|
+
locale: C
|
|
39
39
|
}) => {
|
|
40
|
-
const p = r.getFullYear(),
|
|
41
|
-
const e = Array(12).keys(),
|
|
40
|
+
const p = r.getFullYear(), N = r.getMonth(), f = P(() => {
|
|
41
|
+
const e = Array(12).keys(), d = new Intl.DateTimeFormat(C, {
|
|
42
42
|
month: "long"
|
|
43
|
-
}),
|
|
44
|
-
return Array.from(e,
|
|
45
|
-
value:
|
|
46
|
-
label:
|
|
43
|
+
}), c = (m) => d.format(new Date(p, m));
|
|
44
|
+
return Array.from(e, c).reduce((m, k, S) => m.concat({
|
|
45
|
+
value: S,
|
|
46
|
+
label: k
|
|
47
47
|
}), []);
|
|
48
|
-
}, []),
|
|
49
|
-
(
|
|
48
|
+
}, []), v = P(() => (i.length > 0 ? i : H(p)).reduce(
|
|
49
|
+
(d, c) => d.concat({ value: c, label: `${c}` }),
|
|
50
50
|
[]
|
|
51
|
-
), [i]),
|
|
51
|
+
), [i]), y = (e) => {
|
|
52
52
|
l(e);
|
|
53
|
-
},
|
|
53
|
+
}, A = (e) => {
|
|
54
54
|
s(e);
|
|
55
55
|
};
|
|
56
|
-
return /* @__PURE__ */
|
|
56
|
+
return /* @__PURE__ */ x(U, { children: [
|
|
57
57
|
b && /* @__PURE__ */ t("div", { className: a(w), children: b }),
|
|
58
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ x("div", { className: a("header"), children: [
|
|
59
59
|
/* @__PURE__ */ t(
|
|
60
60
|
"button",
|
|
61
61
|
{
|
|
@@ -68,13 +68,13 @@ const pe = (r, s) => {
|
|
|
68
68
|
children: /* @__PURE__ */ t(E, {})
|
|
69
69
|
}
|
|
70
70
|
),
|
|
71
|
-
/* @__PURE__ */
|
|
71
|
+
/* @__PURE__ */ x("div", { className: a("dropdowns-wrapper"), children: [
|
|
72
72
|
/* @__PURE__ */ t(
|
|
73
73
|
T,
|
|
74
74
|
{
|
|
75
75
|
options: f,
|
|
76
|
-
value:
|
|
77
|
-
onChange:
|
|
76
|
+
value: N,
|
|
77
|
+
onChange: y,
|
|
78
78
|
transparentBackground: !0,
|
|
79
79
|
className: a("dropdown", "month-dropdown"),
|
|
80
80
|
toggleButtonClassName: a("toggle-button")
|
|
@@ -83,9 +83,9 @@ const pe = (r, s) => {
|
|
|
83
83
|
/* @__PURE__ */ t(
|
|
84
84
|
T,
|
|
85
85
|
{
|
|
86
|
-
options:
|
|
86
|
+
options: v,
|
|
87
87
|
value: p,
|
|
88
|
-
onChange:
|
|
88
|
+
onChange: A,
|
|
89
89
|
transparentBackground: !0,
|
|
90
90
|
className: a("dropdown"),
|
|
91
91
|
toggleButtonClassName: a("toggle-button")
|
|
@@ -106,12 +106,12 @@ const pe = (r, s) => {
|
|
|
106
106
|
)
|
|
107
107
|
] })
|
|
108
108
|
] });
|
|
109
|
-
}, K = "
|
|
109
|
+
}, K = "_calendar_1pok6_5", Q = "_date_1pok6_90", X = "_disabled_1pok6_202", Z = "_popper_1pok6_210", ee = "_input_1pok6_214", oe = {
|
|
110
110
|
calendar: K,
|
|
111
|
-
"current-date": "_current-
|
|
111
|
+
"current-date": "_current-date_1pok6_89",
|
|
112
112
|
date: Q,
|
|
113
|
-
"selected-range": "_selected-
|
|
114
|
-
"end-date": "_end-
|
|
113
|
+
"selected-range": "_selected-range_1pok6_119",
|
|
114
|
+
"end-date": "_end-date_1pok6_119",
|
|
115
115
|
disabled: X,
|
|
116
116
|
popper: Z,
|
|
117
117
|
input: ee
|
|
@@ -129,22 +129,22 @@ const pe = (r, s) => {
|
|
|
129
129
|
customClassName: b = "",
|
|
130
130
|
customTimeInput: w = void 0,
|
|
131
131
|
shouldCloseOnSelect: i = !0,
|
|
132
|
-
popperClassName:
|
|
132
|
+
popperClassName: C = "",
|
|
133
133
|
calendarClassName: p = "",
|
|
134
|
-
fixedHeight:
|
|
134
|
+
fixedHeight: N = !1,
|
|
135
135
|
language: f = ne,
|
|
136
|
-
yearsOptions:
|
|
137
|
-
placeholder:
|
|
138
|
-
dateFormat:
|
|
136
|
+
yearsOptions: v = [],
|
|
137
|
+
placeholder: y = L.toUpperCase(),
|
|
138
|
+
dateFormat: A = L,
|
|
139
139
|
selects: e = "start",
|
|
140
|
-
value:
|
|
140
|
+
value: d = null
|
|
141
141
|
}) => {
|
|
142
|
-
const
|
|
143
|
-
const
|
|
142
|
+
const c = B(null), F = n == null ? void 0 : n.toDateString(), m = o == null ? void 0 : o.toDateString(), k = o && n && o > n, S = (u) => {
|
|
143
|
+
const M = u.toDateString(), Y = M === F, q = k && M === m, I = n && o && u > n && u < o;
|
|
144
144
|
return _("date", {
|
|
145
145
|
"current-date": Y,
|
|
146
|
-
"selected-range": I && !
|
|
147
|
-
"end-date":
|
|
146
|
+
"selected-range": I && !q,
|
|
147
|
+
"end-date": q && k,
|
|
148
148
|
disabled: s
|
|
149
149
|
});
|
|
150
150
|
};
|
|
@@ -156,21 +156,21 @@ const pe = (r, s) => {
|
|
|
156
156
|
{
|
|
157
157
|
className: _("input"),
|
|
158
158
|
defaultWidth: !1,
|
|
159
|
-
endIcon: /* @__PURE__ */ t(
|
|
160
|
-
ref:
|
|
159
|
+
endIcon: /* @__PURE__ */ t(j, {}),
|
|
160
|
+
ref: c
|
|
161
161
|
}
|
|
162
162
|
),
|
|
163
|
-
placeholderText:
|
|
164
|
-
selected:
|
|
163
|
+
placeholderText: y,
|
|
164
|
+
selected: d,
|
|
165
165
|
startDate: n,
|
|
166
166
|
endDate: o,
|
|
167
167
|
minDate: e === "end" ? n : void 0,
|
|
168
168
|
disabled: s,
|
|
169
169
|
shouldCloseOnSelect: i,
|
|
170
|
-
fixedHeight:
|
|
170
|
+
fixedHeight: N,
|
|
171
171
|
locale: f,
|
|
172
172
|
showPopperArrow: !1,
|
|
173
|
-
dayClassName:
|
|
173
|
+
dayClassName: S,
|
|
174
174
|
calendarClassName: _(p, "calendar"),
|
|
175
175
|
renderCustomHeader: (u) => /* @__PURE__ */ t(
|
|
176
176
|
J,
|
|
@@ -178,7 +178,7 @@ const pe = (r, s) => {
|
|
|
178
178
|
...u,
|
|
179
179
|
headerNodes: h,
|
|
180
180
|
customClassName: b,
|
|
181
|
-
yearsOptions:
|
|
181
|
+
yearsOptions: v,
|
|
182
182
|
locale: f
|
|
183
183
|
}
|
|
184
184
|
),
|
|
@@ -187,8 +187,8 @@ const pe = (r, s) => {
|
|
|
187
187
|
onFocus: g,
|
|
188
188
|
customTimeInput: w,
|
|
189
189
|
showTimeInput: !!w,
|
|
190
|
-
popperClassName: _(
|
|
191
|
-
dateFormat:
|
|
190
|
+
popperClassName: _(C, "popper"),
|
|
191
|
+
dateFormat: A,
|
|
192
192
|
selectsStart: e === "start",
|
|
193
193
|
selectsEnd: e === "end",
|
|
194
194
|
className: _("datepicker")
|
package/dist/datePicker.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { D as t } from "./datePicker-
|
|
2
|
-
import { r as v } from "./datePicker-
|
|
1
|
+
import { D as t } from "./datePicker-382ef010.js";
|
|
2
|
+
import { r as v } from "./datePicker-382ef010.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react-datepicker/dist/es/index.js";
|
|
5
5
|
import "./bind-06a7ff84.js";
|
|
6
6
|
import "react";
|
|
7
|
-
import "./fieldText-
|
|
7
|
+
import "./fieldText-e605a521.js";
|
|
8
8
|
import "./openEye-7b9cf080.js";
|
|
9
|
-
import "./button-
|
|
9
|
+
import "./button-33bc880f.js";
|
|
10
10
|
import "./spinLoader-c4a53718.js";
|
|
11
11
|
import "./maxValueDisplay-9be01a75.js";
|
|
12
12
|
import "./fieldLabel.js";
|
|
13
13
|
import "./calendarArrow-3e1339ea.js";
|
|
14
|
-
import "./dropdown-
|
|
14
|
+
import "./dropdown-13d7d50e.js";
|
|
15
15
|
import "@floating-ui/react-dom";
|
|
16
16
|
import "downshift";
|
|
17
17
|
import "rc-scrollbars";
|
|
@@ -19,7 +19,7 @@ import "./useOnClickOutside-c332f7d3.js";
|
|
|
19
19
|
import "./keyCodes-f63c0e11.js";
|
|
20
20
|
import "./baseIconButton-251479f7.js";
|
|
21
21
|
import "./dropdown-0260bb66.js";
|
|
22
|
-
import "./checkbox-
|
|
22
|
+
import "./checkbox-aa91985d.js";
|
|
23
23
|
import "react-datepicker";
|
|
24
24
|
export {
|
|
25
25
|
t as DatePicker,
|
|
@@ -0,0 +1,278 @@
|
|
|
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 pe } from "@floating-ui/react-dom";
|
|
5
|
+
import { useSelect as P } from "downshift";
|
|
6
|
+
import { Scrollbars as me } from "rc-scrollbars";
|
|
7
|
+
import { u as ue } from "./useOnClickOutside-c332f7d3.js";
|
|
8
|
+
import { K as p } from "./keyCodes-f63c0e11.js";
|
|
9
|
+
import { B as ye } from "./baseIconButton-251479f7.js";
|
|
10
|
+
import { S as be } from "./dropdown-0260bb66.js";
|
|
11
|
+
import { FieldLabel as xe } from "./fieldLabel.js";
|
|
12
|
+
import { C as Ce } from "./checkbox-aa91985d.js";
|
|
13
|
+
const Oe = "_disabled_1a01l_12", ke = "_hidden_1a01l_16", Ne = "_hover_1a01l_22", De = {
|
|
14
|
+
"dropdown-option": "_dropdown-option_1a01l_1",
|
|
15
|
+
disabled: Oe,
|
|
16
|
+
hidden: ke,
|
|
17
|
+
hover: Ne,
|
|
18
|
+
"single-option": "_single-option_1a01l_35",
|
|
19
|
+
"sub-option": "_sub-option_1a01l_42"
|
|
20
|
+
}, z = J.bind(De), G = _e(
|
|
21
|
+
(n, t) => {
|
|
22
|
+
const {
|
|
23
|
+
option: { value: r, disabled: i, hidden: E, label: m, title: c, groupRef: s },
|
|
24
|
+
selected: w,
|
|
25
|
+
onChange: u,
|
|
26
|
+
render: b,
|
|
27
|
+
highlightHovered: x,
|
|
28
|
+
onMouseEnter: v,
|
|
29
|
+
multiSelect: y,
|
|
30
|
+
isPartiallyChecked: C = !1
|
|
31
|
+
} = n, K = (O) => {
|
|
32
|
+
(O.target instanceof HTMLDivElement || O.target instanceof HTMLInputElement) && (u == null || u(r));
|
|
33
|
+
};
|
|
34
|
+
return /* @__PURE__ */ f(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
className: z("dropdown-option", {
|
|
38
|
+
disabled: i,
|
|
39
|
+
hidden: E,
|
|
40
|
+
hover: x
|
|
41
|
+
}),
|
|
42
|
+
title: c,
|
|
43
|
+
onClick: K,
|
|
44
|
+
ref: t,
|
|
45
|
+
onMouseEnter: v,
|
|
46
|
+
children: [
|
|
47
|
+
y && /* @__PURE__ */ d(Ce, { value: !!w, partiallyChecked: C }),
|
|
48
|
+
/* @__PURE__ */ d("div", { className: z("single-option", { "sub-option": !!s }), children: b ? b(n) : m })
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
), Ee = [
|
|
54
|
+
p.ENTER_KEY_CODE,
|
|
55
|
+
p.SPACE_KEY_CODE,
|
|
56
|
+
p.ARROW_DOWN_KEY_CODE
|
|
57
|
+
], we = [p.ESCAPE_KEY_CODE, p.TAB_KEY_CODE];
|
|
58
|
+
var g = /* @__PURE__ */ ((n) => (n.ON_KEY_DOWN = "onKeyDown", n.ON_CLICK = "onClick", n))(g || {});
|
|
59
|
+
const ve = (n, t) => {
|
|
60
|
+
const r = Array.isArray(t) ? t : [t];
|
|
61
|
+
return n.findIndex(({ value: i }) => r.includes(i));
|
|
62
|
+
}, Ke = (n, t) => (n % t + t) % t, Y = (n, t = 0, r = 1) => {
|
|
63
|
+
if (!n[t].disabled)
|
|
64
|
+
return t;
|
|
65
|
+
const i = n.length;
|
|
66
|
+
return Y(
|
|
67
|
+
n,
|
|
68
|
+
Ke(t + r, i),
|
|
69
|
+
r
|
|
70
|
+
);
|
|
71
|
+
}, Ae = (n, t) => Y(n, t), Ie = (n, t) => Y(n, t, -1), Pe = "_container_1xhk2_1", Ye = "_icon_1xhk2_7", Re = "_arrow_1xhk2_13", Te = "_dropdown_1xhk2_19", He = "_disabled_1xhk2_36", Me = "_value_1xhk2_43", We = "_error_1xhk2_46", Le = "_touched_1xhk2_46", Se = "_opened_1xhk2_50", je = "_placeholder_1xhk2_83", Ve = "_ghost_1xhk2_118", $e = "_divider_1xhk2_132", Ue = {
|
|
72
|
+
container: Pe,
|
|
73
|
+
icon: Ye,
|
|
74
|
+
arrow: Re,
|
|
75
|
+
dropdown: Te,
|
|
76
|
+
"transparent-background": "_transparent-background_1xhk2_33",
|
|
77
|
+
disabled: He,
|
|
78
|
+
value: Me,
|
|
79
|
+
error: We,
|
|
80
|
+
touched: Le,
|
|
81
|
+
opened: Se,
|
|
82
|
+
placeholder: je,
|
|
83
|
+
"mobile-disabled": "_mobile-disabled_1xhk2_87",
|
|
84
|
+
"select-list": "_select-list_1xhk2_92",
|
|
85
|
+
"limited-width": "_limited-width_1xhk2_109",
|
|
86
|
+
"options-container": "_options-container_1xhk2_113",
|
|
87
|
+
ghost: Ve,
|
|
88
|
+
divider: $e
|
|
89
|
+
}, o = J.bind(Ue), st = ({
|
|
90
|
+
multiSelect: n = !1,
|
|
91
|
+
value: t = n ? [] : "",
|
|
92
|
+
options: r = [],
|
|
93
|
+
disabled: i = !1,
|
|
94
|
+
error: E,
|
|
95
|
+
onChange: m,
|
|
96
|
+
onFocus: c,
|
|
97
|
+
onBlur: s,
|
|
98
|
+
mobileDisabled: w,
|
|
99
|
+
title: u,
|
|
100
|
+
touched: b = !1,
|
|
101
|
+
icon: x,
|
|
102
|
+
variant: v,
|
|
103
|
+
placeholder: y = "",
|
|
104
|
+
label: C = "",
|
|
105
|
+
renderOption: K,
|
|
106
|
+
transparentBackground: O = !1,
|
|
107
|
+
className: Q,
|
|
108
|
+
toggleButtonClassName: X,
|
|
109
|
+
isListWidthLimited: Z = !1,
|
|
110
|
+
optionAll: R = { value: "all", label: "All" },
|
|
111
|
+
isOptionAllVisible: T = !1,
|
|
112
|
+
onSelectAll: F = () => {
|
|
113
|
+
},
|
|
114
|
+
formatDisplayedValue: H,
|
|
115
|
+
notScrollable: B = !1,
|
|
116
|
+
footer: M
|
|
117
|
+
}) => {
|
|
118
|
+
const [_, h] = q(!1), W = he(null), [ee, k] = q(null), A = n && Array.isArray(t) ? r.filter((e) => t.includes(e.value)) : null, { refs: L, floatingStyles: te } = fe({
|
|
119
|
+
placement: "bottom-start",
|
|
120
|
+
middleware: [
|
|
121
|
+
ge(5),
|
|
122
|
+
pe({
|
|
123
|
+
fallbackPlacements: ["bottom-start", "top-start", "bottom", "top"]
|
|
124
|
+
})
|
|
125
|
+
]
|
|
126
|
+
}), ne = () => {
|
|
127
|
+
if (T && Array.isArray(t)) {
|
|
128
|
+
const e = r.map((a) => a.value);
|
|
129
|
+
m(t.length === r.length ? [] : e), F();
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
ue(W, () => {
|
|
133
|
+
_ && (h(!1), s == null || s());
|
|
134
|
+
});
|
|
135
|
+
const S = (e) => {
|
|
136
|
+
if (!e.disabled) {
|
|
137
|
+
if (n) {
|
|
138
|
+
const a = Array.isArray(t) ? [...t] : [], l = a.indexOf(e.value);
|
|
139
|
+
l === -1 ? a.push(e.value) : a.splice(l, 1), m(a);
|
|
140
|
+
} else
|
|
141
|
+
m(e.value);
|
|
142
|
+
h((a) => n || !a);
|
|
143
|
+
}
|
|
144
|
+
}, re = () => r.find(({ value: e }) => e === t), j = ve(r, t), {
|
|
145
|
+
getToggleButtonProps: ae,
|
|
146
|
+
getLabelProps: se,
|
|
147
|
+
getMenuProps: de,
|
|
148
|
+
getItemProps: le,
|
|
149
|
+
setHighlightedIndex: N,
|
|
150
|
+
highlightedIndex: V,
|
|
151
|
+
selectedItem: D
|
|
152
|
+
} = P({
|
|
153
|
+
items: r,
|
|
154
|
+
itemToString: (e) => (e != null && e.label ? String(e.label) : y) || "",
|
|
155
|
+
selectedItem: re(),
|
|
156
|
+
isOpen: _,
|
|
157
|
+
circularNavigation: !0,
|
|
158
|
+
defaultHighlightedIndex: j,
|
|
159
|
+
onHighlightedIndexChange: (e) => {
|
|
160
|
+
switch (e.type) {
|
|
161
|
+
case P.stateChangeTypes.MenuKeyDownArrowUp:
|
|
162
|
+
return k(g.ON_KEY_DOWN), N(Ie(r, e.highlightedIndex)), e;
|
|
163
|
+
case P.stateChangeTypes.MenuKeyDownArrowDown:
|
|
164
|
+
return k(g.ON_KEY_DOWN), N(Ae(r, e.highlightedIndex)), e;
|
|
165
|
+
default:
|
|
166
|
+
return e;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}), ie = () => {
|
|
170
|
+
i || (h((e) => !e), _ ? s == null || s() : c == null || c(), k(g.ON_CLICK));
|
|
171
|
+
}, I = (() => {
|
|
172
|
+
if (n && Array.isArray(t) && r.length === t.length)
|
|
173
|
+
return R.label;
|
|
174
|
+
const e = r.reduce((a, l) => ((Array.isArray(t) && t.includes(l.value) || l.value === t) && a.push(l.label), a), []);
|
|
175
|
+
if (e.length > 0)
|
|
176
|
+
return e.join(", ");
|
|
177
|
+
if (!t && t !== !1 && t !== 0 || Array.isArray(t) && !t.length)
|
|
178
|
+
return y;
|
|
179
|
+
})(), oe = (e) => {
|
|
180
|
+
const { keyCode: a } = e;
|
|
181
|
+
Ee.includes(a) && !_ && (e.preventDefault(), N(j), h(!0), c == null || c(), k(g.ON_KEY_DOWN));
|
|
182
|
+
}, ce = (e) => {
|
|
183
|
+
const { keyCode: a } = e;
|
|
184
|
+
if (a === p.ENTER_KEY_CODE) {
|
|
185
|
+
const l = r[V];
|
|
186
|
+
S(l), n || (h(!1), s == null || s());
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
we.includes(a) && (e.stopPropagation(), h(!1), s == null || s());
|
|
190
|
+
}, $ = () => /* @__PURE__ */ f("div", { className: o("options-container"), children: [
|
|
191
|
+
n && T && Array.isArray(t) && /* @__PURE__ */ f(U, { children: [
|
|
192
|
+
/* @__PURE__ */ d(
|
|
193
|
+
G,
|
|
194
|
+
{
|
|
195
|
+
option: R,
|
|
196
|
+
selected: t.length === r.length,
|
|
197
|
+
onChange: ne,
|
|
198
|
+
multiSelect: n,
|
|
199
|
+
isPartiallyChecked: !!t.length
|
|
200
|
+
}
|
|
201
|
+
),
|
|
202
|
+
/* @__PURE__ */ d("div", { className: o("divider") }),
|
|
203
|
+
" "
|
|
204
|
+
] }),
|
|
205
|
+
r.map((e, a) => /* @__PURE__ */ d(
|
|
206
|
+
G,
|
|
207
|
+
{
|
|
208
|
+
...le({
|
|
209
|
+
item: e,
|
|
210
|
+
index: a
|
|
211
|
+
}),
|
|
212
|
+
multiSelect: n,
|
|
213
|
+
selected: n ? A == null ? void 0 : A.some((l) => l.value === e.value) : e.value === ((D == null ? void 0 : D.value) ?? D),
|
|
214
|
+
option: { title: e.label, ...e },
|
|
215
|
+
highlightHovered: V === a && ee !== g.ON_CLICK,
|
|
216
|
+
render: K,
|
|
217
|
+
onChange: e.disabled ? null : () => S(e),
|
|
218
|
+
onMouseEnter: () => N(a)
|
|
219
|
+
},
|
|
220
|
+
e.value
|
|
221
|
+
)),
|
|
222
|
+
M && /* @__PURE__ */ f(U, { children: [
|
|
223
|
+
/* @__PURE__ */ d("div", { className: o("divider") }),
|
|
224
|
+
M
|
|
225
|
+
] })
|
|
226
|
+
] });
|
|
227
|
+
return /* @__PURE__ */ f("div", { ref: W, className: o("container", Q), title: u, children: [
|
|
228
|
+
C && /* @__PURE__ */ d(xe, { ...se(), children: C }),
|
|
229
|
+
/* @__PURE__ */ f(
|
|
230
|
+
"button",
|
|
231
|
+
{
|
|
232
|
+
disabled: i,
|
|
233
|
+
...ae({
|
|
234
|
+
className: o("dropdown", v, X, {
|
|
235
|
+
"transparent-background": O,
|
|
236
|
+
opened: _,
|
|
237
|
+
disabled: i,
|
|
238
|
+
error: E,
|
|
239
|
+
touched: b,
|
|
240
|
+
"mobile-disabled": w
|
|
241
|
+
}),
|
|
242
|
+
onClick: ie,
|
|
243
|
+
onKeyDown: oe,
|
|
244
|
+
ref: L.setReference
|
|
245
|
+
}),
|
|
246
|
+
type: "button",
|
|
247
|
+
children: [
|
|
248
|
+
x && /* @__PURE__ */ d("span", { className: o("icon"), children: x }),
|
|
249
|
+
/* @__PURE__ */ d(
|
|
250
|
+
"span",
|
|
251
|
+
{
|
|
252
|
+
className: o("value", {
|
|
253
|
+
placeholder: I === y
|
|
254
|
+
}),
|
|
255
|
+
children: H ? H(I) : I
|
|
256
|
+
}
|
|
257
|
+
),
|
|
258
|
+
/* @__PURE__ */ d(ye, { 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: L.setFloating
|
|
270
|
+
}),
|
|
271
|
+
children: B ? $() : /* @__PURE__ */ d(me, { autoHeight: !0, autoHeightMax: 216, hideTracksWhenNotNeeded: !0, children: $() })
|
|
272
|
+
}
|
|
273
|
+
)
|
|
274
|
+
] });
|
|
275
|
+
};
|
|
276
|
+
export {
|
|
277
|
+
st as D
|
|
278
|
+
};
|