@cullsin/lnc-menu 3.0.91 → 3.0.92
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/src/SideMenu.js +38 -39
- package/package.json +1 -1
package/dist/src/SideMenu.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import RecentActorsOutlinedIcon from "@mui/icons-material/RecentActorsOutlined";
|
|
3
3
|
import GroupAddOutlinedIcon from "@mui/icons-material/GroupAddOutlined";
|
|
4
|
-
import AppBar from "@mui/material/AppBar";
|
|
5
4
|
import Box from "@mui/material/Box";
|
|
6
5
|
import Drawer from "@mui/material/Drawer";
|
|
7
6
|
import List from "@mui/material/List";
|
|
@@ -81,46 +80,46 @@ function SideMenu({ useDrawer, SampleMgmtIcon, location, language = 'en' }) {
|
|
|
81
80
|
toggleDrawer();
|
|
82
81
|
window.location.href = path;
|
|
83
82
|
};
|
|
84
|
-
return (
|
|
83
|
+
return (_jsx(Box, { sx: { flexGrow: 1 }, children: _jsx(Drawer, { open: isDrawerOpen, variant: "permanent", className: "parent-container", sx: {
|
|
84
|
+
width: isDrawerOpen ? 230 : 64,
|
|
85
|
+
flexShrink: 0,
|
|
86
|
+
"& .MuiDrawer-paper": {
|
|
85
87
|
width: isDrawerOpen ? 230 : 64,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
if (item.subMenu) {
|
|
96
|
-
if (openMenuIndex === index) {
|
|
97
|
-
handleMenuClose();
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
handleMenuOpen(event, index);
|
|
101
|
-
}
|
|
88
|
+
transition: "width 0.3s ease",
|
|
89
|
+
height: "100vh",
|
|
90
|
+
borderRight: "1px solid #B1BECB",
|
|
91
|
+
overflowY: "auto",
|
|
92
|
+
},
|
|
93
|
+
}, children: _jsx(List, { children: menuItems.map((item, index) => (_jsxs(React.Fragment, { children: [_jsx(Tooltip, { title: item.text, placement: "right", disableHoverListener: isDrawerOpen, children: _jsxs(ListItem, { button: true, selected: selectedMainMenu === item.text, className: selectedMainMenu === item.text ? "selected" : "", onClick: (event) => {
|
|
94
|
+
if (item.subMenu) {
|
|
95
|
+
if (openMenuIndex === index) {
|
|
96
|
+
handleMenuClose();
|
|
102
97
|
}
|
|
103
|
-
else
|
|
104
|
-
|
|
105
|
-
setSelectedSubMenuPath(null);
|
|
106
|
-
if (isDrawerOpen)
|
|
107
|
-
toggleDrawer();
|
|
108
|
-
window.location.href = item.path;
|
|
98
|
+
else {
|
|
99
|
+
handleMenuOpen(event, index);
|
|
109
100
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
101
|
+
}
|
|
102
|
+
else if (item.path) {
|
|
103
|
+
setSelectedMainMenu(item.text);
|
|
104
|
+
setSelectedSubMenuPath(null);
|
|
105
|
+
if (isDrawerOpen)
|
|
106
|
+
toggleDrawer();
|
|
107
|
+
window.location.href = item.path;
|
|
108
|
+
}
|
|
109
|
+
else if (item.onClick) {
|
|
110
|
+
item.onClick();
|
|
111
|
+
setSelectedMainMenu(item.text);
|
|
112
|
+
}
|
|
113
|
+
}, children: [_jsx(ListItemIcon, { children: item.icon }), isDrawerOpen && _jsx(ListItemText, { primary: item.text })] }) }), item.subMenu && anchorEl && openMenuIndex === index && (_jsxs(Menu, { className: `app-menu-item ${!isDrawerOpen ? 'collapsed-menu' : ''}`, anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleMenuClose, anchorOrigin: {
|
|
114
|
+
vertical: "top",
|
|
115
|
+
horizontal: "right",
|
|
116
|
+
}, transformOrigin: {
|
|
117
|
+
vertical: "top",
|
|
118
|
+
horizontal: "left",
|
|
119
|
+
}, PaperProps: {
|
|
120
|
+
style: {
|
|
121
|
+
marginLeft: 8,
|
|
122
|
+
},
|
|
123
|
+
}, children: [!isDrawerOpen && (_jsx("span", { className: "submenu-title", children: item.text })), item.subMenu.map((subItem) => (_jsx(MenuItem, { selected: selectedSubMenuPath === subItem.path, onClick: () => handleSubMenuItemClick(subItem.path, item.text), children: subItem.text }, subItem.text)))] }))] }, index))) }) }) }));
|
|
125
124
|
}
|
|
126
125
|
export default SideMenu;
|