@gridsuite/commons-ui 0.269.0 → 0.271.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/ui/dialogs/customMuiDialog/CustomMuiDialog.d.ts +10 -3
- package/dist/components/ui/dialogs/customMuiDialog/CustomMuiDialog.js +33 -28
- package/dist/features/index.js +96 -3
- package/dist/features/network-modifications/common/branch/branchCreation.types.d.ts +26 -0
- package/dist/features/network-modifications/common/branch/branchModification.types.d.ts +36 -0
- package/dist/features/network-modifications/common/branch/branchModification.types.js +1 -0
- package/dist/features/network-modifications/{line/characteristics/lineCharacteristicsPane.types.d.ts → common/branch/index.d.ts} +2 -8
- package/dist/features/network-modifications/common/branch/index.js +1 -0
- package/dist/features/network-modifications/common/connectivity/connectivityForm.utils.d.ts +2 -0
- package/dist/features/network-modifications/common/currentLimits/limits.types.d.ts +1 -0
- package/dist/features/network-modifications/common/currentLimits/limitsPane.utils.d.ts +2 -2
- package/dist/features/network-modifications/common/index.d.ts +1 -0
- package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/reactiveCapability.utils.js +1 -1
- package/dist/features/network-modifications/common/regulatingTerminal/regulatingTerminal.utils.d.ts +2 -2
- package/dist/features/network-modifications/common/regulatingTerminal/regulatingTerminal.utils.js +2 -2
- package/dist/features/network-modifications/index.d.ts +1 -0
- package/dist/features/network-modifications/index.js +96 -3
- package/dist/features/network-modifications/line/characteristics/index.d.ts +0 -1
- package/dist/features/network-modifications/line/characteristics/index.js +1 -2
- package/dist/features/network-modifications/line/characteristics/lineCharacteristicsPane.utils.d.ts +4 -19
- package/dist/features/network-modifications/line/characteristics/lineCharacteristicsPane.utils.js +0 -14
- package/dist/features/network-modifications/line/creation/lineCreation.types.d.ts +6 -26
- package/dist/features/network-modifications/line/index.js +1 -2
- package/dist/features/network-modifications/line/modification/lineModification.types.d.ts +3 -35
- package/dist/features/network-modifications/twoWindingsTransformer/characteristics/TwoWindingsTransformerCharacteristicsPane.d.ts +7 -0
- package/dist/features/network-modifications/twoWindingsTransformer/characteristics/TwoWindingsTransformerCharacteristicsPane.js +168 -0
- package/dist/features/network-modifications/twoWindingsTransformer/characteristics/index.d.ts +8 -0
- package/dist/features/network-modifications/twoWindingsTransformer/characteristics/index.js +8 -0
- package/dist/features/network-modifications/twoWindingsTransformer/characteristics/twoWindingsTransformerCharacteristicsPane.utils.d.ts +41 -0
- package/dist/features/network-modifications/twoWindingsTransformer/characteristics/twoWindingsTransformerCharacteristicsPane.utils.js +51 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogHeader.d.ts +6 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogHeader.js +123 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogTabs.d.ts +9 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogTabs.js +89 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogTabsContent.d.ts +14 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogTabsContent.js +118 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerForm.d.ts +6 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerForm.js +47 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/index.d.ts +12 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/index.js +13 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/twoWindingsTransformer.types.d.ts +87 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/twoWindingsTransformer.types.js +1 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/twoWindingsTransformer.utils.d.ts +10 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/twoWindingsTransformer.utils.js +50 -0
- package/dist/features/network-modifications/twoWindingsTransformer/creation/index.d.ts +8 -0
- package/dist/features/network-modifications/twoWindingsTransformer/creation/index.js +12 -0
- package/dist/features/network-modifications/twoWindingsTransformer/creation/twoWindingsTransformerCreation.types.d.ts +47 -0
- package/dist/features/network-modifications/twoWindingsTransformer/creation/twoWindingsTransformerCreation.types.js +8 -0
- package/dist/features/network-modifications/twoWindingsTransformer/creation/twoWindingsTransformerCreation.utils.d.ts +248 -0
- package/dist/features/network-modifications/twoWindingsTransformer/creation/twoWindingsTransformerCreation.utils.js +325 -0
- package/dist/features/network-modifications/twoWindingsTransformer/index.d.ts +11 -0
- package/dist/features/network-modifications/twoWindingsTransformer/index.js +88 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/index.d.ts +9 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/index.js +10 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/ToBeEstimatedForm.d.ts +6 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/ToBeEstimatedForm.js +104 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/index.d.ts +9 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/index.js +7 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/toBeEstimated.type.d.ts +10 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/toBeEstimated.type.js +1 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/toBeEstimated.utils.d.ts +12 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/toBeEstimated.utils.js +18 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/twoWindingsTransformerModification.types.d.ts +39 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/twoWindingsTransformerModification.types.js +1 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/twoWindingsTransformerModification.utils.d.ts +265 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/twoWindingsTransformerModification.utils.js +100 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/RegulatedTerminalSection.d.ts +13 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/RegulatedTerminalSection.js +130 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/TapChangerSteps.d.ts +20 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/TapChangerSteps.js +311 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/index.d.ts +12 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/index.js +53 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/PhaseTapChangerPane.d.ts +2 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/PhaseTapChangerPane.js +198 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/PhaseTapChangerPaneSteps.d.ts +9 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/PhaseTapChangerPaneSteps.js +201 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/index.d.ts +9 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/index.js +15 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/phaseTapChanger.utils.d.ts +114 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/phaseTapChanger.utils.js +242 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/RatioTapChangerPane.d.ts +2 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/RatioTapChangerPane.js +283 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/RatioTapChangerPaneSteps.d.ts +9 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/RatioTapChangerPaneSteps.js +181 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/index.d.ts +9 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/index.js +18 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/ratioTapChanger.utils.d.ts +132 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/ratioTapChanger.utils.js +211 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/CreateRuleDialog.d.ts +2 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/CreateRuleDialog.js +102 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/CreateRuleDialogSubmitButton.d.ts +7 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/CreateRuleDialogSubmitButton.js +22 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/CreateRuleForm.d.ts +6 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/CreateRuleForm.js +86 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/ImportRuleDialog.d.ts +10 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/ImportRuleDialog.js +140 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/index.d.ts +12 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/index.js +13 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/regulationRule.types.d.ts +12 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/regulationRule.types.js +1 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/regulationRule.utils.d.ts +9 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/regulationRule.utils.js +19 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/tapChanger.utils.d.ts +14 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/tapChanger.utils.js +79 -0
- package/dist/features/network-modifications/voltageLevel/index.d.ts +1 -0
- package/dist/features/network-modifications/voltageLevel/index.js +9 -1
- package/dist/features/network-modifications/voltageLevel/section/VoltageLevelSectionCreationForm.d.ts +10 -0
- package/dist/features/network-modifications/voltageLevel/section/VoltageLevelSectionCreationForm.js +375 -0
- package/dist/features/network-modifications/voltageLevel/section/index.d.ts +9 -0
- package/dist/features/network-modifications/voltageLevel/section/index.js +10 -0
- package/dist/features/network-modifications/voltageLevel/section/voltageLevelSectionCreation.types.d.ts +15 -0
- package/dist/features/network-modifications/voltageLevel/section/voltageLevelSectionCreation.types.js +1 -0
- package/dist/features/network-modifications/voltageLevel/section/voltageLevelSectionCreation.utils.d.ts +48 -0
- package/dist/features/network-modifications/voltageLevel/section/voltageLevelSectionCreation.utils.js +100 -0
- package/dist/index.js +107 -7
- package/dist/translations/en/filterExpertEn.d.ts +0 -3
- package/dist/translations/en/filterExpertEn.js +0 -3
- package/dist/translations/en/network-modification-validationEn.d.ts +1 -0
- package/dist/translations/en/network-modification-validationEn.js +2 -1
- package/dist/translations/en/networkModificationsEn.d.ts +87 -9
- package/dist/translations/en/networkModificationsEn.js +91 -12
- package/dist/translations/fr/filterExpertFr.d.ts +0 -3
- package/dist/translations/fr/filterExpertFr.js +0 -3
- package/dist/translations/fr/network-modification-validationFr.d.ts +1 -0
- package/dist/translations/fr/network-modification-validationFr.js +2 -1
- package/dist/translations/fr/networkModificationsFr.d.ts +87 -9
- package/dist/translations/fr/networkModificationsFr.js +91 -12
- package/dist/utils/constants/fieldConstants.d.ts +37 -0
- package/dist/utils/constants/fieldConstants.js +37 -0
- package/dist/utils/constants/index.js +2 -1
- package/dist/utils/constants/translationKeys.d.ts +1 -0
- package/dist/utils/constants/translationKeys.js +2 -0
- package/dist/utils/functions.d.ts +9 -0
- package/dist/utils/functions.js +40 -0
- package/dist/utils/index.js +11 -4
- package/dist/utils/langs.d.ts +1 -0
- package/dist/utils/langs.js +9 -1
- package/dist/utils/types/equipmentType.d.ts +34 -0
- package/dist/utils/types/equipmentType.js +28 -0
- package/dist/utils/types/index.js +4 -1
- package/package.json +1 -1
- /package/dist/features/network-modifications/{line/characteristics/lineCharacteristicsPane.types.js → common/branch/branchCreation.types.js} +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CreateRuleFormInput } from './regulationRule.types';
|
|
2
|
+
export declare const getCreateRuleValidationSchema: () => import('yup').ObjectSchema<{
|
|
3
|
+
lowTapPosition: number;
|
|
4
|
+
highTapPosition: number;
|
|
5
|
+
}, import('yup').AnyObject, {
|
|
6
|
+
lowTapPosition: undefined;
|
|
7
|
+
highTapPosition: undefined;
|
|
8
|
+
}, "">;
|
|
9
|
+
export declare const getCreateRuleEmptyFormData: () => CreateRuleFormInput;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { object, number } from "yup";
|
|
2
|
+
import { FieldConstants } from "../../../../../utils/constants/fieldConstants.js";
|
|
3
|
+
import "../../../../../utils/conversionUtils.js";
|
|
4
|
+
import "../../../../../utils/types/equipmentType.js";
|
|
5
|
+
import "react/jsx-runtime";
|
|
6
|
+
import "@mui/icons-material";
|
|
7
|
+
const createRuleValidationSchema = () => object().shape({
|
|
8
|
+
[FieldConstants.LOW_TAP_POSITION]: number().nullable().required(),
|
|
9
|
+
[FieldConstants.HIGH_TAP_POSITION]: number().nullable().required()
|
|
10
|
+
});
|
|
11
|
+
const getCreateRuleValidationSchema = () => createRuleValidationSchema();
|
|
12
|
+
const getCreateRuleEmptyFormData = () => ({
|
|
13
|
+
[FieldConstants.LOW_TAP_POSITION]: null,
|
|
14
|
+
[FieldConstants.HIGH_TAP_POSITION]: null
|
|
15
|
+
});
|
|
16
|
+
export {
|
|
17
|
+
getCreateRuleEmptyFormData,
|
|
18
|
+
getCreateRuleValidationSchema
|
|
19
|
+
};
|
package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/tapChanger.utils.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IntlShape } from 'react-intl';
|
|
2
|
+
import { TapChangerStep, TapChangerStepMapInfos } from '../common/twoWindingsTransformer.types';
|
|
3
|
+
export declare const getRegulationTypeLabel: (twt: any, tap: any, intl: IntlShape) => string | null;
|
|
4
|
+
export declare const getTapSideLabel: (twt: any, tap: any, intl: IntlShape) => string | null;
|
|
5
|
+
export declare const compareStepsWithPreviousValues: (tapSteps: TapChangerStep[], previousValues?: TapChangerStep[]) => boolean;
|
|
6
|
+
export declare const computeHighTapPosition: (steps: Record<number, TapChangerStepMapInfos>) => number | null;
|
|
7
|
+
interface TapChangerInfos {
|
|
8
|
+
regulatingTerminalConnectableType: string;
|
|
9
|
+
regulatingTerminalConnectableId: string;
|
|
10
|
+
regulatingTerminalVlId: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const getTapChangerEquipmentSectionTypeValue: (tapChanger: TapChangerInfos) => string | null;
|
|
13
|
+
export declare function toTapChangerStepList(stepsRecord: Record<number, TapChangerStepMapInfos> | undefined): TapChangerStep[] | undefined;
|
|
14
|
+
export {};
|
package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/tapChanger.utils.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
2
|
+
import "../../../../utils/conversionUtils.js";
|
|
3
|
+
import { REGULATION_SIDES } from "../../../../utils/types/equipmentType.js";
|
|
4
|
+
import "react/jsx-runtime";
|
|
5
|
+
import "@mui/icons-material";
|
|
6
|
+
import { REGULATION_TYPES } from "../../common/voltageRegulation/voltageRegulation.utils.js";
|
|
7
|
+
const getRegulationTypeLabel = (twt, tap, intl) => {
|
|
8
|
+
if (tap?.regulatingTerminalConnectableId != null) {
|
|
9
|
+
return tap?.regulatingTerminalConnectableId === twt?.id ? intl.formatMessage({ id: REGULATION_TYPES.LOCAL.label }) : intl.formatMessage({ id: REGULATION_TYPES.DISTANT.label });
|
|
10
|
+
}
|
|
11
|
+
return null;
|
|
12
|
+
};
|
|
13
|
+
const getTapSideLabel = (twt, tap, intl) => {
|
|
14
|
+
if (!tap || !twt) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
if (tap?.regulatingTerminalConnectableId === twt?.id) {
|
|
18
|
+
return tap?.regulatingTerminalVlId === twt?.voltageLevelId1 ? intl.formatMessage({ id: REGULATION_SIDES.SIDE1.label }) : intl.formatMessage({ id: REGULATION_SIDES.SIDE2.label });
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
};
|
|
22
|
+
const STEP_DATA_FIELDS = [
|
|
23
|
+
FieldConstants.STEPS_TAP,
|
|
24
|
+
FieldConstants.STEPS_RESISTANCE,
|
|
25
|
+
FieldConstants.STEPS_REACTANCE,
|
|
26
|
+
FieldConstants.STEPS_CONDUCTANCE,
|
|
27
|
+
FieldConstants.STEPS_SUSCEPTANCE,
|
|
28
|
+
FieldConstants.STEPS_RATIO,
|
|
29
|
+
FieldConstants.STEPS_ALPHA
|
|
30
|
+
];
|
|
31
|
+
const isStepEqual = (step, previousStep) => STEP_DATA_FIELDS.every((field) => {
|
|
32
|
+
const value = step[field];
|
|
33
|
+
const previousValue = previousStep[field];
|
|
34
|
+
if (value == null || previousValue == null) {
|
|
35
|
+
return value == null && previousValue == null;
|
|
36
|
+
}
|
|
37
|
+
return Number(value) === Number(previousValue);
|
|
38
|
+
});
|
|
39
|
+
const compareStepsWithPreviousValues = (tapSteps, previousValues) => {
|
|
40
|
+
if (previousValues === void 0) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
if (tapSteps.length !== previousValues?.length) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
return tapSteps.every((step, index) => isStepEqual(step, previousValues[index]));
|
|
47
|
+
};
|
|
48
|
+
const computeHighTapPosition = (steps) => {
|
|
49
|
+
const values = steps ? Object.keys(steps).map(Number) : [];
|
|
50
|
+
return values.length > 0 ? Math.max(...values) : null;
|
|
51
|
+
};
|
|
52
|
+
const getTapChangerEquipmentSectionTypeValue = (tapChanger) => {
|
|
53
|
+
if (!tapChanger?.regulatingTerminalConnectableType) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
return `${tapChanger?.regulatingTerminalConnectableType} : ${tapChanger?.regulatingTerminalConnectableId}`;
|
|
57
|
+
};
|
|
58
|
+
function toTapChangerStepList(stepsRecord) {
|
|
59
|
+
if (stepsRecord) {
|
|
60
|
+
return Object.keys(stepsRecord).map((key) => {
|
|
61
|
+
const index = Number(key);
|
|
62
|
+
return {
|
|
63
|
+
...stepsRecord[index],
|
|
64
|
+
[FieldConstants.STEPS_TAP]: index
|
|
65
|
+
};
|
|
66
|
+
}).sort((a, b) => {
|
|
67
|
+
return a[FieldConstants.STEPS_TAP] - b[FieldConstants.STEPS_TAP];
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return void 0;
|
|
71
|
+
}
|
|
72
|
+
export {
|
|
73
|
+
compareStepsWithPreviousValues,
|
|
74
|
+
computeHighTapPosition,
|
|
75
|
+
getRegulationTypeLabel,
|
|
76
|
+
getTapChangerEquipmentSectionTypeValue,
|
|
77
|
+
getTapSideLabel,
|
|
78
|
+
toTapChangerStepList
|
|
79
|
+
};
|
|
@@ -72,15 +72,19 @@ import { VoltageLevelModificationForm } from "./modification/VoltageLevelModific
|
|
|
72
72
|
import { voltageLevelModificationDtoToForm, voltageLevelModificationEmptyFormData, voltageLevelModificationFormSchema, voltageLevelModificationFormToDto, voltageLevelModificationWithMeasurementsDtoToForm, voltageLevelModificationWithMeasurementsFormSchema, voltageLevelModificationWithMeasurementsFormToDto } from "./modification/voltageLevelModification.utils.js";
|
|
73
73
|
import { createVoltageLevelTopologyDtoToForm, createVoltageLevelTopologyEmptyFormData, createVoltageLevelTopologyFormSchema, createVoltageLevelTopologyFormToDto } from "./topology/voltageLevelTopologyCreation.utils.js";
|
|
74
74
|
import { CreateVoltageLevelTopologyForm } from "./topology/CreateVoltageLevelTopologyForm.js";
|
|
75
|
+
import { VoltageLevelSectionCreationForm } from "./section/VoltageLevelSectionCreationForm.js";
|
|
76
|
+
import { POSITION_NEW_SECTION_SIDE, voltageLevelSectionCreationDtoToForm, voltageLevelSectionCreationEmptyFormData, voltageLevelSectionCreationFormSchema, voltageLevelSectionCreationFormToDto } from "./section/voltageLevelSectionCreation.utils.js";
|
|
75
77
|
export {
|
|
76
78
|
CouplingDeviceCreationForm,
|
|
77
79
|
CreateVoltageLevelTopologyForm,
|
|
78
80
|
MAX_SECTIONS_COUNT,
|
|
81
|
+
POSITION_NEW_SECTION_SIDE,
|
|
79
82
|
SWITCH_TYPE,
|
|
80
83
|
SwitchKind,
|
|
81
84
|
SwitchesBetweenSections,
|
|
82
85
|
VoltageLevelCreationForm,
|
|
83
86
|
VoltageLevelModificationForm,
|
|
87
|
+
VoltageLevelSectionCreationForm,
|
|
84
88
|
buildNewBusbarSections,
|
|
85
89
|
couplingDeviceCreationDtoToForm,
|
|
86
90
|
couplingDeviceCreationFormSchema,
|
|
@@ -103,5 +107,9 @@ export {
|
|
|
103
107
|
voltageLevelModificationFormToDto,
|
|
104
108
|
voltageLevelModificationWithMeasurementsDtoToForm,
|
|
105
109
|
voltageLevelModificationWithMeasurementsFormSchema,
|
|
106
|
-
voltageLevelModificationWithMeasurementsFormToDto
|
|
110
|
+
voltageLevelModificationWithMeasurementsFormToDto,
|
|
111
|
+
voltageLevelSectionCreationDtoToForm,
|
|
112
|
+
voltageLevelSectionCreationEmptyFormData,
|
|
113
|
+
voltageLevelSectionCreationFormSchema,
|
|
114
|
+
voltageLevelSectionCreationFormToDto
|
|
107
115
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PositionDiagramPaneType } from '../../common/connectivity/connectivity.type';
|
|
2
|
+
import { BusBarSections } from './voltageLevelSectionCreation.types';
|
|
3
|
+
export interface VoltageLevelSectionCreationFormProps {
|
|
4
|
+
busBarSectionInfos?: BusBarSections;
|
|
5
|
+
allBusbarSectionsList?: string[];
|
|
6
|
+
isSymmetricalNbBusBarSections?: boolean;
|
|
7
|
+
isNotFoundOrNotSupported?: boolean;
|
|
8
|
+
PositionDiagramPane?: PositionDiagramPaneType;
|
|
9
|
+
}
|
|
10
|
+
export declare function VoltageLevelSectionCreationForm({ busBarSectionInfos, allBusbarSectionsList, isSymmetricalNbBusBarSections, isNotFoundOrNotSupported, PositionDiagramPane, }: Readonly<VoltageLevelSectionCreationFormProps>): import("react").JSX.Element;
|
package/dist/features/network-modifications/voltageLevel/section/VoltageLevelSectionCreationForm.js
ADDED
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect, useMemo, useCallback } from "react";
|
|
3
|
+
import { TextField, Tooltip, Box, Grid, Button, Typography, Slider } from "@mui/material";
|
|
4
|
+
import { useIntl, FormattedMessage } from "react-intl";
|
|
5
|
+
import { InfoOutlined } from "@mui/icons-material";
|
|
6
|
+
import { useFormContext, useWatch } from "react-hook-form";
|
|
7
|
+
import "../../../../components/ui/overflowableText/OverflowableText.js";
|
|
8
|
+
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
9
|
+
import "../../../../utils/conversionUtils.js";
|
|
10
|
+
import "../../../../utils/types/equipmentType.js";
|
|
11
|
+
import { areIdsEqual, getObjectId } from "../../../../utils/ts-utils.js";
|
|
12
|
+
import "localized-countries";
|
|
13
|
+
import "localized-countries/data/fr";
|
|
14
|
+
import "localized-countries/data/en";
|
|
15
|
+
import "notistack";
|
|
16
|
+
import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
17
|
+
import { useCustomFormContext } from "../../../../components/ui/reactHookForm/provider/useCustomFormContext.js";
|
|
18
|
+
import "yup";
|
|
19
|
+
import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
20
|
+
import { AutocompleteInput } from "../../../../components/ui/reactHookForm/autocompleteInputs/AutocompleteInput.js";
|
|
21
|
+
import { SwitchInput } from "../../../../components/ui/reactHookForm/booleans/SwitchInput.js";
|
|
22
|
+
import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
|
|
23
|
+
import { SelectInput } from "../../../../components/ui/reactHookForm/selectInputs/SelectInput.js";
|
|
24
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
25
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
26
|
+
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
27
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
28
|
+
import "@material-symbols/svg-400/outlined/add_notes-fill.svg?react";
|
|
29
|
+
import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
30
|
+
import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
31
|
+
import "../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
|
|
32
|
+
import "@hello-pangea/dnd";
|
|
33
|
+
import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
34
|
+
import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
35
|
+
import "mui-nested-menu";
|
|
36
|
+
import "react-resizable-panels";
|
|
37
|
+
import "react-papaparse";
|
|
38
|
+
import { GridSection } from "../../../../components/composite/grid/grid-section.js";
|
|
39
|
+
import { filledTextField } from "../../common/form.utils.js";
|
|
40
|
+
import "../../common/properties/propertyUtils.js";
|
|
41
|
+
import "react-dom";
|
|
42
|
+
import "autosuggest-highlight/match";
|
|
43
|
+
import "autosuggest-highlight/parse";
|
|
44
|
+
import "clsx";
|
|
45
|
+
import "../../../../components/composite/filter/FilterCreationDialog.js";
|
|
46
|
+
import "../../../../components/composite/filter/HeaderFilterForm.js";
|
|
47
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
48
|
+
import "../../../../components/composite/filter/expert/ExpertFilterForm.js";
|
|
49
|
+
import "../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
|
|
50
|
+
import "../../../../components/composite/filter/expert/expertFilterConstants.js";
|
|
51
|
+
import "react-querybuilder";
|
|
52
|
+
import "uuid";
|
|
53
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
54
|
+
import "../../../../components/composite/filter/utils/filterFormUtils.js";
|
|
55
|
+
import "@react-querybuilder/material";
|
|
56
|
+
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
57
|
+
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
58
|
+
import "../../../../components/composite/agGridTable/BottomTableButtons.js";
|
|
59
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
60
|
+
import "ag-grid-community";
|
|
61
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
62
|
+
import "../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
|
|
63
|
+
import "mathjs";
|
|
64
|
+
import "../../../../components/composite/report/report-viewer/log-table/log-table.js";
|
|
65
|
+
import "react-window";
|
|
66
|
+
import "../../../../components/composite/report/report-treeview/treeview-item.js";
|
|
67
|
+
import "../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
|
|
68
|
+
import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
69
|
+
import "@mui/material/colors";
|
|
70
|
+
import "@mui/x-charts";
|
|
71
|
+
import "../../common/currentLimits/limitsPane.utils.js";
|
|
72
|
+
import { SWITCH_TYPE } from "../creation/voltageLevelCreation.utils.js";
|
|
73
|
+
import "../creation/voltageLevel.constants.js";
|
|
74
|
+
import { POSITION_NEW_SECTION_SIDE } from "./voltageLevelSectionCreation.utils.js";
|
|
75
|
+
const getArrayPosition = (data, selectedOptionId) => {
|
|
76
|
+
if (!selectedOptionId || !data) {
|
|
77
|
+
return { position: -1, length: 0 };
|
|
78
|
+
}
|
|
79
|
+
const matchingArray = Object.values(data).find(
|
|
80
|
+
(array) => Array.isArray(array) && array.indexOf(selectedOptionId) !== -1
|
|
81
|
+
);
|
|
82
|
+
if (matchingArray) {
|
|
83
|
+
return { position: matchingArray.indexOf(selectedOptionId), length: matchingArray.length };
|
|
84
|
+
}
|
|
85
|
+
return { position: -1, length: 0 };
|
|
86
|
+
};
|
|
87
|
+
function VoltageLevelSectionCreationForm({
|
|
88
|
+
busBarSectionInfos,
|
|
89
|
+
allBusbarSectionsList,
|
|
90
|
+
isSymmetricalNbBusBarSections = false,
|
|
91
|
+
isNotFoundOrNotSupported = false,
|
|
92
|
+
PositionDiagramPane
|
|
93
|
+
}) {
|
|
94
|
+
const intl = useIntl();
|
|
95
|
+
const { isNodeBuilt, isUpdate } = useCustomFormContext();
|
|
96
|
+
const [isDiagramPaneOpen, setIsDiagramPaneOpen] = useState(false);
|
|
97
|
+
const [busBarSectionsIdOptions, setBusBarSectionsIdOptions] = useState([]);
|
|
98
|
+
const [isNotRequiredSwitchBefore, setIsNotRequiredSwitchBefore] = useState(false);
|
|
99
|
+
const [isNotRequiredSwitchAfter, setIsNotRequiredSwitchAfter] = useState(false);
|
|
100
|
+
const { setValue } = useFormContext();
|
|
101
|
+
const voltageLevelId = useWatch({ name: FieldConstants.EQUIPMENT_ID });
|
|
102
|
+
const busbarIndex = useWatch({ name: FieldConstants.BUS_BAR_INDEX });
|
|
103
|
+
const selectedOption = useWatch({ name: FieldConstants.BUSBAR_SECTION_ID });
|
|
104
|
+
const selectedPositionOption = useWatch({ name: FieldConstants.IS_AFTER_BUSBAR_SECTION_ID });
|
|
105
|
+
const isFreeInputMode = !busBarSectionInfos;
|
|
106
|
+
const voltageLevelIdField = /* @__PURE__ */ jsx(
|
|
107
|
+
TextField,
|
|
108
|
+
{
|
|
109
|
+
size: "small",
|
|
110
|
+
fullWidth: true,
|
|
111
|
+
label: intl.formatMessage({ id: "VoltageLevelId" }),
|
|
112
|
+
value: voltageLevelId ?? "",
|
|
113
|
+
slotProps: {
|
|
114
|
+
input: {
|
|
115
|
+
readOnly: true
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
disabled: true,
|
|
119
|
+
...filledTextField
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
const switchValue = useWatch({ name: FieldConstants.NEW_SWITCH_STATES });
|
|
123
|
+
useEffect(() => {
|
|
124
|
+
if (busBarSectionInfos && busbarIndex) {
|
|
125
|
+
const selectedKey = busbarIndex?.id;
|
|
126
|
+
setValue(FieldConstants.ALL_BUS_BAR_SECTIONS, false);
|
|
127
|
+
if (selectedKey === "all") {
|
|
128
|
+
setValue(FieldConstants.ALL_BUS_BAR_SECTIONS, true);
|
|
129
|
+
if (allBusbarSectionsList && Array.isArray(allBusbarSectionsList)) {
|
|
130
|
+
const options2 = allBusbarSectionsList.filter((id) => Boolean(id)).map((id) => ({
|
|
131
|
+
id,
|
|
132
|
+
label: id
|
|
133
|
+
}));
|
|
134
|
+
setBusBarSectionsIdOptions(options2);
|
|
135
|
+
} else {
|
|
136
|
+
setBusBarSectionsIdOptions([]);
|
|
137
|
+
}
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
const sections = busBarSectionInfos[selectedKey];
|
|
141
|
+
if (!sections || !Array.isArray(sections)) {
|
|
142
|
+
setBusBarSectionsIdOptions([]);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const options = sections.filter((id) => Boolean(id)).map((id) => ({
|
|
146
|
+
id,
|
|
147
|
+
label: id
|
|
148
|
+
}));
|
|
149
|
+
setBusBarSectionsIdOptions(options);
|
|
150
|
+
} else {
|
|
151
|
+
setBusBarSectionsIdOptions([]);
|
|
152
|
+
}
|
|
153
|
+
}, [allBusbarSectionsList, busBarSectionInfos, intl, busbarIndex, setValue]);
|
|
154
|
+
const arrayPosition = useMemo(
|
|
155
|
+
() => busBarSectionInfos && getArrayPosition(busBarSectionInfos, selectedOption?.id),
|
|
156
|
+
[busBarSectionInfos, selectedOption?.id]
|
|
157
|
+
);
|
|
158
|
+
useEffect(() => {
|
|
159
|
+
if (selectedOption && selectedPositionOption && busBarSectionInfos && arrayPosition) {
|
|
160
|
+
const selectedSectionIndex = arrayPosition.position;
|
|
161
|
+
const busBarSections = arrayPosition.length - 1;
|
|
162
|
+
if (selectedSectionIndex === 0 && selectedPositionOption === POSITION_NEW_SECTION_SIDE.BEFORE.id) {
|
|
163
|
+
setValue(FieldConstants.SWITCH_BEFORE_NOT_REQUIRED, true);
|
|
164
|
+
setIsNotRequiredSwitchBefore(true);
|
|
165
|
+
} else {
|
|
166
|
+
setValue(FieldConstants.SWITCH_BEFORE_NOT_REQUIRED, false);
|
|
167
|
+
setIsNotRequiredSwitchBefore(false);
|
|
168
|
+
}
|
|
169
|
+
if (busBarSections === selectedSectionIndex && selectedPositionOption === POSITION_NEW_SECTION_SIDE.AFTER.id) {
|
|
170
|
+
setValue(FieldConstants.SWITCH_AFTER_NOT_REQUIRED, true);
|
|
171
|
+
setIsNotRequiredSwitchAfter(true);
|
|
172
|
+
} else {
|
|
173
|
+
setValue(FieldConstants.SWITCH_AFTER_NOT_REQUIRED, false);
|
|
174
|
+
setIsNotRequiredSwitchAfter(false);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
if (isUpdate && isNodeBuilt) {
|
|
178
|
+
setValue(FieldConstants.SWITCH_AFTER_NOT_REQUIRED, true);
|
|
179
|
+
setValue(FieldConstants.SWITCH_BEFORE_NOT_REQUIRED, true);
|
|
180
|
+
}
|
|
181
|
+
}, [selectedOption, setValue, busBarSectionInfos, selectedPositionOption, arrayPosition, isUpdate, isNodeBuilt]);
|
|
182
|
+
const busBarIndexOptions = useMemo(() => {
|
|
183
|
+
if (busBarSectionInfos) {
|
|
184
|
+
const sortedOptions = Object.keys(busBarSectionInfos || {}).sort((a, b) => parseInt(a, 10) - parseInt(b, 10)).map((key) => ({
|
|
185
|
+
id: key,
|
|
186
|
+
label: key
|
|
187
|
+
}));
|
|
188
|
+
const allOption = {
|
|
189
|
+
id: "all",
|
|
190
|
+
label: intl.formatMessage({ id: "allBusbarSections" }),
|
|
191
|
+
disabled: !isSymmetricalNbBusBarSections
|
|
192
|
+
};
|
|
193
|
+
return [...sortedOptions, allOption];
|
|
194
|
+
}
|
|
195
|
+
return [];
|
|
196
|
+
}, [busBarSectionInfos, intl, isSymmetricalNbBusBarSections]);
|
|
197
|
+
const getOptionLabel = (object) => {
|
|
198
|
+
if (typeof object === "string") {
|
|
199
|
+
return object;
|
|
200
|
+
}
|
|
201
|
+
if (object?.id === "all") {
|
|
202
|
+
return intl.formatMessage({ id: "allBusbarSections" }) ?? "";
|
|
203
|
+
}
|
|
204
|
+
return String(object?.id ?? "");
|
|
205
|
+
};
|
|
206
|
+
const isOptionEqualToValue = (val1, val2) => {
|
|
207
|
+
const getId = (option) => {
|
|
208
|
+
return typeof option === "string" ? option : String(option?.id ?? "");
|
|
209
|
+
};
|
|
210
|
+
return getId(val1) === getId(val2);
|
|
211
|
+
};
|
|
212
|
+
const handleChangeBusbarIndex = useCallback(() => {
|
|
213
|
+
if (!isFreeInputMode) {
|
|
214
|
+
setValue(FieldConstants.BUSBAR_SECTION_ID, null);
|
|
215
|
+
}
|
|
216
|
+
}, [isFreeInputMode, setValue]);
|
|
217
|
+
const freeInputOutputTransform = useCallback(
|
|
218
|
+
(value) => typeof value === "string" ? { id: value, label: value } : value,
|
|
219
|
+
[]
|
|
220
|
+
);
|
|
221
|
+
const busbarCountField = /* @__PURE__ */ jsx(
|
|
222
|
+
AutocompleteInput,
|
|
223
|
+
{
|
|
224
|
+
name: FieldConstants.BUS_BAR_INDEX,
|
|
225
|
+
label: "Busbar",
|
|
226
|
+
onChangeCallback: handleChangeBusbarIndex,
|
|
227
|
+
options: busBarIndexOptions,
|
|
228
|
+
getOptionLabel,
|
|
229
|
+
isOptionEqualToValue,
|
|
230
|
+
allowNewValue: isFreeInputMode,
|
|
231
|
+
outputTransform: freeInputOutputTransform,
|
|
232
|
+
renderOption: (props, option) => {
|
|
233
|
+
const allOptionsDisabled = option.id === "all" && option?.disabled;
|
|
234
|
+
const { key, ...otherProps } = props;
|
|
235
|
+
return /* @__PURE__ */ jsx("li", { ...otherProps, children: /* @__PURE__ */ jsxs("div", { children: [
|
|
236
|
+
/* @__PURE__ */ jsx("div", { children: getOptionLabel(option) }),
|
|
237
|
+
allOptionsDisabled && /* @__PURE__ */ jsx(
|
|
238
|
+
"div",
|
|
239
|
+
{
|
|
240
|
+
style: {
|
|
241
|
+
fontSize: "0.85rem",
|
|
242
|
+
color: "red",
|
|
243
|
+
marginTop: "2px"
|
|
244
|
+
},
|
|
245
|
+
children: intl.formatMessage({ id: "allOptionHelperText" })
|
|
246
|
+
}
|
|
247
|
+
)
|
|
248
|
+
] }) }, key);
|
|
249
|
+
},
|
|
250
|
+
getOptionDisabled: (option) => option?.disabled,
|
|
251
|
+
size: "small",
|
|
252
|
+
disabled: isNotFoundOrNotSupported
|
|
253
|
+
}
|
|
254
|
+
);
|
|
255
|
+
const busbarSectionsField = /* @__PURE__ */ jsx(
|
|
256
|
+
AutocompleteInput,
|
|
257
|
+
{
|
|
258
|
+
name: FieldConstants.BUSBAR_SECTION_ID,
|
|
259
|
+
label: "BusBarSectionsReference",
|
|
260
|
+
options: busBarSectionsIdOptions,
|
|
261
|
+
getOptionLabel: getObjectId,
|
|
262
|
+
isOptionEqualToValue: areIdsEqual,
|
|
263
|
+
allowNewValue: isFreeInputMode,
|
|
264
|
+
outputTransform: freeInputOutputTransform,
|
|
265
|
+
size: "small",
|
|
266
|
+
disabled: !busbarIndex || isNotFoundOrNotSupported
|
|
267
|
+
}
|
|
268
|
+
);
|
|
269
|
+
const positionSideNewSectionField = /* @__PURE__ */ jsx(
|
|
270
|
+
SelectInput,
|
|
271
|
+
{
|
|
272
|
+
name: FieldConstants.IS_AFTER_BUSBAR_SECTION_ID,
|
|
273
|
+
label: "isAfterBusBarSectionId",
|
|
274
|
+
options: Object.values(POSITION_NEW_SECTION_SIDE),
|
|
275
|
+
size: "small",
|
|
276
|
+
disabled: !busbarIndex || isNotFoundOrNotSupported
|
|
277
|
+
}
|
|
278
|
+
);
|
|
279
|
+
const switchBeforeField = /* @__PURE__ */ jsx(
|
|
280
|
+
SelectInput,
|
|
281
|
+
{
|
|
282
|
+
name: FieldConstants.SWITCHES_BEFORE_SECTIONS,
|
|
283
|
+
label: "switchesBeforeSections",
|
|
284
|
+
options: Object.values(SWITCH_TYPE),
|
|
285
|
+
size: "small",
|
|
286
|
+
disabled: !busbarIndex || isNotRequiredSwitchBefore || isNotFoundOrNotSupported
|
|
287
|
+
}
|
|
288
|
+
);
|
|
289
|
+
const switchAfterField = /* @__PURE__ */ jsx(
|
|
290
|
+
SelectInput,
|
|
291
|
+
{
|
|
292
|
+
name: FieldConstants.SWITCHES_AFTER_SECTIONS,
|
|
293
|
+
label: "switchesAfterSections",
|
|
294
|
+
options: Object.values(SWITCH_TYPE),
|
|
295
|
+
size: "small",
|
|
296
|
+
disabled: !busbarIndex || isNotRequiredSwitchAfter || isNotFoundOrNotSupported
|
|
297
|
+
}
|
|
298
|
+
);
|
|
299
|
+
const newSwitchState = /* @__PURE__ */ jsx(
|
|
300
|
+
SwitchInput,
|
|
301
|
+
{
|
|
302
|
+
name: FieldConstants.NEW_SWITCH_STATES,
|
|
303
|
+
label: switchValue ? "areSwitchesClosed" : "areSwitchesOpen"
|
|
304
|
+
}
|
|
305
|
+
);
|
|
306
|
+
const getLabelDescription = useCallback(() => {
|
|
307
|
+
return intl.formatMessage({ id: "newSection" });
|
|
308
|
+
}, [intl]);
|
|
309
|
+
const newSectionField = /* @__PURE__ */ jsx(
|
|
310
|
+
Slider,
|
|
311
|
+
{
|
|
312
|
+
min: 0,
|
|
313
|
+
max: 3,
|
|
314
|
+
step: 0.1,
|
|
315
|
+
value: 1.5,
|
|
316
|
+
track: false,
|
|
317
|
+
valueLabelFormat: getLabelDescription,
|
|
318
|
+
valueLabelDisplay: "on",
|
|
319
|
+
size: "medium",
|
|
320
|
+
disabled: true,
|
|
321
|
+
sx: {
|
|
322
|
+
"& .MuiSlider-thumb": {
|
|
323
|
+
backgroundColor: "#1976d2",
|
|
324
|
+
color: "#1976d2",
|
|
325
|
+
"&:hover": {
|
|
326
|
+
backgroundColor: "#1976d2"
|
|
327
|
+
},
|
|
328
|
+
"&.Mui-disabled": {
|
|
329
|
+
backgroundColor: "#1976d2",
|
|
330
|
+
color: "#1976d2"
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
);
|
|
336
|
+
const handleCloseDiagramPane = useCallback(() => {
|
|
337
|
+
setIsDiagramPaneOpen(false);
|
|
338
|
+
}, []);
|
|
339
|
+
const handleClickOpenDiagramPane = useCallback(() => {
|
|
340
|
+
setIsDiagramPaneOpen(true);
|
|
341
|
+
}, []);
|
|
342
|
+
const diagramToolTip = /* @__PURE__ */ jsx(Tooltip, { sx: { paddingLeft: 1 }, title: intl.formatMessage({ id: "builtNodeTooltipForDiagram" }), children: /* @__PURE__ */ jsx(InfoOutlined, { color: "info", fontSize: "medium" }) });
|
|
343
|
+
return /* @__PURE__ */ jsxs(Box, { sx: { p: 2 }, children: [
|
|
344
|
+
/* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
|
|
345
|
+
/* @__PURE__ */ jsx(Grid, { size: 12, children: /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, alignItems: "center", children: [
|
|
346
|
+
/* @__PURE__ */ jsx(Grid, { size: { xs: 12, md: 6 }, children: voltageLevelIdField }),
|
|
347
|
+
PositionDiagramPane && isNodeBuilt && /* @__PURE__ */ jsxs(Grid, { size: { xs: 12, md: 3 }, children: [
|
|
348
|
+
/* @__PURE__ */ jsx(Button, { onClick: handleClickOpenDiagramPane, variant: "outlined", size: "small", children: /* @__PURE__ */ jsx(FormattedMessage, { id: "CreateCouplingDeviceDiagramButton" }) }),
|
|
349
|
+
diagramToolTip
|
|
350
|
+
] })
|
|
351
|
+
] }) }),
|
|
352
|
+
isNotFoundOrNotSupported && /* @__PURE__ */ jsx(Grid, { size: 12, children: /* @__PURE__ */ jsx(Typography, { variant: "body1", color: "red", children: /* @__PURE__ */ jsx(FormattedMessage, { id: "notValidVoltageLevel" }) }) }),
|
|
353
|
+
/* @__PURE__ */ jsx(Grid, { size: 12, children: /* @__PURE__ */ jsx(GridSection, { title: "SectionPosition" }) }),
|
|
354
|
+
/* @__PURE__ */ jsx(Grid, { size: 4, children: busbarCountField }),
|
|
355
|
+
/* @__PURE__ */ jsx(Grid, { size: 4, children: busbarSectionsField }),
|
|
356
|
+
/* @__PURE__ */ jsx(Grid, { size: 4, children: positionSideNewSectionField }),
|
|
357
|
+
/* @__PURE__ */ jsx(Grid, { size: 12, children: /* @__PURE__ */ jsx(GridSection, { title: "Switch" }) }),
|
|
358
|
+
/* @__PURE__ */ jsx(Grid, { size: { xs: 12, sm: 4 }, children: switchBeforeField }),
|
|
359
|
+
/* @__PURE__ */ jsx(Grid, { size: { xs: 12, sm: 4 }, children: newSectionField }),
|
|
360
|
+
/* @__PURE__ */ jsx(Grid, { size: { xs: 12, sm: 4 }, children: switchAfterField }),
|
|
361
|
+
/* @__PURE__ */ jsx(Grid, { size: 12, children: newSwitchState })
|
|
362
|
+
] }),
|
|
363
|
+
PositionDiagramPane && /* @__PURE__ */ jsx(
|
|
364
|
+
PositionDiagramPane,
|
|
365
|
+
{
|
|
366
|
+
open: isDiagramPaneOpen,
|
|
367
|
+
onClose: handleCloseDiagramPane,
|
|
368
|
+
voltageLevelId
|
|
369
|
+
}
|
|
370
|
+
)
|
|
371
|
+
] });
|
|
372
|
+
}
|
|
373
|
+
export {
|
|
374
|
+
VoltageLevelSectionCreationForm
|
|
375
|
+
};
|
|
@@ -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 * from './VoltageLevelSectionCreationForm';
|
|
8
|
+
export * from './voltageLevelSectionCreation.types';
|
|
9
|
+
export * from './voltageLevelSectionCreation.utils';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { VoltageLevelSectionCreationForm } from "./VoltageLevelSectionCreationForm.js";
|
|
2
|
+
import { POSITION_NEW_SECTION_SIDE, voltageLevelSectionCreationDtoToForm, voltageLevelSectionCreationEmptyFormData, voltageLevelSectionCreationFormSchema, voltageLevelSectionCreationFormToDto } from "./voltageLevelSectionCreation.utils.js";
|
|
3
|
+
export {
|
|
4
|
+
POSITION_NEW_SECTION_SIDE,
|
|
5
|
+
VoltageLevelSectionCreationForm,
|
|
6
|
+
voltageLevelSectionCreationDtoToForm,
|
|
7
|
+
voltageLevelSectionCreationEmptyFormData,
|
|
8
|
+
voltageLevelSectionCreationFormSchema,
|
|
9
|
+
voltageLevelSectionCreationFormToDto
|
|
10
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { UUID } from 'node:crypto';
|
|
2
|
+
import { ModificationType } from '../../../../utils';
|
|
3
|
+
export type BusBarSections = Record<string, string[]>;
|
|
4
|
+
export interface VoltageLevelSectionCreationDto {
|
|
5
|
+
type: ModificationType;
|
|
6
|
+
uuid?: UUID;
|
|
7
|
+
voltageLevelId: string;
|
|
8
|
+
busbarIndex: string | null;
|
|
9
|
+
busbarSectionId: string | null;
|
|
10
|
+
allBusbars: boolean;
|
|
11
|
+
afterBusbarSectionId: boolean;
|
|
12
|
+
leftSwitchKind: string | null;
|
|
13
|
+
rightSwitchKind: string | null;
|
|
14
|
+
switchOpen: boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { InferType } from 'yup';
|
|
2
|
+
import { DeepNullable } from '../../../../utils';
|
|
3
|
+
import { BusBarSections, VoltageLevelSectionCreationDto } from './voltageLevelSectionCreation.types';
|
|
4
|
+
export declare const POSITION_NEW_SECTION_SIDE: {
|
|
5
|
+
readonly BEFORE: {
|
|
6
|
+
readonly id: "BEFORE";
|
|
7
|
+
readonly label: "Before";
|
|
8
|
+
};
|
|
9
|
+
readonly AFTER: {
|
|
10
|
+
readonly id: "AFTER";
|
|
11
|
+
readonly label: "After";
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare const voltageLevelSectionCreationFormSchema: import('yup').ObjectSchema<{
|
|
15
|
+
equipmentID: string;
|
|
16
|
+
busbarIndex: {
|
|
17
|
+
id: string;
|
|
18
|
+
};
|
|
19
|
+
busbarSectionId: {
|
|
20
|
+
id: string;
|
|
21
|
+
};
|
|
22
|
+
isAfterBusBarSectionId: string;
|
|
23
|
+
switchesBeforeSections: string | null | undefined;
|
|
24
|
+
switchesAfterSections: string | null | undefined;
|
|
25
|
+
allBusbarSections: boolean | undefined;
|
|
26
|
+
newSwitchStates: boolean | undefined;
|
|
27
|
+
switchBeforeNotRequired: boolean | undefined;
|
|
28
|
+
switchAfterNotRequired: boolean | undefined;
|
|
29
|
+
}, import('yup').AnyObject, {
|
|
30
|
+
equipmentID: undefined;
|
|
31
|
+
busbarIndex: {
|
|
32
|
+
id: undefined;
|
|
33
|
+
};
|
|
34
|
+
busbarSectionId: {
|
|
35
|
+
id: undefined;
|
|
36
|
+
};
|
|
37
|
+
isAfterBusBarSectionId: undefined;
|
|
38
|
+
switchesBeforeSections: undefined;
|
|
39
|
+
switchesAfterSections: undefined;
|
|
40
|
+
allBusbarSections: undefined;
|
|
41
|
+
newSwitchStates: undefined;
|
|
42
|
+
switchBeforeNotRequired: undefined;
|
|
43
|
+
switchAfterNotRequired: undefined;
|
|
44
|
+
}, "">;
|
|
45
|
+
export type VoltageLevelSectionCreationFormData = InferType<typeof voltageLevelSectionCreationFormSchema>;
|
|
46
|
+
export declare const voltageLevelSectionCreationEmptyFormData: DeepNullable<VoltageLevelSectionCreationFormData>;
|
|
47
|
+
export declare const voltageLevelSectionCreationDtoToForm: (dto: VoltageLevelSectionCreationDto) => VoltageLevelSectionCreationFormData;
|
|
48
|
+
export declare const voltageLevelSectionCreationFormToDto: (form: VoltageLevelSectionCreationFormData, busBarSectionInfos?: BusBarSections) => VoltageLevelSectionCreationDto;
|