@gridsuite/commons-ui 0.142.0 → 0.144.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 (102) hide show
  1. package/dist/components/dialogs/elementSaveDialog/ElementSaveDialog.js +1 -1
  2. package/dist/components/dnd-table/dnd-table-add-rows-dialog.js +2 -2
  3. package/dist/components/dnd-table/dnd-table.js +3 -3
  4. package/dist/components/index.js +6 -3
  5. package/dist/components/inputs/reactHookForm/DirectoryItemsInput.d.ts +2 -1
  6. package/dist/components/inputs/reactHookForm/DirectoryItemsInput.js +118 -75
  7. package/dist/components/inputs/reactHookForm/OverflowableChip.d.ts +3 -2
  8. package/dist/components/inputs/reactHookForm/OverflowableChip.js +5 -5
  9. package/dist/components/inputs/reactHookForm/OverflowableChipWithHelperText.d.ts +1 -1
  10. package/dist/components/inputs/reactHookForm/OverflowableChipWithHelperText.js +20 -4
  11. package/dist/components/inputs/reactHookForm/selectInputs/SelectInput.js +3 -1
  12. package/dist/components/inputs/reactHookForm/text/DescriptionField.d.ts +3 -1
  13. package/dist/components/inputs/reactHookForm/text/DescriptionField.js +13 -4
  14. package/dist/components/overflowableText/OverflowableText.js +9 -1
  15. package/dist/components/parameters/common/ProviderParam.js +3 -3
  16. package/dist/components/parameters/common/constant.d.ts +3 -0
  17. package/dist/components/parameters/common/constant.js +6 -0
  18. package/dist/components/parameters/common/index.js +4 -1
  19. package/dist/components/parameters/common/limitreductions/limit-reduction-table-cell.js +3 -3
  20. package/dist/components/parameters/common/limitreductions/limit-reductions-table-form.js +2 -2
  21. package/dist/components/parameters/common/name-element-editor/name-element-editor-utils.js +3 -3
  22. package/dist/components/parameters/common/utils.d.ts +14 -0
  23. package/dist/components/parameters/common/utils.js +89 -0
  24. package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table-cell.js +3 -3
  25. package/dist/components/parameters/common/widget/parameter-float.js +3 -3
  26. package/dist/components/parameters/common/widget/parameter-line-directory-items-input.js +3 -3
  27. package/dist/components/parameters/common/widget/parameter-line-slider.js +3 -3
  28. package/dist/components/parameters/index.js +6 -3
  29. package/dist/components/parameters/loadflow/constants.d.ts +0 -3
  30. package/dist/components/parameters/loadflow/constants.js +0 -6
  31. package/dist/components/parameters/loadflow/index.js +1 -4
  32. package/dist/components/parameters/loadflow/load-flow-general-parameters.js +7 -3
  33. package/dist/components/parameters/loadflow/load-flow-parameter-field.js +3 -3
  34. package/dist/components/parameters/loadflow/load-flow-parameters-form.js +5 -5
  35. package/dist/components/parameters/loadflow/load-flow-parameters-header.js +3 -3
  36. package/dist/components/parameters/loadflow/load-flow-parameters-type.d.ts +11 -0
  37. package/dist/components/parameters/loadflow/load-flow-parameters-type.js +1 -0
  38. package/dist/components/parameters/loadflow/load-flow-parameters-utils.d.ts +0 -11
  39. package/dist/components/parameters/loadflow/load-flow-parameters-utils.js +3 -50
  40. package/dist/components/parameters/loadflow/use-load-flow-parameters-form.d.ts +3 -3
  41. package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +33 -59
  42. package/dist/components/parameters/network-visualizations/network-area-diagram-parameters.js +3 -3
  43. package/dist/components/parameters/network-visualizations/network-visualizations-form.js +2 -2
  44. package/dist/components/parameters/network-visualizations/use-network-visualizations-parameters-form.js +1 -1
  45. package/dist/components/parameters/pcc-min/pcc-min-form-utils.js +3 -3
  46. package/dist/components/parameters/pcc-min/pcc-min-parameters-form.js +3 -3
  47. package/dist/components/parameters/security-analysis/security-analysis-parameters-form.js +3 -3
  48. package/dist/components/parameters/security-analysis/security-analysis-violations-hiding.js +3 -3
  49. package/dist/components/parameters/sensi/sensitivity-Flow-parameters.js +3 -3
  50. package/dist/components/parameters/sensi/sensitivity-analysis-parameters-form.js +3 -3
  51. package/dist/components/parameters/sensi/sensitivity-table.js +1 -1
  52. package/dist/components/parameters/sensi/table-cell.js +3 -3
  53. package/dist/components/parameters/short-circuit/constants.d.ts +12 -0
  54. package/dist/components/parameters/short-circuit/constants.js +16 -1
  55. package/dist/components/parameters/short-circuit/index.js +5 -2
  56. package/dist/components/parameters/short-circuit/short-circuit-fields.js +56 -15
  57. package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.d.ts +3 -1
  58. package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.js +24 -5
  59. package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +5 -5
  60. package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.d.ts +4 -3
  61. package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.js +22 -29
  62. package/dist/components/parameters/short-circuit/short-circuit-parameters-utils.d.ts +27 -0
  63. package/dist/components/parameters/short-circuit/short-circuit-parameters-utils.js +61 -0
  64. package/dist/components/parameters/short-circuit/short-circuit-parameters.type.d.ts +7 -21
  65. package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.d.ts +15 -15
  66. package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +121 -128
  67. package/dist/components/parameters/voltage-init/equipment-selection-parameters.js +3 -3
  68. package/dist/components/parameters/voltage-init/use-voltage-init-parameters-form.js +1 -1
  69. package/dist/components/parameters/voltage-init/voltage-init-form-utils.js +3 -3
  70. package/dist/components/parameters/voltage-init/voltage-init-parameters-form.js +3 -3
  71. package/dist/hooks/use-parameters-backend.d.ts +2 -2
  72. package/dist/hooks/use-parameters-backend.js +6 -4
  73. package/dist/index.js +13 -7
  74. package/dist/services/index.d.ts +1 -0
  75. package/dist/services/index.js +6 -5
  76. package/dist/services/short-circuit-analysis.d.ts +3 -0
  77. package/dist/services/short-circuit-analysis.js +25 -4
  78. package/dist/services/study.d.ts +1 -3
  79. package/dist/services/study.js +0 -19
  80. package/dist/services/utils.d.ts +0 -4
  81. package/dist/services/utils.js +4 -10
  82. package/dist/translations/en/businessErrorsEn.d.ts +17 -0
  83. package/dist/translations/en/businessErrorsEn.js +20 -3
  84. package/dist/translations/en/inputsEn.d.ts +1 -1
  85. package/dist/translations/en/inputsEn.js +1 -1
  86. package/dist/translations/en/parameters.d.ts +3 -0
  87. package/dist/translations/en/parameters.js +3 -0
  88. package/dist/translations/fr/businessErrorsFr.d.ts +17 -0
  89. package/dist/translations/fr/businessErrorsFr.js +20 -3
  90. package/dist/translations/fr/inputsFr.d.ts +1 -1
  91. package/dist/translations/fr/inputsFr.js +1 -1
  92. package/dist/translations/fr/parameters.d.ts +3 -0
  93. package/dist/translations/fr/parameters.js +3 -0
  94. package/dist/utils/error.js +8 -0
  95. package/dist/utils/index.js +2 -0
  96. package/dist/utils/types/NetworkTimeoutError.d.ts +10 -0
  97. package/dist/utils/types/NetworkTimeoutError.js +9 -0
  98. package/dist/utils/types/index.d.ts +1 -0
  99. package/dist/utils/types/index.js +2 -0
  100. package/dist/utils/types/loadflow.type.d.ts +1 -1
  101. package/dist/utils/types/parameters.type.d.ts +6 -3
  102. package/package.json +2 -2
@@ -1,9 +1,8 @@
1
1
  import { useForm } from "react-hook-form";
2
2
  import { yupResolver } from "@hookform/resolvers/yup";
3
- import { useState, useCallback, useMemo, useEffect } from "react";
4
- import { TabValues, getDefaultSpecificParamsValues, getSpecificLoadFlowParametersFormSchema, getCommonLoadFlowParametersFormSchema, mapLimitReductions, setSpecificParameters, setLimitReductions } from "./load-flow-parameters-utils.js";
5
- import { ParameterType } from "../../../utils/types/parameters.type.js";
6
- import { PROVIDER } from "../common/constant.js";
3
+ import { useState, useCallback, useMemo, useEffectEvent, useEffect } from "react";
4
+ import { TabValues, getCommonLoadFlowParametersFormSchema, mapLimitReductions, setLimitReductions } from "./load-flow-parameters-utils.js";
5
+ import { PROVIDER, SPECIFIC_PARAMETERS, COMMON_PARAMETERS, VERSION_PARAMETER } from "../common/constant.js";
7
6
  import "react/jsx-runtime";
8
7
  import "@mui/material";
9
8
  import "react-intl";
@@ -40,9 +39,10 @@ import "react-querybuilder";
40
39
  import "../common/widget/parameter-line-slider.js";
41
40
  import { getLimitReductionsFormSchema, LIMIT_REDUCTIONS_FORM } from "../common/limitreductions/columns-definitions.js";
42
41
  import { toFormValuesLimitReductions } from "../common/limitreductions/limit-reductions-form-util.js";
43
- import { PARAM_LIMIT_REDUCTION, SPECIFIC_PARAMETERS, COMMON_PARAMETERS, PARAM_PROVIDER_OPENLOADFLOW, VERSION_PARAMETER } from "./constants.js";
42
+ import { PARAM_LIMIT_REDUCTION, PARAM_PROVIDER_OPENLOADFLOW } from "./constants.js";
44
43
  import "../../filter/HeaderFilterForm.js";
45
44
  import { getNameElementEditorSchema, getNameElementEditorEmptyFormData } from "../common/name-element-editor/name-element-editor-utils.js";
45
+ import { getDefaultSpecificParamsValues, getSpecificParametersFormSchema, getAllSpecificParametersValues, formatSpecificParameters, setSpecificParameters } from "../common/utils.js";
46
46
  const useLoadFlowParametersForm = (parametersBackend, enableDeveloperMode, parametersUuid, name, description) => {
47
47
  const [
48
48
  providers,
@@ -65,30 +65,21 @@ const useLoadFlowParametersForm = (parametersBackend, enableDeveloperMode, param
65
65
  const handleTabChange = useCallback((event, newValue) => {
66
66
  setSelectedTab(newValue);
67
67
  }, []);
68
- const specificParametersValues = useMemo(() => {
69
- const specificParams = currentProvider ? specificParamsDescriptions?.[currentProvider] : void 0;
70
- return getDefaultSpecificParamsValues(specificParams);
71
- }, [currentProvider, specificParamsDescriptions]);
72
- const specificParameters = useMemo(() => {
73
- const specificParams = currentProvider ? specificParamsDescriptions?.[currentProvider] : void 0;
74
- return specificParams?.map((param) => ({
75
- name: param.name,
76
- type: param.type,
77
- label: param.label,
78
- description: param.description,
79
- possibleValues: param.possibleValues,
80
- defaultValue: param.defaultValue
81
- }));
68
+ const specificParametersDescriptionForProvider = useMemo(() => {
69
+ return currentProvider && specificParamsDescriptions ? specificParamsDescriptions[currentProvider] : [];
82
70
  }, [currentProvider, specificParamsDescriptions]);
71
+ const specificParametersDefaultValues = useMemo(() => {
72
+ return getDefaultSpecificParamsValues(specificParametersDescriptionForProvider);
73
+ }, [specificParametersDescriptionForProvider]);
83
74
  const formSchema = useMemo(() => {
84
75
  return yup.object({
85
76
  [PROVIDER]: yup.string().required(),
86
77
  [PARAM_LIMIT_REDUCTION]: yup.number().nullable(),
87
78
  ...getCommonLoadFlowParametersFormSchema().fields,
88
79
  ...getLimitReductionsFormSchema(limitReductionNumber).fields,
89
- ...getSpecificLoadFlowParametersFormSchema(specificParameters).fields
80
+ ...getSpecificParametersFormSchema(specificParametersDescriptionForProvider).fields
90
81
  }).concat(getNameElementEditorSchema(name));
91
- }, [name, limitReductionNumber, specificParameters]);
82
+ }, [name, limitReductionNumber, specificParametersDescriptionForProvider]);
92
83
  const formMethods = useForm({
93
84
  defaultValues: {
94
85
  ...getNameElementEditorEmptyFormData(name, description),
@@ -98,14 +89,14 @@ const useLoadFlowParametersForm = (parametersBackend, enableDeveloperMode, param
98
89
  ...params?.commonParameters
99
90
  },
100
91
  [SPECIFIC_PARAMETERS]: {
101
- ...specificParametersValues
92
+ ...specificParametersDefaultValues
102
93
  },
103
94
  [LIMIT_REDUCTIONS_FORM]: []
104
95
  },
105
96
  resolver: yupResolver(formSchema)
106
97
  });
107
98
  const { watch, reset } = formMethods;
108
- const watchProvider = watch("provider");
99
+ const watchProvider = watch(PROVIDER);
109
100
  const toLimitReductions = useCallback(
110
101
  (formLimits) => {
111
102
  if (formLimits?.length === 0) {
@@ -125,17 +116,6 @@ const useLoadFlowParametersForm = (parametersBackend, enableDeveloperMode, param
125
116
  },
126
117
  [defaultLimitReductions, params?.limitReductions, watchProvider]
127
118
  );
128
- const getSpecificParametersPerProvider = (formData, _specificParametersValues) => {
129
- return Object.keys(formData[SPECIFIC_PARAMETERS]).reduce(
130
- (acc, key) => {
131
- if (_specificParametersValues[key].toString() !== formData[SPECIFIC_PARAMETERS][key].toString()) {
132
- acc[key] = formData[SPECIFIC_PARAMETERS][key].toString();
133
- }
134
- return acc;
135
- },
136
- {}
137
- );
138
- };
139
119
  const formatNewParams = useCallback(
140
120
  (formData) => {
141
121
  return {
@@ -146,32 +126,20 @@ const useLoadFlowParametersForm = (parametersBackend, enableDeveloperMode, param
146
126
  // PowSyBl requires that "version" appears first
147
127
  ...formData[COMMON_PARAMETERS]
148
128
  },
149
- specificParametersPerProvider: {
150
- [formData.provider]: getSpecificParametersPerProvider(formData, specificParametersValues)
151
- },
129
+ specificParametersPerProvider: specificParametersDefaultValues ? {
130
+ [formData.provider]: getAllSpecificParametersValues(
131
+ formData,
132
+ specificParametersDefaultValues
133
+ )
134
+ } : {},
152
135
  limitReductions: toLimitReductions(formData[LIMIT_REDUCTIONS_FORM])
153
136
  };
154
137
  },
155
- [specificParametersValues, toLimitReductions]
138
+ [specificParametersDefaultValues, toLimitReductions]
156
139
  );
157
140
  const toLoadFlowFormValues = useCallback(
158
141
  (_params) => {
159
- const specificParams = _params.provider ? specificParamsDescriptions?.[_params.provider] : void 0;
160
- const specificParamsPerProvider = _params.specificParametersPerProvider[_params.provider];
161
- const formatted = specificParams?.reduce((acc, param) => {
162
- if (specificParamsPerProvider && Object.prototype.hasOwnProperty.call(specificParamsPerProvider, param.name)) {
163
- if (param.type === ParameterType.BOOLEAN) {
164
- acc[param.name] = specificParamsPerProvider[param.name] === "true";
165
- } else if (param.type === ParameterType.STRING_LIST) {
166
- acc[param.name] = specificParamsPerProvider[param.name] !== "" ? specificParamsPerProvider[param.name].split(",") : [];
167
- } else {
168
- acc[param.name] = specificParamsPerProvider[param.name];
169
- }
170
- } else {
171
- acc[param.name] = getDefaultSpecificParamsValues([param])[param.name];
172
- }
173
- return acc;
174
- }, {});
142
+ const specificParamsListForCurrentProvider = _params.specificParametersPerProvider[_params.provider];
175
143
  return {
176
144
  [PROVIDER]: _params.provider,
177
145
  [PARAM_LIMIT_REDUCTION]: _params.limitReduction,
@@ -179,12 +147,15 @@ const useLoadFlowParametersForm = (parametersBackend, enableDeveloperMode, param
179
147
  ..._params.commonParameters
180
148
  },
181
149
  [SPECIFIC_PARAMETERS]: {
182
- ...formatted
150
+ ...formatSpecificParameters(
151
+ specificParametersDescriptionForProvider,
152
+ specificParamsListForCurrentProvider
153
+ )
183
154
  },
184
155
  ...toFormValuesLimitReductions(_params.limitReductions)
185
156
  };
186
157
  },
187
- [specificParamsDescriptions]
158
+ [specificParametersDescriptionForProvider]
188
159
  );
189
160
  const paramsLoaded = useMemo(() => !!params && !!currentProvider, [currentProvider, params]);
190
161
  const formattedProviders = useMemo(() => {
@@ -230,12 +201,15 @@ const useLoadFlowParametersForm = (parametersBackend, enableDeveloperMode, param
230
201
  },
231
202
  [parametersUuid, formatNewParams, snackError]
232
203
  );
204
+ const resetForm = useEffectEvent((_params) => {
205
+ reset(toLoadFlowFormValues(_params));
206
+ });
233
207
  useEffect(() => {
234
208
  if (!params) {
235
209
  return;
236
210
  }
237
- reset(toLoadFlowFormValues(params));
238
- }, [paramsLoaded, params, reset, specificParamsDescriptions, toLoadFlowFormValues]);
211
+ resetForm(params);
212
+ }, [paramsLoaded, params]);
239
213
  useEffect(() => {
240
214
  if (watchProvider && watchProvider !== currentProvider) {
241
215
  setCurrentProvider(watchProvider);
@@ -266,7 +240,7 @@ const useLoadFlowParametersForm = (parametersBackend, enableDeveloperMode, param
266
240
  handleTabChange,
267
241
  tabIndexesWithError,
268
242
  formattedProviders,
269
- specificParameters,
243
+ specificParametersDescriptionForProvider,
270
244
  defaultLimitReductions,
271
245
  toLoadFlowFormValues,
272
246
  formatNewParams,
@@ -4,12 +4,12 @@ import { FormattedMessage } from "react-intl";
4
4
  import { NAD_POSITIONS_GENERATION_MODE_LABEL, NetworkVisualizationTabValues, PARAM_NAD_POSITIONS_GENERATION_MODE, NAD_POSITIONS_GENERATION_MODE } from "./constants.js";
5
5
  import { parametersStyles } from "../parameters-style.js";
6
6
  import "../../overflowableText/OverflowableText.js";
7
- import "react";
8
- import "react-hook-form";
9
- import "../../../utils/types/equipmentType.js";
10
7
  import "../../../utils/conversionUtils.js";
11
8
  import "@mui/icons-material";
9
+ import "../../../utils/types/equipmentType.js";
12
10
  import "../../../utils/yupConfig.js";
11
+ import "react";
12
+ import "react-hook-form";
13
13
  import "localized-countries";
14
14
  import "localized-countries/data/fr";
15
15
  import "localized-countries/data/en";
@@ -3,11 +3,11 @@ import { Grid, LinearProgress, Tabs, Tab } from "@mui/material";
3
3
  import { useState, useEffect } from "react";
4
4
  import { FormattedMessage } from "react-intl";
5
5
  import "../../overflowableText/OverflowableText.js";
6
- import "react-hook-form";
7
- import "../../../utils/types/equipmentType.js";
8
6
  import "../../../utils/conversionUtils.js";
9
7
  import "@mui/icons-material";
8
+ import "../../../utils/types/equipmentType.js";
10
9
  import "../../../utils/yupConfig.js";
10
+ import "react-hook-form";
11
11
  import { getAvailableComponentLibraries } from "../../../services/study.js";
12
12
  import "localized-countries";
13
13
  import "localized-countries/data/fr";
@@ -6,11 +6,11 @@ import "react/jsx-runtime";
6
6
  import "react-intl";
7
7
  import "@mui/material";
8
8
  import "../../overflowableText/OverflowableText.js";
9
- import "../../../utils/types/equipmentType.js";
10
9
  import "../../../utils/conversionUtils.js";
11
10
  import { snackWithFallback } from "../../../utils/error.js";
12
11
  import "@mui/icons-material";
13
12
  import { ElementType } from "../../../utils/types/elementType.js";
13
+ import "../../../utils/types/equipmentType.js";
14
14
  import { updateParameter } from "../../../services/explore.js";
15
15
  import { setStudyNetworkVisualizationParameters } from "../../../services/study.js";
16
16
  import { getNetworkVisualizationsParameters } from "../../../services/study-config.js";
@@ -3,12 +3,12 @@ import "react/jsx-runtime";
3
3
  import "react-intl";
4
4
  import "@mui/material";
5
5
  import "../../overflowableText/OverflowableText.js";
6
- import "react";
7
- import "react-hook-form";
8
- import "../../../utils/types/equipmentType.js";
9
6
  import "../../../utils/conversionUtils.js";
10
7
  import "@mui/icons-material";
8
+ import "../../../utils/types/equipmentType.js";
11
9
  import "../../../utils/yupConfig.js";
10
+ import "react";
11
+ import "react-hook-form";
12
12
  import "localized-countries";
13
13
  import "localized-countries/data/fr";
14
14
  import "localized-countries/data/en";
@@ -2,14 +2,14 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Box, Grid, LinearProgress } from "@mui/material";
3
3
  import "react-intl";
4
4
  import "../../overflowableText/OverflowableText.js";
5
- import "react";
6
- import "react-hook-form";
7
- import { EquipmentType } from "../../../utils/types/equipmentType.js";
8
5
  import { FILTERS } from "../../../utils/constants/filterConstant.js";
9
6
  import "../../../utils/conversionUtils.js";
10
7
  import "@mui/icons-material";
11
8
  import { ElementType } from "../../../utils/types/elementType.js";
9
+ import { EquipmentType } from "../../../utils/types/equipmentType.js";
12
10
  import "../../../utils/yupConfig.js";
11
+ import "react";
12
+ import "react-hook-form";
13
13
  import "localized-countries";
14
14
  import "localized-countries/data/fr";
15
15
  import "localized-countries/data/en";
@@ -2,13 +2,13 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { FormattedMessage } from "react-intl";
3
3
  import { Grid, Box, LinearProgress } from "@mui/material";
4
4
  import "../../overflowableText/OverflowableText.js";
5
- import "react";
6
- import "react-hook-form";
7
- import "../../../utils/types/equipmentType.js";
8
5
  import "../../../utils/conversionUtils.js";
9
6
  import "@mui/icons-material";
10
7
  import { mergeSx } from "../../../utils/styles.js";
8
+ import "../../../utils/types/equipmentType.js";
11
9
  import "../../../utils/yupConfig.js";
10
+ import "react";
11
+ import "react-hook-form";
12
12
  import "localized-countries";
13
13
  import "localized-countries/data/fr";
14
14
  import "localized-countries/data/en";
@@ -4,11 +4,11 @@ import { useIntl } from "react-intl";
4
4
  import { Info } from "@mui/icons-material";
5
5
  import { parametersStyles } from "../parameters-style.js";
6
6
  import "../../overflowableText/OverflowableText.js";
7
- import "react";
8
- import "react-hook-form";
9
- import "../../../utils/types/equipmentType.js";
10
7
  import "../../../utils/conversionUtils.js";
8
+ import "../../../utils/types/equipmentType.js";
11
9
  import "../../../utils/yupConfig.js";
10
+ import "react";
11
+ import "react-hook-form";
12
12
  import "localized-countries";
13
13
  import "localized-countries/data/fr";
14
14
  import "localized-countries/data/en";
@@ -3,12 +3,12 @@ import { Grid } from "@mui/material";
3
3
  import { FormattedMessage } from "react-intl";
4
4
  import { FLOW_FLOW_SENSITIVITY_VALUE_THRESHOLD, ANGLE_FLOW_SENSITIVITY_VALUE_THRESHOLD, FLOW_VOLTAGE_SENSITIVITY_VALUE_THRESHOLD } from "./constants.js";
5
5
  import "../../overflowableText/OverflowableText.js";
6
- import "react";
7
- import "react-hook-form";
8
- import "../../../utils/types/equipmentType.js";
9
6
  import "../../../utils/conversionUtils.js";
10
7
  import "@mui/icons-material";
8
+ import "../../../utils/types/equipmentType.js";
11
9
  import "../../../utils/yupConfig.js";
10
+ import "react";
11
+ import "react-hook-form";
12
12
  import "localized-countries";
13
13
  import "localized-countries/data/fr";
14
14
  import "localized-countries/data/en";
@@ -3,13 +3,13 @@ import { Box, Grid, LinearProgress } from "@mui/material";
3
3
  import { FormattedMessage } from "react-intl";
4
4
  import { parametersStyles } from "../parameters-style.js";
5
5
  import "../../overflowableText/OverflowableText.js";
6
- import "react";
7
- import "react-hook-form";
8
- import "../../../utils/types/equipmentType.js";
9
6
  import "../../../utils/conversionUtils.js";
10
7
  import "@mui/icons-material";
11
8
  import { mergeSx } from "../../../utils/styles.js";
9
+ import "../../../utils/types/equipmentType.js";
12
10
  import "../../../utils/yupConfig.js";
11
+ import "react";
12
+ import "react-hook-form";
13
13
  import "localized-countries";
14
14
  import "localized-countries/data/fr";
15
15
  import "localized-countries/data/en";
@@ -9,8 +9,8 @@ import { ACTIVATED, MONITORED_BRANCHES, INJECTIONS, HVDC_LINES, PSTS, COUNT } fr
9
9
  import "@hello-pangea/dnd";
10
10
  import { MAX_ROWS_NUMBER } from "../../dnd-table/dnd-table.type.js";
11
11
  import "../../overflowableText/OverflowableText.js";
12
- import "../../../utils/types/equipmentType.js";
13
12
  import "../../../utils/conversionUtils.js";
13
+ import "../../../utils/types/equipmentType.js";
14
14
  import "../../../utils/yupConfig.js";
15
15
  import "localized-countries";
16
16
  import "localized-countries/data/fr";
@@ -2,12 +2,12 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { TableCell } from "@mui/material";
3
3
  import "react-intl";
4
4
  import "../../overflowableText/OverflowableText.js";
5
- import "react";
6
- import "react-hook-form";
7
- import "../../../utils/types/equipmentType.js";
8
5
  import "../../../utils/conversionUtils.js";
9
6
  import "@mui/icons-material";
7
+ import "../../../utils/types/equipmentType.js";
10
8
  import "../../../utils/yupConfig.js";
9
+ import "react";
10
+ import "react-hook-form";
11
11
  import "localized-countries";
12
12
  import "localized-countries/data/fr";
13
13
  import "localized-countries/data/en";
@@ -21,6 +21,8 @@ export declare const SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS = "withVSCConvert
21
21
  export declare const SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS = "withShuntCompensators";
22
22
  export declare const SHORT_CIRCUIT_WITH_NEUTRAL_POSITION = "withNeutralPosition";
23
23
  export declare const SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE = "initialVoltageProfileMode";
24
+ export declare const SHORT_CIRCUIT_VOLTAGE_RANGES = "voltageRanges";
25
+ export declare const SHORT_CIRCUIT_ONLY_STARTED_GENERATORS = "onlyStartedGenerators";
24
26
  export declare const intlPredefinedParametersOptions: () => {
25
27
  id: string;
26
28
  label: string;
@@ -35,3 +37,13 @@ export declare const intlInitialVoltageProfileMode: () => {
35
37
  label: string;
36
38
  };
37
39
  };
40
+ export declare const onlyStartedGeneratorsOptions: {
41
+ ALL: {
42
+ id: string;
43
+ label: string;
44
+ };
45
+ STARTED: {
46
+ id: string;
47
+ label: string;
48
+ };
49
+ };
@@ -17,6 +17,8 @@ const SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS = "withVSCConverterStations";
17
17
  const SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS = "withShuntCompensators";
18
18
  const SHORT_CIRCUIT_WITH_NEUTRAL_POSITION = "withNeutralPosition";
19
19
  const SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE = "initialVoltageProfileMode";
20
+ const SHORT_CIRCUIT_VOLTAGE_RANGES = "voltageRanges";
21
+ const SHORT_CIRCUIT_ONLY_STARTED_GENERATORS = "onlyStartedGenerators";
20
22
  const intlPredefinedParametersOptions = () => [
21
23
  {
22
24
  id: "ICC_MAX_WITH_NOMINAL_VOLTAGE_MAP",
@@ -43,16 +45,29 @@ const intlInitialVoltageProfileMode = () => {
43
45
  }
44
46
  };
45
47
  };
48
+ const onlyStartedGeneratorsOptions = {
49
+ ALL: {
50
+ id: "false",
51
+ label: "ShortCircuitAllLabel"
52
+ },
53
+ STARTED: {
54
+ id: "true",
55
+ label: "ShortCircuitStartedLabel"
56
+ }
57
+ };
46
58
  export {
47
59
  InitialVoltage,
48
60
  PredefinedParameters,
49
61
  SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE,
62
+ SHORT_CIRCUIT_ONLY_STARTED_GENERATORS,
50
63
  SHORT_CIRCUIT_PREDEFINED_PARAMS,
64
+ SHORT_CIRCUIT_VOLTAGE_RANGES,
51
65
  SHORT_CIRCUIT_WITH_FEEDER_RESULT,
52
66
  SHORT_CIRCUIT_WITH_LOADS,
53
67
  SHORT_CIRCUIT_WITH_NEUTRAL_POSITION,
54
68
  SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS,
55
69
  SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS,
56
70
  intlInitialVoltageProfileMode,
57
- intlPredefinedParametersOptions
71
+ intlPredefinedParametersOptions,
72
+ onlyStartedGeneratorsOptions
58
73
  };
@@ -1,11 +1,13 @@
1
- import { InitialVoltage, PredefinedParameters, SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, SHORT_CIRCUIT_PREDEFINED_PARAMS, SHORT_CIRCUIT_WITH_FEEDER_RESULT, SHORT_CIRCUIT_WITH_LOADS, SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, intlInitialVoltageProfileMode, intlPredefinedParametersOptions } from "./constants.js";
1
+ import { InitialVoltage, PredefinedParameters, SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS, SHORT_CIRCUIT_PREDEFINED_PARAMS, SHORT_CIRCUIT_VOLTAGE_RANGES, SHORT_CIRCUIT_WITH_FEEDER_RESULT, SHORT_CIRCUIT_WITH_LOADS, SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, intlInitialVoltageProfileMode, intlPredefinedParametersOptions, onlyStartedGeneratorsOptions } from "./constants.js";
2
2
  import { ShortCircuitParametersInLine } from "./short-circuit-parameters-inline.js";
3
3
  import { ShortCircuitParametersEditionDialog } from "./short-circuit-parameters-dialog.js";
4
4
  export {
5
5
  InitialVoltage,
6
6
  PredefinedParameters,
7
7
  SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE,
8
+ SHORT_CIRCUIT_ONLY_STARTED_GENERATORS,
8
9
  SHORT_CIRCUIT_PREDEFINED_PARAMS,
10
+ SHORT_CIRCUIT_VOLTAGE_RANGES,
9
11
  SHORT_CIRCUIT_WITH_FEEDER_RESULT,
10
12
  SHORT_CIRCUIT_WITH_LOADS,
11
13
  SHORT_CIRCUIT_WITH_NEUTRAL_POSITION,
@@ -14,5 +16,6 @@ export {
14
16
  ShortCircuitParametersEditionDialog,
15
17
  ShortCircuitParametersInLine,
16
18
  intlInitialVoltageProfileMode,
17
- intlPredefinedParametersOptions
19
+ intlPredefinedParametersOptions,
20
+ onlyStartedGeneratorsOptions
18
21
  };
@@ -1,18 +1,18 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { useState, useMemo, useEffect } from "react";
3
3
  import { Grid } from "@mui/material";
4
4
  import { green, red } from "@mui/material/colors";
5
5
  import { Lens } from "@mui/icons-material";
6
6
  import { useWatch, useFormContext } from "react-hook-form";
7
- import { SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, SHORT_CIRCUIT_PREDEFINED_PARAMS, SHORT_CIRCUIT_WITH_LOADS, SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, intlPredefinedParametersOptions, PredefinedParameters, intlInitialVoltageProfileMode, InitialVoltage, SHORT_CIRCUIT_WITH_FEEDER_RESULT } from "./constants.js";
7
+ import { SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, SHORT_CIRCUIT_PREDEFINED_PARAMS, SHORT_CIRCUIT_WITH_LOADS, SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, intlPredefinedParametersOptions, PredefinedParameters, intlInitialVoltageProfileMode, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS, onlyStartedGeneratorsOptions, InitialVoltage, SHORT_CIRCUIT_WITH_FEEDER_RESULT } from "./constants.js";
8
8
  import { VoltageTable } from "./short-circuit-voltage-table.js";
9
9
  import GridItem from "../../grid/grid-item.js";
10
10
  import GridSection from "../../grid/grid-section.js";
11
11
  import "react-intl";
12
12
  import { FieldLabel } from "../../inputs/reactHookForm/utils/FieldLabel.js";
13
13
  import "../../overflowableText/OverflowableText.js";
14
- import "../../../utils/types/equipmentType.js";
15
14
  import "../../../utils/conversionUtils.js";
15
+ import "../../../utils/types/equipmentType.js";
16
16
  import "../../../utils/yupConfig.js";
17
17
  import "localized-countries";
18
18
  import "localized-countries/data/fr";
@@ -37,6 +37,11 @@ import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
37
37
  import "uuid";
38
38
  import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
39
39
  import "react-querybuilder";
40
+ import { COMMON_PARAMETERS, SPECIFIC_PARAMETERS } from "../common/constant.js";
41
+ import "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
42
+ import "../../dialogs/elementSaveDialog/ElementSaveDialog.js";
43
+ import "../common/widget/parameter-line-slider.js";
44
+ import "../common/limitreductions/columns-definitions.js";
40
45
  var Status = /* @__PURE__ */ ((Status2) => {
41
46
  Status2["SUCCESS"] = "SUCCESS";
42
47
  Status2["ERROR"] = "ERROR";
@@ -48,23 +53,30 @@ function ShortCircuitFields({ resetAll, enableDeveloperMode = true }) {
48
53
  /* SUCCESS */
49
54
  );
50
55
  const watchInitialVoltageProfileMode = useWatch({
51
- name: SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE
56
+ name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE}`
52
57
  });
53
58
  const watchPredefinedParams = useWatch({
54
59
  name: SHORT_CIRCUIT_PREDEFINED_PARAMS
55
60
  });
56
61
  const watchLoads = useWatch({
57
- name: SHORT_CIRCUIT_WITH_LOADS
62
+ name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_LOADS}`
58
63
  });
59
64
  const watchShuntCompensators = useWatch({
60
- name: SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS
65
+ name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS}`
61
66
  });
62
67
  const watchVSC = useWatch({
63
- name: SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS
68
+ name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS}`
64
69
  });
65
70
  const watchNeutralPosition = useWatch({
66
- name: SHORT_CIRCUIT_WITH_NEUTRAL_POSITION
71
+ name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_NEUTRAL_POSITION}`
72
+ });
73
+ const watchSpecificParameters = useWatch({
74
+ name: `${SPECIFIC_PARAMETERS}`
67
75
  });
76
+ const isThereSpecificParameters = useMemo(
77
+ () => Object.keys(watchSpecificParameters).length > 0 && watchSpecificParameters.constructor === Object,
78
+ [watchSpecificParameters]
79
+ );
68
80
  const isIccMinFeaturesDefaultConfiguration = useMemo(() => {
69
81
  return !watchLoads && !watchShuntCompensators && !watchVSC && !watchNeutralPosition;
70
82
  }, [watchLoads, watchShuntCompensators, watchVSC, watchNeutralPosition]);
@@ -104,7 +116,7 @@ function ShortCircuitFields({ resetAll, enableDeveloperMode = true }) {
104
116
  }, [enableDeveloperMode, watchPredefinedParams, setValue]);
105
117
  const feederResult = /* @__PURE__ */ jsxs(Grid, { container: true, alignItems: "center", spacing: 2, direction: "row", children: [
106
118
  /* @__PURE__ */ jsx(Grid, { item: true, xs: 10, children: /* @__PURE__ */ jsx(FieldLabel, { label: "descWithFeederResult" }) }),
107
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 2, children: /* @__PURE__ */ jsx(SwitchInput, { name: SHORT_CIRCUIT_WITH_FEEDER_RESULT }) })
119
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: 2, children: /* @__PURE__ */ jsx(SwitchInput, { name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_FEEDER_RESULT}` }) })
108
120
  ] });
109
121
  const predefinedParameters = /* @__PURE__ */ jsx(
110
122
  MuiSelectInput,
@@ -118,14 +130,39 @@ function ShortCircuitFields({ resetAll, enableDeveloperMode = true }) {
118
130
  const initialVoltageProfileModeField = /* @__PURE__ */ jsx(
119
131
  RadioInput,
120
132
  {
121
- name: SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE,
133
+ name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE}`,
122
134
  options: Object.values(initialVoltageProfileMode)
123
135
  }
124
136
  );
125
- const loads = /* @__PURE__ */ jsx(CheckboxInput, { name: SHORT_CIRCUIT_WITH_LOADS, label: "shortCircuitLoads" });
126
- const vsc = /* @__PURE__ */ jsx(CheckboxInput, { name: SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, label: "shortCircuitHvdc" });
127
- const shuntCompensators = /* @__PURE__ */ jsx(CheckboxInput, { name: SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, label: "shortCircuitShuntCompensators" });
128
- const neutralPosition = /* @__PURE__ */ jsx(CheckboxInput, { name: SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, label: "shortCircuitNeutralPosition" });
137
+ const loads = /* @__PURE__ */ jsx(CheckboxInput, { name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_LOADS}`, label: "shortCircuitLoads" });
138
+ const vsc = /* @__PURE__ */ jsx(
139
+ CheckboxInput,
140
+ {
141
+ name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS}`,
142
+ label: "shortCircuitHvdc"
143
+ }
144
+ );
145
+ const shuntCompensators = /* @__PURE__ */ jsx(
146
+ CheckboxInput,
147
+ {
148
+ name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS}`,
149
+ label: "shortCircuitShuntCompensators"
150
+ }
151
+ );
152
+ const neutralPosition = /* @__PURE__ */ jsx(
153
+ CheckboxInput,
154
+ {
155
+ name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_NEUTRAL_POSITION}`,
156
+ label: "shortCircuitNeutralPosition"
157
+ }
158
+ );
159
+ const onlyStartedGenerators = /* @__PURE__ */ jsx(
160
+ RadioInput,
161
+ {
162
+ name: `${SPECIFIC_PARAMETERS}.${SHORT_CIRCUIT_ONLY_STARTED_GENERATORS}`,
163
+ options: Object.values(onlyStartedGeneratorsOptions)
164
+ }
165
+ );
129
166
  useEffect(() => {
130
167
  const isIccMaxWithNominalVoltageMap = watchPredefinedParams === PredefinedParameters.ICC_MAX_WITH_NOMINAL_VOLTAGE_MAP;
131
168
  const isIccMinWithNominal = watchPredefinedParams === PredefinedParameters.ICC_MIN_WITH_NOMINAL_VOLTAGE_MAP;
@@ -165,7 +202,11 @@ function ShortCircuitFields({ resetAll, enableDeveloperMode = true }) {
165
202
  ] }),
166
203
  /* @__PURE__ */ jsx(GridSection, { title: "ShortCircuitVoltageProfileMode", heading: 4 }),
167
204
  /* @__PURE__ */ jsx(Grid, { container: true, children: /* @__PURE__ */ jsx(GridItem, { size: 12, children: initialVoltageProfileModeField }) }),
168
- /* @__PURE__ */ jsx(VoltageTable, { voltageProfileMode: watchInitialVoltageProfileMode })
205
+ /* @__PURE__ */ jsx(VoltageTable, { voltageProfileMode: watchInitialVoltageProfileMode }),
206
+ isThereSpecificParameters && /* @__PURE__ */ jsxs(Fragment, { children: [
207
+ /* @__PURE__ */ jsx(GridSection, { title: "ShortCircuitStartedGeneratorsMode", heading: 4 }),
208
+ /* @__PURE__ */ jsx(Grid, { container: true, children: /* @__PURE__ */ jsx(GridItem, { size: 12, children: onlyStartedGenerators }) })
209
+ ] })
169
210
  ] });
170
211
  }
171
212
  export {
@@ -1,2 +1,4 @@
1
1
  import { ParametersEditionDialogProps } from '../common';
2
- export declare function ShortCircuitParametersEditionDialog({ id, open, onClose, titleId, name, description, activeDirectory, language, enableDeveloperMode, }: Readonly<ParametersEditionDialogProps>): import("react/jsx-runtime").JSX.Element;
2
+ export declare function ShortCircuitParametersEditionDialog({ id, open, onClose, titleId, name, description, activeDirectory, user, language, enableDeveloperMode, }: Readonly<ParametersEditionDialogProps & {
3
+ enableDeveloperMode: boolean;
4
+ }>): import("react/jsx-runtime").JSX.Element;