@hortiview/shared-components 0.0.5189 → 0.0.5201
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.
|
@@ -9,6 +9,11 @@ type ContextMenuProps = {
|
|
|
9
9
|
* @see ListItemProps
|
|
10
10
|
*/
|
|
11
11
|
actions: ListItemProps[];
|
|
12
|
+
/**
|
|
13
|
+
* Determines if menu icon should be vertical or horizontal three dots
|
|
14
|
+
* Default is 'vertical'
|
|
15
|
+
*/
|
|
16
|
+
iconOrientation?: 'vertical' | 'horizontal';
|
|
12
17
|
};
|
|
13
18
|
/**
|
|
14
19
|
*
|
|
@@ -23,5 +28,5 @@ type ContextMenuProps = {
|
|
|
23
28
|
* ];
|
|
24
29
|
* @returns a context menu with the given actions as ListItems
|
|
25
30
|
*/
|
|
26
|
-
export declare const ContextMenu: ({ triggerOpen, actions }: ContextMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare const ContextMenu: ({ triggerOpen, actions, iconOrientation, }: ContextMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
32
|
export {};
|
|
@@ -1,43 +1,47 @@
|
|
|
1
1
|
import "../../assets/ContextMenu.css";
|
|
2
2
|
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
-
import { Menu as a, IconButton as m, List as
|
|
4
|
-
import { useState as
|
|
5
|
-
const
|
|
6
|
-
menu:
|
|
7
|
-
},
|
|
8
|
-
|
|
3
|
+
import { Menu as a, IconButton as m, List as d, ListItem as f } from "@element/react-components";
|
|
4
|
+
import { useState as p, useCallback as i, useEffect as C } from "react";
|
|
5
|
+
const k = "_menu_1rfel_1", v = {
|
|
6
|
+
menu: k
|
|
7
|
+
}, M = ({
|
|
8
|
+
triggerOpen: o = null,
|
|
9
|
+
actions: c,
|
|
10
|
+
iconOrientation: r = "vertical"
|
|
11
|
+
}) => {
|
|
12
|
+
const [e, t] = p(!1), u = i(() => {
|
|
9
13
|
t(!e);
|
|
10
|
-
}, [e]),
|
|
14
|
+
}, [e]), l = i(() => {
|
|
11
15
|
t(!1);
|
|
12
16
|
}, []);
|
|
13
|
-
return
|
|
17
|
+
return C(() => {
|
|
14
18
|
t(o !== null ? o : !1);
|
|
15
19
|
}, [o]), /* @__PURE__ */ n(
|
|
16
20
|
a,
|
|
17
21
|
{
|
|
18
|
-
className:
|
|
22
|
+
className: v.menu,
|
|
19
23
|
"data-testid": "selectionmenu",
|
|
20
24
|
open: e,
|
|
21
25
|
surfaceOnly: !0,
|
|
22
26
|
hoistToBody: !0,
|
|
23
|
-
onClose:
|
|
27
|
+
onClose: l,
|
|
24
28
|
trigger: /* @__PURE__ */ n(
|
|
25
29
|
m,
|
|
26
30
|
{
|
|
27
31
|
variant: e ? "filled-primary" : void 0,
|
|
28
32
|
"data-testid": "openButton",
|
|
29
|
-
icon: "more_vert",
|
|
30
|
-
onClick:
|
|
33
|
+
icon: r === "vertical" ? "more_vert" : "more_horiz",
|
|
34
|
+
onClick: u
|
|
31
35
|
}
|
|
32
36
|
),
|
|
33
|
-
children: /* @__PURE__ */ n(
|
|
34
|
-
|
|
37
|
+
children: /* @__PURE__ */ n(d, { children: c.map((s) => /* @__PURE__ */ n(
|
|
38
|
+
f,
|
|
35
39
|
{
|
|
36
|
-
...
|
|
40
|
+
...s,
|
|
37
41
|
leadingBlockType: "icon",
|
|
38
42
|
"data-testid": "listItemButton",
|
|
39
43
|
onClick: () => {
|
|
40
|
-
|
|
44
|
+
s?.onClick?.(), l();
|
|
41
45
|
}
|
|
42
46
|
}
|
|
43
47
|
)) })
|
|
@@ -46,5 +50,5 @@ const C = "_menu_1rfel_1", k = {
|
|
|
46
50
|
);
|
|
47
51
|
};
|
|
48
52
|
export {
|
|
49
|
-
|
|
53
|
+
M as ContextMenu
|
|
50
54
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hortiview/shared-components",
|
|
3
3
|
"description": "This is a shared component library. It should used in the HortiView platform and its modules.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.5201",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": "https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared",
|
|
7
7
|
"author": "Falk Menge <falk.menge.ext@bayer.com>",
|