@gridsuite/commons-ui 0.69.0 → 0.70.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,3 +1,3 @@
1
1
  import { ValueSelectorProps } from 'react-querybuilder';
2
2
 
3
- export declare function FieldSelector({ options, className, value, disabled, handleOnChange, title, }: Readonly<ValueSelectorProps>): import("react/jsx-runtime").JSX.Element;
3
+ export declare function FieldSelector(props: Readonly<ValueSelectorProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,35 +1,17 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { toFlatOptionArray } from "react-querybuilder";
3
- import { Autocomplete, TextField } from "@mui/material";
4
- function FieldSelector({
5
- options,
6
- className,
7
- value,
8
- disabled,
9
- handleOnChange,
10
- title
11
- }) {
12
- const optionList = toFlatOptionArray(options);
13
- return /* @__PURE__ */ jsx(
14
- Autocomplete,
15
- {
16
- onChange: (event, newValue) => {
17
- if (newValue) {
18
- handleOnChange(newValue.name);
19
- }
20
- },
21
- value: optionList.find((option) => option.name === value),
22
- disabled,
23
- className,
24
- options: optionList,
25
- disableClearable: true,
26
- size: "small",
27
- title,
28
- renderInput: (params) => /* @__PURE__ */ jsx(TextField, { ...params, label: "", variant: "standard" }),
29
- autoHighlight: true,
30
- getOptionLabel: (option) => option.label
2
+ import { MaterialValueSelector } from "@react-querybuilder/material";
3
+ const ITEM_HEIGHT = 32;
4
+ const ITEM_PADDING = 4;
5
+ const ITEMS_COUNT = 10;
6
+ const MenuProps = {
7
+ PaperProps: {
8
+ style: {
9
+ maxHeight: (ITEM_HEIGHT + ITEM_PADDING) * ITEMS_COUNT + ITEM_PADDING
31
10
  }
32
- );
11
+ }
12
+ };
13
+ function FieldSelector(props) {
14
+ return /* @__PURE__ */ jsx(MaterialValueSelector, { ...props, MenuProps });
33
15
  }
34
16
  export {
35
17
  FieldSelector
package/dist/index.js CHANGED
@@ -131,7 +131,7 @@ import { getFileIcon } from "./utils/mapper/getFileIcon.js";
131
131
  import { equipmentTypesForPredefinedPropertiesMapper } from "./utils/mapper/equipmentTypesForPredefinedPropertiesMapper.js";
132
132
  import { makeComposeClasses, mergeSx, toNestedGlobalSelectors } from "./utils/styles.js";
133
133
  import { ElementType } from "./utils/types/elementType.js";
134
- import { EQUIPMENT_TYPE, EquipmentType, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./utils/types/equipmentType.js";
134
+ import { EQUIPMENT_TYPE, EquipmentType, OperatingStatus, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./utils/types/equipmentType.js";
135
135
  import { Battery, BusBar, DanglingLine, Generator, Hvdc, LCC, Line, Load, SVC, ShuntCompensator, Substation, ThreeWindingTransfo, TwoWindingTransfo, VSC, VoltageLevel } from "./utils/types/equipmentTypes.js";
136
136
  import "./utils/yupConfig.js";
137
137
  import { cardErrorBoundaryEn } from "./translations/en/cardErrorBoundaryEn.js";
@@ -287,6 +287,7 @@ export {
287
287
  NO_SELECTION_FOR_COPY,
288
288
  NumericEditor,
289
289
  OPERATOR_OPTIONS,
290
+ OperatingStatus,
290
291
  OperatorType,
291
292
  OverflowableText,
292
293
  PHASE_REGULATION_MODE_OPTIONS,
@@ -8,7 +8,7 @@ import { getFileIcon } from "./mapper/getFileIcon.js";
8
8
  import { equipmentTypesForPredefinedPropertiesMapper } from "./mapper/equipmentTypesForPredefinedPropertiesMapper.js";
9
9
  import { makeComposeClasses, mergeSx, toNestedGlobalSelectors } from "./styles.js";
10
10
  import { ElementType } from "./types/elementType.js";
11
- import { EQUIPMENT_TYPE, EquipmentType, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./types/equipmentType.js";
11
+ import { EQUIPMENT_TYPE, EquipmentType, OperatingStatus, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./types/equipmentType.js";
12
12
  import { Battery, BusBar, DanglingLine, Generator, Hvdc, LCC, Line, Load, SVC, ShuntCompensator, Substation, ThreeWindingTransfo, TwoWindingTransfo, VSC, VoltageLevel } from "./types/equipmentTypes.js";
13
13
  import "./yupConfig.js";
14
14
  import * as yup from "yup";
@@ -32,6 +32,7 @@ export {
32
32
  LIGHT_THEME,
33
33
  Line,
34
34
  Load,
35
+ OperatingStatus,
35
36
  SVC,
36
37
  ShuntCompensator,
37
38
  Substation,
@@ -58,7 +58,10 @@ export declare enum EquipmentType {
58
58
  HVDC_CONVERTER_STATION = "HVDC_CONVERTER_STATION",
59
59
  VSC_CONVERTER_STATION = "VSC_CONVERTER_STATION",
60
60
  LCC_CONVERTER_STATION = "LCC_CONVERTER_STATION",
61
- DANGLING_LINE = "DANGLING_LINE"
61
+ DANGLING_LINE = "DANGLING_LINE",
62
+ TIE_LINE = "TIE_LINE",
63
+ DISCONNECTOR = "DISCONNECTOR",
64
+ BREAKER = "BREAKER"
62
65
  }
63
66
  export declare const EQUIPMENT_TYPE: Record<EquipmentType, {
64
67
  name: EquipmentType;
@@ -78,5 +81,17 @@ export interface EquipmentInfos extends Identifiable {
78
81
  type: EquipmentType;
79
82
  voltageLevelLabel?: string;
80
83
  voltageLevelId?: string;
84
+ operatingStatus?: string;
85
+ terminal1Connected?: boolean;
86
+ terminal2Connected?: boolean;
87
+ voltageLevelId1?: string;
88
+ voltageLevelName1?: string;
89
+ voltageLevelId2?: string;
90
+ voltageLevelName2?: string;
81
91
  }
92
+ export declare const OperatingStatus: {
93
+ IN_OPERATION: string;
94
+ PLANNED_OUTAGE: string;
95
+ FORCED_OUTAGE: string;
96
+ };
82
97
  export declare const getEquipmentsInfosForSearchBar: (equipmentsInfos: Equipment[], getNameOrId: (e: Identifiable) => string) => EquipmentInfos[];
@@ -60,6 +60,9 @@ var EquipmentType = /* @__PURE__ */ ((EquipmentType2) => {
60
60
  EquipmentType2["VSC_CONVERTER_STATION"] = "VSC_CONVERTER_STATION";
61
61
  EquipmentType2["LCC_CONVERTER_STATION"] = "LCC_CONVERTER_STATION";
62
62
  EquipmentType2["DANGLING_LINE"] = "DANGLING_LINE";
63
+ EquipmentType2["TIE_LINE"] = "TIE_LINE";
64
+ EquipmentType2["DISCONNECTOR"] = "DISCONNECTOR";
65
+ EquipmentType2["BREAKER"] = "BREAKER";
63
66
  return EquipmentType2;
64
67
  })(EquipmentType || {});
65
68
  const EQUIPMENT_TYPE = {
@@ -188,7 +191,27 @@ const EQUIPMENT_TYPE = {
188
191
  ]: {
189
192
  name: "LCC_CONVERTER_STATION",
190
193
  tagLabel: "equipment_search/lccConverterStationTag"
191
- }
194
+ },
195
+ [
196
+ "TIE_LINE"
197
+ /* TIE_LINE */
198
+ ]: void 0,
199
+ // Not used in the UI
200
+ [
201
+ "DISCONNECTOR"
202
+ /* DISCONNECTOR */
203
+ ]: void 0,
204
+ // Not used in the UI
205
+ [
206
+ "BREAKER"
207
+ /* BREAKER */
208
+ ]: void 0
209
+ // Not used in the UI
210
+ };
211
+ const OperatingStatus = {
212
+ IN_OPERATION: "IN_OPERATION",
213
+ PLANNED_OUTAGE: "PLANNED_OUTAGE",
214
+ FORCED_OUTAGE: "FORCED_OUTAGE"
192
215
  };
193
216
  const getEquipmentsInfosForSearchBar = (equipmentsInfos, getNameOrId) => {
194
217
  return equipmentsInfos.flatMap((e) => {
@@ -216,6 +239,7 @@ const getEquipmentsInfosForSearchBar = (equipmentsInfos, getNameOrId) => {
216
239
  export {
217
240
  EQUIPMENT_TYPE,
218
241
  EquipmentType,
242
+ OperatingStatus,
219
243
  TYPE_TAG_MAX_SIZE,
220
244
  VL_TAG_MAX_SIZE,
221
245
  equipmentStyles,
@@ -1,5 +1,5 @@
1
1
  import { ElementType } from "./elementType.js";
2
- import { EQUIPMENT_TYPE, EquipmentType, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./equipmentType.js";
2
+ import { EQUIPMENT_TYPE, EquipmentType, OperatingStatus, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./equipmentType.js";
3
3
  import { Battery, BusBar, DanglingLine, Generator, Hvdc, LCC, Line, Load, SVC, ShuntCompensator, Substation, ThreeWindingTransfo, TwoWindingTransfo, VSC, VoltageLevel } from "./equipmentTypes.js";
4
4
  export {
5
5
  Battery,
@@ -13,6 +13,7 @@ export {
13
13
  LCC,
14
14
  Line,
15
15
  Load,
16
+ OperatingStatus,
16
17
  SVC,
17
18
  ShuntCompensator,
18
19
  Substation,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.69.0",
3
+ "version": "0.70.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "engines": {
6
6
  "npm": ">=9",