@gridsuite/commons-ui 0.181.0 → 0.183.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 (75) hide show
  1. package/dist/components/index.js +28 -1
  2. package/dist/components/inputs/index.js +4 -0
  3. package/dist/components/inputs/reactHookForm/index.d.ts +1 -0
  4. package/dist/components/inputs/reactHookForm/index.js +4 -0
  5. package/dist/components/inputs/reactHookForm/readOnly/ButtonReadOnlyInput.d.ts +7 -0
  6. package/dist/components/inputs/reactHookForm/readOnly/ButtonReadOnlyInput.js +50 -0
  7. package/dist/components/inputs/reactHookForm/readOnly/ReadOnlyInput.d.ts +12 -0
  8. package/dist/components/inputs/reactHookForm/readOnly/ReadOnlyInput.js +35 -0
  9. package/dist/components/inputs/reactHookForm/readOnly/index.d.ts +8 -0
  10. package/dist/components/inputs/reactHookForm/readOnly/index.js +6 -0
  11. package/dist/components/network-modifications/common/connectivity/connectivityForm.utils.js +2 -1
  12. package/dist/components/network-modifications/common/measurements/powerWithValidity.utils.js +2 -1
  13. package/dist/components/network-modifications/common/setpoints/setPoints.utils.js +3 -2
  14. package/dist/components/network-modifications/equipmentDeletion/EquipmentDeletionForm.d.ts +9 -0
  15. package/dist/components/network-modifications/equipmentDeletion/EquipmentDeletionForm.js +173 -0
  16. package/dist/components/network-modifications/equipmentDeletion/equipmentDeletion.types.d.ts +17 -0
  17. package/dist/components/network-modifications/equipmentDeletion/equipmentDeletion.types.js +1 -0
  18. package/dist/components/network-modifications/equipmentDeletion/equipmentDeletion.utils.d.ts +33 -0
  19. package/dist/components/network-modifications/equipmentDeletion/equipmentDeletion.utils.js +78 -0
  20. package/dist/components/network-modifications/equipmentDeletion/hvdcLccDeletion/HvdcLccDeletionSpecificForm.d.ts +7 -0
  21. package/dist/components/network-modifications/equipmentDeletion/hvdcLccDeletion/HvdcLccDeletionSpecificForm.js +43 -0
  22. package/dist/components/network-modifications/equipmentDeletion/hvdcLccDeletion/ShuntCompensatorSelectionForm.d.ts +13 -0
  23. package/dist/components/network-modifications/equipmentDeletion/hvdcLccDeletion/ShuntCompensatorSelectionForm.js +58 -0
  24. package/dist/components/network-modifications/equipmentDeletion/hvdcLccDeletion/hvdcLccDeletion.utils.d.ts +21 -0
  25. package/dist/components/network-modifications/equipmentDeletion/hvdcLccDeletion/hvdcLccDeletion.utils.js +22 -0
  26. package/dist/components/network-modifications/equipmentDeletion/hvdcLccDeletion/index.d.ts +10 -0
  27. package/dist/components/network-modifications/equipmentDeletion/hvdcLccDeletion/index.js +10 -0
  28. package/dist/components/network-modifications/equipmentDeletion/hvdcLccDeletion/useHvdcLccDeletion.d.ts +8 -0
  29. package/dist/components/network-modifications/equipmentDeletion/hvdcLccDeletion/useHvdcLccDeletion.js +85 -0
  30. package/dist/components/network-modifications/equipmentDeletion/index.d.ts +10 -0
  31. package/dist/components/network-modifications/equipmentDeletion/index.js +18 -0
  32. package/dist/components/network-modifications/index.d.ts +1 -0
  33. package/dist/components/network-modifications/index.js +24 -1
  34. package/dist/components/network-modifications/load/creation/loadCreation.utils.js +3 -3
  35. package/dist/components/network-modifications/voltage-level/creation/voltageLevelCreation.utils.js +8 -8
  36. package/dist/components/network-modifications/voltage-level/index.d.ts +1 -0
  37. package/dist/components/network-modifications/voltage-level/index.js +8 -1
  38. package/dist/components/network-modifications/voltage-level/modification/VoltageLevelModificationForm.d.ts +5 -0
  39. package/dist/components/network-modifications/voltage-level/modification/VoltageLevelModificationForm.js +159 -0
  40. package/dist/components/network-modifications/voltage-level/modification/index.d.ts +9 -0
  41. package/dist/components/network-modifications/voltage-level/modification/index.js +9 -0
  42. package/dist/components/network-modifications/voltage-level/modification/voltageLevelModification.types.d.ts +35 -0
  43. package/dist/components/network-modifications/voltage-level/modification/voltageLevelModification.types.js +1 -0
  44. package/dist/components/network-modifications/voltage-level/modification/voltageLevelModification.utils.d.ts +36 -0
  45. package/dist/components/network-modifications/voltage-level/modification/voltageLevelModification.utils.js +75 -0
  46. package/dist/components/parameters/common/contingency-table/contingency-table.js +4 -1
  47. package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +11 -10
  48. package/dist/components/parameters/security-analysis/columns-definitions.js +1 -1
  49. package/dist/hooks/index.d.ts +1 -0
  50. package/dist/hooks/index.js +2 -0
  51. package/dist/hooks/useGetLabelEquipmentTypes.d.ts +2 -0
  52. package/dist/hooks/useGetLabelEquipmentTypes.js +20 -0
  53. package/dist/hooks/useModificationLabelComputer.js +2 -0
  54. package/dist/index.js +39 -2
  55. package/dist/translations/en/equipmentTypesEn.d.ts +30 -0
  56. package/dist/translations/en/equipmentTypesEn.js +27 -0
  57. package/dist/translations/en/index.d.ts +1 -0
  58. package/dist/translations/en/index.js +2 -0
  59. package/dist/translations/en/networkModificationsEn.d.ts +9 -0
  60. package/dist/translations/en/networkModificationsEn.js +12 -3
  61. package/dist/translations/fr/equipmentTypesFr.d.ts +30 -0
  62. package/dist/translations/fr/equipmentTypesFr.js +27 -0
  63. package/dist/translations/fr/index.d.ts +1 -0
  64. package/dist/translations/fr/index.js +2 -0
  65. package/dist/translations/fr/networkModificationsFr.d.ts +9 -0
  66. package/dist/translations/fr/networkModificationsFr.js +14 -5
  67. package/dist/utils/constants/fieldConstants.d.ts +7 -0
  68. package/dist/utils/constants/fieldConstants.js +7 -0
  69. package/dist/utils/constants/index.js +2 -1
  70. package/dist/utils/constants/translationKeys.d.ts +1 -0
  71. package/dist/utils/constants/translationKeys.js +2 -0
  72. package/dist/utils/index.js +6 -2
  73. package/dist/utils/ts-utils.d.ts +3 -0
  74. package/dist/utils/ts-utils.js +10 -0
  75. package/package.json +1 -1
@@ -0,0 +1,78 @@
1
+ import { object, mixed, string } from "yup";
2
+ import { EquipmentType } from "../../../utils/types/equipmentType.js";
3
+ import { getHvdcLccDeletionSchema } from "./hvdcLccDeletion/hvdcLccDeletion.utils.js";
4
+ import "react/jsx-runtime";
5
+ import "react-intl";
6
+ import "@mui/material";
7
+ import { FieldConstants } from "../../../utils/constants/fieldConstants.js";
8
+ import { YUP_REQUIRED } from "../../../utils/constants/translationKeys.js";
9
+ import "../../../utils/conversionUtils.js";
10
+ import { ModificationType } from "../../../utils/types/modificationType.js";
11
+ import "@mui/icons-material";
12
+ import "../../../utils/yupConfig.js";
13
+ import "../../overflowableText/OverflowableText.js";
14
+ import "react";
15
+ import "react-hook-form";
16
+ import "localized-countries";
17
+ import "localized-countries/data/fr";
18
+ import "localized-countries/data/en";
19
+ import "notistack";
20
+ import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
21
+ import "../../treeViewFinder/TreeViewFinder.js";
22
+ import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
23
+ import "../../customAGGrid/customAggrid.js";
24
+ import "ag-grid-community";
25
+ import "react-papaparse";
26
+ import "react-csv-downloader";
27
+ import "../../inputs/reactHookForm/numbers/RangeInput.js";
28
+ import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
29
+ import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
30
+ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
31
+ import "@material-symbols/svg-400/outlined/add_notes.svg?react";
32
+ import "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
33
+ import "@react-querybuilder/material";
34
+ import "../../filter/expert/expertFilterConstants.js";
35
+ import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
36
+ import "uuid";
37
+ import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
38
+ import "react-querybuilder";
39
+ const equipmentDeletionFormSchema = object().shape({
40
+ [FieldConstants.EQUIPMENT_ID]: string().nullable().required(YUP_REQUIRED),
41
+ [FieldConstants.TYPE]: mixed().oneOf(Object.values(EquipmentType)).nullable().required(YUP_REQUIRED),
42
+ [FieldConstants.DELETION_SPECIFIC_DATA]: getHvdcLccDeletionSchema()
43
+ }).required();
44
+ const equipmentDeletionEmptyFormData = {
45
+ equipmentID: "",
46
+ type: null,
47
+ equipmentInfos: null
48
+ };
49
+ const equipmentDeletionFormToDto = (form) => {
50
+ return {
51
+ type: ModificationType.EQUIPMENT_DELETION,
52
+ equipmentId: form.equipmentID,
53
+ equipmentType: form.type,
54
+ equipmentInfos: form.equipmentInfos ?? void 0
55
+ };
56
+ };
57
+ const newEquipmentDeletionDto = (equipmentType, equipmentId) => {
58
+ return {
59
+ type: ModificationType.EQUIPMENT_DELETION,
60
+ equipmentId,
61
+ equipmentType,
62
+ equipmentInfos: void 0
63
+ };
64
+ };
65
+ const equipmentDeletionDtoToForm = (dto) => {
66
+ return {
67
+ equipmentID: dto.equipmentId,
68
+ type: dto.equipmentType,
69
+ equipmentInfos: dto.equipmentInfos
70
+ };
71
+ };
72
+ export {
73
+ equipmentDeletionDtoToForm,
74
+ equipmentDeletionEmptyFormData,
75
+ equipmentDeletionFormSchema,
76
+ equipmentDeletionFormToDto,
77
+ newEquipmentDeletionDto
78
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright (c) 2023, 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 declare function HvdcLccDeletionSpecificForm(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,43 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { Grid } from "@mui/material";
3
+ import { useFieldArray } from "react-hook-form";
4
+ import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
5
+ import "../../../../utils/conversionUtils.js";
6
+ import "../../../../utils/types/equipmentType.js";
7
+ import "@mui/icons-material";
8
+ import "../../../../utils/yupConfig.js";
9
+ import GridSection from "../../../grid/grid-section.js";
10
+ import GridItem from "../../../grid/grid-item.js";
11
+ import { ShuntCompensatorSelectionForm } from "./ShuntCompensatorSelectionForm.js";
12
+ function HvdcLccDeletionSpecificForm() {
13
+ const { fields: mcsRows1 } = useFieldArray({
14
+ name: `${FieldConstants.DELETION_SPECIFIC_DATA}.${FieldConstants.SHUNT_COMPENSATOR_SIDE_1}`
15
+ });
16
+ const { fields: mcsRows2 } = useFieldArray({
17
+ name: `${FieldConstants.DELETION_SPECIFIC_DATA}.${FieldConstants.SHUNT_COMPENSATOR_SIDE_2}`
18
+ });
19
+ return /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 1, direction: "column", paddingTop: 2, paddingLeft: 1, children: [
20
+ /* @__PURE__ */ jsx(GridSection, { title: "LCCConverterStationShuntCompensators" }),
21
+ /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 1, children: [
22
+ /* @__PURE__ */ jsx(GridItem, { children: /* @__PURE__ */ jsx(
23
+ ShuntCompensatorSelectionForm,
24
+ {
25
+ title: "Side1",
26
+ arrayFormName: `${FieldConstants.DELETION_SPECIFIC_DATA}.${FieldConstants.SHUNT_COMPENSATOR_SIDE_1}`,
27
+ mcsRows: mcsRows1
28
+ }
29
+ ) }),
30
+ /* @__PURE__ */ jsx(GridItem, { children: /* @__PURE__ */ jsx(
31
+ ShuntCompensatorSelectionForm,
32
+ {
33
+ title: "Side2",
34
+ arrayFormName: `${FieldConstants.DELETION_SPECIFIC_DATA}.${FieldConstants.SHUNT_COMPENSATOR_SIDE_2}`,
35
+ mcsRows: mcsRows2
36
+ }
37
+ ) })
38
+ ] })
39
+ ] });
40
+ }
41
+ export {
42
+ HvdcLccDeletionSpecificForm
43
+ };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright (c) 2023, 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
+ interface ShuntCompensatorSelectionFormProps {
8
+ title: string;
9
+ arrayFormName: string;
10
+ mcsRows: Record<'id', string>[];
11
+ }
12
+ export declare function ShuntCompensatorSelectionForm({ title, arrayFormName, mcsRows, }: Readonly<ShuntCompensatorSelectionFormProps>): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,58 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { FormattedMessage } from "react-intl";
3
+ import { Grid } from "@mui/material";
4
+ import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
5
+ import "../../../../utils/conversionUtils.js";
6
+ import "../../../../utils/types/equipmentType.js";
7
+ import "@mui/icons-material";
8
+ import "../../../../utils/yupConfig.js";
9
+ import "../../../overflowableText/OverflowableText.js";
10
+ import "react";
11
+ import "react-hook-form";
12
+ import "localized-countries";
13
+ import "localized-countries/data/fr";
14
+ import "localized-countries/data/en";
15
+ import "notistack";
16
+ import "../../../inputs/reactHookForm/provider/CustomFormProvider.js";
17
+ import "yup";
18
+ import "../../../treeViewFinder/TreeViewFinder.js";
19
+ import "../../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
20
+ import "../../../customAGGrid/customAggrid.js";
21
+ import "ag-grid-community";
22
+ import "react-papaparse";
23
+ import "react-csv-downloader";
24
+ import { CheckboxInput } from "../../../inputs/reactHookForm/booleans/CheckboxInput.js";
25
+ import "../../../inputs/reactHookForm/numbers/RangeInput.js";
26
+ import { ReadOnlyInput } from "../../../inputs/reactHookForm/readOnly/ReadOnlyInput.js";
27
+ import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
28
+ import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
29
+ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
30
+ import "@material-symbols/svg-400/outlined/add_notes.svg?react";
31
+ import "../../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
32
+ import "@react-querybuilder/material";
33
+ import "../../../filter/expert/expertFilterConstants.js";
34
+ import "../../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
35
+ import "uuid";
36
+ import "../../../inputs/reactQueryBuilder/PropertyValueEditor.js";
37
+ import "react-querybuilder";
38
+ function ShuntCompensatorSelectionForm({
39
+ title,
40
+ arrayFormName,
41
+ mcsRows
42
+ }) {
43
+ return /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 1, direction: "column", children: [
44
+ /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx("h4", { children: /* @__PURE__ */ jsx(FormattedMessage, { id: title }) }) }),
45
+ mcsRows.map((field, index) => /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 1, alignItems: "center", children: [
46
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: 1, children: /* @__PURE__ */ jsx(
47
+ CheckboxInput,
48
+ {
49
+ name: `${arrayFormName}[${index}].${FieldConstants.SHUNT_COMPENSATOR_SELECTED}`
50
+ }
51
+ ) }),
52
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: 11, children: /* @__PURE__ */ jsx(ReadOnlyInput, { name: `${arrayFormName}[${index}].${FieldConstants.ID}` }) })
53
+ ] }, field.id))
54
+ ] });
55
+ }
56
+ export {
57
+ ShuntCompensatorSelectionForm
58
+ };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Copyright (c) 2026, 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 declare const getHvdcLccDeletionSchema: () => import('yup').ObjectSchema<{
8
+ specificType: string;
9
+ mcsOnSide1: {
10
+ id: string;
11
+ connectedToHvdc: NonNullable<boolean | undefined>;
12
+ }[];
13
+ mcsOnSide2: {
14
+ id: string;
15
+ connectedToHvdc: NonNullable<boolean | undefined>;
16
+ }[];
17
+ } | null | undefined, import('yup').AnyObject, {
18
+ specificType: undefined;
19
+ mcsOnSide1: "";
20
+ mcsOnSide2: "";
21
+ }, "">;
@@ -0,0 +1,22 @@
1
+ import { object, array, string, boolean } from "yup";
2
+ import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
3
+ import { YUP_REQUIRED } from "../../../../utils/constants/translationKeys.js";
4
+ import "../../../../utils/conversionUtils.js";
5
+ import "../../../../utils/types/equipmentType.js";
6
+ import "react/jsx-runtime";
7
+ import "@mui/icons-material";
8
+ import "../../../../utils/yupConfig.js";
9
+ const getMcsConnectionsSchema = () => array().of(
10
+ object().shape({
11
+ [FieldConstants.ID]: string().required(YUP_REQUIRED),
12
+ [FieldConstants.SHUNT_COMPENSATOR_SELECTED]: boolean().required(YUP_REQUIRED)
13
+ })
14
+ ).required();
15
+ const getHvdcLccDeletionSchema = () => object().shape({
16
+ [FieldConstants.DELETION_SPECIFIC_TYPE]: string().required(YUP_REQUIRED),
17
+ [FieldConstants.SHUNT_COMPENSATOR_SIDE_1]: getMcsConnectionsSchema(),
18
+ [FieldConstants.SHUNT_COMPENSATOR_SIDE_2]: getMcsConnectionsSchema()
19
+ }).optional().nullable();
20
+ export {
21
+ getHvdcLccDeletionSchema
22
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright (c) 2026, 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 './hvdcLccDeletion.utils';
8
+ export * from './ShuntCompensatorSelectionForm';
9
+ export * from './useHvdcLccDeletion';
10
+ export * from './HvdcLccDeletionSpecificForm';
@@ -0,0 +1,10 @@
1
+ import { getHvdcLccDeletionSchema } from "./hvdcLccDeletion.utils.js";
2
+ import { ShuntCompensatorSelectionForm } from "./ShuntCompensatorSelectionForm.js";
3
+ import { useHvdcLccDeletion } from "./useHvdcLccDeletion.js";
4
+ import { HvdcLccDeletionSpecificForm } from "./HvdcLccDeletionSpecificForm.js";
5
+ export {
6
+ HvdcLccDeletionSpecificForm,
7
+ ShuntCompensatorSelectionForm,
8
+ getHvdcLccDeletionSchema,
9
+ useHvdcLccDeletion
10
+ };
@@ -0,0 +1,8 @@
1
+ import { UUID } from 'node:crypto';
2
+ import { EquipmentDeletionDto, LccDeletionDto } from '../equipmentDeletion.types';
3
+ export interface UseHvdcLccDeletionProps {
4
+ fetchHvdcWithShuntCompensators?: (hvdcLineId: UUID) => Promise<LccDeletionDto>;
5
+ }
6
+ export declare const useHvdcLccDeletion: ({ fetchHvdcWithShuntCompensators }: UseHvdcLccDeletionProps) => {
7
+ specificUpdate: (equipmentId: UUID, editData?: EquipmentDeletionDto) => void;
8
+ };
@@ -0,0 +1,85 @@
1
+ import { useCallback } from "react";
2
+ import { useFieldArray, useFormContext } from "react-hook-form";
3
+ import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
4
+ import "../../../../utils/conversionUtils.js";
5
+ import { snackWithFallback } from "../../../../utils/error.js";
6
+ import "../../../../utils/types/equipmentType.js";
7
+ import "react/jsx-runtime";
8
+ import "@mui/icons-material";
9
+ import "../../../../utils/yupConfig.js";
10
+ import "react-intl";
11
+ import "@mui/material";
12
+ import "localized-countries";
13
+ import "localized-countries/data/fr";
14
+ import "localized-countries/data/en";
15
+ import { useSnackMessage } from "../../../../hooks/useSnackMessage.js";
16
+ const useHvdcLccDeletion = ({ fetchHvdcWithShuntCompensators }) => {
17
+ const { replace: replaceMcsList1 } = useFieldArray({
18
+ name: `${FieldConstants.DELETION_SPECIFIC_DATA}.${FieldConstants.SHUNT_COMPENSATOR_SIDE_1}`
19
+ });
20
+ const { replace: replaceMcsList2 } = useFieldArray({
21
+ name: `${FieldConstants.DELETION_SPECIFIC_DATA}.${FieldConstants.SHUNT_COMPENSATOR_SIDE_2}`
22
+ });
23
+ const { setValue } = useFormContext();
24
+ const { snackError } = useSnackMessage();
25
+ const updateMcsLists = useCallback(
26
+ (hvdcLineData, editData) => {
27
+ function mergeMcsLists(dynamicList, editList) {
28
+ if (!dynamicList?.length && !editList?.length) {
29
+ return [];
30
+ }
31
+ if (!dynamicList?.length) {
32
+ return editList.filter((item) => item.connectedToHvdc);
33
+ }
34
+ if (!editList?.length) {
35
+ return dynamicList;
36
+ }
37
+ const mergedList = dynamicList.map((obj) => {
38
+ return { ...obj, connectedToHvdc: false };
39
+ });
40
+ const dynamicIds = new Set(dynamicList.map((obj) => obj.id));
41
+ editList.forEach((editObj) => {
42
+ if (dynamicIds.has(editObj.id)) {
43
+ const mergedObj = mergedList.find((obj) => obj.id === editObj.id);
44
+ if (mergedObj) {
45
+ mergedObj.connectedToHvdc = editObj.connectedToHvdc;
46
+ }
47
+ } else if (editObj.connectedToHvdc) {
48
+ mergedList.push(editObj);
49
+ }
50
+ });
51
+ return mergedList;
52
+ }
53
+ if (hvdcLineData?.mcsOnSide1 || hvdcLineData?.mcsOnSide2 || editData?.equipmentInfos?.mcsOnSide1 || editData?.equipmentInfos?.mcsOnSide2) {
54
+ setValue(
55
+ `${FieldConstants.DELETION_SPECIFIC_DATA}.${FieldConstants.DELETION_SPECIFIC_TYPE}`,
56
+ FieldConstants.HVDC_LINE_LCC_DELETION_SPECIFIC_TYPE
57
+ );
58
+ replaceMcsList1(mergeMcsLists(hvdcLineData?.mcsOnSide1, editData?.equipmentInfos?.mcsOnSide1 ?? []));
59
+ replaceMcsList2(mergeMcsLists(hvdcLineData?.mcsOnSide2, editData?.equipmentInfos?.mcsOnSide2 ?? []));
60
+ } else {
61
+ setValue(FieldConstants.DELETION_SPECIFIC_DATA, null);
62
+ }
63
+ },
64
+ [replaceMcsList1, replaceMcsList2, setValue]
65
+ );
66
+ const specificUpdate = useCallback(
67
+ (equipmentId, editData) => {
68
+ if (fetchHvdcWithShuntCompensators) {
69
+ fetchHvdcWithShuntCompensators(equipmentId).then((hvdcLineData) => {
70
+ updateMcsLists(hvdcLineData, editData);
71
+ }).catch((error) => {
72
+ setValue(FieldConstants.DELETION_SPECIFIC_DATA, null);
73
+ snackWithFallback(snackError, error, { headerId: "FetchHvdcLineWithShuntCompensatorsError" });
74
+ });
75
+ } else {
76
+ updateMcsLists({}, editData);
77
+ }
78
+ },
79
+ [fetchHvdcWithShuntCompensators, setValue, snackError, updateMcsLists]
80
+ );
81
+ return { specificUpdate };
82
+ };
83
+ export {
84
+ useHvdcLccDeletion
85
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright (c) 2026, 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 './hvdcLccDeletion';
8
+ export * from './equipmentDeletion.types';
9
+ export * from './equipmentDeletion.utils';
10
+ export * from './EquipmentDeletionForm';
@@ -0,0 +1,18 @@
1
+ import { getHvdcLccDeletionSchema } from "./hvdcLccDeletion/hvdcLccDeletion.utils.js";
2
+ import { ShuntCompensatorSelectionForm } from "./hvdcLccDeletion/ShuntCompensatorSelectionForm.js";
3
+ import { useHvdcLccDeletion } from "./hvdcLccDeletion/useHvdcLccDeletion.js";
4
+ import { HvdcLccDeletionSpecificForm } from "./hvdcLccDeletion/HvdcLccDeletionSpecificForm.js";
5
+ import { equipmentDeletionDtoToForm, equipmentDeletionEmptyFormData, equipmentDeletionFormSchema, equipmentDeletionFormToDto, newEquipmentDeletionDto } from "./equipmentDeletion.utils.js";
6
+ import { EquipmentDeletionForm } from "./EquipmentDeletionForm.js";
7
+ export {
8
+ EquipmentDeletionForm,
9
+ HvdcLccDeletionSpecificForm,
10
+ ShuntCompensatorSelectionForm,
11
+ equipmentDeletionDtoToForm,
12
+ equipmentDeletionEmptyFormData,
13
+ equipmentDeletionFormSchema,
14
+ equipmentDeletionFormToDto,
15
+ getHvdcLccDeletionSchema,
16
+ newEquipmentDeletionDto,
17
+ useHvdcLccDeletion
18
+ };
@@ -5,6 +5,7 @@
5
5
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
6
  */
7
7
  export * from './common';
8
+ export * from './equipmentDeletion';
8
9
  export * from './substation';
9
10
  export * from './voltage-level';
10
11
  export * from './load';
@@ -13,6 +13,12 @@ import { SetPointsForm } from "./common/setpoints/SetPointsForm.js";
13
13
  import { createConnectivityData, getCon1andCon2WithPositionValidationSchema, getConnectivityBusBarSectionData, getConnectivityData, getConnectivityFormData, getConnectivityFormDataProps, getConnectivityPropertiesData, getConnectivityPropertiesEmptyFormData, getConnectivityPropertiesValidationSchema, getConnectivityVoltageLevelData, getConnectivityWithPositionEmptyFormData, getConnectivityWithPositionEmptyFormDataProps, getConnectivityWithPositionSchema, getConnectivityWithPositionValidationSchema, getConnectivityWithoutPositionEmptyFormData, getConnectivityWithoutPositionValidationSchema, getCont1Cont2WithPositionEmptyFormData, getNewVoltageLevelData } from "./common/connectivity/connectivityForm.utils.js";
14
14
  import { ConnectivityForm } from "./common/connectivity/ConnectivityForm.js";
15
15
  import { BranchConnectivityForm } from "./common/connectivity/BranchConnectivityForm.js";
16
+ import { getHvdcLccDeletionSchema } from "./equipmentDeletion/hvdcLccDeletion/hvdcLccDeletion.utils.js";
17
+ import { ShuntCompensatorSelectionForm } from "./equipmentDeletion/hvdcLccDeletion/ShuntCompensatorSelectionForm.js";
18
+ import { useHvdcLccDeletion } from "./equipmentDeletion/hvdcLccDeletion/useHvdcLccDeletion.js";
19
+ import { HvdcLccDeletionSpecificForm } from "./equipmentDeletion/hvdcLccDeletion/HvdcLccDeletionSpecificForm.js";
20
+ import { equipmentDeletionDtoToForm, equipmentDeletionEmptyFormData, equipmentDeletionFormSchema, equipmentDeletionFormToDto, newEquipmentDeletionDto } from "./equipmentDeletion/equipmentDeletion.utils.js";
21
+ import { EquipmentDeletionForm } from "./equipmentDeletion/EquipmentDeletionForm.js";
16
22
  import { SubstationCreationForm } from "./substation/creation/SubstationCreationForm.js";
17
23
  import { substationCreationDtoToForm, substationCreationEmptyFormData, substationCreationFormSchema, substationCreationFormToDto } from "./substation/creation/substationCreation.utils.js";
18
24
  import { SubstationModificationForm } from "./substation/modification/SubstationModificationForm.js";
@@ -24,6 +30,8 @@ import { CouplingOmnibusCreation } from "./voltage-level/creation/coupling-omnib
24
30
  import { VoltageLevelCreationForm } from "./voltage-level/creation/VoltageLevelCreationForm.js";
25
31
  import { SWITCH_TYPE, buildNewBusbarSections, getCreateSwitchesEmptyFormData, getCreateSwitchesValidationSchema, translateSwitchKinds, voltageLevelCreationDtoToForm, voltageLevelCreationEmptyFormData, voltageLevelCreationFormSchema, voltageLevelCreationFormToDto } from "./voltage-level/creation/voltageLevelCreation.utils.js";
26
32
  import { SwitchKind } from "./voltage-level/creation/voltageLevelCreation.types.js";
33
+ import { VoltageLevelModificationForm } from "./voltage-level/modification/VoltageLevelModificationForm.js";
34
+ import { voltageLevelModificationDtoToForm, voltageLevelModificationEmptyFormData, voltageLevelModificationFormSchema, voltageLevelModificationFormToDto } from "./voltage-level/modification/voltageLevelModification.utils.js";
27
35
  import { LoadDialogTab } from "./load/common/load.utils.js";
28
36
  import { LoadDialogTabs } from "./load/common/LoadDialogTabs.js";
29
37
  import { LoadDialogTabsContent } from "./load/common/LoadDialogTabsContent.js";
@@ -38,6 +46,8 @@ export {
38
46
  CouplingOmnibusCreation,
39
47
  CouplingOmnibusForm,
40
48
  CreateSwitchesDialog,
49
+ EquipmentDeletionForm,
50
+ HvdcLccDeletionSpecificForm,
41
51
  LoadDialogHeader,
42
52
  LoadDialogTab,
43
53
  LoadDialogTabs,
@@ -49,17 +59,23 @@ export {
49
59
  PropertyForm,
50
60
  SWITCH_TYPE,
51
61
  SetPointsForm,
62
+ ShuntCompensatorSelectionForm,
52
63
  SubstationCreationForm,
53
64
  SubstationModificationForm,
54
65
  SwitchKind,
55
66
  SwitchesBetweenSections,
56
67
  VoltageLevelCreationForm,
68
+ VoltageLevelModificationForm,
57
69
  buildNewBusbarSections,
58
70
  copyEquipmentPropertiesForCreation,
59
71
  createConnectivityData,
60
72
  createPropertyModification,
61
73
  creationPropertiesSchema,
62
74
  emptyProperties,
75
+ equipmentDeletionDtoToForm,
76
+ equipmentDeletionEmptyFormData,
77
+ equipmentDeletionFormSchema,
78
+ equipmentDeletionFormToDto,
63
79
  fetchPredefinedProperties,
64
80
  filledTextField,
65
81
  getActivePowerSetPointSchema,
@@ -89,6 +105,7 @@ export {
89
105
  getCreateSwitchesEmptyFormData,
90
106
  getCreateSwitchesValidationSchema,
91
107
  getFilledPropertiesFromModification,
108
+ getHvdcLccDeletionSchema,
92
109
  getInjectionActiveReactivePowerEditData,
93
110
  getInjectionActiveReactivePowerEditDataProperties,
94
111
  getInjectionActiveReactivePowerEmptyFormData,
@@ -116,6 +133,7 @@ export {
116
133
  loadModificationFormToDto,
117
134
  mergeModificationAndEquipmentProperties,
118
135
  modificationPropertiesSchema,
136
+ newEquipmentDeletionDto,
119
137
  standardTextField,
120
138
  substationCreationDtoToForm,
121
139
  substationCreationEmptyFormData,
@@ -128,8 +146,13 @@ export {
128
146
  testValueWithinPowerInterval,
129
147
  toModificationProperties,
130
148
  translateSwitchKinds,
149
+ useHvdcLccDeletion,
131
150
  voltageLevelCreationDtoToForm,
132
151
  voltageLevelCreationEmptyFormData,
133
152
  voltageLevelCreationFormSchema,
134
- voltageLevelCreationFormToDto
153
+ voltageLevelCreationFormToDto,
154
+ voltageLevelModificationDtoToForm,
155
+ voltageLevelModificationEmptyFormData,
156
+ voltageLevelModificationFormSchema,
157
+ voltageLevelModificationFormToDto
135
158
  };
@@ -1,6 +1,6 @@
1
1
  import { object, number, string } from "yup";
2
2
  import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
3
- import { YUP_REQUIRED } from "../../../../utils/constants/translationKeys.js";
3
+ import { YUP_NOT_TYPE_NUMBER, YUP_REQUIRED } from "../../../../utils/constants/translationKeys.js";
4
4
  import "../../../../utils/conversionUtils.js";
5
5
  import { UNDEFINED_CONNECTION_DIRECTION, UNDEFINED_LOAD_TYPE } from "../../../../utils/types/equipmentType.js";
6
6
  import { ModificationType } from "../../../../utils/types/modificationType.js";
@@ -42,8 +42,8 @@ const loadCreationFormSchema = object().shape({
42
42
  [FieldConstants.EQUIPMENT_ID]: string().required(YUP_REQUIRED),
43
43
  [FieldConstants.EQUIPMENT_NAME]: string().nullable(),
44
44
  [FieldConstants.LOAD_TYPE]: string().nullable(),
45
- [FieldConstants.ACTIVE_POWER_SET_POINT]: number().nullable().required(YUP_REQUIRED),
46
- [FieldConstants.REACTIVE_POWER_SET_POINT]: number().nullable().required(YUP_REQUIRED),
45
+ [FieldConstants.ACTIVE_POWER_SET_POINT]: number().typeError(YUP_NOT_TYPE_NUMBER).nullable().required(YUP_REQUIRED),
46
+ [FieldConstants.REACTIVE_POWER_SET_POINT]: number().typeError(YUP_NOT_TYPE_NUMBER).nullable().required(YUP_REQUIRED),
47
47
  [FieldConstants.CONNECTIVITY]: getConnectivityWithPositionSchema(false)
48
48
  }).concat(creationPropertiesSchema).required(YUP_REQUIRED);
49
49
  const loadCreationEmptyFormData = {
@@ -1,7 +1,7 @@
1
1
  import { object, array, string, number, boolean, ref } from "yup";
2
2
  import { creationPropertiesSchema, toModificationProperties, getPropertiesFromModification, emptyProperties } from "../../common/properties/propertyUtils.js";
3
3
  import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
4
- import { YUP_REQUIRED } from "../../../../utils/constants/translationKeys.js";
4
+ import { YUP_REQUIRED, YUP_NOT_TYPE_NUMBER } from "../../../../utils/constants/translationKeys.js";
5
5
  import { convertOutputValue, convertInputValue } from "../../../../utils/conversionUtils.js";
6
6
  import "../../../../utils/types/equipmentType.js";
7
7
  import { MODIFICATION_TYPES } from "../../../../utils/types/modificationType.js";
@@ -102,23 +102,23 @@ const voltageLevelCreationFormSchema = object().shape({
102
102
  [FieldConstants.COUNTRY]: string().nullable(),
103
103
  [FieldConstants.SUBSTATION_CREATION]: creationPropertiesSchema,
104
104
  [FieldConstants.HIDE_NOMINAL_VOLTAGE]: boolean().required(YUP_REQUIRED),
105
- [FieldConstants.NOMINAL_V]: number().nullable().when([FieldConstants.HIDE_NOMINAL_VOLTAGE], {
105
+ [FieldConstants.NOMINAL_V]: number().typeError(YUP_NOT_TYPE_NUMBER).nullable().when([FieldConstants.HIDE_NOMINAL_VOLTAGE], {
106
106
  is: (hideNominalVoltage) => !hideNominalVoltage,
107
107
  then: (schema) => schema.min(0, "mustBeGreaterOrEqualToZero").required(YUP_REQUIRED)
108
108
  }),
109
- [FieldConstants.LOW_VOLTAGE_LIMIT]: number().nullable().min(0, "mustBeGreaterOrEqualToZero").max(ref(FieldConstants.HIGH_VOLTAGE_LIMIT), "voltageLevelNominalVoltageMaxValueError"),
110
- [FieldConstants.HIGH_VOLTAGE_LIMIT]: number().nullable().min(0, "mustBeGreaterOrEqualToZero"),
111
- [FieldConstants.LOW_SHORT_CIRCUIT_CURRENT_LIMIT]: number().nullable().min(0, "ShortCircuitCurrentLimitMustBeGreaterOrEqualToZero").max(ref(FieldConstants.HIGH_SHORT_CIRCUIT_CURRENT_LIMIT), "ShortCircuitCurrentLimitMinMaxError"),
112
- [FieldConstants.HIGH_SHORT_CIRCUIT_CURRENT_LIMIT]: number().nullable().min(0, "ShortCircuitCurrentLimitMustBeGreaterOrEqualToZero").when([FieldConstants.LOW_SHORT_CIRCUIT_CURRENT_LIMIT], {
109
+ [FieldConstants.LOW_VOLTAGE_LIMIT]: number().typeError(YUP_NOT_TYPE_NUMBER).nullable().min(0, "mustBeGreaterOrEqualToZero").max(ref(FieldConstants.HIGH_VOLTAGE_LIMIT), "voltageLevelNominalVoltageMaxValueError"),
110
+ [FieldConstants.HIGH_VOLTAGE_LIMIT]: number().typeError(YUP_NOT_TYPE_NUMBER).nullable().min(0, "mustBeGreaterOrEqualToZero"),
111
+ [FieldConstants.LOW_SHORT_CIRCUIT_CURRENT_LIMIT]: number().typeError(YUP_NOT_TYPE_NUMBER).nullable().min(0, "ShortCircuitCurrentLimitMustBeGreaterOrEqualToZero").max(ref(FieldConstants.HIGH_SHORT_CIRCUIT_CURRENT_LIMIT), "ShortCircuitCurrentLimitMinMaxError"),
112
+ [FieldConstants.HIGH_SHORT_CIRCUIT_CURRENT_LIMIT]: number().typeError(YUP_NOT_TYPE_NUMBER).nullable().min(0, "ShortCircuitCurrentLimitMustBeGreaterOrEqualToZero").when([FieldConstants.LOW_SHORT_CIRCUIT_CURRENT_LIMIT], {
113
113
  is: (lowShortCircuitCurrentLimit) => lowShortCircuitCurrentLimit != null,
114
114
  then: (schema) => schema.required(YUP_REQUIRED)
115
115
  }),
116
116
  [FieldConstants.HIDE_BUS_BAR_SECTION]: boolean().required(YUP_REQUIRED),
117
- [FieldConstants.BUS_BAR_COUNT]: number().nullable().when([FieldConstants.HIDE_BUS_BAR_SECTION], {
117
+ [FieldConstants.BUS_BAR_COUNT]: number().typeError(YUP_NOT_TYPE_NUMBER).nullable().when([FieldConstants.HIDE_BUS_BAR_SECTION], {
118
118
  is: (hideBusBarSection) => !hideBusBarSection,
119
119
  then: (schema) => schema.min(1, "BusBarCountMustBeGreaterThanOrEqualToOne").required(YUP_REQUIRED)
120
120
  }),
121
- [FieldConstants.SECTION_COUNT]: number().nullable().when([FieldConstants.HIDE_BUS_BAR_SECTION], {
121
+ [FieldConstants.SECTION_COUNT]: number().typeError(YUP_NOT_TYPE_NUMBER).nullable().when([FieldConstants.HIDE_BUS_BAR_SECTION], {
122
122
  is: (hideBusBarSection) => !hideBusBarSection,
123
123
  then: (schema) => schema.min(1, "SectionCountMustBeGreaterThanOrEqualToOne").required(YUP_REQUIRED)
124
124
  }),
@@ -6,3 +6,4 @@
6
6
  */
7
7
  export * from './creation';
8
8
  export * from './voltage-level.type';
9
+ export * from './modification';
@@ -5,6 +5,8 @@ import { CouplingOmnibusCreation } from "./creation/coupling-omnibus/CouplingOmn
5
5
  import { VoltageLevelCreationForm } from "./creation/VoltageLevelCreationForm.js";
6
6
  import { SWITCH_TYPE, buildNewBusbarSections, getCreateSwitchesEmptyFormData, getCreateSwitchesValidationSchema, translateSwitchKinds, voltageLevelCreationDtoToForm, voltageLevelCreationEmptyFormData, voltageLevelCreationFormSchema, voltageLevelCreationFormToDto } from "./creation/voltageLevelCreation.utils.js";
7
7
  import { SwitchKind } from "./creation/voltageLevelCreation.types.js";
8
+ import { VoltageLevelModificationForm } from "./modification/VoltageLevelModificationForm.js";
9
+ import { voltageLevelModificationDtoToForm, voltageLevelModificationEmptyFormData, voltageLevelModificationFormSchema, voltageLevelModificationFormToDto } from "./modification/voltageLevelModification.utils.js";
8
10
  export {
9
11
  CouplingOmnibusCreation,
10
12
  CouplingOmnibusForm,
@@ -13,6 +15,7 @@ export {
13
15
  SwitchKind,
14
16
  SwitchesBetweenSections,
15
17
  VoltageLevelCreationForm,
18
+ VoltageLevelModificationForm,
16
19
  buildNewBusbarSections,
17
20
  getCreateSwitchesEmptyFormData,
18
21
  getCreateSwitchesValidationSchema,
@@ -20,5 +23,9 @@ export {
20
23
  voltageLevelCreationDtoToForm,
21
24
  voltageLevelCreationEmptyFormData,
22
25
  voltageLevelCreationFormSchema,
23
- voltageLevelCreationFormToDto
26
+ voltageLevelCreationFormToDto,
27
+ voltageLevelModificationDtoToForm,
28
+ voltageLevelModificationEmptyFormData,
29
+ voltageLevelModificationFormSchema,
30
+ voltageLevelModificationFormToDto
24
31
  };
@@ -0,0 +1,5 @@
1
+ import { VoltageLevelDto } from './voltageLevelModification.types';
2
+ export interface VoltageLevelModificationFormProps {
3
+ voltageLevelToModify?: VoltageLevelDto | null;
4
+ }
5
+ export declare function VoltageLevelModificationForm({ voltageLevelToModify }: Readonly<VoltageLevelModificationFormProps>): import("react/jsx-runtime").JSX.Element;