@gridsuite/commons-ui 0.271.0 → 0.272.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.
- package/dist/components/composite/customAGGrid/custom-aggrid-types.d.ts +7 -0
- package/dist/components/composite/dnd-table/deletable-table-row.d.ts +2 -1
- package/dist/components/composite/dnd-table/deletable-table-row.js +3 -1
- package/dist/components/composite/dnd-table/dnd-table-row.d.ts +2 -1
- package/dist/components/composite/dnd-table/dnd-table-row.js +29 -4
- package/dist/components/composite/dnd-table/dnd-table.d.ts +1 -0
- package/dist/components/composite/dnd-table/dnd-table.js +13 -3
- package/dist/components/composite/dnd-table/dnd-table.type.d.ts +1 -0
- package/dist/components/composite/report/report-viewer/context/report-viewer-context.d.ts +4 -4
- package/dist/components/composite/report/report-viewer/log-table/log-table.js +8 -7
- package/dist/components/composite/report/report.type.d.ts +0 -4
- package/dist/components/ui/addButton/AddButton.js +9 -1
- package/dist/components/ui/reactHookForm/DirectoryItemsInput.d.ts +2 -1
- package/dist/components/ui/reactHookForm/DirectoryItemsInput.js +3 -1
- package/dist/components/ui/reactHookForm/autocompleteInputs/AutocompleteInput.d.ts +2 -1
- package/dist/components/ui/reactHookForm/autocompleteInputs/AutocompleteInput.js +2 -0
- package/dist/components/ui/reactHookForm/booleans/BooleanInput.d.ts +2 -1
- package/dist/components/ui/reactHookForm/booleans/BooleanInput.js +3 -1
- package/dist/components/ui/reactHookForm/booleans/SwitchInput.d.ts +2 -1
- package/dist/components/ui/reactHookForm/booleans/SwitchInput.js +12 -2
- package/dist/components/ui/reactHookForm/chip-items-input.d.ts +2 -1
- package/dist/components/ui/reactHookForm/chip-items-input.js +2 -1
- package/dist/components/ui/reactHookForm/expandableInput/DeletableRow.d.ts +2 -1
- package/dist/components/ui/reactHookForm/expandableInput/DeletableRow.js +3 -1
- package/dist/components/ui/reactHookForm/expandableInput/ExpandableInput.d.ts +2 -0
- package/dist/components/ui/reactHookForm/expandableInput/ExpandableInput.js +13 -2
- package/dist/components/ui/reactHookForm/tableInputs/table-text-input.d.ts +2 -1
- package/dist/components/ui/reactHookForm/tableInputs/table-text-input.js +2 -1
- package/dist/features/common/index.d.ts +1 -0
- package/dist/features/common/types.d.ts +32 -0
- package/dist/features/common/types.js +1 -0
- package/dist/features/index.d.ts +2 -0
- package/dist/features/index.js +23 -2
- package/dist/features/network-modifications/common/connectivity/VoltageLevelConnectivityForm.js +4 -2
- package/dist/features/results/common/index.d.ts +7 -0
- package/dist/features/results/common/index.js +5 -0
- package/dist/features/results/common/utils.d.ts +5 -0
- package/dist/features/results/common/utils.js +18 -0
- package/dist/features/results/securityanalysis/index.js +1 -2
- package/dist/features/results/securityanalysis/security-analysis-result-nmk.js +3 -2
- package/dist/features/results/securityanalysis/utils.d.ts +0 -1
- package/dist/features/results/securityanalysis/utils.js +0 -2
- package/dist/features/results/shortcircuit/index.d.ts +11 -0
- package/dist/features/results/shortcircuit/index.js +21 -0
- package/dist/features/results/shortcircuit/shortcircuit-analysis-all-buses-result.d.ts +4 -0
- package/dist/features/results/shortcircuit/shortcircuit-analysis-all-buses-result.js +25 -0
- package/dist/features/results/shortcircuit/shortcircuit-analysis-result-content.d.ts +13 -0
- package/dist/features/results/shortcircuit/shortcircuit-analysis-result-content.js +62 -0
- package/dist/features/results/shortcircuit/shortcircuit-analysis-result-table.d.ts +41 -0
- package/dist/features/results/shortcircuit/shortcircuit-analysis-result-table.js +451 -0
- package/dist/features/results/shortcircuit/shortcircuit-analysis-result.d.ts +53 -0
- package/dist/features/results/shortcircuit/shortcircuit-analysis-result.js +252 -0
- package/dist/features/results/shortcircuit/shortcircuit-analysis-result.type.d.ts +41 -0
- package/dist/features/results/shortcircuit/shortcircuit-analysis-result.type.js +8 -0
- package/dist/index.js +23 -2
- package/dist/utils/types/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -66,6 +66,13 @@ export declare enum SortWay {
|
|
|
66
66
|
ASC = "asc",
|
|
67
67
|
DESC = "desc"
|
|
68
68
|
}
|
|
69
|
+
export type PaginationConfig = {
|
|
70
|
+
page: number;
|
|
71
|
+
rowsPerPage: number | {
|
|
72
|
+
value: number;
|
|
73
|
+
label: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
69
76
|
export type TableSortConfig = Record<string, SortConfig[]>;
|
|
70
77
|
export type TableSort = {
|
|
71
78
|
[SPREADSHEET_SORT_STORE]: TableSortConfig;
|
|
@@ -2,6 +2,7 @@ import { TableRowProps } from '@mui/material';
|
|
|
2
2
|
type DeletableTableRowProps = TableRowProps & {
|
|
3
3
|
onClick: () => void;
|
|
4
4
|
disabledDeletion?: boolean | null;
|
|
5
|
+
dataTestId?: string;
|
|
5
6
|
};
|
|
6
|
-
export declare function DeletableTableRow({ onClick, disabledDeletion, children, ...otherProps }: Readonly<DeletableTableRowProps>): import("react").JSX.Element;
|
|
7
|
+
export declare function DeletableTableRow({ onClick, disabledDeletion, dataTestId, children, ...otherProps }: Readonly<DeletableTableRowProps>): import("react").JSX.Element;
|
|
7
8
|
export {};
|
|
@@ -7,6 +7,7 @@ import { CustomTooltip } from "../../ui/tooltip/CustomTooltip.js";
|
|
|
7
7
|
function DeletableTableRow({
|
|
8
8
|
onClick,
|
|
9
9
|
disabledDeletion,
|
|
10
|
+
dataTestId,
|
|
10
11
|
children,
|
|
11
12
|
...otherProps
|
|
12
13
|
}) {
|
|
@@ -18,6 +19,7 @@ function DeletableTableRow({
|
|
|
18
19
|
...otherProps,
|
|
19
20
|
onMouseEnter: () => setIsMouseHover(true),
|
|
20
21
|
onMouseLeave: () => setIsMouseHover(false),
|
|
22
|
+
"data-testid": dataTestId,
|
|
21
23
|
children: [
|
|
22
24
|
children,
|
|
23
25
|
!disabledDeletion && /* @__PURE__ */ jsx(TableCell, { sx: { width: "5rem", textAlign: "center" }, children: isMouseHover && /* @__PURE__ */ jsx(
|
|
@@ -26,7 +28,7 @@ function DeletableTableRow({
|
|
|
26
28
|
title: intl.formatMessage({
|
|
27
29
|
id: "DeleteRows"
|
|
28
30
|
}),
|
|
29
|
-
children: /* @__PURE__ */ jsx(IconButton, { onClick, children: /* @__PURE__ */ jsx(Delete, {}) })
|
|
31
|
+
children: /* @__PURE__ */ jsx(IconButton, { onClick, "data-testid": "DeleteRowButton", children: /* @__PURE__ */ jsx(Delete, {}) })
|
|
30
32
|
}
|
|
31
33
|
) })
|
|
32
34
|
]
|
|
@@ -19,5 +19,6 @@ export type DndTableRowProps = TableRowProps & {
|
|
|
19
19
|
onDeleteRow: (index: number) => void;
|
|
20
20
|
multiselect?: boolean;
|
|
21
21
|
nextSnapshotCellWidthSx: (isDragging: boolean) => SxProps<Theme> | undefined;
|
|
22
|
+
rowDataTestId?: string;
|
|
22
23
|
};
|
|
23
|
-
export declare function DndTableRow({ rowId, tableName, columnsDefinition, index, provided, snapshot, disableDragAndDrop, disabled, disableTableCell, previousValues, getPreviousValue, isValueModified, disabledDeletion, onChangeRow, onDeleteRow, multiselect, nextSnapshotCellWidthSx, }: Readonly<DndTableRowProps>): import("react").JSX.Element;
|
|
24
|
+
export declare function DndTableRow({ rowId, tableName, columnsDefinition, index, provided, snapshot, disableDragAndDrop, disabled, disableTableCell, previousValues, getPreviousValue, isValueModified, disabledDeletion, onChangeRow, onDeleteRow, multiselect, nextSnapshotCellWidthSx, rowDataTestId, }: Readonly<DndTableRowProps>): import("react").JSX.Element;
|
|
@@ -65,6 +65,7 @@ function EditableTableCell({
|
|
|
65
65
|
TableNumericalInput,
|
|
66
66
|
{
|
|
67
67
|
...props,
|
|
68
|
+
"data-testid": column.dataTestId,
|
|
68
69
|
name,
|
|
69
70
|
previousValue,
|
|
70
71
|
valueModified,
|
|
@@ -76,12 +77,21 @@ function EditableTableCell({
|
|
|
76
77
|
hideErrorMessage: column.hideErrorMessage
|
|
77
78
|
}
|
|
78
79
|
),
|
|
79
|
-
column.type === DndColumnType.TEXT && /* @__PURE__ */ jsx(
|
|
80
|
+
column.type === DndColumnType.TEXT && /* @__PURE__ */ jsx(
|
|
81
|
+
TableTextInput,
|
|
82
|
+
{
|
|
83
|
+
...props,
|
|
84
|
+
name,
|
|
85
|
+
hideErrorMessage: column.hideErrorMessage,
|
|
86
|
+
dataTestId: column.dataTestId
|
|
87
|
+
}
|
|
88
|
+
),
|
|
80
89
|
column.type === DndColumnType.AUTOCOMPLETE && /* @__PURE__ */ jsx(
|
|
81
90
|
AutocompleteInput,
|
|
82
91
|
{
|
|
83
92
|
forcePopupIcon: true,
|
|
84
93
|
freeSolo: true,
|
|
94
|
+
dataTestId: column.dataTestId,
|
|
85
95
|
name,
|
|
86
96
|
options: column.options,
|
|
87
97
|
inputTransform: (value) => value ?? "",
|
|
@@ -89,11 +99,22 @@ function EditableTableCell({
|
|
|
89
99
|
size: "small"
|
|
90
100
|
}
|
|
91
101
|
),
|
|
92
|
-
column.type === DndColumnType.SELECT && /* @__PURE__ */ jsx(
|
|
102
|
+
column.type === DndColumnType.SELECT && /* @__PURE__ */ jsx(
|
|
103
|
+
SelectInput,
|
|
104
|
+
{
|
|
105
|
+
options: column.options,
|
|
106
|
+
name,
|
|
107
|
+
size: "small",
|
|
108
|
+
fullWidth: true,
|
|
109
|
+
disableClearable: true,
|
|
110
|
+
dataTestId: column.dataTestId
|
|
111
|
+
}
|
|
112
|
+
),
|
|
93
113
|
column.type === DndColumnType.DIRECTORY_ITEMS && /* @__PURE__ */ jsx(
|
|
94
114
|
DirectoryItemsInput,
|
|
95
115
|
{
|
|
96
116
|
name,
|
|
117
|
+
dataTestId: column.dataTestId,
|
|
97
118
|
equipmentTypes: column.equipmentTypes,
|
|
98
119
|
elementType: column.elementType,
|
|
99
120
|
titleId: column.titleId,
|
|
@@ -102,11 +123,12 @@ function EditableTableCell({
|
|
|
102
123
|
onChange: (value) => column.shouldHandleOnChangeCell && onChangeCell?.(value)
|
|
103
124
|
}
|
|
104
125
|
),
|
|
105
|
-
column.type === DndColumnType.CHIP_ITEMS && /* @__PURE__ */ jsx(ChipItemsInput, { name, hideErrorMessage: column.hideErrorMessage }),
|
|
126
|
+
column.type === DndColumnType.CHIP_ITEMS && /* @__PURE__ */ jsx(ChipItemsInput, { name, hideErrorMessage: column.hideErrorMessage, dataTestId: column.dataTestId }),
|
|
106
127
|
column.type === DndColumnType.SWITCH && /* @__PURE__ */ jsx(
|
|
107
128
|
SwitchInput,
|
|
108
129
|
{
|
|
109
130
|
name,
|
|
131
|
+
dataTestId: column.dataTestId,
|
|
110
132
|
formProps: {
|
|
111
133
|
// callback to propagate a change to parent via column config
|
|
112
134
|
onChange: (_, checked) => column.shouldHandleOnChangeCell && onChangeCell?.(checked)
|
|
@@ -137,7 +159,8 @@ function DndTableRow({
|
|
|
137
159
|
onChangeRow,
|
|
138
160
|
onDeleteRow,
|
|
139
161
|
multiselect,
|
|
140
|
-
nextSnapshotCellWidthSx
|
|
162
|
+
nextSnapshotCellWidthSx,
|
|
163
|
+
rowDataTestId
|
|
141
164
|
}) {
|
|
142
165
|
const intl = useIntl();
|
|
143
166
|
return /* @__PURE__ */ jsxs(
|
|
@@ -149,6 +172,7 @@ function DndTableRow({
|
|
|
149
172
|
onDeleteRow(index);
|
|
150
173
|
},
|
|
151
174
|
disabledDeletion: disabledDeletion || multiselect,
|
|
175
|
+
dataTestId: rowDataTestId,
|
|
152
176
|
children: [
|
|
153
177
|
!disableDragAndDrop && /* @__PURE__ */ jsx(
|
|
154
178
|
CustomTooltip,
|
|
@@ -161,6 +185,7 @@ function DndTableRow({
|
|
|
161
185
|
{
|
|
162
186
|
sx: mergeSx({ textAlign: "center" }, nextSnapshotCellWidthSx(snapshot.isDragging)),
|
|
163
187
|
...disabled ? {} : { ...provided.dragHandleProps },
|
|
188
|
+
"data-testid": "DragAndDropButton",
|
|
164
189
|
children: /* @__PURE__ */ jsx(DragIndicator, {})
|
|
165
190
|
}
|
|
166
191
|
)
|
|
@@ -28,5 +28,6 @@ export interface DndTableProps {
|
|
|
28
28
|
multiselect?: boolean;
|
|
29
29
|
onChange?: (changedRow: any) => void;
|
|
30
30
|
onDelete?: (removedRows: any[]) => void;
|
|
31
|
+
rowDataTestId?: string;
|
|
31
32
|
}
|
|
32
33
|
export declare function DndTable(props: Readonly<DndTableProps>): import("react").JSX.Element;
|
|
@@ -107,7 +107,8 @@ function DndTable(props) {
|
|
|
107
107
|
disabledDeletion,
|
|
108
108
|
multiselect,
|
|
109
109
|
onChange,
|
|
110
|
-
onDelete
|
|
110
|
+
onDelete,
|
|
111
|
+
rowDataTestId
|
|
111
112
|
} = props;
|
|
112
113
|
const intl = useIntl();
|
|
113
114
|
const { getValues, setValue, setError, clearErrors } = useFormContext();
|
|
@@ -265,7 +266,15 @@ function DndTable(props) {
|
|
|
265
266
|
title: intl.formatMessage({
|
|
266
267
|
id: "AddRows"
|
|
267
268
|
}),
|
|
268
|
-
children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
269
|
+
children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
270
|
+
IconButton,
|
|
271
|
+
{
|
|
272
|
+
disabled,
|
|
273
|
+
onClick: handleAddRowsButton,
|
|
274
|
+
"data-testid": "AddRowButton",
|
|
275
|
+
children: /* @__PURE__ */ jsx(AddCircle, {})
|
|
276
|
+
}
|
|
277
|
+
) })
|
|
269
278
|
}
|
|
270
279
|
) })
|
|
271
280
|
] }) });
|
|
@@ -305,7 +314,8 @@ function DndTable(props) {
|
|
|
305
314
|
onChangeRow: handleChangeRow,
|
|
306
315
|
onDeleteRow: handleDeleteRow,
|
|
307
316
|
multiselect,
|
|
308
|
-
nextSnapshotCellWidthSx
|
|
317
|
+
nextSnapshotCellWidthSx,
|
|
318
|
+
rowDataTestId
|
|
309
319
|
}
|
|
310
320
|
);
|
|
311
321
|
return snapshot.isDragging ? createPortal(tableRow, document.body) : tableRow;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FilterConfig } from '../../../customAGGrid
|
|
1
|
+
import { MatchPosition, PagedLogs, ReportType } from '../../report.type';
|
|
2
|
+
import { FilterConfig, PaginationConfig } from '../../../customAGGrid';
|
|
3
3
|
export interface ReportFetcherContextValue {
|
|
4
4
|
fetchLogs: (reportId: string, severityList: string[], messageFilter: string, reportType: ReportType, page: number, size: number) => Promise<PagedLogs> | undefined;
|
|
5
5
|
fetchLogMatches: (reportId: string, severityList: string[], messageFilter: string, reportType: ReportType, searchTerm: string, pageSize: number) => Promise<MatchPosition[]> | undefined;
|
|
@@ -9,8 +9,8 @@ export declare const useReportFetcherContext: () => ReportFetcherContextValue;
|
|
|
9
9
|
export interface ReportFilterContextValue {
|
|
10
10
|
filters: FilterConfig[] | undefined;
|
|
11
11
|
updateFilters: (filters: FilterConfig[]) => void;
|
|
12
|
-
pagination:
|
|
13
|
-
changePagination: (config:
|
|
12
|
+
pagination: PaginationConfig;
|
|
13
|
+
changePagination: (config: PaginationConfig) => void;
|
|
14
14
|
}
|
|
15
15
|
export declare const ReportFilterContext: import('react').Context<ReportFilterContextValue | null>;
|
|
16
16
|
export declare const useReportFilterContext: () => ReportFilterContextValue;
|
|
@@ -104,6 +104,7 @@ function LogTable({
|
|
|
104
104
|
const { fetchLogs, fetchLogMatches } = useReportFetcherContext();
|
|
105
105
|
const { filters, updateFilters, pagination, changePagination } = useReportFilterContext();
|
|
106
106
|
const { page, rowsPerPage } = pagination;
|
|
107
|
+
const rowsPerPageNumber = typeof rowsPerPage === "number" ? rowsPerPage : rowsPerPage.value;
|
|
107
108
|
const [selectedRowIndex, setSelectedRowIndex] = useState(-1);
|
|
108
109
|
const [rowData, setRowData] = useState(null);
|
|
109
110
|
const [searchMatches, setSearchMatches] = useState([]);
|
|
@@ -135,11 +136,11 @@ function LogTable({
|
|
|
135
136
|
setRowData([]);
|
|
136
137
|
return;
|
|
137
138
|
}
|
|
138
|
-
fetchLogs(selectedReport.id, severityFilter, messageFilter, selectedReport.type, page,
|
|
139
|
+
fetchLogs(selectedReport.id, severityFilter, messageFilter, selectedReport.type, page, rowsPerPageNumber)?.then(
|
|
139
140
|
(pagedLogs) => {
|
|
140
141
|
const { content, totalElements, totalPages } = pagedLogs;
|
|
141
142
|
if (totalPages - 1 < page) {
|
|
142
|
-
changePagination({ page: 0, rowsPerPage });
|
|
143
|
+
changePagination({ page: 0, rowsPerPage: rowsPerPageNumber });
|
|
143
144
|
}
|
|
144
145
|
setCount(totalElements);
|
|
145
146
|
setSelectedRowIndex(-1);
|
|
@@ -153,7 +154,7 @@ function LogTable({
|
|
|
153
154
|
selectedReport.type,
|
|
154
155
|
messageFilter,
|
|
155
156
|
page,
|
|
156
|
-
|
|
157
|
+
rowsPerPageNumber,
|
|
157
158
|
changePagination
|
|
158
159
|
]);
|
|
159
160
|
useEffect(() => {
|
|
@@ -281,12 +282,12 @@ function LogTable({
|
|
|
281
282
|
messageFilter,
|
|
282
283
|
selectedReport.type,
|
|
283
284
|
term,
|
|
284
|
-
|
|
285
|
+
rowsPerPageNumber
|
|
285
286
|
)?.then((matchesPositions) => {
|
|
286
287
|
setSearchMatches(matchesPositions);
|
|
287
288
|
const matches = matchesPositions.map((m) => m.rowIndex);
|
|
288
289
|
if (matches.length > 0) {
|
|
289
|
-
changePagination({ page: matchesPositions[0].page, rowsPerPage });
|
|
290
|
+
changePagination({ page: matchesPositions[0].page, rowsPerPage: rowsPerPageNumber });
|
|
290
291
|
}
|
|
291
292
|
handleSearchResults(matches);
|
|
292
293
|
});
|
|
@@ -296,7 +297,7 @@ function LogTable({
|
|
|
296
297
|
handleSearchResults,
|
|
297
298
|
messageFilter,
|
|
298
299
|
resetSearch,
|
|
299
|
-
|
|
300
|
+
rowsPerPageNumber,
|
|
300
301
|
selectedReport.id,
|
|
301
302
|
selectedReport.type,
|
|
302
303
|
changePagination,
|
|
@@ -407,7 +408,7 @@ function LogTable({
|
|
|
407
408
|
component: "div",
|
|
408
409
|
rowsPerPageOptions: PAGE_OPTIONS,
|
|
409
410
|
count,
|
|
410
|
-
rowsPerPage,
|
|
411
|
+
rowsPerPage: rowsPerPageNumber,
|
|
411
412
|
page,
|
|
412
413
|
onPageChange: handleChangePage,
|
|
413
414
|
onRowsPerPageChange: handleChangeRowsPerPage,
|
|
@@ -8,7 +8,15 @@ var AddButtonMode = /* @__PURE__ */ ((AddButtonMode2) => {
|
|
|
8
8
|
return AddButtonMode2;
|
|
9
9
|
})(AddButtonMode || {});
|
|
10
10
|
function AddButton({ label, mode = "add", ...buttonProps }) {
|
|
11
|
-
return /* @__PURE__ */ jsx(
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
Button,
|
|
13
|
+
{
|
|
14
|
+
startIcon: mode === "add" ? /* @__PURE__ */ jsx(ControlPoint, {}) : /* @__PURE__ */ jsx(Edit, {}),
|
|
15
|
+
"data-testid": mode === "add" ? "AddButton" : "EditButton",
|
|
16
|
+
...buttonProps,
|
|
17
|
+
children: /* @__PURE__ */ jsx(FormattedMessage, { id: label })
|
|
18
|
+
}
|
|
19
|
+
);
|
|
12
20
|
}
|
|
13
21
|
export {
|
|
14
22
|
AddButton,
|
|
@@ -17,9 +17,10 @@ export interface DirectoryItemsInputProps<CP extends OverflowableChipProps = Ove
|
|
|
17
17
|
chipProps?: Partial<CP>;
|
|
18
18
|
fullHeight?: boolean;
|
|
19
19
|
fullWidth?: boolean;
|
|
20
|
+
dataTestId?: string;
|
|
20
21
|
}
|
|
21
22
|
export declare function DirectoryItemsInput<CP extends OverflowableChipProps = OverflowableChipProps>({ label, name, elementType, // Used to specify type of element (Filter, Contingency list, ...)
|
|
22
23
|
equipmentTypes, // Mostly used for filters, it allows the user to get elements of specific equipment only
|
|
23
24
|
itemFilter, // Used to further filter the results displayed according to specific requirement
|
|
24
25
|
titleId, // title of directory item selector dialogue
|
|
25
|
-
hideErrorMessage, onChange, disable, allowMultiSelect, labelRequiredFromContext, ChipComponent, chipProps, fullHeight, fullWidth, }: Readonly<DirectoryItemsInputProps<CP>>): import("react").JSX.Element;
|
|
26
|
+
hideErrorMessage, onChange, disable, allowMultiSelect, labelRequiredFromContext, ChipComponent, chipProps, fullHeight, fullWidth, dataTestId, }: Readonly<DirectoryItemsInputProps<CP>>): import("react").JSX.Element;
|
|
@@ -70,7 +70,8 @@ function DirectoryItemsInput({
|
|
|
70
70
|
ChipComponent = OverflowableChip,
|
|
71
71
|
chipProps,
|
|
72
72
|
fullHeight = false,
|
|
73
|
-
fullWidth = true
|
|
73
|
+
fullWidth = true,
|
|
74
|
+
dataTestId
|
|
74
75
|
}) {
|
|
75
76
|
const { snackError } = useSnackMessage();
|
|
76
77
|
const intl = useIntl();
|
|
@@ -213,6 +214,7 @@ function DirectoryItemsInput({
|
|
|
213
214
|
/* @__PURE__ */ jsx(
|
|
214
215
|
Select,
|
|
215
216
|
{
|
|
217
|
+
"data-testid": dataTestId,
|
|
216
218
|
value: elements,
|
|
217
219
|
multiple: true,
|
|
218
220
|
displayEmpty: true,
|
|
@@ -13,8 +13,9 @@ export interface AutocompleteInputProps extends Omit<AutocompleteProps<Option, b
|
|
|
13
13
|
formProps?: Omit<TextFieldProps, 'value' | 'onChange' | 'inputRef' | 'inputProps' | 'InputProps'>;
|
|
14
14
|
disabledTooltip?: boolean;
|
|
15
15
|
onCheckNewValue?: (value: Option | null) => boolean;
|
|
16
|
+
dataTestId?: string;
|
|
16
17
|
}
|
|
17
18
|
export declare function AutocompleteInput({ name, label, options, outputTransform, // transform materialUi input value before sending it to react hook form, mostly used to deal with select fields that need to return a string
|
|
18
19
|
inputTransform, // transform react hook form value before sending it to materialUi input, mostly used to deal with select fields that need to return a string
|
|
19
20
|
readOnly, previousValue, allowNewValue, onChangeCallback, // method called when input value is changing
|
|
20
|
-
formProps, disabledTooltip, onCheckNewValue, ...props }: AutocompleteInputProps): import("react").JSX.Element;
|
|
21
|
+
formProps, disabledTooltip, onCheckNewValue, dataTestId, ...props }: AutocompleteInputProps): import("react").JSX.Element;
|
|
@@ -25,6 +25,7 @@ function AutocompleteInput({
|
|
|
25
25
|
formProps,
|
|
26
26
|
disabledTooltip,
|
|
27
27
|
onCheckNewValue,
|
|
28
|
+
dataTestId,
|
|
28
29
|
...props
|
|
29
30
|
}) {
|
|
30
31
|
const { validationSchema, getValues, removeOptional, isNodeBuilt, isUpdate } = useCustomFormContext();
|
|
@@ -56,6 +57,7 @@ function AutocompleteInput({
|
|
|
56
57
|
return /* @__PURE__ */ jsx(
|
|
57
58
|
Autocomplete,
|
|
58
59
|
{
|
|
60
|
+
"data-testid": dataTestId,
|
|
59
61
|
value: selectedValues ?? null,
|
|
60
62
|
onChange: (_, data) => handleChange(data),
|
|
61
63
|
...allowNewValue && {
|
|
@@ -7,6 +7,7 @@ export type BooleanInputProps<TInput extends InputTypes> = {
|
|
|
7
7
|
label?: string;
|
|
8
8
|
formProps?: InputProps<TInput>;
|
|
9
9
|
Input: TInput;
|
|
10
|
+
dataTestId?: string;
|
|
10
11
|
};
|
|
11
|
-
export declare function BooleanInput<TInput extends InputTypes>({ name, label, formProps, Input, }: Readonly<BooleanInputProps<TInput>>): JSX.Element;
|
|
12
|
+
export declare function BooleanInput<TInput extends InputTypes>({ name, label, formProps, Input, dataTestId, }: Readonly<BooleanInputProps<TInput>>): JSX.Element;
|
|
12
13
|
export {};
|
|
@@ -7,7 +7,8 @@ function BooleanInput({
|
|
|
7
7
|
name,
|
|
8
8
|
label,
|
|
9
9
|
formProps,
|
|
10
|
-
Input
|
|
10
|
+
Input,
|
|
11
|
+
dataTestId
|
|
11
12
|
}) {
|
|
12
13
|
const { onChange, slotProps, ...otherFormProps } = formProps ?? { onChange: void 0 };
|
|
13
14
|
const {
|
|
@@ -28,6 +29,7 @@ function BooleanInput({
|
|
|
28
29
|
onChange: handleChangeValue,
|
|
29
30
|
inputRef: ref,
|
|
30
31
|
slotProps: { input: { "aria-label": "primary checkbox" }, ...slotProps },
|
|
32
|
+
"data-testid": dataTestId,
|
|
31
33
|
...otherFormProps
|
|
32
34
|
}
|
|
33
35
|
);
|
|
@@ -3,5 +3,6 @@ export interface SwitchInputProps {
|
|
|
3
3
|
name: string;
|
|
4
4
|
label?: string;
|
|
5
5
|
formProps?: SwitchProps;
|
|
6
|
+
dataTestId?: string;
|
|
6
7
|
}
|
|
7
|
-
export declare function SwitchInput({ name, label, formProps, ...props }: SwitchInputProps): import("react").JSX.Element;
|
|
8
|
+
export declare function SwitchInput({ name, label, formProps, dataTestId, ...props }: SwitchInputProps): import("react").JSX.Element;
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Switch } from "@mui/material";
|
|
3
3
|
import { BooleanInput } from "./BooleanInput.js";
|
|
4
|
-
function SwitchInput({ name, label, formProps, ...props }) {
|
|
5
|
-
return /* @__PURE__ */ jsx(
|
|
4
|
+
function SwitchInput({ name, label, formProps, dataTestId, ...props }) {
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
BooleanInput,
|
|
7
|
+
{
|
|
8
|
+
name,
|
|
9
|
+
label,
|
|
10
|
+
formProps,
|
|
11
|
+
Input: Switch,
|
|
12
|
+
dataTestId,
|
|
13
|
+
...props
|
|
14
|
+
}
|
|
15
|
+
);
|
|
6
16
|
}
|
|
7
17
|
export {
|
|
8
18
|
SwitchInput
|
|
@@ -8,6 +8,7 @@ interface ChipItemsInputProps {
|
|
|
8
8
|
label?: string;
|
|
9
9
|
name: string;
|
|
10
10
|
hideErrorMessage?: boolean;
|
|
11
|
+
dataTestId?: string;
|
|
11
12
|
}
|
|
12
|
-
export declare function ChipItemsInput({ label, name, hideErrorMessage }: Readonly<ChipItemsInputProps>): import("react").JSX.Element;
|
|
13
|
+
export declare function ChipItemsInput({ label, name, hideErrorMessage, dataTestId }: Readonly<ChipItemsInputProps>): import("react").JSX.Element;
|
|
13
14
|
export {};
|
|
@@ -38,7 +38,7 @@ const styles = {
|
|
|
38
38
|
overflow: "hidden"
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
-
function ChipItemsInput({ label, name, hideErrorMessage }) {
|
|
41
|
+
function ChipItemsInput({ label, name, hideErrorMessage, dataTestId }) {
|
|
42
42
|
const [textEntered, setTextEntered] = useState("");
|
|
43
43
|
const { snackError } = useSnackMessage();
|
|
44
44
|
const {
|
|
@@ -110,6 +110,7 @@ function ChipItemsInput({ label, name, hideErrorMessage }) {
|
|
|
110
110
|
/* @__PURE__ */ jsx(
|
|
111
111
|
TextField,
|
|
112
112
|
{
|
|
113
|
+
"data-testid": dataTestId,
|
|
113
114
|
variant: "standard",
|
|
114
115
|
value: textEntered,
|
|
115
116
|
onKeyDown: keyPress,
|
|
@@ -4,5 +4,6 @@ export interface DeletableRowProps extends PropsWithChildren {
|
|
|
4
4
|
onClick: () => void;
|
|
5
5
|
deletionMark?: boolean | null;
|
|
6
6
|
disabledDeletion?: boolean | null;
|
|
7
|
+
dataTestId?: string;
|
|
7
8
|
}
|
|
8
|
-
export declare function DeletableRow({ alignItems, onClick, deletionMark, disabledDeletion, children, }: Readonly<DeletableRowProps>): import("react").JSX.Element;
|
|
9
|
+
export declare function DeletableRow({ alignItems, onClick, deletionMark, disabledDeletion, dataTestId, children, }: Readonly<DeletableRowProps>): import("react").JSX.Element;
|
|
@@ -9,6 +9,7 @@ function DeletableRow({
|
|
|
9
9
|
onClick,
|
|
10
10
|
deletionMark,
|
|
11
11
|
disabledDeletion,
|
|
12
|
+
dataTestId,
|
|
12
13
|
children
|
|
13
14
|
}) {
|
|
14
15
|
const intl = useIntl();
|
|
@@ -22,6 +23,7 @@ function DeletableRow({
|
|
|
22
23
|
alignItems,
|
|
23
24
|
onMouseEnter: () => setIsMouseHover(true),
|
|
24
25
|
onMouseLeave: () => setIsMouseHover(false),
|
|
26
|
+
"data-testid": dataTestId,
|
|
25
27
|
children: [
|
|
26
28
|
children,
|
|
27
29
|
/* @__PURE__ */ jsx(Grid, { size: 1, children: isMouseHover && !disabledDeletion && /* @__PURE__ */ jsx(
|
|
@@ -30,7 +32,7 @@ function DeletableRow({
|
|
|
30
32
|
title: intl.formatMessage({
|
|
31
33
|
id: deletionMark ? "button.restore" : "DeleteRows"
|
|
32
34
|
}),
|
|
33
|
-
children: /* @__PURE__ */ jsx(IconButton, { onClick, children: deletionMark ? /* @__PURE__ */ jsx(RestoreFromTrash, {}) : /* @__PURE__ */ jsx(Delete, {}) })
|
|
35
|
+
children: /* @__PURE__ */ jsx(IconButton, { onClick, "data-testid": "DeleteRowButton", children: deletionMark ? /* @__PURE__ */ jsx(RestoreFromTrash, {}) : /* @__PURE__ */ jsx(Delete, {}) })
|
|
34
36
|
}
|
|
35
37
|
) })
|
|
36
38
|
]
|
|
@@ -20,5 +20,7 @@ export interface ExpandableInputProps {
|
|
|
20
20
|
watchProps?: boolean;
|
|
21
21
|
disabled?: boolean;
|
|
22
22
|
disabledDeletion?: (idx: number) => boolean;
|
|
23
|
+
rowDataTestId?: string;
|
|
24
|
+
addButtonDataTestId?: string;
|
|
23
25
|
}
|
|
24
26
|
export declare const ExpandableInput: import('react').ForwardRefExoticComponent<Readonly<ExpandableInputProps> & import('react').RefAttributes<unknown>>;
|
|
@@ -22,7 +22,9 @@ const ExpandableInput = forwardRef(
|
|
|
22
22
|
// default value for a flex container
|
|
23
23
|
watchProps = true,
|
|
24
24
|
disabled = false,
|
|
25
|
-
disabledDeletion
|
|
25
|
+
disabledDeletion,
|
|
26
|
+
rowDataTestId,
|
|
27
|
+
addButtonDataTestId
|
|
26
28
|
}, ref) => {
|
|
27
29
|
const {
|
|
28
30
|
fields: values,
|
|
@@ -54,11 +56,20 @@ const ExpandableInput = forwardRef(
|
|
|
54
56
|
},
|
|
55
57
|
deletionMark: getDeletionMark?.(idx),
|
|
56
58
|
disabledDeletion: disabledDeletion?.(idx),
|
|
59
|
+
dataTestId: rowDataTestId,
|
|
57
60
|
children: /* @__PURE__ */ jsx(Field, { name, index: idx, ...fieldProps })
|
|
58
61
|
},
|
|
59
62
|
value.id
|
|
60
63
|
)),
|
|
61
|
-
addButtonLabel && /* @__PURE__ */ jsx(Grid, { children: /* @__PURE__ */ jsx(
|
|
64
|
+
addButtonLabel && /* @__PURE__ */ jsx(Grid, { children: /* @__PURE__ */ jsx(
|
|
65
|
+
AddButton,
|
|
66
|
+
{
|
|
67
|
+
disabled,
|
|
68
|
+
onClick: () => append(initialValue),
|
|
69
|
+
label: addButtonLabel,
|
|
70
|
+
"data-testid": addButtonDataTestId
|
|
71
|
+
}
|
|
72
|
+
) })
|
|
62
73
|
] });
|
|
63
74
|
}
|
|
64
75
|
);
|
|
@@ -3,6 +3,7 @@ interface TableTextInputProps {
|
|
|
3
3
|
name: string;
|
|
4
4
|
hideErrorMessage?: boolean;
|
|
5
5
|
inputProps?: InputBaseComponentProps;
|
|
6
|
+
dataTestId?: string;
|
|
6
7
|
}
|
|
7
|
-
export declare function TableTextInput({ name, hideErrorMessage, inputProps }: Readonly<TableTextInputProps>): import("react").JSX.Element;
|
|
8
|
+
export declare function TableTextInput({ name, hideErrorMessage, inputProps, dataTestId }: Readonly<TableTextInputProps>): import("react").JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -5,7 +5,7 @@ import "react-intl";
|
|
|
5
5
|
import "react";
|
|
6
6
|
import "@mui/icons-material";
|
|
7
7
|
import { genHelperError } from "../utils/functions.js";
|
|
8
|
-
function TableTextInput({ name, hideErrorMessage, inputProps }) {
|
|
8
|
+
function TableTextInput({ name, hideErrorMessage, inputProps, dataTestId }) {
|
|
9
9
|
const {
|
|
10
10
|
field: { onChange, value, ref },
|
|
11
11
|
fieldState: { error }
|
|
@@ -19,6 +19,7 @@ function TableTextInput({ name, hideErrorMessage, inputProps }) {
|
|
|
19
19
|
return /* @__PURE__ */ jsx(
|
|
20
20
|
TextField,
|
|
21
21
|
{
|
|
22
|
+
"data-testid": dataTestId,
|
|
22
23
|
value,
|
|
23
24
|
onChange: handleInputChange,
|
|
24
25
|
error: !!error?.message,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, 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 type Sort = {
|
|
8
|
+
empty?: boolean;
|
|
9
|
+
sorted?: boolean;
|
|
10
|
+
unsorted?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type Pageable = {
|
|
13
|
+
offset?: number;
|
|
14
|
+
pageNumber?: number;
|
|
15
|
+
pageSize?: number;
|
|
16
|
+
paged?: boolean;
|
|
17
|
+
sort?: Sort;
|
|
18
|
+
unpaged?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export interface Page<ResultType> {
|
|
21
|
+
content?: ResultType[];
|
|
22
|
+
pageable?: Pageable;
|
|
23
|
+
last?: boolean;
|
|
24
|
+
totalPages?: number;
|
|
25
|
+
totalElements?: number;
|
|
26
|
+
first?: boolean;
|
|
27
|
+
size?: number;
|
|
28
|
+
number?: number;
|
|
29
|
+
sort?: Sort;
|
|
30
|
+
numberOfElements?: number;
|
|
31
|
+
empty?: boolean;
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/dist/features/index.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ export * from './announcement';
|
|
|
16
16
|
export * from './results/securityanalysis';
|
|
17
17
|
export * from './results/loadflow';
|
|
18
18
|
export * from './results/utils';
|
|
19
|
+
export * from './results/common';
|
|
20
|
+
export * from './results/shortcircuit';
|
|
19
21
|
export * from './results/constants';
|
|
20
22
|
export * from './process-configs';
|
|
21
23
|
export * from './global-filter';
|