@gridsuite/commons-ui 0.226.0 → 0.227.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 (23) hide show
  1. package/dist/components/composite/filter/expert/expertFilterUtils.js +17 -5
  2. package/dist/components/composite/reactQueryBuilder/PropertyValueEditor.js +10 -5
  3. package/dist/components/composite/reactQueryBuilder/TextValueEditor.js +2 -3
  4. package/dist/components/composite/reactQueryBuilder/utils.d.ts +5 -0
  5. package/dist/components/composite/reactQueryBuilder/utils.js +17 -0
  6. package/dist/features/index.js +3 -1
  7. package/dist/features/network-modifications/voltageLevel/creation/voltageLevelCreation.utils.d.ts +2 -12
  8. package/dist/features/network-modifications/voltageLevel/creation/voltageLevelCreation.utils.js +4 -1
  9. package/dist/features/parameters/index.js +3 -1
  10. package/dist/features/parameters/network-visualizations/constants.d.ts +2 -0
  11. package/dist/features/parameters/network-visualizations/constants.js +4 -0
  12. package/dist/features/parameters/network-visualizations/index.js +3 -1
  13. package/dist/features/parameters/network-visualizations/network-visualizations.types.d.ts +1 -0
  14. package/dist/features/parameters/network-visualizations/single-line-diagram-parameters.js +4 -2
  15. package/dist/features/parameters/network-visualizations/use-network-visualizations-parameters-form.js +5 -3
  16. package/dist/index.js +3 -1
  17. package/dist/translations/en/parameters.d.ts +1 -0
  18. package/dist/translations/en/parameters.js +1 -0
  19. package/dist/translations/fr/parameters.d.ts +1 -0
  20. package/dist/translations/fr/parameters.js +1 -0
  21. package/package.json +1 -1
  22. package/dist/hooks/useCustomFilterOptions.d.ts +0 -5
  23. package/dist/hooks/useCustomFilterOptions.js +0 -20
@@ -302,11 +302,23 @@ const queryValidator = (query) => {
302
302
  valid: false,
303
303
  reasons: [RULES.EMPTY_RULE]
304
304
  };
305
- } else if (rule.id && dataType === DataType.PROPERTY && (isBlankOrEmpty(rule.value?.propertyName) || isBlankOrEmpty(rule.value?.propertyOperator) || isBlankOrEmpty(rule.value?.propertyValues) || !rule.value?.propertyValues?.length)) {
306
- result[rule.id] = {
307
- valid: false,
308
- reasons: [RULES.EMPTY_RULE]
309
- };
305
+ } else if (rule.id && dataType === DataType.PROPERTY) {
306
+ if (isBlankOrEmpty(rule.value?.propertyName) || isBlankOrEmpty(rule.value?.propertyOperator)) {
307
+ result[rule.id] = {
308
+ valid: false,
309
+ reasons: [RULES.EMPTY_RULE]
310
+ };
311
+ } else if (rule.value?.propertyOperator === OPERATOR_OPTIONS.EXISTS.name || rule.value?.propertyOperator === OPERATOR_OPTIONS.NOT_EXISTS.name) {
312
+ result[rule.id] = {
313
+ valid: true,
314
+ reasons: void 0
315
+ };
316
+ } else if (isBlankOrEmpty(rule.value?.propertyValues) || !rule.value?.propertyValues?.length) {
317
+ result[rule.id] = {
318
+ valid: false,
319
+ reasons: [RULES.EMPTY_RULE]
320
+ };
321
+ }
310
322
  } else if (rule.id && dataType === DataType.COMBINATOR) {
311
323
  const childrenFields = Object.keys(getFieldData(rule.field).children ?? {});
312
324
  const compositeGroup = rule.value;
@@ -6,8 +6,13 @@ import { useValid } from "./hooks/useValid.js";
6
6
  import { OPERATOR_OPTIONS } from "../filter/expert/expertFilterConstants.js";
7
7
  import { FieldConstants } from "../../../utils/constants/fieldConstants.js";
8
8
  import { usePredefinedProperties } from "../../../hooks/usePredefinedProperties.js";
9
- import { useCustomFilterOptions } from "../../../hooks/useCustomFilterOptions.js";
10
- const PROPERTY_VALUE_OPERATORS = [OPERATOR_OPTIONS.IN, OPERATOR_OPTIONS.NOT_IN];
9
+ import { createCustomFilterOptions } from "./utils.js";
10
+ const PROPERTY_VALUE_OPERATORS = [
11
+ OPERATOR_OPTIONS.IN,
12
+ OPERATOR_OPTIONS.NOT_IN,
13
+ OPERATOR_OPTIONS.EXISTS,
14
+ OPERATOR_OPTIONS.NOT_EXISTS
15
+ ];
11
16
  function PropertyValueEditor(props) {
12
17
  const { equipmentType, valueEditorProps } = props;
13
18
  const valid = useValid(valueEditorProps);
@@ -55,7 +60,7 @@ function PropertyValueEditor(props) {
55
60
  onChange(FieldConstants.PROPERTY_NAME, value);
56
61
  },
57
62
  size: "small",
58
- filterOptions: useCustomFilterOptions()
63
+ filterOptions: createCustomFilterOptions
59
64
  }
60
65
  ) }),
61
66
  /* @__PURE__ */ jsx(Grid, { item: true, xs: "auto", children: /* @__PURE__ */ jsx(FormControl, { variant: "standard", sx: { mt: 1, minWidth: 160 }, children: /* @__PURE__ */ jsx(
@@ -71,7 +76,7 @@ function PropertyValueEditor(props) {
71
76
  children: PROPERTY_VALUE_OPERATORS.map((operator) => /* @__PURE__ */ jsx(MenuItem, { value: operator.customName, children: intl.formatMessage({ id: operator.label }) }, operator.customName))
72
77
  }
73
78
  ) }) }),
74
- /* @__PURE__ */ jsx(Grid, { item: true, xs: true, children: /* @__PURE__ */ jsx(
79
+ valueEditorProps?.value?.propertyOperator !== OPERATOR_OPTIONS.EXISTS.customName && valueEditorProps?.value?.propertyOperator !== OPERATOR_OPTIONS.NOT_EXISTS.customName && /* @__PURE__ */ jsx(Grid, { item: true, xs: true, children: /* @__PURE__ */ jsx(
75
80
  Autocomplete,
76
81
  {
77
82
  value: propertyValues ?? [],
@@ -92,7 +97,7 @@ function PropertyValueEditor(props) {
92
97
  onChange(FieldConstants.PROPERTY_VALUES, value);
93
98
  },
94
99
  size: "small",
95
- filterOptions: useCustomFilterOptions()
100
+ filterOptions: createCustomFilterOptions
96
101
  }
97
102
  ) })
98
103
  ] });
@@ -4,12 +4,11 @@ import { Autocomplete, TextField } from "@mui/material";
4
4
  import { useIntl } from "react-intl";
5
5
  import { useConvertValue } from "./hooks/useConvertValue.js";
6
6
  import { useValid } from "./hooks/useValid.js";
7
- import { useCustomFilterOptions } from "../../../hooks/useCustomFilterOptions.js";
7
+ import { createCustomFilterOptions } from "./utils.js";
8
8
  function TextValueEditor(props) {
9
9
  useConvertValue(props);
10
10
  const valid = useValid(props);
11
11
  const { value, handleOnChange, title } = props;
12
- const customFilterOptions = useCustomFilterOptions();
13
12
  const intl = useIntl();
14
13
  if (!Array.isArray(value)) {
15
14
  return /* @__PURE__ */ jsx(MaterialValueEditor, { ...props });
@@ -33,7 +32,7 @@ function TextValueEditor(props) {
33
32
  ),
34
33
  size: "small",
35
34
  title,
36
- filterOptions: customFilterOptions
35
+ filterOptions: createCustomFilterOptions
37
36
  }
38
37
  );
39
38
  }
@@ -0,0 +1,5 @@
1
+ import { FilterOptionsState } from '@mui/material';
2
+ /**
3
+ * function used to add custom filterOptions, use only when freeSolo = true
4
+ */
5
+ export declare function createCustomFilterOptions(options: string[], params: FilterOptionsState<string>): string[];
@@ -0,0 +1,17 @@
1
+ import { createFilterOptions } from "@mui/material";
2
+ function createCustomFilterOptions(options, params) {
3
+ const filter = createFilterOptions();
4
+ const filteredOptions = filter(options, params);
5
+ const { inputValue } = params;
6
+ const isExisting = options.some((option) => inputValue === option);
7
+ if (isExisting && options.length === 1 && options[0] === inputValue) {
8
+ return [];
9
+ }
10
+ if (inputValue !== "" && !isExisting) {
11
+ filteredOptions.push(inputValue);
12
+ }
13
+ return filteredOptions;
14
+ }
15
+ export {
16
+ createCustomFilterOptions
17
+ };
@@ -40,7 +40,7 @@ import { ContingencyTable } from "./parameters/common/contingency-table/continge
40
40
  import { COLUMNS_DEFINITIONS_CONTINGENCY_LISTS_INFOS, getContingencyListsInfosFormSchema, isValidContingencyRow, toFormValuesContingencyListsInfos } from "./parameters/common/contingency-table/columns-definitions.js";
41
41
  import { useTabs } from "./parameters/common/hook/use-tabs.js";
42
42
  import { useParametersForm } from "./parameters/common/hook/use-parameters-form.js";
43
- import { CENTER_LABEL, COMPONENT_LIBRARY, DIAGONAL_LABEL, INTL_LINE_FLOW_MODE_OPTIONS, INTL_SUBSTATION_LAYOUT_OPTIONS, LINE_FLOW_MODE, LineFlowMode, MAP_BASE_MAP, MAP_MANUAL_REFRESH, NAD_POSITIONS_GENERATION_MODE, NAD_POSITIONS_GENERATION_MODE_LABEL, NetworkVisualizationTabValues, PARAM_CENTER_LABEL, PARAM_COMPONENT_LIBRARY, PARAM_DIAGONAL_LABEL, PARAM_LINE_FLOW_MODE, PARAM_LINE_FULL_PATH, PARAM_LINE_PARALLEL_PATH, PARAM_MAP_BASEMAP, PARAM_MAP_MANUAL_REFRESH, PARAM_NAD_POSITIONS_GENERATION_MODE, PARAM_SUBSTATION_LAYOUT, SUBSTATION_LAYOUT } from "./parameters/network-visualizations/constants.js";
43
+ import { CENTER_LABEL, COMPONENT_LIBRARY, CUSTOM_REAL_TIME_STATE_ESTIMATION, DIAGONAL_LABEL, INTL_LINE_FLOW_MODE_OPTIONS, INTL_SUBSTATION_LAYOUT_OPTIONS, LINE_FLOW_MODE, LineFlowMode, MAP_BASE_MAP, MAP_MANUAL_REFRESH, NAD_POSITIONS_GENERATION_MODE, NAD_POSITIONS_GENERATION_MODE_LABEL, NetworkVisualizationTabValues, PARAM_CENTER_LABEL, PARAM_COMPONENT_LIBRARY, PARAM_DIAGONAL_LABEL, PARAM_LINE_FLOW_MODE, PARAM_LINE_FULL_PATH, PARAM_LINE_PARALLEL_PATH, PARAM_MAP_BASEMAP, PARAM_MAP_MANUAL_REFRESH, PARAM_NAD_POSITIONS_GENERATION_MODE, PARAM_STATE_ESTIMATION, PARAM_SUBSTATION_LAYOUT, SUBSTATION_LAYOUT } from "./parameters/network-visualizations/constants.js";
44
44
  import { MAP_BASEMAP_CARTO, MAP_BASEMAP_CARTO_NOLABEL, MAP_BASEMAP_ETALAB, MAP_BASEMAP_MAPBOX, NadPositionsGenerationMode, SubstationLayout } from "./parameters/network-visualizations/network-visualizations.types.js";
45
45
  import { NetworkVisualizationParametersInline } from "./parameters/network-visualizations/network-visualizations-parameters-inline.js";
46
46
  import { NetworkVisualizationsParametersEditionDialog } from "./parameters/network-visualizations/network-visualizations-parameters-dialog.js";
@@ -246,6 +246,7 @@ export {
246
246
  CONTINGENCY_LISTS,
247
247
  CONTINGENCY_LISTS_INFOS,
248
248
  COUNTRIES_TO_BALANCE,
249
+ CUSTOM_REAL_TIME_STATE_ESTIMATION,
249
250
  CardErrorBoundary,
250
251
  CharacteristicsForm,
251
252
  ComputingType,
@@ -383,6 +384,7 @@ export {
383
384
  PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD,
384
385
  PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD,
385
386
  PARAM_SA_PROVIDER,
387
+ PARAM_STATE_ESTIMATION,
386
388
  PARAM_SUBSTATION_LAYOUT,
387
389
  PHASE_SHIFTER_REGULATION_ON,
388
390
  PRIORITY,
@@ -30,15 +30,7 @@ export declare const voltageLevelCreationFormSchema: import('yup').ObjectSchema<
30
30
  substationCreationId: string | null | undefined;
31
31
  substationName: string | null | undefined;
32
32
  country: string | null | undefined;
33
- substationCreation: {
34
- AdditionalProperties?: {
35
- previousValue?: string | null | undefined;
36
- added: NonNullable<boolean | undefined>;
37
- deletionMark: NonNullable<boolean | undefined>;
38
- name: string;
39
- value: string;
40
- }[] | undefined;
41
- };
33
+ substationCreation: {};
42
34
  hideNominalVoltage: NonNullable<boolean | undefined>;
43
35
  nominalV: number | null | undefined;
44
36
  lowVoltageLimit: number | null | undefined;
@@ -73,9 +65,7 @@ export declare const voltageLevelCreationFormSchema: import('yup').ObjectSchema<
73
65
  substationCreationId: undefined;
74
66
  substationName: undefined;
75
67
  country: undefined;
76
- substationCreation: {
77
- AdditionalProperties: "";
78
- };
68
+ substationCreation: {};
79
69
  hideNominalVoltage: undefined;
80
70
  nominalV: undefined;
81
71
  lowVoltageLimit: undefined;
@@ -119,7 +119,10 @@ const voltageLevelCreationFormSchema = object().shape({
119
119
  }),
120
120
  [FieldConstants.SUBSTATION_NAME]: string().nullable(),
121
121
  [FieldConstants.COUNTRY]: string().nullable(),
122
- [FieldConstants.SUBSTATION_CREATION]: creationPropertiesSchema,
122
+ [FieldConstants.SUBSTATION_CREATION]: object().when([FieldConstants.ADD_SUBSTATION_CREATION], {
123
+ is: (addSubstationCreation) => addSubstationCreation,
124
+ then: () => creationPropertiesSchema
125
+ }),
123
126
  [FieldConstants.HIDE_NOMINAL_VOLTAGE]: boolean().required(),
124
127
  [FieldConstants.NOMINAL_V]: number().nullable().when([FieldConstants.HIDE_NOMINAL_VOLTAGE], {
125
128
  is: (hideNominalVoltage) => !hideNominalVoltage,
@@ -20,7 +20,7 @@ import { ContingencyTable } from "./common/contingency-table/contingency-table.j
20
20
  import { COLUMNS_DEFINITIONS_CONTINGENCY_LISTS_INFOS, getContingencyListsInfosFormSchema, isValidContingencyRow, toFormValuesContingencyListsInfos } from "./common/contingency-table/columns-definitions.js";
21
21
  import { useTabs } from "./common/hook/use-tabs.js";
22
22
  import { useParametersForm } from "./common/hook/use-parameters-form.js";
23
- import { CENTER_LABEL, COMPONENT_LIBRARY, DIAGONAL_LABEL, INTL_LINE_FLOW_MODE_OPTIONS, INTL_SUBSTATION_LAYOUT_OPTIONS, LINE_FLOW_MODE, LineFlowMode, MAP_BASE_MAP, MAP_MANUAL_REFRESH, NAD_POSITIONS_GENERATION_MODE, NAD_POSITIONS_GENERATION_MODE_LABEL, NetworkVisualizationTabValues, PARAM_CENTER_LABEL, PARAM_COMPONENT_LIBRARY, PARAM_DIAGONAL_LABEL, PARAM_LINE_FLOW_MODE, PARAM_LINE_FULL_PATH, PARAM_LINE_PARALLEL_PATH, PARAM_MAP_BASEMAP, PARAM_MAP_MANUAL_REFRESH, PARAM_NAD_POSITIONS_GENERATION_MODE, PARAM_SUBSTATION_LAYOUT, SUBSTATION_LAYOUT } from "./network-visualizations/constants.js";
23
+ import { CENTER_LABEL, COMPONENT_LIBRARY, CUSTOM_REAL_TIME_STATE_ESTIMATION, DIAGONAL_LABEL, INTL_LINE_FLOW_MODE_OPTIONS, INTL_SUBSTATION_LAYOUT_OPTIONS, LINE_FLOW_MODE, LineFlowMode, MAP_BASE_MAP, MAP_MANUAL_REFRESH, NAD_POSITIONS_GENERATION_MODE, NAD_POSITIONS_GENERATION_MODE_LABEL, NetworkVisualizationTabValues, PARAM_CENTER_LABEL, PARAM_COMPONENT_LIBRARY, PARAM_DIAGONAL_LABEL, PARAM_LINE_FLOW_MODE, PARAM_LINE_FULL_PATH, PARAM_LINE_PARALLEL_PATH, PARAM_MAP_BASEMAP, PARAM_MAP_MANUAL_REFRESH, PARAM_NAD_POSITIONS_GENERATION_MODE, PARAM_STATE_ESTIMATION, PARAM_SUBSTATION_LAYOUT, SUBSTATION_LAYOUT } from "./network-visualizations/constants.js";
24
24
  import { MAP_BASEMAP_CARTO, MAP_BASEMAP_CARTO_NOLABEL, MAP_BASEMAP_ETALAB, MAP_BASEMAP_MAPBOX, NadPositionsGenerationMode, SubstationLayout } from "./network-visualizations/network-visualizations.types.js";
25
25
  import { NetworkVisualizationParametersInline } from "./network-visualizations/network-visualizations-parameters-inline.js";
26
26
  import { NetworkVisualizationsParametersEditionDialog } from "./network-visualizations/network-visualizations-parameters-dialog.js";
@@ -68,6 +68,7 @@ export {
68
68
  CONTINGENCY_LISTS,
69
69
  CONTINGENCY_LISTS_INFOS,
70
70
  COUNTRIES_TO_BALANCE,
71
+ CUSTOM_REAL_TIME_STATE_ESTIMATION,
71
72
  ComputingType,
72
73
  ContingencyTable,
73
74
  CreateParameterDialog,
@@ -155,6 +156,7 @@ export {
155
156
  PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD,
156
157
  PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD,
157
158
  PARAM_SA_PROVIDER,
159
+ PARAM_STATE_ESTIMATION,
158
160
  PARAM_SUBSTATION_LAYOUT,
159
161
  PHASE_SHIFTER_REGULATION_ON,
160
162
  PRIORITY,
@@ -14,6 +14,7 @@ export declare const PARAM_COMPONENT_LIBRARY = "componentLibrary";
14
14
  export declare const PARAM_DIAGONAL_LABEL = "diagonalLabel";
15
15
  export declare const PARAM_SUBSTATION_LAYOUT = "substationLayout";
16
16
  export declare const PARAM_NAD_POSITIONS_GENERATION_MODE = "nadPositionsGenerationMode";
17
+ export declare const PARAM_STATE_ESTIMATION = "stateEstimation";
17
18
  export declare enum NetworkVisualizationTabValues {
18
19
  MAP = "mapParameters",
19
20
  SINGLE_LINE_DIAGRAM = "singleLineDiagramParameters",
@@ -27,6 +28,7 @@ export declare const CENTER_LABEL = "centerLabel";
27
28
  export declare const SUBSTATION_LAYOUT = "SubstationLayout";
28
29
  export declare const COMPONENT_LIBRARY = "ComponentLibrary";
29
30
  export declare const NAD_POSITIONS_GENERATION_MODE_LABEL = "nadPositionsGenerationModeLabel";
31
+ export declare const CUSTOM_REAL_TIME_STATE_ESTIMATION = "CustomRealTimeStateEstimation";
30
32
  export declare const INTL_LINE_FLOW_MODE_OPTIONS: {
31
33
  id: LineFlowMode;
32
34
  label: string;
@@ -15,6 +15,7 @@ const PARAM_COMPONENT_LIBRARY = "componentLibrary";
15
15
  const PARAM_DIAGONAL_LABEL = "diagonalLabel";
16
16
  const PARAM_SUBSTATION_LAYOUT = "substationLayout";
17
17
  const PARAM_NAD_POSITIONS_GENERATION_MODE = "nadPositionsGenerationMode";
18
+ const PARAM_STATE_ESTIMATION = "stateEstimation";
18
19
  var NetworkVisualizationTabValues = /* @__PURE__ */ ((NetworkVisualizationTabValues2) => {
19
20
  NetworkVisualizationTabValues2["MAP"] = "mapParameters";
20
21
  NetworkVisualizationTabValues2["SINGLE_LINE_DIAGRAM"] = "singleLineDiagramParameters";
@@ -29,6 +30,7 @@ const CENTER_LABEL = "centerLabel";
29
30
  const SUBSTATION_LAYOUT = "SubstationLayout";
30
31
  const COMPONENT_LIBRARY = "ComponentLibrary";
31
32
  const NAD_POSITIONS_GENERATION_MODE_LABEL = "nadPositionsGenerationModeLabel";
33
+ const CUSTOM_REAL_TIME_STATE_ESTIMATION = "CustomRealTimeStateEstimation";
32
34
  const INTL_LINE_FLOW_MODE_OPTIONS = [
33
35
  {
34
36
  id: "staticArrows",
@@ -70,6 +72,7 @@ const NAD_POSITIONS_GENERATION_MODE = [
70
72
  export {
71
73
  CENTER_LABEL,
72
74
  COMPONENT_LIBRARY,
75
+ CUSTOM_REAL_TIME_STATE_ESTIMATION,
73
76
  DIAGONAL_LABEL,
74
77
  INTL_LINE_FLOW_MODE_OPTIONS,
75
78
  INTL_SUBSTATION_LAYOUT_OPTIONS,
@@ -89,6 +92,7 @@ export {
89
92
  PARAM_MAP_BASEMAP,
90
93
  PARAM_MAP_MANUAL_REFRESH,
91
94
  PARAM_NAD_POSITIONS_GENERATION_MODE,
95
+ PARAM_STATE_ESTIMATION,
92
96
  PARAM_SUBSTATION_LAYOUT,
93
97
  SUBSTATION_LAYOUT
94
98
  };
@@ -1,10 +1,11 @@
1
- import { CENTER_LABEL, COMPONENT_LIBRARY, DIAGONAL_LABEL, INTL_LINE_FLOW_MODE_OPTIONS, INTL_SUBSTATION_LAYOUT_OPTIONS, LINE_FLOW_MODE, LineFlowMode, MAP_BASE_MAP, MAP_MANUAL_REFRESH, NAD_POSITIONS_GENERATION_MODE, NAD_POSITIONS_GENERATION_MODE_LABEL, NetworkVisualizationTabValues, PARAM_CENTER_LABEL, PARAM_COMPONENT_LIBRARY, PARAM_DIAGONAL_LABEL, PARAM_LINE_FLOW_MODE, PARAM_LINE_FULL_PATH, PARAM_LINE_PARALLEL_PATH, PARAM_MAP_BASEMAP, PARAM_MAP_MANUAL_REFRESH, PARAM_NAD_POSITIONS_GENERATION_MODE, PARAM_SUBSTATION_LAYOUT, SUBSTATION_LAYOUT } from "./constants.js";
1
+ import { CENTER_LABEL, COMPONENT_LIBRARY, CUSTOM_REAL_TIME_STATE_ESTIMATION, DIAGONAL_LABEL, INTL_LINE_FLOW_MODE_OPTIONS, INTL_SUBSTATION_LAYOUT_OPTIONS, LINE_FLOW_MODE, LineFlowMode, MAP_BASE_MAP, MAP_MANUAL_REFRESH, NAD_POSITIONS_GENERATION_MODE, NAD_POSITIONS_GENERATION_MODE_LABEL, NetworkVisualizationTabValues, PARAM_CENTER_LABEL, PARAM_COMPONENT_LIBRARY, PARAM_DIAGONAL_LABEL, PARAM_LINE_FLOW_MODE, PARAM_LINE_FULL_PATH, PARAM_LINE_PARALLEL_PATH, PARAM_MAP_BASEMAP, PARAM_MAP_MANUAL_REFRESH, PARAM_NAD_POSITIONS_GENERATION_MODE, PARAM_STATE_ESTIMATION, PARAM_SUBSTATION_LAYOUT, SUBSTATION_LAYOUT } from "./constants.js";
2
2
  import { MAP_BASEMAP_CARTO, MAP_BASEMAP_CARTO_NOLABEL, MAP_BASEMAP_ETALAB, MAP_BASEMAP_MAPBOX, NadPositionsGenerationMode, SubstationLayout } from "./network-visualizations.types.js";
3
3
  import { NetworkVisualizationParametersInline } from "./network-visualizations-parameters-inline.js";
4
4
  import { NetworkVisualizationsParametersEditionDialog } from "./network-visualizations-parameters-dialog.js";
5
5
  export {
6
6
  CENTER_LABEL,
7
7
  COMPONENT_LIBRARY,
8
+ CUSTOM_REAL_TIME_STATE_ESTIMATION,
8
9
  DIAGONAL_LABEL,
9
10
  INTL_LINE_FLOW_MODE_OPTIONS,
10
11
  INTL_SUBSTATION_LAYOUT_OPTIONS,
@@ -31,6 +32,7 @@ export {
31
32
  PARAM_MAP_BASEMAP,
32
33
  PARAM_MAP_MANUAL_REFRESH,
33
34
  PARAM_NAD_POSITIONS_GENERATION_MODE,
35
+ PARAM_STATE_ESTIMATION,
34
36
  PARAM_SUBSTATION_LAYOUT,
35
37
  SUBSTATION_LAYOUT,
36
38
  SubstationLayout
@@ -27,6 +27,7 @@ type SingleLineDiagramParameters = {
27
27
  centerLabel: boolean;
28
28
  substationLayout: string;
29
29
  componentLibrary: string;
30
+ stateEstimation: boolean;
30
31
  };
31
32
  type NetworkAreaDiagramParameters = {
32
33
  nadPositionsGenerationMode: string;
@@ -37,7 +37,7 @@ import "../common/contingency-table/contingency-table.js";
37
37
  import "../common/contingency-table/columns-definitions.js";
38
38
  import "@hookform/resolvers/yup";
39
39
  import "../../../components/composite/filter/HeaderFilterForm.js";
40
- import { INTL_SUBSTATION_LAYOUT_OPTIONS, SUBSTATION_LAYOUT, NetworkVisualizationTabValues, PARAM_SUBSTATION_LAYOUT, COMPONENT_LIBRARY, PARAM_COMPONENT_LIBRARY, DIAGONAL_LABEL, PARAM_DIAGONAL_LABEL, CENTER_LABEL, PARAM_CENTER_LABEL } from "./constants.js";
40
+ import { INTL_SUBSTATION_LAYOUT_OPTIONS, SUBSTATION_LAYOUT, NetworkVisualizationTabValues, PARAM_SUBSTATION_LAYOUT, COMPONENT_LIBRARY, PARAM_COMPONENT_LIBRARY, DIAGONAL_LABEL, PARAM_DIAGONAL_LABEL, CENTER_LABEL, PARAM_CENTER_LABEL, CUSTOM_REAL_TIME_STATE_ESTIMATION, PARAM_STATE_ESTIMATION } from "./constants.js";
41
41
  function SingleLineDiagramParameters({ componentLibraries }) {
42
42
  const componentLibsRenderCache = useMemo(
43
43
  () => Object.fromEntries(componentLibraries.filter(Boolean).map((libLabel) => [libLabel, libLabel])),
@@ -91,7 +91,9 @@ function SingleLineDiagramParameters({ componentLibraries }) {
91
91
  /* @__PURE__ */ jsx(LineSeparator, {}),
92
92
  substationLineDropDown,
93
93
  /* @__PURE__ */ jsx(LineSeparator, {}),
94
- componentLineDropDown
94
+ componentLineDropDown,
95
+ /* @__PURE__ */ jsx(LineSeparator, {}),
96
+ labelPosition(PARAM_STATE_ESTIMATION, CUSTOM_REAL_TIME_STATE_ESTIMATION)
95
97
  ]
96
98
  },
97
99
  "singleLineDiagramParameters"
@@ -34,7 +34,7 @@ import "../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
34
34
  import "../../../components/ui/snackbarProvider/SnackbarProvider.js";
35
35
  import "mui-nested-menu";
36
36
  import "react-resizable-panels";
37
- import { NetworkVisualizationTabValues, PARAM_NAD_POSITIONS_GENERATION_MODE, PARAM_COMPONENT_LIBRARY, PARAM_SUBSTATION_LAYOUT, PARAM_CENTER_LABEL, PARAM_DIAGONAL_LABEL, PARAM_MAP_BASEMAP, PARAM_MAP_MANUAL_REFRESH, PARAM_LINE_FLOW_MODE, PARAM_LINE_PARALLEL_PATH, PARAM_LINE_FULL_PATH } from "./constants.js";
37
+ import { NetworkVisualizationTabValues, PARAM_NAD_POSITIONS_GENERATION_MODE, PARAM_STATE_ESTIMATION, PARAM_COMPONENT_LIBRARY, PARAM_SUBSTATION_LAYOUT, PARAM_CENTER_LABEL, PARAM_DIAGONAL_LABEL, PARAM_MAP_BASEMAP, PARAM_MAP_MANUAL_REFRESH, PARAM_LINE_FLOW_MODE, PARAM_LINE_PARALLEL_PATH, PARAM_LINE_FULL_PATH } from "./constants.js";
38
38
  import "../../../components/composite/filter/HeaderFilterForm.js";
39
39
  import { getNameElementEditorSchema, getNameElementEditorEmptyFormData } from "../common/name-element-editor/name-element-editor-utils.js";
40
40
  const useNetworkVisualizationParametersForm = ({
@@ -63,7 +63,8 @@ const useNetworkVisualizationParametersForm = ({
63
63
  [PARAM_DIAGONAL_LABEL]: yup.boolean(),
64
64
  [PARAM_CENTER_LABEL]: yup.boolean(),
65
65
  [PARAM_SUBSTATION_LAYOUT]: yup.string(),
66
- [PARAM_COMPONENT_LIBRARY]: yup.string()
66
+ [PARAM_COMPONENT_LIBRARY]: yup.string(),
67
+ [PARAM_STATE_ESTIMATION]: yup.boolean()
67
68
  }),
68
69
  [NetworkVisualizationTabValues.NETWORK_AREA_DIAGRAM]: yup.object().shape({
69
70
  [PARAM_NAD_POSITIONS_GENERATION_MODE]: yup.string()
@@ -84,7 +85,8 @@ const useNetworkVisualizationParametersForm = ({
84
85
  [PARAM_DIAGONAL_LABEL]: false,
85
86
  [PARAM_CENTER_LABEL]: false,
86
87
  [PARAM_SUBSTATION_LAYOUT]: "",
87
- [PARAM_COMPONENT_LIBRARY]: ""
88
+ [PARAM_COMPONENT_LIBRARY]: "",
89
+ [PARAM_STATE_ESTIMATION]: false
88
90
  },
89
91
  [NetworkVisualizationTabValues.NETWORK_AREA_DIAGRAM]: {
90
92
  [PARAM_NAD_POSITIONS_GENERATION_MODE]: ""
package/dist/index.js CHANGED
@@ -167,7 +167,7 @@ import { ContingencyTable } from "./features/parameters/common/contingency-table
167
167
  import { COLUMNS_DEFINITIONS_CONTINGENCY_LISTS_INFOS, getContingencyListsInfosFormSchema, isValidContingencyRow, toFormValuesContingencyListsInfos } from "./features/parameters/common/contingency-table/columns-definitions.js";
168
168
  import { useTabs } from "./features/parameters/common/hook/use-tabs.js";
169
169
  import { useParametersForm } from "./features/parameters/common/hook/use-parameters-form.js";
170
- import { CENTER_LABEL, COMPONENT_LIBRARY, DIAGONAL_LABEL, INTL_LINE_FLOW_MODE_OPTIONS, INTL_SUBSTATION_LAYOUT_OPTIONS, LINE_FLOW_MODE, LineFlowMode, MAP_BASE_MAP, MAP_MANUAL_REFRESH, NAD_POSITIONS_GENERATION_MODE, NAD_POSITIONS_GENERATION_MODE_LABEL, NetworkVisualizationTabValues, PARAM_CENTER_LABEL, PARAM_COMPONENT_LIBRARY, PARAM_DIAGONAL_LABEL, PARAM_LINE_FLOW_MODE, PARAM_LINE_FULL_PATH, PARAM_LINE_PARALLEL_PATH, PARAM_MAP_BASEMAP, PARAM_MAP_MANUAL_REFRESH, PARAM_NAD_POSITIONS_GENERATION_MODE, PARAM_SUBSTATION_LAYOUT, SUBSTATION_LAYOUT } from "./features/parameters/network-visualizations/constants.js";
170
+ import { CENTER_LABEL, COMPONENT_LIBRARY, CUSTOM_REAL_TIME_STATE_ESTIMATION, DIAGONAL_LABEL, INTL_LINE_FLOW_MODE_OPTIONS, INTL_SUBSTATION_LAYOUT_OPTIONS, LINE_FLOW_MODE, LineFlowMode, MAP_BASE_MAP, MAP_MANUAL_REFRESH, NAD_POSITIONS_GENERATION_MODE, NAD_POSITIONS_GENERATION_MODE_LABEL, NetworkVisualizationTabValues, PARAM_CENTER_LABEL, PARAM_COMPONENT_LIBRARY, PARAM_DIAGONAL_LABEL, PARAM_LINE_FLOW_MODE, PARAM_LINE_FULL_PATH, PARAM_LINE_PARALLEL_PATH, PARAM_MAP_BASEMAP, PARAM_MAP_MANUAL_REFRESH, PARAM_NAD_POSITIONS_GENERATION_MODE, PARAM_STATE_ESTIMATION, PARAM_SUBSTATION_LAYOUT, SUBSTATION_LAYOUT } from "./features/parameters/network-visualizations/constants.js";
171
171
  import { MAP_BASEMAP_CARTO, MAP_BASEMAP_CARTO_NOLABEL, MAP_BASEMAP_ETALAB, MAP_BASEMAP_MAPBOX, NadPositionsGenerationMode, SubstationLayout } from "./features/parameters/network-visualizations/network-visualizations.types.js";
172
172
  import { NetworkVisualizationParametersInline } from "./features/parameters/network-visualizations/network-visualizations-parameters-inline.js";
173
173
  import { NetworkVisualizationsParametersEditionDialog } from "./features/parameters/network-visualizations/network-visualizations-parameters-dialog.js";
@@ -509,6 +509,7 @@ export {
509
509
  CONVERTERS_MODE_OPTIONS,
510
510
  COUNTRIES_TO_BALANCE,
511
511
  CUSTOM_AGGRID_THEME,
512
+ CUSTOM_REAL_TIME_STATE_ESTIMATION,
512
513
  CalculationType,
513
514
  CancelButton,
514
515
  CardErrorBoundary,
@@ -801,6 +802,7 @@ export {
801
802
  PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD,
802
803
  PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD,
803
804
  PARAM_SA_PROVIDER,
805
+ PARAM_STATE_ESTIMATION,
804
806
  PARAM_SUBSTATION_LAYOUT,
805
807
  PARAM_THEME,
806
808
  PERCENTAGE,
@@ -87,6 +87,7 @@ export declare const parametersEn: {
87
87
  HorizontalSubstationLayout: string;
88
88
  VerticalSubstationLayout: string;
89
89
  ComponentLibrary: string;
90
+ CustomRealTimeStateEstimation: string;
90
91
  nadPositionsGenerationModeLabel: string;
91
92
  NadGeoPositionsModeLabel: string;
92
93
  NadAutoPositionsModeLabel: string;
@@ -81,6 +81,7 @@ const parametersEn = {
81
81
  HorizontalSubstationLayout: "Horizontal",
82
82
  VerticalSubstationLayout: "Vertical",
83
83
  ComponentLibrary: "Component library selection",
84
+ CustomRealTimeStateEstimation: "State estimation",
84
85
  nadPositionsGenerationModeLabel: "Initialization of the positions",
85
86
  NadGeoPositionsModeLabel: "Geographical",
86
87
  NadAutoPositionsModeLabel: "Automatic",
@@ -87,6 +87,7 @@ export declare const parametersFr: {
87
87
  HorizontalSubstationLayout: string;
88
88
  VerticalSubstationLayout: string;
89
89
  ComponentLibrary: string;
90
+ CustomRealTimeStateEstimation: string;
90
91
  nadPositionsGenerationModeLabel: string;
91
92
  NadGeoPositionsModeLabel: string;
92
93
  NadAutoPositionsModeLabel: string;
@@ -81,6 +81,7 @@ const parametersFr = {
81
81
  HorizontalSubstationLayout: "Horizontal",
82
82
  VerticalSubstationLayout: "Vertical",
83
83
  ComponentLibrary: "Sélection de la bibliothèque de composants",
84
+ CustomRealTimeStateEstimation: "Estimation d'état",
84
85
  nadPositionsGenerationModeLabel: "Initialisation des positions",
85
86
  NadGeoPositionsModeLabel: "Géographique",
86
87
  NadAutoPositionsModeLabel: "Automatique",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.226.0",
3
+ "version": "0.227.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "author": "gridsuite team",
6
6
  "homepage": "https://github.com/gridsuite",
@@ -1,5 +0,0 @@
1
- import { FilterOptionsState } from '@mui/material';
2
- /**
3
- * Hook used to add custom filterOptions, use only when freeSolo = true
4
- */
5
- export declare function useCustomFilterOptions(): (options: string[], params: FilterOptionsState<string>) => string[];
@@ -1,20 +0,0 @@
1
- import { useCallback } from "react";
2
- import { createFilterOptions } from "@mui/material";
3
- function useCustomFilterOptions() {
4
- return useCallback((options, params) => {
5
- const filter = createFilterOptions();
6
- const filteredOptions = filter(options, params);
7
- const { inputValue } = params;
8
- const isExisting = options.some((option) => inputValue === option);
9
- if (isExisting && options.length === 1 && options[0] === inputValue) {
10
- return [];
11
- }
12
- if (inputValue !== "" && !isExisting) {
13
- filteredOptions.push(inputValue);
14
- }
15
- return filteredOptions;
16
- }, []);
17
- }
18
- export {
19
- useCustomFilterOptions
20
- };