@gridsuite/commons-ui 0.98.0 → 0.100.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 (149) hide show
  1. package/dist/components/announcement/AnnouncementBanner.d.ts +15 -0
  2. package/dist/components/announcement/AnnouncementBanner.js +87 -0
  3. package/dist/components/announcement/AnnouncementNotification.d.ts +7 -0
  4. package/dist/components/announcement/AnnouncementNotification.js +10 -0
  5. package/dist/components/announcement/index.d.ts +3 -0
  6. package/dist/components/announcement/index.js +8 -0
  7. package/dist/components/announcement/useGlobalAnnouncement.d.ts +10 -0
  8. package/dist/components/announcement/useGlobalAnnouncement.js +48 -0
  9. package/dist/components/dialogs/customMuiDialog/CustomMuiDialog.js +1 -1
  10. package/dist/components/index.d.ts +2 -0
  11. package/dist/components/index.js +104 -3
  12. package/dist/components/inputs/index.js +2 -1
  13. package/dist/components/inputs/reactHookForm/DirectoryItemsInput.d.ts +1 -0
  14. package/dist/components/inputs/reactHookForm/DirectoryItemsInput.js +2 -0
  15. package/dist/components/inputs/reactHookForm/index.js +2 -1
  16. package/dist/components/inputs/reactHookForm/text/TextInput.d.ts +3 -1
  17. package/dist/components/inputs/reactHookForm/text/TextInput.js +4 -2
  18. package/dist/components/inputs/reactHookForm/utils/HelperPreviousValue.js +1 -1
  19. package/dist/components/parameters/common/ProviderParam.d.ts +7 -0
  20. package/dist/components/parameters/common/ProviderParam.js +51 -0
  21. package/dist/components/parameters/common/computing-type.d.ts +20 -0
  22. package/dist/components/parameters/common/computing-type.js +46 -0
  23. package/dist/components/parameters/common/constant.d.ts +8 -0
  24. package/dist/components/parameters/common/constant.js +18 -0
  25. package/dist/components/parameters/common/index.d.ts +15 -0
  26. package/dist/components/parameters/common/index.js +61 -0
  27. package/dist/components/parameters/common/limitreductions/columns-definitions.d.ts +77 -0
  28. package/dist/components/parameters/common/limitreductions/columns-definitions.js +83 -0
  29. package/dist/components/parameters/common/limitreductions/index.d.ts +11 -0
  30. package/dist/components/parameters/common/limitreductions/index.js +21 -0
  31. package/dist/components/parameters/common/limitreductions/limit-reduction-table-cell.d.ts +5 -0
  32. package/dist/components/parameters/common/limitreductions/limit-reduction-table-cell.js +38 -0
  33. package/dist/components/parameters/common/limitreductions/limit-reduction-table-row.d.ts +7 -0
  34. package/dist/components/parameters/common/limitreductions/limit-reduction-table-row.js +9 -0
  35. package/dist/components/parameters/common/limitreductions/limit-reductions-form-util.d.ts +29 -0
  36. package/dist/components/parameters/common/limitreductions/limit-reductions-form-util.js +27 -0
  37. package/dist/components/parameters/common/limitreductions/limit-reductions-table-form.d.ts +4 -0
  38. package/dist/components/parameters/common/limitreductions/limit-reductions-table-form.js +87 -0
  39. package/dist/components/parameters/common/line-separator.d.ts +1 -0
  40. package/dist/components/parameters/common/line-separator.js +8 -0
  41. package/dist/components/parameters/common/parameters-creation-dialog.d.ts +13 -0
  42. package/dist/components/parameters/common/parameters-creation-dialog.js +88 -0
  43. package/dist/components/parameters/common/parameters.d.ts +20 -0
  44. package/dist/components/parameters/common/parameters.js +42 -0
  45. package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table-cell.d.ts +6 -0
  46. package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table-cell.js +42 -0
  47. package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table-row.d.ts +8 -0
  48. package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table-row.js +17 -0
  49. package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table.d.ts +8 -0
  50. package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table.js +55 -0
  51. package/dist/components/parameters/common/voltage-level-table/index.d.ts +9 -0
  52. package/dist/components/parameters/common/voltage-level-table/index.js +8 -0
  53. package/dist/components/parameters/common/widget/index.d.ts +11 -0
  54. package/dist/components/parameters/common/widget/index.js +13 -0
  55. package/dist/components/parameters/common/widget/parameter-float.d.ts +10 -0
  56. package/dist/components/parameters/common/widget/parameter-float.js +51 -0
  57. package/dist/components/parameters/common/widget/parameter-group.d.ts +11 -0
  58. package/dist/components/parameters/common/widget/parameter-group.js +54 -0
  59. package/dist/components/parameters/common/widget/parameter-line-directory-items-input.d.ts +15 -0
  60. package/dist/components/parameters/common/widget/parameter-line-directory-items-input.js +55 -0
  61. package/dist/components/parameters/common/widget/parameter-line-slider.d.ts +12 -0
  62. package/dist/components/parameters/common/widget/parameter-line-slider.js +70 -0
  63. package/dist/components/parameters/common/widget/parameter-switch.d.ts +7 -0
  64. package/dist/components/parameters/common/widget/parameter-switch.js +9 -0
  65. package/dist/components/parameters/index.d.ts +9 -0
  66. package/dist/components/parameters/index.js +94 -0
  67. package/dist/components/parameters/loadflow/constants.d.ts +33 -0
  68. package/dist/components/parameters/loadflow/constants.js +59 -0
  69. package/dist/components/parameters/loadflow/index.d.ts +9 -0
  70. package/dist/components/parameters/loadflow/index.js +31 -0
  71. package/dist/components/parameters/loadflow/load-flow-general-parameters.d.ts +8 -0
  72. package/dist/components/parameters/loadflow/load-flow-general-parameters.js +179 -0
  73. package/dist/components/parameters/loadflow/load-flow-parameter-field.d.ts +19 -0
  74. package/dist/components/parameters/loadflow/load-flow-parameter-field.js +90 -0
  75. package/dist/components/parameters/loadflow/load-flow-parameters-content.d.ts +13 -0
  76. package/dist/components/parameters/loadflow/load-flow-parameters-content.js +82 -0
  77. package/dist/components/parameters/loadflow/load-flow-parameters-context.d.ts +13 -0
  78. package/dist/components/parameters/loadflow/load-flow-parameters-context.js +5 -0
  79. package/dist/components/parameters/loadflow/load-flow-parameters-dialog.d.ts +15 -0
  80. package/dist/components/parameters/loadflow/load-flow-parameters-dialog.js +112 -0
  81. package/dist/components/parameters/loadflow/load-flow-parameters-form.d.ts +9 -0
  82. package/dist/components/parameters/loadflow/load-flow-parameters-form.js +102 -0
  83. package/dist/components/parameters/loadflow/load-flow-parameters-header.d.ts +12 -0
  84. package/dist/components/parameters/loadflow/load-flow-parameters-header.js +84 -0
  85. package/dist/components/parameters/loadflow/load-flow-parameters-inline.d.ts +10 -0
  86. package/dist/components/parameters/loadflow/load-flow-parameters-inline.js +162 -0
  87. package/dist/components/parameters/loadflow/load-flow-parameters-provider.d.ts +4 -0
  88. package/dist/components/parameters/loadflow/load-flow-parameters-provider.js +20 -0
  89. package/dist/components/parameters/loadflow/load-flow-parameters-utils.d.ts +100 -0
  90. package/dist/components/parameters/loadflow/load-flow-parameters-utils.js +158 -0
  91. package/dist/components/parameters/loadflow/use-load-flow-context.d.ts +7 -0
  92. package/dist/components/parameters/loadflow/use-load-flow-context.js +12 -0
  93. package/dist/components/parameters/loadflow/use-load-flow-parameters-form.d.ts +32 -0
  94. package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +263 -0
  95. package/dist/components/parameters/parameters-style.d.ts +150 -0
  96. package/dist/components/parameters/parameters-style.js +146 -0
  97. package/dist/components/topBar/DevModeBanner.d.ts +1 -0
  98. package/dist/components/topBar/DevModeBanner.js +42 -0
  99. package/dist/components/topBar/TopBar.js +302 -305
  100. package/dist/components/topBar/UserInformationDialog.js +1 -1
  101. package/dist/components/topBar/index.d.ts +3 -2
  102. package/dist/components/topBar/index.js +4 -2
  103. package/dist/hooks/index.d.ts +1 -0
  104. package/dist/hooks/index.js +3 -0
  105. package/dist/hooks/use-parameters-backend.d.ts +11 -0
  106. package/dist/hooks/use-parameters-backend.js +217 -0
  107. package/dist/index.js +135 -5
  108. package/dist/services/explore.d.ts +3 -0
  109. package/dist/services/explore.js +26 -1
  110. package/dist/services/index.d.ts +1 -0
  111. package/dist/services/index.js +9 -3
  112. package/dist/services/loadflow.d.ts +9 -0
  113. package/dist/services/loadflow.js +59 -0
  114. package/dist/services/userAdmin.d.ts +3 -3
  115. package/dist/services/userAdmin.js +9 -1
  116. package/dist/services/utils.d.ts +3 -8
  117. package/dist/services/utils.js +5 -0
  118. package/dist/translations/en/index.d.ts +1 -0
  119. package/dist/translations/en/index.js +2 -0
  120. package/dist/translations/en/parameters.d.ts +67 -0
  121. package/dist/translations/en/parameters.js +64 -0
  122. package/dist/translations/fr/index.d.ts +1 -0
  123. package/dist/translations/fr/index.js +2 -0
  124. package/dist/translations/fr/parameters.d.ts +67 -0
  125. package/dist/translations/fr/parameters.js +64 -0
  126. package/dist/utils/constants/notificationsProvider.d.ts +10 -0
  127. package/dist/utils/constants/notificationsProvider.js +17 -0
  128. package/dist/utils/index.d.ts +1 -0
  129. package/dist/utils/index.js +16 -0
  130. package/dist/utils/types/dynamic-security-analysis.type.d.ts +13 -0
  131. package/dist/utils/types/dynamic-security-analysis.type.js +1 -0
  132. package/dist/utils/types/dynamic-simulation.type.d.ts +111 -0
  133. package/dist/utils/types/dynamic-simulation.type.js +8 -0
  134. package/dist/utils/types/index.d.ts +6 -0
  135. package/dist/utils/types/index.js +11 -0
  136. package/dist/utils/types/loadflow.type.d.ts +11 -0
  137. package/dist/utils/types/loadflow.type.js +1 -0
  138. package/dist/utils/types/metadata.d.ts +1 -0
  139. package/dist/utils/types/non-evacuated-energy.type.d.ts +60 -0
  140. package/dist/utils/types/non-evacuated-energy.type.js +12 -0
  141. package/dist/utils/types/parameters.type.d.ts +41 -0
  142. package/dist/utils/types/parameters.type.js +12 -0
  143. package/dist/utils/types/sensitivity-analysis.type.d.ts +101 -0
  144. package/dist/utils/types/sensitivity-analysis.type.js +16 -0
  145. package/dist/utils/types/types.d.ts +12 -0
  146. package/dist/utils/types/types.js +8 -1
  147. package/package.json +2 -1
  148. package/dist/components/topBar/MessageBanner.d.ts +0 -6
  149. package/dist/components/topBar/MessageBanner.js +0 -54
@@ -0,0 +1,46 @@
1
+ var ComputingType = /* @__PURE__ */ ((ComputingType2) => {
2
+ ComputingType2["LOAD_FLOW"] = "LOAD_FLOW";
3
+ ComputingType2["SECURITY_ANALYSIS"] = "SECURITY_ANALYSIS";
4
+ ComputingType2["SENSITIVITY_ANALYSIS"] = "SENSITIVITY_ANALYSIS";
5
+ ComputingType2["NON_EVACUATED_ENERGY_ANALYSIS"] = "NON_EVACUATED_ENERGY_ANALYSIS";
6
+ ComputingType2["SHORT_CIRCUIT"] = "SHORT_CIRCUIT";
7
+ ComputingType2["SHORT_CIRCUIT_ONE_BUS"] = "SHORT_CIRCUIT_ONE_BUS";
8
+ ComputingType2["DYNAMIC_SIMULATION"] = "DYNAMIC_SIMULATION";
9
+ ComputingType2["DYNAMIC_SECURITY_ANALYSIS"] = "DYNAMIC_SECURITY_ANALYSIS";
10
+ ComputingType2["VOLTAGE_INITIALIZATION"] = "VOLTAGE_INITIALIZATION";
11
+ ComputingType2["STATE_ESTIMATION"] = "STATE_ESTIMATION";
12
+ return ComputingType2;
13
+ })(ComputingType || {});
14
+ const isValidComputingType = (value) => {
15
+ return Object.values(ComputingType).includes(value);
16
+ };
17
+ const formatComputingTypeLabel = (type) => {
18
+ switch (type) {
19
+ case "LOAD_FLOW":
20
+ return "LoadFlow";
21
+ case "SECURITY_ANALYSIS":
22
+ return "SecurityAnalysis";
23
+ case "SENSITIVITY_ANALYSIS":
24
+ return "SensitivityAnalysis";
25
+ case "NON_EVACUATED_ENERGY_ANALYSIS":
26
+ return "NonEvacuatedEnergy";
27
+ case "SHORT_CIRCUIT":
28
+ return "ShortCircuit";
29
+ case "VOLTAGE_INITIALIZATION":
30
+ return "VoltageInit";
31
+ case "DYNAMIC_SIMULATION":
32
+ return "DynamicSimulation";
33
+ case "DYNAMIC_SECURITY_ANALYSIS":
34
+ return "DynamicSecurityAnalysis";
35
+ case "STATE_ESTIMATION":
36
+ return "StateEstimation";
37
+ default:
38
+ console.warn(`Unrecognized computing type while formatting its label : ${type}`);
39
+ return void 0;
40
+ }
41
+ };
42
+ export {
43
+ ComputingType,
44
+ formatComputingTypeLabel,
45
+ isValidComputingType
46
+ };
@@ -0,0 +1,8 @@
1
+ export declare const PROVIDER = "provider";
2
+ export declare const VOLTAGE_LEVEL = "voltageLevel";
3
+ export declare const PARAM_SA_PROVIDER = "provider";
4
+ export declare const PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD = "flowProportionalThreshold";
5
+ export declare const PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD = "lowVoltageProportionalThreshold";
6
+ export declare const PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD = "lowVoltageAbsoluteThreshold";
7
+ export declare const PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD = "highVoltageProportionalThreshold";
8
+ export declare const PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD = "highVoltageAbsoluteThreshold";
@@ -0,0 +1,18 @@
1
+ const PROVIDER = "provider";
2
+ const VOLTAGE_LEVEL = "voltageLevel";
3
+ const PARAM_SA_PROVIDER = "provider";
4
+ const PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD = "flowProportionalThreshold";
5
+ const PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD = "lowVoltageProportionalThreshold";
6
+ const PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD = "lowVoltageAbsoluteThreshold";
7
+ const PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD = "highVoltageProportionalThreshold";
8
+ const PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD = "highVoltageAbsoluteThreshold";
9
+ export {
10
+ PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD,
11
+ PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD,
12
+ PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD,
13
+ PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD,
14
+ PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD,
15
+ PARAM_SA_PROVIDER,
16
+ PROVIDER,
17
+ VOLTAGE_LEVEL
18
+ };
@@ -0,0 +1,15 @@
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 './computing-type';
8
+ export * from './constant';
9
+ export * from './line-separator';
10
+ export * from './parameters';
11
+ export * from './parameters-creation-dialog';
12
+ export * from './ProviderParam';
13
+ export * from './widget';
14
+ export * from './voltage-level-table';
15
+ export * from './limitreductions';
@@ -0,0 +1,61 @@
1
+ import { ComputingType, formatComputingTypeLabel, isValidComputingType } from "./computing-type.js";
2
+ 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 "./constant.js";
3
+ import { LineSeparator } from "./line-separator.js";
4
+ import { LabelledButton, SwitchWithLabel, TabPanel } from "./parameters.js";
5
+ import { CreateParameterDialog } from "./parameters-creation-dialog.js";
6
+ import { ProviderParam } from "./ProviderParam.js";
7
+ import { ParameterFloat } from "./widget/parameter-float.js";
8
+ import { ParameterGroup } from "./widget/parameter-group.js";
9
+ import { ParameterLineDirectoryItemsInput } from "./widget/parameter-line-directory-items-input.js";
10
+ import { ParameterLineSlider, sanitizePercentageValue } from "./widget/parameter-line-slider.js";
11
+ import { ParameterSwitch } from "./widget/parameter-switch.js";
12
+ import { CustomVoltageLevelTable } from "./voltage-level-table/custom-voltage-level-table.js";
13
+ import { CustomVoltageLevelTableCell } from "./voltage-level-table/custom-voltage-level-table-cell.js";
14
+ import { CustomVoltageLevelTableRow } from "./voltage-level-table/custom-voltage-level-table-row.js";
15
+ import { COLUMNS_DEFINITIONS_LIMIT_REDUCTIONS, IST_FORM, LIMIT_DURATION_FORM, LIMIT_REDUCTIONS_FORM, TAB_INFO, TabValues, VOLTAGE_LEVELS_FORM, getLimitReductionsFormSchema, getSAParametersFromSchema } from "./limitreductions/columns-definitions.js";
16
+ import { toFormValueSaParameters, toFormValuesLimitReductions } from "./limitreductions/limit-reductions-form-util.js";
17
+ import { LimitReductionsTableForm } from "./limitreductions/limit-reductions-table-form.js";
18
+ import { LimitReductionTableRow } from "./limitreductions/limit-reduction-table-row.js";
19
+ import { LimitReductionTableCell } from "./limitreductions/limit-reduction-table-cell.js";
20
+ export {
21
+ COLUMNS_DEFINITIONS_LIMIT_REDUCTIONS,
22
+ ComputingType,
23
+ CreateParameterDialog,
24
+ CustomVoltageLevelTable,
25
+ CustomVoltageLevelTableCell,
26
+ CustomVoltageLevelTableRow,
27
+ IST_FORM,
28
+ LIMIT_DURATION_FORM,
29
+ LIMIT_REDUCTIONS_FORM,
30
+ LabelledButton,
31
+ LimitReductionTableCell,
32
+ LimitReductionTableRow,
33
+ LimitReductionsTableForm,
34
+ LineSeparator,
35
+ PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD,
36
+ PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD,
37
+ PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD,
38
+ PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD,
39
+ PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD,
40
+ PARAM_SA_PROVIDER,
41
+ PROVIDER,
42
+ ParameterFloat,
43
+ ParameterGroup,
44
+ ParameterLineDirectoryItemsInput,
45
+ ParameterLineSlider,
46
+ ParameterSwitch,
47
+ ProviderParam,
48
+ SwitchWithLabel,
49
+ TAB_INFO,
50
+ TabPanel,
51
+ TabValues,
52
+ VOLTAGE_LEVEL,
53
+ VOLTAGE_LEVELS_FORM,
54
+ formatComputingTypeLabel,
55
+ getLimitReductionsFormSchema,
56
+ getSAParametersFromSchema,
57
+ isValidComputingType,
58
+ sanitizePercentageValue,
59
+ toFormValueSaParameters,
60
+ toFormValuesLimitReductions
61
+ };
@@ -0,0 +1,77 @@
1
+ import { UUID } from 'crypto';
2
+ import { default as yup } from '../../../../utils/yupConfig';
3
+ 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 } from '../constant';
4
+ export declare const LIMIT_REDUCTIONS_FORM = "limitReductionsForm";
5
+ export declare const VOLTAGE_LEVELS_FORM = "voltageLevelsForm";
6
+ export declare const IST_FORM = "istForm";
7
+ export declare const LIMIT_DURATION_FORM = "limitReductionForm";
8
+ export interface IVoltageLevel {
9
+ nominalV: number;
10
+ lowBound: number;
11
+ highBound: number;
12
+ }
13
+ export interface ILimitDuration {
14
+ lowBound: number;
15
+ lowClosed: boolean;
16
+ highBound: number;
17
+ highClosed: boolean;
18
+ }
19
+ export interface ITemporaryLimitReduction {
20
+ reduction: number;
21
+ limitDuration: ILimitDuration;
22
+ }
23
+ export interface ILimitReductionsByVoltageLevel {
24
+ voltageLevel: IVoltageLevel;
25
+ permanentLimitReduction: number;
26
+ temporaryLimitReductions: ITemporaryLimitReduction[];
27
+ }
28
+ export interface ISAParameters {
29
+ uuid?: UUID;
30
+ [PARAM_SA_PROVIDER]: string;
31
+ limitReductions: ILimitReductionsByVoltageLevel[];
32
+ [PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD]: number;
33
+ [PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD]: number;
34
+ [PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD]: number;
35
+ [PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD]: number;
36
+ [PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD]: number;
37
+ }
38
+ export declare enum TabValues {
39
+ 'General' = 0,
40
+ 'LimitReductions' = 1
41
+ }
42
+ export declare const TAB_INFO: {
43
+ label: string;
44
+ developerModeOnly: boolean;
45
+ }[];
46
+ export interface IColumnsDef {
47
+ label: string;
48
+ dataKey: string;
49
+ tooltip: string;
50
+ width?: string;
51
+ }
52
+ export declare const COLUMNS_DEFINITIONS_LIMIT_REDUCTIONS: IColumnsDef[];
53
+ export declare const getLimitReductionsFormSchema: (nbTemporaryLimits: number) => yup.ObjectSchema<{
54
+ limitReductionsForm: {
55
+ voltageLevelsForm?: string | undefined;
56
+ istForm: number;
57
+ }[] | undefined;
58
+ }, yup.AnyObject, {
59
+ limitReductionsForm: "";
60
+ }, "">;
61
+ export declare const getSAParametersFromSchema: (limitReductions?: ILimitReductionsByVoltageLevel[]) => yup.ObjectSchema<{
62
+ flowProportionalThreshold: unknown;
63
+ lowVoltageProportionalThreshold: unknown;
64
+ lowVoltageAbsoluteThreshold: unknown;
65
+ highVoltageProportionalThreshold: unknown;
66
+ highVoltageAbsoluteThreshold: unknown;
67
+ limitReductionsForm: unknown;
68
+ provider: unknown;
69
+ }, yup.AnyObject, {
70
+ flowProportionalThreshold: undefined;
71
+ lowVoltageProportionalThreshold: undefined;
72
+ lowVoltageAbsoluteThreshold: undefined;
73
+ highVoltageProportionalThreshold: undefined;
74
+ highVoltageAbsoluteThreshold: undefined;
75
+ limitReductionsForm: undefined;
76
+ provider: undefined;
77
+ }, "">;
@@ -0,0 +1,83 @@
1
+ import "../../../../utils/yupConfig.js";
2
+ import { PARAM_SA_PROVIDER, 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_FLOW_PROPORTIONAL_THRESHOLD } from "../constant.js";
3
+ import * as yup from "yup";
4
+ const LIMIT_REDUCTIONS_FORM = "limitReductionsForm";
5
+ const VOLTAGE_LEVELS_FORM = "voltageLevelsForm";
6
+ const IST_FORM = "istForm";
7
+ const LIMIT_DURATION_FORM = "limitReductionForm";
8
+ var TabValues = /* @__PURE__ */ ((TabValues2) => {
9
+ TabValues2[TabValues2["General"] = 0] = "General";
10
+ TabValues2[TabValues2["LimitReductions"] = 1] = "LimitReductions";
11
+ return TabValues2;
12
+ })(TabValues || {});
13
+ const TAB_INFO = [
14
+ { label: TabValues[
15
+ 0
16
+ /* General */
17
+ ], developerModeOnly: false },
18
+ { label: TabValues[
19
+ 1
20
+ /* LimitReductions */
21
+ ], developerModeOnly: false }
22
+ ];
23
+ const COLUMNS_DEFINITIONS_LIMIT_REDUCTIONS = [
24
+ {
25
+ label: "voltageRange",
26
+ dataKey: VOLTAGE_LEVELS_FORM,
27
+ tooltip: "voltageRange"
28
+ },
29
+ {
30
+ label: "IST",
31
+ dataKey: IST_FORM,
32
+ tooltip: "IST"
33
+ }
34
+ ];
35
+ const getLimitDurationsFormSchema = (nbLimits) => {
36
+ const limitDurationsFormSchema = {};
37
+ for (let i = 0; i < nbLimits; i++) {
38
+ limitDurationsFormSchema[LIMIT_DURATION_FORM + i] = yup.number().min(0, "RealPercentage").max(1, "RealPercentage").nullable().required();
39
+ }
40
+ return limitDurationsFormSchema;
41
+ };
42
+ const getLimitReductionsFormSchema = (nbTemporaryLimits) => {
43
+ return yup.object().shape({
44
+ [LIMIT_REDUCTIONS_FORM]: yup.array().of(
45
+ yup.object().shape({
46
+ [VOLTAGE_LEVELS_FORM]: yup.string(),
47
+ [IST_FORM]: yup.number().min(0, "RealPercentage").max(1, "RealPercentage").nullable().required(),
48
+ ...getLimitDurationsFormSchema(nbTemporaryLimits)
49
+ })
50
+ )
51
+ }).required();
52
+ };
53
+ const getSAParametersFromSchema = (limitReductions) => {
54
+ const providerSchema = yup.object().shape({
55
+ [PARAM_SA_PROVIDER]: yup.string().required()
56
+ });
57
+ const limitReductionsSchema = getLimitReductionsFormSchema(
58
+ (limitReductions == null ? void 0 : limitReductions.length) ? limitReductions[0].temporaryLimitReductions.length : 0
59
+ );
60
+ const thresholdsSchema = yup.object().shape({
61
+ [PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD]: yup.number().min(0, "NormalizedPercentage").max(100, "NormalizedPercentage").required(),
62
+ [PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD]: yup.number().min(0, "NormalizedPercentage").max(100, "NormalizedPercentage").required(),
63
+ [PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD]: yup.number().required(),
64
+ [PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD]: yup.number().min(0, "NormalizedPercentage").max(100, "NormalizedPercentage").required(),
65
+ [PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD]: yup.number().required()
66
+ });
67
+ return yup.object().shape({
68
+ ...providerSchema.fields,
69
+ ...limitReductionsSchema.fields,
70
+ ...thresholdsSchema.fields
71
+ });
72
+ };
73
+ export {
74
+ COLUMNS_DEFINITIONS_LIMIT_REDUCTIONS,
75
+ IST_FORM,
76
+ LIMIT_DURATION_FORM,
77
+ LIMIT_REDUCTIONS_FORM,
78
+ TAB_INFO,
79
+ TabValues,
80
+ VOLTAGE_LEVELS_FORM,
81
+ getLimitReductionsFormSchema,
82
+ getSAParametersFromSchema
83
+ };
@@ -0,0 +1,11 @@
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 https://mozilla.org/MPL/2.0/.
6
+ */
7
+ export * from './columns-definitions';
8
+ export * from './limit-reductions-form-util';
9
+ export * from './limit-reductions-table-form';
10
+ export * from './limit-reduction-table-row';
11
+ export * from './limit-reduction-table-cell';
@@ -0,0 +1,21 @@
1
+ import { COLUMNS_DEFINITIONS_LIMIT_REDUCTIONS, IST_FORM, LIMIT_DURATION_FORM, LIMIT_REDUCTIONS_FORM, TAB_INFO, TabValues, VOLTAGE_LEVELS_FORM, getLimitReductionsFormSchema, getSAParametersFromSchema } from "./columns-definitions.js";
2
+ import { toFormValueSaParameters, toFormValuesLimitReductions } from "./limit-reductions-form-util.js";
3
+ import { LimitReductionsTableForm } from "./limit-reductions-table-form.js";
4
+ import { LimitReductionTableRow } from "./limit-reduction-table-row.js";
5
+ import { LimitReductionTableCell } from "./limit-reduction-table-cell.js";
6
+ export {
7
+ COLUMNS_DEFINITIONS_LIMIT_REDUCTIONS,
8
+ IST_FORM,
9
+ LIMIT_DURATION_FORM,
10
+ LIMIT_REDUCTIONS_FORM,
11
+ LimitReductionTableCell,
12
+ LimitReductionTableRow,
13
+ LimitReductionsTableForm,
14
+ TAB_INFO,
15
+ TabValues,
16
+ VOLTAGE_LEVELS_FORM,
17
+ getLimitReductionsFormSchema,
18
+ getSAParametersFromSchema,
19
+ toFormValueSaParameters,
20
+ toFormValuesLimitReductions
21
+ };
@@ -0,0 +1,5 @@
1
+ import { IColumnsDef } from './columns-definitions';
2
+ export declare function LimitReductionTableCell({ rowIndex, column }: Readonly<{
3
+ rowIndex: number;
4
+ column: IColumnsDef;
5
+ }>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,38 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { TableCell } from "@mui/material";
3
+ import { VOLTAGE_LEVELS_FORM, LIMIT_REDUCTIONS_FORM } from "./columns-definitions.js";
4
+ import "react-intl";
5
+ import "@mui/icons-material";
6
+ import "react";
7
+ import "react-hook-form";
8
+ import { RawReadOnlyInput } from "../../../inputs/reactHookForm/RawReadOnlyInput.js";
9
+ import "../../../inputs/reactHookForm/provider/CustomFormProvider.js";
10
+ import "yup";
11
+ import "notistack";
12
+ import "../../../overflowableText/OverflowableText.js";
13
+ import "../../../treeViewFinder/TreeViewFinder.js";
14
+ import "../../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
15
+ import "../../../customAGGrid/customAggrid.js";
16
+ import "ag-grid-community";
17
+ import "react-papaparse";
18
+ import "react-csv-downloader";
19
+ import { FloatInput } from "../../../inputs/reactHookForm/numbers/FloatInput.js";
20
+ import "../../../inputs/reactHookForm/numbers/RangeInput.js";
21
+ import "localized-countries";
22
+ import "localized-countries/data/fr";
23
+ import "localized-countries/data/en";
24
+ import "../../../../utils/conversionUtils.js";
25
+ import "../../../../utils/types/equipmentType.js";
26
+ import "../../../../utils/yupConfig.js";
27
+ import "@react-querybuilder/material";
28
+ import "../../../filter/expert/expertFilterConstants.js";
29
+ import "../../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
30
+ import "uuid";
31
+ import "../../../inputs/reactQueryBuilder/PropertyValueEditor.js";
32
+ import "react-querybuilder";
33
+ function LimitReductionTableCell({ rowIndex, column }) {
34
+ return /* @__PURE__ */ jsx(TableCell, { sx: { fontWeight: "bold" }, children: column.dataKey === VOLTAGE_LEVELS_FORM ? /* @__PURE__ */ jsx(RawReadOnlyInput, { name: `${LIMIT_REDUCTIONS_FORM}[${rowIndex}].${column.dataKey}` }) : /* @__PURE__ */ jsx(FloatInput, { name: `${LIMIT_REDUCTIONS_FORM}[${rowIndex}].${column.dataKey}` }) });
35
+ }
36
+ export {
37
+ LimitReductionTableCell
38
+ };
@@ -0,0 +1,7 @@
1
+ import { IColumnsDef } from './columns-definitions';
2
+ interface TableRowComponentProps {
3
+ columnsDefinition: IColumnsDef[];
4
+ index: number;
5
+ }
6
+ export declare function LimitReductionTableRow({ columnsDefinition, index }: Readonly<TableRowComponentProps>): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,9 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { TableRow } from "@mui/material";
3
+ import { LimitReductionTableCell } from "./limit-reduction-table-cell.js";
4
+ function LimitReductionTableRow({ columnsDefinition, index }) {
5
+ return /* @__PURE__ */ jsx(TableRow, { children: columnsDefinition.map((column) => /* @__PURE__ */ jsx(LimitReductionTableCell, { rowIndex: index, column }, `${column.dataKey}`)) });
6
+ }
7
+ export {
8
+ LimitReductionTableRow
9
+ };
@@ -0,0 +1,29 @@
1
+ import { ILimitReductionsByVoltageLevel, ISAParameters } from './columns-definitions';
2
+ export declare const toFormValuesLimitReductions: (limits: ILimitReductionsByVoltageLevel[]) => {
3
+ limitReductionsForm?: undefined;
4
+ } | {
5
+ limitReductionsForm: {
6
+ voltageLevelsForm: string;
7
+ istForm: number;
8
+ }[];
9
+ };
10
+ export declare const toFormValueSaParameters: (params: ISAParameters) => {
11
+ flowProportionalThreshold: number;
12
+ lowVoltageProportionalThreshold: number;
13
+ lowVoltageAbsoluteThreshold: number;
14
+ highVoltageProportionalThreshold: number;
15
+ highVoltageAbsoluteThreshold: number;
16
+ limitReductionsForm?: undefined;
17
+ provider: string;
18
+ } | {
19
+ flowProportionalThreshold: number;
20
+ lowVoltageProportionalThreshold: number;
21
+ lowVoltageAbsoluteThreshold: number;
22
+ highVoltageProportionalThreshold: number;
23
+ highVoltageAbsoluteThreshold: number;
24
+ limitReductionsForm: {
25
+ voltageLevelsForm: string;
26
+ istForm: number;
27
+ }[];
28
+ provider: string;
29
+ };
@@ -0,0 +1,27 @@
1
+ import { LIMIT_REDUCTIONS_FORM, IST_FORM, VOLTAGE_LEVELS_FORM, LIMIT_DURATION_FORM } from "./columns-definitions.js";
2
+ import { 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_FLOW_PROPORTIONAL_THRESHOLD, PARAM_SA_PROVIDER } from "../constant.js";
3
+ const toFormValuesFromTemporaryLimits = (limits) => limits.reduce((acc, limit, index) => {
4
+ acc[LIMIT_DURATION_FORM + index] = limit.reduction;
5
+ return acc;
6
+ }, {});
7
+ const toFormValuesLimitReductions = (limits) => !limits ? {} : {
8
+ [LIMIT_REDUCTIONS_FORM]: limits.map((vlLimits) => ({
9
+ [VOLTAGE_LEVELS_FORM]: `${vlLimits.voltageLevel.nominalV} kV`,
10
+ [IST_FORM]: vlLimits.permanentLimitReduction,
11
+ ...toFormValuesFromTemporaryLimits(vlLimits.temporaryLimitReductions)
12
+ }))
13
+ };
14
+ const toFormValueSaParameters = (params) => ({
15
+ [PARAM_SA_PROVIDER]: params[PARAM_SA_PROVIDER],
16
+ ...toFormValuesLimitReductions(params == null ? void 0 : params.limitReductions),
17
+ // SA specific form values
18
+ [PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD]: params[PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD] * 100,
19
+ [PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD]: params[PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD] * 100,
20
+ [PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD]: params[PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD],
21
+ [PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD]: params[PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD] * 100,
22
+ [PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD]: params[PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD]
23
+ });
24
+ export {
25
+ toFormValueSaParameters,
26
+ toFormValuesLimitReductions
27
+ };
@@ -0,0 +1,4 @@
1
+ import { ILimitReductionsByVoltageLevel } from './columns-definitions';
2
+ export declare function LimitReductionsTableForm({ limits }: Readonly<{
3
+ limits: ILimitReductionsByVoltageLevel[];
4
+ }>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,87 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useCallback, useMemo } from "react";
3
+ import { useIntl } from "react-intl";
4
+ import { COLUMNS_DEFINITIONS_LIMIT_REDUCTIONS, LIMIT_DURATION_FORM, LIMIT_REDUCTIONS_FORM } from "./columns-definitions.js";
5
+ import { CustomVoltageLevelTable } from "../voltage-level-table/custom-voltage-level-table.js";
6
+ import "@mui/material";
7
+ import "@mui/icons-material";
8
+ import "react-hook-form";
9
+ import "../../../inputs/reactHookForm/provider/CustomFormProvider.js";
10
+ import "yup";
11
+ import "notistack";
12
+ import "../../../overflowableText/OverflowableText.js";
13
+ import "../../../treeViewFinder/TreeViewFinder.js";
14
+ import "../../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
15
+ import "../../../customAGGrid/customAggrid.js";
16
+ import "ag-grid-community";
17
+ import "react-papaparse";
18
+ import "react-csv-downloader";
19
+ import "../../../inputs/reactHookForm/numbers/RangeInput.js";
20
+ import "localized-countries";
21
+ import "localized-countries/data/fr";
22
+ import "localized-countries/data/en";
23
+ import "../../../../utils/conversionUtils.js";
24
+ import "../../../../utils/types/equipmentType.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
+ const getLabelColumn = (limit) => {
33
+ const lowBound = `${Math.trunc(limit.limitDuration.lowBound / 60)} min`;
34
+ const highBoundValue = Math.trunc(limit.limitDuration.highBound / 60);
35
+ const highBound = highBoundValue === 0 ? "∞" : `${Math.trunc(limit.limitDuration.highBound / 60)} min`;
36
+ const lowerBoundClosed = limit.limitDuration.lowClosed ? "[" : "]";
37
+ const highBoundClosed = limit.limitDuration.highClosed || null ? "]" : "[";
38
+ return `${lowerBoundClosed}${lowBound}, ${highBound}${highBoundClosed}`;
39
+ };
40
+ function LimitReductionsTableForm({ limits }) {
41
+ const intl = useIntl();
42
+ const getToolTipColumn = useCallback(
43
+ (limit) => {
44
+ const lowBound = Math.trunc(limit.limitDuration.lowBound / 60);
45
+ const highBound = Math.trunc(limit.limitDuration.highBound / 60);
46
+ if (lowBound === 0) {
47
+ return intl.formatMessage({ id: "LimitDurationAfterIST" }, { value: highBound });
48
+ }
49
+ return intl.formatMessage(
50
+ { id: "LimitDurationInterval" },
51
+ {
52
+ lowBound: `IT${lowBound}`,
53
+ highBound: highBound === 0 ? "IST" : `IT${highBound}`
54
+ }
55
+ );
56
+ },
57
+ [intl]
58
+ );
59
+ const columnsDefinition = useMemo(() => {
60
+ const columnsDef = COLUMNS_DEFINITIONS_LIMIT_REDUCTIONS.map((column) => ({
61
+ ...column,
62
+ label: intl.formatMessage({ id: column.label }),
63
+ tooltip: intl.formatMessage({ id: column.tooltip })
64
+ }));
65
+ if (limits !== null && limits.length > 0) {
66
+ limits[0].temporaryLimitReductions.forEach((tlimit, index) => {
67
+ columnsDef.push({
68
+ label: getLabelColumn(tlimit),
69
+ dataKey: LIMIT_DURATION_FORM + index,
70
+ tooltip: getToolTipColumn(tlimit)
71
+ });
72
+ });
73
+ }
74
+ return columnsDef;
75
+ }, [intl, limits, getToolTipColumn]);
76
+ return /* @__PURE__ */ jsx(
77
+ CustomVoltageLevelTable,
78
+ {
79
+ formName: LIMIT_REDUCTIONS_FORM,
80
+ columnsDefinition,
81
+ tableHeight: 450
82
+ }
83
+ );
84
+ }
85
+ export {
86
+ LimitReductionsTableForm
87
+ };
@@ -0,0 +1 @@
1
+ export declare function LineSeparator(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Grid, Divider } from "@mui/material";
3
+ function LineSeparator() {
4
+ return /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(Divider, {}) });
5
+ }
6
+ export {
7
+ LineSeparator
8
+ };
@@ -0,0 +1,13 @@
1
+ import { FieldValues, UseFormGetValues } from 'react-hook-form';
2
+ import { UUID } from 'crypto';
3
+ import { ElementType } from '../../../utils';
4
+ interface CreateParameterProps<T extends FieldValues> {
5
+ studyUuid: UUID | null;
6
+ open: boolean;
7
+ onClose: () => void;
8
+ parameterValues: UseFormGetValues<T> | any;
9
+ parameterType: ElementType;
10
+ parameterFormatter: (newParams: any) => any;
11
+ }
12
+ export declare function CreateParameterDialog<T extends FieldValues>({ studyUuid, open, onClose, parameterValues, parameterType, parameterFormatter, }: Readonly<CreateParameterProps<T>>): import("react/jsx-runtime").JSX.Element | null;
13
+ export {};