pcm-shared-components 0.0.151 → 0.0.154
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.
|
@@ -2,9 +2,24 @@ import React, { useState, useEffect } from 'react';
|
|
|
2
2
|
import { Tooltip, IconButton, MenuItem, Menu } from "@mui/material";
|
|
3
3
|
import ChevronRightIcon from '@mui/icons-material/ChevronRight';
|
|
4
4
|
import { makeStyles } from '@mui/styles';
|
|
5
|
+
import withStyles from "@mui/styles/withStyles";
|
|
5
6
|
import ListItemIcon from "@mui/material/ListItemIcon";
|
|
6
7
|
import ListItemText from "@mui/material/ListItemText";
|
|
7
8
|
import Switch from "@mui/material/Switch";
|
|
9
|
+
const StyledMenuItem = withStyles(() => ({
|
|
10
|
+
root: {
|
|
11
|
+
minHeight: 32,
|
|
12
|
+
paddingLeft: 12,
|
|
13
|
+
paddingRight: 12,
|
|
14
|
+
minWidth: '100% !important',
|
|
15
|
+
"&:focus": {
|
|
16
|
+
backgroundColor: "primary",
|
|
17
|
+
"& .MuiListItemIcon-root, & .MuiListItemText-primary": {
|
|
18
|
+
color: "primary"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}))(MenuItem);
|
|
8
23
|
|
|
9
24
|
const GenericSubMenu = ({
|
|
10
25
|
menu,
|
|
@@ -73,7 +88,7 @@ const GenericSubMenu = ({
|
|
|
73
88
|
return /*#__PURE__*/React.createElement("div", {
|
|
74
89
|
key: `main_sub_menu_items_${menu.icon}`,
|
|
75
90
|
className: !full_menu ? "flex flex-row" : 'flex flex-col w-full'
|
|
76
|
-
}, full_menu ? /*#__PURE__*/React.createElement(
|
|
91
|
+
}, full_menu ? /*#__PURE__*/React.createElement(StyledMenuItem, {
|
|
77
92
|
onClick: openSubMenu
|
|
78
93
|
}, menu.icon && /*#__PURE__*/React.createElement(ListItemIcon, null, menu.icon), /*#__PURE__*/React.createElement("div", {
|
|
79
94
|
className: "flex flex-row justify-between w-full"
|
|
@@ -114,7 +129,7 @@ const GenericSubMenu = ({
|
|
|
114
129
|
classes: classes,
|
|
115
130
|
full_menu: true,
|
|
116
131
|
handleParentMenuClose: handleSubMenuClose
|
|
117
|
-
}) : /*#__PURE__*/React.createElement(
|
|
132
|
+
}) : /*#__PURE__*/React.createElement(StyledMenuItem, {
|
|
118
133
|
key: `sub_menu_items__${idx}}`,
|
|
119
134
|
onClick: () => {
|
|
120
135
|
handleSubMenuClose();
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import withStyles from "@mui/styles/withStyles";
|
|
3
5
|
import Menu from "@mui/material/Menu";
|
|
@@ -7,40 +9,37 @@ import ListItemText from "@mui/material/ListItemText";
|
|
|
7
9
|
import Switch from "@mui/material/Switch";
|
|
8
10
|
import PropTypes from "prop-types";
|
|
9
11
|
import GenericSubMenu from './GenericSubMenu';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
// },
|
|
42
|
-
// },
|
|
43
|
-
// }))(MenuItem);
|
|
12
|
+
const StyledMenu = withStyles({
|
|
13
|
+
paper: {
|
|
14
|
+
border: "1px solid #d3d4d5",
|
|
15
|
+
paddingTop: 4,
|
|
16
|
+
paddingBottom: 4
|
|
17
|
+
}
|
|
18
|
+
})(props => /*#__PURE__*/React.createElement(Menu, _extends({
|
|
19
|
+
elevation: 0,
|
|
20
|
+
anchorOrigin: {
|
|
21
|
+
vertical: "bottom",
|
|
22
|
+
horizontal: props.menuAnchorLocation
|
|
23
|
+
},
|
|
24
|
+
transformOrigin: {
|
|
25
|
+
vertical: "top",
|
|
26
|
+
horizontal: props.menuAnchorLocation
|
|
27
|
+
}
|
|
28
|
+
}, props)));
|
|
29
|
+
const StyledMenuItem = withStyles(() => ({
|
|
30
|
+
root: {
|
|
31
|
+
minHeight: 32,
|
|
32
|
+
paddingLeft: 12,
|
|
33
|
+
paddingRight: 12,
|
|
34
|
+
minWidth: '100% !important',
|
|
35
|
+
"&:focus": {
|
|
36
|
+
backgroundColor: "primary",
|
|
37
|
+
"& .MuiListItemIcon-root, & .MuiListItemText-primary": {
|
|
38
|
+
color: "primary"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}))(MenuItem);
|
|
44
43
|
|
|
45
44
|
const handleMenuOnClick = (menu, handleClose) => {
|
|
46
45
|
menu.onClick();
|
package/package.json
CHANGED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
|
-
import MenuItem from "@mui/material/MenuItem";
|
|
4
|
-
import Menu from "@mui/material/Menu";
|
|
5
|
-
import withStyles from "@mui/styles/withStyles";
|
|
6
|
-
export const StyledMenu = withStyles({
|
|
7
|
-
paper: {
|
|
8
|
-
border: "1px solid #d3d4d5",
|
|
9
|
-
paddingTop: 4,
|
|
10
|
-
paddingBottom: 4
|
|
11
|
-
}
|
|
12
|
-
})(props => /*#__PURE__*/React.createElement(Menu, _extends({
|
|
13
|
-
elevation: 0,
|
|
14
|
-
anchorOrigin: {
|
|
15
|
-
vertical: "bottom",
|
|
16
|
-
horizontal: props.menuAnchorLocation
|
|
17
|
-
},
|
|
18
|
-
transformOrigin: {
|
|
19
|
-
vertical: "top",
|
|
20
|
-
horizontal: props.menuAnchorLocation
|
|
21
|
-
}
|
|
22
|
-
}, props)));
|
|
23
|
-
export const StyledMenuItem = withStyles(() => ({
|
|
24
|
-
root: {
|
|
25
|
-
minHeight: 32,
|
|
26
|
-
paddingLeft: 12,
|
|
27
|
-
paddingRight: 12,
|
|
28
|
-
minWidth: '100% !important',
|
|
29
|
-
"&:focus": {
|
|
30
|
-
backgroundColor: "primary",
|
|
31
|
-
"& .MuiListItemIcon-root, & .MuiListItemText-primary": {
|
|
32
|
-
color: "primary"
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}))(MenuItem);
|