@digitaldefiance/express-suite-react-components 2.13.15 → 2.14.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digitaldefiance/express-suite-react-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.14.1",
|
|
4
4
|
"homepage": "https://github.com/Digital-Defiance/react-components",
|
|
5
5
|
"description": "React MUI components for Digital Defiance Express Suite",
|
|
6
6
|
"repository": {
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"react-router-dom": "6.29.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@digitaldefiance/i18n-lib": "4.
|
|
35
|
-
"@digitaldefiance/suite-core-lib": "3.
|
|
34
|
+
"@digitaldefiance/i18n-lib": "4.6.1",
|
|
35
|
+
"@digitaldefiance/suite-core-lib": "3.13.1",
|
|
36
36
|
"@emotion/react": "^11.14.0",
|
|
37
37
|
"@emotion/styled": "^11.14.0",
|
|
38
38
|
"@mui/icons-material": "^7.0.2",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopMenu.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/TopMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAIX,MAAM,iCAAiC,CAAC;AAUzC,OAAO,KAAK,EAAE,EAAe,EAAE,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"TopMenu.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/TopMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAIX,MAAM,iCAAiC,CAAC;AAUzC,OAAO,KAAK,EAAE,EAAe,EAAE,EAAE,YAAY,EAAiC,MAAM,OAAO,CAAC;AAK5F,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAO7C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,UAAU,CAAC,EAAE;YACX,QAAQ,EAAE,MAAM,CAAC;YACjB,SAAS,EAAE,MAAM,CAAC;YAClB,MAAM,EAAE,MAAM,CAAC;YACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;SACxB,CAAC;KACH;CACF;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,YAAY,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,eAAe,CAAC,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAChD,SAAS,CAAC,EAAE,UAAU,CAAC;CACxB;AAED,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CA+GpC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -23,13 +23,25 @@ const TopMenu = ({ Logo, additionalMenus, constants }) => {
|
|
|
23
23
|
const handleCloseSideMenu = () => setIsSideMenuOpen(false);
|
|
24
24
|
const { tComponent } = (0, I18nProvider_1.useI18n)();
|
|
25
25
|
const siteTitle = tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_SiteTemplate, { Site: (constants ?? suite_core_lib_1.Constants).Site });
|
|
26
|
+
const allMenus = (0, react_1.useMemo)(() => {
|
|
27
|
+
const contextMenus = getTopMenus();
|
|
28
|
+
if (!additionalMenus || additionalMenus.length === 0) {
|
|
29
|
+
return contextMenus;
|
|
30
|
+
}
|
|
31
|
+
const additional = additionalMenus.map((m) => ({
|
|
32
|
+
...m,
|
|
33
|
+
options: [],
|
|
34
|
+
isUserMenu: false,
|
|
35
|
+
}));
|
|
36
|
+
return [...contextMenus, ...additional].sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
|
|
37
|
+
}, [getTopMenus, additionalMenus]);
|
|
26
38
|
return ((0, jsx_runtime_1.jsxs)(material_1.AppBar, { position: "fixed", sx: { top: 10 }, children: [(0, jsx_runtime_1.jsxs)(material_1.Toolbar, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "large", edge: "start", color: "inherit", "aria-label": "menu", sx: { mr: 2 }, onClick: handleOpenSideMenu, children: (0, jsx_runtime_1.jsx)(Menu_1.default, {}) }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
27
39
|
height: 40,
|
|
28
40
|
width: 40,
|
|
29
41
|
marginRight: 2,
|
|
30
42
|
display: 'flex',
|
|
31
43
|
alignItems: 'center',
|
|
32
|
-
}, children: Logo }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h6", component: "div", sx: { flexGrow: 1 }, children: siteTitle }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: 'flex', alignItems: 'center' }, children: [isAuthenticated ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { color: "inherit", component: react_router_dom_1.Link, to: "/dashboard", children: tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_Dashboard) }),
|
|
44
|
+
}, children: Logo }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h6", component: "div", sx: { flexGrow: 1 }, children: siteTitle }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: 'flex', alignItems: 'center' }, children: [isAuthenticated ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { color: "inherit", component: react_router_dom_1.Link, to: "/dashboard", children: tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_Dashboard) }), allMenus.map((menu, index) => menu.isUserMenu ? ((0, jsx_runtime_1.jsx)(UserMenu_1.UserMenu, {}, `user-menu`)) : ((0, jsx_runtime_1.jsx)(DropdownMenu_1.DropdownMenu, { menuType: menu.menuType, menuIcon: menu.menuIcon }, `menu-${index}`)))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { color: "inherit", component: react_router_dom_1.Link, to: "/login", children: tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Login_LoginButton) }), (0, jsx_runtime_1.jsx)(material_1.Button, { color: "inherit", component: react_router_dom_1.Link, to: "/register", children: tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.RegisterButton) })] })), (0, jsx_runtime_1.jsx)(UserLanguageSelector_1.UserLanguageSelector, {})] })] }), (0, jsx_runtime_1.jsx)(SideMenu_1.SideMenu, { isOpen: isSideMenuOpen, onClose: handleCloseSideMenu })] }));
|
|
33
45
|
};
|
|
34
46
|
exports.TopMenu = TopMenu;
|
|
35
47
|
exports.default = exports.TopMenu;
|