bmi-next-brokers 2.5.7 → 2.5.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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
import { SelectSize } from '../Select';
|
|
2
3
|
export interface SearchableInputGroupField {
|
|
3
4
|
key: string;
|
|
@@ -8,7 +9,7 @@ export interface SearchableInputGroupField {
|
|
|
8
9
|
/** Cabecera de la columna en el dropdown. */
|
|
9
10
|
columnHeader?: string;
|
|
10
11
|
}
|
|
11
|
-
export interface SearchableInputGroupProps {
|
|
12
|
+
export interface SearchableInputGroupProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onSelect"> {
|
|
12
13
|
fields: SearchableInputGroupField[];
|
|
13
14
|
/** Valores controlados que se muestran en los inputs. */
|
|
14
15
|
values?: Record<string, string>;
|
|
@@ -25,5 +26,6 @@ export interface SearchableInputGroupProps {
|
|
|
25
26
|
disabled?: boolean;
|
|
26
27
|
size?: SelectSize;
|
|
27
28
|
btc?: boolean;
|
|
29
|
+
containerClassName?: string;
|
|
28
30
|
}
|
|
29
|
-
export declare const SearchableInputGroup: ({ fields, values, options, onSearch, onSelect, noResultMessage, loading, disabled, btc, size, }: SearchableInputGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare const SearchableInputGroup: ({ fields, values, options, onSearch, onSelect, noResultMessage, loading, disabled, btc, size, className, containerClassName, ...rest }: SearchableInputGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,103 +1,120 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { Input as
|
|
1
|
+
import { jsxs as v, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useState as W, useRef as N, useEffect as y } from "react";
|
|
3
|
+
import { createPortal as L } from "react-dom";
|
|
4
|
+
import { Input as O } from "../Input/Input.js";
|
|
5
5
|
import { s as n } from "../../Select.module-D_7bjq9u.js";
|
|
6
|
-
import { useBTC as
|
|
7
|
-
import { useDropdownPosition as
|
|
8
|
-
import '../../assets/index4.css';const
|
|
9
|
-
container:
|
|
10
|
-
inputs:
|
|
11
|
-
inputWrapper:
|
|
12
|
-
},
|
|
6
|
+
import { useBTC as k } from "../../hooks/btcContext/useBtcContext.js";
|
|
7
|
+
import { useDropdownPosition as F } from "../../hooks/useDropdownPosition.js";
|
|
8
|
+
import '../../assets/index4.css';const G = "_container_1kajw_1", M = "_inputs_1kajw_7", V = "_inputWrapper_1kajw_13", p = {
|
|
9
|
+
container: G,
|
|
10
|
+
inputs: M,
|
|
11
|
+
inputWrapper: V
|
|
12
|
+
}, X = ({
|
|
13
13
|
fields: m,
|
|
14
|
-
values:
|
|
14
|
+
values: _ = {},
|
|
15
15
|
options: a = [],
|
|
16
|
-
onSearch:
|
|
16
|
+
onSearch: b,
|
|
17
17
|
onSelect: u,
|
|
18
|
-
noResultMessage:
|
|
19
|
-
loading:
|
|
18
|
+
noResultMessage: $ = "No se encontraron resultados",
|
|
19
|
+
loading: j = !1,
|
|
20
20
|
disabled: f = !1,
|
|
21
|
-
btc:
|
|
22
|
-
size: s = "medium"
|
|
21
|
+
btc: C = !1,
|
|
22
|
+
size: s = "medium",
|
|
23
|
+
className: h,
|
|
24
|
+
containerClassName: I,
|
|
25
|
+
...R
|
|
23
26
|
}) => {
|
|
24
|
-
const { btc:
|
|
25
|
-
isOpen:
|
|
27
|
+
const { btc: x } = k(), B = C ?? x, [w, c] = W(!1), l = N(null), i = N(null), D = w && !f, E = F({
|
|
28
|
+
isOpen: w,
|
|
26
29
|
containerRef: l,
|
|
27
30
|
dropdownRef: i,
|
|
28
31
|
size: s,
|
|
29
32
|
optionsLength: a.length,
|
|
30
33
|
isSearchable: !0
|
|
31
34
|
});
|
|
32
|
-
|
|
35
|
+
y(() => {
|
|
33
36
|
const e = (t) => {
|
|
34
37
|
l.current && !l.current.contains(t.target) && i.current && !i.current.contains(t.target) && c(!1);
|
|
35
38
|
};
|
|
36
39
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
37
40
|
}, []);
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
+
const P = (e, t) => {
|
|
42
|
+
b(e, t), t.trim() ? c(!0) : c(!1);
|
|
43
|
+
}, S = (e) => {
|
|
41
44
|
u == null || u(e), c(!1);
|
|
42
|
-
},
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
45
|
+
}, T = !j && a.length === 0;
|
|
46
|
+
return /* @__PURE__ */ v(
|
|
47
|
+
"div",
|
|
48
|
+
{
|
|
49
|
+
ref: l,
|
|
50
|
+
className: [p.container, I].filter(Boolean).join(" "),
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ o(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
className: `${p.inputs} ${h || ""}`,
|
|
56
|
+
...R,
|
|
57
|
+
children: m.map(({ key: e, label: t, placeholder: r }) => /* @__PURE__ */ o("div", { className: p.inputWrapper, children: /* @__PURE__ */ o(
|
|
58
|
+
O,
|
|
59
|
+
{
|
|
60
|
+
label: t,
|
|
61
|
+
placeholder: r,
|
|
62
|
+
value: _[e] ?? "",
|
|
63
|
+
onChange: (d) => P(e, d.target.value),
|
|
64
|
+
icon: "SearchIcon",
|
|
65
|
+
size: s,
|
|
66
|
+
disabled: f,
|
|
67
|
+
btc: B
|
|
68
|
+
}
|
|
69
|
+
) }, e))
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
D && L(
|
|
73
|
+
/* @__PURE__ */ o(
|
|
70
74
|
"div",
|
|
71
75
|
{
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
76
|
+
ref: i,
|
|
77
|
+
className: [
|
|
78
|
+
n.dropdown,
|
|
79
|
+
n[s],
|
|
80
|
+
n.dropdownPortal,
|
|
81
|
+
n.dropdownTable
|
|
82
|
+
].join(" "),
|
|
83
|
+
style: E,
|
|
84
|
+
children: a.length > 0 ? a.map((e, t) => /* @__PURE__ */ o(
|
|
85
|
+
"div",
|
|
86
|
+
{
|
|
87
|
+
className: `${n.option} ${n.optionTable}`,
|
|
88
|
+
onMouseDown: (r) => {
|
|
89
|
+
r.preventDefault(), r.stopPropagation(), S(e);
|
|
90
|
+
},
|
|
91
|
+
children: m.map(({ key: r, columnKey: d, columnHeader: g }) => /* @__PURE__ */ v("div", { className: n.tableColumn, children: [
|
|
92
|
+
g && /* @__PURE__ */ o(
|
|
93
|
+
"div",
|
|
94
|
+
{
|
|
95
|
+
className: `${n.columnHeader} ${n[s]}`,
|
|
96
|
+
children: g
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
/* @__PURE__ */ o(
|
|
100
|
+
"div",
|
|
101
|
+
{
|
|
102
|
+
className: `${n.columnValue} ${n[s]}`,
|
|
103
|
+
children: String(e[d ?? r] ?? "")
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
] }, r))
|
|
107
|
+
},
|
|
108
|
+
t
|
|
109
|
+
)) : T && /* @__PURE__ */ o("span", { className: n.noResults, children: $ })
|
|
110
|
+
}
|
|
111
|
+
),
|
|
112
|
+
document.getElementById("root") || document.body
|
|
113
|
+
)
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
);
|
|
100
117
|
};
|
|
101
118
|
export {
|
|
102
|
-
|
|
119
|
+
X as SearchableInputGroup
|
|
103
120
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as p, jsx as l, Fragment as G } from "react/jsx-runtime";
|
|
2
|
-
import { useState as J, useRef as
|
|
2
|
+
import { useState as J, useRef as C, useEffect as K, useMemo as de } from "react";
|
|
3
3
|
import { createPortal as Re } from "react-dom";
|
|
4
4
|
import { s as e } from "../../Select.module-D_7bjq9u.js";
|
|
5
5
|
import { Icon as W } from "../../icons/Icon.js";
|
|
6
6
|
import { HelperText as We } from "../helperText/index.js";
|
|
7
7
|
import { FieldError as xe } from "../fieldError/index.js";
|
|
8
8
|
import { useIsMediaQuery as Pe } from "../../hooks/useMediaQuery.js";
|
|
9
|
-
import { Drawer as
|
|
10
|
-
import { useClose as
|
|
9
|
+
import { Drawer as Ve } from "../drawer/index.js";
|
|
10
|
+
import { useClose as Fe } from "../../hooks/useClose.js";
|
|
11
11
|
import { Input as je } from "../Input/Input.js";
|
|
12
12
|
import { useBTC as Me } from "../../hooks/btcContext/useBtcContext.js";
|
|
13
13
|
import { useDropdownPosition as Be } from "../../hooks/useDropdownPosition.js";
|
|
@@ -16,23 +16,23 @@ const nr = ({
|
|
|
16
16
|
label: x,
|
|
17
17
|
error: U,
|
|
18
18
|
helperText: P,
|
|
19
|
-
icon:
|
|
19
|
+
icon: L,
|
|
20
20
|
className: ue,
|
|
21
21
|
required: me,
|
|
22
|
-
placeholder:
|
|
23
|
-
options:
|
|
24
|
-
value:
|
|
22
|
+
placeholder: V = "Seleccionar...",
|
|
23
|
+
options: y = [],
|
|
24
|
+
value: f,
|
|
25
25
|
onChange: i,
|
|
26
|
-
onSearchInput:
|
|
27
|
-
disabled:
|
|
26
|
+
onSearchInput: F,
|
|
27
|
+
disabled: v = !1,
|
|
28
28
|
inverted: g = !1,
|
|
29
|
-
dynamicIcon:
|
|
30
|
-
showPlaceholderIcon:
|
|
29
|
+
dynamicIcon: he = !1,
|
|
30
|
+
showPlaceholderIcon: fe = !1,
|
|
31
31
|
btc: X,
|
|
32
|
-
columnHeaders:
|
|
32
|
+
columnHeaders: k,
|
|
33
33
|
searchable: pe = !1,
|
|
34
34
|
noSearchResult: Y = "No se encontraron resultados",
|
|
35
|
-
searchAndCheckbox:
|
|
35
|
+
searchAndCheckbox: E = !1,
|
|
36
36
|
customBorderColor: Z,
|
|
37
37
|
responsive: ge = !1,
|
|
38
38
|
title: $e,
|
|
@@ -40,60 +40,65 @@ const nr = ({
|
|
|
40
40
|
highlightMatch: Ne = !1,
|
|
41
41
|
...Se
|
|
42
42
|
}) => {
|
|
43
|
-
const j = !!
|
|
43
|
+
const j = !!F, { btc: ve } = Me(), be = X ?? ve, [a, b] = J(!1), [m, ye] = J(""), s = pe || E, $ = E, M = C(null), Oe = C(null), T = C(null), z = C(null), B = C(null), [O, w] = J([]), De = a && !v, Ce = Pe(`(max-width: ${we}px)`), A = ge && Ce && !v;
|
|
44
44
|
K(() => {
|
|
45
45
|
if ($)
|
|
46
|
-
if (Array.isArray(
|
|
47
|
-
const r =
|
|
48
|
-
w(
|
|
46
|
+
if (Array.isArray(f) && f.length > 0) {
|
|
47
|
+
const r = y.filter((n) => f.includes(n.value)), t = r.map((n) => n.value);
|
|
48
|
+
w((n) => {
|
|
49
|
+
const u = n.map((S) => S.value);
|
|
50
|
+
return u.length === r.length && r.every((S) => u.includes(S.value)) ? n : r;
|
|
51
|
+
}), (t.length !== f.length || !t.every((n) => f.includes(n))) && i && i(t);
|
|
49
52
|
} else
|
|
50
|
-
w([]);
|
|
51
|
-
else if (
|
|
52
|
-
const r =
|
|
53
|
-
r ? w(
|
|
53
|
+
w((r) => r.length === 0 ? r : []);
|
|
54
|
+
else if (f) {
|
|
55
|
+
const r = y.find((t) => t.value === f);
|
|
56
|
+
r ? w(
|
|
57
|
+
(t) => t.length === 1 && t[0].value === r.value ? t : [r]
|
|
58
|
+
) : (w((t) => t.length === 0 ? t : []), i && i(""));
|
|
54
59
|
} else
|
|
55
|
-
w([]);
|
|
56
|
-
}, [
|
|
57
|
-
const
|
|
60
|
+
w((r) => r.length === 0 ? r : []);
|
|
61
|
+
}, [f, y, $]);
|
|
62
|
+
const I = O.map((r) => r.value), o = O[0] ?? null, N = (r) => typeof r == "string" ? r.normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/\s+/g, "").toLowerCase() : "", ee = C("");
|
|
58
63
|
K(() => {
|
|
59
64
|
if (!s) return;
|
|
60
|
-
const r =
|
|
65
|
+
const r = m.trim(), t = ee.current.trim();
|
|
61
66
|
if ($) {
|
|
62
67
|
if (r.length > 0) {
|
|
63
|
-
const d =
|
|
64
|
-
(
|
|
65
|
-
),
|
|
66
|
-
d.length !==
|
|
68
|
+
const d = O.filter(
|
|
69
|
+
(u) => N(u.label).includes(N(r))
|
|
70
|
+
), n = d.map((u) => u.value);
|
|
71
|
+
d.length !== O.length && (w(d), i && i(n));
|
|
67
72
|
}
|
|
68
|
-
r === "" &&
|
|
73
|
+
r === "" && t.length > 0 && (w([]), i && i([]));
|
|
69
74
|
} else
|
|
70
|
-
o && r.length > 0 && !N(o.label).includes(N(r)) && (w([]), i && i("")), r === "" &&
|
|
71
|
-
ee.current =
|
|
75
|
+
o && r.length > 0 && !N(o.label).includes(N(r)) && (w([]), i && i("")), r === "" && t.length > 0 && (w([]), i && i(""));
|
|
76
|
+
ee.current = m;
|
|
72
77
|
}, [
|
|
73
|
-
|
|
78
|
+
m,
|
|
74
79
|
o,
|
|
75
|
-
|
|
80
|
+
O,
|
|
76
81
|
$,
|
|
77
82
|
s,
|
|
78
83
|
i
|
|
79
84
|
]);
|
|
80
|
-
const re = de(() => s ? a ?
|
|
85
|
+
const re = de(() => s ? a ? m : !$ && o ? o.label : $ && I.length > 0 ? `${I.length} ${I.length === 1 ? "seleccionado" : "seleccionados"}` : "" : "", [
|
|
81
86
|
s,
|
|
82
87
|
a,
|
|
83
|
-
|
|
88
|
+
m,
|
|
84
89
|
o,
|
|
85
|
-
|
|
90
|
+
I,
|
|
86
91
|
$
|
|
87
|
-
]), te = (r) =>
|
|
88
|
-
(r) => N(r.label).includes(N(
|
|
89
|
-
), [
|
|
92
|
+
]), te = (r) => O.some((t) => t.value === r), Q = de(() => !s || !m || j ? y : y.filter(
|
|
93
|
+
(r) => N(r.label).includes(N(m))
|
|
94
|
+
), [y, m, s, j]), _ = (() => {
|
|
90
95
|
if (U) return U;
|
|
91
|
-
if (s &&
|
|
96
|
+
if (s && m && m.trim().length > 0 && Q.length === 0 && !a && !f)
|
|
92
97
|
return Y;
|
|
93
98
|
})();
|
|
94
99
|
K(() => {
|
|
95
|
-
const r = (
|
|
96
|
-
M.current && !M.current.contains(
|
|
100
|
+
const r = (t) => {
|
|
101
|
+
M.current && !M.current.contains(t.target) && T.current && !T.current.contains(t.target) && b(!1);
|
|
97
102
|
};
|
|
98
103
|
return document.addEventListener("mousedown", r), () => {
|
|
99
104
|
document.removeEventListener("mousedown", r);
|
|
@@ -103,130 +108,130 @@ const nr = ({
|
|
|
103
108
|
e.select,
|
|
104
109
|
be && e.btc,
|
|
105
110
|
e[c],
|
|
106
|
-
|
|
107
|
-
|
|
111
|
+
_ ? e.error : "",
|
|
112
|
+
v ? e.disabled : "",
|
|
108
113
|
a ? e.open : "",
|
|
109
114
|
g ? e.inverted : "",
|
|
110
115
|
ue
|
|
111
|
-
].filter(Boolean).join(" "),
|
|
116
|
+
].filter(Boolean).join(" "), D = c === "small" ? 16 : c === "large" ? 20 : c === "extraLarge" ? 24 : 18, ne = he && (o != null && o.icon) && !(s && a) ? o.icon : L, Ie = () => {
|
|
112
117
|
var r;
|
|
113
|
-
|
|
114
|
-
}, q = (r,
|
|
118
|
+
v || (b(!a), s && !a && (se(), (r = B.current) == null || r.focus()));
|
|
119
|
+
}, q = (r, t = !0) => {
|
|
115
120
|
if (i)
|
|
116
121
|
if ($) {
|
|
117
|
-
const d = Array.isArray(
|
|
118
|
-
i(
|
|
122
|
+
const d = Array.isArray(f) ? f : [], u = d.includes(r) ? d.filter((h) => h !== r) : [...d, r];
|
|
123
|
+
i(u);
|
|
119
124
|
} else
|
|
120
|
-
i(r),
|
|
125
|
+
i(r), t && b(!1);
|
|
121
126
|
}, le = (r) => {
|
|
122
|
-
const
|
|
123
|
-
ye(
|
|
127
|
+
const t = r.target.value;
|
|
128
|
+
ye(t), a || b(!0), F && F(t);
|
|
124
129
|
}, se = () => {
|
|
125
|
-
a ||
|
|
130
|
+
a || b(!0);
|
|
126
131
|
}, _e = (r) => {
|
|
127
|
-
A && (r.preventDefault(), r.stopPropagation()), s && (r.stopPropagation(), a || (
|
|
128
|
-
var
|
|
129
|
-
(
|
|
132
|
+
A && (r.preventDefault(), r.stopPropagation()), s && (r.stopPropagation(), a || (b(!0), setTimeout(() => {
|
|
133
|
+
var t;
|
|
134
|
+
(t = B.current) == null || t.focus();
|
|
130
135
|
}, 0)));
|
|
131
|
-
}, H = (r,
|
|
132
|
-
if (!Ne || !
|
|
133
|
-
const d = N(r),
|
|
134
|
-
if (!d.includes(
|
|
135
|
-
const
|
|
136
|
+
}, H = (r, t) => {
|
|
137
|
+
if (!Ne || !t.trim()) return r;
|
|
138
|
+
const d = N(r), n = N(t.trim());
|
|
139
|
+
if (!d.includes(n)) return r;
|
|
140
|
+
const u = [], h = [];
|
|
136
141
|
for (let R = 0; R < r.length; R++) {
|
|
137
142
|
const Qe = N(r[R]);
|
|
138
143
|
for (let oe = 0; oe < Qe.length; oe++)
|
|
139
|
-
|
|
144
|
+
h.push(R);
|
|
140
145
|
}
|
|
141
|
-
const
|
|
142
|
-
return
|
|
146
|
+
const S = d.indexOf(n), Te = S + n.length - 1, ie = h[S], ae = h[Te] + 1;
|
|
147
|
+
return u.push(r.slice(0, ie)), u.push(
|
|
143
148
|
/* @__PURE__ */ l("mark", { className: e.highlight, children: r.slice(ie, ae) }, "highlight")
|
|
144
|
-
),
|
|
149
|
+
), u.push(r.slice(ae)), /* @__PURE__ */ l(G, { children: u });
|
|
145
150
|
}, ke = Be({
|
|
146
151
|
isOpen: a,
|
|
147
152
|
containerRef: z,
|
|
148
|
-
dropdownRef:
|
|
153
|
+
dropdownRef: T,
|
|
149
154
|
size: c,
|
|
150
|
-
optionsLength:
|
|
155
|
+
optionsLength: Q.length,
|
|
151
156
|
isSearchable: s,
|
|
152
157
|
label: x,
|
|
153
158
|
helperText: P,
|
|
154
|
-
displayError:
|
|
159
|
+
displayError: _
|
|
155
160
|
}), ce = ({
|
|
156
161
|
insideDrawer: r = !1,
|
|
157
|
-
handleOptionClickProp:
|
|
162
|
+
handleOptionClickProp: t
|
|
158
163
|
}) => {
|
|
159
|
-
const d = (
|
|
160
|
-
|
|
164
|
+
const d = (n) => {
|
|
165
|
+
t ? t(n) : q(n);
|
|
161
166
|
};
|
|
162
|
-
return
|
|
167
|
+
return Q.length > 0 ? Q.map((n, u) => /* @__PURE__ */ p(
|
|
163
168
|
"div",
|
|
164
169
|
{
|
|
165
|
-
className: `${e.option} ${r ? e.isDrawer : ""} ${te(
|
|
166
|
-
onClick: (
|
|
167
|
-
|
|
170
|
+
className: `${e.option} ${r ? e.isDrawer : ""} ${te(n.value) ? e.optionSelected : ""} ${g ? e.option_inverted : ""} ${n.columns ? e.optionTable : ""} ${E ? e.optionWithCheckbox : ""}`,
|
|
171
|
+
onClick: (h) => {
|
|
172
|
+
h.stopPropagation(), d(n.value);
|
|
168
173
|
},
|
|
169
174
|
children: [
|
|
170
|
-
|
|
175
|
+
E && /* @__PURE__ */ l(
|
|
171
176
|
"input",
|
|
172
177
|
{
|
|
173
178
|
type: "checkbox",
|
|
174
|
-
checked: te(
|
|
175
|
-
onChange: () => q(
|
|
176
|
-
onClick: (
|
|
179
|
+
checked: te(n.value),
|
|
180
|
+
onChange: () => q(n.value),
|
|
181
|
+
onClick: (h) => h.stopPropagation(),
|
|
177
182
|
className: e.optionCheckbox
|
|
178
183
|
}
|
|
179
184
|
),
|
|
180
|
-
|
|
181
|
-
/* @__PURE__ */ l("div", { className: `${e.columnHeader} ${e[c]}`, children:
|
|
185
|
+
n.columns ? /* @__PURE__ */ l(G, { children: k && Object.entries(k).map(([h, S]) => /* @__PURE__ */ p("div", { className: e.tableColumn, children: [
|
|
186
|
+
/* @__PURE__ */ l("div", { className: `${e.columnHeader} ${e[c]}`, children: S }),
|
|
182
187
|
/* @__PURE__ */ l("div", { className: `${e.columnValue} ${e[c]}`, children: H(
|
|
183
|
-
String(
|
|
184
|
-
|
|
188
|
+
String(n.columns[h] ?? ""),
|
|
189
|
+
m
|
|
185
190
|
) })
|
|
186
|
-
] },
|
|
191
|
+
] }, h)) }) : (
|
|
187
192
|
//opción tiene descripción
|
|
188
|
-
|
|
189
|
-
(
|
|
193
|
+
n.description ? /* @__PURE__ */ p("div", { className: e.optionWithDescriptionWrapper, children: [
|
|
194
|
+
(n.icon || L) && /* @__PURE__ */ l(
|
|
190
195
|
W,
|
|
191
196
|
{
|
|
192
|
-
name:
|
|
193
|
-
width:
|
|
194
|
-
height:
|
|
197
|
+
name: n.icon || L,
|
|
198
|
+
width: D,
|
|
199
|
+
height: D
|
|
195
200
|
}
|
|
196
201
|
),
|
|
197
202
|
/* @__PURE__ */ p("div", { className: e.optionWithDescription, children: [
|
|
198
|
-
/* @__PURE__ */ l("span", { className: e.optionWithDescriptionLabel, children: H(
|
|
199
|
-
/* @__PURE__ */ l("span", { className: e.optionWithDescriptionValue, children:
|
|
203
|
+
/* @__PURE__ */ l("span", { className: e.optionWithDescriptionLabel, children: H(n.label, m) }),
|
|
204
|
+
/* @__PURE__ */ l("span", { className: e.optionWithDescriptionValue, children: n.description })
|
|
200
205
|
] })
|
|
201
206
|
] }) : /* @__PURE__ */ p(G, { children: [
|
|
202
|
-
(
|
|
207
|
+
(n.icon || L) && /* @__PURE__ */ l("div", { className: e.optionIcon, children: /* @__PURE__ */ l(
|
|
203
208
|
W,
|
|
204
209
|
{
|
|
205
|
-
name:
|
|
206
|
-
width:
|
|
207
|
-
height:
|
|
210
|
+
name: n.icon || L,
|
|
211
|
+
width: D,
|
|
212
|
+
height: D
|
|
208
213
|
}
|
|
209
214
|
) }),
|
|
210
|
-
/* @__PURE__ */ l("div", { style: { whiteSpace: "pre-line", lineHeight: 1.25 }, children: H(
|
|
215
|
+
/* @__PURE__ */ l("div", { style: { whiteSpace: "pre-line", lineHeight: 1.25 }, children: H(n.label, m) })
|
|
211
216
|
] })
|
|
212
217
|
)
|
|
213
218
|
]
|
|
214
219
|
},
|
|
215
|
-
|
|
220
|
+
u
|
|
216
221
|
)) : /* @__PURE__ */ l("span", { className: e.noResults, children: Y });
|
|
217
222
|
}, Ee = () => {
|
|
218
|
-
const r =
|
|
223
|
+
const r = Fe(), t = (d) => {
|
|
219
224
|
q(d, !1), $ || r();
|
|
220
225
|
};
|
|
221
226
|
return /* @__PURE__ */ l(
|
|
222
227
|
"div",
|
|
223
228
|
{
|
|
224
|
-
className: `${e.dropdown} ${e.isDrawer} ${e[c]} ${g ? e.dropdown_inverted : ""} ${
|
|
229
|
+
className: `${e.dropdown} ${e.isDrawer} ${e[c]} ${g ? e.dropdown_inverted : ""} ${k ? e.dropdownTable : ""} ${s ? e.dropdownSearchable : ""}`,
|
|
225
230
|
children: /* @__PURE__ */ l(
|
|
226
231
|
ce,
|
|
227
232
|
{
|
|
228
233
|
insideDrawer: !0,
|
|
229
|
-
handleOptionClickProp:
|
|
234
|
+
handleOptionClickProp: t
|
|
230
235
|
}
|
|
231
236
|
)
|
|
232
237
|
}
|
|
@@ -236,13 +241,13 @@ const nr = ({
|
|
|
236
241
|
"div",
|
|
237
242
|
{
|
|
238
243
|
ref: z,
|
|
239
|
-
className: `${e.selectContainer} ${c === "medium" ? e.selectContainer_medium : c === "large" ? e.selectContainer_large : c === "extraLarge" ? e.selectContainer_extraLarge : ""} ${
|
|
244
|
+
className: `${e.selectContainer} ${c === "medium" ? e.selectContainer_medium : c === "large" ? e.selectContainer_large : c === "extraLarge" ? e.selectContainer_extraLarge : ""} ${v ? e.disabled : ""}`,
|
|
240
245
|
...Se,
|
|
241
246
|
children: [
|
|
242
247
|
x && /* @__PURE__ */ p(
|
|
243
248
|
"label",
|
|
244
249
|
{
|
|
245
|
-
className: `${e.label} ${c === "large" ? e.label_large : ""} ${c === "extraLarge" ? e.label_extraLarge : ""} ${g ? e.label_inverted : ""} ${
|
|
250
|
+
className: `${e.label} ${c === "large" ? e.label_large : ""} ${c === "extraLarge" ? e.label_extraLarge : ""} ${g ? e.label_inverted : ""} ${v ? e.disabled : ""} `,
|
|
246
251
|
children: [
|
|
247
252
|
x,
|
|
248
253
|
/* @__PURE__ */ l(
|
|
@@ -265,7 +270,7 @@ const nr = ({
|
|
|
265
270
|
style: Z ? { borderColor: Z } : void 0,
|
|
266
271
|
children: [
|
|
267
272
|
/* @__PURE__ */ p("div", { className: e.iconLabel, children: [
|
|
268
|
-
(s || ne &&
|
|
273
|
+
(s || ne && fe) && /* @__PURE__ */ l(
|
|
269
274
|
"div",
|
|
270
275
|
{
|
|
271
276
|
className: `${e.icon} ${g ? e.icon_inverted : ""}`,
|
|
@@ -273,8 +278,8 @@ const nr = ({
|
|
|
273
278
|
W,
|
|
274
279
|
{
|
|
275
280
|
name: s ? "SearchIcon" : ne,
|
|
276
|
-
width:
|
|
277
|
-
height:
|
|
281
|
+
width: D,
|
|
282
|
+
height: D
|
|
278
283
|
}
|
|
279
284
|
)
|
|
280
285
|
}
|
|
@@ -284,19 +289,19 @@ const nr = ({
|
|
|
284
289
|
{
|
|
285
290
|
ref: B,
|
|
286
291
|
value: re,
|
|
287
|
-
className: `${e.selectInput} ${!o && !a &&
|
|
288
|
-
placeholder:
|
|
292
|
+
className: `${e.selectInput} ${!o && !a && I.length === 0 ? e.placeholder : ""}`,
|
|
293
|
+
placeholder: V,
|
|
289
294
|
onChange: le,
|
|
290
295
|
onFocus: se,
|
|
291
296
|
onClick: _e,
|
|
292
|
-
disabled:
|
|
297
|
+
disabled: v,
|
|
293
298
|
readOnly: A || !a
|
|
294
299
|
}
|
|
295
300
|
) : /* @__PURE__ */ l(
|
|
296
301
|
"span",
|
|
297
302
|
{
|
|
298
303
|
className: `${e.selectValue} ${o ? "" : e.placeholder}`,
|
|
299
|
-
children: o ? o.label :
|
|
304
|
+
children: o ? o.label : V
|
|
300
305
|
}
|
|
301
306
|
)
|
|
302
307
|
] }),
|
|
@@ -313,19 +318,19 @@ const nr = ({
|
|
|
313
318
|
}
|
|
314
319
|
),
|
|
315
320
|
A ? /* @__PURE__ */ p(
|
|
316
|
-
|
|
321
|
+
Ve,
|
|
317
322
|
{
|
|
318
323
|
className: e.drawerSelect,
|
|
319
324
|
headerClassName: e.drawerSelectHeader,
|
|
320
325
|
isOpen: a,
|
|
321
|
-
setIsOpen:
|
|
326
|
+
setIsOpen: b,
|
|
322
327
|
title: $e,
|
|
323
328
|
zIndex: 1,
|
|
324
329
|
children: [
|
|
325
330
|
s && /* @__PURE__ */ l("div", { className: e.drawerSearchInput, children: /* @__PURE__ */ l(
|
|
326
331
|
je,
|
|
327
332
|
{
|
|
328
|
-
placeholder:
|
|
333
|
+
placeholder: V,
|
|
329
334
|
icon: "SearchIcon",
|
|
330
335
|
value: re,
|
|
331
336
|
onChange: le,
|
|
@@ -339,8 +344,8 @@ const nr = ({
|
|
|
339
344
|
/* @__PURE__ */ l(
|
|
340
345
|
"div",
|
|
341
346
|
{
|
|
342
|
-
ref:
|
|
343
|
-
className: `${e.dropdown} ${e[c]} ${e.dropdownPortal} ${g ? e.dropdown_inverted : ""} ${
|
|
347
|
+
ref: T,
|
|
348
|
+
className: `${e.dropdown} ${e[c]} ${e.dropdownPortal} ${g ? e.dropdown_inverted : ""} ${k ? e.dropdownTable : ""} ${s ? e.dropdownSearchable : ""}`,
|
|
344
349
|
style: ke,
|
|
345
350
|
children: /* @__PURE__ */ l(ce, {})
|
|
346
351
|
}
|
|
@@ -348,8 +353,8 @@ const nr = ({
|
|
|
348
353
|
document.getElementById("root") || document.body
|
|
349
354
|
)
|
|
350
355
|
] }),
|
|
351
|
-
|
|
352
|
-
P && !
|
|
356
|
+
_ && /* @__PURE__ */ l(xe, { message: _, size: c, inverted: g }),
|
|
357
|
+
P && !_ && /* @__PURE__ */ l(We, { message: P, size: c, inverted: g })
|
|
353
358
|
]
|
|
354
359
|
}
|
|
355
360
|
);
|
package/dist/main.d.ts
CHANGED
|
@@ -43,3 +43,4 @@ export type { SpinnerProps, SpinnerColor } from './components/Spinner';
|
|
|
43
43
|
export type { Step } from './components/stepper';
|
|
44
44
|
export type { ToastProps, ToastType, ToastPosition } from './components/Toast';
|
|
45
45
|
export type { ModalProps } from './components/modal';
|
|
46
|
+
export type { SearchableInputGroupProps, SearchableInputGroupField, } from './components/SearchableInputGroup';
|
package/package.json
CHANGED