@reportportal/ui-kit 0.0.1-alpha.210 → 0.0.1-alpha.211
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 +7 -2
- package/dist/popover.js +61 -52
- package/package.json +1 -1
|
@@ -12,9 +12,14 @@ export interface PopoverProps {
|
|
|
12
12
|
safeZone?: number;
|
|
13
13
|
arrowColor?: string;
|
|
14
14
|
dataAutomationId?: string;
|
|
15
|
-
isOpened?: boolean;
|
|
16
|
-
isCentered?: boolean;
|
|
17
15
|
strategy?: Strategy;
|
|
16
|
+
transitionDuration?: number | Partial<{
|
|
17
|
+
open: number;
|
|
18
|
+
close: number;
|
|
19
|
+
}>;
|
|
20
|
+
isCentered?: boolean;
|
|
21
|
+
isFocusDisabled?: boolean;
|
|
22
|
+
isOpened?: boolean;
|
|
18
23
|
shouldUsePortal?: boolean;
|
|
19
24
|
setIsOpened?: (isOpened: boolean) => void;
|
|
20
25
|
}
|
package/dist/popover.js
CHANGED
|
@@ -1,86 +1,95 @@
|
|
|
1
|
-
import { jsxs as f, Fragment as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { useFloating as
|
|
4
|
-
import { c as
|
|
5
|
-
import { g as
|
|
6
|
-
const
|
|
1
|
+
import { jsxs as f, Fragment as W, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as U, useState as q, useCallback as z } from "react";
|
|
3
|
+
import { useFloating as B, offset as J, flip as K, arrow as Q, autoUpdate as V, useClick as X, useDismiss as Y, useRole as Z, useInteractions as $, useTransitionStyles as ee, FloatingFocusManager as te, FloatingArrow as se, FloatingPortal as ne } from "@floating-ui/react";
|
|
4
|
+
import { c as oe } from "./bind-06a7ff84.js";
|
|
5
|
+
import { g as ae, T as u, a as le, A as ie, b as re, m as ce } from "./floatingUi-46f5b896.js";
|
|
6
|
+
const pe = "_popover_n3nff_1", me = "_title_n3nff_28", fe = {
|
|
7
7
|
"popover-wrapper": "_popover-wrapper_n3nff_1",
|
|
8
|
-
popover:
|
|
9
|
-
title:
|
|
10
|
-
},
|
|
11
|
-
content:
|
|
12
|
-
children:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
title:
|
|
17
|
-
arrowOffset: n =
|
|
8
|
+
popover: pe,
|
|
9
|
+
title: me
|
|
10
|
+
}, l = oe.bind(fe), he = ({
|
|
11
|
+
content: d,
|
|
12
|
+
children: g,
|
|
13
|
+
placement: v = "bottom",
|
|
14
|
+
fallbackPlacements: _ = le,
|
|
15
|
+
className: h,
|
|
16
|
+
title: i,
|
|
17
|
+
arrowOffset: n = ie,
|
|
18
18
|
safeZone: A = 4,
|
|
19
19
|
arrowColor: F = "white",
|
|
20
20
|
dataAutomationId: x,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
strategy: y = "absolute",
|
|
22
|
+
transitionDuration: R = 0,
|
|
23
|
+
isCentered: r = !0,
|
|
24
|
+
isFocusDisabled: w = !1,
|
|
25
|
+
isOpened: E,
|
|
26
|
+
shouldUsePortal: b = !1,
|
|
25
27
|
setIsOpened: o
|
|
26
28
|
}) => {
|
|
27
|
-
const c =
|
|
29
|
+
const c = U(null), [T, N] = q(!1), p = o ? E : T, P = (e) => {
|
|
28
30
|
o ? o(e) : N(e);
|
|
29
|
-
},
|
|
30
|
-
(e,
|
|
31
|
-
[n,
|
|
32
|
-
), { placement:
|
|
33
|
-
open:
|
|
31
|
+
}, S = z(
|
|
32
|
+
(e, a) => ae(e, a, n, r),
|
|
33
|
+
[n, r]
|
|
34
|
+
), { placement: k, refs: m, floatingStyles: I, context: t } = B({
|
|
35
|
+
open: p,
|
|
34
36
|
onOpenChange: P,
|
|
35
|
-
placement:
|
|
36
|
-
strategy:
|
|
37
|
+
placement: v,
|
|
38
|
+
strategy: y,
|
|
37
39
|
middleware: [
|
|
38
|
-
|
|
39
|
-
mainAxis: A +
|
|
40
|
-
alignmentAxis:
|
|
40
|
+
J(({ rects: e, placement: a }) => ({
|
|
41
|
+
mainAxis: A + u,
|
|
42
|
+
alignmentAxis: S(e, a)
|
|
41
43
|
})),
|
|
42
|
-
|
|
44
|
+
K({
|
|
43
45
|
fallbackAxisSideDirection: "start",
|
|
44
|
-
fallbackPlacements:
|
|
46
|
+
fallbackPlacements: _
|
|
45
47
|
}),
|
|
46
|
-
|
|
48
|
+
Q({
|
|
47
49
|
element: c
|
|
48
50
|
})
|
|
49
51
|
],
|
|
50
|
-
whileElementsMounted:
|
|
51
|
-
}),
|
|
52
|
-
|
|
52
|
+
whileElementsMounted: V
|
|
53
|
+
}), D = X(t), G = Y(t), H = Z(t), { getReferenceProps: M, getFloatingProps: O } = $([D, G, H]), { isMounted: j, styles: C } = ee(t, {
|
|
54
|
+
duration: R,
|
|
55
|
+
initial: { opacity: 0 }
|
|
56
|
+
}), L = () => {
|
|
57
|
+
const e = /* @__PURE__ */ s(te, { context: t, modal: !1, disabled: w, children: /* @__PURE__ */ f(
|
|
53
58
|
"div",
|
|
54
59
|
{
|
|
55
|
-
className:
|
|
60
|
+
className: l("popover", h),
|
|
56
61
|
"data-automation-id": x,
|
|
57
|
-
ref:
|
|
58
|
-
style:
|
|
59
|
-
|
|
62
|
+
ref: m.setFloating,
|
|
63
|
+
style: {
|
|
64
|
+
...I,
|
|
65
|
+
...C,
|
|
66
|
+
pointerEvents: p ? "auto" : "none"
|
|
67
|
+
},
|
|
68
|
+
...O(),
|
|
60
69
|
children: [
|
|
61
70
|
/* @__PURE__ */ s(
|
|
62
|
-
|
|
71
|
+
se,
|
|
63
72
|
{
|
|
64
73
|
ref: c,
|
|
65
74
|
context: t,
|
|
66
|
-
width:
|
|
67
|
-
height:
|
|
75
|
+
width: re,
|
|
76
|
+
height: u,
|
|
68
77
|
fill: F,
|
|
69
|
-
staticOffset:
|
|
78
|
+
staticOffset: ce.includes(k) ? null : n
|
|
70
79
|
}
|
|
71
80
|
),
|
|
72
|
-
|
|
73
|
-
|
|
81
|
+
i && /* @__PURE__ */ s("div", { className: l("title"), children: i }),
|
|
82
|
+
d
|
|
74
83
|
]
|
|
75
84
|
}
|
|
76
85
|
) });
|
|
77
|
-
return
|
|
86
|
+
return b ? /* @__PURE__ */ s(ne, { children: e }) : e;
|
|
78
87
|
};
|
|
79
|
-
return /* @__PURE__ */ f(
|
|
80
|
-
/* @__PURE__ */ s("div", { ref:
|
|
81
|
-
|
|
88
|
+
return /* @__PURE__ */ f(W, { children: [
|
|
89
|
+
/* @__PURE__ */ s("div", { ref: m.setReference, ...M(), className: l("popover-wrapper"), children: g }),
|
|
90
|
+
j && L()
|
|
82
91
|
] });
|
|
83
92
|
};
|
|
84
93
|
export {
|
|
85
|
-
|
|
94
|
+
he as Popover
|
|
86
95
|
};
|