@gridsuite/commons-ui 0.269.0 → 0.271.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 (142) hide show
  1. package/dist/components/ui/dialogs/customMuiDialog/CustomMuiDialog.d.ts +10 -3
  2. package/dist/components/ui/dialogs/customMuiDialog/CustomMuiDialog.js +33 -28
  3. package/dist/features/index.js +96 -3
  4. package/dist/features/network-modifications/common/branch/branchCreation.types.d.ts +26 -0
  5. package/dist/features/network-modifications/common/branch/branchModification.types.d.ts +36 -0
  6. package/dist/features/network-modifications/common/branch/branchModification.types.js +1 -0
  7. package/dist/features/network-modifications/{line/characteristics/lineCharacteristicsPane.types.d.ts → common/branch/index.d.ts} +2 -8
  8. package/dist/features/network-modifications/common/branch/index.js +1 -0
  9. package/dist/features/network-modifications/common/connectivity/connectivityForm.utils.d.ts +2 -0
  10. package/dist/features/network-modifications/common/currentLimits/limits.types.d.ts +1 -0
  11. package/dist/features/network-modifications/common/currentLimits/limitsPane.utils.d.ts +2 -2
  12. package/dist/features/network-modifications/common/index.d.ts +1 -0
  13. package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/reactiveCapability.utils.js +1 -1
  14. package/dist/features/network-modifications/common/regulatingTerminal/regulatingTerminal.utils.d.ts +2 -2
  15. package/dist/features/network-modifications/common/regulatingTerminal/regulatingTerminal.utils.js +2 -2
  16. package/dist/features/network-modifications/index.d.ts +1 -0
  17. package/dist/features/network-modifications/index.js +96 -3
  18. package/dist/features/network-modifications/line/characteristics/index.d.ts +0 -1
  19. package/dist/features/network-modifications/line/characteristics/index.js +1 -2
  20. package/dist/features/network-modifications/line/characteristics/lineCharacteristicsPane.utils.d.ts +4 -19
  21. package/dist/features/network-modifications/line/characteristics/lineCharacteristicsPane.utils.js +0 -14
  22. package/dist/features/network-modifications/line/creation/lineCreation.types.d.ts +6 -26
  23. package/dist/features/network-modifications/line/index.js +1 -2
  24. package/dist/features/network-modifications/line/modification/lineModification.types.d.ts +3 -35
  25. package/dist/features/network-modifications/twoWindingsTransformer/characteristics/TwoWindingsTransformerCharacteristicsPane.d.ts +7 -0
  26. package/dist/features/network-modifications/twoWindingsTransformer/characteristics/TwoWindingsTransformerCharacteristicsPane.js +168 -0
  27. package/dist/features/network-modifications/twoWindingsTransformer/characteristics/index.d.ts +8 -0
  28. package/dist/features/network-modifications/twoWindingsTransformer/characteristics/index.js +8 -0
  29. package/dist/features/network-modifications/twoWindingsTransformer/characteristics/twoWindingsTransformerCharacteristicsPane.utils.d.ts +41 -0
  30. package/dist/features/network-modifications/twoWindingsTransformer/characteristics/twoWindingsTransformerCharacteristicsPane.utils.js +51 -0
  31. package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogHeader.d.ts +6 -0
  32. package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogHeader.js +123 -0
  33. package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogTabs.d.ts +9 -0
  34. package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogTabs.js +89 -0
  35. package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogTabsContent.d.ts +14 -0
  36. package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogTabsContent.js +118 -0
  37. package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerForm.d.ts +6 -0
  38. package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerForm.js +47 -0
  39. package/dist/features/network-modifications/twoWindingsTransformer/common/index.d.ts +12 -0
  40. package/dist/features/network-modifications/twoWindingsTransformer/common/index.js +13 -0
  41. package/dist/features/network-modifications/twoWindingsTransformer/common/twoWindingsTransformer.types.d.ts +87 -0
  42. package/dist/features/network-modifications/twoWindingsTransformer/common/twoWindingsTransformer.types.js +1 -0
  43. package/dist/features/network-modifications/twoWindingsTransformer/common/twoWindingsTransformer.utils.d.ts +10 -0
  44. package/dist/features/network-modifications/twoWindingsTransformer/common/twoWindingsTransformer.utils.js +50 -0
  45. package/dist/features/network-modifications/twoWindingsTransformer/creation/index.d.ts +8 -0
  46. package/dist/features/network-modifications/twoWindingsTransformer/creation/index.js +12 -0
  47. package/dist/features/network-modifications/twoWindingsTransformer/creation/twoWindingsTransformerCreation.types.d.ts +47 -0
  48. package/dist/features/network-modifications/twoWindingsTransformer/creation/twoWindingsTransformerCreation.types.js +8 -0
  49. package/dist/features/network-modifications/twoWindingsTransformer/creation/twoWindingsTransformerCreation.utils.d.ts +248 -0
  50. package/dist/features/network-modifications/twoWindingsTransformer/creation/twoWindingsTransformerCreation.utils.js +325 -0
  51. package/dist/features/network-modifications/twoWindingsTransformer/index.d.ts +11 -0
  52. package/dist/features/network-modifications/twoWindingsTransformer/index.js +88 -0
  53. package/dist/features/network-modifications/twoWindingsTransformer/modification/index.d.ts +9 -0
  54. package/dist/features/network-modifications/twoWindingsTransformer/modification/index.js +10 -0
  55. package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/ToBeEstimatedForm.d.ts +6 -0
  56. package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/ToBeEstimatedForm.js +104 -0
  57. package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/index.d.ts +9 -0
  58. package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/index.js +7 -0
  59. package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/toBeEstimated.type.d.ts +10 -0
  60. package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/toBeEstimated.type.js +1 -0
  61. package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/toBeEstimated.utils.d.ts +12 -0
  62. package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/toBeEstimated.utils.js +18 -0
  63. package/dist/features/network-modifications/twoWindingsTransformer/modification/twoWindingsTransformerModification.types.d.ts +39 -0
  64. package/dist/features/network-modifications/twoWindingsTransformer/modification/twoWindingsTransformerModification.types.js +1 -0
  65. package/dist/features/network-modifications/twoWindingsTransformer/modification/twoWindingsTransformerModification.utils.d.ts +265 -0
  66. package/dist/features/network-modifications/twoWindingsTransformer/modification/twoWindingsTransformerModification.utils.js +100 -0
  67. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/RegulatedTerminalSection.d.ts +13 -0
  68. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/RegulatedTerminalSection.js +130 -0
  69. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/TapChangerSteps.d.ts +20 -0
  70. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/TapChangerSteps.js +311 -0
  71. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/index.d.ts +12 -0
  72. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/index.js +53 -0
  73. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/PhaseTapChangerPane.d.ts +2 -0
  74. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/PhaseTapChangerPane.js +198 -0
  75. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/PhaseTapChangerPaneSteps.d.ts +9 -0
  76. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/PhaseTapChangerPaneSteps.js +201 -0
  77. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/index.d.ts +9 -0
  78. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/index.js +15 -0
  79. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/phaseTapChanger.utils.d.ts +114 -0
  80. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/phaseTapChanger.utils.js +242 -0
  81. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/RatioTapChangerPane.d.ts +2 -0
  82. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/RatioTapChangerPane.js +283 -0
  83. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/RatioTapChangerPaneSteps.d.ts +9 -0
  84. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/RatioTapChangerPaneSteps.js +181 -0
  85. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/index.d.ts +9 -0
  86. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/index.js +18 -0
  87. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/ratioTapChanger.utils.d.ts +132 -0
  88. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/ratioTapChanger.utils.js +211 -0
  89. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/CreateRuleDialog.d.ts +2 -0
  90. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/CreateRuleDialog.js +102 -0
  91. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/CreateRuleDialogSubmitButton.d.ts +7 -0
  92. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/CreateRuleDialogSubmitButton.js +22 -0
  93. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/CreateRuleForm.d.ts +6 -0
  94. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/CreateRuleForm.js +86 -0
  95. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/ImportRuleDialog.d.ts +10 -0
  96. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/ImportRuleDialog.js +140 -0
  97. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/index.d.ts +12 -0
  98. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/index.js +13 -0
  99. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/regulationRule.types.d.ts +12 -0
  100. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/regulationRule.types.js +1 -0
  101. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/regulationRule.utils.d.ts +9 -0
  102. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/regulationRule.utils.js +19 -0
  103. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/tapChanger.utils.d.ts +14 -0
  104. package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/tapChanger.utils.js +79 -0
  105. package/dist/features/network-modifications/voltageLevel/index.d.ts +1 -0
  106. package/dist/features/network-modifications/voltageLevel/index.js +9 -1
  107. package/dist/features/network-modifications/voltageLevel/section/VoltageLevelSectionCreationForm.d.ts +10 -0
  108. package/dist/features/network-modifications/voltageLevel/section/VoltageLevelSectionCreationForm.js +375 -0
  109. package/dist/features/network-modifications/voltageLevel/section/index.d.ts +9 -0
  110. package/dist/features/network-modifications/voltageLevel/section/index.js +10 -0
  111. package/dist/features/network-modifications/voltageLevel/section/voltageLevelSectionCreation.types.d.ts +15 -0
  112. package/dist/features/network-modifications/voltageLevel/section/voltageLevelSectionCreation.types.js +1 -0
  113. package/dist/features/network-modifications/voltageLevel/section/voltageLevelSectionCreation.utils.d.ts +48 -0
  114. package/dist/features/network-modifications/voltageLevel/section/voltageLevelSectionCreation.utils.js +100 -0
  115. package/dist/index.js +107 -7
  116. package/dist/translations/en/filterExpertEn.d.ts +0 -3
  117. package/dist/translations/en/filterExpertEn.js +0 -3
  118. package/dist/translations/en/network-modification-validationEn.d.ts +1 -0
  119. package/dist/translations/en/network-modification-validationEn.js +2 -1
  120. package/dist/translations/en/networkModificationsEn.d.ts +87 -9
  121. package/dist/translations/en/networkModificationsEn.js +91 -12
  122. package/dist/translations/fr/filterExpertFr.d.ts +0 -3
  123. package/dist/translations/fr/filterExpertFr.js +0 -3
  124. package/dist/translations/fr/network-modification-validationFr.d.ts +1 -0
  125. package/dist/translations/fr/network-modification-validationFr.js +2 -1
  126. package/dist/translations/fr/networkModificationsFr.d.ts +87 -9
  127. package/dist/translations/fr/networkModificationsFr.js +91 -12
  128. package/dist/utils/constants/fieldConstants.d.ts +37 -0
  129. package/dist/utils/constants/fieldConstants.js +37 -0
  130. package/dist/utils/constants/index.js +2 -1
  131. package/dist/utils/constants/translationKeys.d.ts +1 -0
  132. package/dist/utils/constants/translationKeys.js +2 -0
  133. package/dist/utils/functions.d.ts +9 -0
  134. package/dist/utils/functions.js +40 -0
  135. package/dist/utils/index.js +11 -4
  136. package/dist/utils/langs.d.ts +1 -0
  137. package/dist/utils/langs.js +9 -1
  138. package/dist/utils/types/equipmentType.d.ts +34 -0
  139. package/dist/utils/types/equipmentType.js +28 -0
  140. package/dist/utils/types/index.js +4 -1
  141. package/package.json +1 -1
  142. /package/dist/features/network-modifications/{line/characteristics/lineCharacteristicsPane.types.js → common/branch/branchCreation.types.js} +0 -0
@@ -5,7 +5,7 @@ import { MAX_CHAR_DESCRIPTION } from "./uiConstants.js";
5
5
  import { AMPERE, DEGREE, KILO_AMPERE, KILO_METER, KILO_VOLT, MEGA_VAR, MEGA_VOLT_AMPERE, MEGA_WATT, MICRO_SIEMENS, OHM, PERCENTAGE, SIEMENS } from "./unitsConstants.js";
6
6
  import { COMMON_APP_NAME, COMMON_CONFIG_PARAMS_NAMES, LAST_SELECTED_DIRECTORY, PARAM_DEVELOPER_MODE, PARAM_LANGUAGE, PARAM_THEME } from "./configConstants.js";
7
7
  import { FILTERS, FILTER_ID, FILTER_NAME, ID } from "./filterConstant.js";
8
- import { ACTIVE_LIMITS_MIN_MAX_INVALID, CREATE_SUBSTATION_IN_VOLTAGE_LEVEL_IDENTICAL_ID, DESCRIPTION_LIMIT_ERROR, DUPLICATED_PROPS_ERROR, MAXIMUM_SECTION_COUNT_MUST_BE_GREATER_OR_EQUAL_TO_ONE, MIN_ACTIVE_POWER_MUST_BE_LESS_OR_EQUAL_TO_MAX_ACTIVE_POWER, MUST_BE_GREATER_OR_EQUAL_TO_ZERO, NAME_ALREADY_USED, NAME_EMPTY, NORMALIZED_PERCENTAGE, NUMERIC_VALUE_OR_EMPTY_FIELD, REACTIVE_LIMITS_MIN_MAX_INVALID, REAL_PERCENTAGE, SECTION_COUNT_MUST_BE_BETWEEN_ZERO_AND_MAXIMUM_SECTION_COUNT, SHORT_CIRCUIT_CURRENT_LIMIT_MUST_BE_GREATER_OR_EQUAL_TO_ZERO, SHUNT_COMPENSATOR_ERROR_Q_AT_NOMINAL_VOLTAGE_LESS_THAN_ZERO, VALUE_MUST_BE_NUMERIC_WHEN_PERCENTAGE_ERROR, VALUE_MUST_BE_REF_WHEN_PERCENTAGE_ERROR, WRONG_REF_OR_VALUE_ERROR, YUP_DEFAULT, YUP_NOT_NULL, YUP_NOT_TYPE_DEFAULT, YUP_NOT_TYPE_NUMBER, YUP_POSITIVE, YUP_REQUIRED } from "./translationKeys.js";
8
+ import { ACTIVE_LIMITS_MIN_MAX_INVALID, CREATE_SUBSTATION_IN_VOLTAGE_LEVEL_IDENTICAL_ID, DESCRIPTION_LIMIT_ERROR, DUPLICATED_PROPS_ERROR, MAXIMUM_SECTION_COUNT_MUST_BE_GREATER_OR_EQUAL_TO_ONE, MIN_ACTIVE_POWER_MUST_BE_LESS_OR_EQUAL_TO_MAX_ACTIVE_POWER, MUST_BE_GREATER_OR_EQUAL_TO_ZERO, NAME_ALREADY_USED, NAME_EMPTY, NORMALIZED_PERCENTAGE, NUMERIC_VALUE_OR_EMPTY_FIELD, REACTIVE_LIMITS_MIN_MAX_INVALID, REAL_PERCENTAGE, SECTION_COUNT_MUST_BE_BETWEEN_ZERO_AND_MAXIMUM_SECTION_COUNT, SHORT_CIRCUIT_CURRENT_LIMIT_MUST_BE_GREATER_OR_EQUAL_TO_ZERO, SHUNT_COMPENSATOR_ERROR_Q_AT_NOMINAL_VOLTAGE_LESS_THAN_ZERO, TARGET_DEADBAND_MUST_BE_GREATER_OR_EQUAL_TO_ZERO, VALUE_MUST_BE_NUMERIC_WHEN_PERCENTAGE_ERROR, VALUE_MUST_BE_REF_WHEN_PERCENTAGE_ERROR, WRONG_REF_OR_VALUE_ERROR, YUP_DEFAULT, YUP_NOT_NULL, YUP_NOT_TYPE_DEFAULT, YUP_NOT_TYPE_NUMBER, YUP_POSITIVE, YUP_REQUIRED } from "./translationKeys.js";
9
9
  export {
10
10
  ACTIVE_LIMITS_MIN_MAX_INVALID,
11
11
  AMPERE,
@@ -58,6 +58,7 @@ export {
58
58
  SHUNT_COMPENSATOR_ERROR_Q_AT_NOMINAL_VOLTAGE_LESS_THAN_ZERO,
59
59
  SIEMENS,
60
60
  SusceptanceAdornment,
61
+ TARGET_DEADBAND_MUST_BE_GREATER_OR_EQUAL_TO_ZERO,
61
62
  VALUE_MUST_BE_NUMERIC_WHEN_PERCENTAGE_ERROR,
62
63
  VALUE_MUST_BE_REF_WHEN_PERCENTAGE_ERROR,
63
64
  VoltageAdornment,
@@ -18,6 +18,7 @@ export declare const MAXIMUM_SECTION_COUNT_MUST_BE_GREATER_OR_EQUAL_TO_ONE = "Ma
18
18
  export declare const SECTION_COUNT_MUST_BE_BETWEEN_ZERO_AND_MAXIMUM_SECTION_COUNT = "SectionCountMustBeBetweenZeroAndMaximumSectionCount";
19
19
  export declare const CREATE_SUBSTATION_IN_VOLTAGE_LEVEL_IDENTICAL_ID = "CreateSubstationInVoltageLevelIdenticalId";
20
20
  export declare const MIN_ACTIVE_POWER_MUST_BE_LESS_OR_EQUAL_TO_MAX_ACTIVE_POWER = "MinActivePowerMustBeLessOrEqualToMaxActivePower";
21
+ export declare const TARGET_DEADBAND_MUST_BE_GREATER_OR_EQUAL_TO_ZERO = "TargetDeadbandMustBeGreaterOrEqualToZero";
21
22
  export declare const NAME_ALREADY_USED = "nameAlreadyUsed";
22
23
  export declare const NUMERIC_VALUE_OR_EMPTY_FIELD = "NumericValueOrEmptyField";
23
24
  export declare const WRONG_REF_OR_VALUE_ERROR = "WrongRefOrValueError";
@@ -18,6 +18,7 @@ const MAXIMUM_SECTION_COUNT_MUST_BE_GREATER_OR_EQUAL_TO_ONE = "MaximumSectionCou
18
18
  const SECTION_COUNT_MUST_BE_BETWEEN_ZERO_AND_MAXIMUM_SECTION_COUNT = "SectionCountMustBeBetweenZeroAndMaximumSectionCount";
19
19
  const CREATE_SUBSTATION_IN_VOLTAGE_LEVEL_IDENTICAL_ID = "CreateSubstationInVoltageLevelIdenticalId";
20
20
  const MIN_ACTIVE_POWER_MUST_BE_LESS_OR_EQUAL_TO_MAX_ACTIVE_POWER = "MinActivePowerMustBeLessOrEqualToMaxActivePower";
21
+ const TARGET_DEADBAND_MUST_BE_GREATER_OR_EQUAL_TO_ZERO = "TargetDeadbandMustBeGreaterOrEqualToZero";
21
22
  const NAME_ALREADY_USED = "nameAlreadyUsed";
22
23
  const NUMERIC_VALUE_OR_EMPTY_FIELD = "NumericValueOrEmptyField";
23
24
  const WRONG_REF_OR_VALUE_ERROR = "WrongRefOrValueError";
@@ -40,6 +41,7 @@ export {
40
41
  SECTION_COUNT_MUST_BE_BETWEEN_ZERO_AND_MAXIMUM_SECTION_COUNT,
41
42
  SHORT_CIRCUIT_CURRENT_LIMIT_MUST_BE_GREATER_OR_EQUAL_TO_ZERO,
42
43
  SHUNT_COMPENSATOR_ERROR_Q_AT_NOMINAL_VOLTAGE_LESS_THAN_ZERO,
44
+ TARGET_DEADBAND_MUST_BE_GREATER_OR_EQUAL_TO_ZERO,
43
45
  VALUE_MUST_BE_NUMERIC_WHEN_PERCENTAGE_ERROR,
44
46
  VALUE_MUST_BE_REF_WHEN_PERCENTAGE_ERROR,
45
47
  WRONG_REF_OR_VALUE_ERROR,
@@ -27,3 +27,12 @@ export declare const areArrayElementsUnique: (array: unknown[]) => boolean;
27
27
  export declare function isEmpty(value: any): boolean;
28
28
  export declare const isObjectEmpty: (object: object) => boolean;
29
29
  export declare function getRows(rows: any[] | undefined, status: string): any[];
30
+ /**
31
+ * Returns true if every element of this array is a number and they are ordered (ascending or descending)
32
+ * @param array or numbers
33
+ * @returns {boolean}
34
+ */
35
+ export declare const areNumbersOrdered: (array?: unknown) => boolean;
36
+ export declare const addSelectedFieldToRows: <T>(rows?: T[]) => (T & {
37
+ selected: boolean;
38
+ })[];
@@ -1,5 +1,6 @@
1
1
  import { FieldConstants } from "./constants/fieldConstants.js";
2
2
  import { RunningStatus } from "./running-status.js";
3
+ import { toNumber } from "./validation-functions.js";
3
4
  const hasNonEmptyRows = (rows) => Array.isArray(rows) && rows.some(
4
5
  (row) => row && Object.keys(row).filter((key) => key !== FieldConstants.AG_GRID_ROW_UUID).some((key) => row[key] !== void 0 && row[key] !== null && String(row[key]).trim().length > 0)
5
6
  );
@@ -24,8 +25,47 @@ const isObjectEmpty = (object) => object && Object.keys(object).length === 0;
24
25
  function getRows(rows, status) {
25
26
  return status === RunningStatus.SUCCEED && rows ? rows : [];
26
27
  }
28
+ const areNumbersOrdered = (array) => {
29
+ if (!Array.isArray(array)) {
30
+ return false;
31
+ }
32
+ if (array.length === 0) {
33
+ return true;
34
+ }
35
+ if (array.length === 1) {
36
+ return !Number.isNaN(toNumber(array[0]));
37
+ }
38
+ let current = toNumber(array[0]);
39
+ if (Number.isNaN(current)) {
40
+ return false;
41
+ }
42
+ let order = null;
43
+ for (let i = 1; i < array.length; i++) {
44
+ const nextOne = toNumber(array[i]);
45
+ if (Number.isNaN(nextOne)) {
46
+ return false;
47
+ }
48
+ if (current !== nextOne) {
49
+ if (order === null) {
50
+ order = current < nextOne ? "asc" : "desc";
51
+ }
52
+ if (order === "asc" && current > nextOne || order === "desc" && current < nextOne) {
53
+ return false;
54
+ }
55
+ current = nextOne;
56
+ }
57
+ }
58
+ return true;
59
+ };
60
+ const addSelectedFieldToRows = (rows) => {
61
+ return rows?.map((row) => {
62
+ return { ...row, [FieldConstants.SELECTED]: false };
63
+ }) ?? [];
64
+ };
27
65
  export {
66
+ addSelectedFieldToRows,
28
67
  areArrayElementsUnique,
68
+ areNumbersOrdered,
29
69
  arraysContainIdenticalStrings,
30
70
  getRows,
31
71
  hasNonEmptyRows,
@@ -6,13 +6,13 @@ import { MAX_CHAR_DESCRIPTION } from "./constants/uiConstants.js";
6
6
  import { AMPERE, DEGREE, KILO_AMPERE, KILO_METER, KILO_VOLT, MEGA_VAR, MEGA_VOLT_AMPERE, MEGA_WATT, MICRO_SIEMENS, OHM, PERCENTAGE, SIEMENS } from "./constants/unitsConstants.js";
7
7
  import { COMMON_APP_NAME, COMMON_CONFIG_PARAMS_NAMES, LAST_SELECTED_DIRECTORY, PARAM_DEVELOPER_MODE, PARAM_LANGUAGE, PARAM_THEME } from "./constants/configConstants.js";
8
8
  import { FILTERS, FILTER_ID, FILTER_NAME, ID } from "./constants/filterConstant.js";
9
- import { ACTIVE_LIMITS_MIN_MAX_INVALID, CREATE_SUBSTATION_IN_VOLTAGE_LEVEL_IDENTICAL_ID, DESCRIPTION_LIMIT_ERROR, DUPLICATED_PROPS_ERROR, MAXIMUM_SECTION_COUNT_MUST_BE_GREATER_OR_EQUAL_TO_ONE, MIN_ACTIVE_POWER_MUST_BE_LESS_OR_EQUAL_TO_MAX_ACTIVE_POWER, MUST_BE_GREATER_OR_EQUAL_TO_ZERO, NAME_ALREADY_USED, NAME_EMPTY, NORMALIZED_PERCENTAGE, NUMERIC_VALUE_OR_EMPTY_FIELD, REACTIVE_LIMITS_MIN_MAX_INVALID, REAL_PERCENTAGE, SECTION_COUNT_MUST_BE_BETWEEN_ZERO_AND_MAXIMUM_SECTION_COUNT, SHORT_CIRCUIT_CURRENT_LIMIT_MUST_BE_GREATER_OR_EQUAL_TO_ZERO, SHUNT_COMPENSATOR_ERROR_Q_AT_NOMINAL_VOLTAGE_LESS_THAN_ZERO, VALUE_MUST_BE_NUMERIC_WHEN_PERCENTAGE_ERROR, VALUE_MUST_BE_REF_WHEN_PERCENTAGE_ERROR, WRONG_REF_OR_VALUE_ERROR, YUP_DEFAULT, YUP_NOT_NULL, YUP_NOT_TYPE_DEFAULT, YUP_NOT_TYPE_NUMBER, YUP_POSITIVE, YUP_REQUIRED } from "./constants/translationKeys.js";
9
+ import { ACTIVE_LIMITS_MIN_MAX_INVALID, CREATE_SUBSTATION_IN_VOLTAGE_LEVEL_IDENTICAL_ID, DESCRIPTION_LIMIT_ERROR, DUPLICATED_PROPS_ERROR, MAXIMUM_SECTION_COUNT_MUST_BE_GREATER_OR_EQUAL_TO_ONE, MIN_ACTIVE_POWER_MUST_BE_LESS_OR_EQUAL_TO_MAX_ACTIVE_POWER, MUST_BE_GREATER_OR_EQUAL_TO_ZERO, NAME_ALREADY_USED, NAME_EMPTY, NORMALIZED_PERCENTAGE, NUMERIC_VALUE_OR_EMPTY_FIELD, REACTIVE_LIMITS_MIN_MAX_INVALID, REAL_PERCENTAGE, SECTION_COUNT_MUST_BE_BETWEEN_ZERO_AND_MAXIMUM_SECTION_COUNT, SHORT_CIRCUIT_CURRENT_LIMIT_MUST_BE_GREATER_OR_EQUAL_TO_ZERO, SHUNT_COMPENSATOR_ERROR_Q_AT_NOMINAL_VOLTAGE_LESS_THAN_ZERO, TARGET_DEADBAND_MUST_BE_GREATER_OR_EQUAL_TO_ZERO, VALUE_MUST_BE_NUMERIC_WHEN_PERCENTAGE_ERROR, VALUE_MUST_BE_REF_WHEN_PERCENTAGE_ERROR, WRONG_REF_OR_VALUE_ERROR, YUP_DEFAULT, YUP_NOT_NULL, YUP_NOT_TYPE_DEFAULT, YUP_NOT_TYPE_NUMBER, YUP_POSITIVE, YUP_REQUIRED } from "./constants/translationKeys.js";
10
10
  import { GRIDSUITE_DEFAULT_PRECISION, convertInputValue, convertOutputValue, isBlankOrEmpty, kiloUnitToUnit, microUnitToUnit, roundToDefaultPrecision, roundToPrecision, toModificationOperation, unitToKiloUnit, unitToMicroUnit } from "./conversionUtils.js";
11
11
  import { catchErrorHandler, extractErrorMessageDescriptor, snackWithFallback } from "./error.js";
12
12
  import { isDisabledValidationButton } from "./form-utils.js";
13
- import { areArrayElementsUnique, arraysContainIdenticalStrings, getRows, hasNonEmptyRows, isEmpty, isObjectEmpty, keyGenerator } from "./functions.js";
13
+ import { addSelectedFieldToRows, areArrayElementsUnique, areNumbersOrdered, arraysContainIdenticalStrings, getRows, hasNonEmptyRows, isEmpty, isObjectEmpty, keyGenerator } from "./functions.js";
14
14
  import { getEquipmentTypeShortLabel } from "./labelUtils.js";
15
- import { LANG_ENGLISH, LANG_FRENCH, LANG_SYSTEM, getCsvDelimiter } from "./langs.js";
15
+ import { LANG_ENGLISH, LANG_FRENCH, LANG_SYSTEM, getCsvDelimiter, transformIfFrenchNumber } from "./langs.js";
16
16
  import { getFileIcon } from "./mapper/getFileIcon.js";
17
17
  import { equipmentTypesForPredefinedPropertiesMapper } from "./mapper/equipmentTypesForPredefinedPropertiesMapper.js";
18
18
  import { copyToClipboard } from "./navigator-clipboard.js";
@@ -22,7 +22,7 @@ import { CustomError } from "./types/CustomError.js";
22
22
  import { ProblemDetailError } from "./types/ProblemDetailError.js";
23
23
  import { NetworkTimeoutError } from "./types/NetworkTimeoutError.js";
24
24
  import { ElementType } from "./types/elementType.js";
25
- import { ALL_EQUIPMENTS, BASE_EQUIPMENTS, CONNECTION_DIRECTIONS, ENERGY_SOURCES, EQUIPMENTS_WITH_ONE_NOMINAL_VOLTAGE, EQUIPMENTS_WITH_ONE_SUBSTATION, EQUIPMENTS_WITH_THREE_NOMINAL_VOLTAGES, EQUIPMENTS_WITH_TWO_NOMINAL_VOLTAGES, EQUIPMENTS_WITH_TWO_SUBSTATIONS, EquipmentType, ExtendedEquipmentType, HvdcType, LOAD_TYPES, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, UNDEFINED_CONNECTION_DIRECTION, UNDEFINED_LOAD_TYPE, VL_TAG_MAX_SIZE, equipmentStyles, getConnectionDirectionLabel, getEnergySourceLabel, getEquipmentsInfosForSearchBar, getLoadTypeLabel } from "./types/equipmentType.js";
25
+ import { ALL_EQUIPMENTS, BASE_EQUIPMENTS, CONNECTION_DIRECTIONS, ENERGY_SOURCES, EQUIPMENTS_WITH_ONE_NOMINAL_VOLTAGE, EQUIPMENTS_WITH_ONE_SUBSTATION, EQUIPMENTS_WITH_THREE_NOMINAL_VOLTAGES, EQUIPMENTS_WITH_TWO_NOMINAL_VOLTAGES, EQUIPMENTS_WITH_TWO_SUBSTATIONS, EquipmentType, ExtendedEquipmentType, HvdcType, LOAD_TYPES, OperatingStatus, PHASE_REGULATION_MODES, RATIO_REGULATION_MODES, REGULATION_SIDES, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, UNDEFINED_CONNECTION_DIRECTION, UNDEFINED_LOAD_TYPE, VL_TAG_MAX_SIZE, equipmentStyles, getConnectionDirectionLabel, getEnergySourceLabel, getEquipmentsInfosForSearchBar, getLoadTypeLabel } from "./types/equipmentType.js";
26
26
  import { Battery, BoundaryLine, BusBar, Generator, Hvdc, LCC, Line, Load, SVC, ShuntCompensator, Substation, ThreeWindingTransfo, TwoWindingTransfo, VSC, VoltageLevel, isInjection } from "./types/equipmentTypes.js";
27
27
  import { AnnouncementSeverity, ArrayAction, ElementStatus, ReferenceType } from "./types/types.js";
28
28
  import { MODIFICATION_TYPES, ModificationType } from "./types/modificationType.js";
@@ -126,6 +126,7 @@ export {
126
126
  PARAM_LANGUAGE,
127
127
  PARAM_THEME,
128
128
  PERCENTAGE,
129
+ PHASE_REGULATION_MODES,
129
130
  PREFIX_CONFIG_NOTIFICATION_WS,
130
131
  PREFIX_DIRECTORY_NOTIFICATION_WS,
131
132
  PREFIX_MONITOR_NOTIFICATION_WS,
@@ -133,8 +134,10 @@ export {
133
134
  ParameterType,
134
135
  PercentageAdornment,
135
136
  ProblemDetailError,
137
+ RATIO_REGULATION_MODES,
136
138
  REACTIVE_LIMITS_MIN_MAX_INVALID,
137
139
  REAL_PERCENTAGE,
140
+ REGULATION_SIDES,
138
141
  ReactivePowerAdornment,
139
142
  ReferenceType,
140
143
  RunningStatus,
@@ -149,6 +152,7 @@ export {
149
152
  SolverType,
150
153
  Substation,
151
154
  SusceptanceAdornment,
155
+ TARGET_DEADBAND_MUST_BE_GREATER_OR_EQUAL_TO_ZERO,
152
156
  TYPE_TAG_MAX_SIZE,
153
157
  ThreeWindingTransfo,
154
158
  TwoWindingTransfo,
@@ -167,8 +171,10 @@ export {
167
171
  YUP_NOT_TYPE_NUMBER,
168
172
  YUP_POSITIVE,
169
173
  YUP_REQUIRED,
174
+ addSelectedFieldToRows,
170
175
  areArrayElementsUnique,
171
176
  areIdsEqual,
177
+ areNumbersOrdered,
172
178
  arraysContainIdenticalStrings,
173
179
  catchErrorHandler,
174
180
  convertInputValue,
@@ -219,6 +225,7 @@ export {
219
225
  toModificationOperation,
220
226
  toNestedGlobalSelectors,
221
227
  toNumber,
228
+ transformIfFrenchNumber,
222
229
  unitToKiloUnit,
223
230
  unitToMicroUnit,
224
231
  validateValueIsANumber
@@ -4,3 +4,4 @@ export declare const LANG_FRENCH = "fr";
4
4
  export type GsLangUser = typeof LANG_ENGLISH | typeof LANG_FRENCH;
5
5
  export type GsLang = GsLangUser | typeof LANG_SYSTEM;
6
6
  export declare function getCsvDelimiter(language: string | undefined): ';' | ',';
7
+ export declare const transformIfFrenchNumber: (value: string, language: GsLang) => string;
@@ -4,9 +4,17 @@ const LANG_FRENCH = "fr";
4
4
  function getCsvDelimiter(language) {
5
5
  return language === LANG_FRENCH ? ";" : ",";
6
6
  }
7
+ const transformIfFrenchNumber = (value, language) => {
8
+ const trimmedValue = value.trim();
9
+ if (language === LANG_FRENCH && trimmedValue.includes(",") && !Number.isNaN(Number(trimmedValue.replace(",", ".")))) {
10
+ return trimmedValue.replace(",", ".");
11
+ }
12
+ return trimmedValue;
13
+ };
7
14
  export {
8
15
  LANG_ENGLISH,
9
16
  LANG_FRENCH,
10
17
  LANG_SYSTEM,
11
- getCsvDelimiter
18
+ getCsvDelimiter,
19
+ transformIfFrenchNumber
12
20
  };
@@ -98,6 +98,40 @@ export declare const LOAD_TYPES: {
98
98
  }[];
99
99
  export declare const UNDEFINED_LOAD_TYPE = "UNDEFINED";
100
100
  export declare function getLoadTypeLabel(loadTypeId: string): string | undefined;
101
+ export declare const REGULATION_SIDES: {
102
+ readonly SIDE1: {
103
+ readonly id: "SIDE1";
104
+ readonly label: "RegulatedSide1";
105
+ };
106
+ readonly SIDE2: {
107
+ readonly id: "SIDE2";
108
+ readonly label: "RegulatedSide2";
109
+ };
110
+ };
111
+ export declare const PHASE_REGULATION_MODES: {
112
+ readonly CURRENT_LIMITER: {
113
+ readonly id: "CURRENT_LIMITER";
114
+ readonly label: "CurrentLimiter";
115
+ };
116
+ readonly ACTIVE_POWER_CONTROL: {
117
+ readonly id: "ACTIVE_POWER_CONTROL";
118
+ readonly label: "PhaseActivePowerControl";
119
+ };
120
+ readonly OFF: {
121
+ readonly id: "OFF";
122
+ readonly label: "Off";
123
+ };
124
+ };
125
+ export declare const RATIO_REGULATION_MODES: {
126
+ readonly FIXED_RATIO: {
127
+ readonly id: "FIXED_RATIO";
128
+ readonly label: "FixedRatio";
129
+ };
130
+ readonly VOLTAGE_REGULATION: {
131
+ readonly id: "VOLTAGE_REGULATION";
132
+ readonly label: "VoltageRegulation";
133
+ };
134
+ };
101
135
  export declare const UNDEFINED_CONNECTION_DIRECTION = "UNDEFINED";
102
136
  export declare const CONNECTION_DIRECTIONS: readonly [{
103
137
  readonly id: "TOP";
@@ -129,6 +129,31 @@ const UNDEFINED_LOAD_TYPE = "UNDEFINED";
129
129
  function getLoadTypeLabel(loadTypeId) {
130
130
  return LOAD_TYPES.find(({ id }) => id === loadTypeId)?.label;
131
131
  }
132
+ const REGULATION_SIDES = {
133
+ SIDE1: { id: "SIDE1", label: "RegulatedSide1" },
134
+ SIDE2: { id: "SIDE2", label: "RegulatedSide2" }
135
+ };
136
+ const PHASE_REGULATION_MODES = {
137
+ CURRENT_LIMITER: { id: "CURRENT_LIMITER", label: "CurrentLimiter" },
138
+ ACTIVE_POWER_CONTROL: {
139
+ id: "ACTIVE_POWER_CONTROL",
140
+ label: "PhaseActivePowerControl"
141
+ },
142
+ OFF: { id: "OFF", label: "Off" }
143
+ // used for the ui but doesn't exist in powsybl => should not be sent to the back
144
+ };
145
+ const RATIO_REGULATION_MODES = {
146
+ FIXED_RATIO: {
147
+ // isRegulating false
148
+ id: "FIXED_RATIO",
149
+ label: "FixedRatio"
150
+ },
151
+ VOLTAGE_REGULATION: {
152
+ // isRegulating true
153
+ id: "VOLTAGE_REGULATION",
154
+ label: "VoltageRegulation"
155
+ }
156
+ };
132
157
  const UNDEFINED_CONNECTION_DIRECTION = "UNDEFINED";
133
158
  const CONNECTION_DIRECTIONS = [
134
159
  { id: "TOP", label: "Top" },
@@ -472,6 +497,9 @@ export {
472
497
  HvdcType,
473
498
  LOAD_TYPES,
474
499
  OperatingStatus,
500
+ PHASE_REGULATION_MODES,
501
+ RATIO_REGULATION_MODES,
502
+ REGULATION_SIDES,
475
503
  SEARCH_EQUIPMENTS,
476
504
  TYPE_TAG_MAX_SIZE,
477
505
  UNDEFINED_CONNECTION_DIRECTION,
@@ -2,7 +2,7 @@ import { CustomError } from "./CustomError.js";
2
2
  import { ProblemDetailError } from "./ProblemDetailError.js";
3
3
  import { NetworkTimeoutError } from "./NetworkTimeoutError.js";
4
4
  import { ElementType } from "./elementType.js";
5
- import { ALL_EQUIPMENTS, BASE_EQUIPMENTS, CONNECTION_DIRECTIONS, ENERGY_SOURCES, EQUIPMENTS_WITH_ONE_NOMINAL_VOLTAGE, EQUIPMENTS_WITH_ONE_SUBSTATION, EQUIPMENTS_WITH_THREE_NOMINAL_VOLTAGES, EQUIPMENTS_WITH_TWO_NOMINAL_VOLTAGES, EQUIPMENTS_WITH_TWO_SUBSTATIONS, EquipmentType, ExtendedEquipmentType, HvdcType, LOAD_TYPES, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, UNDEFINED_CONNECTION_DIRECTION, UNDEFINED_LOAD_TYPE, VL_TAG_MAX_SIZE, equipmentStyles, getConnectionDirectionLabel, getEnergySourceLabel, getEquipmentsInfosForSearchBar, getLoadTypeLabel } from "./equipmentType.js";
5
+ import { ALL_EQUIPMENTS, BASE_EQUIPMENTS, CONNECTION_DIRECTIONS, ENERGY_SOURCES, EQUIPMENTS_WITH_ONE_NOMINAL_VOLTAGE, EQUIPMENTS_WITH_ONE_SUBSTATION, EQUIPMENTS_WITH_THREE_NOMINAL_VOLTAGES, EQUIPMENTS_WITH_TWO_NOMINAL_VOLTAGES, EQUIPMENTS_WITH_TWO_SUBSTATIONS, EquipmentType, ExtendedEquipmentType, HvdcType, LOAD_TYPES, OperatingStatus, PHASE_REGULATION_MODES, RATIO_REGULATION_MODES, REGULATION_SIDES, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, UNDEFINED_CONNECTION_DIRECTION, UNDEFINED_LOAD_TYPE, VL_TAG_MAX_SIZE, equipmentStyles, getConnectionDirectionLabel, getEnergySourceLabel, getEquipmentsInfosForSearchBar, getLoadTypeLabel } from "./equipmentType.js";
6
6
  import { Battery, BoundaryLine, BusBar, Generator, Hvdc, LCC, Line, Load, SVC, ShuntCompensator, Substation, ThreeWindingTransfo, TwoWindingTransfo, VSC, VoltageLevel, isInjection } from "./equipmentTypes.js";
7
7
  import { AnnouncementSeverity, ArrayAction, ElementStatus, ReferenceType } from "./types.js";
8
8
  import { MODIFICATION_TYPES, ModificationType } from "./modificationType.js";
@@ -52,8 +52,11 @@ export {
52
52
  NetworkTimeoutError,
53
53
  OperatingStatus,
54
54
  OperationType,
55
+ PHASE_REGULATION_MODES,
55
56
  ParameterType,
56
57
  ProblemDetailError,
58
+ RATIO_REGULATION_MODES,
59
+ REGULATION_SIDES,
57
60
  ReferenceType,
58
61
  SEARCH_EQUIPMENTS,
59
62
  SVC,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.269.0",
3
+ "version": "0.271.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "author": "gridsuite team",
6
6
  "homepage": "https://github.com/gridsuite",