@reportportal/ui-kit 0.0.1-alpha.215 → 0.0.1-alpha.216
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.
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { S as
|
|
4
|
-
import { B as
|
|
5
|
-
import { Popover as
|
|
6
|
-
import { c as
|
|
7
|
-
const
|
|
2
|
+
import { useState as V, useRef as w, useCallback as C, useEffect as F, isValidElement as K, Fragment as R } from "react";
|
|
3
|
+
import { S as U } from "./details-dbb1530b.js";
|
|
4
|
+
import { B as z } from "./baseIconButton-251479f7.js";
|
|
5
|
+
import { Popover as G } from "./popover.js";
|
|
6
|
+
import { c as H } from "./bind-06a7ff84.js";
|
|
7
|
+
const J = "_disabled_gfti4_69", L = "_divider_gfti4_76", m = {
|
|
8
8
|
"action-menu": "_action-menu_gfti4_16",
|
|
9
9
|
"actions-popover": "_actions-popover_gfti4_20",
|
|
10
10
|
"action-dropdown": "_action-dropdown_gfti4_24",
|
|
11
11
|
"action-menu-button": "_action-menu-button_gfti4_29",
|
|
12
12
|
"action-item": "_action-item_gfti4_42",
|
|
13
|
-
disabled:
|
|
14
|
-
divider:
|
|
15
|
-
}, l =
|
|
13
|
+
disabled: J,
|
|
14
|
+
divider: L
|
|
15
|
+
}, l = H.bind(m), ne = ({
|
|
16
16
|
className: p,
|
|
17
17
|
children: b,
|
|
18
18
|
...h
|
|
19
|
-
}) => /* @__PURE__ */ i("div", { className: l("action-item", p), tabIndex: -1, ...h, children: b }),
|
|
19
|
+
}) => /* @__PURE__ */ i("div", { className: l("action-item", p), tabIndex: -1, ...h, children: b }), te = ({
|
|
20
20
|
placement: p = "bottom-end",
|
|
21
21
|
items: b = [],
|
|
22
22
|
cleanupDividers: h = !0,
|
|
@@ -27,15 +27,16 @@ const H = "_disabled_gfti4_69", J = "_divider_gfti4_76", m = {
|
|
|
27
27
|
menuClassName: M,
|
|
28
28
|
ariaLabel: S,
|
|
29
29
|
trigger: v,
|
|
30
|
-
disabled: a = !1
|
|
30
|
+
disabled: a = !1,
|
|
31
|
+
shouldUsePortal: O
|
|
31
32
|
}) => {
|
|
32
|
-
const [u, f] =
|
|
33
|
+
const [u, f] = V(!1), c = w(null), _ = w(/* @__PURE__ */ new Map()), q = C(
|
|
33
34
|
(e) => {
|
|
34
35
|
a || f(e);
|
|
35
36
|
},
|
|
36
37
|
[a]
|
|
37
38
|
);
|
|
38
|
-
|
|
39
|
+
F(() => {
|
|
39
40
|
u && c.current && requestAnimationFrame(() => {
|
|
40
41
|
requestAnimationFrame(() => {
|
|
41
42
|
var n;
|
|
@@ -46,7 +47,7 @@ const H = "_disabled_gfti4_69", J = "_divider_gfti4_76", m = {
|
|
|
46
47
|
});
|
|
47
48
|
});
|
|
48
49
|
}, [u]);
|
|
49
|
-
const s = (e) => !!(e && typeof e == "object" && "type" in e && e.type === "divider"),
|
|
50
|
+
const s = (e) => !!(e && typeof e == "object" && "type" in e && e.type === "divider"), $ = (e) => s(e) ? !0 : typeof e == "object" && e !== null && "hasPermission" in e ? e.hasPermission !== !1 : !0, j = (e) => {
|
|
50
51
|
var r, I, d, k, x, D;
|
|
51
52
|
const n = Array.from(
|
|
52
53
|
((r = c.current) == null ? void 0 : r.querySelectorAll(
|
|
@@ -75,7 +76,7 @@ const H = "_disabled_gfti4_69", J = "_divider_gfti4_76", m = {
|
|
|
75
76
|
o && ((D = c.current) != null && D.contains(o)) && (o.click(), f(!1));
|
|
76
77
|
} else
|
|
77
78
|
e.key === "Escape" && (e.preventDefault(), f(!1));
|
|
78
|
-
},
|
|
79
|
+
}, B = (e) => {
|
|
79
80
|
const n = e.target, t = n.closest(`[role="menuitem"], .${m["action-item"]}`);
|
|
80
81
|
if (t && !t.hasAttribute("disabled")) {
|
|
81
82
|
if (n === t) {
|
|
@@ -86,7 +87,7 @@ const H = "_disabled_gfti4_69", J = "_divider_gfti4_76", m = {
|
|
|
86
87
|
}
|
|
87
88
|
f(!1);
|
|
88
89
|
}
|
|
89
|
-
},
|
|
90
|
+
}, P = (e, n) => s(e) ? /* @__PURE__ */ i("div", { className: l("divider") }, `divider-${n}`) : K(e) ? /* @__PURE__ */ i(R, { children: e }, n) : typeof e == "object" && e !== null && "label" in e ? e.hasPermission === !1 ? null : /* @__PURE__ */ i(
|
|
90
91
|
"button",
|
|
91
92
|
{
|
|
92
93
|
ref: (t) => {
|
|
@@ -114,42 +115,43 @@ const H = "_disabled_gfti4_69", J = "_divider_gfti4_76", m = {
|
|
|
114
115
|
n.shift();
|
|
115
116
|
for (; n.length > 0 && s(n[n.length - 1]); )
|
|
116
117
|
n.pop();
|
|
117
|
-
return n = n.filter((t, r) => !s(t) || r === 0 ? !0 : !s(n[r - 1])), n = n.filter((t, r) => s(t) ? n.slice(r + 1).some((d) =>
|
|
118
|
-
})(b).map(
|
|
118
|
+
return n = n.filter((t, r) => !s(t) || r === 0 ? !0 : !s(n[r - 1])), n = n.filter((t, r) => s(t) ? n.slice(r + 1).some((d) => $(d)) : !0), n;
|
|
119
|
+
})(b).map(P).filter(Boolean);
|
|
119
120
|
return y.length === 0 ? null : /* @__PURE__ */ i("div", { className: l("action-menu", A), children: /* @__PURE__ */ i(
|
|
120
|
-
|
|
121
|
+
G,
|
|
121
122
|
{
|
|
122
123
|
placement: p,
|
|
123
124
|
isOpened: a ? !1 : u,
|
|
124
|
-
setIsOpened:
|
|
125
|
+
setIsOpened: q,
|
|
126
|
+
shouldUsePortal: O,
|
|
125
127
|
content: /* @__PURE__ */ i(
|
|
126
128
|
"div",
|
|
127
129
|
{
|
|
128
130
|
ref: c,
|
|
129
131
|
role: "menu",
|
|
130
132
|
tabIndex: -1,
|
|
131
|
-
onKeyDown:
|
|
132
|
-
onClick:
|
|
133
|
+
onKeyDown: j,
|
|
134
|
+
onClick: B,
|
|
133
135
|
className: l("action-dropdown", M, N),
|
|
134
136
|
children: y
|
|
135
137
|
}
|
|
136
138
|
),
|
|
137
139
|
className: l("actions-popover", E),
|
|
138
140
|
children: v ? /* @__PURE__ */ i("div", { className: g, children: v }) : /* @__PURE__ */ i(
|
|
139
|
-
|
|
141
|
+
z,
|
|
140
142
|
{
|
|
141
143
|
className: l("action-menu-button", g),
|
|
142
144
|
disabled: a,
|
|
143
145
|
"aria-label": S || "Actions menu",
|
|
144
146
|
"aria-expanded": u,
|
|
145
147
|
"aria-haspopup": "menu",
|
|
146
|
-
children: /* @__PURE__ */ i(
|
|
148
|
+
children: /* @__PURE__ */ i(U, {})
|
|
147
149
|
}
|
|
148
150
|
)
|
|
149
151
|
}
|
|
150
152
|
) });
|
|
151
153
|
};
|
|
152
154
|
export {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
+
te as A,
|
|
156
|
+
ne as a
|
|
155
157
|
};
|
package/dist/actionMenu.js
CHANGED
|
@@ -18,7 +18,7 @@ export declare const ActionMenuItem: ({ className, children, ...props }: {
|
|
|
18
18
|
className?: string | undefined;
|
|
19
19
|
children: ReactNode;
|
|
20
20
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
export interface ActionMenuProps extends Pick<PopoverProps, 'placement'> {
|
|
21
|
+
export interface ActionMenuProps extends Pick<PopoverProps, 'placement' | 'shouldUsePortal'> {
|
|
22
22
|
items?: MenuItem[];
|
|
23
23
|
cleanupDividers?: boolean;
|
|
24
24
|
className?: string;
|
|
@@ -30,4 +30,4 @@ export interface ActionMenuProps extends Pick<PopoverProps, 'placement'> {
|
|
|
30
30
|
trigger?: ReactNode;
|
|
31
31
|
disabled?: boolean;
|
|
32
32
|
}
|
|
33
|
-
export declare const ActionMenu: ({ placement, items, cleanupDividers, className, contentClassName, buttonClassName, popoverClassName, menuClassName, ariaLabel, trigger, disabled, }: ActionMenuProps) => ReactElement | null;
|
|
33
|
+
export declare const ActionMenu: ({ placement, items, cleanupDividers, className, contentClassName, buttonClassName, popoverClassName, menuClassName, ariaLabel, trigger, disabled, shouldUsePortal, }: ActionMenuProps) => ReactElement | null;
|
package/dist/filterItem.js
CHANGED
|
@@ -4,7 +4,7 @@ import { c as K } from "./bind-06a7ff84.js";
|
|
|
4
4
|
import "react-dnd";
|
|
5
5
|
import "react-dnd-html5-backend";
|
|
6
6
|
import { u as L } from "./useEllipsisTitle-462fa254.js";
|
|
7
|
-
import { A as M } from "./actionMenu-
|
|
7
|
+
import { A as M } from "./actionMenu-6a964512.js";
|
|
8
8
|
import "./details-dbb1530b.js";
|
|
9
9
|
import "./baseIconButton-251479f7.js";
|
|
10
10
|
import "./popover.js";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AdaptiveTagList as y } from "./adaptiveTagList.js";
|
|
2
|
-
import { A as h, a as M } from "./actionMenu-
|
|
2
|
+
import { A as h, a as M } from "./actionMenu-6a964512.js";
|
|
3
3
|
import { ACTION_MENU_DIVIDER as w } from "./actionMenu.js";
|
|
4
4
|
import { A as R } from "./index-d6e02727.js";
|
|
5
5
|
import { B as k } from "./baseIconButton-251479f7.js";
|