@cullsin/lnc-menu 3.0.91 → 3.0.93

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,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 (_jsxs(Box, { sx: { flexGrow: 1 }, children: [_jsx(AppBar, { sx: { position: "fixed", top: 0 } }), _jsx(Drawer, { open: isDrawerOpen, variant: "permanent", className: "parent-container", sx: {
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
- flexShrink: 0,
87
- "& .MuiDrawer-paper": {
88
- width: isDrawerOpen ? 230 : 64,
89
- transition: "width 0.3s ease",
90
- height: "100vh",
91
- borderRight: "1px solid #B1BECB",
92
- overflowY: "auto",
93
- },
94
- }, 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) => {
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 if (item.path) {
104
- setSelectedMainMenu(item.text);
105
- setSelectedSubMenuPath(null);
106
- if (isDrawerOpen)
107
- toggleDrawer();
108
- window.location.href = item.path;
98
+ else {
99
+ handleMenuOpen(event, index);
109
100
  }
110
- else if (item.onClick) {
111
- item.onClick();
112
- setSelectedMainMenu(item.text);
113
- }
114
- }, 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: {
115
- vertical: "top",
116
- horizontal: "right",
117
- }, transformOrigin: {
118
- vertical: "top",
119
- horizontal: "left",
120
- }, PaperProps: {
121
- style: {
122
- marginLeft: 8,
123
- },
124
- }, 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))) }) })] }));
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cullsin/lnc-menu",
3
- "version": "3.0.91",
3
+ "version": "3.0.93",
4
4
  "description": "Reusable SideMenu component for MedGenome LNC platform using MUI",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",