pcm-shared-components 0.0.148 → 0.0.149
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,10 +1,11 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import { Tooltip, IconButton
|
|
2
|
+
import { Tooltip, IconButton } from "@mui/material";
|
|
3
3
|
import ChevronRightIcon from '@mui/icons-material/ChevronRight';
|
|
4
4
|
import { makeStyles } from '@mui/styles';
|
|
5
5
|
import ListItemIcon from "@mui/material/ListItemIcon";
|
|
6
6
|
import ListItemText from "@mui/material/ListItemText";
|
|
7
7
|
import Switch from "@mui/material/Switch";
|
|
8
|
+
import { StyledMenuItem, StyledMenu } from './StyledMenuParts';
|
|
8
9
|
|
|
9
10
|
const GenericSubMenu = ({
|
|
10
11
|
menu,
|
|
@@ -73,7 +74,7 @@ const GenericSubMenu = ({
|
|
|
73
74
|
return /*#__PURE__*/React.createElement("div", {
|
|
74
75
|
key: `main_sub_menu_items_${menu.icon}`,
|
|
75
76
|
className: !full_menu ? "flex flex-row" : 'flex flex-col w-full'
|
|
76
|
-
}, full_menu ? /*#__PURE__*/React.createElement(
|
|
77
|
+
}, full_menu ? /*#__PURE__*/React.createElement(StyledMenuItem, {
|
|
77
78
|
onClick: openSubMenu
|
|
78
79
|
}, menu.icon && /*#__PURE__*/React.createElement(ListItemIcon, null, menu.icon), /*#__PURE__*/React.createElement("div", {
|
|
79
80
|
className: "flex flex-row justify-between w-full"
|
|
@@ -90,8 +91,8 @@ const GenericSubMenu = ({
|
|
|
90
91
|
color: "inherit",
|
|
91
92
|
"aria-owns": "menu-appbar",
|
|
92
93
|
onClick: openSubMenu
|
|
93
|
-
}, menu.icon)), /*#__PURE__*/React.createElement(
|
|
94
|
-
className: "",
|
|
94
|
+
}, menu.icon)), /*#__PURE__*/React.createElement(StyledMenu, {
|
|
95
|
+
className: "flex flex-col",
|
|
95
96
|
style: {
|
|
96
97
|
display: anchorSubMenu ? 'block' : 'none'
|
|
97
98
|
} //Makes the disappearing menu smoother so I don't see it being jarred in a corner.
|
|
@@ -114,7 +115,7 @@ const GenericSubMenu = ({
|
|
|
114
115
|
classes: classes,
|
|
115
116
|
full_menu: true,
|
|
116
117
|
handleParentMenuClose: handleSubMenuClose
|
|
117
|
-
}) : /*#__PURE__*/React.createElement(
|
|
118
|
+
}) : /*#__PURE__*/React.createElement(StyledMenuItem, {
|
|
118
119
|
key: `sub_menu_items__${idx}}`,
|
|
119
120
|
onClick: () => {
|
|
120
121
|
handleSubMenuClose();
|
|
@@ -1,5 +1,3 @@
|
|
|
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
1
|
import React from 'react';
|
|
4
2
|
import withStyles from "@mui/styles/withStyles";
|
|
5
3
|
import Menu from "@mui/material/Menu";
|
|
@@ -9,37 +7,40 @@ import ListItemText from "@mui/material/ListItemText";
|
|
|
9
7
|
import Switch from "@mui/material/Switch";
|
|
10
8
|
import PropTypes from "prop-types";
|
|
11
9
|
import GenericSubMenu from './GenericSubMenu';
|
|
12
|
-
const StyledMenu = withStyles({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
})(props =>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
10
|
+
import { StyledMenuItem, StyledMenu } from './StyledMenuParts'; // const StyledMenu = withStyles({
|
|
11
|
+
// paper: {
|
|
12
|
+
// border: "1px solid #d3d4d5",
|
|
13
|
+
// paddingTop: 4,
|
|
14
|
+
// paddingBottom: 4,
|
|
15
|
+
// },
|
|
16
|
+
// })((props) => (
|
|
17
|
+
// <Menu
|
|
18
|
+
// elevation={0}
|
|
19
|
+
// anchorOrigin={{
|
|
20
|
+
// vertical: "bottom",
|
|
21
|
+
// horizontal: props.menuAnchorLocation,
|
|
22
|
+
// }}
|
|
23
|
+
// transformOrigin={{
|
|
24
|
+
// vertical: "top",
|
|
25
|
+
// horizontal: props.menuAnchorLocation,
|
|
26
|
+
// }}
|
|
27
|
+
// {...props}
|
|
28
|
+
// />
|
|
29
|
+
// ));
|
|
30
|
+
// const StyledMenuItem = withStyles(() => ({
|
|
31
|
+
// root: {
|
|
32
|
+
// minHeight: 32,
|
|
33
|
+
// paddingLeft: 12,
|
|
34
|
+
// paddingRight: 12,
|
|
35
|
+
// minWidth: '100% !important',
|
|
36
|
+
// "&:focus": {
|
|
37
|
+
// backgroundColor: "primary",
|
|
38
|
+
// "& .MuiListItemIcon-root, & .MuiListItemText-primary": {
|
|
39
|
+
// color: "primary",
|
|
40
|
+
// },
|
|
41
|
+
// },
|
|
42
|
+
// },
|
|
43
|
+
// }))(MenuItem);
|
|
43
44
|
|
|
44
45
|
const handleMenuOnClick = (menu, handleClose) => {
|
|
45
46
|
menu.onClick();
|
|
@@ -0,0 +1,36 @@
|
|
|
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);
|