bmi-next 1.0.24 → 1.0.25
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,95 +1,105 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
1
|
+
import { jsxs as o, Fragment as D, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as h, Fragment as A } from "react";
|
|
3
3
|
import { r as I } from "../../../index-Cp_B-Y3h.js";
|
|
4
4
|
import { Icon as j } from "../../../icons/icons.js";
|
|
5
5
|
import { Image as H } from "../../images/index.js";
|
|
6
|
-
import '../../../assets/index3.css';const B = "_overlay_f1ngj_1", Y = "_closing_f1ngj_11", L = "_bottomDrawer_f1ngj_35", S = "_drawerHeader_f1ngj_73", C = "_drawerIndicator_f1ngj_87",
|
|
6
|
+
import '../../../assets/index3.css';const B = "_overlay_f1ngj_1", Y = "_closing_f1ngj_11", L = "_bottomDrawer_f1ngj_35", S = "_drawerHeader_f1ngj_73", C = "_drawerIndicator_f1ngj_87", R = "_drawerContent_f1ngj_98", X = "_optionCountry_f1ngj_106", $ = "_optionNormal_f1ngj_107", b = "_options_f1ngj_125", x = "_closeButton_f1ngj_137", M = "_separator_f1ngj_150", t = {
|
|
7
7
|
overlay: B,
|
|
8
8
|
closing: Y,
|
|
9
9
|
bottomDrawer: L,
|
|
10
10
|
drawerHeader: S,
|
|
11
11
|
drawerIndicator: C,
|
|
12
|
-
drawerContent:
|
|
13
|
-
optionCountry:
|
|
14
|
-
optionNormal:
|
|
15
|
-
options:
|
|
16
|
-
closeButton:
|
|
17
|
-
separator:
|
|
12
|
+
drawerContent: R,
|
|
13
|
+
optionCountry: X,
|
|
14
|
+
optionNormal: $,
|
|
15
|
+
options: b,
|
|
16
|
+
closeButton: x,
|
|
17
|
+
separator: M
|
|
18
18
|
}, P = ({
|
|
19
|
-
isOpen:
|
|
19
|
+
isOpen: E,
|
|
20
20
|
handleClose: s,
|
|
21
|
-
dragPosition:
|
|
22
|
-
setDragPosition:
|
|
23
|
-
isClosing:
|
|
24
|
-
title:
|
|
25
|
-
options:
|
|
26
|
-
handleOptionClick:
|
|
27
|
-
countries:
|
|
28
|
-
zIndex:
|
|
21
|
+
dragPosition: p,
|
|
22
|
+
setDragPosition: m,
|
|
23
|
+
isClosing: u,
|
|
24
|
+
title: f,
|
|
25
|
+
options: _,
|
|
26
|
+
handleOptionClick: y,
|
|
27
|
+
countries: w,
|
|
28
|
+
zIndex: l
|
|
29
29
|
}) => {
|
|
30
|
-
const
|
|
31
|
-
if (!
|
|
32
|
-
const
|
|
30
|
+
const N = l ? 50 : 70, d = h(0), i = h(0);
|
|
31
|
+
if (!E) return null;
|
|
32
|
+
const g = (e) => {
|
|
33
33
|
const n = "touches" in e ? e.touches[0].clientY : e.clientY;
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
document.removeEventListener("mousemove",
|
|
37
|
-
},
|
|
38
|
-
const n = "touches" in e ? e.touches[0].clientY : e.clientY,
|
|
39
|
-
|
|
34
|
+
d.current = n, i.current = n, document.addEventListener("mousemove", a), document.addEventListener("touchmove", a), document.addEventListener("mouseup", c), document.addEventListener("touchend", c);
|
|
35
|
+
}, c = () => {
|
|
36
|
+
document.removeEventListener("mousemove", a), document.removeEventListener("touchmove", a), document.removeEventListener("mouseup", c), document.removeEventListener("touchend", c), i.current - d.current > 100 ? s() : m(0);
|
|
37
|
+
}, a = (e) => {
|
|
38
|
+
const n = "touches" in e ? e.touches[0].clientY : e.clientY, v = n - d.current;
|
|
39
|
+
i.current = n, v > 0 && m(v);
|
|
40
40
|
};
|
|
41
41
|
return I.createPortal(
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ o(D, { children: [
|
|
43
|
+
/* @__PURE__ */ r(
|
|
44
44
|
"div",
|
|
45
45
|
{
|
|
46
|
-
style: { zIndex: 2e3 + (
|
|
47
|
-
className: `${t.overlay} ${
|
|
46
|
+
style: { zIndex: 2e3 + (l || 0) },
|
|
47
|
+
className: `${t.overlay} ${u ? t.closing : ""}`,
|
|
48
48
|
onClick: s
|
|
49
49
|
}
|
|
50
50
|
),
|
|
51
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ o(
|
|
52
52
|
"div",
|
|
53
53
|
{
|
|
54
|
-
className: `${t.bottomDrawer} ${
|
|
54
|
+
className: `${t.bottomDrawer} ${u ? t.closing : ""}`,
|
|
55
55
|
style: {
|
|
56
|
-
transform: `translateY(${
|
|
57
|
-
zIndex: 2001 + (
|
|
56
|
+
transform: `translateY(${p ?? 0}px)`,
|
|
57
|
+
zIndex: 2001 + (l || 0)
|
|
58
58
|
},
|
|
59
59
|
children: [
|
|
60
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ o(
|
|
61
61
|
"header",
|
|
62
62
|
{
|
|
63
63
|
className: t.drawerHeader,
|
|
64
|
-
onMouseDown:
|
|
65
|
-
onTouchStart:
|
|
64
|
+
onMouseDown: g,
|
|
65
|
+
onTouchStart: g,
|
|
66
66
|
children: [
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ r("div", { className: t.drawerIndicator }),
|
|
68
|
+
/* @__PURE__ */ r("div", { className: t.closeButton, onClick: s, children: /* @__PURE__ */ r(j, { name: "Close", fill: "rgb(0 0 0/40%)" }) }),
|
|
69
|
+
/* @__PURE__ */ r("p", { children: f })
|
|
70
70
|
]
|
|
71
71
|
}
|
|
72
72
|
),
|
|
73
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ r(
|
|
74
74
|
"div",
|
|
75
75
|
{
|
|
76
76
|
className: t.drawerContent,
|
|
77
|
-
style: { maxHeight: `${
|
|
78
|
-
children: /* @__PURE__ */
|
|
79
|
-
(e, n) => e.hidden ? null : /* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */
|
|
77
|
+
style: { maxHeight: `${N}vh` },
|
|
78
|
+
children: /* @__PURE__ */ r("div", { className: t.options, children: _.map(
|
|
79
|
+
(e, n) => e.hidden ? null : /* @__PURE__ */ o(A, { children: [
|
|
80
|
+
/* @__PURE__ */ o(
|
|
81
81
|
"div",
|
|
82
82
|
{
|
|
83
|
-
className: `${
|
|
84
|
-
onClick: () =>
|
|
83
|
+
className: `${w ? t.optionCountry : t.optionNormal}`,
|
|
84
|
+
onClick: () => y(e),
|
|
85
85
|
children: [
|
|
86
|
-
e.image && /* @__PURE__ */
|
|
87
|
-
|
|
86
|
+
e.image && /* @__PURE__ */ r(H, { width: 30, height: 30, src: e.image.src }),
|
|
87
|
+
/* @__PURE__ */ o("div", { style: { display: "flex", flexDirection: "column" }, children: [
|
|
88
|
+
/* @__PURE__ */ r("p", { style: { margin: 0 }, children: e.label }),
|
|
89
|
+
e.description && /* @__PURE__ */ r(
|
|
90
|
+
"p",
|
|
91
|
+
{
|
|
92
|
+
className: "small2Regular",
|
|
93
|
+
style: { margin: 0, opacity: 0.5 },
|
|
94
|
+
children: e.description
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
] })
|
|
88
98
|
]
|
|
89
99
|
},
|
|
90
100
|
e.value
|
|
91
101
|
),
|
|
92
|
-
n <
|
|
102
|
+
n < _.length - 1 && /* @__PURE__ */ r("div", { className: t.separator })
|
|
93
103
|
] }, n)
|
|
94
104
|
) })
|
|
95
105
|
}
|
|
@@ -10,6 +10,7 @@ import { ImgProps } from '../images';
|
|
|
10
10
|
* @property {ImgProps} [image] - Imagen opcional para mostrar junto a la opción.
|
|
11
11
|
* @property {IconPropsWithIconName} [icon] - Icono opcional para mostrar junto a la opción.
|
|
12
12
|
* @property {boolean} [hidden] - Indica si la opción debe estar oculta en la lista.
|
|
13
|
+
* @property {string} [description] - Descripción opcional para mostrar junto a la opción.
|
|
13
14
|
*/
|
|
14
15
|
export interface Option {
|
|
15
16
|
/** El texto que se muestra para la opción */
|
|
@@ -22,6 +23,8 @@ export interface Option {
|
|
|
22
23
|
icon?: IconPropsWithIconName;
|
|
23
24
|
/** Indica si la opción debe estar oculta en la lista */
|
|
24
25
|
hidden?: boolean;
|
|
26
|
+
/** Descripción opcional para mostrar junto a la opción */
|
|
27
|
+
description?: string;
|
|
25
28
|
}
|
|
26
29
|
/**
|
|
27
30
|
* Props del componente Select.
|
package/package.json
CHANGED