@gridsuite/commons-ui 0.101.0 → 0.102.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.
- package/dist/components/parameters/loadflow/load-flow-parameters-content.js +18 -23
- package/dist/components/parameters/loadflow/load-flow-parameters-dialog.d.ts +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-dialog.js +6 -0
- package/dist/components/parameters/loadflow/load-flow-parameters-form.js +51 -50
- package/dist/translations/en/parameters.js +1 -1
- package/dist/translations/fr/parameters.js +1 -1
- package/package.json +1 -1
|
@@ -44,6 +44,11 @@ const styles = {
|
|
|
44
44
|
},
|
|
45
45
|
maxWidth: {
|
|
46
46
|
width: "100%"
|
|
47
|
+
},
|
|
48
|
+
wrapper: {
|
|
49
|
+
flexGrow: 1,
|
|
50
|
+
overflow: "auto",
|
|
51
|
+
paddingLeft: 1
|
|
47
52
|
}
|
|
48
53
|
};
|
|
49
54
|
function LoadFlowParametersContent({
|
|
@@ -53,29 +58,19 @@ function LoadFlowParametersContent({
|
|
|
53
58
|
params,
|
|
54
59
|
defaultLimitReductions
|
|
55
60
|
}) {
|
|
56
|
-
return /* @__PURE__ */ jsx(
|
|
57
|
-
|
|
58
|
-
{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
name: PARAM_LIMIT_REDUCTION,
|
|
70
|
-
label: "LimitReduction",
|
|
71
|
-
marks: alertThresholdMarks,
|
|
72
|
-
minValue: MIN_VALUE_ALLOWED_FOR_LIMIT_REDUCTION,
|
|
73
|
-
maxValue: MAX_VALUE_ALLOWED_FOR_LIMIT_REDUCTION
|
|
74
|
-
}
|
|
75
|
-
) }) })
|
|
76
|
-
] }) })
|
|
77
|
-
}
|
|
78
|
-
);
|
|
61
|
+
return /* @__PURE__ */ jsx(Box, { sx: styles.wrapper, children: /* @__PURE__ */ jsx(Grid, { container: true, sx: styles.container, children: /* @__PURE__ */ jsxs(Grid, { item: true, sx: styles.maxWidth, children: [
|
|
62
|
+
/* @__PURE__ */ jsx(TabPanel, { value: selectedTab, index: TabValues.GENERAL, children: /* @__PURE__ */ jsx(LoadFlowGeneralParameters, { provider: currentProvider, specificParams: specificParameters }) }),
|
|
63
|
+
/* @__PURE__ */ jsx(TabPanel, { value: selectedTab, index: TabValues.LIMIT_REDUCTIONS, children: /* @__PURE__ */ jsx(Grid, { container: true, sx: { width: "100%" }, children: currentProvider === PARAM_PROVIDER_OPENLOADFLOW ? /* @__PURE__ */ jsx(LimitReductionsTableForm, { limits: (params == null ? void 0 : params.limitReductions) ?? defaultLimitReductions }) : /* @__PURE__ */ jsx(
|
|
64
|
+
ParameterLineSlider,
|
|
65
|
+
{
|
|
66
|
+
name: PARAM_LIMIT_REDUCTION,
|
|
67
|
+
label: "LimitReduction",
|
|
68
|
+
marks: alertThresholdMarks,
|
|
69
|
+
minValue: MIN_VALUE_ALLOWED_FOR_LIMIT_REDUCTION,
|
|
70
|
+
maxValue: MAX_VALUE_ALLOWED_FOR_LIMIT_REDUCTION
|
|
71
|
+
}
|
|
72
|
+
) }) })
|
|
73
|
+
] }) }) });
|
|
79
74
|
}
|
|
80
75
|
export {
|
|
81
76
|
LoadFlowParametersContent as default
|
|
@@ -70,6 +70,10 @@ function LoadFlowParametersEditionDialog({
|
|
|
70
70
|
getLoadFlowDefaultLimitReductions
|
|
71
71
|
);
|
|
72
72
|
const loadflowMethods = useLoadFlowParametersForm(parametersBackend, enableDeveloperMode, id, name, description);
|
|
73
|
+
const {
|
|
74
|
+
formState: { errors, dirtyFields }
|
|
75
|
+
} = loadflowMethods.formMethods;
|
|
76
|
+
const disableSave = Object.keys(errors).length > 0 || Object.keys(dirtyFields).length === 0;
|
|
73
77
|
return /* @__PURE__ */ jsx(
|
|
74
78
|
CustomMuiDialog,
|
|
75
79
|
{
|
|
@@ -82,6 +86,7 @@ function LoadFlowParametersEditionDialog({
|
|
|
82
86
|
titleId,
|
|
83
87
|
removeOptional: true,
|
|
84
88
|
language,
|
|
89
|
+
disabledSave: disableSave,
|
|
85
90
|
children: /* @__PURE__ */ jsx(LoadFlowProvider, { children: /* @__PURE__ */ jsx(
|
|
86
91
|
LoadFlowParametersForm,
|
|
87
92
|
{
|
|
@@ -92,6 +97,7 @@ function LoadFlowParametersEditionDialog({
|
|
|
92
97
|
UniqueNameInput,
|
|
93
98
|
{
|
|
94
99
|
name: FieldConstants.NAME,
|
|
100
|
+
currentName: name,
|
|
95
101
|
label: "nameProperty",
|
|
96
102
|
elementType: ElementType.LOADFLOW_PARAMETERS,
|
|
97
103
|
activeDirectory,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Box, LinearProgress } from "@mui/material";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Grid, LinearProgress } from "@mui/material";
|
|
3
3
|
import LoadFlowParametersHeader from "./load-flow-parameters-header.js";
|
|
4
4
|
import LoadFlowParametersContent from "./load-flow-parameters-content.js";
|
|
5
5
|
import "react-intl";
|
|
@@ -29,6 +29,31 @@ import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
|
29
29
|
import "uuid";
|
|
30
30
|
import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
31
31
|
import "react-querybuilder";
|
|
32
|
+
const styles = {
|
|
33
|
+
form: {
|
|
34
|
+
height: "100%",
|
|
35
|
+
display: "flex",
|
|
36
|
+
position: "relative",
|
|
37
|
+
flexDirection: "column"
|
|
38
|
+
},
|
|
39
|
+
loadflowParameters: {
|
|
40
|
+
flexGrow: 1,
|
|
41
|
+
paddingLeft: 1,
|
|
42
|
+
overflow: "auto"
|
|
43
|
+
},
|
|
44
|
+
actions: {
|
|
45
|
+
flexGrow: 0
|
|
46
|
+
},
|
|
47
|
+
content: (theme) => ({
|
|
48
|
+
overflowY: "auto",
|
|
49
|
+
overflowX: "hidden",
|
|
50
|
+
maxHeight: "calc(100% - 15vh)",
|
|
51
|
+
paddingRight: theme.spacing(2),
|
|
52
|
+
paddingTop: theme.spacing(2),
|
|
53
|
+
paddingBottom: theme.spacing(1),
|
|
54
|
+
flexGrow: 1
|
|
55
|
+
})
|
|
56
|
+
};
|
|
32
57
|
function LoadFlowParametersForm({
|
|
33
58
|
loadflowMethods,
|
|
34
59
|
renderTitleFields,
|
|
@@ -47,55 +72,31 @@ function LoadFlowParametersForm({
|
|
|
47
72
|
defaultLimitReductions,
|
|
48
73
|
paramsLoaded
|
|
49
74
|
} = loadflowMethods;
|
|
50
|
-
return /* @__PURE__ */
|
|
75
|
+
return /* @__PURE__ */ jsx(CustomFormProvider, { validationSchema: formSchema, ...formMethods, removeOptional: true, children: /* @__PURE__ */ jsxs(Box, { sx: styles.form, children: [
|
|
51
76
|
renderTitleFields == null ? void 0 : renderTitleFields(),
|
|
52
|
-
/* @__PURE__ */ jsxs(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
selectedTab,
|
|
76
|
-
handleTabChange,
|
|
77
|
-
tabIndexesWithError,
|
|
78
|
-
formattedProviders
|
|
79
|
-
}
|
|
80
|
-
),
|
|
81
|
-
/* @__PURE__ */ jsx(
|
|
82
|
-
LoadFlowParametersContent,
|
|
83
|
-
{
|
|
84
|
-
selectedTab,
|
|
85
|
-
currentProvider: currentProvider ?? "",
|
|
86
|
-
specificParameters,
|
|
87
|
-
params,
|
|
88
|
-
defaultLimitReductions
|
|
89
|
-
}
|
|
90
|
-
)
|
|
91
|
-
]
|
|
92
|
-
}
|
|
93
|
-
) : /* @__PURE__ */ jsx(LinearProgress, {}),
|
|
94
|
-
renderActions == null ? void 0 : renderActions()
|
|
95
|
-
]
|
|
96
|
-
}
|
|
97
|
-
)
|
|
98
|
-
] });
|
|
77
|
+
paramsLoaded ? /* @__PURE__ */ jsxs(Box, { sx: styles.loadflowParameters, children: [
|
|
78
|
+
/* @__PURE__ */ jsx(
|
|
79
|
+
LoadFlowParametersHeader,
|
|
80
|
+
{
|
|
81
|
+
selectedTab,
|
|
82
|
+
handleTabChange,
|
|
83
|
+
tabIndexesWithError,
|
|
84
|
+
formattedProviders
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
/* @__PURE__ */ jsx(Grid, { container: true, sx: styles.content, children: /* @__PURE__ */ jsx(
|
|
88
|
+
LoadFlowParametersContent,
|
|
89
|
+
{
|
|
90
|
+
selectedTab,
|
|
91
|
+
currentProvider: currentProvider ?? "",
|
|
92
|
+
specificParameters,
|
|
93
|
+
params,
|
|
94
|
+
defaultLimitReductions
|
|
95
|
+
}
|
|
96
|
+
) })
|
|
97
|
+
] }) : /* @__PURE__ */ jsx(LinearProgress, {}),
|
|
98
|
+
renderActions && /* @__PURE__ */ jsx(Box, { sx: styles.actions, children: renderActions == null ? void 0 : renderActions() })
|
|
99
|
+
] }) });
|
|
99
100
|
}
|
|
100
101
|
export {
|
|
101
102
|
LoadFlowParametersForm
|
|
@@ -44,7 +44,7 @@ const parametersEn = {
|
|
|
44
44
|
descLfCountries: "Countries",
|
|
45
45
|
descLfAllCountries: "All countries",
|
|
46
46
|
descLfCountriesToBalance: "Countries participating in balancing",
|
|
47
|
-
editParameters: "Edit
|
|
47
|
+
editParameters: "Edit parameters",
|
|
48
48
|
RealPercentage: "This value must be between 0 and 1",
|
|
49
49
|
General: "General",
|
|
50
50
|
LimitReductions: "Limit reductions",
|
|
@@ -44,7 +44,7 @@ const parametersFr = {
|
|
|
44
44
|
descLfCountries: "Pays",
|
|
45
45
|
descLfAllCountries: "Tous les pays",
|
|
46
46
|
descLfCountriesToBalance: "Pays participant à la compensation",
|
|
47
|
-
editParameters: "Éditer
|
|
47
|
+
editParameters: "Éditer les paramètres",
|
|
48
48
|
RealPercentage: "Cette valeur doit être comprise entre 0 et 1",
|
|
49
49
|
General: "Général",
|
|
50
50
|
LimitReductions: "Abattements",
|