@gridsuite/commons-ui 0.179.0 → 0.181.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.
- package/dist/components/index.js +78 -1
- package/dist/components/inputs/index.js +2 -0
- package/dist/components/inputs/reactHookForm/CheckboxNullableInput.d.ts +15 -0
- package/dist/components/inputs/reactHookForm/CheckboxNullableInput.js +75 -0
- package/dist/components/inputs/reactHookForm/index.d.ts +1 -0
- package/dist/components/inputs/reactHookForm/index.js +2 -0
- package/dist/components/network-modifications/common/connectivity/BranchConnectivityForm.d.ts +7 -0
- package/dist/components/network-modifications/common/connectivity/BranchConnectivityForm.js +63 -0
- package/dist/components/network-modifications/common/connectivity/ConnectivityForm.d.ts +37 -0
- package/dist/components/network-modifications/common/connectivity/ConnectivityForm.js +267 -0
- package/dist/components/network-modifications/common/connectivity/connectivity.type.d.ts +34 -0
- package/dist/components/network-modifications/common/connectivity/connectivity.type.js +1 -0
- package/dist/components/network-modifications/common/connectivity/connectivityForm.utils.d.ts +241 -0
- package/dist/components/network-modifications/common/connectivity/connectivityForm.utils.js +196 -0
- package/dist/components/network-modifications/common/connectivity/index.d.ts +10 -0
- package/dist/components/network-modifications/common/connectivity/index.js +25 -0
- package/dist/components/network-modifications/common/index.d.ts +4 -1
- package/dist/components/network-modifications/common/index.js +56 -1
- package/dist/components/network-modifications/common/measurements/BranchActiveReactivePowerMeasurementsForm.d.ts +2 -0
- package/dist/components/network-modifications/common/measurements/BranchActiveReactivePowerMeasurementsForm.js +37 -0
- package/dist/components/network-modifications/common/measurements/PowerMeasurementsForm.d.ts +9 -0
- package/dist/components/network-modifications/common/measurements/PowerMeasurementsForm.js +52 -0
- package/dist/components/network-modifications/common/measurements/PowerWithValidityForm.d.ts +2 -0
- package/dist/components/network-modifications/common/measurements/PowerWithValidityForm.js +74 -0
- package/dist/components/network-modifications/common/measurements/branchActiveReactivePowerForm.utils.d.ts +56 -0
- package/dist/components/network-modifications/common/measurements/branchActiveReactivePowerForm.utils.js +69 -0
- package/dist/components/network-modifications/common/measurements/index.d.ts +13 -0
- package/dist/components/network-modifications/common/measurements/index.js +26 -0
- package/dist/components/network-modifications/common/measurements/injectionActiveReactivePowerForm.utils.d.ts +58 -0
- package/dist/components/network-modifications/common/measurements/injectionActiveReactivePowerForm.utils.js +55 -0
- package/dist/components/network-modifications/common/measurements/measurement.type.d.ts +13 -0
- package/dist/components/network-modifications/common/measurements/measurement.type.js +1 -0
- package/dist/components/network-modifications/common/measurements/powerWithValidity.utils.d.ts +22 -0
- package/dist/components/network-modifications/common/measurements/powerWithValidity.utils.js +36 -0
- package/dist/components/network-modifications/common/setpoints/SetPointsForm.d.ts +15 -0
- package/dist/components/network-modifications/common/setpoints/SetPointsForm.js +71 -0
- package/dist/components/network-modifications/common/setpoints/index.d.ts +8 -0
- package/dist/components/network-modifications/common/setpoints/index.js +10 -0
- package/dist/components/network-modifications/common/setpoints/setPoints.utils.d.ts +16 -0
- package/dist/components/network-modifications/common/setpoints/setPoints.utils.js +62 -0
- package/dist/components/network-modifications/index.d.ts +1 -0
- package/dist/components/network-modifications/index.js +76 -1
- package/dist/components/network-modifications/load/common/LoadDialogHeader.d.ts +6 -0
- package/dist/components/network-modifications/load/common/LoadDialogHeader.js +100 -0
- package/dist/components/network-modifications/load/common/LoadDialogTabs.d.ts +14 -0
- package/dist/components/network-modifications/load/common/LoadDialogTabs.js +49 -0
- package/dist/components/network-modifications/load/common/LoadDialogTabsContent.d.ts +8 -0
- package/dist/components/network-modifications/load/common/LoadDialogTabsContent.js +61 -0
- package/dist/components/network-modifications/load/common/LoadForm.d.ts +6 -0
- package/dist/components/network-modifications/load/common/LoadForm.js +65 -0
- package/dist/components/network-modifications/load/common/index.d.ts +12 -0
- package/dist/components/network-modifications/load/common/index.js +12 -0
- package/dist/components/network-modifications/load/common/load.types.d.ts +16 -0
- package/dist/components/network-modifications/load/common/load.types.js +1 -0
- package/dist/components/network-modifications/load/common/load.utils.d.ts +11 -0
- package/dist/components/network-modifications/load/common/load.utils.js +8 -0
- package/dist/components/network-modifications/load/creation/index.d.ts +8 -0
- package/dist/components/network-modifications/load/creation/index.js +7 -0
- package/dist/components/network-modifications/load/creation/loadCreation.types.d.ts +16 -0
- package/dist/components/network-modifications/load/creation/loadCreation.types.js +1 -0
- package/dist/components/network-modifications/load/creation/loadCreation.utils.d.ts +53 -0
- package/dist/components/network-modifications/load/creation/loadCreation.utils.js +98 -0
- package/dist/components/network-modifications/load/index.d.ts +9 -0
- package/dist/components/network-modifications/load/index.js +22 -0
- package/dist/components/network-modifications/load/modification/index.d.ts +8 -0
- package/dist/components/network-modifications/load/modification/index.js +7 -0
- package/dist/components/network-modifications/load/modification/loadModification.types.d.ts +21 -0
- package/dist/components/network-modifications/load/modification/loadModification.types.js +1 -0
- package/dist/components/network-modifications/load/modification/loadModification.utils.d.ts +69 -0
- package/dist/components/network-modifications/load/modification/loadModification.utils.js +106 -0
- package/dist/components/network-modifications/substation/creation/substationCreation.utils.js +2 -1
- package/dist/components/network-modifications/voltage-level/index.d.ts +1 -0
- package/dist/components/network-modifications/voltage-level/voltage-level.type.d.ts +12 -0
- package/dist/components/network-modifications/voltage-level/voltage-level.type.js +1 -0
- package/dist/index.js +88 -3
- package/dist/translations/en/networkModificationsEn.d.ts +22 -0
- package/dist/translations/en/networkModificationsEn.js +23 -1
- package/dist/translations/fr/networkModificationsFr.d.ts +22 -0
- package/dist/translations/fr/networkModificationsFr.js +23 -1
- package/dist/utils/constants/fieldConstants.d.ts +24 -1
- package/dist/utils/constants/fieldConstants.js +24 -1
- package/dist/utils/index.js +10 -2
- package/dist/utils/ts-utils.d.ts +5 -6
- package/dist/utils/ts-utils.js +11 -0
- package/dist/utils/types/equipmentType.d.ts +18 -0
- package/dist/utils/types/equipmentType.js +27 -1
- package/dist/utils/types/index.js +8 -2
- package/package.json +1 -1
package/dist/utils/index.js
CHANGED
|
@@ -21,7 +21,7 @@ import { CustomError } from "./types/CustomError.js";
|
|
|
21
21
|
import { ProblemDetailError } from "./types/ProblemDetailError.js";
|
|
22
22
|
import { NetworkTimeoutError } from "./types/NetworkTimeoutError.js";
|
|
23
23
|
import { ElementType } from "./types/elementType.js";
|
|
24
|
-
import { ALL_EQUIPMENTS, BASE_EQUIPMENTS, EquipmentType, ExtendedEquipmentType, HvdcType, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./types/equipmentType.js";
|
|
24
|
+
import { ALL_EQUIPMENTS, BASE_EQUIPMENTS, CONNECTION_DIRECTIONS, EquipmentType, ExtendedEquipmentType, HvdcType, LOAD_TYPES, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, UNDEFINED_CONNECTION_DIRECTION, UNDEFINED_LOAD_TYPE, VL_TAG_MAX_SIZE, equipmentStyles, getConnectionDirectionLabel, getEquipmentsInfosForSearchBar, getLoadTypeLabel } from "./types/equipmentType.js";
|
|
25
25
|
import { Battery, BusBar, DanglingLine, Generator, Hvdc, LCC, Line, Load, SVC, ShuntCompensator, Substation, ThreeWindingTransfo, TwoWindingTransfo, VSC, VoltageLevel } from "./types/equipmentTypes.js";
|
|
26
26
|
import { AnnouncementSeverity, ArrayAction } from "./types/types.js";
|
|
27
27
|
import { MODIFICATION_TYPES, ModificationType } from "./types/modificationType.js";
|
|
@@ -31,7 +31,7 @@ import { SolverTypeInfos } from "./types/dynamic-simulation.type.js";
|
|
|
31
31
|
import { DistributionType, SensitivityType } from "./types/sensitivity-analysis.type.js";
|
|
32
32
|
import { CalculationType, LoadModelsRule } from "./types/dynamic-margin-calculation.type.js";
|
|
33
33
|
import { OperationType } from "./types/network-modification-types.js";
|
|
34
|
-
import { getIdOrSelf, notNull, notUndefined, parseIntData, removeNullFields, sanitizeString } from "./ts-utils.js";
|
|
34
|
+
import { areIdsEqual, getIdOrSelf, getObjectId, notNull, notUndefined, parseIntData, removeNullFields, sanitizeString } from "./ts-utils.js";
|
|
35
35
|
import { toNumber, validateValueIsANumber } from "./validation-functions.js";
|
|
36
36
|
import "./yupConfig.js";
|
|
37
37
|
import * as yup from "yup";
|
|
@@ -47,6 +47,7 @@ export {
|
|
|
47
47
|
BusBar,
|
|
48
48
|
COMMON_APP_NAME,
|
|
49
49
|
COMMON_CONFIG_PARAMS_NAMES,
|
|
50
|
+
CONNECTION_DIRECTIONS,
|
|
50
51
|
CalculationType,
|
|
51
52
|
CustomError,
|
|
52
53
|
DARK_THEME,
|
|
@@ -79,6 +80,7 @@ export {
|
|
|
79
80
|
LAST_SELECTED_DIRECTORY,
|
|
80
81
|
LCC,
|
|
81
82
|
LIGHT_THEME,
|
|
83
|
+
LOAD_TYPES,
|
|
82
84
|
Line,
|
|
83
85
|
Load,
|
|
84
86
|
LoadModelsRule,
|
|
@@ -119,12 +121,15 @@ export {
|
|
|
119
121
|
TYPE_TAG_MAX_SIZE,
|
|
120
122
|
ThreeWindingTransfo,
|
|
121
123
|
TwoWindingTransfo,
|
|
124
|
+
UNDEFINED_CONNECTION_DIRECTION,
|
|
125
|
+
UNDEFINED_LOAD_TYPE,
|
|
122
126
|
VL_TAG_MAX_SIZE,
|
|
123
127
|
VSC,
|
|
124
128
|
VoltageAdornment,
|
|
125
129
|
VoltageLevel,
|
|
126
130
|
YUP_REQUIRED,
|
|
127
131
|
areArrayElementsUnique,
|
|
132
|
+
areIdsEqual,
|
|
128
133
|
arraysContainIdenticalStrings,
|
|
129
134
|
catchErrorHandler,
|
|
130
135
|
convertInputValue,
|
|
@@ -134,10 +139,13 @@ export {
|
|
|
134
139
|
equipmentStyles,
|
|
135
140
|
equipmentTypesForPredefinedPropertiesMapper,
|
|
136
141
|
extractErrorMessageDescriptor,
|
|
142
|
+
getConnectionDirectionLabel,
|
|
137
143
|
getEquipmentTypeShortLabel,
|
|
138
144
|
getEquipmentsInfosForSearchBar,
|
|
139
145
|
getFileIcon,
|
|
140
146
|
getIdOrSelf,
|
|
147
|
+
getLoadTypeLabel,
|
|
148
|
+
getObjectId,
|
|
141
149
|
isBlankOrEmpty,
|
|
142
150
|
isEmpty,
|
|
143
151
|
isObjectEmpty,
|
package/dist/utils/ts-utils.d.ts
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Copyright (c) 2024, 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
|
-
*/
|
|
1
|
+
import { Option } from './types';
|
|
7
2
|
export type Nullable<T> = {
|
|
8
3
|
[K in keyof T]: T[K] | null;
|
|
9
4
|
};
|
|
@@ -16,3 +11,7 @@ export declare function removeNullFields<T extends Record<string, any>>(data: T)
|
|
|
16
11
|
export declare function parseIntData(val: string | number, defaultValue: string | number): string | number;
|
|
17
12
|
export declare function sanitizeString(val: string | null | undefined): string | null;
|
|
18
13
|
export declare const getIdOrSelf: (e: any) => any;
|
|
14
|
+
export declare const areIdsEqual: (val1: Option, val2: Option) => boolean;
|
|
15
|
+
export declare const getObjectId: (object: string | {
|
|
16
|
+
id: string;
|
|
17
|
+
}) => string;
|
package/dist/utils/ts-utils.js
CHANGED
|
@@ -27,8 +27,19 @@ function sanitizeString(val) {
|
|
|
27
27
|
return trimmedValue === void 0 || trimmedValue === "" ? null : trimmedValue;
|
|
28
28
|
}
|
|
29
29
|
const getIdOrSelf = (e) => e?.id ?? e;
|
|
30
|
+
const areIdsEqual = (val1, val2) => {
|
|
31
|
+
if (typeof val1 !== "string" && typeof val2 !== "string") {
|
|
32
|
+
return val1.id === val2.id;
|
|
33
|
+
}
|
|
34
|
+
return val1 === val2;
|
|
35
|
+
};
|
|
36
|
+
const getObjectId = (object) => {
|
|
37
|
+
return typeof object === "string" ? object : object?.id ?? null;
|
|
38
|
+
};
|
|
30
39
|
export {
|
|
40
|
+
areIdsEqual,
|
|
31
41
|
getIdOrSelf,
|
|
42
|
+
getObjectId,
|
|
32
43
|
notNull,
|
|
33
44
|
notUndefined,
|
|
34
45
|
parseIntData,
|
|
@@ -67,6 +67,24 @@ export declare enum HvdcType {
|
|
|
67
67
|
LCC = "LCC",
|
|
68
68
|
VSC = "VSC"
|
|
69
69
|
}
|
|
70
|
+
export declare const LOAD_TYPES: {
|
|
71
|
+
id: string;
|
|
72
|
+
label: string;
|
|
73
|
+
}[];
|
|
74
|
+
export declare const UNDEFINED_LOAD_TYPE = "UNDEFINED";
|
|
75
|
+
export declare function getLoadTypeLabel(loadTypeId: string): string | undefined;
|
|
76
|
+
export declare const UNDEFINED_CONNECTION_DIRECTION = "UNDEFINED";
|
|
77
|
+
export declare const CONNECTION_DIRECTIONS: readonly [{
|
|
78
|
+
readonly id: "TOP";
|
|
79
|
+
readonly label: "Top";
|
|
80
|
+
}, {
|
|
81
|
+
readonly id: "BOTTOM";
|
|
82
|
+
readonly label: "Bottom";
|
|
83
|
+
}, {
|
|
84
|
+
readonly id: "UNDEFINED";
|
|
85
|
+
readonly label: "Undefined";
|
|
86
|
+
}];
|
|
87
|
+
export declare function getConnectionDirectionLabel(connectionDirectionId: string | null | undefined): "Top" | "Bottom" | "Undefined" | undefined;
|
|
70
88
|
export declare enum ExtendedEquipmentType {
|
|
71
89
|
HVDC_LINE_LCC = "HVDC_LINE_LCC",
|
|
72
90
|
HVDC_LINE_VSC = "HVDC_LINE_VSC"
|
|
@@ -63,6 +63,26 @@ var HvdcType = /* @__PURE__ */ ((HvdcType2) => {
|
|
|
63
63
|
HvdcType2["VSC"] = "VSC";
|
|
64
64
|
return HvdcType2;
|
|
65
65
|
})(HvdcType || {});
|
|
66
|
+
const LOAD_TYPES = [
|
|
67
|
+
{ id: "AUXILIARY", label: "Auxiliary" },
|
|
68
|
+
{ id: "FICTITIOUS", label: "Fictitious" }
|
|
69
|
+
];
|
|
70
|
+
const UNDEFINED_LOAD_TYPE = "UNDEFINED";
|
|
71
|
+
function getLoadTypeLabel(loadTypeId) {
|
|
72
|
+
return LOAD_TYPES.find(({ id }) => id === loadTypeId)?.label;
|
|
73
|
+
}
|
|
74
|
+
const UNDEFINED_CONNECTION_DIRECTION = "UNDEFINED";
|
|
75
|
+
const CONNECTION_DIRECTIONS = [
|
|
76
|
+
{ id: "TOP", label: "Top" },
|
|
77
|
+
{ id: "BOTTOM", label: "Bottom" },
|
|
78
|
+
{ id: UNDEFINED_CONNECTION_DIRECTION, label: "Undefined" }
|
|
79
|
+
];
|
|
80
|
+
function getConnectionDirectionLabel(connectionDirectionId) {
|
|
81
|
+
if (connectionDirectionId === UNDEFINED_CONNECTION_DIRECTION) {
|
|
82
|
+
return "Undefined";
|
|
83
|
+
}
|
|
84
|
+
return CONNECTION_DIRECTIONS.find(({ id }) => id === connectionDirectionId)?.label;
|
|
85
|
+
}
|
|
66
86
|
var ExtendedEquipmentType = /* @__PURE__ */ ((ExtendedEquipmentType2) => {
|
|
67
87
|
ExtendedEquipmentType2["HVDC_LINE_LCC"] = "HVDC_LINE_LCC";
|
|
68
88
|
ExtendedEquipmentType2["HVDC_LINE_VSC"] = "HVDC_LINE_VSC";
|
|
@@ -375,13 +395,19 @@ function getEquipmentsInfosForSearchBar(equipmentsInfos, getNameOrId) {
|
|
|
375
395
|
export {
|
|
376
396
|
ALL_EQUIPMENTS,
|
|
377
397
|
BASE_EQUIPMENTS,
|
|
398
|
+
CONNECTION_DIRECTIONS,
|
|
378
399
|
EquipmentType,
|
|
379
400
|
ExtendedEquipmentType,
|
|
380
401
|
HvdcType,
|
|
402
|
+
LOAD_TYPES,
|
|
381
403
|
OperatingStatus,
|
|
382
404
|
SEARCH_EQUIPMENTS,
|
|
383
405
|
TYPE_TAG_MAX_SIZE,
|
|
406
|
+
UNDEFINED_CONNECTION_DIRECTION,
|
|
407
|
+
UNDEFINED_LOAD_TYPE,
|
|
384
408
|
VL_TAG_MAX_SIZE,
|
|
385
409
|
equipmentStyles,
|
|
386
|
-
|
|
410
|
+
getConnectionDirectionLabel,
|
|
411
|
+
getEquipmentsInfosForSearchBar,
|
|
412
|
+
getLoadTypeLabel
|
|
387
413
|
};
|
|
@@ -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, EquipmentType, ExtendedEquipmentType, HvdcType, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./equipmentType.js";
|
|
5
|
+
import { ALL_EQUIPMENTS, BASE_EQUIPMENTS, CONNECTION_DIRECTIONS, EquipmentType, ExtendedEquipmentType, HvdcType, LOAD_TYPES, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, UNDEFINED_CONNECTION_DIRECTION, UNDEFINED_LOAD_TYPE, VL_TAG_MAX_SIZE, equipmentStyles, getConnectionDirectionLabel, getEquipmentsInfosForSearchBar, getLoadTypeLabel } from "./equipmentType.js";
|
|
6
6
|
import { Battery, BusBar, DanglingLine, Generator, Hvdc, LCC, Line, Load, SVC, ShuntCompensator, Substation, ThreeWindingTransfo, TwoWindingTransfo, VSC, VoltageLevel } from "./equipmentTypes.js";
|
|
7
7
|
import { AnnouncementSeverity, ArrayAction } from "./types.js";
|
|
8
8
|
import { MODIFICATION_TYPES, ModificationType } from "./modificationType.js";
|
|
@@ -19,6 +19,7 @@ export {
|
|
|
19
19
|
BASE_EQUIPMENTS,
|
|
20
20
|
Battery,
|
|
21
21
|
BusBar,
|
|
22
|
+
CONNECTION_DIRECTIONS,
|
|
22
23
|
CalculationType,
|
|
23
24
|
CustomError,
|
|
24
25
|
DanglingLine,
|
|
@@ -31,6 +32,7 @@ export {
|
|
|
31
32
|
Hvdc,
|
|
32
33
|
HvdcType,
|
|
33
34
|
LCC,
|
|
35
|
+
LOAD_TYPES,
|
|
34
36
|
Line,
|
|
35
37
|
Load,
|
|
36
38
|
LoadModelsRule,
|
|
@@ -50,9 +52,13 @@ export {
|
|
|
50
52
|
TYPE_TAG_MAX_SIZE,
|
|
51
53
|
ThreeWindingTransfo,
|
|
52
54
|
TwoWindingTransfo,
|
|
55
|
+
UNDEFINED_CONNECTION_DIRECTION,
|
|
56
|
+
UNDEFINED_LOAD_TYPE,
|
|
53
57
|
VL_TAG_MAX_SIZE,
|
|
54
58
|
VSC,
|
|
55
59
|
VoltageLevel,
|
|
56
60
|
equipmentStyles,
|
|
57
|
-
|
|
61
|
+
getConnectionDirectionLabel,
|
|
62
|
+
getEquipmentsInfosForSearchBar,
|
|
63
|
+
getLoadTypeLabel
|
|
58
64
|
};
|