@gridsuite/commons-ui 0.107.1 → 0.109.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 (114) hide show
  1. package/dist/components/dialogs/elementSaveDialog/ElementSaveDialog.js +10 -10
  2. package/dist/components/dnd-table/dnd-table-add-rows-dialog.d.ts +13 -0
  3. package/dist/components/dnd-table/dnd-table-add-rows-dialog.js +69 -0
  4. package/dist/components/dnd-table/dnd-table-bottom-left-buttons.d.ts +17 -0
  5. package/dist/components/dnd-table/dnd-table-bottom-left-buttons.js +48 -0
  6. package/dist/components/dnd-table/dnd-table-bottom-right-buttons.d.ts +17 -0
  7. package/dist/components/dnd-table/dnd-table-bottom-right-buttons.js +104 -0
  8. package/dist/components/dnd-table/dnd-table.d.ts +28 -0
  9. package/dist/components/dnd-table/dnd-table.js +394 -0
  10. package/dist/components/dnd-table/dnd-table.type.d.ts +51 -0
  11. package/dist/components/dnd-table/dnd-table.type.js +16 -0
  12. package/dist/components/dnd-table/index.d.ts +11 -0
  13. package/dist/components/dnd-table/index.js +14 -0
  14. package/dist/components/filter/HeaderFilterForm.js +4 -4
  15. package/dist/components/index.d.ts +1 -0
  16. package/dist/components/index.js +60 -4
  17. package/dist/components/inputs/index.js +6 -0
  18. package/dist/components/inputs/reactHookForm/chip-items-input.d.ts +13 -0
  19. package/dist/components/inputs/reactHookForm/chip-items-input.js +129 -0
  20. package/dist/components/inputs/reactHookForm/index.d.ts +2 -0
  21. package/dist/components/inputs/reactHookForm/index.js +6 -0
  22. package/dist/components/inputs/reactHookForm/tableInputs/index.d.ts +8 -0
  23. package/dist/components/inputs/reactHookForm/tableInputs/index.js +6 -0
  24. package/dist/components/inputs/reactHookForm/tableInputs/table-numerical-input.d.ts +12 -0
  25. package/dist/components/inputs/reactHookForm/tableInputs/table-numerical-input.js +110 -0
  26. package/dist/components/inputs/reactHookForm/tableInputs/table-text-input.d.ts +8 -0
  27. package/dist/components/inputs/reactHookForm/tableInputs/table-text-input.js +43 -0
  28. package/dist/components/parameters/common/ProviderParam.js +6 -6
  29. package/dist/components/parameters/common/constant.d.ts +8 -0
  30. package/dist/components/parameters/common/constant.js +12 -1
  31. package/dist/components/parameters/common/index.js +3 -1
  32. package/dist/components/parameters/common/limitreductions/limit-reduction-table-cell.js +7 -7
  33. package/dist/components/parameters/common/limitreductions/limit-reductions-table-form.js +6 -6
  34. package/dist/components/parameters/common/name-element-editor/name-element-editor-form.js +8 -8
  35. package/dist/components/parameters/common/name-element-editor/name-element-editor-utils.js +11 -10
  36. package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table-cell.js +7 -7
  37. package/dist/components/parameters/common/widget/parameter-float.js +6 -6
  38. package/dist/components/parameters/common/widget/parameter-line-directory-items-input.js +11 -10
  39. package/dist/components/parameters/common/widget/parameter-line-slider.js +6 -6
  40. package/dist/components/parameters/index.d.ts +1 -0
  41. package/dist/components/parameters/index.js +42 -4
  42. package/dist/components/parameters/loadflow/constants.d.ts +0 -1
  43. package/dist/components/parameters/loadflow/constants.js +0 -2
  44. package/dist/components/parameters/loadflow/index.js +1 -2
  45. package/dist/components/parameters/loadflow/load-flow-general-parameters.js +7 -12
  46. package/dist/components/parameters/loadflow/load-flow-parameter-field.js +6 -6
  47. package/dist/components/parameters/loadflow/load-flow-parameters-form.js +6 -6
  48. package/dist/components/parameters/loadflow/load-flow-parameters-header.js +6 -6
  49. package/dist/components/parameters/loadflow/load-flow-parameters-inline.js +48 -12
  50. package/dist/components/parameters/loadflow/load-flow-parameters-utils.d.ts +0 -4
  51. package/dist/components/parameters/loadflow/load-flow-parameters-utils.js +1 -2
  52. package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +2 -1
  53. package/dist/components/parameters/network-visualizations/constants.js +5 -1
  54. package/dist/components/parameters/network-visualizations/index.js +2 -1
  55. package/dist/components/parameters/network-visualizations/network-area-diagram-parameters.js +6 -6
  56. package/dist/components/parameters/network-visualizations/network-visualizations-form.js +7 -7
  57. package/dist/components/parameters/network-visualizations/network-visualizations-parameters-dialog.js +3 -3
  58. package/dist/components/parameters/network-visualizations/network-visualizations-parameters-inline.js +2 -2
  59. package/dist/components/parameters/network-visualizations/network-visualizations.types.d.ts +2 -1
  60. package/dist/components/parameters/network-visualizations/network-visualizations.types.js +2 -0
  61. package/dist/components/parameters/network-visualizations/use-network-visualizations-parameters-form.js +12 -11
  62. package/dist/components/parameters/short-circuit/short-circuit-fields.js +5 -5
  63. package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.js +3 -3
  64. package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +6 -6
  65. package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.js +2 -2
  66. package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +11 -10
  67. package/dist/components/parameters/voltage-init/constants.d.ts +39 -0
  68. package/dist/components/parameters/voltage-init/constants.js +65 -0
  69. package/dist/components/parameters/voltage-init/equipment-selection-parameters.d.ts +7 -0
  70. package/dist/components/parameters/voltage-init/equipment-selection-parameters.js +119 -0
  71. package/dist/components/parameters/voltage-init/general-parameters.d.ts +4 -0
  72. package/dist/components/parameters/voltage-init/general-parameters.js +112 -0
  73. package/dist/components/parameters/voltage-init/index.d.ts +10 -0
  74. package/dist/components/parameters/voltage-init/index.js +38 -0
  75. package/dist/components/parameters/voltage-init/use-voltage-init-parameters-form.d.ts +32 -0
  76. package/dist/components/parameters/voltage-init/use-voltage-init-parameters-form.js +218 -0
  77. package/dist/components/parameters/voltage-init/voltage-init-form-utils.d.ts +4 -0
  78. package/dist/components/parameters/voltage-init/voltage-init-form-utils.js +220 -0
  79. package/dist/components/parameters/voltage-init/voltage-init-parameters-dialog.d.ts +2 -0
  80. package/dist/components/parameters/voltage-init/voltage-init-parameters-dialog.js +97 -0
  81. package/dist/components/parameters/voltage-init/voltage-init-parameters-form.d.ts +30 -0
  82. package/dist/components/parameters/voltage-init/voltage-init-parameters-form.js +150 -0
  83. package/dist/components/parameters/voltage-init/voltage-init-parameters-inline.d.ts +8 -0
  84. package/dist/components/parameters/voltage-init/voltage-init-parameters-inline.js +173 -0
  85. package/dist/components/parameters/voltage-init/voltage-init.type.d.ts +33 -0
  86. package/dist/components/parameters/voltage-init/voltage-init.type.js +8 -0
  87. package/dist/components/parameters/voltage-init/voltage-limits-parameters.d.ts +7 -0
  88. package/dist/components/parameters/voltage-init/voltage-limits-parameters.js +188 -0
  89. package/dist/index.js +72 -5
  90. package/dist/services/index.d.ts +1 -0
  91. package/dist/services/index.js +6 -2
  92. package/dist/services/study.d.ts +2 -0
  93. package/dist/services/study.js +15 -1
  94. package/dist/services/voltage-init.d.ts +4 -0
  95. package/dist/services/voltage-init.js +14 -0
  96. package/dist/translations/en/dndTableEn.d.ts +16 -0
  97. package/dist/translations/en/dndTableEn.js +13 -0
  98. package/dist/translations/en/index.d.ts +1 -0
  99. package/dist/translations/en/index.js +2 -0
  100. package/dist/translations/en/networkModificationsEn.js +12 -12
  101. package/dist/translations/en/parameters.d.ts +32 -1
  102. package/dist/translations/en/parameters.js +33 -2
  103. package/dist/translations/fr/dndTableFr.d.ts +16 -0
  104. package/dist/translations/fr/dndTableFr.js +13 -0
  105. package/dist/translations/fr/index.d.ts +1 -0
  106. package/dist/translations/fr/index.js +2 -0
  107. package/dist/translations/fr/networkModificationsFr.js +12 -12
  108. package/dist/translations/fr/parameters.d.ts +33 -1
  109. package/dist/translations/fr/parameters.js +34 -2
  110. package/dist/utils/index.d.ts +1 -0
  111. package/dist/utils/index.js +3 -0
  112. package/dist/utils/validation-functions.d.ts +8 -0
  113. package/dist/utils/validation-functions.js +23 -0
  114. package/package.json +1 -1
@@ -0,0 +1,220 @@
1
+ import { EquipmentsSelectionType } from "./voltage-init.type.js";
2
+ import { DEFAULT_SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD, DEFAULT_REACTIVE_SLACKS_THRESHOLD, DEFAULT_UPDATE_BUS_VOLTAGE, DEFAULT_GENERAL_APPLY_MODIFICATIONS, VARIABLE_SHUNT_COMPENSATORS, FILTER_NAME, FILTER_ID, ID, SHUNT_COMPENSATORS_SELECTION_TYPE, VARIABLE_TRANSFORMERS, TRANSFORMERS_SELECTION_TYPE, VARIABLE_Q_GENERATORS, GENERATORS_SELECTION_TYPE, VOLTAGE_LIMITS_DEFAULT, FILTERS, HIGH_VOLTAGE_LIMIT, LOW_VOLTAGE_LIMIT, PRIORITY, VOLTAGE_LIMITS_MODIFICATION, SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD, VoltageInitTabValues, REACTIVE_SLACKS_THRESHOLD, UPDATE_BUS_VOLTAGE, GENERAL_APPLY_MODIFICATIONS } from "./constants.js";
3
+ import "react/jsx-runtime";
4
+ import "react-intl";
5
+ import "@mui/material";
6
+ import "react";
7
+ import "react-hook-form";
8
+ import "../../../utils/types/equipmentType.js";
9
+ import "localized-countries";
10
+ import "localized-countries/data/fr";
11
+ import "localized-countries/data/en";
12
+ import "notistack";
13
+ import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
14
+ import "@mui/icons-material";
15
+ import "yup";
16
+ import "../../overflowableText/OverflowableText.js";
17
+ import { NAME } from "../../inputs/reactHookForm/DirectoryItemsInput.js";
18
+ import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
19
+ import "../../customAGGrid/customAggrid.js";
20
+ import "ag-grid-community";
21
+ import "react-papaparse";
22
+ import "react-csv-downloader";
23
+ import "../../inputs/reactHookForm/numbers/RangeInput.js";
24
+ import "../../../utils/conversionUtils.js";
25
+ import "../../../utils/yupConfig.js";
26
+ import "@react-querybuilder/material";
27
+ import "../../filter/expert/expertFilterConstants.js";
28
+ import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
29
+ import "uuid";
30
+ import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
31
+ import "react-querybuilder";
32
+ import "@hello-pangea/dnd";
33
+ import { SELECTED } from "../../dnd-table/dnd-table.type.js";
34
+ const fromVoltageInitParametersFormToParamValues = (newParams) => {
35
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
36
+ return {
37
+ applyModifications: ((_a = newParams == null ? void 0 : newParams[VoltageInitTabValues.GENERAL]) == null ? void 0 : _a[GENERAL_APPLY_MODIFICATIONS]) ?? DEFAULT_GENERAL_APPLY_MODIFICATIONS,
38
+ computationParameters: {
39
+ [UPDATE_BUS_VOLTAGE]: ((_b = newParams == null ? void 0 : newParams[VoltageInitTabValues.GENERAL]) == null ? void 0 : _b[UPDATE_BUS_VOLTAGE]) ?? DEFAULT_UPDATE_BUS_VOLTAGE,
40
+ [REACTIVE_SLACKS_THRESHOLD]: ((_c = newParams == null ? void 0 : newParams[VoltageInitTabValues.GENERAL]) == null ? void 0 : _c[REACTIVE_SLACKS_THRESHOLD]) ?? DEFAULT_REACTIVE_SLACKS_THRESHOLD,
41
+ [SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD]: ((_d = newParams == null ? void 0 : newParams[VoltageInitTabValues.GENERAL]) == null ? void 0 : _d[SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD]) ?? DEFAULT_SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD,
42
+ [VOLTAGE_LIMITS_MODIFICATION]: ((_e = newParams.voltageLimitsModification) == null ? void 0 : _e.map((voltageLimit) => {
43
+ var _a2, _b2;
44
+ return {
45
+ [PRIORITY]: (_a2 = newParams.voltageLimitsModification) == null ? void 0 : _a2.indexOf(voltageLimit),
46
+ [LOW_VOLTAGE_LIMIT]: voltageLimit[LOW_VOLTAGE_LIMIT] ?? 0,
47
+ [HIGH_VOLTAGE_LIMIT]: voltageLimit[HIGH_VOLTAGE_LIMIT] ?? 0,
48
+ [FILTERS]: ((_b2 = voltageLimit[FILTERS]) == null ? void 0 : _b2.map((filter) => {
49
+ return {
50
+ [FILTER_ID]: filter[ID],
51
+ [FILTER_NAME]: filter[NAME]
52
+ };
53
+ })) ?? []
54
+ };
55
+ })) ?? [],
56
+ [VOLTAGE_LIMITS_DEFAULT]: ((_f = newParams.voltageLimitsDefault) == null ? void 0 : _f.map((voltageLimit) => {
57
+ var _a2, _b2;
58
+ return {
59
+ [PRIORITY]: (_a2 = newParams.voltageLimitsDefault) == null ? void 0 : _a2.indexOf(voltageLimit),
60
+ [LOW_VOLTAGE_LIMIT]: voltageLimit[LOW_VOLTAGE_LIMIT] ?? 0,
61
+ [HIGH_VOLTAGE_LIMIT]: voltageLimit[HIGH_VOLTAGE_LIMIT] ?? 0,
62
+ [FILTERS]: ((_b2 = voltageLimit[FILTERS]) == null ? void 0 : _b2.map((filter) => {
63
+ return {
64
+ [FILTER_ID]: filter[ID],
65
+ [FILTER_NAME]: filter[NAME]
66
+ };
67
+ })) ?? []
68
+ };
69
+ })) ?? [],
70
+ [GENERATORS_SELECTION_TYPE]: newParams[GENERATORS_SELECTION_TYPE] ?? EquipmentsSelectionType.ALL_EXCEPT,
71
+ [VARIABLE_Q_GENERATORS]: ((_g = newParams[VARIABLE_Q_GENERATORS]) == null ? void 0 : _g.map((filter) => {
72
+ return {
73
+ [FILTER_ID]: filter[ID],
74
+ [FILTER_NAME]: filter[NAME]
75
+ };
76
+ })) ?? [],
77
+ [TRANSFORMERS_SELECTION_TYPE]: newParams[TRANSFORMERS_SELECTION_TYPE] ?? EquipmentsSelectionType.NONE_EXCEPT,
78
+ [VARIABLE_TRANSFORMERS]: ((_h = newParams[VARIABLE_TRANSFORMERS]) == null ? void 0 : _h.map((filter) => {
79
+ return {
80
+ [FILTER_ID]: filter[ID],
81
+ [FILTER_NAME]: filter[NAME]
82
+ };
83
+ })) ?? [],
84
+ [SHUNT_COMPENSATORS_SELECTION_TYPE]: newParams[SHUNT_COMPENSATORS_SELECTION_TYPE] ?? EquipmentsSelectionType.NONE_EXCEPT,
85
+ [VARIABLE_SHUNT_COMPENSATORS]: ((_i = newParams[VARIABLE_SHUNT_COMPENSATORS]) == null ? void 0 : _i.map((filter) => {
86
+ return {
87
+ [FILTER_ID]: filter[ID],
88
+ [FILTER_NAME]: filter[NAME]
89
+ };
90
+ })) ?? []
91
+ }
92
+ };
93
+ };
94
+ const fromVoltageInitParamsDataToFormValues = (parameters) => {
95
+ var _a, _b, _c, _d, _e;
96
+ return {
97
+ [VoltageInitTabValues.GENERAL]: {
98
+ [GENERAL_APPLY_MODIFICATIONS]: DEFAULT_GENERAL_APPLY_MODIFICATIONS,
99
+ [UPDATE_BUS_VOLTAGE]: parameters[UPDATE_BUS_VOLTAGE],
100
+ [REACTIVE_SLACKS_THRESHOLD]: parameters.reactiveSlacksThreshold,
101
+ [SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD]: parameters.shuntCompensatorActivationThreshold
102
+ },
103
+ [VOLTAGE_LIMITS_MODIFICATION]: ((_a = parameters == null ? void 0 : parameters.voltageLimitsModification) == null ? void 0 : _a.map((voltageLimit) => {
104
+ var _a2;
105
+ return {
106
+ [SELECTED]: false,
107
+ [FILTERS]: (_a2 = voltageLimit[FILTERS]) == null ? void 0 : _a2.map((filter) => {
108
+ return {
109
+ [ID]: filter[FILTER_ID],
110
+ [NAME]: filter[FILTER_NAME]
111
+ };
112
+ }),
113
+ [LOW_VOLTAGE_LIMIT]: voltageLimit[LOW_VOLTAGE_LIMIT],
114
+ [HIGH_VOLTAGE_LIMIT]: voltageLimit[HIGH_VOLTAGE_LIMIT]
115
+ };
116
+ })) ?? [],
117
+ [VOLTAGE_LIMITS_DEFAULT]: ((_b = parameters == null ? void 0 : parameters.voltageLimitsDefault) == null ? void 0 : _b.map((voltageLimit) => {
118
+ var _a2;
119
+ return {
120
+ [SELECTED]: false,
121
+ [FILTERS]: (_a2 = voltageLimit[FILTERS]) == null ? void 0 : _a2.map((filter) => {
122
+ return {
123
+ [ID]: filter[FILTER_ID],
124
+ [NAME]: filter[FILTER_NAME]
125
+ };
126
+ }),
127
+ [LOW_VOLTAGE_LIMIT]: voltageLimit[LOW_VOLTAGE_LIMIT],
128
+ [HIGH_VOLTAGE_LIMIT]: voltageLimit[HIGH_VOLTAGE_LIMIT]
129
+ };
130
+ })) ?? [],
131
+ [GENERATORS_SELECTION_TYPE]: (parameters == null ? void 0 : parameters[GENERATORS_SELECTION_TYPE]) ?? EquipmentsSelectionType.ALL_EXCEPT,
132
+ [VARIABLE_Q_GENERATORS]: (_c = parameters == null ? void 0 : parameters[VARIABLE_Q_GENERATORS]) == null ? void 0 : _c.map((filter) => {
133
+ return {
134
+ [ID]: filter[FILTER_ID],
135
+ [NAME]: filter[FILTER_NAME]
136
+ };
137
+ }),
138
+ [TRANSFORMERS_SELECTION_TYPE]: (parameters == null ? void 0 : parameters[TRANSFORMERS_SELECTION_TYPE]) ?? EquipmentsSelectionType.NONE_EXCEPT,
139
+ [VARIABLE_TRANSFORMERS]: (_d = parameters == null ? void 0 : parameters[VARIABLE_TRANSFORMERS]) == null ? void 0 : _d.map((filter) => {
140
+ return {
141
+ [ID]: filter[FILTER_ID],
142
+ [NAME]: filter[FILTER_NAME]
143
+ };
144
+ }),
145
+ [SHUNT_COMPENSATORS_SELECTION_TYPE]: (parameters == null ? void 0 : parameters[SHUNT_COMPENSATORS_SELECTION_TYPE]) ?? EquipmentsSelectionType.NONE_EXCEPT,
146
+ [VARIABLE_SHUNT_COMPENSATORS]: (_e = parameters == null ? void 0 : parameters[VARIABLE_SHUNT_COMPENSATORS]) == null ? void 0 : _e.map((filter) => {
147
+ return {
148
+ [ID]: filter[FILTER_ID],
149
+ [NAME]: filter[FILTER_NAME]
150
+ };
151
+ })
152
+ };
153
+ };
154
+ const fromStudyVoltageInitParamsDataToFormValues = (parameters) => {
155
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
156
+ return {
157
+ [VoltageInitTabValues.GENERAL]: {
158
+ [GENERAL_APPLY_MODIFICATIONS]: parameters.applyModifications,
159
+ [UPDATE_BUS_VOLTAGE]: ((_a = parameters == null ? void 0 : parameters.computationParameters) == null ? void 0 : _a[UPDATE_BUS_VOLTAGE]) ?? DEFAULT_UPDATE_BUS_VOLTAGE,
160
+ [REACTIVE_SLACKS_THRESHOLD]: (_b = parameters == null ? void 0 : parameters.computationParameters) == null ? void 0 : _b.reactiveSlacksThreshold,
161
+ [SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD]: (_c = parameters == null ? void 0 : parameters.computationParameters) == null ? void 0 : _c.shuntCompensatorActivationThreshold
162
+ },
163
+ [VOLTAGE_LIMITS_MODIFICATION]: ((_e = (_d = parameters == null ? void 0 : parameters.computationParameters) == null ? void 0 : _d.voltageLimitsModification) == null ? void 0 : _e.map((voltageLimit) => {
164
+ var _a2;
165
+ return {
166
+ [SELECTED]: false,
167
+ [FILTERS]: (_a2 = voltageLimit[FILTERS]) == null ? void 0 : _a2.map((filter) => {
168
+ return {
169
+ [ID]: filter[FILTER_ID],
170
+ [NAME]: filter[FILTER_NAME]
171
+ };
172
+ }),
173
+ [LOW_VOLTAGE_LIMIT]: voltageLimit[LOW_VOLTAGE_LIMIT],
174
+ [HIGH_VOLTAGE_LIMIT]: voltageLimit[HIGH_VOLTAGE_LIMIT]
175
+ };
176
+ })) ?? [],
177
+ [VOLTAGE_LIMITS_DEFAULT]: ((_g = (_f = parameters == null ? void 0 : parameters.computationParameters) == null ? void 0 : _f.voltageLimitsDefault) == null ? void 0 : _g.map((voltageLimit) => {
178
+ var _a2;
179
+ return {
180
+ [SELECTED]: false,
181
+ [FILTERS]: (_a2 = voltageLimit[FILTERS]) == null ? void 0 : _a2.map((filter) => {
182
+ return {
183
+ [ID]: filter[FILTER_ID],
184
+ [NAME]: filter[FILTER_NAME]
185
+ };
186
+ }),
187
+ [LOW_VOLTAGE_LIMIT]: voltageLimit[LOW_VOLTAGE_LIMIT],
188
+ [HIGH_VOLTAGE_LIMIT]: voltageLimit[HIGH_VOLTAGE_LIMIT]
189
+ };
190
+ })) ?? [],
191
+ [GENERATORS_SELECTION_TYPE]: ((_h = parameters == null ? void 0 : parameters.computationParameters) == null ? void 0 : _h[GENERATORS_SELECTION_TYPE]) ?? EquipmentsSelectionType.ALL_EXCEPT,
192
+ [VARIABLE_Q_GENERATORS]: (_j = (_i = parameters == null ? void 0 : parameters.computationParameters) == null ? void 0 : _i[VARIABLE_Q_GENERATORS]) == null ? void 0 : _j.map((filter) => {
193
+ return {
194
+ [ID]: filter[FILTER_ID],
195
+ [NAME]: filter[FILTER_NAME]
196
+ };
197
+ }),
198
+ [TRANSFORMERS_SELECTION_TYPE]: ((_k = parameters == null ? void 0 : parameters.computationParameters) == null ? void 0 : _k[TRANSFORMERS_SELECTION_TYPE]) ?? EquipmentsSelectionType.NONE_EXCEPT,
199
+ [VARIABLE_TRANSFORMERS]: (_m = (_l = parameters == null ? void 0 : parameters.computationParameters) == null ? void 0 : _l[VARIABLE_TRANSFORMERS]) == null ? void 0 : _m.map((filter) => {
200
+ return {
201
+ [ID]: filter[FILTER_ID],
202
+ [NAME]: filter[FILTER_NAME]
203
+ };
204
+ }),
205
+ [SHUNT_COMPENSATORS_SELECTION_TYPE]: ((_n = parameters == null ? void 0 : parameters.computationParameters) == null ? void 0 : _n[SHUNT_COMPENSATORS_SELECTION_TYPE]) ?? EquipmentsSelectionType.NONE_EXCEPT,
206
+ [VARIABLE_SHUNT_COMPENSATORS]: (_p = (_o = parameters == null ? void 0 : parameters.computationParameters) == null ? void 0 : _o[VARIABLE_SHUNT_COMPENSATORS]) == null ? void 0 : _p.map(
207
+ (filter) => {
208
+ return {
209
+ [ID]: filter[FILTER_ID],
210
+ [NAME]: filter[FILTER_NAME]
211
+ };
212
+ }
213
+ )
214
+ };
215
+ };
216
+ export {
217
+ fromStudyVoltageInitParamsDataToFormValues,
218
+ fromVoltageInitParametersFormToParamValues,
219
+ fromVoltageInitParamsDataToFormValues
220
+ };
@@ -0,0 +1,2 @@
1
+ import { ParametersEditionDialogProps } from '../common';
2
+ export declare function VoltageInitParametersEditionDialog({ id, open, onClose, titleId, name, description, activeDirectory, language, }: Readonly<ParametersEditionDialogProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,97 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { CustomMuiDialog } from "../../dialogs/customMuiDialog/CustomMuiDialog.js";
3
+ import "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
4
+ import "../../dialogs/elementSaveDialog/ElementSaveDialog.js";
5
+ import "react";
6
+ import "@mui/material";
7
+ import "react-intl";
8
+ import "react-hook-form";
9
+ import "@mui/icons-material";
10
+ import { ElementType } from "../../../utils/types/elementType.js";
11
+ import "../../treeViewFinder/TreeViewFinder.js";
12
+ import "notistack";
13
+ import "../../../utils/conversionUtils.js";
14
+ import "../../../utils/types/equipmentType.js";
15
+ import "../../../utils/yupConfig.js";
16
+ import { NameElementEditorForm } from "../common/name-element-editor/name-element-editor-form.js";
17
+ import "localized-countries";
18
+ import "localized-countries/data/fr";
19
+ import "localized-countries/data/en";
20
+ import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
21
+ import "yup";
22
+ import "../../overflowableText/OverflowableText.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 "../../inputs/reactHookForm/numbers/RangeInput.js";
29
+ import "@react-querybuilder/material";
30
+ import "../../filter/expert/expertFilterConstants.js";
31
+ import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
32
+ import "uuid";
33
+ import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
34
+ import "react-querybuilder";
35
+ import { useVoltageInitParametersForm } from "./use-voltage-init-parameters-form.js";
36
+ import { VoltageInitParametersForm } from "./voltage-init-parameters-form.js";
37
+ function VoltageInitParametersEditionDialog({
38
+ id,
39
+ open,
40
+ onClose,
41
+ titleId,
42
+ name,
43
+ description,
44
+ activeDirectory,
45
+ language
46
+ }) {
47
+ const voltageInitMethods = useVoltageInitParametersForm({
48
+ parametersUuid: id,
49
+ name,
50
+ description,
51
+ studyUuid: null,
52
+ parameters: null
53
+ });
54
+ const {
55
+ formState: { errors, dirtyFields }
56
+ } = voltageInitMethods.formMethods;
57
+ const disableSave = Object.keys(errors).length > 0 || Object.keys(dirtyFields).length === 0;
58
+ return /* @__PURE__ */ jsx(
59
+ CustomMuiDialog,
60
+ {
61
+ open,
62
+ onClose,
63
+ onSave: voltageInitMethods.onSaveDialog,
64
+ formSchema: voltageInitMethods.formSchema,
65
+ formMethods: voltageInitMethods.formMethods,
66
+ titleId,
67
+ removeOptional: true,
68
+ language,
69
+ disabledSave: disableSave,
70
+ PaperProps: {
71
+ sx: {
72
+ height: "90vh"
73
+ // we want the dialog height to be fixed even when switching tabs
74
+ }
75
+ },
76
+ children: /* @__PURE__ */ jsx(
77
+ VoltageInitParametersForm,
78
+ {
79
+ voltageInitMethods,
80
+ renderTitleFields: () => {
81
+ return /* @__PURE__ */ jsx(
82
+ NameElementEditorForm,
83
+ {
84
+ initialElementName: name,
85
+ activeDirectory,
86
+ elementType: ElementType.VOLTAGE_INIT_PARAMETERS
87
+ }
88
+ );
89
+ }
90
+ }
91
+ )
92
+ }
93
+ );
94
+ }
95
+ export {
96
+ VoltageInitParametersEditionDialog
97
+ };
@@ -0,0 +1,30 @@
1
+ import { Theme } from '@mui/material';
2
+ import { ReactNode } from 'react';
3
+ import { UseVoltageInitParametersFormReturn } from './use-voltage-init-parameters-form';
4
+ export declare const styles: {
5
+ gridWithActions: (theme: Theme) => {
6
+ overflowY: string;
7
+ overflowX: string;
8
+ paddingRight: string;
9
+ paddingTop: string;
10
+ paddingBottom: string;
11
+ flexGrow: number;
12
+ maxHeight: string;
13
+ };
14
+ gridWithoutActions: (theme: Theme) => {
15
+ overflowY: string;
16
+ overflowX: string;
17
+ paddingRight: string;
18
+ paddingTop: string;
19
+ paddingBottom: string;
20
+ flexGrow: number;
21
+ maxHeight: string;
22
+ };
23
+ };
24
+ interface VoltageInitParametersFormProps {
25
+ voltageInitMethods: UseVoltageInitParametersFormReturn;
26
+ renderTitleFields?: () => ReactNode;
27
+ renderActions?: () => ReactNode;
28
+ }
29
+ export declare function VoltageInitParametersForm({ voltageInitMethods, renderTitleFields, renderActions, }: Readonly<VoltageInitParametersFormProps>): import("react/jsx-runtime").JSX.Element;
30
+ export {};
@@ -0,0 +1,150 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Box, Grid, LinearProgress, Tabs, Tab } from "@mui/material";
3
+ import { FormattedMessage } from "react-intl";
4
+ import { getTabIndicatorStyle, getTabStyle } from "../parameters-style.js";
5
+ import "react";
6
+ import "react-hook-form";
7
+ import "../../../utils/types/equipmentType.js";
8
+ import "localized-countries";
9
+ import "localized-countries/data/fr";
10
+ import "localized-countries/data/en";
11
+ import "notistack";
12
+ import { CustomFormProvider } from "../../inputs/reactHookForm/provider/CustomFormProvider.js";
13
+ import "@mui/icons-material";
14
+ import "yup";
15
+ import "../../overflowableText/OverflowableText.js";
16
+ import "../../treeViewFinder/TreeViewFinder.js";
17
+ import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
18
+ import "../../customAGGrid/customAggrid.js";
19
+ import "ag-grid-community";
20
+ import "react-papaparse";
21
+ import "react-csv-downloader";
22
+ import "../../inputs/reactHookForm/numbers/RangeInput.js";
23
+ import "../../../utils/conversionUtils.js";
24
+ import "../../../utils/yupConfig.js";
25
+ import "@react-querybuilder/material";
26
+ import "../../filter/expert/expertFilterConstants.js";
27
+ import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
28
+ import "uuid";
29
+ import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
30
+ import "react-querybuilder";
31
+ import { TabPanel } from "../common/parameters.js";
32
+ import "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
33
+ import "../../dialogs/elementSaveDialog/ElementSaveDialog.js";
34
+ import "../common/widget/parameter-line-slider.js";
35
+ import "../common/limitreductions/columns-definitions.js";
36
+ import { VoltageInitTabValues } from "./constants.js";
37
+ import { GeneralParameters } from "./general-parameters.js";
38
+ import { EquipmentSelectionParameters } from "./equipment-selection-parameters.js";
39
+ import { VoltageLimitsParameters } from "./voltage-limits-parameters.js";
40
+ const styles = {
41
+ gridWithActions: (theme) => ({
42
+ overflowY: "auto",
43
+ overflowX: "hidden",
44
+ paddingRight: theme.spacing(2),
45
+ paddingTop: theme.spacing(2),
46
+ paddingBottom: theme.spacing(1),
47
+ flexGrow: 1,
48
+ maxHeight: "85%"
49
+ }),
50
+ gridWithoutActions: (theme) => ({
51
+ overflowY: "auto",
52
+ overflowX: "hidden",
53
+ paddingRight: theme.spacing(2),
54
+ paddingTop: theme.spacing(2),
55
+ paddingBottom: theme.spacing(1),
56
+ flexGrow: 1,
57
+ maxHeight: "100%"
58
+ })
59
+ };
60
+ function VoltageInitParametersForm({
61
+ voltageInitMethods,
62
+ renderTitleFields,
63
+ renderActions
64
+ }) {
65
+ const { formMethods, formSchema, selectedTab, handleTabChange, paramsLoading, tabIndexesWithError } = voltageInitMethods;
66
+ return /* @__PURE__ */ jsx(CustomFormProvider, { validationSchema: formSchema, ...formMethods, removeOptional: true, children: /* @__PURE__ */ jsxs(
67
+ Box,
68
+ {
69
+ sx: {
70
+ height: "100%",
71
+ position: "relative"
72
+ },
73
+ children: [
74
+ /* @__PURE__ */ jsxs(Grid, { item: true, container: true, sx: renderActions ? styles.gridWithActions : styles.gridWithoutActions, children: [
75
+ /* @__PURE__ */ jsx(Grid, { item: true, container: true, direction: "column", children: renderTitleFields == null ? void 0 : renderTitleFields() }),
76
+ paramsLoading ? /* @__PURE__ */ jsx(LinearProgress, {}) : /* @__PURE__ */ jsxs(
77
+ Box,
78
+ {
79
+ sx: {
80
+ height: "100%",
81
+ width: "100%"
82
+ },
83
+ children: [
84
+ /* @__PURE__ */ jsxs(
85
+ Tabs,
86
+ {
87
+ value: selectedTab,
88
+ variant: "scrollable",
89
+ onChange: handleTabChange,
90
+ TabIndicatorProps: {
91
+ sx: getTabIndicatorStyle(tabIndexesWithError, selectedTab)
92
+ },
93
+ children: [
94
+ /* @__PURE__ */ jsx(
95
+ Tab,
96
+ {
97
+ label: /* @__PURE__ */ jsx(FormattedMessage, { id: "VoltageInitParametersGeneralTabLabel" }),
98
+ value: VoltageInitTabValues.GENERAL,
99
+ sx: getTabStyle(tabIndexesWithError, VoltageInitTabValues.GENERAL)
100
+ }
101
+ ),
102
+ /* @__PURE__ */ jsx(
103
+ Tab,
104
+ {
105
+ label: /* @__PURE__ */ jsx(FormattedMessage, { id: "VoltageLimits" }),
106
+ value: VoltageInitTabValues.VOLTAGE_LIMITS,
107
+ sx: getTabStyle(tabIndexesWithError, VoltageInitTabValues.VOLTAGE_LIMITS)
108
+ }
109
+ ),
110
+ /* @__PURE__ */ jsx(
111
+ Tab,
112
+ {
113
+ label: /* @__PURE__ */ jsx(FormattedMessage, { id: "EquipmentSelection" }),
114
+ value: VoltageInitTabValues.EQUIPMENTS_SELECTION,
115
+ sx: getTabStyle(tabIndexesWithError, VoltageInitTabValues.EQUIPMENTS_SELECTION)
116
+ }
117
+ )
118
+ ]
119
+ }
120
+ ),
121
+ /* @__PURE__ */ jsxs(Grid, { container: true, children: [
122
+ /* @__PURE__ */ jsx(TabPanel, { value: selectedTab, index: VoltageInitTabValues.GENERAL, children: /* @__PURE__ */ jsx(GeneralParameters, { withApplyModifications: renderActions != null }) }),
123
+ /* @__PURE__ */ jsx(TabPanel, { value: selectedTab, index: VoltageInitTabValues.VOLTAGE_LIMITS, children: /* @__PURE__ */ jsx(VoltageLimitsParameters, {}) }),
124
+ /* @__PURE__ */ jsx(TabPanel, { value: selectedTab, index: VoltageInitTabValues.EQUIPMENTS_SELECTION, children: /* @__PURE__ */ jsx(EquipmentSelectionParameters, {}) })
125
+ ] })
126
+ ]
127
+ }
128
+ )
129
+ ] }),
130
+ renderActions && /* @__PURE__ */ jsx(
131
+ Grid,
132
+ {
133
+ item: true,
134
+ container: true,
135
+ direction: "column",
136
+ sx: {
137
+ position: "fixed",
138
+ bottom: "15px"
139
+ },
140
+ children: renderActions()
141
+ }
142
+ )
143
+ ]
144
+ }
145
+ ) });
146
+ }
147
+ export {
148
+ VoltageInitParametersForm,
149
+ styles
150
+ };
@@ -0,0 +1,8 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ import { UUID } from 'crypto';
3
+ import { VoltageInitStudyParameters } from './voltage-init.type';
4
+ export declare function VoltageInitParametersInLine({ studyUuid, setHaveDirtyFields, voltageInitParameters, }: Readonly<{
5
+ studyUuid: UUID | null;
6
+ setHaveDirtyFields: Dispatch<SetStateAction<boolean>>;
7
+ voltageInitParameters: VoltageInitStudyParameters | null;
8
+ }>): import("react/jsx-runtime").JSX.Element;