@reportportal/ui-kit 0.0.1-alpha.176 → 0.0.1-alpha.177
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/tooltip.js +59 -57
- package/package.json +1 -1
package/dist/tooltip.js
CHANGED
|
@@ -1,105 +1,107 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as u, Fragment as P, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { useState as R, useRef as f } from "react";
|
|
3
3
|
import { createPortal as G } from "react-dom";
|
|
4
4
|
import { c as j } from "./bind-06a7ff84.js";
|
|
5
5
|
import { useFloating as k, offset as $, flip as B, arrow as C, autoUpdate as U, FloatingArrow as Y } from "@floating-ui/react";
|
|
6
|
-
import { T as
|
|
6
|
+
import { T as h, g as Z, b as q, a as z } from "./floatingUi-41f8c7b5.js";
|
|
7
7
|
const J = {
|
|
8
8
|
"tooltip-wrapper": "_tooltip-wrapper_1n6ya_16",
|
|
9
9
|
"tooltip-content": "_tooltip-content_1n6ya_26"
|
|
10
|
-
},
|
|
11
|
-
content:
|
|
10
|
+
}, i = j.bind(J), K = 300, Q = 100, st = ({
|
|
11
|
+
content: g,
|
|
12
12
|
wrapperClassName: x,
|
|
13
|
-
tooltipClassName:
|
|
13
|
+
tooltipClassName: T,
|
|
14
14
|
contentClassName: w,
|
|
15
|
-
dynamicWidth:
|
|
16
|
-
width:
|
|
17
|
-
minWidth:
|
|
18
|
-
safeZone:
|
|
19
|
-
zIndex:
|
|
20
|
-
placement:
|
|
21
|
-
arrowColor:
|
|
22
|
-
dataAutomationId:
|
|
23
|
-
mainAxis:
|
|
24
|
-
children:
|
|
25
|
-
portalRoot:
|
|
26
|
-
isFloating:
|
|
15
|
+
dynamicWidth: _,
|
|
16
|
+
width: A,
|
|
17
|
+
minWidth: E = 120,
|
|
18
|
+
safeZone: b = 4,
|
|
19
|
+
zIndex: y = 9,
|
|
20
|
+
placement: I = "bottom",
|
|
21
|
+
arrowColor: N = "rgba(34, 34, 34, 0.91)",
|
|
22
|
+
dataAutomationId: F,
|
|
23
|
+
mainAxis: O = !0,
|
|
24
|
+
children: S,
|
|
25
|
+
portalRoot: r,
|
|
26
|
+
isFloating: W = !0
|
|
27
27
|
}) => {
|
|
28
|
-
const [a, l] = R(!1),
|
|
28
|
+
const [a, l] = R(!1), c = f(null), e = f(), { refs: m, floatingStyles: v, context: L } = k({
|
|
29
29
|
open: a,
|
|
30
|
-
placement:
|
|
30
|
+
placement: I,
|
|
31
31
|
middleware: [
|
|
32
|
-
$(({ rects:
|
|
33
|
-
mainAxis:
|
|
34
|
-
alignmentAxis: Z(
|
|
32
|
+
$(({ rects: t, placement: H }) => ({
|
|
33
|
+
mainAxis: b + h,
|
|
34
|
+
alignmentAxis: Z(t, H)
|
|
35
35
|
})),
|
|
36
|
-
|
|
37
|
-
mainAxis:
|
|
36
|
+
W && B({
|
|
37
|
+
mainAxis: O,
|
|
38
38
|
fallbackAxisSideDirection: "start",
|
|
39
39
|
fallbackPlacements: q
|
|
40
40
|
}),
|
|
41
41
|
C({
|
|
42
|
-
element:
|
|
42
|
+
element: c
|
|
43
43
|
})
|
|
44
44
|
],
|
|
45
45
|
whileElementsMounted: U
|
|
46
|
-
}),
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
},
|
|
46
|
+
}), o = _ ? null : { width: `${A}px` }, M = document.documentElement.clientWidth, D = o || M - Q, n = () => {
|
|
47
|
+
e.current && clearTimeout(e.current), l(!1);
|
|
48
|
+
}, d = () => {
|
|
49
|
+
e.current = setTimeout(() => l(!0), K);
|
|
50
|
+
}, p = () => /* @__PURE__ */ u(
|
|
51
51
|
"div",
|
|
52
52
|
{
|
|
53
|
-
ref:
|
|
53
|
+
ref: m.setFloating,
|
|
54
54
|
style: {
|
|
55
|
-
...
|
|
56
|
-
...
|
|
57
|
-
minWidth:
|
|
58
|
-
zIndex:
|
|
55
|
+
...v,
|
|
56
|
+
...o,
|
|
57
|
+
minWidth: E,
|
|
58
|
+
zIndex: y,
|
|
59
59
|
pointerEvents: "none"
|
|
60
60
|
},
|
|
61
|
-
"data-automation-id":
|
|
62
|
-
className:
|
|
61
|
+
"data-automation-id": F,
|
|
62
|
+
className: i(T),
|
|
63
63
|
children: [
|
|
64
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ s(
|
|
65
65
|
Y,
|
|
66
66
|
{
|
|
67
|
-
ref:
|
|
68
|
-
context:
|
|
67
|
+
ref: c,
|
|
68
|
+
context: L,
|
|
69
69
|
width: z,
|
|
70
|
-
height:
|
|
71
|
-
fill:
|
|
70
|
+
height: h,
|
|
71
|
+
fill: N
|
|
72
72
|
}
|
|
73
73
|
),
|
|
74
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ s(
|
|
75
75
|
"div",
|
|
76
76
|
{
|
|
77
|
-
className:
|
|
77
|
+
className: i("tooltip-content", w),
|
|
78
78
|
style: {
|
|
79
|
-
maxWidth: `${
|
|
79
|
+
maxWidth: `${D}px`
|
|
80
80
|
},
|
|
81
|
-
children:
|
|
81
|
+
children: g
|
|
82
82
|
}
|
|
83
83
|
)
|
|
84
84
|
]
|
|
85
85
|
}
|
|
86
86
|
);
|
|
87
|
-
return /* @__PURE__ */
|
|
88
|
-
/* @__PURE__ */
|
|
87
|
+
return /* @__PURE__ */ u(P, { children: [
|
|
88
|
+
/* @__PURE__ */ s(
|
|
89
89
|
"div",
|
|
90
90
|
{
|
|
91
|
-
ref:
|
|
92
|
-
className:
|
|
93
|
-
onMouseDown:
|
|
94
|
-
onMouseEnter:
|
|
95
|
-
onMouseLeave:
|
|
96
|
-
onFocus:
|
|
97
|
-
|
|
91
|
+
ref: m.setReference,
|
|
92
|
+
className: i("tooltip-wrapper", x),
|
|
93
|
+
onMouseDown: n,
|
|
94
|
+
onMouseEnter: d,
|
|
95
|
+
onMouseLeave: n,
|
|
96
|
+
onFocus: (t) => {
|
|
97
|
+
t.target === t.currentTarget && d();
|
|
98
|
+
},
|
|
99
|
+
onBlur: n,
|
|
98
100
|
tabIndex: 0,
|
|
99
|
-
children:
|
|
101
|
+
children: S
|
|
100
102
|
}
|
|
101
103
|
),
|
|
102
|
-
a && (
|
|
104
|
+
a && (r ? G(p(), r) : p())
|
|
103
105
|
] });
|
|
104
106
|
};
|
|
105
107
|
export {
|