@gridsuite/commons-ui 0.140.0 → 0.141.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.
Files changed (43) hide show
  1. package/dist/components/customAGGrid/cell-renderers.d.ts +26 -0
  2. package/dist/components/customAGGrid/cell-renderers.js +199 -0
  3. package/dist/components/customAGGrid/index.d.ts +1 -0
  4. package/dist/components/customAGGrid/index.js +9 -0
  5. package/dist/components/dialogs/customMuiDialog/CustomMuiDialog.js +2 -2
  6. package/dist/components/dialogs/descriptionModificationDialog/DescriptionModificationDialog.d.ts +1 -1
  7. package/dist/components/dialogs/modifyElementSelection/ModifyElementSelection.js +3 -0
  8. package/dist/components/directoryItemSelector/DirectoryItemSelector.js +5 -2
  9. package/dist/components/directoryItemSelector/utils.js +2 -1
  10. package/dist/components/index.d.ts +2 -0
  11. package/dist/components/index.js +15 -0
  12. package/dist/components/inputs/reactHookForm/DirectoryItemsInput.d.ts +2 -1
  13. package/dist/components/inputs/reactHookForm/DirectoryItemsInput.js +44 -55
  14. package/dist/components/inputs/reactHookForm/agGridTable/CustomAgGridTable.js +1 -0
  15. package/dist/components/inputs/reactQueryBuilder/ElementValueEditor.js +1 -1
  16. package/dist/components/muiTable/OverflowableTableCell.d.ts +3 -0
  17. package/dist/components/muiTable/OverflowableTableCell.js +10 -0
  18. package/dist/components/muiTable/OverflowableTableCellWithCheckbox.d.ts +6 -0
  19. package/dist/components/muiTable/OverflowableTableCellWithCheckbox.js +16 -0
  20. package/dist/components/muiTable/index.d.ts +8 -0
  21. package/dist/components/muiTable/index.js +6 -0
  22. package/dist/components/parameters/common/parameters-creation-dialog.js +1 -1
  23. package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +1 -1
  24. package/dist/components/parameters/network-visualizations/use-network-visualizations-parameters-form.js +1 -1
  25. package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +1 -1
  26. package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +1 -1
  27. package/dist/components/parameters/voltage-init/use-voltage-init-parameters-form.js +1 -1
  28. package/dist/components/resizablePanels/ResizeHandle.d.ts +8 -0
  29. package/dist/components/resizablePanels/ResizeHandle.js +32 -0
  30. package/dist/components/resizablePanels/index.d.ts +7 -0
  31. package/dist/components/resizablePanels/index.js +4 -0
  32. package/dist/components/topBar/GridLogo.d.ts +4 -2
  33. package/dist/components/topBar/GridLogo.js +39 -21
  34. package/dist/components/topBar/TopBar.d.ts +2 -1
  35. package/dist/components/topBar/TopBar.js +81 -65
  36. package/dist/index.js +23 -5
  37. package/dist/services/config.d.ts +10 -0
  38. package/dist/services/config.js +34 -0
  39. package/dist/services/directory.d.ts +6 -4
  40. package/dist/services/directory.js +17 -32
  41. package/dist/services/index.d.ts +5 -4
  42. package/dist/services/index.js +8 -5
  43. package/package.json +2 -1
@@ -0,0 +1,16 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { TableCell, Checkbox } from "@mui/material";
3
+ import { OverflowableText } from "../overflowableText/OverflowableText.js";
4
+ function OverflowableTableCellWithCheckbox({
5
+ checked,
6
+ ...overflowableTextProps
7
+ }) {
8
+ return /* @__PURE__ */ jsxs(TableCell, { padding: "checkbox", sx: { display: "flex", alignItems: "center", width: "100%" }, children: [
9
+ /* @__PURE__ */ jsx(Checkbox, { checked }),
10
+ /* @__PURE__ */ jsx(OverflowableText, { sx: { flex: "1 1 0", width: 0, display: "block" }, ...overflowableTextProps })
11
+ ] });
12
+ }
13
+ export {
14
+ OverflowableTableCellWithCheckbox,
15
+ OverflowableTableCellWithCheckbox as default
16
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Copyright (c) 2025, 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 * from './OverflowableTableCell';
8
+ export * from './OverflowableTableCellWithCheckbox';
@@ -0,0 +1,6 @@
1
+ import { OverflowableTableCell } from "./OverflowableTableCell.js";
2
+ import { OverflowableTableCellWithCheckbox } from "./OverflowableTableCellWithCheckbox.js";
3
+ export {
4
+ OverflowableTableCell,
5
+ OverflowableTableCellWithCheckbox
6
+ };
@@ -2,11 +2,11 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { useCallback } from "react";
3
3
  import "react-intl";
4
4
  import "../../../utils/types/equipmentType.js";
5
- import { createParameter, updateParameter } from "../../../services/explore.js";
6
5
  import "../../../utils/conversionUtils.js";
7
6
  import { snackWithFallback } from "../../../utils/error.js";
8
7
  import "@mui/icons-material";
9
8
  import "../../../utils/yupConfig.js";
9
+ import { createParameter, updateParameter } from "../../../services/explore.js";
10
10
  import "@mui/material";
11
11
  import "localized-countries";
12
12
  import "localized-countries/data/fr";
@@ -8,12 +8,12 @@ import "react/jsx-runtime";
8
8
  import "@mui/material";
9
9
  import "react-intl";
10
10
  import "../../../utils/types/equipmentType.js";
11
- import { updateParameter } from "../../../services/explore.js";
12
11
  import "../../../utils/conversionUtils.js";
13
12
  import { snackWithFallback } from "../../../utils/error.js";
14
13
  import "@mui/icons-material";
15
14
  import { ElementType } from "../../../utils/types/elementType.js";
16
15
  import "../../../utils/yupConfig.js";
16
+ import { updateParameter } from "../../../services/explore.js";
17
17
  import "localized-countries";
18
18
  import "localized-countries/data/fr";
19
19
  import "localized-countries/data/en";
@@ -7,11 +7,11 @@ import "react-intl";
7
7
  import "@mui/material";
8
8
  import "../../overflowableText/OverflowableText.js";
9
9
  import "../../../utils/types/equipmentType.js";
10
- import { updateParameter } from "../../../services/explore.js";
11
10
  import "../../../utils/conversionUtils.js";
12
11
  import { snackWithFallback } from "../../../utils/error.js";
13
12
  import "@mui/icons-material";
14
13
  import { ElementType } from "../../../utils/types/elementType.js";
14
+ import { updateParameter } from "../../../services/explore.js";
15
15
  import { setStudyNetworkVisualizationParameters } from "../../../services/study.js";
16
16
  import { getNetworkVisualizationsParameters } from "../../../services/study-config.js";
17
17
  import "localized-countries";
@@ -6,13 +6,13 @@ import "react/jsx-runtime";
6
6
  import "@mui/material";
7
7
  import "react-intl";
8
8
  import "../../../utils/types/equipmentType.js";
9
- import { updateParameter } from "../../../services/explore.js";
10
9
  import { FieldConstants } from "../../../utils/constants/fieldConstants.js";
11
10
  import "../../../utils/conversionUtils.js";
12
11
  import { snackWithFallback } from "../../../utils/error.js";
13
12
  import "@mui/icons-material";
14
13
  import { ElementType } from "../../../utils/types/elementType.js";
15
14
  import "../../../utils/yupConfig.js";
15
+ import { updateParameter } from "../../../services/explore.js";
16
16
  import "localized-countries";
17
17
  import "localized-countries/data/fr";
18
18
  import "localized-countries/data/en";
@@ -7,11 +7,11 @@ import "react-intl";
7
7
  import "@mui/material";
8
8
  import "../../overflowableText/OverflowableText.js";
9
9
  import "../../../utils/types/equipmentType.js";
10
- import { updateParameter } from "../../../services/explore.js";
11
10
  import "../../../utils/conversionUtils.js";
12
11
  import { snackWithFallback } from "../../../utils/error.js";
13
12
  import "@mui/icons-material";
14
13
  import { ElementType } from "../../../utils/types/elementType.js";
14
+ import { updateParameter } from "../../../services/explore.js";
15
15
  import { setStudyShortCircuitParameters, invalidateStudyShortCircuitStatus } from "../../../services/study.js";
16
16
  import "localized-countries";
17
17
  import "localized-countries/data/fr";
@@ -7,12 +7,12 @@ import "react-intl";
7
7
  import "@mui/material";
8
8
  import "../../overflowableText/OverflowableText.js";
9
9
  import "../../../utils/types/equipmentType.js";
10
- import { updateParameter } from "../../../services/explore.js";
11
10
  import { ID, FILTERS } from "../../../utils/constants/filterConstant.js";
12
11
  import { isBlankOrEmpty } from "../../../utils/conversionUtils.js";
13
12
  import { snackWithFallback } from "../../../utils/error.js";
14
13
  import "@mui/icons-material";
15
14
  import { ElementType } from "../../../utils/types/elementType.js";
15
+ import { updateParameter } from "../../../services/explore.js";
16
16
  import { updateVoltageInitParameters } from "../../../services/study.js";
17
17
  import { getVoltageInitParameters } from "../../../services/voltage-init.js";
18
18
  import "localized-countries";
@@ -0,0 +1,8 @@
1
+ import { Theme } from '@mui/material';
2
+ interface ResizeHandleProps {
3
+ visible?: boolean;
4
+ rotated?: boolean;
5
+ style?: (theme: Theme) => React.CSSProperties;
6
+ }
7
+ export declare function ResizeHandle({ visible, rotated, style }: Readonly<ResizeHandleProps>): import("react/jsx-runtime").JSX.Element;
8
+ export default ResizeHandle;
@@ -0,0 +1,32 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { PanelResizeHandle } from "react-resizable-panels";
3
+ import { DragIndicator } from "@mui/icons-material";
4
+ import { useTheme } from "@mui/material";
5
+ const getStyles = (theme, visible, rotated, customStyle) => ({
6
+ handle: {
7
+ display: visible ? "flex" : "none",
8
+ alignItems: "center",
9
+ backgroundColor: theme.palette.background.paper,
10
+ borderLeft: rotated ? "none" : `1px solid ${theme.palette.divider}`,
11
+ borderRight: rotated ? "none" : `1px solid ${theme.palette.divider}`,
12
+ borderBottom: rotated ? `1px solid ${theme.palette.divider}` : "none",
13
+ borderTop: rotated ? `1px solid ${theme.palette.divider}` : "none",
14
+ justifyContent: "center",
15
+ ...customStyle ? customStyle(theme) : {}
16
+ },
17
+ icon: {
18
+ transform: rotated ? "rotate(90deg)" : "none",
19
+ transition: "transform 0.2s",
20
+ color: "inherit",
21
+ cursor: "ns-resize"
22
+ }
23
+ });
24
+ function ResizeHandle({ visible = true, rotated = false, style }) {
25
+ const theme = useTheme();
26
+ const styles = getStyles(theme, visible, rotated, style);
27
+ return /* @__PURE__ */ jsx(PanelResizeHandle, { style: styles.handle, children: /* @__PURE__ */ jsx(DragIndicator, { fontSize: "small", style: styles.icon }) });
28
+ }
29
+ export {
30
+ ResizeHandle,
31
+ ResizeHandle as default
32
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright (c) 2025, 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 * from './ResizeHandle';
@@ -0,0 +1,4 @@
1
+ import { ResizeHandle } from "./ResizeHandle.js";
2
+ export {
3
+ ResizeHandle
4
+ };
@@ -2,12 +2,14 @@ import { ReactNode } from 'react';
2
2
  import { SxStyle } from '../../utils/styles';
3
3
  export interface GridLogoProps extends Omit<LogoTextProps, 'style'> {
4
4
  appLogo: ReactNode;
5
+ dense?: boolean;
5
6
  }
6
- export declare function LogoText({ appName, appColor, style, onClick }: Partial<LogoTextProps>): import("react/jsx-runtime").JSX.Element;
7
- export declare function GridLogo({ appLogo, appName, appColor, onClick }: Partial<GridLogoProps>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function LogoText({ appName, appColor, style, onClick, dense }: Readonly<Partial<LogoTextProps>>): import("react/jsx-runtime").JSX.Element;
8
+ export declare function GridLogo({ appLogo, appName, appColor, onClick, dense }: Readonly<Partial<GridLogoProps>>): import("react/jsx-runtime").JSX.Element;
8
9
  export interface LogoTextProps {
9
10
  appName: string;
10
11
  appColor: string;
11
12
  style: SxStyle;
12
13
  onClick: () => void;
14
+ dense?: boolean;
13
15
  }
@@ -1,32 +1,50 @@
1
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { Typography, Box } from "@mui/material";
3
3
  import { BrokenImage } from "@mui/icons-material";
4
+ import { useMemo } from "react";
4
5
  import { mergeSx } from "../../utils/styles.js";
5
- const styles = {
6
- logo: {
7
- flexShrink: 0,
8
- width: 48,
9
- height: 48,
10
- marginBottom: "8px"
11
- },
12
- title: {
13
- marginLeft: "18px",
14
- display: { xs: "none", lg: "block" }
15
- },
16
- clickable: {
17
- cursor: "pointer"
18
- }
6
+ const LOGO_WIDTH = 32;
7
+ const LOGO_HEIGHT = 32;
8
+ const LOGO_WIDTH_DENSE = 26;
9
+ const LOGO_HEIGHT_DENSE = 26;
10
+ const getStyles = (dense = false) => {
11
+ return {
12
+ container: {
13
+ display: "flex",
14
+ alignItems: "center"
15
+ },
16
+ logo: (_theme) => ({
17
+ flexShrink: 0,
18
+ width: dense ? LOGO_WIDTH_DENSE : LOGO_WIDTH,
19
+ height: dense ? LOGO_HEIGHT_DENSE : LOGO_HEIGHT,
20
+ display: "flex",
21
+ alignItems: "center",
22
+ justifyContent: "center"
23
+ }),
24
+ title: (theme) => ({
25
+ marginLeft: theme.spacing(dense ? 0.5 : 1),
26
+ display: { xs: "none", lg: "block" },
27
+ ...dense && {
28
+ fontSize: 18
29
+ }
30
+ }),
31
+ clickable: {
32
+ cursor: "pointer"
33
+ }
34
+ };
19
35
  };
20
- function LogoText({ appName, appColor, style, onClick }) {
21
- return /* @__PURE__ */ jsxs(Typography, { variant: "h4", sx: mergeSx(style, onClick && styles.clickable), onClick, children: [
36
+ function LogoText({ appName, appColor, style, onClick, dense = false }) {
37
+ const styles = useMemo(() => getStyles(dense), [dense]);
38
+ return /* @__PURE__ */ jsxs(Typography, { sx: mergeSx(style, onClick && styles.clickable), onClick, children: [
22
39
  /* @__PURE__ */ jsx("span", { style: { fontWeight: "bold" }, children: "Grid" }),
23
40
  /* @__PURE__ */ jsx("span", { style: { color: appColor }, children: appName })
24
41
  ] });
25
42
  }
26
- function GridLogo({ appLogo, appName, appColor, onClick }) {
27
- return /* @__PURE__ */ jsxs(Fragment, { children: [
28
- /* @__PURE__ */ jsx(Box, { sx: mergeSx(styles.logo, onClick && styles.clickable), onClick, children: appLogo || /* @__PURE__ */ jsx(BrokenImage, {}) }),
29
- /* @__PURE__ */ jsx(LogoText, { appName, appColor, onClick, style: styles.title })
43
+ function GridLogo({ appLogo, appName, appColor, onClick, dense = false }) {
44
+ const styles = useMemo(() => getStyles(dense), [dense]);
45
+ return /* @__PURE__ */ jsxs(Box, { sx: mergeSx(styles.container, onClick && styles.clickable), onClick, children: [
46
+ /* @__PURE__ */ jsx(Box, { sx: styles.logo, children: appLogo || /* @__PURE__ */ jsx(BrokenImage, {}) }),
47
+ /* @__PURE__ */ jsx(LogoText, { appName, appColor, style: styles.title, dense })
30
48
  ] });
31
49
  }
32
50
  export {
@@ -20,5 +20,6 @@ export type TopBarProps = Omit<GridLogoProps, 'onClick'> & Omit<LogoutProps, 'di
20
20
  language: GsLang;
21
21
  developerMode?: boolean;
22
22
  onDeveloperModeClick?: (value: boolean) => void;
23
+ dense?: boolean;
23
24
  };
24
- export declare function TopBar({ appName, appColor, appLogo, appVersion, appLicense, logoAboutDialog, onLogoutClick, onLogoClick, user, children, appsAndUrls, onAboutClick, globalVersionPromise, additionalModulesPromise, onThemeClick, theme, developerMode, onDeveloperModeClick, onEquipmentLabellingClick, equipmentLabelling, onLanguageClick, language, }: PropsWithChildren<TopBarProps>): import("react/jsx-runtime").JSX.Element;
25
+ export declare function TopBar({ appName, appColor, appLogo, appVersion, appLicense, logoAboutDialog, onLogoutClick, onLogoClick, user, children, appsAndUrls, onAboutClick, globalVersionPromise, additionalModulesPromise, onThemeClick, theme, developerMode, onDeveloperModeClick, onEquipmentLabellingClick, equipmentLabelling, onLanguageClick, language, dense, }: PropsWithChildren<TopBarProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { useState, useMemo } from "react";
2
+ import { useMemo, useState } from "react";
3
3
  import { FormattedMessage } from "react-intl";
4
- import { styled, Menu, MenuItem, ListItemIcon, AppBar, Toolbar, Box, IconButton, ListItemText, Button, darken, Popper, Paper, ClickAwayListener, MenuList, Typography, ToggleButtonGroup, ToggleButton } from "@mui/material";
4
+ import { styled, Menu, MenuItem, ListItemIcon, AppBar, Toolbar, Box, IconButton, ListItemText, Button, Popper, Paper, ClickAwayListener, MenuList, Typography, ToggleButtonGroup, ToggleButton, darken } from "@mui/material";
5
5
  import { Apps, ArrowDropUp, ArrowDropDown, Person, Badge, ManageAccounts, HelpOutline, WbSunny, Brightness3, Computer, ExitToApp } from "@mui/icons-material";
6
6
  import { GridLogo } from "./GridLogo.js";
7
7
  import { AboutDialog } from "./AboutDialog.js";
@@ -11,63 +11,77 @@ import UserSettingsDialog from "./UserSettingsDialog.js";
11
11
  import { LIGHT_THEME, DARK_THEME } from "../../utils/styles.js";
12
12
  import { LANG_SYSTEM, LANG_ENGLISH, LANG_FRENCH } from "../../utils/langs.js";
13
13
  import { DevModeBanner } from "./DevModeBanner.js";
14
- const styles = {
15
- grow: {
16
- flexGrow: 1,
17
- display: "flex",
18
- overflow: "hidden"
19
- },
20
- menuContainer: {
21
- marginLeft: 1
22
- },
23
- link: {
24
- textDecoration: "none",
25
- color: "inherit"
26
- },
27
- name: (theme) => ({
28
- backgroundColor: darken(theme.palette.background.paper, 0.1),
29
- paddingTop: "10px",
30
- borderRadius: "100%",
31
- fontWeight: "400",
32
- textTransform: "uppercase",
33
- height: "48px",
34
- width: "48px"
35
- }),
36
- arrowIcon: {
37
- fontSize: "40px"
38
- },
39
- userMail: {
40
- fontSize: "14px",
41
- display: "block"
42
- },
43
- borderBottom: {
44
- borderBottom: "1px solid #ccc"
45
- },
46
- settingsMenu: {
47
- maxWidth: "385px",
48
- zIndex: 60
49
- },
50
- sizeLabel: {
51
- fontSize: "16px"
52
- },
53
- showHideMenu: {
54
- padding: "0",
55
- borderRadius: "25px"
56
- },
57
- toggleButtonGroup: {
58
- marginLeft: "15px",
59
- pointerEvents: "auto"
60
- },
61
- toggleButton: {
62
- height: "30px",
63
- width: "48px",
64
- padding: "7px",
65
- textTransform: "capitalize"
66
- },
67
- languageToggleButton: {
68
- height: "30px",
69
- width: "48px"
70
- }
14
+ const getStyles = (dense = false) => {
15
+ return {
16
+ toolbar: (theme) => ({
17
+ ...dense && {
18
+ minHeight: `${theme.spacing(6)} !important`,
19
+ paddingLeft: `${theme.spacing(0.875)} !important`,
20
+ paddingRight: `${theme.spacing(0.875)} !important`
21
+ }
22
+ }),
23
+ grow: {
24
+ flexGrow: 1,
25
+ display: "flex",
26
+ overflow: "hidden"
27
+ },
28
+ menuContainer: (theme) => ({
29
+ marginLeft: theme.spacing(dense ? 0.5 : 1)
30
+ }),
31
+ link: {
32
+ textDecoration: "none",
33
+ color: "inherit"
34
+ },
35
+ name: (theme) => ({
36
+ backgroundColor: darken(theme.palette.background.paper, 0.1),
37
+ paddingTop: theme.spacing(dense ? 0.625 : 1.25),
38
+ borderRadius: "100%",
39
+ fontWeight: "400",
40
+ textTransform: "uppercase",
41
+ height: theme.spacing(dense ? 4.5 : 6),
42
+ width: theme.spacing(dense ? 4.5 : 6)
43
+ }),
44
+ arrowIcon: (theme) => ({
45
+ fontSize: theme.spacing(dense ? 4 : 5)
46
+ }),
47
+ userMail: {
48
+ fontSize: "14px",
49
+ display: "block"
50
+ },
51
+ borderBottom: {
52
+ borderBottom: "1px solid #ccc"
53
+ },
54
+ borderTop: {
55
+ borderTop: "1px solid #ccc"
56
+ },
57
+ settingsMenu: {
58
+ maxWidth: "385px",
59
+ zIndex: 60
60
+ },
61
+ sizeLabel: {
62
+ fontSize: "16px"
63
+ },
64
+ showHideMenu: (theme) => ({
65
+ padding: 0,
66
+ borderRadius: "50%",
67
+ minWidth: theme.spacing(dense ? 5 : 6.875),
68
+ minHeight: theme.spacing(dense ? 5 : 6.875)
69
+ }),
70
+ toggleButtonGroup: {
71
+ marginLeft: "15px",
72
+ pointerEvents: "auto"
73
+ },
74
+ toggleButton: {
75
+ height: "30px",
76
+ width: "48px",
77
+ padding: "7px",
78
+ textTransform: "capitalize"
79
+ },
80
+ languageToggleButton: {
81
+ height: "30px",
82
+ width: "48px"
83
+ }
84
+ };
71
85
  };
72
86
  const StyledMenu = styled((props) => /* @__PURE__ */ jsx(
73
87
  Menu,
@@ -130,8 +144,10 @@ function TopBar({
130
144
  onEquipmentLabellingClick,
131
145
  equipmentLabelling,
132
146
  onLanguageClick,
133
- language
147
+ language,
148
+ dense = false
134
149
  }) {
150
+ const styles = useMemo(() => getStyles(dense), [dense]);
135
151
  const [anchorElSettingsMenu, setAnchorElSettingsMenu] = useState(null);
136
152
  const [anchorElAppsMenu, setAnchorElAppsMenu] = useState(null);
137
153
  const {
@@ -196,15 +212,15 @@ function TopBar({
196
212
  openUserSettingsDialog();
197
213
  };
198
214
  const logoClickable = useMemo(
199
- () => /* @__PURE__ */ jsx(GridLogo, { onClick: onLogoClick, appLogo, appName, appColor }),
200
- [onLogoClick, appLogo, appName, appColor]
215
+ () => /* @__PURE__ */ jsx(GridLogo, { onClick: onLogoClick, appLogo, appName, appColor, dense }),
216
+ [onLogoClick, appLogo, appName, appColor, dense]
201
217
  );
202
218
  return /* @__PURE__ */ jsxs(AppBar, { position: "static", color: "default", children: [
203
219
  user && developerMode && /* @__PURE__ */ jsx(DevModeBanner, {}),
204
- /* @__PURE__ */ jsxs(Toolbar, { children: [
220
+ /* @__PURE__ */ jsxs(Toolbar, { variant: dense ? "dense" : "regular", sx: styles.toolbar, children: [
205
221
  logoClickable,
206
222
  /* @__PURE__ */ jsx(Box, { sx: styles.grow, children }),
207
- user && /* @__PURE__ */ jsxs(Box, { children: [
223
+ user && !dense && /* @__PURE__ */ jsxs(Box, { children: [
208
224
  /* @__PURE__ */ jsx(
209
225
  IconButton,
210
226
  {
@@ -273,7 +289,7 @@ function TopBar({
273
289
  "data-testid": "SettingsMenu",
274
290
  children: [
275
291
  /* @__PURE__ */ jsx(Box, { component: "span", sx: styles.name, children: user.profile.name !== void 0 ? abbreviationFromUserName(user.profile.name) : "" }),
276
- anchorElSettingsMenu ? /* @__PURE__ */ jsx(ArrowDropUp, { sx: styles.arrowIcon }) : /* @__PURE__ */ jsx(ArrowDropDown, { sx: styles.arrowIcon })
292
+ !dense && (anchorElSettingsMenu ? /* @__PURE__ */ jsx(ArrowDropUp, { sx: styles.arrowIcon }) : /* @__PURE__ */ jsx(ArrowDropDown, { sx: styles.arrowIcon }))
277
293
  ]
278
294
  }
279
295
  ),
package/dist/index.js CHANGED
@@ -21,6 +21,7 @@ import { useCsvExport } from "./components/csvDownloader/use-csv-export.js";
21
21
  import { CUSTOM_AGGRID_THEME, styles } from "./components/customAGGrid/customAggrid.style.js";
22
22
  import { CustomAGGrid } from "./components/customAGGrid/customAggrid.js";
23
23
  import { SeparatorCellRenderer } from "./components/customAGGrid/separatorCellRenderer.js";
24
+ import { BooleanCellRenderer, BooleanNullableCellRenderer, ContingencyCellRenderer, DefaultCellRenderer, ErrorCellRenderer, MessageLogCellRenderer, NetworkModificationNameCellRenderer, NumericCellRenderer } from "./components/customAGGrid/cell-renderers.js";
24
25
  import { CustomMuiDialog, unscrollableDialogStyles } from "./components/dialogs/customMuiDialog/CustomMuiDialog.js";
25
26
  import { DescriptionModificationDialog } from "./components/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
26
27
  import { ElementSaveDialog } from "./components/dialogs/elementSaveDialog/ElementSaveDialog.js";
@@ -173,6 +174,9 @@ import { SensitivityAnalysisParametersDialog } from "./components/parameters/sen
173
174
  import { COLUMNS_DEFINITIONS_HVDCS, COLUMNS_DEFINITIONS_INJECTIONS, COLUMNS_DEFINITIONS_INJECTIONS_SET, COLUMNS_DEFINITIONS_NODES, COLUMNS_DEFINITIONS_PSTS, EQUIPMENTS_IN_VOLTAGE_REGULATION_TYPES, HVDC_EQUIPMENT_TYPES, INJECTIONS_EQUIPMENT_TYPES, INJECTION_DISTRIBUTION_TYPES, MONITORED_BRANCHES_EQUIPMENT_TYPES, MONITORED_VOLTAGE_LEVELS_EQUIPMENT_TYPES, PSTS_EQUIPMENT_TYPES, SENSITIVITY_TYPES, SensiBranchesTabValues, SensiHvdcs, SensiInjection, SensiInjectionsSet, SensiNodes, SensiPsts, SensiTabValues } from "./components/parameters/sensi/columns-definitions.js";
174
175
  import { SensitivityTable } from "./components/parameters/sensi/sensitivity-table.js";
175
176
  import { CustomMenuItem, CustomNestedMenuItem } from "./components/menus/custom-nested-menu.js";
177
+ import { OverflowableTableCell } from "./components/muiTable/OverflowableTableCell.js";
178
+ import { OverflowableTableCellWithCheckbox } from "./components/muiTable/OverflowableTableCellWithCheckbox.js";
179
+ import { ResizeHandle } from "./components/resizablePanels/ResizeHandle.js";
176
180
  import { useStateBoolean } from "./hooks/customStates/useStateBoolean.js";
177
181
  import { useStateNumber } from "./hooks/customStates/useStateNumber.js";
178
182
  import { useModificationLabelComputer } from "./hooks/useModificationLabelComputer.js";
@@ -189,17 +193,18 @@ import { OptionalServicesStatus, useParametersBackend } from "./hooks/use-parame
189
193
  import { useCreateRowDataSensi } from "./hooks/use-create-row-data-sensi.js";
190
194
  import { LOGOUT_ERROR, RESET_AUTHENTICATION_ROUTER_ERROR, SHOW_AUTH_INFO_LOGIN, SIGNIN_CALLBACK_ERROR, UNAUTHORIZED_USER_INFO, USER, USER_VALIDATION_ERROR, resetAuthenticationRouterError, setLoggedUser, setLogoutError, setShowAuthenticationRouterLogin, setSignInCallbackError, setUnauthorizedUserInfo, setUserValidationError } from "./redux/actions/authActions.js";
191
195
  import { getUserToken, setCommonStore } from "./redux/commonStore.js";
192
- import { NetworkTimeoutError, backendFetch, backendFetchFile, backendFetchJson, backendFetchText, getRequestParamFromList } from "./services/utils.js";
193
- import { createFilter, createParameter, fetchElementsInfos, saveFilter, updateParameter } from "./services/explore.js";
194
196
  import { fetchAppsMetadata, fetchDefaultCountry, fetchEnv, fetchFavoriteAndDefaultCountries, fetchStudyMetadata, isStudyMetadata } from "./services/appsMetadata.js";
195
- import { elementAlreadyExists, fetchConfigParameter, fetchConfigParameters, fetchDirectoryContent, fetchDirectoryElementPath, fetchRootFolders, getAppName, updateConfigParameter } from "./services/directory.js";
197
+ import { fetchConfigParameter, fetchConfigParameters, getAppName, updateConfigParameter } from "./services/config.js";
198
+ import { PermissionType, elementAlreadyExists, fetchDirectoryContent, fetchDirectoryElementPath, fetchRootFolders, hasElementPermission } from "./services/directory.js";
199
+ import { createFilter, createParameter, fetchElementsInfos, saveFilter, updateParameter } from "./services/explore.js";
196
200
  import { PREFIX_STUDY_QUERIES, fetchLoadFlowParameters, getDefaultLoadFlowProvider, getLoadFlowDefaultLimitReductions, getLoadFlowProviders, getLoadFlowSpecificParametersDescription, getLoadFlowUrl, setLoadFlowParameters } from "./services/loadflow.js";
201
+ import { getPccMinStudyParameters, updatePccMinParameters } from "./services/pcc-min.js";
202
+ import { fetchDefaultSecurityAnalysisProvider, fetchSecurityAnalysisParameters, fetchSecurityAnalysisProviders, getSecurityAnalysisDefaultLimitReductions, getSecurityAnalysisParameters, getStudyUrl, safeEncodeURIComponent, setSecurityAnalysisParameters, updateSecurityAnalysisParameters, updateSecurityAnalysisProvider } from "./services/security-analysis.js";
197
203
  import { exportFilter, getAvailableComponentLibraries, getStudyNetworkVisualizationsParameters, getStudyShortCircuitParameters, invalidateStudyShortCircuitStatus, setStudyNetworkVisualizationParameters, setStudyShortCircuitParameters, updateVoltageInitParameters } from "./services/study.js";
198
204
  import { getNetworkVisualizationsParameters } from "./services/study-config.js";
199
205
  import { fetchCurrentAnnouncement, fetchUserDetails } from "./services/userAdmin.js";
206
+ import { NetworkTimeoutError, backendFetch, backendFetchFile, backendFetchJson, backendFetchText, getRequestParamFromList } from "./services/utils.js";
200
207
  import { getVoltageInitParameters, getVoltageInitUrl } from "./services/voltage-init.js";
201
- import { getPccMinStudyParameters, updatePccMinParameters } from "./services/pcc-min.js";
202
- import { fetchDefaultSecurityAnalysisProvider, fetchSecurityAnalysisParameters, fetchSecurityAnalysisProviders, getSecurityAnalysisDefaultLimitReductions, getSecurityAnalysisParameters, getStudyUrl, safeEncodeURIComponent, setSecurityAnalysisParameters, updateSecurityAnalysisParameters, updateSecurityAnalysisProvider } from "./services/security-analysis.js";
203
208
  import { equalsArray } from "./utils/algos.js";
204
209
  import { FetchStatus } from "./utils/constants/fetchStatus.js";
205
210
  import { FieldConstants } from "./utils/constants/fieldConstants.js";
@@ -306,7 +311,9 @@ export {
306
311
  BALANCE_TYPE,
307
312
  BASE_EQUIPMENTS,
308
313
  Battery,
314
+ BooleanCellRenderer,
309
315
  BooleanInput,
316
+ BooleanNullableCellRenderer,
310
317
  BottomRightButtons,
311
318
  BusBar,
312
319
  CENTER_LABEL,
@@ -334,6 +341,7 @@ export {
334
341
  CombinatorSelector,
335
342
  CombinatorType,
336
343
  ComputingType,
344
+ ContingencyCellRenderer,
337
345
  CountriesInput,
338
346
  CountryValueEditor,
339
347
  CreateParameterDialog,
@@ -368,6 +376,7 @@ export {
368
376
  DISTRIBUTION_KEY,
369
377
  DanglingLine,
370
378
  DataType,
379
+ DefaultCellRenderer,
371
380
  DescriptionField,
372
381
  DescriptionModificationDialog,
373
382
  DevModeBanner,
@@ -393,6 +402,7 @@ export {
393
402
  EquipmentItem,
394
403
  EquipmentType,
395
404
  EquipmentsSelectionType,
405
+ ErrorCellRenderer,
396
406
  ErrorInLogoutAlert,
397
407
  ErrorInUserValidationAlert,
398
408
  ErrorInput,
@@ -490,6 +500,7 @@ export {
490
500
  MODIFICATION_TYPES,
491
501
  MONITORED_BRANCHES_EQUIPMENT_TYPES,
492
502
  MONITORED_VOLTAGE_LEVELS_EQUIPMENT_TYPES,
503
+ MessageLogCellRenderer,
493
504
  MidFormError,
494
505
  ModificationType,
495
506
  ModifyElementSelection,
@@ -501,6 +512,7 @@ export {
501
512
  NAME,
502
513
  NO_ITEM_SELECTION_FOR_COPY,
503
514
  NadPositionsGenerationMode,
515
+ NetworkModificationNameCellRenderer,
504
516
  NetworkTimeoutError,
505
517
  NetworkVisualizationParametersInline,
506
518
  NetworkVisualizationTabValues,
@@ -508,6 +520,7 @@ export {
508
520
  NotificationsContext,
509
521
  NotificationsProvider,
510
522
  NotificationsUrlKeys,
523
+ NumericCellRenderer,
511
524
  NumericEditor,
512
525
  OHM,
513
526
  OPERATOR_OPTIONS,
@@ -516,6 +529,8 @@ export {
516
529
  OptionalServicesStatus,
517
530
  OverflowableChip,
518
531
  OverflowableChipWithHelperText,
532
+ OverflowableTableCell,
533
+ OverflowableTableCellWithCheckbox,
519
534
  OverflowableText,
520
535
  PARAM_CENTER_LABEL,
521
536
  PARAM_COMPONENT_LIBRARY,
@@ -555,6 +570,7 @@ export {
555
570
  ParameterSwitch,
556
571
  ParameterType,
557
572
  PccMinParametersInLine,
573
+ PermissionType,
558
574
  PhotoLibraryIcon,
559
575
  PopupConfirmationDialog,
560
576
  PredefinedParameters,
@@ -574,6 +590,7 @@ export {
574
590
  RawReadOnlyInput,
575
591
  ReactivePowerAdornment,
576
592
  RemoveButton,
593
+ ResizeHandle,
577
594
  RuleValueEditor,
578
595
  SEARCH_EQUIPMENTS,
579
596
  SELECTED,
@@ -786,6 +803,7 @@ export {
786
803
  gridItem,
787
804
  handleSigninCallback,
788
805
  handleSilentRenewCallback,
806
+ hasElementPermission,
789
807
  identity,
790
808
  importExpertRules,
791
809
  importParamsEn,
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright (c) 2024, 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 getAppName(appName: string, name: string): string;
8
+ export declare function updateConfigParameter(appName: string, name: string, value: string): Promise<Response>;
9
+ export declare function fetchConfigParameters(appName: string): Promise<any>;
10
+ export declare function fetchConfigParameter(appName: string, name: string): Promise<any>;