@reportportal/ui-kit 0.0.1-alpha.64 → 0.0.1-alpha.65
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/popover/popover.d.ts +1 -0
- package/dist/popover.js +60 -56
- package/package.json +1 -1
package/dist/popover.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { useFloating as
|
|
4
|
-
import { c as
|
|
5
|
-
const
|
|
1
|
+
import { jsxs as f, Fragment as S, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as j, useState as C, useCallback as L } from "react";
|
|
3
|
+
import { useFloating as M, offset as U, flip as W, arrow as q, autoUpdate as z, useClick as B, useDismiss as J, useRole as K, useInteractions as Q, FloatingFocusManager as V, FloatingArrow as X } from "@floating-ui/react";
|
|
4
|
+
import { c as Y } from "./bind-06a7ff84.js";
|
|
5
|
+
const Z = "_popover_16ogt_1", $ = "_title_16ogt_28", O = {
|
|
6
6
|
"popover-wrapper": "_popover-wrapper_16ogt_1",
|
|
7
|
-
popover:
|
|
8
|
-
title:
|
|
9
|
-
},
|
|
7
|
+
popover: Z,
|
|
8
|
+
title: $
|
|
9
|
+
}, r = Y.bind(O), g = 16, d = 8, tt = ["top", "right", "bottom", "left"], et = [
|
|
10
10
|
"right",
|
|
11
11
|
"right-start",
|
|
12
12
|
"right-end",
|
|
13
13
|
"left",
|
|
14
14
|
"left-start",
|
|
15
15
|
"left-end"
|
|
16
|
-
],
|
|
16
|
+
], ot = [
|
|
17
17
|
"top",
|
|
18
18
|
"top-start",
|
|
19
19
|
"top-end",
|
|
@@ -26,70 +26,74 @@ const Q = "_popover_16ogt_1", V = "_title_16ogt_28", X = {
|
|
|
26
26
|
"left",
|
|
27
27
|
"left-start",
|
|
28
28
|
"left-end"
|
|
29
|
-
],
|
|
30
|
-
className:
|
|
31
|
-
content:
|
|
32
|
-
children:
|
|
33
|
-
placement:
|
|
34
|
-
fallbackPlacements:
|
|
35
|
-
title:
|
|
36
|
-
arrowOffset:
|
|
37
|
-
safeZone:
|
|
38
|
-
arrowColor:
|
|
39
|
-
dataAutomationId:
|
|
40
|
-
isOpened:
|
|
41
|
-
setIsOpened:
|
|
29
|
+
], it = ({
|
|
30
|
+
className: h,
|
|
31
|
+
content: u,
|
|
32
|
+
children: v,
|
|
33
|
+
placement: _ = "bottom",
|
|
34
|
+
fallbackPlacements: b = ot,
|
|
35
|
+
title: i,
|
|
36
|
+
arrowOffset: o = 16,
|
|
37
|
+
safeZone: w = 4,
|
|
38
|
+
arrowColor: x = "white",
|
|
39
|
+
dataAutomationId: A,
|
|
40
|
+
isOpened: F,
|
|
41
|
+
setIsOpened: n,
|
|
42
|
+
isCentered: a = !0
|
|
42
43
|
}) => {
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
const c = j(null), [R, N] = C(!1), p = n ? F : R, P = (t) => {
|
|
45
|
+
n ? n(t) : N(t);
|
|
46
|
+
}, k = L(
|
|
47
|
+
(t, l) => a ? ((et.includes(l) ? t.reference.height : t.reference.width) - g) / 2 - o : -o,
|
|
48
|
+
[o, a]
|
|
49
|
+
), { placement: E, refs: m, floatingStyles: I, context: e } = M({
|
|
50
|
+
open: p,
|
|
51
|
+
onOpenChange: P,
|
|
52
|
+
placement: _,
|
|
49
53
|
middleware: [
|
|
50
|
-
|
|
51
|
-
mainAxis:
|
|
52
|
-
alignmentAxis: (
|
|
54
|
+
U(({ rects: t, placement: l }) => ({
|
|
55
|
+
mainAxis: w + d,
|
|
56
|
+
alignmentAxis: k(t, l)
|
|
53
57
|
})),
|
|
54
|
-
|
|
58
|
+
W({
|
|
55
59
|
fallbackAxisSideDirection: "start",
|
|
56
|
-
fallbackPlacements:
|
|
60
|
+
fallbackPlacements: b
|
|
57
61
|
}),
|
|
58
|
-
|
|
59
|
-
element:
|
|
62
|
+
q({
|
|
63
|
+
element: c
|
|
60
64
|
})
|
|
61
65
|
],
|
|
62
|
-
whileElementsMounted:
|
|
63
|
-
}),
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
|
|
66
|
+
whileElementsMounted: z
|
|
67
|
+
}), T = B(e), y = J(e), D = K(e), { getReferenceProps: G, getFloatingProps: H } = Q([T, y, D]);
|
|
68
|
+
return /* @__PURE__ */ f(S, { children: [
|
|
69
|
+
/* @__PURE__ */ s("div", { ref: m.setReference, ...G(), className: r("popover-wrapper"), children: v }),
|
|
70
|
+
p && /* @__PURE__ */ s(V, { context: e, modal: !1, children: /* @__PURE__ */ f(
|
|
67
71
|
"div",
|
|
68
72
|
{
|
|
69
|
-
className:
|
|
70
|
-
"data-automation-id":
|
|
71
|
-
ref:
|
|
72
|
-
style:
|
|
73
|
-
...
|
|
73
|
+
className: r("popover", h),
|
|
74
|
+
"data-automation-id": A,
|
|
75
|
+
ref: m.setFloating,
|
|
76
|
+
style: I,
|
|
77
|
+
...H,
|
|
74
78
|
children: [
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
79
|
+
/* @__PURE__ */ s(
|
|
80
|
+
X,
|
|
77
81
|
{
|
|
78
|
-
ref:
|
|
79
|
-
context:
|
|
80
|
-
width:
|
|
81
|
-
height:
|
|
82
|
-
fill:
|
|
83
|
-
staticOffset:
|
|
82
|
+
ref: c,
|
|
83
|
+
context: e,
|
|
84
|
+
width: g,
|
|
85
|
+
height: d,
|
|
86
|
+
fill: x,
|
|
87
|
+
staticOffset: tt.includes(E) ? null : o
|
|
84
88
|
}
|
|
85
89
|
),
|
|
86
|
-
|
|
87
|
-
|
|
90
|
+
i && /* @__PURE__ */ s("div", { className: r("title"), children: i }),
|
|
91
|
+
u
|
|
88
92
|
]
|
|
89
93
|
}
|
|
90
94
|
) })
|
|
91
95
|
] });
|
|
92
96
|
};
|
|
93
97
|
export {
|
|
94
|
-
|
|
98
|
+
it as Popover
|
|
95
99
|
};
|