@gridsuite/commons-ui 0.224.0 → 0.225.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 (83) hide show
  1. package/dist/components/composite/dnd-table/dnd-table.d.ts +8 -4
  2. package/dist/components/composite/dnd-table/dnd-table.js +100 -160
  3. package/dist/components/composite/dnd-table/dnd-table.type.d.ts +17 -3
  4. package/dist/components/composite/dnd-table/dnd-table.type.js +2 -0
  5. package/dist/components/composite/dnd-table/index.d.ts +6 -1
  6. package/dist/components/composite/dnd-table/index.js +6 -6
  7. package/dist/components/composite/index.js +6 -6
  8. package/dist/components/index.js +6 -6
  9. package/dist/features/index.js +16 -0
  10. package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/reactiveCapability.utils.d.ts +4 -3
  11. package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/reactiveCapability.utils.js +7 -30
  12. package/dist/features/network-modifications/common/reactiveLimits/reactiveLimits.utils.d.ts +2 -0
  13. package/dist/features/network-modifications/generator/generatorDialog.type.d.ts +0 -60
  14. package/dist/features/network-modifications/generator/index.js +17 -1
  15. package/dist/features/network-modifications/generator/modification/GeneratorDialogHeader.d.ts +6 -0
  16. package/dist/features/network-modifications/generator/modification/GeneratorDialogHeader.js +109 -0
  17. package/dist/features/network-modifications/generator/modification/GeneratorDialogTabs.d.ts +13 -0
  18. package/dist/features/network-modifications/generator/modification/GeneratorDialogTabs.js +55 -0
  19. package/dist/features/network-modifications/generator/modification/GeneratorDialogTabsContent.d.ts +12 -0
  20. package/dist/features/network-modifications/generator/modification/GeneratorDialogTabsContent.js +277 -0
  21. package/dist/features/network-modifications/generator/modification/GeneratorModificationForm.d.ts +10 -0
  22. package/dist/features/network-modifications/generator/modification/GeneratorModificationForm.js +52 -0
  23. package/dist/features/network-modifications/generator/modification/generatorModification.types.d.ts +3 -5
  24. package/dist/features/network-modifications/generator/modification/generatorModification.utils.d.ts +140 -0
  25. package/dist/features/network-modifications/generator/modification/generatorModification.utils.js +211 -0
  26. package/dist/features/network-modifications/generator/modification/generatorTabs.utils.d.ts +8 -0
  27. package/dist/features/network-modifications/generator/modification/generatorTabs.utils.js +56 -0
  28. package/dist/features/network-modifications/generator/modification/index.d.ts +6 -0
  29. package/dist/features/network-modifications/generator/modification/index.js +18 -1
  30. package/dist/features/network-modifications/index.js +16 -0
  31. package/dist/features/parameters/common/contingency-table/columns-definitions.d.ts +1 -1
  32. package/dist/features/parameters/common/contingency-table/columns-definitions.js +1 -1
  33. package/dist/features/parameters/common/parameter-table-field/parameter-table-field.js +2 -2
  34. package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-inline.js +1 -1
  35. package/dist/features/parameters/dynamic-margin-calculation/loads-variations-parameters.js +1 -1
  36. package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-inline.js +1 -1
  37. package/dist/features/parameters/dynamic-simulation/dynamic-simulation-inline.js +1 -1
  38. package/dist/features/parameters/loadflow/load-flow-parameters-inline.js +1 -1
  39. package/dist/features/parameters/network-visualizations/network-visualizations-parameters-inline.js +1 -1
  40. package/dist/features/parameters/pcc-min/pcc-min-parameters-inline.js +1 -1
  41. package/dist/features/parameters/security-analysis/security-analysis-parameters-inline.js +1 -1
  42. package/dist/features/parameters/sensi/columns-definitions.js +1 -1
  43. package/dist/features/parameters/sensi/sensitivity-analysis-parameters-inline.js +1 -1
  44. package/dist/features/parameters/short-circuit/short-circuit-parameters-inline.js +1 -1
  45. package/dist/features/parameters/voltage-init/use-voltage-init-parameters-form.js +1 -1
  46. package/dist/features/parameters/voltage-init/voltage-init-form-utils.js +1 -1
  47. package/dist/features/parameters/voltage-init/voltage-init-parameters-inline.js +1 -1
  48. package/dist/features/parameters/voltage-init/voltage-limits-parameters.js +1 -1
  49. package/dist/index.js +22 -6
  50. package/dist/services/security-analysis.js +2 -3
  51. package/dist/translations/en/networkModificationsEn.d.ts +2 -0
  52. package/dist/translations/en/networkModificationsEn.js +2 -0
  53. package/dist/translations/fr/networkModificationsFr.d.ts +2 -0
  54. package/dist/translations/fr/networkModificationsFr.js +2 -0
  55. package/package.json +1 -1
  56. package/dist/components/composite/dnd-table-v2/dnd-table-add-rows-dialog.d.ts +0 -13
  57. package/dist/components/composite/dnd-table-v2/dnd-table-add-rows-dialog.js +0 -69
  58. package/dist/components/composite/dnd-table-v2/dnd-table-bottom-left-buttons.d.ts +0 -17
  59. package/dist/components/composite/dnd-table-v2/dnd-table-bottom-left-buttons.js +0 -47
  60. package/dist/components/composite/dnd-table-v2/dnd-table-bottom-right-buttons.d.ts +0 -17
  61. package/dist/components/composite/dnd-table-v2/dnd-table-bottom-right-buttons.js +0 -100
  62. package/dist/components/composite/dnd-table-v2/dnd-table.d.ts +0 -32
  63. package/dist/components/composite/dnd-table-v2/dnd-table.js +0 -375
  64. package/dist/components/composite/dnd-table-v2/dnd-table.type.d.ts +0 -70
  65. package/dist/components/composite/dnd-table-v2/dnd-table.type.js +0 -19
  66. package/dist/components/composite/dnd-table-v2/index.d.ts +0 -12
  67. package/dist/components/composite/dnd-table-v2/index.js +0 -16
  68. package/dist/features/parameters/common/parameter-table/constants.d.ts +0 -11
  69. package/dist/features/parameters/common/parameter-table/constants.js +0 -12
  70. package/dist/features/parameters/common/parameter-table/parameter-table.d.ts +0 -15
  71. package/dist/features/parameters/common/parameter-table/parameter-table.js +0 -98
  72. package/dist/features/parameters/common/parameter-table/table-cell.d.ts +0 -8
  73. package/dist/features/parameters/common/parameter-table/table-cell.js +0 -83
  74. package/dist/features/parameters/common/parameter-table/table-row.d.ts +0 -11
  75. package/dist/features/parameters/common/parameter-table/table-row.js +0 -41
  76. package/dist/features/parameters/common/parameter-table/types.d.ts +0 -26
  77. package/dist/features/parameters/common/parameter-table/types.js +0 -1
  78. /package/dist/components/composite/{dnd-table-v2 → dnd-table}/deletable-table-row.d.ts +0 -0
  79. /package/dist/components/composite/{dnd-table-v2 → dnd-table}/deletable-table-row.js +0 -0
  80. /package/dist/components/composite/{dnd-table-v2 → dnd-table}/dnd-table-row.d.ts +0 -0
  81. /package/dist/components/composite/{dnd-table-v2 → dnd-table}/dnd-table-row.js +0 -0
  82. /package/dist/components/composite/{dnd-table-v2 → dnd-table}/dnd-table-utils.d.ts +0 -0
  83. /package/dist/components/composite/{dnd-table-v2 → dnd-table}/dnd-table-utils.js +0 -0
@@ -101,8 +101,7 @@ function setSelectedReactiveLimits(id, minMaxReactiveLimits, setValue) {
101
101
  function setCurrentReactiveCapabilityCurveTable(previousReactiveCapabilityCurveTable, fieldKey, setValue) {
102
102
  setValue(fieldKey, previousReactiveCapabilityCurveTable);
103
103
  }
104
- function handleReactiveCapabilityCurveChoice(previousChoice, form) {
105
- const currentReactiveLimits = form[FieldConstants.REACTIVE_LIMITS];
104
+ function handleReactiveCapabilityCurveChoice(previousChoice, currentReactiveLimits) {
106
105
  const currentChoice = currentReactiveLimits?.[FieldConstants.REACTIVE_CAPABILITY_CURVE_CHOICE];
107
106
  if (currentChoice === "MINMAX") {
108
107
  const hasAnyValue = currentReactiveLimits?.[FieldConstants.MAXIMUM_REACTIVE_POWER] || currentReactiveLimits?.[FieldConstants.MINIMUM_REACTIVE_POWER];
@@ -129,38 +128,16 @@ function toReactiveCapabilityCurveChoiceForGeneratorCreation(form, dto) {
129
128
  if (dto) {
130
129
  previousChoice = dto.reactiveCapabilityCurve ? "CURVE" : "MINMAX";
131
130
  }
132
- return handleReactiveCapabilityCurveChoice(previousChoice, form);
131
+ return handleReactiveCapabilityCurveChoice(previousChoice, form.reactiveLimits);
133
132
  }
134
- function handleReactiveCapabilityCurveChoiceForModification(currentChoice, previousChoice, currentReactiveLimits) {
135
- if (currentChoice === "MINMAX") {
136
- const hasAnyValue = currentReactiveLimits?.[FieldConstants.MAXIMUM_REACTIVE_POWER] || currentReactiveLimits?.[FieldConstants.MINIMUM_REACTIVE_POWER];
137
- if (previousChoice === "CURVE" && !hasAnyValue) {
138
- return "CURVE";
139
- }
140
- return "MINMAX";
141
- }
142
- if (currentChoice === "CURVE") {
143
- const currentPoints = currentReactiveLimits?.[FieldConstants.REACTIVE_CAPABILITY_CURVE_TABLE];
144
- const hasAnyValue = currentPoints?.some((v) => v.p != null || v.maxQ != null || v.minQ != null);
145
- if (previousChoice === "MINMAX" && !hasAnyValue) {
146
- return "MINMAX";
147
- }
148
- return "CURVE";
149
- }
150
- console.error(
151
- "Reactive capability curve choice is not valid, it should be either MINMAX or CURVE. We return MINMAX by default."
152
- );
153
- return "MINMAX";
154
- }
155
- function toReactiveCapabilityCurveChoiceForGeneratorModification(currentReactiveLimits, editData, networkPoints) {
156
- const currentChoice = currentReactiveLimits?.[FieldConstants.REACTIVE_CAPABILITY_CURVE_CHOICE];
133
+ function toReactiveCapabilityCurveChoiceForGeneratorModification(form, generatorToModify, dto) {
157
134
  let editDataChoice;
158
- if (editData) {
159
- editDataChoice = editData.reactiveCapabilityCurve?.value === true ? "CURVE" : "MINMAX";
135
+ if (dto) {
136
+ editDataChoice = dto.reactiveCapabilityCurve?.value === true ? "CURVE" : "MINMAX";
160
137
  }
161
- const networkChoice = networkPoints ? "CURVE" : "MINMAX";
138
+ const networkChoice = generatorToModify?.reactiveCapabilityCurvePoints ? "CURVE" : "MINMAX";
162
139
  const previousChoice = editDataChoice ?? networkChoice;
163
- return handleReactiveCapabilityCurveChoiceForModification(currentChoice, previousChoice, currentReactiveLimits);
140
+ return handleReactiveCapabilityCurveChoice(previousChoice, form.reactiveLimits);
164
141
  }
165
142
  export {
166
143
  INSERT,
@@ -1,3 +1,4 @@
1
+ import { InferType } from 'yup';
1
2
  import { ReactiveCapabilityCurvePoints } from './reactiveLimits.type';
2
3
  import { FieldConstants } from '../../../../utils';
3
4
  export declare const REACTIVE_LIMIT_TYPES: readonly [{
@@ -69,6 +70,7 @@ export declare const getReactiveLimitsValidationSchema: (isEquipmentModification
69
70
  maximumReactivePower: undefined;
70
71
  reactiveCapabilityCurveTable: "";
71
72
  }, "">;
73
+ export type ReactiveLimitsFormData = InferType<ReturnType<typeof getReactiveLimitsValidationSchema>>;
72
74
  export declare const getReactiveLimitsSchema: (isEquipmentModification?: boolean, positiveAndNegativePExist?: boolean, id?: FieldConstants) => {
73
75
  [x: string]: import('yup').ObjectSchema<{
74
76
  reactiveCapabilityCurveChoice: string;
@@ -1,68 +1,8 @@
1
- import { FieldConstants } from '../../../utils';
2
1
  import { ActivePowerControlInfos } from '../common/activePowerControl';
3
2
  import { MinMaxReactiveLimitsFormInfos, ReactiveCapabilityCurvePoints } from '../common/reactiveLimits/reactiveLimits.type';
4
3
  import { ShortCircuitInfos } from '../common/shortCircuit/shortCircuitForm.type';
5
- import { Property } from '../common/properties/properties.type';
6
4
  import { ConnectablePositionFormInfos } from '../common/connectivity/connectivity.type';
7
5
  import { MeasurementInfo } from '../common/measurements/measurement.type';
8
- export type GeneratorDialogSchemaBaseForm = {
9
- [FieldConstants.EQUIPMENT_NAME]?: string;
10
- [FieldConstants.ENERGY_SOURCE]: string | null;
11
- [FieldConstants.MAXIMUM_ACTIVE_POWER]: number | null;
12
- [FieldConstants.MINIMUM_ACTIVE_POWER]: number | null;
13
- [FieldConstants.RATED_NOMINAL_POWER]?: number | null;
14
- [FieldConstants.TRANSFORMER_REACTANCE]?: number | null;
15
- [FieldConstants.TRANSIENT_REACTANCE]?: number | null;
16
- [FieldConstants.PLANNED_ACTIVE_POWER_SET_POINT]?: number | null;
17
- [FieldConstants.MARGINAL_COST]?: number | null;
18
- [FieldConstants.PLANNED_OUTAGE_RATE]?: number | null;
19
- [FieldConstants.FORCED_OUTAGE_RATE]?: number | null;
20
- [FieldConstants.CONNECTIVITY]: {
21
- [FieldConstants.VOLTAGE_LEVEL]: {
22
- [FieldConstants.ID]?: string;
23
- };
24
- [FieldConstants.BUS_OR_BUSBAR_SECTION]: {
25
- [FieldConstants.ID]?: string;
26
- };
27
- [FieldConstants.CONNECTION_DIRECTION]?: string;
28
- [FieldConstants.CONNECTION_NAME]?: string;
29
- [FieldConstants.CONNECTION_POSITION]?: number;
30
- [FieldConstants.CONNECTED]?: boolean;
31
- };
32
- [FieldConstants.VOLTAGE_REGULATION]?: boolean | null;
33
- [FieldConstants.ACTIVE_POWER_SET_POINT]?: number;
34
- [FieldConstants.REACTIVE_POWER_SET_POINT]?: number | null;
35
- [FieldConstants.VOLTAGE_REGULATION_TYPE]?: string | null;
36
- [FieldConstants.VOLTAGE_SET_POINT]?: number | null;
37
- [FieldConstants.Q_PERCENT]?: number | null;
38
- [FieldConstants.VOLTAGE_LEVEL]?: {
39
- [FieldConstants.ID]?: string;
40
- [FieldConstants.NAME]?: string;
41
- [FieldConstants.SUBSTATION_ID]?: string;
42
- [FieldConstants.NOMINAL_VOLTAGE]?: string;
43
- [FieldConstants.TOPOLOGY_KIND]?: string | null;
44
- };
45
- [FieldConstants.EQUIPMENT]?: {
46
- [FieldConstants.ID]?: string;
47
- [FieldConstants.NAME]?: string | null;
48
- [FieldConstants.TYPE]?: string;
49
- };
50
- [FieldConstants.FREQUENCY_REGULATION]?: boolean | null;
51
- [FieldConstants.DROOP]?: number | null;
52
- [FieldConstants.REACTIVE_LIMITS]: {
53
- [FieldConstants.MINIMUM_REACTIVE_POWER]?: number | null;
54
- [FieldConstants.MAXIMUM_REACTIVE_POWER]?: number | null;
55
- [FieldConstants.REACTIVE_CAPABILITY_CURVE_CHOICE]: string | null;
56
- [FieldConstants.REACTIVE_CAPABILITY_CURVE_TABLE]?: ReactiveCapabilityCurvePoints[];
57
- };
58
- [FieldConstants.ADDITIONAL_PROPERTIES]?: Property[];
59
- };
60
- export type GeneratorModificationDialogSchemaForm = {
61
- [FieldConstants.STATE_ESTIMATION]?: {
62
- [FieldConstants.MEASUREMENT_P]?: MeasurementInfo;
63
- [FieldConstants.MEASUREMENT_Q]?: MeasurementInfo;
64
- };
65
- } & Partial<GeneratorDialogSchemaBaseForm>;
66
6
  export interface GeneratorFormInfos {
67
7
  id: string;
68
8
  name: string;
@@ -1,9 +1,25 @@
1
1
  import { generatorCreationDtoToForm, generatorCreationEmptyFormData, generatorCreationFormSchema, generatorCreationFormToDto } from "./creation/generatorCreation.utils.js";
2
2
  import { GeneratorCreationForm } from "./creation/GeneratorCreationForm.js";
3
+ import { generatorModificationDtoToForm, generatorModificationEmptyFormData, generatorModificationFormSchema, generatorModificationFormToDto } from "./modification/generatorModification.utils.js";
4
+ import { GENERATOR_TAB_FIELDS, GeneratorDialogTab } from "./modification/generatorTabs.utils.js";
5
+ import { GeneratorDialogHeader } from "./modification/GeneratorDialogHeader.js";
6
+ import { GeneratorDialogTabs } from "./modification/GeneratorDialogTabs.js";
7
+ import { GeneratorDialogTabsContent } from "./modification/GeneratorDialogTabsContent.js";
8
+ import { GeneratorModificationForm } from "./modification/GeneratorModificationForm.js";
3
9
  export {
10
+ GENERATOR_TAB_FIELDS,
4
11
  GeneratorCreationForm,
12
+ GeneratorDialogHeader,
13
+ GeneratorDialogTab,
14
+ GeneratorDialogTabs,
15
+ GeneratorDialogTabsContent,
16
+ GeneratorModificationForm,
5
17
  generatorCreationDtoToForm,
6
18
  generatorCreationEmptyFormData,
7
19
  generatorCreationFormSchema,
8
- generatorCreationFormToDto
20
+ generatorCreationFormToDto,
21
+ generatorModificationDtoToForm,
22
+ generatorModificationEmptyFormData,
23
+ generatorModificationFormSchema,
24
+ generatorModificationFormToDto
9
25
  };
@@ -0,0 +1,6 @@
1
+ import { GeneratorFormInfos } from '../generatorDialog.type';
2
+ export interface GeneratorDialogHeaderProps {
3
+ generatorToModify?: GeneratorFormInfos | null;
4
+ equipmentId?: string;
5
+ }
6
+ export declare function GeneratorDialogHeader({ generatorToModify, equipmentId }: Readonly<GeneratorDialogHeaderProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,109 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { TextField, Grid } from "@mui/material";
3
+ import { useIntl } from "react-intl";
4
+ import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
5
+ import "../../../../utils/conversionUtils.js";
6
+ import { getEnergySourceLabel, ENERGY_SOURCES } from "../../../../utils/types/equipmentType.js";
7
+ import "@mui/icons-material";
8
+ import { filledTextField } from "../../common/form.utils.js";
9
+ import "react";
10
+ import "react-hook-form";
11
+ import "../../common/properties/propertyUtils.js";
12
+ import "../../../../components/ui/overflowableText/OverflowableText.js";
13
+ import "localized-countries";
14
+ import "localized-countries/data/fr";
15
+ import "localized-countries/data/en";
16
+ import "notistack";
17
+ import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
18
+ import "yup";
19
+ import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
20
+ import { TextInput } from "../../../../components/ui/reactHookForm/text/TextInput.js";
21
+ import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
22
+ import { SelectInput } from "../../../../components/ui/reactHookForm/selectInputs/SelectInput.js";
23
+ import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
24
+ import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
25
+ import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
26
+ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
27
+ import "@material-symbols/svg-400/outlined/add_notes.svg?react";
28
+ import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
29
+ import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
30
+ import "@hello-pangea/dnd";
31
+ import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
32
+ import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
33
+ import "mui-nested-menu";
34
+ import "react-resizable-panels";
35
+ import "react-dom";
36
+ import "autosuggest-highlight/match";
37
+ import "autosuggest-highlight/parse";
38
+ import "clsx";
39
+ import "../../../../components/composite/filter/FilterCreationDialog.js";
40
+ import "../../../../components/composite/filter/HeaderFilterForm.js";
41
+ import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
42
+ import "../../../../components/composite/filter/expert/ExpertFilterForm.js";
43
+ import "../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
44
+ import "../../../../components/composite/filter/expert/expertFilterConstants.js";
45
+ import "react-querybuilder";
46
+ import "uuid";
47
+ import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
48
+ import "../../../../components/composite/filter/utils/filterFormUtils.js";
49
+ import "@react-querybuilder/material";
50
+ import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
51
+ import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
52
+ import "../../../../components/composite/agGridTable/BottomRightButtons.js";
53
+ import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
54
+ import "ag-grid-community";
55
+ import "react-papaparse";
56
+ import "react-csv-downloader";
57
+ import "../../../../components/composite/customAGGrid/customAggrid.js";
58
+ import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
59
+ function GeneratorDialogHeader({ generatorToModify, equipmentId }) {
60
+ const intl = useIntl();
61
+ const energySourceLabelId = getEnergySourceLabel(generatorToModify?.energySource);
62
+ const previousEnergySourceLabel = energySourceLabelId ? intl.formatMessage({
63
+ id: energySourceLabelId
64
+ }) : void 0;
65
+ const generatorIdField = /* @__PURE__ */ jsx(
66
+ TextField,
67
+ {
68
+ size: "small",
69
+ fullWidth: true,
70
+ label: "ID",
71
+ value: equipmentId ?? "",
72
+ InputProps: {
73
+ readOnly: true
74
+ },
75
+ disabled: true,
76
+ ...filledTextField
77
+ }
78
+ );
79
+ const generatorNameField = /* @__PURE__ */ jsx(
80
+ TextInput,
81
+ {
82
+ name: FieldConstants.EQUIPMENT_NAME,
83
+ label: "Name",
84
+ formProps: filledTextField,
85
+ previousValue: generatorToModify?.name,
86
+ clearable: true
87
+ }
88
+ );
89
+ const energySourceField = /* @__PURE__ */ jsx(
90
+ SelectInput,
91
+ {
92
+ name: FieldConstants.ENERGY_SOURCE,
93
+ label: "energySource",
94
+ options: [...ENERGY_SOURCES],
95
+ fullWidth: true,
96
+ size: "small",
97
+ formProps: { ...filledTextField },
98
+ previousValue: previousEnergySourceLabel
99
+ }
100
+ );
101
+ return /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
102
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: true, children: generatorIdField }),
103
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: true, children: generatorNameField }),
104
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: true, children: energySourceField })
105
+ ] });
106
+ }
107
+ export {
108
+ GeneratorDialogHeader
109
+ };
@@ -0,0 +1,13 @@
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
+ interface GeneratorDialogTabsProps {
8
+ tabIndex: number;
9
+ tabIndexesWithError: number[];
10
+ setTabIndex: (newTabIndex: number) => void;
11
+ }
12
+ export declare function GeneratorDialogTabs({ tabIndex, tabIndexesWithError, setTabIndex, }: Readonly<GeneratorDialogTabsProps>): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,55 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { Tabs, Tab } from "@mui/material";
3
+ import { FormattedMessage } from "react-intl";
4
+ import { GeneratorDialogTab } from "./generatorTabs.utils.js";
5
+ import { getTabIndicatorStyle, getTabStyle } from "../../../parameters/parameters-style.js";
6
+ function GeneratorDialogTabs({
7
+ tabIndex,
8
+ tabIndexesWithError,
9
+ setTabIndex
10
+ }) {
11
+ return /* @__PURE__ */ jsxs(
12
+ Tabs,
13
+ {
14
+ value: tabIndex,
15
+ variant: "scrollable",
16
+ onChange: (event, newValue) => setTabIndex(newValue),
17
+ TabIndicatorProps: {
18
+ sx: getTabIndicatorStyle(tabIndexesWithError, tabIndex)
19
+ },
20
+ children: [
21
+ /* @__PURE__ */ jsx(
22
+ Tab,
23
+ {
24
+ label: /* @__PURE__ */ jsx(FormattedMessage, { id: "ConnectivityTab" }),
25
+ sx: getTabStyle(tabIndexesWithError, GeneratorDialogTab.CONNECTIVITY_TAB)
26
+ }
27
+ ),
28
+ /* @__PURE__ */ jsx(
29
+ Tab,
30
+ {
31
+ label: /* @__PURE__ */ jsx(FormattedMessage, { id: "SetpointsAndLimitsTab" }),
32
+ sx: getTabStyle(tabIndexesWithError, GeneratorDialogTab.SETPOINTS_AND_LIMITS_TAB)
33
+ }
34
+ ),
35
+ /* @__PURE__ */ jsx(
36
+ Tab,
37
+ {
38
+ label: /* @__PURE__ */ jsx(FormattedMessage, { id: "SpecificTab" }),
39
+ sx: getTabStyle(tabIndexesWithError, GeneratorDialogTab.SPECIFIC_TAB)
40
+ }
41
+ ),
42
+ /* @__PURE__ */ jsx(
43
+ Tab,
44
+ {
45
+ label: /* @__PURE__ */ jsx(FormattedMessage, { id: "AdditionalInformation" }),
46
+ sx: getTabStyle(tabIndexesWithError, GeneratorDialogTab.ADDITIONAL_INFORMATION_TAB)
47
+ }
48
+ )
49
+ ]
50
+ }
51
+ );
52
+ }
53
+ export {
54
+ GeneratorDialogTabs
55
+ };
@@ -0,0 +1,12 @@
1
+ import { ConnectivityNetworkProps } from '../../common';
2
+ import { GeneratorFormInfos } from '../generatorDialog.type';
3
+ import { EquipmentType, Identifiable } from '../../../../utils';
4
+ export interface GeneratorDialogTabsContentProps extends ConnectivityNetworkProps {
5
+ generatorToModify?: GeneratorFormInfos | null;
6
+ updatePreviousReactiveCapabilityCurveTable: (action: string, index: number) => void;
7
+ fetchVoltageLevelEquipments: (voltageLevelId: string) => Promise<(Identifiable & {
8
+ type: EquipmentType;
9
+ })[]>;
10
+ tabIndex: number;
11
+ }
12
+ export declare function GeneratorDialogTabsContent({ generatorToModify, updatePreviousReactiveCapabilityCurveTable, tabIndex, voltageLevelOptions, PositionDiagramPane, fetchBusesOrBusbarSections, fetchVoltageLevelEquipments, }: Readonly<GeneratorDialogTabsContentProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,277 @@
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import { Box, Grid } from "@mui/material";
3
+ import { useIntl, FormattedMessage } from "react-intl";
4
+ import { useWatch } from "react-hook-form";
5
+ import { GeneratorDialogTab } from "./generatorTabs.utils.js";
6
+ import { PropertiesForm } from "../../common/properties/PropertiesForm.js";
7
+ import "react";
8
+ import { ActivePowerAdornment, MVAPowerAdornment } from "../../../../utils/constants/adornments.js";
9
+ import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
10
+ import "../../../../utils/conversionUtils.js";
11
+ import "../../../../utils/types/equipmentType.js";
12
+ import "@mui/icons-material";
13
+ import "../../../../components/ui/overflowableText/OverflowableText.js";
14
+ import "localized-countries";
15
+ import "localized-countries/data/fr";
16
+ import "localized-countries/data/en";
17
+ import "notistack";
18
+ import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
19
+ import "yup";
20
+ import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
21
+ import { FloatInput } from "../../../../components/ui/reactHookForm/numbers/FloatInput.js";
22
+ import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
23
+ import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
24
+ import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
25
+ import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
26
+ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
27
+ import "@material-symbols/svg-400/outlined/add_notes.svg?react";
28
+ import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
29
+ import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
30
+ import { CheckboxNullableInput } from "../../../../components/ui/reactHookForm/CheckboxNullableInput.js";
31
+ import "@hello-pangea/dnd";
32
+ import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
33
+ import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
34
+ import "mui-nested-menu";
35
+ import "react-resizable-panels";
36
+ import "../../common/properties/propertyUtils.js";
37
+ import { PowerMeasurementsForm } from "../../common/measurements/PowerMeasurementsForm.js";
38
+ import GridSection from "../../../../components/composite/grid/grid-section.js";
39
+ import "react-dom";
40
+ import "autosuggest-highlight/match";
41
+ import "autosuggest-highlight/parse";
42
+ import "clsx";
43
+ import "../../../../components/composite/filter/FilterCreationDialog.js";
44
+ import "../../../../components/composite/filter/HeaderFilterForm.js";
45
+ import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
46
+ import "../../../../components/composite/filter/expert/ExpertFilterForm.js";
47
+ import "../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
48
+ import "../../../../components/composite/filter/expert/expertFilterConstants.js";
49
+ import "react-querybuilder";
50
+ import "uuid";
51
+ import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
52
+ import "../../../../components/composite/filter/utils/filterFormUtils.js";
53
+ import GridItem from "../../../../components/composite/grid/grid-item.js";
54
+ import "@react-querybuilder/material";
55
+ import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
56
+ import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
57
+ import "../../../../components/composite/agGridTable/BottomRightButtons.js";
58
+ import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
59
+ import "ag-grid-community";
60
+ import "react-papaparse";
61
+ import "react-csv-downloader";
62
+ import "../../../../components/composite/customAGGrid/customAggrid.js";
63
+ import { SetPointsForm } from "../../common/setpoints/SetPointsForm.js";
64
+ import { ConnectivityForm } from "../../common/connectivity/ConnectivityForm.js";
65
+ import { ActivePowerControlForm } from "../../common/activePowerControl/ActivePowerControlForm.js";
66
+ import { ShortCircuitForm } from "../../common/shortCircuit/ShortCircuitForm.js";
67
+ import { ReactiveLimitsForm } from "../../common/reactiveLimits/ReactiveLimitsForm.js";
68
+ import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
69
+ import { VoltageRegulationForm } from "../../common/voltageRegulation/VoltageRegulationForm.js";
70
+ function GeneratorDialogTabsContent({
71
+ generatorToModify,
72
+ updatePreviousReactiveCapabilityCurveTable,
73
+ tabIndex,
74
+ voltageLevelOptions = [],
75
+ PositionDiagramPane,
76
+ fetchBusesOrBusbarSections,
77
+ fetchVoltageLevelEquipments
78
+ }) {
79
+ const intl = useIntl();
80
+ const watchVoltageRegulation = useWatch({
81
+ name: FieldConstants.VOLTAGE_REGULATION
82
+ });
83
+ const previousRegulation = () => {
84
+ if (generatorToModify?.voltageRegulatorOn) {
85
+ return intl.formatMessage({ id: "On" });
86
+ }
87
+ if (generatorToModify?.voltageRegulatorOn === false) {
88
+ return intl.formatMessage({ id: "Off" });
89
+ }
90
+ return null;
91
+ };
92
+ const voltageRegulationField = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
93
+ CheckboxNullableInput,
94
+ {
95
+ name: FieldConstants.VOLTAGE_REGULATION,
96
+ label: "VoltageRegulationText",
97
+ previousValue: previousRegulation() ?? void 0
98
+ }
99
+ ) });
100
+ const voltageRegulationFields = /* @__PURE__ */ jsx(
101
+ VoltageRegulationForm,
102
+ {
103
+ voltageLevelOptions,
104
+ fetchVoltageLevelEquipments,
105
+ previousValues: {
106
+ regulatingTerminalConnectableId: generatorToModify?.regulatingTerminalConnectableId,
107
+ regulatingTerminalVlId: generatorToModify?.regulatingTerminalVlId,
108
+ regulatingTerminalConnectableType: generatorToModify?.regulatingTerminalConnectableType,
109
+ voltageSetPoint: generatorToModify?.targetV,
110
+ qPercent: generatorToModify?.coordinatedReactiveControl?.qPercent
111
+ },
112
+ isEquipmentModification: true
113
+ }
114
+ );
115
+ const maximumActivePowerField = /* @__PURE__ */ jsx(
116
+ FloatInput,
117
+ {
118
+ name: FieldConstants.MAXIMUM_ACTIVE_POWER,
119
+ label: "MaximumActivePowerText",
120
+ adornment: ActivePowerAdornment,
121
+ previousValue: generatorToModify?.maxP,
122
+ clearable: true
123
+ }
124
+ );
125
+ const minimumActivePowerField = /* @__PURE__ */ jsx(
126
+ FloatInput,
127
+ {
128
+ name: FieldConstants.MINIMUM_ACTIVE_POWER,
129
+ label: "MinimumActivePowerText",
130
+ adornment: ActivePowerAdornment,
131
+ previousValue: generatorToModify?.minP,
132
+ clearable: true
133
+ }
134
+ );
135
+ const ratedNominalPowerField = /* @__PURE__ */ jsx(
136
+ FloatInput,
137
+ {
138
+ name: FieldConstants.RATED_NOMINAL_POWER,
139
+ label: "RatedNominalPowerText",
140
+ adornment: MVAPowerAdornment,
141
+ previousValue: generatorToModify?.ratedS,
142
+ clearable: true
143
+ }
144
+ );
145
+ const plannedActivePowerSetPointField = /* @__PURE__ */ jsx(
146
+ FloatInput,
147
+ {
148
+ name: FieldConstants.PLANNED_ACTIVE_POWER_SET_POINT,
149
+ label: "PlannedActivePowerSetPointForm",
150
+ adornment: ActivePowerAdornment,
151
+ previousValue: generatorToModify?.generatorStartup?.plannedActivePowerSetPoint ?? void 0,
152
+ clearable: true
153
+ }
154
+ );
155
+ const marginalCostField = /* @__PURE__ */ jsx(
156
+ FloatInput,
157
+ {
158
+ name: FieldConstants.MARGINAL_COST,
159
+ label: "MarginalCost",
160
+ previousValue: generatorToModify?.generatorStartup?.marginalCost ?? void 0,
161
+ clearable: true
162
+ }
163
+ );
164
+ const plannedOutageRateField = /* @__PURE__ */ jsx(
165
+ FloatInput,
166
+ {
167
+ name: FieldConstants.PLANNED_OUTAGE_RATE,
168
+ label: "plannedOutageRate",
169
+ previousValue: generatorToModify?.generatorStartup?.plannedOutageRate ?? void 0,
170
+ clearable: true
171
+ }
172
+ );
173
+ const forcedOutageRateField = /* @__PURE__ */ jsx(
174
+ FloatInput,
175
+ {
176
+ name: FieldConstants.FORCED_OUTAGE_RATE,
177
+ label: "forcedOutageRate",
178
+ previousValue: generatorToModify?.generatorStartup?.forcedOutageRate ?? void 0,
179
+ clearable: true
180
+ }
181
+ );
182
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
183
+ /* @__PURE__ */ jsxs(Box, { hidden: tabIndex !== GeneratorDialogTab.CONNECTIVITY_TAB, children: [
184
+ /* @__PURE__ */ jsx(GridSection, { title: "ConnectivityTab" }),
185
+ /* @__PURE__ */ jsx(
186
+ ConnectivityForm,
187
+ {
188
+ isEquipmentModification: true,
189
+ previousValues: {
190
+ connectablePosition: generatorToModify?.connectablePosition,
191
+ voltageLevelId: generatorToModify?.voltageLevelId,
192
+ busOrBusbarSectionId: generatorToModify?.busOrBusbarSectionId,
193
+ terminalConnected: generatorToModify?.terminalConnected
194
+ },
195
+ voltageLevelOptions,
196
+ PositionDiagramPane,
197
+ fetchBusesOrBusbarSections
198
+ }
199
+ )
200
+ ] }),
201
+ /* @__PURE__ */ jsxs(Box, { hidden: tabIndex !== GeneratorDialogTab.SETPOINTS_AND_LIMITS_TAB, children: [
202
+ /* @__PURE__ */ jsx(
203
+ SetPointsForm,
204
+ {
205
+ previousValues: {
206
+ activePower: generatorToModify?.targetP,
207
+ reactivePower: generatorToModify?.targetQ
208
+ },
209
+ isModification: true
210
+ }
211
+ ),
212
+ /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, paddingTop: 2, children: [
213
+ /* @__PURE__ */ jsx(Box, { sx: { width: "100%" } }),
214
+ /* @__PURE__ */ jsx(
215
+ GridItem,
216
+ {
217
+ tooltip: watchVoltageRegulation === null ? /* @__PURE__ */ jsx(FormattedMessage, { id: "NoModification" }) : "",
218
+ size: 4,
219
+ children: voltageRegulationField
220
+ }
221
+ ),
222
+ voltageRegulationFields,
223
+ /* @__PURE__ */ jsx(Box, { sx: { width: "100%" } }),
224
+ /* @__PURE__ */ jsx(
225
+ ActivePowerControlForm,
226
+ {
227
+ isEquipmentModification: true,
228
+ previousValues: generatorToModify?.activePowerControl
229
+ }
230
+ )
231
+ ] }),
232
+ /* @__PURE__ */ jsx(Grid, { container: true, spacing: 2, children: /* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, children: [
233
+ /* @__PURE__ */ jsx("h3", { children: /* @__PURE__ */ jsx(FormattedMessage, { id: "Limits" }) }),
234
+ /* @__PURE__ */ jsx("h4", { children: /* @__PURE__ */ jsx(FormattedMessage, { id: "ActiveLimits" }) })
235
+ ] }) }),
236
+ /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
237
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: minimumActivePowerField }),
238
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: maximumActivePowerField }),
239
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: ratedNominalPowerField })
240
+ ] }),
241
+ /* @__PURE__ */ jsx(Grid, { container: true, spacing: 2, children: /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx("h4", { children: /* @__PURE__ */ jsx(FormattedMessage, { id: "ReactiveLimits" }) }) }) }),
242
+ /* @__PURE__ */ jsx(
243
+ ReactiveLimitsForm,
244
+ {
245
+ previousReactiveCapabilityCurvePoints: generatorToModify?.reactiveCapabilityCurvePoints,
246
+ previousMinMaxReactiveLimits: generatorToModify?.minMaxReactiveLimits,
247
+ updatePreviousReactiveCapabilityCurveTable
248
+ }
249
+ )
250
+ ] }),
251
+ /* @__PURE__ */ jsxs(Box, { hidden: tabIndex !== GeneratorDialogTab.SPECIFIC_TAB, children: [
252
+ /* @__PURE__ */ jsx(GridSection, { title: "ShortCircuit" }),
253
+ /* @__PURE__ */ jsx(ShortCircuitForm, { previousValues: generatorToModify?.generatorShortCircuit }),
254
+ /* @__PURE__ */ jsx(GridSection, { title: "GenerationDispatch" }),
255
+ /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
256
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: plannedActivePowerSetPointField }),
257
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: marginalCostField }),
258
+ /* @__PURE__ */ jsxs(Grid, { container: true, item: true, spacing: 2, children: [
259
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: plannedOutageRateField }),
260
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: forcedOutageRateField })
261
+ ] })
262
+ ] }),
263
+ /* @__PURE__ */ jsx(GridSection, { title: "MeasurementsSection" }),
264
+ /* @__PURE__ */ jsx(
265
+ PowerMeasurementsForm,
266
+ {
267
+ activePowerMeasurement: generatorToModify?.measurementP,
268
+ reactivePowerMeasurement: generatorToModify?.measurementQ
269
+ }
270
+ )
271
+ ] }),
272
+ /* @__PURE__ */ jsx(Box, { hidden: tabIndex !== GeneratorDialogTab.ADDITIONAL_INFORMATION_TAB, children: /* @__PURE__ */ jsx(PropertiesForm, { networkElementType: "generator", isModification: true }) })
273
+ ] });
274
+ }
275
+ export {
276
+ GeneratorDialogTabsContent
277
+ };
@@ -0,0 +1,10 @@
1
+ import { GeneratorDialogHeaderProps } from './GeneratorDialogHeader';
2
+ import { GeneratorDialogTabsContentProps } from './GeneratorDialogTabsContent';
3
+ import { EquipmentType, Identifiable } from '../../../../utils';
4
+ interface GeneratorModificationFormProps extends GeneratorDialogHeaderProps, Omit<GeneratorDialogTabsContentProps, 'tabIndex'> {
5
+ fetchVoltageLevelEquipments: (voltageLevelId: string) => Promise<(Identifiable & {
6
+ type: EquipmentType;
7
+ })[]>;
8
+ }
9
+ export declare function GeneratorModificationForm({ generatorToModify, updatePreviousReactiveCapabilityCurveTable, voltageLevelOptions, fetchBusesOrBusbarSections, PositionDiagramPane, fetchVoltageLevelEquipments, }: Readonly<GeneratorModificationFormProps>): import("react/jsx-runtime").JSX.Element;
10
+ export {};