@gridsuite/commons-ui 0.279.0 → 0.281.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 (132) hide show
  1. package/dist/components/composite/customAGGrid/separatorCellRenderer.d.ts +7 -2
  2. package/dist/components/composite/customAGGrid/separatorCellRenderer.js +2 -2
  3. package/dist/components/ui/dialogs/elementSaveDialog/ElementSaveDialog.d.ts +6 -1
  4. package/dist/components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js +29 -5
  5. package/dist/components/ui/reactHookForm/booleans/RadioInput.d.ts +1 -0
  6. package/dist/components/ui/reactHookForm/booleans/RadioInput.js +2 -1
  7. package/dist/features/index.js +93 -3
  8. package/dist/features/network-modifications/index.d.ts +1 -0
  9. package/dist/features/network-modifications/index.js +91 -3
  10. package/dist/features/network-modifications/tabular/TabularForm.d.ts +22 -0
  11. package/dist/features/network-modifications/tabular/TabularForm.js +536 -0
  12. package/dist/features/network-modifications/tabular/index.d.ts +7 -0
  13. package/dist/features/network-modifications/tabular/index.js +65 -0
  14. package/dist/features/network-modifications/tabular/properties/DefineTabularPropertiesDialog.d.ts +12 -0
  15. package/dist/features/network-modifications/tabular/properties/DefineTabularPropertiesDialog.js +123 -0
  16. package/dist/features/network-modifications/tabular/properties/TabularPropertiesForm.d.ts +1 -0
  17. package/dist/features/network-modifications/tabular/properties/TabularPropertiesForm.js +87 -0
  18. package/dist/features/network-modifications/tabular/properties/TabularPropertyForm.d.ts +5 -0
  19. package/dist/features/network-modifications/tabular/properties/TabularPropertyForm.js +91 -0
  20. package/dist/features/network-modifications/tabular/properties/index.d.ts +4 -0
  21. package/dist/features/network-modifications/tabular/properties/index.js +13 -0
  22. package/dist/features/network-modifications/tabular/properties/tabularProperty.utils.d.ts +26 -0
  23. package/dist/features/network-modifications/tabular/properties/tabularProperty.utils.js +50 -0
  24. package/dist/features/network-modifications/tabular/tabular.constants.d.ts +59 -0
  25. package/dist/features/network-modifications/tabular/tabular.constants.js +75 -0
  26. package/dist/features/network-modifications/tabular/tabular.types.d.ts +41 -0
  27. package/dist/features/network-modifications/tabular/tabular.types.js +8 -0
  28. package/dist/features/network-modifications/tabular/tabular.utils.d.ts +68 -0
  29. package/dist/features/network-modifications/tabular/tabular.utils.js +301 -0
  30. package/dist/features/network-modifications/tabular/tabularCreation.utils.d.ts +25 -0
  31. package/dist/features/network-modifications/tabular/tabularCreation.utils.js +276 -0
  32. package/dist/features/network-modifications/tabular/tabularModification.utils.d.ts +43 -0
  33. package/dist/features/network-modifications/tabular/tabularModification.utils.js +406 -0
  34. package/dist/features/network-modifications/voltageLevel/common/HeaderWithTooltip.d.ts +8 -0
  35. package/dist/features/network-modifications/voltageLevel/common/HeaderWithTooltip.js +119 -0
  36. package/dist/features/network-modifications/voltageLevel/common/index.d.ts +1 -0
  37. package/dist/features/network-modifications/voltageLevel/common/index.js +4 -0
  38. package/dist/features/network-modifications/voltageLevel/index.d.ts +4 -1
  39. package/dist/features/network-modifications/voltageLevel/index.js +28 -3
  40. package/dist/features/network-modifications/voltageLevel/moveFeederBays/MoveVoltageLevelFeederBaysForm.d.ts +8 -0
  41. package/dist/features/network-modifications/voltageLevel/moveFeederBays/MoveVoltageLevelFeederBaysForm.js +387 -0
  42. package/dist/features/network-modifications/voltageLevel/moveFeederBays/feederBay/FeederBayDirectionCellRender.d.ts +6 -0
  43. package/dist/features/network-modifications/voltageLevel/moveFeederBays/feederBay/FeederBayDirectionCellRender.js +64 -0
  44. package/dist/features/network-modifications/voltageLevel/moveFeederBays/feederBay/FeederBayPositionCellRender.d.ts +6 -0
  45. package/dist/features/network-modifications/voltageLevel/moveFeederBays/feederBay/FeederBayPositionCellRender.js +102 -0
  46. package/dist/features/network-modifications/voltageLevel/moveFeederBays/feederBay/index.d.ts +2 -0
  47. package/dist/features/network-modifications/voltageLevel/moveFeederBays/feederBay/index.js +6 -0
  48. package/dist/features/network-modifications/voltageLevel/moveFeederBays/index.d.ts +4 -0
  49. package/dist/features/network-modifications/voltageLevel/moveFeederBays/index.js +13 -0
  50. package/dist/features/network-modifications/voltageLevel/moveFeederBays/moveVoltageLevelFeederBays.type.d.ts +36 -0
  51. package/dist/features/network-modifications/voltageLevel/moveFeederBays/moveVoltageLevelFeederBays.utils.d.ts +37 -0
  52. package/dist/features/network-modifications/voltageLevel/moveFeederBays/moveVoltageLevelFeederBays.utils.js +86 -0
  53. package/dist/features/network-modifications/voltageLevel/topology/{CreateVoltageLevelTopologyForm.d.ts → creation/CreateVoltageLevelTopologyForm.d.ts} +1 -1
  54. package/dist/features/network-modifications/voltageLevel/topology/{CreateVoltageLevelTopologyForm.js → creation/CreateVoltageLevelTopologyForm.js} +38 -38
  55. package/dist/features/network-modifications/voltageLevel/topology/{voltageLevelTopologyCreation.types.d.ts → creation/voltageLevelTopologyCreation.types.d.ts} +1 -1
  56. package/dist/features/network-modifications/voltageLevel/topology/creation/voltageLevelTopologyCreation.types.js +1 -0
  57. package/dist/features/network-modifications/voltageLevel/topology/{voltageLevelTopologyCreation.utils.d.ts → creation/voltageLevelTopologyCreation.utils.d.ts} +1 -1
  58. package/dist/features/network-modifications/voltageLevel/topology/{voltageLevelTopologyCreation.utils.js → creation/voltageLevelTopologyCreation.utils.js} +5 -5
  59. package/dist/features/network-modifications/voltageLevel/topology/modification/ConnectionCellRender.d.ts +6 -0
  60. package/dist/features/network-modifications/voltageLevel/topology/modification/ConnectionCellRender.js +80 -0
  61. package/dist/features/network-modifications/voltageLevel/topology/modification/VoltageLevelTopologyModificationForm.d.ts +10 -0
  62. package/dist/features/network-modifications/voltageLevel/topology/modification/VoltageLevelTopologyModificationForm.js +284 -0
  63. package/dist/features/network-modifications/voltageLevel/topology/modification/constants.d.ts +10 -0
  64. package/dist/features/network-modifications/voltageLevel/topology/modification/constants.js +10 -0
  65. package/dist/features/network-modifications/voltageLevel/topology/modification/index.d.ts +10 -0
  66. package/dist/features/network-modifications/voltageLevel/topology/modification/index.js +14 -0
  67. package/dist/features/network-modifications/voltageLevel/topology/modification/voltageLevelTopologyModification.types.d.ts +28 -0
  68. package/dist/features/network-modifications/voltageLevel/topology/modification/voltageLevelTopologyModification.types.js +1 -0
  69. package/dist/features/network-modifications/voltageLevel/topology/modification/voltageLevelTopologyModification.utils.d.ts +29 -0
  70. package/dist/features/network-modifications/voltageLevel/topology/modification/voltageLevelTopologyModification.utils.js +124 -0
  71. package/dist/features/parameters/common/index.d.ts +1 -0
  72. package/dist/features/parameters/common/index.js +2 -0
  73. package/dist/features/parameters/common/parameter-field.d.ts +2 -2
  74. package/dist/features/parameters/common/parameter-field.js +1 -1
  75. package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-form.js +1 -1
  76. package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-inline.js +6 -6
  77. package/dist/features/parameters/dynamic-margin-calculation/loads-variations-parameters.js +1 -1
  78. package/dist/features/parameters/dynamic-margin-calculation/time-delay-parameters.js +1 -1
  79. package/dist/features/parameters/dynamic-security-analysis/contingency-parameters.js +1 -1
  80. package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-inline.js +6 -6
  81. package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.js +1 -1
  82. package/dist/features/parameters/dynamic-security-analysis/scenario-parameters.js +1 -1
  83. package/dist/features/parameters/dynamic-simulation/dynamic-simulation-inline.js +6 -6
  84. package/dist/features/parameters/dynamic-simulation/dynamic-simulation-parameters-form.js +1 -1
  85. package/dist/features/parameters/dynamic-simulation/network/network-parameters.js +1 -1
  86. package/dist/features/parameters/dynamic-simulation/solver/common-solver/common-solver-parameters.js +1 -1
  87. package/dist/features/parameters/dynamic-simulation/solver/ida-solver/ida-solver-parameters.js +1 -1
  88. package/dist/features/parameters/dynamic-simulation/solver/sim-solver/simplified-solver-parameters.js +1 -1
  89. package/dist/features/parameters/dynamic-simulation/solver/solver-parameters.js +1 -1
  90. package/dist/features/parameters/dynamic-simulation/time-delay/time-delay-parameters.js +1 -1
  91. package/dist/features/parameters/index.js +2 -0
  92. package/dist/features/parameters/loadflow/load-flow-advanced-parameters.js +1 -1
  93. package/dist/features/parameters/loadflow/load-flow-general-parameters.js +1 -1
  94. package/dist/features/parameters/loadflow/load-flow-parameters-inline.js +5 -5
  95. package/dist/features/parameters/loadflow/load-flow-provider-specific-parameters.js +1 -1
  96. package/dist/features/parameters/network-visualizations/network-visualizations-parameters-inline.js +5 -5
  97. package/dist/features/parameters/pcc-min/pcc-min-parameters-inline.js +5 -5
  98. package/dist/features/parameters/security-analysis/security-analysis-parameters-inline.js +6 -6
  99. package/dist/features/parameters/sensi/sensitivity-analysis-parameters-inline.js +6 -6
  100. package/dist/features/parameters/short-circuit/short-circuit-parameters-inline.js +5 -5
  101. package/dist/features/parameters/voltage-init/voltage-init-parameters-inline.js +5 -5
  102. package/dist/features/side-bar/AppSideBarHeader.js +20 -5
  103. package/dist/features/side-bar/EnvironmentChip.d.ts +13 -0
  104. package/dist/features/side-bar/EnvironmentChip.js +49 -0
  105. package/dist/index.js +97 -5
  106. package/dist/services/appsMetadata.d.ts +2 -0
  107. package/dist/services/directory.d.ts +1 -1
  108. package/dist/services/directory.js +6 -2
  109. package/dist/services/index.js +2 -1
  110. package/dist/services/userAdmin.d.ts +2 -1
  111. package/dist/services/userAdmin.js +9 -1
  112. package/dist/translations/en/businessErrorsEn.d.ts +1 -0
  113. package/dist/translations/en/businessErrorsEn.js +1 -0
  114. package/dist/translations/en/networkModificationsEn.d.ts +97 -0
  115. package/dist/translations/en/networkModificationsEn.js +103 -1
  116. package/dist/translations/fr/businessErrorsFr.d.ts +1 -0
  117. package/dist/translations/fr/businessErrorsFr.js +1 -0
  118. package/dist/translations/fr/networkModificationsFr.d.ts +97 -0
  119. package/dist/translations/fr/networkModificationsFr.js +103 -1
  120. package/dist/utils/constants/fieldConstants.d.ts +7 -1
  121. package/dist/utils/constants/fieldConstants.js +6 -0
  122. package/dist/utils/constants/index.js +2 -1
  123. package/dist/utils/constants/notificationsProvider.d.ts +1 -0
  124. package/dist/utils/constants/notificationsProvider.js +1 -0
  125. package/dist/utils/constants/translationKeys.d.ts +1 -0
  126. package/dist/utils/constants/translationKeys.js +2 -0
  127. package/dist/utils/index.js +2 -1
  128. package/dist/utils/types/types.d.ts +4 -0
  129. package/package.json +1 -1
  130. /package/dist/features/network-modifications/voltageLevel/{topology/voltageLevelTopologyCreation.types.js → moveFeederBays/moveVoltageLevelFeederBays.type.js} +0 -0
  131. /package/dist/features/network-modifications/voltageLevel/topology/{index.d.ts → creation/index.d.ts} +0 -0
  132. /package/dist/features/network-modifications/voltageLevel/topology/{index.js → creation/index.js} +0 -0
@@ -0,0 +1,123 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useCallback, useEffect } from "react";
3
+ import { useForm } from "react-hook-form";
4
+ import { yupResolver } from "@hookform/resolvers/yup";
5
+ import { Grid } from "@mui/material";
6
+ import "@mui/icons-material";
7
+ import "react-intl";
8
+ import "../../../../components/ui/overflowableText/OverflowableText.js";
9
+ import "../../../../utils/conversionUtils.js";
10
+ import "../../../../utils/types/equipmentType.js";
11
+ import { equipmentTypesForPredefinedPropertiesMapper } from "../../../../utils/mapper/equipmentTypesForPredefinedPropertiesMapper.js";
12
+ import "localized-countries";
13
+ import "localized-countries/data/fr";
14
+ import "localized-countries/data/en";
15
+ import "notistack";
16
+ import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
17
+ import "yup";
18
+ import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
19
+ import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
20
+ import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
21
+ import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
22
+ import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
23
+ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
24
+ import "@material-symbols/svg-400/outlined/add_notes-fill.svg?react";
25
+ import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
26
+ import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
27
+ import "../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
28
+ import "@hello-pangea/dnd";
29
+ import { CustomMuiDialog } from "../../../../components/ui/dialogs/customMuiDialog/CustomMuiDialog.js";
30
+ import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
31
+ import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
32
+ import "mui-nested-menu";
33
+ import "react-resizable-panels";
34
+ import "react-papaparse";
35
+ import "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/BottomTableButtons.js";
53
+ import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
54
+ import "ag-grid-community";
55
+ import "../../../../components/composite/customAGGrid/customAggrid.js";
56
+ import "../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
57
+ import "mathjs";
58
+ import "../../../../components/composite/report/report-viewer/log-table/log-table.js";
59
+ import "react-window";
60
+ import "../../../../components/composite/report/report-treeview/treeview-item.js";
61
+ import "../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
62
+ import { TabularFieldConstants } from "../tabular.constants.js";
63
+ import { TabularPropertiesForm } from "./TabularPropertiesForm.js";
64
+ import { emptyTabularProperties, tabularPropertiesSchema, buildPredefinedTabularProperties } from "./tabularProperty.utils.js";
65
+ const styles = {
66
+ dialogContent: {
67
+ ".MuiDialog-paper": {
68
+ width: "35%",
69
+ height: "50%",
70
+ maxWidth: "none",
71
+ margin: "auto"
72
+ }
73
+ }
74
+ };
75
+ function DefineTabularPropertiesDialog({
76
+ open,
77
+ equipmentType,
78
+ currentProperties,
79
+ predefinedEquipmentProperties,
80
+ onValidate
81
+ }) {
82
+ const formMethods = useForm({
83
+ defaultValues: emptyTabularProperties,
84
+ resolver: yupResolver(tabularPropertiesSchema)
85
+ });
86
+ const { reset } = formMethods;
87
+ const onClose = useCallback(() => {
88
+ open.setFalse();
89
+ reset(emptyTabularProperties);
90
+ }, [open, reset]);
91
+ useEffect(() => {
92
+ if (open.value && equipmentType) {
93
+ if (currentProperties?.length) {
94
+ reset({
95
+ [TabularFieldConstants.TABULAR_PROPERTIES]: currentProperties
96
+ });
97
+ } else {
98
+ const networkEquipmentType = equipmentTypesForPredefinedPropertiesMapper(equipmentType);
99
+ if (networkEquipmentType && predefinedEquipmentProperties?.[networkEquipmentType]) {
100
+ const propertyNames = Object.keys(predefinedEquipmentProperties[networkEquipmentType] ?? {}).sort(
101
+ (a, b) => a.localeCompare(b)
102
+ );
103
+ reset(buildPredefinedTabularProperties(propertyNames));
104
+ }
105
+ }
106
+ }
107
+ }, [currentProperties, equipmentType, open, predefinedEquipmentProperties, reset]);
108
+ return /* @__PURE__ */ jsx(
109
+ CustomMuiDialog,
110
+ {
111
+ titleId: "DefinePropertiesTitle",
112
+ open: open.value,
113
+ formContext: { ...formMethods, validationSchema: tabularPropertiesSchema },
114
+ onClose,
115
+ onSave: onValidate,
116
+ sx: styles.dialogContent,
117
+ children: /* @__PURE__ */ jsx(Grid, { container: true, children: /* @__PURE__ */ jsx(TabularPropertiesForm, {}) })
118
+ }
119
+ );
120
+ }
121
+ export {
122
+ DefineTabularPropertiesDialog
123
+ };
@@ -0,0 +1 @@
1
+ export declare function TabularPropertiesForm(): import("react").JSX.Element;
@@ -0,0 +1,87 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useCallback } from "react";
3
+ import { useFormContext } from "react-hook-form";
4
+ import { Grid } from "@mui/material";
5
+ import "@mui/icons-material";
6
+ import "react-intl";
7
+ import "../../../../components/ui/overflowableText/OverflowableText.js";
8
+ import "../../../../utils/conversionUtils.js";
9
+ import "../../../../utils/types/equipmentType.js";
10
+ import "localized-countries";
11
+ import "localized-countries/data/fr";
12
+ import "localized-countries/data/en";
13
+ import "notistack";
14
+ import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
15
+ import "yup";
16
+ import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
17
+ import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
18
+ import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
19
+ import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
20
+ import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
21
+ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
22
+ import "@material-symbols/svg-400/outlined/add_notes-fill.svg?react";
23
+ import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
24
+ import { ExpandableInput } from "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
25
+ import "../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
26
+ import "@hello-pangea/dnd";
27
+ import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
28
+ import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
29
+ import "mui-nested-menu";
30
+ import "react-resizable-panels";
31
+ import "react-papaparse";
32
+ import "react-dom";
33
+ import "autosuggest-highlight/match";
34
+ import "autosuggest-highlight/parse";
35
+ import "clsx";
36
+ import "../../../../components/composite/filter/FilterCreationDialog.js";
37
+ import "../../../../components/composite/filter/HeaderFilterForm.js";
38
+ import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
39
+ import "../../../../components/composite/filter/expert/ExpertFilterForm.js";
40
+ import "../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
41
+ import "../../../../components/composite/filter/expert/expertFilterConstants.js";
42
+ import "react-querybuilder";
43
+ import "uuid";
44
+ import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
45
+ import "../../../../components/composite/filter/utils/filterFormUtils.js";
46
+ import "@react-querybuilder/material";
47
+ import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
48
+ import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
49
+ import "../../../../components/composite/agGridTable/BottomTableButtons.js";
50
+ import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
51
+ import "ag-grid-community";
52
+ import "../../../../components/composite/customAGGrid/customAggrid.js";
53
+ import "../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
54
+ import "mathjs";
55
+ import "../../../../components/composite/report/report-viewer/log-table/log-table.js";
56
+ import "react-window";
57
+ import "../../../../components/composite/report/report-treeview/treeview-item.js";
58
+ import "../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
59
+ import { TabularFieldConstants } from "../tabular.constants.js";
60
+ import { TabularPropertyForm } from "./TabularPropertyForm.js";
61
+ import { initializedTabularProperty } from "./tabularProperty.utils.js";
62
+ function TabularPropertiesForm() {
63
+ const { getValues } = useFormContext();
64
+ const disabledDeletion = useCallback(
65
+ (idx) => {
66
+ const properties = getValues(TabularFieldConstants.TABULAR_PROPERTIES);
67
+ if (properties?.[idx] !== void 0) {
68
+ return properties[idx][TabularFieldConstants.PREDEFINED];
69
+ }
70
+ return false;
71
+ },
72
+ [getValues]
73
+ );
74
+ return /* @__PURE__ */ jsx(Grid, { container: true, children: /* @__PURE__ */ jsx(
75
+ ExpandableInput,
76
+ {
77
+ name: TabularFieldConstants.TABULAR_PROPERTIES,
78
+ Field: TabularPropertyForm,
79
+ addButtonLabel: "AddProperty",
80
+ initialValue: initializedTabularProperty(),
81
+ disabledDeletion
82
+ }
83
+ ) });
84
+ }
85
+ export {
86
+ TabularPropertiesForm
87
+ };
@@ -0,0 +1,5 @@
1
+ export interface TabularPropertyFormProps {
2
+ name: string;
3
+ index: string;
4
+ }
5
+ export declare function TabularPropertyForm({ name, index }: Readonly<TabularPropertyFormProps>): import("react").JSX.Element;
@@ -0,0 +1,91 @@
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import { useWatch } from "react-hook-form";
3
+ import "@mui/material";
4
+ import "@mui/icons-material";
5
+ import "react-intl";
6
+ import "../../../../components/ui/overflowableText/OverflowableText.js";
7
+ import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
8
+ import "../../../../utils/conversionUtils.js";
9
+ import "../../../../utils/types/equipmentType.js";
10
+ import "react";
11
+ import "localized-countries";
12
+ import "localized-countries/data/fr";
13
+ import "localized-countries/data/en";
14
+ import "notistack";
15
+ import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
16
+ import "yup";
17
+ import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
18
+ import { CheckboxInput } from "../../../../components/ui/reactHookForm/booleans/CheckboxInput.js";
19
+ import { TextInput } from "../../../../components/ui/reactHookForm/text/TextInput.js";
20
+ import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
21
+ import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
22
+ import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
23
+ import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
24
+ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
25
+ import "@material-symbols/svg-400/outlined/add_notes-fill.svg?react";
26
+ import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
27
+ import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
28
+ import "../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
29
+ import "@hello-pangea/dnd";
30
+ import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
31
+ import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
32
+ import "mui-nested-menu";
33
+ import "react-resizable-panels";
34
+ import "react-papaparse";
35
+ import "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 { GridItem } from "../../../../components/composite/grid/grid-item.js";
50
+ import "@react-querybuilder/material";
51
+ import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
52
+ import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
53
+ import "../../../../components/composite/agGridTable/BottomTableButtons.js";
54
+ import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
55
+ import "ag-grid-community";
56
+ import "../../../../components/composite/customAGGrid/customAggrid.js";
57
+ import "../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
58
+ import "mathjs";
59
+ import "../../../../components/composite/report/report-viewer/log-table/log-table.js";
60
+ import "react-window";
61
+ import "../../../../components/composite/report/report-treeview/treeview-item.js";
62
+ import "../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
63
+ import { italicFontTextField } from "../../common/form.utils.js";
64
+ import "../../common/properties/propertyUtils.js";
65
+ import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
66
+ import "@mui/material/colors";
67
+ import "@mui/x-charts";
68
+ import "../../common/currentLimits/limitsPane.utils.js";
69
+ import { TabularFieldConstants } from "../tabular.constants.js";
70
+ function TabularPropertyForm({ name, index }) {
71
+ const watchPredefined = useWatch({
72
+ name: `${name}.${index}.${TabularFieldConstants.PREDEFINED}`
73
+ });
74
+ const nameField = /* @__PURE__ */ jsx(TextInput, { name: `${name}.${index}.${FieldConstants.NAME}`, label: "PropertyName" });
75
+ const nameReadOnlyField = /* @__PURE__ */ jsx(
76
+ TextInput,
77
+ {
78
+ name: `${name}.${index}.${FieldConstants.NAME}`,
79
+ label: "PropertyName",
80
+ formProps: { disabled: true, ...italicFontTextField }
81
+ }
82
+ );
83
+ const selectionField = /* @__PURE__ */ jsx(CheckboxInput, { name: `${name}.${index}.${FieldConstants.SELECTED}` });
84
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
85
+ /* @__PURE__ */ jsx(GridItem, { size: 10, children: watchPredefined ? nameReadOnlyField : nameField }),
86
+ /* @__PURE__ */ jsx(GridItem, { size: 1, children: selectionField })
87
+ ] });
88
+ }
89
+ export {
90
+ TabularPropertyForm
91
+ };
@@ -0,0 +1,4 @@
1
+ export * from './DefineTabularPropertiesDialog';
2
+ export * from './TabularPropertiesForm';
3
+ export * from './TabularPropertyForm';
4
+ export * from './tabularProperty.utils';
@@ -0,0 +1,13 @@
1
+ import { DefineTabularPropertiesDialog } from "./DefineTabularPropertiesDialog.js";
2
+ import { TabularPropertiesForm } from "./TabularPropertiesForm.js";
3
+ import { TabularPropertyForm } from "./TabularPropertyForm.js";
4
+ import { buildPredefinedTabularProperties, emptyTabularProperties, initializedTabularProperty, tabularPropertiesSchema } from "./tabularProperty.utils.js";
5
+ export {
6
+ DefineTabularPropertiesDialog,
7
+ TabularPropertiesForm,
8
+ TabularPropertyForm,
9
+ buildPredefinedTabularProperties,
10
+ emptyTabularProperties,
11
+ initializedTabularProperty,
12
+ tabularPropertiesSchema
13
+ };
@@ -0,0 +1,26 @@
1
+ import { FieldConstants } from '../../../../utils';
2
+ import { TabularFieldConstants } from '../tabular.constants';
3
+ import * as yup from 'yup';
4
+ export type TabularProperty = {
5
+ [FieldConstants.NAME]: string;
6
+ [TabularFieldConstants.PREDEFINED]: boolean;
7
+ [FieldConstants.SELECTED]: boolean;
8
+ };
9
+ export type TabularProperties = {
10
+ [TabularFieldConstants.TABULAR_PROPERTIES]?: TabularProperty[];
11
+ };
12
+ export declare const emptyTabularProperties: TabularProperties;
13
+ export declare const buildPredefinedTabularProperties: (names: string[]) => {
14
+ properties: TabularProperty[];
15
+ };
16
+ export declare const initializedTabularProperty: () => TabularProperty;
17
+ export declare const tabularPropertiesSchema: yup.ObjectSchema<{
18
+ properties: {
19
+ name: string;
20
+ selected: NonNullable<boolean | undefined>;
21
+ predefined: NonNullable<boolean | undefined>;
22
+ }[] | undefined;
23
+ }, yup.AnyObject, {
24
+ properties: "";
25
+ }, "">;
26
+ export type TabularPropertiesFormType = yup.InferType<typeof tabularPropertiesSchema>;
@@ -0,0 +1,50 @@
1
+ import * as yup from "yup";
2
+ import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
3
+ import { DUPLICATED_PROPS_ERROR } from "../../../../utils/constants/translationKeys.js";
4
+ import "../../../../utils/conversionUtils.js";
5
+ import "../../../../utils/types/equipmentType.js";
6
+ import "react/jsx-runtime";
7
+ import "@mui/icons-material";
8
+ import { TabularFieldConstants } from "../tabular.constants.js";
9
+ const emptyTabularProperties = {
10
+ [TabularFieldConstants.TABULAR_PROPERTIES]: []
11
+ };
12
+ const buildPredefinedTabularProperties = (names) => {
13
+ const properties = names.map((name) => ({
14
+ [FieldConstants.NAME]: name,
15
+ [TabularFieldConstants.PREDEFINED]: true,
16
+ [FieldConstants.SELECTED]: false
17
+ }));
18
+ return {
19
+ [TabularFieldConstants.TABULAR_PROPERTIES]: properties
20
+ };
21
+ };
22
+ const initializedTabularProperty = () => {
23
+ return {
24
+ [FieldConstants.NAME]: "",
25
+ [TabularFieldConstants.PREDEFINED]: false,
26
+ [FieldConstants.SELECTED]: true
27
+ };
28
+ };
29
+ const checkUniquePropertyNames = (properties) => {
30
+ if (properties === void 0) {
31
+ return true;
32
+ }
33
+ const validValues = properties.filter((v) => v.name);
34
+ return validValues.length === new Set(validValues.map((v) => v.name)).size;
35
+ };
36
+ const tabularPropertiesSchema = yup.object({
37
+ [TabularFieldConstants.TABULAR_PROPERTIES]: yup.array().of(
38
+ yup.object().shape({
39
+ [FieldConstants.NAME]: yup.string().required(),
40
+ [TabularFieldConstants.PREDEFINED]: yup.boolean().required(),
41
+ [FieldConstants.SELECTED]: yup.boolean().required()
42
+ })
43
+ ).test("checkUniqueProperties", DUPLICATED_PROPS_ERROR, (values) => checkUniquePropertyNames(values))
44
+ });
45
+ export {
46
+ buildPredefinedTabularProperties,
47
+ emptyTabularProperties,
48
+ initializedTabularProperty,
49
+ tabularPropertiesSchema
50
+ };
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Field names specific to the tabular creation/modification CSV format.
3
+ * Every other column name comes from {@link FieldConstants}.
4
+ */
5
+ export declare enum TabularFieldConstants {
6
+ EQUIPMENT_ID = "equipmentId",
7
+ CSV_FILENAME = "csvFilename",
8
+ MODIFICATIONS_TABLE = "modificationsTable",
9
+ TABULAR_PROPERTIES = "properties",
10
+ PREDEFINED = "predefined",
11
+ BUS_OR_BUSBAR_SECTION_ID = "busOrBusbarSectionId",
12
+ MIN_P = "minP",
13
+ MAX_P = "maxP",
14
+ P0 = "p0",
15
+ TARGET_P = "targetP",
16
+ TARGET_Q = "targetQ",
17
+ PARTICIPATE = "participate",
18
+ VOLTAGE_REGULATION_ON = "voltageRegulationOn",
19
+ REGULATING_TERMINAL_ID = "regulatingTerminalId",
20
+ REGULATING_TERMINAL_TYPE = "regulatingTerminalType",
21
+ STEP_UP_TRANSFORMER_REACTANCE = "stepUpTransformerX",
22
+ REACTIVE_CAPABILITY_CURVE = "reactiveCapabilityCurve",
23
+ REACTIVE_CAPABILITY_CURVE_POINTS = "reactiveCapabilityCurvePoints",
24
+ REACTIVE_CAPABILITY_CURVE_P_MIN = "reactiveCapabilityCurvePmin",
25
+ REACTIVE_CAPABILITY_CURVE_Q_MIN_P_MIN = "reactiveCapabilityCurveQminPmin",
26
+ REACTIVE_CAPABILITY_CURVE_Q_MAX_P_MIN = "reactiveCapabilityCurveQmaxPmin",
27
+ REACTIVE_CAPABILITY_CURVE_P_0 = "reactiveCapabilityCurveP0",
28
+ REACTIVE_CAPABILITY_CURVE_Q_MIN_P_0 = "reactiveCapabilityCurveQminP0",
29
+ REACTIVE_CAPABILITY_CURVE_Q_MAX_P_0 = "reactiveCapabilityCurveQmaxP0",
30
+ REACTIVE_CAPABILITY_CURVE_P_MAX = "reactiveCapabilityCurvePmax",
31
+ REACTIVE_CAPABILITY_CURVE_Q_MIN_P_MAX = "reactiveCapabilityCurveQminPmax",
32
+ REACTIVE_CAPABILITY_CURVE_Q_MAX_P_MAX = "reactiveCapabilityCurveQmaxPmax",
33
+ CONNECTED1 = "terminal1Connected",
34
+ CONNECTED2 = "terminal2Connected",
35
+ CONNECTION_NAME1 = "connectionName1",
36
+ CONNECTION_NAME2 = "connectionName2",
37
+ CONNECTION_DIRECTION1 = "connectionDirection1",
38
+ CONNECTION_DIRECTION2 = "connectionDirection2",
39
+ CONNECTION_POSITION1 = "connectionPosition1",
40
+ CONNECTION_POSITION2 = "connectionPosition2",
41
+ IP_MIN = "ipMin",
42
+ IP_MAX = "ipMax",
43
+ RATIO_TAP_CHANGER_LOAD_TAP_CHANGING_CAPABILITIES = "ratioTapChangerLoadTapChangingCapabilities",
44
+ RATIO_TAP_CHANGER_REGULATION_SIDE = "ratioTapChangerRegulationSide"
45
+ }
46
+ /** Cell data types handled by the tabular table (they match AG Grid cell data types). */
47
+ export declare const TABULAR_NUMBER = "number";
48
+ export declare const TABULAR_ENUM = "enum";
49
+ export declare const TABULAR_BOOLEAN = "boolean";
50
+ /** Prefix of the CSV columns holding a user defined equipment property. */
51
+ export declare const PROPERTY_CSV_COLUMN_PREFIX = "property_";
52
+ export declare const REGULATING_TERMINAL_TYPES: string[];
53
+ export declare const LOAD_TYPES_FOR_LOAD_TABULAR_CREATION_MODIFICATION: readonly [...{
54
+ id: string;
55
+ label: string;
56
+ }[], {
57
+ readonly id: "UNDEFINED";
58
+ readonly label: "Undefined";
59
+ }];
@@ -0,0 +1,75 @@
1
+ import "../../../utils/conversionUtils.js";
2
+ import { LOAD_TYPES, UNDEFINED_LOAD_TYPE } from "../../../utils/types/equipmentType.js";
3
+ import "react/jsx-runtime";
4
+ import "@mui/icons-material";
5
+ var TabularFieldConstants = /* @__PURE__ */ ((TabularFieldConstants2) => {
6
+ TabularFieldConstants2["EQUIPMENT_ID"] = "equipmentId";
7
+ TabularFieldConstants2["CSV_FILENAME"] = "csvFilename";
8
+ TabularFieldConstants2["MODIFICATIONS_TABLE"] = "modificationsTable";
9
+ TabularFieldConstants2["TABULAR_PROPERTIES"] = "properties";
10
+ TabularFieldConstants2["PREDEFINED"] = "predefined";
11
+ TabularFieldConstants2["BUS_OR_BUSBAR_SECTION_ID"] = "busOrBusbarSectionId";
12
+ TabularFieldConstants2["MIN_P"] = "minP";
13
+ TabularFieldConstants2["MAX_P"] = "maxP";
14
+ TabularFieldConstants2["P0"] = "p0";
15
+ TabularFieldConstants2["TARGET_P"] = "targetP";
16
+ TabularFieldConstants2["TARGET_Q"] = "targetQ";
17
+ TabularFieldConstants2["PARTICIPATE"] = "participate";
18
+ TabularFieldConstants2["VOLTAGE_REGULATION_ON"] = "voltageRegulationOn";
19
+ TabularFieldConstants2["REGULATING_TERMINAL_ID"] = "regulatingTerminalId";
20
+ TabularFieldConstants2["REGULATING_TERMINAL_TYPE"] = "regulatingTerminalType";
21
+ TabularFieldConstants2["STEP_UP_TRANSFORMER_REACTANCE"] = "stepUpTransformerX";
22
+ TabularFieldConstants2["REACTIVE_CAPABILITY_CURVE"] = "reactiveCapabilityCurve";
23
+ TabularFieldConstants2["REACTIVE_CAPABILITY_CURVE_POINTS"] = "reactiveCapabilityCurvePoints";
24
+ TabularFieldConstants2["REACTIVE_CAPABILITY_CURVE_P_MIN"] = "reactiveCapabilityCurvePmin";
25
+ TabularFieldConstants2["REACTIVE_CAPABILITY_CURVE_Q_MIN_P_MIN"] = "reactiveCapabilityCurveQminPmin";
26
+ TabularFieldConstants2["REACTIVE_CAPABILITY_CURVE_Q_MAX_P_MIN"] = "reactiveCapabilityCurveQmaxPmin";
27
+ TabularFieldConstants2["REACTIVE_CAPABILITY_CURVE_P_0"] = "reactiveCapabilityCurveP0";
28
+ TabularFieldConstants2["REACTIVE_CAPABILITY_CURVE_Q_MIN_P_0"] = "reactiveCapabilityCurveQminP0";
29
+ TabularFieldConstants2["REACTIVE_CAPABILITY_CURVE_Q_MAX_P_0"] = "reactiveCapabilityCurveQmaxP0";
30
+ TabularFieldConstants2["REACTIVE_CAPABILITY_CURVE_P_MAX"] = "reactiveCapabilityCurvePmax";
31
+ TabularFieldConstants2["REACTIVE_CAPABILITY_CURVE_Q_MIN_P_MAX"] = "reactiveCapabilityCurveQminPmax";
32
+ TabularFieldConstants2["REACTIVE_CAPABILITY_CURVE_Q_MAX_P_MAX"] = "reactiveCapabilityCurveQmaxPmax";
33
+ TabularFieldConstants2["CONNECTED1"] = "terminal1Connected";
34
+ TabularFieldConstants2["CONNECTED2"] = "terminal2Connected";
35
+ TabularFieldConstants2["CONNECTION_NAME1"] = "connectionName1";
36
+ TabularFieldConstants2["CONNECTION_NAME2"] = "connectionName2";
37
+ TabularFieldConstants2["CONNECTION_DIRECTION1"] = "connectionDirection1";
38
+ TabularFieldConstants2["CONNECTION_DIRECTION2"] = "connectionDirection2";
39
+ TabularFieldConstants2["CONNECTION_POSITION1"] = "connectionPosition1";
40
+ TabularFieldConstants2["CONNECTION_POSITION2"] = "connectionPosition2";
41
+ TabularFieldConstants2["IP_MIN"] = "ipMin";
42
+ TabularFieldConstants2["IP_MAX"] = "ipMax";
43
+ TabularFieldConstants2["RATIO_TAP_CHANGER_LOAD_TAP_CHANGING_CAPABILITIES"] = "ratioTapChangerLoadTapChangingCapabilities";
44
+ TabularFieldConstants2["RATIO_TAP_CHANGER_REGULATION_SIDE"] = "ratioTapChangerRegulationSide";
45
+ return TabularFieldConstants2;
46
+ })(TabularFieldConstants || {});
47
+ const TABULAR_NUMBER = "number";
48
+ const TABULAR_ENUM = "enum";
49
+ const TABULAR_BOOLEAN = "boolean";
50
+ const PROPERTY_CSV_COLUMN_PREFIX = "property_";
51
+ const REGULATING_TERMINAL_TYPES = [
52
+ "LINE",
53
+ "TWO_WINDINGS_TRANSFORMER",
54
+ "GENERATOR",
55
+ "LOAD",
56
+ "BATTERY",
57
+ "SHUNT_COMPENSATOR",
58
+ "STATIC_VAR_COMPENSATOR",
59
+ "BOUNDARY_LINE",
60
+ "HVDC_CONVERTER_STATION",
61
+ "BUSBAR_SECTION"
62
+ ];
63
+ const LOAD_TYPES_FOR_LOAD_TABULAR_CREATION_MODIFICATION = [
64
+ ...LOAD_TYPES,
65
+ { id: UNDEFINED_LOAD_TYPE, label: "Undefined" }
66
+ ];
67
+ export {
68
+ LOAD_TYPES_FOR_LOAD_TABULAR_CREATION_MODIFICATION,
69
+ PROPERTY_CSV_COLUMN_PREFIX,
70
+ REGULATING_TERMINAL_TYPES,
71
+ TABULAR_BOOLEAN,
72
+ TABULAR_ENUM,
73
+ TABULAR_NUMBER,
74
+ TabularFieldConstants
75
+ };
@@ -0,0 +1,41 @@
1
+ import { UUID } from 'node:crypto';
2
+ import { EquipmentType, ModificationType, PredefinedProperties } from '../../../utils';
3
+ import { TabularProperty } from './properties/tabularProperty.utils';
4
+ export declare enum TabularModificationType {
5
+ CREATION = "creation",
6
+ MODIFICATION = "modification"
7
+ }
8
+ export interface TabularModificationRow {
9
+ [key: string]: any;
10
+ }
11
+ export interface TabularField {
12
+ id: string;
13
+ name?: string;
14
+ index?: number;
15
+ type?: string;
16
+ options?: string[];
17
+ required?: boolean;
18
+ requiredIf?: {
19
+ id: string;
20
+ };
21
+ }
22
+ export type TabularFields = Partial<Record<EquipmentType, TabularField[]>>;
23
+ export type TabularModificationDto = {
24
+ uuid: UUID;
25
+ type: ModificationType.TABULAR_MODIFICATION | ModificationType.TABULAR_CREATION;
26
+ properties: TabularProperty[];
27
+ csvFilename: string;
28
+ modificationType: ModificationType;
29
+ modifications: TabularModificationRow[];
30
+ };
31
+ /** Payload sent to the back-end for a tabular creation or modification. */
32
+ export type TabularFormDto = {
33
+ type: ModificationType.TABULAR_MODIFICATION | ModificationType.TABULAR_CREATION;
34
+ modificationType: string;
35
+ modifications: TabularModificationRow[];
36
+ csvFilename?: string;
37
+ properties?: TabularProperty[];
38
+ };
39
+ export type PredefinedEquipmentProperties = {
40
+ [p: string]: PredefinedProperties;
41
+ };
@@ -0,0 +1,8 @@
1
+ var TabularModificationType = /* @__PURE__ */ ((TabularModificationType2) => {
2
+ TabularModificationType2["CREATION"] = "creation";
3
+ TabularModificationType2["MODIFICATION"] = "modification";
4
+ return TabularModificationType2;
5
+ })(TabularModificationType || {});
6
+ export {
7
+ TabularModificationType
8
+ };