bmi-next-brokers 2.3.8 → 2.3.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/assets/index8.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._tooltip_mbgpt_1{position:fixed;background-color:#eef3fc;border:1px solid #2054a5;border-radius:6px;z-index:9000;font-size:12px;font-family:var(--font-regular);line-height:normal;color:#2054a5}._scrollableContent_mbgpt_13{display:flex;padding:8px;overflow-y:auto;word-wrap:break-word}._scrollableContent_mbgpt_13::-webkit-scrollbar{display:none}._tooltip_mbgpt_1:before,._tooltip_mbgpt_1:after{content:"";position:absolute;width:0;height:0}._right_mbgpt_34{transform:translateY(-50%)}._right_mbgpt_34:before{top:calc(50% + var(--arrow-offset, 0px));left:-8px;transform:translateY(-50%);border-top:7px solid transparent;border-bottom:7px solid transparent;border-right:8px solid #2054a5}._right_mbgpt_34:after{top:calc(50% + var(--arrow-offset, 0px));left:-6px;transform:translateY(-50%);border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:7px solid #eef3fc}._left_mbgpt_59{transform:translateY(-50%)}._left_mbgpt_59:before{top:calc(50% + var(--arrow-offset, 0px));right:-8px;transform:translateY(-50%);border-top:7px solid transparent;border-bottom:7px solid transparent;border-left:8px solid #2054a5}._left_mbgpt_59:after{top:calc(50% + var(--arrow-offset, 0px));right:-6px;transform:translateY(-50%);border-top:6px solid transparent;border-bottom:6px solid transparent;border-left:7px solid #eef3fc}._top_mbgpt_82{transform:translate(-50%)}._top_mbgpt_82:before{bottom:-8px;left:calc(50% + var(--arrow-offset, 0px));transform:translate(-50%);border-left:7px solid transparent;border-right:7px solid transparent;border-top:8px solid #2054a5}._top_mbgpt_82:after{bottom:-6px;left:calc(50% + var(--arrow-offset, 0px));transform:translate(-50%);border-left:6px solid transparent;border-right:6px solid transparent;border-top:7px solid #eef3fc}._bottom_mbgpt_105{transform:translate(-50%)}._bottom_mbgpt_105:before{top:-8px;left:calc(50% + var(--arrow-offset, 0px));transform:translate(-50%);border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:8px solid #2054a5}._bottom_mbgpt_105:after{top:-6px;left:calc(50% + var(--arrow-offset, 0px));transform:translate(-50%);border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:7px solid #eef3fc}
|
|
@@ -30,7 +30,7 @@ import '../../../assets/index14.css';const I = "_menuItem_16vvj_1", p = "_conten
|
|
|
30
30
|
o && /* @__PURE__ */ r("span", { className: "bodyRegular", children: e.label }),
|
|
31
31
|
e.iconBefore && o && /* @__PURE__ */ r("div", { className: t.iconBefore, children: /* @__PURE__ */ r(s, { name: e.iconBefore, width: 20, height: 20 }) })
|
|
32
32
|
] }),
|
|
33
|
-
!o && /* @__PURE__ */ r(u, { target: c.current, visible: v, gap: 20, children: e.label })
|
|
33
|
+
!o && /* @__PURE__ */ r(u, { target: c.current, visible: v, gap: 20, delay: 0, children: e.label })
|
|
34
34
|
]
|
|
35
35
|
}
|
|
36
36
|
);
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Posicionamiento del Tooltip
|
|
3
|
+
*/
|
|
4
|
+
type Placement = "right" | "left" | "top" | "bottom";
|
|
1
5
|
/**
|
|
2
6
|
* Interfaz de props Tooltip.
|
|
3
7
|
*/
|
|
@@ -6,6 +10,9 @@ interface TooltipProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
6
10
|
children: React.ReactNode;
|
|
7
11
|
visible: boolean;
|
|
8
12
|
gap?: number;
|
|
13
|
+
defaultPlacement?: Placement;
|
|
14
|
+
/** Milisegundos de hover antes de mostrar el tooltip. Por defecto 1000 ms. */
|
|
15
|
+
delay?: number;
|
|
9
16
|
}
|
|
10
|
-
export declare const Tooltip: ({ target, children, visible, style, gap, }: TooltipProps) => import('react').ReactPortal | null;
|
|
17
|
+
export declare const Tooltip: ({ target, children, visible, style, gap, defaultPlacement, delay, }: TooltipProps) => import('react').ReactPortal | null;
|
|
11
18
|
export {};
|
|
@@ -1,107 +1,130 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import '../../assets/index8.css';const
|
|
5
|
-
tooltip:
|
|
6
|
-
scrollableContent:
|
|
7
|
-
right:
|
|
8
|
-
left:
|
|
9
|
-
top:
|
|
10
|
-
bottom:
|
|
11
|
-
},
|
|
1
|
+
import { jsx as j } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as D, useState as a, useEffect as k, useLayoutEffect as L } from "react";
|
|
3
|
+
import { createPortal as F } from "react-dom";
|
|
4
|
+
import '../../assets/index8.css';const G = "_tooltip_mbgpt_1", J = "_scrollableContent_mbgpt_13", K = "_right_mbgpt_34", Q = "_left_mbgpt_59", U = "_top_mbgpt_82", X = "_bottom_mbgpt_105", g = {
|
|
5
|
+
tooltip: G,
|
|
6
|
+
scrollableContent: J,
|
|
7
|
+
right: K,
|
|
8
|
+
left: Q,
|
|
9
|
+
top: U,
|
|
10
|
+
bottom: X
|
|
11
|
+
}, nt = ({
|
|
12
12
|
target: e,
|
|
13
|
-
children:
|
|
14
|
-
visible:
|
|
15
|
-
style:
|
|
16
|
-
gap:
|
|
13
|
+
children: v,
|
|
14
|
+
visible: _,
|
|
15
|
+
style: O,
|
|
16
|
+
gap: r = 12,
|
|
17
|
+
defaultPlacement: h = "right",
|
|
18
|
+
delay: C = 500
|
|
17
19
|
}) => {
|
|
18
|
-
const n =
|
|
20
|
+
const n = D(null), [c, x] = a(!1), [W, y] = a(h);
|
|
21
|
+
k(() => {
|
|
22
|
+
if (!_) {
|
|
23
|
+
x(!1);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const t = setTimeout(() => x(!0), C);
|
|
27
|
+
return () => clearTimeout(t);
|
|
28
|
+
}, [_, C]);
|
|
29
|
+
const [R, H] = a({ top: 0, left: 0 }), [$, T] = a(0), z = 15, f = 7.5, l = () => {
|
|
19
30
|
if (!e || !n.current) return;
|
|
20
|
-
const t = e.getBoundingClientRect(),
|
|
21
|
-
const
|
|
22
|
-
return Math.max(
|
|
23
|
-
},
|
|
24
|
-
const
|
|
25
|
-
return
|
|
26
|
-
},
|
|
31
|
+
const t = e.getBoundingClientRect(), b = n.current.offsetWidth, s = n.current.offsetHeight, m = window.innerHeight, M = window.innerWidth - t.right, P = t.left, A = m - t.bottom, B = (o) => {
|
|
32
|
+
const i = f, u = m - s - f;
|
|
33
|
+
return Math.max(i, Math.min(o, u));
|
|
34
|
+
}, E = (o) => {
|
|
35
|
+
const i = o + s / 2, u = o - s / 2;
|
|
36
|
+
return i + f > m ? m - s / 2 - f : u - f < 0 ? s / 2 + f : o;
|
|
37
|
+
}, N = (o) => {
|
|
27
38
|
if (!e || !n.current) return;
|
|
28
|
-
const
|
|
39
|
+
const i = e.getBoundingClientRect(), u = i.left + i.width / 2, p = n.current.getBoundingClientRect(), V = p.left + p.width / 2;
|
|
29
40
|
if (o === "right" || o === "left") {
|
|
30
|
-
const
|
|
31
|
-
|
|
41
|
+
const I = i.top + i.height / 2, q = p.top + p.height / 2;
|
|
42
|
+
T(I - q);
|
|
32
43
|
} else
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
44
|
+
T(u - V);
|
|
45
|
+
}, S = (o) => {
|
|
46
|
+
switch (o) {
|
|
47
|
+
case "right":
|
|
48
|
+
return M >= b + r;
|
|
49
|
+
case "left":
|
|
50
|
+
return P >= b + r;
|
|
51
|
+
case "bottom":
|
|
52
|
+
return A >= s + r;
|
|
53
|
+
case "top":
|
|
54
|
+
return t.top >= s + r;
|
|
55
|
+
}
|
|
56
|
+
}, w = [
|
|
57
|
+
h,
|
|
58
|
+
...{
|
|
59
|
+
top: ["bottom", "right", "left"],
|
|
60
|
+
bottom: ["top", "right", "left"],
|
|
61
|
+
right: ["left", "top", "bottom"],
|
|
62
|
+
left: ["right", "top", "bottom"]
|
|
63
|
+
}[h]
|
|
64
|
+
].find(S) ?? h;
|
|
65
|
+
let d = { top: 0, left: 0 };
|
|
66
|
+
switch (w) {
|
|
67
|
+
case "right":
|
|
68
|
+
d = {
|
|
69
|
+
top: E(t.top + t.height / 2),
|
|
70
|
+
left: t.right + r
|
|
71
|
+
};
|
|
72
|
+
break;
|
|
73
|
+
case "left":
|
|
74
|
+
d = {
|
|
75
|
+
top: E(t.top + t.height / 2),
|
|
76
|
+
left: t.right - t.width - b - r
|
|
77
|
+
};
|
|
78
|
+
break;
|
|
79
|
+
case "bottom":
|
|
80
|
+
d = {
|
|
81
|
+
top: B(t.bottom + r),
|
|
82
|
+
left: t.left + t.width / 2
|
|
83
|
+
};
|
|
84
|
+
break;
|
|
85
|
+
case "top":
|
|
86
|
+
d = {
|
|
87
|
+
top: B(t.top - s - r),
|
|
88
|
+
left: t.left + t.width / 2
|
|
89
|
+
};
|
|
90
|
+
break;
|
|
69
91
|
}
|
|
92
|
+
y(w), H(d), setTimeout(() => N(w), 0);
|
|
70
93
|
};
|
|
71
|
-
return
|
|
72
|
-
|
|
73
|
-
}, [
|
|
74
|
-
if (!n.current || !
|
|
75
|
-
const t = new ResizeObserver(
|
|
94
|
+
return L(() => {
|
|
95
|
+
c && l();
|
|
96
|
+
}, [c, v]), L(() => {
|
|
97
|
+
if (!n.current || !c) return;
|
|
98
|
+
const t = new ResizeObserver(l);
|
|
76
99
|
return t.observe(n.current), () => t.disconnect();
|
|
77
|
-
}, [
|
|
78
|
-
if (!e || !
|
|
79
|
-
const t = new ResizeObserver(
|
|
80
|
-
return t.observe(e), window.addEventListener("scroll",
|
|
81
|
-
t.disconnect(), window.removeEventListener("scroll",
|
|
100
|
+
}, [c]), k(() => {
|
|
101
|
+
if (!e || !c) return;
|
|
102
|
+
const t = new ResizeObserver(l);
|
|
103
|
+
return t.observe(e), window.addEventListener("scroll", l, !0), window.addEventListener("resize", l), () => {
|
|
104
|
+
t.disconnect(), window.removeEventListener("scroll", l, !0), window.removeEventListener("resize", l);
|
|
82
105
|
};
|
|
83
|
-
}, [e,
|
|
84
|
-
/* @__PURE__ */
|
|
106
|
+
}, [e, c]), !c || !e ? null : F(
|
|
107
|
+
/* @__PURE__ */ j(
|
|
85
108
|
"div",
|
|
86
109
|
{
|
|
87
110
|
ref: n,
|
|
88
|
-
className:
|
|
111
|
+
className: `${g.tooltip} ${g[W]}`,
|
|
89
112
|
style: {
|
|
90
|
-
top:
|
|
91
|
-
left:
|
|
92
|
-
"--arrow-offset": `${
|
|
113
|
+
top: R.top,
|
|
114
|
+
left: R.left,
|
|
115
|
+
"--arrow-offset": `${$}px`,
|
|
93
116
|
//posición flecha tooltip
|
|
94
|
-
...
|
|
117
|
+
...O
|
|
95
118
|
},
|
|
96
|
-
children: /* @__PURE__ */
|
|
119
|
+
children: /* @__PURE__ */ j(
|
|
97
120
|
"div",
|
|
98
121
|
{
|
|
99
|
-
className:
|
|
122
|
+
className: g.scrollableContent,
|
|
100
123
|
style: {
|
|
101
|
-
maxWidth: `calc(85dvw - ${
|
|
102
|
-
maxHeight: `calc(100dvh - ${
|
|
124
|
+
maxWidth: `calc(85dvw - ${z}px)`,
|
|
125
|
+
maxHeight: `calc(100dvh - ${z}px)`
|
|
103
126
|
},
|
|
104
|
-
children:
|
|
127
|
+
children: v
|
|
105
128
|
}
|
|
106
129
|
)
|
|
107
130
|
}
|
|
@@ -110,5 +133,5 @@ import '../../assets/index8.css';const N = "_tooltip_11uqe_1", V = "_scrollableC
|
|
|
110
133
|
);
|
|
111
134
|
};
|
|
112
135
|
export {
|
|
113
|
-
|
|
136
|
+
nt as Tooltip
|
|
114
137
|
};
|
package/package.json
CHANGED