@gridsuite/commons-ui 0.239.0 → 0.241.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/README.md +6 -2
- package/dist/components/composite/agGridTable/cellEditors/numericEditor.d.ts +9 -3
- package/dist/components/composite/agGridTable/cellEditors/numericEditor.js +24 -5
- package/dist/components/composite/customAGGrid/custom-aggrid-filters/custom-aggrid-comparator-filter.js +2 -2
- package/dist/components/composite/customAGGrid/custom-aggrid-filters/custom-aggrid-text-filter.js +4 -4
- package/dist/components/composite/customAGGrid/custom-aggrid-filters/custom-filter-icon.js +2 -2
- package/dist/components/composite/customAGGrid/custom-aggrid-header.js +26 -13
- package/dist/components/composite/customAGGrid/custom-aggrid-menu.js +2 -2
- package/dist/components/composite/dnd-table/dnd-table-bottom-left-buttons.js +4 -4
- package/dist/components/composite/dnd-table/dnd-table-bottom-right-buttons.js +6 -6
- package/dist/components/composite/dnd-table/dnd-table.js +4 -4
- package/dist/components/composite/filter/HeaderFilterForm.js +4 -4
- package/dist/components/composite/filter/explicitNaming/ExplicitNamingFilterForm.d.ts +1 -1
- package/dist/components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js +2 -4
- package/dist/components/composite/grid/grid-item.d.ts +4 -3
- package/dist/components/composite/grid/grid-item.js +8 -4
- package/dist/components/composite/grid/grid-section.d.ts +1 -1
- package/dist/components/composite/grid/grid-section.js +3 -3
- package/dist/components/composite/grid/index.js +6 -3
- package/dist/components/composite/index.js +4 -3
- package/dist/components/composite/reactQueryBuilder/PropertyValueEditor.js +5 -5
- package/dist/components/composite/reactQueryBuilder/compositeRuleEditor/GroupValueEditor.js +2 -2
- package/dist/components/composite/reactQueryBuilder/compositeRuleEditor/RuleValueEditor.js +5 -5
- package/dist/components/index.js +4 -3
- package/dist/components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js +9 -9
- package/dist/components/ui/dialogs/modifyElementSelection/ModifyElementSelection.js +3 -3
- package/dist/components/ui/reactHookForm/errorManagement/FieldErrorAlert.js +2 -2
- package/dist/components/ui/reactHookForm/expandableInput/DeletableRow.js +4 -4
- package/dist/components/ui/reactHookForm/expandableInput/ExpandableInput.js +4 -4
- package/dist/components/ui/reactHookForm/numbers/RangeInput.js +5 -5
- package/dist/components/ui/reactHookForm/utils/functions.js +2 -2
- package/dist/features/authentication/AuthenticationRouter.js +2 -2
- package/dist/features/authentication/AuthenticationRouterErrorDisplay.js +3 -3
- package/dist/features/index.js +6 -1
- package/dist/features/network-modifications/battery/creation/BatteryCreationForm.js +7 -7
- package/dist/features/network-modifications/battery/modification/BatteryDialogHeader.js +4 -4
- package/dist/features/network-modifications/battery/modification/BatteryDialogTabsContent.js +8 -8
- package/dist/features/network-modifications/battery/modification/BatteryModificationForm.js +5 -5
- package/dist/features/network-modifications/by-filter/assignment/assignment/assignment-form.js +1 -1
- package/dist/features/network-modifications/by-filter/assignment/modification-by-assignment-form.js +4 -4
- package/dist/features/network-modifications/by-filter/deletion/ByFilterDeletionForm.js +4 -4
- package/dist/features/network-modifications/common/activePowerControl/ActivePowerControlForm.js +1 -1
- package/dist/features/network-modifications/common/connectivity/BranchConnectivityForm.js +1 -1
- package/dist/features/network-modifications/common/connectivity/ConnectivityForm.js +7 -7
- package/dist/features/network-modifications/common/connectivity/PositionForm.js +4 -4
- package/dist/features/network-modifications/common/connectivity/VoltageLevelConnectivityForm.js +4 -4
- package/dist/features/network-modifications/common/measurements/BranchActiveReactivePowerMeasurementsForm.js +4 -3
- package/dist/features/network-modifications/common/measurements/BusbarSectionVoltageMeasurementsForm.js +2 -2
- package/dist/features/network-modifications/common/measurements/PowerMeasurementsForm.js +4 -4
- package/dist/features/network-modifications/common/measurements/PowerWithValidityForm.js +4 -4
- package/dist/features/network-modifications/common/properties/PropertiesForm.js +1 -1
- package/dist/features/network-modifications/common/properties/PropertyForm.js +5 -5
- package/dist/features/network-modifications/common/reactiveLimits/ReactiveLimitsForm.js +3 -3
- package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/ReactiveCapabilityCurveRowForm.js +1 -1
- package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/ReactiveCapabilityCurveTableForm.js +7 -7
- package/dist/features/network-modifications/common/regulatingTerminal/RegulatingTerminalForm.js +2 -2
- package/dist/features/network-modifications/common/setpoints/SetPointsForm.js +5 -5
- package/dist/features/network-modifications/common/shortCircuit/ShortCircuitForm.js +3 -3
- package/dist/features/network-modifications/common/voltageRegulation/VoltageRegulationForm.js +5 -5
- package/dist/features/network-modifications/equipmentDeletion/EquipmentDeletionForm.js +6 -6
- package/dist/features/network-modifications/equipmentDeletion/hvdcLccDeletion/HvdcLccDeletionSpecificForm.js +5 -5
- package/dist/features/network-modifications/equipmentDeletion/hvdcLccDeletion/ShuntCompensatorSelectionForm.js +5 -5
- package/dist/features/network-modifications/generator/creation/GeneratorCreationForm.js +9 -9
- package/dist/features/network-modifications/generator/modification/GeneratorDialogHeader.js +5 -5
- package/dist/features/network-modifications/generator/modification/GeneratorDialogTabsContent.js +9 -9
- package/dist/features/network-modifications/generator/modification/GeneratorModificationForm.js +5 -5
- package/dist/features/network-modifications/load/common/LoadDialogHeader.js +5 -5
- package/dist/features/network-modifications/load/common/LoadDialogTabsContent.js +1 -1
- package/dist/features/network-modifications/load/common/LoadForm.js +5 -5
- package/dist/features/network-modifications/shunt-compensator/common/CharacteristicsForm.js +12 -12
- package/dist/features/network-modifications/shunt-compensator/common/characteristicsForm.utils.d.ts +8 -8
- package/dist/features/network-modifications/shunt-compensator/creation/ShuntCompensatorCreationForm.js +11 -11
- package/dist/features/network-modifications/shunt-compensator/creation/shuntCompensatorCreation.utils.d.ts +12 -12
- package/dist/features/network-modifications/shunt-compensator/modification/ShuntCompensatorModificationForm.js +3 -3
- package/dist/features/network-modifications/shunt-compensator/modification/shuntCompensatorModification.utils.d.ts +12 -12
- package/dist/features/network-modifications/substation/creation/SubstationCreationForm.js +7 -7
- package/dist/features/network-modifications/substation/modification/SubstationModificationForm.js +7 -7
- package/dist/features/network-modifications/voltageLevel/creation/VoltageLevelCreationForm.js +7 -7
- package/dist/features/network-modifications/voltageLevel/creation/tabs/characteristicsTab/CharacteristicsTab.js +9 -9
- package/dist/features/network-modifications/voltageLevel/creation/tabs/structureTab/StructureTab.js +5 -5
- package/dist/features/network-modifications/voltageLevel/creation/tabs/structureTab/couplingOmnibus/CouplingOmnibusCreation.js +3 -3
- package/dist/features/network-modifications/voltageLevel/creation/tabs/structureTab/switchesBetweenSections/SwitchesBetweenSections.js +1 -1
- package/dist/features/network-modifications/voltageLevel/creation/tabs/substationTab/SubstationCreationSection.js +7 -7
- package/dist/features/network-modifications/voltageLevel/creation/tabs/substationTab/SubstationTab.js +5 -5
- package/dist/features/network-modifications/voltageLevel/modification/VoltageLevelModificationForm.js +3 -3
- package/dist/features/network-modifications/voltageLevel/modification/voltageLevelModification.utils.d.ts +1 -1
- package/dist/features/parameters/common/contingency-table/contingency-table.js +4 -4
- package/dist/features/parameters/common/hook/use-tabs.d.ts +3 -2
- package/dist/features/parameters/common/hook/use-tabs.js +2 -3
- package/dist/features/parameters/common/index.d.ts +2 -1
- package/dist/features/parameters/common/index.js +6 -1
- package/dist/features/parameters/common/line-separator.js +2 -2
- package/dist/features/parameters/common/name-element-editor/name-element-editor-form.js +4 -4
- package/dist/features/parameters/common/parameter-field.js +5 -4
- package/dist/features/parameters/common/parameter-layout/index.d.ts +8 -0
- package/dist/features/parameters/common/parameter-layout/index.js +7 -0
- package/dist/features/parameters/common/parameter-layout/parameter-layout-provider.d.ts +10 -0
- package/dist/features/parameters/common/parameter-layout/parameter-layout-provider.js +15 -0
- package/dist/features/parameters/common/parameter-layout/parameter-layout.d.ts +23 -0
- package/dist/features/parameters/common/parameter-layout/parameter-layout.js +167 -0
- package/dist/features/parameters/common/parameter-table-field/parameter-table-field.js +3 -3
- package/dist/features/parameters/common/parameters.js +3 -3
- package/dist/features/parameters/common/provider-param.d.ts +10 -0
- package/dist/features/parameters/common/{ProviderParam.js → provider-param.js} +9 -11
- package/dist/features/parameters/common/widget/parameter-float.js +4 -4
- package/dist/features/parameters/common/widget/parameter-group.js +2 -2
- package/dist/features/parameters/common/widget/parameter-line-directory-items-input.js +4 -4
- package/dist/features/parameters/common/widget/parameter-line-slider.js +4 -4
- package/dist/features/parameters/common/widget/parameter-switch.js +2 -2
- package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-form.d.ts +4 -5
- package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-form.js +39 -60
- package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-inline.js +39 -101
- package/dist/features/parameters/dynamic-margin-calculation/loads-variations-parameters.js +2 -2
- package/dist/features/parameters/dynamic-margin-calculation/time-delay-parameters.js +2 -2
- package/dist/features/parameters/dynamic-margin-calculation/use-dynamic-margin-calculation-parameters-form.js +8 -7
- package/dist/features/parameters/dynamic-security-analysis/contingency-parameters.js +12 -11
- package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-inline.js +38 -71
- package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.d.ts +4 -5
- package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.js +39 -61
- package/dist/features/parameters/dynamic-security-analysis/scenario-parameters.js +2 -2
- package/dist/features/parameters/dynamic-security-analysis/use-dynamic-security-analysis-parameters-form.js +8 -7
- package/dist/features/parameters/dynamic-simulation/curve/common/grid-buttons.js +4 -4
- package/dist/features/parameters/dynamic-simulation/curve/curve-parameters.js +7 -8
- package/dist/features/parameters/dynamic-simulation/curve/dialog/curve-preview.js +7 -7
- package/dist/features/parameters/dynamic-simulation/curve/dialog/curve-selector-dialog.js +10 -10
- package/dist/features/parameters/dynamic-simulation/curve/dialog/curve-selector.js +26 -50
- package/dist/features/parameters/dynamic-simulation/curve/dialog/equipment-filter.js +20 -20
- package/dist/features/parameters/dynamic-simulation/curve/dialog/model-filter.js +11 -10
- package/dist/features/parameters/dynamic-simulation/dynamic-simulation-inline.js +42 -104
- package/dist/features/parameters/dynamic-simulation/dynamic-simulation-parameters-form.d.ts +4 -5
- package/dist/features/parameters/dynamic-simulation/dynamic-simulation-parameters-form.js +75 -97
- package/dist/features/parameters/dynamic-simulation/mapping/mapping-parameters.js +10 -9
- package/dist/features/parameters/dynamic-simulation/network/network-parameters.js +2 -2
- package/dist/features/parameters/dynamic-simulation/solver/solver-parameters.js +2 -2
- package/dist/features/parameters/dynamic-simulation/time-delay/time-delay-parameters.js +2 -2
- package/dist/features/parameters/dynamic-simulation/use-dynamic-simulation-parameters-form.js +7 -6
- package/dist/features/parameters/index.js +6 -1
- package/dist/features/parameters/loadflow/load-flow-general-parameters.js +1 -0
- package/dist/features/parameters/loadflow/load-flow-parameters-content.js +14 -13
- package/dist/features/parameters/loadflow/load-flow-parameters-dialog.js +12 -18
- package/dist/features/parameters/loadflow/load-flow-parameters-form.d.ts +1 -6
- package/dist/features/parameters/loadflow/load-flow-parameters-form.js +26 -91
- package/dist/features/parameters/loadflow/load-flow-parameters-header.js +29 -53
- package/dist/features/parameters/loadflow/load-flow-parameters-inline.js +35 -128
- package/dist/features/parameters/loadflow/load-flow-parameters-utils.js +11 -10
- package/dist/features/parameters/loadflow/use-load-flow-parameters-form.js +10 -9
- package/dist/features/parameters/network-visualizations/map-parameters.js +18 -17
- package/dist/features/parameters/network-visualizations/network-area-diagram-parameters.js +4 -4
- package/dist/features/parameters/network-visualizations/network-visualizations-form.d.ts +1 -4
- package/dist/features/parameters/network-visualizations/network-visualizations-form.js +19 -48
- package/dist/features/parameters/network-visualizations/network-visualizations-parameters-dialog.js +13 -19
- package/dist/features/parameters/network-visualizations/network-visualizations-parameters-inline.js +34 -65
- package/dist/features/parameters/network-visualizations/single-line-diagram-parameters.js +18 -17
- package/dist/features/parameters/parameters-style.d.ts +0 -1
- package/dist/features/parameters/parameters-style.js +0 -2
- package/dist/features/parameters/pcc-min/pcc-min-parameters-dialog.js +13 -18
- package/dist/features/parameters/pcc-min/pcc-min-parameters-form.d.ts +7 -29
- package/dist/features/parameters/pcc-min/pcc-min-parameters-form.js +16 -109
- package/dist/features/parameters/pcc-min/pcc-min-parameters-inline.js +27 -84
- package/dist/features/parameters/security-analysis/columns-definitions.js +11 -10
- package/dist/features/parameters/security-analysis/security-analysis-parameters-dialog.js +20 -20
- package/dist/features/parameters/security-analysis/security-analysis-parameters-form.d.ts +2 -4
- package/dist/features/parameters/security-analysis/security-analysis-parameters-form.js +44 -115
- package/dist/features/parameters/security-analysis/security-analysis-parameters-inline.js +40 -109
- package/dist/features/parameters/security-analysis/security-analysis-parameters-selector.js +12 -11
- package/dist/features/parameters/security-analysis/security-analysis-violations-hiding.js +9 -11
- package/dist/features/parameters/security-analysis/use-security-analysis-parameters-form.js +7 -6
- package/dist/features/parameters/sensi/columns-definitions.js +9 -8
- package/dist/features/parameters/sensi/sensitivity-analysis-parameters-dialog.js +21 -21
- package/dist/features/parameters/sensi/sensitivity-analysis-parameters-form.d.ts +3 -5
- package/dist/features/parameters/sensi/sensitivity-analysis-parameters-form.js +33 -90
- package/dist/features/parameters/sensi/sensitivity-analysis-parameters-inline.js +40 -99
- package/dist/features/parameters/sensi/sensitivity-parameters-fields.js +8 -17
- package/dist/features/parameters/sensi/sensitivity-parameters-selector.js +10 -9
- package/dist/features/parameters/sensi/utils.js +8 -7
- package/dist/features/parameters/short-circuit/short-circuit-general-tab-panel.js +15 -14
- package/dist/features/parameters/short-circuit/short-circuit-parameters-content.js +11 -10
- package/dist/features/parameters/short-circuit/short-circuit-parameters-dialog.js +13 -18
- package/dist/features/parameters/short-circuit/short-circuit-parameters-form.d.ts +1 -4
- package/dist/features/parameters/short-circuit/short-circuit-parameters-form.js +5 -63
- package/dist/features/parameters/short-circuit/short-circuit-parameters-inline.js +33 -101
- package/dist/features/parameters/short-circuit/short-circuit-parameters-utils.js +12 -11
- package/dist/features/parameters/short-circuit/short-circuit-power-electronics-tab-panel.js +17 -16
- package/dist/features/parameters/short-circuit/short-circuit-study-area-tab-panel.js +15 -14
- package/dist/features/parameters/short-circuit/use-short-circuit-parameters-form.js +1 -0
- package/dist/features/parameters/voltage-init/equipment-selection-parameters.js +6 -5
- package/dist/features/parameters/voltage-init/general-parameters.js +11 -10
- package/dist/features/parameters/voltage-init/voltage-init-parameters-dialog.js +13 -18
- package/dist/features/parameters/voltage-init/voltage-init-parameters-form.d.ts +2 -24
- package/dist/features/parameters/voltage-init/voltage-init-parameters-form.js +51 -108
- package/dist/features/parameters/voltage-init/voltage-init-parameters-inline.js +34 -90
- package/dist/features/parameters/voltage-init/voltage-limits-parameters.js +2 -2
- package/dist/features/process-configs/security-analysis/update-sa-process-config.js +7 -6
- package/dist/features/topBar/AboutDialog.js +4 -7
- package/dist/index.js +13 -4
- package/dist/translations/en/commonButtonEn.d.ts +2 -0
- package/dist/translations/en/commonButtonEn.js +2 -0
- package/dist/translations/en/parameters.d.ts +1 -0
- package/dist/translations/en/parameters.js +3 -1
- package/dist/translations/fr/commonButtonFr.d.ts +2 -0
- package/dist/translations/fr/commonButtonFr.js +2 -0
- package/dist/translations/fr/parameters.d.ts +1 -0
- package/dist/translations/fr/parameters.js +3 -1
- package/dist/utils/types/elementType.d.ts +1 -0
- package/dist/utils/types/elementType.js +1 -0
- package/package.json +3 -2
- package/dist/features/parameters/common/ProviderParam.d.ts +0 -7
package/dist/features/network-modifications/voltageLevel/creation/tabs/structureTab/StructureTab.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Grid2 } from "@mui/material";
|
|
3
3
|
import { useEffect } from "react";
|
|
4
4
|
import { useFormContext, useWatch } from "react-hook-form";
|
|
5
|
-
import GridSection from "../../../../../../components/composite/grid/grid-section.js";
|
|
5
|
+
import { GridSection } from "../../../../../../components/composite/grid/grid-section.js";
|
|
6
6
|
import "@mui/icons-material";
|
|
7
7
|
import "react-intl";
|
|
8
8
|
import "../../../../../../components/ui/overflowableText/OverflowableText.js";
|
|
@@ -44,9 +44,9 @@ function StructureTab() {
|
|
|
44
44
|
const displayOmnibus = watchBusBarCount > 1 || watchSectionCount > 1;
|
|
45
45
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
46
46
|
/* @__PURE__ */ jsx(GridSection, { title: "BusBarSections" }),
|
|
47
|
-
/* @__PURE__ */ jsxs(
|
|
48
|
-
/* @__PURE__ */ jsx(
|
|
49
|
-
/* @__PURE__ */ jsx(
|
|
47
|
+
/* @__PURE__ */ jsxs(Grid2, { container: true, spacing: 2, children: [
|
|
48
|
+
/* @__PURE__ */ jsx(Grid2, { size: 4, children: /* @__PURE__ */ jsx(IntegerInput, { name: FieldConstants.BUS_BAR_COUNT, label: "BusBarCount" }) }),
|
|
49
|
+
/* @__PURE__ */ jsx(Grid2, { size: 4, children: /* @__PURE__ */ jsx(IntegerInput, { name: FieldConstants.SECTION_COUNT, label: "numberOfSections" }) })
|
|
50
50
|
] }),
|
|
51
51
|
/* @__PURE__ */ jsx(SwitchesBetweenSections, {}),
|
|
52
52
|
displayOmnibus && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect } from "react";
|
|
3
3
|
import { useFormContext } from "react-hook-form";
|
|
4
|
-
import {
|
|
4
|
+
import { Grid2 } from "@mui/material";
|
|
5
5
|
import { AutocompleteInput } from "../../../../../../../components/ui/reactHookForm/autocompleteInputs/AutocompleteInput.js";
|
|
6
6
|
import { FieldConstants } from "../../../../../../../utils/constants/fieldConstants.js";
|
|
7
7
|
import "../../../../../../../utils/conversionUtils.js";
|
|
@@ -24,7 +24,7 @@ function CouplingOmnibusCreation({ index, sectionOptions }) {
|
|
|
24
24
|
return () => unsubscribe();
|
|
25
25
|
}, [subscribe, trigger, getValues, index]);
|
|
26
26
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
27
|
-
/* @__PURE__ */ jsx(
|
|
27
|
+
/* @__PURE__ */ jsx(Grid2, { size: 4, children: /* @__PURE__ */ jsx(
|
|
28
28
|
AutocompleteInput,
|
|
29
29
|
{
|
|
30
30
|
allowNewValue: true,
|
|
@@ -35,7 +35,7 @@ function CouplingOmnibusCreation({ index, sectionOptions }) {
|
|
|
35
35
|
size: "small"
|
|
36
36
|
}
|
|
37
37
|
) }),
|
|
38
|
-
/* @__PURE__ */ jsx(
|
|
38
|
+
/* @__PURE__ */ jsx(Grid2, { size: 4, children: /* @__PURE__ */ jsx(
|
|
39
39
|
AutocompleteInput,
|
|
40
40
|
{
|
|
41
41
|
allowNewValue: true,
|
|
@@ -32,7 +32,7 @@ import "../../../../../../../components/ui/snackbarProvider/SnackbarProvider.js"
|
|
|
32
32
|
import "mui-nested-menu";
|
|
33
33
|
import "react-resizable-panels";
|
|
34
34
|
import "react-papaparse";
|
|
35
|
-
import GridSection from "../../../../../../../components/composite/grid/grid-section.js";
|
|
35
|
+
import { GridSection } from "../../../../../../../components/composite/grid/grid-section.js";
|
|
36
36
|
import { SWITCH_TYPE } from "../../../voltageLevelCreation.utils.js";
|
|
37
37
|
import { MAX_SECTIONS_COUNT } from "../../../voltageLevel.constants.js";
|
|
38
38
|
function SwitchesBetweenSections() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useIntl } from "react-intl";
|
|
3
|
-
import {
|
|
3
|
+
import { Grid2, IconButton } from "@mui/material";
|
|
4
4
|
import { Delete } from "@mui/icons-material";
|
|
5
5
|
import { CustomTooltip } from "../../../../../../components/ui/tooltip/CustomTooltip.js";
|
|
6
6
|
import "../../../../../../components/ui/overflowableText/OverflowableText.js";
|
|
@@ -33,7 +33,7 @@ import "../../../../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
|
33
33
|
import "mui-nested-menu";
|
|
34
34
|
import "react-resizable-panels";
|
|
35
35
|
import "react-papaparse";
|
|
36
|
-
import GridSection from "../../../../../../components/composite/grid/grid-section.js";
|
|
36
|
+
import { GridSection } from "../../../../../../components/composite/grid/grid-section.js";
|
|
37
37
|
import { PropertiesForm } from "../../../../common/properties/PropertiesForm.js";
|
|
38
38
|
import "../../../../common/properties/propertyUtils.js";
|
|
39
39
|
import "react-dom";
|
|
@@ -71,11 +71,11 @@ function SubstationCreationSection({
|
|
|
71
71
|
const intl = useIntl();
|
|
72
72
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
73
73
|
/* @__PURE__ */ jsx(GridSection, { title: "CreateSubstation" }),
|
|
74
|
-
/* @__PURE__ */ jsxs(
|
|
75
|
-
/* @__PURE__ */ jsx(
|
|
76
|
-
/* @__PURE__ */ jsx(
|
|
77
|
-
/* @__PURE__ */ jsx(
|
|
78
|
-
showDeleteButton && onDelete && /* @__PURE__ */ jsx(
|
|
74
|
+
/* @__PURE__ */ jsxs(Grid2, { container: true, spacing: 2, children: [
|
|
75
|
+
/* @__PURE__ */ jsx(Grid2, { size: "grow", children: /* @__PURE__ */ jsx(TextInput, { name: FieldConstants.SUBSTATION_CREATION_ID, label: "SubstationId" }) }),
|
|
76
|
+
/* @__PURE__ */ jsx(Grid2, { size: "grow", children: /* @__PURE__ */ jsx(TextInput, { name: FieldConstants.SUBSTATION_NAME, label: "substationName" }) }),
|
|
77
|
+
/* @__PURE__ */ jsx(Grid2, { size: "grow", children: /* @__PURE__ */ jsx(CountrySelectionInput, { name: FieldConstants.COUNTRY, label: "Country", size: "small" }) }),
|
|
78
|
+
showDeleteButton && onDelete && /* @__PURE__ */ jsx(Grid2, { size: 1, children: /* @__PURE__ */ jsx(CustomTooltip, { title: intl.formatMessage({ id: "DeleteRows" }), children: /* @__PURE__ */ jsx(IconButton, { onClick: onDelete, children: /* @__PURE__ */ jsx(Delete, {}) }) }) })
|
|
79
79
|
] }),
|
|
80
80
|
/* @__PURE__ */ jsx(PropertiesForm, { id: FieldConstants.SUBSTATION_CREATION, networkElementType: "substation" })
|
|
81
81
|
] });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useWatch, useFormContext } from "react-hook-form";
|
|
3
3
|
import { FormattedMessage } from "react-intl";
|
|
4
|
-
import {
|
|
4
|
+
import { Grid2 } from "@mui/material";
|
|
5
5
|
import { useCallback, useEffect } from "react";
|
|
6
6
|
import { FieldConstants } from "../../../../../../utils/constants/fieldConstants.js";
|
|
7
7
|
import "../../../../../../utils/conversionUtils.js";
|
|
@@ -56,8 +56,8 @@ function SubstationTab({ substationOptions, showDeleteButton }) {
|
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
}, [setValue, getValues, watchAddSubstationCreation]);
|
|
59
|
-
return watchAddSubstationCreation ? /* @__PURE__ */ jsx(SubstationCreationSection, { showDeleteButton, onDelete: handleDeleteSubstationCreation }) : /* @__PURE__ */ jsxs(
|
|
60
|
-
/* @__PURE__ */ jsx(
|
|
59
|
+
return watchAddSubstationCreation ? /* @__PURE__ */ jsx(SubstationCreationSection, { showDeleteButton, onDelete: handleDeleteSubstationCreation }) : /* @__PURE__ */ jsxs(Grid2, { container: true, spacing: 2, pt: 2, children: [
|
|
60
|
+
/* @__PURE__ */ jsx(Grid2, { size: 4, children: substationOptions ? /* @__PURE__ */ jsx(
|
|
61
61
|
AutocompleteInput,
|
|
62
62
|
{
|
|
63
63
|
name: FieldConstants.SUBSTATION_ID,
|
|
@@ -70,8 +70,8 @@ function SubstationTab({ substationOptions, showDeleteButton }) {
|
|
|
70
70
|
noOptionsText: ""
|
|
71
71
|
}
|
|
72
72
|
) : /* @__PURE__ */ jsx(TextInput, { name: FieldConstants.SUBSTATION_ID, label: "SUBSTATION" }) }),
|
|
73
|
-
/* @__PURE__ */ jsx(
|
|
74
|
-
/* @__PURE__ */ jsx(
|
|
73
|
+
/* @__PURE__ */ jsx(Grid2, { mt: 0.75, children: /* @__PURE__ */ jsx(FormattedMessage, { id: "Or" }) }),
|
|
74
|
+
/* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsx(AddButton, { label: "CreateSubstation", onClick: handleCreateSubstation }) })
|
|
75
75
|
] });
|
|
76
76
|
}
|
|
77
77
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
|
-
import { Grid2, TextField, Tabs, Tab, Box } from "@mui/material";
|
|
3
|
+
import { Stack, Grid2, TextField, Tabs, Tab, Box } from "@mui/material";
|
|
4
4
|
import { FormattedMessage } from "react-intl";
|
|
5
5
|
import { useWatch } from "react-hook-form";
|
|
6
6
|
import { VoltageAdornment, KiloAmpereAdornment } from "../../../../utils/constants/adornments.js";
|
|
@@ -37,7 +37,7 @@ import "mui-nested-menu";
|
|
|
37
37
|
import "react-resizable-panels";
|
|
38
38
|
import "react-papaparse";
|
|
39
39
|
import "../../common/properties/propertyUtils.js";
|
|
40
|
-
import GridSection from "../../../../components/composite/grid/grid-section.js";
|
|
40
|
+
import { GridSection } from "../../../../components/composite/grid/grid-section.js";
|
|
41
41
|
import { BusbarSectionVoltageMeasurementsForm } from "../../common/measurements/BusbarSectionVoltageMeasurementsForm.js";
|
|
42
42
|
import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
43
43
|
import { getTabStyle, getTabIndicatorStyle } from "../../../parameters/parameters-style.js";
|
|
@@ -78,7 +78,7 @@ function VoltageLevelModificationForm({
|
|
|
78
78
|
0
|
|
79
79
|
/* CHARACTERISTICS_TAB */
|
|
80
80
|
);
|
|
81
|
-
return /* @__PURE__ */ jsxs(
|
|
81
|
+
return /* @__PURE__ */ jsxs(Stack, { spacing: 2, children: [
|
|
82
82
|
/* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsxs(Grid2, { container: true, spacing: 2, children: [
|
|
83
83
|
/* @__PURE__ */ jsx(Grid2, { size: 4, children: /* @__PURE__ */ jsx(
|
|
84
84
|
TextField,
|
|
@@ -55,8 +55,8 @@ export declare const voltageLevelModificationWithMeasurementsFormSchema: import(
|
|
|
55
55
|
} & {
|
|
56
56
|
busbarSectionVMeasurements: {
|
|
57
57
|
value: number | null;
|
|
58
|
-
busbarSectionId: string;
|
|
59
58
|
validity: boolean | null;
|
|
59
|
+
busbarSectionId: string;
|
|
60
60
|
}[] | null;
|
|
61
61
|
}, import('yup').AnyObject, {
|
|
62
62
|
equipmentID: undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Grid2, Stack, Alert, CircularProgress } from "@mui/material";
|
|
3
3
|
import { forwardRef, useState, useImperativeHandle, useCallback, useEffect, useMemo } from "react";
|
|
4
4
|
import { useIntl, FormattedMessage } from "react-intl";
|
|
5
5
|
import { useFormContext } from "react-hook-form";
|
|
@@ -120,7 +120,7 @@ function ContingencyTableWithApiRef({ name, showContingencyCount = false, fetchC
|
|
|
120
120
|
})
|
|
121
121
|
);
|
|
122
122
|
}, [intl]);
|
|
123
|
-
return /* @__PURE__ */
|
|
123
|
+
return /* @__PURE__ */ jsx(Grid2, { size: 12, children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
124
124
|
/* @__PURE__ */ jsx(
|
|
125
125
|
ParameterTableField,
|
|
126
126
|
{
|
|
@@ -132,7 +132,7 @@ function ContingencyTableWithApiRef({ name, showContingencyCount = false, fetchC
|
|
|
132
132
|
}
|
|
133
133
|
),
|
|
134
134
|
showContingencyCount && renderContingencyCount()
|
|
135
|
-
] });
|
|
135
|
+
] }) });
|
|
136
136
|
}
|
|
137
137
|
const ContingencyTable = forwardRef(ContingencyTableWithApiRef);
|
|
138
138
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SyntheticEvent } from 'react';
|
|
2
2
|
import { FieldErrors } from 'react-hook-form';
|
|
3
|
-
export type
|
|
3
|
+
export type UseTabsReturn<TTabValue extends string> = {
|
|
4
4
|
selectedTab: TTabValue;
|
|
5
5
|
tabsWithError: TTabValue[];
|
|
6
6
|
onTabChange: (event: SyntheticEvent, newValue: TTabValue) => void;
|
|
@@ -9,5 +9,6 @@ export type UseTabs<TTabValue extends string> = {
|
|
|
9
9
|
export type UseTabsProps<TTabValue extends string> = {
|
|
10
10
|
defaultTab: TTabValue;
|
|
11
11
|
tabEnum: Record<string, TTabValue>;
|
|
12
|
+
errors: FieldErrors;
|
|
12
13
|
};
|
|
13
|
-
export declare function useTabs<TTabValue extends string>({ defaultTab, tabEnum, }: Readonly<UseTabsProps<TTabValue>>):
|
|
14
|
+
export declare function useTabs<TTabValue extends string>({ defaultTab, tabEnum, errors, }: Readonly<UseTabsProps<TTabValue>>): UseTabsReturn<TTabValue>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { useState, useCallback } from "react";
|
|
2
|
-
import { useFormState } from "react-hook-form";
|
|
3
2
|
import { isObjectEmpty } from "../../../../utils/functions.js";
|
|
4
3
|
function useTabs({
|
|
5
4
|
defaultTab,
|
|
6
|
-
tabEnum
|
|
5
|
+
tabEnum,
|
|
6
|
+
errors
|
|
7
7
|
}) {
|
|
8
|
-
const { errors } = useFormState();
|
|
9
8
|
const [selectedTab, setSelectedTab] = useState(defaultTab);
|
|
10
9
|
const [tabsWithError, setTabsWithError] = useState([]);
|
|
11
10
|
const onTabChange = useCallback(
|
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
5
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
6
|
*/
|
|
7
|
+
export * from './parameter-layout';
|
|
7
8
|
export * from './computing-type';
|
|
8
9
|
export * from './constants';
|
|
9
10
|
export * from './parameters-edition-dialog-props';
|
|
10
11
|
export * from './line-separator';
|
|
11
12
|
export * from './parameters';
|
|
12
13
|
export * from './parameters-creation-dialog';
|
|
13
|
-
export * from './
|
|
14
|
+
export * from './provider-param';
|
|
14
15
|
export * from './widget';
|
|
15
16
|
export * from './voltage-level-table';
|
|
16
17
|
export * from './limitreductions';
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { ParameterLayout } from "./parameter-layout/parameter-layout.js";
|
|
2
|
+
import { ParameterLayoutProvider, useParameterLayoutContext } from "./parameter-layout/parameter-layout-provider.js";
|
|
1
3
|
import { formatComputingTypeLabel, isValidComputingType } from "./computing-type.js";
|
|
2
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";
|
|
3
5
|
import { LineSeparator } from "./line-separator.js";
|
|
4
6
|
import { LabelledButton, SwitchWithLabel, TabPanel } from "./parameters.js";
|
|
5
7
|
import { CreateParameterDialog } from "./parameters-creation-dialog.js";
|
|
6
|
-
import { ProviderParam } from "./
|
|
8
|
+
import { ProviderParam } from "./provider-param.js";
|
|
7
9
|
import { ParameterFloat } from "./widget/parameter-float.js";
|
|
8
10
|
import { ParameterGroup } from "./widget/parameter-group.js";
|
|
9
11
|
import { ParameterLineDirectoryItemsInput } from "./widget/parameter-line-directory-items-input.js";
|
|
@@ -49,6 +51,8 @@ export {
|
|
|
49
51
|
PROVIDER,
|
|
50
52
|
ParameterFloat,
|
|
51
53
|
ParameterGroup,
|
|
54
|
+
ParameterLayout,
|
|
55
|
+
ParameterLayoutProvider,
|
|
52
56
|
ParameterLineDirectoryItemsInput,
|
|
53
57
|
ParameterLineSlider,
|
|
54
58
|
ParameterSwitch,
|
|
@@ -69,6 +73,7 @@ export {
|
|
|
69
73
|
sanitizePercentageValue,
|
|
70
74
|
toFormValuesContingencyListsInfos,
|
|
71
75
|
toFormValuesLimitReductions,
|
|
76
|
+
useParameterLayoutContext,
|
|
72
77
|
useParametersForm,
|
|
73
78
|
useTabs
|
|
74
79
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Grid2, Divider } from "@mui/material";
|
|
3
3
|
function LineSeparator() {
|
|
4
|
-
return /* @__PURE__ */ jsx(
|
|
4
|
+
return /* @__PURE__ */ jsx(Grid2, { size: 12, children: /* @__PURE__ */ jsx(Divider, {}) });
|
|
5
5
|
}
|
|
6
6
|
export {
|
|
7
7
|
LineSeparator
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Grid2, Stack } from "@mui/material";
|
|
3
3
|
import { DescriptionField } from "../../../../components/ui/reactHookForm/text/DescriptionField.js";
|
|
4
4
|
import { UniqueNameInput } from "../../../../components/ui/reactHookForm/text/UniqueNameInput.js";
|
|
5
5
|
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
@@ -12,8 +12,8 @@ function NameElementEditorForm({
|
|
|
12
12
|
activeDirectory,
|
|
13
13
|
elementType
|
|
14
14
|
}) {
|
|
15
|
-
return /* @__PURE__ */ jsx(
|
|
16
|
-
/* @__PURE__ */ jsx(
|
|
15
|
+
return /* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsxs(Stack, { spacing: 2, marginBottom: "8px", children: [
|
|
16
|
+
/* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsx(
|
|
17
17
|
UniqueNameInput,
|
|
18
18
|
{
|
|
19
19
|
name: FieldConstants.NAME,
|
|
@@ -25,7 +25,7 @@ function NameElementEditorForm({
|
|
|
25
25
|
fullWidth: false
|
|
26
26
|
}
|
|
27
27
|
) }),
|
|
28
|
-
/* @__PURE__ */ jsx(
|
|
28
|
+
/* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsx(DescriptionField, { expandingTextSx: filterStyles.description }) })
|
|
29
29
|
] }) });
|
|
30
30
|
}
|
|
31
31
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Grid2, Typography, Chip } from "@mui/material";
|
|
3
3
|
import { FormattedMessage } from "react-intl";
|
|
4
4
|
import { CustomTooltip } from "../../../components/ui/tooltip/CustomTooltip.js";
|
|
5
5
|
import { parametersStyles } from "../parameters-style.js";
|
|
@@ -41,6 +41,7 @@ import "mui-nested-menu";
|
|
|
41
41
|
import "react-resizable-panels";
|
|
42
42
|
import "react-papaparse";
|
|
43
43
|
import { LineSeparator } from "./line-separator.js";
|
|
44
|
+
import "./parameter-layout/parameter-layout-provider.js";
|
|
44
45
|
import "./widget/parameter-line-slider.js";
|
|
45
46
|
import "./limitreductions/columns-definitions.js";
|
|
46
47
|
import "./contingency-table/contingency-table.js";
|
|
@@ -96,9 +97,9 @@ function ParameterField({ id, name, type, label, description, possibleValues, sx
|
|
|
96
97
|
return null;
|
|
97
98
|
}
|
|
98
99
|
};
|
|
99
|
-
return /* @__PURE__ */ jsxs(
|
|
100
|
-
/* @__PURE__ */ jsx(
|
|
101
|
-
/* @__PURE__ */ jsx(
|
|
100
|
+
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() }),
|
|
102
103
|
/* @__PURE__ */ jsx(LineSeparator, {})
|
|
103
104
|
] }, name);
|
|
104
105
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, 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
|
+
export * from './parameter-layout';
|
|
8
|
+
export * from './parameter-layout-provider';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface ParameterLayoutContextValue {
|
|
3
|
+
isXsScreen: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const useParameterLayoutContext: () => ParameterLayoutContextValue;
|
|
6
|
+
export declare function ParameterLayoutProvider({ isXsScreen, children, }: Readonly<{
|
|
7
|
+
isXsScreen: boolean;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}>): import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useMemo, useContext } from "react";
|
|
3
|
+
const ParameterLayoutContext = createContext({ isXsScreen: false });
|
|
4
|
+
const useParameterLayoutContext = () => useContext(ParameterLayoutContext);
|
|
5
|
+
function ParameterLayoutProvider({
|
|
6
|
+
isXsScreen,
|
|
7
|
+
children
|
|
8
|
+
}) {
|
|
9
|
+
const isXsScreenMemo = useMemo(() => ({ isXsScreen }), [isXsScreen]);
|
|
10
|
+
return /* @__PURE__ */ jsx(ParameterLayoutContext.Provider, { value: isXsScreenMemo, children });
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
ParameterLayoutProvider,
|
|
14
|
+
useParameterLayoutContext
|
|
15
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MouseEventHandler, ReactNode } from 'react';
|
|
2
|
+
import { UUID } from 'node:crypto';
|
|
3
|
+
import { FieldValues, UseFormGetValues } from 'react-hook-form';
|
|
4
|
+
import { TreeViewFinderNodeProps } from '../../../../components/ui';
|
|
5
|
+
import { ElementType } from '../../../../utils';
|
|
6
|
+
export type CreateParameterDialogConfig<T extends FieldValues> = {
|
|
7
|
+
studyUuid: UUID | null;
|
|
8
|
+
getParameterValues: UseFormGetValues<T>;
|
|
9
|
+
parameterFormatter: (params: FieldValues) => any;
|
|
10
|
+
};
|
|
11
|
+
interface ParameterLayoutProps<T extends FieldValues> {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
title?: string;
|
|
14
|
+
isLoading?: boolean;
|
|
15
|
+
parameterType: ElementType;
|
|
16
|
+
createParameter?: CreateParameterDialogConfig<T>;
|
|
17
|
+
selectParameterHandler?: (nodes: TreeViewFinderNodeProps[]) => void;
|
|
18
|
+
resetHandler?: () => void;
|
|
19
|
+
validateHandler?: MouseEventHandler<HTMLButtonElement>;
|
|
20
|
+
validateDisabled?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function ParameterLayout<T extends FieldValues>({ children, title, isLoading, createParameter, resetHandler, validateHandler, validateDisabled, selectParameterHandler, parameterType, }: Readonly<ParameterLayoutProps<T>>): import("react").JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Stack, Box, Grid2, ButtonGroup, Tooltip, LinearProgress } from "@mui/material";
|
|
3
|
+
import { Upload, RestartAlt } from "@mui/icons-material";
|
|
4
|
+
import { useState, useCallback } from "react";
|
|
5
|
+
import { useIntl, FormattedMessage } from "react-intl";
|
|
6
|
+
import { LabelledButton } from "../parameters.js";
|
|
7
|
+
import "../../../../components/ui/overflowableText/OverflowableText.js";
|
|
8
|
+
import "../../../../utils/conversionUtils.js";
|
|
9
|
+
import "../../../../utils/types/equipmentType.js";
|
|
10
|
+
import "react-hook-form";
|
|
11
|
+
import "localized-countries";
|
|
12
|
+
import "localized-countries/data/fr";
|
|
13
|
+
import "localized-countries/data/en";
|
|
14
|
+
import "notistack";
|
|
15
|
+
import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
16
|
+
import { SubmitButton } from "../../../../components/ui/reactHookForm/utils/SubmitButton.js";
|
|
17
|
+
import "yup";
|
|
18
|
+
import { DirectoryItemSelector } from "../../../../components/ui/directoryItemSelector/DirectoryItemSelector.js";
|
|
19
|
+
import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
|
|
20
|
+
import { PopupConfirmationDialog } from "../../../../components/ui/dialogs/popupConfirmationDialog/PopupConfirmationDialog.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 "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
36
|
+
import { CreateParameterDialog } from "../parameters-creation-dialog.js";
|
|
37
|
+
import { LineSeparator } from "../line-separator.js";
|
|
38
|
+
import { useParameterLayoutContext } from "./parameter-layout-provider.js";
|
|
39
|
+
const styles = {
|
|
40
|
+
stack: {
|
|
41
|
+
height: "100%"
|
|
42
|
+
},
|
|
43
|
+
title: {
|
|
44
|
+
paddingBottom: 0
|
|
45
|
+
},
|
|
46
|
+
content: {
|
|
47
|
+
flexGrow: 1,
|
|
48
|
+
overflowY: "auto",
|
|
49
|
+
overflowX: "hidden"
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
function ParameterLayout({
|
|
53
|
+
children,
|
|
54
|
+
title,
|
|
55
|
+
isLoading,
|
|
56
|
+
createParameter,
|
|
57
|
+
resetHandler,
|
|
58
|
+
validateHandler,
|
|
59
|
+
validateDisabled,
|
|
60
|
+
selectParameterHandler,
|
|
61
|
+
parameterType
|
|
62
|
+
}) {
|
|
63
|
+
const { isXsScreen } = useParameterLayoutContext();
|
|
64
|
+
const [openCreateParameterDialog, setOpenCreateParameterDialog] = useState(false);
|
|
65
|
+
const [openSelectParameterDialog, setOpenSelectParameterDialog] = useState(false);
|
|
66
|
+
const [openResetConfirmation, setOpenResetConfirmation] = useState(false);
|
|
67
|
+
const handlePrefillClick = useCallback(() => {
|
|
68
|
+
setOpenSelectParameterDialog(true);
|
|
69
|
+
}, []);
|
|
70
|
+
const handleSaveClick = useCallback(() => {
|
|
71
|
+
setOpenCreateParameterDialog(true);
|
|
72
|
+
}, []);
|
|
73
|
+
const handleResetClick = useCallback(() => {
|
|
74
|
+
setOpenResetConfirmation(true);
|
|
75
|
+
}, []);
|
|
76
|
+
const handleCancelReset = useCallback(() => {
|
|
77
|
+
setOpenResetConfirmation(false);
|
|
78
|
+
}, []);
|
|
79
|
+
const intl = useIntl();
|
|
80
|
+
return /* @__PURE__ */ jsxs(Stack, { sx: styles.stack, children: [
|
|
81
|
+
(title || selectParameterHandler || resetHandler) && /* @__PURE__ */ jsx(Box, { sx: styles.title, children: /* @__PURE__ */ jsxs(Grid2, { container: true, sx: { alignItems: "center", justifyContent: "space-between" }, children: [
|
|
82
|
+
/* @__PURE__ */ jsx(Grid2, { size: 4, children: title && !isXsScreen && /* @__PURE__ */ jsx(FormattedMessage, { id: title }) }),
|
|
83
|
+
/* @__PURE__ */ jsx(Grid2, { size: "auto", children: /* @__PURE__ */ jsxs(ButtonGroup, { children: [
|
|
84
|
+
selectParameterHandler && /* @__PURE__ */ jsx(
|
|
85
|
+
LabelledButton,
|
|
86
|
+
{
|
|
87
|
+
callback: handlePrefillClick,
|
|
88
|
+
label: "button.prefill",
|
|
89
|
+
"data-testid": "PrefillButton",
|
|
90
|
+
startIcon: /* @__PURE__ */ jsx(Upload, {})
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
resetHandler && /* @__PURE__ */ jsx(Tooltip, { title: /* @__PURE__ */ jsx(FormattedMessage, { id: "tooltip.reset" }), children: /* @__PURE__ */ jsx(
|
|
94
|
+
LabelledButton,
|
|
95
|
+
{
|
|
96
|
+
callback: handleResetClick,
|
|
97
|
+
label: "button.reset",
|
|
98
|
+
"data-testid": "ResetButton",
|
|
99
|
+
startIcon: /* @__PURE__ */ jsx(RestartAlt, {})
|
|
100
|
+
}
|
|
101
|
+
) })
|
|
102
|
+
] }) })
|
|
103
|
+
] }) }),
|
|
104
|
+
/* @__PURE__ */ jsx(Box, { sx: styles.content, children: isLoading ? /* @__PURE__ */ jsx(LinearProgress, {}) : children }),
|
|
105
|
+
/* @__PURE__ */ jsxs(Stack, { spacing: 1, children: [
|
|
106
|
+
/* @__PURE__ */ jsx(LineSeparator, {}),
|
|
107
|
+
/* @__PURE__ */ jsxs(Grid2, { container: true, spacing: 1, children: [
|
|
108
|
+
createParameter && /* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsx(LabelledButton, { label: "save", "data-testid": "SaveButton", callback: handleSaveClick }) }),
|
|
109
|
+
validateHandler && /* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsx(
|
|
110
|
+
SubmitButton,
|
|
111
|
+
{
|
|
112
|
+
variant: "contained",
|
|
113
|
+
"data-testid": "ValidateButton",
|
|
114
|
+
onClick: validateHandler,
|
|
115
|
+
disabled: validateDisabled
|
|
116
|
+
}
|
|
117
|
+
) })
|
|
118
|
+
] })
|
|
119
|
+
] }),
|
|
120
|
+
openCreateParameterDialog && createParameter && /* @__PURE__ */ jsx(
|
|
121
|
+
CreateParameterDialog,
|
|
122
|
+
{
|
|
123
|
+
studyUuid: createParameter?.studyUuid,
|
|
124
|
+
open: openCreateParameterDialog,
|
|
125
|
+
onClose: () => setOpenCreateParameterDialog(false),
|
|
126
|
+
parameterValues: createParameter?.getParameterValues,
|
|
127
|
+
parameterFormatter: createParameter?.parameterFormatter,
|
|
128
|
+
parameterType
|
|
129
|
+
}
|
|
130
|
+
),
|
|
131
|
+
openSelectParameterDialog && selectParameterHandler && /* @__PURE__ */ jsx(
|
|
132
|
+
DirectoryItemSelector,
|
|
133
|
+
{
|
|
134
|
+
open: openSelectParameterDialog,
|
|
135
|
+
onClose: (nodes) => {
|
|
136
|
+
setOpenSelectParameterDialog(false);
|
|
137
|
+
selectParameterHandler(nodes);
|
|
138
|
+
},
|
|
139
|
+
types: [parameterType],
|
|
140
|
+
title: intl.formatMessage({
|
|
141
|
+
id: "showSelectParameterDialog"
|
|
142
|
+
}),
|
|
143
|
+
onlyLeaves: true,
|
|
144
|
+
multiSelect: false,
|
|
145
|
+
validationButtonText: intl.formatMessage({
|
|
146
|
+
id: "validate"
|
|
147
|
+
})
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
openResetConfirmation && resetHandler && /* @__PURE__ */ jsx(
|
|
151
|
+
PopupConfirmationDialog,
|
|
152
|
+
{
|
|
153
|
+
message: "resetParamsConfirmation",
|
|
154
|
+
validateButtonLabel: "validate",
|
|
155
|
+
openConfirmationPopup: openResetConfirmation,
|
|
156
|
+
setOpenConfirmationPopup: handleCancelReset,
|
|
157
|
+
handlePopupConfirmation: () => {
|
|
158
|
+
resetHandler();
|
|
159
|
+
setOpenResetConfirmation(false);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
)
|
|
163
|
+
] });
|
|
164
|
+
}
|
|
165
|
+
export {
|
|
166
|
+
ParameterLayout
|
|
167
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Grid2, Typography } from "@mui/material";
|
|
3
3
|
import { FormattedMessage } from "react-intl";
|
|
4
4
|
import { useFieldArray, useFormContext } from "react-hook-form";
|
|
5
5
|
import { Info } from "@mui/icons-material";
|
|
@@ -84,8 +84,8 @@ function ParameterTableField({
|
|
|
84
84
|
},
|
|
85
85
|
[isValidRow, onChange]
|
|
86
86
|
);
|
|
87
|
-
return /* @__PURE__ */ jsxs(
|
|
88
|
-
label && /* @__PURE__ */ jsxs(
|
|
87
|
+
return /* @__PURE__ */ jsxs(Grid2, { container: true, sx: sxContainerProps, size: 12, children: [
|
|
88
|
+
label && /* @__PURE__ */ jsxs(Grid2, { container: true, alignItems: "center", paddingBottom: 2, paddingTop: 2, children: [
|
|
89
89
|
/* @__PURE__ */ jsx(Typography, { component: "span", variant: "h6", children: /* @__PURE__ */ jsx(FormattedMessage, { id: label }) }),
|
|
90
90
|
tooltipProps && /* @__PURE__ */ jsx(
|
|
91
91
|
CustomTooltip,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { FormattedMessage } from "react-intl";
|
|
3
|
-
import { Typography, Box, Button,
|
|
3
|
+
import { Typography, Box, Button, Grid2, Switch } from "@mui/material";
|
|
4
4
|
import { parametersStyles } from "../parameters-style.js";
|
|
5
5
|
function LabelledButton({ callback, label, ...props }) {
|
|
6
6
|
return /* @__PURE__ */ jsx(Button, { onClick: callback, ...props, children: /* @__PURE__ */ jsx(FormattedMessage, { id: label }) });
|
|
7
7
|
}
|
|
8
8
|
function SwitchWithLabel({ value, label, callback }) {
|
|
9
9
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10
|
-
/* @__PURE__ */ jsx(
|
|
11
|
-
/* @__PURE__ */ jsx(
|
|
10
|
+
/* @__PURE__ */ jsx(Grid2, { size: 8, sx: parametersStyles.parameterName, children: /* @__PURE__ */ jsx(FormattedMessage, { id: label }) }),
|
|
11
|
+
/* @__PURE__ */ jsx(Grid2, { container: true, size: 4, sx: parametersStyles.controlItem, children: /* @__PURE__ */ jsx(
|
|
12
12
|
Switch,
|
|
13
13
|
{
|
|
14
14
|
checked: value,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SxProps } from '@mui/material';
|
|
2
|
+
export interface ProviderParamProps {
|
|
3
|
+
options: {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}[];
|
|
7
|
+
id?: string;
|
|
8
|
+
sx?: SxProps;
|
|
9
|
+
}
|
|
10
|
+
export declare function ProviderParam({ options, id, sx }: Readonly<ProviderParamProps>): import("react").JSX.Element;
|