@gridsuite/commons-ui 0.282.0 → 0.283.0
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/features/side-bar/AppSideBar.js +2 -1
- package/dist/features/side-bar/AppSideBarHeader.js +3 -3
- package/dist/features/side-bar/footer/AppSideBarFooter.js +2 -0
- package/dist/features/side-bar/footer/common/SideBarMenuItem.d.ts +2 -1
- package/dist/features/side-bar/footer/common/SideBarMenuItem.js +5 -4
- package/dist/features/side-bar/footer/profile/ProfileMenu.js +1 -1
- package/dist/features/side-bar/footer/profile/UserIcon.d.ts +3 -7
- package/dist/features/side-bar/footer/profile/UserIcon.js +11 -7
- package/dist/features/side-bar/footer/settings/SettingsMenu.js +1 -1
- package/dist/translations/en/topBarEn.d.ts +1 -0
- package/dist/translations/en/topBarEn.js +2 -1
- package/dist/translations/fr/topBarFr.d.ts +1 -0
- package/dist/translations/fr/topBarFr.js +1 -0
- package/package.json +1 -1
|
@@ -35,8 +35,8 @@ function AppSideBarHeader({
|
|
|
35
35
|
isMinimized && /* @__PURE__ */ jsx(EnvironmentChip, { environment, variant: "minimized" })
|
|
36
36
|
] }),
|
|
37
37
|
!isMinimized && /* @__PURE__ */ jsxs(Box, { sx: { position: "relative", display: "inline-block" }, children: [
|
|
38
|
-
/* @__PURE__ */ jsxs(Typography, {
|
|
39
|
-
"Grid",
|
|
38
|
+
/* @__PURE__ */ jsxs(Typography, { fontSize: 18, children: [
|
|
39
|
+
/* @__PURE__ */ jsx(Box, { component: "span", style: { fontWeight: "bold" }, children: "Grid" }),
|
|
40
40
|
/* @__PURE__ */ jsx(Box, { component: "span", sx: { color: appNameColor }, children: appName })
|
|
41
41
|
] }),
|
|
42
42
|
/* @__PURE__ */ jsx(EnvironmentChip, { environment, variant: "expanded" })
|
|
@@ -55,7 +55,7 @@ function AppSideBarHeader({
|
|
|
55
55
|
"V",
|
|
56
56
|
appVersion
|
|
57
57
|
] }),
|
|
58
|
-
/* @__PURE__ */ jsx(Tooltip, { title: `V${appVersion}`, disableHoverListener: !isMinimized, children: /* @__PURE__ */ jsx(IconButton, { sx: { padding: 0 }, onClick: () => setOpenDialog(SideBarDialogType.ABOUT), children: /* @__PURE__ */ jsx(Info, { fontSize: "small", color: "
|
|
58
|
+
/* @__PURE__ */ jsx(Tooltip, { title: `V${appVersion}`, disableHoverListener: !isMinimized, children: /* @__PURE__ */ jsx(IconButton, { sx: { padding: 0 }, onClick: () => setOpenDialog(SideBarDialogType.ABOUT), children: /* @__PURE__ */ jsx(Info, { fontSize: "small", sx: { color: "text.secondary" } }) }) })
|
|
59
59
|
] })
|
|
60
60
|
}
|
|
61
61
|
),
|
|
@@ -35,6 +35,7 @@ function AppSideBarFooter({
|
|
|
35
35
|
/* @__PURE__ */ jsx(
|
|
36
36
|
SideBarMenuItem,
|
|
37
37
|
{
|
|
38
|
+
tooltip: isMinimized ? "top-bar/logout" : void 0,
|
|
38
39
|
label: "top-bar/logout",
|
|
39
40
|
icon: /* @__PURE__ */ jsx(Logout, {}),
|
|
40
41
|
onClick: onLogoutClick,
|
|
@@ -46,6 +47,7 @@ function AppSideBarFooter({
|
|
|
46
47
|
/* @__PURE__ */ jsx(
|
|
47
48
|
SideBarMenuItem,
|
|
48
49
|
{
|
|
50
|
+
tooltip: isMinimized ? "top-bar/expand" : void 0,
|
|
49
51
|
label: "top-bar/minimize",
|
|
50
52
|
icon: isMinimized ? /* @__PURE__ */ jsx(KeyboardDoubleArrowRight, {}) : /* @__PURE__ */ jsx(KeyboardDoubleArrowLeft, {}),
|
|
51
53
|
onClick: toggleSideBarMinimized,
|
|
@@ -5,6 +5,7 @@ interface SideBarMenuItemProps {
|
|
|
5
5
|
onClick?: () => void;
|
|
6
6
|
showLabel?: boolean;
|
|
7
7
|
disabled?: boolean;
|
|
8
|
+
tooltip?: string;
|
|
8
9
|
}
|
|
9
|
-
export declare function SideBarMenuItem({ label, icon, onClick, showLabel, disabled, }: Readonly<SideBarMenuItemProps>): import("react").JSX.Element;
|
|
10
|
+
export declare function SideBarMenuItem({ label, icon, onClick, tooltip, showLabel, disabled, }: Readonly<SideBarMenuItemProps>): import("react").JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Typography } from "@mui/material";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Tooltip, Typography } from "@mui/material";
|
|
3
3
|
import { useIntl } from "react-intl";
|
|
4
4
|
import { submenuFooterStyle } from "./submenu-footer.style.js";
|
|
5
5
|
import "@mui/icons-material";
|
|
@@ -61,15 +61,16 @@ function SideBarMenuItem({
|
|
|
61
61
|
label,
|
|
62
62
|
icon,
|
|
63
63
|
onClick,
|
|
64
|
+
tooltip = "",
|
|
64
65
|
showLabel = true,
|
|
65
66
|
disabled = false
|
|
66
67
|
}) {
|
|
67
68
|
const intl = useIntl();
|
|
68
|
-
return /* @__PURE__ */ jsxs(CustomMenuItem, { disabled, onClick, sx: submenuFooterStyle.subMenu, children: [
|
|
69
|
+
return /* @__PURE__ */ jsx(Tooltip, { placement: "right-start", title: tooltip && intl.formatMessage({ id: tooltip }), children: /* @__PURE__ */ jsxs(CustomMenuItem, { disabled, onClick, sx: submenuFooterStyle.subMenu, children: [
|
|
69
70
|
icon,
|
|
70
71
|
" ",
|
|
71
72
|
showLabel && /* @__PURE__ */ jsx(Typography, { px: 1, children: intl.formatMessage({ id: label }) })
|
|
72
|
-
] });
|
|
73
|
+
] }) });
|
|
73
74
|
}
|
|
74
75
|
export {
|
|
75
76
|
SideBarMenuItem
|
|
@@ -72,7 +72,7 @@ function ProfileMenu({ isMinimized, userProfile }) {
|
|
|
72
72
|
CustomNestedMenuItem,
|
|
73
73
|
{
|
|
74
74
|
label: !isMinimized ? profileLabel : "",
|
|
75
|
-
leftIcon: /* @__PURE__ */ jsx(UserAvatarIcon, { label: userProfile?.name ?? "" }),
|
|
75
|
+
leftIcon: /* @__PURE__ */ jsx(UserAvatarIcon, { sx: { backgroundColor: "text.secondary" }, label: userProfile?.name ?? "" }),
|
|
76
76
|
sx: submenuFooterStyle.subMenu,
|
|
77
77
|
children: [
|
|
78
78
|
isMinimized && /* @__PURE__ */ jsx(MinimizedSubMenuHeader, { label: profileLabel }),
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
-
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
-
*/
|
|
7
|
-
export declare function UserAvatarIcon({ label }: Readonly<{
|
|
1
|
+
import { SxProps, Theme } from '@mui/material';
|
|
2
|
+
export declare function UserAvatarIcon({ label, sx }: Readonly<{
|
|
8
3
|
label: string;
|
|
4
|
+
sx?: SxProps<Theme>;
|
|
9
5
|
}>): import("react").JSX.Element;
|
|
@@ -4,6 +4,7 @@ import "../../../../utils/conversionUtils.js";
|
|
|
4
4
|
import "../../../../utils/types/equipmentType.js";
|
|
5
5
|
import { isEmpty } from "../../../../utils/functions.js";
|
|
6
6
|
import "@mui/icons-material";
|
|
7
|
+
import { mergeSx } from "../../../../utils/styles.js";
|
|
7
8
|
function getAbbreviationFromUserName(name) {
|
|
8
9
|
if (isEmpty(name)) {
|
|
9
10
|
return "";
|
|
@@ -14,16 +15,19 @@ function getAbbreviationFromUserName(name) {
|
|
|
14
15
|
}
|
|
15
16
|
return firstName[0];
|
|
16
17
|
}
|
|
17
|
-
function UserAvatarIcon({ label }) {
|
|
18
|
+
function UserAvatarIcon({ label, sx }) {
|
|
18
19
|
return /* @__PURE__ */ jsx(
|
|
19
20
|
Avatar,
|
|
20
21
|
{
|
|
21
|
-
sx: (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
sx: mergeSx(
|
|
23
|
+
(theme) => ({
|
|
24
|
+
height: "24px",
|
|
25
|
+
width: "24px",
|
|
26
|
+
fontSize: theme.typography.pxToRem(11),
|
|
27
|
+
textTransform: "uppercase"
|
|
28
|
+
}),
|
|
29
|
+
{ ...sx }
|
|
30
|
+
),
|
|
27
31
|
children: getAbbreviationFromUserName(label)
|
|
28
32
|
}
|
|
29
33
|
);
|
|
@@ -85,7 +85,7 @@ function SettingsMenu({
|
|
|
85
85
|
sx: submenuFooterStyle.subMenuChildren,
|
|
86
86
|
renderLabel: () => /* @__PURE__ */ jsxs(Box, { children: [
|
|
87
87
|
intl.formatMessage({ id: "top-bar/language" }),
|
|
88
|
-
/* @__PURE__ */ jsxs(Typography, { component: "span", fontSize: 12, sx: { color: "text.
|
|
88
|
+
/* @__PURE__ */ jsxs(Typography, { component: "span", fontSize: 12, sx: { color: "text.secondary" }, children: [
|
|
89
89
|
" - ",
|
|
90
90
|
intl.formatMessage({
|
|
91
91
|
id: `top-bar/language/${selectedLanguage}`
|
|
@@ -24,6 +24,7 @@ export declare const topBarEn: {
|
|
|
24
24
|
'top-bar/developerModeWarning': string;
|
|
25
25
|
'top-bar/settings': string;
|
|
26
26
|
'top-bar/minimize': string;
|
|
27
|
+
'top-bar/expand': string;
|
|
27
28
|
'about-dialog/title': string;
|
|
28
29
|
'about-dialog/version': string;
|
|
29
30
|
'about-dialog/alert-running-old-version-msg': string;
|
|
@@ -17,7 +17,8 @@ const topBarEn = {
|
|
|
17
17
|
"top-bar/language/sys": "Browser",
|
|
18
18
|
"top-bar/developerModeWarning": "Developer mode: Some features are incomplete and may not work as expected.",
|
|
19
19
|
"top-bar/settings": "Settings",
|
|
20
|
-
"top-bar/minimize": "
|
|
20
|
+
"top-bar/minimize": "Collapse menu",
|
|
21
|
+
"top-bar/expand": "Expand menu",
|
|
21
22
|
"about-dialog/title": "About",
|
|
22
23
|
"about-dialog/version": "Version {version}",
|
|
23
24
|
"about-dialog/alert-running-old-version-msg": "Running old version.\nSave your work and refresh the application to load the latest version.",
|
|
@@ -24,6 +24,7 @@ export declare const topBarFr: {
|
|
|
24
24
|
'top-bar/developerModeWarning': string;
|
|
25
25
|
'top-bar/settings': string;
|
|
26
26
|
'top-bar/minimize': string;
|
|
27
|
+
'top-bar/expand': string;
|
|
27
28
|
'about-dialog/title': string;
|
|
28
29
|
'about-dialog/version': string;
|
|
29
30
|
'about-dialog/alert-running-old-version-msg': string;
|
|
@@ -18,6 +18,7 @@ const topBarFr = {
|
|
|
18
18
|
"top-bar/developerModeWarning": "Mode développeur : Certaines fonctionnalités ne sont pas complètes et peuvent ne pas fonctionner comme prévu.",
|
|
19
19
|
"top-bar/settings": "Réglages",
|
|
20
20
|
"top-bar/minimize": "Réduire le menu",
|
|
21
|
+
"top-bar/expand": "Développer le menu",
|
|
21
22
|
"about-dialog/title": "À propos",
|
|
22
23
|
"about-dialog/version": "Version {version}",
|
|
23
24
|
"about-dialog/alert-running-old-version-msg": "Ancienne version de l'application.\nVeuillez sauvegarder votre travail et rafraîchir l'application pour charger la dernière version",
|