@gridsuite/commons-ui 0.178.0 → 0.180.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.js +79 -1
- package/dist/components/inputs/index.js +2 -0
- package/dist/components/inputs/reactHookForm/CheckboxNullableInput.d.ts +15 -0
- package/dist/components/inputs/reactHookForm/CheckboxNullableInput.js +75 -0
- package/dist/components/inputs/reactHookForm/index.d.ts +1 -0
- package/dist/components/inputs/reactHookForm/index.js +2 -0
- package/dist/components/network-modifications/common/connectivity/BranchConnectivityForm.d.ts +7 -0
- package/dist/components/network-modifications/common/connectivity/BranchConnectivityForm.js +63 -0
- package/dist/components/network-modifications/common/connectivity/ConnectivityForm.d.ts +37 -0
- package/dist/components/network-modifications/common/connectivity/ConnectivityForm.js +267 -0
- package/dist/components/network-modifications/common/connectivity/connectivity.type.d.ts +34 -0
- package/dist/components/network-modifications/common/connectivity/connectivity.type.js +1 -0
- package/dist/components/network-modifications/common/connectivity/connectivityForm.utils.d.ts +241 -0
- package/dist/components/network-modifications/common/connectivity/connectivityForm.utils.js +196 -0
- package/dist/components/network-modifications/common/connectivity/index.d.ts +10 -0
- package/dist/components/network-modifications/common/connectivity/index.js +25 -0
- package/dist/components/network-modifications/common/index.d.ts +4 -1
- package/dist/components/network-modifications/common/index.js +56 -1
- package/dist/components/network-modifications/common/measurements/BranchActiveReactivePowerMeasurementsForm.d.ts +2 -0
- package/dist/components/network-modifications/common/measurements/BranchActiveReactivePowerMeasurementsForm.js +37 -0
- package/dist/components/network-modifications/common/measurements/PowerMeasurementsForm.d.ts +9 -0
- package/dist/components/network-modifications/common/measurements/PowerMeasurementsForm.js +52 -0
- package/dist/components/network-modifications/common/measurements/PowerWithValidityForm.d.ts +2 -0
- package/dist/components/network-modifications/common/measurements/PowerWithValidityForm.js +74 -0
- package/dist/components/network-modifications/common/measurements/branchActiveReactivePowerForm.utils.d.ts +56 -0
- package/dist/components/network-modifications/common/measurements/branchActiveReactivePowerForm.utils.js +69 -0
- package/dist/components/network-modifications/common/measurements/index.d.ts +13 -0
- package/dist/components/network-modifications/common/measurements/index.js +26 -0
- package/dist/components/network-modifications/common/measurements/injectionActiveReactivePowerForm.utils.d.ts +58 -0
- package/dist/components/network-modifications/common/measurements/injectionActiveReactivePowerForm.utils.js +55 -0
- package/dist/components/network-modifications/common/measurements/measurement.type.d.ts +13 -0
- package/dist/components/network-modifications/common/measurements/measurement.type.js +1 -0
- package/dist/components/network-modifications/common/measurements/powerWithValidity.utils.d.ts +22 -0
- package/dist/components/network-modifications/common/measurements/powerWithValidity.utils.js +36 -0
- package/dist/components/network-modifications/common/setpoints/SetPointsForm.d.ts +15 -0
- package/dist/components/network-modifications/common/setpoints/SetPointsForm.js +71 -0
- package/dist/components/network-modifications/common/setpoints/index.d.ts +8 -0
- package/dist/components/network-modifications/common/setpoints/index.js +10 -0
- package/dist/components/network-modifications/common/setpoints/setPoints.utils.d.ts +16 -0
- package/dist/components/network-modifications/common/setpoints/setPoints.utils.js +62 -0
- package/dist/components/network-modifications/index.d.ts +1 -0
- package/dist/components/network-modifications/index.js +71 -1
- package/dist/components/network-modifications/load/common/LoadDialogHeader.d.ts +7 -0
- package/dist/components/network-modifications/load/common/LoadDialogHeader.js +103 -0
- package/dist/components/network-modifications/load/common/LoadDialogTabs.d.ts +14 -0
- package/dist/components/network-modifications/load/common/LoadDialogTabs.js +49 -0
- package/dist/components/network-modifications/load/common/LoadDialogTabsContent.d.ts +8 -0
- package/dist/components/network-modifications/load/common/LoadDialogTabsContent.js +61 -0
- package/dist/components/network-modifications/load/common/LoadForm.d.ts +5 -0
- package/dist/components/network-modifications/load/common/LoadForm.js +73 -0
- package/dist/components/network-modifications/load/common/index.d.ts +12 -0
- package/dist/components/network-modifications/load/common/index.js +12 -0
- package/dist/components/network-modifications/load/common/load.types.d.ts +16 -0
- package/dist/components/network-modifications/load/common/load.types.js +1 -0
- package/dist/components/network-modifications/load/common/load.utils.d.ts +11 -0
- package/dist/components/network-modifications/load/common/load.utils.js +8 -0
- package/dist/components/network-modifications/load/creation/index.d.ts +8 -0
- package/dist/components/network-modifications/load/creation/index.js +7 -0
- package/dist/components/network-modifications/load/creation/loadCreation.types.d.ts +16 -0
- package/dist/components/network-modifications/load/creation/loadCreation.types.js +1 -0
- package/dist/components/network-modifications/load/creation/loadCreation.utils.d.ts +53 -0
- package/dist/components/network-modifications/load/creation/loadCreation.utils.js +98 -0
- package/dist/components/network-modifications/load/index.d.ts +8 -0
- package/dist/components/network-modifications/load/index.js +17 -0
- package/dist/components/network-modifications/substation/creation/substationCreation.utils.js +2 -1
- package/dist/components/network-modifications/voltage-level/creation/substation-creation/SubstationAutocompleteAddButton.js +3 -0
- package/dist/components/network-modifications/voltage-level/index.d.ts +1 -0
- package/dist/components/network-modifications/voltage-level/voltage-level.type.d.ts +12 -0
- package/dist/components/network-modifications/voltage-level/voltage-level.type.js +1 -0
- package/dist/components/parameters/common/utils.d.ts +25 -2
- package/dist/components/parameters/common/utils.js +40 -1
- package/dist/components/parameters/dynamic-margin-calculation/use-dynamic-margin-calculation-parameters-form.d.ts +2 -18
- package/dist/components/parameters/dynamic-margin-calculation/use-dynamic-margin-calculation-parameters-form.js +2 -38
- package/dist/components/parameters/dynamic-security-analysis/constants.d.ts +9 -0
- package/dist/components/parameters/dynamic-security-analysis/constants.js +8 -0
- package/dist/components/parameters/dynamic-security-analysis/contingency-parameters.d.ts +10 -0
- package/dist/components/parameters/dynamic-security-analysis/contingency-parameters.js +65 -0
- package/dist/components/parameters/dynamic-security-analysis/dynamic-security-analysis-inline.d.ts +10 -0
- package/dist/components/parameters/dynamic-security-analysis/dynamic-security-analysis-inline.js +130 -0
- package/dist/components/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.d.ts +9 -0
- package/dist/components/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.js +103 -0
- package/dist/components/parameters/dynamic-security-analysis/index.d.ts +8 -0
- package/dist/components/parameters/dynamic-security-analysis/index.js +8 -0
- package/dist/components/parameters/dynamic-security-analysis/scenario-parameters.d.ts +10 -0
- package/dist/components/parameters/dynamic-security-analysis/scenario-parameters.js +16 -0
- package/dist/components/parameters/dynamic-security-analysis/use-dynamic-security-analysis-parameters-form.d.ts +51 -0
- package/dist/components/parameters/dynamic-security-analysis/use-dynamic-security-analysis-parameters-form.js +181 -0
- package/dist/components/parameters/index.d.ts +1 -0
- package/dist/components/parameters/index.js +6 -0
- package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +24 -4
- package/dist/components/parameters/util/make-component-utils.d.ts +17 -0
- package/dist/components/parameters/util/make-component-utils.js +96 -0
- package/dist/components/parameters/util/styles.d.ts +38 -0
- package/dist/components/parameters/util/styles.js +41 -0
- package/dist/index.js +95 -4
- package/dist/services/dynamic-security-analysis.d.ts +4 -0
- package/dist/services/dynamic-security-analysis.js +29 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.js +6 -1
- package/dist/services/sensitivity-analysis.d.ts +1 -1
- package/dist/services/sensitivity-analysis.js +3 -2
- package/dist/services/utils.d.ts +2 -0
- package/dist/services/utils.js +3 -0
- package/dist/translations/en/networkModificationsEn.d.ts +17 -0
- package/dist/translations/en/networkModificationsEn.js +18 -1
- package/dist/translations/fr/networkModificationsFr.d.ts +17 -0
- package/dist/translations/fr/networkModificationsFr.js +18 -1
- package/dist/utils/constants/fieldConstants.d.ts +24 -1
- package/dist/utils/constants/fieldConstants.js +24 -1
- package/dist/utils/index.js +10 -2
- package/dist/utils/ts-utils.d.ts +5 -6
- package/dist/utils/ts-utils.js +11 -0
- package/dist/utils/types/elementType.d.ts +1 -0
- package/dist/utils/types/elementType.js +1 -0
- package/dist/utils/types/equipmentType.d.ts +18 -0
- package/dist/utils/types/equipmentType.js +27 -1
- package/dist/utils/types/index.js +8 -2
- package/package.json +1 -1
|
@@ -1,25 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ObjectSchema } from 'yup';
|
|
3
|
-
import { SyntheticEvent } from 'react';
|
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
|
4
2
|
import { DynamicMarginCalculationParametersInfos } from '../../../utils/types/dynamic-margin-calculation.type';
|
|
5
3
|
import { TabValues } from './dynamic-margin-calculation.type';
|
|
4
|
+
import { UseComputationParametersFormReturn } from '../common/utils';
|
|
6
5
|
export declare const toFormValues: (_params: DynamicMarginCalculationParametersInfos) => FieldValues;
|
|
7
6
|
export declare const toParamsInfos: (_formData: FieldValues) => DynamicMarginCalculationParametersInfos;
|
|
8
|
-
export type UseTabsReturn<TTabValue extends string> = {
|
|
9
|
-
selectedTab: TTabValue;
|
|
10
|
-
tabsWithError: TTabValue[];
|
|
11
|
-
onTabChange: (event: SyntheticEvent, newValue: TTabValue) => void;
|
|
12
|
-
onError: (errors: FieldErrors) => void;
|
|
13
|
-
};
|
|
14
|
-
export type UseComputationParametersFormReturn<TTabValue extends string> = UseTabsReturn<TTabValue> & {
|
|
15
|
-
formMethods: UseFormReturn;
|
|
16
|
-
formSchema: ObjectSchema<any>;
|
|
17
|
-
paramsLoaded: boolean;
|
|
18
|
-
formattedProviders: {
|
|
19
|
-
id: string;
|
|
20
|
-
label: string;
|
|
21
|
-
}[];
|
|
22
|
-
};
|
|
23
7
|
export type UseDynamicMarginCalculationParametersFormReturn = UseComputationParametersFormReturn<TabValues>;
|
|
24
8
|
export type UseParametersFormProps = {
|
|
25
9
|
providers: Record<string, string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useForm } from "react-hook-form";
|
|
2
|
-
import { useMemo, useEffect
|
|
2
|
+
import { useMemo, useEffect } from "react";
|
|
3
3
|
import { yupResolver } from "@hookform/resolvers/yup";
|
|
4
4
|
import "../../../utils/yupConfig.js";
|
|
5
5
|
import { formSchema as formSchema$2, emptyFormData as emptyFormData$2 } from "./time-delay-parameters.js";
|
|
@@ -7,7 +7,6 @@ import { formSchema as formSchema$1, emptyFormData as emptyFormData$1 } from "./
|
|
|
7
7
|
import { ID } from "../../../utils/constants/filterConstant.js";
|
|
8
8
|
import "../../../utils/conversionUtils.js";
|
|
9
9
|
import "../../../utils/types/equipmentType.js";
|
|
10
|
-
import { isObjectEmpty } from "../../../utils/functions.js";
|
|
11
10
|
import "react/jsx-runtime";
|
|
12
11
|
import "@mui/icons-material";
|
|
13
12
|
import { PROVIDER } from "../common/constants.js";
|
|
@@ -46,6 +45,7 @@ import "../../filter/HeaderFilterForm.js";
|
|
|
46
45
|
import { getNameElementEditorSchema, getNameElementEditorEmptyFormData } from "../common/name-element-editor/name-element-editor-utils.js";
|
|
47
46
|
import { LOADS_VARIATIONS, LOAD_MODELS_RULE, ACCURACY, CALCULATION_TYPE, LOAD_INCREASE_STOP_TIME, LOAD_INCREASE_START_TIME, MARGIN_CALCULATION_START_TIME, STOP_TIME, START_TIME } from "./constants.js";
|
|
48
47
|
import { TabValues } from "./dynamic-margin-calculation.type.js";
|
|
48
|
+
import { useTabs } from "../common/utils.js";
|
|
49
49
|
const formSchema = yup.object().shape({
|
|
50
50
|
[PROVIDER]: yup.string().required(),
|
|
51
51
|
[TabValues.TAB_TIME_DELAY]: formSchema$2,
|
|
@@ -87,42 +87,6 @@ const toParamsInfos = (_formData) => ({
|
|
|
87
87
|
loadModelsRule: _formData[TabValues.TAB_LOADS_VARIATIONS][LOAD_MODELS_RULE],
|
|
88
88
|
loadsVariations: _formData[TabValues.TAB_LOADS_VARIATIONS][LOADS_VARIATIONS]
|
|
89
89
|
});
|
|
90
|
-
function useTabs({
|
|
91
|
-
defaultTab,
|
|
92
|
-
tabEnum
|
|
93
|
-
}) {
|
|
94
|
-
const [tabValue, setTabValue] = useState(defaultTab);
|
|
95
|
-
const [tabValuesWithError, setTabValuesWithError] = useState([]);
|
|
96
|
-
const handleTabChange = useCallback((event, newValue) => {
|
|
97
|
-
setTabValue(newValue);
|
|
98
|
-
}, []);
|
|
99
|
-
const onError = useCallback(
|
|
100
|
-
(errors) => {
|
|
101
|
-
if (!errors || isObjectEmpty(errors)) {
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
const tabsInError = [];
|
|
105
|
-
Object.values(tabEnum).forEach((tab) => {
|
|
106
|
-
if (errors?.[tab] && tab !== tabValue) {
|
|
107
|
-
tabsInError.push(tab);
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
if (tabsInError.includes(tabValue)) {
|
|
111
|
-
setTabValuesWithError(tabsInError.filter((errorTab) => errorTab !== tabValue));
|
|
112
|
-
} else if (tabsInError.length > 0) {
|
|
113
|
-
setTabValue(tabsInError[0]);
|
|
114
|
-
setTabValuesWithError(tabsInError.filter((errorTab, index, arr) => errorTab !== arr[0]));
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
[tabValue, tabEnum]
|
|
118
|
-
);
|
|
119
|
-
return {
|
|
120
|
-
selectedTab: tabValue,
|
|
121
|
-
tabsWithError: tabValuesWithError,
|
|
122
|
-
onTabChange: handleTabChange,
|
|
123
|
-
onError
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
90
|
function useDynamicMarginCalculationParametersForm({
|
|
127
91
|
providers,
|
|
128
92
|
params,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, RTE (http://www.rte-france.com)
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
+
*/
|
|
7
|
+
export declare const CONTINGENCIES_START_TIME = "contingenciesStartTime";
|
|
8
|
+
export declare const CONTINGENCIES_LIST_INFOS = "contingencyListInfos";
|
|
9
|
+
export declare const SCENARIO_DURATION = "scenarioDuration";
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
declare function ContingencyParameters({ path }: Readonly<{
|
|
8
|
+
path: string;
|
|
9
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default ContingencyParameters;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Grid } from "@mui/material";
|
|
3
|
+
import "react-intl";
|
|
4
|
+
import "react";
|
|
5
|
+
import "../../../utils/conversionUtils.js";
|
|
6
|
+
import { ElementType } from "../../../utils/types/elementType.js";
|
|
7
|
+
import "../../../utils/types/equipmentType.js";
|
|
8
|
+
import "@mui/icons-material";
|
|
9
|
+
import "../../../utils/yupConfig.js";
|
|
10
|
+
import "localized-countries";
|
|
11
|
+
import "localized-countries/data/fr";
|
|
12
|
+
import "localized-countries/data/en";
|
|
13
|
+
import "notistack";
|
|
14
|
+
import "react-hook-form";
|
|
15
|
+
import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
|
|
16
|
+
import "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
17
|
+
import "../../dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
18
|
+
import "../../treeViewFinder/TreeViewFinder.js";
|
|
19
|
+
import "../../overflowableText/OverflowableText.js";
|
|
20
|
+
import "yup";
|
|
21
|
+
import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
22
|
+
import "../../customAGGrid/customAggrid.js";
|
|
23
|
+
import "ag-grid-community";
|
|
24
|
+
import "react-papaparse";
|
|
25
|
+
import "react-csv-downloader";
|
|
26
|
+
import "../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
27
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
28
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
29
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
30
|
+
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
31
|
+
import "@react-querybuilder/material";
|
|
32
|
+
import "../../filter/expert/expertFilterConstants.js";
|
|
33
|
+
import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
34
|
+
import "uuid";
|
|
35
|
+
import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
36
|
+
import "react-querybuilder";
|
|
37
|
+
import { ParameterLineDirectoryItemsInput } from "../common/widget/parameter-line-directory-items-input.js";
|
|
38
|
+
import "../common/widget/parameter-line-slider.js";
|
|
39
|
+
import "../common/limitreductions/columns-definitions.js";
|
|
40
|
+
import "../common/contingency-table/columns-definitions.js";
|
|
41
|
+
import { TYPES, makeComponents } from "../util/make-component-utils.js";
|
|
42
|
+
import { CONTINGENCIES_START_TIME, CONTINGENCIES_LIST_INFOS } from "./constants.js";
|
|
43
|
+
const defParams = {
|
|
44
|
+
[CONTINGENCIES_START_TIME]: {
|
|
45
|
+
type: TYPES.FLOAT,
|
|
46
|
+
label: "DynamicSecurityAnalysisContingenciesStartTime"
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
function ContingencyParameters({ path }) {
|
|
50
|
+
return /* @__PURE__ */ jsxs(Grid, { xl: 8, container: true, children: [
|
|
51
|
+
makeComponents(defParams, path),
|
|
52
|
+
/* @__PURE__ */ jsx(
|
|
53
|
+
ParameterLineDirectoryItemsInput,
|
|
54
|
+
{
|
|
55
|
+
name: `${path}.${CONTINGENCIES_LIST_INFOS}`,
|
|
56
|
+
elementType: ElementType.CONTINGENCY_LIST,
|
|
57
|
+
label: "ContingencyListsSelection",
|
|
58
|
+
hideErrorMessage: true
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
] });
|
|
62
|
+
}
|
|
63
|
+
export {
|
|
64
|
+
ContingencyParameters as default
|
|
65
|
+
};
|
package/dist/components/parameters/dynamic-security-analysis/dynamic-security-analysis-inline.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UUID } from 'node:crypto';
|
|
2
|
+
import { UseParametersBackendReturnProps } from '../../../utils/types/parameters.type';
|
|
3
|
+
import { ComputingType } from '../common/computing-type';
|
|
4
|
+
type DynamicSecurityAnalysisInlineProps = {
|
|
5
|
+
studyUuid: UUID | null;
|
|
6
|
+
parametersBackend: UseParametersBackendReturnProps<ComputingType.DYNAMIC_SECURITY_ANALYSIS>;
|
|
7
|
+
setHaveDirtyFields: (isDirty: boolean) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare function DynamicSecurityAnalysisInline({ studyUuid, parametersBackend, setHaveDirtyFields, }: Readonly<DynamicSecurityAnalysisInlineProps>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
package/dist/components/parameters/dynamic-security-analysis/dynamic-security-analysis-inline.js
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Grid } from "@mui/material";
|
|
3
|
+
import { FormattedMessage } from "react-intl";
|
|
4
|
+
import { useState, useCallback, useEffect } from "react";
|
|
5
|
+
import "../../../utils/conversionUtils.js";
|
|
6
|
+
import { ElementType } from "../../../utils/types/elementType.js";
|
|
7
|
+
import "../../../utils/types/equipmentType.js";
|
|
8
|
+
import "@mui/icons-material";
|
|
9
|
+
import { mergeSx } from "../../../utils/styles.js";
|
|
10
|
+
import "../../../utils/yupConfig.js";
|
|
11
|
+
import { useDynamicSecurityAnalysisParametersForm, toParamsInfos } from "./use-dynamic-security-analysis-parameters-form.js";
|
|
12
|
+
import { LabelledButton } from "../common/parameters.js";
|
|
13
|
+
import { SubmitButton } from "../../inputs/reactHookForm/utils/SubmitButton.js";
|
|
14
|
+
import { PopupConfirmationDialog } from "../../dialogs/popupConfirmationDialog/PopupConfirmationDialog.js";
|
|
15
|
+
import { parametersStyles } from "../parameters-style.js";
|
|
16
|
+
import { CreateParameterDialog } from "../common/parameters-creation-dialog.js";
|
|
17
|
+
import "../../overflowableText/OverflowableText.js";
|
|
18
|
+
import "react-hook-form";
|
|
19
|
+
import "localized-countries";
|
|
20
|
+
import "localized-countries/data/fr";
|
|
21
|
+
import "localized-countries/data/en";
|
|
22
|
+
import "notistack";
|
|
23
|
+
import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
|
|
24
|
+
import "yup";
|
|
25
|
+
import "../../treeViewFinder/TreeViewFinder.js";
|
|
26
|
+
import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
27
|
+
import "../../customAGGrid/customAggrid.js";
|
|
28
|
+
import "ag-grid-community";
|
|
29
|
+
import "react-papaparse";
|
|
30
|
+
import "react-csv-downloader";
|
|
31
|
+
import "../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
32
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
33
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
34
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
35
|
+
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
36
|
+
import "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
37
|
+
import "@react-querybuilder/material";
|
|
38
|
+
import "../../filter/expert/expertFilterConstants.js";
|
|
39
|
+
import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
40
|
+
import "uuid";
|
|
41
|
+
import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
42
|
+
import "react-querybuilder";
|
|
43
|
+
import "../common/widget/parameter-line-slider.js";
|
|
44
|
+
import "../common/limitreductions/columns-definitions.js";
|
|
45
|
+
import "../common/contingency-table/columns-definitions.js";
|
|
46
|
+
import { DynamicSecurityAnalysisParametersForm } from "./dynamic-security-analysis-parameters-form.js";
|
|
47
|
+
function DynamicSecurityAnalysisInline({
|
|
48
|
+
studyUuid,
|
|
49
|
+
parametersBackend,
|
|
50
|
+
setHaveDirtyFields
|
|
51
|
+
}) {
|
|
52
|
+
const { providers, params, updateParameters, resetParameters } = parametersBackend;
|
|
53
|
+
const dynamicSecurityAnalysisMethods = useDynamicSecurityAnalysisParametersForm({
|
|
54
|
+
providers,
|
|
55
|
+
params,
|
|
56
|
+
name: null,
|
|
57
|
+
description: null
|
|
58
|
+
});
|
|
59
|
+
const [openCreateParameterDialog, setOpenCreateParameterDialog] = useState(false);
|
|
60
|
+
const [openResetConfirmation, setOpenResetConfirmation] = useState(false);
|
|
61
|
+
const { formMethods, onError } = dynamicSecurityAnalysisMethods;
|
|
62
|
+
const { handleSubmit, getValues, formState } = formMethods;
|
|
63
|
+
const handleResetClick = useCallback(() => {
|
|
64
|
+
setOpenResetConfirmation(true);
|
|
65
|
+
}, []);
|
|
66
|
+
const handleCancelReset = useCallback(() => {
|
|
67
|
+
setOpenResetConfirmation(false);
|
|
68
|
+
}, []);
|
|
69
|
+
const handleReset = useCallback(() => {
|
|
70
|
+
resetParameters();
|
|
71
|
+
setOpenResetConfirmation(false);
|
|
72
|
+
}, [resetParameters]);
|
|
73
|
+
const onSubmit = useCallback(
|
|
74
|
+
(formData) => {
|
|
75
|
+
updateParameters(toParamsInfos(formData));
|
|
76
|
+
},
|
|
77
|
+
[updateParameters]
|
|
78
|
+
);
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
setHaveDirtyFields(!!Object.keys(formState.dirtyFields).length);
|
|
81
|
+
}, [formState, setHaveDirtyFields]);
|
|
82
|
+
const renderActions = () => {
|
|
83
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
84
|
+
/* @__PURE__ */ jsx(Grid, { container: true, item: true, children: /* @__PURE__ */ jsxs(
|
|
85
|
+
Grid,
|
|
86
|
+
{
|
|
87
|
+
sx: mergeSx(parametersStyles.controlParametersItem, {
|
|
88
|
+
paddingBottom: 2,
|
|
89
|
+
paddingLeft: 0
|
|
90
|
+
}),
|
|
91
|
+
children: [
|
|
92
|
+
/* @__PURE__ */ jsx(LabelledButton, { callback: handleResetClick, label: "resetToDefault" }),
|
|
93
|
+
/* @__PURE__ */ jsx(SubmitButton, { variant: "outlined", onClick: handleSubmit(onSubmit, onError), children: /* @__PURE__ */ jsx(FormattedMessage, { id: "validate" }) })
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
) }),
|
|
97
|
+
openCreateParameterDialog && /* @__PURE__ */ jsx(
|
|
98
|
+
CreateParameterDialog,
|
|
99
|
+
{
|
|
100
|
+
studyUuid,
|
|
101
|
+
open: openCreateParameterDialog,
|
|
102
|
+
onClose: () => setOpenCreateParameterDialog(false),
|
|
103
|
+
parameterValues: getValues,
|
|
104
|
+
parameterFormatter: toParamsInfos,
|
|
105
|
+
parameterType: ElementType.DYNAMIC_SECURITY_ANALYSIS_PARAMETERS
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
openResetConfirmation && /* @__PURE__ */ jsx(
|
|
109
|
+
PopupConfirmationDialog,
|
|
110
|
+
{
|
|
111
|
+
message: "resetParamsConfirmation",
|
|
112
|
+
validateButtonLabel: "validate",
|
|
113
|
+
openConfirmationPopup: openResetConfirmation,
|
|
114
|
+
setOpenConfirmationPopup: handleCancelReset,
|
|
115
|
+
handlePopupConfirmation: handleReset
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
] });
|
|
119
|
+
};
|
|
120
|
+
return /* @__PURE__ */ jsx(
|
|
121
|
+
DynamicSecurityAnalysisParametersForm,
|
|
122
|
+
{
|
|
123
|
+
dynamicSecurityAnalysisMethods,
|
|
124
|
+
renderActions
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
export {
|
|
129
|
+
DynamicSecurityAnalysisInline
|
|
130
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { UseDynamicSecurityAnalysisParametersFormReturn } from './use-dynamic-security-analysis-parameters-form';
|
|
3
|
+
type DynamicSecurityAnalysisParametersFormProps = {
|
|
4
|
+
dynamicSecurityAnalysisMethods: UseDynamicSecurityAnalysisParametersFormReturn;
|
|
5
|
+
renderTitleFields?: () => ReactNode;
|
|
6
|
+
renderActions?: () => ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export declare function DynamicSecurityAnalysisParametersForm({ dynamicSecurityAnalysisMethods, renderTitleFields, renderActions, }: Readonly<DynamicSecurityAnalysisParametersFormProps>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Grid, Tabs, Tab, LinearProgress } from "@mui/material";
|
|
3
|
+
import { FormattedMessage } from "react-intl";
|
|
4
|
+
import ScenarioParameters from "./scenario-parameters.js";
|
|
5
|
+
import ContingencyParameters from "./contingency-parameters.js";
|
|
6
|
+
import { parametersStyles } from "../util/styles.js";
|
|
7
|
+
import { TabPanel } from "../common/parameters.js";
|
|
8
|
+
import "react";
|
|
9
|
+
import "../../../utils/conversionUtils.js";
|
|
10
|
+
import "../../../utils/types/equipmentType.js";
|
|
11
|
+
import "@mui/icons-material";
|
|
12
|
+
import { mergeSx } from "../../../utils/styles.js";
|
|
13
|
+
import "../../../utils/yupConfig.js";
|
|
14
|
+
import "localized-countries";
|
|
15
|
+
import "localized-countries/data/fr";
|
|
16
|
+
import "localized-countries/data/en";
|
|
17
|
+
import "notistack";
|
|
18
|
+
import "react-hook-form";
|
|
19
|
+
import { CustomFormProvider } from "../../inputs/reactHookForm/provider/CustomFormProvider.js";
|
|
20
|
+
import "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
21
|
+
import "../../dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
22
|
+
import "../../treeViewFinder/TreeViewFinder.js";
|
|
23
|
+
import { ProviderParam } from "../common/ProviderParam.js";
|
|
24
|
+
import "../../overflowableText/OverflowableText.js";
|
|
25
|
+
import "yup";
|
|
26
|
+
import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
27
|
+
import "../../customAGGrid/customAggrid.js";
|
|
28
|
+
import "ag-grid-community";
|
|
29
|
+
import "react-papaparse";
|
|
30
|
+
import "react-csv-downloader";
|
|
31
|
+
import "../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
32
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
33
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
34
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
35
|
+
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
36
|
+
import "@react-querybuilder/material";
|
|
37
|
+
import "../../filter/expert/expertFilterConstants.js";
|
|
38
|
+
import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
39
|
+
import "uuid";
|
|
40
|
+
import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
41
|
+
import "react-querybuilder";
|
|
42
|
+
import { getTabStyle } from "../parameters-style.js";
|
|
43
|
+
import "../common/widget/parameter-line-slider.js";
|
|
44
|
+
import "../common/limitreductions/columns-definitions.js";
|
|
45
|
+
import "../common/contingency-table/columns-definitions.js";
|
|
46
|
+
import { TabValues } from "./use-dynamic-security-analysis-parameters-form.js";
|
|
47
|
+
function DynamicSecurityAnalysisParametersForm({
|
|
48
|
+
dynamicSecurityAnalysisMethods,
|
|
49
|
+
renderTitleFields,
|
|
50
|
+
renderActions
|
|
51
|
+
}) {
|
|
52
|
+
const { formMethods, formSchema, paramsLoaded, formattedProviders, selectedTab, onTabChange, tabsWithError } = dynamicSecurityAnalysisMethods;
|
|
53
|
+
return /* @__PURE__ */ jsxs(CustomFormProvider, { validationSchema: formSchema, ...formMethods, children: [
|
|
54
|
+
renderTitleFields?.(),
|
|
55
|
+
paramsLoaded ? /* @__PURE__ */ jsxs(Grid, { sx: { height: "100%" }, children: [
|
|
56
|
+
/* @__PURE__ */ jsx(Grid, { container: true, children: /* @__PURE__ */ jsx(ProviderParam, { options: formattedProviders }) }),
|
|
57
|
+
/* @__PURE__ */ jsx(
|
|
58
|
+
Grid,
|
|
59
|
+
{
|
|
60
|
+
sx: mergeSx(parametersStyles.scrollableGrid, {
|
|
61
|
+
height: "100%",
|
|
62
|
+
paddingTop: 0
|
|
63
|
+
}),
|
|
64
|
+
children: /* @__PURE__ */ jsxs(Grid, { item: true, width: "100%", children: [
|
|
65
|
+
/* @__PURE__ */ jsxs(
|
|
66
|
+
Tabs,
|
|
67
|
+
{
|
|
68
|
+
value: selectedTab,
|
|
69
|
+
variant: "scrollable",
|
|
70
|
+
onChange: onTabChange,
|
|
71
|
+
"aria-label": "parameters",
|
|
72
|
+
children: [
|
|
73
|
+
/* @__PURE__ */ jsx(
|
|
74
|
+
Tab,
|
|
75
|
+
{
|
|
76
|
+
label: /* @__PURE__ */ jsx(FormattedMessage, { id: "DynamicSecurityAnalysisScenario" }),
|
|
77
|
+
value: TabValues.SCENARIO,
|
|
78
|
+
sx: getTabStyle(tabsWithError, TabValues.SCENARIO)
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
/* @__PURE__ */ jsx(
|
|
82
|
+
Tab,
|
|
83
|
+
{
|
|
84
|
+
label: /* @__PURE__ */ jsx(FormattedMessage, { id: "DynamicSecurityAnalysisContingency" }),
|
|
85
|
+
value: TabValues.CONTINGENCY
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
/* @__PURE__ */ jsx(TabPanel, { value: selectedTab, index: TabValues.SCENARIO, children: /* @__PURE__ */ jsx(ScenarioParameters, { path: TabValues.SCENARIO }) }),
|
|
92
|
+
/* @__PURE__ */ jsx(TabPanel, { value: selectedTab, index: TabValues.CONTINGENCY, children: /* @__PURE__ */ jsx(ContingencyParameters, { path: TabValues.CONTINGENCY }) })
|
|
93
|
+
] })
|
|
94
|
+
},
|
|
95
|
+
"dsaParameters"
|
|
96
|
+
),
|
|
97
|
+
renderActions?.()
|
|
98
|
+
] }) : /* @__PURE__ */ jsx(LinearProgress, {})
|
|
99
|
+
] });
|
|
100
|
+
}
|
|
101
|
+
export {
|
|
102
|
+
DynamicSecurityAnalysisParametersForm
|
|
103
|
+
};
|
|
@@ -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 './constants';
|
|
8
|
+
export * from './dynamic-security-analysis-inline';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CONTINGENCIES_LIST_INFOS, CONTINGENCIES_START_TIME, SCENARIO_DURATION } from "./constants.js";
|
|
2
|
+
import { DynamicSecurityAnalysisInline } from "./dynamic-security-analysis-inline.js";
|
|
3
|
+
export {
|
|
4
|
+
CONTINGENCIES_LIST_INFOS,
|
|
5
|
+
CONTINGENCIES_START_TIME,
|
|
6
|
+
DynamicSecurityAnalysisInline,
|
|
7
|
+
SCENARIO_DURATION
|
|
8
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
declare function ScenarioParameters({ path }: Readonly<{
|
|
8
|
+
path: string;
|
|
9
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default ScenarioParameters;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Grid } from "@mui/material";
|
|
3
|
+
import { TYPES, makeComponents } from "../util/make-component-utils.js";
|
|
4
|
+
import { SCENARIO_DURATION } from "./constants.js";
|
|
5
|
+
const defParams = {
|
|
6
|
+
[SCENARIO_DURATION]: {
|
|
7
|
+
type: TYPES.FLOAT,
|
|
8
|
+
label: "DynamicSecurityAnalysisScenarioDuration"
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
function ScenarioParameters({ path }) {
|
|
12
|
+
return /* @__PURE__ */ jsx(Grid, { xl: 8, container: true, children: makeComponents(defParams, path) });
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
ScenarioParameters as default
|
|
16
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
|
2
|
+
import { default as yup } from '../../../utils/yupConfig';
|
|
3
|
+
import { DynamicSecurityAnalysisParametersFetchReturn, DynamicSecurityAnalysisParametersInfos } from '../../../utils';
|
|
4
|
+
import { UseComputationParametersFormReturn } from '../common/utils';
|
|
5
|
+
export declare enum TabValues {
|
|
6
|
+
SCENARIO = "scenario",
|
|
7
|
+
CONTINGENCY = "contingency"
|
|
8
|
+
}
|
|
9
|
+
export declare const formSchema: yup.ObjectSchema<{
|
|
10
|
+
provider: string;
|
|
11
|
+
scenario: {
|
|
12
|
+
scenarioDuration: number;
|
|
13
|
+
};
|
|
14
|
+
contingency: {
|
|
15
|
+
contingenciesStartTime: number;
|
|
16
|
+
contingencyListInfos: {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
}[];
|
|
20
|
+
};
|
|
21
|
+
}, yup.AnyObject, {
|
|
22
|
+
provider: undefined;
|
|
23
|
+
scenario: {
|
|
24
|
+
scenarioDuration: undefined;
|
|
25
|
+
};
|
|
26
|
+
contingency: {
|
|
27
|
+
contingenciesStartTime: undefined;
|
|
28
|
+
contingencyListInfos: "";
|
|
29
|
+
};
|
|
30
|
+
}, "">;
|
|
31
|
+
export declare const emptyFormData: {
|
|
32
|
+
provider: string;
|
|
33
|
+
scenario: {
|
|
34
|
+
scenarioDuration: number;
|
|
35
|
+
};
|
|
36
|
+
contingency: {
|
|
37
|
+
contingenciesStartTime: number;
|
|
38
|
+
contingencyListInfos: never[];
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export declare const toFormValues: (_params: DynamicSecurityAnalysisParametersFetchReturn) => FieldValues;
|
|
42
|
+
export declare const toParamsInfos: (_formData: FieldValues) => DynamicSecurityAnalysisParametersFetchReturn;
|
|
43
|
+
export type UseDynamicSecurityAnalysisParametersFormReturn = UseComputationParametersFormReturn<TabValues>;
|
|
44
|
+
type UseDynamicSecurityAnalysisParametersFormProps = {
|
|
45
|
+
providers: Record<string, string>;
|
|
46
|
+
params: DynamicSecurityAnalysisParametersInfos | null;
|
|
47
|
+
name: string | null;
|
|
48
|
+
description: string | null;
|
|
49
|
+
};
|
|
50
|
+
export declare function useDynamicSecurityAnalysisParametersForm({ providers, params, name: initialName, description: initialDescription, }: Readonly<UseDynamicSecurityAnalysisParametersFormProps>): UseDynamicSecurityAnalysisParametersFormReturn;
|
|
51
|
+
export {};
|