@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.
Files changed (142) hide show
  1. package/dist/components/ui/dialogs/customMuiDialog/CustomMuiDialog.d.ts +10 -3
  2. package/dist/components/ui/dialogs/customMuiDialog/CustomMuiDialog.js +33 -28
  3. package/dist/features/index.js +96 -3
  4. package/dist/features/network-modifications/common/branch/branchCreation.types.d.ts +26 -0
  5. package/dist/features/network-modifications/common/branch/branchModification.types.d.ts +36 -0
  6. package/dist/features/network-modifications/common/branch/branchModification.types.js +1 -0
  7. package/dist/features/network-modifications/{line/characteristics/lineCharacteristicsPane.types.d.ts → common/branch/index.d.ts} +2 -8
  8. package/dist/features/network-modifications/common/branch/index.js +1 -0
  9. package/dist/features/network-modifications/common/connectivity/connectivityForm.utils.d.ts +2 -0
  10. package/dist/features/network-modifications/common/currentLimits/limits.types.d.ts +1 -0
  11. package/dist/features/network-modifications/common/currentLimits/limitsPane.utils.d.ts +2 -2
  12. package/dist/features/network-modifications/common/index.d.ts +1 -0
  13. package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/reactiveCapability.utils.js +1 -1
  14. package/dist/features/network-modifications/common/regulatingTerminal/regulatingTerminal.utils.d.ts +2 -2
  15. package/dist/features/network-modifications/common/regulatingTerminal/regulatingTerminal.utils.js +2 -2
  16. package/dist/features/network-modifications/index.d.ts +1 -0
  17. package/dist/features/network-modifications/index.js +96 -3
  18. package/dist/features/network-modifications/line/characteristics/index.d.ts +0 -1
  19. package/dist/features/network-modifications/line/characteristics/index.js +1 -2
  20. package/dist/features/network-modifications/line/characteristics/lineCharacteristicsPane.utils.d.ts +4 -19
  21. package/dist/features/network-modifications/line/characteristics/lineCharacteristicsPane.utils.js +0 -14
  22. package/dist/features/network-modifications/line/creation/lineCreation.types.d.ts +6 -26
  23. package/dist/features/network-modifications/line/index.js +1 -2
  24. package/dist/features/network-modifications/line/modification/lineModification.types.d.ts +3 -35
  25. package/dist/features/network-modifications/twoWindingsTransformer/characteristics/TwoWindingsTransformerCharacteristicsPane.d.ts +7 -0
  26. package/dist/features/network-modifications/twoWindingsTransformer/characteristics/TwoWindingsTransformerCharacteristicsPane.js +168 -0
  27. package/dist/features/network-modifications/twoWindingsTransformer/characteristics/index.d.ts +8 -0
  28. package/dist/features/network-modifications/twoWindingsTransformer/characteristics/index.js +8 -0
  29. package/dist/features/network-modifications/twoWindingsTransformer/characteristics/twoWindingsTransformerCharacteristicsPane.utils.d.ts +41 -0
  30. package/dist/features/network-modifications/twoWindingsTransformer/characteristics/twoWindingsTransformerCharacteristicsPane.utils.js +51 -0
  31. package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogHeader.d.ts +6 -0
  32. package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogHeader.js +123 -0
  33. package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogTabs.d.ts +9 -0
  34. package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogTabs.js +89 -0
  35. package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogTabsContent.d.ts +14 -0
  36. package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogTabsContent.js +118 -0
  37. package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerForm.d.ts +6 -0
  38. package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerForm.js +47 -0
  39. package/dist/features/network-modifications/twoWindingsTransformer/common/index.d.ts +12 -0
  40. package/dist/features/network-modifications/twoWindingsTransformer/common/index.js +13 -0
  41. package/dist/features/network-modifications/twoWindingsTransformer/common/twoWindingsTransformer.types.d.ts +87 -0
  42. package/dist/features/network-modifications/twoWindingsTransformer/common/twoWindingsTransformer.types.js +1 -0
  43. package/dist/features/network-modifications/twoWindingsTransformer/common/twoWindingsTransformer.utils.d.ts +10 -0
  44. package/dist/features/network-modifications/twoWindingsTransformer/common/twoWindingsTransformer.utils.js +50 -0
  45. package/dist/features/network-modifications/twoWindingsTransformer/creation/index.d.ts +8 -0
  46. package/dist/features/network-modifications/twoWindingsTransformer/creation/index.js +12 -0
  47. package/dist/features/network-modifications/twoWindingsTransformer/creation/twoWindingsTransformerCreation.types.d.ts +47 -0
  48. package/dist/features/network-modifications/twoWindingsTransformer/creation/twoWindingsTransformerCreation.types.js +8 -0
  49. package/dist/features/network-modifications/twoWindingsTransformer/creation/twoWindingsTransformerCreation.utils.d.ts +248 -0
  50. package/dist/features/network-modifications/twoWindingsTransformer/creation/twoWindingsTransformerCreation.utils.js +325 -0
  51. package/dist/features/network-modifications/twoWindingsTransformer/index.d.ts +11 -0
  52. package/dist/features/network-modifications/twoWindingsTransformer/index.js +88 -0
  53. package/dist/features/network-modifications/twoWindingsTransformer/modification/index.d.ts +9 -0
  54. package/dist/features/network-modifications/twoWindingsTransformer/modification/index.js +10 -0
  55. package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/ToBeEstimatedForm.d.ts +6 -0
  56. package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/ToBeEstimatedForm.js +104 -0
  57. package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/index.d.ts +9 -0
  58. package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/index.js +7 -0
  59. package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/toBeEstimated.type.d.ts +10 -0
  60. package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/toBeEstimated.type.js +1 -0
  61. package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/toBeEstimated.utils.d.ts +12 -0
  62. package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/toBeEstimated.utils.js +18 -0
  63. package/dist/features/network-modifications/twoWindingsTransformer/modification/twoWindingsTransformerModification.types.d.ts +39 -0
  64. package/dist/features/network-modifications/twoWindingsTransformer/modification/twoWindingsTransformerModification.types.js +1 -0
  65. package/dist/features/network-modifications/twoWindingsTransformer/modification/twoWindingsTransformerModification.utils.d.ts +265 -0
  66. package/dist/features/network-modifications/twoWindingsTransformer/modification/twoWindingsTransformerModification.utils.js +100 -0
  67. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/RegulatedTerminalSection.d.ts +13 -0
  68. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/RegulatedTerminalSection.js +130 -0
  69. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/TapChangerSteps.d.ts +20 -0
  70. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/TapChangerSteps.js +311 -0
  71. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/index.d.ts +12 -0
  72. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/index.js +53 -0
  73. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/PhaseTapChangerPane.d.ts +2 -0
  74. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/PhaseTapChangerPane.js +198 -0
  75. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/PhaseTapChangerPaneSteps.d.ts +9 -0
  76. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/PhaseTapChangerPaneSteps.js +201 -0
  77. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/index.d.ts +9 -0
  78. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/index.js +15 -0
  79. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/phaseTapChanger.utils.d.ts +114 -0
  80. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/phaseTapChanger.utils.js +242 -0
  81. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/RatioTapChangerPane.d.ts +2 -0
  82. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/RatioTapChangerPane.js +283 -0
  83. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/RatioTapChangerPaneSteps.d.ts +9 -0
  84. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/RatioTapChangerPaneSteps.js +181 -0
  85. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/index.d.ts +9 -0
  86. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/index.js +18 -0
  87. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/ratioTapChanger.utils.d.ts +132 -0
  88. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/ratioTapChanger.utils.js +211 -0
  89. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/CreateRuleDialog.d.ts +2 -0
  90. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/CreateRuleDialog.js +102 -0
  91. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/CreateRuleDialogSubmitButton.d.ts +7 -0
  92. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/CreateRuleDialogSubmitButton.js +22 -0
  93. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/CreateRuleForm.d.ts +6 -0
  94. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/CreateRuleForm.js +86 -0
  95. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/ImportRuleDialog.d.ts +10 -0
  96. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/ImportRuleDialog.js +140 -0
  97. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/index.d.ts +12 -0
  98. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/index.js +13 -0
  99. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/regulationRule.types.d.ts +12 -0
  100. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/regulationRule.types.js +1 -0
  101. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/regulationRule.utils.d.ts +9 -0
  102. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/regulationRule.utils.js +19 -0
  103. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/tapChanger.utils.d.ts +14 -0
  104. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/tapChanger.utils.js +79 -0
  105. package/dist/features/network-modifications/voltageLevel/index.d.ts +1 -0
  106. package/dist/features/network-modifications/voltageLevel/index.js +9 -1
  107. package/dist/features/network-modifications/voltageLevel/section/VoltageLevelSectionCreationForm.d.ts +10 -0
  108. package/dist/features/network-modifications/voltageLevel/section/VoltageLevelSectionCreationForm.js +375 -0
  109. package/dist/features/network-modifications/voltageLevel/section/index.d.ts +9 -0
  110. package/dist/features/network-modifications/voltageLevel/section/index.js +10 -0
  111. package/dist/features/network-modifications/voltageLevel/section/voltageLevelSectionCreation.types.d.ts +15 -0
  112. package/dist/features/network-modifications/voltageLevel/section/voltageLevelSectionCreation.types.js +1 -0
  113. package/dist/features/network-modifications/voltageLevel/section/voltageLevelSectionCreation.utils.d.ts +48 -0
  114. package/dist/features/network-modifications/voltageLevel/section/voltageLevelSectionCreation.utils.js +100 -0
  115. package/dist/index.js +107 -7
  116. package/dist/translations/en/filterExpertEn.d.ts +0 -3
  117. package/dist/translations/en/filterExpertEn.js +0 -3
  118. package/dist/translations/en/network-modification-validationEn.d.ts +1 -0
  119. package/dist/translations/en/network-modification-validationEn.js +2 -1
  120. package/dist/translations/en/networkModificationsEn.d.ts +87 -9
  121. package/dist/translations/en/networkModificationsEn.js +91 -12
  122. package/dist/translations/fr/filterExpertFr.d.ts +0 -3
  123. package/dist/translations/fr/filterExpertFr.js +0 -3
  124. package/dist/translations/fr/network-modification-validationFr.d.ts +1 -0
  125. package/dist/translations/fr/network-modification-validationFr.js +2 -1
  126. package/dist/translations/fr/networkModificationsFr.d.ts +87 -9
  127. package/dist/translations/fr/networkModificationsFr.js +91 -12
  128. package/dist/utils/constants/fieldConstants.d.ts +37 -0
  129. package/dist/utils/constants/fieldConstants.js +37 -0
  130. package/dist/utils/constants/index.js +2 -1
  131. package/dist/utils/constants/translationKeys.d.ts +1 -0
  132. package/dist/utils/constants/translationKeys.js +2 -0
  133. package/dist/utils/functions.d.ts +9 -0
  134. package/dist/utils/functions.js +40 -0
  135. package/dist/utils/index.js +11 -4
  136. package/dist/utils/langs.d.ts +1 -0
  137. package/dist/utils/langs.js +9 -1
  138. package/dist/utils/types/equipmentType.d.ts +34 -0
  139. package/dist/utils/types/equipmentType.js +28 -0
  140. package/dist/utils/types/index.js +4 -1
  141. package/package.json +1 -1
  142. /package/dist/features/network-modifications/{line/characteristics/lineCharacteristicsPane.types.js → common/branch/branchCreation.types.js} +0 -0
@@ -0,0 +1,283 @@
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import { Grid } from "@mui/material";
3
+ import { useMemo, useCallback, useEffect } from "react";
4
+ import { useFormContext, useWatch } from "react-hook-form";
5
+ import { useIntl } from "react-intl";
6
+ import { RatioTapChangerPaneSteps } from "./RatioTapChangerPaneSteps.js";
7
+ import { getComputedPreviousRatioRegulationType, getComputedRegulationModeId, getComputedRegulationTypeId, getComputedTapSideId } from "./ratioTapChanger.utils.js";
8
+ import { RegulatedTerminalSection } from "../RegulatedTerminalSection.js";
9
+ import { VoltageAdornment } from "../../../../../utils/constants/adornments.js";
10
+ import { FieldConstants } from "../../../../../utils/constants/fieldConstants.js";
11
+ import "../../../../../utils/conversionUtils.js";
12
+ import { RATIO_REGULATION_MODES } from "../../../../../utils/types/equipmentType.js";
13
+ import "@mui/icons-material";
14
+ import "../../../../../components/ui/overflowableText/OverflowableText.js";
15
+ import "localized-countries";
16
+ import "localized-countries/data/fr";
17
+ import "localized-countries/data/en";
18
+ import "notistack";
19
+ import "../../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
20
+ import "yup";
21
+ import "../../../../../components/ui/treeViewFinder/TreeViewFinder.js";
22
+ import { SwitchInput } from "../../../../../components/ui/reactHookForm/booleans/SwitchInput.js";
23
+ import { FloatInput } from "../../../../../components/ui/reactHookForm/numbers/FloatInput.js";
24
+ import "../../../../../components/ui/reactHookForm/numbers/RangeInput.js";
25
+ import { SelectInput } from "../../../../../components/ui/reactHookForm/selectInputs/SelectInput.js";
26
+ import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
27
+ import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
28
+ import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
29
+ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
30
+ import "@material-symbols/svg-400/outlined/add_notes-fill.svg?react";
31
+ import "../../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
32
+ import "../../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
33
+ import { CheckboxNullableInput } from "../../../../../components/ui/reactHookForm/CheckboxNullableInput.js";
34
+ import "../../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
35
+ import "@hello-pangea/dnd";
36
+ import "../../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
37
+ import "../../../../../components/ui/snackbarProvider/SnackbarProvider.js";
38
+ import "mui-nested-menu";
39
+ import "react-resizable-panels";
40
+ import "react-papaparse";
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 { GridItem } from "../../../../../components/composite/grid/grid-item.js";
56
+ import { GridSection } from "../../../../../components/composite/grid/grid-section.js";
57
+ import "@react-querybuilder/material";
58
+ import "../../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
59
+ import "../../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
60
+ import "../../../../../components/composite/agGridTable/BottomTableButtons.js";
61
+ import "../../../../../components/composite/agGridTable/CustomAgGridTable.js";
62
+ import "ag-grid-community";
63
+ import "../../../../../components/composite/customAGGrid/customAggrid.js";
64
+ import "../../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
65
+ import "mathjs";
66
+ import "../../../../../components/composite/report/report-viewer/log-table/log-table.js";
67
+ import "react-window";
68
+ import "../../../../../components/composite/report/report-treeview/treeview-item.js";
69
+ import "../../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
70
+ function RatioTapChangerPane({
71
+ id = FieldConstants.RATIO_TAP_CHANGER,
72
+ voltageLevelOptions = [],
73
+ previousValues,
74
+ editData,
75
+ fetchVoltageLevelEquipments,
76
+ isModification = false
77
+ }) {
78
+ const { trigger, setValue, getValues } = useFormContext();
79
+ const intl = useIntl();
80
+ const previousRegulation = () => {
81
+ if (previousValues?.ratioTapChanger?.hasLoadTapChangingCapabilities) {
82
+ return intl.formatMessage({ id: "On" });
83
+ }
84
+ if (previousValues?.ratioTapChanger?.hasLoadTapChangingCapabilities === false) {
85
+ return intl.formatMessage({ id: "Off" });
86
+ }
87
+ return void 0;
88
+ };
89
+ const getRatioTapChangerRegulationModeLabel = (ratioTapChangerFormValues) => {
90
+ if (!ratioTapChangerFormValues) {
91
+ return void 0;
92
+ }
93
+ if (ratioTapChangerFormValues?.isRegulating) {
94
+ return intl.formatMessage({
95
+ id: RATIO_REGULATION_MODES.VOLTAGE_REGULATION.label
96
+ });
97
+ }
98
+ return intl.formatMessage({
99
+ id: RATIO_REGULATION_MODES.FIXED_RATIO.label
100
+ });
101
+ };
102
+ const ratioTapChangerEnabledWatcher = useWatch({
103
+ name: `${id}.${FieldConstants.ENABLED}`
104
+ });
105
+ const ratioTapLoadTapChangingCapabilitiesWatcher = useWatch({
106
+ name: `${id}.${FieldConstants.LOAD_TAP_CHANGING_CAPABILITIES}`
107
+ });
108
+ const isRatioTapLoadTapChangingCapabilitiesOff = !ratioTapLoadTapChangingCapabilitiesWatcher || ratioTapLoadTapChangingCapabilitiesWatcher === null;
109
+ const regulationModeWatch = useWatch({
110
+ name: `${id}.${FieldConstants.REGULATION_MODE}`
111
+ });
112
+ const regulationTypeWatch = useWatch({
113
+ name: `${id}.${FieldConstants.REGULATION_TYPE}`
114
+ });
115
+ const regulationType = useMemo(() => {
116
+ return regulationTypeWatch || (previousValues ? getComputedPreviousRatioRegulationType(previousValues) : void 0);
117
+ }, [previousValues, regulationTypeWatch]);
118
+ const findAndSetVoltageLevelFromPrevious = useCallback(() => {
119
+ const prevVl = voltageLevelOptions.find(
120
+ (vl) => vl.id === previousValues?.ratioTapChanger?.regulatingTerminalVlId
121
+ );
122
+ if (prevVl) {
123
+ const newVlValue = {
124
+ id: prevVl.id,
125
+ label: prevVl.name ?? ""
126
+ };
127
+ setValue(`${id}.${FieldConstants.VOLTAGE_LEVEL}`, newVlValue);
128
+ } else {
129
+ console.error("Voltage level not found:", prevVl);
130
+ }
131
+ }, [setValue, id, voltageLevelOptions, previousValues]);
132
+ const setEquipmentFromPrevious = useCallback(() => {
133
+ const prevEquipmentId = previousValues?.ratioTapChanger?.regulatingTerminalConnectableId;
134
+ if (prevEquipmentId) {
135
+ const prevEquipmentType = previousValues?.ratioTapChanger?.regulatingTerminalConnectableType;
136
+ const newEquipment = {
137
+ id: prevEquipmentId,
138
+ label: prevEquipmentType,
139
+ type: prevEquipmentType
140
+ };
141
+ setValue(`${id}.${FieldConstants.EQUIPMENT}`, newEquipment);
142
+ }
143
+ }, [setValue, id, previousValues]);
144
+ const setValueIfNull = useCallback(
145
+ (curRatioTapChanger, field, value) => {
146
+ if (curRatioTapChanger[field] === null) {
147
+ setValue(`${id}.${field}`, value);
148
+ }
149
+ },
150
+ [setValue, id]
151
+ );
152
+ const fillRatioTapChangerRegulationAttributesWithPreviousValues = useCallback(
153
+ (newOnLoad) => {
154
+ if (newOnLoad !== true || !previousValues) {
155
+ return;
156
+ }
157
+ const curRatioTapChanger = getValues(id);
158
+ setValueIfNull(
159
+ curRatioTapChanger,
160
+ FieldConstants.REGULATION_MODE,
161
+ getComputedRegulationModeId(previousValues)
162
+ );
163
+ setValueIfNull(curRatioTapChanger, FieldConstants.TARGET_V, previousValues?.ratioTapChanger?.targetV);
164
+ setValueIfNull(
165
+ curRatioTapChanger,
166
+ FieldConstants.TARGET_DEADBAND,
167
+ previousValues?.ratioTapChanger?.targetDeadband
168
+ );
169
+ setValueIfNull(
170
+ curRatioTapChanger,
171
+ FieldConstants.REGULATION_TYPE,
172
+ getComputedRegulationTypeId(previousValues)
173
+ );
174
+ setValueIfNull(curRatioTapChanger, FieldConstants.REGULATION_SIDE, getComputedTapSideId(previousValues));
175
+ if (curRatioTapChanger[FieldConstants.VOLTAGE_LEVEL] === null) {
176
+ findAndSetVoltageLevelFromPrevious();
177
+ }
178
+ if (curRatioTapChanger[FieldConstants.EQUIPMENT] === null) {
179
+ setEquipmentFromPrevious();
180
+ }
181
+ },
182
+ [id, previousValues, getValues, setValueIfNull, findAndSetVoltageLevelFromPrevious, setEquipmentFromPrevious]
183
+ );
184
+ useEffect(() => {
185
+ if (regulationModeWatch === RATIO_REGULATION_MODES.FIXED_RATIO.id) {
186
+ trigger(`${id}.${FieldConstants.REGULATION_TYPE}`).then();
187
+ trigger(`${id}.${FieldConstants.REGULATION_SIDE}`).then();
188
+ trigger(`${id}.${FieldConstants.TARGET_V}`).then();
189
+ }
190
+ }, [regulationModeWatch, trigger, id]);
191
+ const ratioTapLoadTapChangingCapabilitiesField = isModification ? /* @__PURE__ */ jsx(
192
+ CheckboxNullableInput,
193
+ {
194
+ name: `${id}.${FieldConstants.LOAD_TAP_CHANGING_CAPABILITIES}`,
195
+ label: "OnLoad",
196
+ formProps: {
197
+ disabled: !ratioTapChangerEnabledWatcher
198
+ },
199
+ previousValue: previousRegulation(),
200
+ onChange: fillRatioTapChangerRegulationAttributesWithPreviousValues
201
+ }
202
+ ) : /* @__PURE__ */ jsx(
203
+ SwitchInput,
204
+ {
205
+ name: `${id}.${FieldConstants.LOAD_TAP_CHANGING_CAPABILITIES}`,
206
+ label: "OnLoad",
207
+ formProps: {
208
+ disabled: !ratioTapChangerEnabledWatcher
209
+ }
210
+ }
211
+ );
212
+ const regulationModeField = /* @__PURE__ */ jsx(
213
+ SelectInput,
214
+ {
215
+ name: `${id}.${FieldConstants.REGULATION_MODE}`,
216
+ label: "RegulationMode",
217
+ options: Object.values(RATIO_REGULATION_MODES),
218
+ size: "small",
219
+ disabled: isRatioTapLoadTapChangingCapabilitiesOff,
220
+ previousValue: getRatioTapChangerRegulationModeLabel(previousValues?.ratioTapChanger)
221
+ }
222
+ );
223
+ const targetVoltage1Field = /* @__PURE__ */ jsx(
224
+ FloatInput,
225
+ {
226
+ name: `${id}.${FieldConstants.TARGET_V}`,
227
+ label: "TargetVoltage",
228
+ adornment: VoltageAdornment,
229
+ formProps: {
230
+ disabled: isRatioTapLoadTapChangingCapabilitiesOff
231
+ },
232
+ previousValue: previousValues?.ratioTapChanger?.targetV ?? void 0
233
+ }
234
+ );
235
+ const targetDeadbandField = /* @__PURE__ */ jsx(
236
+ FloatInput,
237
+ {
238
+ name: `${id}.${FieldConstants.TARGET_DEADBAND}`,
239
+ label: "Deadband",
240
+ adornment: VoltageAdornment,
241
+ formProps: {
242
+ disabled: isRatioTapLoadTapChangingCapabilitiesOff
243
+ },
244
+ previousValue: previousValues?.ratioTapChanger?.targetDeadband
245
+ }
246
+ );
247
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
248
+ /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
249
+ /* @__PURE__ */ jsx(GridItem, { children: ratioTapLoadTapChangingCapabilitiesField }),
250
+ /* @__PURE__ */ jsx(GridItem, { size: "auto" })
251
+ ] }),
252
+ /* @__PURE__ */ jsx(GridSection, { title: "RegulationSection", heading: 4 }),
253
+ /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 1, children: [
254
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: regulationModeField }),
255
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: targetVoltage1Field }),
256
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: targetDeadbandField })
257
+ ] }),
258
+ /* @__PURE__ */ jsx(
259
+ RegulatedTerminalSection,
260
+ {
261
+ id,
262
+ voltageLevelOptions,
263
+ previousValues,
264
+ tapChangerDisabled: isRatioTapLoadTapChangingCapabilitiesOff,
265
+ regulationType,
266
+ fetchVoltageLevelEquipments
267
+ }
268
+ ),
269
+ /* @__PURE__ */ jsx(GridSection, { title: "TapsSection", heading: 4 }),
270
+ /* @__PURE__ */ jsx(
271
+ RatioTapChangerPaneSteps,
272
+ {
273
+ disabled: !ratioTapChangerEnabledWatcher,
274
+ previousValues: previousValues?.ratioTapChanger,
275
+ editData,
276
+ isModification
277
+ }
278
+ )
279
+ ] });
280
+ }
281
+ export {
282
+ RatioTapChangerPane
283
+ };
@@ -0,0 +1,9 @@
1
+ import { TapChangerMapInfos } from '../../common/twoWindingsTransformer.types';
2
+ import { TwoWindingsTransformerModificationDto } from '../../modification/twoWindingsTransformerModification.types';
3
+ export interface RatioTapChangerPaneStepsProps {
4
+ disabled?: boolean;
5
+ previousValues?: TapChangerMapInfos;
6
+ editData?: TwoWindingsTransformerModificationDto;
7
+ isModification?: boolean;
8
+ }
9
+ export declare function RatioTapChangerPaneSteps({ disabled, previousValues, editData, isModification, }: Readonly<RatioTapChangerPaneStepsProps>): import("react").JSX.Element;
@@ -0,0 +1,181 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { useIntl } from "react-intl";
4
+ import { TapChangerSteps } from "../TapChangerSteps.js";
5
+ import "@mui/material";
6
+ import "@mui/icons-material";
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 { parseIntData } from "../../../../../utils/ts-utils.js";
12
+ import "react-hook-form";
13
+ import "localized-countries";
14
+ import "localized-countries/data/fr";
15
+ import "localized-countries/data/en";
16
+ import "notistack";
17
+ import "../../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
18
+ import "yup";
19
+ import "../../../../../components/ui/treeViewFinder/TreeViewFinder.js";
20
+ import "../../../../../components/ui/reactHookForm/numbers/RangeInput.js";
21
+ import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
22
+ import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
23
+ import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
24
+ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
25
+ import "@material-symbols/svg-400/outlined/add_notes-fill.svg?react";
26
+ import "../../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
27
+ import "../../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
28
+ import "../../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
29
+ import "@hello-pangea/dnd";
30
+ import "../../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
31
+ import "../../../../../components/ui/snackbarProvider/SnackbarProvider.js";
32
+ import "mui-nested-menu";
33
+ import "react-resizable-panels";
34
+ import "react-papaparse";
35
+ import "react-dom";
36
+ import { DndColumnType } from "../../../../../components/composite/dnd-table/dnd-table.type.js";
37
+ import "autosuggest-highlight/match";
38
+ import "autosuggest-highlight/parse";
39
+ import "clsx";
40
+ import "../../../../../components/composite/filter/FilterCreationDialog.js";
41
+ import "../../../../../components/composite/filter/HeaderFilterForm.js";
42
+ import "../../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
43
+ import "../../../../../components/composite/filter/expert/ExpertFilterForm.js";
44
+ import "../../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
45
+ import "../../../../../components/composite/filter/expert/expertFilterConstants.js";
46
+ import "react-querybuilder";
47
+ import "uuid";
48
+ import "../../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
49
+ import "../../../../../components/composite/filter/utils/filterFormUtils.js";
50
+ import "@react-querybuilder/material";
51
+ import "../../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
52
+ import "../../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
53
+ import "../../../../../components/composite/agGridTable/BottomTableButtons.js";
54
+ import "../../../../../components/composite/agGridTable/CustomAgGridTable.js";
55
+ import "ag-grid-community";
56
+ import "../../../../../components/composite/customAGGrid/customAggrid.js";
57
+ import "../../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
58
+ import "mathjs";
59
+ import "../../../../../components/composite/report/report-viewer/log-table/log-table.js";
60
+ import "react-window";
61
+ import "../../../../../components/composite/report/report-treeview/treeview-item.js";
62
+ import "../../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
63
+ function RatioTapChangerPaneSteps({
64
+ disabled,
65
+ previousValues,
66
+ editData,
67
+ isModification = false
68
+ }) {
69
+ const intl = useIntl();
70
+ const COLUMNS_DEFINITIONS = useMemo(() => {
71
+ return [
72
+ {
73
+ label: "Tap",
74
+ dataKey: FieldConstants.STEPS_TAP,
75
+ type: DndColumnType.TEXT
76
+ },
77
+ {
78
+ label: "DeltaResistance",
79
+ dataKey: FieldConstants.STEPS_RESISTANCE,
80
+ initialValue: 0,
81
+ editable: true,
82
+ type: DndColumnType.NUMERIC,
83
+ clearable: false
84
+ },
85
+ {
86
+ label: "DeltaReactance",
87
+ dataKey: FieldConstants.STEPS_REACTANCE,
88
+ initialValue: 0,
89
+ editable: true,
90
+ type: DndColumnType.NUMERIC,
91
+ clearable: false
92
+ },
93
+ {
94
+ label: "DeltaConductance",
95
+ dataKey: FieldConstants.STEPS_CONDUCTANCE,
96
+ initialValue: 0,
97
+ editable: true,
98
+ type: DndColumnType.NUMERIC,
99
+ clearable: false
100
+ },
101
+ {
102
+ label: "DeltaSusceptance",
103
+ dataKey: FieldConstants.STEPS_SUSCEPTANCE,
104
+ initialValue: 0,
105
+ editable: true,
106
+ type: DndColumnType.NUMERIC,
107
+ clearable: false
108
+ },
109
+ {
110
+ label: "Ratio",
111
+ dataKey: FieldConstants.STEPS_RATIO,
112
+ initialValue: 1,
113
+ editable: true,
114
+ type: DndColumnType.NUMERIC,
115
+ clearable: false
116
+ }
117
+ ].map((column) => ({
118
+ ...column,
119
+ label: intl.formatMessage({ id: column.label }).toLowerCase().replace(/^\w/, (c) => c.toUpperCase())
120
+ }));
121
+ }, [intl]);
122
+ const csvColumns = useMemo(() => {
123
+ return [
124
+ intl.formatMessage({ id: "ImportFileResistance" }),
125
+ intl.formatMessage({ id: "ImportFileReactance" }),
126
+ intl.formatMessage({ id: "ImportFileConductance" }),
127
+ intl.formatMessage({ id: "ImportFileSusceptance" }),
128
+ intl.formatMessage({ id: "Ratio" })
129
+ ];
130
+ }, [intl]);
131
+ const handleImportRow = (val) => {
132
+ return {
133
+ [FieldConstants.STEPS_RESISTANCE]: parseIntData(
134
+ val[intl.formatMessage({
135
+ id: "ImportFileResistance"
136
+ })],
137
+ 0
138
+ ),
139
+ [FieldConstants.STEPS_REACTANCE]: parseIntData(
140
+ val[intl.formatMessage({
141
+ id: "ImportFileReactance"
142
+ })],
143
+ 0
144
+ ),
145
+ [FieldConstants.STEPS_CONDUCTANCE]: parseIntData(
146
+ val[intl.formatMessage({
147
+ id: "ImportFileConductance"
148
+ })],
149
+ 0
150
+ ),
151
+ [FieldConstants.STEPS_SUSCEPTANCE]: parseIntData(
152
+ val[intl.formatMessage({
153
+ id: "ImportFileSusceptance"
154
+ })],
155
+ 0
156
+ ),
157
+ [FieldConstants.STEPS_RATIO]: Number.isNaN(Number.parseFloat(val[intl.formatMessage({ id: "Ratio" })])) ? 1 : Number.parseFloat(val[intl.formatMessage({ id: "Ratio" })])
158
+ };
159
+ };
160
+ return /* @__PURE__ */ jsx(
161
+ TapChangerSteps,
162
+ {
163
+ tapChanger: FieldConstants.RATIO_TAP_CHANGER,
164
+ createTapRuleColumn: FieldConstants.STEPS_RATIO,
165
+ columnsDefinition: COLUMNS_DEFINITIONS,
166
+ csvColumns,
167
+ createRuleMessageId: "CreateRegulationRule",
168
+ createRuleAllowNegativeValues: false,
169
+ importRuleMessageId: "ImportRegulationRule",
170
+ resetButtonMessageId: "ResetRegulationRule",
171
+ handleImportRow,
172
+ disabled,
173
+ previousValues,
174
+ editData: editData?.ratioTapChanger?.steps,
175
+ isModification
176
+ }
177
+ );
178
+ }
179
+ export {
180
+ RatioTapChangerPaneSteps
181
+ };
@@ -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 './ratioTapChanger.utils';
8
+ export * from './RatioTapChangerPaneSteps';
9
+ export * from './RatioTapChangerPane';
@@ -0,0 +1,18 @@
1
+ import { getComputedPreviousRatioRegulationType, getComputedRegulationMode, getComputedRegulationModeId, getComputedRegulationType, getComputedRegulationTypeId, getComputedTapSide, getComputedTapSideId, getInitialTwtRatioRegulationModeId, getRatioTapChangerEmptyFormData, getRatioTapChangerFormData, getRatioTapChangerValidationSchemaProps } from "./ratioTapChanger.utils.js";
2
+ import { RatioTapChangerPaneSteps } from "./RatioTapChangerPaneSteps.js";
3
+ import { RatioTapChangerPane } from "./RatioTapChangerPane.js";
4
+ export {
5
+ RatioTapChangerPane,
6
+ RatioTapChangerPaneSteps,
7
+ getComputedPreviousRatioRegulationType,
8
+ getComputedRegulationMode,
9
+ getComputedRegulationModeId,
10
+ getComputedRegulationType,
11
+ getComputedRegulationTypeId,
12
+ getComputedTapSide,
13
+ getComputedTapSideId,
14
+ getInitialTwtRatioRegulationModeId,
15
+ getRatioTapChangerEmptyFormData,
16
+ getRatioTapChangerFormData,
17
+ getRatioTapChangerValidationSchemaProps
18
+ };
@@ -0,0 +1,132 @@
1
+ import { InferType } from 'yup';
2
+ import { TapChangerStep, TwoWindingsTransformerMapInfos } from '../../common/twoWindingsTransformer.types';
3
+ import { FieldConstants } from '../../../../../utils/constants/fieldConstants';
4
+ import { DeepNullable } from '../../../../../utils';
5
+ export declare const getRatioTapChangerValidationSchemaProps: (isModification?: boolean) => import('yup').ObjectSchema<{
6
+ voltageLevel: {
7
+ id?: string | undefined;
8
+ name?: string | undefined;
9
+ nominalVoltage?: string | undefined;
10
+ substationId?: string | undefined;
11
+ topologyKind?: string | null | undefined;
12
+ } | null;
13
+ equipment: {
14
+ id?: string | undefined;
15
+ name?: string | null | undefined;
16
+ type?: string | undefined;
17
+ } | null;
18
+ enabled: NonNullable<boolean | undefined>;
19
+ hasLoadTapChangingCapabilities: boolean | null | undefined;
20
+ regulationMode: string | null | undefined;
21
+ regulationType: string | null | undefined;
22
+ regulationSide: string | null | undefined;
23
+ targetV: {} | null | undefined;
24
+ targetDeadband: {} | null | undefined;
25
+ lowTapPosition: number | null | undefined;
26
+ highTapPosition: number | null | undefined;
27
+ tapPosition: number | null | undefined;
28
+ steps: {
29
+ b?: number | undefined;
30
+ g?: number | undefined;
31
+ r?: number | undefined;
32
+ x?: number | undefined;
33
+ rho?: number | undefined;
34
+ index: number;
35
+ }[] | undefined;
36
+ }, import('yup').AnyObject, {
37
+ voltageLevel: {
38
+ id: undefined;
39
+ name: undefined;
40
+ substationId: undefined;
41
+ nominalVoltage: undefined;
42
+ topologyKind: undefined;
43
+ };
44
+ equipment: {
45
+ id: undefined;
46
+ name: undefined;
47
+ type: undefined;
48
+ };
49
+ enabled: undefined;
50
+ hasLoadTapChangingCapabilities: undefined;
51
+ regulationMode: undefined;
52
+ regulationType: undefined;
53
+ regulationSide: undefined;
54
+ targetV: undefined;
55
+ targetDeadband: undefined;
56
+ lowTapPosition: undefined;
57
+ highTapPosition: undefined;
58
+ tapPosition: undefined;
59
+ steps: "";
60
+ }, "">;
61
+ export type RatioTapChangerFormSchema = InferType<ReturnType<typeof getRatioTapChangerValidationSchemaProps>>;
62
+ export declare const getRatioTapChangerEmptyFormData: (isModification?: boolean) => DeepNullable<RatioTapChangerFormSchema>;
63
+ interface RatioTapChangerFormParams {
64
+ enabled?: boolean;
65
+ hasLoadTapChangingCapabilities?: boolean | null;
66
+ regulationMode?: string | null;
67
+ regulationType?: string | null;
68
+ regulationSide?: string | null;
69
+ targetV?: number | null;
70
+ targetDeadband?: number | null;
71
+ lowTapPosition?: number | null;
72
+ highTapPosition?: number | null;
73
+ tapPosition?: number | null;
74
+ steps?: TapChangerStep[];
75
+ voltageLevelId?: string;
76
+ equipmentId?: string;
77
+ equipmentType?: string;
78
+ }
79
+ export declare const getRatioTapChangerFormData: ({ enabled, hasLoadTapChangingCapabilities, regulationMode, regulationType, regulationSide, targetV, targetDeadband, lowTapPosition, highTapPosition, tapPosition, steps, voltageLevelId, equipmentId, equipmentType, }: RatioTapChangerFormParams, id?: typeof FieldConstants.RATIO_TAP_CHANGER) => {
80
+ ratioTapChanger: {
81
+ voltageLevel: {
82
+ id: string;
83
+ name: string;
84
+ substationId: string;
85
+ nominalVoltage: string;
86
+ topologyKind: string;
87
+ } | null;
88
+ equipment: {
89
+ id: string;
90
+ name: string | null;
91
+ type: string;
92
+ } | null;
93
+ enabled: boolean;
94
+ hasLoadTapChangingCapabilities: boolean | null;
95
+ regulationMode: string | null;
96
+ regulationType: string | null;
97
+ regulationSide: string | null;
98
+ targetV: number | null;
99
+ targetDeadband: number | null;
100
+ lowTapPosition: number | null;
101
+ highTapPosition: number | null;
102
+ tapPosition: number | null;
103
+ steps: TapChangerStep[];
104
+ };
105
+ };
106
+ export declare const getComputedRegulationType: (twt: TwoWindingsTransformerMapInfos) => {
107
+ readonly id: "DISTANT";
108
+ readonly label: "Distant";
109
+ } | {
110
+ readonly id: "LOCAL";
111
+ readonly label: "Local";
112
+ } | null;
113
+ export declare const getComputedRegulationTypeId: (twt: TwoWindingsTransformerMapInfos) => "LOCAL" | "DISTANT" | null;
114
+ export declare const getComputedRegulationMode: (twt: TwoWindingsTransformerMapInfos) => {
115
+ readonly id: "FIXED_RATIO";
116
+ readonly label: "FixedRatio";
117
+ } | {
118
+ readonly id: "VOLTAGE_REGULATION";
119
+ readonly label: "VoltageRegulation";
120
+ } | null;
121
+ export declare const getInitialTwtRatioRegulationModeId: (twt: TwoWindingsTransformerMapInfos) => "FIXED_RATIO" | "VOLTAGE_REGULATION" | null;
122
+ export declare const getComputedRegulationModeId: (twt: TwoWindingsTransformerMapInfos) => "FIXED_RATIO" | "VOLTAGE_REGULATION" | null;
123
+ export declare const getComputedPreviousRatioRegulationType: (previousValues: TwoWindingsTransformerMapInfos) => "LOCAL" | "DISTANT" | null;
124
+ export declare const getComputedTapSide: (twt: TwoWindingsTransformerMapInfos) => {
125
+ readonly id: "SIDE1";
126
+ readonly label: "RegulatedSide1";
127
+ } | {
128
+ readonly id: "SIDE2";
129
+ readonly label: "RegulatedSide2";
130
+ } | null;
131
+ export declare const getComputedTapSideId: (twt: TwoWindingsTransformerMapInfos) => "SIDE1" | "SIDE2" | null;
132
+ export {};