@gridsuite/commons-ui 0.104.2 → 0.105.1
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/inputs/reactHookForm/autocompleteInputs/AutocompleteInput.js +4 -2
- package/dist/hooks/useModificationLabelComputer.js +1 -1
- package/dist/translations/en/networkModificationsEn.d.ts +2 -1
- package/dist/translations/en/networkModificationsEn.js +2 -1
- package/dist/translations/fr/networkModificationsFr.d.ts +2 -1
- package/dist/translations/fr/networkModificationsFr.js +2 -1
- package/dist/utils/types/modificationType.d.ts +6 -2
- package/dist/utils/types/modificationType.js +9 -4
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
2
3
|
import { Autocomplete, TextField } from "@mui/material";
|
|
3
4
|
import { useController } from "react-hook-form";
|
|
4
5
|
import { identity, genHelperError, isFieldRequired } from "../utils/functions.js";
|
|
@@ -44,10 +45,11 @@ function AutocompleteInput({
|
|
|
44
45
|
}
|
|
45
46
|
onChange(outputTransform(newValue));
|
|
46
47
|
};
|
|
48
|
+
const selectedValues = useMemo(() => inputTransform(value), [inputTransform, value]);
|
|
47
49
|
return /* @__PURE__ */ jsx(
|
|
48
50
|
Autocomplete,
|
|
49
51
|
{
|
|
50
|
-
value:
|
|
52
|
+
value: selectedValues,
|
|
51
53
|
onChange: (_, data) => handleChange(data),
|
|
52
54
|
...allowNewValue && {
|
|
53
55
|
freeSolo: true,
|
|
@@ -70,7 +72,7 @@ function AutocompleteInput({
|
|
|
70
72
|
},
|
|
71
73
|
inputRef: ref,
|
|
72
74
|
inputProps: { ...inputProps, readOnly },
|
|
73
|
-
helperText: /* @__PURE__ */ jsx(
|
|
75
|
+
helperText: previousValue && /* @__PURE__ */ jsx(
|
|
74
76
|
HelperPreviousValue,
|
|
75
77
|
{
|
|
76
78
|
previousValue,
|
|
@@ -51,7 +51,7 @@ const useModificationLabelComputer = () => {
|
|
|
51
51
|
return intl.formatMessage({
|
|
52
52
|
id: `network_modifications.tabular.${modificationMetadata.tabularCreationType}`
|
|
53
53
|
});
|
|
54
|
-
case MODIFICATION_TYPES.
|
|
54
|
+
case MODIFICATION_TYPES.CREATE_COUPLING_DEVICE.type:
|
|
55
55
|
return modificationMetadata.voltageLevelId;
|
|
56
56
|
default:
|
|
57
57
|
return modificationMetadata.equipmentId || "";
|
|
@@ -62,5 +62,6 @@ export declare const networkModificationsEn: {
|
|
|
62
62
|
'network_modifications.STATIC_VAR_COMPENSATOR_CREATION': string;
|
|
63
63
|
'network_modifications.VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION': string;
|
|
64
64
|
'network_modifications.VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION': string;
|
|
65
|
-
'network_modifications.
|
|
65
|
+
'network_modifications.CREATE_COUPLING_DEVICE': string;
|
|
66
|
+
'network_modifications.BALANCES_ADJUSTMENT_MODIFICATION': string;
|
|
66
67
|
};
|
|
@@ -56,7 +56,8 @@ const networkModificationsEn = {
|
|
|
56
56
|
"network_modifications.STATIC_VAR_COMPENSATOR_CREATION": "Creating static var compensator {computedLabel}",
|
|
57
57
|
"network_modifications.VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION": "Creating voltage level {voltageLevelEquipmentId} and substation {substationEquipmentId}",
|
|
58
58
|
"network_modifications.VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION": "Modifying voltage level topology {computedLabel}",
|
|
59
|
-
"network_modifications.
|
|
59
|
+
"network_modifications.CREATE_COUPLING_DEVICE": "Creating a coupling device in voltage level {computedLabel}",
|
|
60
|
+
"network_modifications.BALANCES_ADJUSTMENT_MODIFICATION": "Balances adjustment modification"
|
|
60
61
|
};
|
|
61
62
|
export {
|
|
62
63
|
networkModificationsEn
|
|
@@ -62,5 +62,6 @@ export declare const networkModificationsFr: {
|
|
|
62
62
|
'network_modifications.STATIC_VAR_COMPENSATOR_CREATION': string;
|
|
63
63
|
'network_modifications.VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION': string;
|
|
64
64
|
'network_modifications.VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION': string;
|
|
65
|
-
'network_modifications.
|
|
65
|
+
'network_modifications.CREATE_COUPLING_DEVICE': string;
|
|
66
|
+
'network_modifications.BALANCES_ADJUSTMENT_MODIFICATION': string;
|
|
66
67
|
};
|
|
@@ -56,7 +56,8 @@ const networkModificationsFr = {
|
|
|
56
56
|
"network_modifications.STATIC_VAR_COMPENSATOR_CREATION": "Création de CSPR {computedLabel}",
|
|
57
57
|
"network_modifications.VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION": "Création du poste {voltageLevelEquipmentId} et du site {substationEquipmentId}",
|
|
58
58
|
"network_modifications.VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION": "Modification de la topologie du poste {computedLabel}",
|
|
59
|
-
"network_modifications.
|
|
59
|
+
"network_modifications.CREATE_COUPLING_DEVICE": "Création de couplage / omnibus dans le poste {computedLabel}",
|
|
60
|
+
"network_modifications.BALANCES_ADJUSTMENT_MODIFICATION": "Modification d'équilibrage bilan"
|
|
60
61
|
};
|
|
61
62
|
export {
|
|
62
63
|
networkModificationsFr
|
|
@@ -50,7 +50,8 @@ export declare enum ModificationType {
|
|
|
50
50
|
LCC_CREATION = "LCC_CREATION",
|
|
51
51
|
LCC_MODIFICATION = "LCC_MODIFICATION",
|
|
52
52
|
VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION = "VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION",
|
|
53
|
-
|
|
53
|
+
CREATE_COUPLING_DEVICE = "CREATE_COUPLING_DEVICE",
|
|
54
|
+
BALANCES_ADJUSTMENT = "BALANCES_ADJUSTMENT_MODIFICATION"
|
|
54
55
|
}
|
|
55
56
|
export declare const MODIFICATION_TYPES: {
|
|
56
57
|
GROOVY_SCRIPT: {
|
|
@@ -191,7 +192,10 @@ export declare const MODIFICATION_TYPES: {
|
|
|
191
192
|
VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION: {
|
|
192
193
|
type: ModificationType;
|
|
193
194
|
};
|
|
194
|
-
|
|
195
|
+
CREATE_COUPLING_DEVICE: {
|
|
196
|
+
type: ModificationType;
|
|
197
|
+
};
|
|
198
|
+
BALANCES_ADJUSTMENT: {
|
|
195
199
|
type: ModificationType;
|
|
196
200
|
};
|
|
197
201
|
};
|
|
@@ -44,7 +44,8 @@ var ModificationType = /* @__PURE__ */ ((ModificationType2) => {
|
|
|
44
44
|
ModificationType2["LCC_CREATION"] = "LCC_CREATION";
|
|
45
45
|
ModificationType2["LCC_MODIFICATION"] = "LCC_MODIFICATION";
|
|
46
46
|
ModificationType2["VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION"] = "VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION";
|
|
47
|
-
ModificationType2["
|
|
47
|
+
ModificationType2["CREATE_COUPLING_DEVICE"] = "CREATE_COUPLING_DEVICE";
|
|
48
|
+
ModificationType2["BALANCES_ADJUSTMENT"] = "BALANCES_ADJUSTMENT_MODIFICATION";
|
|
48
49
|
return ModificationType2;
|
|
49
50
|
})(ModificationType || {});
|
|
50
51
|
const MODIFICATION_TYPES = {
|
|
@@ -230,9 +231,13 @@ const MODIFICATION_TYPES = {
|
|
|
230
231
|
type: "VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION"
|
|
231
232
|
/* VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION */
|
|
232
233
|
},
|
|
233
|
-
|
|
234
|
-
type: "
|
|
235
|
-
/*
|
|
234
|
+
CREATE_COUPLING_DEVICE: {
|
|
235
|
+
type: "CREATE_COUPLING_DEVICE"
|
|
236
|
+
/* CREATE_COUPLING_DEVICE */
|
|
237
|
+
},
|
|
238
|
+
BALANCES_ADJUSTMENT: {
|
|
239
|
+
type: "BALANCES_ADJUSTMENT_MODIFICATION"
|
|
240
|
+
/* BALANCES_ADJUSTMENT */
|
|
236
241
|
}
|
|
237
242
|
};
|
|
238
243
|
export {
|