@gridsuite/commons-ui 0.132.0 → 0.134.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 (129) hide show
  1. package/dist/components/authentication/utils/authService.js +6 -9
  2. package/dist/components/checkBoxList/CheckBoxList.js +1 -1
  3. package/dist/components/checkBoxList/CheckBoxListItem.js +3 -3
  4. package/dist/components/checkBoxList/CheckBoxListItemContent.js +3 -3
  5. package/dist/components/checkBoxList/CheckBoxListItems.js +4 -4
  6. package/dist/components/checkBoxList/DraggableCheckBoxListItem.js +5 -5
  7. package/dist/components/checkBoxList/DraggableCheckBoxListItemContent.js +1 -1
  8. package/dist/components/contingencyList/criteriaBased/criteriaBasedUtils.js +7 -7
  9. package/dist/components/csvDownloader/use-csv-export.js +1 -4
  10. package/dist/components/customAGGrid/customAggrid.js +2 -2
  11. package/dist/components/dialogs/customMuiDialog/CustomMuiDialog.js +2 -2
  12. package/dist/components/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js +1 -2
  13. package/dist/components/dialogs/elementSaveDialog/ElementSaveDialog.js +6 -6
  14. package/dist/components/dialogs/elementSaveDialog/utils.js +1 -1
  15. package/dist/components/dialogs/modifyElementSelection/ModifyElementSelection.js +1 -1
  16. package/dist/components/directoryItemSelector/DirectoryItemSelector.js +3 -4
  17. package/dist/components/dnd-table/dnd-table-bottom-right-buttons.js +2 -3
  18. package/dist/components/dnd-table/dnd-table.js +7 -7
  19. package/dist/components/elementSearch/elementItem/EquipmentItem.js +6 -7
  20. package/dist/components/elementSearch/elementSearchDialog/ElementSearchDialog.js +1 -1
  21. package/dist/components/elementSearch/tagRenderer/TagRenderer.js +3 -4
  22. package/dist/components/filter/FilterCreationDialog.js +23 -13
  23. package/dist/components/filter/FilterForm.js +2 -2
  24. package/dist/components/filter/expert/ExpertFilterEditionDialog.js +13 -6
  25. package/dist/components/filter/expert/ExpertFilterForm.d.ts +0 -1
  26. package/dist/components/filter/expert/ExpertFilterForm.js +11 -21
  27. package/dist/components/filter/expert/expertFilterConstants.d.ts +13 -12
  28. package/dist/components/filter/expert/expertFilterConstants.js +17 -48
  29. package/dist/components/filter/expert/expertFilterUtils.js +21 -25
  30. package/dist/components/filter/expert/index.js +1 -2
  31. package/dist/components/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js +2 -4
  32. package/dist/components/filter/explicitNaming/ExplicitNamingFilterForm.js +11 -18
  33. package/dist/components/filter/index.js +1 -2
  34. package/dist/components/filter/utils/filterApi.js +14 -6
  35. package/dist/components/flatParameters/FlatParameters.js +2 -2
  36. package/dist/components/index.js +1 -4
  37. package/dist/components/inputs/SelectClearable.js +1 -1
  38. package/dist/components/inputs/index.js +0 -2
  39. package/dist/components/inputs/reactHookForm/DirectoryItemsInput.js +44 -48
  40. package/dist/components/inputs/reactHookForm/agGridTable/CustomAgGridTable.js +3 -4
  41. package/dist/components/inputs/reactHookForm/agGridTable/csvUploader/CsvUploader.js +1 -1
  42. package/dist/components/inputs/reactHookForm/autocompleteInputs/AutocompleteInput.js +4 -4
  43. package/dist/components/inputs/reactHookForm/chip-items-input.js +3 -3
  44. package/dist/components/inputs/reactHookForm/errorManagement/ErrorInput.js +1 -2
  45. package/dist/components/inputs/reactHookForm/index.js +0 -2
  46. package/dist/components/inputs/reactHookForm/numbers/FloatInput.js +1 -1
  47. package/dist/components/inputs/reactHookForm/numbers/SliderInput.js +1 -1
  48. package/dist/components/inputs/reactHookForm/selectInputs/InputWithPopupConfirmation.js +2 -2
  49. package/dist/components/inputs/reactHookForm/selectInputs/SelectInput.js +3 -3
  50. package/dist/components/inputs/reactHookForm/tableInputs/table-numerical-input.js +4 -4
  51. package/dist/components/inputs/reactHookForm/tableInputs/table-text-input.js +3 -3
  52. package/dist/components/inputs/reactHookForm/text/ExpandingTextField.js +2 -2
  53. package/dist/components/inputs/reactHookForm/text/TextInput.js +5 -5
  54. package/dist/components/inputs/reactHookForm/text/UniqueNameInput.js +2 -2
  55. package/dist/components/inputs/reactHookForm/utils/SubmitButton.js +1 -1
  56. package/dist/components/inputs/reactHookForm/utils/functions.js +2 -3
  57. package/dist/components/inputs/reactHookForm/utils/index.d.ts +0 -1
  58. package/dist/components/inputs/reactHookForm/utils/index.js +0 -2
  59. package/dist/components/inputs/reactQueryBuilder/OperatorSelector.js +2 -2
  60. package/dist/components/inputs/reactQueryBuilder/PropertyValueEditor.js +8 -9
  61. package/dist/components/inputs/reactQueryBuilder/TextValueEditor.js +1 -1
  62. package/dist/components/inputs/reactQueryBuilder/TranslatedValueEditor.js +1 -1
  63. package/dist/components/inputs/reactQueryBuilder/ValueEditor.js +2 -3
  64. package/dist/components/inputs/reactQueryBuilder/compositeRuleEditor/GroupValueEditor.js +12 -15
  65. package/dist/components/inputs/reactQueryBuilder/compositeRuleEditor/RuleValueEditor.js +3 -4
  66. package/dist/components/notifications/hooks/useListenerManager.js +2 -4
  67. package/dist/components/overflowableText/OverflowableText.js +4 -5
  68. package/dist/components/parameters/common/computing-type.d.ts +2 -1
  69. package/dist/components/parameters/common/computing-type.js +3 -0
  70. package/dist/components/parameters/common/limitreductions/columns-definitions.js +1 -1
  71. package/dist/components/parameters/common/limitreductions/limit-reductions-form-util.js +1 -1
  72. package/dist/components/parameters/loadflow/load-flow-general-parameters.js +1 -1
  73. package/dist/components/parameters/loadflow/load-flow-parameters-content.js +1 -1
  74. package/dist/components/parameters/loadflow/load-flow-parameters-form.js +1 -1
  75. package/dist/components/parameters/loadflow/load-flow-parameters-utils.js +3 -3
  76. package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +15 -16
  77. package/dist/components/parameters/network-visualizations/map-parameters.js +13 -17
  78. package/dist/components/parameters/network-visualizations/network-area-diagram-parameters.js +1 -2
  79. package/dist/components/parameters/network-visualizations/network-visualizations-form.js +2 -2
  80. package/dist/components/parameters/network-visualizations/single-line-diagram-parameters.js +2 -3
  81. package/dist/components/parameters/security-analysis/security-analysis-parameters-form.js +2 -3
  82. package/dist/components/parameters/security-analysis/security-analysis-parameters-selector.js +3 -3
  83. package/dist/components/parameters/security-analysis/security-analysis-violations-hiding.js +1 -1
  84. package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.js +5 -5
  85. package/dist/components/parameters/sensi/sensitivity-analysis-parameters-form.js +1 -1
  86. package/dist/components/parameters/sensi/sensitivity-table.js +2 -3
  87. package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +42 -54
  88. package/dist/components/parameters/sensi/utils.js +16 -27
  89. package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +2 -2
  90. package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.js +1 -1
  91. package/dist/components/parameters/voltage-init/use-voltage-init-parameters-form.js +1 -1
  92. package/dist/components/parameters/voltage-init/voltage-init-form-utils.js +47 -56
  93. package/dist/components/parameters/voltage-init/voltage-init-parameters-form.js +1 -1
  94. package/dist/components/parameters/voltage-init/voltage-init-parameters-inline.js +1 -1
  95. package/dist/components/snackbarProvider/SnackbarProvider.js +1 -4
  96. package/dist/components/topBar/TopBar.js +33 -36
  97. package/dist/components/topBar/UserInformationDialog.js +7 -8
  98. package/dist/components/topBar/UserSettingsDialog.js +1 -1
  99. package/dist/components/treeViewFinder/TreeViewFinder.js +13 -13
  100. package/dist/hooks/use-parameters-backend.js +5 -5
  101. package/dist/hooks/use-unique-name-validation.js +2 -3
  102. package/dist/hooks/useConfidentialityWarning.js +1 -1
  103. package/dist/hooks/usePredefinedProperties.js +1 -2
  104. package/dist/index.js +9 -5
  105. package/dist/redux/commonStore.js +1 -2
  106. package/dist/services/businessErrorCode.d.ts +11 -0
  107. package/dist/services/businessErrorCode.js +10 -0
  108. package/dist/services/index.d.ts +1 -0
  109. package/dist/services/index.js +2 -0
  110. package/dist/services/utils.js +13 -7
  111. package/dist/translations/en/businessErrorsEn.d.ts +28 -0
  112. package/dist/translations/en/businessErrorsEn.js +25 -0
  113. package/dist/translations/en/equipmentsEn.d.ts +1 -0
  114. package/dist/translations/en/equipmentsEn.js +2 -1
  115. package/dist/translations/en/index.d.ts +1 -0
  116. package/dist/translations/en/index.js +2 -0
  117. package/dist/translations/fr/businessErrorsFr.d.ts +28 -0
  118. package/dist/translations/fr/businessErrorsFr.js +25 -0
  119. package/dist/translations/fr/equipmentsFr.d.ts +1 -0
  120. package/dist/translations/fr/equipmentsFr.js +2 -1
  121. package/dist/translations/fr/index.d.ts +1 -0
  122. package/dist/translations/fr/index.js +2 -0
  123. package/dist/utils/index.js +2 -1
  124. package/dist/utils/types/equipmentType.d.ts +162 -8
  125. package/dist/utils/types/equipmentType.js +126 -22
  126. package/dist/utils/types/index.js +2 -1
  127. package/package.json +6 -6
  128. package/dist/components/inputs/reactHookForm/utils/RefreshButton.d.ts +0 -2
  129. package/dist/components/inputs/reactHookForm/utils/RefreshButton.js +0 -9
@@ -41,7 +41,7 @@ import "../../filter/HeaderFilterForm.js";
41
41
  import { getNameElementEditorEmptyFormData } from "../common/name-element-editor/name-element-editor-utils.js";
42
42
  const useSecurityAnalysisParametersForm = (parametersBackend, parametersUuid, name, description) => {
43
43
  const [providers, provider, , , , params, , updateParameters, , , defaultLimitReductions] = parametersBackend;
44
- const [currentProvider, setCurrentProvider] = useState(params == null ? void 0 : params.provider);
44
+ const [currentProvider, setCurrentProvider] = useState(params?.provider);
45
45
  const { snackError } = useSnackMessage();
46
46
  const formattedProviders = useMemo(() => {
47
47
  return Object.entries(providers).filter(([key]) => !key.includes("DynaFlow")).map(([key, value]) => ({
@@ -51,8 +51,8 @@ const useSecurityAnalysisParametersForm = (parametersBackend, parametersUuid, na
51
51
  }, [providers]);
52
52
  const paramsLoaded = useMemo(() => !!params && !!currentProvider, [currentProvider, params]);
53
53
  const formSchema = useMemo(() => {
54
- return getSAParametersFromSchema(name, params == null ? void 0 : params.limitReductions);
55
- }, [name, params == null ? void 0 : params.limitReductions]);
54
+ return getSAParametersFromSchema(name, params?.limitReductions);
55
+ }, [name, params?.limitReductions]);
56
56
  const formMethods = useForm({
57
57
  defaultValues: {
58
58
  ...getNameElementEditorEmptyFormData(name, description),
@@ -70,7 +70,7 @@ const useSecurityAnalysisParametersForm = (parametersBackend, parametersUuid, na
70
70
  const watchProvider = watch("provider");
71
71
  const toLimitReductions = useCallback(
72
72
  (formLimits) => {
73
- if (!(params == null ? void 0 : params.limitReductions)) {
73
+ if (!params?.limitReductions) {
74
74
  return [];
75
75
  }
76
76
  return params.limitReductions.map((vlLimits, indexVl) => {
@@ -87,7 +87,7 @@ const useSecurityAnalysisParametersForm = (parametersBackend, parametersUuid, na
87
87
  return vlLNewLimits;
88
88
  });
89
89
  },
90
- [params == null ? void 0 : params.limitReductions]
90
+ [params?.limitReductions]
91
91
  );
92
92
  const formatNewParams = useCallback(
93
93
  (formData) => {
@@ -64,7 +64,7 @@ function SensitivityAnalysisParametersForm({
64
64
  validationSchema: sensitivityAnalysisMethods.formSchema,
65
65
  ...sensitivityAnalysisMethods.formMethods,
66
66
  children: /* @__PURE__ */ jsxs(Box, { sx: styles.sensibilityAnalysisParameters, children: [
67
- renderTitleFields == null ? void 0 : renderTitleFields(),
67
+ renderTitleFields?.(),
68
68
  sensitivityAnalysisMethods.paramsLoaded ? /* @__PURE__ */ jsxs(Box, { sx: mergeSx(parametersStyles.scrollableGrid, { paddingTop: 0, maxHeight: "100%" }), children: [
69
69
  /* @__PURE__ */ jsxs(
70
70
  Grid,
@@ -53,11 +53,10 @@ function SensitivityTable({
53
53
  }, [append, createRows, currentRows.length]);
54
54
  const fetchCount = useCallback(
55
55
  (providedArrayFormName, index, source) => {
56
- var _a, _b, _c, _d;
57
56
  const row = getValues(providedArrayFormName)[index];
58
57
  const isActivated = row[ACTIVATED];
59
- const hasMonitoredBranches = ((_a = row[MONITORED_BRANCHES]) == null ? void 0 : _a.length) > 0;
60
- const hasInjections = ((_b = row[INJECTIONS]) == null ? void 0 : _b.length) > 0 || ((_c = row[HVDC_LINES]) == null ? void 0 : _c.length) > 0 || ((_d = row[PSTS]) == null ? void 0 : _d.length) > 0;
58
+ const hasMonitoredBranches = row[MONITORED_BRANCHES]?.length > 0;
59
+ const hasInjections = row[INJECTIONS]?.length > 0 || row[HVDC_LINES]?.length > 0 || row[PSTS]?.length > 0;
61
60
  if (source === "switch" && hasMonitoredBranches && hasInjections) {
62
61
  if (isActivated) {
63
62
  onChangeParams(row, providedArrayFormName, index);
@@ -115,10 +115,7 @@ const useSensitivityAnalysisParametersForm = ({
115
115
  const tabToCheck = values[tab];
116
116
  if (tabToCheck) {
117
117
  const count = tabToCheck.filter((entry) => entry[ACTIVATED]).filter((entry) => entry[MONITORED_BRANCHES].length > 0).filter(
118
- (entry) => {
119
- var _a, _b, _c;
120
- return ((_a = entry[INJECTIONS]) == null ? void 0 : _a.length) > 0 || ((_b = entry[PSTS]) == null ? void 0 : _b.length) > 0 || ((_c = entry[HVDC_LINES]) == null ? void 0 : _c.length) > 0;
121
- }
118
+ (entry) => entry[INJECTIONS]?.length > 0 || entry[PSTS]?.length > 0 || entry[HVDC_LINES]?.length > 0
122
119
  ).map((entry) => entry[COUNT]).reduce((a, b) => a + b, 0);
123
120
  totalResultCount += count;
124
121
  }
@@ -170,140 +167,134 @@ const useSensitivityAnalysisParametersForm = ({
170
167
  );
171
168
  const fromSensitivityAnalysisParamsDataToFormValues = useCallback(
172
169
  (parameters) => {
173
- var _a, _b, _c, _d, _e;
174
170
  const values = {
175
171
  [PROVIDER]: parameters[PROVIDER],
176
172
  [FLOW_FLOW_SENSITIVITY_VALUE_THRESHOLD]: parameters.flowFlowSensitivityValueThreshold,
177
173
  [ANGLE_FLOW_SENSITIVITY_VALUE_THRESHOLD]: parameters.angleFlowSensitivityValueThreshold,
178
174
  [FLOW_VOLTAGE_SENSITIVITY_VALUE_THRESHOLD]: parameters.flowVoltageSensitivityValueThreshold,
179
- [PARAMETER_SENSI_INJECTIONS_SET]: ((_a = parameters.sensitivityInjectionsSet) == null ? void 0 : _a.map((sensiInjectionsSet) => {
180
- var _a2, _b2, _c2;
175
+ [PARAMETER_SENSI_INJECTIONS_SET]: parameters.sensitivityInjectionsSet?.map((sensiInjectionsSet) => {
181
176
  return {
182
- [MONITORED_BRANCHES]: ((_a2 = sensiInjectionsSet[MONITORED_BRANCHES]) == null ? void 0 : _a2.map((sensiInjection) => {
177
+ [MONITORED_BRANCHES]: sensiInjectionsSet[MONITORED_BRANCHES]?.map((sensiInjection) => {
183
178
  return {
184
179
  [FieldConstants.ID]: sensiInjection[CONTAINER_ID],
185
180
  [FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
186
181
  };
187
- })) ?? [],
188
- [INJECTIONS]: ((_b2 = sensiInjectionsSet[INJECTIONS]) == null ? void 0 : _b2.map((sensiInjection) => {
182
+ }) ?? [],
183
+ [INJECTIONS]: sensiInjectionsSet[INJECTIONS]?.map((sensiInjection) => {
189
184
  return {
190
185
  [FieldConstants.ID]: sensiInjection[CONTAINER_ID],
191
186
  [FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
192
187
  };
193
- })) ?? [],
188
+ }) ?? [],
194
189
  [DISTRIBUTION_TYPE]: sensiInjectionsSet[DISTRIBUTION_TYPE],
195
- [CONTINGENCIES]: ((_c2 = sensiInjectionsSet[CONTINGENCIES]) == null ? void 0 : _c2.map((sensiInjection) => {
190
+ [CONTINGENCIES]: sensiInjectionsSet[CONTINGENCIES]?.map((sensiInjection) => {
196
191
  return {
197
192
  [FieldConstants.ID]: sensiInjection[CONTAINER_ID],
198
193
  [FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
199
194
  };
200
- })) ?? [],
195
+ }) ?? [],
201
196
  [ACTIVATED]: sensiInjectionsSet[ACTIVATED] ?? false,
202
197
  [COUNT]: 0
203
198
  };
204
- })) ?? [],
205
- [PARAMETER_SENSI_INJECTION]: ((_b = parameters.sensitivityInjection) == null ? void 0 : _b.map((sensiInjections) => {
206
- var _a2, _b2, _c2;
199
+ }) ?? [],
200
+ [PARAMETER_SENSI_INJECTION]: parameters.sensitivityInjection?.map((sensiInjections) => {
207
201
  return {
208
- [MONITORED_BRANCHES]: ((_a2 = sensiInjections[MONITORED_BRANCHES]) == null ? void 0 : _a2.map((sensiInjection) => {
202
+ [MONITORED_BRANCHES]: sensiInjections[MONITORED_BRANCHES]?.map((sensiInjection) => {
209
203
  return {
210
204
  [FieldConstants.ID]: sensiInjection[CONTAINER_ID],
211
205
  [FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
212
206
  };
213
- })) ?? [],
214
- [INJECTIONS]: ((_b2 = sensiInjections[INJECTIONS]) == null ? void 0 : _b2.map((sensiInjection) => {
207
+ }) ?? [],
208
+ [INJECTIONS]: sensiInjections[INJECTIONS]?.map((sensiInjection) => {
215
209
  return {
216
210
  [FieldConstants.ID]: sensiInjection[CONTAINER_ID],
217
211
  [FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
218
212
  };
219
- })) ?? [],
220
- [CONTINGENCIES]: ((_c2 = sensiInjections[CONTINGENCIES]) == null ? void 0 : _c2.map((sensiInjection) => {
213
+ }) ?? [],
214
+ [CONTINGENCIES]: sensiInjections[CONTINGENCIES]?.map((sensiInjection) => {
221
215
  return {
222
216
  [FieldConstants.ID]: sensiInjection[CONTAINER_ID],
223
217
  [FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
224
218
  };
225
- })) ?? [],
219
+ }) ?? [],
226
220
  [ACTIVATED]: sensiInjections[ACTIVATED] ?? false,
227
221
  [COUNT]: 0
228
222
  };
229
- })) ?? [],
230
- [PARAMETER_SENSI_HVDC]: ((_c = parameters.sensitivityHVDC) == null ? void 0 : _c.map((sensiInjectionsSet) => {
231
- var _a2, _b2, _c2;
223
+ }) ?? [],
224
+ [PARAMETER_SENSI_HVDC]: parameters.sensitivityHVDC?.map((sensiInjectionsSet) => {
232
225
  return {
233
- [MONITORED_BRANCHES]: ((_a2 = sensiInjectionsSet[MONITORED_BRANCHES]) == null ? void 0 : _a2.map((sensiInjection) => {
226
+ [MONITORED_BRANCHES]: sensiInjectionsSet[MONITORED_BRANCHES]?.map((sensiInjection) => {
234
227
  return {
235
228
  [FieldConstants.ID]: sensiInjection[CONTAINER_ID],
236
229
  [FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
237
230
  };
238
- })) ?? [],
239
- [HVDC_LINES]: ((_b2 = sensiInjectionsSet[HVDC_LINES]) == null ? void 0 : _b2.map((sensiInjection) => {
231
+ }) ?? [],
232
+ [HVDC_LINES]: sensiInjectionsSet[HVDC_LINES]?.map((sensiInjection) => {
240
233
  return {
241
234
  [FieldConstants.ID]: sensiInjection[CONTAINER_ID],
242
235
  [FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
243
236
  };
244
- })) ?? [],
237
+ }) ?? [],
245
238
  [SENSITIVITY_TYPE]: sensiInjectionsSet[SENSITIVITY_TYPE],
246
- [CONTINGENCIES]: ((_c2 = sensiInjectionsSet[CONTINGENCIES]) == null ? void 0 : _c2.map((sensiInjection) => {
239
+ [CONTINGENCIES]: sensiInjectionsSet[CONTINGENCIES]?.map((sensiInjection) => {
247
240
  return {
248
241
  [FieldConstants.ID]: sensiInjection[CONTAINER_ID],
249
242
  [FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
250
243
  };
251
- })) ?? [],
244
+ }) ?? [],
252
245
  [ACTIVATED]: sensiInjectionsSet[ACTIVATED] ?? false,
253
246
  [COUNT]: 0
254
247
  };
255
- })) ?? [],
256
- [PARAMETER_SENSI_PST]: ((_d = parameters.sensitivityPST) == null ? void 0 : _d.map((sensiInjectionsSet) => {
257
- var _a2, _b2, _c2;
248
+ }) ?? [],
249
+ [PARAMETER_SENSI_PST]: parameters.sensitivityPST?.map((sensiInjectionsSet) => {
258
250
  return {
259
- [MONITORED_BRANCHES]: ((_a2 = sensiInjectionsSet[MONITORED_BRANCHES]) == null ? void 0 : _a2.map((sensiInjection) => {
251
+ [MONITORED_BRANCHES]: sensiInjectionsSet[MONITORED_BRANCHES]?.map((sensiInjection) => {
260
252
  return {
261
253
  [FieldConstants.ID]: sensiInjection[CONTAINER_ID],
262
254
  [FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
263
255
  };
264
- })) ?? [],
265
- [PSTS]: ((_b2 = sensiInjectionsSet[PSTS]) == null ? void 0 : _b2.map((sensiInjection) => {
256
+ }) ?? [],
257
+ [PSTS]: sensiInjectionsSet[PSTS]?.map((sensiInjection) => {
266
258
  return {
267
259
  [FieldConstants.ID]: sensiInjection[CONTAINER_ID],
268
260
  [FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
269
261
  };
270
- })) ?? [],
262
+ }) ?? [],
271
263
  [SENSITIVITY_TYPE]: sensiInjectionsSet[SENSITIVITY_TYPE],
272
- [CONTINGENCIES]: ((_c2 = sensiInjectionsSet[CONTINGENCIES]) == null ? void 0 : _c2.map((sensiInjection) => {
264
+ [CONTINGENCIES]: sensiInjectionsSet[CONTINGENCIES]?.map((sensiInjection) => {
273
265
  return {
274
266
  [FieldConstants.ID]: sensiInjection[CONTAINER_ID],
275
267
  [FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
276
268
  };
277
- })) ?? [],
269
+ }) ?? [],
278
270
  [ACTIVATED]: sensiInjectionsSet[ACTIVATED] ?? false,
279
271
  [COUNT]: 0
280
272
  };
281
- })) ?? [],
282
- [PARAMETER_SENSI_NODES]: ((_e = parameters.sensitivityNodes) == null ? void 0 : _e.map((sensiInjectionsSet) => {
283
- var _a2, _b2, _c2;
273
+ }) ?? [],
274
+ [PARAMETER_SENSI_NODES]: parameters.sensitivityNodes?.map((sensiInjectionsSet) => {
284
275
  return {
285
- [SUPERVISED_VOLTAGE_LEVELS]: ((_a2 = sensiInjectionsSet[SUPERVISED_VOLTAGE_LEVELS]) == null ? void 0 : _a2.map((sensiInjection) => {
276
+ [SUPERVISED_VOLTAGE_LEVELS]: sensiInjectionsSet[SUPERVISED_VOLTAGE_LEVELS]?.map((sensiInjection) => {
286
277
  return {
287
278
  [FieldConstants.ID]: sensiInjection[CONTAINER_ID],
288
279
  [FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
289
280
  };
290
- })) ?? [],
291
- [EQUIPMENTS_IN_VOLTAGE_REGULATION]: ((_b2 = sensiInjectionsSet[EQUIPMENTS_IN_VOLTAGE_REGULATION]) == null ? void 0 : _b2.map((sensiInjection) => {
281
+ }) ?? [],
282
+ [EQUIPMENTS_IN_VOLTAGE_REGULATION]: sensiInjectionsSet[EQUIPMENTS_IN_VOLTAGE_REGULATION]?.map((sensiInjection) => {
292
283
  return {
293
284
  [FieldConstants.ID]: sensiInjection[CONTAINER_ID],
294
285
  [FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
295
286
  };
296
- })) ?? [],
297
- [CONTINGENCIES]: ((_c2 = sensiInjectionsSet[CONTINGENCIES]) == null ? void 0 : _c2.map((sensiInjection) => {
287
+ }) ?? [],
288
+ [CONTINGENCIES]: sensiInjectionsSet[CONTINGENCIES]?.map((sensiInjection) => {
298
289
  return {
299
290
  [FieldConstants.ID]: sensiInjection[CONTAINER_ID],
300
291
  [FieldConstants.NAME]: sensiInjection[CONTAINER_NAME]
301
292
  };
302
- })) ?? [],
293
+ }) ?? [],
303
294
  [ACTIVATED]: sensiInjectionsSet[ACTIVATED] ?? false,
304
295
  [COUNT]: 0
305
296
  };
306
- })) ?? []
297
+ }) ?? []
307
298
  };
308
299
  return values;
309
300
  },
@@ -319,10 +310,7 @@ const useSensitivityAnalysisParametersForm = ({
319
310
  index
320
311
  }));
321
312
  const filteredInitEntries = entries.filter(
322
- (entry) => {
323
- var _a, _b, _c;
324
- return entry[ACTIVATED] && entry[MONITORED_BRANCHES].length > 0 && (((_a = entry[INJECTIONS]) == null ? void 0 : _a.length) > 0 || ((_b = entry[PSTS]) == null ? void 0 : _b.length) > 0 || ((_c = entry[HVDC_LINES]) == null ? void 0 : _c.length) > 0);
325
- }
313
+ (entry) => entry[ACTIVATED] && entry[MONITORED_BRANCHES].length > 0 && (entry[INJECTIONS]?.length > 0 || entry[PSTS]?.length > 0 || entry[HVDC_LINES]?.length > 0)
326
314
  );
327
315
  filteredInitEntries.forEach((entry) => {
328
316
  const originalIndex = entriesWithIndices.findIndex((obj) => obj.entry === entry);
@@ -92,10 +92,8 @@ const getSensiHVDCsFormSchema = () => ({
92
92
  )
93
93
  });
94
94
  const getSensiHvdcformatNewParams = (newParams) => {
95
- var _a;
96
95
  return {
97
- [PARAMETER_SENSI_HVDC]: (_a = newParams.sensitivityHVDC) == null ? void 0 : _a.map((sensitivityHVDCs) => {
98
- var _a2;
96
+ [PARAMETER_SENSI_HVDC]: newParams.sensitivityHVDC?.map((sensitivityHVDCs) => {
99
97
  return {
100
98
  [MONITORED_BRANCHES]: sensitivityHVDCs[MONITORED_BRANCHES].map((container) => {
101
99
  return {
@@ -110,7 +108,7 @@ const getSensiHvdcformatNewParams = (newParams) => {
110
108
  };
111
109
  }),
112
110
  [SENSITIVITY_TYPE]: sensitivityHVDCs[SENSITIVITY_TYPE],
113
- [CONTINGENCIES]: (_a2 = sensitivityHVDCs[CONTINGENCIES]) == null ? void 0 : _a2.map((container) => {
111
+ [CONTINGENCIES]: sensitivityHVDCs[CONTINGENCIES]?.map((container) => {
114
112
  return {
115
113
  [CONTAINER_ID]: container[ID],
116
114
  [CONTAINER_NAME]: container[NAME]
@@ -139,10 +137,8 @@ const getSensiInjectionsFormSchema = () => ({
139
137
  )
140
138
  });
141
139
  const getSensiInjectionsformatNewParams = (newParams) => {
142
- var _a;
143
140
  return {
144
- [PARAMETER_SENSI_INJECTION]: (_a = newParams.sensitivityInjection) == null ? void 0 : _a.map((sensitivityInjections) => {
145
- var _a2;
141
+ [PARAMETER_SENSI_INJECTION]: newParams.sensitivityInjection?.map((sensitivityInjections) => {
146
142
  return {
147
143
  [MONITORED_BRANCHES]: sensitivityInjections[MONITORED_BRANCHES].map((container) => {
148
144
  return {
@@ -156,7 +152,7 @@ const getSensiInjectionsformatNewParams = (newParams) => {
156
152
  [CONTAINER_NAME]: container[NAME]
157
153
  };
158
154
  }),
159
- [CONTINGENCIES]: (_a2 = sensitivityInjections[CONTINGENCIES]) == null ? void 0 : _a2.map((container) => {
155
+ [CONTINGENCIES]: sensitivityInjections[CONTINGENCIES]?.map((container) => {
160
156
  return {
161
157
  [CONTAINER_ID]: container[ID],
162
158
  [CONTAINER_NAME]: container[NAME]
@@ -189,20 +185,17 @@ const getSensiInjectionsSetFormSchema = () => ({
189
185
  )
190
186
  });
191
187
  const getGenericRowNewParams = (newRowParams) => {
192
- var _a, _b, _c, _d;
193
188
  return {
194
189
  [MONITORED_BRANCHES]: newRowParams[MONITORED_BRANCHES].map((container) => container[ID]),
195
- [INJECTIONS]: (_a = newRowParams[INJECTIONS]) == null ? void 0 : _a.map((container) => container[ID]),
196
- [HVDC_LINES]: (_b = newRowParams[HVDC_LINES]) == null ? void 0 : _b.map((container) => container[ID]),
197
- [PSTS]: (_c = newRowParams[PSTS]) == null ? void 0 : _c.map((container) => container[ID]),
198
- [CONTINGENCIES]: (_d = newRowParams[CONTINGENCIES]) == null ? void 0 : _d.map((container) => container[ID])
190
+ [INJECTIONS]: newRowParams[INJECTIONS]?.map((container) => container[ID]),
191
+ [HVDC_LINES]: newRowParams[HVDC_LINES]?.map((container) => container[ID]),
192
+ [PSTS]: newRowParams[PSTS]?.map((container) => container[ID]),
193
+ [CONTINGENCIES]: newRowParams[CONTINGENCIES]?.map((container) => container[ID])
199
194
  };
200
195
  };
201
196
  const getSensiInjectionsSetformatNewParams = (newParams) => {
202
- var _a;
203
197
  return {
204
- [PARAMETER_SENSI_INJECTIONS_SET]: (_a = newParams.sensitivityInjectionsSet) == null ? void 0 : _a.map((sensitivityInjectionSet) => {
205
- var _a2;
198
+ [PARAMETER_SENSI_INJECTIONS_SET]: newParams.sensitivityInjectionsSet?.map((sensitivityInjectionSet) => {
206
199
  return {
207
200
  [MONITORED_BRANCHES]: sensitivityInjectionSet[MONITORED_BRANCHES].map((container) => {
208
201
  return {
@@ -217,7 +210,7 @@ const getSensiInjectionsSetformatNewParams = (newParams) => {
217
210
  };
218
211
  }),
219
212
  [DISTRIBUTION_TYPE]: sensitivityInjectionSet[DISTRIBUTION_TYPE],
220
- [CONTINGENCIES]: (_a2 = sensitivityInjectionSet[CONTINGENCIES]) == null ? void 0 : _a2.map((container) => {
213
+ [CONTINGENCIES]: sensitivityInjectionSet[CONTINGENCIES]?.map((container) => {
221
214
  return {
222
215
  [CONTAINER_ID]: container[ID],
223
216
  [CONTAINER_NAME]: container[NAME]
@@ -248,18 +241,16 @@ const getSensiNodesFormSchema = () => ({
248
241
  )
249
242
  });
250
243
  const getSensiNodesformatNewParams = (newParams) => {
251
- var _a;
252
244
  return {
253
- [PARAMETER_SENSI_NODES]: (_a = newParams.sensitivityNodes) == null ? void 0 : _a.map((sensitivityNode) => {
254
- var _a2, _b, _c;
245
+ [PARAMETER_SENSI_NODES]: newParams.sensitivityNodes?.map((sensitivityNode) => {
255
246
  return {
256
- [SUPERVISED_VOLTAGE_LEVELS]: (_a2 = sensitivityNode[SUPERVISED_VOLTAGE_LEVELS]) == null ? void 0 : _a2.map((container) => {
247
+ [SUPERVISED_VOLTAGE_LEVELS]: sensitivityNode[SUPERVISED_VOLTAGE_LEVELS]?.map((container) => {
257
248
  return {
258
249
  [CONTAINER_ID]: container[ID],
259
250
  [CONTAINER_NAME]: container[NAME]
260
251
  };
261
252
  }),
262
- [EQUIPMENTS_IN_VOLTAGE_REGULATION]: (_b = sensitivityNode[EQUIPMENTS_IN_VOLTAGE_REGULATION]) == null ? void 0 : _b.map(
253
+ [EQUIPMENTS_IN_VOLTAGE_REGULATION]: sensitivityNode[EQUIPMENTS_IN_VOLTAGE_REGULATION]?.map(
263
254
  (container) => {
264
255
  return {
265
256
  [CONTAINER_ID]: container[ID],
@@ -267,7 +258,7 @@ const getSensiNodesformatNewParams = (newParams) => {
267
258
  };
268
259
  }
269
260
  ),
270
- [CONTINGENCIES]: (_c = sensitivityNode[CONTINGENCIES]) == null ? void 0 : _c.map((container) => {
261
+ [CONTINGENCIES]: sensitivityNode[CONTINGENCIES]?.map((container) => {
271
262
  return {
272
263
  [CONTAINER_ID]: container[ID],
273
264
  [CONTAINER_NAME]: container[NAME]
@@ -297,10 +288,8 @@ const getSensiPSTsFormSchema = () => ({
297
288
  )
298
289
  });
299
290
  const getSensiPstformatNewParams = (newParams) => {
300
- var _a;
301
291
  return {
302
- [PARAMETER_SENSI_PST]: (_a = newParams.sensitivityPST) == null ? void 0 : _a.map((sensitivityPSTs) => {
303
- var _a2;
292
+ [PARAMETER_SENSI_PST]: newParams.sensitivityPST?.map((sensitivityPSTs) => {
304
293
  return {
305
294
  [MONITORED_BRANCHES]: sensitivityPSTs[MONITORED_BRANCHES].map((container) => {
306
295
  return {
@@ -315,7 +304,7 @@ const getSensiPstformatNewParams = (newParams) => {
315
304
  };
316
305
  }),
317
306
  [SENSITIVITY_TYPE]: sensitivityPSTs[SENSITIVITY_TYPE],
318
- [CONTINGENCIES]: (_a2 = sensitivityPSTs[CONTINGENCIES]) == null ? void 0 : _a2.map((container) => {
307
+ [CONTINGENCIES]: sensitivityPSTs[CONTINGENCIES]?.map((container) => {
319
308
  return {
320
309
  [CONTAINER_ID]: container[ID],
321
310
  [CONTAINER_NAME]: container[NAME]
@@ -46,7 +46,7 @@ function ShortCircuitParametersForm({
46
46
  flexDirection: "column"
47
47
  },
48
48
  children: [
49
- /* @__PURE__ */ jsx(Grid, { item: true, container: true, direction: "column", children: renderTitleFields == null ? void 0 : renderTitleFields() }),
49
+ /* @__PURE__ */ jsx(Grid, { item: true, container: true, direction: "column", children: renderTitleFields?.() }),
50
50
  paramsLoading ? /* @__PURE__ */ jsx(LinearProgress, {}) : /* @__PURE__ */ jsx(Grid, { sx: parametersStyles.scrollableGrid, children: /* @__PURE__ */ jsx(ShortCircuitFields, { enableDeveloperMode, resetAll }) }),
51
51
  /* @__PURE__ */ jsx(
52
52
  Grid,
@@ -58,7 +58,7 @@ function ShortCircuitParametersForm({
58
58
  position: "absolute",
59
59
  bottom: "15px"
60
60
  },
61
- children: renderActions == null ? void 0 : renderActions()
61
+ children: renderActions?.()
62
62
  }
63
63
  )
64
64
  ]
@@ -75,7 +75,7 @@ function ShortCircuitParametersInLine({
75
75
  );
76
76
  const handleLoadParameters = useCallback(
77
77
  (newParams) => {
78
- if (newParams == null ? void 0 : newParams.length) {
78
+ if (newParams?.length) {
79
79
  setOpenSelectParameterDialog(false);
80
80
  const paramUuid = newParams[0].id;
81
81
  fetchShortCircuitParameters(paramUuid).then((parameters) => {
@@ -138,7 +138,7 @@ const useVoltageInitParametersForm = ({
138
138
  const onValidationError = useCallback(
139
139
  (errors) => {
140
140
  const tabsInError = [];
141
- if ((errors == null ? void 0 : errors[GENERAL]) && VoltageInitTabValues.GENERAL !== selectedTab) {
141
+ if (errors?.[GENERAL] && VoltageInitTabValues.GENERAL !== selectedTab) {
142
142
  tabsInError.push(VoltageInitTabValues.GENERAL);
143
143
  }
144
144
  setTabIndexesWithError(tabsInError);