@digitaldefiance/express-suite-react-components 2.13.13 → 2.13.15
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 +1 -1
- package/src/components/TopMenu.d.ts +2 -0
- package/src/components/TopMenu.d.ts.map +1 -1
- package/src/components/TopMenu.js +2 -2
- package/src/components/TranslatedTitle.d.ts +2 -1
- package/src/components/TranslatedTitle.d.ts.map +1 -1
- package/src/components/TranslatedTitle.js +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digitaldefiance/express-suite-react-components",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.15",
|
|
4
4
|
"homepage": "https://github.com/Digital-Defiance/react-components",
|
|
5
5
|
"description": "React MUI components for Digital Defiance Express Suite",
|
|
6
6
|
"repository": {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IConstants } from '@digitaldefiance/suite-core-lib';
|
|
1
2
|
import React, { FC, ReactElement } from 'react';
|
|
2
3
|
import { MenuType } from '../types/MenuType';
|
|
3
4
|
declare global {
|
|
@@ -18,6 +19,7 @@ export interface AdditionalDropdownMenu {
|
|
|
18
19
|
export interface TopMenuProps {
|
|
19
20
|
Logo: React.ReactNode;
|
|
20
21
|
additionalMenus?: Array<AdditionalDropdownMenu>;
|
|
22
|
+
constants?: IConstants;
|
|
21
23
|
}
|
|
22
24
|
export declare const TopMenu: FC<TopMenuProps>;
|
|
23
25
|
export default TopMenu;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopMenu.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/TopMenu.tsx"],"names":[],"mappings":"
|
|
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,EAAwB,MAAM,OAAO,CAAC;AAKnF,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,CAgGpC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -15,14 +15,14 @@ const DropdownMenu_1 = require("./DropdownMenu");
|
|
|
15
15
|
const SideMenu_1 = require("./SideMenu");
|
|
16
16
|
const UserLanguageSelector_1 = require("./UserLanguageSelector");
|
|
17
17
|
const UserMenu_1 = require("./UserMenu");
|
|
18
|
-
const TopMenu = ({ Logo }) => {
|
|
18
|
+
const TopMenu = ({ Logo, additionalMenus, constants }) => {
|
|
19
19
|
const { isAuthenticated } = (0, react_1.useContext)(AuthProvider_1.AuthContext);
|
|
20
20
|
const { getTopMenus } = (0, MenuContext_1.useMenu)();
|
|
21
21
|
const [isSideMenuOpen, setIsSideMenuOpen] = (0, react_1.useState)(false);
|
|
22
22
|
const handleOpenSideMenu = () => setIsSideMenuOpen(true);
|
|
23
23
|
const handleCloseSideMenu = () => setIsSideMenuOpen(false);
|
|
24
24
|
const { tComponent } = (0, I18nProvider_1.useI18n)();
|
|
25
|
-
const siteTitle = tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_SiteTemplate);
|
|
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
26
|
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
27
|
height: 40,
|
|
28
28
|
width: 40,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
interface FCParams<TEnum extends string> {
|
|
2
2
|
componentId: string;
|
|
3
3
|
stringKey: TEnum;
|
|
4
|
+
vars?: Record<string, string | number>;
|
|
4
5
|
}
|
|
5
|
-
export declare const TranslatedTitle: <TEnum extends string>({ componentId, stringKey, }: FCParams<TEnum>) => null;
|
|
6
|
+
export declare const TranslatedTitle: <TEnum extends string>({ componentId, stringKey, vars, }: FCParams<TEnum>) => null;
|
|
6
7
|
export default TranslatedTitle;
|
|
7
8
|
//# sourceMappingURL=TranslatedTitle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TranslatedTitle.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/TranslatedTitle.tsx"],"names":[],"mappings":"AAKA,UAAU,QAAQ,CAAC,KAAK,SAAS,MAAM;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"TranslatedTitle.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/TranslatedTitle.tsx"],"names":[],"mappings":"AAKA,UAAU,QAAQ,CAAC,KAAK,SAAS,MAAM;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,KAAK,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;CACxC;AAED,eAAO,MAAM,eAAe,GAAI,KAAK,SAAS,MAAM,EAAE,mCAInD,QAAQ,CAAC,KAAK,CAAC,KAAG,IAapB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.TranslatedTitle = void 0;
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const contexts_1 = require("../contexts");
|
|
7
|
-
const TranslatedTitle = ({ componentId, stringKey, }) => {
|
|
7
|
+
const TranslatedTitle = ({ componentId, stringKey, vars, }) => {
|
|
8
8
|
const { tComponent, currentLanguage } = (0, contexts_1.useI18n)();
|
|
9
9
|
(0, react_1.useEffect)(() => {
|
|
10
|
-
document.title = tComponent(componentId, stringKey,
|
|
11
|
-
}, [tComponent, componentId, stringKey, currentLanguage]);
|
|
10
|
+
document.title = tComponent(componentId, stringKey, vars, currentLanguage);
|
|
11
|
+
}, [tComponent, componentId, stringKey, vars, currentLanguage]);
|
|
12
12
|
return null;
|
|
13
13
|
};
|
|
14
14
|
exports.TranslatedTitle = TranslatedTitle;
|