@gridsuite/commons-ui 0.267.0 → 0.268.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 (93) hide show
  1. package/dist/components/composite/grid/grid-section.d.ts +5 -2
  2. package/dist/components/composite/grid/grid-section.js +56 -4
  3. package/dist/components/ui/reactHookForm/booleans/BooleanInput.js +1 -1
  4. package/dist/features/common/index.d.ts +7 -0
  5. package/dist/features/common/index.js +4 -0
  6. package/dist/features/common/renderTable-ExportCsv.d.ts +18 -0
  7. package/dist/features/common/renderTable-ExportCsv.js +136 -0
  8. package/dist/features/index.d.ts +5 -0
  9. package/dist/features/index.js +43 -2
  10. package/dist/features/network-modifications/index.d.ts +1 -0
  11. package/dist/features/network-modifications/index.js +33 -1
  12. package/dist/features/network-modifications/static-var-compensator/common/constants.d.ts +20 -0
  13. package/dist/features/network-modifications/static-var-compensator/common/constants.js +9 -0
  14. package/dist/features/network-modifications/static-var-compensator/common/index.d.ts +13 -0
  15. package/dist/features/network-modifications/static-var-compensator/common/index.js +20 -0
  16. package/dist/features/network-modifications/static-var-compensator/common/set-points-limits-form-utils.d.ts +91 -0
  17. package/dist/features/network-modifications/static-var-compensator/common/set-points-limits-form-utils.js +166 -0
  18. package/dist/features/network-modifications/static-var-compensator/common/set-points-limits-form.d.ts +8 -0
  19. package/dist/features/network-modifications/static-var-compensator/common/set-points-limits-form.js +200 -0
  20. package/dist/features/network-modifications/static-var-compensator/common/standby-automaton-form-utils.d.ts +66 -0
  21. package/dist/features/network-modifications/static-var-compensator/common/standby-automaton-form-utils.js +149 -0
  22. package/dist/features/network-modifications/static-var-compensator/common/standby-automaton-form.d.ts +7 -0
  23. package/dist/features/network-modifications/static-var-compensator/common/standby-automaton-form.js +153 -0
  24. package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-header.d.ts +7 -0
  25. package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-header.js +72 -0
  26. package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-tabs.d.ts +7 -0
  27. package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-tabs.js +44 -0
  28. package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-tab-utils.d.ts +8 -0
  29. package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-tab-utils.js +34 -0
  30. package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-tabs-content.d.ts +9 -0
  31. package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-tabs-content.js +100 -0
  32. package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator.types.d.ts +68 -0
  33. package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator.types.js +1 -0
  34. package/dist/features/network-modifications/static-var-compensator/common/susceptance-area.d.ts +7 -0
  35. package/dist/features/network-modifications/static-var-compensator/common/susceptance-area.js +161 -0
  36. package/dist/features/network-modifications/static-var-compensator/creation/index.d.ts +9 -0
  37. package/dist/features/network-modifications/static-var-compensator/creation/index.js +9 -0
  38. package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-form.d.ts +8 -0
  39. package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-form.js +105 -0
  40. package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-utils.d.ts +114 -0
  41. package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-utils.js +189 -0
  42. package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation.types.d.ts +34 -0
  43. package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation.types.js +1 -0
  44. package/dist/features/network-modifications/static-var-compensator/index.d.ts +8 -0
  45. package/dist/features/network-modifications/static-var-compensator/index.js +27 -0
  46. package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation-form.d.ts +8 -0
  47. package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation-form.js +153 -0
  48. package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation-utils.d.ts +20 -0
  49. package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation-utils.js +40 -0
  50. package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation.types.d.ts +11 -0
  51. package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation.types.js +1 -0
  52. package/dist/features/network-modifications/voltageLevel/coupling-device/index.d.ts +3 -0
  53. package/dist/features/network-modifications/voltageLevel/coupling-device/index.js +9 -0
  54. package/dist/features/network-modifications/voltageLevel/creation/index.js +1 -1
  55. package/dist/features/network-modifications/voltageLevel/index.d.ts +1 -0
  56. package/dist/features/network-modifications/voltageLevel/index.js +8 -1
  57. package/dist/features/network-modifications/voltageLevel/topology/CreateVoltageLevelTopologyForm.js +12 -2
  58. package/dist/features/network-modifications/voltageLevel/topology/voltageLevelTopologyCreation.types.d.ts +1 -1
  59. package/dist/features/network-modifications/voltageLevel/topology/voltageLevelTopologyCreation.utils.d.ts +3 -3
  60. package/dist/features/results/constants.d.ts +7 -0
  61. package/dist/features/results/constants.js +4 -0
  62. package/dist/features/results/hooks/index.d.ts +7 -0
  63. package/dist/features/results/hooks/index.js +4 -0
  64. package/dist/features/results/hooks/useIntlResultStatusMessages.d.ts +19 -0
  65. package/dist/features/results/hooks/useIntlResultStatusMessages.js +23 -0
  66. package/dist/features/results/loadflow/index.d.ts +8 -0
  67. package/dist/features/results/loadflow/index.js +4 -0
  68. package/dist/features/results/loadflow/limit-violation-result.d.ts +2 -0
  69. package/dist/features/results/loadflow/limit-violation-result.js +134 -0
  70. package/dist/features/results/loadflow/load-flow-result.type.d.ts +29 -0
  71. package/dist/features/results/loadflow/load-flow-result.type.js +1 -0
  72. package/dist/features/results/securityanalysis/index.js +1 -2
  73. package/dist/features/results/securityanalysis/security-analysis-result-nmk.js +2 -1
  74. package/dist/features/results/securityanalysis/utils.d.ts +0 -2
  75. package/dist/features/results/securityanalysis/utils.js +0 -22
  76. package/dist/features/results/utils/index.d.ts +7 -0
  77. package/dist/features/results/utils/index.js +4 -0
  78. package/dist/features/results/utils/no-rows-message.d.ts +2 -0
  79. package/dist/features/results/utils/no-rows-message.js +24 -0
  80. package/dist/hooks/index.d.ts +1 -0
  81. package/dist/hooks/index.js +2 -0
  82. package/dist/hooks/useOpenLoaderShortWait.d.ts +18 -0
  83. package/dist/hooks/useOpenLoaderShortWait.js +19 -0
  84. package/dist/index.js +46 -1
  85. package/dist/translations/en/networkModificationsEn.d.ts +28 -0
  86. package/dist/translations/en/networkModificationsEn.js +30 -1
  87. package/dist/translations/fr/networkModificationsFr.d.ts +28 -0
  88. package/dist/translations/fr/networkModificationsFr.js +30 -1
  89. package/dist/utils/constants/fieldConstants.d.ts +19 -1
  90. package/dist/utils/constants/fieldConstants.js +18 -0
  91. package/dist/utils/index.d.ts +1 -0
  92. package/dist/utils/index.js +2 -0
  93. package/package.json +1 -1
@@ -0,0 +1,7 @@
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 RESULTS_LOADING_DELAY = 500;
@@ -0,0 +1,4 @@
1
+ const RESULTS_LOADING_DELAY = 500;
2
+ export {
3
+ RESULTS_LOADING_DELAY
4
+ };
@@ -0,0 +1,7 @@
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 * from './useIntlResultStatusMessages';
@@ -0,0 +1,4 @@
1
+ import { useIntlResultStatusMessages } from "./useIntlResultStatusMessages.js";
2
+ export {
3
+ useIntlResultStatusMessages
4
+ };
@@ -0,0 +1,19 @@
1
+ import { IntlShape } from 'react-intl';
2
+ export declare const useIntlResultStatusMessages: (intl: IntlShape, hasNoData?: boolean, hasFilters?: boolean) => {
3
+ running: string;
4
+ failed: string;
5
+ fetching: string;
6
+ noData: string;
7
+ noCalculation: string;
8
+ } | {
9
+ running: string;
10
+ failed: string;
11
+ fetching: string;
12
+ noLimitViolation: string;
13
+ noCalculation: string;
14
+ } | {
15
+ running: string;
16
+ failed: string;
17
+ fetching: string;
18
+ noCalculation: string;
19
+ };
@@ -0,0 +1,23 @@
1
+ import { useCallback, useMemo } from "react";
2
+ const useIntlResultStatusMessages = (intl, hasNoData = false, hasFilters = false) => {
3
+ const specificMessage = useCallback(() => {
4
+ if (hasNoData) {
5
+ return {
6
+ noData: intl.formatMessage({ id: !hasFilters ? "grid.noRowsToShow" : "grid.noMatchedFilters" })
7
+ };
8
+ }
9
+ return { noLimitViolation: intl.formatMessage({ id: "grid.noLimitViolation" }) };
10
+ }, [intl, hasNoData, hasFilters]);
11
+ return useMemo(() => {
12
+ return {
13
+ noCalculation: intl.formatMessage({ id: "grid.noCalculation" }),
14
+ ...specificMessage(),
15
+ running: intl.formatMessage({ id: "grid.running" }),
16
+ failed: intl.formatMessage({ id: "grid.failed" }),
17
+ fetching: intl.formatMessage({ id: "LoadingRemoteData" })
18
+ };
19
+ }, [intl, specificMessage]);
20
+ };
21
+ export {
22
+ useIntlResultStatusMessages
23
+ };
@@ -0,0 +1,8 @@
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 * from './limit-violation-result';
8
+ export * from './load-flow-result.type';
@@ -0,0 +1,4 @@
1
+ import { LimitViolationResult } from "./limit-violation-result.js";
2
+ export {
3
+ LimitViolationResult
4
+ };
@@ -0,0 +1,2 @@
1
+ import { LimitViolationResultProps } from './load-flow-result.type';
2
+ export declare function LimitViolationResult({ result, isLoadingResult, columnDefs, tableName, computationStatus, exportCsvResetKey, language, onGridReady, }: LimitViolationResultProps): import("react").JSX.Element;
@@ -0,0 +1,134 @@
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { useRef, useMemo, useCallback } from "react";
3
+ import { useIntl } from "react-intl";
4
+ import { useTheme, Box, LinearProgress } from "@mui/material";
5
+ import { RunningStatus } from "../../../utils/running-status.js";
6
+ import "../../../utils/conversionUtils.js";
7
+ import "../../../utils/types/equipmentType.js";
8
+ import { getRows } from "../../../utils/functions.js";
9
+ import "@mui/icons-material";
10
+ import "localized-countries";
11
+ import "localized-countries/data/fr";
12
+ import "localized-countries/data/en";
13
+ import "notistack";
14
+ import { useOpenLoaderShortWait } from "../../../hooks/useOpenLoaderShortWait.js";
15
+ import { RESULTS_LOADING_DELAY } from "../constants.js";
16
+ import "../../../components/ui/overflowableText/OverflowableText.js";
17
+ import "react-hook-form";
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 "mui-nested-menu";
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 { DefaultCellRenderer } from "../../../components/composite/customAGGrid/cell-renderers.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 { getNoRowsMessage } from "../utils/no-rows-message.js";
65
+ import { useIntlResultStatusMessages } from "../hooks/useIntlResultStatusMessages.js";
66
+ import { RenderTableAndExportCsv } from "../../common/renderTable-ExportCsv.js";
67
+ function LimitViolationResult({
68
+ result,
69
+ isLoadingResult,
70
+ columnDefs,
71
+ tableName,
72
+ computationStatus,
73
+ exportCsvResetKey,
74
+ language,
75
+ onGridReady
76
+ }) {
77
+ const theme = useTheme();
78
+ const intl = useIntl();
79
+ const gridRef = useRef(null);
80
+ const openLoaderTab = useOpenLoaderShortWait({
81
+ isLoading: computationStatus === RunningStatus.RUNNING || isLoadingResult,
82
+ delay: RESULTS_LOADING_DELAY
83
+ });
84
+ const defaultColDef = useMemo(
85
+ () => ({
86
+ filter: true,
87
+ sortable: true,
88
+ resizable: true,
89
+ lockPinned: true,
90
+ suppressMovable: true,
91
+ wrapHeaderText: true,
92
+ autoHeaderHeight: true,
93
+ flex: 1,
94
+ cellRenderer: DefaultCellRenderer
95
+ }),
96
+ []
97
+ );
98
+ const getRowStyle = useCallback(
99
+ (params) => {
100
+ if (params?.data?.elementId) {
101
+ return {
102
+ backgroundColor: theme.selectedRow.background
103
+ };
104
+ }
105
+ return void 0;
106
+ },
107
+ [theme.selectedRow.background]
108
+ );
109
+ const messages = useIntlResultStatusMessages(intl);
110
+ const overlayNoRowsTemplate = getNoRowsMessage(messages, result, computationStatus, !isLoadingResult);
111
+ const rowsToShow = getRows(result, computationStatus);
112
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
113
+ /* @__PURE__ */ jsx(Box, { sx: { height: "12px", marginTop: "12px" }, children: openLoaderTab && /* @__PURE__ */ jsx(LinearProgress, {}) }),
114
+ /* @__PURE__ */ jsx(
115
+ RenderTableAndExportCsv,
116
+ {
117
+ gridRef,
118
+ columns: columnDefs,
119
+ defaultColDef,
120
+ tableName,
121
+ rows: rowsToShow,
122
+ getRowStyle,
123
+ overlayNoRowsTemplate,
124
+ skipColumnHeaders: false,
125
+ exportCsvResetKey,
126
+ onGridReady,
127
+ language
128
+ }
129
+ )
130
+ ] });
131
+ }
132
+ export {
133
+ LimitViolationResult
134
+ };
@@ -0,0 +1,29 @@
1
+ import { Key } from 'react';
2
+ import { ColDef } from 'ag-grid-community';
3
+ import { GsLangUser } from '../../../utils';
4
+ export interface LimitViolationResultProps {
5
+ result: OverloadedEquipment[] | undefined;
6
+ columnDefs: ColDef<any>[];
7
+ isLoadingResult: boolean;
8
+ tableName: string;
9
+ computationStatus: string;
10
+ computationSubType: string;
11
+ exportCsvResetKey: Key;
12
+ language: GsLangUser;
13
+ onGridReady?: (params: any) => void;
14
+ }
15
+ export interface OverloadedEquipment {
16
+ overload: number;
17
+ patlOverload: number;
18
+ subjectId: string;
19
+ locationId: string;
20
+ value: number;
21
+ actualOverloadDuration: number | null;
22
+ upComingOverloadDuration: number | null;
23
+ limit: number;
24
+ patlLimit: number;
25
+ limitName: string | null | undefined;
26
+ nextLimitName: string | null | undefined;
27
+ side: string | undefined;
28
+ limitType: string;
29
+ }
@@ -1,7 +1,7 @@
1
1
  import { SecurityAnalysisResultNmk } from "./security-analysis-result-nmk.js";
2
2
  import { SecurityAnalysisTable } from "./security-analysis-table.js";
3
3
  import { NmkType } from "./security-analysis.type.js";
4
- import { PAGE_OPTIONS, flattenNmKResultsConstraints, flattenNmKResultsContingencies, getNoRowsMessage, handlePostSortRows, mapNmKResultsCutOffPower } from "./utils.js";
4
+ import { PAGE_OPTIONS, flattenNmKResultsConstraints, flattenNmKResultsContingencies, handlePostSortRows, mapNmKResultsCutOffPower } from "./utils.js";
5
5
  export {
6
6
  NmkType,
7
7
  PAGE_OPTIONS,
@@ -9,7 +9,6 @@ export {
9
9
  SecurityAnalysisTable,
10
10
  flattenNmKResultsConstraints,
11
11
  flattenNmKResultsContingencies,
12
- getNoRowsMessage,
13
12
  handlePostSortRows,
14
13
  mapNmKResultsCutOffPower
15
14
  };
@@ -60,7 +60,8 @@ import "../../../components/composite/report/report-viewer/log-table/log-table.j
60
60
  import "react-window";
61
61
  import "../../../components/composite/report/report-treeview/treeview-item.js";
62
62
  import "../../../components/composite/report/report-viewer/context/report-viewer-context.js";
63
- import { mapNmKResultsCutOffPower, flattenNmKResultsConstraints, flattenNmKResultsContingencies, handlePostSortRows, getNoRowsMessage, PAGE_OPTIONS } from "./utils.js";
63
+ import { mapNmKResultsCutOffPower, flattenNmKResultsConstraints, flattenNmKResultsContingencies, handlePostSortRows, PAGE_OPTIONS } from "./utils.js";
64
+ import { getNoRowsMessage } from "../utils/no-rows-message.js";
64
65
  const styles = {
65
66
  container: {
66
67
  display: "flex",
@@ -1,8 +1,6 @@
1
1
  import { IntlShape } from 'react-intl';
2
2
  import { PostSortRowsParams } from 'ag-grid-community';
3
3
  import { ConstraintsFromContingencyItem, ContingenciesFromConstraintItem, CutOffPowerFromConstraintsItem, SecurityAnalysisNmkTableRow } from './security-analysis.type';
4
- import { RunningStatusMessage } from '../../../utils/running-status';
5
- export declare function getNoRowsMessage(messages: RunningStatusMessage, rows: any[] | undefined, status: string, isDataReady?: boolean): string | undefined;
6
4
  export declare const PAGE_OPTIONS: number[];
7
5
  export declare const flattenNmKResultsContingencies: (intl: IntlShape, result: ConstraintsFromContingencyItem[] | null) => SecurityAnalysisNmkTableRow[] | undefined;
8
6
  export declare const flattenNmKResultsConstraints: (intl: IntlShape, result: ContingenciesFromConstraintItem[] | null) => SecurityAnalysisNmkTableRow[] | undefined;
@@ -1,24 +1,3 @@
1
- import { RunningStatus } from "../../../utils/running-status.js";
2
- function getNoRowsMessage(messages, rows, status, isDataReady) {
3
- switch (status) {
4
- case RunningStatus.IDLE:
5
- return messages.noCalculation;
6
- case RunningStatus.RUNNING:
7
- return messages.running;
8
- case RunningStatus.FAILED:
9
- return messages.failed;
10
- case RunningStatus.SUCCEED:
11
- if (!isDataReady || !rows) {
12
- return messages.fetching;
13
- }
14
- if (rows?.length === 0) {
15
- return messages.noData ? messages.noData : messages.noLimitViolation;
16
- }
17
- return void 0;
18
- default:
19
- return messages.noCalculation;
20
- }
21
- }
22
1
  const PAGE_OPTIONS = [25, 100, 500, 1e3];
23
2
  const MAX_INT32 = 2147483647;
24
3
  const PERMANENT_LIMIT_NAME = "permanent";
@@ -142,7 +121,6 @@ export {
142
121
  PAGE_OPTIONS,
143
122
  flattenNmKResultsConstraints,
144
123
  flattenNmKResultsContingencies,
145
- getNoRowsMessage,
146
124
  handlePostSortRows,
147
125
  mapNmKResultsCutOffPower
148
126
  };
@@ -0,0 +1,7 @@
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 * from './no-rows-message';
@@ -0,0 +1,4 @@
1
+ import { getNoRowsMessage } from "./no-rows-message.js";
2
+ export {
3
+ getNoRowsMessage
4
+ };
@@ -0,0 +1,2 @@
1
+ import { RunningStatusMessage } from '../../../utils/running-status';
2
+ export declare function getNoRowsMessage(messages: RunningStatusMessage, rows: any[] | undefined, status: string, isDataReady?: boolean): string | undefined;
@@ -0,0 +1,24 @@
1
+ import { RunningStatus } from "../../../utils/running-status.js";
2
+ function getNoRowsMessage(messages, rows, status, isDataReady) {
3
+ switch (status) {
4
+ case RunningStatus.IDLE:
5
+ return messages.noCalculation;
6
+ case RunningStatus.RUNNING:
7
+ return messages.running;
8
+ case RunningStatus.FAILED:
9
+ return messages.failed;
10
+ case RunningStatus.SUCCEED:
11
+ if (!isDataReady || !rows) {
12
+ return messages.fetching;
13
+ }
14
+ if (rows?.length === 0) {
15
+ return messages.noData ? messages.noData : messages.noLimitViolation;
16
+ }
17
+ return void 0;
18
+ default:
19
+ return messages.noCalculation;
20
+ }
21
+ }
22
+ export {
23
+ getNoRowsMessage
24
+ };
@@ -17,3 +17,4 @@ export * from './useFormatLabelWithUnit';
17
17
  export * from './useSelectAppearance';
18
18
  export * from './use-parameters-backend';
19
19
  export * from './useGetLabelEquipmentTypes';
20
+ export * from './useOpenLoaderShortWait';
@@ -12,6 +12,7 @@ import { useFormatLabelWithUnit } from "./useFormatLabelWithUnit.js";
12
12
  import { useSelectAppearance } from "./useSelectAppearance.js";
13
13
  import { OptionalServicesStatus, useParametersBackend } from "./use-parameters-backend.js";
14
14
  import { useGetLabelEquipmentTypes } from "./useGetLabelEquipmentTypes.js";
15
+ import { useOpenLoaderShortWait } from "./useOpenLoaderShortWait.js";
15
16
  export {
16
17
  OptionalServicesStatus,
17
18
  getComputedLanguage,
@@ -23,6 +24,7 @@ export {
23
24
  useIntlRef,
24
25
  useLocalizedCountries,
25
26
  useModificationLabelComputer,
27
+ useOpenLoaderShortWait,
26
28
  useParametersBackend,
27
29
  usePredefinedProperties,
28
30
  usePrevious,
@@ -0,0 +1,18 @@
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
+ /**
8
+ * A hook that returns a boolean indicating whether a loader should be displayed after a short delay.
9
+ *
10
+ * @param {boolean} isLoading - Whether the loading is active.
11
+ * @param {number} delay - The delay before displaying the loader, in milliseconds.
12
+ *
13
+ * @returns {boolean} A boolean indicating whether the loader should be displayed.
14
+ */
15
+ export declare const useOpenLoaderShortWait: ({ isLoading, delay }: {
16
+ isLoading: boolean;
17
+ delay: number;
18
+ }) => boolean;
@@ -0,0 +1,19 @@
1
+ import { useState, useEffect } from "react";
2
+ const useOpenLoaderShortWait = ({ isLoading, delay }) => {
3
+ const [shouldOpen, setShouldOpen] = useState(false);
4
+ useEffect(() => {
5
+ let timeout;
6
+ if (!isLoading) {
7
+ setShouldOpen(false);
8
+ } else {
9
+ timeout = setTimeout(() => {
10
+ setShouldOpen(true);
11
+ }, delay);
12
+ }
13
+ return () => clearTimeout(timeout);
14
+ }, [delay, isLoading]);
15
+ return shouldOpen;
16
+ };
17
+ export {
18
+ useOpenLoaderShortWait
19
+ };
package/dist/index.js CHANGED
@@ -285,6 +285,8 @@ import { SubstationCreationForm } from "./features/network-modifications/substat
285
285
  import { substationCreationDtoToForm, substationCreationEmptyFormData, substationCreationFormSchema, substationCreationFormToDto } from "./features/network-modifications/substation/creation/substationCreation.utils.js";
286
286
  import { SubstationModificationForm } from "./features/network-modifications/substation/modification/SubstationModificationForm.js";
287
287
  import { substationModificationDtoToForm, substationModificationEmptyFormData, substationModificationFormSchema, substationModificationFormToDto } from "./features/network-modifications/substation/modification/substationModification.utils.js";
288
+ import { CouplingDeviceCreationForm } from "./features/network-modifications/voltageLevel/coupling-device/coupling-device-creation-form.js";
289
+ import { couplingDeviceCreationDtoToForm, couplingDeviceCreationFormSchema, couplingDeviceCreationFormToDto, emptyCouplingDeviceCreationFormData } from "./features/network-modifications/voltageLevel/coupling-device/coupling-device-creation-utils.js";
288
290
  import { SwitchesBetweenSections } from "./features/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/SwitchesBetweenSections.js";
289
291
  import "react/jsx-runtime";
290
292
  import "@mui/material";
@@ -330,6 +332,7 @@ import { ComputingType } from "./utils/types/computing-type.js";
330
332
  import { areIdsEqual, getIdOrSelf, getIdOrValue, getLabelOrValue, getObjectId, isNonEmptyStringOrArray, notNull, notUndefined, parseIntData, removeNullFields, richTypeEquals, sanitizeString } from "./utils/ts-utils.js";
331
333
  import { toNumber, validateValueIsANumber } from "./utils/validation-functions.js";
332
334
  import { NO_ITEM_SELECTION_FOR_COPY } from "./utils/directory-utils.js";
335
+ import { RunningStatus } from "./utils/running-status.js";
333
336
  import { fetchAppsMetadata, fetchBaseVoltages, fetchDefaultCountry, fetchEnv, fetchFavoriteAndDefaultCountries, fetchStudyMetadata, isExploreMetadata, isStudyMetadata } from "./services/appsMetadata.js";
334
337
  import { fetchConfigParameter, fetchConfigParameters, getAppName, updateConfigParameter } from "./services/config.js";
335
338
  import { PermissionType, elementAlreadyExists, fetchDirectoryContent, fetchDirectoryElementPath, fetchElementNames, fetchRootFolders, hasElementPermission } from "./services/directory.js";
@@ -409,6 +412,14 @@ import { LineDialogHeader } from "./features/network-modifications/line/common/L
409
412
  import { LineForm } from "./features/network-modifications/line/common/LineForm.js";
410
413
  import { lineCreationDtoToForm, lineCreationEmptyFormData, lineCreationFormSchema, lineCreationFormToDto } from "./features/network-modifications/line/creation/lineCreation.utils.js";
411
414
  import { lineModificationDtoToForm, lineModificationEmptyFormData, lineModificationFormSchema, lineModificationFormToDto } from "./features/network-modifications/line/modification/lineModification.utils.js";
415
+ import { StaticVarCompensatorDialogHeader } from "./features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-header.js";
416
+ import { StaticVarCompensatorDialogTabs } from "./features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-tabs.js";
417
+ import { STATIC_VAR_COMPENSATOR_TAB_FIELDS, StaticVarCompensatorDialogTab } from "./features/network-modifications/static-var-compensator/common/static-var-compensator-tab-utils.js";
418
+ import { VOLTAGE_REGULATION_MODES } from "./features/network-modifications/static-var-compensator/common/constants.js";
419
+ import { getReactiveFormData, getReactiveFormEmptyFormData, getReactiveFormValidationSchema } from "./features/network-modifications/static-var-compensator/common/set-points-limits-form-utils.js";
420
+ import { computeQ0, getStandbyAutomatonEmptyFormData, getStandbyAutomatonFormData, getStandbyAutomatonFormValidationSchema } from "./features/network-modifications/static-var-compensator/common/standby-automaton-form-utils.js";
421
+ import { StaticVarCompensatorCreationForm } from "./features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-form.js";
422
+ import { staticVarCompensatorCreationEmptyFormData, staticVarCompensatorCreationFormSchema, staticVarCompensatorCreationFormToDto, staticVarCompensatorDtoToForm } from "./features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-utils.js";
412
423
  import { BuildStatusChip } from "./features/node/build-status-chip.js";
413
424
  import { BuildStatus } from "./features/node/constant.js";
414
425
  import { COLUMNS_WITHOUT_BORDER, DEPTH_CELL_WIDTH, DROP_FORBIDDEN_INDICATOR_BOTTOM, DROP_FORBIDDEN_INDICATOR_TOP, DROP_INDICATOR_BOTTOM, DROP_INDICATOR_TOP, MODIFICATION_ROW_HEIGHT, createCellBorderColor, createCellContentWrapperSx, createCellStyle, createEditDescriptionStyle, createHeaderCellStyle, createModificationNameCellStyle, createNameCellLabelBoxSx, createNameCellRootStyle, createRootNetworkChipCellSx, createRowSx, networkModificationTableStyles } from "./features/network-modification-table/network-modification-table-styles.js";
@@ -434,7 +445,10 @@ import { useGlobalAnnouncement } from "./features/announcement/useGlobalAnnounce
434
445
  import { SecurityAnalysisResultNmk } from "./features/results/securityanalysis/security-analysis-result-nmk.js";
435
446
  import { SecurityAnalysisTable } from "./features/results/securityanalysis/security-analysis-table.js";
436
447
  import { NmkType } from "./features/results/securityanalysis/security-analysis.type.js";
437
- import { PAGE_OPTIONS, flattenNmKResultsConstraints, flattenNmKResultsContingencies, getNoRowsMessage, handlePostSortRows, mapNmKResultsCutOffPower } from "./features/results/securityanalysis/utils.js";
448
+ import { PAGE_OPTIONS, flattenNmKResultsConstraints, flattenNmKResultsContingencies, handlePostSortRows, mapNmKResultsCutOffPower } from "./features/results/securityanalysis/utils.js";
449
+ import { LimitViolationResult } from "./features/results/loadflow/limit-violation-result.js";
450
+ import { getNoRowsMessage } from "./features/results/utils/no-rows-message.js";
451
+ import { RESULTS_LOADING_DELAY } from "./features/results/constants.js";
438
452
  import { ProcessType } from "./features/process-configs/common/process-config.type.js";
439
453
  import { emptyProcessConfigModificationsFormData, getProcessConfigModificationsBackendFromFormData, getProcessConfigModificationsFormData, processConfigModificationsShape } from "./features/process-configs/common/process-config-modifications-edition.utils.js";
440
454
  import { ProcessConfigModificationsEdition } from "./features/process-configs/common/process-config-modifications-edition.js";
@@ -450,6 +464,8 @@ import { MAX_RECENT_GLOBAL_FILTERS, addSelectedGlobalFiltersToTableState, clearS
450
464
  import { syncGlobalFilters } from "./features/global-filter/utils/global-filter-sync.utils.js";
451
465
  import { RECENT_FILTER, addGlobalFilterId, getGlobalFilterId, getOptionLabel } from "./features/global-filter/utils/global-filter-utils.js";
452
466
  import { GlobalFilterContextProvider } from "./features/global-filter/context/global-filter-context-provider.js";
467
+ import { RenderTableAndExportCsv } from "./features/common/renderTable-ExportCsv.js";
468
+ import { useIntlResultStatusMessages } from "./features/results/hooks/useIntlResultStatusMessages.js";
453
469
  import { useStateBoolean } from "./hooks/customStates/useStateBoolean.js";
454
470
  import { useStateNumber } from "./hooks/customStates/useStateNumber.js";
455
471
  import { useModificationLabelComputer } from "./hooks/useModificationLabelComputer.js";
@@ -464,6 +480,7 @@ import { useFormatLabelWithUnit } from "./hooks/useFormatLabelWithUnit.js";
464
480
  import { useSelectAppearance } from "./hooks/useSelectAppearance.js";
465
481
  import { OptionalServicesStatus, useParametersBackend } from "./hooks/use-parameters-backend.js";
466
482
  import { useGetLabelEquipmentTypes } from "./hooks/useGetLabelEquipmentTypes.js";
483
+ import { useOpenLoaderShortWait } from "./hooks/useOpenLoaderShortWait.js";
467
484
  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";
468
485
  import { getUser, getUserToken, setCommonStore, subscribeToUserState } from "./redux/commonStore.js";
469
486
  import { cardErrorBoundaryEn } from "./translations/en/cardErrorBoundaryEn.js";
@@ -630,6 +647,7 @@ export {
630
647
  CountriesInput,
631
648
  CountrySelectionInput,
632
649
  CountryValueEditor,
650
+ CouplingDeviceCreationForm,
633
651
  CreateParameterDialog,
634
652
  CreateVoltageLevelTopologyForm,
635
653
  CsvDownloadButton,
@@ -845,6 +863,7 @@ export {
845
863
  LimitReductionTableRow,
846
864
  LimitReductionsTableForm,
847
865
  LimitTypes,
866
+ LimitViolationResult,
848
867
  LimitsChart,
849
868
  LimitsEditor,
850
869
  LimitsGroupsContextualMenu,
@@ -1028,6 +1047,7 @@ export {
1028
1047
  REMOVE,
1029
1048
  REPORT_SEVERITY,
1030
1049
  RESET_AUTHENTICATION_ROUTER_ERROR,
1050
+ RESULTS_LOADING_DELAY,
1031
1051
  RULES,
1032
1052
  RadioInput,
1033
1053
  RangeInput,
@@ -1042,6 +1062,7 @@ export {
1042
1062
  ReferenceType,
1043
1063
  RegulatingTerminalForm,
1044
1064
  RemoveButton,
1065
+ RenderTableAndExportCsv,
1045
1066
  ReportFetcherContext,
1046
1067
  ReportFilterContext,
1047
1068
  ReportType,
@@ -1051,6 +1072,7 @@ export {
1051
1072
  RootNetworkChipCell,
1052
1073
  RootNetworkHeaderRenderer,
1053
1074
  RuleValueEditor,
1075
+ RunningStatus,
1054
1076
  SAProcessConfigEditionDialog,
1055
1077
  SCENARIO_DURATION,
1056
1078
  SEARCH_EQUIPMENTS,
@@ -1085,6 +1107,7 @@ export {
1085
1107
  STARTED_GENERATORS_IN_CALCULATION_CLUSTER_THRESHOLD,
1086
1108
  STARTED_GENERATORS_OUTSIDE_CALCULATION_CLUSTER_THRESHOLD,
1087
1109
  START_TIME,
1110
+ STATIC_VAR_COMPENSATOR_TAB_FIELDS,
1088
1111
  STOP_TIME,
1089
1112
  SUBSTATION_LAYOUT,
1090
1113
  SVAR_REGULATION_MODE_OPTIONS,
@@ -1125,6 +1148,10 @@ export {
1125
1148
  SnackbarProvider,
1126
1149
  SolverType,
1127
1150
  SortWay,
1151
+ StaticVarCompensatorCreationForm,
1152
+ StaticVarCompensatorDialogHeader,
1153
+ StaticVarCompensatorDialogTab,
1154
+ StaticVarCompensatorDialogTabs,
1128
1155
  SubmitButton,
1129
1156
  Substation,
1130
1157
  SubstationCreationForm,
@@ -1180,6 +1207,7 @@ export {
1180
1207
  VOLTAGE_LEVELS_FORM,
1181
1208
  VOLTAGE_LIMITS_DEFAULT,
1182
1209
  VOLTAGE_LIMITS_MODIFICATION,
1210
+ VOLTAGE_REGULATION_MODES,
1183
1211
  VSC,
1184
1212
  ValueEditor,
1185
1213
  ValueSelector,
@@ -1238,6 +1266,7 @@ export {
1238
1266
  commonButtonFr,
1239
1267
  componentsEn,
1240
1268
  componentsFr,
1269
+ computeQ0,
1241
1270
  computeSwitchedOnValue,
1242
1271
  computeTagMinSize,
1243
1272
  computeTolerance,
@@ -1250,6 +1279,9 @@ export {
1250
1279
  copyEquipmentPropertiesForCreation,
1251
1280
  copyToClipboard,
1252
1281
  countRules,
1282
+ couplingDeviceCreationDtoToForm,
1283
+ couplingDeviceCreationFormSchema,
1284
+ couplingDeviceCreationFormToDto,
1253
1285
  createCellBorderColor,
1254
1286
  createCellContentWrapperSx,
1255
1287
  createCellStyle,
@@ -1284,6 +1316,7 @@ export {
1284
1316
  elementEditionStyles,
1285
1317
  elementSearchEn,
1286
1318
  elementSearchFr,
1319
+ emptyCouplingDeviceCreationFormData,
1287
1320
  emptyFormData,
1288
1321
  emptyLineSegment,
1289
1322
  emptyModificationByAssignmentFormData,
@@ -1489,6 +1522,9 @@ export {
1489
1522
  getRangeInputSchema,
1490
1523
  getReactiveCapabilityCurveValidationSchema,
1491
1524
  getReactiveCapabilityCurveValidationSchemaArray,
1525
+ getReactiveFormData,
1526
+ getReactiveFormEmptyFormData,
1527
+ getReactiveFormValidationSchema,
1492
1528
  getReactiveLimitsEmptyFormData,
1493
1529
  getReactiveLimitsEmptyFormDataProps,
1494
1530
  getReactiveLimitsFormData,
@@ -1514,6 +1550,9 @@ export {
1514
1550
  getShortCircuitFormData,
1515
1551
  getShortCircuitFormSchema,
1516
1552
  getShortCircuitSpecificParametersDescription,
1553
+ getStandbyAutomatonEmptyFormData,
1554
+ getStandbyAutomatonFormData,
1555
+ getStandbyAutomatonFormValidationSchema,
1517
1556
  getStudyNetworkVisualizationsParameters,
1518
1557
  getStudyShortCircuitParameters,
1519
1558
  getStudyUrl,
@@ -1675,6 +1714,10 @@ export {
1675
1714
  snackWithFallback,
1676
1715
  sortSeverityList,
1677
1716
  standardTextField,
1717
+ staticVarCompensatorCreationEmptyFormData,
1718
+ staticVarCompensatorCreationFormSchema,
1719
+ staticVarCompensatorCreationFormToDto,
1720
+ staticVarCompensatorDtoToForm,
1678
1721
  styles,
1679
1722
  subscribeToUserState,
1680
1723
  substationCreationDtoToForm,
@@ -1740,11 +1783,13 @@ export {
1740
1783
  useGlobalAnnouncement,
1741
1784
  useHvdcLccDeletion,
1742
1785
  useIntlRef,
1786
+ useIntlResultStatusMessages,
1743
1787
  useListenerManager,
1744
1788
  useLocalizedCountries,
1745
1789
  useModificationLabelComputer,
1746
1790
  useModificationsDragAndDrop,
1747
1791
  useNotificationsListener,
1792
+ useOpenLoaderShortWait,
1748
1793
  useParameterLayoutContext,
1749
1794
  useParametersBackend,
1750
1795
  useParametersForm,