@gridsuite/commons-ui 0.178.0 → 0.180.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 (118) hide show
  1. package/dist/components/index.js +79 -1
  2. package/dist/components/inputs/index.js +2 -0
  3. package/dist/components/inputs/reactHookForm/CheckboxNullableInput.d.ts +15 -0
  4. package/dist/components/inputs/reactHookForm/CheckboxNullableInput.js +75 -0
  5. package/dist/components/inputs/reactHookForm/index.d.ts +1 -0
  6. package/dist/components/inputs/reactHookForm/index.js +2 -0
  7. package/dist/components/network-modifications/common/connectivity/BranchConnectivityForm.d.ts +7 -0
  8. package/dist/components/network-modifications/common/connectivity/BranchConnectivityForm.js +63 -0
  9. package/dist/components/network-modifications/common/connectivity/ConnectivityForm.d.ts +37 -0
  10. package/dist/components/network-modifications/common/connectivity/ConnectivityForm.js +267 -0
  11. package/dist/components/network-modifications/common/connectivity/connectivity.type.d.ts +34 -0
  12. package/dist/components/network-modifications/common/connectivity/connectivity.type.js +1 -0
  13. package/dist/components/network-modifications/common/connectivity/connectivityForm.utils.d.ts +241 -0
  14. package/dist/components/network-modifications/common/connectivity/connectivityForm.utils.js +196 -0
  15. package/dist/components/network-modifications/common/connectivity/index.d.ts +10 -0
  16. package/dist/components/network-modifications/common/connectivity/index.js +25 -0
  17. package/dist/components/network-modifications/common/index.d.ts +4 -1
  18. package/dist/components/network-modifications/common/index.js +56 -1
  19. package/dist/components/network-modifications/common/measurements/BranchActiveReactivePowerMeasurementsForm.d.ts +2 -0
  20. package/dist/components/network-modifications/common/measurements/BranchActiveReactivePowerMeasurementsForm.js +37 -0
  21. package/dist/components/network-modifications/common/measurements/PowerMeasurementsForm.d.ts +9 -0
  22. package/dist/components/network-modifications/common/measurements/PowerMeasurementsForm.js +52 -0
  23. package/dist/components/network-modifications/common/measurements/PowerWithValidityForm.d.ts +2 -0
  24. package/dist/components/network-modifications/common/measurements/PowerWithValidityForm.js +74 -0
  25. package/dist/components/network-modifications/common/measurements/branchActiveReactivePowerForm.utils.d.ts +56 -0
  26. package/dist/components/network-modifications/common/measurements/branchActiveReactivePowerForm.utils.js +69 -0
  27. package/dist/components/network-modifications/common/measurements/index.d.ts +13 -0
  28. package/dist/components/network-modifications/common/measurements/index.js +26 -0
  29. package/dist/components/network-modifications/common/measurements/injectionActiveReactivePowerForm.utils.d.ts +58 -0
  30. package/dist/components/network-modifications/common/measurements/injectionActiveReactivePowerForm.utils.js +55 -0
  31. package/dist/components/network-modifications/common/measurements/measurement.type.d.ts +13 -0
  32. package/dist/components/network-modifications/common/measurements/measurement.type.js +1 -0
  33. package/dist/components/network-modifications/common/measurements/powerWithValidity.utils.d.ts +22 -0
  34. package/dist/components/network-modifications/common/measurements/powerWithValidity.utils.js +36 -0
  35. package/dist/components/network-modifications/common/setpoints/SetPointsForm.d.ts +15 -0
  36. package/dist/components/network-modifications/common/setpoints/SetPointsForm.js +71 -0
  37. package/dist/components/network-modifications/common/setpoints/index.d.ts +8 -0
  38. package/dist/components/network-modifications/common/setpoints/index.js +10 -0
  39. package/dist/components/network-modifications/common/setpoints/setPoints.utils.d.ts +16 -0
  40. package/dist/components/network-modifications/common/setpoints/setPoints.utils.js +62 -0
  41. package/dist/components/network-modifications/index.d.ts +1 -0
  42. package/dist/components/network-modifications/index.js +71 -1
  43. package/dist/components/network-modifications/load/common/LoadDialogHeader.d.ts +7 -0
  44. package/dist/components/network-modifications/load/common/LoadDialogHeader.js +103 -0
  45. package/dist/components/network-modifications/load/common/LoadDialogTabs.d.ts +14 -0
  46. package/dist/components/network-modifications/load/common/LoadDialogTabs.js +49 -0
  47. package/dist/components/network-modifications/load/common/LoadDialogTabsContent.d.ts +8 -0
  48. package/dist/components/network-modifications/load/common/LoadDialogTabsContent.js +61 -0
  49. package/dist/components/network-modifications/load/common/LoadForm.d.ts +5 -0
  50. package/dist/components/network-modifications/load/common/LoadForm.js +73 -0
  51. package/dist/components/network-modifications/load/common/index.d.ts +12 -0
  52. package/dist/components/network-modifications/load/common/index.js +12 -0
  53. package/dist/components/network-modifications/load/common/load.types.d.ts +16 -0
  54. package/dist/components/network-modifications/load/common/load.types.js +1 -0
  55. package/dist/components/network-modifications/load/common/load.utils.d.ts +11 -0
  56. package/dist/components/network-modifications/load/common/load.utils.js +8 -0
  57. package/dist/components/network-modifications/load/creation/index.d.ts +8 -0
  58. package/dist/components/network-modifications/load/creation/index.js +7 -0
  59. package/dist/components/network-modifications/load/creation/loadCreation.types.d.ts +16 -0
  60. package/dist/components/network-modifications/load/creation/loadCreation.types.js +1 -0
  61. package/dist/components/network-modifications/load/creation/loadCreation.utils.d.ts +53 -0
  62. package/dist/components/network-modifications/load/creation/loadCreation.utils.js +98 -0
  63. package/dist/components/network-modifications/load/index.d.ts +8 -0
  64. package/dist/components/network-modifications/load/index.js +17 -0
  65. package/dist/components/network-modifications/substation/creation/substationCreation.utils.js +2 -1
  66. package/dist/components/network-modifications/voltage-level/creation/substation-creation/SubstationAutocompleteAddButton.js +3 -0
  67. package/dist/components/network-modifications/voltage-level/index.d.ts +1 -0
  68. package/dist/components/network-modifications/voltage-level/voltage-level.type.d.ts +12 -0
  69. package/dist/components/network-modifications/voltage-level/voltage-level.type.js +1 -0
  70. package/dist/components/parameters/common/utils.d.ts +25 -2
  71. package/dist/components/parameters/common/utils.js +40 -1
  72. package/dist/components/parameters/dynamic-margin-calculation/use-dynamic-margin-calculation-parameters-form.d.ts +2 -18
  73. package/dist/components/parameters/dynamic-margin-calculation/use-dynamic-margin-calculation-parameters-form.js +2 -38
  74. package/dist/components/parameters/dynamic-security-analysis/constants.d.ts +9 -0
  75. package/dist/components/parameters/dynamic-security-analysis/constants.js +8 -0
  76. package/dist/components/parameters/dynamic-security-analysis/contingency-parameters.d.ts +10 -0
  77. package/dist/components/parameters/dynamic-security-analysis/contingency-parameters.js +65 -0
  78. package/dist/components/parameters/dynamic-security-analysis/dynamic-security-analysis-inline.d.ts +10 -0
  79. package/dist/components/parameters/dynamic-security-analysis/dynamic-security-analysis-inline.js +130 -0
  80. package/dist/components/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.d.ts +9 -0
  81. package/dist/components/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.js +103 -0
  82. package/dist/components/parameters/dynamic-security-analysis/index.d.ts +8 -0
  83. package/dist/components/parameters/dynamic-security-analysis/index.js +8 -0
  84. package/dist/components/parameters/dynamic-security-analysis/scenario-parameters.d.ts +10 -0
  85. package/dist/components/parameters/dynamic-security-analysis/scenario-parameters.js +16 -0
  86. package/dist/components/parameters/dynamic-security-analysis/use-dynamic-security-analysis-parameters-form.d.ts +51 -0
  87. package/dist/components/parameters/dynamic-security-analysis/use-dynamic-security-analysis-parameters-form.js +181 -0
  88. package/dist/components/parameters/index.d.ts +1 -0
  89. package/dist/components/parameters/index.js +6 -0
  90. package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +24 -4
  91. package/dist/components/parameters/util/make-component-utils.d.ts +17 -0
  92. package/dist/components/parameters/util/make-component-utils.js +96 -0
  93. package/dist/components/parameters/util/styles.d.ts +38 -0
  94. package/dist/components/parameters/util/styles.js +41 -0
  95. package/dist/index.js +95 -4
  96. package/dist/services/dynamic-security-analysis.d.ts +4 -0
  97. package/dist/services/dynamic-security-analysis.js +29 -0
  98. package/dist/services/index.d.ts +1 -0
  99. package/dist/services/index.js +6 -1
  100. package/dist/services/sensitivity-analysis.d.ts +1 -1
  101. package/dist/services/sensitivity-analysis.js +3 -2
  102. package/dist/services/utils.d.ts +2 -0
  103. package/dist/services/utils.js +3 -0
  104. package/dist/translations/en/networkModificationsEn.d.ts +17 -0
  105. package/dist/translations/en/networkModificationsEn.js +18 -1
  106. package/dist/translations/fr/networkModificationsFr.d.ts +17 -0
  107. package/dist/translations/fr/networkModificationsFr.js +18 -1
  108. package/dist/utils/constants/fieldConstants.d.ts +24 -1
  109. package/dist/utils/constants/fieldConstants.js +24 -1
  110. package/dist/utils/index.js +10 -2
  111. package/dist/utils/ts-utils.d.ts +5 -6
  112. package/dist/utils/ts-utils.js +11 -0
  113. package/dist/utils/types/elementType.d.ts +1 -0
  114. package/dist/utils/types/elementType.js +1 -0
  115. package/dist/utils/types/equipmentType.d.ts +18 -0
  116. package/dist/utils/types/equipmentType.js +27 -1
  117. package/dist/utils/types/index.js +8 -2
  118. package/package.json +1 -1
@@ -0,0 +1,26 @@
1
+ import { getPowerWithValidityEditData, getPowerWithValidityEmptyFormData, getPowerWithValidityValidationSchema } from "./powerWithValidity.utils.js";
2
+ import { getInjectionActiveReactivePowerEditData, getInjectionActiveReactivePowerEditDataProperties, getInjectionActiveReactivePowerEmptyFormData, getInjectionActiveReactivePowerEmptyFormDataProperties, getInjectionActiveReactivePowerValidationSchema, getInjectionActiveReactivePowerValidationSchemaProperties } from "./injectionActiveReactivePowerForm.utils.js";
3
+ import { getBranchActiveReactivePowerEditData, getBranchActiveReactivePowerEditDataProperties, getBranchActiveReactivePowerEmptyFormData, getBranchActiveReactivePowerEmptyFormDataProperties, getBranchActiveReactivePowerValidationSchema, getBranchActiveReactivePowerValidationSchemaProperties } from "./branchActiveReactivePowerForm.utils.js";
4
+ import { PowerWithValidityForm } from "./PowerWithValidityForm.js";
5
+ import { PowerMeasurementsForm } from "./PowerMeasurementsForm.js";
6
+ import { BranchActiveReactivePowerMeasurementsForm } from "./BranchActiveReactivePowerMeasurementsForm.js";
7
+ export {
8
+ BranchActiveReactivePowerMeasurementsForm,
9
+ PowerMeasurementsForm,
10
+ PowerWithValidityForm,
11
+ getBranchActiveReactivePowerEditData,
12
+ getBranchActiveReactivePowerEditDataProperties,
13
+ getBranchActiveReactivePowerEmptyFormData,
14
+ getBranchActiveReactivePowerEmptyFormDataProperties,
15
+ getBranchActiveReactivePowerValidationSchema,
16
+ getBranchActiveReactivePowerValidationSchemaProperties,
17
+ getInjectionActiveReactivePowerEditData,
18
+ getInjectionActiveReactivePowerEditDataProperties,
19
+ getInjectionActiveReactivePowerEmptyFormData,
20
+ getInjectionActiveReactivePowerEmptyFormDataProperties,
21
+ getInjectionActiveReactivePowerValidationSchema,
22
+ getInjectionActiveReactivePowerValidationSchemaProperties,
23
+ getPowerWithValidityEditData,
24
+ getPowerWithValidityEmptyFormData,
25
+ getPowerWithValidityValidationSchema
26
+ };
@@ -0,0 +1,58 @@
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 declare function getInjectionActiveReactivePowerEmptyFormDataProperties(): {
8
+ [x: string]: {
9
+ value: null;
10
+ validity: null;
11
+ };
12
+ };
13
+ export declare function getInjectionActiveReactivePowerEmptyFormData(id: string): {
14
+ [id]: {
15
+ [x: string]: {
16
+ value: null;
17
+ validity: null;
18
+ };
19
+ };
20
+ };
21
+ export declare const getInjectionActiveReactivePowerValidationSchemaProperties: () => import('yup').ObjectSchema<{
22
+ [x: string]: {
23
+ validity?: boolean | null | undefined;
24
+ value?: number | null | undefined;
25
+ };
26
+ }, import('yup').AnyObject, {
27
+ [x: string]: {
28
+ value: undefined;
29
+ validity: undefined;
30
+ };
31
+ }, "">;
32
+ export declare const getInjectionActiveReactivePowerValidationSchema: (id: string) => {
33
+ [x: string]: import('yup').ObjectSchema<{
34
+ [x: string]: {
35
+ validity?: boolean | null | undefined;
36
+ value?: number | null | undefined;
37
+ };
38
+ }, import('yup').AnyObject, {
39
+ [x: string]: {
40
+ value: undefined;
41
+ validity: undefined;
42
+ };
43
+ }, "">;
44
+ };
45
+ export declare function getInjectionActiveReactivePowerEditDataProperties(injectionData: any): {
46
+ [x: string]: {
47
+ value: number;
48
+ validity: boolean;
49
+ };
50
+ };
51
+ export declare function getInjectionActiveReactivePowerEditData(id: string, injectionData: any): {
52
+ [id]: {
53
+ [x: string]: {
54
+ value: number;
55
+ validity: boolean;
56
+ };
57
+ };
58
+ };
@@ -0,0 +1,55 @@
1
+ import { object } from "yup";
2
+ import { getPowerWithValidityEmptyFormData, getPowerWithValidityValidationSchema, getPowerWithValidityEditData } from "./powerWithValidity.utils.js";
3
+ import { FieldConstants } from "../../../../utils/constants/fieldConstants.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
+ function getInjectionActiveReactivePowerEmptyFormDataProperties() {
10
+ return {
11
+ ...getPowerWithValidityEmptyFormData(FieldConstants.MEASUREMENT_P),
12
+ ...getPowerWithValidityEmptyFormData(FieldConstants.MEASUREMENT_Q)
13
+ };
14
+ }
15
+ function getInjectionActiveReactivePowerEmptyFormData(id) {
16
+ return {
17
+ [id]: {
18
+ ...getInjectionActiveReactivePowerEmptyFormDataProperties()
19
+ }
20
+ };
21
+ }
22
+ const getInjectionActiveReactivePowerValidationSchemaProperties = () => object().shape({
23
+ ...getPowerWithValidityValidationSchema(FieldConstants.MEASUREMENT_P),
24
+ ...getPowerWithValidityValidationSchema(FieldConstants.MEASUREMENT_Q)
25
+ });
26
+ const getInjectionActiveReactivePowerValidationSchema = (id) => ({
27
+ [id]: getInjectionActiveReactivePowerValidationSchemaProperties()
28
+ });
29
+ function getInjectionActiveReactivePowerEditDataProperties(injectionData) {
30
+ return {
31
+ ...getPowerWithValidityEditData(FieldConstants.MEASUREMENT_P, {
32
+ value: injectionData?.pMeasurementValue?.value,
33
+ validity: injectionData?.pMeasurementValidity?.value
34
+ }),
35
+ ...getPowerWithValidityEditData(FieldConstants.MEASUREMENT_Q, {
36
+ value: injectionData?.qMeasurementValue?.value,
37
+ validity: injectionData?.qMeasurementValidity?.value
38
+ })
39
+ };
40
+ }
41
+ function getInjectionActiveReactivePowerEditData(id, injectionData) {
42
+ return {
43
+ [id]: {
44
+ ...getInjectionActiveReactivePowerEditDataProperties(injectionData)
45
+ }
46
+ };
47
+ }
48
+ export {
49
+ getInjectionActiveReactivePowerEditData,
50
+ getInjectionActiveReactivePowerEditDataProperties,
51
+ getInjectionActiveReactivePowerEmptyFormData,
52
+ getInjectionActiveReactivePowerEmptyFormDataProperties,
53
+ getInjectionActiveReactivePowerValidationSchema,
54
+ getInjectionActiveReactivePowerValidationSchemaProperties
55
+ };
@@ -0,0 +1,13 @@
1
+ import { FieldType } from '../../../../utils';
2
+ export interface BranchActiveReactivePowerMeasurementsFormProps {
3
+ equipmentToModify: any;
4
+ }
5
+ export interface MeasurementInfo {
6
+ value: number;
7
+ validity: boolean;
8
+ }
9
+ export interface MeasurementProps {
10
+ id: string;
11
+ field: FieldType;
12
+ measurement?: MeasurementInfo;
13
+ }
@@ -0,0 +1,22 @@
1
+ import { MeasurementInfo } from './measurement.type';
2
+ export declare function getPowerWithValidityEmptyFormData(id: string): {
3
+ [id]: {
4
+ value: null;
5
+ validity: null;
6
+ };
7
+ };
8
+ export declare function getPowerWithValidityValidationSchema(id: string): {
9
+ [id]: import('yup').ObjectSchema<{
10
+ value: number | null | undefined;
11
+ validity: boolean | null | undefined;
12
+ }, import('yup').AnyObject, {
13
+ value: undefined;
14
+ validity: undefined;
15
+ }, "">;
16
+ };
17
+ export declare function getPowerWithValidityEditData(id: string, measurement: MeasurementInfo): {
18
+ [id]: {
19
+ value: number;
20
+ validity: boolean;
21
+ };
22
+ };
@@ -0,0 +1,36 @@
1
+ import { object, boolean, number } from "yup";
2
+ import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
3
+ import "../../../../utils/conversionUtils.js";
4
+ import "../../../../utils/types/equipmentType.js";
5
+ import "react/jsx-runtime";
6
+ import "@mui/icons-material";
7
+ import "../../../../utils/yupConfig.js";
8
+ function getPowerWithValidityEmptyFormData(id) {
9
+ return {
10
+ [id]: {
11
+ [FieldConstants.VALUE]: null,
12
+ [FieldConstants.VALIDITY]: null
13
+ }
14
+ };
15
+ }
16
+ function getPowerWithValidityValidationSchema(id) {
17
+ return {
18
+ [id]: object().shape({
19
+ [FieldConstants.VALUE]: number().nullable(),
20
+ [FieldConstants.VALIDITY]: boolean().nullable()
21
+ })
22
+ };
23
+ }
24
+ function getPowerWithValidityEditData(id, measurement) {
25
+ return {
26
+ [id]: {
27
+ [FieldConstants.VALUE]: measurement?.value ?? null,
28
+ [FieldConstants.VALIDITY]: measurement?.validity ?? null
29
+ }
30
+ };
31
+ }
32
+ export {
33
+ getPowerWithValidityEditData,
34
+ getPowerWithValidityEmptyFormData,
35
+ getPowerWithValidityValidationSchema
36
+ };
@@ -0,0 +1,15 @@
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 SetPointsFormProps {
8
+ previousValues?: {
9
+ activePower?: number | null;
10
+ reactivePower?: number | null;
11
+ };
12
+ isModification?: boolean;
13
+ }
14
+ export declare function SetPointsForm({ previousValues, isModification }: Readonly<SetPointsFormProps>): import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -0,0 +1,71 @@
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import { Grid } from "@mui/material";
3
+ import GridSection from "../../../grid/grid-section.js";
4
+ import GridItem from "../../../grid/grid-item.js";
5
+ import { ActivePowerAdornment, ReactivePowerAdornment } from "../../../../utils/constants/adornments.js";
6
+ import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
7
+ import "../../../../utils/conversionUtils.js";
8
+ import "../../../../utils/types/equipmentType.js";
9
+ import "@mui/icons-material";
10
+ import "../../../../utils/yupConfig.js";
11
+ import "react-intl";
12
+ import "../../../overflowableText/OverflowableText.js";
13
+ import "react";
14
+ import "react-hook-form";
15
+ import "localized-countries";
16
+ import "localized-countries/data/fr";
17
+ import "localized-countries/data/en";
18
+ import "notistack";
19
+ import "../../../inputs/reactHookForm/provider/CustomFormProvider.js";
20
+ import "yup";
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 { FloatInput } from "../../../inputs/reactHookForm/numbers/FloatInput.js";
28
+ import "../../../inputs/reactHookForm/numbers/RangeInput.js";
29
+ import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
30
+ import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
31
+ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
32
+ import "@material-symbols/svg-400/outlined/add_notes.svg?react";
33
+ import "../../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
34
+ import "@react-querybuilder/material";
35
+ import "../../../filter/expert/expertFilterConstants.js";
36
+ import "../../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
37
+ import "uuid";
38
+ import "../../../inputs/reactQueryBuilder/PropertyValueEditor.js";
39
+ import "react-querybuilder";
40
+ function SetPointsForm({ previousValues, isModification = false }) {
41
+ const activePowerSetPointField = /* @__PURE__ */ jsx(
42
+ FloatInput,
43
+ {
44
+ name: FieldConstants.ACTIVE_POWER_SET_POINT,
45
+ label: "ActivePowerText",
46
+ adornment: ActivePowerAdornment,
47
+ previousValue: previousValues?.activePower ?? void 0,
48
+ clearable: isModification
49
+ }
50
+ );
51
+ const reactivePowerSetPointField = /* @__PURE__ */ jsx(
52
+ FloatInput,
53
+ {
54
+ name: FieldConstants.REACTIVE_POWER_SET_POINT,
55
+ label: "ReactivePowerText",
56
+ adornment: ReactivePowerAdornment,
57
+ previousValue: previousValues?.reactivePower ?? void 0,
58
+ clearable: isModification
59
+ }
60
+ );
61
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
62
+ /* @__PURE__ */ jsx(GridSection, { title: "Setpoints" }),
63
+ /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
64
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: activePowerSetPointField }),
65
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: reactivePowerSetPointField })
66
+ ] })
67
+ ] });
68
+ }
69
+ export {
70
+ SetPointsForm
71
+ };
@@ -0,0 +1,8 @@
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 './setPoints.utils';
8
+ export * from './SetPointsForm';
@@ -0,0 +1,10 @@
1
+ import { getActivePowerSetPointSchema, getReactivePowerSetPointSchema, getSetPointsEmptyFormData, getSetPointsSchema, testValueWithinPowerInterval } from "./setPoints.utils.js";
2
+ import { SetPointsForm } from "./SetPointsForm.js";
3
+ export {
4
+ SetPointsForm,
5
+ getActivePowerSetPointSchema,
6
+ getReactivePowerSetPointSchema,
7
+ getSetPointsEmptyFormData,
8
+ getSetPointsSchema,
9
+ testValueWithinPowerInterval
10
+ };
@@ -0,0 +1,16 @@
1
+ import { TestContext } from 'yup';
2
+ export declare const getSetPointsEmptyFormData: (_isEquipmentModification?: boolean) => {
3
+ activePowerSetpoint: null;
4
+ reactivePowerSetpoint: null;
5
+ };
6
+ export declare const testValueWithinPowerInterval: (value: number | null, context: TestContext) => boolean;
7
+ export declare const getActivePowerSetPointSchema: (isEquipmentModification?: boolean) => {
8
+ activePowerSetpoint: import('yup').NumberSchema<number | undefined, import('yup').AnyObject, undefined, "">;
9
+ };
10
+ export declare const getReactivePowerSetPointSchema: (isEquipmentModification?: boolean) => {
11
+ reactivePowerSetpoint: import('yup').NumberSchema<number | null | undefined, import('yup').AnyObject, undefined, "">;
12
+ };
13
+ export declare const getSetPointsSchema: (isEquipmentModification?: boolean) => {
14
+ reactivePowerSetpoint: import('yup').NumberSchema<number | null | undefined, import('yup').AnyObject, undefined, "">;
15
+ activePowerSetpoint: import('yup').NumberSchema<number | undefined, import('yup').AnyObject, undefined, "">;
16
+ };
@@ -0,0 +1,62 @@
1
+ import { number } from "yup";
2
+ import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
3
+ import "../../../../utils/conversionUtils.js";
4
+ import "../../../../utils/types/equipmentType.js";
5
+ import "react/jsx-runtime";
6
+ import "@mui/icons-material";
7
+ import "../../../../utils/yupConfig.js";
8
+ const getSetPointsEmptyFormData = (_isEquipmentModification = false) => ({
9
+ [FieldConstants.ACTIVE_POWER_SET_POINT]: null,
10
+ [FieldConstants.REACTIVE_POWER_SET_POINT]: null
11
+ });
12
+ const testValueWithinPowerInterval = (value, context) => {
13
+ const minActivePower = context.parent[FieldConstants.MINIMUM_ACTIVE_POWER];
14
+ const maxActivePower = context.parent[FieldConstants.MAXIMUM_ACTIVE_POWER];
15
+ if (value === null || value === void 0) {
16
+ return true;
17
+ }
18
+ if (minActivePower === null || maxActivePower === null) {
19
+ return false;
20
+ }
21
+ return value >= minActivePower && value <= maxActivePower;
22
+ };
23
+ const testValueWithinPowerIntervalOrEqualToZero = (value, context) => {
24
+ if (value === 0) {
25
+ return true;
26
+ }
27
+ return testValueWithinPowerInterval(value, context);
28
+ };
29
+ const getActivePowerSetPointSchema = (isEquipmentModification = false) => ({
30
+ [FieldConstants.ACTIVE_POWER_SET_POINT]: number().when([], {
31
+ is: () => isEquipmentModification,
32
+ then: (schema) => {
33
+ return schema.nullable();
34
+ }
35
+ }).when([], {
36
+ is: () => !isEquipmentModification,
37
+ then: (schema) => {
38
+ return schema.required().nonNullable("FieldIsRequired").test(
39
+ "activePowerSetPoint",
40
+ "ActivePowerMustBeZeroOrBetweenMinAndMaxActivePower",
41
+ testValueWithinPowerIntervalOrEqualToZero
42
+ );
43
+ }
44
+ })
45
+ });
46
+ const getReactivePowerSetPointSchema = (isEquipmentModification = false) => ({
47
+ [FieldConstants.REACTIVE_POWER_SET_POINT]: number().nullable().when([FieldConstants.VOLTAGE_REGULATION], {
48
+ is: (value) => !isEquipmentModification && !value,
49
+ then: (schema) => schema.required()
50
+ })
51
+ });
52
+ const getSetPointsSchema = (isEquipmentModification = false) => ({
53
+ ...getActivePowerSetPointSchema(isEquipmentModification),
54
+ ...getReactivePowerSetPointSchema(isEquipmentModification)
55
+ });
56
+ export {
57
+ getActivePowerSetPointSchema,
58
+ getReactivePowerSetPointSchema,
59
+ getSetPointsEmptyFormData,
60
+ getSetPointsSchema,
61
+ testValueWithinPowerInterval
62
+ };
@@ -7,3 +7,4 @@
7
7
  export * from './common';
8
8
  export * from './substation';
9
9
  export * from './voltage-level';
10
+ export * from './load';
@@ -1,7 +1,18 @@
1
+ import { filledTextField, italicFontTextField, standardTextField } from "./common/form.utils.js";
1
2
  import { PropertiesForm } from "./common/properties/PropertiesForm.js";
2
3
  import { PropertyForm } from "./common/properties/PropertyForm.js";
3
4
  import { copyEquipmentPropertiesForCreation, createPropertyModification, creationPropertiesSchema, emptyProperties, fetchPredefinedProperties, getConcatenatedProperties, getFilledPropertiesFromModification, getPropertiesFromModification, getPropertyValue, initializedProperty, mergeModificationAndEquipmentProperties, modificationPropertiesSchema, toModificationProperties } from "./common/properties/propertyUtils.js";
4
- import { filledTextField, italicFontTextField, standardTextField } from "./common/form.utils.js";
5
+ import { getPowerWithValidityEditData, getPowerWithValidityEmptyFormData, getPowerWithValidityValidationSchema } from "./common/measurements/powerWithValidity.utils.js";
6
+ import { getInjectionActiveReactivePowerEditData, getInjectionActiveReactivePowerEditDataProperties, getInjectionActiveReactivePowerEmptyFormData, getInjectionActiveReactivePowerEmptyFormDataProperties, getInjectionActiveReactivePowerValidationSchema, getInjectionActiveReactivePowerValidationSchemaProperties } from "./common/measurements/injectionActiveReactivePowerForm.utils.js";
7
+ import { getBranchActiveReactivePowerEditData, getBranchActiveReactivePowerEditDataProperties, getBranchActiveReactivePowerEmptyFormData, getBranchActiveReactivePowerEmptyFormDataProperties, getBranchActiveReactivePowerValidationSchema, getBranchActiveReactivePowerValidationSchemaProperties } from "./common/measurements/branchActiveReactivePowerForm.utils.js";
8
+ import { PowerWithValidityForm } from "./common/measurements/PowerWithValidityForm.js";
9
+ import { PowerMeasurementsForm } from "./common/measurements/PowerMeasurementsForm.js";
10
+ import { BranchActiveReactivePowerMeasurementsForm } from "./common/measurements/BranchActiveReactivePowerMeasurementsForm.js";
11
+ import { getActivePowerSetPointSchema, getReactivePowerSetPointSchema, getSetPointsEmptyFormData, getSetPointsSchema, testValueWithinPowerInterval } from "./common/setpoints/setPoints.utils.js";
12
+ import { SetPointsForm } from "./common/setpoints/SetPointsForm.js";
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
+ import { ConnectivityForm } from "./common/connectivity/ConnectivityForm.js";
15
+ import { BranchConnectivityForm } from "./common/connectivity/BranchConnectivityForm.js";
5
16
  import { SubstationCreationForm } from "./substation/creation/SubstationCreationForm.js";
6
17
  import { substationCreationDtoToForm, substationCreationEmptyFormData, substationCreationFormSchema, substationCreationFormToDto } from "./substation/creation/substationCreation.utils.js";
7
18
  import { SubstationModificationForm } from "./substation/modification/SubstationModificationForm.js";
@@ -13,13 +24,30 @@ import { CouplingOmnibusCreation } from "./voltage-level/creation/coupling-omnib
13
24
  import { VoltageLevelCreationForm } from "./voltage-level/creation/VoltageLevelCreationForm.js";
14
25
  import { SWITCH_TYPE, buildNewBusbarSections, getCreateSwitchesEmptyFormData, getCreateSwitchesValidationSchema, translateSwitchKinds, voltageLevelCreationDtoToForm, voltageLevelCreationEmptyFormData, voltageLevelCreationFormSchema, voltageLevelCreationFormToDto } from "./voltage-level/creation/voltageLevelCreation.utils.js";
15
26
  import { SwitchKind } from "./voltage-level/creation/voltageLevelCreation.types.js";
27
+ import { LoadDialogTab } from "./load/common/load.utils.js";
28
+ import { LoadDialogTabs } from "./load/common/LoadDialogTabs.js";
29
+ import { LoadDialogTabsContent } from "./load/common/LoadDialogTabsContent.js";
30
+ import { LoadDialogHeader } from "./load/common/LoadDialogHeader.js";
31
+ import { LoadForm } from "./load/common/LoadForm.js";
32
+ import { loadCreationDtoToForm, loadCreationEmptyFormData, loadCreationFormSchema, loadCreationFormToDto } from "./load/creation/loadCreation.utils.js";
16
33
  export {
34
+ BranchActiveReactivePowerMeasurementsForm,
35
+ BranchConnectivityForm,
36
+ ConnectivityForm,
17
37
  CouplingOmnibusCreation,
18
38
  CouplingOmnibusForm,
19
39
  CreateSwitchesDialog,
40
+ LoadDialogHeader,
41
+ LoadDialogTab,
42
+ LoadDialogTabs,
43
+ LoadDialogTabsContent,
44
+ LoadForm,
45
+ PowerMeasurementsForm,
46
+ PowerWithValidityForm,
20
47
  PropertiesForm,
21
48
  PropertyForm,
22
49
  SWITCH_TYPE,
50
+ SetPointsForm,
23
51
  SubstationCreationForm,
24
52
  SubstationModificationForm,
25
53
  SwitchKind,
@@ -27,19 +55,60 @@ export {
27
55
  VoltageLevelCreationForm,
28
56
  buildNewBusbarSections,
29
57
  copyEquipmentPropertiesForCreation,
58
+ createConnectivityData,
30
59
  createPropertyModification,
31
60
  creationPropertiesSchema,
32
61
  emptyProperties,
33
62
  fetchPredefinedProperties,
34
63
  filledTextField,
64
+ getActivePowerSetPointSchema,
65
+ getBranchActiveReactivePowerEditData,
66
+ getBranchActiveReactivePowerEditDataProperties,
67
+ getBranchActiveReactivePowerEmptyFormData,
68
+ getBranchActiveReactivePowerEmptyFormDataProperties,
69
+ getBranchActiveReactivePowerValidationSchema,
70
+ getBranchActiveReactivePowerValidationSchemaProperties,
71
+ getCon1andCon2WithPositionValidationSchema,
35
72
  getConcatenatedProperties,
73
+ getConnectivityBusBarSectionData,
74
+ getConnectivityData,
75
+ getConnectivityFormData,
76
+ getConnectivityFormDataProps,
77
+ getConnectivityPropertiesData,
78
+ getConnectivityPropertiesEmptyFormData,
79
+ getConnectivityPropertiesValidationSchema,
80
+ getConnectivityVoltageLevelData,
81
+ getConnectivityWithPositionEmptyFormData,
82
+ getConnectivityWithPositionEmptyFormDataProps,
83
+ getConnectivityWithPositionSchema,
84
+ getConnectivityWithPositionValidationSchema,
85
+ getConnectivityWithoutPositionEmptyFormData,
86
+ getConnectivityWithoutPositionValidationSchema,
87
+ getCont1Cont2WithPositionEmptyFormData,
36
88
  getCreateSwitchesEmptyFormData,
37
89
  getCreateSwitchesValidationSchema,
38
90
  getFilledPropertiesFromModification,
91
+ getInjectionActiveReactivePowerEditData,
92
+ getInjectionActiveReactivePowerEditDataProperties,
93
+ getInjectionActiveReactivePowerEmptyFormData,
94
+ getInjectionActiveReactivePowerEmptyFormDataProperties,
95
+ getInjectionActiveReactivePowerValidationSchema,
96
+ getInjectionActiveReactivePowerValidationSchemaProperties,
97
+ getNewVoltageLevelData,
98
+ getPowerWithValidityEditData,
99
+ getPowerWithValidityEmptyFormData,
100
+ getPowerWithValidityValidationSchema,
39
101
  getPropertiesFromModification,
40
102
  getPropertyValue,
103
+ getReactivePowerSetPointSchema,
104
+ getSetPointsEmptyFormData,
105
+ getSetPointsSchema,
41
106
  initializedProperty,
42
107
  italicFontTextField,
108
+ loadCreationDtoToForm,
109
+ loadCreationEmptyFormData,
110
+ loadCreationFormSchema,
111
+ loadCreationFormToDto,
43
112
  mergeModificationAndEquipmentProperties,
44
113
  modificationPropertiesSchema,
45
114
  standardTextField,
@@ -51,6 +120,7 @@ export {
51
120
  substationModificationEmptyFormData,
52
121
  substationModificationFormSchema,
53
122
  substationModificationFormToDto,
123
+ testValueWithinPowerInterval,
54
124
  toModificationProperties,
55
125
  translateSwitchKinds,
56
126
  voltageLevelCreationDtoToForm,
@@ -0,0 +1,7 @@
1
+ import { LoadFormInfos } from './load.types';
2
+ export interface LoadDialogHeaderProps {
3
+ loadToModify?: LoadFormInfos | null;
4
+ equipmentId?: string | null;
5
+ isModification?: boolean;
6
+ }
7
+ export declare function LoadDialogHeader({ loadToModify, equipmentId, isModification, }: Readonly<LoadDialogHeaderProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,103 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { TextField, Box, Grid } from "@mui/material";
3
+ import { useIntl } from "react-intl";
4
+ import { filledTextField } from "../../common/form.utils.js";
5
+ import "react";
6
+ import "react-hook-form";
7
+ import "../../common/properties/propertyUtils.js";
8
+ import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
9
+ import "../../../../utils/conversionUtils.js";
10
+ import { getLoadTypeLabel, LOAD_TYPES } from "../../../../utils/types/equipmentType.js";
11
+ import "@mui/icons-material";
12
+ import "../../../../utils/yupConfig.js";
13
+ import GridItem from "../../../grid/grid-item.js";
14
+ import "../../../overflowableText/OverflowableText.js";
15
+ import "localized-countries";
16
+ import "localized-countries/data/fr";
17
+ import "localized-countries/data/en";
18
+ import "notistack";
19
+ import "../../../inputs/reactHookForm/provider/CustomFormProvider.js";
20
+ import "yup";
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 { TextInput } from "../../../inputs/reactHookForm/text/TextInput.js";
28
+ import "../../../inputs/reactHookForm/numbers/RangeInput.js";
29
+ import { SelectInput } from "../../../inputs/reactHookForm/selectInputs/SelectInput.js";
30
+ import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
31
+ import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
32
+ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
33
+ import "@material-symbols/svg-400/outlined/add_notes.svg?react";
34
+ import "../../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
35
+ import "@react-querybuilder/material";
36
+ import "../../../filter/expert/expertFilterConstants.js";
37
+ import "../../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
38
+ import "uuid";
39
+ import "../../../inputs/reactQueryBuilder/PropertyValueEditor.js";
40
+ import "react-querybuilder";
41
+ function LoadDialogHeader({
42
+ loadToModify,
43
+ equipmentId,
44
+ isModification = false
45
+ }) {
46
+ const intl = useIntl();
47
+ const loadIdField = isModification ? /* @__PURE__ */ jsx(
48
+ TextField,
49
+ {
50
+ size: "small",
51
+ fullWidth: true,
52
+ label: "ID",
53
+ value: equipmentId,
54
+ InputProps: {
55
+ readOnly: true
56
+ },
57
+ disabled: true,
58
+ ...filledTextField
59
+ }
60
+ ) : /* @__PURE__ */ jsx(TextInput, { name: FieldConstants.EQUIPMENT_ID, label: "ID", formProps: { autoFocus: true, ...filledTextField } });
61
+ const loadNameField = /* @__PURE__ */ jsx(
62
+ TextInput,
63
+ {
64
+ name: FieldConstants.EQUIPMENT_NAME,
65
+ label: "Name",
66
+ formProps: filledTextField,
67
+ previousValue: loadToModify?.name,
68
+ clearable: true
69
+ }
70
+ );
71
+ const loadTypeField = /* @__PURE__ */ jsx(
72
+ SelectInput,
73
+ {
74
+ name: FieldConstants.LOAD_TYPE,
75
+ label: "loadType",
76
+ options: Object.values(LOAD_TYPES),
77
+ fullWidth: true,
78
+ size: "small",
79
+ formProps: filledTextField,
80
+ previousValue: loadToModify?.type && loadToModify.type !== "UNDEFINED" ? intl.formatMessage({
81
+ id: getLoadTypeLabel(loadToModify.type)
82
+ }) : void 0
83
+ }
84
+ );
85
+ return /* @__PURE__ */ jsx(
86
+ Box,
87
+ {
88
+ sx: {
89
+ display: "flex",
90
+ flexWrap: "wrap",
91
+ gap: "15px"
92
+ },
93
+ children: /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
94
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: loadIdField }),
95
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: loadNameField }),
96
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: loadTypeField })
97
+ ] })
98
+ }
99
+ );
100
+ }
101
+ export {
102
+ LoadDialogHeader
103
+ };