@gridsuite/commons-ui 0.209.0 → 0.210.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/filter/utils/filterFormUtils.js +2 -1
- package/dist/components/index.js +21 -1
- package/dist/components/inputs/reactHookForm/booleans/RadioInput.js +1 -1
- package/dist/components/network-modifications/battery/creation/batteryCreation.utils.js +3 -3
- package/dist/components/network-modifications/common/activePowerControl/activePowerControlForm.utils.js +2 -2
- package/dist/components/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/reactiveCapability.utils.js +4 -3
- package/dist/components/network-modifications/common/reactiveLimits/reactiveLimits.utils.js +3 -3
- package/dist/components/network-modifications/common/setpoints/setPoints.utils.js +1 -1
- package/dist/components/network-modifications/common/shortCircuit/shortCircuitForm.utils.js +3 -3
- package/dist/components/network-modifications/index.d.ts +1 -0
- package/dist/components/network-modifications/index.js +21 -1
- package/dist/components/network-modifications/shunt-compensator/common/CharacteristicsForm.d.ts +6 -0
- package/dist/components/network-modifications/shunt-compensator/common/CharacteristicsForm.js +199 -0
- package/dist/components/network-modifications/shunt-compensator/common/characteristicsForm.utils.d.ts +64 -0
- package/dist/components/network-modifications/shunt-compensator/common/characteristicsForm.utils.js +90 -0
- package/dist/components/network-modifications/{voltageLevel/creation/tabs/structureTab/switchesBetweenSections/creation/CreateSwitchesForm.d.ts → shunt-compensator/common/index.d.ts} +4 -5
- package/dist/components/network-modifications/shunt-compensator/common/index.js +13 -0
- package/dist/components/network-modifications/shunt-compensator/common/shuntCompensator.types.d.ts +20 -0
- package/dist/components/network-modifications/shunt-compensator/common/shuntCompensator.types.js +1 -0
- package/dist/components/network-modifications/shunt-compensator/common/shuntCompensator.utils.d.ts +27 -0
- package/dist/components/network-modifications/shunt-compensator/common/shuntCompensator.utils.js +16 -0
- package/dist/components/network-modifications/shunt-compensator/creation/ShuntCompensatorCreationForm.d.ts +3 -0
- package/dist/components/network-modifications/shunt-compensator/creation/ShuntCompensatorCreationForm.js +82 -0
- package/dist/components/network-modifications/shunt-compensator/creation/index.d.ts +9 -0
- package/dist/components/network-modifications/shunt-compensator/creation/index.js +9 -0
- package/dist/components/network-modifications/shunt-compensator/creation/shuntCompensatorCreation.types.d.ts +20 -0
- package/dist/components/network-modifications/shunt-compensator/creation/shuntCompensatorCreation.types.js +1 -0
- package/dist/components/network-modifications/shunt-compensator/creation/shuntCompensatorCreation.utils.d.ts +110 -0
- package/dist/components/network-modifications/shunt-compensator/creation/shuntCompensatorCreation.utils.js +103 -0
- package/dist/components/network-modifications/{voltageLevel/creation/tabs/structureTab/switchesBetweenSections/creation → shunt-compensator}/index.d.ts +2 -1
- package/dist/components/network-modifications/shunt-compensator/index.js +20 -0
- package/dist/components/network-modifications/voltageLevel/creation/VoltageLevelCreationForm.js +1 -1
- package/dist/components/network-modifications/voltageLevel/creation/index.d.ts +1 -0
- package/dist/components/network-modifications/voltageLevel/creation/index.js +3 -1
- package/dist/components/network-modifications/voltageLevel/creation/tabs/structureTab/StructureTab.js +6 -2
- package/dist/components/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/SwitchesBetweenSections.js +22 -43
- package/dist/components/network-modifications/voltageLevel/creation/voltageLevel.constants.d.ts +1 -0
- package/dist/components/network-modifications/voltageLevel/creation/voltageLevel.constants.js +2 -0
- package/dist/components/network-modifications/voltageLevel/creation/voltageLevelCreation.utils.js +2 -1
- package/dist/components/network-modifications/voltageLevel/index.js +3 -1
- package/dist/index.js +21 -1
- package/dist/translations/en/networkModificationsEn.d.ts +14 -0
- package/dist/translations/en/networkModificationsEn.js +14 -0
- package/dist/translations/fr/networkModificationsFr.d.ts +14 -0
- package/dist/translations/fr/networkModificationsFr.js +14 -0
- package/dist/utils/constants/fieldConstants.d.ts +7 -0
- package/dist/utils/constants/fieldConstants.js +7 -0
- package/package.json +1 -1
- package/dist/components/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/creation/CreateSwitchesDialog.d.ts +0 -11
- package/dist/components/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/creation/CreateSwitchesDialog.js +0 -84
- package/dist/components/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/creation/CreateSwitchesDialogSubmitButton.d.ts +0 -6
- package/dist/components/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/creation/CreateSwitchesDialogSubmitButton.js +0 -11
- package/dist/components/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/creation/CreateSwitchesForm.js +0 -61
- package/dist/components/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/creation/createSwitchesDialog.utils.d.ts +0 -14
- package/dist/components/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/creation/createSwitchesDialog.utils.js +0 -27
- package/dist/components/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/creation/index.js +0 -4
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { useFormContext, useWatch } from "react-hook-form";
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Grid2 } from "@mui/material";
|
|
3
|
+
import { useCallback, useRef, useEffect } from "react";
|
|
4
|
+
import { useFormContext, useFieldArray, useWatch } from "react-hook-form";
|
|
5
5
|
import { useIntl } from "react-intl";
|
|
6
|
-
import { ArrowDropDown } from "@mui/icons-material";
|
|
7
6
|
import { FieldConstants } from "../../../../../../../utils/constants/fieldConstants.js";
|
|
8
7
|
import "../../../../../../../utils/conversionUtils.js";
|
|
9
8
|
import "../../../../../../../utils/types/equipmentType.js";
|
|
9
|
+
import "@mui/icons-material";
|
|
10
10
|
import "../../../../../../../utils/yupConfig.js";
|
|
11
11
|
import { SwitchKind } from "../../../voltageLevelCreation.types.js";
|
|
12
12
|
import "../../../../../../overflowableText/OverflowableText.js";
|
|
@@ -22,8 +22,8 @@ import "../../../../../../customAGGrid/customAggrid.js";
|
|
|
22
22
|
import "ag-grid-community";
|
|
23
23
|
import "react-papaparse";
|
|
24
24
|
import "react-csv-downloader";
|
|
25
|
-
import { TextInput } from "../../../../../../inputs/reactHookForm/text/TextInput.js";
|
|
26
25
|
import "../../../../../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
26
|
+
import { EnumInput } from "../../../../../../inputs/reactHookForm/selectInputs/EnumInput.js";
|
|
27
27
|
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
28
28
|
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
29
29
|
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
@@ -37,23 +37,16 @@ import "../../../../../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
|
37
37
|
import "uuid";
|
|
38
38
|
import "../../../../../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
39
39
|
import "react-querybuilder";
|
|
40
|
-
import { CreateSwitchesDialog } from "./creation/CreateSwitchesDialog.js";
|
|
41
40
|
import GridSection from "../../../../../../grid/grid-section.js";
|
|
41
|
+
import { SWITCH_TYPE } from "../../../voltageLevelCreation.utils.js";
|
|
42
|
+
import { MAX_SECTIONS_COUNT } from "../../../voltageLevel.constants.js";
|
|
42
43
|
function SwitchesBetweenSections() {
|
|
43
|
-
const {
|
|
44
|
-
const
|
|
44
|
+
const { setValue } = useFormContext();
|
|
45
|
+
const { fields: rows } = useFieldArray({ name: `${FieldConstants.SWITCH_KINDS}` });
|
|
45
46
|
const watchSectionCount = useWatch({ name: FieldConstants.SECTION_COUNT });
|
|
46
47
|
const watchSwitchesBetweenSections = useWatch({
|
|
47
48
|
name: FieldConstants.SWITCHES_BETWEEN_SECTIONS
|
|
48
49
|
});
|
|
49
|
-
const addIconAdornment = useCallback((clickCallback) => {
|
|
50
|
-
return /* @__PURE__ */ jsx(IconButton, { onClick: clickCallback, children: /* @__PURE__ */ jsx(ArrowDropDown, {}) });
|
|
51
|
-
}, []);
|
|
52
|
-
const handleClickOpenSwitchesPane = useCallback(() => {
|
|
53
|
-
if (watchSectionCount > 1) {
|
|
54
|
-
setOpenCreateSwitchesDialog(true);
|
|
55
|
-
}
|
|
56
|
-
}, [watchSectionCount]);
|
|
57
50
|
const intl = useIntl();
|
|
58
51
|
const setSwitchesKinds = useCallback(
|
|
59
52
|
(data) => {
|
|
@@ -68,19 +61,13 @@ function SwitchesBetweenSections() {
|
|
|
68
61
|
},
|
|
69
62
|
[intl, setValue]
|
|
70
63
|
);
|
|
71
|
-
const handleCreateSwitchesDialog = useCallback(
|
|
72
|
-
(data) => {
|
|
73
|
-
setSwitchesKinds(data);
|
|
74
|
-
},
|
|
75
|
-
[setSwitchesKinds]
|
|
76
|
-
);
|
|
77
64
|
const sectionCountRef = useRef(watchSectionCount);
|
|
78
65
|
const switchesBetweenSectionsRef = useRef(watchSwitchesBetweenSections);
|
|
79
66
|
useEffect(() => {
|
|
80
67
|
if (sectionCountRef.current !== watchSectionCount && switchesBetweenSectionsRef.current === watchSwitchesBetweenSections) {
|
|
81
68
|
const initialKindDisconnector = { switchKind: SwitchKind.DISCONNECTOR };
|
|
82
69
|
let list = [];
|
|
83
|
-
if (watchSectionCount >= 1) {
|
|
70
|
+
if (watchSectionCount >= 1 && watchSectionCount <= MAX_SECTIONS_COUNT) {
|
|
84
71
|
list = new Array(watchSectionCount - 1).fill(initialKindDisconnector);
|
|
85
72
|
}
|
|
86
73
|
const data = { switchKinds: list };
|
|
@@ -89,32 +76,24 @@ function SwitchesBetweenSections() {
|
|
|
89
76
|
sectionCountRef.current = watchSectionCount;
|
|
90
77
|
switchesBetweenSectionsRef.current = watchSwitchesBetweenSections;
|
|
91
78
|
}, [watchSectionCount, watchSwitchesBetweenSections, setSwitchesKinds]);
|
|
92
|
-
if (Number.isNaN(watchSectionCount) || watchSectionCount <= 1) {
|
|
79
|
+
if (Number.isNaN(watchSectionCount) || watchSectionCount <= 1 || watchSectionCount > MAX_SECTIONS_COUNT) {
|
|
93
80
|
return null;
|
|
94
81
|
}
|
|
95
82
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
96
83
|
/* @__PURE__ */ jsx(GridSection, { title: "SwitchesBetweenSections" }),
|
|
97
|
-
/* @__PURE__ */ jsx(
|
|
98
|
-
|
|
84
|
+
/* @__PURE__ */ jsx(Grid2, { container: true, spacing: 2, pt: 1, children: rows.map((value, index) => /* @__PURE__ */ jsx(Grid2, { size: 4, children: /* @__PURE__ */ jsx(
|
|
85
|
+
EnumInput,
|
|
99
86
|
{
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
87
|
+
options: Object.values(SWITCH_TYPE),
|
|
88
|
+
name: `${FieldConstants.SWITCH_KINDS}.${index}.${FieldConstants.SWITCH_KIND}`,
|
|
89
|
+
label: "SwitchBetweenSectionsLabel",
|
|
90
|
+
labelValues: {
|
|
91
|
+
index1: String(index + 1),
|
|
92
|
+
index2: String(index + 2)
|
|
104
93
|
},
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
),
|
|
108
|
-
openCreateSwitchesDialog && /* @__PURE__ */ jsx(
|
|
109
|
-
CreateSwitchesDialog,
|
|
110
|
-
{
|
|
111
|
-
openCreateSwitchesDialog,
|
|
112
|
-
setOpenCreateSwitchesDialog,
|
|
113
|
-
handleCreateSwitchesDialog,
|
|
114
|
-
sectionCount: getValues(FieldConstants.SECTION_COUNT),
|
|
115
|
-
switchKinds: getValues(FieldConstants.SWITCH_KINDS)
|
|
94
|
+
size: "small"
|
|
116
95
|
}
|
|
117
|
-
)
|
|
96
|
+
) }, value.id)) })
|
|
118
97
|
] });
|
|
119
98
|
}
|
|
120
99
|
export {
|
package/dist/components/network-modifications/voltageLevel/creation/voltageLevel.constants.js
CHANGED
|
@@ -4,6 +4,7 @@ import "../../../../utils/types/equipmentType.js";
|
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "@mui/icons-material";
|
|
6
6
|
import "../../../../utils/yupConfig.js";
|
|
7
|
+
const MAX_SECTIONS_COUNT = 20;
|
|
7
8
|
var VoltageLevelTab = /* @__PURE__ */ ((VoltageLevelTab2) => {
|
|
8
9
|
VoltageLevelTab2[VoltageLevelTab2["SUBSTATION_TAB"] = 0] = "SUBSTATION_TAB";
|
|
9
10
|
VoltageLevelTab2[VoltageLevelTab2["CHARACTERISTICS_TAB"] = 1] = "CHARACTERISTICS_TAB";
|
|
@@ -52,6 +53,7 @@ const VOLTAGE_LEVEL_TAB_FIELDS = {
|
|
|
52
53
|
]: [FieldConstants.ADDITIONAL_PROPERTIES]
|
|
53
54
|
};
|
|
54
55
|
export {
|
|
56
|
+
MAX_SECTIONS_COUNT,
|
|
55
57
|
VOLTAGE_LEVEL_TAB_FIELDS,
|
|
56
58
|
VoltageLevelTab
|
|
57
59
|
};
|
package/dist/components/network-modifications/voltageLevel/creation/voltageLevelCreation.utils.js
CHANGED
|
@@ -10,6 +10,7 @@ import "react/jsx-runtime";
|
|
|
10
10
|
import "@mui/icons-material";
|
|
11
11
|
import { sanitizeString } from "../../../../utils/ts-utils.js";
|
|
12
12
|
import "../../../../utils/yupConfig.js";
|
|
13
|
+
import { MAX_SECTIONS_COUNT } from "./voltageLevel.constants.js";
|
|
13
14
|
import "@mui/material";
|
|
14
15
|
import "react-intl";
|
|
15
16
|
import "../../../overflowableText/OverflowableText.js";
|
|
@@ -122,7 +123,7 @@ const voltageLevelCreationFormSchema = object().shape({
|
|
|
122
123
|
}),
|
|
123
124
|
[FieldConstants.SECTION_COUNT]: number().typeError(YUP_NOT_TYPE_NUMBER).nullable().when([FieldConstants.HIDE_BUS_BAR_SECTION], {
|
|
124
125
|
is: (hideBusBarSection) => !hideBusBarSection,
|
|
125
|
-
then: (schema) => schema.min(1, "SectionCountMustBeGreaterThanOrEqualToOne").required(YUP_REQUIRED)
|
|
126
|
+
then: (schema) => schema.min(1, "SectionCountMustBeGreaterThanOrEqualToOne").max(MAX_SECTIONS_COUNT, "SectionCountMustBeLessThanOrEqualToTwenty").required(YUP_REQUIRED)
|
|
126
127
|
}),
|
|
127
128
|
[FieldConstants.SWITCHES_BETWEEN_SECTIONS]: string().nullable().when([FieldConstants.SECTION_COUNT], {
|
|
128
129
|
is: (sectionCount) => sectionCount > 1,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SwitchesBetweenSections } from "./creation/tabs/structureTab/switchesBetweenSections/SwitchesBetweenSections.js";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "@mui/material";
|
|
4
|
+
import "react";
|
|
4
5
|
import "react-hook-form";
|
|
5
6
|
import "react-intl";
|
|
6
7
|
import "../../overflowableText/OverflowableText.js";
|
|
@@ -8,7 +9,6 @@ import "../../../utils/conversionUtils.js";
|
|
|
8
9
|
import "../../../utils/types/equipmentType.js";
|
|
9
10
|
import "@mui/icons-material";
|
|
10
11
|
import "../../../utils/yupConfig.js";
|
|
11
|
-
import "react";
|
|
12
12
|
import "localized-countries";
|
|
13
13
|
import "localized-countries/data/fr";
|
|
14
14
|
import "localized-countries/data/en";
|
|
@@ -36,12 +36,14 @@ import "uuid";
|
|
|
36
36
|
import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
37
37
|
import "react-querybuilder";
|
|
38
38
|
import "../common/properties/propertyUtils.js";
|
|
39
|
+
import { MAX_SECTIONS_COUNT } from "./creation/voltageLevel.constants.js";
|
|
39
40
|
import { VoltageLevelCreationForm } from "./creation/VoltageLevelCreationForm.js";
|
|
40
41
|
import { SWITCH_TYPE, buildNewBusbarSections, getCreateSwitchesEmptyFormData, getCreateSwitchesValidationSchema, translateSwitchKinds, voltageLevelCreationDtoToForm, voltageLevelCreationEmptyFormData, voltageLevelCreationFormSchema, voltageLevelCreationFormToDto } from "./creation/voltageLevelCreation.utils.js";
|
|
41
42
|
import { SwitchKind } from "./creation/voltageLevelCreation.types.js";
|
|
42
43
|
import { VoltageLevelModificationForm } from "./modification/VoltageLevelModificationForm.js";
|
|
43
44
|
import { voltageLevelModificationDtoToForm, voltageLevelModificationEmptyFormData, voltageLevelModificationFormSchema, voltageLevelModificationFormToDto } from "./modification/voltageLevelModification.utils.js";
|
|
44
45
|
export {
|
|
46
|
+
MAX_SECTIONS_COUNT,
|
|
45
47
|
SWITCH_TYPE,
|
|
46
48
|
SwitchKind,
|
|
47
49
|
SwitchesBetweenSections,
|
package/dist/index.js
CHANGED
|
@@ -233,6 +233,7 @@ import { substationCreationDtoToForm, substationCreationEmptyFormData, substatio
|
|
|
233
233
|
import { SubstationModificationForm } from "./components/network-modifications/substation/modification/SubstationModificationForm.js";
|
|
234
234
|
import { substationModificationDtoToForm, substationModificationEmptyFormData, substationModificationFormSchema, substationModificationFormToDto } from "./components/network-modifications/substation/modification/substationModification.utils.js";
|
|
235
235
|
import { SwitchesBetweenSections } from "./components/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/SwitchesBetweenSections.js";
|
|
236
|
+
import "react";
|
|
236
237
|
import "react-hook-form";
|
|
237
238
|
import { equalsArray } from "./utils/algos.js";
|
|
238
239
|
import { ActivePowerAdornment, AmpereAdornment, KiloAmpereAdornment, KilometerAdornment, MVAPowerAdornment, MicroSusceptanceAdornment, OhmAdornment, PercentageAdornment, ReactivePowerAdornment, SusceptanceAdornment, VoltageAdornment } from "./utils/constants/adornments.js";
|
|
@@ -272,7 +273,6 @@ import { areIdsEqual, getIdOrSelf, getIdOrValue, getLabelOrValue, getObjectId, n
|
|
|
272
273
|
import { toNumber, validateValueIsANumber } from "./utils/validation-functions.js";
|
|
273
274
|
import { NO_ITEM_SELECTION_FOR_COPY } from "./utils/directory-utils.js";
|
|
274
275
|
import "./utils/yupConfig.js";
|
|
275
|
-
import "react";
|
|
276
276
|
import { fetchAppsMetadata, fetchBaseVoltages, fetchDefaultCountry, fetchEnv, fetchFavoriteAndDefaultCountries, fetchStudyMetadata, isExploreMetadata, isStudyMetadata } from "./services/appsMetadata.js";
|
|
277
277
|
import { fetchConfigParameter, fetchConfigParameters, getAppName, updateConfigParameter } from "./services/config.js";
|
|
278
278
|
import { PermissionType, elementAlreadyExists, fetchDirectoryContent, fetchDirectoryElementPath, fetchElementNames, fetchRootFolders, hasElementPermission } from "./services/directory.js";
|
|
@@ -293,6 +293,7 @@ import { fetchDynamicSimulationParameters, fetchDynamicSimulationProviders, upda
|
|
|
293
293
|
import { fetchContingencyAndFiltersLists, fetchDynamicSecurityAnalysisProviders } from "./services/dynamic-security-analysis.js";
|
|
294
294
|
import { fetchDynamicMarginCalculationParameters, fetchDynamicMarginCalculationProviders, updateDynamicMarginCalculationParameters } from "./services/dynamic-margin-calculation.js";
|
|
295
295
|
import "@mui/icons-material";
|
|
296
|
+
import { MAX_SECTIONS_COUNT } from "./components/network-modifications/voltageLevel/creation/voltageLevel.constants.js";
|
|
296
297
|
import { VoltageLevelCreationForm } from "./components/network-modifications/voltageLevel/creation/VoltageLevelCreationForm.js";
|
|
297
298
|
import { SWITCH_TYPE, buildNewBusbarSections, getCreateSwitchesEmptyFormData, getCreateSwitchesValidationSchema, translateSwitchKinds, voltageLevelCreationDtoToForm, voltageLevelCreationEmptyFormData, voltageLevelCreationFormSchema, voltageLevelCreationFormToDto } from "./components/network-modifications/voltageLevel/creation/voltageLevelCreation.utils.js";
|
|
298
299
|
import { SwitchKind } from "./components/network-modifications/voltageLevel/creation/voltageLevelCreation.types.js";
|
|
@@ -312,6 +313,11 @@ import { emptyModificationByAssignmentFormData, modificationByAssignmentDtoToFor
|
|
|
312
313
|
import { DataType as DataType2 } from "./components/network-modifications/by-filter/assignment/assignment/assignment.type.js";
|
|
313
314
|
import { batteryCreationDtoToForm, batteryCreationEmptyFormData, batteryCreationFormSchema, batteryCreationFormToDto } from "./components/network-modifications/battery/creation/batteryCreation.utils.js";
|
|
314
315
|
import { BatteryCreationForm } from "./components/network-modifications/battery/creation/BatteryCreationForm.js";
|
|
316
|
+
import { CHARACTERISTICS_CHOICES, SHUNT_COMPENSATOR_TYPES, computeSwitchedOnValue } from "./components/network-modifications/shunt-compensator/common/shuntCompensator.utils.js";
|
|
317
|
+
import { CharacteristicsForm } from "./components/network-modifications/shunt-compensator/common/CharacteristicsForm.js";
|
|
318
|
+
import { getCharacteristicsCreateFormDataFromSearchCopy, getCharacteristicsEmptyFormData, getCharacteristicsFormData, getCharacteristicsFormValidationSchema } from "./components/network-modifications/shunt-compensator/common/characteristicsForm.utils.js";
|
|
319
|
+
import { ShuntCompensatorCreationForm } from "./components/network-modifications/shunt-compensator/creation/ShuntCompensatorCreationForm.js";
|
|
320
|
+
import { shuntCompensatorCreationDtoToForm, shuntCompensatorCreationEmptyFormData, shuntCompensatorCreationFormSchema, shuntCompensatorCreationFormToDto } from "./components/network-modifications/shunt-compensator/creation/shuntCompensatorCreation.utils.js";
|
|
315
321
|
import { BuildStatusChip } from "./components/node/build-status-chip.js";
|
|
316
322
|
import { BuildStatus } from "./components/node/constant.js";
|
|
317
323
|
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 "./components/network-modification-table/network-modification-table-styles.js";
|
|
@@ -447,6 +453,7 @@ export {
|
|
|
447
453
|
ByFilterDeletionForm,
|
|
448
454
|
CALCULATION_TYPE,
|
|
449
455
|
CENTER_LABEL,
|
|
456
|
+
CHARACTERISTICS_CHOICES,
|
|
450
457
|
COLUMNS_DEFINITIONS_CONTINGENCY_LISTS_INFOS,
|
|
451
458
|
COLUMNS_DEFINITIONS_HVDCS,
|
|
452
459
|
COLUMNS_DEFINITIONS_INJECTIONS,
|
|
@@ -474,6 +481,7 @@ export {
|
|
|
474
481
|
CalculationType,
|
|
475
482
|
CancelButton,
|
|
476
483
|
CardErrorBoundary,
|
|
484
|
+
CharacteristicsForm,
|
|
477
485
|
CheckBoxList,
|
|
478
486
|
CheckboxInput,
|
|
479
487
|
CheckboxNullableInput,
|
|
@@ -676,6 +684,7 @@ export {
|
|
|
676
684
|
MAX_CHAR_DESCRIPTION,
|
|
677
685
|
MAX_COMPOSITE_NESTING_DEPTH,
|
|
678
686
|
MAX_ROWS_NUMBER,
|
|
687
|
+
MAX_SECTIONS_COUNT,
|
|
679
688
|
MAX_VALUE_ALLOWED_FOR_LIMIT_REDUCTION,
|
|
680
689
|
MEGA_VAR,
|
|
681
690
|
MEGA_VOLT_AMPERE,
|
|
@@ -823,6 +832,7 @@ export {
|
|
|
823
832
|
SHOW_AUTH_INFO_LOGIN,
|
|
824
833
|
SHUNT_COMPENSATORS_SELECTION_TYPE,
|
|
825
834
|
SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD,
|
|
835
|
+
SHUNT_COMPENSATOR_TYPES,
|
|
826
836
|
SHUNT_COMPENSATOR_TYPE_OPTIONS,
|
|
827
837
|
SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON,
|
|
828
838
|
SIEMENS,
|
|
@@ -854,6 +864,7 @@ export {
|
|
|
854
864
|
ShortCircuitParametersEditionDialog,
|
|
855
865
|
ShortCircuitParametersInLine,
|
|
856
866
|
ShuntCompensator,
|
|
867
|
+
ShuntCompensatorCreationForm,
|
|
857
868
|
ShuntCompensatorSelectionForm,
|
|
858
869
|
SignInCallbackHandler,
|
|
859
870
|
SilentRenewCallbackHandler,
|
|
@@ -949,6 +960,7 @@ export {
|
|
|
949
960
|
commonButtonFr,
|
|
950
961
|
componentsEn,
|
|
951
962
|
componentsFr,
|
|
963
|
+
computeSwitchedOnValue,
|
|
952
964
|
computeTagMinSize,
|
|
953
965
|
convertInputValue,
|
|
954
966
|
convertOutputValue,
|
|
@@ -1074,6 +1086,10 @@ export {
|
|
|
1074
1086
|
getBranchActiveReactivePowerEmptyFormDataProperties,
|
|
1075
1087
|
getBranchActiveReactivePowerValidationSchema,
|
|
1076
1088
|
getBranchActiveReactivePowerValidationSchemaProperties,
|
|
1089
|
+
getCharacteristicsCreateFormDataFromSearchCopy,
|
|
1090
|
+
getCharacteristicsEmptyFormData,
|
|
1091
|
+
getCharacteristicsFormData,
|
|
1092
|
+
getCharacteristicsFormValidationSchema,
|
|
1077
1093
|
getComputedLanguage,
|
|
1078
1094
|
getCon1andCon2WithPositionValidationSchema,
|
|
1079
1095
|
getConcatenatedProperties,
|
|
@@ -1261,6 +1277,10 @@ export {
|
|
|
1261
1277
|
setStudyNetworkVisualizationParameters,
|
|
1262
1278
|
setUnauthorizedUserInfo,
|
|
1263
1279
|
setUserValidationError,
|
|
1280
|
+
shuntCompensatorCreationDtoToForm,
|
|
1281
|
+
shuntCompensatorCreationEmptyFormData,
|
|
1282
|
+
shuntCompensatorCreationFormSchema,
|
|
1283
|
+
shuntCompensatorCreationFormToDto,
|
|
1264
1284
|
snackWithFallback,
|
|
1265
1285
|
standardTextField,
|
|
1266
1286
|
styles,
|
|
@@ -77,8 +77,10 @@ export declare const networkModificationsEn: {
|
|
|
77
77
|
AddProperty: string;
|
|
78
78
|
PropertyName: string;
|
|
79
79
|
PropertyValue: string;
|
|
80
|
+
ID: string;
|
|
80
81
|
Name: string;
|
|
81
82
|
Country: string;
|
|
83
|
+
Characteristics: string;
|
|
82
84
|
CreateVoltageLevel: string;
|
|
83
85
|
VoltageLevelCreationError: string;
|
|
84
86
|
ModifyVoltageLevel: string;
|
|
@@ -110,6 +112,7 @@ export declare const networkModificationsEn: {
|
|
|
110
112
|
Disconnector: string;
|
|
111
113
|
BusBarCountMustBeGreaterThanOrEqualToOne: string;
|
|
112
114
|
SectionCountMustBeGreaterThanOrEqualToOne: string;
|
|
115
|
+
SectionCountMustBeLessThanOrEqualToTwenty: string;
|
|
113
116
|
mustBeGreaterOrEqualToZero: string;
|
|
114
117
|
CreateCouplingDeviceIdenticalBusBar: string;
|
|
115
118
|
CreateSubstationInVoltageLevelIdenticalId: string;
|
|
@@ -121,6 +124,17 @@ export declare const networkModificationsEn: {
|
|
|
121
124
|
YupNotTypeNumber: string;
|
|
122
125
|
CreateLoad: string;
|
|
123
126
|
loadType: string;
|
|
127
|
+
CreateShuntCompensator: string;
|
|
128
|
+
ShuntCompensatorCreationError: string;
|
|
129
|
+
Reactor: string;
|
|
130
|
+
Capacitor: string;
|
|
131
|
+
QatNominalVLabel: string;
|
|
132
|
+
SusceptanceLabel: string;
|
|
133
|
+
SwitchedOnMaxQAtNominalV: string;
|
|
134
|
+
SwitchedOnMaxSusceptance: string;
|
|
135
|
+
ShuntCompensatorErrorQAtNominalVoltageLessThanZero: string;
|
|
136
|
+
MaximumSectionCountMustBeGreaterOrEqualToOne: string;
|
|
137
|
+
SectionCountMustBeBetweenZeroAndMaximumSectionCount: string;
|
|
124
138
|
VOLTAGE_LEVEL: string;
|
|
125
139
|
BusBarBus: string;
|
|
126
140
|
ConnectionName: string;
|
|
@@ -83,8 +83,10 @@ const networkModificationsEn = {
|
|
|
83
83
|
AddProperty: "Add property",
|
|
84
84
|
PropertyName: "Property name",
|
|
85
85
|
PropertyValue: "Property value",
|
|
86
|
+
ID: "ID",
|
|
86
87
|
Name: "Name",
|
|
87
88
|
Country: "Country",
|
|
89
|
+
Characteristics: "Characteristics",
|
|
88
90
|
CreateVoltageLevel: "Create voltage level",
|
|
89
91
|
VoltageLevelCreationError: "Error while creating voltage level",
|
|
90
92
|
ModifyVoltageLevel: "Modify a voltage level",
|
|
@@ -116,6 +118,7 @@ const networkModificationsEn = {
|
|
|
116
118
|
Disconnector: "Disconnector",
|
|
117
119
|
BusBarCountMustBeGreaterThanOrEqualToOne: "Number of busbars must be greater than or equal to 1",
|
|
118
120
|
SectionCountMustBeGreaterThanOrEqualToOne: "Number of sections must be greater than or equal to 1",
|
|
121
|
+
SectionCountMustBeLessThanOrEqualToTwenty: "Number of sections must be less than or equal to 20",
|
|
119
122
|
mustBeGreaterOrEqualToZero: "Must be greater than or equal to 0",
|
|
120
123
|
CreateCouplingDeviceIdenticalBusBar: "Bus bar section / bus 1 and 2 must be different",
|
|
121
124
|
CreateSubstationInVoltageLevelIdenticalId: "Voltage Level ID can not match Substation ID",
|
|
@@ -127,6 +130,17 @@ const networkModificationsEn = {
|
|
|
127
130
|
YupNotTypeNumber: "This field only accepts numeric values",
|
|
128
131
|
CreateLoad: "Create load",
|
|
129
132
|
loadType: "Type",
|
|
133
|
+
CreateShuntCompensator: "Create shunt compensator (Linear)",
|
|
134
|
+
ShuntCompensatorCreationError: "Error while creating shunt compensator",
|
|
135
|
+
Reactor: "Reactor",
|
|
136
|
+
Capacitor: "Capacitor",
|
|
137
|
+
QatNominalVLabel: "Q at nominal voltage (Mvar)",
|
|
138
|
+
SusceptanceLabel: "Susceptance (S)",
|
|
139
|
+
SwitchedOnMaxQAtNominalV: "Switch-on Q at nominal voltage",
|
|
140
|
+
SwitchedOnMaxSusceptance: "Switch-on susceptance",
|
|
141
|
+
ShuntCompensatorErrorQAtNominalVoltageLessThanZero: "Q at nominal voltage value should be greater than or equal to 0",
|
|
142
|
+
MaximumSectionCountMustBeGreaterOrEqualToOne: "Maximum section count must be greater than or equal to 1",
|
|
143
|
+
SectionCountMustBeBetweenZeroAndMaximumSectionCount: "Section count must be between 0 and Maximum section count",
|
|
130
144
|
VOLTAGE_LEVEL: "Voltage Level",
|
|
131
145
|
BusBarBus: "Bus bar section / bus",
|
|
132
146
|
ConnectionName: "Connection name",
|
|
@@ -77,8 +77,10 @@ export declare const networkModificationsFr: {
|
|
|
77
77
|
AddProperty: string;
|
|
78
78
|
PropertyName: string;
|
|
79
79
|
PropertyValue: string;
|
|
80
|
+
ID: string;
|
|
80
81
|
Name: string;
|
|
81
82
|
Country: string;
|
|
83
|
+
Characteristics: string;
|
|
82
84
|
CreateVoltageLevel: string;
|
|
83
85
|
VoltageLevelCreationError: string;
|
|
84
86
|
ModifyVoltageLevel: string;
|
|
@@ -110,6 +112,7 @@ export declare const networkModificationsFr: {
|
|
|
110
112
|
Disconnector: string;
|
|
111
113
|
BusBarCountMustBeGreaterThanOrEqualToOne: string;
|
|
112
114
|
SectionCountMustBeGreaterThanOrEqualToOne: string;
|
|
115
|
+
SectionCountMustBeLessThanOrEqualToTwenty: string;
|
|
113
116
|
mustBeGreaterOrEqualToZero: string;
|
|
114
117
|
CreateCouplingDeviceIdenticalBusBar: string;
|
|
115
118
|
CreateSubstationInVoltageLevelIdenticalId: string;
|
|
@@ -121,6 +124,17 @@ export declare const networkModificationsFr: {
|
|
|
121
124
|
YupNotTypeNumber: string;
|
|
122
125
|
CreateLoad: string;
|
|
123
126
|
loadType: string;
|
|
127
|
+
CreateShuntCompensator: string;
|
|
128
|
+
ShuntCompensatorCreationError: string;
|
|
129
|
+
Reactor: string;
|
|
130
|
+
Capacitor: string;
|
|
131
|
+
QatNominalVLabel: string;
|
|
132
|
+
SusceptanceLabel: string;
|
|
133
|
+
SwitchedOnMaxQAtNominalV: string;
|
|
134
|
+
SwitchedOnMaxSusceptance: string;
|
|
135
|
+
ShuntCompensatorErrorQAtNominalVoltageLessThanZero: string;
|
|
136
|
+
MaximumSectionCountMustBeGreaterOrEqualToOne: string;
|
|
137
|
+
SectionCountMustBeBetweenZeroAndMaximumSectionCount: string;
|
|
124
138
|
VOLTAGE_LEVEL: string;
|
|
125
139
|
BusBarBus: string;
|
|
126
140
|
ConnectionName: string;
|
|
@@ -83,8 +83,10 @@ const networkModificationsFr = {
|
|
|
83
83
|
AddProperty: "Ajouter une propriété",
|
|
84
84
|
PropertyName: "Nom de la propriété",
|
|
85
85
|
PropertyValue: "Valeur de la propriété",
|
|
86
|
+
ID: "ID",
|
|
86
87
|
Name: "Nom",
|
|
87
88
|
Country: "Pays",
|
|
89
|
+
Characteristics: "Caractéristiques",
|
|
88
90
|
CreateVoltageLevel: "Créer un poste",
|
|
89
91
|
VoltageLevelCreationError: "Erreur lors de la création d'un poste",
|
|
90
92
|
ModifyVoltageLevel: "Modifier un poste",
|
|
@@ -116,6 +118,7 @@ const networkModificationsFr = {
|
|
|
116
118
|
Disconnector: "Sectionneur",
|
|
117
119
|
BusBarCountMustBeGreaterThanOrEqualToOne: "Un nombre de barres doit être supérieur ou égal à 1",
|
|
118
120
|
SectionCountMustBeGreaterThanOrEqualToOne: "Un nombre de sections doit être supérieur ou égal à 1",
|
|
121
|
+
SectionCountMustBeLessThanOrEqualToTwenty: "Un nombre de sections doit être inférieur ou égal à 20",
|
|
119
122
|
mustBeGreaterOrEqualToZero: "Cette valeur doit être supérieure ou égale à 0",
|
|
120
123
|
CreateCouplingDeviceIdenticalBusBar: "Les SJB / Nœuds 1 et 2 doivent être différents",
|
|
121
124
|
CreateSubstationInVoltageLevelIdenticalId: "L'ID du poste doit être différent de celui du site",
|
|
@@ -127,6 +130,17 @@ const networkModificationsFr = {
|
|
|
127
130
|
YupNotTypeNumber: "Ce champ n'accepte que des valeurs numériques",
|
|
128
131
|
CreateLoad: "Créer une consommation",
|
|
129
132
|
loadType: "Type",
|
|
133
|
+
CreateShuntCompensator: "Créer un moyen de compensation statique (Linéaire)",
|
|
134
|
+
ShuntCompensatorCreationError: "Erreur lors de la création d'un moyen de compensation",
|
|
135
|
+
Reactor: "Réactance",
|
|
136
|
+
Capacitor: "Condensateur",
|
|
137
|
+
QatNominalVLabel: "Q à Unom (Mvar)",
|
|
138
|
+
SusceptanceLabel: "Susceptance (S)",
|
|
139
|
+
SwitchedOnMaxQAtNominalV: "Q enclenchée à tension nominale",
|
|
140
|
+
SwitchedOnMaxSusceptance: "Susceptance enclenchée",
|
|
141
|
+
ShuntCompensatorErrorQAtNominalVoltageLessThanZero: "La valeur de Q à Unom doit être supérieure ou égale à 0",
|
|
142
|
+
MaximumSectionCountMustBeGreaterOrEqualToOne: "Le nombre de gradins doit être supérieur ou égal à 1",
|
|
143
|
+
SectionCountMustBeBetweenZeroAndMaximumSectionCount: "La valeur de la prise courante doit être comprise entre 0 et le nombre de gradins",
|
|
130
144
|
VOLTAGE_LEVEL: "Poste",
|
|
131
145
|
BusBarBus: "SJB / nœud",
|
|
132
146
|
ConnectionName: "Nom départ",
|
|
@@ -16,6 +16,7 @@ export declare enum FieldConstants {
|
|
|
16
16
|
CASE_FORMAT = "caseFormat",
|
|
17
17
|
CASE_NAME = "caseName",
|
|
18
18
|
CASE_UUID = "caseUuid",
|
|
19
|
+
CHARACTERISTICS_CHOICE = "characteristicsChoice",
|
|
19
20
|
CONNECTED = "terminalConnected",
|
|
20
21
|
CONNECTION_DIRECTION = "connectionDirection",
|
|
21
22
|
CONNECTION_NAME = "connectionName",
|
|
@@ -55,7 +56,10 @@ export declare enum FieldConstants {
|
|
|
55
56
|
ID = "id",
|
|
56
57
|
LOAD_TYPE = "loadType",
|
|
57
58
|
MARGINAL_COST = "marginalCost",
|
|
59
|
+
MAX_Q_AT_NOMINAL_V = "maxQAtNominalV",
|
|
60
|
+
MAX_SUSCEPTANCE = "maxSusceptance",
|
|
58
61
|
MAXIMUM_ACTIVE_POWER = "maximumActivePower",
|
|
62
|
+
MAXIMUM_SECTION_COUNT = "maximumSectionCount",
|
|
59
63
|
MEASUREMENT_P = "measurementP",
|
|
60
64
|
MEASUREMENT_P1 = "measurementP1",
|
|
61
65
|
MEASUREMENT_P2 = "measurementP2",
|
|
@@ -82,7 +86,10 @@ export declare enum FieldConstants {
|
|
|
82
86
|
SHUNT_COMPENSATOR_SIDE_1 = "mcsOnSide1",
|
|
83
87
|
SHUNT_COMPENSATOR_SIDE_2 = "mcsOnSide2",
|
|
84
88
|
SHUNT_COMPENSATOR_SELECTED = "connectedToHvdc",
|
|
89
|
+
SHUNT_COMPENSATOR_TYPE = "shuntCompensatorType",
|
|
85
90
|
STATE_ESTIMATION = "stateEstimation",
|
|
91
|
+
SWITCHED_ON_Q_AT_NOMINAL_V = "switchedOnQAtNominalV",
|
|
92
|
+
SWITCHED_ON_SUSCEPTANCE = "switchedOnSusceptance",
|
|
86
93
|
STUDY_NAME = "studyName",
|
|
87
94
|
TYPE = "type",
|
|
88
95
|
VALIDITY = "validity",
|
|
@@ -10,6 +10,7 @@ var FieldConstants = /* @__PURE__ */ ((FieldConstants2) => {
|
|
|
10
10
|
FieldConstants2["CASE_FORMAT"] = "caseFormat";
|
|
11
11
|
FieldConstants2["CASE_NAME"] = "caseName";
|
|
12
12
|
FieldConstants2["CASE_UUID"] = "caseUuid";
|
|
13
|
+
FieldConstants2["CHARACTERISTICS_CHOICE"] = "characteristicsChoice";
|
|
13
14
|
FieldConstants2["CONNECTED"] = "terminalConnected";
|
|
14
15
|
FieldConstants2["CONNECTION_DIRECTION"] = "connectionDirection";
|
|
15
16
|
FieldConstants2["CONNECTION_NAME"] = "connectionName";
|
|
@@ -49,7 +50,10 @@ var FieldConstants = /* @__PURE__ */ ((FieldConstants2) => {
|
|
|
49
50
|
FieldConstants2["ID"] = "id";
|
|
50
51
|
FieldConstants2["LOAD_TYPE"] = "loadType";
|
|
51
52
|
FieldConstants2["MARGINAL_COST"] = "marginalCost";
|
|
53
|
+
FieldConstants2["MAX_Q_AT_NOMINAL_V"] = "maxQAtNominalV";
|
|
54
|
+
FieldConstants2["MAX_SUSCEPTANCE"] = "maxSusceptance";
|
|
52
55
|
FieldConstants2["MAXIMUM_ACTIVE_POWER"] = "maximumActivePower";
|
|
56
|
+
FieldConstants2["MAXIMUM_SECTION_COUNT"] = "maximumSectionCount";
|
|
53
57
|
FieldConstants2["MEASUREMENT_P"] = "measurementP";
|
|
54
58
|
FieldConstants2["MEASUREMENT_P1"] = "measurementP1";
|
|
55
59
|
FieldConstants2["MEASUREMENT_P2"] = "measurementP2";
|
|
@@ -76,7 +80,10 @@ var FieldConstants = /* @__PURE__ */ ((FieldConstants2) => {
|
|
|
76
80
|
FieldConstants2["SHUNT_COMPENSATOR_SIDE_1"] = "mcsOnSide1";
|
|
77
81
|
FieldConstants2["SHUNT_COMPENSATOR_SIDE_2"] = "mcsOnSide2";
|
|
78
82
|
FieldConstants2["SHUNT_COMPENSATOR_SELECTED"] = "connectedToHvdc";
|
|
83
|
+
FieldConstants2["SHUNT_COMPENSATOR_TYPE"] = "shuntCompensatorType";
|
|
79
84
|
FieldConstants2["STATE_ESTIMATION"] = "stateEstimation";
|
|
85
|
+
FieldConstants2["SWITCHED_ON_Q_AT_NOMINAL_V"] = "switchedOnQAtNominalV";
|
|
86
|
+
FieldConstants2["SWITCHED_ON_SUSCEPTANCE"] = "switchedOnSusceptance";
|
|
80
87
|
FieldConstants2["STUDY_NAME"] = "studyName";
|
|
81
88
|
FieldConstants2["TYPE"] = "type";
|
|
82
89
|
FieldConstants2["VALIDITY"] = "validity";
|
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { CreateSwitchesFormData, SwitchKindFormData } from '../../../../voltageLevelCreation.types';
|
|
3
|
-
interface CreateSwitchesDialogProps {
|
|
4
|
-
sectionCount: number;
|
|
5
|
-
handleCreateSwitchesDialog: (data: CreateSwitchesFormData) => void;
|
|
6
|
-
setOpenCreateSwitchesDialog: React.Dispatch<React.SetStateAction<boolean>>;
|
|
7
|
-
openCreateSwitchesDialog: boolean;
|
|
8
|
-
switchKinds: SwitchKindFormData[];
|
|
9
|
-
}
|
|
10
|
-
export declare function CreateSwitchesDialog({ sectionCount, handleCreateSwitchesDialog, setOpenCreateSwitchesDialog, openCreateSwitchesDialog, switchKinds, }: Readonly<CreateSwitchesDialogProps>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Dialog, DialogActions } from "@mui/material";
|
|
3
|
-
import { useForm } from "react-hook-form";
|
|
4
|
-
import { yupResolver } from "@hookform/resolvers/yup";
|
|
5
|
-
import { useEffect } from "react";
|
|
6
|
-
import { object } from "yup";
|
|
7
|
-
import { getCreateSwitchesValidationSchema, getCreateSwitchesEmptyFormData } from "../../../../voltageLevelCreation.utils.js";
|
|
8
|
-
import { FieldConstants } from "../../../../../../../../utils/constants/fieldConstants.js";
|
|
9
|
-
import "../../../../../../../../utils/conversionUtils.js";
|
|
10
|
-
import "../../../../../../../../utils/types/equipmentType.js";
|
|
11
|
-
import "@mui/icons-material";
|
|
12
|
-
import "../../../../../../../../utils/yupConfig.js";
|
|
13
|
-
import "react-intl";
|
|
14
|
-
import "../../../../../../../overflowableText/OverflowableText.js";
|
|
15
|
-
import "localized-countries";
|
|
16
|
-
import "localized-countries/data/fr";
|
|
17
|
-
import "localized-countries/data/en";
|
|
18
|
-
import "notistack";
|
|
19
|
-
import { CustomFormProvider } from "../../../../../../../inputs/reactHookForm/provider/CustomFormProvider.js";
|
|
20
|
-
import { CancelButton } from "../../../../../../../inputs/reactHookForm/utils/CancelButton.js";
|
|
21
|
-
import "../../../../../../../treeViewFinder/TreeViewFinder.js";
|
|
22
|
-
import "../../../../../../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
23
|
-
import "../../../../../../../customAGGrid/customAggrid.js";
|
|
24
|
-
import "ag-grid-community";
|
|
25
|
-
import "react-papaparse";
|
|
26
|
-
import "react-csv-downloader";
|
|
27
|
-
import "../../../../../../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
28
|
-
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
29
|
-
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
30
|
-
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
31
|
-
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
32
|
-
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
33
|
-
import "../../../../../../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
34
|
-
import "../../../../../../../inputs/reactHookForm/expandableInput/ExpandableInput.js";
|
|
35
|
-
import "@react-querybuilder/material";
|
|
36
|
-
import "../../../../../../../filter/expert/expertFilterConstants.js";
|
|
37
|
-
import "../../../../../../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
38
|
-
import "uuid";
|
|
39
|
-
import "../../../../../../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
40
|
-
import "react-querybuilder";
|
|
41
|
-
import CreateSwitchesForm from "./CreateSwitchesForm.js";
|
|
42
|
-
import { CreateSwitchesDialogSubmitButton } from "./CreateSwitchesDialogSubmitButton.js";
|
|
43
|
-
const formSchema = object().shape({
|
|
44
|
-
...getCreateSwitchesValidationSchema()
|
|
45
|
-
});
|
|
46
|
-
function CreateSwitchesDialog({
|
|
47
|
-
sectionCount,
|
|
48
|
-
handleCreateSwitchesDialog,
|
|
49
|
-
setOpenCreateSwitchesDialog,
|
|
50
|
-
openCreateSwitchesDialog,
|
|
51
|
-
switchKinds
|
|
52
|
-
}) {
|
|
53
|
-
const emptyFormData = getCreateSwitchesEmptyFormData(sectionCount);
|
|
54
|
-
const formMethods = useForm({
|
|
55
|
-
defaultValues: emptyFormData,
|
|
56
|
-
resolver: yupResolver(formSchema)
|
|
57
|
-
});
|
|
58
|
-
const { reset } = formMethods;
|
|
59
|
-
useEffect(() => {
|
|
60
|
-
if (switchKinds?.length > 0) {
|
|
61
|
-
reset({
|
|
62
|
-
[FieldConstants.SWITCH_KINDS]: switchKinds
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
}, [switchKinds, reset]);
|
|
66
|
-
const handleCloseDialog = () => {
|
|
67
|
-
reset(emptyFormData);
|
|
68
|
-
setOpenCreateSwitchesDialog(false);
|
|
69
|
-
};
|
|
70
|
-
const handleSave = (data) => {
|
|
71
|
-
handleCreateSwitchesDialog(data);
|
|
72
|
-
handleCloseDialog();
|
|
73
|
-
};
|
|
74
|
-
return /* @__PURE__ */ jsx(Dialog, { open: openCreateSwitchesDialog, fullWidth: true, children: /* @__PURE__ */ jsxs(CustomFormProvider, { validationSchema: formSchema, ...formMethods, children: [
|
|
75
|
-
/* @__PURE__ */ jsx(CreateSwitchesForm, { id: FieldConstants.SWITCH_KINDS }),
|
|
76
|
-
/* @__PURE__ */ jsxs(DialogActions, { children: [
|
|
77
|
-
/* @__PURE__ */ jsx(CancelButton, { onClick: handleCloseDialog }),
|
|
78
|
-
/* @__PURE__ */ jsx(CreateSwitchesDialogSubmitButton, { handleSave })
|
|
79
|
-
] })
|
|
80
|
-
] }) });
|
|
81
|
-
}
|
|
82
|
-
export {
|
|
83
|
-
CreateSwitchesDialog
|
|
84
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { CreateSwitchesFormData } from '../../../../voltageLevelCreation.types';
|
|
2
|
-
interface CreateSwitchesDialogSubmitButtonProps {
|
|
3
|
-
handleSave: (data: CreateSwitchesFormData) => void | Promise<void>;
|
|
4
|
-
}
|
|
5
|
-
export declare function CreateSwitchesDialogSubmitButton({ handleSave }: Readonly<CreateSwitchesDialogSubmitButtonProps>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Button } from "@mui/material";
|
|
3
|
-
import { useFormContext } from "react-hook-form";
|
|
4
|
-
import { FormattedMessage } from "react-intl";
|
|
5
|
-
function CreateSwitchesDialogSubmitButton({ handleSave }) {
|
|
6
|
-
const { handleSubmit } = useFormContext();
|
|
7
|
-
return /* @__PURE__ */ jsx(Button, { onClick: handleSubmit(handleSave), variant: "outlined", children: /* @__PURE__ */ jsx(FormattedMessage, { id: "validate" }) });
|
|
8
|
-
}
|
|
9
|
-
export {
|
|
10
|
-
CreateSwitchesDialogSubmitButton
|
|
11
|
-
};
|