@gridsuite/commons-ui 0.104.1 → 0.105.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.
@@ -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: inputTransform(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,
@@ -34,7 +34,8 @@ const styles = {
34
34
  height: "100%",
35
35
  display: "flex",
36
36
  position: "relative",
37
- flexDirection: "column"
37
+ flexDirection: "column",
38
+ maxHeight: "calc(100% - 5vh)"
38
39
  },
39
40
  loadflowParameters: {
40
41
  flexGrow: 1,
@@ -47,7 +48,6 @@ const styles = {
47
48
  content: (theme) => ({
48
49
  overflowY: "auto",
49
50
  overflowX: "hidden",
50
- maxHeight: "calc(100% - 15vh)",
51
51
  paddingRight: theme.spacing(2),
52
52
  paddingTop: theme.spacing(2),
53
53
  paddingBottom: theme.spacing(1),
@@ -63,4 +63,5 @@ export declare const networkModificationsEn: {
63
63
  'network_modifications.VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION': string;
64
64
  'network_modifications.VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION': string;
65
65
  'network_modifications.COUPLING_DEVICE_CREATION': 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.COUPLING_DEVICE_CREATION": "Creating a coupling device in voltage level {computedLabel}"
59
+ "network_modifications.COUPLING_DEVICE_CREATION": "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
@@ -63,4 +63,5 @@ export declare const networkModificationsFr: {
63
63
  'network_modifications.VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION': string;
64
64
  'network_modifications.VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION': string;
65
65
  'network_modifications.COUPLING_DEVICE_CREATION': 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.COUPLING_DEVICE_CREATION": "Création de couplage / omnibus dans le poste {computedLabel}"
59
+ "network_modifications.COUPLING_DEVICE_CREATION": "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
- COUPLING_DEVICE_CREATION = "COUPLING_DEVICE_CREATION"
53
+ COUPLING_DEVICE_CREATION = "COUPLING_DEVICE_CREATION",
54
+ BALANCES_ADJUSTMENT = "BALANCES_ADJUSTMENT_MODIFICATION"
54
55
  }
55
56
  export declare const MODIFICATION_TYPES: {
56
57
  GROOVY_SCRIPT: {
@@ -194,4 +195,7 @@ export declare const MODIFICATION_TYPES: {
194
195
  COUPLING_DEVICE_CREATION: {
195
196
  type: ModificationType;
196
197
  };
198
+ BALANCES_ADJUSTMENT: {
199
+ type: ModificationType;
200
+ };
197
201
  };
@@ -45,6 +45,7 @@ var ModificationType = /* @__PURE__ */ ((ModificationType2) => {
45
45
  ModificationType2["LCC_MODIFICATION"] = "LCC_MODIFICATION";
46
46
  ModificationType2["VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION"] = "VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION";
47
47
  ModificationType2["COUPLING_DEVICE_CREATION"] = "COUPLING_DEVICE_CREATION";
48
+ ModificationType2["BALANCES_ADJUSTMENT"] = "BALANCES_ADJUSTMENT_MODIFICATION";
48
49
  return ModificationType2;
49
50
  })(ModificationType || {});
50
51
  const MODIFICATION_TYPES = {
@@ -233,6 +234,10 @@ const MODIFICATION_TYPES = {
233
234
  COUPLING_DEVICE_CREATION: {
234
235
  type: "COUPLING_DEVICE_CREATION"
235
236
  /* COUPLING_DEVICE_CREATION */
237
+ },
238
+ BALANCES_ADJUSTMENT: {
239
+ type: "BALANCES_ADJUSTMENT_MODIFICATION"
240
+ /* BALANCES_ADJUSTMENT */
236
241
  }
237
242
  };
238
243
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.104.1",
3
+ "version": "0.105.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "author": "gridsuite team",
6
6
  "homepage": "https://github.com/gridsuite",