@gridsuite/commons-ui 0.177.0 → 0.179.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 (89) hide show
  1. package/dist/components/index.js +31 -1
  2. package/dist/components/inputs/index.js +2 -0
  3. package/dist/components/inputs/reactHookForm/index.js +2 -0
  4. package/dist/components/inputs/reactHookForm/numbers/IntegerInput.js +1 -1
  5. package/dist/components/inputs/reactHookForm/selectInputs/EnumInput.d.ts +18 -0
  6. package/dist/components/inputs/reactHookForm/selectInputs/EnumInput.js +28 -0
  7. package/dist/components/inputs/reactHookForm/selectInputs/index.d.ts +1 -0
  8. package/dist/components/inputs/reactHookForm/selectInputs/index.js +2 -0
  9. package/dist/components/network-modifications/index.d.ts +1 -0
  10. package/dist/components/network-modifications/index.js +23 -1
  11. package/dist/components/network-modifications/voltage-level/creation/VoltageLevelCreationForm.d.ts +11 -0
  12. package/dist/components/network-modifications/voltage-level/creation/VoltageLevelCreationForm.js +174 -0
  13. package/dist/components/network-modifications/voltage-level/creation/coupling-omnibus/CouplingOmnibusCreation.d.ts +7 -0
  14. package/dist/components/network-modifications/voltage-level/creation/coupling-omnibus/CouplingOmnibusCreation.js +54 -0
  15. package/dist/components/network-modifications/voltage-level/creation/coupling-omnibus/CouplingOmnibusForm.d.ts +7 -0
  16. package/dist/components/network-modifications/voltage-level/creation/coupling-omnibus/CouplingOmnibusForm.js +73 -0
  17. package/dist/components/network-modifications/voltage-level/creation/coupling-omnibus/index.d.ts +8 -0
  18. package/dist/components/network-modifications/voltage-level/creation/coupling-omnibus/index.js +6 -0
  19. package/dist/components/network-modifications/voltage-level/creation/index.d.ts +11 -0
  20. package/dist/components/network-modifications/voltage-level/creation/index.js +24 -0
  21. package/dist/components/network-modifications/voltage-level/creation/substation-creation/SubstationAutocompleteAddButton.d.ts +5 -0
  22. package/dist/components/network-modifications/voltage-level/creation/substation-creation/SubstationAutocompleteAddButton.js +79 -0
  23. package/dist/components/network-modifications/voltage-level/creation/substation-creation/SubstationCreationSection.d.ts +6 -0
  24. package/dist/components/network-modifications/voltage-level/creation/substation-creation/SubstationCreationSection.js +61 -0
  25. package/dist/components/network-modifications/voltage-level/creation/switches-between-sections/SwitchesBetweenSections.d.ts +7 -0
  26. package/dist/components/network-modifications/voltage-level/creation/switches-between-sections/SwitchesBetweenSections.js +119 -0
  27. package/dist/components/network-modifications/voltage-level/creation/switches-between-sections/creation/CreateSwitchesDialog.d.ts +11 -0
  28. package/dist/components/network-modifications/voltage-level/creation/switches-between-sections/creation/CreateSwitchesDialog.js +82 -0
  29. package/dist/components/network-modifications/voltage-level/creation/switches-between-sections/creation/CreateSwitchesDialogSubmitButton.d.ts +6 -0
  30. package/dist/components/network-modifications/voltage-level/creation/switches-between-sections/creation/CreateSwitchesDialogSubmitButton.js +11 -0
  31. package/dist/components/network-modifications/voltage-level/creation/switches-between-sections/creation/CreateSwitchesForm.d.ts +11 -0
  32. package/dist/components/network-modifications/voltage-level/creation/switches-between-sections/creation/CreateSwitchesForm.js +70 -0
  33. package/dist/components/network-modifications/voltage-level/creation/switches-between-sections/creation/createSwitchesDialog.utils.d.ts +14 -0
  34. package/dist/components/network-modifications/voltage-level/creation/switches-between-sections/creation/createSwitchesDialog.utils.js +27 -0
  35. package/dist/components/network-modifications/voltage-level/creation/switches-between-sections/creation/index.d.ts +7 -0
  36. package/dist/components/network-modifications/voltage-level/creation/switches-between-sections/creation/index.js +4 -0
  37. package/dist/components/network-modifications/voltage-level/creation/switches-between-sections/index.d.ts +8 -0
  38. package/dist/components/network-modifications/voltage-level/creation/switches-between-sections/index.js +6 -0
  39. package/dist/components/network-modifications/voltage-level/creation/voltageLevelCreation.types.d.ts +34 -0
  40. package/dist/components/network-modifications/voltage-level/creation/voltageLevelCreation.types.js +9 -0
  41. package/dist/components/network-modifications/voltage-level/creation/voltageLevelCreation.utils.d.ts +155 -0
  42. package/dist/components/network-modifications/voltage-level/creation/voltageLevelCreation.utils.js +248 -0
  43. package/dist/components/network-modifications/voltage-level/index.d.ts +7 -0
  44. package/dist/components/network-modifications/voltage-level/index.js +24 -0
  45. package/dist/components/parameters/common/utils.d.ts +25 -2
  46. package/dist/components/parameters/common/utils.js +40 -1
  47. package/dist/components/parameters/dynamic-margin-calculation/use-dynamic-margin-calculation-parameters-form.d.ts +2 -18
  48. package/dist/components/parameters/dynamic-margin-calculation/use-dynamic-margin-calculation-parameters-form.js +2 -38
  49. package/dist/components/parameters/dynamic-security-analysis/constants.d.ts +9 -0
  50. package/dist/components/parameters/dynamic-security-analysis/constants.js +8 -0
  51. package/dist/components/parameters/dynamic-security-analysis/contingency-parameters.d.ts +10 -0
  52. package/dist/components/parameters/dynamic-security-analysis/contingency-parameters.js +65 -0
  53. package/dist/components/parameters/dynamic-security-analysis/dynamic-security-analysis-inline.d.ts +10 -0
  54. package/dist/components/parameters/dynamic-security-analysis/dynamic-security-analysis-inline.js +130 -0
  55. package/dist/components/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.d.ts +9 -0
  56. package/dist/components/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.js +103 -0
  57. package/dist/components/parameters/dynamic-security-analysis/index.d.ts +8 -0
  58. package/dist/components/parameters/dynamic-security-analysis/index.js +8 -0
  59. package/dist/components/parameters/dynamic-security-analysis/scenario-parameters.d.ts +10 -0
  60. package/dist/components/parameters/dynamic-security-analysis/scenario-parameters.js +16 -0
  61. package/dist/components/parameters/dynamic-security-analysis/use-dynamic-security-analysis-parameters-form.d.ts +51 -0
  62. package/dist/components/parameters/dynamic-security-analysis/use-dynamic-security-analysis-parameters-form.js +181 -0
  63. package/dist/components/parameters/index.d.ts +1 -0
  64. package/dist/components/parameters/index.js +6 -0
  65. package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +24 -4
  66. package/dist/components/parameters/util/make-component-utils.d.ts +17 -0
  67. package/dist/components/parameters/util/make-component-utils.js +96 -0
  68. package/dist/components/parameters/util/styles.d.ts +38 -0
  69. package/dist/components/parameters/util/styles.js +41 -0
  70. package/dist/index.js +38 -2
  71. package/dist/services/dynamic-security-analysis.d.ts +4 -0
  72. package/dist/services/dynamic-security-analysis.js +29 -0
  73. package/dist/services/index.d.ts +1 -0
  74. package/dist/services/index.js +8 -2
  75. package/dist/services/networkModification.d.ts +1 -0
  76. package/dist/services/networkModification.js +15 -1
  77. package/dist/services/sensitivity-analysis.d.ts +1 -1
  78. package/dist/services/sensitivity-analysis.js +3 -2
  79. package/dist/services/utils.d.ts +2 -0
  80. package/dist/services/utils.js +3 -0
  81. package/dist/translations/en/networkModificationsEn.d.ts +35 -0
  82. package/dist/translations/en/networkModificationsEn.js +35 -0
  83. package/dist/translations/fr/networkModificationsFr.d.ts +35 -0
  84. package/dist/translations/fr/networkModificationsFr.js +35 -0
  85. package/dist/utils/constants/fieldConstants.d.ts +22 -1
  86. package/dist/utils/constants/fieldConstants.js +21 -0
  87. package/dist/utils/types/elementType.d.ts +1 -0
  88. package/dist/utils/types/elementType.js +1 -0
  89. package/package.json +1 -1
@@ -85,6 +85,7 @@ import { CountriesInput } from "./inputs/reactHookForm/selectInputs/CountriesInp
85
85
  import { InputWithPopupConfirmation } from "./inputs/reactHookForm/selectInputs/InputWithPopupConfirmation.js";
86
86
  import { MuiSelectInput } from "./inputs/reactHookForm/selectInputs/MuiSelectInput.js";
87
87
  import { SelectInput } from "./inputs/reactHookForm/selectInputs/SelectInput.js";
88
+ import { EnumInput } from "./inputs/reactHookForm/selectInputs/EnumInput.js";
88
89
  import { TableNumericalInput } from "./inputs/reactHookForm/tableInputs/table-numerical-input.js";
89
90
  import { TableTextInput } from "./inputs/reactHookForm/tableInputs/table-text-input.js";
90
91
  import { DescriptionField } from "./inputs/reactHookForm/text/DescriptionField.js";
@@ -178,6 +179,8 @@ import { SensitivityAnalysisParametersDialog } from "./parameters/sensi/sensitiv
178
179
  import { COLUMNS_DEFINITIONS_HVDCS, COLUMNS_DEFINITIONS_INJECTIONS, COLUMNS_DEFINITIONS_INJECTIONS_SET, COLUMNS_DEFINITIONS_NODES, COLUMNS_DEFINITIONS_PSTS, EQUIPMENTS_IN_VOLTAGE_REGULATION_TYPES, HVDC_EQUIPMENT_TYPES, INJECTIONS_EQUIPMENT_TYPES, INJECTION_DISTRIBUTION_TYPES, MONITORED_BRANCHES_EQUIPMENT_TYPES, MONITORED_VOLTAGE_LEVELS_EQUIPMENT_TYPES, PSTS_EQUIPMENT_TYPES, SENSITIVITY_TYPES, SensiBranchesTabValues, SensiHvdcs, SensiInjection, SensiInjectionsSet, SensiNodes, SensiPsts, SensiTabValues } from "./parameters/sensi/columns-definitions.js";
179
180
  import { ACCURACY, ACTIVE, CALCULATION_TYPE, LOADS_VARIATIONS, LOAD_FILTERS, LOAD_INCREASE_START_TIME, LOAD_INCREASE_STOP_TIME, LOAD_MODELS_RULE, MARGIN_CALCULATION_START_TIME, START_TIME, STOP_TIME, VARIATION } from "./parameters/dynamic-margin-calculation/constants.js";
180
181
  import { DynamicMarginCalculationInline } from "./parameters/dynamic-margin-calculation/dynamic-margin-calculation-inline.js";
182
+ import { CONTINGENCIES_LIST_INFOS, CONTINGENCIES_START_TIME, SCENARIO_DURATION } from "./parameters/dynamic-security-analysis/constants.js";
183
+ import { DynamicSecurityAnalysisInline } from "./parameters/dynamic-security-analysis/dynamic-security-analysis-inline.js";
181
184
  import { CustomMenuItem, CustomNestedMenuItem } from "./menus/custom-nested-menu.js";
182
185
  import { OverflowableTableCell } from "./muiTable/OverflowableTableCell.js";
183
186
  import { OverflowableTableCellWithCheckbox } from "./muiTable/OverflowableTableCellWithCheckbox.js";
@@ -190,6 +193,13 @@ import { SubstationCreationForm } from "./network-modifications/substation/creat
190
193
  import { substationCreationDtoToForm, substationCreationEmptyFormData, substationCreationFormSchema, substationCreationFormToDto } from "./network-modifications/substation/creation/substationCreation.utils.js";
191
194
  import { SubstationModificationForm } from "./network-modifications/substation/modification/SubstationModificationForm.js";
192
195
  import { substationModificationDtoToForm, substationModificationEmptyFormData, substationModificationFormSchema, substationModificationFormToDto } from "./network-modifications/substation/modification/substationModification.utils.js";
196
+ import { CreateSwitchesDialog } from "./network-modifications/voltage-level/creation/switches-between-sections/creation/CreateSwitchesDialog.js";
197
+ import { SwitchesBetweenSections } from "./network-modifications/voltage-level/creation/switches-between-sections/SwitchesBetweenSections.js";
198
+ import { CouplingOmnibusForm } from "./network-modifications/voltage-level/creation/coupling-omnibus/CouplingOmnibusForm.js";
199
+ import { CouplingOmnibusCreation } from "./network-modifications/voltage-level/creation/coupling-omnibus/CouplingOmnibusCreation.js";
200
+ import { VoltageLevelCreationForm } from "./network-modifications/voltage-level/creation/VoltageLevelCreationForm.js";
201
+ import { SWITCH_TYPE, buildNewBusbarSections, getCreateSwitchesEmptyFormData, getCreateSwitchesValidationSchema, translateSwitchKinds, voltageLevelCreationDtoToForm, voltageLevelCreationEmptyFormData, voltageLevelCreationFormSchema, voltageLevelCreationFormToDto } from "./network-modifications/voltage-level/creation/voltageLevelCreation.utils.js";
202
+ import { SwitchKind } from "./network-modifications/voltage-level/creation/voltageLevelCreation.types.js";
193
203
  export {
194
204
  ACCURACY,
195
205
  ACTIVE,
@@ -222,6 +232,8 @@ export {
222
232
  COMPONENT_LIBRARY,
223
233
  CONNECTED_MODE,
224
234
  CONTINGENCIES,
235
+ CONTINGENCIES_LIST_INFOS,
236
+ CONTINGENCIES_START_TIME,
225
237
  CONTINGENCY_LISTS,
226
238
  CONTINGENCY_LISTS_INFOS,
227
239
  CONTINGENCY_LIST_EQUIPMENTS,
@@ -241,7 +253,10 @@ export {
241
253
  CountriesInput,
242
254
  CountrySelectionInput,
243
255
  CountryValueEditor,
256
+ CouplingOmnibusCreation,
257
+ CouplingOmnibusForm,
244
258
  CreateParameterDialog,
259
+ CreateSwitchesDialog,
245
260
  CsvExport,
246
261
  CsvUploader,
247
262
  CustomAGGrid,
@@ -282,6 +297,7 @@ export {
282
297
  DndTableBottomLeftButtons,
283
298
  DndTableBottomRightButtons,
284
299
  DynamicMarginCalculationInline,
300
+ DynamicSecurityAnalysisInline,
285
301
  ENERGY_SOURCE_OPTIONS,
286
302
  EQUIPMENTS_IN_VOLTAGE_REGULATION_TYPES,
287
303
  EXPERT_FILTER_EQUIPMENTS,
@@ -292,6 +308,7 @@ export {
292
308
  ElementSearchDialog,
293
309
  ElementSearchInput,
294
310
  ElementValueEditor,
311
+ EnumInput,
295
312
  EquipmentItem,
296
313
  EquipmentsSelectionType,
297
314
  ErrorCellRenderer,
@@ -447,6 +464,7 @@ export {
447
464
  RemoveButton,
448
465
  ResizeHandle,
449
466
  RuleValueEditor,
467
+ SCENARIO_DURATION,
450
468
  SELECTED,
451
469
  SELECTION_TYPE,
452
470
  SENSITIVITY_TYPES,
@@ -474,6 +492,7 @@ export {
474
492
  STOP_TIME,
475
493
  SUBSTATION_LAYOUT,
476
494
  SVAR_REGULATION_MODE_OPTIONS,
495
+ SWITCH_TYPE,
477
496
  SecurityAnalysisParametersDialog,
478
497
  SecurityAnalysisParametersInline,
479
498
  SelectClearable,
@@ -499,7 +518,9 @@ export {
499
518
  SubstationLayout,
500
519
  SubstationModificationForm,
501
520
  SwitchInput,
521
+ SwitchKind,
502
522
  SwitchWithLabel,
523
+ SwitchesBetweenSections,
503
524
  TAB_INFO,
504
525
  TRANSFORMERS_SELECTION_TYPE,
505
526
  TWT_SPLIT_SHUNT_ADMITTANCE,
@@ -534,8 +555,10 @@ export {
534
555
  VoltageInitParametersEditionDialog,
535
556
  VoltageInitParametersInLine,
536
557
  VoltageInitTabValues,
558
+ VoltageLevelCreationForm,
537
559
  WRITE_SLACK_BUS,
538
560
  alertThresholdMarks,
561
+ buildNewBusbarSections,
539
562
  copyEquipmentPropertiesForCreation,
540
563
  countRules,
541
564
  createPropertyModification,
@@ -555,6 +578,8 @@ export {
555
578
  generateTreeViewFinderClass,
556
579
  getConcatenatedProperties,
557
580
  getContingencyListsInfosFormSchema,
581
+ getCreateSwitchesEmptyFormData,
582
+ getCreateSwitchesValidationSchema,
558
583
  getExpertFilterEmptyFormData,
559
584
  getExplicitNamingFilterEmptyFormData,
560
585
  getFilledPropertiesFromModification,
@@ -606,6 +631,7 @@ export {
606
631
  toFormValuesContingencyListsInfos,
607
632
  toFormValuesLimitReductions,
608
633
  toModificationProperties,
634
+ translateSwitchKinds,
609
635
  unscrollableDialogStyles,
610
636
  useConvertValue,
611
637
  useCsvExport,
@@ -614,5 +640,9 @@ export {
614
640
  useGlobalAnnouncement,
615
641
  useListenerManager,
616
642
  useNotificationsListener,
617
- useValid
643
+ useValid,
644
+ voltageLevelCreationDtoToForm,
645
+ voltageLevelCreationEmptyFormData,
646
+ voltageLevelCreationFormSchema,
647
+ voltageLevelCreationFormToDto
618
648
  };
@@ -28,6 +28,7 @@ import { CountriesInput } from "./reactHookForm/selectInputs/CountriesInput.js";
28
28
  import { InputWithPopupConfirmation } from "./reactHookForm/selectInputs/InputWithPopupConfirmation.js";
29
29
  import { MuiSelectInput } from "./reactHookForm/selectInputs/MuiSelectInput.js";
30
30
  import { SelectInput } from "./reactHookForm/selectInputs/SelectInput.js";
31
+ import { EnumInput } from "./reactHookForm/selectInputs/EnumInput.js";
31
32
  import { TableNumericalInput } from "./reactHookForm/tableInputs/table-numerical-input.js";
32
33
  import { TableTextInput } from "./reactHookForm/tableInputs/table-text-input.js";
33
34
  import { DescriptionField } from "./reactHookForm/text/DescriptionField.js";
@@ -86,6 +87,7 @@ export {
86
87
  DescriptionInput,
87
88
  DirectoryItemsInput,
88
89
  ElementValueEditor,
90
+ EnumInput,
89
91
  ErrorInput,
90
92
  ExpandableInput,
91
93
  ExpandingTextField,
@@ -27,6 +27,7 @@ import { CountriesInput } from "./selectInputs/CountriesInput.js";
27
27
  import { InputWithPopupConfirmation } from "./selectInputs/InputWithPopupConfirmation.js";
28
28
  import { MuiSelectInput } from "./selectInputs/MuiSelectInput.js";
29
29
  import { SelectInput } from "./selectInputs/SelectInput.js";
30
+ import { EnumInput } from "./selectInputs/EnumInput.js";
30
31
  import { TableNumericalInput } from "./tableInputs/table-numerical-input.js";
31
32
  import { TableTextInput } from "./tableInputs/table-text-input.js";
32
33
  import { DescriptionField } from "./text/DescriptionField.js";
@@ -61,6 +62,7 @@ export {
61
62
  DescriptionField,
62
63
  DescriptionInput,
63
64
  DirectoryItemsInput,
65
+ EnumInput,
64
66
  ErrorInput,
65
67
  ExpandableInput,
66
68
  ExpandingTextField,
@@ -6,7 +6,7 @@ function IntegerInput(props) {
6
6
  if (value === "-") {
7
7
  return value;
8
8
  }
9
- return value === null || typeof value === "number" && Number.isNaN(value) ? "" : value.toString();
9
+ return value === null || value === void 0 || typeof value === "number" && Number.isNaN(value) ? "" : value.toString();
10
10
  };
11
11
  const outputTransform = (value) => {
12
12
  if (value === "-") {
@@ -0,0 +1,18 @@
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 EnumInputProps<T> {
8
+ options: T[];
9
+ name: string;
10
+ label: string;
11
+ size: 'small' | 'medium';
12
+ labelValues: Record<string, string>;
13
+ }
14
+ export declare function EnumInput<T extends {
15
+ id: string;
16
+ label: string;
17
+ }>({ options, name, label, size, labelValues, }: Readonly<EnumInputProps<T>>): import("react/jsx-runtime").JSX.Element;
18
+ export {};
@@ -0,0 +1,28 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { FormControl, InputLabel, Select, MenuItem, FormHelperText } from "@mui/material";
3
+ import { FormattedMessage } from "react-intl";
4
+ import { useController } from "react-hook-form";
5
+ import { FieldLabel } from "../utils/FieldLabel.js";
6
+ import "react";
7
+ import "@mui/icons-material";
8
+ import "yup";
9
+ function EnumInput({
10
+ options,
11
+ name,
12
+ label,
13
+ size,
14
+ labelValues
15
+ }) {
16
+ const {
17
+ field: { onChange, value },
18
+ fieldState: { error }
19
+ } = useController({ name });
20
+ return /* @__PURE__ */ jsxs(FormControl, { fullWidth: true, size, error: !!error, children: [
21
+ /* @__PURE__ */ jsx(InputLabel, { id: "enum-type-label", children: /* @__PURE__ */ jsx(FieldLabel, { label, values: labelValues }) }),
22
+ /* @__PURE__ */ jsx(Select, { label, id: label, value, fullWidth: true, onChange, children: options.map((e) => /* @__PURE__ */ jsx(MenuItem, { value: e.id, children: /* @__PURE__ */ jsx("em", { children: /* @__PURE__ */ jsx(FormattedMessage, { id: e.label }) }) }, e.label)) }),
23
+ error?.message && /* @__PURE__ */ jsx(FormHelperText, { children: /* @__PURE__ */ jsx(FormattedMessage, { id: error.message }) })
24
+ ] });
25
+ }
26
+ export {
27
+ EnumInput
28
+ };
@@ -8,3 +8,4 @@ export * from './CountriesInput';
8
8
  export * from './InputWithPopupConfirmation';
9
9
  export * from './MuiSelectInput';
10
10
  export * from './SelectInput';
11
+ export * from './EnumInput';
@@ -2,8 +2,10 @@ import { CountriesInput } from "./CountriesInput.js";
2
2
  import { InputWithPopupConfirmation } from "./InputWithPopupConfirmation.js";
3
3
  import { MuiSelectInput } from "./MuiSelectInput.js";
4
4
  import { SelectInput } from "./SelectInput.js";
5
+ import { EnumInput } from "./EnumInput.js";
5
6
  export {
6
7
  CountriesInput,
8
+ EnumInput,
7
9
  InputWithPopupConfirmation,
8
10
  MuiSelectInput,
9
11
  SelectInput
@@ -6,3 +6,4 @@
6
6
  */
7
7
  export * from './common';
8
8
  export * from './substation';
9
+ export * from './voltage-level';
@@ -6,11 +6,26 @@ import { SubstationCreationForm } from "./substation/creation/SubstationCreation
6
6
  import { substationCreationDtoToForm, substationCreationEmptyFormData, substationCreationFormSchema, substationCreationFormToDto } from "./substation/creation/substationCreation.utils.js";
7
7
  import { SubstationModificationForm } from "./substation/modification/SubstationModificationForm.js";
8
8
  import { substationModificationDtoToForm, substationModificationEmptyFormData, substationModificationFormSchema, substationModificationFormToDto } from "./substation/modification/substationModification.utils.js";
9
+ import { CreateSwitchesDialog } from "./voltage-level/creation/switches-between-sections/creation/CreateSwitchesDialog.js";
10
+ import { SwitchesBetweenSections } from "./voltage-level/creation/switches-between-sections/SwitchesBetweenSections.js";
11
+ import { CouplingOmnibusForm } from "./voltage-level/creation/coupling-omnibus/CouplingOmnibusForm.js";
12
+ import { CouplingOmnibusCreation } from "./voltage-level/creation/coupling-omnibus/CouplingOmnibusCreation.js";
13
+ import { VoltageLevelCreationForm } from "./voltage-level/creation/VoltageLevelCreationForm.js";
14
+ import { SWITCH_TYPE, buildNewBusbarSections, getCreateSwitchesEmptyFormData, getCreateSwitchesValidationSchema, translateSwitchKinds, voltageLevelCreationDtoToForm, voltageLevelCreationEmptyFormData, voltageLevelCreationFormSchema, voltageLevelCreationFormToDto } from "./voltage-level/creation/voltageLevelCreation.utils.js";
15
+ import { SwitchKind } from "./voltage-level/creation/voltageLevelCreation.types.js";
9
16
  export {
17
+ CouplingOmnibusCreation,
18
+ CouplingOmnibusForm,
19
+ CreateSwitchesDialog,
10
20
  PropertiesForm,
11
21
  PropertyForm,
22
+ SWITCH_TYPE,
12
23
  SubstationCreationForm,
13
24
  SubstationModificationForm,
25
+ SwitchKind,
26
+ SwitchesBetweenSections,
27
+ VoltageLevelCreationForm,
28
+ buildNewBusbarSections,
14
29
  copyEquipmentPropertiesForCreation,
15
30
  createPropertyModification,
16
31
  creationPropertiesSchema,
@@ -18,6 +33,8 @@ export {
18
33
  fetchPredefinedProperties,
19
34
  filledTextField,
20
35
  getConcatenatedProperties,
36
+ getCreateSwitchesEmptyFormData,
37
+ getCreateSwitchesValidationSchema,
21
38
  getFilledPropertiesFromModification,
22
39
  getPropertiesFromModification,
23
40
  getPropertyValue,
@@ -34,5 +51,10 @@ export {
34
51
  substationModificationEmptyFormData,
35
52
  substationModificationFormSchema,
36
53
  substationModificationFormToDto,
37
- toModificationProperties
54
+ toModificationProperties,
55
+ translateSwitchKinds,
56
+ voltageLevelCreationDtoToForm,
57
+ voltageLevelCreationEmptyFormData,
58
+ voltageLevelCreationFormSchema,
59
+ voltageLevelCreationFormToDto
38
60
  };
@@ -0,0 +1,11 @@
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 interface VoltageLevelCreationFormProps {
8
+ substationOptions?: string[];
9
+ showDeleteSubstationButton?: boolean;
10
+ }
11
+ export declare function VoltageLevelCreationForm({ substationOptions, showDeleteSubstationButton, }?: VoltageLevelCreationFormProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,174 @@
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import { useEffect, useCallback } from "react";
3
+ import { Grid, Box } from "@mui/material";
4
+ import { useFormContext, useWatch } from "react-hook-form";
5
+ import GridItem from "../../../grid/grid-item.js";
6
+ import GridSection from "../../../grid/grid-section.js";
7
+ import "react-intl";
8
+ import "../../../overflowableText/OverflowableText.js";
9
+ import { VoltageAdornment, KiloAmpereAdornment } from "../../../../utils/constants/adornments.js";
10
+ import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
11
+ import "../../../../utils/conversionUtils.js";
12
+ import "../../../../utils/types/equipmentType.js";
13
+ import "@mui/icons-material";
14
+ import "../../../../utils/yupConfig.js";
15
+ import { fetchDefaultCountry } from "../../../../services/appsMetadata.js";
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 "yup";
22
+ import "../../../treeViewFinder/TreeViewFinder.js";
23
+ import "../../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
24
+ import "../../../customAGGrid/customAggrid.js";
25
+ import "ag-grid-community";
26
+ import "react-papaparse";
27
+ import "react-csv-downloader";
28
+ import { AutocompleteInput } from "../../../inputs/reactHookForm/autocompleteInputs/AutocompleteInput.js";
29
+ import { FloatInput } from "../../../inputs/reactHookForm/numbers/FloatInput.js";
30
+ import { IntegerInput } from "../../../inputs/reactHookForm/numbers/IntegerInput.js";
31
+ import "../../../inputs/reactHookForm/numbers/RangeInput.js";
32
+ import { TextInput } from "../../../inputs/reactHookForm/text/TextInput.js";
33
+ import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
34
+ import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
35
+ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
36
+ import "@material-symbols/svg-400/outlined/add_notes.svg?react";
37
+ import "../../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
38
+ import "@react-querybuilder/material";
39
+ import "../../../filter/expert/expertFilterConstants.js";
40
+ import "../../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
41
+ import "uuid";
42
+ import "../../../inputs/reactQueryBuilder/PropertyValueEditor.js";
43
+ import "react-querybuilder";
44
+ import { PropertiesForm } from "../../common/properties/PropertiesForm.js";
45
+ import "./switches-between-sections/creation/CreateSwitchesDialog.js";
46
+ import { SwitchesBetweenSections } from "./switches-between-sections/SwitchesBetweenSections.js";
47
+ import { CouplingOmnibusForm } from "./coupling-omnibus/CouplingOmnibusForm.js";
48
+ import { SubstationCreationSection } from "./substation-creation/SubstationCreationSection.js";
49
+ import { SubstationAutocompleteAddButton } from "./substation-creation/SubstationAutocompleteAddButton.js";
50
+ function VoltageLevelCreationForm({
51
+ substationOptions,
52
+ showDeleteSubstationButton = true
53
+ } = {}) {
54
+ const { setValue, getValues } = useFormContext();
55
+ const watchAddSubstationCreation = useWatch({ name: FieldConstants.ADD_SUBSTATION_CREATION });
56
+ const watchHideNominalVoltage = useWatch({ name: FieldConstants.HIDE_NOMINAL_VOLTAGE });
57
+ const watchHideBusBarSection = useWatch({ name: FieldConstants.HIDE_BUS_BAR_SECTION });
58
+ const watchBusBarCount = useWatch({ name: FieldConstants.BUS_BAR_COUNT });
59
+ const watchSectionCount = useWatch({ name: FieldConstants.SECTION_COUNT });
60
+ const displayOmnibus = watchBusBarCount > 1 || watchSectionCount > 1;
61
+ useEffect(() => {
62
+ if (watchAddSubstationCreation && !getValues(FieldConstants.COUNTRY)) {
63
+ fetchDefaultCountry().then((country) => {
64
+ if (country) {
65
+ setValue(FieldConstants.COUNTRY, country);
66
+ }
67
+ });
68
+ }
69
+ }, [setValue, getValues, watchAddSubstationCreation]);
70
+ const handleDeleteSubstationCreation = useCallback(() => {
71
+ setValue(FieldConstants.ADD_SUBSTATION_CREATION, false);
72
+ setValue(FieldConstants.SUBSTATION_CREATION_ID, null);
73
+ setValue(FieldConstants.SUBSTATION_NAME, null);
74
+ setValue(FieldConstants.COUNTRY, null);
75
+ }, [setValue]);
76
+ const substationField = substationOptions ? /* @__PURE__ */ jsx(
77
+ AutocompleteInput,
78
+ {
79
+ openOnFocus: true,
80
+ forcePopupIcon: true,
81
+ name: FieldConstants.SUBSTATION_ID,
82
+ label: "SUBSTATION",
83
+ options: substationOptions,
84
+ size: "small",
85
+ formProps: { margin: "normal" },
86
+ allowNewValue: true,
87
+ PaperComponent: SubstationAutocompleteAddButton,
88
+ noOptionsText: ""
89
+ }
90
+ ) : /* @__PURE__ */ jsx(TextInput, { name: FieldConstants.SUBSTATION_ID, label: "SUBSTATION", formProps: { margin: "normal" } });
91
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
92
+ /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
93
+ /* @__PURE__ */ jsx(GridItem, { children: /* @__PURE__ */ jsx(
94
+ TextInput,
95
+ {
96
+ name: FieldConstants.EQUIPMENT_ID,
97
+ label: "ID",
98
+ formProps: { autoFocus: true, margin: "normal" }
99
+ }
100
+ ) }),
101
+ /* @__PURE__ */ jsx(GridItem, { children: /* @__PURE__ */ jsx(TextInput, { name: FieldConstants.EQUIPMENT_NAME, label: "Name", formProps: { margin: "normal" } }) })
102
+ ] }),
103
+ watchAddSubstationCreation ? /* @__PURE__ */ jsx(
104
+ SubstationCreationSection,
105
+ {
106
+ showDeleteButton: showDeleteSubstationButton,
107
+ onDelete: handleDeleteSubstationCreation
108
+ }
109
+ ) : /* @__PURE__ */ jsx(Grid, { container: true, spacing: 2, children: /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, sm: 6, children: substationField }) }),
110
+ /* @__PURE__ */ jsx(GridSection, { title: "VoltageText" }),
111
+ /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
112
+ !watchHideNominalVoltage && /* @__PURE__ */ jsx(GridItem, { size: 4, children: /* @__PURE__ */ jsx(
113
+ FloatInput,
114
+ {
115
+ name: FieldConstants.NOMINAL_V,
116
+ label: "NominalVoltage",
117
+ adornment: VoltageAdornment
118
+ }
119
+ ) }),
120
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: /* @__PURE__ */ jsx(
121
+ FloatInput,
122
+ {
123
+ name: FieldConstants.LOW_VOLTAGE_LIMIT,
124
+ label: "LowVoltageLimit",
125
+ adornment: VoltageAdornment
126
+ }
127
+ ) }),
128
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: /* @__PURE__ */ jsx(
129
+ FloatInput,
130
+ {
131
+ name: FieldConstants.HIGH_VOLTAGE_LIMIT,
132
+ label: "HighVoltageLimit",
133
+ adornment: VoltageAdornment
134
+ }
135
+ ) })
136
+ ] }),
137
+ /* @__PURE__ */ jsx(GridSection, { title: "ShortCircuit" }),
138
+ /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
139
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: /* @__PURE__ */ jsx(
140
+ FloatInput,
141
+ {
142
+ name: FieldConstants.LOW_SHORT_CIRCUIT_CURRENT_LIMIT,
143
+ label: "LowShortCircuitCurrentLimit",
144
+ adornment: KiloAmpereAdornment
145
+ }
146
+ ) }),
147
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: /* @__PURE__ */ jsx(
148
+ FloatInput,
149
+ {
150
+ name: FieldConstants.HIGH_SHORT_CIRCUIT_CURRENT_LIMIT,
151
+ label: "HighShortCircuitCurrentLimit",
152
+ adornment: KiloAmpereAdornment
153
+ }
154
+ ) }),
155
+ /* @__PURE__ */ jsx(Box, { sx: { width: "100%" } })
156
+ ] }),
157
+ !watchHideBusBarSection && /* @__PURE__ */ jsxs(Fragment, { children: [
158
+ /* @__PURE__ */ jsx(GridSection, { title: "BusBarSections" }),
159
+ /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
160
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: /* @__PURE__ */ jsx(IntegerInput, { name: FieldConstants.BUS_BAR_COUNT, label: "BusBarCount" }) }),
161
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: /* @__PURE__ */ jsx(IntegerInput, { name: FieldConstants.SECTION_COUNT, label: "numberOfSections" }) }),
162
+ /* @__PURE__ */ jsx(SwitchesBetweenSections, {})
163
+ ] }),
164
+ displayOmnibus && /* @__PURE__ */ jsxs(Fragment, { children: [
165
+ /* @__PURE__ */ jsx(GridSection, { title: "Coupling_Omnibus" }),
166
+ /* @__PURE__ */ jsx(Grid, { container: true, children: /* @__PURE__ */ jsx(GridItem, { size: 12, children: /* @__PURE__ */ jsx(CouplingOmnibusForm, {}) }) })
167
+ ] })
168
+ ] }),
169
+ /* @__PURE__ */ jsx(PropertiesForm, { networkElementType: "voltageLevel" })
170
+ ] });
171
+ }
172
+ export {
173
+ VoltageLevelCreationForm
174
+ };
@@ -0,0 +1,7 @@
1
+ import { Option } from '../../../../../utils/types/types';
2
+ interface CouplingOmnibusCreationProps {
3
+ index: number;
4
+ sectionOptions: Option[];
5
+ }
6
+ export declare function CouplingOmnibusCreation({ index, sectionOptions }: Readonly<CouplingOmnibusCreationProps>): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,54 @@
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { useEffect } from "react";
3
+ import { useFormContext } from "react-hook-form";
4
+ import { AutocompleteInput } from "../../../../inputs/reactHookForm/autocompleteInputs/AutocompleteInput.js";
5
+ import GridItem from "../../../../grid/grid-item.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
+ function CouplingOmnibusCreation({ index, sectionOptions }) {
12
+ const { getValues, trigger, subscribe } = useFormContext();
13
+ useEffect(() => {
14
+ const unsubscribe = subscribe({
15
+ name: [`${FieldConstants.COUPLING_OMNIBUS}.${index}.${FieldConstants.BUS_BAR_SECTION_ID1}`],
16
+ formState: {
17
+ values: true
18
+ },
19
+ callback: () => {
20
+ if (getValues(`${FieldConstants.COUPLING_OMNIBUS}.${index}.${FieldConstants.BUS_BAR_SECTION_ID2}`)) {
21
+ trigger(`${FieldConstants.COUPLING_OMNIBUS}.${index}.${FieldConstants.BUS_BAR_SECTION_ID2}`);
22
+ }
23
+ }
24
+ });
25
+ return () => unsubscribe();
26
+ }, [subscribe, trigger, getValues, index]);
27
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
28
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: /* @__PURE__ */ jsx(
29
+ AutocompleteInput,
30
+ {
31
+ allowNewValue: true,
32
+ forcePopupIcon: true,
33
+ name: `${FieldConstants.COUPLING_OMNIBUS}.${index}.${FieldConstants.BUS_BAR_SECTION_ID1}`,
34
+ label: "BusBarSectionID1",
35
+ options: sectionOptions ?? [],
36
+ size: "small"
37
+ }
38
+ ) }),
39
+ /* @__PURE__ */ jsx(GridItem, { size: 4, children: /* @__PURE__ */ jsx(
40
+ AutocompleteInput,
41
+ {
42
+ allowNewValue: true,
43
+ forcePopupIcon: true,
44
+ name: `${FieldConstants.COUPLING_OMNIBUS}.${index}.${FieldConstants.BUS_BAR_SECTION_ID2}`,
45
+ label: "BusBarSectionID2",
46
+ options: sectionOptions ?? [],
47
+ size: "small"
48
+ }
49
+ ) })
50
+ ] });
51
+ }
52
+ export {
53
+ CouplingOmnibusCreation
54
+ };
@@ -0,0 +1,7 @@
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 function CouplingOmnibusForm(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,73 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useState, useEffect } from "react";
3
+ import { useFormContext } from "react-hook-form";
4
+ import { CouplingOmnibusCreation } from "./CouplingOmnibusCreation.js";
5
+ import { ExpandableInput } from "../../../../inputs/reactHookForm/expandableInput/ExpandableInput.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 { fetchBusBarSectionsForNewCoupler } from "../../../../../services/networkModification.js";
12
+ function CouplingOmnibusForm() {
13
+ const { setValue, subscribe, trigger, getValues, formState } = useFormContext();
14
+ const couplingOmnibusCreation = {
15
+ [FieldConstants.BUS_BAR_SECTION_ID1]: null,
16
+ [FieldConstants.BUS_BAR_SECTION_ID2]: null
17
+ };
18
+ const [sectionOptions, setSectionOptions] = useState([]);
19
+ useEffect(() => {
20
+ const switchKinds = getValues(FieldConstants.SWITCH_KINDS).map(
21
+ (value) => value.switchKind
22
+ );
23
+ fetchBusBarSectionsForNewCoupler(
24
+ getValues(FieldConstants.EQUIPMENT_ID),
25
+ getValues(FieldConstants.BUS_BAR_COUNT),
26
+ getValues(FieldConstants.SECTION_COUNT),
27
+ switchKinds
28
+ ).then((bbsIds) => {
29
+ setSectionOptions(bbsIds);
30
+ });
31
+ }, [getValues]);
32
+ useEffect(() => {
33
+ const unsubscribe = subscribe({
34
+ name: [
35
+ FieldConstants.EQUIPMENT_ID,
36
+ FieldConstants.BUS_BAR_COUNT,
37
+ FieldConstants.SECTION_COUNT,
38
+ FieldConstants.SWITCH_KINDS
39
+ ],
40
+ formState: {
41
+ values: true
42
+ },
43
+ callback: () => {
44
+ const switchKinds = getValues(FieldConstants.SWITCH_KINDS).map(
45
+ (value) => value.switchKind
46
+ );
47
+ fetchBusBarSectionsForNewCoupler(
48
+ getValues(FieldConstants.EQUIPMENT_ID),
49
+ getValues(FieldConstants.BUS_BAR_COUNT),
50
+ getValues(FieldConstants.SECTION_COUNT),
51
+ switchKinds
52
+ ).then((bbsIds) => {
53
+ setValue(FieldConstants.COUPLING_OMNIBUS, []);
54
+ setSectionOptions(bbsIds);
55
+ });
56
+ }
57
+ });
58
+ return () => unsubscribe();
59
+ }, [subscribe, trigger, getValues, setValue, formState]);
60
+ return /* @__PURE__ */ jsx(
61
+ ExpandableInput,
62
+ {
63
+ name: FieldConstants.COUPLING_OMNIBUS,
64
+ Field: CouplingOmnibusCreation,
65
+ fieldProps: { sectionOptions },
66
+ addButtonLabel: "AddCoupling_Omnibus",
67
+ initialValue: couplingOmnibusCreation
68
+ }
69
+ );
70
+ }
71
+ export {
72
+ CouplingOmnibusForm
73
+ };
@@ -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 { CouplingOmnibusForm } from './CouplingOmnibusForm';
8
+ export { CouplingOmnibusCreation } from './CouplingOmnibusCreation';
@@ -0,0 +1,6 @@
1
+ import { CouplingOmnibusForm } from "./CouplingOmnibusForm.js";
2
+ import { CouplingOmnibusCreation } from "./CouplingOmnibusCreation.js";
3
+ export {
4
+ CouplingOmnibusCreation,
5
+ CouplingOmnibusForm
6
+ };
@@ -0,0 +1,11 @@
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 './switches-between-sections';
8
+ export * from './coupling-omnibus';
9
+ export * from './VoltageLevelCreationForm';
10
+ export * from './voltageLevelCreation.utils';
11
+ export * from './voltageLevelCreation.types';