@gridsuite/commons-ui 0.59.0 → 0.59.2

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 (30) hide show
  1. package/dist/chunks/{criteria-based-filter-edition-dialog.p2pUWzxc.js → criteria-based-filter-edition-dialog.CszM47bS.js} +11 -6
  2. package/dist/components/CustomAGGrid/custom-aggrid.d.ts +11 -0
  3. package/dist/components/CustomAGGrid/custom-aggrid.js +73 -0
  4. package/dist/components/CustomAGGrid/custom-aggrid.style.d.ts +20 -0
  5. package/dist/components/CustomAGGrid/custom-aggrid.style.js +47 -0
  6. package/dist/components/filter/criteria-based/criteria-based-filter-edition-dialog.js +1 -1
  7. package/dist/components/filter/expert/expert-filter-edition-dialog.js +1 -1
  8. package/dist/components/filter/expert/expert-filter-form.js +1 -1
  9. package/dist/components/filter/explicit-naming/explicit-naming-filter-edition-dialog.js +1 -1
  10. package/dist/components/filter/explicit-naming/explicit-naming-filter-form.js +1 -1
  11. package/dist/components/filter/filter-creation-dialog.js +1 -1
  12. package/dist/components/filter/filter-form.js +1 -1
  13. package/dist/components/filter/utils/filter-form-utils.d.ts +3 -2
  14. package/dist/components/filter/utils/filter-form-utils.js +42 -21
  15. package/dist/components/inputs/react-hook-form/ag-grid-table/bottom-right-buttons.js +1 -1
  16. package/dist/components/inputs/react-hook-form/ag-grid-table/csv-uploader/csv-uploader.js +2 -1
  17. package/dist/components/inputs/react-hook-form/ag-grid-table/custom-ag-grid-table.js +1 -1
  18. package/dist/components/inputs/react-hook-form/error-management/error-input.js +10 -8
  19. package/dist/components/inputs/react-query-builder/custom-react-query-builder.js +1 -1
  20. package/dist/components/inputs/react-query-builder/element-value-editor.js +2 -1
  21. package/dist/components/inputs/react-query-builder/remove-button.js +1 -1
  22. package/dist/components/inputs/react-query-builder/value-editor.js +1 -1
  23. package/dist/index.d.ts +2 -0
  24. package/dist/index.js +13 -11
  25. package/dist/module-mui.d.js +1 -0
  26. package/dist/utils/ElementIcon.d.ts +2 -2
  27. package/dist/utils/EquipmentType.d.ts +13 -9
  28. package/dist/utils/EquipmentType.js +9 -9
  29. package/dist/utils/types.d.ts +3 -0
  30. package/package.json +1 -1
@@ -52,6 +52,7 @@ import "autosuggest-highlight/match";
52
52
  import "autosuggest-highlight/parse";
53
53
  import "../components/CardErrorBoundary/card-error-boundary.js";
54
54
  import "@mui/icons-material/Folder";
55
+ import "../components/CustomAGGrid/custom-aggrid.js";
55
56
  import { saveExplicitNamingFilter, saveCriteriaBasedFilter, saveExpertFilter } from "../components/filter/utils/filter-api.js";
56
57
  import { formatQuery, QueryBuilder } from "react-querybuilder";
57
58
  import { getNumberOfSiblings, recursiveRemove, countRules, getOperators, queryValidator, testQuery, importExpertRules } from "../components/filter/expert/expert-filter-utils.js";
@@ -475,10 +476,14 @@ const CustomAgGridTable = ({
475
476
  });
476
477
  const { append, remove, update, swap, move } = useFieldArrayOutput;
477
478
  const rowData = watch(name);
478
- const isFirstSelected = (rowData == null ? void 0 : rowData.length) && ((_a = gridApi == null ? void 0 : gridApi.api.getRowNode(rowData[0][FieldConstants.AG_GRID_ROW_UUID])) == null ? void 0 : _a.isSelected());
479
- const isLastSelected = (rowData == null ? void 0 : rowData.length) && ((_b = gridApi == null ? void 0 : gridApi.api.getRowNode(
480
- rowData[rowData.length - 1][FieldConstants.AG_GRID_ROW_UUID]
481
- )) == null ? void 0 : _b.isSelected());
479
+ const isFirstSelected = Boolean(
480
+ (rowData == null ? void 0 : rowData.length) && ((_a = gridApi == null ? void 0 : gridApi.api.getRowNode(rowData[0][FieldConstants.AG_GRID_ROW_UUID])) == null ? void 0 : _a.isSelected())
481
+ );
482
+ const isLastSelected = Boolean(
483
+ (rowData == null ? void 0 : rowData.length) && ((_b = gridApi == null ? void 0 : gridApi.api.getRowNode(
484
+ rowData[rowData.length - 1][FieldConstants.AG_GRID_ROW_UUID]
485
+ )) == null ? void 0 : _b.isSelected())
486
+ );
482
487
  const noRowSelected = selectedRows.length === 0;
483
488
  const handleMoveRowUp = () => {
484
489
  selectedRows.map((row) => getIndex(row)).sort().forEach((idx) => {
@@ -546,12 +551,12 @@ const CustomAgGridTable = ({
546
551
  {
547
552
  item: true,
548
553
  xs: 12,
549
- className: theme.aggrid,
554
+ className: theme.aggrid.theme,
550
555
  sx: style(cssProps).grid,
551
556
  children: /* @__PURE__ */ jsx(
552
557
  AgGridReact,
553
558
  {
554
- rowData: gridApi && (rowData == null ? void 0 : rowData.length) ? rowData : null,
559
+ rowData,
555
560
  onGridReady,
556
561
  getLocaleText,
557
562
  cacheOverflowSize: 10,
@@ -0,0 +1,11 @@
1
+ import { AgGridReact, AgGridReactProps } from 'ag-grid-react';
2
+ import { default as React } from 'react';
3
+
4
+ interface CustomAGGGridStyleProps {
5
+ shouldHidePinnedHeaderRightBorder?: boolean;
6
+ showOverlay?: boolean;
7
+ }
8
+ interface CustomAGGridProps extends AgGridReactProps, CustomAGGGridStyleProps {
9
+ }
10
+ declare const CustomAGGrid: React.ForwardRefExoticComponent<CustomAGGridProps & React.RefAttributes<AgGridReact<any>>>;
11
+ export default CustomAGGrid;
@@ -0,0 +1,73 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import React, { useCallback } from "react";
3
+ import { AgGridReact } from "ag-grid-react";
4
+ import { useIntl } from "react-intl";
5
+ import "ag-grid-community/styles/ag-grid.css";
6
+ import "ag-grid-community/styles/ag-theme-alpine.css";
7
+ import { Box } from "@mui/system";
8
+ import { mergeSx } from "../../utils/styles.js";
9
+ import { useTheme } from "@mui/material";
10
+ import { CUSTOM_AGGRID_THEME, styles } from "./custom-aggrid.style.js";
11
+ const onColumnResized = (params) => {
12
+ var _a;
13
+ const { column, finished } = params;
14
+ const colDefinedMinWidth = (_a = column == null ? void 0 : column.getColDef()) == null ? void 0 : _a.minWidth;
15
+ if (column && colDefinedMinWidth && finished) {
16
+ const newWidth = column == null ? void 0 : column.getActualWidth();
17
+ if (newWidth < colDefinedMinWidth) {
18
+ column == null ? void 0 : column.setActualWidth(colDefinedMinWidth, params.source);
19
+ }
20
+ }
21
+ };
22
+ const CustomAGGrid = React.forwardRef(
23
+ (props, ref) => {
24
+ const {
25
+ shouldHidePinnedHeaderRightBorder = false,
26
+ overlayNoRowsTemplate,
27
+ loadingOverlayComponent,
28
+ loadingOverlayComponentParams,
29
+ showOverlay = false
30
+ } = props;
31
+ const theme = useTheme();
32
+ const intl = useIntl();
33
+ const GRID_PREFIX = "grid.";
34
+ const getLocaleText = useCallback(
35
+ (params) => {
36
+ const key = GRID_PREFIX + params.key;
37
+ return intl.formatMessage({
38
+ id: key,
39
+ defaultMessage: params.defaultValue
40
+ });
41
+ },
42
+ [intl]
43
+ );
44
+ return /* @__PURE__ */ jsx(
45
+ Box,
46
+ {
47
+ sx: mergeSx(
48
+ styles.grid,
49
+ shouldHidePinnedHeaderRightBorder ? styles.noBorderRight : void 0,
50
+ showOverlay ? styles.overlayBackground : void 0
51
+ ),
52
+ className: `${theme.aggrid.theme} ${CUSTOM_AGGRID_THEME}`,
53
+ children: /* @__PURE__ */ jsx(
54
+ AgGridReact,
55
+ {
56
+ ref,
57
+ getLocaleText,
58
+ suppressPropertyNamesCheck: true,
59
+ loadingOverlayComponent,
60
+ loadingOverlayComponentParams,
61
+ overlayNoRowsTemplate,
62
+ onColumnResized,
63
+ enableCellTextSelection: true,
64
+ ...props
65
+ }
66
+ )
67
+ }
68
+ );
69
+ }
70
+ );
71
+ export {
72
+ CustomAGGrid as default
73
+ };
@@ -0,0 +1,20 @@
1
+ import { SystemStyleObject } from '@mui/system/styleFunctionSx/styleFunctionSx';
2
+ import { Theme } from '@mui/material/styles/createTheme';
3
+
4
+ export declare const CUSTOM_AGGRID_THEME = "custom-aggrid-theme";
5
+ export declare const styles: {
6
+ grid: (theme: Theme) => SystemStyleObject<Theme>;
7
+ noBorderRight: {
8
+ '& .ag-pinned-left-header': {
9
+ borderRight: string;
10
+ };
11
+ };
12
+ overlayBackground: (theme: Theme) => {
13
+ '& .ag-overlay-loading-wrapper': {
14
+ background: string;
15
+ };
16
+ '& .ag-overlay-no-rows-wrapper': {
17
+ background: string;
18
+ };
19
+ };
20
+ };
@@ -0,0 +1,47 @@
1
+ const CUSTOM_AGGRID_THEME = "custom-aggrid-theme";
2
+ const styles = {
3
+ grid: (theme) => ({
4
+ width: "auto",
5
+ height: "100%",
6
+ position: "relative",
7
+ [`&.${CUSTOM_AGGRID_THEME}`]: {
8
+ "--ag-value-change-value-highlight-background-color": theme.aggrid.valueChangeHighlightBackgroundColor,
9
+ "--ag-selected-row-background-color": theme.aggrid.highlightColor,
10
+ "--ag-row-hover-color": theme.aggrid.highlightColor
11
+ },
12
+ "& .ag-checkbox-input": {
13
+ cursor: "pointer"
14
+ },
15
+ //overrides the default computed max height for ag grid default selector editor to make it more usable
16
+ //can be removed if a custom selector editor is implemented
17
+ "& .ag-select-list": {
18
+ maxHeight: "300px !important"
19
+ },
20
+ //allows to hide the scrollbar in the pinned rows section as it is unecessary to our implementation
21
+ "& .ag-body-horizontal-scroll:not(.ag-scrollbar-invisible) .ag-horizontal-left-spacer:not(.ag-scroller-corner)": {
22
+ visibility: "hidden"
23
+ },
24
+ //removes border on focused cell - using "suppressCellFocus" Aggrid option causes side effects and breaks field edition
25
+ "& .ag-cell-focus, .ag-cell": {
26
+ border: "none !important"
27
+ }
28
+ }),
29
+ noBorderRight: {
30
+ // hides right border for header of "Edit" column due to column being pinned
31
+ "& .ag-pinned-left-header": {
32
+ borderRight: "none"
33
+ }
34
+ },
35
+ overlayBackground: (theme) => ({
36
+ "& .ag-overlay-loading-wrapper": {
37
+ background: theme.aggrid.overlay.background
38
+ },
39
+ "& .ag-overlay-no-rows-wrapper": {
40
+ background: "none"
41
+ }
42
+ })
43
+ };
44
+ export {
45
+ CUSTOM_AGGRID_THEME,
46
+ styles
47
+ };
@@ -8,7 +8,7 @@ import "react-hook-form";
8
8
  import "@hookform/resolvers/yup";
9
9
  import "./criteria-based-filter-form.js";
10
10
  import "../../../utils/yup-config.js";
11
- import { b, p } from "../../../chunks/criteria-based-filter-edition-dialog.p2pUWzxc.js";
11
+ import { b, p } from "../../../chunks/criteria-based-filter-edition-dialog.CszM47bS.js";
12
12
  import "../constants/filter-constants.js";
13
13
  import "../../../utils/FetchStatus.js";
14
14
  import "../../../services/explore.js";
@@ -7,7 +7,7 @@ import "@hookform/resolvers/yup";
7
7
  import "../../../hooks/useSnackMessage.js";
8
8
  import "../../dialogs/custom-mui-dialog.js";
9
9
  import "../../../utils/yup-config.js";
10
- import { E } from "../../../chunks/criteria-based-filter-edition-dialog.p2pUWzxc.js";
10
+ import { E } from "../../../chunks/criteria-based-filter-edition-dialog.CszM47bS.js";
11
11
  import "../utils/filter-api.js";
12
12
  import "./expert-filter-utils.js";
13
13
  import "../constants/filter-constants.js";
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "@mui/material/Grid";
4
4
  import "react-querybuilder";
5
- import { k, n, l, m } from "../../../chunks/criteria-based-filter-edition-dialog.p2pUWzxc.js";
5
+ import { k, n, l, m } from "../../../chunks/criteria-based-filter-edition-dialog.CszM47bS.js";
6
6
  import "react-hook-form";
7
7
  import "./expert-filter-utils.js";
8
8
  import "./expert-filter-constants.js";
@@ -7,7 +7,7 @@ import "@hookform/resolvers/yup";
7
7
  import "../../../hooks/useSnackMessage.js";
8
8
  import "../../dialogs/custom-mui-dialog.js";
9
9
  import "../../../utils/yup-config.js";
10
- import { a } from "../../../chunks/criteria-based-filter-edition-dialog.p2pUWzxc.js";
10
+ import { a } from "../../../chunks/criteria-based-filter-edition-dialog.CszM47bS.js";
11
11
  import "../../../utils/field-constants.js";
12
12
  import "uuid";
13
13
  import "../../../utils/equipment-types.js";
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "../../../utils/field-constants.js";
4
4
  import "../../../utils/yup-config.js";
5
- import { d, f, e, g } from "../../../chunks/criteria-based-filter-edition-dialog.p2pUWzxc.js";
5
+ import { d, f, e, g } from "../../../chunks/criteria-based-filter-edition-dialog.CszM47bS.js";
6
6
  import "react-intl";
7
7
  import "react-hook-form";
8
8
  import "@mui/material/Grid";
@@ -5,7 +5,7 @@ import "react-hook-form";
5
5
  import "../../hooks/useSnackMessage.js";
6
6
  import "../dialogs/custom-mui-dialog.js";
7
7
  import "./criteria-based/criteria-based-filter-form.js";
8
- import { F } from "../../chunks/criteria-based-filter-edition-dialog.p2pUWzxc.js";
8
+ import { F } from "../../chunks/criteria-based-filter-edition-dialog.CszM47bS.js";
9
9
  import "../../utils/field-constants.js";
10
10
  import "../../utils/yup-config.js";
11
11
  import "@hookform/resolvers/yup";
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
2
2
  import "../inputs/react-hook-form/unique-name-input.js";
3
3
  import "../../utils/field-constants.js";
4
4
  import "./criteria-based/criteria-based-filter-form.js";
5
- import { o } from "../../chunks/criteria-based-filter-edition-dialog.p2pUWzxc.js";
5
+ import { o } from "../../chunks/criteria-based-filter-edition-dialog.CszM47bS.js";
6
6
  import "react";
7
7
  import "react-hook-form";
8
8
  import "@mui/material";
@@ -1,3 +1,4 @@
1
+ import { EquipmentType } from '../../../utils/EquipmentType';
1
2
  import { FunctionComponent } from 'react';
2
3
 
3
4
  type FormField = {
@@ -12,6 +13,6 @@ export type FormEquipment = {
12
13
  label: string;
13
14
  fields: FormField[];
14
15
  };
15
- export declare const CONTINGENCY_LIST_EQUIPMENTS: Record<string, FormEquipment>;
16
- export declare const FILTER_EQUIPMENTS: Record<string, FormEquipment>;
16
+ export declare const CONTINGENCY_LIST_EQUIPMENTS: Record<EquipmentType.BUSBAR_SECTION | EquipmentType.LINE | EquipmentType.TWO_WINDINGS_TRANSFORMER | EquipmentType.GENERATOR | EquipmentType.SHUNT_COMPENSATOR | EquipmentType.HVDC_LINE | EquipmentType.DANGLING_LINE, FormEquipment>;
17
+ export declare const FILTER_EQUIPMENTS: Record<EquipmentType.SUBSTATION | EquipmentType.VOLTAGE_LEVEL | EquipmentType.LINE | EquipmentType.TWO_WINDINGS_TRANSFORMER | EquipmentType.THREE_WINDINGS_TRANSFORMER | EquipmentType.GENERATOR | EquipmentType.BATTERY | EquipmentType.LOAD | EquipmentType.SHUNT_COMPENSATOR | EquipmentType.STATIC_VAR_COMPENSATOR | EquipmentType.HVDC_LINE | EquipmentType.DANGLING_LINE, FormEquipment>;
17
18
  export {};
@@ -66,7 +66,12 @@ const energySource = {
66
66
  ]
67
67
  }
68
68
  };
69
- const COMMON_EQUIPMENTS = {
69
+ const CONTINGENCY_LIST_EQUIPMENTS = {
70
+ BUSBAR_SECTION: {
71
+ id: "BUSBAR_SECTION",
72
+ label: "BusBarSections",
73
+ fields: [countries, nominalVoltage]
74
+ },
70
75
  LINE: {
71
76
  id: "LINE",
72
77
  label: "Lines",
@@ -98,16 +103,27 @@ const COMMON_EQUIPMENTS = {
98
103
  fields: [countries, nominalVoltage]
99
104
  }
100
105
  };
101
- const CONTINGENCY_LIST_EQUIPMENTS = {
102
- ...COMMON_EQUIPMENTS,
103
- BUSBAR_SECTION: {
104
- id: "BUSBAR_SECTION",
105
- label: "BusBarSections",
106
- fields: [countries, nominalVoltage]
107
- }
108
- };
109
106
  const FILTER_EQUIPMENTS = {
110
- ...COMMON_EQUIPMENTS,
107
+ SUBSTATION: {
108
+ id: "SUBSTATION",
109
+ label: "Substations",
110
+ fields: [countries, nominalVoltage]
111
+ },
112
+ VOLTAGE_LEVEL: {
113
+ id: "VOLTAGE_LEVEL",
114
+ label: "VoltageLevels",
115
+ fields: [countries, nominalVoltage]
116
+ },
117
+ LINE: {
118
+ id: "LINE",
119
+ label: "Lines",
120
+ fields: [countries1, countries2, nominalVoltage1, nominalVoltage2]
121
+ },
122
+ TWO_WINDINGS_TRANSFORMER: {
123
+ id: "TWO_WINDINGS_TRANSFORMER",
124
+ label: "TwoWindingsTransformers",
125
+ fields: [countries, nominalVoltage1, nominalVoltage2]
126
+ },
111
127
  THREE_WINDINGS_TRANSFORMER: {
112
128
  id: "THREE_WINDINGS_TRANSFORMER",
113
129
  label: "ThreeWindingsTransformers",
@@ -118,30 +134,35 @@ const FILTER_EQUIPMENTS = {
118
134
  label: "Generators",
119
135
  fields: [countries, energySource, nominalVoltage]
120
136
  },
121
- LOAD: {
122
- id: "LOAD",
123
- label: "Loads",
124
- fields: [countries, nominalVoltage]
125
- },
126
137
  BATTERY: {
127
138
  id: "BATTERY",
128
139
  label: "Batteries",
129
140
  fields: [countries, nominalVoltage]
130
141
  },
131
- VOLTAGE_LEVEL: {
132
- id: "VOLTAGE_LEVEL",
133
- label: "VoltageLevels",
142
+ LOAD: {
143
+ id: "LOAD",
144
+ label: "Loads",
134
145
  fields: [countries, nominalVoltage]
135
146
  },
136
- SUBSTATION: {
137
- id: "SUBSTATION",
138
- label: "Substations",
147
+ SHUNT_COMPENSATOR: {
148
+ id: "SHUNT_COMPENSATOR",
149
+ label: "ShuntCompensators",
139
150
  fields: [countries, nominalVoltage]
140
151
  },
141
152
  STATIC_VAR_COMPENSATOR: {
142
153
  id: "STATIC_VAR_COMPENSATOR",
143
154
  label: "StaticVarCompensators",
144
155
  fields: [countries, nominalVoltage]
156
+ },
157
+ HVDC_LINE: {
158
+ id: "HVDC_LINE",
159
+ label: "Hvdc",
160
+ fields: [countries1, countries2, nominalVoltage]
161
+ },
162
+ DANGLING_LINE: {
163
+ id: "DANGLING_LINE",
164
+ label: "DanglingLines",
165
+ fields: [countries, nominalVoltage]
145
166
  }
146
167
  };
147
168
  export {
@@ -4,7 +4,7 @@ import "@mui/material/IconButton";
4
4
  import "@mui/icons-material";
5
5
  import "@mui/icons-material/ControlPoint";
6
6
  import "@mui/icons-material/Delete";
7
- import { B } from "../../../../chunks/criteria-based-filter-edition-dialog.p2pUWzxc.js";
7
+ import { B } from "../../../../chunks/criteria-based-filter-edition-dialog.CszM47bS.js";
8
8
  import "react";
9
9
  import "react-intl";
10
10
  import "@mui/material/styles";
@@ -34,7 +34,7 @@ import "../../../../dialogs/description-modification-dialog.js";
34
34
  import "../../../../../utils/field-constants.js";
35
35
  import "yup";
36
36
  import "../../../../dialogs/popup-confirmation-dialog.js";
37
- import { c } from "../../../../../chunks/criteria-based-filter-edition-dialog.p2pUWzxc.js";
37
+ import { c } from "../../../../../chunks/criteria-based-filter-edition-dialog.CszM47bS.js";
38
38
  import "ag-grid-react";
39
39
  import "ag-grid-community/styles/ag-grid.css";
40
40
  import "ag-grid-community/styles/ag-theme-alpine.css";
@@ -42,6 +42,7 @@ import "autosuggest-highlight/match";
42
42
  import "autosuggest-highlight/parse";
43
43
  import "../../../../CardErrorBoundary/card-error-boundary.js";
44
44
  import "@mui/icons-material/Folder";
45
+ import "../../../../CustomAGGrid/custom-aggrid.js";
45
46
  import "../../../../../chunks/filter-properties.B7-q_yPf.js";
46
47
  import "@mui/icons-material/Delete";
47
48
  import "@mui/material/IconButton";
@@ -5,7 +5,7 @@ import "ag-grid-react";
5
5
  import "ag-grid-community/styles/ag-grid.css";
6
6
  import "ag-grid-community/styles/ag-theme-alpine.css";
7
7
  import "@mui/material";
8
- import { C, R, C as C2 } from "../../../../chunks/criteria-based-filter-edition-dialog.p2pUWzxc.js";
8
+ import { C, R, C as C2 } from "../../../../chunks/criteria-based-filter-edition-dialog.CszM47bS.js";
9
9
  import "react-intl";
10
10
  import "../../../../utils/field-constants.js";
11
11
  export {
@@ -6,6 +6,7 @@ const ErrorInput = ({
6
6
  name,
7
7
  InputField
8
8
  }) => {
9
+ var _a;
9
10
  const {
10
11
  fieldState: { error },
11
12
  formState: { isSubmitting }
@@ -13,16 +14,16 @@ const ErrorInput = ({
13
14
  name
14
15
  });
15
16
  const errorRef = useRef(null);
16
- const errorProps = (errorMsg) => {
17
- if (typeof errorMsg === "string") {
17
+ const errorProps = (errorMsg2) => {
18
+ if (typeof errorMsg2 === "string") {
18
19
  return {
19
- id: errorMsg
20
+ id: errorMsg2
20
21
  };
21
- } else if (typeof errorMsg === "object") {
22
+ } else if (typeof errorMsg2 === "object") {
22
23
  return {
23
- id: errorMsg.id,
24
+ id: errorMsg2.id,
24
25
  values: {
25
- value: errorMsg.value
26
+ value: errorMsg2.value
26
27
  }
27
28
  };
28
29
  }
@@ -33,8 +34,9 @@ const ErrorInput = ({
33
34
  errorRef.current.scrollIntoView({ behavior: "smooth" });
34
35
  }
35
36
  }, [isSubmitting]);
36
- return /* @__PURE__ */ jsx(Fragment, { children: (error == null ? void 0 : error.message) && /* @__PURE__ */ jsx("div", { ref: errorRef, children: InputField({
37
- message: /* @__PURE__ */ jsx(FormattedMessage, { ...errorProps(error == null ? void 0 : error.message) })
37
+ const errorMsg = (error == null ? void 0 : error.message) || ((_a = error == null ? void 0 : error.root) == null ? void 0 : _a.message);
38
+ return /* @__PURE__ */ jsx(Fragment, { children: errorMsg && /* @__PURE__ */ jsx("div", { ref: errorRef, children: InputField({
39
+ message: /* @__PURE__ */ jsx(FormattedMessage, { ...errorProps(errorMsg) })
38
40
  }) }) });
39
41
  };
40
42
  export {
@@ -7,7 +7,7 @@ import "@react-querybuilder/material";
7
7
  import "react-querybuilder";
8
8
  import "react-intl";
9
9
  import "react-hook-form";
10
- import { j } from "../../../chunks/criteria-based-filter-edition-dialog.p2pUWzxc.js";
10
+ import { j } from "../../../chunks/criteria-based-filter-edition-dialog.CszM47bS.js";
11
11
  import "./combinator-selector.js";
12
12
  import "./add-button.js";
13
13
  import "./value-selector.js";
@@ -26,7 +26,7 @@ import "../../../services/explore.js";
26
26
  import "yup";
27
27
  import "../react-hook-form/provider/use-custom-form-context.js";
28
28
  import "../../dialogs/popup-confirmation-dialog.js";
29
- import { i } from "../../../chunks/criteria-based-filter-edition-dialog.p2pUWzxc.js";
29
+ import { i } from "../../../chunks/criteria-based-filter-edition-dialog.CszM47bS.js";
30
30
  import "ag-grid-react";
31
31
  import "ag-grid-community/styles/ag-grid.css";
32
32
  import "ag-grid-community/styles/ag-theme-alpine.css";
@@ -34,6 +34,7 @@ import "autosuggest-highlight/match";
34
34
  import "autosuggest-highlight/parse";
35
35
  import "../../CardErrorBoundary/card-error-boundary.js";
36
36
  import "../react-hook-form/directory-items-input.js";
37
+ import "../../CustomAGGrid/custom-aggrid.js";
37
38
  import "../../../chunks/filter-properties.B7-q_yPf.js";
38
39
  import "@mui/icons-material/Delete";
39
40
  import "@mui/material/IconButton";
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
2
2
  import "@mui/material/IconButton";
3
3
  import "@mui/icons-material/Delete";
4
4
  import "react-hook-form";
5
- import { h } from "../../../chunks/criteria-based-filter-edition-dialog.p2pUWzxc.js";
5
+ import { h } from "../../../chunks/criteria-based-filter-edition-dialog.CszM47bS.js";
6
6
  import "../../filter/expert/expert-filter-utils.js";
7
7
  export {
8
8
  h as default
@@ -9,7 +9,7 @@ import "react-hook-form";
9
9
  import "../../../utils/field-constants.js";
10
10
  import "../../filter/expert/expert-filter.type.js";
11
11
  import "../../../utils/equipment-types.js";
12
- import { V } from "../../../chunks/criteria-based-filter-edition-dialog.p2pUWzxc.js";
12
+ import { V } from "../../../chunks/criteria-based-filter-edition-dialog.CszM47bS.js";
13
13
  import "../../../utils/ElementType.js";
14
14
  import "./property-value-editor.js";
15
15
  import "../../filter/constants/filter-constants.js";
package/dist/index.d.ts CHANGED
@@ -96,6 +96,7 @@ export { genHelperPreviousValue, genHelperError, identity, isFieldRequired, grid
96
96
  export { keyGenerator, areArrayElementsUnique, isObjectEmpty, } from './utils/functions';
97
97
  export { default as DirectoryItemsInput } from './components/inputs/react-hook-form/directory-items-input';
98
98
  export { default as DirectoryItemSelector } from './components/DirectoryItemSelector/directory-item-selector';
99
+ export { default as CustomAGGrid } from './components/CustomAGGrid/custom-aggrid';
99
100
  export { RawReadOnlyInput } from './components/inputs/react-hook-form/raw-read-only-input';
100
101
  export { default as FilterCreationDialog } from './components/filter/filter-creation-dialog';
101
102
  export { default as ExpertFilterEditionDialog } from './components/filter/expert/expert-filter-edition-dialog';
@@ -112,6 +113,7 @@ export { default as CsvUploader } from './components/inputs/react-hook-form/ag-g
112
113
  export { UniqueNameInput } from './components/inputs/react-hook-form/unique-name-input';
113
114
  export { UserManagerMock } from './utils/UserManagerMock';
114
115
  export { FILTER_EQUIPMENTS, CONTINGENCY_LIST_EQUIPMENTS, } from './components/filter/utils/filter-form-utils';
116
+ export type { FormEquipment } from './components/filter/utils/filter-form-utils';
115
117
  export { getCriteriaBasedFormData, getCriteriaBasedSchema, } from './components/filter/criteria-based/criteria-based-filter-utils';
116
118
  export { mergeSx } from './utils/styles';
117
119
  export { setCommonStore } from './redux/commonStore';
package/dist/index.js CHANGED
@@ -21,7 +21,7 @@ import { default as default13 } from "./components/dialogs/description-modificat
21
21
  import { default as default14 } from "./components/dialogs/modify-element-selection.js";
22
22
  import { default as default15 } from "./components/filter/criteria-based/criteria-based-form.js";
23
23
  import { default as default16 } from "./components/dialogs/popup-confirmation-dialog.js";
24
- import { B, b, c, C, E, a, F, R } from "./chunks/criteria-based-filter-edition-dialog.p2pUWzxc.js";
24
+ import { B, b, c, C, E, a, F, R } from "./chunks/criteria-based-filter-edition-dialog.CszM47bS.js";
25
25
  import { Battery, BusBar, DanglingLine, Generator, Hvdc, LCC, Line, Load, SVC, ShuntCompensator, Substation, ThreeWindingTransfo, TwoWindingTransfo, VSC, VoltageLevel, noSelectionForCopy } from "./utils/equipment-types.js";
26
26
  import { FieldConstants } from "./utils/field-constants.js";
27
27
  import { GRIDSUITE_DEFAULT_PRECISION, isBlankOrEmpty, microUnitToUnit, roundToDefaultPrecision, roundToPrecision, unitToMicroUnit } from "./utils/conversion-utils.js";
@@ -87,14 +87,15 @@ import { genHelperError, genHelperPreviousValue, gridItem, identity, isFieldRequ
87
87
  import { areArrayElementsUnique, isObjectEmpty, keyGenerator } from "./utils/functions.js";
88
88
  import { default as default65 } from "./components/inputs/react-hook-form/directory-items-input.js";
89
89
  import { default as default66 } from "./components/DirectoryItemSelector/directory-item-selector.js";
90
+ import { default as default67 } from "./components/CustomAGGrid/custom-aggrid.js";
90
91
  import { RawReadOnlyInput } from "./components/inputs/react-hook-form/raw-read-only-input.js";
91
92
  import { saveCriteriaBasedFilter, saveExpertFilter, saveExplicitNamingFilter } from "./components/filter/utils/filter-api.js";
92
- import { DEFAULT_RANGE_VALUE, default as default67, getRangeInputDataForm, getRangeInputSchema } from "./components/inputs/react-hook-form/range-input.js";
93
- import { default as default68 } from "./components/inputs/react-hook-form/select-inputs/input-with-popup-confirmation.js";
94
- import { default as default69 } from "./components/inputs/react-hook-form/select-inputs/mui-select-input.js";
95
- import { default as default70 } from "./components/inputs/react-hook-form/select-inputs/countries-input.js";
93
+ import { DEFAULT_RANGE_VALUE, default as default68, getRangeInputDataForm, getRangeInputSchema } from "./components/inputs/react-hook-form/range-input.js";
94
+ import { default as default69 } from "./components/inputs/react-hook-form/select-inputs/input-with-popup-confirmation.js";
95
+ import { default as default70 } from "./components/inputs/react-hook-form/select-inputs/mui-select-input.js";
96
+ import { default as default71 } from "./components/inputs/react-hook-form/select-inputs/countries-input.js";
96
97
  import { getComputedLanguage, getSystemLanguage, useLocalizedCountries } from "./hooks/localized-countries-hook.js";
97
- import { default as default71 } from "./components/inputs/react-hook-form/autocomplete-inputs/multiple-autocomplete-input.js";
98
+ import { default as default72 } from "./components/inputs/react-hook-form/autocomplete-inputs/multiple-autocomplete-input.js";
98
99
  import { UniqueNameInput } from "./components/inputs/react-hook-form/unique-name-input.js";
99
100
  import { UserManagerMock } from "./utils/UserManagerMock.js";
100
101
  import { CONTINGENCY_LIST_EQUIPMENTS, FILTER_EQUIPMENTS } from "./components/filter/utils/filter-form-utils.js";
@@ -117,10 +118,11 @@ export {
117
118
  default64 as CancelButton,
118
119
  default45 as CardErrorBoundary,
119
120
  default56 as CheckboxInput,
120
- default70 as CountriesInput,
121
+ default71 as CountriesInput,
121
122
  b as CriteriaBasedFilterEditionDialog,
122
123
  default15 as CriteriaBasedForm,
123
124
  c as CsvUploader,
125
+ default67 as CustomAGGrid,
124
126
  C as CustomAgGridTable,
125
127
  default47 as CustomFormProvider,
126
128
  default12 as CustomMuiDialog,
@@ -152,7 +154,7 @@ export {
152
154
  GRIDSUITE_DEFAULT_PRECISION,
153
155
  Generator,
154
156
  Hvdc,
155
- default68 as InputWithPopupConfirmation,
157
+ default69 as InputWithPopupConfirmation,
156
158
  default54 as IntegerInput,
157
159
  KeyedColumnsRowIndexer,
158
160
  LANG_ENGLISH,
@@ -165,16 +167,16 @@ export {
165
167
  Load,
166
168
  default60 as MidFormError,
167
169
  default14 as ModifyElementSelection,
168
- default69 as MuiSelectInput,
170
+ default70 as MuiSelectInput,
169
171
  default7 as MuiVirtualizedTable,
170
- default71 as MultipleAutocompleteInput,
172
+ default72 as MultipleAutocompleteInput,
171
173
  default11 as MultipleSelectionDialog,
172
174
  OverflowableText,
173
175
  default16 as PopupConfirmationDialog,
174
176
  RESET_AUTHENTICATION_ROUTER_ERROR,
175
177
  R as ROW_DRAGGING_SELECTION_COLUMN_DEF,
176
178
  default51 as RadioInput,
177
- default67 as RangeInput,
179
+ default68 as RangeInput,
178
180
  RawReadOnlyInput,
179
181
  default8 as ReportViewer,
180
182
  default9 as ReportViewerDialog,
@@ -0,0 +1 @@
1
+
@@ -1,4 +1,4 @@
1
- import { SxProps } from '@mui/material';
1
+ import { SxProps, Theme } from '@mui/material';
2
2
  import { ElementType } from './ElementType';
3
3
 
4
- export declare function getFileIcon(type: ElementType, style: SxProps): import("react/jsx-runtime").JSX.Element | undefined;
4
+ export declare function getFileIcon(type: ElementType, style: SxProps<Theme>): import("react/jsx-runtime").JSX.Element | undefined;
@@ -36,25 +36,29 @@ export declare const equipmentStyles: {
36
36
  padding: string;
37
37
  };
38
38
  };
39
+ /**
40
+ * The order of the equipments in this list is important, as many UI follow it directly.
41
+ * When EquipmentType is used for an interface this order must be maintained.
42
+ */
39
43
  export declare enum EquipmentType {
40
44
  SUBSTATION = "SUBSTATION",
41
- LOAD = "LOAD",
42
- GENERATOR = "GENERATOR",
45
+ VOLTAGE_LEVEL = "VOLTAGE_LEVEL",
46
+ BUS = "BUS",
47
+ BUSBAR_SECTION = "BUSBAR_SECTION",
48
+ SWITCH = "SWITCH",
43
49
  LINE = "LINE",
44
50
  TWO_WINDINGS_TRANSFORMER = "TWO_WINDINGS_TRANSFORMER",
51
+ THREE_WINDINGS_TRANSFORMER = "THREE_WINDINGS_TRANSFORMER",
52
+ GENERATOR = "GENERATOR",
45
53
  BATTERY = "BATTERY",
54
+ LOAD = "LOAD",
46
55
  SHUNT_COMPENSATOR = "SHUNT_COMPENSATOR",
47
- VOLTAGE_LEVEL = "VOLTAGE_LEVEL",
48
- BUSBAR_SECTION = "BUSBAR_SECTION",
49
- DANGLING_LINE = "DANGLING_LINE",
50
- HVDC_LINE = "HVDC_LINE",
51
- THREE_WINDINGS_TRANSFORMER = "THREE_WINDINGS_TRANSFORMER",
52
56
  STATIC_VAR_COMPENSATOR = "STATIC_VAR_COMPENSATOR",
57
+ HVDC_LINE = "HVDC_LINE",
53
58
  HVDC_CONVERTER_STATION = "HVDC_CONVERTER_STATION",
54
59
  VSC_CONVERTER_STATION = "VSC_CONVERTER_STATION",
55
60
  LCC_CONVERTER_STATION = "LCC_CONVERTER_STATION",
56
- BUS = "BUS",
57
- SWITCH = "SWITCH"
61
+ DANGLING_LINE = "DANGLING_LINE"
58
62
  }
59
63
  export declare const EQUIPMENT_TYPE: Record<EquipmentType, {
60
64
  name: EquipmentType;
@@ -43,23 +43,23 @@ const equipmentStyles = {
43
43
  };
44
44
  var EquipmentType = /* @__PURE__ */ ((EquipmentType2) => {
45
45
  EquipmentType2["SUBSTATION"] = "SUBSTATION";
46
- EquipmentType2["LOAD"] = "LOAD";
47
- EquipmentType2["GENERATOR"] = "GENERATOR";
46
+ EquipmentType2["VOLTAGE_LEVEL"] = "VOLTAGE_LEVEL";
47
+ EquipmentType2["BUS"] = "BUS";
48
+ EquipmentType2["BUSBAR_SECTION"] = "BUSBAR_SECTION";
49
+ EquipmentType2["SWITCH"] = "SWITCH";
48
50
  EquipmentType2["LINE"] = "LINE";
49
51
  EquipmentType2["TWO_WINDINGS_TRANSFORMER"] = "TWO_WINDINGS_TRANSFORMER";
52
+ EquipmentType2["THREE_WINDINGS_TRANSFORMER"] = "THREE_WINDINGS_TRANSFORMER";
53
+ EquipmentType2["GENERATOR"] = "GENERATOR";
50
54
  EquipmentType2["BATTERY"] = "BATTERY";
55
+ EquipmentType2["LOAD"] = "LOAD";
51
56
  EquipmentType2["SHUNT_COMPENSATOR"] = "SHUNT_COMPENSATOR";
52
- EquipmentType2["VOLTAGE_LEVEL"] = "VOLTAGE_LEVEL";
53
- EquipmentType2["BUSBAR_SECTION"] = "BUSBAR_SECTION";
54
- EquipmentType2["DANGLING_LINE"] = "DANGLING_LINE";
55
- EquipmentType2["HVDC_LINE"] = "HVDC_LINE";
56
- EquipmentType2["THREE_WINDINGS_TRANSFORMER"] = "THREE_WINDINGS_TRANSFORMER";
57
57
  EquipmentType2["STATIC_VAR_COMPENSATOR"] = "STATIC_VAR_COMPENSATOR";
58
+ EquipmentType2["HVDC_LINE"] = "HVDC_LINE";
58
59
  EquipmentType2["HVDC_CONVERTER_STATION"] = "HVDC_CONVERTER_STATION";
59
60
  EquipmentType2["VSC_CONVERTER_STATION"] = "VSC_CONVERTER_STATION";
60
61
  EquipmentType2["LCC_CONVERTER_STATION"] = "LCC_CONVERTER_STATION";
61
- EquipmentType2["BUS"] = "BUS";
62
- EquipmentType2["SWITCH"] = "SWITCH";
62
+ EquipmentType2["DANGLING_LINE"] = "DANGLING_LINE";
63
63
  return EquipmentType2;
64
64
  })(EquipmentType || {});
65
65
  const EQUIPMENT_TYPE = {
@@ -6,6 +6,7 @@ export type Input = string | number;
6
6
  export type ElementAttributes = {
7
7
  elementUuid: UUID;
8
8
  elementName: string;
9
+ description: string;
9
10
  type: ElementType;
10
11
  accessRights: {
11
12
  isPrivate: boolean;
@@ -17,6 +18,8 @@ export type ElementAttributes = {
17
18
  lastModifiedBy: string;
18
19
  children: any[];
19
20
  parentUuid: null | UUID;
21
+ specificMetadata: Record<string, object>;
22
+ uploading?: boolean;
20
23
  };
21
24
  export type Equipment = typeof Substation | typeof Line | typeof Generator | typeof Load | typeof Battery | typeof SVC | typeof DanglingLine | typeof LCC | typeof VSC | typeof Hvdc | typeof BusBar | typeof TwoWindingTransfo | typeof ThreeWindingTransfo | typeof ShuntCompensator | typeof VoltageLevel | typeof Substation;
22
25
  export type EquipmentType = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.59.0",
3
+ "version": "0.59.2",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "engines": {
6
6
  "npm": ">=9",