bmi-next-brokers 1.6.2 → 1.6.4
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 +190 -190
- package/dist/main.d.ts +0 -2
- package/dist/main.js +28 -30
- package/package.json +1 -1
- package/dist/assets/Search.css +0 -1
- package/dist/components/Search/Search.d.ts +0 -25
- package/dist/components/Search/Search.js +0 -188
- package/dist/components/Search/index.d.ts +0 -1
- package/dist/components/Search/index.js +0 -4
|
@@ -1,111 +1,110 @@
|
|
|
1
|
-
import { jsxs 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
|
-
selectInput:
|
|
24
|
-
inverted:
|
|
25
|
-
error:
|
|
26
|
-
chevron:
|
|
27
|
-
chevronOpen:
|
|
28
|
-
large:
|
|
29
|
-
extraLarge:
|
|
30
|
-
errorShake:
|
|
31
|
-
errorMessage:
|
|
32
|
-
errorMessageSlide:
|
|
1
|
+
import { jsxs as d, jsx as n, Fragment as A } from "react/jsx-runtime";
|
|
2
|
+
import { useState as $, useRef as T, useEffect as G } from "react";
|
|
3
|
+
import { r as se } from "../../index-CGDUIzcq.js";
|
|
4
|
+
import { Icon as O } from "../../icons/Icon.js";
|
|
5
|
+
import '../../assets/Select.css';const ae = "_selectContainer_m531c_5", _e = "_selectContainer_medium_m531c_21", ie = "_selectContainer_large_m531c_29", de = "_selectContainer_extraLarge_m531c_31", me = "_label_m531c_39", pe = "_label_large_m531c_55", ue = "_label_extraLarge_m531c_57", he = "_label_disabled_m531c_65", ge = "_selectWrapper_m531c_73", be = "_select_m531c_5", fe = "_medium_m531c_125", ve = "_small_m531c_127", xe = "_btc_m531c_163", we = "_open_m531c_185", $e = "_disabled_m531c_193", Te = "_placeholder_m531c_209", Ce = "_selectValue_m531c_217", Le = "_selectInput_m531c_237", Me = "_inverted_m531c_319", Se = "_error_m531c_351", Ie = "_chevron_m531c_375", Ne = "_chevronOpen_m531c_385", qe = "_large_m531c_419", ke = "_extraLarge_m531c_431", ye = "_errorShake_m531c_1", We = "_errorMessage_m531c_525", Ee = "_errorMessageSlide_m531c_1", Oe = "_errorMessage_medium_m531c_541", Pe = "_errorMessage_small_m531c_543", Re = "_errorMessage_large_m531c_551", Ve = "_errorMessage_extraLarge_m531c_553", je = "_errorMessage_inverted_m531c_561", De = "_helperText_m531c_569", He = "_helperText_medium_m531c_581", Fe = "_helperText_small_m531c_583", Qe = "_helperText_large_m531c_591", Be = "_helperText_extraLarge_m531c_593", Ae = "_helperText_disabled_m531c_601", Ge = "_iconLabel_m531c_609", Je = "_icon_m531c_609", Ke = "_icon_disabled_m531c_649", Ue = "_required_m531c_659", Xe = "_required_inverted_m531c_669", Ye = "_required_disabled_m531c_677", Ze = "_required_inverted_disabled_m531c_685", ze = "_dropdown_m531c_695", er = "_dropdownPortal_m531c_751", rr = "_option_m531c_767", tr = "_optionWithCheckbox_m531c_803", nr = "_optionCheckbox_m531c_815", cr = "_dropdown_inverted_m531c_875", or = "_optionSelected_m531c_895", lr = "_option_inverted_m531c_911", sr = "_searchInputWrapper_m531c_929", ar = "_searchIcon_m531c_947", _r = "_searchInput_m531c_929", ir = "_noResults_m531c_1025", dr = "_optionIcon_m531c_1135", mr = "_label_inverted_m531c_1185", pr = "_helperText_inverted_m531c_1193", ur = "_icon_inverted_m531c_1201", hr = "_dropdownTable_m531c_1323", gr = "_optionTable_m531c_1333", br = "_tableColumn_m531c_1349", fr = "_columnHeader_m531c_1365", vr = "_columnValue_m531c_1387", xr = "_label_inverted_disabled_m531c_1511", wr = "_helperText_inverted_disabled_m531c_1519", $r = "_icon_inverted_disabled_m531c_1527", e = {
|
|
6
|
+
selectContainer: ae,
|
|
7
|
+
selectContainer_medium: _e,
|
|
8
|
+
selectContainer_large: ie,
|
|
9
|
+
selectContainer_extraLarge: de,
|
|
10
|
+
label: me,
|
|
11
|
+
label_large: pe,
|
|
12
|
+
label_extraLarge: ue,
|
|
13
|
+
label_disabled: he,
|
|
14
|
+
selectWrapper: ge,
|
|
15
|
+
select: be,
|
|
16
|
+
medium: fe,
|
|
17
|
+
small: ve,
|
|
18
|
+
btc: xe,
|
|
19
|
+
open: we,
|
|
20
|
+
disabled: $e,
|
|
21
|
+
placeholder: Te,
|
|
22
|
+
selectValue: Ce,
|
|
23
|
+
selectInput: Le,
|
|
24
|
+
inverted: Me,
|
|
25
|
+
error: Se,
|
|
26
|
+
chevron: Ie,
|
|
27
|
+
chevronOpen: Ne,
|
|
28
|
+
large: qe,
|
|
29
|
+
extraLarge: ke,
|
|
30
|
+
errorShake: ye,
|
|
31
|
+
errorMessage: We,
|
|
32
|
+
errorMessageSlide: Ee,
|
|
33
33
|
errorMessage_medium: Oe,
|
|
34
|
-
errorMessage_small:
|
|
35
|
-
errorMessage_large:
|
|
34
|
+
errorMessage_small: Pe,
|
|
35
|
+
errorMessage_large: Re,
|
|
36
36
|
errorMessage_extraLarge: Ve,
|
|
37
37
|
errorMessage_inverted: je,
|
|
38
|
-
helperText:
|
|
38
|
+
helperText: De,
|
|
39
39
|
helperText_medium: He,
|
|
40
|
-
helperText_small:
|
|
41
|
-
helperText_large:
|
|
40
|
+
helperText_small: Fe,
|
|
41
|
+
helperText_large: Qe,
|
|
42
42
|
helperText_extraLarge: Be,
|
|
43
|
-
helperText_disabled:
|
|
43
|
+
helperText_disabled: Ae,
|
|
44
44
|
iconLabel: Ge,
|
|
45
45
|
icon: Je,
|
|
46
|
-
icon_disabled:
|
|
47
|
-
required:
|
|
48
|
-
required_inverted:
|
|
49
|
-
required_disabled:
|
|
50
|
-
required_inverted_disabled:
|
|
51
|
-
dropdown:
|
|
52
|
-
dropdownPortal:
|
|
53
|
-
option:
|
|
54
|
-
optionWithCheckbox:
|
|
55
|
-
optionCheckbox:
|
|
46
|
+
icon_disabled: Ke,
|
|
47
|
+
required: Ue,
|
|
48
|
+
required_inverted: Xe,
|
|
49
|
+
required_disabled: Ye,
|
|
50
|
+
required_inverted_disabled: Ze,
|
|
51
|
+
dropdown: ze,
|
|
52
|
+
dropdownPortal: er,
|
|
53
|
+
option: rr,
|
|
54
|
+
optionWithCheckbox: tr,
|
|
55
|
+
optionCheckbox: nr,
|
|
56
56
|
dropdown_inverted: cr,
|
|
57
|
-
optionSelected:
|
|
58
|
-
option_inverted:
|
|
59
|
-
searchInputWrapper:
|
|
60
|
-
searchIcon:
|
|
61
|
-
searchInput:
|
|
62
|
-
noResults:
|
|
63
|
-
optionIcon:
|
|
64
|
-
label_inverted:
|
|
65
|
-
helperText_inverted:
|
|
66
|
-
icon_inverted:
|
|
67
|
-
dropdownTable:
|
|
68
|
-
optionTable:
|
|
69
|
-
tableColumn:
|
|
70
|
-
columnHeader:
|
|
71
|
-
columnValue:
|
|
72
|
-
label_inverted_disabled:
|
|
73
|
-
helperText_inverted_disabled:
|
|
74
|
-
icon_inverted_disabled:
|
|
75
|
-
},
|
|
57
|
+
optionSelected: or,
|
|
58
|
+
option_inverted: lr,
|
|
59
|
+
searchInputWrapper: sr,
|
|
60
|
+
searchIcon: ar,
|
|
61
|
+
searchInput: _r,
|
|
62
|
+
noResults: ir,
|
|
63
|
+
optionIcon: dr,
|
|
64
|
+
label_inverted: mr,
|
|
65
|
+
helperText_inverted: pr,
|
|
66
|
+
icon_inverted: ur,
|
|
67
|
+
dropdownTable: hr,
|
|
68
|
+
optionTable: gr,
|
|
69
|
+
tableColumn: br,
|
|
70
|
+
columnHeader: fr,
|
|
71
|
+
columnValue: vr,
|
|
72
|
+
label_inverted_disabled: xr,
|
|
73
|
+
helperText_inverted_disabled: wr,
|
|
74
|
+
icon_inverted_disabled: $r
|
|
75
|
+
}, Ir = ({
|
|
76
76
|
size: s = "medium",
|
|
77
|
-
label:
|
|
78
|
-
error:
|
|
79
|
-
helperText:
|
|
80
|
-
icon:
|
|
77
|
+
label: P,
|
|
78
|
+
error: R,
|
|
79
|
+
helperText: V,
|
|
80
|
+
icon: C,
|
|
81
81
|
className: J,
|
|
82
|
-
required:
|
|
83
|
-
placeholder:
|
|
84
|
-
options:
|
|
85
|
-
value:
|
|
86
|
-
onChange:
|
|
87
|
-
disabled:
|
|
88
|
-
inverted:
|
|
89
|
-
dynamicIcon:
|
|
90
|
-
showPlaceholderIcon:
|
|
91
|
-
btc:
|
|
92
|
-
columnHeaders:
|
|
93
|
-
searchable:
|
|
94
|
-
noSearchResult:
|
|
95
|
-
searchAndCheckbox:
|
|
96
|
-
...
|
|
82
|
+
required: K,
|
|
83
|
+
placeholder: j = "Seleccionar...",
|
|
84
|
+
options: L = [],
|
|
85
|
+
value: m,
|
|
86
|
+
onChange: M,
|
|
87
|
+
disabled: c = !1,
|
|
88
|
+
inverted: o = !1,
|
|
89
|
+
dynamicIcon: U = !1,
|
|
90
|
+
showPlaceholderIcon: X = !1,
|
|
91
|
+
btc: Y = !1,
|
|
92
|
+
columnHeaders: S,
|
|
93
|
+
searchable: Z = !1,
|
|
94
|
+
noSearchResult: D = "No se encontraron resultados",
|
|
95
|
+
searchAndCheckbox: u = !1,
|
|
96
|
+
...z
|
|
97
97
|
}) => {
|
|
98
|
-
|
|
99
|
-
const [n, d] = M(!1), [b, u] = M(""), [re, h] = M(!1), m = z || g, f = g, [T, te] = M(null), y = S(null), q = S(null), E = S(null), v = S(null), i = f ? void 0 : $.find((r) => r.value === _), x = f && Array.isArray(_) ? _ : [], Q = (r) => f ? x.includes(r) : _ === r, w = m && b ? $.filter(
|
|
98
|
+
const [l, p] = $(!1), [b, h] = $(""), [ee, g] = $(!1), a = Z || u, f = u, [v, re] = $(null), I = T(null), N = T(null), q = T(null), k = T(null), _ = f ? void 0 : L.find((r) => r.value === m), H = f && Array.isArray(m) ? m : [], F = (r) => f ? H.includes(r) : m === r, y = a && b ? L.filter(
|
|
100
99
|
(r) => r.label.toLowerCase().includes(b.toLowerCase())
|
|
101
|
-
) :
|
|
102
|
-
if (
|
|
103
|
-
if (
|
|
104
|
-
return
|
|
105
|
-
})(),
|
|
106
|
-
if (
|
|
107
|
-
const r =
|
|
108
|
-
|
|
100
|
+
) : L, x = (() => {
|
|
101
|
+
if (R) return R;
|
|
102
|
+
if (a && ee && b && b.trim().length > 0 && y.length === 0 && !l && !m)
|
|
103
|
+
return D;
|
|
104
|
+
})(), W = () => {
|
|
105
|
+
if (N.current) {
|
|
106
|
+
const r = N.current.getBoundingClientRect();
|
|
107
|
+
re({
|
|
109
108
|
top: r.bottom + 10,
|
|
110
109
|
left: r.left,
|
|
111
110
|
width: r.width
|
|
@@ -114,190 +113,191 @@ import '../../assets/Select.css';const _e = "_selectContainer_m531c_5", ie = "_s
|
|
|
114
113
|
};
|
|
115
114
|
G(() => {
|
|
116
115
|
const r = (t) => {
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
I.current && !I.current.contains(t.target) && q.current && !q.current.contains(t.target) && (p(!1), a && setTimeout(() => {
|
|
117
|
+
h(""), g(!1);
|
|
119
118
|
}, 200));
|
|
120
119
|
};
|
|
121
120
|
return document.addEventListener("mousedown", r), () => {
|
|
122
121
|
document.removeEventListener("mousedown", r);
|
|
123
122
|
};
|
|
124
|
-
}, [
|
|
125
|
-
if (
|
|
126
|
-
|
|
123
|
+
}, [a]), G(() => {
|
|
124
|
+
if (l) {
|
|
125
|
+
W();
|
|
127
126
|
const r = () => {
|
|
128
|
-
|
|
127
|
+
l && W();
|
|
129
128
|
}, t = () => {
|
|
130
|
-
|
|
129
|
+
l && W();
|
|
131
130
|
};
|
|
132
131
|
return window.addEventListener("scroll", r, !0), window.addEventListener("resize", t), () => {
|
|
133
132
|
window.removeEventListener("scroll", r, !0), window.removeEventListener("resize", t);
|
|
134
133
|
};
|
|
135
134
|
}
|
|
136
|
-
}, [
|
|
137
|
-
const
|
|
135
|
+
}, [l]);
|
|
136
|
+
const te = [
|
|
138
137
|
e.select,
|
|
139
|
-
|
|
138
|
+
Y && e.btc,
|
|
140
139
|
e[s],
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
140
|
+
x ? e.error : "",
|
|
141
|
+
c ? e.disabled : "",
|
|
142
|
+
l ? e.open : "",
|
|
143
|
+
o ? e.inverted : "",
|
|
145
144
|
J
|
|
146
|
-
].filter(Boolean).join(" "),
|
|
147
|
-
|
|
145
|
+
].filter(Boolean).join(" "), w = s === "small" ? 16 : s === "large" ? 20 : s === "extraLarge" ? 24 : 18, Q = U && (_ != null && _.icon) ? _.icon : C, ne = () => {
|
|
146
|
+
c || (p(!l), a && !l && setTimeout(() => {
|
|
148
147
|
var r;
|
|
149
|
-
(r =
|
|
148
|
+
(r = k.current) == null || r.focus();
|
|
150
149
|
}, 0));
|
|
151
|
-
},
|
|
152
|
-
if (
|
|
150
|
+
}, B = (r) => {
|
|
151
|
+
if (M)
|
|
153
152
|
if (f) {
|
|
154
|
-
const t = Array.isArray(
|
|
155
|
-
|
|
153
|
+
const t = Array.isArray(m) ? m : [], i = t.includes(r) ? t.filter((E) => E !== r) : [...t, r];
|
|
154
|
+
M(i), a && !u && (p(!1), h(""), g(!1));
|
|
156
155
|
} else
|
|
157
|
-
|
|
156
|
+
M(r), p(!1), h(""), g(!1);
|
|
158
157
|
}, ce = (r) => {
|
|
159
158
|
const t = r.target.value;
|
|
160
|
-
|
|
161
|
-
},
|
|
162
|
-
|
|
163
|
-
},
|
|
164
|
-
|
|
159
|
+
h(t), g(t.length > 0), l || p(!0);
|
|
160
|
+
}, oe = () => {
|
|
161
|
+
l || (p(!0), h(""), g(!1));
|
|
162
|
+
}, le = (r) => {
|
|
163
|
+
a && (r.stopPropagation(), l || (p(!0), setTimeout(() => {
|
|
165
164
|
var t;
|
|
166
|
-
(t =
|
|
165
|
+
(t = k.current) == null || t.focus();
|
|
167
166
|
}, 0)));
|
|
168
167
|
};
|
|
169
|
-
return /* @__PURE__ */
|
|
168
|
+
return /* @__PURE__ */ d(
|
|
170
169
|
"div",
|
|
171
170
|
{
|
|
172
171
|
className: `${e.selectContainer} ${s === "medium" ? e.selectContainer_medium : s === "large" ? e.selectContainer_large : s === "extraLarge" ? e.selectContainer_extraLarge : ""}`,
|
|
173
|
-
...
|
|
172
|
+
...z,
|
|
174
173
|
children: [
|
|
175
|
-
|
|
174
|
+
P && /* @__PURE__ */ d(
|
|
176
175
|
"label",
|
|
177
176
|
{
|
|
178
|
-
className: `${e.label} ${s === "large" ? e.label_large : ""} ${s === "extraLarge" ? e.label_extraLarge : ""} ${
|
|
177
|
+
className: `${e.label} ${s === "large" ? e.label_large : ""} ${s === "extraLarge" ? e.label_extraLarge : ""} ${c && !o ? e.label_disabled : ""} ${o && !c ? e.label_inverted : ""} ${o && c ? e.label_inverted_disabled : ""}`,
|
|
179
178
|
children: [
|
|
180
|
-
|
|
181
|
-
/* @__PURE__ */
|
|
179
|
+
P,
|
|
180
|
+
/* @__PURE__ */ n(
|
|
182
181
|
"span",
|
|
183
182
|
{
|
|
184
|
-
className: `${e.required} ${
|
|
185
|
-
children:
|
|
183
|
+
className: `${e.required} ${c && !o ? e.required_disabled : ""} ${o && !c ? e.required_inverted : ""} ${o && c ? e.required_inverted_disabled : ""}`,
|
|
184
|
+
children: K && "*"
|
|
186
185
|
}
|
|
187
186
|
)
|
|
188
187
|
]
|
|
189
188
|
}
|
|
190
189
|
),
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
-
/* @__PURE__ */
|
|
194
|
-
|
|
190
|
+
/* @__PURE__ */ d("div", { className: e.selectWrapper, ref: N, children: [
|
|
191
|
+
/* @__PURE__ */ d("div", { className: te, onClick: ne, ref: I, children: [
|
|
192
|
+
/* @__PURE__ */ d("div", { className: e.iconLabel, children: [
|
|
193
|
+
Q && X && /* @__PURE__ */ n(
|
|
195
194
|
"div",
|
|
196
195
|
{
|
|
197
|
-
className: `${e.icon} ${
|
|
198
|
-
children: /* @__PURE__ */
|
|
196
|
+
className: `${e.icon} ${c && !o ? e.icon_disabled : ""} ${o && !c ? e.icon_inverted : ""} ${o && c ? e.icon_inverted_disabled : ""}`,
|
|
197
|
+
children: /* @__PURE__ */ n(O, { name: Q, width: w, height: w })
|
|
199
198
|
}
|
|
200
199
|
),
|
|
201
|
-
|
|
200
|
+
a ? /* @__PURE__ */ n(
|
|
202
201
|
"input",
|
|
203
202
|
{
|
|
204
|
-
ref:
|
|
203
|
+
ref: k,
|
|
205
204
|
type: "text",
|
|
206
|
-
className: `${e.selectInput} ${!
|
|
207
|
-
placeholder:
|
|
208
|
-
value: n ? b : f && x.length > 0 ? `${x.length} seleccionado${x.length > 1 ? "s" : ""}` : i ? i.label : _ && typeof _ == "string" && ((B = $.find((r) => r.value === _)) == null ? void 0 : B.label) || "",
|
|
205
|
+
className: `${e.selectInput} ${!_ && !l && H.length === 0 ? e.placeholder : ""}`,
|
|
206
|
+
placeholder: j,
|
|
209
207
|
onChange: ce,
|
|
210
|
-
onFocus:
|
|
211
|
-
onClick:
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
r.key === "Escape" ? (d(!1), u(""), h(!1), (t = v.current) == null || t.blur()) : r.key === "Enter" && w.length > 0 ? (r.preventDefault(), W(w[0].value)) : r.key === "ArrowDown" && !n && (r.preventDefault(), d(!0), (a = v.current) == null || a.focus()), r.stopPropagation();
|
|
215
|
-
},
|
|
216
|
-
disabled: o,
|
|
217
|
-
readOnly: !n
|
|
208
|
+
onFocus: oe,
|
|
209
|
+
onClick: le,
|
|
210
|
+
disabled: c,
|
|
211
|
+
readOnly: !l
|
|
218
212
|
}
|
|
219
|
-
) : /* @__PURE__ */
|
|
213
|
+
) : /* @__PURE__ */ n(
|
|
220
214
|
"span",
|
|
221
215
|
{
|
|
222
|
-
className: `${e.selectValue} ${
|
|
223
|
-
children:
|
|
216
|
+
className: `${e.selectValue} ${_ ? "" : e.placeholder}`,
|
|
217
|
+
children: _ ? _.label : j
|
|
224
218
|
}
|
|
225
219
|
)
|
|
226
220
|
] }),
|
|
227
|
-
/* @__PURE__ */
|
|
228
|
-
|
|
221
|
+
/* @__PURE__ */ n(
|
|
222
|
+
O,
|
|
229
223
|
{
|
|
230
224
|
name: "ArrowDown",
|
|
231
225
|
width: 16,
|
|
232
226
|
height: 16,
|
|
233
|
-
className: `${e.chevron} ${
|
|
227
|
+
className: `${e.chevron} ${l ? e.chevronOpen : ""}`
|
|
234
228
|
}
|
|
235
229
|
)
|
|
236
230
|
] }),
|
|
237
|
-
|
|
238
|
-
/* @__PURE__ */
|
|
231
|
+
l && !c && v && se.createPortal(
|
|
232
|
+
/* @__PURE__ */ n(
|
|
239
233
|
"div",
|
|
240
234
|
{
|
|
241
|
-
ref:
|
|
242
|
-
className: `${e.dropdown} ${e.dropdownPortal} ${
|
|
235
|
+
ref: q,
|
|
236
|
+
className: `${e.dropdown} ${e.dropdownPortal} ${o ? e.dropdown_inverted : ""} ${S ? e.dropdownTable : ""} ${a ? e.dropdownSearchable : ""}`,
|
|
243
237
|
style: {
|
|
244
|
-
top: `${
|
|
245
|
-
left: `${
|
|
246
|
-
width: `${
|
|
238
|
+
top: `${v.top}px`,
|
|
239
|
+
left: `${v.left}px`,
|
|
240
|
+
width: `${v.width}px`
|
|
247
241
|
},
|
|
248
|
-
children:
|
|
242
|
+
children: y.length > 0 ? y.map((r, t) => /* @__PURE__ */ d(
|
|
249
243
|
"div",
|
|
250
244
|
{
|
|
251
|
-
className: `${e.option} ${
|
|
252
|
-
onClick: (
|
|
253
|
-
|
|
245
|
+
className: `${e.option} ${F(r.value) ? e.optionSelected : ""} ${o ? e.option_inverted : ""} ${r.columns ? e.optionTable : ""} ${u ? e.optionWithCheckbox : ""}`,
|
|
246
|
+
onClick: (i) => {
|
|
247
|
+
i.stopPropagation(), B(r.value);
|
|
254
248
|
},
|
|
255
249
|
children: [
|
|
256
|
-
|
|
250
|
+
u && /* @__PURE__ */ n(
|
|
257
251
|
"input",
|
|
258
252
|
{
|
|
259
253
|
type: "checkbox",
|
|
260
|
-
checked:
|
|
261
|
-
onChange: () =>
|
|
262
|
-
onClick: (
|
|
254
|
+
checked: F(r.value),
|
|
255
|
+
onChange: () => B(r.value),
|
|
256
|
+
onClick: (i) => i.stopPropagation(),
|
|
263
257
|
className: e.optionCheckbox
|
|
264
258
|
}
|
|
265
259
|
),
|
|
266
|
-
r.columns ? /* @__PURE__ */
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
-
] },
|
|
270
|
-
(r.icon ||
|
|
271
|
-
|
|
260
|
+
r.columns ? /* @__PURE__ */ n(A, { children: S && Object.entries(S).map(([i, E]) => /* @__PURE__ */ d("div", { className: e.tableColumn, children: [
|
|
261
|
+
/* @__PURE__ */ n("div", { className: e.columnHeader, children: E }),
|
|
262
|
+
/* @__PURE__ */ n("div", { className: e.columnValue, children: r.columns[i] || "" })
|
|
263
|
+
] }, i)) }) : /* @__PURE__ */ d(A, { children: [
|
|
264
|
+
(r.icon || C) && /* @__PURE__ */ n("div", { className: e.optionIcon, children: /* @__PURE__ */ n(
|
|
265
|
+
O,
|
|
272
266
|
{
|
|
273
|
-
name: r.icon ||
|
|
274
|
-
width:
|
|
275
|
-
height:
|
|
267
|
+
name: r.icon || C,
|
|
268
|
+
width: w,
|
|
269
|
+
height: w
|
|
276
270
|
}
|
|
277
271
|
) }),
|
|
278
|
-
|
|
272
|
+
/* @__PURE__ */ n(
|
|
273
|
+
"div",
|
|
274
|
+
{
|
|
275
|
+
style: { whiteSpace: "pre-line", lineHeight: 1.25 },
|
|
276
|
+
children: r.label
|
|
277
|
+
}
|
|
278
|
+
)
|
|
279
279
|
] })
|
|
280
280
|
]
|
|
281
281
|
},
|
|
282
282
|
t
|
|
283
|
-
)) : /* @__PURE__ */
|
|
283
|
+
)) : /* @__PURE__ */ n("div", { className: e.noResults, children: D })
|
|
284
284
|
}
|
|
285
285
|
),
|
|
286
286
|
document.body
|
|
287
287
|
)
|
|
288
288
|
] }),
|
|
289
|
-
|
|
289
|
+
x && /* @__PURE__ */ n(
|
|
290
290
|
"span",
|
|
291
291
|
{
|
|
292
|
-
className: `${e.errorMessage} ${e[`errorMessage_${s}`]} ${
|
|
293
|
-
children:
|
|
292
|
+
className: `${e.errorMessage} ${e[`errorMessage_${s}`]} ${o ? e.errorMessage_inverted : ""}`,
|
|
293
|
+
children: x
|
|
294
294
|
}
|
|
295
295
|
),
|
|
296
|
-
|
|
296
|
+
V && !x && /* @__PURE__ */ n(
|
|
297
297
|
"span",
|
|
298
298
|
{
|
|
299
|
-
className: `${e.helperText} ${e[`helperText_${s}`]} ${
|
|
300
|
-
children:
|
|
299
|
+
className: `${e.helperText} ${e[`helperText_${s}`]} ${c && !o ? e.helperText_disabled : ""} ${o && !c ? e.helperText_inverted : ""} ${o && c ? e.helperText_inverted_disabled : ""}`,
|
|
300
|
+
children: V
|
|
301
301
|
}
|
|
302
302
|
)
|
|
303
303
|
]
|
|
@@ -305,5 +305,5 @@ import '../../assets/Select.css';const _e = "_selectContainer_m531c_5", ie = "_s
|
|
|
305
305
|
);
|
|
306
306
|
};
|
|
307
307
|
export {
|
|
308
|
-
|
|
308
|
+
Ir as Select
|
|
309
309
|
};
|
package/dist/main.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ export { FileUpload, CompactFileUpload } from './components/FileUpload';
|
|
|
8
8
|
export { Input } from './components/Input';
|
|
9
9
|
export { Checkbox } from './components/Input/Checkbox/Checkbox';
|
|
10
10
|
export { RadioButton } from './components/Input/RadioButton/RadioButton';
|
|
11
|
-
export { Search } from './components/Search';
|
|
12
11
|
export { Navbar } from './components/navbar';
|
|
13
12
|
export { ProgressBar } from './components/progressBar';
|
|
14
13
|
export { Select } from './components/Select';
|
|
@@ -26,7 +25,6 @@ export type { FileUploadProps, FileUploadVariant, CompactFileUploadProps, Compac
|
|
|
26
25
|
export type { InputProps, InputSize } from './components/Input';
|
|
27
26
|
export type { CheckboxProps } from './components/Input/Checkbox/Checkbox';
|
|
28
27
|
export type { RadioButtonProps } from './components/Input/RadioButton/RadioButton';
|
|
29
|
-
export type { SearchProps, SearchSize, SearchOption } from './components/Search';
|
|
30
28
|
export type { NavbarOption } from './components/navbar';
|
|
31
29
|
export type { ProgressBar as ProgressBarProps } from './components/progressBar';
|
|
32
30
|
export type { SelectProps, SelectSize, SelectOption, } from './components/Select';
|
package/dist/main.js
CHANGED
|
@@ -2,43 +2,41 @@ import { Icon as e } from "./icons/Icon.js";
|
|
|
2
2
|
import { Badge as p } from "./components/badge/index.js";
|
|
3
3
|
import { Button as x } from "./components/Button/Button.js";
|
|
4
4
|
import { ButtonGroup as a } from "./components/ButtonGroup/ButtonGroup.js";
|
|
5
|
-
import { Dialog as
|
|
6
|
-
import { FileUpload as
|
|
5
|
+
import { Dialog as n } from "./components/Dialog/Dialog.js";
|
|
6
|
+
import { FileUpload as c } from "./components/FileUpload/FileUpload.js";
|
|
7
7
|
import { CompactFileUpload as i } from "./components/FileUpload/CompactFileUpload.js";
|
|
8
|
-
import { Input as
|
|
9
|
-
import { Checkbox as
|
|
8
|
+
import { Input as b } from "./components/Input/Input.js";
|
|
9
|
+
import { Checkbox as S } from "./components/Input/Checkbox/Checkbox.js";
|
|
10
10
|
import { RadioButton as T } from "./components/Input/RadioButton/RadioButton.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { useScrollLock as H } from "./hooks/useScrollLock.js";
|
|
11
|
+
import { Navbar as C } from "./components/navbar/index.js";
|
|
12
|
+
import { ProgressBar as G } from "./components/progressBar/index.js";
|
|
13
|
+
import { Select as U } from "./components/Select/Select.js";
|
|
14
|
+
import { Spinner as v } from "./components/Spinner/Spinner.js";
|
|
15
|
+
import { Stepper as L } from "./components/stepper/index.js";
|
|
16
|
+
import { Tab as N } from "./components/tab/index.js";
|
|
17
|
+
import { TabGroup as R } from "./components/tab/tabGroup/index.js";
|
|
18
|
+
import { Toast as q } from "./components/Toast/Toast.js";
|
|
19
|
+
import { Modal as y } from "./components/modal/index.js";
|
|
20
|
+
import { useScrollLock as A } from "./hooks/useScrollLock.js";
|
|
22
21
|
import './assets/main.css';export {
|
|
23
22
|
p as Badge,
|
|
24
23
|
x as Button,
|
|
25
24
|
a as ButtonGroup,
|
|
26
|
-
|
|
25
|
+
S as Checkbox,
|
|
27
26
|
i as CompactFileUpload,
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
n as Dialog,
|
|
28
|
+
c as FileUpload,
|
|
30
29
|
e as Icon,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
b as Input,
|
|
31
|
+
y as Modal,
|
|
32
|
+
C as Navbar,
|
|
33
|
+
G as ProgressBar,
|
|
35
34
|
T as RadioButton,
|
|
36
|
-
|
|
37
|
-
v as
|
|
38
|
-
L as
|
|
39
|
-
N as
|
|
40
|
-
R as
|
|
41
|
-
q as
|
|
42
|
-
|
|
43
|
-
H as useScrollLock
|
|
35
|
+
U as Select,
|
|
36
|
+
v as Spinner,
|
|
37
|
+
L as Stepper,
|
|
38
|
+
N as Tab,
|
|
39
|
+
R as TabGroup,
|
|
40
|
+
q as Toast,
|
|
41
|
+
A as useScrollLock
|
|
44
42
|
};
|
package/package.json
CHANGED
package/dist/assets/Search.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._searchContainer_12k26_1{display:flex;flex-direction:column;gap:4px;cursor:pointer}._label_12k26_8{font-family:Poppins Regular;font-size:13px;color:var(--Content-Neutral-Default-Active, #000);font-weight:500;padding-left:4px}._label_large_12k26_16{font-size:15px;margin-bottom:6px}._label_disabled_12k26_21{color:var(--content-disabled-default, #cbd5e1)}._searchWrapper_12k26_25{position:relative;display:flex;align-items:center;width:100%}._search_12k26_1{border:1px solid #ddd;border-radius:16px;font-family:Poppins Regular;font-weight:100;outline:none;transition:all .2s ease;width:100%;background-color:#fff}._search_12k26_1:focus{box-shadow:0 0 0 3px var(--ui-blue-400, #7eaae6)}._search_12k26_1:active{border:1px solid var(--Stroke-Neutral-Primary, #94a3b8)}._search_12k26_1::placeholder{color:var(--Content-Neutral-Default-Default, #a3a3a3)}._search_12k26_1:disabled{border-radius:16px;border:1px solid var(--Stroke-Disabled-Default, #cbd5e1);background:var(--Fill-Disabled-Default, #f8fafc);color:var(--content-disabled-default, #cbd5e1);cursor:not-allowed}._search_12k26_1:disabled::placeholder{color:var(--Content-Neutral-Disabled, #94a3b8)}._small_12k26_68{padding:8px 11px 8px 28px;font-size:12px}._medium_12k26_73{padding:8px 10px 8px 30px;font-size:14px}._large_12k26_78{padding:11px 12px 11px 32px;font-size:15px}._small_12k26_68:not(:placeholder-shown){padding:8px 32px 8px 28px}._medium_12k26_73:not(:placeholder-shown){padding:8px 36px 8px 30px}._large_12k26_78:not(:placeholder-shown){padding:11px 40px 11px 32px}._error_12k26_97{border:1px solid var(--Stroke-Negative-Active, #dc2626);background:var(--Fill-Negative-Default-Active, #fee2e2);color:var(--Content-Negative-Default-Active, #dc2626);animation:_errorShake_12k26_1 .4s ease-in-out}._error_12k26_97::placeholder{color:#d6837a}._error_12k26_97:active{border:1px solid var(--Stroke-Negative-Active, #dc2626)}._error_12k26_97:focus{box-shadow:0 0 0 3px var(--ui-red-400, #f87171)}._errorMessage_12k26_116{font-family:Poppins Medium;color:#e74c3c;margin-top:2px;margin-left:4px;animation:_errorMessageSlide_12k26_1 .3s ease-out;transform-origin:top}._errorMessage_small_12k26_125{font-size:10px}._errorMessage_medium_12k26_129{font-size:12px}._errorMessage_large_12k26_133{font-size:14px}._helperText_12k26_137{font-family:Poppins Regular;color:#acacac;margin-top:2px;margin-left:4px}._helperText_small_12k26_144,._helperText_medium_12k26_148{font-size:11px}._helperText_large_12k26_152{font-size:13px;margin-top:7px}._helperText_disabled_12k26_157{color:var(--content-disabled-default, #cbd5e1)}._icon_12k26_162{position:absolute;left:8px;color:var(--Content-Neutral-Default, #475569);pointer-events:none;z-index:10;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center}._icon_disabled_12k26_175{color:var(--Content-Neutral-Disabled, #94a3b8)}._clearButton_12k26_180{position:absolute;right:8px;top:50%;transform:translateY(-50%);background:none;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--Content-Neutral-Default, #475569);padding:4px;border-radius:4px;transition:all .2s ease;z-index:10}._clearButton_12k26_180:hover{background-color:var(--Fill-Neutral-Default-Hover, #f1f5f9);color:var(--Content-Neutral-Default-Active, #000)}._clearButton_12k26_180:focus{outline:none;box-shadow:0 0 0 2px var(--ui-blue-400, #7eaae6)}._clearButton_disabled_12k26_208{color:var(--Content-Neutral-Disabled, #94a3b8);cursor:not-allowed}._clearButton_disabled_12k26_208:hover{background:none}._clearButton_inverted_12k26_218{color:#fff}._clearButton_inverted_12k26_218:hover{background-color:#ffffff1a;color:#fff}._clearButton_inverted_12k26_218:focus{box-shadow:0 0 0 2px #ffffff4d}._clearButton_inverted_disabled_12k26_231{color:var(--content-disabled-default, #4f88d9);cursor:not-allowed}._clearButton_inverted_disabled_12k26_231:hover{background:none}._required_12k26_241{color:var(--Content-Negative-Default-Active, #dc2626);margin-left:2px}@keyframes _errorShake_12k26_1{0%,to{transform:translate(0)}10%,30%,50%,70%,90%{transform:translate(-2px)}20%,40%,60%,80%{transform:translate(2px)}}@keyframes _errorMessageSlide_12k26_1{0%{opacity:0;transform:translateY(-5px) scaleY(0)}50%{opacity:.8;transform:translateY(-2px) scaleY(.7)}to{opacity:1;transform:translateY(0) scaleY(1)}}._inverted_12k26_283{border:1px solid var(--Stroke-Neutral-Secondary, #c9e1f6);background-color:transparent!important;color:#fff!important}._inverted_12k26_283:focus{box-shadow:0 0 0 3px #ffffff4d!important}._inverted_12k26_283:active{border:1px solid white!important}._inverted_12k26_283::placeholder{color:#ffffffb3!important}._label_inverted_12k26_301{color:#fff!important}._helperText_inverted_12k26_305{color:var(--Content-Neutral-Default-Default, #fafafa)}._icon_inverted_12k26_309{color:#fff!important}._errorMessage_inverted_12k26_313{color:var(--Content-Negative-Default-Active, #f87171)!important}._inverted_12k26_283._error_12k26_97{border:1px solid var(--Stroke-Negative-Active, #ef4444)!important;color:var(--Content-Negative-Default-Active, #f87171)!important;background-color:transparent!important}._inverted_12k26_283._error_12k26_97::placeholder{color:var(--Content-Negative-Default-Active, #f87171)!important}._inverted_12k26_283._error_12k26_97:focus{border:1px solid transparent!important;box-shadow:0 0 0 3px var(--ui-red-400, #f87171)!important}._inverted_12k26_283._error_12k26_97:active{border:1px solid transparent!important;box-shadow:0 0 0 3px var(--ui-red-400, #f87171)!important}._inverted_12k26_283:disabled{border:1px solid var(--Stroke-Disabled-Default, #1b468a)!important;background-color:transparent!important;color:var(--content-disabled-default, #4f88d9)!important;cursor:not-allowed}._inverted_12k26_283:disabled::placeholder{color:var(--content-disabled-default, #4f88d9)!important}._label_inverted_disabled_12k26_350{color:var(--Content-Neutral-Default-Active, #FFF)}._helperText_inverted_disabled_12k26_354{color:var(--Content-Neutral-Default-Default, #FAFAFA)}._icon_inverted_disabled_12k26_358{color:var(--content-disabled-default, #4f88d9)!important}._inverted_12k26_283:disabled:focus,._inverted_12k26_283:disabled:active{box-shadow:none!important}._inverted_12k26_283._error_12k26_97:disabled{border:1px solid var(--Stroke-Negative-Active, #ef4444)!important;color:var(--Content-Negative-Default-Active, #f87171)!important}._inverted_12k26_283._error_12k26_97:disabled:focus,._inverted_12k26_283._error_12k26_97:disabled:active{box-shadow:0 0 0 3px var(--ui-red-400, #f87171)!important}._inverted_12k26_283._error_12k26_97:disabled::placeholder{color:var(--Content-Negative-Default-Active, #f87171)!important}._required_inverted_12k26_382{color:var(--Content-Negative-Default-Active, #f87171)}._required_disabled_12k26_386{color:var(--content-disabled-default, #CBD5E1)}._required_inverted_disabled_12k26_390{color:var(--content-disabled-default, #4F88D9)}._dropdown_12k26_395{position:absolute;top:100%;left:0;right:0;margin-top:4px;background:#fff;border:1px solid var(--Stroke-Neutral-Primary, #ddd);border-radius:12px;box-shadow:0 4px 12px #0000001a;max-height:240px;overflow-y:auto;z-index:1000;animation:_dropdownSlide_12k26_1 .2s ease-out}._dropdown_inverted_12k26_411{background:var(--Fill-Brand-Inverted-Active, #2054A5);border:1px solid var(--Stroke-Neutral-Secondary, #c9e1f6);box-shadow:0 4px 12px #0000004d}._option_12k26_418{display:flex;align-items:center;padding:10px 12px;cursor:pointer;transition:all .2s ease;color:var(--Content-Neutral-Default-Active, #000);font-family:Poppins Regular;font-size:14px;border-bottom:1px solid var(--Stroke-Neutral-Primary, #e5e7eb)}._option_12k26_418:first-child{border-radius:12px 12px 0 0}._option_12k26_418:last-child{border-radius:0 0 12px 12px;border-bottom:none}._option_12k26_418:hover,._option_highlighted_12k26_440{background:var(--Fill-Neutral-Default-Hover, #f1f5f9)}._option_inverted_12k26_444{color:#fff;border-bottom-color:#fff3}._option_inverted_12k26_444:hover,._option_inverted_12k26_444._option_highlighted_12k26_440{background:#ffffff1a}._option_inverted_12k26_444:last-child{border-bottom:none}._optionIcon_12k26_458{display:flex;align-items:center;justify-content:center;margin-right:8px;color:var(--Content-Neutral-Default, #475569)}._option_inverted_12k26_444 ._optionIcon_12k26_458{color:#fffc}._optionLabel_12k26_470{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes _dropdownSlide_12k26_1{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}._dropdown_12k26_395::-webkit-scrollbar{width:6px}._dropdown_12k26_395::-webkit-scrollbar-track{background:transparent}._dropdown_12k26_395::-webkit-scrollbar-thumb{background:var(--Stroke-Neutral-Primary, #cbd5e1);border-radius:3px}._dropdown_12k26_395::-webkit-scrollbar-thumb:hover{background:var(--Stroke-Neutral-Primary, #94a3b8)}._dropdown_inverted_12k26_411::-webkit-scrollbar-thumb{background:#ffffff4d}._dropdown_inverted_12k26_411::-webkit-scrollbar-thumb:hover{background:#ffffff80}
|
|
@@ -1,25 +0,0 @@
|
|
|
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>;
|
|
@@ -1,188 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Search, type SearchProps, type SearchSize, type SearchOption } from './Search';
|