@cullsin/lnc-menu 3.0.90 → 3.0.91
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 +9 -21
- package/dist/src/src/sidemenu.scss +19 -14
- package/package.json +1 -1
package/dist/src/SideMenu.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import ArticleOutlinedIcon from "@mui/icons-material/ArticleOutlined";
|
|
3
|
-
import DashboardOutlinedIcon from "@mui/icons-material/DashboardOutlined";
|
|
4
2
|
import RecentActorsOutlinedIcon from "@mui/icons-material/RecentActorsOutlined";
|
|
5
3
|
import GroupAddOutlinedIcon from "@mui/icons-material/GroupAddOutlined";
|
|
6
4
|
import AppBar from "@mui/material/AppBar";
|
|
@@ -23,37 +21,27 @@ function SideMenu({ useDrawer, SampleMgmtIcon, location, language = 'en' }) {
|
|
|
23
21
|
const [anchorEl, setAnchorEl] = React.useState(null);
|
|
24
22
|
const t = React.useMemo(() => getTranslations(language), [language]);
|
|
25
23
|
const menuItems = React.useMemo(() => [
|
|
26
|
-
{
|
|
27
|
-
text: t.menu.home,
|
|
28
|
-
icon: _jsx(DashboardOutlinedIcon, {}),
|
|
29
|
-
subMenu: [{ text: t.menu.dashboard, path: "/super-site/dashboard" }],
|
|
30
|
-
},
|
|
31
24
|
{
|
|
32
25
|
text: t.menu.patientManagement,
|
|
33
26
|
icon: _jsx(RecentActorsOutlinedIcon, {}),
|
|
34
27
|
subMenu: [
|
|
35
|
-
{ text: t.menu.patient, path:
|
|
36
|
-
{ text: t.menu.family, path:
|
|
28
|
+
{ text: t.menu.patient, path: `/patient/${language}/patient-listing` },
|
|
29
|
+
{ text: t.menu.family, path: `/family/${language}/family-listing` },
|
|
37
30
|
],
|
|
38
31
|
},
|
|
39
32
|
{
|
|
40
33
|
text: t.menu.sampleManagement,
|
|
41
34
|
icon: _jsx(SampleMgmtIcon, {}),
|
|
42
35
|
subMenu: [
|
|
43
|
-
{ text: t.menu.sampleListing, path:
|
|
36
|
+
{ text: t.menu.sampleListing, path: `/sample/${language}/sample-listing` }
|
|
44
37
|
],
|
|
45
38
|
},
|
|
46
|
-
{
|
|
47
|
-
text: t.menu.reports,
|
|
48
|
-
icon: _jsx(ArticleOutlinedIcon, {}),
|
|
49
|
-
path: "/reports/",
|
|
50
|
-
},
|
|
51
39
|
{
|
|
52
40
|
text: t.menu.carrierDuoTrio,
|
|
53
41
|
icon: _jsx(GroupAddOutlinedIcon, {}),
|
|
54
|
-
path:
|
|
42
|
+
path: `/carrier-duo-trio/${language}/`,
|
|
55
43
|
},
|
|
56
|
-
], [SampleMgmtIcon, t]);
|
|
44
|
+
], [SampleMgmtIcon, t, language]);
|
|
57
45
|
// 🔁 Sync selection with current path
|
|
58
46
|
React.useEffect(() => {
|
|
59
47
|
const currentPath = location.pathname;
|
|
@@ -123,16 +111,16 @@ function SideMenu({ useDrawer, SampleMgmtIcon, location, language = 'en' }) {
|
|
|
123
111
|
item.onClick();
|
|
124
112
|
setSelectedMainMenu(item.text);
|
|
125
113
|
}
|
|
126
|
-
}, children: [_jsx(ListItemIcon, { children: item.icon }), isDrawerOpen && _jsx(ListItemText, { primary: item.text })] }) }), item.subMenu && anchorEl && openMenuIndex === index && (_jsxs(Menu, { className:
|
|
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: {
|
|
127
115
|
vertical: "top",
|
|
128
|
-
horizontal: "
|
|
116
|
+
horizontal: "right",
|
|
129
117
|
}, transformOrigin: {
|
|
130
118
|
vertical: "top",
|
|
131
119
|
horizontal: "left",
|
|
132
120
|
}, PaperProps: {
|
|
133
121
|
style: {
|
|
134
|
-
marginLeft:
|
|
122
|
+
marginLeft: 8,
|
|
135
123
|
},
|
|
136
|
-
}, children: [_jsx("span", { className: "submenu-title", children:
|
|
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))) }) })] }));
|
|
137
125
|
}
|
|
138
126
|
export default SideMenu;
|
|
@@ -104,6 +104,8 @@
|
|
|
104
104
|
color: #efffff;
|
|
105
105
|
padding: 0 0 5px 10px;
|
|
106
106
|
display: block;
|
|
107
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
|
|
108
|
+
margin-bottom: 5px;
|
|
107
109
|
}
|
|
108
110
|
.MuiMenuItem-root {
|
|
109
111
|
&.Mui-focusVisible {
|
|
@@ -118,25 +120,28 @@
|
|
|
118
120
|
}
|
|
119
121
|
}
|
|
120
122
|
}
|
|
121
|
-
}
|
|
122
123
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
124
|
+
&.collapsed-menu {
|
|
125
|
+
.MuiList-root {
|
|
126
|
+
&.MuiMenu-list {
|
|
127
|
+
&::before {
|
|
128
|
+
content: "";
|
|
129
|
+
position: absolute;
|
|
130
|
+
top: 15px;
|
|
131
|
+
left: -8px;
|
|
132
|
+
width: 0;
|
|
133
|
+
height: 0;
|
|
134
|
+
border-top: 8px solid transparent;
|
|
135
|
+
border-bottom: 8px solid transparent;
|
|
136
|
+
border-right: 8px solid #516578;
|
|
137
|
+
z-index: 2;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
136
140
|
}
|
|
137
141
|
}
|
|
138
142
|
}
|
|
139
143
|
|
|
144
|
+
|
|
140
145
|
.MuiPopover-root {
|
|
141
146
|
.MuiPaper-root {
|
|
142
147
|
overflow: visible;
|