@gridsuite/commons-ui 0.95.0 → 0.97.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/README.md CHANGED
@@ -30,7 +30,8 @@ To fix this, run this command from the app **after** running "npm install"
30
30
  #### For integrators
31
31
 
32
32
  If you want to deploy a new version of commons-ui in the [NPM package registry](https://www.npmjs.com/package/@gridsuite/commons-ui),
33
- you need to follow the steps below:
33
+ first you need **some permissions**. You need to be a member of the *gridsuite* organization and a member of the *'developers'* team.
34
+ Only in this case, you need to follow the steps below:
34
35
 
35
36
  - [Make a release action](https://github.com/gridsuite/commons-ui/actions/workflows/release.yml)
36
37
  - In the 'run workflow' combobox select, let the branch on main
@@ -38,6 +39,8 @@ you need to follow the steps below:
38
39
  - Enter your NPM access token (it must be an **automation** access token to bypass 2FA, see the [access token documentation](https://docs.npmjs.com/creating-and-viewing-access-tokens) for details)
39
40
  - Click 'run workflow'
40
41
 
42
+ Otherwise ask someone who has the permission.
43
+
41
44
  #### License Headers and dependencies checking
42
45
 
43
46
  To check dependencies license compatibility with this project one locally, please run the following command :
@@ -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 declare function LeftPanelCloseIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import LeftPanelClose from "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
3
+ import { useTheme } from "@mui/material";
4
+ function LeftPanelCloseIcon() {
5
+ const theme = useTheme();
6
+ return /* @__PURE__ */ jsx(
7
+ LeftPanelClose,
8
+ {
9
+ style: {
10
+ width: 24,
11
+ height: 24,
12
+ fill: theme.palette.text.primary
13
+ }
14
+ }
15
+ );
16
+ }
17
+ export {
18
+ LeftPanelCloseIcon
19
+ };
@@ -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 declare function LeftPanelOpenIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import LeftPanelOpen from "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
3
+ import { useTheme } from "@mui/material";
4
+ function LeftPanelOpenIcon() {
5
+ const theme = useTheme();
6
+ return /* @__PURE__ */ jsx(
7
+ LeftPanelOpen,
8
+ {
9
+ style: {
10
+ width: 24,
11
+ height: 24,
12
+ fill: theme.palette.text.primary
13
+ }
14
+ }
15
+ );
16
+ }
17
+ export {
18
+ LeftPanelOpenIcon
19
+ };
@@ -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 { LeftPanelOpenIcon } from './LeftPanelOpenIcon';
8
+ export { LeftPanelCloseIcon } from './LeftPanelCloseIcon';
@@ -0,0 +1,6 @@
1
+ import { LeftPanelOpenIcon } from "./LeftPanelOpenIcon.js";
2
+ import { LeftPanelCloseIcon } from "./LeftPanelCloseIcon.js";
3
+ export {
4
+ LeftPanelCloseIcon,
5
+ LeftPanelOpenIcon
6
+ };
@@ -20,3 +20,5 @@ export * from './snackbarProvider';
20
20
  export * from './topBar';
21
21
  export * from './treeViewFinder';
22
22
  export * from './notifications';
23
+ export * from './icons';
24
+ export * from './menus';
@@ -105,6 +105,9 @@ import { NotificationsProvider } from "./notifications/NotificationsProvider.js"
105
105
  import { NotificationsContext } from "./notifications/contexts/NotificationsContext.js";
106
106
  import { useNotificationsListener } from "./notifications/hooks/useNotificationsListener.js";
107
107
  import { useListenerManager } from "./notifications/hooks/useListenerManager.js";
108
+ import { LeftPanelOpenIcon } from "./icons/LeftPanelOpenIcon.js";
109
+ import { LeftPanelCloseIcon } from "./icons/LeftPanelCloseIcon.js";
110
+ import { CustomMenuItem, CustomNestedMenuItem } from "./menus/custom-nested-menu.js";
108
111
  export {
109
112
  AboutDialog,
110
113
  ActivableChip,
@@ -133,7 +136,9 @@ export {
133
136
  CustomAgGridTable,
134
137
  CustomFormContext,
135
138
  CustomFormProvider,
139
+ CustomMenuItem,
136
140
  CustomMuiDialog,
141
+ CustomNestedMenuItem,
137
142
  CustomReactQueryBuilder,
138
143
  DEFAULT_RANGE_VALUE,
139
144
  DISTRIBUTION_KEY,
@@ -175,6 +180,8 @@ export {
175
180
  InputWithPopupConfirmation,
176
181
  IntegerInput,
177
182
  LOAD_TYPE_OPTIONS,
183
+ LeftPanelCloseIcon,
184
+ LeftPanelOpenIcon,
178
185
  Login,
179
186
  LogoText,
180
187
  Logout,
@@ -0,0 +1,9 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { NestedMenuItemProps } from 'mui-nested-menu';
3
+ import { MenuItemProps, SxProps, Theme } from '@mui/material';
4
+ interface CustomNestedMenuItemProps extends PropsWithChildren, Omit<NestedMenuItemProps, 'parentMenuOpen'> {
5
+ sx?: SxProps<Theme>;
6
+ }
7
+ export declare function CustomNestedMenuItem({ sx, children, ...other }: Readonly<CustomNestedMenuItemProps>): import("react/jsx-runtime").JSX.Element;
8
+ export declare function CustomMenuItem({ sx, ...other }: Readonly<MenuItemProps>): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,42 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { NestedMenuItem } from "mui-nested-menu";
4
+ import { Box, MenuItem } from "@mui/material";
5
+ import "../../utils/conversionUtils.js";
6
+ import "@mui/icons-material";
7
+ import { mergeSx } from "../../utils/styles.js";
8
+ import "../../utils/types/equipmentType.js";
9
+ import "../../utils/yupConfig.js";
10
+ const styles = {
11
+ highlightedParentLine: {
12
+ backgroundColor: "action.hover",
13
+ color: "primary.main",
14
+ transition: "all 300ms ease"
15
+ },
16
+ highlightedLine: {
17
+ transition: "all 300ms ease",
18
+ "&:hover": {
19
+ backgroundColor: "action.hover",
20
+ color: "primary.main"
21
+ }
22
+ }
23
+ };
24
+ function CustomNestedMenuItem({ sx, children, ...other }) {
25
+ const [subMenuActive, setSubMenuActive] = useState(false);
26
+ return /* @__PURE__ */ jsx(
27
+ NestedMenuItem,
28
+ {
29
+ ...other,
30
+ parentMenuOpen: true,
31
+ sx: mergeSx(subMenuActive ? styles.highlightedParentLine : styles.highlightedLine, sx),
32
+ children: /* @__PURE__ */ jsx(Box, { onMouseEnter: () => setSubMenuActive(true), onMouseLeave: () => setSubMenuActive(false), children })
33
+ }
34
+ );
35
+ }
36
+ function CustomMenuItem({ sx, ...other }) {
37
+ return /* @__PURE__ */ jsx(MenuItem, { sx: mergeSx(styles.highlightedLine, sx), ...other });
38
+ }
39
+ export {
40
+ CustomMenuItem,
41
+ CustomNestedMenuItem
42
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright (c) 2021, 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 './custom-nested-menu';
@@ -0,0 +1,5 @@
1
+ import { CustomMenuItem, CustomNestedMenuItem } from "./custom-nested-menu.js";
2
+ export {
3
+ CustomMenuItem,
4
+ CustomNestedMenuItem
5
+ };
package/dist/index.js CHANGED
@@ -106,6 +106,9 @@ import { NotificationsProvider } from "./components/notifications/NotificationsP
106
106
  import { NotificationsContext } from "./components/notifications/contexts/NotificationsContext.js";
107
107
  import { useNotificationsListener } from "./components/notifications/hooks/useNotificationsListener.js";
108
108
  import { useListenerManager } from "./components/notifications/hooks/useListenerManager.js";
109
+ import { LeftPanelOpenIcon } from "./components/icons/LeftPanelOpenIcon.js";
110
+ import { LeftPanelCloseIcon } from "./components/icons/LeftPanelCloseIcon.js";
111
+ import { CustomMenuItem, CustomNestedMenuItem } from "./components/menus/custom-nested-menu.js";
109
112
  import { useStateBoolean } from "./hooks/customStates/useStateBoolean.js";
110
113
  import { useStateNumber } from "./hooks/customStates/useStateNumber.js";
111
114
  import { useModificationLabelComputer } from "./hooks/useModificationLabelComputer.js";
@@ -219,7 +222,9 @@ export {
219
222
  CustomAgGridTable,
220
223
  CustomFormContext,
221
224
  CustomFormProvider,
225
+ CustomMenuItem,
222
226
  CustomMuiDialog,
227
+ CustomNestedMenuItem,
223
228
  CustomReactQueryBuilder,
224
229
  DARK_THEME,
225
230
  DEFAULT_RANGE_VALUE,
@@ -284,6 +289,8 @@ export {
284
289
  LIGHT_THEME,
285
290
  LOAD_TYPE_OPTIONS,
286
291
  LOGOUT_ERROR,
292
+ LeftPanelCloseIcon,
293
+ LeftPanelOpenIcon,
287
294
  Line,
288
295
  Load,
289
296
  Login,
@@ -58,6 +58,8 @@ export declare const networkModificationsEn: {
58
58
  'network_modifications.TABULAR_CREATION': string;
59
59
  'network_modifications.tabular.GENERATOR_CREATION': string;
60
60
  'network_modifications.LCC_CREATION': string;
61
+ 'network_modifications.LCC_MODIFICATION': string;
61
62
  'network_modifications.STATIC_VAR_COMPENSATOR_CREATION': string;
62
63
  'network_modifications.VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION': string;
64
+ 'network_modifications.VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION': string;
63
65
  };
@@ -52,8 +52,10 @@ const networkModificationsEn = {
52
52
  "network_modifications.TABULAR_CREATION": "Tabular creation - {computedLabel}",
53
53
  "network_modifications.tabular.GENERATOR_CREATION": "generator creations",
54
54
  "network_modifications.LCC_CREATION": "Creating HVDC (LCC) {computedLabel}",
55
+ "network_modifications.LCC_MODIFICATION": "Modifying HVDC (LCC) {computedLabel}",
55
56
  "network_modifications.STATIC_VAR_COMPENSATOR_CREATION": "Creating static var compensator {computedLabel}",
56
- "network_modifications.VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION": "Creating voltage level {voltageLevelEquipmentId} and substation {substationEquipmentId}"
57
+ "network_modifications.VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION": "Creating voltage level {voltageLevelEquipmentId} and substation {substationEquipmentId}",
58
+ "network_modifications.VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION": "Modifying voltage level topology {computedLabel}"
57
59
  };
58
60
  export {
59
61
  networkModificationsEn
@@ -58,6 +58,8 @@ export declare const networkModificationsFr: {
58
58
  'network_modifications.TABULAR_CREATION': string;
59
59
  'network_modifications.tabular.GENERATOR_CREATION': string;
60
60
  'network_modifications.LCC_CREATION': string;
61
+ 'network_modifications.LCC_MODIFICATION': string;
61
62
  'network_modifications.STATIC_VAR_COMPENSATOR_CREATION': string;
62
63
  'network_modifications.VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION': string;
64
+ 'network_modifications.VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION': string;
63
65
  };
@@ -52,8 +52,10 @@ const networkModificationsFr = {
52
52
  "network_modifications.TABULAR_CREATION": "Création tabulaire - {computedLabel}",
53
53
  "network_modifications.tabular.GENERATOR_CREATION": "créations de générateurs",
54
54
  "network_modifications.LCC_CREATION": "Création de la HVDC (LCC) {computedLabel}",
55
+ "network_modifications.LCC_MODIFICATION": "Modification de la HVDC (LCC) {computedLabel}",
55
56
  "network_modifications.STATIC_VAR_COMPENSATOR_CREATION": "Création de CSPR {computedLabel}",
56
- "network_modifications.VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION": "Création du poste {voltageLevelEquipmentId} et du site {substationEquipmentId}"
57
+ "network_modifications.VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION": "Création du poste {voltageLevelEquipmentId} et du site {substationEquipmentId}",
58
+ "network_modifications.VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION": "Modification de la topologie du poste {computedLabel}"
57
59
  };
58
60
  export {
59
61
  networkModificationsFr
@@ -46,7 +46,10 @@ export declare enum ModificationType {
46
46
  CONVERTER_STATION_MODIFICATION = "CONVERTER_STATION_MODIFICATION",
47
47
  COMPOSITE_MODIFICATION = "COMPOSITE_MODIFICATION",
48
48
  LCC_CONVERTER_STATION_CREATION = "LCC_CONVERTER_STATION_CREATION",
49
- LCC_CREATION = "LCC_CREATION"
49
+ LCC_CONVERTER_STATION_MODIFICATION = "LCC_CONVERTER_STATION_MODIFICATION",
50
+ LCC_CREATION = "LCC_CREATION",
51
+ LCC_MODIFICATION = "LCC_MODIFICATION",
52
+ VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION = "VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION"
50
53
  }
51
54
  export declare const MODIFICATION_TYPES: {
52
55
  GROOVY_SCRIPT: {
@@ -172,10 +175,19 @@ export declare const MODIFICATION_TYPES: {
172
175
  LCC_CONVERTER_STATION_CREATION: {
173
176
  type: ModificationType;
174
177
  };
178
+ LCC_CONVERTER_STATION_MODIFICATION: {
179
+ type: ModificationType;
180
+ };
175
181
  LCC_CREATION: {
176
182
  type: ModificationType;
177
183
  };
184
+ LCC_MODIFICATION: {
185
+ type: ModificationType;
186
+ };
178
187
  VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION: {
179
188
  type: string;
180
189
  };
190
+ VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION: {
191
+ type: ModificationType;
192
+ };
181
193
  };
@@ -40,7 +40,10 @@ var ModificationType = /* @__PURE__ */ ((ModificationType2) => {
40
40
  ModificationType2["CONVERTER_STATION_MODIFICATION"] = "CONVERTER_STATION_MODIFICATION";
41
41
  ModificationType2["COMPOSITE_MODIFICATION"] = "COMPOSITE_MODIFICATION";
42
42
  ModificationType2["LCC_CONVERTER_STATION_CREATION"] = "LCC_CONVERTER_STATION_CREATION";
43
+ ModificationType2["LCC_CONVERTER_STATION_MODIFICATION"] = "LCC_CONVERTER_STATION_MODIFICATION";
43
44
  ModificationType2["LCC_CREATION"] = "LCC_CREATION";
45
+ ModificationType2["LCC_MODIFICATION"] = "LCC_MODIFICATION";
46
+ ModificationType2["VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION"] = "VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION";
44
47
  return ModificationType2;
45
48
  })(ModificationType || {});
46
49
  const MODIFICATION_TYPES = {
@@ -207,12 +210,24 @@ const MODIFICATION_TYPES = {
207
210
  type: "LCC_CONVERTER_STATION_CREATION"
208
211
  /* LCC_CONVERTER_STATION_CREATION */
209
212
  },
213
+ LCC_CONVERTER_STATION_MODIFICATION: {
214
+ type: "LCC_CONVERTER_STATION_MODIFICATION"
215
+ /* LCC_CONVERTER_STATION_MODIFICATION */
216
+ },
210
217
  LCC_CREATION: {
211
218
  type: "LCC_CREATION"
212
219
  /* LCC_CREATION */
213
220
  },
221
+ LCC_MODIFICATION: {
222
+ type: "LCC_MODIFICATION"
223
+ /* LCC_MODIFICATION */
224
+ },
214
225
  VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION: {
215
226
  type: "VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION"
227
+ },
228
+ VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION: {
229
+ type: "VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION"
230
+ /* VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION */
216
231
  }
217
232
  };
218
233
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.95.0",
3
+ "version": "0.97.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "author": "gridsuite team",
6
6
  "homepage": "https://github.com/gridsuite",
@@ -36,10 +36,12 @@
36
36
  "dependencies": {
37
37
  "@ag-grid-community/locale": "^33.1.0",
38
38
  "@hello-pangea/dnd": "^18.0.1",
39
+ "@material-symbols/svg-400": "^0.31.2",
39
40
  "@react-querybuilder/dnd": "^8.2.0",
40
41
  "@react-querybuilder/material": "^8.2.0",
41
42
  "autosuggest-highlight": "^3.3.4",
42
43
  "clsx": "^2.1.1",
44
+ "mui-nested-menu": "^4.0.0",
43
45
  "jwt-decode": "^4.0.0",
44
46
  "localized-countries": "^2.0.0",
45
47
  "oidc-client": "^1.11.5",