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