@gridsuite/commons-ui 0.278.0 → 0.279.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/index.d.ts +1 -0
- package/dist/features/index.js +6 -0
- package/dist/features/side-bar/AppSideBar.d.ts +27 -0
- package/dist/features/side-bar/AppSideBar.js +102 -0
- package/dist/features/side-bar/AppSideBarHeader.d.ts +11 -0
- package/dist/features/side-bar/AppSideBarHeader.js +54 -0
- package/dist/features/side-bar/dialogs/AppSideBarDialogProvider.d.ts +14 -0
- package/dist/features/side-bar/dialogs/AppSideBarDialogProvider.js +36 -0
- package/dist/features/side-bar/dialogs/AppSideBarDialogs.d.ts +14 -0
- package/dist/features/side-bar/dialogs/AppSideBarDialogs.js +56 -0
- package/dist/features/side-bar/footer/AppSideBarFooter.d.ts +15 -0
- package/dist/features/side-bar/footer/AppSideBarFooter.js +60 -0
- package/dist/features/side-bar/footer/applications/ApplicationMenu.d.ts +5 -0
- package/dist/features/side-bar/footer/applications/ApplicationMenu.js +83 -0
- package/dist/features/side-bar/footer/applications/OtherAppRedirection.d.ts +6 -0
- package/dist/features/side-bar/footer/applications/OtherAppRedirection.js +105 -0
- package/dist/features/side-bar/footer/common/MinimizedSubMenuHeader.d.ts +9 -0
- package/dist/features/side-bar/footer/common/MinimizedSubMenuHeader.js +22 -0
- package/dist/features/side-bar/footer/common/SideBarMenuItem.d.ts +10 -0
- package/dist/features/side-bar/footer/common/SideBarMenuItem.js +76 -0
- package/dist/features/side-bar/footer/common/submenu-footer.style.d.ts +23 -0
- package/dist/features/side-bar/footer/common/submenu-footer.style.js +20 -0
- package/dist/features/side-bar/footer/profile/ProfileInfos.d.ts +4 -0
- package/dist/features/side-bar/footer/profile/ProfileInfos.js +32 -0
- package/dist/features/side-bar/footer/profile/ProfileMenu.d.ts +7 -0
- package/dist/features/side-bar/footer/profile/ProfileMenu.js +95 -0
- package/dist/features/side-bar/footer/profile/UserIcon.d.ts +9 -0
- package/dist/features/side-bar/footer/profile/UserIcon.js +33 -0
- package/dist/features/side-bar/footer/settings/DarkModeToggle.d.ts +7 -0
- package/dist/features/side-bar/footer/settings/DarkModeToggle.js +74 -0
- package/dist/features/side-bar/footer/settings/LanguageSelection.d.ts +8 -0
- package/dist/features/side-bar/footer/settings/LanguageSelection.js +75 -0
- package/dist/features/side-bar/footer/settings/SettingsMenu.d.ts +10 -0
- package/dist/features/side-bar/footer/settings/SettingsMenu.js +112 -0
- package/dist/features/side-bar/index.d.ts +7 -0
- package/dist/features/side-bar/index.js +4 -0
- package/dist/features/topBar/index.d.ts +2 -0
- package/dist/features/topBar/index.js +5 -1
- package/dist/index.js +6 -0
- package/dist/translations/en/topBarEn.d.ts +7 -0
- package/dist/translations/en/topBarEn.js +7 -0
- package/dist/translations/fr/topBarFr.d.ts +7 -0
- package/dist/translations/fr/topBarFr.js +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ListSubheader } from "@mui/material";
|
|
3
|
+
function MinimizedSubMenuHeader({ label }) {
|
|
4
|
+
return /* @__PURE__ */ jsx(
|
|
5
|
+
ListSubheader,
|
|
6
|
+
{
|
|
7
|
+
sx: {
|
|
8
|
+
backgroundImage: "var(--Paper-overlay)",
|
|
9
|
+
".MuiMenuItem-root, .MuiTypography-root": {
|
|
10
|
+
px: 1.5
|
|
11
|
+
// customize padding for text
|
|
12
|
+
},
|
|
13
|
+
px: 1.5
|
|
14
|
+
// customize padding for the whole menu item
|
|
15
|
+
},
|
|
16
|
+
children: label
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
MinimizedSubMenuHeader
|
|
22
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface SideBarMenuItemProps {
|
|
3
|
+
label: string;
|
|
4
|
+
icon?: ReactNode;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
showLabel?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function SideBarMenuItem({ label, icon, onClick, showLabel, disabled, }: Readonly<SideBarMenuItemProps>): import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Typography } from "@mui/material";
|
|
3
|
+
import { useIntl } from "react-intl";
|
|
4
|
+
import { submenuFooterStyle } from "./submenu-footer.style.js";
|
|
5
|
+
import "@mui/icons-material";
|
|
6
|
+
import "../../../../components/ui/overflowableText/OverflowableText.js";
|
|
7
|
+
import "../../../../utils/conversionUtils.js";
|
|
8
|
+
import "../../../../utils/types/equipmentType.js";
|
|
9
|
+
import "react";
|
|
10
|
+
import "react-hook-form";
|
|
11
|
+
import "localized-countries";
|
|
12
|
+
import "localized-countries/data/fr";
|
|
13
|
+
import "localized-countries/data/en";
|
|
14
|
+
import "notistack";
|
|
15
|
+
import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
16
|
+
import "yup";
|
|
17
|
+
import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
18
|
+
import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
|
|
19
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
20
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
21
|
+
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
22
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
23
|
+
import "@material-symbols/svg-400/outlined/add_notes-fill.svg?react";
|
|
24
|
+
import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
25
|
+
import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
26
|
+
import "../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
|
|
27
|
+
import "@hello-pangea/dnd";
|
|
28
|
+
import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
29
|
+
import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
30
|
+
import { CustomMenuItem } from "../../../../components/ui/menus/custom-nested-menu.js";
|
|
31
|
+
import "react-resizable-panels";
|
|
32
|
+
import "react-papaparse";
|
|
33
|
+
import "react-dom";
|
|
34
|
+
import "autosuggest-highlight/match";
|
|
35
|
+
import "autosuggest-highlight/parse";
|
|
36
|
+
import "clsx";
|
|
37
|
+
import "../../../../components/composite/filter/FilterCreationDialog.js";
|
|
38
|
+
import "../../../../components/composite/filter/HeaderFilterForm.js";
|
|
39
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
40
|
+
import "../../../../components/composite/filter/expert/ExpertFilterForm.js";
|
|
41
|
+
import "../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
|
|
42
|
+
import "../../../../components/composite/filter/expert/expertFilterConstants.js";
|
|
43
|
+
import "react-querybuilder";
|
|
44
|
+
import "uuid";
|
|
45
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
46
|
+
import "../../../../components/composite/filter/utils/filterFormUtils.js";
|
|
47
|
+
import "@react-querybuilder/material";
|
|
48
|
+
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
49
|
+
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
50
|
+
import "../../../../components/composite/agGridTable/BottomTableButtons.js";
|
|
51
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
52
|
+
import "ag-grid-community";
|
|
53
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
54
|
+
import "../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
|
|
55
|
+
import "mathjs";
|
|
56
|
+
import "../../../../components/composite/report/report-viewer/log-table/log-table.js";
|
|
57
|
+
import "react-window";
|
|
58
|
+
import "../../../../components/composite/report/report-treeview/treeview-item.js";
|
|
59
|
+
import "../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
|
|
60
|
+
function SideBarMenuItem({
|
|
61
|
+
label,
|
|
62
|
+
icon,
|
|
63
|
+
onClick,
|
|
64
|
+
showLabel = true,
|
|
65
|
+
disabled = false
|
|
66
|
+
}) {
|
|
67
|
+
const intl = useIntl();
|
|
68
|
+
return /* @__PURE__ */ jsxs(CustomMenuItem, { disabled, onClick, sx: submenuFooterStyle.subMenu, children: [
|
|
69
|
+
icon,
|
|
70
|
+
" ",
|
|
71
|
+
showLabel && /* @__PURE__ */ jsx(Typography, { px: 1, children: intl.formatMessage({ id: label }) })
|
|
72
|
+
] });
|
|
73
|
+
}
|
|
74
|
+
export {
|
|
75
|
+
SideBarMenuItem
|
|
76
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, RTE (http://www.rte-france.com)
|
|
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 const submenuFooterStyle: {
|
|
8
|
+
subMenu: {
|
|
9
|
+
pl: number;
|
|
10
|
+
mb: number;
|
|
11
|
+
color: string;
|
|
12
|
+
'&:hover': {
|
|
13
|
+
color: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
subMenuChildren: {
|
|
17
|
+
pl: number;
|
|
18
|
+
color: string;
|
|
19
|
+
'&:hover': {
|
|
20
|
+
color: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const submenuFooterStyle = {
|
|
2
|
+
subMenu: {
|
|
3
|
+
pl: 1.5,
|
|
4
|
+
mb: 0.5,
|
|
5
|
+
color: "inherit",
|
|
6
|
+
"&:hover": {
|
|
7
|
+
color: "inherit"
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
subMenuChildren: {
|
|
11
|
+
pl: 2,
|
|
12
|
+
color: "inherit",
|
|
13
|
+
"&:hover": {
|
|
14
|
+
color: "inherit"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
submenuFooterStyle
|
|
20
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { MenuItem, Box, Divider } from "@mui/material";
|
|
3
|
+
import { Person } from "@mui/icons-material";
|
|
4
|
+
function ProfileInfos({ userProfile }) {
|
|
5
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6
|
+
/* @__PURE__ */ jsxs(
|
|
7
|
+
MenuItem,
|
|
8
|
+
{
|
|
9
|
+
sx: {
|
|
10
|
+
px: 1.5,
|
|
11
|
+
"&.Mui-disabled": {
|
|
12
|
+
opacity: 1
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
disabled: true,
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ jsx(Person, {}),
|
|
18
|
+
/* @__PURE__ */ jsxs(Box, { component: "span", px: 1, children: [
|
|
19
|
+
userProfile?.name,
|
|
20
|
+
" ",
|
|
21
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
22
|
+
/* @__PURE__ */ jsx(Box, { component: "span", children: userProfile?.email })
|
|
23
|
+
] })
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
/* @__PURE__ */ jsx(Divider, {})
|
|
28
|
+
] });
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
ProfileInfos
|
|
32
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UserProfile } from 'oidc-client-ts';
|
|
2
|
+
interface ProfileMenuProps {
|
|
3
|
+
isMinimized: boolean;
|
|
4
|
+
userProfile?: UserProfile;
|
|
5
|
+
}
|
|
6
|
+
export declare function ProfileMenu({ isMinimized, userProfile }: Readonly<ProfileMenuProps>): import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Badge, ManageAccounts } from "@mui/icons-material";
|
|
3
|
+
import { useIntl } from "react-intl";
|
|
4
|
+
import { MinimizedSubMenuHeader } from "../common/MinimizedSubMenuHeader.js";
|
|
5
|
+
import { ProfileInfos } from "./ProfileInfos.js";
|
|
6
|
+
import { UserAvatarIcon } from "./UserIcon.js";
|
|
7
|
+
import { SideBarMenuItem } from "../common/SideBarMenuItem.js";
|
|
8
|
+
import { submenuFooterStyle } from "../common/submenu-footer.style.js";
|
|
9
|
+
import "@mui/material";
|
|
10
|
+
import "../../../../components/ui/overflowableText/OverflowableText.js";
|
|
11
|
+
import "../../../../utils/conversionUtils.js";
|
|
12
|
+
import "../../../../utils/types/equipmentType.js";
|
|
13
|
+
import "react";
|
|
14
|
+
import "react-hook-form";
|
|
15
|
+
import "localized-countries";
|
|
16
|
+
import "localized-countries/data/fr";
|
|
17
|
+
import "localized-countries/data/en";
|
|
18
|
+
import "notistack";
|
|
19
|
+
import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
20
|
+
import "yup";
|
|
21
|
+
import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
22
|
+
import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
|
|
23
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
24
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
25
|
+
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
26
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
27
|
+
import "@material-symbols/svg-400/outlined/add_notes-fill.svg?react";
|
|
28
|
+
import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
29
|
+
import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
30
|
+
import "../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
|
|
31
|
+
import "@hello-pangea/dnd";
|
|
32
|
+
import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
33
|
+
import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
34
|
+
import { CustomNestedMenuItem } from "../../../../components/ui/menus/custom-nested-menu.js";
|
|
35
|
+
import "react-resizable-panels";
|
|
36
|
+
import "react-papaparse";
|
|
37
|
+
import "react-dom";
|
|
38
|
+
import "autosuggest-highlight/match";
|
|
39
|
+
import "autosuggest-highlight/parse";
|
|
40
|
+
import "clsx";
|
|
41
|
+
import "../../../../components/composite/filter/FilterCreationDialog.js";
|
|
42
|
+
import "../../../../components/composite/filter/HeaderFilterForm.js";
|
|
43
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
44
|
+
import "../../../../components/composite/filter/expert/ExpertFilterForm.js";
|
|
45
|
+
import "../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
|
|
46
|
+
import "../../../../components/composite/filter/expert/expertFilterConstants.js";
|
|
47
|
+
import "react-querybuilder";
|
|
48
|
+
import "uuid";
|
|
49
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
50
|
+
import "../../../../components/composite/filter/utils/filterFormUtils.js";
|
|
51
|
+
import "@react-querybuilder/material";
|
|
52
|
+
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
53
|
+
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
54
|
+
import "../../../../components/composite/agGridTable/BottomTableButtons.js";
|
|
55
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
56
|
+
import "ag-grid-community";
|
|
57
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
58
|
+
import "../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
|
|
59
|
+
import "mathjs";
|
|
60
|
+
import "../../../../components/composite/report/report-viewer/log-table/log-table.js";
|
|
61
|
+
import "react-window";
|
|
62
|
+
import "../../../../components/composite/report/report-treeview/treeview-item.js";
|
|
63
|
+
import "../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
|
|
64
|
+
import { useAppSideBarDialogs, SideBarDialogType } from "../../dialogs/AppSideBarDialogProvider.js";
|
|
65
|
+
function ProfileMenu({ isMinimized, userProfile }) {
|
|
66
|
+
const intl = useIntl();
|
|
67
|
+
const { setOpenDialog } = useAppSideBarDialogs();
|
|
68
|
+
const openProfileDialog = () => setOpenDialog(SideBarDialogType.PROFILE);
|
|
69
|
+
const openProfileSettingsDialog = () => setOpenDialog(SideBarDialogType.PROFILE_SETTINGS);
|
|
70
|
+
const profileLabel = intl.formatMessage({ id: "user-information-dialog/profile" });
|
|
71
|
+
return /* @__PURE__ */ jsxs(
|
|
72
|
+
CustomNestedMenuItem,
|
|
73
|
+
{
|
|
74
|
+
label: !isMinimized ? profileLabel : "",
|
|
75
|
+
leftIcon: /* @__PURE__ */ jsx(UserAvatarIcon, { label: userProfile?.name ?? "" }),
|
|
76
|
+
sx: submenuFooterStyle.subMenu,
|
|
77
|
+
children: [
|
|
78
|
+
isMinimized && /* @__PURE__ */ jsx(MinimizedSubMenuHeader, { label: profileLabel }),
|
|
79
|
+
/* @__PURE__ */ jsx(ProfileInfos, { userProfile }),
|
|
80
|
+
/* @__PURE__ */ jsx(SideBarMenuItem, { label: "top-bar/userInformation", icon: /* @__PURE__ */ jsx(Badge, {}), onClick: openProfileDialog }),
|
|
81
|
+
/* @__PURE__ */ jsx(
|
|
82
|
+
SideBarMenuItem,
|
|
83
|
+
{
|
|
84
|
+
label: "top-bar/userSettings",
|
|
85
|
+
icon: /* @__PURE__ */ jsx(ManageAccounts, {}),
|
|
86
|
+
onClick: openProfileSettingsDialog
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
export {
|
|
94
|
+
ProfileMenu
|
|
95
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, RTE (http://www.rte-france.com)
|
|
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<{
|
|
8
|
+
label: string;
|
|
9
|
+
}>): import("react").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Avatar } from "@mui/material";
|
|
3
|
+
import "../../../../utils/conversionUtils.js";
|
|
4
|
+
import "../../../../utils/types/equipmentType.js";
|
|
5
|
+
import { isEmpty } from "../../../../utils/functions.js";
|
|
6
|
+
import "@mui/icons-material";
|
|
7
|
+
function getAbbreviationFromUserName(name) {
|
|
8
|
+
if (isEmpty(name)) {
|
|
9
|
+
return "";
|
|
10
|
+
}
|
|
11
|
+
const [firstName, ...otherNames] = name.split(" ");
|
|
12
|
+
if (otherNames.length > 0) {
|
|
13
|
+
return `${firstName[0]}${otherNames.at(-1)[0]}`;
|
|
14
|
+
}
|
|
15
|
+
return firstName[0];
|
|
16
|
+
}
|
|
17
|
+
function UserAvatarIcon({ label }) {
|
|
18
|
+
return /* @__PURE__ */ jsx(
|
|
19
|
+
Avatar,
|
|
20
|
+
{
|
|
21
|
+
sx: (theme) => ({
|
|
22
|
+
height: "24px",
|
|
23
|
+
width: "24px",
|
|
24
|
+
fontSize: theme.typography.pxToRem(11),
|
|
25
|
+
textTransform: "uppercase"
|
|
26
|
+
}),
|
|
27
|
+
children: getAbbreviationFromUserName(label)
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
UserAvatarIcon
|
|
33
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GsTheme } from '../../../../utils';
|
|
2
|
+
interface DarkModeToggleProps {
|
|
3
|
+
currentTheme: GsTheme;
|
|
4
|
+
setTheme: (newTheme: GsTheme) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function DarkModeToggle({ currentTheme, setTheme }: Readonly<DarkModeToggleProps>): import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Stack, Switch } from "@mui/material";
|
|
3
|
+
import { FormattedMessage } from "react-intl";
|
|
4
|
+
import "../../../../utils/conversionUtils.js";
|
|
5
|
+
import "../../../../utils/types/equipmentType.js";
|
|
6
|
+
import "@mui/icons-material";
|
|
7
|
+
import { DARK_THEME, LIGHT_THEME } from "../../../../utils/styles.js";
|
|
8
|
+
import "../../../../components/ui/overflowableText/OverflowableText.js";
|
|
9
|
+
import "react";
|
|
10
|
+
import "react-hook-form";
|
|
11
|
+
import "localized-countries";
|
|
12
|
+
import "localized-countries/data/fr";
|
|
13
|
+
import "localized-countries/data/en";
|
|
14
|
+
import "notistack";
|
|
15
|
+
import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
16
|
+
import "yup";
|
|
17
|
+
import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
18
|
+
import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
|
|
19
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
20
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
21
|
+
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
22
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
23
|
+
import "@material-symbols/svg-400/outlined/add_notes-fill.svg?react";
|
|
24
|
+
import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
25
|
+
import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
26
|
+
import "../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
|
|
27
|
+
import "@hello-pangea/dnd";
|
|
28
|
+
import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
29
|
+
import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
30
|
+
import { CustomMenuItem } from "../../../../components/ui/menus/custom-nested-menu.js";
|
|
31
|
+
import "react-resizable-panels";
|
|
32
|
+
import "react-papaparse";
|
|
33
|
+
import "react-dom";
|
|
34
|
+
import "autosuggest-highlight/match";
|
|
35
|
+
import "autosuggest-highlight/parse";
|
|
36
|
+
import "clsx";
|
|
37
|
+
import "../../../../components/composite/filter/FilterCreationDialog.js";
|
|
38
|
+
import "../../../../components/composite/filter/HeaderFilterForm.js";
|
|
39
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
40
|
+
import "../../../../components/composite/filter/expert/ExpertFilterForm.js";
|
|
41
|
+
import "../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
|
|
42
|
+
import "../../../../components/composite/filter/expert/expertFilterConstants.js";
|
|
43
|
+
import "react-querybuilder";
|
|
44
|
+
import "uuid";
|
|
45
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
46
|
+
import "../../../../components/composite/filter/utils/filterFormUtils.js";
|
|
47
|
+
import "@react-querybuilder/material";
|
|
48
|
+
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
49
|
+
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
50
|
+
import "../../../../components/composite/agGridTable/BottomTableButtons.js";
|
|
51
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
52
|
+
import "ag-grid-community";
|
|
53
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
54
|
+
import "../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
|
|
55
|
+
import "mathjs";
|
|
56
|
+
import "../../../../components/composite/report/report-viewer/log-table/log-table.js";
|
|
57
|
+
import "react-window";
|
|
58
|
+
import "../../../../components/composite/report/report-treeview/treeview-item.js";
|
|
59
|
+
import "../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
|
|
60
|
+
import { submenuFooterStyle } from "../common/submenu-footer.style.js";
|
|
61
|
+
function DarkModeToggle({ currentTheme, setTheme }) {
|
|
62
|
+
const isDarkMode = currentTheme === DARK_THEME;
|
|
63
|
+
const toggleMode = (event) => {
|
|
64
|
+
const targetModeValue = event.target.checked ? DARK_THEME : LIGHT_THEME;
|
|
65
|
+
setTheme(targetModeValue);
|
|
66
|
+
};
|
|
67
|
+
return /* @__PURE__ */ jsx(CustomMenuItem, { sx: submenuFooterStyle.subMenuChildren, children: /* @__PURE__ */ jsxs(Stack, { width: "100%", direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2, children: [
|
|
68
|
+
/* @__PURE__ */ jsx(FormattedMessage, { id: "top-bar/darkMode" }),
|
|
69
|
+
/* @__PURE__ */ jsx(Switch, { checked: isDarkMode, onChange: toggleMode })
|
|
70
|
+
] }) });
|
|
71
|
+
}
|
|
72
|
+
export {
|
|
73
|
+
DarkModeToggle
|
|
74
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GsLang } from '../../../../utils';
|
|
2
|
+
interface LanguageSelectionProps {
|
|
3
|
+
language: GsLang;
|
|
4
|
+
isSelectedLanguage: boolean;
|
|
5
|
+
setSelectedLanguage: (newLanguage: GsLang) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function LanguageSelection({ language, isSelectedLanguage, setSelectedLanguage, }: Readonly<LanguageSelectionProps>): import("react").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Done } from "@mui/icons-material";
|
|
3
|
+
import { FormattedMessage } from "react-intl";
|
|
4
|
+
import "@mui/material";
|
|
5
|
+
import "../../../../components/ui/overflowableText/OverflowableText.js";
|
|
6
|
+
import "../../../../utils/conversionUtils.js";
|
|
7
|
+
import "../../../../utils/types/equipmentType.js";
|
|
8
|
+
import "react";
|
|
9
|
+
import "react-hook-form";
|
|
10
|
+
import "localized-countries";
|
|
11
|
+
import "localized-countries/data/fr";
|
|
12
|
+
import "localized-countries/data/en";
|
|
13
|
+
import "notistack";
|
|
14
|
+
import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
15
|
+
import "yup";
|
|
16
|
+
import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
17
|
+
import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
|
|
18
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
19
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
20
|
+
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
21
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
22
|
+
import "@material-symbols/svg-400/outlined/add_notes-fill.svg?react";
|
|
23
|
+
import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
24
|
+
import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
25
|
+
import "../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
|
|
26
|
+
import "@hello-pangea/dnd";
|
|
27
|
+
import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
28
|
+
import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
29
|
+
import { CustomMenuItem } from "../../../../components/ui/menus/custom-nested-menu.js";
|
|
30
|
+
import "react-resizable-panels";
|
|
31
|
+
import "react-papaparse";
|
|
32
|
+
import "react-dom";
|
|
33
|
+
import "autosuggest-highlight/match";
|
|
34
|
+
import "autosuggest-highlight/parse";
|
|
35
|
+
import "clsx";
|
|
36
|
+
import "../../../../components/composite/filter/FilterCreationDialog.js";
|
|
37
|
+
import "../../../../components/composite/filter/HeaderFilterForm.js";
|
|
38
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
39
|
+
import "../../../../components/composite/filter/expert/ExpertFilterForm.js";
|
|
40
|
+
import "../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
|
|
41
|
+
import "../../../../components/composite/filter/expert/expertFilterConstants.js";
|
|
42
|
+
import "react-querybuilder";
|
|
43
|
+
import "uuid";
|
|
44
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
45
|
+
import "../../../../components/composite/filter/utils/filterFormUtils.js";
|
|
46
|
+
import "@react-querybuilder/material";
|
|
47
|
+
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
48
|
+
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
49
|
+
import "../../../../components/composite/agGridTable/BottomTableButtons.js";
|
|
50
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
51
|
+
import "ag-grid-community";
|
|
52
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
53
|
+
import "../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
|
|
54
|
+
import "mathjs";
|
|
55
|
+
import "../../../../components/composite/report/report-viewer/log-table/log-table.js";
|
|
56
|
+
import "react-window";
|
|
57
|
+
import "../../../../components/composite/report/report-treeview/treeview-item.js";
|
|
58
|
+
import "../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
|
|
59
|
+
import { submenuFooterStyle } from "../common/submenu-footer.style.js";
|
|
60
|
+
function LanguageSelection({
|
|
61
|
+
language,
|
|
62
|
+
isSelectedLanguage,
|
|
63
|
+
setSelectedLanguage
|
|
64
|
+
}) {
|
|
65
|
+
const onClick = () => {
|
|
66
|
+
setSelectedLanguage(language);
|
|
67
|
+
};
|
|
68
|
+
return /* @__PURE__ */ jsxs(CustomMenuItem, { sx: submenuFooterStyle.subMenuChildren, onClick, children: [
|
|
69
|
+
/* @__PURE__ */ jsx(FormattedMessage, { id: `top-bar/language/${language}` }),
|
|
70
|
+
/* @__PURE__ */ jsx(Done, { color: "info", sx: { ml: 1, visibility: isSelectedLanguage ? "initial" : "hidden" } })
|
|
71
|
+
] });
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
LanguageSelection
|
|
75
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GsLang, GsTheme } from '../../../../utils';
|
|
2
|
+
interface SettingsMenuProps {
|
|
3
|
+
isMinimized: boolean;
|
|
4
|
+
currentTheme: GsTheme;
|
|
5
|
+
setTheme: (newTheme: GsTheme) => void;
|
|
6
|
+
selectedLanguage: GsLang;
|
|
7
|
+
setSelectedLanguage: (newSelectedLanguage: GsLang) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function SettingsMenu({ isMinimized, currentTheme, setTheme, selectedLanguage, setSelectedLanguage, }: Readonly<SettingsMenuProps>): import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DisplaySettings } from "@mui/icons-material";
|
|
3
|
+
import { useIntl } from "react-intl";
|
|
4
|
+
import { Box, Typography } from "@mui/material";
|
|
5
|
+
import { MinimizedSubMenuHeader } from "../common/MinimizedSubMenuHeader.js";
|
|
6
|
+
import { DarkModeToggle } from "./DarkModeToggle.js";
|
|
7
|
+
import { LanguageSelection } from "./LanguageSelection.js";
|
|
8
|
+
import { submenuFooterStyle } from "../common/submenu-footer.style.js";
|
|
9
|
+
import "../../../../components/ui/overflowableText/OverflowableText.js";
|
|
10
|
+
import "../../../../utils/conversionUtils.js";
|
|
11
|
+
import "../../../../utils/types/equipmentType.js";
|
|
12
|
+
import "react";
|
|
13
|
+
import "react-hook-form";
|
|
14
|
+
import "localized-countries";
|
|
15
|
+
import "localized-countries/data/fr";
|
|
16
|
+
import "localized-countries/data/en";
|
|
17
|
+
import "notistack";
|
|
18
|
+
import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
19
|
+
import "yup";
|
|
20
|
+
import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
21
|
+
import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
|
|
22
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
23
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
24
|
+
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
25
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
26
|
+
import "@material-symbols/svg-400/outlined/add_notes-fill.svg?react";
|
|
27
|
+
import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
28
|
+
import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
29
|
+
import "../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
|
|
30
|
+
import "@hello-pangea/dnd";
|
|
31
|
+
import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
32
|
+
import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
33
|
+
import { CustomNestedMenuItem } from "../../../../components/ui/menus/custom-nested-menu.js";
|
|
34
|
+
import "react-resizable-panels";
|
|
35
|
+
import "react-papaparse";
|
|
36
|
+
import "react-dom";
|
|
37
|
+
import "autosuggest-highlight/match";
|
|
38
|
+
import "autosuggest-highlight/parse";
|
|
39
|
+
import "clsx";
|
|
40
|
+
import "../../../../components/composite/filter/FilterCreationDialog.js";
|
|
41
|
+
import "../../../../components/composite/filter/HeaderFilterForm.js";
|
|
42
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
43
|
+
import "../../../../components/composite/filter/expert/ExpertFilterForm.js";
|
|
44
|
+
import "../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
|
|
45
|
+
import "../../../../components/composite/filter/expert/expertFilterConstants.js";
|
|
46
|
+
import "react-querybuilder";
|
|
47
|
+
import "uuid";
|
|
48
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
49
|
+
import "../../../../components/composite/filter/utils/filterFormUtils.js";
|
|
50
|
+
import "@react-querybuilder/material";
|
|
51
|
+
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
52
|
+
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
53
|
+
import "../../../../components/composite/agGridTable/BottomTableButtons.js";
|
|
54
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
55
|
+
import "ag-grid-community";
|
|
56
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
57
|
+
import "../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
|
|
58
|
+
import "mathjs";
|
|
59
|
+
import "../../../../components/composite/report/report-viewer/log-table/log-table.js";
|
|
60
|
+
import "react-window";
|
|
61
|
+
import "../../../../components/composite/report/report-treeview/treeview-item.js";
|
|
62
|
+
import "../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
|
|
63
|
+
function SettingsMenu({
|
|
64
|
+
isMinimized,
|
|
65
|
+
currentTheme,
|
|
66
|
+
setTheme,
|
|
67
|
+
selectedLanguage,
|
|
68
|
+
setSelectedLanguage
|
|
69
|
+
}) {
|
|
70
|
+
const intl = useIntl();
|
|
71
|
+
const settingsLabel = intl.formatMessage({ id: "top-bar/settings" });
|
|
72
|
+
const availableLanguages = ["sys", "fr", "en"];
|
|
73
|
+
return /* @__PURE__ */ jsxs(
|
|
74
|
+
CustomNestedMenuItem,
|
|
75
|
+
{
|
|
76
|
+
label: !isMinimized ? settingsLabel : "",
|
|
77
|
+
leftIcon: /* @__PURE__ */ jsx(DisplaySettings, {}),
|
|
78
|
+
sx: submenuFooterStyle.subMenu,
|
|
79
|
+
children: [
|
|
80
|
+
isMinimized && /* @__PURE__ */ jsx(MinimizedSubMenuHeader, { label: settingsLabel }),
|
|
81
|
+
/* @__PURE__ */ jsx(DarkModeToggle, { currentTheme, setTheme }),
|
|
82
|
+
/* @__PURE__ */ jsx(
|
|
83
|
+
CustomNestedMenuItem,
|
|
84
|
+
{
|
|
85
|
+
sx: submenuFooterStyle.subMenuChildren,
|
|
86
|
+
renderLabel: () => /* @__PURE__ */ jsxs(Box, { children: [
|
|
87
|
+
intl.formatMessage({ id: "top-bar/language" }),
|
|
88
|
+
/* @__PURE__ */ jsxs(Typography, { component: "span", fontSize: 12, sx: { color: "text.disabled" }, children: [
|
|
89
|
+
" - ",
|
|
90
|
+
intl.formatMessage({
|
|
91
|
+
id: `top-bar/language/${selectedLanguage}`
|
|
92
|
+
})
|
|
93
|
+
] })
|
|
94
|
+
] }),
|
|
95
|
+
children: availableLanguages.map((language) => /* @__PURE__ */ jsx(
|
|
96
|
+
LanguageSelection,
|
|
97
|
+
{
|
|
98
|
+
language,
|
|
99
|
+
isSelectedLanguage: selectedLanguage === language,
|
|
100
|
+
setSelectedLanguage
|
|
101
|
+
},
|
|
102
|
+
language
|
|
103
|
+
))
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
export {
|
|
111
|
+
SettingsMenu
|
|
112
|
+
};
|