@gridsuite/commons-ui 0.267.0 → 0.269.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 (109) hide show
  1. package/dist/components/composite/agGridTable/BottomTableButtons.js +1 -1
  2. package/dist/components/composite/grid/grid-section.d.ts +5 -2
  3. package/dist/components/composite/grid/grid-section.js +56 -4
  4. package/dist/components/ui/reactHookForm/DirectoryItemsInput.js +1 -1
  5. package/dist/components/ui/reactHookForm/booleans/BooleanInput.js +1 -1
  6. package/dist/features/common/index.d.ts +7 -0
  7. package/dist/features/common/index.js +4 -0
  8. package/dist/features/common/renderTable-ExportCsv.d.ts +18 -0
  9. package/dist/features/common/renderTable-ExportCsv.js +136 -0
  10. package/dist/features/index.d.ts +5 -0
  11. package/dist/features/index.js +43 -2
  12. package/dist/features/network-modifications/index.d.ts +1 -0
  13. package/dist/features/network-modifications/index.js +33 -1
  14. package/dist/features/network-modifications/static-var-compensator/common/constants.d.ts +20 -0
  15. package/dist/features/network-modifications/static-var-compensator/common/constants.js +9 -0
  16. package/dist/features/network-modifications/static-var-compensator/common/index.d.ts +13 -0
  17. package/dist/features/network-modifications/static-var-compensator/common/index.js +20 -0
  18. package/dist/features/network-modifications/static-var-compensator/common/set-points-limits-form-utils.d.ts +91 -0
  19. package/dist/features/network-modifications/static-var-compensator/common/set-points-limits-form-utils.js +166 -0
  20. package/dist/features/network-modifications/static-var-compensator/common/set-points-limits-form.d.ts +8 -0
  21. package/dist/features/network-modifications/static-var-compensator/common/set-points-limits-form.js +200 -0
  22. package/dist/features/network-modifications/static-var-compensator/common/standby-automaton-form-utils.d.ts +66 -0
  23. package/dist/features/network-modifications/static-var-compensator/common/standby-automaton-form-utils.js +149 -0
  24. package/dist/features/network-modifications/static-var-compensator/common/standby-automaton-form.d.ts +7 -0
  25. package/dist/features/network-modifications/static-var-compensator/common/standby-automaton-form.js +153 -0
  26. package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-header.d.ts +7 -0
  27. package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-header.js +72 -0
  28. package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-tabs.d.ts +7 -0
  29. package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-tabs.js +44 -0
  30. package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-tab-utils.d.ts +8 -0
  31. package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-tab-utils.js +34 -0
  32. package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-tabs-content.d.ts +9 -0
  33. package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-tabs-content.js +100 -0
  34. package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator.types.d.ts +68 -0
  35. package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator.types.js +1 -0
  36. package/dist/features/network-modifications/static-var-compensator/common/susceptance-area.d.ts +7 -0
  37. package/dist/features/network-modifications/static-var-compensator/common/susceptance-area.js +161 -0
  38. package/dist/features/network-modifications/static-var-compensator/creation/index.d.ts +9 -0
  39. package/dist/features/network-modifications/static-var-compensator/creation/index.js +9 -0
  40. package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-form.d.ts +8 -0
  41. package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-form.js +105 -0
  42. package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-utils.d.ts +114 -0
  43. package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-utils.js +189 -0
  44. package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation.types.d.ts +34 -0
  45. package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation.types.js +1 -0
  46. package/dist/features/network-modifications/static-var-compensator/index.d.ts +8 -0
  47. package/dist/features/network-modifications/static-var-compensator/index.js +27 -0
  48. package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation-form.d.ts +8 -0
  49. package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation-form.js +153 -0
  50. package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation-utils.d.ts +20 -0
  51. package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation-utils.js +40 -0
  52. package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation.types.d.ts +11 -0
  53. package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation.types.js +1 -0
  54. package/dist/features/network-modifications/voltageLevel/coupling-device/index.d.ts +3 -0
  55. package/dist/features/network-modifications/voltageLevel/coupling-device/index.js +9 -0
  56. package/dist/features/network-modifications/voltageLevel/creation/index.js +1 -1
  57. package/dist/features/network-modifications/voltageLevel/index.d.ts +1 -0
  58. package/dist/features/network-modifications/voltageLevel/index.js +8 -1
  59. package/dist/features/network-modifications/voltageLevel/topology/CreateVoltageLevelTopologyForm.js +12 -2
  60. package/dist/features/network-modifications/voltageLevel/topology/voltageLevelTopologyCreation.types.d.ts +1 -1
  61. package/dist/features/network-modifications/voltageLevel/topology/voltageLevelTopologyCreation.utils.d.ts +3 -3
  62. package/dist/features/parameters/loadflow/load-flow-provider-specific-parameters.js +10 -1
  63. package/dist/features/results/constants.d.ts +7 -0
  64. package/dist/features/results/constants.js +4 -0
  65. package/dist/features/results/hooks/index.d.ts +7 -0
  66. package/dist/features/results/hooks/index.js +4 -0
  67. package/dist/features/results/hooks/useIntlResultStatusMessages.d.ts +19 -0
  68. package/dist/features/results/hooks/useIntlResultStatusMessages.js +23 -0
  69. package/dist/features/results/loadflow/index.d.ts +8 -0
  70. package/dist/features/results/loadflow/index.js +4 -0
  71. package/dist/features/results/loadflow/limit-violation-result.d.ts +2 -0
  72. package/dist/features/results/loadflow/limit-violation-result.js +134 -0
  73. package/dist/features/results/loadflow/load-flow-result.type.d.ts +29 -0
  74. package/dist/features/results/loadflow/load-flow-result.type.js +1 -0
  75. package/dist/features/results/securityanalysis/index.js +1 -2
  76. package/dist/features/results/securityanalysis/security-analysis-result-nmk.js +2 -1
  77. package/dist/features/results/securityanalysis/utils.d.ts +0 -2
  78. package/dist/features/results/securityanalysis/utils.js +0 -22
  79. package/dist/features/results/utils/index.d.ts +7 -0
  80. package/dist/features/results/utils/index.js +4 -0
  81. package/dist/features/results/utils/no-rows-message.d.ts +2 -0
  82. package/dist/features/results/utils/no-rows-message.js +24 -0
  83. package/dist/features/topBar/TopBar.js +2 -2
  84. package/dist/hooks/index.d.ts +1 -0
  85. package/dist/hooks/index.js +2 -0
  86. package/dist/hooks/useOpenLoaderShortWait.d.ts +18 -0
  87. package/dist/hooks/useOpenLoaderShortWait.js +19 -0
  88. package/dist/index.js +50 -1
  89. package/dist/translations/en/businessErrorsEn.d.ts +14 -0
  90. package/dist/translations/en/businessErrorsEn.js +15 -1
  91. package/dist/translations/en/index.d.ts +1 -0
  92. package/dist/translations/en/index.js +2 -0
  93. package/dist/translations/en/networkModificationsEn.d.ts +28 -0
  94. package/dist/translations/en/networkModificationsEn.js +30 -1
  95. package/dist/translations/en/specificParameters.d.ts +96 -0
  96. package/dist/translations/en/specificParameters.js +95 -0
  97. package/dist/translations/fr/businessErrorsFr.d.ts +14 -0
  98. package/dist/translations/fr/businessErrorsFr.js +15 -1
  99. package/dist/translations/fr/index.d.ts +1 -0
  100. package/dist/translations/fr/index.js +2 -0
  101. package/dist/translations/fr/networkModificationsFr.d.ts +28 -0
  102. package/dist/translations/fr/networkModificationsFr.js +30 -1
  103. package/dist/translations/fr/specificParameters.d.ts +96 -0
  104. package/dist/translations/fr/specificParameters.js +95 -0
  105. package/dist/utils/constants/fieldConstants.d.ts +19 -1
  106. package/dist/utils/constants/fieldConstants.js +18 -0
  107. package/dist/utils/index.d.ts +1 -0
  108. package/dist/utils/index.js +2 -0
  109. package/package.json +1 -1
@@ -37,7 +37,16 @@ import "../common/contingency-table/contingency-table.js";
37
37
  import "../common/contingency-table/columns-definitions.js";
38
38
  import "@hookform/resolvers/yup";
39
39
  function LoadFlowProviderSpecificParameters({ specificParameters }) {
40
- return /* @__PURE__ */ jsx(Fragment, { children: specificParameters?.map((item) => /* @__PURE__ */ createElement(ParameterField, { id: SPECIFIC_PARAMETERS, ...item, key: item.name })) });
40
+ return /* @__PURE__ */ jsx(Fragment, { children: specificParameters?.map((item) => /* @__PURE__ */ createElement(
41
+ ParameterField,
42
+ {
43
+ id: SPECIFIC_PARAMETERS,
44
+ ...item,
45
+ label: item.name,
46
+ description: `${item.description} (${item.name})`,
47
+ key: item.name
48
+ }
49
+ )) });
41
50
  }
42
51
  const LoadFlowProviderSpecificParameters$1 = memo(LoadFlowProviderSpecificParameters);
43
52
  export {
@@ -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
+ };
@@ -381,7 +381,7 @@ function TopBar({
381
381
  value: LIGHT_THEME,
382
382
  "aria-label": LIGHT_THEME,
383
383
  sx: styles.toggleButton,
384
- children: /* @__PURE__ */ jsx(WbSunny, { fontSize: "small" })
384
+ children: /* @__PURE__ */ jsx(WbSunny, { fontSize: "small", "data-testid": "WbSunnyIcon" })
385
385
  }
386
386
  ),
387
387
  /* @__PURE__ */ jsx(
@@ -390,7 +390,7 @@ function TopBar({
390
390
  value: DARK_THEME,
391
391
  "aria-label": DARK_THEME,
392
392
  sx: styles.toggleButton,
393
- children: /* @__PURE__ */ jsx(Brightness3, { fontSize: "small" })
393
+ children: /* @__PURE__ */ jsx(Brightness3, { fontSize: "small", "data-testid": "Brightness3Icon" })
394
394
  }
395
395
  )
396
396
  ]
@@ -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
+ };