@gridsuite/commons-ui 0.246.0 → 0.248.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 (58) hide show
  1. package/dist/components/composite/filter/expert/ExpertFilterForm.js +2 -2
  2. package/dist/components/composite/filter/expert/expertFilterConstants.js +12 -0
  3. package/dist/components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js +4 -6
  4. package/dist/components/index.js +2 -0
  5. package/dist/components/ui/index.js +2 -0
  6. package/dist/components/ui/reactHookForm/index.js +2 -0
  7. package/dist/components/ui/reactHookForm/selectInputs/InputWithPopupConfirmation.d.ts +1 -1
  8. package/dist/components/ui/reactHookForm/selectInputs/InputWithPopupConfirmation.js +4 -3
  9. package/dist/components/ui/reactHookForm/utils/CancelButton.d.ts +1 -1
  10. package/dist/components/ui/reactHookForm/utils/CancelButton.js +3 -4
  11. package/dist/components/ui/reactHookForm/utils/CloseButton.d.ts +2 -0
  12. package/dist/components/ui/reactHookForm/utils/CloseButton.js +9 -0
  13. package/dist/components/ui/reactHookForm/utils/index.d.ts +1 -0
  14. package/dist/components/ui/reactHookForm/utils/index.js +2 -0
  15. package/dist/features/index.js +2 -1
  16. package/dist/features/network-modifications/common/currentLimits/LimitsPane.js +6 -5
  17. package/dist/features/parameters/common/constants.d.ts +1 -0
  18. package/dist/features/parameters/common/constants.js +2 -0
  19. package/dist/features/parameters/common/index.js +2 -1
  20. package/dist/features/parameters/common/parameter-field.d.ts +2 -1
  21. package/dist/features/parameters/common/parameter-field.js +25 -6
  22. package/dist/features/parameters/index.js +2 -1
  23. package/dist/features/parameters/loadflow/load-flow-advanced-parameters.d.ts +5 -0
  24. package/dist/features/parameters/loadflow/load-flow-advanced-parameters.js +111 -0
  25. package/dist/features/parameters/loadflow/load-flow-general-parameters.d.ts +7 -6
  26. package/dist/features/parameters/loadflow/load-flow-general-parameters.js +8 -93
  27. package/dist/features/parameters/loadflow/load-flow-parameters-content.d.ts +1 -1
  28. package/dist/features/parameters/loadflow/load-flow-parameters-content.js +6 -2
  29. package/dist/features/parameters/loadflow/load-flow-parameters-form.js +2 -1
  30. package/dist/features/parameters/loadflow/load-flow-parameters-header.d.ts +2 -1
  31. package/dist/features/parameters/loadflow/load-flow-parameters-header.js +21 -1
  32. package/dist/features/parameters/loadflow/load-flow-parameters-type.d.ts +2 -1
  33. package/dist/features/parameters/loadflow/load-flow-parameters-utils.d.ts +22 -8
  34. package/dist/features/parameters/loadflow/load-flow-parameters-utils.js +39 -5
  35. package/dist/features/parameters/loadflow/load-flow-provider-specific-parameters.d.ts +7 -0
  36. package/dist/features/parameters/loadflow/load-flow-provider-specific-parameters.js +47 -0
  37. package/dist/features/parameters/loadflow/use-load-flow-parameters-form.js +28 -6
  38. package/dist/features/parameters/security-analysis/security-analysis-parameters-selector.js +1 -0
  39. package/dist/features/process-configs/security-analysis/update-sa-process-config.js +1 -0
  40. package/dist/features/topBar/AboutDialog.js +3 -2
  41. package/dist/features/topBar/UserInformationDialog.js +2 -2
  42. package/dist/features/topBar/UserSettingsDialog.js +3 -2
  43. package/dist/index.js +4 -1
  44. package/dist/translations/en/commonButtonEn.d.ts +1 -0
  45. package/dist/translations/en/commonButtonEn.js +1 -0
  46. package/dist/translations/en/parameters.d.ts +3 -2
  47. package/dist/translations/en/parameters.js +4 -3
  48. package/dist/translations/en/topBarEn.d.ts +0 -1
  49. package/dist/translations/en/topBarEn.js +1 -2
  50. package/dist/translations/fr/commonButtonFr.d.ts +1 -0
  51. package/dist/translations/fr/commonButtonFr.js +1 -0
  52. package/dist/translations/fr/parameters.d.ts +3 -2
  53. package/dist/translations/fr/parameters.js +4 -3
  54. package/dist/translations/fr/topBarFr.d.ts +0 -1
  55. package/dist/translations/fr/topBarFr.js +1 -2
  56. package/dist/utils/types/equipmentType.js +7 -0
  57. package/dist/utils/types/parameters.type.d.ts +1 -0
  58. package/package.json +1 -1
@@ -77,7 +77,7 @@ function ExpertFilterForm({ isEditing }) {
77
77
  const openConfirmationPopup = useCallback(() => {
78
78
  return formatQuery(getValues(EXPERT_FILTER_QUERY), "json_without_ids") !== formatQuery(defaultQuery, "json_without_ids");
79
79
  }, [getValues]);
80
- const handleResetOnConfirmation = useCallback(() => {
80
+ const resetOnTypeChange = useCallback(() => {
81
81
  setValue(EXPERT_FILTER_QUERY, defaultQuery);
82
82
  }, [setValue]);
83
83
  const watchEquipmentType = useWatch({
@@ -102,7 +102,7 @@ function ExpertFilterForm({ isEditing }) {
102
102
  options: Object.values(EXPERT_FILTER_EQUIPMENTS),
103
103
  label: "equipmentType",
104
104
  shouldOpenPopup: openConfirmationPopup,
105
- resetOnConfirmation: handleResetOnConfirmation,
105
+ onValueChange: resetOnTypeChange,
106
106
  message: "changeTypeMessage",
107
107
  validateButtonLabel: "button.changeType",
108
108
  sx: filterStyles.textField,
@@ -16,6 +16,7 @@ const EXPERT_FILTER_QUERY = "rules";
16
16
  const EXPERT_FILTER_EQUIPMENTS = {
17
17
  [EquipmentType.SUBSTATION]: ALL_EQUIPMENTS[EquipmentType.SUBSTATION],
18
18
  [EquipmentType.VOLTAGE_LEVEL]: ALL_EQUIPMENTS[EquipmentType.VOLTAGE_LEVEL],
19
+ [EquipmentType.BUSBAR_SECTION]: ALL_EQUIPMENTS[EquipmentType.BUSBAR_SECTION],
19
20
  [EquipmentType.LINE]: ALL_EQUIPMENTS[EquipmentType.LINE],
20
21
  [EquipmentType.TWO_WINDINGS_TRANSFORMER]: ALL_EQUIPMENTS[EquipmentType.TWO_WINDINGS_TRANSFORMER],
21
22
  [EquipmentType.THREE_WINDINGS_TRANSFORMER]: ALL_EQUIPMENTS[EquipmentType.THREE_WINDINGS_TRANSFORMER],
@@ -1122,6 +1123,17 @@ const EXPERT_FILTER_FIELDS = {
1122
1123
  FIELDS_OPTIONS.LOW_SHORT_CIRCUIT_CURRENT_LIMIT,
1123
1124
  FIELDS_OPTIONS.HIGH_SHORT_CIRCUIT_CURRENT_LIMIT
1124
1125
  ],
1126
+ BUSBAR_SECTION: [
1127
+ FIELDS_OPTIONS.ID,
1128
+ FIELDS_OPTIONS.NAME,
1129
+ FIELDS_OPTIONS.COUNTRY,
1130
+ FIELDS_OPTIONS.VOLTAGE_LEVEL_ID,
1131
+ FIELDS_OPTIONS.NOMINAL_VOLTAGE,
1132
+ FIELDS_OPTIONS.PROPERTY,
1133
+ FIELDS_OPTIONS.SUBSTATION_ID,
1134
+ FIELDS_OPTIONS.SUBSTATION_PROPERTY,
1135
+ FIELDS_OPTIONS.VOLTAGE_LEVEL_PROPERTY
1136
+ ],
1125
1137
  LINE: [
1126
1138
  FIELDS_OPTIONS.ID,
1127
1139
  FIELDS_OPTIONS.NAME,
@@ -151,10 +151,6 @@ function ExplicitNamingFilterForm({
151
151
  const [selectedFile, setSelectedFile] = useState();
152
152
  const [fileErrorMessage, setFileErrorMessage] = useState();
153
153
  const tableRef = useRef(null);
154
- useEffect(() => {
155
- setSelectedFile(void 0);
156
- setFileErrorMessage(void 0);
157
- }, [watchEquipmentType]);
158
154
  const getTemplateData = useCallback(() => [csvFileHeaders], [csvFileHeaders]);
159
155
  const getTableData = useCallback(() => {
160
156
  const rows = getValues(FILTER_EQUIPMENTS_ATTRIBUTES) ?? [];
@@ -170,7 +166,9 @@ function ExplicitNamingFilterForm({
170
166
  (row) => row[DISTRIBUTION_KEY] || row[FieldConstants.EQUIPMENT_ID]
171
167
  );
172
168
  };
173
- const handleResetOnConfirmation = () => {
169
+ const resetOnTypeChange = () => {
170
+ setSelectedFile(void 0);
171
+ setFileErrorMessage(void 0);
174
172
  setValue(FILTER_EQUIPMENTS_ATTRIBUTES, makeDefaultTableRows());
175
173
  };
176
174
  const onStudySelected = (studyUuid) => {
@@ -204,7 +202,7 @@ function ExplicitNamingFilterForm({
204
202
  disabled: !!sourceFilterForExplicitNamingConversion || isEditing && !isDeveloperMode,
205
203
  label: "equipmentType",
206
204
  shouldOpenPopup: openConfirmationPopup,
207
- resetOnConfirmation: handleResetOnConfirmation,
205
+ onValueChange: resetOnTypeChange,
208
206
  message: "changeTypeMessage",
209
207
  validateButtonLabel: "button.changeType",
210
208
  sx: { width: 400, maxWidth: "100%" },
@@ -36,6 +36,7 @@ import { TextInput } from "./ui/reactHookForm/text/TextInput.js";
36
36
  import { UniqueNameInput } from "./ui/reactHookForm/text/UniqueNameInput.js";
37
37
  import { DescriptionInput } from "./ui/reactHookForm/text/DescriptionInput.js";
38
38
  import { CancelButton } from "./ui/reactHookForm/utils/CancelButton.js";
39
+ import { CloseButton } from "./ui/reactHookForm/utils/CloseButton.js";
39
40
  import { FieldLabel } from "./ui/reactHookForm/utils/FieldLabel.js";
40
41
  import { SubmitButton } from "./ui/reactHookForm/utils/SubmitButton.js";
41
42
  import { TextFieldWithAdornment } from "./ui/reactHookForm/utils/TextFieldWithAdornment.js";
@@ -176,6 +177,7 @@ export {
176
177
  CheckboxInput,
177
178
  CheckboxNullableInput,
178
179
  ChipItemsInput,
180
+ CloseButton,
179
181
  ColumnTypes,
180
182
  CombinatorSelector,
181
183
  CombinatorType,
@@ -36,6 +36,7 @@ import { TextInput } from "./reactHookForm/text/TextInput.js";
36
36
  import { UniqueNameInput } from "./reactHookForm/text/UniqueNameInput.js";
37
37
  import { DescriptionInput } from "./reactHookForm/text/DescriptionInput.js";
38
38
  import { CancelButton } from "./reactHookForm/utils/CancelButton.js";
39
+ import { CloseButton } from "./reactHookForm/utils/CloseButton.js";
39
40
  import { FieldLabel } from "./reactHookForm/utils/FieldLabel.js";
40
41
  import { SubmitButton } from "./reactHookForm/utils/SubmitButton.js";
41
42
  import { TextFieldWithAdornment } from "./reactHookForm/utils/TextFieldWithAdornment.js";
@@ -92,6 +93,7 @@ export {
92
93
  CheckboxInput,
93
94
  CheckboxNullableInput,
94
95
  ChipItemsInput,
96
+ CloseButton,
95
97
  CountriesInput,
96
98
  CountrySelectionInput,
97
99
  CsvDownloadButton,
@@ -35,6 +35,7 @@ import { TextInput } from "./text/TextInput.js";
35
35
  import { UniqueNameInput } from "./text/UniqueNameInput.js";
36
36
  import { DescriptionInput } from "./text/DescriptionInput.js";
37
37
  import { CancelButton } from "./utils/CancelButton.js";
38
+ import { CloseButton } from "./utils/CloseButton.js";
38
39
  import { FieldLabel } from "./utils/FieldLabel.js";
39
40
  import { SubmitButton } from "./utils/SubmitButton.js";
40
41
  import { TextFieldWithAdornment } from "./utils/TextFieldWithAdornment.js";
@@ -54,6 +55,7 @@ export {
54
55
  CheckboxInput,
55
56
  CheckboxNullableInput,
56
57
  ChipItemsInput,
58
+ CloseButton,
57
59
  CountriesInput,
58
60
  CountrySelectionInput,
59
61
  CustomFormContext,
@@ -1,3 +1,3 @@
1
1
  export declare function InputWithPopupConfirmation({ Input, name, shouldOpenPopup, // condition to open popup confirmation
2
- resetOnConfirmation, // function to reset values in your form on confirmation,
2
+ onValueChange, // function applying the changes on EVERY value change, be it confirmed through the popup or not
3
3
  message, validateButtonLabel, ...props }: any): import("react").JSX.Element;
@@ -7,8 +7,8 @@ function InputWithPopupConfirmation({
7
7
  name,
8
8
  shouldOpenPopup,
9
9
  // condition to open popup confirmation
10
- resetOnConfirmation,
11
- // function to reset values in your form on confirmation,
10
+ onValueChange,
11
+ // function applying the changes on EVERY value change, be it confirmed through the popup or not
12
12
  message,
13
13
  validateButtonLabel,
14
14
  ...props
@@ -25,11 +25,12 @@ function InputWithPopupConfirmation({
25
25
  setOpenPopup(true);
26
26
  setNewValue(value);
27
27
  } else {
28
+ onValueChange?.();
28
29
  onChange(value);
29
30
  }
30
31
  };
31
32
  const handlePopupConfirmation = () => {
32
- resetOnConfirmation?.();
33
+ onValueChange?.();
33
34
  onChange(newValue);
34
35
  setOpenPopup(false);
35
36
  };
@@ -1,2 +1,2 @@
1
1
  import { ButtonProps } from '@mui/material';
2
- export declare function CancelButton(inProps: Readonly<Omit<ButtonProps, 'children'>>): import("react").JSX.Element;
2
+ export declare function CancelButton(buttonProps: Readonly<Omit<ButtonProps, 'children'>>): import("react").JSX.Element;
@@ -1,9 +1,8 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { useThemeProps, Button } from "@mui/material";
2
+ import { Button } from "@mui/material";
3
3
  import { FormattedMessage } from "react-intl";
4
- function CancelButton(inProps) {
5
- const props = useThemeProps({ props: inProps, name: "CancelButton" });
6
- return /* @__PURE__ */ jsx(Button, { "data-testid": "CancelButton", ...props, children: /* @__PURE__ */ jsx(FormattedMessage, { id: "cancel" }) });
4
+ function CancelButton(buttonProps) {
5
+ return /* @__PURE__ */ jsx(Button, { "data-testid": "CancelButton", ...buttonProps, children: /* @__PURE__ */ jsx(FormattedMessage, { id: "cancel" }) });
7
6
  }
8
7
  export {
9
8
  CancelButton
@@ -0,0 +1,2 @@
1
+ import { ButtonProps } from '@mui/material';
2
+ export declare function CloseButton(buttonProps: Readonly<Omit<ButtonProps, 'children'>>): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Button } from "@mui/material";
3
+ import { FormattedMessage } from "react-intl";
4
+ function CloseButton(buttonProps) {
5
+ return /* @__PURE__ */ jsx(Button, { "data-testid": "CloseButton", ...buttonProps, children: /* @__PURE__ */ jsx(FormattedMessage, { id: "close" }) });
6
+ }
7
+ export {
8
+ CloseButton
9
+ };
@@ -5,6 +5,7 @@
5
5
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
6
  */
7
7
  export * from './CancelButton';
8
+ export * from './CloseButton';
8
9
  export * from './FieldLabel';
9
10
  export * from './SubmitButton';
10
11
  export * from './TextFieldWithAdornment';
@@ -1,4 +1,5 @@
1
1
  import { CancelButton } from "./CancelButton.js";
2
+ import { CloseButton } from "./CloseButton.js";
2
3
  import { FieldLabel } from "./FieldLabel.js";
3
4
  import { SubmitButton } from "./SubmitButton.js";
4
5
  import { TextFieldWithAdornment } from "./TextFieldWithAdornment.js";
@@ -6,6 +7,7 @@ import { genHelperError, gridItem, identity, isFieldRequired, toFloatOrNullValue
6
7
  import { HelperPreviousValue } from "./HelperPreviousValue.js";
7
8
  export {
8
9
  CancelButton,
10
+ CloseButton,
9
11
  FieldLabel,
10
12
  HelperPreviousValue,
11
13
  SubmitButton,
@@ -21,7 +21,7 @@ import { TopBar } from "./topBar/TopBar.js";
21
21
  import { ParameterLayout } from "./parameters/common/parameter-layout/parameter-layout.js";
22
22
  import { ParameterLayoutProvider, useParameterLayoutContext } from "./parameters/common/parameter-layout/parameter-layout-provider.js";
23
23
  import { formatComputingTypeLabel, isValidComputingType } from "./parameters/common/computing-type.js";
24
- import { COMMON_PARAMETERS, CONTINGENCIES, CONTINGENCY_LISTS, CONTINGENCY_LISTS_INFOS, PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_PROVIDER, PROVIDER, SPECIFIC_PARAMETERS, VERSION_PARAMETER, VOLTAGE_LEVEL } from "./parameters/common/constants.js";
24
+ import { ADVANCED_PARAMETERS, COMMON_PARAMETERS, CONTINGENCIES, CONTINGENCY_LISTS, CONTINGENCY_LISTS_INFOS, PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_PROVIDER, PROVIDER, SPECIFIC_PARAMETERS, VERSION_PARAMETER, VOLTAGE_LEVEL } from "./parameters/common/constants.js";
25
25
  import { LineSeparator } from "./parameters/common/line-separator.js";
26
26
  import { LabelledButton, SwitchWithLabel, TabPanel } from "./parameters/common/parameters.js";
27
27
  import { CreateParameterDialog } from "./parameters/common/parameters-creation-dialog.js";
@@ -237,6 +237,7 @@ import { ProcessType } from "./process-configs/process-configs.type.js";
237
237
  export {
238
238
  ACCURACY,
239
239
  ACTIVE,
240
+ ADVANCED_PARAMETERS,
240
241
  APPLICABILITY,
241
242
  AUTO_EXTENSIBLE_COLUMNS,
242
243
  AboutDialog,
@@ -112,16 +112,17 @@ function LimitsPane({
112
112
  }
113
113
  return null;
114
114
  };
115
- const handlePopupConfirmation = () => {
116
- const resetOLGs = mapServerLimitsGroupsToFormInfos(
115
+ const resetOLGs = () => {
116
+ const networkOLGs = mapServerLimitsGroupsToFormInfos(
117
117
  equipmentToModify?.currentLimits ?? []
118
118
  );
119
119
  const currentValues = getValues();
120
120
  reset(
121
121
  {
122
122
  ...currentValues,
123
- [FieldConstants.LIMITS]: {
124
- [FieldConstants.OPERATIONAL_LIMITS_GROUPS]: resetOLGs,
123
+ [id]: {
124
+ ...currentValues[id],
125
+ [FieldConstants.OPERATIONAL_LIMITS_GROUPS]: networkOLGs,
125
126
  [FieldConstants.ENABLE_OLG_MODIFICATION]: false
126
127
  }
127
128
  },
@@ -161,7 +162,7 @@ function LimitsPane({
161
162
  name: `${id}.${FieldConstants.ENABLE_OLG_MODIFICATION}`,
162
163
  label: olgEditable ? "Edit" : "View",
163
164
  shouldOpenPopup: () => olgEditable,
164
- resetOnConfirmation: handlePopupConfirmation,
165
+ onValueChange: resetOLGs,
165
166
  message: "disableOLGedition",
166
167
  validateButtonLabel: "validate"
167
168
  }
@@ -8,6 +8,7 @@ export declare const PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD = "highVoltage
8
8
  export declare const PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD = "highVoltageAbsoluteThreshold";
9
9
  export declare const VERSION_PARAMETER = "version";
10
10
  export declare const COMMON_PARAMETERS = "commonParameters";
11
+ export declare const ADVANCED_PARAMETERS = "advancedParameters";
11
12
  export declare const SPECIFIC_PARAMETERS = "specificParametersPerProvider";
12
13
  export declare const CONTINGENCY_LISTS_INFOS = "contingencyListsInfos";
13
14
  export declare const CONTINGENCY_LISTS = "contingencyLists";
@@ -8,11 +8,13 @@ const PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD = "highVoltageProportionalThr
8
8
  const PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD = "highVoltageAbsoluteThreshold";
9
9
  const VERSION_PARAMETER = "version";
10
10
  const COMMON_PARAMETERS = "commonParameters";
11
+ const ADVANCED_PARAMETERS = "advancedParameters";
11
12
  const SPECIFIC_PARAMETERS = "specificParametersPerProvider";
12
13
  const CONTINGENCY_LISTS_INFOS = "contingencyListsInfos";
13
14
  const CONTINGENCY_LISTS = "contingencyLists";
14
15
  const CONTINGENCIES = "contingencies";
15
16
  export {
17
+ ADVANCED_PARAMETERS,
16
18
  COMMON_PARAMETERS,
17
19
  CONTINGENCIES,
18
20
  CONTINGENCY_LISTS,
@@ -1,7 +1,7 @@
1
1
  import { ParameterLayout } from "./parameter-layout/parameter-layout.js";
2
2
  import { ParameterLayoutProvider, useParameterLayoutContext } from "./parameter-layout/parameter-layout-provider.js";
3
3
  import { formatComputingTypeLabel, isValidComputingType } from "./computing-type.js";
4
- import { COMMON_PARAMETERS, CONTINGENCIES, CONTINGENCY_LISTS, CONTINGENCY_LISTS_INFOS, PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_PROVIDER, PROVIDER, SPECIFIC_PARAMETERS, VERSION_PARAMETER, VOLTAGE_LEVEL } from "./constants.js";
4
+ import { ADVANCED_PARAMETERS, COMMON_PARAMETERS, CONTINGENCIES, CONTINGENCY_LISTS, CONTINGENCY_LISTS_INFOS, PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_PROVIDER, PROVIDER, SPECIFIC_PARAMETERS, VERSION_PARAMETER, VOLTAGE_LEVEL } from "./constants.js";
5
5
  import { LineSeparator } from "./line-separator.js";
6
6
  import { LabelledButton, SwitchWithLabel, TabPanel } from "./parameters.js";
7
7
  import { CreateParameterDialog } from "./parameters-creation-dialog.js";
@@ -23,6 +23,7 @@ import { COLUMNS_DEFINITIONS_CONTINGENCY_LISTS_INFOS, getContingencyListsInfosFo
23
23
  import { useTabs } from "./hook/use-tabs.js";
24
24
  import { useParametersForm } from "./hook/use-parameters-form.js";
25
25
  export {
26
+ ADVANCED_PARAMETERS,
26
27
  COLUMNS_DEFINITIONS_CONTINGENCY_LISTS_INFOS,
27
28
  COLUMNS_DEFINITIONS_LIMIT_REDUCTIONS,
28
29
  COMMON_PARAMETERS,
@@ -4,6 +4,7 @@ interface ParameterFieldProps {
4
4
  name: string;
5
5
  type: string;
6
6
  label?: string;
7
+ inputLabel?: string;
7
8
  description?: string;
8
9
  possibleValues?: {
9
10
  id: string;
@@ -11,5 +12,5 @@ interface ParameterFieldProps {
11
12
  }[] | string[];
12
13
  sx?: SxProps;
13
14
  }
14
- declare function ParameterField({ id, name, type, label, description, possibleValues, sx }: Readonly<ParameterFieldProps>): import("react").JSX.Element;
15
+ declare function ParameterField({ id, name, type, label, inputLabel, description, possibleValues, sx, }: Readonly<ParameterFieldProps>): import("react").JSX.Element;
15
16
  export default ParameterField;
@@ -8,6 +8,7 @@ import "@mui/icons-material";
8
8
  import "../../../components/ui/overflowableText/OverflowableText.js";
9
9
  import "../../../utils/conversionUtils.js";
10
10
  import "../../../utils/types/equipmentType.js";
11
+ import { mergeSx } from "../../../utils/styles.js";
11
12
  import "react";
12
13
  import "react-hook-form";
13
14
  import "localized-countries";
@@ -48,7 +49,16 @@ import "./contingency-table/contingency-table.js";
48
49
  import "./contingency-table/columns-definitions.js";
49
50
  import "@hookform/resolvers/yup";
50
51
  import "../../../components/composite/filter/HeaderFilterForm.js";
51
- function ParameterField({ id, name, type, label, description, possibleValues, sx }) {
52
+ function ParameterField({
53
+ id,
54
+ name,
55
+ type,
56
+ label,
57
+ inputLabel,
58
+ description,
59
+ possibleValues,
60
+ sx
61
+ }) {
52
62
  const renderField = () => {
53
63
  switch (type) {
54
64
  case ParameterType.STRING:
@@ -59,13 +69,20 @@ function ParameterField({ id, name, type, label, description, possibleValues, sx
59
69
  options: possibleValues,
60
70
  size: "small",
61
71
  "data-testid": `${id}.${name}`,
62
- sx
72
+ sx: mergeSx(sx, { overflow: "hidden" })
63
73
  }
64
74
  ) : /* @__PURE__ */ jsx(TextInput, { name: `${id}.${name}`, dataTestId: `${id}.${name}` });
65
75
  case ParameterType.BOOLEAN:
66
76
  return /* @__PURE__ */ jsx(SwitchInput, { name: `${id}.${name}`, "data-testid": `${id}.${name}` });
67
77
  case ParameterType.COUNTRIES:
68
- return /* @__PURE__ */ jsx(CountriesInput, { name: `${id}.${name}`, label: "descLfCountries", dataTestId: `${id}.${name}` });
78
+ return /* @__PURE__ */ jsx(
79
+ CountriesInput,
80
+ {
81
+ name: `${id}.${name}`,
82
+ label: inputLabel ?? "descLfCountries",
83
+ dataTestId: `${id}.${name}`
84
+ }
85
+ );
69
86
  case ParameterType.DOUBLE:
70
87
  return /* @__PURE__ */ jsx(FloatInput, { name: `${id}.${name}`, dataTestId: `${id}.${name}` });
71
88
  case ParameterType.STRING_LIST:
@@ -74,7 +91,7 @@ function ParameterField({ id, name, type, label, description, possibleValues, sx
74
91
  {
75
92
  "data-testid": `${id}.${name}`,
76
93
  name: `${id}.${name}`,
77
- label,
94
+ label: inputLabel,
78
95
  options: possibleValues,
79
96
  fullWidth: true,
80
97
  multiple: true,
@@ -97,9 +114,11 @@ function ParameterField({ id, name, type, label, description, possibleValues, sx
97
114
  return null;
98
115
  }
99
116
  };
117
+ const LABEL_GRID_SIZE = type !== ParameterType.COUNTRIES ? 8 : 3;
118
+ const INPUT_GRID_SIZE = 12 - LABEL_GRID_SIZE;
100
119
  return /* @__PURE__ */ jsxs(Grid2, { container: true, spacing: 1, paddingTop: 1, justifyContent: "space-between", sx: { width: "100%" }, children: [
101
- /* @__PURE__ */ jsx(Grid2, { size: 8, children: /* @__PURE__ */ jsx(CustomTooltip, { title: description, children: /* @__PURE__ */ jsx(Typography, { sx: parametersStyles.parameterName, children: label ? /* @__PURE__ */ jsx(FormattedMessage, { id: label }) : name }) }, name) }),
102
- /* @__PURE__ */ jsx(Grid2, { container: true, size: 4, sx: parametersStyles.controlItem, children: renderField() }),
120
+ /* @__PURE__ */ jsx(Grid2, { size: LABEL_GRID_SIZE, children: /* @__PURE__ */ jsx(CustomTooltip, { title: description, children: /* @__PURE__ */ jsx(Typography, { sx: parametersStyles.parameterName, children: label ? /* @__PURE__ */ jsx(FormattedMessage, { id: label }) : name }) }, name) }),
121
+ /* @__PURE__ */ jsx(Grid2, { container: true, size: INPUT_GRID_SIZE, sx: parametersStyles.controlItem, children: renderField() }),
103
122
  /* @__PURE__ */ jsx(LineSeparator, {})
104
123
  ] }, name);
105
124
  }
@@ -1,7 +1,7 @@
1
1
  import { ParameterLayout } from "./common/parameter-layout/parameter-layout.js";
2
2
  import { ParameterLayoutProvider, useParameterLayoutContext } from "./common/parameter-layout/parameter-layout-provider.js";
3
3
  import { formatComputingTypeLabel, isValidComputingType } from "./common/computing-type.js";
4
- import { COMMON_PARAMETERS, CONTINGENCIES, CONTINGENCY_LISTS, CONTINGENCY_LISTS_INFOS, PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_PROVIDER, PROVIDER, SPECIFIC_PARAMETERS, VERSION_PARAMETER, VOLTAGE_LEVEL } from "./common/constants.js";
4
+ import { ADVANCED_PARAMETERS, COMMON_PARAMETERS, CONTINGENCIES, CONTINGENCY_LISTS, CONTINGENCY_LISTS_INFOS, PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_PROVIDER, PROVIDER, SPECIFIC_PARAMETERS, VERSION_PARAMETER, VOLTAGE_LEVEL } from "./common/constants.js";
5
5
  import { LineSeparator } from "./common/line-separator.js";
6
6
  import { LabelledButton, SwitchWithLabel, TabPanel } from "./common/parameters.js";
7
7
  import { CreateParameterDialog } from "./common/parameters-creation-dialog.js";
@@ -51,6 +51,7 @@ import { DynamicMarginCalculationInline } from "./dynamic-margin-calculation/dyn
51
51
  export {
52
52
  ACCURACY,
53
53
  ACTIVE,
54
+ ADVANCED_PARAMETERS,
54
55
  BALANCE_TYPE,
55
56
  CALCULATION_TYPE,
56
57
  CENTER_LABEL,
@@ -0,0 +1,5 @@
1
+ import { SpecificParameterInfos } from '../../../utils/types/parameters.type';
2
+ export declare const advancedParams: SpecificParameterInfos[];
3
+ declare function LoadFlowAdvancedParameters(): import("react").JSX.Element;
4
+ declare const _default: import('react').MemoExoticComponent<typeof LoadFlowAdvancedParameters>;
5
+ export default _default;
@@ -0,0 +1,111 @@
1
+ import { jsx, Fragment } from "react/jsx-runtime";
2
+ import { memo, createElement } from "react";
3
+ import ParameterField from "../common/parameter-field.js";
4
+ import { VOLTAGE_INIT_MODE, USE_REACTIVE_LIMITS, TWT_SPLIT_SHUNT_ADMITTANCE, READ_SLACK_BUS, WRITE_SLACK_BUS, DISTRIBUTED_SLACK, SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON, DC_USE_TRANSFORMER_RATIO, DC_POWER_FACTOR } from "./constants.js";
5
+ import { ParameterType } from "../../../utils/types/parameters.type.js";
6
+ import "@mui/material";
7
+ import "@mui/icons-material";
8
+ import "react-intl";
9
+ import "../../../components/ui/overflowableText/OverflowableText.js";
10
+ import "../../../utils/conversionUtils.js";
11
+ import "../../../utils/types/equipmentType.js";
12
+ import "react-hook-form";
13
+ import "localized-countries";
14
+ import "localized-countries/data/fr";
15
+ import "localized-countries/data/en";
16
+ import "notistack";
17
+ import "../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
18
+ import "yup";
19
+ import "../../../components/ui/treeViewFinder/TreeViewFinder.js";
20
+ import "../../../components/ui/reactHookForm/numbers/RangeInput.js";
21
+ import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
22
+ import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
23
+ import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
24
+ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
25
+ import "@material-symbols/svg-400/outlined/add_notes.svg?react";
26
+ import "../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
27
+ import "../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
28
+ import "../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
29
+ import "@hello-pangea/dnd";
30
+ import "../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
31
+ import "../../../components/ui/snackbarProvider/SnackbarProvider.js";
32
+ import "mui-nested-menu";
33
+ import "react-resizable-panels";
34
+ import "react-papaparse";
35
+ import "../common/parameter-layout/parameter-layout-provider.js";
36
+ import { ADVANCED_PARAMETERS } from "../common/constants.js";
37
+ import "../common/widget/parameter-line-slider.js";
38
+ import "../common/limitreductions/columns-definitions.js";
39
+ import "../common/contingency-table/contingency-table.js";
40
+ import "../common/contingency-table/columns-definitions.js";
41
+ import "@hookform/resolvers/yup";
42
+ import "../../../components/composite/filter/HeaderFilterForm.js";
43
+ const advancedParams = [
44
+ {
45
+ name: VOLTAGE_INIT_MODE,
46
+ type: ParameterType.STRING,
47
+ label: "descLfVoltageInitMode",
48
+ possibleValues: [
49
+ {
50
+ id: "UNIFORM_VALUES",
51
+ label: "descLfUniformValues"
52
+ },
53
+ {
54
+ id: "PREVIOUS_VALUES",
55
+ label: "descLfPreviousValues"
56
+ },
57
+ {
58
+ id: "DC_VALUES",
59
+ label: "descLfDcValues"
60
+ }
61
+ ]
62
+ },
63
+ {
64
+ name: USE_REACTIVE_LIMITS,
65
+ type: ParameterType.BOOLEAN,
66
+ label: "descLfUseReactiveLimits"
67
+ },
68
+ {
69
+ name: TWT_SPLIT_SHUNT_ADMITTANCE,
70
+ type: ParameterType.BOOLEAN,
71
+ label: "descLfTwtSplitShuntAdmittance"
72
+ },
73
+ {
74
+ name: READ_SLACK_BUS,
75
+ type: ParameterType.BOOLEAN,
76
+ label: "descLfReadSlackBus"
77
+ },
78
+ {
79
+ name: WRITE_SLACK_BUS,
80
+ type: ParameterType.BOOLEAN,
81
+ label: "descLfWriteSlackBus"
82
+ },
83
+ {
84
+ name: DISTRIBUTED_SLACK,
85
+ type: ParameterType.BOOLEAN,
86
+ label: "descLfDistributedSlack"
87
+ },
88
+ {
89
+ name: SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON,
90
+ type: ParameterType.BOOLEAN,
91
+ label: "descLfShuntCompensatorVoltageControlOn"
92
+ },
93
+ {
94
+ name: DC_USE_TRANSFORMER_RATIO,
95
+ type: ParameterType.BOOLEAN,
96
+ label: "descLfDcUseTransformerRatio"
97
+ },
98
+ {
99
+ name: DC_POWER_FACTOR,
100
+ type: ParameterType.DOUBLE,
101
+ label: "descLfDcPowerFactor"
102
+ }
103
+ ];
104
+ function LoadFlowAdvancedParameters() {
105
+ return /* @__PURE__ */ jsx(Fragment, { children: advancedParams.map((item) => /* @__PURE__ */ createElement(ParameterField, { id: ADVANCED_PARAMETERS, ...item, key: item.name })) });
106
+ }
107
+ const LoadFlowAdvancedParameters$1 = memo(LoadFlowAdvancedParameters);
108
+ export {
109
+ advancedParams,
110
+ LoadFlowAdvancedParameters$1 as default
111
+ };
@@ -1,8 +1,9 @@
1
- import { SpecificParameterInfos } from '../../../utils/types/parameters.type';
2
- interface LoadFlowGeneralParametersProps {
3
- provider: string;
4
- specificParams: SpecificParameterInfos[];
5
- }
6
- declare function LoadFlowGeneralParameters({ provider, specificParams }: Readonly<LoadFlowGeneralParametersProps>): import("react").JSX.Element;
1
+ /**
2
+ * Copyright (c) 2024, RTE (http://www.rte-france.com)
3
+ * This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
+ */
7
+ declare function LoadFlowGeneralParameters(): import("react").JSX.Element;
7
8
  declare const _default: import('react').MemoExoticComponent<typeof LoadFlowGeneralParameters>;
8
9
  export default _default;