@gridsuite/commons-ui 0.107.0 → 0.108.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 (115) hide show
  1. package/dist/components/dialogs/elementSaveDialog/ElementSaveDialog.js +10 -10
  2. package/dist/components/directoryItemSelector/DirectoryItemSelector.js +1 -0
  3. package/dist/components/dnd-table/dnd-table-add-rows-dialog.d.ts +13 -0
  4. package/dist/components/dnd-table/dnd-table-add-rows-dialog.js +69 -0
  5. package/dist/components/dnd-table/dnd-table-bottom-left-buttons.d.ts +17 -0
  6. package/dist/components/dnd-table/dnd-table-bottom-left-buttons.js +48 -0
  7. package/dist/components/dnd-table/dnd-table-bottom-right-buttons.d.ts +17 -0
  8. package/dist/components/dnd-table/dnd-table-bottom-right-buttons.js +104 -0
  9. package/dist/components/dnd-table/dnd-table.d.ts +28 -0
  10. package/dist/components/dnd-table/dnd-table.js +394 -0
  11. package/dist/components/dnd-table/dnd-table.type.d.ts +51 -0
  12. package/dist/components/dnd-table/dnd-table.type.js +16 -0
  13. package/dist/components/dnd-table/index.d.ts +11 -0
  14. package/dist/components/dnd-table/index.js +14 -0
  15. package/dist/components/filter/HeaderFilterForm.js +4 -4
  16. package/dist/components/filter/expert/expertFilterConstants.d.ts +15 -0
  17. package/dist/components/filter/expert/expertFilterConstants.js +28 -0
  18. package/dist/components/filter/expert/expertFilterUtils.js +1 -1
  19. package/dist/components/index.d.ts +1 -0
  20. package/dist/components/index.js +57 -1
  21. package/dist/components/inputs/index.js +6 -0
  22. package/dist/components/inputs/reactHookForm/chip-items-input.d.ts +13 -0
  23. package/dist/components/inputs/reactHookForm/chip-items-input.js +129 -0
  24. package/dist/components/inputs/reactHookForm/index.d.ts +2 -0
  25. package/dist/components/inputs/reactHookForm/index.js +6 -0
  26. package/dist/components/inputs/reactHookForm/tableInputs/index.d.ts +8 -0
  27. package/dist/components/inputs/reactHookForm/tableInputs/index.js +6 -0
  28. package/dist/components/inputs/reactHookForm/tableInputs/table-numerical-input.d.ts +12 -0
  29. package/dist/components/inputs/reactHookForm/tableInputs/table-numerical-input.js +110 -0
  30. package/dist/components/inputs/reactHookForm/tableInputs/table-text-input.d.ts +8 -0
  31. package/dist/components/inputs/reactHookForm/tableInputs/table-text-input.js +43 -0
  32. package/dist/components/inputs/reactQueryBuilder/ValueEditor.js +4 -2
  33. package/dist/components/parameters/common/ProviderParam.js +6 -6
  34. package/dist/components/parameters/common/constant.d.ts +8 -0
  35. package/dist/components/parameters/common/constant.js +12 -1
  36. package/dist/components/parameters/common/index.js +3 -1
  37. package/dist/components/parameters/common/limitreductions/limit-reduction-table-cell.js +7 -7
  38. package/dist/components/parameters/common/limitreductions/limit-reductions-table-form.js +6 -6
  39. package/dist/components/parameters/common/name-element-editor/name-element-editor-form.js +8 -8
  40. package/dist/components/parameters/common/name-element-editor/name-element-editor-utils.js +11 -10
  41. package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table-cell.js +7 -7
  42. package/dist/components/parameters/common/widget/parameter-float.js +6 -6
  43. package/dist/components/parameters/common/widget/parameter-line-directory-items-input.js +11 -10
  44. package/dist/components/parameters/common/widget/parameter-line-slider.js +6 -6
  45. package/dist/components/parameters/index.d.ts +1 -0
  46. package/dist/components/parameters/index.js +39 -1
  47. package/dist/components/parameters/loadflow/load-flow-general-parameters.js +6 -6
  48. package/dist/components/parameters/loadflow/load-flow-parameter-field.js +6 -6
  49. package/dist/components/parameters/loadflow/load-flow-parameters-form.js +6 -6
  50. package/dist/components/parameters/loadflow/load-flow-parameters-header.js +6 -6
  51. package/dist/components/parameters/loadflow/load-flow-parameters-inline.js +3 -3
  52. package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +2 -1
  53. package/dist/components/parameters/network-visualizations/network-area-diagram-parameters.js +6 -6
  54. package/dist/components/parameters/network-visualizations/network-visualizations-form.js +7 -7
  55. package/dist/components/parameters/network-visualizations/network-visualizations-parameters-dialog.js +3 -3
  56. package/dist/components/parameters/network-visualizations/network-visualizations-parameters-inline.js +2 -2
  57. package/dist/components/parameters/network-visualizations/use-network-visualizations-parameters-form.js +12 -11
  58. package/dist/components/parameters/short-circuit/short-circuit-fields.js +5 -5
  59. package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.js +3 -3
  60. package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +6 -6
  61. package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.js +2 -2
  62. package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +11 -10
  63. package/dist/components/parameters/voltage-init/constants.d.ts +39 -0
  64. package/dist/components/parameters/voltage-init/constants.js +65 -0
  65. package/dist/components/parameters/voltage-init/equipment-selection-parameters.d.ts +7 -0
  66. package/dist/components/parameters/voltage-init/equipment-selection-parameters.js +119 -0
  67. package/dist/components/parameters/voltage-init/general-parameters.d.ts +4 -0
  68. package/dist/components/parameters/voltage-init/general-parameters.js +112 -0
  69. package/dist/components/parameters/voltage-init/index.d.ts +10 -0
  70. package/dist/components/parameters/voltage-init/index.js +38 -0
  71. package/dist/components/parameters/voltage-init/use-voltage-init-parameters-form.d.ts +32 -0
  72. package/dist/components/parameters/voltage-init/use-voltage-init-parameters-form.js +218 -0
  73. package/dist/components/parameters/voltage-init/voltage-init-form-utils.d.ts +4 -0
  74. package/dist/components/parameters/voltage-init/voltage-init-form-utils.js +220 -0
  75. package/dist/components/parameters/voltage-init/voltage-init-parameters-dialog.d.ts +2 -0
  76. package/dist/components/parameters/voltage-init/voltage-init-parameters-dialog.js +97 -0
  77. package/dist/components/parameters/voltage-init/voltage-init-parameters-form.d.ts +30 -0
  78. package/dist/components/parameters/voltage-init/voltage-init-parameters-form.js +150 -0
  79. package/dist/components/parameters/voltage-init/voltage-init-parameters-inline.d.ts +8 -0
  80. package/dist/components/parameters/voltage-init/voltage-init-parameters-inline.js +152 -0
  81. package/dist/components/parameters/voltage-init/voltage-init.type.d.ts +33 -0
  82. package/dist/components/parameters/voltage-init/voltage-init.type.js +8 -0
  83. package/dist/components/parameters/voltage-init/voltage-limits-parameters.d.ts +7 -0
  84. package/dist/components/parameters/voltage-init/voltage-limits-parameters.js +188 -0
  85. package/dist/components/treeViewFinder/TreeViewFinder.d.ts +2 -0
  86. package/dist/index.js +69 -2
  87. package/dist/services/index.d.ts +1 -0
  88. package/dist/services/index.js +6 -2
  89. package/dist/services/study.d.ts +2 -0
  90. package/dist/services/study.js +15 -1
  91. package/dist/services/voltage-init.d.ts +4 -0
  92. package/dist/services/voltage-init.js +14 -0
  93. package/dist/translations/en/dndTableEn.d.ts +16 -0
  94. package/dist/translations/en/dndTableEn.js +13 -0
  95. package/dist/translations/en/filterExpertEn.d.ts +3 -0
  96. package/dist/translations/en/filterExpertEn.js +4 -1
  97. package/dist/translations/en/index.d.ts +1 -0
  98. package/dist/translations/en/index.js +2 -0
  99. package/dist/translations/en/parameters.d.ts +30 -0
  100. package/dist/translations/en/parameters.js +31 -1
  101. package/dist/translations/fr/dndTableFr.d.ts +16 -0
  102. package/dist/translations/fr/dndTableFr.js +13 -0
  103. package/dist/translations/fr/filterExpertFr.d.ts +3 -0
  104. package/dist/translations/fr/filterExpertFr.js +4 -1
  105. package/dist/translations/fr/index.d.ts +1 -0
  106. package/dist/translations/fr/index.js +2 -0
  107. package/dist/translations/fr/parameters.d.ts +31 -0
  108. package/dist/translations/fr/parameters.js +32 -1
  109. package/dist/utils/index.d.ts +1 -0
  110. package/dist/utils/index.js +3 -0
  111. package/dist/utils/types/fieldType.d.ts +3 -0
  112. package/dist/utils/types/fieldType.js +3 -0
  113. package/dist/utils/validation-functions.d.ts +8 -0
  114. package/dist/utils/validation-functions.js +23 -0
  115. package/package.json +1 -1
@@ -22,6 +22,11 @@ import { ElementSaveDialog } from "./dialogs/elementSaveDialog/ElementSaveDialog
22
22
  import { ModifyElementSelection } from "./dialogs/modifyElementSelection/ModifyElementSelection.js";
23
23
  import { PopupConfirmationDialog } from "./dialogs/popupConfirmationDialog/PopupConfirmationDialog.js";
24
24
  import { DirectoryItemSelector } from "./directoryItemSelector/DirectoryItemSelector.js";
25
+ import { DndTable } from "./dnd-table/dnd-table.js";
26
+ import { DndColumnType, MAX_ROWS_NUMBER, SELECTED } from "./dnd-table/dnd-table.type.js";
27
+ import { DndTableAddRowsDialog } from "./dnd-table/dnd-table-add-rows-dialog.js";
28
+ import { DndTableBottomLeftButtons } from "./dnd-table/dnd-table-bottom-left-buttons.js";
29
+ import { DndTableBottomRightButtons } from "./dnd-table/dnd-table-bottom-right-buttons.js";
25
30
  import { EquipmentItem } from "./elementSearch/elementItem/EquipmentItem.js";
26
31
  import { ElementSearchDialog } from "./elementSearch/elementSearchDialog/ElementSearchDialog.js";
27
32
  import { ElementSearchInput } from "./elementSearch/elementSearchInput/ElementSearchInput.js";
@@ -47,6 +52,7 @@ import "react/jsx-runtime";
47
52
  import "@mui/material";
48
53
  import "react-intl";
49
54
  import { SelectClearable } from "./inputs/SelectClearable.js";
55
+ import { ChipItemsInput } from "./inputs/reactHookForm/chip-items-input.js";
50
56
  import { DESCRIPTION_INPUT, DirectoryItemsInput, NAME } from "./inputs/reactHookForm/DirectoryItemsInput.js";
51
57
  import { RawReadOnlyInput } from "./inputs/reactHookForm/RawReadOnlyInput.js";
52
58
  import { BottomRightButtons } from "./inputs/reactHookForm/agGridTable/BottomRightButtons.js";
@@ -73,6 +79,8 @@ import { CountriesInput } from "./inputs/reactHookForm/selectInputs/CountriesInp
73
79
  import { InputWithPopupConfirmation } from "./inputs/reactHookForm/selectInputs/InputWithPopupConfirmation.js";
74
80
  import { MuiSelectInput } from "./inputs/reactHookForm/selectInputs/MuiSelectInput.js";
75
81
  import { SelectInput } from "./inputs/reactHookForm/selectInputs/SelectInput.js";
82
+ import { TableNumericalInput } from "./inputs/reactHookForm/tableInputs/table-numerical-input.js";
83
+ import { TableTextInput } from "./inputs/reactHookForm/tableInputs/table-text-input.js";
76
84
  import { DescriptionField } from "./inputs/reactHookForm/text/DescriptionField.js";
77
85
  import { ExpandingTextField } from "./inputs/reactHookForm/text/ExpandingTextField.js";
78
86
  import { TextInput } from "./inputs/reactHookForm/text/TextInput.js";
@@ -116,7 +124,7 @@ import { LeftPanelOpenIcon } from "./icons/LeftPanelOpenIcon.js";
116
124
  import { LeftPanelCloseIcon } from "./icons/LeftPanelCloseIcon.js";
117
125
  import { DeviceHubIcon } from "./icons/DeviceHubIcon.js";
118
126
  import { ComputingType, formatComputingTypeLabel, isValidComputingType } from "./parameters/common/computing-type.js";
119
- import { PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_PROVIDER, PROVIDER, VOLTAGE_LEVEL } from "./parameters/common/constant.js";
127
+ import { PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_PROVIDER, PROVIDER, ReactivePowerAdornment, VOLTAGE_LEVEL, VoltageAdornment } from "./parameters/common/constant.js";
120
128
  import { LineSeparator } from "./parameters/common/line-separator.js";
121
129
  import { LabelledButton, SwitchWithLabel, TabPanel } from "./parameters/common/parameters.js";
122
130
  import { CreateParameterDialog } from "./parameters/common/parameters-creation-dialog.js";
@@ -145,6 +153,10 @@ import { LoadFlowParametersEditionDialog } from "./parameters/loadflow/load-flow
145
153
  import { InitialVoltage, PredefinedParameters, SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, SHORT_CIRCUIT_PREDEFINED_PARAMS, SHORT_CIRCUIT_WITH_FEEDER_RESULT, SHORT_CIRCUIT_WITH_LOADS, SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, intlInitialVoltageProfileMode, intlPredefinedParametersOptions } from "./parameters/short-circuit/constants.js";
146
154
  import { ShortCircuitParametersInLine } from "./parameters/short-circuit/short-circuit-parameters-inline.js";
147
155
  import { ShortCircuitParametersEditionDialog } from "./parameters/short-circuit/short-circuit-parameters-dialog.js";
156
+ import { DEFAULT_GENERAL_APPLY_MODIFICATIONS, DEFAULT_REACTIVE_SLACKS_THRESHOLD, DEFAULT_SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD, DEFAULT_UPDATE_BUS_VOLTAGE, FILTERS, FILTER_ID, FILTER_NAME, GENERAL, GENERAL_APPLY_MODIFICATIONS, GENERATORS_SELECTION_TYPE, HIGH_VOLTAGE_LIMIT, ID, LEG_SIDE, LOW_VOLTAGE_LIMIT, PRIORITY, RATIO_TAP_CHANGER_POSITION, RATIO_TAP_CHANGER_TARGET_V, REACTIVE_SLACKS_THRESHOLD, SELECTION_TYPE, SHUNT_COMPENSATORS_SELECTION_TYPE, SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD, TRANSFORMERS_SELECTION_TYPE, UPDATE_BUS_VOLTAGE, VARIABLE_Q_GENERATORS, VARIABLE_SHUNT_COMPENSATORS, VARIABLE_TRANSFORMERS, VOLTAGE_LIMITS_DEFAULT, VOLTAGE_LIMITS_MODIFICATION, VoltageInitTabValues } from "./parameters/voltage-init/constants.js";
157
+ import { EquipmentsSelectionType } from "./parameters/voltage-init/voltage-init.type.js";
158
+ import { VoltageInitParametersEditionDialog } from "./parameters/voltage-init/voltage-init-parameters-dialog.js";
159
+ import { VoltageInitParametersInLine } from "./parameters/voltage-init/voltage-init-parameters-inline.js";
148
160
  import { CustomMenuItem, CustomNestedMenuItem } from "./menus/custom-nested-menu.js";
149
161
  export {
150
162
  AboutDialog,
@@ -173,6 +185,7 @@ export {
173
185
  CardErrorBoundary,
174
186
  CheckBoxList,
175
187
  CheckboxInput,
188
+ ChipItemsInput,
176
189
  CombinatorSelector,
177
190
  CombinatorType,
178
191
  ComputingType,
@@ -195,8 +208,12 @@ export {
195
208
  DC,
196
209
  DC_POWER_FACTOR,
197
210
  DC_USE_TRANSFORMER_RATIO,
211
+ DEFAULT_GENERAL_APPLY_MODIFICATIONS,
198
212
  DEFAULT_LIMIT_REDUCTION_VALUE,
199
213
  DEFAULT_RANGE_VALUE,
214
+ DEFAULT_REACTIVE_SLACKS_THRESHOLD,
215
+ DEFAULT_SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD,
216
+ DEFAULT_UPDATE_BUS_VOLTAGE,
200
217
  DESCRIPTION_INPUT,
201
218
  DIAGONAL_LABEL,
202
219
  DISTRIBUTED_SLACK,
@@ -208,6 +225,11 @@ export {
208
225
  DeviceHubIcon,
209
226
  DirectoryItemSelector,
210
227
  DirectoryItemsInput,
228
+ DndColumnType,
229
+ DndTable,
230
+ DndTableAddRowsDialog,
231
+ DndTableBottomLeftButtons,
232
+ DndTableBottomRightButtons,
211
233
  ENERGY_SOURCE_OPTIONS,
212
234
  EXPERT_FILTER_EQUIPMENTS,
213
235
  EXPERT_FILTER_FIELDS,
@@ -217,6 +239,7 @@ export {
217
239
  ElementSearchInput,
218
240
  ElementValueEditor,
219
241
  EquipmentItem,
242
+ EquipmentsSelectionType,
220
243
  ErrorInLogoutAlert,
221
244
  ErrorInUserValidationAlert,
222
245
  ErrorInput,
@@ -226,8 +249,11 @@ export {
226
249
  ExplicitNamingFilterEditionDialog,
227
250
  ExplicitNamingFilterForm,
228
251
  FIELDS_OPTIONS,
252
+ FILTERS,
229
253
  FILTER_EQUIPMENTS,
230
254
  FILTER_EQUIPMENTS_ATTRIBUTES,
255
+ FILTER_ID,
256
+ FILTER_NAME,
231
257
  FieldErrorAlert,
232
258
  FieldLabel,
233
259
  FilterCreationDialog,
@@ -235,10 +261,15 @@ export {
235
261
  FilterType,
236
262
  FlatParameters,
237
263
  FloatInput,
264
+ GENERAL,
265
+ GENERAL_APPLY_MODIFICATIONS,
266
+ GENERATORS_SELECTION_TYPE,
238
267
  GridLogo,
239
268
  GroupValueEditor,
269
+ HIGH_VOLTAGE_LIMIT,
240
270
  HVDC_AC_EMULATION,
241
271
  HelperPreviousValue,
272
+ ID,
242
273
  INIT_NAD_WITH_GEO_DATA,
243
274
  INTL_LINE_FLOW_MODE_OPTIONS,
244
275
  INTL_MAP_BASE_MAP_OPTIONS,
@@ -247,10 +278,12 @@ export {
247
278
  InitialVoltage,
248
279
  InputWithPopupConfirmation,
249
280
  IntegerInput,
281
+ LEG_SIDE,
250
282
  LIMIT_DURATION_FORM,
251
283
  LIMIT_REDUCTIONS_FORM,
252
284
  LINE_FLOW_MODE,
253
285
  LOAD_TYPE_OPTIONS,
286
+ LOW_VOLTAGE_LIMIT,
254
287
  LabelledButton,
255
288
  LeftPanelCloseIcon,
256
289
  LeftPanelOpenIcon,
@@ -269,6 +302,7 @@ export {
269
302
  MAP_BASEMAP_MAPBOX,
270
303
  MAP_BASE_MAP,
271
304
  MAP_MANUAL_REFRESH,
305
+ MAX_ROWS_NUMBER,
272
306
  MAX_VALUE_ALLOWED_FOR_LIMIT_REDUCTION,
273
307
  MIN_VALUE_ALLOWED_FOR_LIMIT_REDUCTION,
274
308
  MidFormError,
@@ -307,6 +341,7 @@ export {
307
341
  PARAM_SUBSTATION_LAYOUT,
308
342
  PHASE_REGULATION_MODE_OPTIONS,
309
343
  PHASE_SHIFTER_REGULATION_ON,
344
+ PRIORITY,
310
345
  PROVIDER,
311
346
  ParameterFloat,
312
347
  ParameterGroup,
@@ -318,6 +353,9 @@ export {
318
353
  PropertyValueEditor,
319
354
  ProviderParam,
320
355
  RATIO_REGULATION_MODE_OPTIONS,
356
+ RATIO_TAP_CHANGER_POSITION,
357
+ RATIO_TAP_CHANGER_TARGET_V,
358
+ REACTIVE_SLACKS_THRESHOLD,
321
359
  READ_SLACK_BUS,
322
360
  REGULATION_TYPE_OPTIONS,
323
361
  RULES,
@@ -325,8 +363,11 @@ export {
325
363
  RangeInput,
326
364
  RangeType,
327
365
  RawReadOnlyInput,
366
+ ReactivePowerAdornment,
328
367
  RemoveButton,
329
368
  RuleValueEditor,
369
+ SELECTED,
370
+ SELECTION_TYPE,
330
371
  SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE,
331
372
  SHORT_CIRCUIT_PREDEFINED_PARAMS,
332
373
  SHORT_CIRCUIT_WITH_FEEDER_RESULT,
@@ -334,6 +375,8 @@ export {
334
375
  SHORT_CIRCUIT_WITH_NEUTRAL_POSITION,
335
376
  SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS,
336
377
  SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS,
378
+ SHUNT_COMPENSATORS_SELECTION_TYPE,
379
+ SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD,
337
380
  SHUNT_COMPENSATOR_TYPE_OPTIONS,
338
381
  SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON,
339
382
  SPECIFIC_PARAMETERS,
@@ -352,10 +395,13 @@ export {
352
395
  SwitchInput,
353
396
  SwitchWithLabel,
354
397
  TAB_INFO,
398
+ TRANSFORMERS_SELECTION_TYPE,
355
399
  TRANSFORMER_VOLTAGE_CONTROL_ON,
356
400
  TWT_SPLIT_SHUNT_ADMITTANCE,
357
401
  TabPanel,
358
402
  TabValues,
403
+ TableNumericalInput,
404
+ TableTextInput,
359
405
  TagRenderer,
360
406
  TextFieldWithAdornment,
361
407
  TextInput,
@@ -363,15 +409,25 @@ export {
363
409
  TopBar,
364
410
  TranslatedValueEditor,
365
411
  TreeViewFinder,
412
+ UPDATE_BUS_VOLTAGE,
366
413
  USE_REACTIVE_LIMITS,
367
414
  UnauthorizedAccessAlert,
368
415
  UniqueNameInput,
369
416
  UserManagerMock,
417
+ VARIABLE_Q_GENERATORS,
418
+ VARIABLE_SHUNT_COMPENSATORS,
419
+ VARIABLE_TRANSFORMERS,
370
420
  VOLTAGE_INIT_MODE,
371
421
  VOLTAGE_LEVEL,
372
422
  VOLTAGE_LEVELS_FORM,
423
+ VOLTAGE_LIMITS_DEFAULT,
424
+ VOLTAGE_LIMITS_MODIFICATION,
373
425
  ValueEditor,
374
426
  ValueSelector,
427
+ VoltageAdornment,
428
+ VoltageInitParametersEditionDialog,
429
+ VoltageInitParametersInLine,
430
+ VoltageInitTabValues,
375
431
  WRITE_SLACK_BUS,
376
432
  alertThresholdMarks,
377
433
  countRules,
@@ -1,4 +1,5 @@
1
1
  import { SelectClearable } from "./SelectClearable.js";
2
+ import { ChipItemsInput } from "./reactHookForm/chip-items-input.js";
2
3
  import { DESCRIPTION_INPUT, DirectoryItemsInput, NAME } from "./reactHookForm/DirectoryItemsInput.js";
3
4
  import { RawReadOnlyInput } from "./reactHookForm/RawReadOnlyInput.js";
4
5
  import { BottomRightButtons } from "./reactHookForm/agGridTable/BottomRightButtons.js";
@@ -25,6 +26,8 @@ import { CountriesInput } from "./reactHookForm/selectInputs/CountriesInput.js";
25
26
  import { InputWithPopupConfirmation } from "./reactHookForm/selectInputs/InputWithPopupConfirmation.js";
26
27
  import { MuiSelectInput } from "./reactHookForm/selectInputs/MuiSelectInput.js";
27
28
  import { SelectInput } from "./reactHookForm/selectInputs/SelectInput.js";
29
+ import { TableNumericalInput } from "./reactHookForm/tableInputs/table-numerical-input.js";
30
+ import { TableTextInput } from "./reactHookForm/tableInputs/table-text-input.js";
28
31
  import { DescriptionField } from "./reactHookForm/text/DescriptionField.js";
29
32
  import { ExpandingTextField } from "./reactHookForm/text/ExpandingTextField.js";
30
33
  import { TextInput } from "./reactHookForm/text/TextInput.js";
@@ -61,6 +64,7 @@ export {
61
64
  BottomRightButtons,
62
65
  CancelButton,
63
66
  CheckboxInput,
67
+ ChipItemsInput,
64
68
  CombinatorSelector,
65
69
  CountriesInput,
66
70
  CountryValueEditor,
@@ -100,6 +104,8 @@ export {
100
104
  SliderInput,
101
105
  SubmitButton,
102
106
  SwitchInput,
107
+ TableNumericalInput,
108
+ TableTextInput,
103
109
  TextFieldWithAdornment,
104
110
  TextInput,
105
111
  TextValueEditor,
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright (c) 2023, RTE (http://www.rte-france.com)
3
+ * This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
+ */
7
+ interface ChipItemsInputProps {
8
+ label?: string;
9
+ name: string;
10
+ hideErrorMessage: boolean;
11
+ }
12
+ export declare function ChipItemsInput({ label, name, hideErrorMessage }: Readonly<ChipItemsInputProps>): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,129 @@
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { FormControl, Chip, TextField } from "@mui/material";
3
+ import { useState, useCallback } from "react";
4
+ import { useFieldArray, useController } from "react-hook-form";
5
+ import "react-intl";
6
+ import "../../../utils/types/equipmentType.js";
7
+ import "localized-countries";
8
+ import "localized-countries/data/fr";
9
+ import "localized-countries/data/en";
10
+ import { useSnackMessage } from "../../../hooks/useSnackMessage.js";
11
+ import "./provider/CustomFormProvider.js";
12
+ import { useCustomFormContext } from "./provider/useCustomFormContext.js";
13
+ import { FieldLabel } from "./utils/FieldLabel.js";
14
+ import "@mui/icons-material";
15
+ import { isFieldRequired } from "./utils/functions.js";
16
+ import { OverflowableText } from "../../overflowableText/OverflowableText.js";
17
+ import { RawReadOnlyInput } from "./RawReadOnlyInput.js";
18
+ import { ErrorInput } from "./errorManagement/ErrorInput.js";
19
+ import { MidFormError } from "./errorManagement/MidFormError.js";
20
+ function ChipItemsInput({ label, name, hideErrorMessage }) {
21
+ const [textEntered, setTextEntered] = useState("");
22
+ const { snackError } = useSnackMessage();
23
+ const {
24
+ fields: elements,
25
+ append,
26
+ remove
27
+ } = useFieldArray({
28
+ name
29
+ });
30
+ const { validationSchema, getValues } = useCustomFormContext();
31
+ const {
32
+ fieldState: { error }
33
+ } = useController({
34
+ name
35
+ });
36
+ const addItem = useCallback(
37
+ (value) => {
38
+ if (getValues(name).find((v) => v === value) !== void 0) {
39
+ snackError({
40
+ messageTxt: "",
41
+ headerId: "directory_items_input/ElementAlreadyUsed"
42
+ });
43
+ } else {
44
+ append(value);
45
+ }
46
+ },
47
+ [append, getValues, snackError, name]
48
+ );
49
+ const keyPress = (e) => {
50
+ if (e.key === "Enter" && textEntered.length > 0) {
51
+ addItem(textEntered);
52
+ setTextEntered("");
53
+ }
54
+ };
55
+ const onBlur = () => {
56
+ if (textEntered.length > 0) {
57
+ addItem(textEntered);
58
+ setTextEntered("");
59
+ }
60
+ };
61
+ const handleChange = (e) => {
62
+ setTextEntered(e.target.value);
63
+ };
64
+ const styles = {
65
+ chipContainer: {
66
+ display: "flex",
67
+ gap: "8px",
68
+ flexWrap: "wrap",
69
+ flexDirection: "row",
70
+ border: "2px solid lightgray",
71
+ borderRadius: "4px",
72
+ overflow: "hidden",
73
+ borderColor: (error == null ? void 0 : error.message) ? "error.main" : null
74
+ },
75
+ chipItem: {
76
+ display: "flex",
77
+ gap: "8px",
78
+ flexWrap: "wrap",
79
+ flexDirection: "row",
80
+ marginTop: 0,
81
+ padding: 1,
82
+ overflow: "hidden"
83
+ }
84
+ };
85
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
86
+ /* @__PURE__ */ jsxs(FormControl, { sx: styles.chipContainer, error: !!(error == null ? void 0 : error.message), children: [
87
+ (elements == null ? void 0 : elements.length) === 0 && label && /* @__PURE__ */ jsx(FieldLabel, { label, optional: !isFieldRequired(name, validationSchema, getValues()) }),
88
+ (elements == null ? void 0 : elements.length) > 0 && /* @__PURE__ */ jsx(FormControl, { sx: styles.chipItem, children: elements.map((item, index) => /* @__PURE__ */ jsx(
89
+ Chip,
90
+ {
91
+ size: "small",
92
+ onDelete: () => {
93
+ remove(index);
94
+ },
95
+ label: /* @__PURE__ */ jsx(
96
+ OverflowableText,
97
+ {
98
+ text: /* @__PURE__ */ jsx(RawReadOnlyInput, { name: `${name}.${index}` }),
99
+ sx: { width: "100%" }
100
+ }
101
+ )
102
+ },
103
+ item.id
104
+ )) }),
105
+ /* @__PURE__ */ jsx(
106
+ TextField,
107
+ {
108
+ variant: "standard",
109
+ InputProps: {
110
+ disableUnderline: true,
111
+ style: {
112
+ marginTop: "5px",
113
+ height: "30px",
114
+ marginLeft: "10px"
115
+ }
116
+ },
117
+ value: textEntered,
118
+ onKeyDown: keyPress,
119
+ onChange: handleChange,
120
+ onBlur
121
+ }
122
+ )
123
+ ] }),
124
+ !hideErrorMessage && /* @__PURE__ */ jsx(ErrorInput, { name, InputField: MidFormError })
125
+ ] });
126
+ }
127
+ export {
128
+ ChipItemsInput
129
+ };
@@ -4,6 +4,7 @@
4
4
  * License, v. 2.0. If a copy of the MPL was not distributed with this
5
5
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
6
  */
7
+ export * from './chip-items-input';
7
8
  export * from './DirectoryItemsInput';
8
9
  export * from './RawReadOnlyInput';
9
10
  export * from './agGridTable';
@@ -13,5 +14,6 @@ export * from './errorManagement';
13
14
  export * from './numbers';
14
15
  export * from './provider';
15
16
  export * from './selectInputs';
17
+ export * from './tableInputs';
16
18
  export * from './text';
17
19
  export * from './utils';
@@ -1,3 +1,4 @@
1
+ import { ChipItemsInput } from "./chip-items-input.js";
1
2
  import { DESCRIPTION_INPUT, DirectoryItemsInput, NAME } from "./DirectoryItemsInput.js";
2
3
  import { RawReadOnlyInput } from "./RawReadOnlyInput.js";
3
4
  import { BottomRightButtons } from "./agGridTable/BottomRightButtons.js";
@@ -24,6 +25,8 @@ import { CountriesInput } from "./selectInputs/CountriesInput.js";
24
25
  import { InputWithPopupConfirmation } from "./selectInputs/InputWithPopupConfirmation.js";
25
26
  import { MuiSelectInput } from "./selectInputs/MuiSelectInput.js";
26
27
  import { SelectInput } from "./selectInputs/SelectInput.js";
28
+ import { TableNumericalInput } from "./tableInputs/table-numerical-input.js";
29
+ import { TableTextInput } from "./tableInputs/table-text-input.js";
27
30
  import { DescriptionField } from "./text/DescriptionField.js";
28
31
  import { ExpandingTextField } from "./text/ExpandingTextField.js";
29
32
  import { TextInput } from "./text/TextInput.js";
@@ -40,6 +43,7 @@ export {
40
43
  BottomRightButtons,
41
44
  CancelButton,
42
45
  CheckboxInput,
46
+ ChipItemsInput,
43
47
  CountriesInput,
44
48
  CsvUploader,
45
49
  CustomAgGridTable,
@@ -70,6 +74,8 @@ export {
70
74
  SliderInput,
71
75
  SubmitButton,
72
76
  SwitchInput,
77
+ TableNumericalInput,
78
+ TableTextInput,
73
79
  TextFieldWithAdornment,
74
80
  TextInput,
75
81
  UniqueNameInput,
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Copyright (c) 2025, RTE (http://www.rte-france.com)
3
+ * This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
+ */
7
+ export * from './table-numerical-input';
8
+ export * from './table-text-input';
@@ -0,0 +1,6 @@
1
+ import { TableNumericalInput } from "./table-numerical-input.js";
2
+ import { TableTextInput } from "./table-text-input.js";
3
+ export {
4
+ TableNumericalInput,
5
+ TableTextInput
6
+ };
@@ -0,0 +1,12 @@
1
+ import { InputBaseComponentProps, StandardTextFieldProps } from '@mui/material';
2
+ export interface TableNumericalInputProps extends StandardTextFieldProps {
3
+ name: string;
4
+ inputProps?: InputBaseComponentProps;
5
+ previousValue?: number;
6
+ valueModified: boolean;
7
+ adornment?: {
8
+ text: string;
9
+ };
10
+ isClearable?: boolean;
11
+ }
12
+ export declare function TableNumericalInput({ name, style, inputProps, previousValue, valueModified, adornment, isClearable, ...props }: Readonly<TableNumericalInputProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,110 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { TextField, InputAdornment, IconButton } from "@mui/material";
3
+ import { useFormContext, useController } from "react-hook-form";
4
+ import { Clear } from "@mui/icons-material";
5
+ import { useMemo } from "react";
6
+ import "../../../../utils/conversionUtils.js";
7
+ import "../../../../utils/types/equipmentType.js";
8
+ import { validateValueIsANumber } from "../../../../utils/validation-functions.js";
9
+ import "../../../../utils/yupConfig.js";
10
+ function TableNumericalInput({
11
+ name,
12
+ style,
13
+ inputProps,
14
+ previousValue,
15
+ valueModified,
16
+ adornment,
17
+ isClearable = true,
18
+ ...props
19
+ }) {
20
+ const { trigger } = useFormContext();
21
+ const {
22
+ field: { onChange, value, ref },
23
+ fieldState: { error }
24
+ } = useController({ name });
25
+ const inputTransform = (str) => {
26
+ if (str === null) {
27
+ return "";
28
+ }
29
+ if (["-", "."].includes(str)) {
30
+ return str;
31
+ }
32
+ return Number.isNaN(Number(str)) ? "" : str.toString();
33
+ };
34
+ const clearable = useMemo(
35
+ () => (
36
+ // We add the clear button only if the field is clearable and the previous value is different from the current one
37
+ isClearable && (previousValue === Number.MAX_VALUE ? validateValueIsANumber(value) : previousValue !== void 0 && previousValue !== value)
38
+ ),
39
+ [isClearable, previousValue, value]
40
+ );
41
+ const outputTransform = (str) => {
42
+ if (typeof str === "string") {
43
+ if (str === "-") {
44
+ return str;
45
+ }
46
+ if (str === "") {
47
+ return null;
48
+ }
49
+ const tmp = (str == null ? void 0 : str.replace(",", ".")) || "";
50
+ if (tmp.endsWith(".") || tmp.endsWith("0")) {
51
+ return str;
52
+ }
53
+ return parseFloat(tmp) || null;
54
+ }
55
+ return str === Number.MAX_VALUE ? null : str;
56
+ };
57
+ const handleInputChange = (e) => {
58
+ onChange(outputTransform(e.target.value));
59
+ trigger(name);
60
+ };
61
+ const transformedValue = inputTransform(value);
62
+ const handleClearValue = () => {
63
+ onChange(outputTransform(previousValue));
64
+ };
65
+ return /* @__PURE__ */ jsx(
66
+ TextField,
67
+ {
68
+ value: transformedValue,
69
+ onChange: handleInputChange,
70
+ error: !!(error == null ? void 0 : error.message),
71
+ size: "small",
72
+ fullWidth: true,
73
+ inputRef: ref,
74
+ InputProps: {
75
+ endAdornment: /* @__PURE__ */ jsxs(InputAdornment, { position: "end", children: [
76
+ transformedValue && (adornment == null ? void 0 : adornment.text),
77
+ clearable && /* @__PURE__ */ jsx(
78
+ IconButton,
79
+ {
80
+ onClick: handleClearValue,
81
+ style: {
82
+ visibility: clearable ? "visible" : "hidden"
83
+ },
84
+ children: /* @__PURE__ */ jsx(Clear, {})
85
+ }
86
+ )
87
+ ] }),
88
+ disableInjectingGlobalStyles: true,
89
+ // disable auto-fill animations and increase rendering perf
90
+ inputProps: {
91
+ style: {
92
+ fontSize: "small",
93
+ color: previousValue !== void 0 && previousValue === parseFloat(value) && !valueModified ? "grey" : void 0,
94
+ // grey out the value if it is the same as the previous one
95
+ textAlign: (style == null ? void 0 : style.textAlign) ?? "left"
96
+ },
97
+ inputMode: "numeric",
98
+ pattern: "[0-9]*",
99
+ lang: "en-US",
100
+ // to have '.' as decimal separator
101
+ ...inputProps
102
+ }
103
+ },
104
+ ...props
105
+ }
106
+ );
107
+ }
108
+ export {
109
+ TableNumericalInput
110
+ };
@@ -0,0 +1,8 @@
1
+ import { InputBaseComponentProps } from '@mui/material';
2
+ interface TableTextInputProps {
3
+ name: string;
4
+ showErrorMsg?: boolean;
5
+ inputProps?: InputBaseComponentProps;
6
+ }
7
+ export declare function TableTextInput({ name, showErrorMsg, inputProps, ...props }: Readonly<TableTextInputProps>): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,43 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { TextField } from "@mui/material";
3
+ import { useController } from "react-hook-form";
4
+ import { useIntl } from "react-intl";
5
+ function TableTextInput({ name, showErrorMsg, inputProps, ...props }) {
6
+ const {
7
+ field: { onChange, value, ref },
8
+ fieldState: { error }
9
+ } = useController({ name });
10
+ const intl = useIntl();
11
+ const outputTransform = (str) => {
12
+ return (str == null ? void 0 : str.trim()) === "" ? "" : str;
13
+ };
14
+ const handleInputChange = (e) => {
15
+ onChange(outputTransform(e.target.value));
16
+ };
17
+ return /* @__PURE__ */ jsx(
18
+ TextField,
19
+ {
20
+ value,
21
+ onChange: handleInputChange,
22
+ error: !!(error == null ? void 0 : error.message),
23
+ helperText: showErrorMsg && ((error == null ? void 0 : error.message) ? intl.formatMessage({ id: error.message }) : ""),
24
+ size: "small",
25
+ fullWidth: true,
26
+ inputRef: ref,
27
+ InputProps: {
28
+ disableInjectingGlobalStyles: true,
29
+ // disable auto-fill animations and increase rendering perf
30
+ inputProps: {
31
+ style: {
32
+ fontSize: "small"
33
+ },
34
+ ...inputProps
35
+ }
36
+ },
37
+ ...props
38
+ }
39
+ );
40
+ }
41
+ export {
42
+ TableTextInput
43
+ };
@@ -32,12 +32,12 @@ function ValueEditor(props) {
32
32
  const { getValues } = formContext;
33
33
  const itemFilter = useCallback(
34
34
  (filterValue) => {
35
- var _a, _b, _c;
35
+ var _a, _b, _c, _d;
36
36
  if ((filterValue == null ? void 0 : filterValue.type) === ElementType.FILTER) {
37
37
  return (
38
38
  // we do not authorize to use an expert filter in the rules of
39
39
  // another expert filter, to prevent potential cycle problems
40
- ((_a = filterValue == null ? void 0 : filterValue.specificMetadata) == null ? void 0 : _a.type) !== FilterType.EXPERT.id && (field === FieldType.ID && ((_b = filterValue == null ? void 0 : filterValue.specificMetadata) == null ? void 0 : _b.equipmentType) === getValues(FieldConstants.EQUIPMENT_TYPE) || (field === FieldType.VOLTAGE_LEVEL_ID || field === FieldType.VOLTAGE_LEVEL_ID_1 || field === FieldType.VOLTAGE_LEVEL_ID_2 || field === FieldType.VOLTAGE_LEVEL_ID_3) && ((_c = filterValue == null ? void 0 : filterValue.specificMetadata) == null ? void 0 : _c.equipmentType) === VoltageLevel.type)
40
+ ((_a = filterValue == null ? void 0 : filterValue.specificMetadata) == null ? void 0 : _a.type) !== FilterType.EXPERT.id && (field === FieldType.ID && ((_b = filterValue == null ? void 0 : filterValue.specificMetadata) == null ? void 0 : _b.equipmentType) === getValues(FieldConstants.EQUIPMENT_TYPE) || (field === FieldType.VOLTAGE_LEVEL_ID || field === FieldType.VOLTAGE_LEVEL_ID_1 || field === FieldType.VOLTAGE_LEVEL_ID_2 || field === FieldType.VOLTAGE_LEVEL_ID_3) && ((_c = filterValue == null ? void 0 : filterValue.specificMetadata) == null ? void 0 : _c.equipmentType) === VoltageLevel.type || (field === FieldType.SUBSTATION_ID || field === FieldType.SUBSTATION_ID_1 || field === FieldType.SUBSTATION_ID_2) && ((_d = filterValue == null ? void 0 : filterValue.specificMetadata) == null ? void 0 : _d.equipmentType) === Substation.type)
41
41
  );
42
42
  }
43
43
  return true;
@@ -57,6 +57,8 @@ function ValueEditor(props) {
57
57
  let equipmentTypes;
58
58
  if (field === FieldType.VOLTAGE_LEVEL_ID || field === FieldType.VOLTAGE_LEVEL_ID_1 || field === FieldType.VOLTAGE_LEVEL_ID_2 || field === FieldType.VOLTAGE_LEVEL_ID_3) {
59
59
  equipmentTypes = [VoltageLevel.type];
60
+ } else if (field === FieldType.SUBSTATION_ID || field === FieldType.SUBSTATION_ID_1 || field === FieldType.SUBSTATION_ID_2) {
61
+ equipmentTypes = [Substation.type];
60
62
  } else if (field === FieldType.ID) {
61
63
  equipmentTypes = [getValues(FieldConstants.EQUIPMENT_TYPE)];
62
64
  }