@gridsuite/commons-ui 0.208.0 → 0.210.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/components/filter/utils/filterFormUtils.js +2 -1
  2. package/dist/components/index.js +33 -3
  3. package/dist/components/inputs/reactHookForm/booleans/RadioInput.js +2 -2
  4. package/dist/components/network-modification-table/renderers/name-cell.d.ts +2 -1
  5. package/dist/components/network-modification-table/renderers/name-cell.js +136 -19
  6. package/dist/components/network-modifications/battery/creation/BatteryCreationForm.d.ts +4 -0
  7. package/dist/components/network-modifications/battery/creation/BatteryCreationForm.js +105 -0
  8. package/dist/components/network-modifications/battery/creation/batteryCreation.types.d.ts +26 -0
  9. package/dist/components/network-modifications/battery/creation/batteryCreation.types.js +1 -0
  10. package/dist/components/network-modifications/battery/creation/batteryCreation.utils.d.ts +79 -0
  11. package/dist/components/network-modifications/battery/creation/batteryCreation.utils.js +145 -0
  12. package/dist/components/network-modifications/{voltageLevel/creation/tabs/structureTab/switchesBetweenSections/creation/CreateSwitchesForm.d.ts → battery/creation/index.d.ts} +3 -5
  13. package/dist/components/network-modifications/battery/creation/index.js +9 -0
  14. package/dist/components/network-modifications/{voltageLevel/creation/tabs/structureTab/switchesBetweenSections/creation → battery}/index.d.ts +1 -1
  15. package/dist/components/network-modifications/battery/index.js +9 -0
  16. package/dist/components/network-modifications/common/activePowerControl/activePowerControlForm.utils.js +2 -2
  17. package/dist/components/network-modifications/common/index.js +5 -2
  18. package/dist/components/network-modifications/common/reactiveLimits/index.js +5 -2
  19. package/dist/components/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/index.js +2 -1
  20. package/dist/components/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/reactiveCapability.utils.d.ts +10 -1
  21. package/dist/components/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/reactiveCapability.utils.js +30 -27
  22. package/dist/components/network-modifications/common/reactiveLimits/reactiveLimits.type.d.ts +3 -3
  23. package/dist/components/network-modifications/common/reactiveLimits/reactiveLimits.utils.d.ts +33 -0
  24. package/dist/components/network-modifications/common/reactiveLimits/reactiveLimits.utils.js +69 -35
  25. package/dist/components/network-modifications/common/setpoints/setPoints.utils.js +1 -1
  26. package/dist/components/network-modifications/common/shortCircuit/shortCircuitForm.utils.js +3 -3
  27. package/dist/components/network-modifications/index.d.ts +2 -0
  28. package/dist/components/network-modifications/index.js +33 -3
  29. package/dist/components/network-modifications/shunt-compensator/common/CharacteristicsForm.d.ts +6 -0
  30. package/dist/components/network-modifications/shunt-compensator/common/CharacteristicsForm.js +199 -0
  31. package/dist/components/network-modifications/shunt-compensator/common/characteristicsForm.utils.d.ts +64 -0
  32. package/dist/components/network-modifications/shunt-compensator/common/characteristicsForm.utils.js +90 -0
  33. package/dist/components/network-modifications/shunt-compensator/common/index.d.ts +10 -0
  34. package/dist/components/network-modifications/shunt-compensator/common/index.js +13 -0
  35. package/dist/components/network-modifications/shunt-compensator/common/shuntCompensator.types.d.ts +20 -0
  36. package/dist/components/network-modifications/shunt-compensator/common/shuntCompensator.types.js +1 -0
  37. package/dist/components/network-modifications/shunt-compensator/common/shuntCompensator.utils.d.ts +27 -0
  38. package/dist/components/network-modifications/shunt-compensator/common/shuntCompensator.utils.js +16 -0
  39. package/dist/components/network-modifications/shunt-compensator/creation/ShuntCompensatorCreationForm.d.ts +3 -0
  40. package/dist/components/network-modifications/shunt-compensator/creation/ShuntCompensatorCreationForm.js +82 -0
  41. package/dist/components/network-modifications/shunt-compensator/creation/index.d.ts +9 -0
  42. package/dist/components/network-modifications/shunt-compensator/creation/index.js +9 -0
  43. package/dist/components/network-modifications/shunt-compensator/creation/shuntCompensatorCreation.types.d.ts +20 -0
  44. package/dist/components/network-modifications/shunt-compensator/creation/shuntCompensatorCreation.types.js +1 -0
  45. package/dist/components/network-modifications/shunt-compensator/creation/shuntCompensatorCreation.utils.d.ts +110 -0
  46. package/dist/components/network-modifications/shunt-compensator/creation/shuntCompensatorCreation.utils.js +103 -0
  47. package/dist/components/network-modifications/shunt-compensator/index.d.ts +8 -0
  48. package/dist/components/network-modifications/shunt-compensator/index.js +20 -0
  49. package/dist/components/network-modifications/voltageLevel/creation/VoltageLevelCreationForm.js +1 -1
  50. package/dist/components/network-modifications/voltageLevel/creation/index.d.ts +1 -0
  51. package/dist/components/network-modifications/voltageLevel/creation/index.js +3 -1
  52. package/dist/components/network-modifications/voltageLevel/creation/tabs/structureTab/StructureTab.js +6 -2
  53. package/dist/components/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/SwitchesBetweenSections.js +22 -43
  54. package/dist/components/network-modifications/voltageLevel/creation/voltageLevel.constants.d.ts +1 -0
  55. package/dist/components/network-modifications/voltageLevel/creation/voltageLevel.constants.js +2 -0
  56. package/dist/components/network-modifications/voltageLevel/creation/voltageLevelCreation.utils.js +2 -1
  57. package/dist/components/network-modifications/voltageLevel/index.js +3 -1
  58. package/dist/index.js +33 -3
  59. package/dist/translations/en/networkModificationsEn.d.ts +24 -0
  60. package/dist/translations/en/networkModificationsEn.js +24 -0
  61. package/dist/translations/fr/networkModificationsFr.d.ts +24 -0
  62. package/dist/translations/fr/networkModificationsFr.js +24 -0
  63. package/dist/utils/constants/fieldConstants.d.ts +7 -0
  64. package/dist/utils/constants/fieldConstants.js +7 -0
  65. package/dist/utils/types/network-modification-metadata.d.ts +1 -0
  66. package/package.json +1 -1
  67. package/dist/components/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/creation/CreateSwitchesDialog.d.ts +0 -11
  68. package/dist/components/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/creation/CreateSwitchesDialog.js +0 -84
  69. package/dist/components/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/creation/CreateSwitchesDialogSubmitButton.d.ts +0 -6
  70. package/dist/components/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/creation/CreateSwitchesDialogSubmitButton.js +0 -11
  71. package/dist/components/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/creation/CreateSwitchesForm.js +0 -61
  72. package/dist/components/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/creation/createSwitchesDialog.utils.d.ts +0 -14
  73. package/dist/components/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/creation/createSwitchesDialog.utils.js +0 -27
  74. package/dist/components/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/creation/index.js +0 -4
package/dist/index.js CHANGED
@@ -216,10 +216,10 @@ import { getActivePowerControlEmptyFormData, getActivePowerControlSchema } from
216
216
  import { ActivePowerControlForm } from "./components/network-modifications/common/activePowerControl/ActivePowerControlForm.js";
217
217
  import { getShortCircuitEmptyFormData, getShortCircuitFormData, getShortCircuitFormSchema } from "./components/network-modifications/common/shortCircuit/shortCircuitForm.utils.js";
218
218
  import { ShortCircuitForm } from "./components/network-modifications/common/shortCircuit/ShortCircuitForm.js";
219
- import { INSERT, REMOVE, getReactiveCapabilityCurveValidationSchema, getRowEmptyFormData, setCurrentReactiveCapabilityCurveTable, setSelectedReactiveLimits, toReactiveCapabilityCurveChoiceForGeneratorCreation, toReactiveCapabilityCurveChoiceForGeneratorModification } from "./components/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/reactiveCapability.utils.js";
219
+ import { INSERT, REMOVE, getReactiveCapabilityCurveValidationSchema, getReactiveCapabilityCurveValidationSchemaArray, getRowEmptyFormData, setCurrentReactiveCapabilityCurveTable, setSelectedReactiveLimits, toReactiveCapabilityCurveChoiceForGeneratorCreation, toReactiveCapabilityCurveChoiceForGeneratorModification } from "./components/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/reactiveCapability.utils.js";
220
220
  import { ReactiveCapabilityCurveRowForm } from "./components/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/ReactiveCapabilityCurveRowForm.js";
221
221
  import { ReactiveCapabilityCurveTableForm } from "./components/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/ReactiveCapabilityCurveTableForm.js";
222
- import { REACTIVE_LIMIT_TYPES, getReactiveLimitsEmptyFormData, getReactiveLimitsFormData, getReactiveLimitsSchema, getReactiveLimitsValidationSchema } from "./components/network-modifications/common/reactiveLimits/reactiveLimits.utils.js";
222
+ import { REACTIVE_LIMIT_TYPES, getReactiveLimitsEmptyFormData, getReactiveLimitsEmptyFormDataProps, getReactiveLimitsFormData, getReactiveLimitsFormDataProps, getReactiveLimitsSchema, getReactiveLimitsValidationSchema } from "./components/network-modifications/common/reactiveLimits/reactiveLimits.utils.js";
223
223
  import { ReactiveLimitsForm } from "./components/network-modifications/common/reactiveLimits/ReactiveLimitsForm.js";
224
224
  import { getHvdcLccDeletionSchema } from "./components/network-modifications/equipmentDeletion/hvdcLccDeletion/hvdcLccDeletion.utils.js";
225
225
  import { ShuntCompensatorSelectionForm } from "./components/network-modifications/equipmentDeletion/hvdcLccDeletion/ShuntCompensatorSelectionForm.js";
@@ -233,6 +233,7 @@ import { substationCreationDtoToForm, substationCreationEmptyFormData, substatio
233
233
  import { SubstationModificationForm } from "./components/network-modifications/substation/modification/SubstationModificationForm.js";
234
234
  import { substationModificationDtoToForm, substationModificationEmptyFormData, substationModificationFormSchema, substationModificationFormToDto } from "./components/network-modifications/substation/modification/substationModification.utils.js";
235
235
  import { SwitchesBetweenSections } from "./components/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/SwitchesBetweenSections.js";
236
+ import "react";
236
237
  import "react-hook-form";
237
238
  import { equalsArray } from "./utils/algos.js";
238
239
  import { ActivePowerAdornment, AmpereAdornment, KiloAmpereAdornment, KilometerAdornment, MVAPowerAdornment, MicroSusceptanceAdornment, OhmAdornment, PercentageAdornment, ReactivePowerAdornment, SusceptanceAdornment, VoltageAdornment } from "./utils/constants/adornments.js";
@@ -272,7 +273,6 @@ import { areIdsEqual, getIdOrSelf, getIdOrValue, getLabelOrValue, getObjectId, n
272
273
  import { toNumber, validateValueIsANumber } from "./utils/validation-functions.js";
273
274
  import { NO_ITEM_SELECTION_FOR_COPY } from "./utils/directory-utils.js";
274
275
  import "./utils/yupConfig.js";
275
- import "react";
276
276
  import { fetchAppsMetadata, fetchBaseVoltages, fetchDefaultCountry, fetchEnv, fetchFavoriteAndDefaultCountries, fetchStudyMetadata, isExploreMetadata, isStudyMetadata } from "./services/appsMetadata.js";
277
277
  import { fetchConfigParameter, fetchConfigParameters, getAppName, updateConfigParameter } from "./services/config.js";
278
278
  import { PermissionType, elementAlreadyExists, fetchDirectoryContent, fetchDirectoryElementPath, fetchElementNames, fetchRootFolders, hasElementPermission } from "./services/directory.js";
@@ -293,6 +293,7 @@ import { fetchDynamicSimulationParameters, fetchDynamicSimulationProviders, upda
293
293
  import { fetchContingencyAndFiltersLists, fetchDynamicSecurityAnalysisProviders } from "./services/dynamic-security-analysis.js";
294
294
  import { fetchDynamicMarginCalculationParameters, fetchDynamicMarginCalculationProviders, updateDynamicMarginCalculationParameters } from "./services/dynamic-margin-calculation.js";
295
295
  import "@mui/icons-material";
296
+ import { MAX_SECTIONS_COUNT } from "./components/network-modifications/voltageLevel/creation/voltageLevel.constants.js";
296
297
  import { VoltageLevelCreationForm } from "./components/network-modifications/voltageLevel/creation/VoltageLevelCreationForm.js";
297
298
  import { SWITCH_TYPE, buildNewBusbarSections, getCreateSwitchesEmptyFormData, getCreateSwitchesValidationSchema, translateSwitchKinds, voltageLevelCreationDtoToForm, voltageLevelCreationEmptyFormData, voltageLevelCreationFormSchema, voltageLevelCreationFormToDto } from "./components/network-modifications/voltageLevel/creation/voltageLevelCreation.utils.js";
298
299
  import { SwitchKind } from "./components/network-modifications/voltageLevel/creation/voltageLevelCreation.types.js";
@@ -310,6 +311,13 @@ import { EQUIPMENT_TYPE_ORDER, byFilterDeletionDtoToForm, byFilterDeletionFormSc
310
311
  import { ModificationByAssignmentForm } from "./components/network-modifications/by-filter/assignment/modification-by-assignment-form.js";
311
312
  import { emptyModificationByAssignmentFormData, modificationByAssignmentDtoToForm, modificationByAssignmentFormSchema, modificationByAssignmentFormToDto } from "./components/network-modifications/by-filter/assignment/modificationByAssignment.utils.js";
312
313
  import { DataType as DataType2 } from "./components/network-modifications/by-filter/assignment/assignment/assignment.type.js";
314
+ import { batteryCreationDtoToForm, batteryCreationEmptyFormData, batteryCreationFormSchema, batteryCreationFormToDto } from "./components/network-modifications/battery/creation/batteryCreation.utils.js";
315
+ import { BatteryCreationForm } from "./components/network-modifications/battery/creation/BatteryCreationForm.js";
316
+ import { CHARACTERISTICS_CHOICES, SHUNT_COMPENSATOR_TYPES, computeSwitchedOnValue } from "./components/network-modifications/shunt-compensator/common/shuntCompensator.utils.js";
317
+ import { CharacteristicsForm } from "./components/network-modifications/shunt-compensator/common/CharacteristicsForm.js";
318
+ import { getCharacteristicsCreateFormDataFromSearchCopy, getCharacteristicsEmptyFormData, getCharacteristicsFormData, getCharacteristicsFormValidationSchema } from "./components/network-modifications/shunt-compensator/common/characteristicsForm.utils.js";
319
+ import { ShuntCompensatorCreationForm } from "./components/network-modifications/shunt-compensator/creation/ShuntCompensatorCreationForm.js";
320
+ import { shuntCompensatorCreationDtoToForm, shuntCompensatorCreationEmptyFormData, shuntCompensatorCreationFormSchema, shuntCompensatorCreationFormToDto } from "./components/network-modifications/shunt-compensator/creation/shuntCompensatorCreation.utils.js";
313
321
  import { BuildStatusChip } from "./components/node/build-status-chip.js";
314
322
  import { BuildStatus } from "./components/node/constant.js";
315
323
  import { COLUMNS_WITHOUT_BORDER, DEPTH_CELL_WIDTH, DROP_FORBIDDEN_INDICATOR_BOTTOM, DROP_FORBIDDEN_INDICATOR_TOP, DROP_INDICATOR_BOTTOM, DROP_INDICATOR_TOP, MODIFICATION_ROW_HEIGHT, createCellBorderColor, createCellContentWrapperSx, createCellStyle, createEditDescriptionStyle, createHeaderCellStyle, createModificationNameCellStyle, createNameCellLabelBoxSx, createNameCellRootStyle, createRootNetworkChipCellSx, createRowSx, networkModificationTableStyles } from "./components/network-modification-table/network-modification-table-styles.js";
@@ -430,6 +438,7 @@ export {
430
438
  BASE_EQUIPMENTS,
431
439
  BASE_MODIFICATION_TABLE_COLUMNS,
432
440
  Battery,
441
+ BatteryCreationForm,
433
442
  BooleanCellRenderer,
434
443
  BooleanInput,
435
444
  BooleanNullableCellRenderer,
@@ -444,6 +453,7 @@ export {
444
453
  ByFilterDeletionForm,
445
454
  CALCULATION_TYPE,
446
455
  CENTER_LABEL,
456
+ CHARACTERISTICS_CHOICES,
447
457
  COLUMNS_DEFINITIONS_CONTINGENCY_LISTS_INFOS,
448
458
  COLUMNS_DEFINITIONS_HVDCS,
449
459
  COLUMNS_DEFINITIONS_INJECTIONS,
@@ -471,6 +481,7 @@ export {
471
481
  CalculationType,
472
482
  CancelButton,
473
483
  CardErrorBoundary,
484
+ CharacteristicsForm,
474
485
  CheckBoxList,
475
486
  CheckboxInput,
476
487
  CheckboxNullableInput,
@@ -673,6 +684,7 @@ export {
673
684
  MAX_CHAR_DESCRIPTION,
674
685
  MAX_COMPOSITE_NESTING_DEPTH,
675
686
  MAX_ROWS_NUMBER,
687
+ MAX_SECTIONS_COUNT,
676
688
  MAX_VALUE_ALLOWED_FOR_LIMIT_REDUCTION,
677
689
  MEGA_VAR,
678
690
  MEGA_VOLT_AMPERE,
@@ -820,6 +832,7 @@ export {
820
832
  SHOW_AUTH_INFO_LOGIN,
821
833
  SHUNT_COMPENSATORS_SELECTION_TYPE,
822
834
  SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD,
835
+ SHUNT_COMPENSATOR_TYPES,
823
836
  SHUNT_COMPENSATOR_TYPE_OPTIONS,
824
837
  SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON,
825
838
  SIEMENS,
@@ -851,6 +864,7 @@ export {
851
864
  ShortCircuitParametersEditionDialog,
852
865
  ShortCircuitParametersInLine,
853
866
  ShuntCompensator,
867
+ ShuntCompensatorCreationForm,
854
868
  ShuntCompensatorSelectionForm,
855
869
  SignInCallbackHandler,
856
870
  SilentRenewCallbackHandler,
@@ -927,6 +941,10 @@ export {
927
941
  backendFetchFile,
928
942
  backendFetchJson,
929
943
  backendFetchText,
944
+ batteryCreationDtoToForm,
945
+ batteryCreationEmptyFormData,
946
+ batteryCreationFormSchema,
947
+ batteryCreationFormToDto,
930
948
  buildNewBusbarSections,
931
949
  businessErrorsEn,
932
950
  businessErrorsFr,
@@ -942,6 +960,7 @@ export {
942
960
  commonButtonFr,
943
961
  componentsEn,
944
962
  componentsFr,
963
+ computeSwitchedOnValue,
945
964
  computeTagMinSize,
946
965
  convertInputValue,
947
966
  convertOutputValue,
@@ -1067,6 +1086,10 @@ export {
1067
1086
  getBranchActiveReactivePowerEmptyFormDataProperties,
1068
1087
  getBranchActiveReactivePowerValidationSchema,
1069
1088
  getBranchActiveReactivePowerValidationSchemaProperties,
1089
+ getCharacteristicsCreateFormDataFromSearchCopy,
1090
+ getCharacteristicsEmptyFormData,
1091
+ getCharacteristicsFormData,
1092
+ getCharacteristicsFormValidationSchema,
1070
1093
  getComputedLanguage,
1071
1094
  getCon1andCon2WithPositionValidationSchema,
1072
1095
  getConcatenatedProperties,
@@ -1128,8 +1151,11 @@ export {
1128
1151
  getPropertyValue,
1129
1152
  getRangeInputSchema,
1130
1153
  getReactiveCapabilityCurveValidationSchema,
1154
+ getReactiveCapabilityCurveValidationSchemaArray,
1131
1155
  getReactiveLimitsEmptyFormData,
1156
+ getReactiveLimitsEmptyFormDataProps,
1132
1157
  getReactiveLimitsFormData,
1158
+ getReactiveLimitsFormDataProps,
1133
1159
  getReactiveLimitsSchema,
1134
1160
  getReactiveLimitsValidationSchema,
1135
1161
  getReactivePowerSetPointSchema,
@@ -1251,6 +1277,10 @@ export {
1251
1277
  setStudyNetworkVisualizationParameters,
1252
1278
  setUnauthorizedUserInfo,
1253
1279
  setUserValidationError,
1280
+ shuntCompensatorCreationDtoToForm,
1281
+ shuntCompensatorCreationEmptyFormData,
1282
+ shuntCompensatorCreationFormSchema,
1283
+ shuntCompensatorCreationFormToDto,
1254
1284
  snackWithFallback,
1255
1285
  standardTextField,
1256
1286
  styles,
@@ -77,8 +77,10 @@ export declare const networkModificationsEn: {
77
77
  AddProperty: string;
78
78
  PropertyName: string;
79
79
  PropertyValue: string;
80
+ ID: string;
80
81
  Name: string;
81
82
  Country: string;
83
+ Characteristics: string;
82
84
  CreateVoltageLevel: string;
83
85
  VoltageLevelCreationError: string;
84
86
  ModifyVoltageLevel: string;
@@ -110,6 +112,7 @@ export declare const networkModificationsEn: {
110
112
  Disconnector: string;
111
113
  BusBarCountMustBeGreaterThanOrEqualToOne: string;
112
114
  SectionCountMustBeGreaterThanOrEqualToOne: string;
115
+ SectionCountMustBeLessThanOrEqualToTwenty: string;
113
116
  mustBeGreaterOrEqualToZero: string;
114
117
  CreateCouplingDeviceIdenticalBusBar: string;
115
118
  CreateSubstationInVoltageLevelIdenticalId: string;
@@ -121,6 +124,17 @@ export declare const networkModificationsEn: {
121
124
  YupNotTypeNumber: string;
122
125
  CreateLoad: string;
123
126
  loadType: string;
127
+ CreateShuntCompensator: string;
128
+ ShuntCompensatorCreationError: string;
129
+ Reactor: string;
130
+ Capacitor: string;
131
+ QatNominalVLabel: string;
132
+ SusceptanceLabel: string;
133
+ SwitchedOnMaxQAtNominalV: string;
134
+ SwitchedOnMaxSusceptance: string;
135
+ ShuntCompensatorErrorQAtNominalVoltageLessThanZero: string;
136
+ MaximumSectionCountMustBeGreaterOrEqualToOne: string;
137
+ SectionCountMustBeBetweenZeroAndMaximumSectionCount: string;
124
138
  VOLTAGE_LEVEL: string;
125
139
  BusBarBus: string;
126
140
  ConnectionName: string;
@@ -194,6 +208,11 @@ export declare const networkModificationsEn: {
194
208
  addNewAssignment: string;
195
209
  changeTypeConfirmation: string;
196
210
  Or: string;
211
+ CreateBattery: string;
212
+ BatteryCreationError: string;
213
+ Connectivity: string;
214
+ ActiveLimits: string;
215
+ ReactiveLimits: string;
197
216
  NormalizedPercentage: string;
198
217
  On: string;
199
218
  Off: string;
@@ -205,12 +224,17 @@ export declare const networkModificationsEn: {
205
224
  ReactiveLimitsKindCurve: string;
206
225
  MinimumReactivePower: string;
207
226
  MaximumReactivePower: string;
227
+ ActiveLimitsMinMaxInvalid: string;
228
+ ReactiveLimitsMinMaxInvalid: string;
229
+ MinReactivePowerRequired: string;
230
+ MaxReactivePowerRequired: string;
208
231
  ReactiveCapabilityCurveCreationErrorMissingPoints: string;
209
232
  ReactiveCapabilityCurveCreationErrorPInvalid: string;
210
233
  ReactiveCapabilityCurveCreationErrorPOutOfRange: string;
211
234
  ReactiveCapabilityCurveCreationErrorQminPQmaxPIncoherence: string;
212
235
  ReactiveCapabilityCurveCreationErrorMissingNegativeP: string;
213
236
  ReactiveCapabilityCurveCreationErrorMissingPositiveP: string;
237
+ ActivePowerMustBeZeroOrBetweenMinAndMaxActivePower: string;
214
238
  P: string;
215
239
  QminP: string;
216
240
  QmaxP: string;
@@ -83,8 +83,10 @@ const networkModificationsEn = {
83
83
  AddProperty: "Add property",
84
84
  PropertyName: "Property name",
85
85
  PropertyValue: "Property value",
86
+ ID: "ID",
86
87
  Name: "Name",
87
88
  Country: "Country",
89
+ Characteristics: "Characteristics",
88
90
  CreateVoltageLevel: "Create voltage level",
89
91
  VoltageLevelCreationError: "Error while creating voltage level",
90
92
  ModifyVoltageLevel: "Modify a voltage level",
@@ -116,6 +118,7 @@ const networkModificationsEn = {
116
118
  Disconnector: "Disconnector",
117
119
  BusBarCountMustBeGreaterThanOrEqualToOne: "Number of busbars must be greater than or equal to 1",
118
120
  SectionCountMustBeGreaterThanOrEqualToOne: "Number of sections must be greater than or equal to 1",
121
+ SectionCountMustBeLessThanOrEqualToTwenty: "Number of sections must be less than or equal to 20",
119
122
  mustBeGreaterOrEqualToZero: "Must be greater than or equal to 0",
120
123
  CreateCouplingDeviceIdenticalBusBar: "Bus bar section / bus 1 and 2 must be different",
121
124
  CreateSubstationInVoltageLevelIdenticalId: "Voltage Level ID can not match Substation ID",
@@ -127,6 +130,17 @@ const networkModificationsEn = {
127
130
  YupNotTypeNumber: "This field only accepts numeric values",
128
131
  CreateLoad: "Create load",
129
132
  loadType: "Type",
133
+ CreateShuntCompensator: "Create shunt compensator (Linear)",
134
+ ShuntCompensatorCreationError: "Error while creating shunt compensator",
135
+ Reactor: "Reactor",
136
+ Capacitor: "Capacitor",
137
+ QatNominalVLabel: "Q at nominal voltage (Mvar)",
138
+ SusceptanceLabel: "Susceptance (S)",
139
+ SwitchedOnMaxQAtNominalV: "Switch-on Q at nominal voltage",
140
+ SwitchedOnMaxSusceptance: "Switch-on susceptance",
141
+ ShuntCompensatorErrorQAtNominalVoltageLessThanZero: "Q at nominal voltage value should be greater than or equal to 0",
142
+ MaximumSectionCountMustBeGreaterOrEqualToOne: "Maximum section count must be greater than or equal to 1",
143
+ SectionCountMustBeBetweenZeroAndMaximumSectionCount: "Section count must be between 0 and Maximum section count",
130
144
  VOLTAGE_LEVEL: "Voltage Level",
131
145
  BusBarBus: "Bus bar section / bus",
132
146
  ConnectionName: "Connection name",
@@ -200,6 +214,11 @@ const networkModificationsEn = {
200
214
  addNewAssignment: "Modify another field",
201
215
  changeTypeConfirmation: "The type will be changed. All fields values will be erased.",
202
216
  Or: "or",
217
+ CreateBattery: "Create battery",
218
+ BatteryCreationError: "Error while creating battery",
219
+ Connectivity: "Connectivity",
220
+ ActiveLimits: "Active limits",
221
+ ReactiveLimits: "Reactive limits",
203
222
  NormalizedPercentage: "This percentage must be between 0 and 100",
204
223
  On: "On",
205
224
  Off: "Off",
@@ -211,12 +230,17 @@ const networkModificationsEn = {
211
230
  ReactiveLimitsKindCurve: "By diagram",
212
231
  MinimumReactivePower: "Minimum reactive power",
213
232
  MaximumReactivePower: "Maximum reactive power",
233
+ ActiveLimitsMinMaxInvalid: "Maximum active power must be greater than minimum active power",
234
+ ReactiveLimitsMinMaxInvalid: "Maximum reactive power must be greater than minimum reactive power",
235
+ MinReactivePowerRequired: "Minimum reactive power is required if maximum is defined",
236
+ MaxReactivePowerRequired: "Maximum reactive power is required if minimum is defined",
214
237
  ReactiveCapabilityCurveCreationErrorMissingPoints: "The table of reactive capability curve must have at least four points.",
215
238
  ReactiveCapabilityCurveCreationErrorPInvalid: "Each active power value must be a valid unique number.",
216
239
  ReactiveCapabilityCurveCreationErrorPOutOfRange: "Each active power value must be within the min P and max P values.",
217
240
  ReactiveCapabilityCurveCreationErrorQminPQmaxPIncoherence: "Each minimum reactive power value must be less than or equal to the corresponding maximum reactive power value.",
218
241
  ReactiveCapabilityCurveCreationErrorMissingNegativeP: "The reactive capability curve table must have at least one row with negative active power",
219
242
  ReactiveCapabilityCurveCreationErrorMissingPositiveP: "The reactive capability curve table must have at least one row with positive active power",
243
+ ActivePowerMustBeZeroOrBetweenMinAndMaxActivePower: "Active power value must be equal to 0 or between minimum and maximum active power values",
220
244
  P: "P{labelSuffix}",
221
245
  QminP: "QminP{labelSuffix}",
222
246
  QmaxP: "QmaxP{labelSuffix}",
@@ -77,8 +77,10 @@ export declare const networkModificationsFr: {
77
77
  AddProperty: string;
78
78
  PropertyName: string;
79
79
  PropertyValue: string;
80
+ ID: string;
80
81
  Name: string;
81
82
  Country: string;
83
+ Characteristics: string;
82
84
  CreateVoltageLevel: string;
83
85
  VoltageLevelCreationError: string;
84
86
  ModifyVoltageLevel: string;
@@ -110,6 +112,7 @@ export declare const networkModificationsFr: {
110
112
  Disconnector: string;
111
113
  BusBarCountMustBeGreaterThanOrEqualToOne: string;
112
114
  SectionCountMustBeGreaterThanOrEqualToOne: string;
115
+ SectionCountMustBeLessThanOrEqualToTwenty: string;
113
116
  mustBeGreaterOrEqualToZero: string;
114
117
  CreateCouplingDeviceIdenticalBusBar: string;
115
118
  CreateSubstationInVoltageLevelIdenticalId: string;
@@ -121,6 +124,17 @@ export declare const networkModificationsFr: {
121
124
  YupNotTypeNumber: string;
122
125
  CreateLoad: string;
123
126
  loadType: string;
127
+ CreateShuntCompensator: string;
128
+ ShuntCompensatorCreationError: string;
129
+ Reactor: string;
130
+ Capacitor: string;
131
+ QatNominalVLabel: string;
132
+ SusceptanceLabel: string;
133
+ SwitchedOnMaxQAtNominalV: string;
134
+ SwitchedOnMaxSusceptance: string;
135
+ ShuntCompensatorErrorQAtNominalVoltageLessThanZero: string;
136
+ MaximumSectionCountMustBeGreaterOrEqualToOne: string;
137
+ SectionCountMustBeBetweenZeroAndMaximumSectionCount: string;
124
138
  VOLTAGE_LEVEL: string;
125
139
  BusBarBus: string;
126
140
  ConnectionName: string;
@@ -194,6 +208,11 @@ export declare const networkModificationsFr: {
194
208
  addNewAssignment: string;
195
209
  changeTypeConfirmation: string;
196
210
  Or: string;
211
+ CreateBattery: string;
212
+ BatteryCreationError: string;
213
+ Connectivity: string;
214
+ ActiveLimits: string;
215
+ ReactiveLimits: string;
197
216
  NormalizedPercentage: string;
198
217
  On: string;
199
218
  Off: string;
@@ -205,12 +224,17 @@ export declare const networkModificationsFr: {
205
224
  ReactiveLimitsKindCurve: string;
206
225
  MinimumReactivePower: string;
207
226
  MaximumReactivePower: string;
227
+ ActiveLimitsMinMaxInvalid: string;
228
+ ReactiveLimitsMinMaxInvalid: string;
229
+ MinReactivePowerRequired: string;
230
+ MaxReactivePowerRequired: string;
208
231
  ReactiveCapabilityCurveCreationErrorMissingPoints: string;
209
232
  ReactiveCapabilityCurveCreationErrorPInvalid: string;
210
233
  ReactiveCapabilityCurveCreationErrorPOutOfRange: string;
211
234
  ReactiveCapabilityCurveCreationErrorQminPQmaxPIncoherence: string;
212
235
  ReactiveCapabilityCurveCreationErrorMissingNegativeP: string;
213
236
  ReactiveCapabilityCurveCreationErrorMissingPositiveP: string;
237
+ ActivePowerMustBeZeroOrBetweenMinAndMaxActivePower: string;
214
238
  P: string;
215
239
  QminP: string;
216
240
  QmaxP: string;
@@ -83,8 +83,10 @@ const networkModificationsFr = {
83
83
  AddProperty: "Ajouter une propriété",
84
84
  PropertyName: "Nom de la propriété",
85
85
  PropertyValue: "Valeur de la propriété",
86
+ ID: "ID",
86
87
  Name: "Nom",
87
88
  Country: "Pays",
89
+ Characteristics: "Caractéristiques",
88
90
  CreateVoltageLevel: "Créer un poste",
89
91
  VoltageLevelCreationError: "Erreur lors de la création d'un poste",
90
92
  ModifyVoltageLevel: "Modifier un poste",
@@ -116,6 +118,7 @@ const networkModificationsFr = {
116
118
  Disconnector: "Sectionneur",
117
119
  BusBarCountMustBeGreaterThanOrEqualToOne: "Un nombre de barres doit être supérieur ou égal à 1",
118
120
  SectionCountMustBeGreaterThanOrEqualToOne: "Un nombre de sections doit être supérieur ou égal à 1",
121
+ SectionCountMustBeLessThanOrEqualToTwenty: "Un nombre de sections doit être inférieur ou égal à 20",
119
122
  mustBeGreaterOrEqualToZero: "Cette valeur doit être supérieure ou égale à 0",
120
123
  CreateCouplingDeviceIdenticalBusBar: "Les SJB / Nœuds 1 et 2 doivent être différents",
121
124
  CreateSubstationInVoltageLevelIdenticalId: "L'ID du poste doit être différent de celui du site",
@@ -127,6 +130,17 @@ const networkModificationsFr = {
127
130
  YupNotTypeNumber: "Ce champ n'accepte que des valeurs numériques",
128
131
  CreateLoad: "Créer une consommation",
129
132
  loadType: "Type",
133
+ CreateShuntCompensator: "Créer un moyen de compensation statique (Linéaire)",
134
+ ShuntCompensatorCreationError: "Erreur lors de la création d'un moyen de compensation",
135
+ Reactor: "Réactance",
136
+ Capacitor: "Condensateur",
137
+ QatNominalVLabel: "Q à Unom (Mvar)",
138
+ SusceptanceLabel: "Susceptance (S)",
139
+ SwitchedOnMaxQAtNominalV: "Q enclenchée à tension nominale",
140
+ SwitchedOnMaxSusceptance: "Susceptance enclenchée",
141
+ ShuntCompensatorErrorQAtNominalVoltageLessThanZero: "La valeur de Q à Unom doit être supérieure ou égale à 0",
142
+ MaximumSectionCountMustBeGreaterOrEqualToOne: "Le nombre de gradins doit être supérieur ou égal à 1",
143
+ SectionCountMustBeBetweenZeroAndMaximumSectionCount: "La valeur de la prise courante doit être comprise entre 0 et le nombre de gradins",
130
144
  VOLTAGE_LEVEL: "Poste",
131
145
  BusBarBus: "SJB / nœud",
132
146
  ConnectionName: "Nom départ",
@@ -200,6 +214,11 @@ const networkModificationsFr = {
200
214
  addNewAssignment: "Modifier un autre champ",
201
215
  changeTypeConfirmation: "Le type va être modifié. Toutes les valeurs des champs seront effacées.",
202
216
  Or: "ou",
217
+ CreateBattery: "Créer une batterie",
218
+ BatteryCreationError: "Erreur lors de la création d'une batterie",
219
+ Connectivity: "Connectivité",
220
+ ActiveLimits: "Limites en actif",
221
+ ReactiveLimits: "Limites en réactif",
203
222
  NormalizedPercentage: "Ce pourcentage doit être compris entre 0 et 100",
204
223
  On: "Activé",
205
224
  Off: "Désactivé",
@@ -211,12 +230,17 @@ const networkModificationsFr = {
211
230
  ReactiveLimitsKindCurve: "Par diagramme",
212
231
  MinimumReactivePower: "Puissance réactive minimale",
213
232
  MaximumReactivePower: "Puissance réactive maximale",
233
+ ActiveLimitsMinMaxInvalid: "La puissance active maximale doit être supérieure à la puissance active minimale",
234
+ ReactiveLimitsMinMaxInvalid: "La puissance réactive maximale doit être supérieure à la puissance réactive minimale",
235
+ MinReactivePowerRequired: "La puissance réactive minimale est requise si la maximale est définie",
236
+ MaxReactivePowerRequired: "La puissance réactive maximale est requise si la minimale est définie",
214
237
  ReactiveCapabilityCurveCreationErrorMissingPoints: "Le tableau des limites de réactifs par diagramme doit comporter au moins quatre points.",
215
238
  ReactiveCapabilityCurveCreationErrorPInvalid: "Chaque valeur de puissance active doit être un nombre unique et valide.",
216
239
  ReactiveCapabilityCurveCreationErrorPOutOfRange: "Chaque valeur de puissance active doit être comprise entre les valeurs P min et P max.",
217
240
  ReactiveCapabilityCurveCreationErrorQminPQmaxPIncoherence: "Chaque valeur de puissance réactive minimale doit être inférieure ou égale à la puissance réactive maximale correspondante.",
218
241
  ReactiveCapabilityCurveCreationErrorMissingNegativeP: "Le tableau des limites de réactifs par diagramme doit comporter au moins une ligne avec une puissance active négative",
219
242
  ReactiveCapabilityCurveCreationErrorMissingPositiveP: "Le tableau des limites de réactifs par diagramme doit comporter au moins une ligne avec une puissance active positive",
243
+ ActivePowerMustBeZeroOrBetweenMinAndMaxActivePower: "La valeur de la puissance active doit être égale à 0 ou comprise entre la valeur de la puissance active min et la valeur de la puissance active max",
220
244
  P: "P{labelSuffix}",
221
245
  QminP: "QminP{labelSuffix}",
222
246
  QmaxP: "QmaxP{labelSuffix}",
@@ -16,6 +16,7 @@ export declare enum FieldConstants {
16
16
  CASE_FORMAT = "caseFormat",
17
17
  CASE_NAME = "caseName",
18
18
  CASE_UUID = "caseUuid",
19
+ CHARACTERISTICS_CHOICE = "characteristicsChoice",
19
20
  CONNECTED = "terminalConnected",
20
21
  CONNECTION_DIRECTION = "connectionDirection",
21
22
  CONNECTION_NAME = "connectionName",
@@ -55,7 +56,10 @@ export declare enum FieldConstants {
55
56
  ID = "id",
56
57
  LOAD_TYPE = "loadType",
57
58
  MARGINAL_COST = "marginalCost",
59
+ MAX_Q_AT_NOMINAL_V = "maxQAtNominalV",
60
+ MAX_SUSCEPTANCE = "maxSusceptance",
58
61
  MAXIMUM_ACTIVE_POWER = "maximumActivePower",
62
+ MAXIMUM_SECTION_COUNT = "maximumSectionCount",
59
63
  MEASUREMENT_P = "measurementP",
60
64
  MEASUREMENT_P1 = "measurementP1",
61
65
  MEASUREMENT_P2 = "measurementP2",
@@ -82,7 +86,10 @@ export declare enum FieldConstants {
82
86
  SHUNT_COMPENSATOR_SIDE_1 = "mcsOnSide1",
83
87
  SHUNT_COMPENSATOR_SIDE_2 = "mcsOnSide2",
84
88
  SHUNT_COMPENSATOR_SELECTED = "connectedToHvdc",
89
+ SHUNT_COMPENSATOR_TYPE = "shuntCompensatorType",
85
90
  STATE_ESTIMATION = "stateEstimation",
91
+ SWITCHED_ON_Q_AT_NOMINAL_V = "switchedOnQAtNominalV",
92
+ SWITCHED_ON_SUSCEPTANCE = "switchedOnSusceptance",
86
93
  STUDY_NAME = "studyName",
87
94
  TYPE = "type",
88
95
  VALIDITY = "validity",
@@ -10,6 +10,7 @@ var FieldConstants = /* @__PURE__ */ ((FieldConstants2) => {
10
10
  FieldConstants2["CASE_FORMAT"] = "caseFormat";
11
11
  FieldConstants2["CASE_NAME"] = "caseName";
12
12
  FieldConstants2["CASE_UUID"] = "caseUuid";
13
+ FieldConstants2["CHARACTERISTICS_CHOICE"] = "characteristicsChoice";
13
14
  FieldConstants2["CONNECTED"] = "terminalConnected";
14
15
  FieldConstants2["CONNECTION_DIRECTION"] = "connectionDirection";
15
16
  FieldConstants2["CONNECTION_NAME"] = "connectionName";
@@ -49,7 +50,10 @@ var FieldConstants = /* @__PURE__ */ ((FieldConstants2) => {
49
50
  FieldConstants2["ID"] = "id";
50
51
  FieldConstants2["LOAD_TYPE"] = "loadType";
51
52
  FieldConstants2["MARGINAL_COST"] = "marginalCost";
53
+ FieldConstants2["MAX_Q_AT_NOMINAL_V"] = "maxQAtNominalV";
54
+ FieldConstants2["MAX_SUSCEPTANCE"] = "maxSusceptance";
52
55
  FieldConstants2["MAXIMUM_ACTIVE_POWER"] = "maximumActivePower";
56
+ FieldConstants2["MAXIMUM_SECTION_COUNT"] = "maximumSectionCount";
53
57
  FieldConstants2["MEASUREMENT_P"] = "measurementP";
54
58
  FieldConstants2["MEASUREMENT_P1"] = "measurementP1";
55
59
  FieldConstants2["MEASUREMENT_P2"] = "measurementP2";
@@ -76,7 +80,10 @@ var FieldConstants = /* @__PURE__ */ ((FieldConstants2) => {
76
80
  FieldConstants2["SHUNT_COMPENSATOR_SIDE_1"] = "mcsOnSide1";
77
81
  FieldConstants2["SHUNT_COMPENSATOR_SIDE_2"] = "mcsOnSide2";
78
82
  FieldConstants2["SHUNT_COMPENSATOR_SELECTED"] = "connectedToHvdc";
83
+ FieldConstants2["SHUNT_COMPENSATOR_TYPE"] = "shuntCompensatorType";
79
84
  FieldConstants2["STATE_ESTIMATION"] = "stateEstimation";
85
+ FieldConstants2["SWITCHED_ON_Q_AT_NOMINAL_V"] = "switchedOnQAtNominalV";
86
+ FieldConstants2["SWITCHED_ON_SUSCEPTANCE"] = "switchedOnSusceptance";
80
87
  FieldConstants2["STUDY_NAME"] = "studyName";
81
88
  FieldConstants2["TYPE"] = "type";
82
89
  FieldConstants2["VALIDITY"] = "validity";
@@ -13,4 +13,5 @@ export interface NetworkModificationMetadata {
13
13
  export interface ComposedModificationMetadata extends NetworkModificationMetadata {
14
14
  subModifications: ComposedModificationMetadata[];
15
15
  maxDepth?: number;
16
+ name?: string;
16
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.208.0",
3
+ "version": "0.210.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "author": "gridsuite team",
6
6
  "homepage": "https://github.com/gridsuite",
@@ -1,11 +0,0 @@
1
- import { default as React } from 'react';
2
- import { CreateSwitchesFormData, SwitchKindFormData } from '../../../../voltageLevelCreation.types';
3
- interface CreateSwitchesDialogProps {
4
- sectionCount: number;
5
- handleCreateSwitchesDialog: (data: CreateSwitchesFormData) => void;
6
- setOpenCreateSwitchesDialog: React.Dispatch<React.SetStateAction<boolean>>;
7
- openCreateSwitchesDialog: boolean;
8
- switchKinds: SwitchKindFormData[];
9
- }
10
- export declare function CreateSwitchesDialog({ sectionCount, handleCreateSwitchesDialog, setOpenCreateSwitchesDialog, openCreateSwitchesDialog, switchKinds, }: Readonly<CreateSwitchesDialogProps>): import("react/jsx-runtime").JSX.Element;
11
- export {};
@@ -1,84 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Dialog, DialogActions } from "@mui/material";
3
- import { useForm } from "react-hook-form";
4
- import { yupResolver } from "@hookform/resolvers/yup";
5
- import { useEffect } from "react";
6
- import { object } from "yup";
7
- import { getCreateSwitchesValidationSchema, getCreateSwitchesEmptyFormData } from "../../../../voltageLevelCreation.utils.js";
8
- import { FieldConstants } from "../../../../../../../../utils/constants/fieldConstants.js";
9
- import "../../../../../../../../utils/conversionUtils.js";
10
- import "../../../../../../../../utils/types/equipmentType.js";
11
- import "@mui/icons-material";
12
- import "../../../../../../../../utils/yupConfig.js";
13
- import "react-intl";
14
- import "../../../../../../../overflowableText/OverflowableText.js";
15
- import "localized-countries";
16
- import "localized-countries/data/fr";
17
- import "localized-countries/data/en";
18
- import "notistack";
19
- import { CustomFormProvider } from "../../../../../../../inputs/reactHookForm/provider/CustomFormProvider.js";
20
- import { CancelButton } from "../../../../../../../inputs/reactHookForm/utils/CancelButton.js";
21
- import "../../../../../../../treeViewFinder/TreeViewFinder.js";
22
- import "../../../../../../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
23
- import "../../../../../../../customAGGrid/customAggrid.js";
24
- import "ag-grid-community";
25
- import "react-papaparse";
26
- import "react-csv-downloader";
27
- import "../../../../../../../inputs/reactHookForm/numbers/RangeInput.js";
28
- import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
29
- import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
30
- import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
31
- import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
32
- import "@material-symbols/svg-400/outlined/add_notes.svg?react";
33
- import "../../../../../../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
34
- import "../../../../../../../inputs/reactHookForm/expandableInput/ExpandableInput.js";
35
- import "@react-querybuilder/material";
36
- import "../../../../../../../filter/expert/expertFilterConstants.js";
37
- import "../../../../../../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
38
- import "uuid";
39
- import "../../../../../../../inputs/reactQueryBuilder/PropertyValueEditor.js";
40
- import "react-querybuilder";
41
- import CreateSwitchesForm from "./CreateSwitchesForm.js";
42
- import { CreateSwitchesDialogSubmitButton } from "./CreateSwitchesDialogSubmitButton.js";
43
- const formSchema = object().shape({
44
- ...getCreateSwitchesValidationSchema()
45
- });
46
- function CreateSwitchesDialog({
47
- sectionCount,
48
- handleCreateSwitchesDialog,
49
- setOpenCreateSwitchesDialog,
50
- openCreateSwitchesDialog,
51
- switchKinds
52
- }) {
53
- const emptyFormData = getCreateSwitchesEmptyFormData(sectionCount);
54
- const formMethods = useForm({
55
- defaultValues: emptyFormData,
56
- resolver: yupResolver(formSchema)
57
- });
58
- const { reset } = formMethods;
59
- useEffect(() => {
60
- if (switchKinds?.length > 0) {
61
- reset({
62
- [FieldConstants.SWITCH_KINDS]: switchKinds
63
- });
64
- }
65
- }, [switchKinds, reset]);
66
- const handleCloseDialog = () => {
67
- reset(emptyFormData);
68
- setOpenCreateSwitchesDialog(false);
69
- };
70
- const handleSave = (data) => {
71
- handleCreateSwitchesDialog(data);
72
- handleCloseDialog();
73
- };
74
- return /* @__PURE__ */ jsx(Dialog, { open: openCreateSwitchesDialog, fullWidth: true, children: /* @__PURE__ */ jsxs(CustomFormProvider, { validationSchema: formSchema, ...formMethods, children: [
75
- /* @__PURE__ */ jsx(CreateSwitchesForm, { id: FieldConstants.SWITCH_KINDS }),
76
- /* @__PURE__ */ jsxs(DialogActions, { children: [
77
- /* @__PURE__ */ jsx(CancelButton, { onClick: handleCloseDialog }),
78
- /* @__PURE__ */ jsx(CreateSwitchesDialogSubmitButton, { handleSave })
79
- ] })
80
- ] }) });
81
- }
82
- export {
83
- CreateSwitchesDialog
84
- };
@@ -1,6 +0,0 @@
1
- import { CreateSwitchesFormData } from '../../../../voltageLevelCreation.types';
2
- interface CreateSwitchesDialogSubmitButtonProps {
3
- handleSave: (data: CreateSwitchesFormData) => void | Promise<void>;
4
- }
5
- export declare function CreateSwitchesDialogSubmitButton({ handleSave }: Readonly<CreateSwitchesDialogSubmitButtonProps>): import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1,11 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { Button } from "@mui/material";
3
- import { useFormContext } from "react-hook-form";
4
- import { FormattedMessage } from "react-intl";
5
- function CreateSwitchesDialogSubmitButton({ handleSave }) {
6
- const { handleSubmit } = useFormContext();
7
- return /* @__PURE__ */ jsx(Button, { onClick: handleSubmit(handleSave), variant: "outlined", children: /* @__PURE__ */ jsx(FormattedMessage, { id: "validate" }) });
8
- }
9
- export {
10
- CreateSwitchesDialogSubmitButton
11
- };