@gridsuite/commons-ui 0.245.0 → 0.247.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 (65) hide show
  1. package/dist/components/composite/agGridTable/BottomTableButtons.js +8 -23
  2. package/dist/components/composite/agGridTable/agGridTable-utils.d.ts +0 -1
  3. package/dist/components/composite/filter/expert/expertFilterConstants.js +12 -0
  4. package/dist/components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js +75 -64
  5. package/dist/components/index.js +4 -0
  6. package/dist/components/ui/csvDownloader/csv-download-button.d.ts +11 -0
  7. package/dist/components/ui/csvDownloader/csv-download-button.js +28 -0
  8. package/dist/components/ui/csvDownloader/export-csv-button.d.ts +3 -2
  9. package/dist/components/ui/csvDownloader/export-csv-button.js +2 -1
  10. package/dist/components/ui/csvDownloader/index.d.ts +1 -0
  11. package/dist/components/ui/csvDownloader/index.js +2 -0
  12. package/dist/components/ui/csvPicker/csv-picker.js +10 -24
  13. package/dist/components/ui/index.js +4 -0
  14. package/dist/components/ui/reactHookForm/index.js +2 -0
  15. package/dist/components/ui/reactHookForm/utils/CancelButton.d.ts +1 -1
  16. package/dist/components/ui/reactHookForm/utils/CancelButton.js +3 -4
  17. package/dist/components/ui/reactHookForm/utils/CloseButton.d.ts +2 -0
  18. package/dist/components/ui/reactHookForm/utils/CloseButton.js +9 -0
  19. package/dist/components/ui/reactHookForm/utils/index.d.ts +1 -0
  20. package/dist/components/ui/reactHookForm/utils/index.js +2 -0
  21. package/dist/features/index.js +2 -1
  22. package/dist/features/parameters/common/constants.d.ts +1 -0
  23. package/dist/features/parameters/common/constants.js +2 -0
  24. package/dist/features/parameters/common/index.js +2 -1
  25. package/dist/features/parameters/common/parameter-field.d.ts +2 -1
  26. package/dist/features/parameters/common/parameter-field.js +25 -6
  27. package/dist/features/parameters/index.js +2 -1
  28. package/dist/features/parameters/loadflow/load-flow-advanced-parameters.d.ts +5 -0
  29. package/dist/features/parameters/loadflow/load-flow-advanced-parameters.js +111 -0
  30. package/dist/features/parameters/loadflow/load-flow-general-parameters.d.ts +7 -6
  31. package/dist/features/parameters/loadflow/load-flow-general-parameters.js +8 -93
  32. package/dist/features/parameters/loadflow/load-flow-parameters-content.d.ts +1 -1
  33. package/dist/features/parameters/loadflow/load-flow-parameters-content.js +6 -2
  34. package/dist/features/parameters/loadflow/load-flow-parameters-form.js +2 -1
  35. package/dist/features/parameters/loadflow/load-flow-parameters-header.d.ts +2 -1
  36. package/dist/features/parameters/loadflow/load-flow-parameters-header.js +21 -1
  37. package/dist/features/parameters/loadflow/load-flow-parameters-type.d.ts +2 -1
  38. package/dist/features/parameters/loadflow/load-flow-parameters-utils.d.ts +22 -8
  39. package/dist/features/parameters/loadflow/load-flow-parameters-utils.js +39 -5
  40. package/dist/features/parameters/loadflow/load-flow-provider-specific-parameters.d.ts +7 -0
  41. package/dist/features/parameters/loadflow/load-flow-provider-specific-parameters.js +47 -0
  42. package/dist/features/parameters/loadflow/use-load-flow-parameters-form.js +28 -6
  43. package/dist/features/parameters/security-analysis/security-analysis-parameters-selector.js +1 -0
  44. package/dist/features/process-configs/security-analysis/update-sa-process-config.js +1 -0
  45. package/dist/features/topBar/AboutDialog.js +3 -2
  46. package/dist/features/topBar/UserInformationDialog.js +2 -2
  47. package/dist/features/topBar/UserSettingsDialog.js +3 -2
  48. package/dist/index.js +6 -1
  49. package/dist/translations/en/commonButtonEn.d.ts +1 -0
  50. package/dist/translations/en/commonButtonEn.js +1 -0
  51. package/dist/translations/en/csvEn.js +3 -3
  52. package/dist/translations/en/parameters.d.ts +3 -2
  53. package/dist/translations/en/parameters.js +4 -3
  54. package/dist/translations/en/topBarEn.d.ts +0 -1
  55. package/dist/translations/en/topBarEn.js +1 -2
  56. package/dist/translations/fr/commonButtonFr.d.ts +1 -0
  57. package/dist/translations/fr/commonButtonFr.js +1 -0
  58. package/dist/translations/fr/csvFr.js +3 -3
  59. package/dist/translations/fr/parameters.d.ts +3 -2
  60. package/dist/translations/fr/parameters.js +4 -3
  61. package/dist/translations/fr/topBarFr.d.ts +0 -1
  62. package/dist/translations/fr/topBarFr.js +1 -2
  63. package/dist/utils/types/equipmentType.js +7 -0
  64. package/dist/utils/types/parameters.type.d.ts +1 -0
  65. package/package.json +1 -1
@@ -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;
@@ -1,12 +1,11 @@
1
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
1
+ import { jsx, Fragment } from "react/jsx-runtime";
2
2
  import { memo, createElement } from "react";
3
3
  import ParameterField from "../common/parameter-field.js";
4
- import { PHASE_SHIFTER_REGULATION_ON, DC, BALANCE_TYPE, COUNTRIES_TO_BALANCE, CONNECTED_MODE, HVDC_AC_EMULATION, 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 { useLoadFlowContext } from "./use-load-flow-context.js";
4
+ import { PHASE_SHIFTER_REGULATION_ON, DC, BALANCE_TYPE, COUNTRIES_TO_BALANCE, CONNECTED_MODE, HVDC_AC_EMULATION } from "./constants.js";
6
5
  import { ParameterType } from "../../../utils/types/parameters.type.js";
7
6
  import "@mui/material";
8
- import "react-intl";
9
7
  import "@mui/icons-material";
8
+ import "react-intl";
10
9
  import "../../../components/ui/overflowableText/OverflowableText.js";
11
10
  import "../../../utils/conversionUtils.js";
12
11
  import "../../../utils/types/equipmentType.js";
@@ -33,10 +32,9 @@ import "../../../components/ui/snackbarProvider/SnackbarProvider.js";
33
32
  import "mui-nested-menu";
34
33
  import "react-resizable-panels";
35
34
  import "react-papaparse";
36
- import { ParameterGroup } from "../common/widget/parameter-group.js";
37
- import "../common/widget/parameter-line-slider.js";
38
35
  import "../common/parameter-layout/parameter-layout-provider.js";
39
- import { COMMON_PARAMETERS, SPECIFIC_PARAMETERS } from "../common/constants.js";
36
+ import { COMMON_PARAMETERS } from "../common/constants.js";
37
+ import "../common/widget/parameter-line-slider.js";
40
38
  import "../common/limitreductions/columns-definitions.js";
41
39
  import "../common/contingency-table/contingency-table.js";
42
40
  import "../common/contingency-table/columns-definitions.js";
@@ -67,6 +65,7 @@ const basicParams = [
67
65
  {
68
66
  name: COUNTRIES_TO_BALANCE,
69
67
  type: ParameterType.COUNTRIES,
68
+ inputLabel: "inputLabelLfCountriesToBalance",
70
69
  label: "descLfCountriesToBalance"
71
70
  },
72
71
  {
@@ -94,92 +93,8 @@ const basicParams = [
94
93
  label: "descLfHvdcAcEmulation"
95
94
  }
96
95
  ];
97
- const advancedParams = [
98
- {
99
- name: VOLTAGE_INIT_MODE,
100
- type: ParameterType.STRING,
101
- label: "descLfVoltageInitMode",
102
- possibleValues: [
103
- {
104
- id: "UNIFORM_VALUES",
105
- label: "descLfUniformValues"
106
- },
107
- {
108
- id: "PREVIOUS_VALUES",
109
- label: "descLfPreviousValues"
110
- },
111
- {
112
- id: "DC_VALUES",
113
- label: "descLfDcValues"
114
- }
115
- ]
116
- },
117
- {
118
- name: USE_REACTIVE_LIMITS,
119
- type: ParameterType.BOOLEAN,
120
- label: "descLfUseReactiveLimits"
121
- },
122
- {
123
- name: TWT_SPLIT_SHUNT_ADMITTANCE,
124
- type: ParameterType.BOOLEAN,
125
- label: "descLfTwtSplitShuntAdmittance"
126
- },
127
- {
128
- name: READ_SLACK_BUS,
129
- type: ParameterType.BOOLEAN,
130
- label: "descLfReadSlackBus"
131
- },
132
- {
133
- name: WRITE_SLACK_BUS,
134
- type: ParameterType.BOOLEAN,
135
- label: "descLfWriteSlackBus"
136
- },
137
- {
138
- name: DISTRIBUTED_SLACK,
139
- type: ParameterType.BOOLEAN,
140
- label: "descLfDistributedSlack"
141
- },
142
- {
143
- name: SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON,
144
- type: ParameterType.BOOLEAN,
145
- label: "descLfShuntCompensatorVoltageControlOn"
146
- },
147
- {
148
- name: DC_USE_TRANSFORMER_RATIO,
149
- type: ParameterType.BOOLEAN,
150
- label: "descLfDcUseTransformerRatio"
151
- },
152
- {
153
- name: DC_POWER_FACTOR,
154
- type: ParameterType.DOUBLE,
155
- label: "descLfDcPowerFactor"
156
- }
157
- ];
158
- function LoadFlowGeneralParameters({ provider, specificParams }) {
159
- const { showAdvancedLfParams, setShowAdvancedLfParams, showSpecificLfParams, setShowSpecificLfParams } = useLoadFlowContext();
160
- return /* @__PURE__ */ jsxs(Fragment, { children: [
161
- basicParams.map((item) => /* @__PURE__ */ createElement(ParameterField, { id: COMMON_PARAMETERS, ...item, key: item.name })),
162
- /* @__PURE__ */ jsx(
163
- ParameterGroup,
164
- {
165
- label: "showAdvancedParameters",
166
- state: showAdvancedLfParams,
167
- onClick: setShowAdvancedLfParams,
168
- children: showAdvancedLfParams && advancedParams.map((item) => /* @__PURE__ */ createElement(ParameterField, { id: COMMON_PARAMETERS, ...item, key: item.name }))
169
- }
170
- ),
171
- /* @__PURE__ */ jsx(
172
- ParameterGroup,
173
- {
174
- label: "showSpecificParameters",
175
- state: showSpecificLfParams,
176
- onClick: setShowSpecificLfParams,
177
- infoText: provider ?? "",
178
- disabled: !provider || !specificParams,
179
- children: showSpecificLfParams && specificParams?.map((item) => /* @__PURE__ */ createElement(ParameterField, { id: SPECIFIC_PARAMETERS, ...item, key: item.name }))
180
- }
181
- )
182
- ] });
96
+ function LoadFlowGeneralParameters() {
97
+ return /* @__PURE__ */ jsx(Fragment, { children: basicParams.map((item) => /* @__PURE__ */ createElement(ParameterField, { id: COMMON_PARAMETERS, ...item, key: item.name })) });
183
98
  }
184
99
  const LoadFlowGeneralParameters$1 = memo(LoadFlowGeneralParameters);
185
100
  export {
@@ -5,7 +5,7 @@ import { LoadFlowParametersInfos } from '../../../utils/types/loadflow.type';
5
5
  type LoadFlowParametersContentProps = {
6
6
  selectedTab: TabValues;
7
7
  currentProvider: string;
8
- specificParameters: SpecificParameterInfos[];
8
+ specificParameters?: SpecificParameterInfos[];
9
9
  params: LoadFlowParametersInfos | null;
10
10
  defaultLimitReductions: ILimitReductionsByVoltageLevel[];
11
11
  };
@@ -1,7 +1,9 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Box, Grid2 } from "@mui/material";
3
3
  import { TabValues } from "./load-flow-parameters-utils.js";
4
+ import LoadFlowAdvancedParameters from "./load-flow-advanced-parameters.js";
4
5
  import LoadFlowGeneralParameters from "./load-flow-general-parameters.js";
6
+ import LoadFlowProviderSpecificParameters from "./load-flow-provider-specific-parameters.js";
5
7
  import "@mui/icons-material";
6
8
  import "react";
7
9
  import "react-intl";
@@ -64,7 +66,7 @@ function LoadFlowParametersContent({
64
66
  defaultLimitReductions
65
67
  }) {
66
68
  return /* @__PURE__ */ jsx(Box, { sx: styles.wrapper, children: /* @__PURE__ */ jsx(Grid2, { container: true, sx: styles.container, children: /* @__PURE__ */ jsxs(Grid2, { sx: styles.maxWidth, children: [
67
- /* @__PURE__ */ jsx(TabPanel, { value: selectedTab, index: TabValues.GENERAL, children: /* @__PURE__ */ jsx(LoadFlowGeneralParameters, { provider: currentProvider, specificParams: specificParameters }) }),
69
+ /* @__PURE__ */ jsx(TabPanel, { value: selectedTab, index: TabValues.GENERAL, children: /* @__PURE__ */ jsx(LoadFlowGeneralParameters, {}) }),
68
70
  /* @__PURE__ */ jsx(TabPanel, { value: selectedTab, index: TabValues.LIMIT_REDUCTIONS, children: /* @__PURE__ */ jsx(Grid2, { container: true, sx: { width: "100%" }, children: currentProvider === PARAM_PROVIDER_OPENLOADFLOW ? /* @__PURE__ */ jsx(LimitReductionsTableForm, { limits: params?.limitReductions ?? defaultLimitReductions }) : /* @__PURE__ */ jsx(
69
71
  ParameterLineSlider,
70
72
  {
@@ -74,7 +76,9 @@ function LoadFlowParametersContent({
74
76
  minValue: MIN_VALUE_ALLOWED_FOR_LIMIT_REDUCTION,
75
77
  maxValue: MAX_VALUE_ALLOWED_FOR_LIMIT_REDUCTION
76
78
  }
77
- ) }) })
79
+ ) }) }),
80
+ /* @__PURE__ */ jsx(TabPanel, { value: selectedTab, index: TabValues.ADVANCED, children: /* @__PURE__ */ jsx(LoadFlowAdvancedParameters, {}) }),
81
+ /* @__PURE__ */ jsx(TabPanel, { value: selectedTab, index: TabValues.PROVIDER_SPECIFIC, children: /* @__PURE__ */ jsx(LoadFlowProviderSpecificParameters, { specificParameters }) })
78
82
  ] }) }) });
79
83
  }
80
84
  export {
@@ -21,7 +21,8 @@ function LoadFlowParametersForm({ loadflowMethods }) {
21
21
  selectedTab,
22
22
  handleTabChange,
23
23
  tabIndexesWithError,
24
- formattedProviders
24
+ formattedProviders,
25
+ disableSpecificProviderParams: !watchProvider || !specificParametersDescriptionForProvider
25
26
  }
26
27
  ) }),
27
28
  /* @__PURE__ */ jsx(Grid2, { size: 12, children: /* @__PURE__ */ jsx(
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  import { TabValues } from './load-flow-parameters-utils';
3
- declare function LoadFlowParametersHeader({ selectedTab, handleTabChange, tabIndexesWithError, formattedProviders, }: Readonly<{
3
+ declare function LoadFlowParametersHeader({ selectedTab, handleTabChange, tabIndexesWithError, formattedProviders, disableSpecificProviderParams, }: Readonly<{
4
4
  selectedTab: string;
5
5
  handleTabChange: (event: React.SyntheticEvent, newValue: TabValues) => void;
6
6
  tabIndexesWithError: TabValues[];
@@ -8,5 +8,6 @@ declare function LoadFlowParametersHeader({ selectedTab, handleTabChange, tabInd
8
8
  id: string;
9
9
  label: string;
10
10
  }[];
11
+ disableSpecificProviderParams: boolean;
11
12
  }>): React.JSX.Element;
12
13
  export default LoadFlowParametersHeader;
@@ -43,7 +43,8 @@ function LoadFlowParametersHeader({
43
43
  selectedTab,
44
44
  handleTabChange,
45
45
  tabIndexesWithError,
46
- formattedProviders
46
+ formattedProviders,
47
+ disableSpecificProviderParams
47
48
  }) {
48
49
  return /* @__PURE__ */ jsxs(Stack, { children: [
49
50
  /* @__PURE__ */ jsx(ProviderParam, { options: formattedProviders, id: "Lf" }),
@@ -65,6 +66,25 @@ function LoadFlowParametersHeader({
65
66
  sx: getTabStyle(tabIndexesWithError, TabValues.LIMIT_REDUCTIONS),
66
67
  "data-testid": "LfLimitReductionsTab"
67
68
  }
69
+ ),
70
+ /* @__PURE__ */ jsx(
71
+ Tab,
72
+ {
73
+ label: /* @__PURE__ */ jsx(FormattedMessage, { id: TabValues.ADVANCED }),
74
+ value: TabValues.ADVANCED,
75
+ sx: getTabStyle(tabIndexesWithError, TabValues.ADVANCED),
76
+ "data-testid": "LfAdvancedTab"
77
+ }
78
+ ),
79
+ /* @__PURE__ */ jsx(
80
+ Tab,
81
+ {
82
+ label: /* @__PURE__ */ jsx(FormattedMessage, { id: TabValues.PROVIDER_SPECIFIC }),
83
+ value: TabValues.PROVIDER_SPECIFIC,
84
+ sx: getTabStyle(tabIndexesWithError, TabValues.PROVIDER_SPECIFIC),
85
+ "data-testid": "LfProviderSpecificTab",
86
+ disabled: disableSpecificProviderParams
87
+ }
68
88
  )
69
89
  ] })
70
90
  ] });
@@ -1,11 +1,12 @@
1
1
  import { UUID } from 'node:crypto';
2
2
  import { ILimitReductionsByVoltageLevel } from '../common';
3
3
  import { SpecificParametersPerProvider } from '../../../utils';
4
+ export type ParameterValue = boolean | string | string[] | number;
4
5
  export interface LoadFlowParametersInfos {
5
6
  uuid?: UUID;
6
7
  provider: string;
7
8
  limitReduction: number;
8
- commonParameters: Record<string, boolean | string | string[] | number>;
9
+ commonParameters: Record<string, ParameterValue>;
9
10
  specificParametersPerProvider: SpecificParametersPerProvider;
10
11
  limitReductions: ILimitReductionsByVoltageLevel[];
11
12
  }
@@ -1,8 +1,11 @@
1
1
  import { UseFormReturn } from 'react-hook-form';
2
2
  import { ILimitReductionsByVoltageLevel } from '../common';
3
+ import { ParameterValue } from './load-flow-parameters-type';
3
4
  import * as yup from 'yup';
4
5
  export declare enum TabValues {
5
6
  GENERAL = "General",
7
+ ADVANCED = "Advanced",
8
+ PROVIDER_SPECIFIC = "ProviderSpecific",
6
9
  LIMIT_REDUCTIONS = "LimitReductions"
7
10
  }
8
11
  export declare const getBasicLoadFlowParametersFormSchema: () => yup.ObjectSchema<{
@@ -20,7 +23,7 @@ export declare const getBasicLoadFlowParametersFormSchema: () => yup.ObjectSchem
20
23
  componentMode: undefined;
21
24
  hvdcAcEmulation: undefined;
22
25
  }, "">;
23
- export declare const getAdvancedLoadFlowParametersFormSchema: () => yup.ObjectSchema<{
26
+ export declare const getAdvancedLoadFlowParametersFormSchemaFields: () => yup.ObjectSchema<{
24
27
  voltageInitMode: string;
25
28
  useReactiveLimits: NonNullable<boolean | undefined>;
26
29
  twtSplitShuntAdmittance: NonNullable<boolean | undefined>;
@@ -49,6 +52,19 @@ export declare const getCommonLoadFlowParametersFormSchema: () => yup.ObjectSche
49
52
  countriesToBalance?: unknown;
50
53
  componentMode?: unknown;
51
54
  hvdcAcEmulation?: unknown;
55
+ };
56
+ }, yup.AnyObject, {
57
+ commonParameters: {
58
+ phaseShifterRegulationOn: undefined;
59
+ dc: undefined;
60
+ balanceType: undefined;
61
+ countriesToBalance: undefined;
62
+ componentMode: undefined;
63
+ hvdcAcEmulation: undefined;
64
+ };
65
+ }, "">;
66
+ export declare const getAdvancedLoadFlowParametersFormSchema: () => yup.ObjectSchema<{
67
+ advancedParameters: {
52
68
  voltageInitMode?: unknown;
53
69
  useReactiveLimits?: unknown;
54
70
  twtSplitShuntAdmittance?: unknown;
@@ -60,7 +76,7 @@ export declare const getCommonLoadFlowParametersFormSchema: () => yup.ObjectSche
60
76
  dcPowerFactor?: unknown;
61
77
  };
62
78
  }, yup.AnyObject, {
63
- commonParameters: {
79
+ advancedParameters: {
64
80
  voltageInitMode: undefined;
65
81
  useReactiveLimits: undefined;
66
82
  twtSplitShuntAdmittance: undefined;
@@ -70,13 +86,11 @@ export declare const getCommonLoadFlowParametersFormSchema: () => yup.ObjectSche
70
86
  shuntCompensatorVoltageControlOn: undefined;
71
87
  dcUseTransformerRatio: undefined;
72
88
  dcPowerFactor: undefined;
73
- phaseShifterRegulationOn: undefined;
74
- dc: undefined;
75
- balanceType: undefined;
76
- countriesToBalance: undefined;
77
- componentMode: undefined;
78
- hvdcAcEmulation: undefined;
79
89
  };
80
90
  }, "">;
81
91
  export declare const setLimitReductions: (provider: string, defaultLimitReductions: ILimitReductionsByVoltageLevel[], formMethods: UseFormReturn) => void;
82
92
  export declare const mapLimitReductions: (vlLimits: ILimitReductionsByVoltageLevel, formLimits: Record<string, unknown>[], indexVl: number) => ILimitReductionsByVoltageLevel;
93
+ export declare function splitCommonParameters(commonParameters?: Record<string, ParameterValue>): {
94
+ advancedParameters: Record<string, ParameterValue>;
95
+ commonParameters: Record<string, ParameterValue>;
96
+ };
@@ -30,7 +30,7 @@ import "mui-nested-menu";
30
30
  import "react-resizable-panels";
31
31
  import "react-papaparse";
32
32
  import "../common/parameter-layout/parameter-layout-provider.js";
33
- import { COMMON_PARAMETERS } from "../common/constants.js";
33
+ import { ADVANCED_PARAMETERS, COMMON_PARAMETERS } from "../common/constants.js";
34
34
  import "../common/widget/parameter-line-slider.js";
35
35
  import { IST_FORM, LIMIT_DURATION_FORM, LIMIT_REDUCTIONS_FORM, toFormValuesLimitReductions } from "../common/limitreductions/columns-definitions.js";
36
36
  import "../common/contingency-table/contingency-table.js";
@@ -38,8 +38,11 @@ import "../common/contingency-table/columns-definitions.js";
38
38
  import "@hookform/resolvers/yup";
39
39
  import "../../../components/composite/filter/HeaderFilterForm.js";
40
40
  import { DC_POWER_FACTOR, DC_USE_TRANSFORMER_RATIO, SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON, DISTRIBUTED_SLACK, WRITE_SLACK_BUS, READ_SLACK_BUS, TWT_SPLIT_SHUNT_ADMITTANCE, USE_REACTIVE_LIMITS, VOLTAGE_INIT_MODE, HVDC_AC_EMULATION, CONNECTED_MODE, COUNTRIES_TO_BALANCE, BALANCE_TYPE, DC, PHASE_SHIFTER_REGULATION_ON, PARAM_PROVIDER_OPENLOADFLOW, PARAM_LIMIT_REDUCTION, DEFAULT_LIMIT_REDUCTION_VALUE } from "./constants.js";
41
+ import { advancedParams } from "./load-flow-advanced-parameters.js";
41
42
  var TabValues = /* @__PURE__ */ ((TabValues2) => {
42
43
  TabValues2["GENERAL"] = "General";
44
+ TabValues2["ADVANCED"] = "Advanced";
45
+ TabValues2["PROVIDER_SPECIFIC"] = "ProviderSpecific";
43
46
  TabValues2["LIMIT_REDUCTIONS"] = "LimitReductions";
44
47
  return TabValues2;
45
48
  })(TabValues || {});
@@ -53,7 +56,7 @@ const getBasicLoadFlowParametersFormSchema = () => {
53
56
  [HVDC_AC_EMULATION]: yup.boolean().required()
54
57
  });
55
58
  };
56
- const getAdvancedLoadFlowParametersFormSchema = () => {
59
+ const getAdvancedLoadFlowParametersFormSchemaFields = () => {
57
60
  return yup.object().shape({
58
61
  [VOLTAGE_INIT_MODE]: yup.string().required(),
59
62
  [USE_REACTIVE_LIMITS]: yup.boolean().required(),
@@ -69,8 +72,14 @@ const getAdvancedLoadFlowParametersFormSchema = () => {
69
72
  const getCommonLoadFlowParametersFormSchema = () => {
70
73
  return yup.object().shape({
71
74
  [COMMON_PARAMETERS]: yup.object().shape({
72
- ...getBasicLoadFlowParametersFormSchema().fields,
73
- ...getAdvancedLoadFlowParametersFormSchema().fields
75
+ ...getBasicLoadFlowParametersFormSchema().fields
76
+ })
77
+ });
78
+ };
79
+ const getAdvancedLoadFlowParametersFormSchema = () => {
80
+ return yup.object().shape({
81
+ [ADVANCED_PARAMETERS]: yup.object().shape({
82
+ ...getAdvancedLoadFlowParametersFormSchemaFields().fields
74
83
  })
75
84
  });
76
85
  };
@@ -100,11 +109,36 @@ const mapLimitReductions = (vlLimits, formLimits, indexVl) => {
100
109
  });
101
110
  return vlLNewLimits;
102
111
  };
112
+ function splitCommonParameters(commonParameters) {
113
+ if (!commonParameters) {
114
+ return {
115
+ advancedParameters: {},
116
+ commonParameters: {}
117
+ };
118
+ }
119
+ const advancedParamNames = new Set(advancedParams.map((param) => param.name));
120
+ return Object.entries(commonParameters).reduce(
121
+ (acc, [key, value]) => {
122
+ if (advancedParamNames.has(key)) {
123
+ acc.advancedParameters[key] = value;
124
+ } else {
125
+ acc.commonParameters[key] = value;
126
+ }
127
+ return acc;
128
+ },
129
+ {
130
+ advancedParameters: {},
131
+ commonParameters: {}
132
+ }
133
+ );
134
+ }
103
135
  export {
104
136
  TabValues,
105
137
  getAdvancedLoadFlowParametersFormSchema,
138
+ getAdvancedLoadFlowParametersFormSchemaFields,
106
139
  getBasicLoadFlowParametersFormSchema,
107
140
  getCommonLoadFlowParametersFormSchema,
108
141
  mapLimitReductions,
109
- setLimitReductions
142
+ setLimitReductions,
143
+ splitCommonParameters
110
144
  };
@@ -0,0 +1,7 @@
1
+ import { SpecificParameterInfos } from '../../../utils';
2
+ interface LoadFlowProviderSpecificParametersProps {
3
+ specificParameters?: SpecificParameterInfos[];
4
+ }
5
+ declare function LoadFlowProviderSpecificParameters({ specificParameters }: Readonly<LoadFlowProviderSpecificParametersProps>): import("react").JSX.Element;
6
+ declare const _default: import('react').MemoExoticComponent<typeof LoadFlowProviderSpecificParameters>;
7
+ export default _default;