bmi-next-brokers 1.2.6 → 1.2.9
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/Input.module-7cfiMD0m.js +88 -0
- package/dist/assets/Dialog.css +1 -1
- package/dist/assets/Input.css +1 -1
- package/dist/assets/Search.css +1 -0
- package/dist/assets/Select.css +1 -1
- package/dist/components/Dialog/Dialog.d.ts +1 -0
- package/dist/components/Dialog/Dialog.js +84 -69
- package/dist/components/Input/Checkbox/Checkbox.js +18 -18
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/RadioButton/RadioButton.js +36 -36
- package/dist/components/Search/Search.d.ts +25 -0
- package/dist/components/Search/Search.js +188 -0
- package/dist/components/Search/index.d.ts +1 -0
- package/dist/components/Search/index.js +4 -0
- package/dist/components/Select/Select.js +77 -77
- package/dist/components/modal/index.d.ts +2 -2
- package/dist/components/modal/index.js +95 -95
- package/dist/icons/components/index.d.ts +2 -2
- package/dist/icons/components/index.js +140 -140
- package/dist/main.d.ts +2 -0
- package/dist/main.js +30 -28
- package/package.json +1 -1
- package/dist/Input.module-DuUfwXwW.js +0 -88
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as s, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as P } from "react";
|
|
3
|
-
import { s as
|
|
4
|
-
const
|
|
3
|
+
import { s as a } from "../../../Input.module-7cfiMD0m.js";
|
|
4
|
+
const T = ({
|
|
5
5
|
size: o = "medium",
|
|
6
6
|
label: c,
|
|
7
7
|
placeholder: p,
|
|
8
8
|
helperText: i,
|
|
9
9
|
required: h,
|
|
10
10
|
error: _,
|
|
11
|
-
inverted:
|
|
11
|
+
inverted: e = !1,
|
|
12
12
|
disabled: l = !1,
|
|
13
13
|
checked: r = !1,
|
|
14
14
|
btc: u = !1,
|
|
15
15
|
onClick: m,
|
|
16
16
|
...$
|
|
17
17
|
}) => {
|
|
18
|
-
const
|
|
19
|
-
!l &&
|
|
18
|
+
const t = P(null), g = (d) => {
|
|
19
|
+
!l && t.current && t.current.click(), m && m(d);
|
|
20
20
|
}, x = [
|
|
21
|
-
|
|
22
|
-
u &&
|
|
23
|
-
l ?
|
|
24
|
-
o === "small" ?
|
|
25
|
-
_ ?
|
|
26
|
-
|
|
27
|
-
r && !_ && !l && !
|
|
28
|
-
r && !_ && !l &&
|
|
29
|
-
r && _ ?
|
|
30
|
-
r && l ?
|
|
21
|
+
a.inputWrapper,
|
|
22
|
+
u && a.btc,
|
|
23
|
+
l ? a.inputCheckbox_disabled : a.inputCheckbox,
|
|
24
|
+
o === "small" ? a.smallCheckbox : o === "large" ? a.largeCheckbox : o === "extraLarge" ? a.extraLargeCheckbox : a.mediumCheckbox,
|
|
25
|
+
_ ? a.error : "",
|
|
26
|
+
e ? a.inverted : "",
|
|
27
|
+
r && !_ && !l && !e ? a.inputCheckbox_checked : "",
|
|
28
|
+
r && !_ && !l && e ? a.inputCheckbox_inverted_checked : "",
|
|
29
|
+
r && _ ? a.error_checked : "",
|
|
30
|
+
r && l ? a.inputCheckbox_disabled_checked : ""
|
|
31
31
|
].filter(Boolean).join(" "), f = [
|
|
32
|
-
l && !
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
l && !e ? a.passwordToggle_disabled : "",
|
|
33
|
+
e && !l ? a.passwordToggle_inverted : "",
|
|
34
|
+
e && l ? a.passwordToggle_inverted_disabled : ""
|
|
35
35
|
].filter(Boolean).join(" "), C = [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
l && !
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
a.helperText,
|
|
37
|
+
a[`helperText_${o}`],
|
|
38
|
+
l && !e ? a.helperText_disabled : "",
|
|
39
|
+
e && !l ? a.helperText_inverted : "",
|
|
40
|
+
e && l ? a.helperText_inverted_disabled : ""
|
|
41
41
|
].filter(Boolean).join(" ");
|
|
42
|
-
return /* @__PURE__ */
|
|
42
|
+
return /* @__PURE__ */ s(
|
|
43
43
|
"div",
|
|
44
44
|
{
|
|
45
|
-
className: `${
|
|
45
|
+
className: `${a.inputContainer} ${o === "medium" ? a.inputContainer_medium : o === "large" ? a.inputContainer_large : o === "extraLarge" ? a.inputContainer_extraLarge : ""}`,
|
|
46
46
|
children: [
|
|
47
|
-
c && /* @__PURE__ */
|
|
47
|
+
c && /* @__PURE__ */ s(
|
|
48
48
|
"label",
|
|
49
49
|
{
|
|
50
|
-
className: `${
|
|
51
|
-
${o === "extraLarge" ?
|
|
52
|
-
${l && !
|
|
50
|
+
className: `${a.label} ${o === "large" ? a.label_large : ""}
|
|
51
|
+
${o === "extraLarge" ? a.label_extraLarge : ""}
|
|
52
|
+
${l && !e ? a.label_disabled : ""} ${e && !l ? a.label_inverted : ""} ${e && l ? a.label_inverted_disabled : ""}`,
|
|
53
53
|
children: [
|
|
54
54
|
c,
|
|
55
55
|
h && /* @__PURE__ */ n(
|
|
56
56
|
"span",
|
|
57
57
|
{
|
|
58
|
-
className: `${
|
|
58
|
+
className: `${a.required} ${l && !e ? a.required_disabled : ""} ${e && !l ? a.required_inverted : ""} ${e && l ? a.required_inverted_disabled : ""}`,
|
|
59
59
|
children: "*"
|
|
60
60
|
}
|
|
61
61
|
)
|
|
62
62
|
]
|
|
63
63
|
}
|
|
64
64
|
),
|
|
65
|
-
/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ s(
|
|
66
66
|
"div",
|
|
67
67
|
{
|
|
68
68
|
className: x,
|
|
@@ -76,7 +76,7 @@ const L = ({
|
|
|
76
76
|
/* @__PURE__ */ n(
|
|
77
77
|
"input",
|
|
78
78
|
{
|
|
79
|
-
ref:
|
|
79
|
+
ref: t,
|
|
80
80
|
type: "radio",
|
|
81
81
|
className: f,
|
|
82
82
|
disabled: l,
|
|
@@ -88,7 +88,7 @@ const L = ({
|
|
|
88
88
|
p && /* @__PURE__ */ n(
|
|
89
89
|
"span",
|
|
90
90
|
{
|
|
91
|
-
className: `${
|
|
91
|
+
className: `${a.radioPlaceholder} ${o === "small" ? a.smallRadio : o === "large" ? a.largeRadio : o === "extraLarge" ? a.extraLargeRadio : a.mediumRadio} ${l && !e && !r ? a.radioPlaceholder_disabled : ""} ${l && !e && r ? a.radioPlaceholder_disabled_checked : ""} ${e && !l && !r ? a.radioPlaceholder_inverted : ""} ${e && l ? a.radioPlaceholder_inverted_disabled : ""} ${r && !_ && !l && !e ? a.radioPlaceholder_checked : ""} ${r && !_ && !l && e ? a.radioPlaceholder_inverted_checked : ""} ${_ && !r && !e ? a.radioPlaceholder_error : ""} ${_ && !r && e ? a.radioPlaceholder_inverted_error : ""} ${_ && r && !e ? a.radioPlaceholder_error_checked : ""} ${_ && r && e ? a.radioPlaceholder_inverted_error_checked : ""}`,
|
|
92
92
|
children: p
|
|
93
93
|
}
|
|
94
94
|
)
|
|
@@ -98,7 +98,7 @@ const L = ({
|
|
|
98
98
|
_ ? /* @__PURE__ */ n(
|
|
99
99
|
"span",
|
|
100
100
|
{
|
|
101
|
-
className: `${
|
|
101
|
+
className: `${a.errorMessage} ${a[`errorMessage_${o}`]} ${e ? a.errorMessage_inverted : ""}`,
|
|
102
102
|
children: _
|
|
103
103
|
}
|
|
104
104
|
) : i && /* @__PURE__ */ n("span", { className: C, children: i })
|
|
@@ -107,5 +107,5 @@ const L = ({
|
|
|
107
107
|
);
|
|
108
108
|
};
|
|
109
109
|
export {
|
|
110
|
-
|
|
110
|
+
T as RadioButton
|
|
111
111
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import * as Icons from "../../icons/index";
|
|
3
|
+
export type SearchSize = "small" | "medium" | "large";
|
|
4
|
+
export type IconName = keyof typeof Icons;
|
|
5
|
+
export interface SearchOption {
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
icon?: IconName;
|
|
9
|
+
}
|
|
10
|
+
export interface SearchProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
11
|
+
size?: SearchSize;
|
|
12
|
+
label?: string;
|
|
13
|
+
error?: string;
|
|
14
|
+
helperText?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
inverted?: boolean;
|
|
18
|
+
clearable?: boolean;
|
|
19
|
+
onClear?: () => void;
|
|
20
|
+
onSearch?: (value: string) => void;
|
|
21
|
+
options?: SearchOption[];
|
|
22
|
+
onOptionSelect?: (option: SearchOption) => void;
|
|
23
|
+
showOptionsOnFocus?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare const Search: React.FC<SearchProps>;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { jsxs as k, jsx as _ } from "react/jsx-runtime";
|
|
2
|
+
import { useState as x, useRef as y, useEffect as A } from "react";
|
|
3
|
+
import { Icon as $ } from "../../icons/Icon.js";
|
|
4
|
+
import '../../assets/Search.css';const H = "_searchContainer_12k26_1", U = "_label_12k26_8", G = "_label_large_12k26_16", J = "_label_disabled_12k26_21", P = "_searchWrapper_12k26_25", Q = "_search_12k26_1", X = "_small_12k26_68", Y = "_medium_12k26_73", Z = "_large_12k26_78", z = "_error_12k26_97", ee = "_errorShake_12k26_1", re = "_errorMessage_12k26_116", te = "_errorMessageSlide_12k26_1", le = "_errorMessage_small_12k26_125", ne = "_errorMessage_medium_12k26_129", _e = "_errorMessage_large_12k26_133", ae = "_helperText_12k26_137", de = "_helperText_small_12k26_144", se = "_helperText_medium_12k26_148", ie = "_helperText_large_12k26_152", oe = "_helperText_disabled_12k26_157", ce = "_icon_12k26_162", he = "_icon_disabled_12k26_175", be = "_clearButton_12k26_180", ue = "_clearButton_disabled_12k26_208", ge = "_clearButton_inverted_12k26_218", me = "_clearButton_inverted_disabled_12k26_231", ke = "_required_12k26_241", ve = "_inverted_12k26_283", pe = "_label_inverted_12k26_301", fe = "_helperText_inverted_12k26_305", we = "_icon_inverted_12k26_309", xe = "_errorMessage_inverted_12k26_313", $e = "_label_inverted_disabled_12k26_350", Te = "_helperText_inverted_disabled_12k26_354", Me = "_icon_inverted_disabled_12k26_358", Be = "_required_inverted_12k26_382", qe = "_required_disabled_12k26_386", Se = "_required_inverted_disabled_12k26_390", Ne = "_dropdown_12k26_395", ye = "_dropdownSlide_12k26_1", Ce = "_dropdown_inverted_12k26_411", Ee = "_option_12k26_418", Ie = "_option_highlighted_12k26_440", De = "_option_inverted_12k26_444", Le = "_optionIcon_12k26_458", Fe = "_optionLabel_12k26_470", e = {
|
|
5
|
+
searchContainer: H,
|
|
6
|
+
label: U,
|
|
7
|
+
label_large: G,
|
|
8
|
+
label_disabled: J,
|
|
9
|
+
searchWrapper: P,
|
|
10
|
+
search: Q,
|
|
11
|
+
small: X,
|
|
12
|
+
medium: Y,
|
|
13
|
+
large: Z,
|
|
14
|
+
error: z,
|
|
15
|
+
errorShake: ee,
|
|
16
|
+
errorMessage: re,
|
|
17
|
+
errorMessageSlide: te,
|
|
18
|
+
errorMessage_small: le,
|
|
19
|
+
errorMessage_medium: ne,
|
|
20
|
+
errorMessage_large: _e,
|
|
21
|
+
helperText: ae,
|
|
22
|
+
helperText_small: de,
|
|
23
|
+
helperText_medium: se,
|
|
24
|
+
helperText_large: ie,
|
|
25
|
+
helperText_disabled: oe,
|
|
26
|
+
icon: ce,
|
|
27
|
+
icon_disabled: he,
|
|
28
|
+
clearButton: be,
|
|
29
|
+
clearButton_disabled: ue,
|
|
30
|
+
clearButton_inverted: ge,
|
|
31
|
+
clearButton_inverted_disabled: me,
|
|
32
|
+
required: ke,
|
|
33
|
+
inverted: ve,
|
|
34
|
+
label_inverted: pe,
|
|
35
|
+
helperText_inverted: fe,
|
|
36
|
+
icon_inverted: we,
|
|
37
|
+
errorMessage_inverted: xe,
|
|
38
|
+
label_inverted_disabled: $e,
|
|
39
|
+
helperText_inverted_disabled: Te,
|
|
40
|
+
icon_inverted_disabled: Me,
|
|
41
|
+
required_inverted: Be,
|
|
42
|
+
required_disabled: qe,
|
|
43
|
+
required_inverted_disabled: Se,
|
|
44
|
+
dropdown: Ne,
|
|
45
|
+
dropdownSlide: ye,
|
|
46
|
+
dropdown_inverted: Ce,
|
|
47
|
+
option: Ee,
|
|
48
|
+
option_highlighted: Ie,
|
|
49
|
+
option_inverted: De,
|
|
50
|
+
optionIcon: Le,
|
|
51
|
+
optionLabel: Fe
|
|
52
|
+
}, We = ({
|
|
53
|
+
size: a = "medium",
|
|
54
|
+
label: T,
|
|
55
|
+
error: h,
|
|
56
|
+
helperText: M,
|
|
57
|
+
className: C,
|
|
58
|
+
required: E,
|
|
59
|
+
inverted: l = !1,
|
|
60
|
+
clearable: I = !0,
|
|
61
|
+
onClear: B,
|
|
62
|
+
onSearch: b,
|
|
63
|
+
value: v,
|
|
64
|
+
onChange: d,
|
|
65
|
+
options: u = [],
|
|
66
|
+
onOptionSelect: q,
|
|
67
|
+
showOptionsOnFocus: D = !1,
|
|
68
|
+
...t
|
|
69
|
+
}) => {
|
|
70
|
+
const [g, p] = x(v || ""), [S, s] = x(!1), [m, i] = x(-1), f = y(null), L = y(null), F = [
|
|
71
|
+
e.search,
|
|
72
|
+
e[a],
|
|
73
|
+
h ? e.error : "",
|
|
74
|
+
l ? e.inverted : "",
|
|
75
|
+
C
|
|
76
|
+
].filter(Boolean).join(" "), o = a === "small" ? 16 : a === "large" ? 20 : 18, c = u.filter(
|
|
77
|
+
(r) => r.label.toLowerCase().includes(String(g).toLowerCase())
|
|
78
|
+
);
|
|
79
|
+
A(() => {
|
|
80
|
+
const r = (n) => {
|
|
81
|
+
f.current && !f.current.contains(n.target) && s(!1);
|
|
82
|
+
};
|
|
83
|
+
return document.addEventListener("mousedown", r), () => document.removeEventListener("mousedown", r);
|
|
84
|
+
}, []);
|
|
85
|
+
const K = (r) => {
|
|
86
|
+
const n = r.target.value;
|
|
87
|
+
p(n), s(u.length > 0 && n.length > 0), i(-1), d && d(r);
|
|
88
|
+
}, O = (r) => {
|
|
89
|
+
if (u.length > 0 && S)
|
|
90
|
+
switch (r.key) {
|
|
91
|
+
case "ArrowDown":
|
|
92
|
+
r.preventDefault(), i(
|
|
93
|
+
(n) => n < c.length - 1 ? n + 1 : n
|
|
94
|
+
);
|
|
95
|
+
break;
|
|
96
|
+
case "ArrowUp":
|
|
97
|
+
r.preventDefault(), i((n) => n > 0 ? n - 1 : -1);
|
|
98
|
+
break;
|
|
99
|
+
case "Enter":
|
|
100
|
+
r.preventDefault(), m >= 0 && c[m] ? N(c[m]) : b && (b(String(g)), s(!1));
|
|
101
|
+
break;
|
|
102
|
+
case "Escape":
|
|
103
|
+
s(!1), i(-1);
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
else r.key === "Enter" && b && b(String(g));
|
|
107
|
+
t.onKeyDown && t.onKeyDown(r);
|
|
108
|
+
}, N = (r) => {
|
|
109
|
+
if (p(r.label), s(!1), i(-1), q && q(r), d) {
|
|
110
|
+
const n = {
|
|
111
|
+
target: { value: r.label }
|
|
112
|
+
};
|
|
113
|
+
d(n);
|
|
114
|
+
}
|
|
115
|
+
}, V = (r) => {
|
|
116
|
+
D && u.length > 0 && s(!0), t.onFocus && t.onFocus(r);
|
|
117
|
+
}, W = () => {
|
|
118
|
+
p(""), B && B(), d && d({
|
|
119
|
+
target: { value: "" }
|
|
120
|
+
});
|
|
121
|
+
}, w = v !== void 0 ? v : g, j = I && w && String(w).length > 0, R = S && c.length > 0 && !t.disabled;
|
|
122
|
+
return /* @__PURE__ */ k("div", { className: e.searchContainer, ref: f, children: [
|
|
123
|
+
T && /* @__PURE__ */ k("label", { className: `${e.label} ${a === "large" ? e.label_large : ""} ${t.disabled && !l ? e.label_disabled : ""} ${l && !t.disabled ? e.label_inverted : ""} ${l && t.disabled ? e.label_inverted_disabled : ""}`, children: [
|
|
124
|
+
T,
|
|
125
|
+
/* @__PURE__ */ _("span", { className: `${e.required} ${l ? e.required_inverted : ""}`, children: E && "*" })
|
|
126
|
+
] }),
|
|
127
|
+
/* @__PURE__ */ k("div", { className: e.searchWrapper, children: [
|
|
128
|
+
/* @__PURE__ */ _("div", { className: `${e.icon} ${t.disabled && !l ? e.icon_disabled : ""} ${l && !t.disabled ? e.icon_inverted : ""} ${l && t.disabled ? e.icon_inverted_disabled : ""}`, children: /* @__PURE__ */ _(
|
|
129
|
+
$,
|
|
130
|
+
{
|
|
131
|
+
name: "SearchIcon",
|
|
132
|
+
width: o,
|
|
133
|
+
height: o
|
|
134
|
+
}
|
|
135
|
+
) }),
|
|
136
|
+
/* @__PURE__ */ _(
|
|
137
|
+
"input",
|
|
138
|
+
{
|
|
139
|
+
ref: L,
|
|
140
|
+
className: F,
|
|
141
|
+
type: "text",
|
|
142
|
+
value: w,
|
|
143
|
+
onChange: K,
|
|
144
|
+
onKeyDown: O,
|
|
145
|
+
onFocus: V,
|
|
146
|
+
autoComplete: "off",
|
|
147
|
+
...t
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
R && /* @__PURE__ */ _("div", { className: `${e.dropdown} ${l ? e.dropdown_inverted : ""}`, children: c.map((r, n) => /* @__PURE__ */ k(
|
|
151
|
+
"div",
|
|
152
|
+
{
|
|
153
|
+
className: `${e.option} ${n === m ? e.option_highlighted : ""} ${l ? e.option_inverted : ""}`,
|
|
154
|
+
onClick: () => N(r),
|
|
155
|
+
onMouseEnter: () => i(n),
|
|
156
|
+
children: [
|
|
157
|
+
r.icon && /* @__PURE__ */ _("div", { className: e.optionIcon, children: /* @__PURE__ */ _($, { name: r.icon, width: o, height: o }) }),
|
|
158
|
+
/* @__PURE__ */ _("span", { className: e.optionLabel, children: r.label })
|
|
159
|
+
]
|
|
160
|
+
},
|
|
161
|
+
r.value
|
|
162
|
+
)) }),
|
|
163
|
+
j && /* @__PURE__ */ _(
|
|
164
|
+
"button",
|
|
165
|
+
{
|
|
166
|
+
type: "button",
|
|
167
|
+
className: `${e.clearButton} ${t.disabled && !l ? e.clearButton_disabled : ""} ${l && !t.disabled ? e.clearButton_inverted : ""} ${l && t.disabled ? e.clearButton_inverted_disabled : ""}`,
|
|
168
|
+
onClick: W,
|
|
169
|
+
disabled: t.disabled,
|
|
170
|
+
"aria-label": "Limpiar búsqueda",
|
|
171
|
+
children: /* @__PURE__ */ _(
|
|
172
|
+
$,
|
|
173
|
+
{
|
|
174
|
+
name: "Close",
|
|
175
|
+
width: o,
|
|
176
|
+
height: o
|
|
177
|
+
}
|
|
178
|
+
)
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
] }),
|
|
182
|
+
h && /* @__PURE__ */ _("span", { className: `${e.errorMessage} ${e[`errorMessage_${a}`]} ${l ? e.errorMessage_inverted : ""}`, children: h }),
|
|
183
|
+
M && !h && /* @__PURE__ */ _("span", { className: `${e.helperText} ${e[`helperText_${a}`]} ${t.disabled && !l ? e.helperText_disabled : ""} ${l && !t.disabled ? e.helperText_inverted : ""} ${l && t.disabled ? e.helperText_inverted_disabled : ""}`, children: M })
|
|
184
|
+
] });
|
|
185
|
+
};
|
|
186
|
+
export {
|
|
187
|
+
We as Search
|
|
188
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Search, type SearchProps, type SearchSize, type SearchOption } from './Search';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useState as O, useRef as V, useEffect as W } from "react";
|
|
3
3
|
import { Icon as g } from "../../icons/Icon.js";
|
|
4
|
-
import '../../assets/Select.css';const j = "
|
|
4
|
+
import '../../assets/Select.css';const j = "_selectContainer_1o6wc_3", E = "_selectContainer_medium_1o6wc_9", R = "_selectContainer_large_1o6wc_13", y = "_selectContainer_extraLarge_1o6wc_14", A = "_label_1o6wc_18", B = "_label_large_1o6wc_26", D = "_label_extraLarge_1o6wc_27", F = "_label_disabled_1o6wc_31", G = "_selectWrapper_1o6wc_35", H = "_select_1o6wc_3", J = "_medium_1o6wc_57", K = "_small_1o6wc_58", P = "_btc_1o6wc_76", Q = "_open_1o6wc_87", U = "_disabled_1o6wc_91", X = "_placeholder_1o6wc_99", Y = "_selectValue_1o6wc_103", Z = "_chevron_1o6wc_112", z = "_chevronOpen_1o6wc_117", ee = "_large_1o6wc_134", re = "_extraLarge_1o6wc_140", _e = "_error_1o6wc_147", oe = "_errorShake_1o6wc_1", le = "_errorMessage_1o6wc_187", te = "_errorMessageSlide_1o6wc_1", ce = "_errorMessage_medium_1o6wc_195", ne = "_errorMessage_small_1o6wc_196", ae = "_errorMessage_large_1o6wc_200", se = "_errorMessage_extraLarge_1o6wc_201", ie = "_errorMessage_inverted_1o6wc_205", de = "_helperText_1o6wc_209", pe = "_helperText_medium_1o6wc_215", we = "_helperText_small_1o6wc_216", ge = "_helperText_large_1o6wc_220", me = "_helperText_extraLarge_1o6wc_221", he = "_helperText_disabled_1o6wc_225", be = "_iconLabel_1o6wc_229", ve = "_icon_1o6wc_229", ue = "_icon_disabled_1o6wc_245", xe = "_required_1o6wc_250", $e = "_required_inverted_1o6wc_255", Te = "_required_disabled_1o6wc_259", Le = "_required_inverted_disabled_1o6wc_263", Me = "_dropdown_1o6wc_268", fe = "_option_1o6wc_282", Ce = "_optionSelected_1o6wc_326", qe = "_optionIcon_1o6wc_345", Ne = "_inverted_1o6wc_352", Se = "_label_inverted_1o6wc_370", ke = "_helperText_inverted_1o6wc_374", Ie = "_icon_inverted_1o6wc_378", Oe = "_dropdown_inverted_1o6wc_382", Ve = "_option_inverted_1o6wc_387", We = "_label_inverted_disabled_1o6wc_477", je = "_helperText_inverted_disabled_1o6wc_481", Ee = "_icon_inverted_disabled_1o6wc_485", e = {
|
|
5
5
|
selectContainer: j,
|
|
6
6
|
selectContainer_medium: E,
|
|
7
7
|
selectContainer_large: R,
|
|
@@ -23,32 +23,32 @@ import '../../assets/Select.css';const j = "_selectContainer_1l7x6_3", E = "_sel
|
|
|
23
23
|
chevronOpen: z,
|
|
24
24
|
large: ee,
|
|
25
25
|
extraLarge: re,
|
|
26
|
-
error:
|
|
27
|
-
errorShake:
|
|
28
|
-
errorMessage:
|
|
29
|
-
errorMessageSlide:
|
|
30
|
-
errorMessage_medium:
|
|
31
|
-
errorMessage_small:
|
|
32
|
-
errorMessage_large:
|
|
33
|
-
errorMessage_extraLarge:
|
|
26
|
+
error: _e,
|
|
27
|
+
errorShake: oe,
|
|
28
|
+
errorMessage: le,
|
|
29
|
+
errorMessageSlide: te,
|
|
30
|
+
errorMessage_medium: ce,
|
|
31
|
+
errorMessage_small: ne,
|
|
32
|
+
errorMessage_large: ae,
|
|
33
|
+
errorMessage_extraLarge: se,
|
|
34
34
|
errorMessage_inverted: ie,
|
|
35
35
|
helperText: de,
|
|
36
|
-
helperText_medium:
|
|
37
|
-
helperText_small:
|
|
36
|
+
helperText_medium: pe,
|
|
37
|
+
helperText_small: we,
|
|
38
38
|
helperText_large: ge,
|
|
39
39
|
helperText_extraLarge: me,
|
|
40
40
|
helperText_disabled: he,
|
|
41
41
|
iconLabel: be,
|
|
42
42
|
icon: ve,
|
|
43
43
|
icon_disabled: ue,
|
|
44
|
-
required:
|
|
45
|
-
required_inverted:
|
|
46
|
-
required_disabled:
|
|
47
|
-
required_inverted_disabled:
|
|
48
|
-
dropdown:
|
|
49
|
-
option:
|
|
50
|
-
optionSelected:
|
|
51
|
-
optionIcon:
|
|
44
|
+
required: xe,
|
|
45
|
+
required_inverted: $e,
|
|
46
|
+
required_disabled: Te,
|
|
47
|
+
required_inverted_disabled: Le,
|
|
48
|
+
dropdown: Me,
|
|
49
|
+
option: fe,
|
|
50
|
+
optionSelected: Ce,
|
|
51
|
+
optionIcon: qe,
|
|
52
52
|
inverted: Ne,
|
|
53
53
|
label_inverted: Se,
|
|
54
54
|
helperText_inverted: ke,
|
|
@@ -59,134 +59,134 @@ import '../../assets/Select.css';const j = "_selectContainer_1l7x6_3", E = "_sel
|
|
|
59
59
|
helperText_inverted_disabled: je,
|
|
60
60
|
icon_inverted_disabled: Ee
|
|
61
61
|
}, Be = ({
|
|
62
|
-
size:
|
|
62
|
+
size: l = "medium",
|
|
63
63
|
label: m,
|
|
64
|
-
error:
|
|
64
|
+
error: a,
|
|
65
65
|
helperText: h,
|
|
66
66
|
icon: d,
|
|
67
|
-
className:
|
|
68
|
-
required:
|
|
69
|
-
placeholder:
|
|
67
|
+
className: $,
|
|
68
|
+
required: T,
|
|
69
|
+
placeholder: L = "Seleccionar...",
|
|
70
70
|
options: b = [],
|
|
71
71
|
value: v,
|
|
72
72
|
onChange: u,
|
|
73
|
-
disabled:
|
|
73
|
+
disabled: _ = !1,
|
|
74
74
|
inverted: r = !1,
|
|
75
|
-
dynamicIcon:
|
|
76
|
-
showPlaceholderIcon:
|
|
77
|
-
btc:
|
|
78
|
-
...
|
|
75
|
+
dynamicIcon: M = !1,
|
|
76
|
+
showPlaceholderIcon: f = !1,
|
|
77
|
+
btc: C = !1,
|
|
78
|
+
...q
|
|
79
79
|
}) => {
|
|
80
|
-
const [
|
|
80
|
+
const [s, p] = O(!1), w = V(null), c = b.find((o) => o.value === v);
|
|
81
81
|
W(() => {
|
|
82
|
-
const
|
|
83
|
-
|
|
82
|
+
const o = (I) => {
|
|
83
|
+
w.current && !w.current.contains(I.target) && p(!1);
|
|
84
84
|
};
|
|
85
|
-
return document.addEventListener("mousedown",
|
|
86
|
-
document.removeEventListener("mousedown",
|
|
85
|
+
return document.addEventListener("mousedown", o), () => {
|
|
86
|
+
document.removeEventListener("mousedown", o);
|
|
87
87
|
};
|
|
88
88
|
}, []);
|
|
89
89
|
const N = [
|
|
90
90
|
e.select,
|
|
91
|
-
|
|
92
|
-
e[
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
91
|
+
C && e.btc,
|
|
92
|
+
e[l],
|
|
93
|
+
a ? e.error : "",
|
|
94
|
+
_ ? e.disabled : "",
|
|
95
|
+
s ? e.open : "",
|
|
96
96
|
r ? e.inverted : "",
|
|
97
|
-
|
|
98
|
-
].filter(Boolean).join(" "), i =
|
|
99
|
-
|
|
100
|
-
}, k = (
|
|
101
|
-
u && u(
|
|
97
|
+
$
|
|
98
|
+
].filter(Boolean).join(" "), i = l === "small" ? 16 : l === "large" ? 20 : l === "extraLarge" ? 24 : 18, x = M && (c != null && c.icon) ? c.icon : d, S = () => {
|
|
99
|
+
_ || p(!s);
|
|
100
|
+
}, k = (o) => {
|
|
101
|
+
u && u(o), p(!1);
|
|
102
102
|
};
|
|
103
|
-
return /* @__PURE__ */
|
|
103
|
+
return /* @__PURE__ */ n(
|
|
104
104
|
"div",
|
|
105
105
|
{
|
|
106
|
-
className: `${e.selectContainer} ${
|
|
107
|
-
...
|
|
106
|
+
className: `${e.selectContainer} ${l === "medium" ? e.selectContainer_medium : l === "large" ? e.selectContainer_large : l === "extraLarge" ? e.selectContainer_extraLarge : ""}`,
|
|
107
|
+
...q,
|
|
108
108
|
children: [
|
|
109
|
-
m && /* @__PURE__ */
|
|
109
|
+
m && /* @__PURE__ */ n(
|
|
110
110
|
"label",
|
|
111
111
|
{
|
|
112
|
-
className: `${e.label} ${
|
|
112
|
+
className: `${e.label} ${l === "large" ? e.label_large : ""} ${l === "extraLarge" ? e.label_extraLarge : ""} ${_ && !r ? e.label_disabled : ""} ${r && !_ ? e.label_inverted : ""} ${r && _ ? e.label_inverted_disabled : ""}`,
|
|
113
113
|
children: [
|
|
114
114
|
m,
|
|
115
|
-
/* @__PURE__ */
|
|
115
|
+
/* @__PURE__ */ t(
|
|
116
116
|
"span",
|
|
117
117
|
{
|
|
118
|
-
className: `${e.required} ${
|
|
119
|
-
children:
|
|
118
|
+
className: `${e.required} ${_ && !r ? e.required_disabled : ""} ${r && !_ ? e.required_inverted : ""} ${r && _ ? e.required_inverted_disabled : ""}`,
|
|
119
|
+
children: T && "*"
|
|
120
120
|
}
|
|
121
121
|
)
|
|
122
122
|
]
|
|
123
123
|
}
|
|
124
124
|
),
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
-
|
|
125
|
+
/* @__PURE__ */ n("div", { className: e.selectWrapper, ref: w, children: [
|
|
126
|
+
/* @__PURE__ */ n("div", { className: N, onClick: S, children: [
|
|
127
|
+
/* @__PURE__ */ n("div", { className: e.iconLabel, children: [
|
|
128
|
+
x && f && /* @__PURE__ */ t(
|
|
129
129
|
"div",
|
|
130
130
|
{
|
|
131
|
-
className: `${e.icon} ${
|
|
132
|
-
children: /* @__PURE__ */
|
|
131
|
+
className: `${e.icon} ${_ && !r ? e.icon_disabled : ""} ${r && !_ ? e.icon_inverted : ""} ${r && _ ? e.icon_inverted_disabled : ""}`,
|
|
132
|
+
children: /* @__PURE__ */ t(g, { name: x, width: i, height: i })
|
|
133
133
|
}
|
|
134
134
|
),
|
|
135
|
-
/* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ t(
|
|
136
136
|
"span",
|
|
137
137
|
{
|
|
138
|
-
className: `${e.selectValue} ${
|
|
139
|
-
children:
|
|
138
|
+
className: `${e.selectValue} ${c ? "" : e.placeholder}`,
|
|
139
|
+
children: c ? c.label : L
|
|
140
140
|
}
|
|
141
141
|
)
|
|
142
142
|
] }),
|
|
143
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ t(
|
|
144
144
|
g,
|
|
145
145
|
{
|
|
146
146
|
name: "ArrowDown",
|
|
147
147
|
width: 16,
|
|
148
148
|
height: 16,
|
|
149
|
-
className: `${e.chevron} ${
|
|
149
|
+
className: `${e.chevron} ${s ? e.chevronOpen : ""}`
|
|
150
150
|
}
|
|
151
151
|
)
|
|
152
152
|
] }),
|
|
153
|
-
|
|
153
|
+
s && !_ && /* @__PURE__ */ t(
|
|
154
154
|
"div",
|
|
155
155
|
{
|
|
156
156
|
className: `${e.dropdown} ${r ? e.dropdown_inverted : ""}`,
|
|
157
|
-
children: b.map((
|
|
157
|
+
children: b.map((o) => /* @__PURE__ */ n(
|
|
158
158
|
"div",
|
|
159
159
|
{
|
|
160
|
-
className: `${e.option} ${v ===
|
|
161
|
-
onClick: () => k(
|
|
160
|
+
className: `${e.option} ${v === o.value ? e.optionSelected : ""} ${r ? e.option_inverted : ""}`,
|
|
161
|
+
onClick: () => k(o.value),
|
|
162
162
|
children: [
|
|
163
|
-
(
|
|
163
|
+
(o.icon || d) && /* @__PURE__ */ t("div", { className: e.optionIcon, children: /* @__PURE__ */ t(
|
|
164
164
|
g,
|
|
165
165
|
{
|
|
166
|
-
name:
|
|
166
|
+
name: o.icon || d,
|
|
167
167
|
width: i,
|
|
168
168
|
height: i
|
|
169
169
|
}
|
|
170
170
|
) }),
|
|
171
|
-
|
|
171
|
+
o.label
|
|
172
172
|
]
|
|
173
173
|
},
|
|
174
|
-
|
|
174
|
+
o.value
|
|
175
175
|
))
|
|
176
176
|
}
|
|
177
177
|
)
|
|
178
178
|
] }),
|
|
179
|
-
|
|
179
|
+
a && /* @__PURE__ */ t(
|
|
180
180
|
"span",
|
|
181
181
|
{
|
|
182
|
-
className: `${e.errorMessage} ${e[`errorMessage_${
|
|
183
|
-
children:
|
|
182
|
+
className: `${e.errorMessage} ${e[`errorMessage_${l}`]} ${r ? e.errorMessage_inverted : ""}`,
|
|
183
|
+
children: a
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
|
-
h && !
|
|
186
|
+
h && !a && /* @__PURE__ */ t(
|
|
187
187
|
"span",
|
|
188
188
|
{
|
|
189
|
-
className: `${e.helperText} ${e[`helperText_${
|
|
189
|
+
className: `${e.helperText} ${e[`helperText_${l}`]} ${_ && !r ? e.helperText_disabled : ""} ${r && !_ ? e.helperText_inverted : ""} ${r && _ ? e.helperText_inverted_disabled : ""}`,
|
|
190
190
|
children: h
|
|
191
191
|
}
|
|
192
192
|
)
|
|
@@ -18,8 +18,8 @@ export interface ModalProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
|
18
18
|
title?: string;
|
|
19
19
|
children?: React.ReactNode;
|
|
20
20
|
width?: number;
|
|
21
|
-
confirmButton
|
|
22
|
-
cancelButton
|
|
21
|
+
confirmButton?: ModalButtonProps;
|
|
22
|
+
cancelButton?: ModalButtonProps;
|
|
23
23
|
zIndex?: number;
|
|
24
24
|
className?: string;
|
|
25
25
|
onClickOverlay?: (() => Promise<void> | void) | false;
|