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