@gridsuite/commons-ui 0.50.1 → 0.51.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.
@@ -16,7 +16,7 @@ interface DirectoryItemSelectorProps {
16
16
  itemFilter?: any;
17
17
  fetchDirectoryContent: (directoryUuid: UUID, elementTypes: string[]) => Promise<any>;
18
18
  fetchRootFolders: (types: string[]) => Promise<any>;
19
- fetchElementsInfos: (ids: UUID[], elementTypes: string[], equipmentTypes?: string[]) => Promise<any>;
19
+ fetchElementsInfos: (ids: UUID[], elementTypes: string[], equipmentTypes: string[]) => Promise<any>;
20
20
  classes?: any;
21
21
  contentText?: string;
22
22
  defaultExpanded?: string[];
@@ -1,6 +1,7 @@
1
1
  import { jsx, Fragment } from "react/jsx-runtime";
2
2
  import { useState, useRef, useCallback, useEffect } from "react";
3
- import { elementType, getFileIcon } from "../../utils/ElementType.js";
3
+ import { getFileIcon } from "../../utils/ElementIcon.js";
4
+ import { ElementType } from "../../utils/ElementType.js";
4
5
  import { useSnackMessage } from "../../hooks/useSnackMessage.js";
5
6
  import TreeViewFinder from "../TreeViewFinder/TreeViewFinder.js";
6
7
  const styles = {
@@ -41,7 +42,7 @@ const DirectoryItemSelector = ({
41
42
  const openRef = useRef();
42
43
  openRef.current = open;
43
44
  const contentFilter = useCallback(
44
- () => /* @__PURE__ */ new Set([elementType.DIRECTORY, ...types]),
45
+ () => /* @__PURE__ */ new Set([ElementType.DIRECTORY, ...types]),
45
46
  [types]
46
47
  );
47
48
  const convertChildren = useCallback((children) => {
@@ -51,8 +52,8 @@ const DirectoryItemSelector = ({
51
52
  name: e.elementName,
52
53
  specificMetadata: e.specificMetadata,
53
54
  icon: getFileIcon(e.type, styles.icon),
54
- children: e.type === elementType.DIRECTORY ? convertChildren(e.children) : void 0,
55
- childrenCount: e.type === elementType.DIRECTORY ? e.subdirectoriesCount : void 0
55
+ children: e.type === ElementType.DIRECTORY ? convertChildren(e.children) : void 0,
56
+ childrenCount: e.type === ElementType.DIRECTORY ? e.subdirectoriesCount : void 0
56
57
  };
57
58
  });
58
59
  }, []);
@@ -63,10 +64,10 @@ const DirectoryItemSelector = ({
63
64
  id: e.elementUuid,
64
65
  name: e.elementName,
65
66
  icon: getFileIcon(e.type, styles.icon),
66
- children: e.type === elementType.DIRECTORY ? convertChildren(
67
+ children: e.type === ElementType.DIRECTORY ? convertChildren(
67
68
  nodeMap.current[e.elementUuid].children
68
69
  ) : void 0,
69
- childrenCount: e.type === elementType.DIRECTORY ? e.subdirectoriesCount : void 0
70
+ childrenCount: e.type === ElementType.DIRECTORY ? e.subdirectoriesCount : void 0
70
71
  };
71
72
  });
72
73
  },
@@ -122,7 +123,7 @@ const DirectoryItemSelector = ({
122
123
  equipmentTypes
123
124
  ).then((childrenWithMetadata) => {
124
125
  const children2 = itemFilter ? childrenWithMetadata.filter((val) => {
125
- if (val.type === elementType.DIRECTORY) {
126
+ if (val.type === ElementType.DIRECTORY) {
126
127
  return true;
127
128
  }
128
129
  return itemFilter(val);
package/dist/index.d.ts CHANGED
@@ -22,7 +22,6 @@ import type {
22
22
 
23
23
  export { default as TreeViewFinder } from './components/TreeViewFinder';
24
24
  export { default as AboutDialog } from './components/TopBar/AboutDialog';
25
- export { default as SnackbarProvider } from './components/SnackbarProvider';
26
25
  export { default as AuthenticationRouter } from './components/AuthenticationRouter';
27
26
  export { default as MuiVirtualizedTable } from './components/MuiVirtualizedTable';
28
27
  export {
@@ -35,9 +34,13 @@ export { default as ElementSearchDialog } from './components/ElementSearchDialog
35
34
  export { default as MultipleSelectionDialog } from './components/MultipleSelectionDialog';
36
35
 
37
36
  export {
37
+ Equipment,
38
+ EquipmentInfos,
38
39
  EQUIPMENT_TYPE,
40
+ EquipmentType,
39
41
  getEquipmentsInfosForSearchBar,
40
42
  equipmentStyles,
43
+ Identifiable,
41
44
  } from './utils/EquipmentType';
42
45
 
43
46
  export {
@@ -47,7 +50,7 @@ export {
47
50
  getPreLoginPath,
48
51
  } from './utils/AuthService';
49
52
 
50
- export { getFileIcon } from './utils/ElementType';
53
+ export { getFileIcon } from './utils/ElementIcon';
51
54
 
52
55
  export {
53
56
  DEFAULT_CELL_PADDING,
@@ -118,13 +121,16 @@ export {
118
121
  ExpandingTextFieldProps,
119
122
  ExpandingTextField,
120
123
  } from './components/react-hook-form/expanding-text-field';
124
+
125
+ export { ElementType } from './utils/ElementType';
126
+
121
127
  /**
122
128
  * Section to export manual type declarations of .js and .jsx files
123
129
  */
124
130
 
125
- export const CardErrorBoundary: FunctionComponent;
126
-
127
- export const TopBar: FunctionComponent;
131
+ export const CardErrorBoundary: FunctionComponent<any>;
132
+ export const TopBar: FunctionComponent<any>;
133
+ export const SnackbarProvider: FunctionComponent<any>;
128
134
 
129
135
  export function logout(
130
136
  dispatch: any,
@@ -314,15 +320,3 @@ interface OverflowableTextProps {
314
320
  }
315
321
 
316
322
  export const OverflowableText: FunctionComponent<OverflowableTextProps>;
317
-
318
- export enum elementType {
319
- DIRECTORY = 'DIRECTORY',
320
- STUDY = 'STUDY',
321
- FILTER = 'FILTER',
322
- MODIFICATION = 'MODIFICATION',
323
- CONTINGENCY_LIST = 'CONTINGENCY_LIST',
324
- VOLTAGE_INIT_PARAMETERS = 'VOLTAGE_INIT_PARAMETERS',
325
- SECURITY_ANALYSIS_PARAMETERS = 'SECURITY_ANALYSIS_PARAMETERS',
326
- LOADFLOW_PARAMETERS = 'LOADFLOW_PARAMETERS',
327
- SENSITIVITY_PARAMETERS = 'SENSITIVITY_PARAMETERS',
328
- }
package/dist/index.js CHANGED
@@ -13,9 +13,10 @@ import { default as default10 } from "./components/ElementSearchDialog/element-s
13
13
  import { TagRenderer } from "./components/ElementSearchDialog/tag-renderer.js";
14
14
  import { FlatParameters } from "./components/FlatParameters/FlatParameters.js";
15
15
  import { default as default11 } from "./components/MultipleSelectionDialog/MultipleSelectionDialog.js";
16
- import { EQUIPMENT_TYPE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./utils/EquipmentType.js";
16
+ import { ElementType } from "./utils/ElementType.js";
17
+ import { EQUIPMENT_TYPE, EquipmentType, equipmentStyles, getEquipmentsInfosForSearchBar } from "./utils/EquipmentType.js";
17
18
  import { dispatchUser, getPreLoginPath, initializeAuthenticationDev, initializeAuthenticationProd, logout } from "./utils/AuthService.js";
18
- import { elementType, getFileIcon } from "./utils/ElementType.js";
19
+ import { getFileIcon } from "./utils/ElementIcon.js";
19
20
  import { LOGOUT_ERROR, RESET_AUTHENTICATION_ROUTER_ERROR, SHOW_AUTH_INFO_LOGIN, SIGNIN_CALLBACK_ERROR, UNAUTHORIZED_USER_INFO, USER, USER_VALIDATION_ERROR, setLoggedUser, setSignInCallbackError } from "./utils/actions.js";
20
21
  import { default as default12 } from "./components/translations/report-viewer-en.js";
21
22
  import { default as default13 } from "./components/translations/report-viewer-fr.js";
@@ -84,7 +85,9 @@ export {
84
85
  default54 as DirectoryItemsInput,
85
86
  EQUIPMENT_TYPE,
86
87
  default10 as ElementSearchDialog,
88
+ ElementType,
87
89
  EquipmentItem,
90
+ EquipmentType,
88
91
  default47 as ErrorInput,
89
92
  default39 as ExpandingTextField,
90
93
  default48 as FieldErrorAlert,
@@ -130,7 +133,6 @@ export {
130
133
  default34 as directory_items_input_en,
131
134
  default35 as directory_items_input_fr,
132
135
  dispatchUser,
133
- elementType,
134
136
  default22 as element_search_en,
135
137
  default23 as element_search_fr,
136
138
  equipmentStyles,
@@ -0,0 +1 @@
1
+ export function getFileIcon(type: any, style: any): import("react/jsx-runtime").JSX.Element | undefined;
@@ -0,0 +1,29 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Settings, Article, NoteAlt, OfflineBolt, Photo, PhotoLibrary } from "@mui/icons-material";
3
+ import { ElementType } from "./ElementType.js";
4
+ function getFileIcon(type, style) {
5
+ switch (type) {
6
+ case ElementType.STUDY:
7
+ return /* @__PURE__ */ jsx(PhotoLibrary, { sx: style });
8
+ case ElementType.CASE:
9
+ return /* @__PURE__ */ jsx(Photo, { sx: style });
10
+ case ElementType.CONTINGENCY_LIST:
11
+ return /* @__PURE__ */ jsx(OfflineBolt, { sx: style });
12
+ case ElementType.MODIFICATION:
13
+ return /* @__PURE__ */ jsx(NoteAlt, { sx: style });
14
+ case ElementType.FILTER:
15
+ return /* @__PURE__ */ jsx(Article, { sx: style });
16
+ case ElementType.VOLTAGE_INIT_PARAMETERS:
17
+ case ElementType.SECURITY_ANALYSIS_PARAMETERS:
18
+ case ElementType.LOADFLOW_PARAMETERS:
19
+ case ElementType.SENSITIVITY_PARAMETERS:
20
+ return /* @__PURE__ */ jsx(Settings, { sx: style });
21
+ case ElementType.DIRECTORY:
22
+ return;
23
+ default:
24
+ console.warn("unknown type [" + type + "]");
25
+ }
26
+ }
27
+ export {
28
+ getFileIcon
29
+ };
@@ -1,13 +1,18 @@
1
- export function getFileIcon(type: any, style: any): import("react/jsx-runtime").JSX.Element | undefined;
2
- export namespace elementType {
3
- const DIRECTORY: string;
4
- const STUDY: string;
5
- const CASE: string;
6
- const FILTER: string;
7
- const MODIFICATION: string;
8
- const CONTINGENCY_LIST: string;
9
- const VOLTAGE_INIT_PARAMETERS: string;
10
- const SECURITY_ANALYSIS_PARAMETERS: string;
11
- const LOADFLOW_PARAMETERS: string;
12
- const SENSITIVITY_PARAMETERS: string;
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
+ */
7
+ export declare enum ElementType {
8
+ DIRECTORY = "DIRECTORY",
9
+ STUDY = "STUDY",
10
+ CASE = "CASE",
11
+ FILTER = "FILTER",
12
+ MODIFICATION = "MODIFICATION",
13
+ CONTINGENCY_LIST = "CONTINGENCY_LIST",
14
+ VOLTAGE_INIT_PARAMETERS = "VOLTAGE_INIT_PARAMETERS",
15
+ SECURITY_ANALYSIS_PARAMETERS = "SECURITY_ANALYSIS_PARAMETERS",
16
+ LOADFLOW_PARAMETERS = "LOADFLOW_PARAMETERS",
17
+ SENSITIVITY_PARAMETERS = "SENSITIVITY_PARAMETERS"
13
18
  }
@@ -1,41 +1,16 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { Settings, Article, NoteAlt, OfflineBolt, Photo, PhotoLibrary } from "@mui/icons-material";
3
- const elementType = {
4
- DIRECTORY: "DIRECTORY",
5
- STUDY: "STUDY",
6
- CASE: "CASE",
7
- FILTER: "FILTER",
8
- MODIFICATION: "MODIFICATION",
9
- CONTINGENCY_LIST: "CONTINGENCY_LIST",
10
- VOLTAGE_INIT_PARAMETERS: "VOLTAGE_INIT_PARAMETERS",
11
- SECURITY_ANALYSIS_PARAMETERS: "SECURITY_ANALYSIS_PARAMETERS",
12
- LOADFLOW_PARAMETERS: "LOADFLOW_PARAMETERS",
13
- SENSITIVITY_PARAMETERS: "SENSITIVITY_PARAMETERS"
14
- };
15
- function getFileIcon(type, style) {
16
- switch (type) {
17
- case elementType.STUDY:
18
- return /* @__PURE__ */ jsx(PhotoLibrary, { sx: style });
19
- case elementType.CASE:
20
- return /* @__PURE__ */ jsx(Photo, { sx: style });
21
- case elementType.CONTINGENCY_LIST:
22
- return /* @__PURE__ */ jsx(OfflineBolt, { sx: style });
23
- case elementType.MODIFICATION:
24
- return /* @__PURE__ */ jsx(NoteAlt, { sx: style });
25
- case elementType.FILTER:
26
- return /* @__PURE__ */ jsx(Article, { sx: style });
27
- case elementType.VOLTAGE_INIT_PARAMETERS:
28
- case elementType.SECURITY_ANALYSIS_PARAMETERS:
29
- case elementType.LOADFLOW_PARAMETERS:
30
- case elementType.SENSITIVITY_PARAMETERS:
31
- return /* @__PURE__ */ jsx(Settings, { sx: style });
32
- case elementType.DIRECTORY:
33
- return;
34
- default:
35
- console.warn("unknown type [" + type + "]");
36
- }
37
- }
1
+ var ElementType = /* @__PURE__ */ ((ElementType2) => {
2
+ ElementType2["DIRECTORY"] = "DIRECTORY";
3
+ ElementType2["STUDY"] = "STUDY";
4
+ ElementType2["CASE"] = "CASE";
5
+ ElementType2["FILTER"] = "FILTER";
6
+ ElementType2["MODIFICATION"] = "MODIFICATION";
7
+ ElementType2["CONTINGENCY_LIST"] = "CONTINGENCY_LIST";
8
+ ElementType2["VOLTAGE_INIT_PARAMETERS"] = "VOLTAGE_INIT_PARAMETERS";
9
+ ElementType2["SECURITY_ANALYSIS_PARAMETERS"] = "SECURITY_ANALYSIS_PARAMETERS";
10
+ ElementType2["LOADFLOW_PARAMETERS"] = "LOADFLOW_PARAMETERS";
11
+ ElementType2["SENSITIVITY_PARAMETERS"] = "SENSITIVITY_PARAMETERS";
12
+ return ElementType2;
13
+ })(ElementType || {});
38
14
  export {
39
- elementType,
40
- getFileIcon
15
+ ElementType
41
16
  };
@@ -1,136 +1,76 @@
1
- export const TYPE_TAG_MAX_SIZE: "90px";
2
- export const VL_TAG_MAX_SIZE: "100px";
3
- export namespace equipmentStyles {
4
- namespace equipmentOption {
5
- const display: string;
6
- const gap: string;
7
- const width: string;
8
- const margin: string;
9
- const padding: string;
10
- const alignItems: string;
11
- const justifyContent: string;
12
- }
13
- function equipmentTag(theme: any): {
1
+ export declare const TYPE_TAG_MAX_SIZE = "90px";
2
+ export declare const VL_TAG_MAX_SIZE = "100px";
3
+ export declare const equipmentStyles: {
4
+ equipmentOption: {
5
+ display: string;
6
+ gap: string;
7
+ width: string;
8
+ margin: string;
9
+ padding: string;
10
+ alignItems: string;
11
+ justifyContent: string;
12
+ };
13
+ equipmentTag: (theme: string) => {
14
14
  borderRadius: string;
15
15
  padding: string;
16
16
  fontSize: string;
17
17
  textAlign: string;
18
18
  color: string;
19
19
  };
20
- namespace equipmentTypeTag {
21
- export { TYPE_TAG_MAX_SIZE as minWidth };
22
- export { TYPE_TAG_MAX_SIZE as maxWidth };
23
- export const background: string;
24
- }
25
- namespace equipmentVlTag {
26
- export { VL_TAG_MAX_SIZE as width };
27
- export { VL_TAG_MAX_SIZE as minWidth };
28
- export { VL_TAG_MAX_SIZE as maxWidth };
29
- const background_1: string;
30
- export { background_1 as background };
31
- export const fontStyle: string;
32
- }
33
- namespace result {
34
- const width_1: string;
35
- export { width_1 as width };
36
- const padding_1: string;
37
- export { padding_1 as padding };
38
- }
20
+ equipmentTypeTag: {
21
+ minWidth: string;
22
+ maxWidth: string;
23
+ background: string;
24
+ };
25
+ equipmentVlTag: {
26
+ width: string;
27
+ minWidth: string;
28
+ maxWidth: string;
29
+ background: string;
30
+ fontStyle: string;
31
+ };
32
+ result: {
33
+ width: string;
34
+ padding: string;
35
+ };
36
+ };
37
+ export declare enum EquipmentType {
38
+ SUBSTATION = "SUBSTATION",
39
+ LOAD = "LOAD",
40
+ GENERATOR = "GENERATOR",
41
+ LINE = "LINE",
42
+ TWO_WINDINGS_TRANSFORMER = "TWO_WINDINGS_TRANSFORMER",
43
+ BATTERY = "BATTERY",
44
+ SHUNT_COMPENSATOR = "SHUNT_COMPENSATOR",
45
+ VOLTAGE_LEVEL = "VOLTAGE_LEVEL",
46
+ BUSBAR_SECTION = "BUSBAR_SECTION",
47
+ DANGLING_LINE = "DANGLING_LINE",
48
+ HVDC_LINE = "HVDC_LINE",
49
+ THREE_WINDINGS_TRANSFORMER = "THREE_WINDINGS_TRANSFORMER",
50
+ STATIC_VAR_COMPENSATOR = "STATIC_VAR_COMPENSATOR",
51
+ HVDC_CONVERTER_STATION = "HVDC_CONVERTER_STATION",
52
+ VSC_CONVERTER_STATION = "VSC_CONVERTER_STATION",
53
+ LCC_CONVERTER_STATION = "LCC_CONVERTER_STATION",
54
+ BUS = "BUS",
55
+ SWITCH = "SWITCH"
56
+ }
57
+ export declare const EQUIPMENT_TYPE: Record<EquipmentType, {
58
+ name: EquipmentType;
59
+ tagLabel: string;
60
+ } | undefined>;
61
+ export interface Identifiable {
62
+ id: string;
63
+ name?: string;
64
+ }
65
+ export interface Equipment extends Identifiable {
66
+ type: EquipmentType;
67
+ voltageLevels?: Identifiable[];
39
68
  }
40
- export namespace EQUIPMENT_TYPE {
41
- namespace SUBSTATION {
42
- const name: string;
43
- const tagLabel: string;
44
- }
45
- namespace VOLTAGE_LEVEL {
46
- const name_1: string;
47
- export { name_1 as name };
48
- const tagLabel_1: string;
49
- export { tagLabel_1 as tagLabel };
50
- }
51
- namespace LINE {
52
- const name_2: string;
53
- export { name_2 as name };
54
- const tagLabel_2: string;
55
- export { tagLabel_2 as tagLabel };
56
- }
57
- namespace TWO_WINDINGS_TRANSFORMER {
58
- const name_3: string;
59
- export { name_3 as name };
60
- const tagLabel_3: string;
61
- export { tagLabel_3 as tagLabel };
62
- }
63
- namespace THREE_WINDINGS_TRANSFORMER {
64
- const name_4: string;
65
- export { name_4 as name };
66
- const tagLabel_4: string;
67
- export { tagLabel_4 as tagLabel };
68
- }
69
- namespace HVDC_LINE {
70
- const name_5: string;
71
- export { name_5 as name };
72
- const tagLabel_5: string;
73
- export { tagLabel_5 as tagLabel };
74
- }
75
- namespace GENERATOR {
76
- const name_6: string;
77
- export { name_6 as name };
78
- const tagLabel_6: string;
79
- export { tagLabel_6 as tagLabel };
80
- }
81
- namespace BATTERY {
82
- const name_7: string;
83
- export { name_7 as name };
84
- const tagLabel_7: string;
85
- export { tagLabel_7 as tagLabel };
86
- }
87
- namespace LOAD {
88
- const name_8: string;
89
- export { name_8 as name };
90
- const tagLabel_8: string;
91
- export { tagLabel_8 as tagLabel };
92
- }
93
- namespace SHUNT_COMPENSATOR {
94
- const name_9: string;
95
- export { name_9 as name };
96
- const tagLabel_9: string;
97
- export { tagLabel_9 as tagLabel };
98
- }
99
- namespace DANGLING_LINE {
100
- const name_10: string;
101
- export { name_10 as name };
102
- const tagLabel_10: string;
103
- export { tagLabel_10 as tagLabel };
104
- }
105
- namespace STATIC_VAR_COMPENSATOR {
106
- const name_11: string;
107
- export { name_11 as name };
108
- const tagLabel_11: string;
109
- export { tagLabel_11 as tagLabel };
110
- }
111
- namespace HVDC_CONVERTER_STATION {
112
- const name_12: string;
113
- export { name_12 as name };
114
- const tagLabel_12: string;
115
- export { tagLabel_12 as tagLabel };
116
- }
117
- namespace BUSBAR_SECTION {
118
- const name_13: string;
119
- export { name_13 as name };
120
- const tagLabel_13: string;
121
- export { tagLabel_13 as tagLabel };
122
- }
123
- namespace BUS {
124
- const name_14: string;
125
- export { name_14 as name };
126
- const tagLabel_14: string;
127
- export { tagLabel_14 as tagLabel };
128
- }
129
- namespace SWITCH {
130
- const name_15: string;
131
- export { name_15 as name };
132
- const tagLabel_15: string;
133
- export { tagLabel_15 as tagLabel };
134
- }
69
+ export interface EquipmentInfos extends Identifiable {
70
+ label: string;
71
+ key: string;
72
+ type: EquipmentType;
73
+ voltageLevelLabel?: string;
74
+ voltageLevelId?: string;
135
75
  }
136
- export function getEquipmentsInfosForSearchBar(equipmentsInfos: any, getNameOrId: any): any;
76
+ export declare const getEquipmentsInfosForSearchBar: (equipmentsInfos: Equipment[], getNameOrId: (e: Identifiable) => string) => EquipmentInfos[];
@@ -35,74 +35,158 @@ const equipmentStyles = {
35
35
  padding: "2px"
36
36
  }
37
37
  };
38
+ var EquipmentType = /* @__PURE__ */ ((EquipmentType2) => {
39
+ EquipmentType2["SUBSTATION"] = "SUBSTATION";
40
+ EquipmentType2["LOAD"] = "LOAD";
41
+ EquipmentType2["GENERATOR"] = "GENERATOR";
42
+ EquipmentType2["LINE"] = "LINE";
43
+ EquipmentType2["TWO_WINDINGS_TRANSFORMER"] = "TWO_WINDINGS_TRANSFORMER";
44
+ EquipmentType2["BATTERY"] = "BATTERY";
45
+ EquipmentType2["SHUNT_COMPENSATOR"] = "SHUNT_COMPENSATOR";
46
+ EquipmentType2["VOLTAGE_LEVEL"] = "VOLTAGE_LEVEL";
47
+ EquipmentType2["BUSBAR_SECTION"] = "BUSBAR_SECTION";
48
+ EquipmentType2["DANGLING_LINE"] = "DANGLING_LINE";
49
+ EquipmentType2["HVDC_LINE"] = "HVDC_LINE";
50
+ EquipmentType2["THREE_WINDINGS_TRANSFORMER"] = "THREE_WINDINGS_TRANSFORMER";
51
+ EquipmentType2["STATIC_VAR_COMPENSATOR"] = "STATIC_VAR_COMPENSATOR";
52
+ EquipmentType2["HVDC_CONVERTER_STATION"] = "HVDC_CONVERTER_STATION";
53
+ EquipmentType2["VSC_CONVERTER_STATION"] = "VSC_CONVERTER_STATION";
54
+ EquipmentType2["LCC_CONVERTER_STATION"] = "LCC_CONVERTER_STATION";
55
+ EquipmentType2["BUS"] = "BUS";
56
+ EquipmentType2["SWITCH"] = "SWITCH";
57
+ return EquipmentType2;
58
+ })(EquipmentType || {});
38
59
  const EQUIPMENT_TYPE = {
39
- SUBSTATION: {
60
+ [
61
+ "SUBSTATION"
62
+ /* SUBSTATION */
63
+ ]: {
40
64
  name: "SUBSTATION",
41
65
  tagLabel: "equipment_search/substationTag"
42
66
  },
43
- VOLTAGE_LEVEL: {
67
+ [
68
+ "VOLTAGE_LEVEL"
69
+ /* VOLTAGE_LEVEL */
70
+ ]: {
44
71
  name: "VOLTAGE_LEVEL",
45
72
  tagLabel: "equipment_search/voltageLevelTag"
46
73
  },
47
- LINE: {
74
+ [
75
+ "LINE"
76
+ /* LINE */
77
+ ]: {
48
78
  name: "LINE",
49
79
  tagLabel: "equipment_search/lineTag"
50
80
  },
51
- TWO_WINDINGS_TRANSFORMER: {
81
+ [
82
+ "TWO_WINDINGS_TRANSFORMER"
83
+ /* TWO_WINDINGS_TRANSFORMER */
84
+ ]: {
52
85
  name: "TWO_WINDINGS_TRANSFORMER",
53
86
  tagLabel: "equipment_search/2wtTag"
54
87
  },
55
- THREE_WINDINGS_TRANSFORMER: {
88
+ [
89
+ "THREE_WINDINGS_TRANSFORMER"
90
+ /* THREE_WINDINGS_TRANSFORMER */
91
+ ]: {
56
92
  name: "THREE_WINDINGS_TRANSFORMER",
57
93
  tagLabel: "equipment_search/3wtTag"
58
94
  },
59
- HVDC_LINE: {
95
+ [
96
+ "HVDC_LINE"
97
+ /* HVDC_LINE */
98
+ ]: {
60
99
  name: "HVDC_LINE",
61
100
  tagLabel: "equipment_search/hvdcLineTag"
62
101
  },
63
- GENERATOR: {
102
+ [
103
+ "GENERATOR"
104
+ /* GENERATOR */
105
+ ]: {
64
106
  name: "GENERATOR",
65
107
  tagLabel: "equipment_search/generatorTag"
66
108
  },
67
- BATTERY: {
109
+ [
110
+ "BATTERY"
111
+ /* BATTERY */
112
+ ]: {
68
113
  name: "BATTERY",
69
114
  tagLabel: "equipment_search/batteryTag"
70
115
  },
71
- LOAD: {
116
+ [
117
+ "LOAD"
118
+ /* LOAD */
119
+ ]: {
72
120
  name: "LOAD",
73
121
  tagLabel: "equipment_search/loadTag"
74
122
  },
75
- SHUNT_COMPENSATOR: {
123
+ [
124
+ "SHUNT_COMPENSATOR"
125
+ /* SHUNT_COMPENSATOR */
126
+ ]: {
76
127
  name: "SHUNT_COMPENSATOR",
77
128
  tagLabel: "equipment_search/shuntTag"
78
129
  },
79
- DANGLING_LINE: {
130
+ [
131
+ "DANGLING_LINE"
132
+ /* DANGLING_LINE */
133
+ ]: {
80
134
  name: "DANGLING_LINE",
81
135
  tagLabel: "equipment_search/lineTag"
82
136
  },
83
- STATIC_VAR_COMPENSATOR: {
137
+ [
138
+ "STATIC_VAR_COMPENSATOR"
139
+ /* STATIC_VAR_COMPENSATOR */
140
+ ]: {
84
141
  name: "STATIC_VAR_COMPENSATOR",
85
142
  tagLabel: "equipment_search/svcTag"
86
143
  },
87
- HVDC_CONVERTER_STATION: {
144
+ [
145
+ "HVDC_CONVERTER_STATION"
146
+ /* HVDC_CONVERTER_STATION */
147
+ ]: {
88
148
  name: "HVDC_CONVERTER_STATION",
89
149
  tagLabel: "equipment_search/hvdcStationTag"
90
150
  },
91
- BUSBAR_SECTION: {
151
+ [
152
+ "BUSBAR_SECTION"
153
+ /* BUSBAR_SECTION */
154
+ ]: {
92
155
  name: "BUSBAR_SECTION",
93
156
  tagLabel: "equipment_search/busbarSectionTag"
94
157
  },
95
- BUS: {
158
+ [
159
+ "BUS"
160
+ /* BUS */
161
+ ]: {
96
162
  name: "BUS",
97
163
  tagLabel: "equipment_search/busTag"
98
164
  },
99
- SWITCH: {
165
+ [
166
+ "SWITCH"
167
+ /* SWITCH */
168
+ ]: {
100
169
  name: "SWITCH",
101
170
  tagLabel: "equipment_search/switchTag"
171
+ },
172
+ [
173
+ "VSC_CONVERTER_STATION"
174
+ /* VSC_CONVERTER_STATION */
175
+ ]: {
176
+ name: "VSC_CONVERTER_STATION",
177
+ tagLabel: "equipment_search/vscConverterStationTag"
178
+ },
179
+ [
180
+ "LCC_CONVERTER_STATION"
181
+ /* LCC_CONVERTER_STATION */
182
+ ]: {
183
+ name: "LCC_CONVERTER_STATION",
184
+ tagLabel: "equipment_search/lccConverterStationTag"
102
185
  }
103
186
  };
104
187
  const getEquipmentsInfosForSearchBar = (equipmentsInfos, getNameOrId) => {
105
188
  return equipmentsInfos.flatMap((e) => {
189
+ var _a;
106
190
  let label = getNameOrId(e);
107
191
  return e.type === "SUBSTATION" ? [
108
192
  {
@@ -111,7 +195,7 @@ const getEquipmentsInfosForSearchBar = (equipmentsInfos, getNameOrId) => {
111
195
  key: e.id,
112
196
  type: e.type
113
197
  }
114
- ] : e.voltageLevels.map((vli) => {
198
+ ] : ((_a = e.voltageLevels) == null ? void 0 : _a.map((vli) => {
115
199
  return {
116
200
  label,
117
201
  id: e.id,
@@ -120,11 +204,12 @@ const getEquipmentsInfosForSearchBar = (equipmentsInfos, getNameOrId) => {
120
204
  voltageLevelLabel: getNameOrId(vli),
121
205
  voltageLevelId: vli.id
122
206
  };
123
- });
207
+ })) ?? [];
124
208
  });
125
209
  };
126
210
  export {
127
211
  EQUIPMENT_TYPE,
212
+ EquipmentType,
128
213
  TYPE_TAG_MAX_SIZE,
129
214
  VL_TAG_MAX_SIZE,
130
215
  equipmentStyles,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.50.1",
3
+ "version": "0.51.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "engines": {
6
6
  "npm": ">=9",