@gridsuite/commons-ui 0.284.0 → 0.286.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 (85) hide show
  1. package/dist/components/ui/reactHookForm/DirectoryItemsInput.d.ts +2 -1
  2. package/dist/components/ui/reactHookForm/DirectoryItemsInput.js +14 -2
  3. package/dist/components/ui/reactHookForm/text/DescriptionField.d.ts +3 -1
  4. package/dist/components/ui/reactHookForm/text/DescriptionField.js +12 -2
  5. package/dist/components/ui/reactHookForm/utils/HelperPreviousValue.js +1 -1
  6. package/dist/features/index.js +50 -7
  7. package/dist/features/network-modification-table/renderers/reference-link-cell.js +4 -4
  8. package/dist/features/network-modification-table/utils.js +1 -1
  9. package/dist/features/network-modifications/battery/modification/BatteryDialogTabsContent.d.ts +2 -2
  10. package/dist/features/network-modifications/common/index.js +2 -5
  11. package/dist/features/network-modifications/common/measurements/PowerMeasurementsForm.js +3 -9
  12. package/dist/features/network-modifications/common/measurements/branchActiveReactivePowerForm.utils.d.ts +4 -17
  13. package/dist/features/network-modifications/common/measurements/branchActiveReactivePowerForm.utils.js +0 -8
  14. package/dist/features/network-modifications/common/measurements/index.js +1 -2
  15. package/dist/features/network-modifications/common/measurements/injectionActiveReactivePowerForm.utils.d.ts +6 -9
  16. package/dist/features/network-modifications/common/measurements/measurement.type.d.ts +7 -1
  17. package/dist/features/network-modifications/common/measurements/powerWithValidity.utils.d.ts +3 -3
  18. package/dist/features/network-modifications/common/reactiveLimits/index.js +1 -3
  19. package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/index.js +1 -3
  20. package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/reactiveCapability.utils.d.ts +0 -4
  21. package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/reactiveCapability.utils.js +0 -8
  22. package/dist/features/network-modifications/common/reactiveLimits/reactiveLimits.type.d.ts +1 -0
  23. package/dist/features/network-modifications/generator/modification/GeneratorDialogTabsContent.d.ts +2 -2
  24. package/dist/features/network-modifications/hvdcLine/index.d.ts +7 -0
  25. package/dist/features/network-modifications/hvdcLine/index.js +47 -0
  26. package/dist/features/network-modifications/hvdcLine/vsc/common/characteristics/VscHvdcLineCharacteristicsPane.d.ts +8 -0
  27. package/dist/features/network-modifications/hvdcLine/vsc/common/characteristics/VscHvdcLineCharacteristicsPane.js +235 -0
  28. package/dist/features/network-modifications/hvdcLine/vsc/common/characteristics/index.d.ts +8 -0
  29. package/dist/features/network-modifications/hvdcLine/vsc/common/characteristics/index.js +11 -0
  30. package/dist/features/network-modifications/hvdcLine/vsc/common/characteristics/vscHvdcLineCharacteristicsPane.utils.d.ts +67 -0
  31. package/dist/features/network-modifications/hvdcLine/vsc/common/characteristics/vscHvdcLineCharacteristicsPane.utils.js +106 -0
  32. package/dist/features/network-modifications/hvdcLine/vsc/common/converterStation/VscConverterStationPane.d.ts +12 -0
  33. package/dist/features/network-modifications/hvdcLine/vsc/common/converterStation/VscConverterStationPane.js +198 -0
  34. package/dist/features/network-modifications/hvdcLine/vsc/common/converterStation/index.d.ts +8 -0
  35. package/dist/features/network-modifications/hvdcLine/vsc/common/converterStation/index.js +13 -0
  36. package/dist/features/network-modifications/hvdcLine/vsc/common/converterStation/vscConverterStationPane.utils.d.ts +156 -0
  37. package/dist/features/network-modifications/hvdcLine/vsc/common/converterStation/vscConverterStationPane.utils.js +199 -0
  38. package/dist/features/network-modifications/hvdcLine/vsc/common/form/VscHvdcLineDialogHeader.d.ts +6 -0
  39. package/dist/features/network-modifications/hvdcLine/vsc/common/form/VscHvdcLineDialogHeader.js +106 -0
  40. package/dist/features/network-modifications/hvdcLine/vsc/common/form/VscHvdcLineDialogTabs.d.ts +9 -0
  41. package/dist/features/network-modifications/hvdcLine/vsc/common/form/VscHvdcLineDialogTabs.js +129 -0
  42. package/dist/features/network-modifications/hvdcLine/vsc/common/form/VscHvdcLineDialogTabsContent.d.ts +10 -0
  43. package/dist/features/network-modifications/hvdcLine/vsc/common/form/VscHvdcLineDialogTabsContent.js +139 -0
  44. package/dist/features/network-modifications/hvdcLine/vsc/common/form/VscHvdcLineForm.d.ts +11 -0
  45. package/dist/features/network-modifications/hvdcLine/vsc/common/form/VscHvdcLineForm.js +43 -0
  46. package/dist/features/network-modifications/hvdcLine/vsc/common/form/index.d.ts +11 -0
  47. package/dist/features/network-modifications/hvdcLine/vsc/common/form/index.js +13 -0
  48. package/dist/features/network-modifications/hvdcLine/vsc/common/form/vscHvdcLine.utils.d.ts +8 -0
  49. package/dist/features/network-modifications/hvdcLine/vsc/common/form/vscHvdcLine.utils.js +34 -0
  50. package/dist/features/network-modifications/hvdcLine/vsc/common/index.d.ts +10 -0
  51. package/dist/features/network-modifications/hvdcLine/vsc/common/index.js +36 -0
  52. package/dist/features/network-modifications/hvdcLine/vsc/common/vscHvdcLine.types.d.ts +52 -0
  53. package/dist/features/network-modifications/hvdcLine/vsc/common/vscHvdcLine.types.js +25 -0
  54. package/dist/features/network-modifications/hvdcLine/vsc/creation/index.d.ts +8 -0
  55. package/dist/features/network-modifications/hvdcLine/vsc/creation/index.js +7 -0
  56. package/dist/features/network-modifications/hvdcLine/vsc/creation/vscHvdcLineCreation.types.d.ts +45 -0
  57. package/dist/features/network-modifications/hvdcLine/vsc/creation/vscHvdcLineCreation.types.js +1 -0
  58. package/dist/features/network-modifications/hvdcLine/vsc/creation/vscHvdcLineCreation.utils.d.ts +159 -0
  59. package/dist/features/network-modifications/hvdcLine/vsc/creation/vscHvdcLineCreation.utils.js +88 -0
  60. package/dist/features/network-modifications/hvdcLine/vsc/index.d.ts +9 -0
  61. package/dist/features/network-modifications/hvdcLine/vsc/index.js +47 -0
  62. package/dist/features/network-modifications/hvdcLine/vsc/modification/index.d.ts +8 -0
  63. package/dist/features/network-modifications/hvdcLine/vsc/modification/index.js +8 -0
  64. package/dist/features/network-modifications/hvdcLine/vsc/modification/vscHvdcLineModification.types.d.ts +49 -0
  65. package/dist/features/network-modifications/hvdcLine/vsc/modification/vscHvdcLineModification.types.js +1 -0
  66. package/dist/features/network-modifications/hvdcLine/vsc/modification/vscHvdcLineModification.utils.d.ts +230 -0
  67. package/dist/features/network-modifications/hvdcLine/vsc/modification/vscHvdcLineModification.utils.js +145 -0
  68. package/dist/features/network-modifications/index.d.ts +1 -0
  69. package/dist/features/network-modifications/index.js +48 -6
  70. package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-tabs.js +3 -3
  71. package/dist/features/parameters/common/widget/parameter-line-directory-items-input.d.ts +4 -1
  72. package/dist/features/parameters/common/widget/parameter-line-directory-items-input.js +8 -4
  73. package/dist/features/process-configs/index.js +2 -1
  74. package/dist/features/process-configs/process-config.utils.d.ts +31 -0
  75. package/dist/features/process-configs/process-config.utils.js +53 -0
  76. package/dist/hooks/useModificationLabelComputer.js +7 -5
  77. package/dist/index.js +50 -7
  78. package/dist/translations/en/networkModificationsEn.d.ts +23 -4
  79. package/dist/translations/en/networkModificationsEn.js +23 -4
  80. package/dist/translations/fr/networkModificationsFr.d.ts +23 -4
  81. package/dist/translations/fr/networkModificationsFr.js +23 -4
  82. package/dist/utils/constants/fieldConstants.d.ts +15 -0
  83. package/dist/utils/constants/fieldConstants.js +15 -0
  84. package/dist/utils/types/network-modification-metadata.d.ts +3 -3
  85. package/package.json +1 -1
@@ -0,0 +1,198 @@
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import { useEffect } from "react";
3
+ import { Grid } from "@mui/material";
4
+ import { useFormContext, useWatch } from "react-hook-form";
5
+ import { useIntl } from "react-intl";
6
+ import "@mui/icons-material";
7
+ import "../../../../../../components/ui/overflowableText/OverflowableText.js";
8
+ import { PercentageAdornment, ReactivePowerAdornment, VoltageAdornment } from "../../../../../../utils/constants/adornments.js";
9
+ import { FieldConstants } from "../../../../../../utils/constants/fieldConstants.js";
10
+ import "../../../../../../utils/conversionUtils.js";
11
+ import "../../../../../../utils/types/equipmentType.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 "yup";
18
+ import "../../../../../../components/ui/treeViewFinder/TreeViewFinder.js";
19
+ import { SwitchInput } from "../../../../../../components/ui/reactHookForm/booleans/SwitchInput.js";
20
+ import { FloatInput } from "../../../../../../components/ui/reactHookForm/numbers/FloatInput.js";
21
+ import { TextInput } from "../../../../../../components/ui/reactHookForm/text/TextInput.js";
22
+ import "../../../../../../components/ui/reactHookForm/numbers/RangeInput.js";
23
+ import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
24
+ import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
25
+ import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
26
+ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
27
+ import "@material-symbols/svg-400/outlined/add_notes-fill.svg?react";
28
+ import "../../../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
29
+ import "../../../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
30
+ import { CheckboxNullableInput } from "../../../../../../components/ui/reactHookForm/CheckboxNullableInput.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 "react-dom";
39
+ import "autosuggest-highlight/match";
40
+ import "autosuggest-highlight/parse";
41
+ import "clsx";
42
+ import "../../../../../../components/composite/filter/FilterCreationDialog.js";
43
+ import "../../../../../../components/composite/filter/HeaderFilterForm.js";
44
+ import "../../../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
45
+ import "../../../../../../components/composite/filter/expert/ExpertFilterForm.js";
46
+ import "../../../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
47
+ import "../../../../../../components/composite/filter/expert/expertFilterConstants.js";
48
+ import "react-querybuilder";
49
+ import "uuid";
50
+ import "../../../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
51
+ import "../../../../../../components/composite/filter/utils/filterFormUtils.js";
52
+ import { GridItem } from "../../../../../../components/composite/grid/grid-item.js";
53
+ import { GridSection } from "../../../../../../components/composite/grid/grid-section.js";
54
+ import "@react-querybuilder/material";
55
+ import "../../../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
56
+ import "../../../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
57
+ import "../../../../../../components/composite/agGridTable/BottomTableButtons.js";
58
+ import "../../../../../../components/composite/agGridTable/CustomAgGridTable.js";
59
+ import "ag-grid-community";
60
+ import "../../../../../../components/composite/customAGGrid/customAggrid.js";
61
+ import "../../../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
62
+ import "mathjs";
63
+ import "../../../../../../components/composite/report/report-viewer/log-table/log-table.js";
64
+ import "react-window";
65
+ import "../../../../../../components/composite/report/report-treeview/treeview-item.js";
66
+ import "../../../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
67
+ import { ReactiveLimitsForm } from "../../../../common/reactiveLimits/ReactiveLimitsForm.js";
68
+ import { ConnectivityForm } from "../../../../common/connectivity/ConnectivityForm.js";
69
+ function VscConverterStationPane({
70
+ id,
71
+ stationLabel,
72
+ isModification = false,
73
+ stationToModify,
74
+ updatePreviousReactiveCapabilityCurveTableConverterStation,
75
+ voltageLevelOptions = [],
76
+ PositionDiagramPane,
77
+ fetchBusesOrBusbarSections
78
+ }) {
79
+ const intl = useIntl();
80
+ const { trigger } = useFormContext();
81
+ const voltageRegulationOnWatch = useWatch({
82
+ name: `${id}.${FieldConstants.VOLTAGE_REGULATION_ON}`
83
+ });
84
+ useEffect(() => {
85
+ if (!voltageRegulationOnWatch) {
86
+ trigger(`${id}.${FieldConstants.VOLTAGE_REGULATION_ON}`);
87
+ }
88
+ }, [voltageRegulationOnWatch, trigger, id]);
89
+ const converterStationIdField = /* @__PURE__ */ jsx(
90
+ TextInput,
91
+ {
92
+ name: `${id}.${FieldConstants.CONVERTER_STATION_ID}`,
93
+ label: "converterStationId",
94
+ disabled: isModification
95
+ }
96
+ );
97
+ const converterStationNameField = /* @__PURE__ */ jsx(
98
+ TextInput,
99
+ {
100
+ name: `${id}.${FieldConstants.CONVERTER_STATION_NAME}`,
101
+ label: "converterStationName",
102
+ previousValue: stationToModify?.name ?? ""
103
+ }
104
+ );
105
+ const connectivityForm = /* @__PURE__ */ jsx(
106
+ ConnectivityForm,
107
+ {
108
+ id: `${id}.${FieldConstants.CONNECTIVITY}`,
109
+ isEquipmentModification: isModification,
110
+ previousValues: {
111
+ connectablePosition: stationToModify?.connectablePosition,
112
+ voltageLevelId: stationToModify?.voltageLevelId,
113
+ busOrBusbarSectionId: stationToModify?.busOrBusbarSectionId,
114
+ terminalConnected: stationToModify?.terminalConnected
115
+ },
116
+ voltageLevelOptions,
117
+ PositionDiagramPane,
118
+ fetchBusesOrBusbarSections
119
+ }
120
+ );
121
+ const lossFactorField = /* @__PURE__ */ jsx(
122
+ FloatInput,
123
+ {
124
+ name: `${id}.${FieldConstants.LOSS_FACTOR}`,
125
+ label: "lossFactorLabel",
126
+ adornment: PercentageAdornment,
127
+ previousValue: stationToModify?.lossFactor
128
+ }
129
+ );
130
+ const reactivePowerField = /* @__PURE__ */ jsx(
131
+ FloatInput,
132
+ {
133
+ name: `${id}.${FieldConstants.REACTIVE_POWER}`,
134
+ adornment: ReactivePowerAdornment,
135
+ label: "ReactivePowerText",
136
+ previousValue: stationToModify?.reactivePowerSetpoint ?? void 0
137
+ }
138
+ );
139
+ const previousVoltageRegulatorOn = () => {
140
+ if (!stationToModify) {
141
+ return void 0;
142
+ }
143
+ return intl.formatMessage({
144
+ id: stationToModify?.voltageRegulatorOn ? "On" : "Off"
145
+ });
146
+ };
147
+ const voltageRegulation = isModification ? /* @__PURE__ */ jsx(
148
+ CheckboxNullableInput,
149
+ {
150
+ name: `${id}.${FieldConstants.VOLTAGE_REGULATION_ON}`,
151
+ label: "VoltageRegulationText",
152
+ previousValue: previousVoltageRegulatorOn(),
153
+ id: void 0,
154
+ formProps: void 0
155
+ }
156
+ ) : /* @__PURE__ */ jsx(SwitchInput, { name: `${id}.${FieldConstants.VOLTAGE_REGULATION_ON}`, label: "VoltageRegulationText" });
157
+ const voltageField = /* @__PURE__ */ jsx(
158
+ FloatInput,
159
+ {
160
+ name: `${id}.${FieldConstants.VOLTAGE}`,
161
+ adornment: VoltageAdornment,
162
+ label: "VoltageText",
163
+ previousValue: stationToModify?.voltageSetpoint ?? void 0
164
+ }
165
+ );
166
+ return /* @__PURE__ */ jsxs(Grid, { container: true, children: [
167
+ /* @__PURE__ */ jsx(GridSection, { title: stationLabel }),
168
+ /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, sx: { width: "100%" }, children: [
169
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: converterStationIdField }),
170
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: converterStationNameField })
171
+ ] }),
172
+ !isModification && /* @__PURE__ */ jsxs(Fragment, { children: [
173
+ /* @__PURE__ */ jsx(GridSection, { title: "Connectivity" }),
174
+ /* @__PURE__ */ jsx(Grid, { container: true, spacing: 2, children: /* @__PURE__ */ jsx(GridItem, { size: 12, children: connectivityForm }) })
175
+ ] }),
176
+ /* @__PURE__ */ jsx(GridSection, { title: "Characteristics" }),
177
+ /* @__PURE__ */ jsx(Grid, { container: true, sx: { width: "100%" }, children: /* @__PURE__ */ jsx(GridItem, { size: 4, children: lossFactorField }) }),
178
+ /* @__PURE__ */ jsx(GridSection, { title: "ReactiveLimits" }),
179
+ /* @__PURE__ */ jsx(
180
+ ReactiveLimitsForm,
181
+ {
182
+ id: `${id}.${FieldConstants.REACTIVE_LIMITS}`,
183
+ previousReactiveCapabilityCurvePoints: stationToModify?.reactiveCapabilityCurvePoints,
184
+ previousMinMaxReactiveLimits: stationToModify?.minMaxReactiveLimits,
185
+ updatePreviousReactiveCapabilityCurveTable: updatePreviousReactiveCapabilityCurveTableConverterStation
186
+ }
187
+ ),
188
+ /* @__PURE__ */ jsx(GridSection, { title: "Setpoints" }),
189
+ /* @__PURE__ */ jsx(Grid, { container: true, spacing: 2, sx: { width: "100%" }, children: /* @__PURE__ */ jsx(GridItem, { size: 4, children: reactivePowerField }) }),
190
+ /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, paddingTop: 2, sx: { width: "100%" }, children: [
191
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: voltageRegulation }),
192
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: voltageField })
193
+ ] })
194
+ ] });
195
+ }
196
+ export {
197
+ VscConverterStationPane
198
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Copyright (c) 2026, RTE (http://www.rte-france.com)
3
+ * This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
+ */
7
+ export * from './vscConverterStationPane.utils';
8
+ export * from './VscConverterStationPane';
@@ -0,0 +1,13 @@
1
+ import { converterStationCreationDtoToForm, converterStationCreationFormToDto, converterStationCreationFromCopy, converterStationModificationDtoToForm, converterStationModificationFormToDto, getVscConverterStationCreationSchema, getVscConverterStationEmptyFormData, getVscConverterStationModificationSchema } from "./vscConverterStationPane.utils.js";
2
+ import { VscConverterStationPane } from "./VscConverterStationPane.js";
3
+ export {
4
+ VscConverterStationPane,
5
+ converterStationCreationDtoToForm,
6
+ converterStationCreationFormToDto,
7
+ converterStationCreationFromCopy,
8
+ converterStationModificationDtoToForm,
9
+ converterStationModificationFormToDto,
10
+ getVscConverterStationCreationSchema,
11
+ getVscConverterStationEmptyFormData,
12
+ getVscConverterStationModificationSchema
13
+ };
@@ -0,0 +1,156 @@
1
+ import { InferType } from 'yup';
2
+ import { FieldConstants } from '../../../../../../utils';
3
+ import { InjectionActiveReactivePowerFormData } from '../../../../common/measurements/injectionActiveReactivePowerForm.utils';
4
+ import { ConverterStationCreationDto } from '../../creation/vscHvdcLineCreation.types';
5
+ import { ConverterStationInfos } from '../vscHvdcLine.types';
6
+ import { ConverterStationModificationDto } from '../../modification/vscHvdcLineModification.types';
7
+ export type UpdateReactiveCapabilityCurveTableConverterStation = (action: string, index: number, converterStationName: FieldConstants.CONVERTER_STATION_1 | FieldConstants.CONVERTER_STATION_2) => void;
8
+ export declare const getVscConverterStationCreationSchema: () => import('yup').ObjectSchema<{
9
+ converterStationId: string;
10
+ converterStationName: string | null | undefined;
11
+ lossFactor: number;
12
+ voltageRegulationOn: boolean | undefined;
13
+ reactivePower: number | null;
14
+ voltage: number | null;
15
+ connectivity: {
16
+ terminalConnected?: boolean | null | undefined;
17
+ connectionDirection?: string | null | undefined;
18
+ connectionName?: string | undefined;
19
+ connectionPosition?: number | null | undefined;
20
+ busOrBusbarSection: {
21
+ id?: string | undefined;
22
+ } | null;
23
+ voltageLevel: {
24
+ id?: string | undefined;
25
+ } | null;
26
+ };
27
+ reactiveLimits: {
28
+ minimumReactivePower?: number | null | undefined;
29
+ maximumReactivePower?: number | null | undefined;
30
+ reactiveCapabilityCurveTable?: {
31
+ minQ: number | null;
32
+ maxQ: number | null;
33
+ p: number | null;
34
+ }[] | null | undefined;
35
+ reactiveCapabilityCurveChoice: string;
36
+ };
37
+ }, import('yup').AnyObject, {
38
+ converterStationId: undefined;
39
+ converterStationName: undefined;
40
+ lossFactor: undefined;
41
+ voltageRegulationOn: undefined;
42
+ reactivePower: null;
43
+ voltage: null;
44
+ connectivity: {
45
+ voltageLevel: {
46
+ id: undefined;
47
+ };
48
+ busOrBusbarSection: {
49
+ id: undefined;
50
+ };
51
+ connectionDirection: undefined;
52
+ connectionName: undefined;
53
+ connectionPosition: undefined;
54
+ terminalConnected: undefined;
55
+ };
56
+ reactiveLimits: {
57
+ reactiveCapabilityCurveChoice: undefined;
58
+ minimumReactivePower: undefined;
59
+ maximumReactivePower: undefined;
60
+ reactiveCapabilityCurveTable: "";
61
+ };
62
+ }, "">;
63
+ export type VscConverterStationCreationFormData = InferType<ReturnType<typeof getVscConverterStationCreationSchema>>;
64
+ export declare const getVscConverterStationModificationSchema: () => import('yup').ObjectSchema<{
65
+ converterStationId: string | undefined;
66
+ converterStationName: string | null | undefined;
67
+ lossFactor: number | null | undefined;
68
+ voltageRegulationOn: boolean | null | undefined;
69
+ reactivePower: number | null | undefined;
70
+ voltage: number | null | undefined;
71
+ connectivity: {
72
+ terminalConnected?: boolean | null | undefined;
73
+ connectionDirection?: string | null | undefined;
74
+ connectionName?: string | undefined;
75
+ connectionPosition?: number | null | undefined;
76
+ busOrBusbarSection: {
77
+ id?: string | undefined;
78
+ } | null;
79
+ voltageLevel: {
80
+ id?: string | undefined;
81
+ } | null;
82
+ };
83
+ reactiveLimits: {
84
+ minimumReactivePower?: number | null | undefined;
85
+ maximumReactivePower?: number | null | undefined;
86
+ reactiveCapabilityCurveTable?: {
87
+ minQ: number | null;
88
+ maxQ: number | null;
89
+ p: number | null;
90
+ }[] | null | undefined;
91
+ reactiveCapabilityCurveChoice: string;
92
+ };
93
+ }, import('yup').AnyObject, {
94
+ converterStationId: undefined;
95
+ converterStationName: undefined;
96
+ lossFactor: undefined;
97
+ voltageRegulationOn: undefined;
98
+ reactivePower: undefined;
99
+ voltage: undefined;
100
+ connectivity: {
101
+ voltageLevel: {
102
+ id: undefined;
103
+ };
104
+ busOrBusbarSection: {
105
+ id: undefined;
106
+ };
107
+ connectionDirection: undefined;
108
+ connectionName: undefined;
109
+ connectionPosition: undefined;
110
+ terminalConnected: undefined;
111
+ };
112
+ reactiveLimits: {
113
+ reactiveCapabilityCurveChoice: undefined;
114
+ minimumReactivePower: undefined;
115
+ maximumReactivePower: undefined;
116
+ reactiveCapabilityCurveTable: "";
117
+ };
118
+ }, "">;
119
+ export type VscConverterStationModificationFormData = InferType<ReturnType<typeof getVscConverterStationModificationSchema>>;
120
+ export declare function getVscConverterStationEmptyFormData(isModification?: boolean): {
121
+ converterStationId: string | null;
122
+ converterStationName: string | null;
123
+ lossFactor: null;
124
+ reactivePower: null;
125
+ voltageRegulationOn: boolean | null;
126
+ voltage: null;
127
+ connectivity: {
128
+ connectionDirection: null;
129
+ connectionName: string;
130
+ connectionPosition: null;
131
+ voltageLevel: null;
132
+ busOrBusbarSection: null;
133
+ terminalConnected: boolean | null;
134
+ };
135
+ reactiveLimits: {
136
+ reactiveCapabilityCurveChoice: string;
137
+ minimumReactivePower: null;
138
+ maximumReactivePower: null;
139
+ reactiveCapabilityCurveTable: {
140
+ p: null;
141
+ maxQ: null;
142
+ minQ: null;
143
+ }[];
144
+ };
145
+ stateEstimation: {
146
+ [x: string]: {
147
+ value: null;
148
+ validity: null;
149
+ };
150
+ } | null;
151
+ };
152
+ export declare function converterStationCreationFormToDto(formData: VscConverterStationCreationFormData): ConverterStationCreationDto;
153
+ export declare function converterStationCreationDtoToForm(dto: ConverterStationCreationDto): VscConverterStationCreationFormData;
154
+ export declare function converterStationCreationFromCopy(converterStation?: ConverterStationInfos): VscConverterStationCreationFormData;
155
+ export declare function converterStationModificationFormToDto(formData: VscConverterStationModificationFormData, measurementData: InjectionActiveReactivePowerFormData): ConverterStationModificationDto;
156
+ export declare function converterStationModificationDtoToForm(dto: ConverterStationModificationDto): VscConverterStationModificationFormData;
@@ -0,0 +1,199 @@
1
+ import { object, number, boolean, string } from "yup";
2
+ import { FieldConstants } from "../../../../../../utils/constants/fieldConstants.js";
3
+ import { MUST_BE_GREATER_OR_EQUAL_TO_ZERO, NORMALIZED_PERCENTAGE } from "../../../../../../utils/constants/translationKeys.js";
4
+ import { toModificationOperation } from "../../../../../../utils/conversionUtils.js";
5
+ import { UNDEFINED_CONNECTION_DIRECTION } from "../../../../../../utils/types/equipmentType.js";
6
+ import { ModificationType } from "../../../../../../utils/types/modificationType.js";
7
+ import "react/jsx-runtime";
8
+ import "@mui/icons-material";
9
+ import { sanitizeString } from "../../../../../../utils/ts-utils.js";
10
+ import { getReactiveLimitsValidationSchema, getReactiveLimitsEmptyFormDataProps, getReactiveLimitsFormDataProps } from "../../../../common/reactiveLimits/reactiveLimits.utils.js";
11
+ import { getConnectivityWithPositionSchema, getConnectivityWithPositionEmptyFormDataProps, getConnectivityFormDataProps } from "../../../../common/connectivity/connectivityForm.utils.js";
12
+ import { getInjectionActiveReactivePowerEmptyFormDataProperties } from "../../../../common/measurements/injectionActiveReactivePowerForm.utils.js";
13
+ const getVscConverterStationCreationSchema = () => object().shape({
14
+ [FieldConstants.CONVERTER_STATION_ID]: string().nullable().required(),
15
+ [FieldConstants.CONVERTER_STATION_NAME]: string().nullable(),
16
+ [FieldConstants.LOSS_FACTOR]: number().nullable().required().min(0, NORMALIZED_PERCENTAGE).max(100, NORMALIZED_PERCENTAGE),
17
+ [FieldConstants.VOLTAGE_REGULATION_ON]: boolean(),
18
+ [FieldConstants.REACTIVE_POWER]: number().nullable().default(null).when([FieldConstants.VOLTAGE_REGULATION_ON], {
19
+ is: false,
20
+ then: (schema) => schema.required()
21
+ }),
22
+ [FieldConstants.VOLTAGE]: number().nullable().default(null).min(0, MUST_BE_GREATER_OR_EQUAL_TO_ZERO).when([FieldConstants.VOLTAGE_REGULATION_ON], {
23
+ is: true,
24
+ then: (schema) => schema.required()
25
+ }),
26
+ [FieldConstants.CONNECTIVITY]: getConnectivityWithPositionSchema(),
27
+ [FieldConstants.REACTIVE_LIMITS]: getReactiveLimitsValidationSchema(false, true)
28
+ });
29
+ const getVscConverterStationModificationSchema = () => object().shape({
30
+ [FieldConstants.CONVERTER_STATION_ID]: string(),
31
+ [FieldConstants.CONVERTER_STATION_NAME]: string().nullable(),
32
+ [FieldConstants.LOSS_FACTOR]: number().nullable().min(0, NORMALIZED_PERCENTAGE).max(100, NORMALIZED_PERCENTAGE),
33
+ [FieldConstants.VOLTAGE_REGULATION_ON]: boolean().nullable(),
34
+ [FieldConstants.REACTIVE_POWER]: number().nullable(),
35
+ [FieldConstants.VOLTAGE]: number().nullable().min(0, MUST_BE_GREATER_OR_EQUAL_TO_ZERO),
36
+ [FieldConstants.CONNECTIVITY]: getConnectivityWithPositionSchema(true),
37
+ [FieldConstants.REACTIVE_LIMITS]: getReactiveLimitsValidationSchema(true)
38
+ });
39
+ function getVscConverterStationEmptyFormData(isModification = false) {
40
+ return {
41
+ [FieldConstants.CONVERTER_STATION_ID]: isModification ? "" : null,
42
+ [FieldConstants.CONVERTER_STATION_NAME]: isModification ? "" : null,
43
+ [FieldConstants.LOSS_FACTOR]: null,
44
+ [FieldConstants.REACTIVE_POWER]: null,
45
+ [FieldConstants.VOLTAGE_REGULATION_ON]: isModification ? null : false,
46
+ [FieldConstants.VOLTAGE]: null,
47
+ [FieldConstants.CONNECTIVITY]: getConnectivityWithPositionEmptyFormDataProps(isModification),
48
+ [FieldConstants.REACTIVE_LIMITS]: getReactiveLimitsEmptyFormDataProps(),
49
+ [FieldConstants.STATE_ESTIMATION]: isModification ? getInjectionActiveReactivePowerEmptyFormDataProperties() : null
50
+ };
51
+ }
52
+ function converterStationCreationFormToDto(formData) {
53
+ const reactiveLimits = formData[FieldConstants.REACTIVE_LIMITS];
54
+ const isReactiveCapabilityCurveOn = reactiveLimits[FieldConstants.REACTIVE_CAPABILITY_CURVE_CHOICE] === "CURVE";
55
+ return {
56
+ type: ModificationType.CONVERTER_STATION_CREATION,
57
+ equipmentId: formData[FieldConstants.CONVERTER_STATION_ID],
58
+ equipmentName: formData[FieldConstants.CONVERTER_STATION_NAME] ?? null,
59
+ lossFactor: formData[FieldConstants.LOSS_FACTOR],
60
+ reactivePowerSetpoint: formData[FieldConstants.REACTIVE_POWER],
61
+ voltageRegulationOn: formData[FieldConstants.VOLTAGE_REGULATION_ON],
62
+ voltageSetpoint: formData[FieldConstants.VOLTAGE],
63
+ voltageLevelId: formData[FieldConstants.CONNECTIVITY]?.[FieldConstants.VOLTAGE_LEVEL]?.[FieldConstants.ID] ?? "",
64
+ busOrBusbarSectionId: formData[FieldConstants.CONNECTIVITY]?.[FieldConstants.BUS_OR_BUSBAR_SECTION]?.[FieldConstants.ID] ?? "",
65
+ connectionName: sanitizeString(formData[FieldConstants.CONNECTIVITY]?.[FieldConstants.CONNECTION_NAME]),
66
+ connectionDirection: formData[FieldConstants.CONNECTIVITY]?.[FieldConstants.CONNECTION_DIRECTION] ?? UNDEFINED_CONNECTION_DIRECTION,
67
+ connectionPosition: formData[FieldConstants.CONNECTIVITY]?.[FieldConstants.CONNECTION_POSITION],
68
+ terminalConnected: formData[FieldConstants.CONNECTIVITY]?.[FieldConstants.CONNECTED],
69
+ reactiveCapabilityCurve: isReactiveCapabilityCurveOn,
70
+ minQ: isReactiveCapabilityCurveOn ? null : reactiveLimits[FieldConstants.MINIMUM_REACTIVE_POWER] ?? null,
71
+ maxQ: isReactiveCapabilityCurveOn ? null : reactiveLimits[FieldConstants.MAXIMUM_REACTIVE_POWER] ?? null,
72
+ reactiveCapabilityCurvePoints: isReactiveCapabilityCurveOn ? reactiveLimits[FieldConstants.REACTIVE_CAPABILITY_CURVE_TABLE] ?? [] : []
73
+ };
74
+ }
75
+ function getConverterStationReactiveLimits(converterStation) {
76
+ return converterStation.reactiveCapabilityCurve ? getReactiveLimitsFormDataProps({
77
+ reactiveCapabilityCurveChoice: "CURVE",
78
+ minimumReactivePower: null,
79
+ maximumReactivePower: null,
80
+ reactiveCapabilityCurvePoints: converterStation.reactiveCapabilityCurvePoints
81
+ }) : getReactiveLimitsFormDataProps({
82
+ reactiveCapabilityCurveChoice: "MINMAX",
83
+ minimumReactivePower: converterStation.minQ,
84
+ maximumReactivePower: converterStation.maxQ,
85
+ reactiveCapabilityCurvePoints: converterStation?.reactiveCapabilityCurvePoints ?? null
86
+ });
87
+ }
88
+ function converterStationCreationDtoToForm(dto) {
89
+ return {
90
+ [FieldConstants.CONVERTER_STATION_ID]: dto?.equipmentId,
91
+ [FieldConstants.CONVERTER_STATION_NAME]: dto?.equipmentName ?? "",
92
+ [FieldConstants.LOSS_FACTOR]: dto?.lossFactor ?? 0,
93
+ [FieldConstants.REACTIVE_POWER]: dto?.reactivePowerSetpoint,
94
+ [FieldConstants.VOLTAGE_REGULATION_ON]: dto?.voltageRegulationOn,
95
+ [FieldConstants.VOLTAGE]: dto?.voltageSetpoint,
96
+ [FieldConstants.CONNECTIVITY]: getConnectivityFormDataProps({
97
+ voltageLevelId: dto.voltageLevelId,
98
+ busbarSectionId: dto.busOrBusbarSectionId,
99
+ connectionDirection: dto.connectionDirection,
100
+ connectionName: dto.connectionName,
101
+ connectionPosition: dto.connectionPosition,
102
+ terminalConnected: dto.terminalConnected
103
+ }),
104
+ [FieldConstants.REACTIVE_LIMITS]: getConverterStationReactiveLimits(dto)
105
+ };
106
+ }
107
+ function converterStationCreationFromCopy(converterStation) {
108
+ return {
109
+ [FieldConstants.CONVERTER_STATION_ID]: `${converterStation?.id}(1)`,
110
+ [FieldConstants.CONVERTER_STATION_NAME]: converterStation?.name ?? "",
111
+ [FieldConstants.LOSS_FACTOR]: converterStation?.lossFactor ?? 0,
112
+ [FieldConstants.REACTIVE_POWER]: converterStation?.reactivePowerSetpoint ?? null,
113
+ [FieldConstants.VOLTAGE_REGULATION_ON]: converterStation?.voltageRegulatorOn,
114
+ [FieldConstants.VOLTAGE]: converterStation?.voltageSetpoint ?? null,
115
+ [FieldConstants.CONNECTIVITY]: getConnectivityFormDataProps({
116
+ voltageLevelId: converterStation?.voltageLevelId,
117
+ busbarSectionId: converterStation?.busOrBusbarSectionId,
118
+ connectionDirection: converterStation?.connectablePosition?.connectionDirection,
119
+ connectionName: converterStation?.connectablePosition?.connectionName,
120
+ connectionPosition: null,
121
+ terminalConnected: true
122
+ }),
123
+ [FieldConstants.REACTIVE_LIMITS]: getReactiveLimitsFormDataProps({
124
+ reactiveCapabilityCurveChoice: converterStation?.minMaxReactiveLimits ? "MINMAX" : "CURVE",
125
+ minimumReactivePower: converterStation?.minMaxReactiveLimits?.minQ,
126
+ maximumReactivePower: converterStation?.minMaxReactiveLimits?.maxQ,
127
+ reactiveCapabilityCurvePoints: converterStation?.reactiveCapabilityCurvePoints ?? null
128
+ })
129
+ };
130
+ }
131
+ function converterStationModificationFormToDto(formData, measurementData) {
132
+ const reactiveLimits = formData[FieldConstants.REACTIVE_LIMITS];
133
+ const connectivity = formData[FieldConstants.CONNECTIVITY];
134
+ const isReactiveCapabilityCurveOn = reactiveLimits[FieldConstants.REACTIVE_CAPABILITY_CURVE_CHOICE] === "CURVE";
135
+ return {
136
+ type: ModificationType.CONVERTER_STATION_MODIFICATION,
137
+ equipmentId: formData[FieldConstants.CONVERTER_STATION_ID] ?? "",
138
+ equipmentName: toModificationOperation(formData[FieldConstants.CONVERTER_STATION_NAME]),
139
+ voltageLevelId: toModificationOperation(connectivity?.[FieldConstants.VOLTAGE_LEVEL]?.[FieldConstants.ID]),
140
+ busOrBusbarSectionId: toModificationOperation(
141
+ connectivity?.[FieldConstants.BUS_OR_BUSBAR_SECTION]?.[FieldConstants.ID]
142
+ ),
143
+ connectionName: toModificationOperation(connectivity?.[FieldConstants.CONNECTION_NAME]),
144
+ connectionDirection: toModificationOperation(connectivity?.[FieldConstants.CONNECTION_DIRECTION]),
145
+ connectionPosition: toModificationOperation(connectivity?.[FieldConstants.CONNECTION_POSITION]),
146
+ terminalConnected: toModificationOperation(connectivity?.[FieldConstants.CONNECTED]),
147
+ pMeasurementValue: toModificationOperation(measurementData?.[FieldConstants.MEASUREMENT_P]?.value),
148
+ pMeasurementValidity: toModificationOperation(measurementData?.[FieldConstants.MEASUREMENT_P]?.validity),
149
+ qMeasurementValue: toModificationOperation(measurementData?.[FieldConstants.MEASUREMENT_Q]?.value),
150
+ qMeasurementValidity: toModificationOperation(measurementData?.[FieldConstants.MEASUREMENT_Q]?.validity),
151
+ lossFactor: toModificationOperation(formData[FieldConstants.LOSS_FACTOR]),
152
+ reactivePowerSetpoint: toModificationOperation(formData[FieldConstants.REACTIVE_POWER]),
153
+ voltageRegulationOn: toModificationOperation(formData[FieldConstants.VOLTAGE_REGULATION_ON]),
154
+ voltageSetpoint: toModificationOperation(formData[FieldConstants.VOLTAGE]),
155
+ reactiveCapabilityCurve: toModificationOperation(isReactiveCapabilityCurveOn),
156
+ minQ: toModificationOperation(
157
+ isReactiveCapabilityCurveOn ? null : reactiveLimits[FieldConstants.MINIMUM_REACTIVE_POWER]
158
+ ),
159
+ maxQ: toModificationOperation(
160
+ isReactiveCapabilityCurveOn ? null : reactiveLimits[FieldConstants.MAXIMUM_REACTIVE_POWER]
161
+ ),
162
+ reactiveCapabilityCurvePoints: isReactiveCapabilityCurveOn ? reactiveLimits[FieldConstants.REACTIVE_CAPABILITY_CURVE_TABLE] ?? [] : []
163
+ };
164
+ }
165
+ function converterStationModificationDtoToForm(dto) {
166
+ return {
167
+ [FieldConstants.CONVERTER_STATION_ID]: dto?.equipmentId,
168
+ [FieldConstants.CONVERTER_STATION_NAME]: dto?.equipmentName?.value ?? "",
169
+ [FieldConstants.LOSS_FACTOR]: dto?.lossFactor?.value ?? null,
170
+ [FieldConstants.REACTIVE_POWER]: dto?.reactivePowerSetpoint?.value ?? null,
171
+ [FieldConstants.VOLTAGE_REGULATION_ON]: dto?.voltageRegulationOn?.value ?? null,
172
+ [FieldConstants.VOLTAGE]: dto?.voltageSetpoint?.value ?? null,
173
+ [FieldConstants.CONNECTIVITY]: getConnectivityFormDataProps({
174
+ voltageLevelId: dto?.voltageLevelId?.value ?? null,
175
+ busbarSectionId: dto?.busOrBusbarSectionId?.value ?? null,
176
+ connectionName: dto?.connectionName?.value ?? null,
177
+ connectionDirection: dto?.connectionDirection?.value ?? null,
178
+ connectionPosition: dto?.connectionPosition?.value ?? null,
179
+ terminalConnected: dto?.terminalConnected?.value ?? null,
180
+ isEquipmentModification: true
181
+ }),
182
+ [FieldConstants.REACTIVE_LIMITS]: getReactiveLimitsFormDataProps({
183
+ reactiveCapabilityCurveChoice: dto?.reactiveCapabilityCurve?.value ? "CURVE" : "MINMAX",
184
+ maximumReactivePower: dto?.maxQ?.value ?? null,
185
+ minimumReactivePower: dto?.minQ?.value ?? null,
186
+ reactiveCapabilityCurvePoints: dto?.reactiveCapabilityCurvePoints ?? null
187
+ })
188
+ };
189
+ }
190
+ export {
191
+ converterStationCreationDtoToForm,
192
+ converterStationCreationFormToDto,
193
+ converterStationCreationFromCopy,
194
+ converterStationModificationDtoToForm,
195
+ converterStationModificationFormToDto,
196
+ getVscConverterStationCreationSchema,
197
+ getVscConverterStationEmptyFormData,
198
+ getVscConverterStationModificationSchema
199
+ };
@@ -0,0 +1,6 @@
1
+ import { VscHvdcLineInfo } from '../vscHvdcLine.types';
2
+ export interface VscHvdcLineDialogHeaderProps {
3
+ hvdcLineToModify?: VscHvdcLineInfo | null;
4
+ isModification?: boolean;
5
+ }
6
+ export declare function VscHvdcLineDialogHeader({ hvdcLineToModify, isModification, }: Readonly<VscHvdcLineDialogHeaderProps>): import("react").JSX.Element;