bmi-next-brokers 1.3.2 → 1.3.3
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/components/Select/Select.js +121 -120
- package/package.json +1 -1
|
@@ -1,176 +1,176 @@
|
|
|
1
|
-
import { jsxs as s, jsx as l, Fragment as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { r as
|
|
4
|
-
import { Icon as
|
|
5
|
-
import '../../assets/Select.css';const
|
|
6
|
-
selectContainer:
|
|
7
|
-
selectContainer_medium:
|
|
8
|
-
selectContainer_large:
|
|
9
|
-
selectContainer_extraLarge:
|
|
10
|
-
label:
|
|
11
|
-
label_large:
|
|
12
|
-
label_extraLarge:
|
|
13
|
-
label_disabled:
|
|
14
|
-
selectWrapper:
|
|
15
|
-
select:
|
|
16
|
-
medium:
|
|
17
|
-
small:
|
|
18
|
-
btc:
|
|
19
|
-
open:
|
|
20
|
-
disabled:
|
|
21
|
-
placeholder:
|
|
22
|
-
selectValue:
|
|
23
|
-
chevron:
|
|
24
|
-
chevronOpen:
|
|
25
|
-
large:
|
|
26
|
-
extraLarge:
|
|
27
|
-
error:
|
|
28
|
-
errorShake:
|
|
29
|
-
errorMessage:
|
|
30
|
-
errorMessageSlide:
|
|
31
|
-
errorMessage_medium:
|
|
32
|
-
errorMessage_small:
|
|
33
|
-
errorMessage_large:
|
|
34
|
-
errorMessage_extraLarge:
|
|
35
|
-
errorMessage_inverted:
|
|
36
|
-
helperText:
|
|
37
|
-
helperText_medium:
|
|
38
|
-
helperText_small:
|
|
39
|
-
helperText_large:
|
|
40
|
-
helperText_extraLarge:
|
|
41
|
-
helperText_disabled:
|
|
42
|
-
iconLabel:
|
|
43
|
-
icon:
|
|
44
|
-
icon_disabled:
|
|
45
|
-
required:
|
|
46
|
-
required_inverted:
|
|
47
|
-
required_disabled:
|
|
48
|
-
required_inverted_disabled:
|
|
49
|
-
dropdown:
|
|
50
|
-
dropdownPortal:
|
|
51
|
-
option:
|
|
52
|
-
optionSelected:
|
|
53
|
-
optionIcon:
|
|
54
|
-
inverted:
|
|
55
|
-
label_inverted:
|
|
56
|
-
helperText_inverted:
|
|
57
|
-
icon_inverted:
|
|
58
|
-
dropdown_inverted:
|
|
59
|
-
option_inverted:
|
|
60
|
-
dropdownTable:
|
|
61
|
-
optionTable:
|
|
62
|
-
tableColumn:
|
|
63
|
-
columnHeader:
|
|
64
|
-
columnValue:
|
|
65
|
-
label_inverted_disabled:
|
|
66
|
-
helperText_inverted_disabled:
|
|
67
|
-
icon_inverted_disabled:
|
|
68
|
-
},
|
|
1
|
+
import { jsxs as s, jsx as l, Fragment as N } from "react/jsx-runtime";
|
|
2
|
+
import { useState as S, useRef as x, useEffect as E } from "react";
|
|
3
|
+
import { r as A } from "../../index-CGDUIzcq.js";
|
|
4
|
+
import { Icon as $ } from "../../icons/Icon.js";
|
|
5
|
+
import '../../assets/Select.css';const F = "_selectContainer_rm5cq_3", G = "_selectContainer_medium_rm5cq_9", J = "_selectContainer_large_rm5cq_13", K = "_selectContainer_extraLarge_rm5cq_14", Q = "_label_rm5cq_18", U = "_label_large_rm5cq_26", X = "_label_extraLarge_rm5cq_27", Y = "_label_disabled_rm5cq_31", Z = "_selectWrapper_rm5cq_35", z = "_select_rm5cq_3", ee = "_medium_rm5cq_57", re = "_small_rm5cq_58", ne = "_btc_rm5cq_76", te = "_open_rm5cq_87", le = "_disabled_rm5cq_91", _e = "_placeholder_rm5cq_99", oe = "_selectValue_rm5cq_103", ce = "_chevron_rm5cq_112", ae = "_chevronOpen_rm5cq_117", se = "_large_rm5cq_134", de = "_extraLarge_rm5cq_140", ie = "_error_rm5cq_147", me = "_errorShake_rm5cq_1", pe = "_errorMessage_rm5cq_187", ue = "_errorMessageSlide_rm5cq_1", he = "_errorMessage_medium_rm5cq_195", qe = "_errorMessage_small_rm5cq_196", ge = "_errorMessage_large_rm5cq_200", be = "_errorMessage_extraLarge_rm5cq_201", ve = "_errorMessage_inverted_rm5cq_205", xe = "_helperText_rm5cq_209", $e = "_helperText_medium_rm5cq_215", we = "_helperText_small_rm5cq_216", Te = "_helperText_large_rm5cq_220", fe = "_helperText_extraLarge_rm5cq_221", Le = "_helperText_disabled_rm5cq_225", Ce = "_iconLabel_rm5cq_229", Me = "_icon_rm5cq_229", Ne = "_icon_disabled_rm5cq_245", Se = "_required_rm5cq_250", Ee = "_required_inverted_rm5cq_255", Oe = "_required_disabled_rm5cq_259", Pe = "_required_inverted_disabled_rm5cq_263", Ve = "_dropdown_rm5cq_268", Ie = "_dropdownPortal_rm5cq_282", ke = "_option_rm5cq_290", Re = "_optionSelected_rm5cq_334", We = "_optionIcon_rm5cq_353", je = "_inverted_rm5cq_360", De = "_label_inverted_rm5cq_378", ye = "_helperText_inverted_rm5cq_382", Be = "_icon_inverted_rm5cq_386", He = "_dropdown_inverted_rm5cq_390", Ae = "_option_inverted_rm5cq_395", Fe = "_dropdownTable_rm5cq_438", Ge = "_optionTable_rm5cq_443", Je = "_tableColumn_rm5cq_451", Ke = "_columnHeader_rm5cq_459", Qe = "_columnValue_rm5cq_470", Ue = "_label_inverted_disabled_rm5cq_532", Xe = "_helperText_inverted_disabled_rm5cq_536", Ye = "_icon_inverted_disabled_rm5cq_540", e = {
|
|
6
|
+
selectContainer: F,
|
|
7
|
+
selectContainer_medium: G,
|
|
8
|
+
selectContainer_large: J,
|
|
9
|
+
selectContainer_extraLarge: K,
|
|
10
|
+
label: Q,
|
|
11
|
+
label_large: U,
|
|
12
|
+
label_extraLarge: X,
|
|
13
|
+
label_disabled: Y,
|
|
14
|
+
selectWrapper: Z,
|
|
15
|
+
select: z,
|
|
16
|
+
medium: ee,
|
|
17
|
+
small: re,
|
|
18
|
+
btc: ne,
|
|
19
|
+
open: te,
|
|
20
|
+
disabled: le,
|
|
21
|
+
placeholder: _e,
|
|
22
|
+
selectValue: oe,
|
|
23
|
+
chevron: ce,
|
|
24
|
+
chevronOpen: ae,
|
|
25
|
+
large: se,
|
|
26
|
+
extraLarge: de,
|
|
27
|
+
error: ie,
|
|
28
|
+
errorShake: me,
|
|
29
|
+
errorMessage: pe,
|
|
30
|
+
errorMessageSlide: ue,
|
|
31
|
+
errorMessage_medium: he,
|
|
32
|
+
errorMessage_small: qe,
|
|
33
|
+
errorMessage_large: ge,
|
|
34
|
+
errorMessage_extraLarge: be,
|
|
35
|
+
errorMessage_inverted: ve,
|
|
36
|
+
helperText: xe,
|
|
37
|
+
helperText_medium: $e,
|
|
38
|
+
helperText_small: we,
|
|
39
|
+
helperText_large: Te,
|
|
40
|
+
helperText_extraLarge: fe,
|
|
41
|
+
helperText_disabled: Le,
|
|
42
|
+
iconLabel: Ce,
|
|
43
|
+
icon: Me,
|
|
44
|
+
icon_disabled: Ne,
|
|
45
|
+
required: Se,
|
|
46
|
+
required_inverted: Ee,
|
|
47
|
+
required_disabled: Oe,
|
|
48
|
+
required_inverted_disabled: Pe,
|
|
49
|
+
dropdown: Ve,
|
|
50
|
+
dropdownPortal: Ie,
|
|
51
|
+
option: ke,
|
|
52
|
+
optionSelected: Re,
|
|
53
|
+
optionIcon: We,
|
|
54
|
+
inverted: je,
|
|
55
|
+
label_inverted: De,
|
|
56
|
+
helperText_inverted: ye,
|
|
57
|
+
icon_inverted: Be,
|
|
58
|
+
dropdown_inverted: He,
|
|
59
|
+
option_inverted: Ae,
|
|
60
|
+
dropdownTable: Fe,
|
|
61
|
+
optionTable: Ge,
|
|
62
|
+
tableColumn: Je,
|
|
63
|
+
columnHeader: Ke,
|
|
64
|
+
columnValue: Qe,
|
|
65
|
+
label_inverted_disabled: Ue,
|
|
66
|
+
helperText_inverted_disabled: Xe,
|
|
67
|
+
icon_inverted_disabled: Ye
|
|
68
|
+
}, nr = ({
|
|
69
69
|
size: _ = "medium",
|
|
70
|
-
label:
|
|
70
|
+
label: w,
|
|
71
71
|
error: d,
|
|
72
|
-
helperText:
|
|
72
|
+
helperText: T,
|
|
73
73
|
icon: p,
|
|
74
|
-
className:
|
|
75
|
-
required:
|
|
76
|
-
placeholder:
|
|
77
|
-
options:
|
|
78
|
-
value:
|
|
79
|
-
onChange:
|
|
74
|
+
className: O,
|
|
75
|
+
required: P,
|
|
76
|
+
placeholder: V = "Seleccionar...",
|
|
77
|
+
options: f = [],
|
|
78
|
+
value: L,
|
|
79
|
+
onChange: C,
|
|
80
80
|
disabled: t = !1,
|
|
81
81
|
inverted: n = !1,
|
|
82
|
-
dynamicIcon:
|
|
83
|
-
showPlaceholderIcon:
|
|
84
|
-
btc:
|
|
82
|
+
dynamicIcon: I = !1,
|
|
83
|
+
showPlaceholderIcon: k = !1,
|
|
84
|
+
btc: R = !1,
|
|
85
85
|
columnHeaders: u,
|
|
86
|
-
...
|
|
86
|
+
...W
|
|
87
87
|
}) => {
|
|
88
|
-
const [o, h] =
|
|
88
|
+
const [o, h] = S(!1), [i, j] = S(null), q = x(null), g = x(null), b = x(null), a = f.find((r) => r.value === L), v = () => {
|
|
89
89
|
if (g.current) {
|
|
90
90
|
const r = g.current.getBoundingClientRect();
|
|
91
|
-
|
|
91
|
+
j({
|
|
92
92
|
top: r.bottom + 10,
|
|
93
93
|
left: r.left,
|
|
94
94
|
width: r.width
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
|
-
|
|
99
|
-
const r = (
|
|
100
|
-
q.current && !q.current.contains(
|
|
98
|
+
E(() => {
|
|
99
|
+
const r = (c) => {
|
|
100
|
+
q.current && !q.current.contains(c.target) && b.current && !b.current.contains(c.target) && h(!1);
|
|
101
101
|
};
|
|
102
102
|
return document.addEventListener("mousedown", r), () => {
|
|
103
103
|
document.removeEventListener("mousedown", r);
|
|
104
104
|
};
|
|
105
|
-
}, []),
|
|
105
|
+
}, []), E(() => {
|
|
106
106
|
if (o) {
|
|
107
|
-
|
|
107
|
+
v();
|
|
108
108
|
const r = () => {
|
|
109
|
-
o &&
|
|
110
|
-
},
|
|
111
|
-
o &&
|
|
109
|
+
o && v();
|
|
110
|
+
}, c = () => {
|
|
111
|
+
o && v();
|
|
112
112
|
};
|
|
113
|
-
return window.addEventListener("scroll", r, !0), window.addEventListener("resize",
|
|
114
|
-
window.removeEventListener("scroll", r, !0), window.removeEventListener("resize",
|
|
113
|
+
return window.addEventListener("scroll", r, !0), window.addEventListener("resize", c), () => {
|
|
114
|
+
window.removeEventListener("scroll", r, !0), window.removeEventListener("resize", c);
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
117
|
}, [o]);
|
|
118
|
-
const
|
|
118
|
+
const D = [
|
|
119
119
|
e.select,
|
|
120
|
-
|
|
120
|
+
R && e.btc,
|
|
121
121
|
e[_],
|
|
122
122
|
d ? e.error : "",
|
|
123
123
|
t ? e.disabled : "",
|
|
124
124
|
o ? e.open : "",
|
|
125
125
|
n ? e.inverted : "",
|
|
126
|
-
|
|
127
|
-
].filter(Boolean).join(" "), m = _ === "small" ? 16 : _ === "large" ? 20 : _ === "extraLarge" ? 24 : 18,
|
|
126
|
+
O
|
|
127
|
+
].filter(Boolean).join(" "), m = _ === "small" ? 16 : _ === "large" ? 20 : _ === "extraLarge" ? 24 : 18, M = I && (a != null && a.icon) ? a.icon : p, y = () => {
|
|
128
128
|
t || h(!o);
|
|
129
|
-
},
|
|
130
|
-
|
|
129
|
+
}, B = (r) => {
|
|
130
|
+
C && C(r), h(!1);
|
|
131
131
|
};
|
|
132
132
|
return /* @__PURE__ */ s(
|
|
133
133
|
"div",
|
|
134
134
|
{
|
|
135
135
|
className: `${e.selectContainer} ${_ === "medium" ? e.selectContainer_medium : _ === "large" ? e.selectContainer_large : _ === "extraLarge" ? e.selectContainer_extraLarge : ""}`,
|
|
136
|
-
...
|
|
136
|
+
...W,
|
|
137
137
|
children: [
|
|
138
|
-
|
|
138
|
+
w && /* @__PURE__ */ s(
|
|
139
139
|
"label",
|
|
140
140
|
{
|
|
141
141
|
className: `${e.label} ${_ === "large" ? e.label_large : ""} ${_ === "extraLarge" ? e.label_extraLarge : ""} ${t && !n ? e.label_disabled : ""} ${n && !t ? e.label_inverted : ""} ${n && t ? e.label_inverted_disabled : ""}`,
|
|
142
142
|
children: [
|
|
143
|
-
|
|
143
|
+
w,
|
|
144
144
|
/* @__PURE__ */ l(
|
|
145
145
|
"span",
|
|
146
146
|
{
|
|
147
147
|
className: `${e.required} ${t && !n ? e.required_disabled : ""} ${n && !t ? e.required_inverted : ""} ${n && t ? e.required_inverted_disabled : ""}`,
|
|
148
|
-
children:
|
|
148
|
+
children: P && "*"
|
|
149
149
|
}
|
|
150
150
|
)
|
|
151
151
|
]
|
|
152
152
|
}
|
|
153
153
|
),
|
|
154
154
|
/* @__PURE__ */ s("div", { className: e.selectWrapper, ref: g, children: [
|
|
155
|
-
/* @__PURE__ */ s("div", { className:
|
|
155
|
+
/* @__PURE__ */ s("div", { className: D, onClick: y, ref: q, children: [
|
|
156
156
|
/* @__PURE__ */ s("div", { className: e.iconLabel, children: [
|
|
157
|
-
|
|
157
|
+
M && k && /* @__PURE__ */ l(
|
|
158
158
|
"div",
|
|
159
159
|
{
|
|
160
160
|
className: `${e.icon} ${t && !n ? e.icon_disabled : ""} ${n && !t ? e.icon_inverted : ""} ${n && t ? e.icon_inverted_disabled : ""}`,
|
|
161
|
-
children: /* @__PURE__ */ l(
|
|
161
|
+
children: /* @__PURE__ */ l($, { name: M, width: m, height: m })
|
|
162
162
|
}
|
|
163
163
|
),
|
|
164
164
|
/* @__PURE__ */ l(
|
|
165
165
|
"span",
|
|
166
166
|
{
|
|
167
|
-
className: `${e.selectValue} ${
|
|
168
|
-
children:
|
|
167
|
+
className: `${e.selectValue} ${a ? "" : e.placeholder}`,
|
|
168
|
+
children: a ? a.label : V
|
|
169
169
|
}
|
|
170
170
|
)
|
|
171
171
|
] }),
|
|
172
172
|
/* @__PURE__ */ l(
|
|
173
|
-
|
|
173
|
+
$,
|
|
174
174
|
{
|
|
175
175
|
name: "ArrowDown",
|
|
176
176
|
width: 16,
|
|
@@ -179,27 +179,28 @@ import '../../assets/Select.css';const A = "_selectContainer_rm5cq_3", F = "_sel
|
|
|
179
179
|
}
|
|
180
180
|
)
|
|
181
181
|
] }),
|
|
182
|
-
o && !t && i &&
|
|
182
|
+
o && !t && i && A.createPortal(
|
|
183
183
|
/* @__PURE__ */ l(
|
|
184
184
|
"div",
|
|
185
185
|
{
|
|
186
|
+
ref: b,
|
|
186
187
|
className: `${e.dropdown} ${e.dropdownPortal} ${n ? e.dropdown_inverted : ""} ${u ? e.dropdownTable : ""}`,
|
|
187
188
|
style: {
|
|
188
189
|
top: `${i.top}px`,
|
|
189
190
|
left: `${i.left}px`,
|
|
190
191
|
width: `${i.width}px`
|
|
191
192
|
},
|
|
192
|
-
children:
|
|
193
|
+
children: f.map((r) => /* @__PURE__ */ l(
|
|
193
194
|
"div",
|
|
194
195
|
{
|
|
195
|
-
className: `${e.option} ${
|
|
196
|
-
onClick: () =>
|
|
197
|
-
children: r.columns ? /* @__PURE__ */ l(
|
|
198
|
-
/* @__PURE__ */ l("div", { className: e.columnHeader, children:
|
|
199
|
-
/* @__PURE__ */ l("div", { className: e.columnValue, children: r.columns[
|
|
200
|
-
] },
|
|
196
|
+
className: `${e.option} ${L === r.value ? e.optionSelected : ""} ${n ? e.option_inverted : ""} ${r.columns ? e.optionTable : ""}`,
|
|
197
|
+
onClick: () => B(r.value),
|
|
198
|
+
children: r.columns ? /* @__PURE__ */ l(N, { children: u && Object.entries(u).map(([c, H]) => /* @__PURE__ */ s("div", { className: e.tableColumn, children: [
|
|
199
|
+
/* @__PURE__ */ l("div", { className: e.columnHeader, children: H }),
|
|
200
|
+
/* @__PURE__ */ l("div", { className: e.columnValue, children: r.columns[c] || "" })
|
|
201
|
+
] }, c)) }) : /* @__PURE__ */ s(N, { children: [
|
|
201
202
|
(r.icon || p) && /* @__PURE__ */ l("div", { className: e.optionIcon, children: /* @__PURE__ */ l(
|
|
202
|
-
|
|
203
|
+
$,
|
|
203
204
|
{
|
|
204
205
|
name: r.icon || p,
|
|
205
206
|
width: m,
|
|
@@ -223,11 +224,11 @@ import '../../assets/Select.css';const A = "_selectContainer_rm5cq_3", F = "_sel
|
|
|
223
224
|
children: d
|
|
224
225
|
}
|
|
225
226
|
),
|
|
226
|
-
|
|
227
|
+
T && !d && /* @__PURE__ */ l(
|
|
227
228
|
"span",
|
|
228
229
|
{
|
|
229
230
|
className: `${e.helperText} ${e[`helperText_${_}`]} ${t && !n ? e.helperText_disabled : ""} ${n && !t ? e.helperText_inverted : ""} ${n && t ? e.helperText_inverted_disabled : ""}`,
|
|
230
|
-
children:
|
|
231
|
+
children: T
|
|
231
232
|
}
|
|
232
233
|
)
|
|
233
234
|
]
|
|
@@ -235,5 +236,5 @@ import '../../assets/Select.css';const A = "_selectContainer_rm5cq_3", F = "_sel
|
|
|
235
236
|
);
|
|
236
237
|
};
|
|
237
238
|
export {
|
|
238
|
-
|
|
239
|
+
nr as Select
|
|
239
240
|
};
|
package/package.json
CHANGED