@hortiview/shared-components 0.0.8519 → 0.0.8594
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/assets/contextMenu.css +1 -1
- package/dist/components/ContextMenu/ContextMenu.d.ts +5 -2
- package/dist/components/ContextMenu/ContextMenu.js +21 -20
- package/dist/components/Filter/Filter.js +1 -1
- package/dist/components/GenericTable/GenericTable.js +1 -1
- package/dist/contextMenu.module-vNQHb48g.js +9 -0
- package/dist/main.d.ts +1 -0
- package/package.json +1 -1
- package/dist/contextMenu.module-DNQ8d9Aj.js +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._menu_ol91v_1{width:15.875rem}._icon_ol91v_5{color:var(--lmnt-theme-on-secondary-inactive)}._listItem_ol91v_9 [class*=mdc-list-item__start]{color:var(--lmnt-theme-on-secondary-inactive);align-self:center!important;margin:0 1rem!important}._listItem_ol91v_9 [class*=mdc-list-item__end]{color:var(--lmnt-theme-on-secondary-inactive)}
|
|
@@ -6,15 +6,18 @@ type ContextMenuProps = {
|
|
|
6
6
|
triggerOpen?: boolean | null;
|
|
7
7
|
/**
|
|
8
8
|
* List of actions to display in the context menu as ListItems
|
|
9
|
-
* @see
|
|
9
|
+
* @see ActionProps
|
|
10
10
|
*/
|
|
11
|
-
actions:
|
|
11
|
+
actions: ActionProps[];
|
|
12
12
|
/**
|
|
13
13
|
* Determines if menu icon should be vertical or horizontal three dots
|
|
14
14
|
* Default is 'vertical'
|
|
15
15
|
*/
|
|
16
16
|
iconOrientation?: 'vertical' | 'horizontal';
|
|
17
17
|
};
|
|
18
|
+
export type ActionProps = ListItemProps & {
|
|
19
|
+
closeOnClick?: boolean;
|
|
20
|
+
};
|
|
18
21
|
/**
|
|
19
22
|
*
|
|
20
23
|
* @param {boolean} triggerOpen indicates if the menu should be open
|
|
@@ -1,50 +1,51 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Menu as u, IconButton as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { uniqueId as
|
|
5
|
-
import { s
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Menu as u, IconButton as f, List as d, ListItem as p } from "@element/react-components";
|
|
3
|
+
import { useState as C, useCallback as r, useEffect as k } from "react";
|
|
4
|
+
import { uniqueId as y } from "lodash";
|
|
5
|
+
import { s } from "../../contextMenu.module-vNQHb48g.js";
|
|
6
6
|
const M = ({
|
|
7
|
-
triggerOpen:
|
|
7
|
+
triggerOpen: l = null,
|
|
8
8
|
actions: a,
|
|
9
9
|
iconOrientation: c = "vertical"
|
|
10
10
|
}) => {
|
|
11
|
-
const [e, t] =
|
|
11
|
+
const [e, t] = C(!1), m = r(() => {
|
|
12
12
|
t(!e);
|
|
13
|
-
}, [e]),
|
|
13
|
+
}, [e]), i = r(() => {
|
|
14
14
|
t(!1);
|
|
15
15
|
}, []);
|
|
16
|
-
return
|
|
17
|
-
t(
|
|
18
|
-
}, [
|
|
16
|
+
return k(() => {
|
|
17
|
+
t(l !== null ? l : !1);
|
|
18
|
+
}, [l]), /* @__PURE__ */ n(
|
|
19
19
|
u,
|
|
20
20
|
{
|
|
21
|
-
className:
|
|
21
|
+
className: s.menu,
|
|
22
22
|
"data-testid": "selectionmenu",
|
|
23
23
|
open: e,
|
|
24
24
|
surfaceOnly: !0,
|
|
25
25
|
hoistToBody: !0,
|
|
26
|
-
onClose:
|
|
27
|
-
trigger: /* @__PURE__ */
|
|
28
|
-
|
|
26
|
+
onClose: i,
|
|
27
|
+
trigger: /* @__PURE__ */ n(
|
|
28
|
+
f,
|
|
29
29
|
{
|
|
30
|
-
className:
|
|
30
|
+
className: s.icon,
|
|
31
31
|
variant: e ? "filled-primary" : void 0,
|
|
32
32
|
"data-testid": "openButton",
|
|
33
33
|
icon: c === "vertical" ? "more_vert" : "more_horiz",
|
|
34
34
|
onClick: m
|
|
35
35
|
}
|
|
36
36
|
),
|
|
37
|
-
children: /* @__PURE__ */
|
|
37
|
+
children: /* @__PURE__ */ n(d, { children: a.map((o) => /* @__PURE__ */ n(
|
|
38
38
|
p,
|
|
39
39
|
{
|
|
40
|
-
|
|
40
|
+
className: s.listItem,
|
|
41
|
+
...o,
|
|
41
42
|
leadingBlockType: "icon",
|
|
42
43
|
"data-testid": "listItemButton",
|
|
43
44
|
onClick: () => {
|
|
44
|
-
|
|
45
|
+
o?.onClick?.(), o.closeOnClick !== !1 && i();
|
|
45
46
|
}
|
|
46
47
|
},
|
|
47
|
-
|
|
48
|
+
y(`LI_${o.primaryText?.toString()}_`)
|
|
48
49
|
)) })
|
|
49
50
|
},
|
|
50
51
|
"selectionmenu"
|
|
@@ -19,7 +19,7 @@ import "../../baseView.module-uWbm_a5f.js";
|
|
|
19
19
|
import "../../BlockView.module-BPlNT5uh.js";
|
|
20
20
|
import "../../chipCard.module-BjpKuf1b.js";
|
|
21
21
|
import "lodash";
|
|
22
|
-
import "../../contextMenu.module-
|
|
22
|
+
import "../../contextMenu.module-vNQHb48g.js";
|
|
23
23
|
import { Modal as K } from "../Modal/Modal.js";
|
|
24
24
|
import "../../deleteModal.module-Ds3MDzdl.js";
|
|
25
25
|
import "../../disclaimer.module-BZydt-Q_.js";
|
|
@@ -18,7 +18,7 @@ import "../../baseView.module-uWbm_a5f.js";
|
|
|
18
18
|
import "../../BlockView.module-BPlNT5uh.js";
|
|
19
19
|
import "../../chipCard.module-BjpKuf1b.js";
|
|
20
20
|
import "lodash";
|
|
21
|
-
import "../../contextMenu.module-
|
|
21
|
+
import "../../contextMenu.module-vNQHb48g.js";
|
|
22
22
|
import "../../modal.module-BlDp1Wiq.js";
|
|
23
23
|
import "../../deleteModal.module-Ds3MDzdl.js";
|
|
24
24
|
import "../../disclaimer.module-BZydt-Q_.js";
|
package/dist/main.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export { AvailableCustomIcons } from './enums/AvailableCustomIcons';
|
|
|
30
30
|
export { ThemeColor } from './enums/ThemeColor';
|
|
31
31
|
export { useBreakpoints } from './hooks/useBreakpoints';
|
|
32
32
|
export { capitalizeFirstLetters } from './services/UtilService';
|
|
33
|
+
export type { ActionProps } from './components/ContextMenu/ContextMenu';
|
|
33
34
|
export type { FormSelectOption } from './components/FormComponents/FormSelect/FormSelect';
|
|
34
35
|
export type { FormTextProps } from './components/FormComponents/FormText/FormText';
|
|
35
36
|
export type { FieldItem } from './components/InfoGroup/InfoGroup';
|
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.8594",
|
|
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>",
|