@gridsuite/commons-ui 0.78.0 → 0.80.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/authentication/utils/userManagerMock.d.ts +3 -3
- package/dist/components/authentication/utils/userManagerMock.js +1 -2
- package/dist/components/customAGGrid/customAggrid.js +2 -2
- package/dist/components/directoryItemSelector/DirectoryItemSelector.d.ts +2 -11
- package/dist/components/directoryItemSelector/DirectoryItemSelector.js +3 -1
- package/dist/components/filter/FilterCreationDialog.js +4 -2
- package/dist/components/filter/expert/ExpertFilterEditionDialog.js +9 -5
- package/dist/components/filter/expert/ExpertFilterForm.d.ts +0 -1
- package/dist/components/filter/expert/ExpertFilterForm.js +1 -3
- package/dist/components/filter/expert/expertFilterConstants.d.ts +1 -0
- package/dist/components/filter/expert/expertFilterConstants.js +2 -0
- package/dist/components/filter/expert/index.js +2 -2
- package/dist/components/filter/explicitNaming/ExplicitNamingFilterConstants.d.ts +7 -0
- package/dist/components/filter/explicitNaming/ExplicitNamingFilterConstants.js +4 -0
- package/dist/components/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js +4 -2
- package/dist/components/filter/explicitNaming/ExplicitNamingFilterForm.d.ts +0 -1
- package/dist/components/filter/explicitNaming/ExplicitNamingFilterForm.js +9 -5
- package/dist/components/filter/explicitNaming/index.d.ts +1 -0
- package/dist/components/filter/explicitNaming/index.js +2 -1
- package/dist/components/filter/filter.type.d.ts +19 -2
- package/dist/components/filter/index.js +4 -3
- package/dist/components/filter/utils/filterApi.d.ts +1 -1
- package/dist/components/filter/utils/filterApi.js +9 -2
- package/dist/components/flatParameters/FlatParameters.d.ts +2 -2
- package/dist/components/index.js +5 -5
- package/dist/components/inputs/index.js +1 -2
- package/dist/components/inputs/reactHookForm/DirectoryItemsInput.d.ts +3 -7
- package/dist/components/inputs/reactHookForm/agGridTable/CustomAgGridTable.d.ts +3 -8
- package/dist/components/inputs/reactHookForm/agGridTable/CustomAgGridTable.js +4 -14
- package/dist/components/inputs/reactHookForm/agGridTable/cellEditors/numericEditor.d.ts +3 -3
- package/dist/components/inputs/reactHookForm/agGridTable/csvUploader/CsvUploader.d.ts +1 -1
- package/dist/components/inputs/reactHookForm/agGridTable/index.js +2 -3
- package/dist/components/inputs/reactHookForm/booleans/BooleanInput.d.ts +2 -2
- package/dist/components/inputs/reactHookForm/index.js +1 -2
- package/dist/components/inputs/reactHookForm/numbers/SliderInput.d.ts +1 -1
- package/dist/components/inputs/reactQueryBuilder/ElementValueEditor.d.ts +3 -7
- package/dist/components/notifications/hooks/useNotificationsListener.d.ts +1 -1
- package/dist/hooks/useSnackMessage.d.ts +1 -3
- package/dist/index.js +5 -5
- package/dist/module-mui.d.js +1 -1
- package/dist/services/explore.d.ts +3 -2
- package/dist/services/utils.d.ts +8 -2
- package/dist/services/utils.js +1 -1
- package/dist/utils/algos.d.ts +1 -1
- package/dist/utils/algos.js +5 -3
- package/dist/utils/mapper/getFileIcon.js +1 -0
- package/dist/utils/types/elementType.d.ts +1 -0
- package/dist/utils/types/elementType.js +1 -0
- package/dist/utils/types/types.d.ts +7 -2
- package/package.json +5 -5
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { MetadataService, SigninRequest, SigninResponse, SignoutRequest, SignoutResponse, User, UserManager, UserManagerEvents, UserManagerSettings } from 'oidc-client';
|
|
2
2
|
|
|
3
3
|
declare class Events implements UserManagerEvents {
|
|
4
|
-
userLoadedCallbacks: ((data:
|
|
5
|
-
addUserLoaded(callback: (data:
|
|
6
|
-
addSilentRenewError(
|
|
4
|
+
userLoadedCallbacks: ((data: User) => void)[];
|
|
5
|
+
addUserLoaded(callback: (data: User) => void): void;
|
|
6
|
+
addSilentRenewError(): void;
|
|
7
7
|
load(): void;
|
|
8
8
|
unload(): void;
|
|
9
9
|
removeUserLoaded(): void;
|
|
@@ -15,7 +15,7 @@ const onColumnResized = (params) => {
|
|
|
15
15
|
if (column && colDefinedMinWidth && finished) {
|
|
16
16
|
const newWidth = column == null ? void 0 : column.getActualWidth();
|
|
17
17
|
if (newWidth < colDefinedMinWidth) {
|
|
18
|
-
|
|
18
|
+
params.api.setColumnWidths([{ key: column, newWidth: colDefinedMinWidth }], finished, params.source);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
};
|
|
@@ -48,9 +48,9 @@ const CustomAGGrid = React.forwardRef((props, ref) => {
|
|
|
48
48
|
{
|
|
49
49
|
ref,
|
|
50
50
|
getLocaleText,
|
|
51
|
-
suppressPropertyNamesCheck: true,
|
|
52
51
|
onColumnResized,
|
|
53
52
|
enableCellTextSelection: true,
|
|
53
|
+
theme: "legacy",
|
|
54
54
|
...agGridReactProps
|
|
55
55
|
}
|
|
56
56
|
)
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
+
import { ElementAttributes } from '../../utils';
|
|
1
2
|
import { TreeViewFinderProps } from '../treeViewFinder/TreeViewFinder';
|
|
2
3
|
import { UUID } from 'crypto';
|
|
3
4
|
|
|
4
5
|
export interface DirectoryItemSelectorProps extends TreeViewFinderProps {
|
|
5
|
-
open: boolean;
|
|
6
6
|
types: string[];
|
|
7
7
|
equipmentTypes?: string[];
|
|
8
|
-
itemFilter?:
|
|
9
|
-
classes?: any;
|
|
10
|
-
contentText?: string;
|
|
11
|
-
defaultExpanded?: string[];
|
|
12
|
-
defaultSelected?: string[];
|
|
13
|
-
validationButtonText?: string;
|
|
14
|
-
className?: string;
|
|
15
|
-
cancelButtonProps?: any;
|
|
16
|
-
onlyLeaves?: boolean;
|
|
17
|
-
multiselect?: boolean;
|
|
8
|
+
itemFilter?: (val: ElementAttributes) => boolean;
|
|
18
9
|
expanded?: UUID[];
|
|
19
10
|
selected?: UUID[];
|
|
20
11
|
}
|
|
@@ -171,7 +171,9 @@ function DirectoryItemSelector({
|
|
|
171
171
|
(nodeId) => {
|
|
172
172
|
const typeList = types.includes(ElementType.DIRECTORY) ? [] : types;
|
|
173
173
|
fetchDirectoryContent(nodeId, typeList).then((children) => {
|
|
174
|
-
const childrenMatchedTypes = children.filter(
|
|
174
|
+
const childrenMatchedTypes = children.filter(
|
|
175
|
+
(item) => contentFilter().has(item.type)
|
|
176
|
+
);
|
|
175
177
|
if (childrenMatchedTypes.length > 0 && equipmentTypes && equipmentTypes.length > 0) {
|
|
176
178
|
fetchElementsInfos(
|
|
177
179
|
childrenMatchedTypes.map((e) => e.elementUuid),
|
|
@@ -5,13 +5,15 @@ import { yupResolver } from "@hookform/resolvers/yup";
|
|
|
5
5
|
import { saveExplicitNamingFilter, saveExpertFilter } from "./utils/filterApi.js";
|
|
6
6
|
import { useSnackMessage } from "../../hooks/useSnackMessage.js";
|
|
7
7
|
import { CustomMuiDialog } from "../dialogs/customMuiDialog/CustomMuiDialog.js";
|
|
8
|
-
import { getExplicitNamingFilterEmptyFormData, explicitNamingFilterSchema
|
|
8
|
+
import { getExplicitNamingFilterEmptyFormData, explicitNamingFilterSchema } from "./explicitNaming/ExplicitNamingFilterForm.js";
|
|
9
9
|
import { FieldConstants } from "../../utils/constants/fieldConstants.js";
|
|
10
10
|
import "../../utils/yupConfig.js";
|
|
11
11
|
import { FilterForm } from "./FilterForm.js";
|
|
12
|
-
import { getExpertFilterEmptyFormData, expertFilterSchema
|
|
12
|
+
import { getExpertFilterEmptyFormData, expertFilterSchema } from "./expert/ExpertFilterForm.js";
|
|
13
13
|
import { FilterType } from "./constants/FilterConstants.js";
|
|
14
14
|
import { MAX_CHAR_DESCRIPTION } from "../../utils/constants/uiConstants.js";
|
|
15
|
+
import { EXPERT_FILTER_QUERY } from "./expert/expertFilterConstants.js";
|
|
16
|
+
import { FILTER_EQUIPMENTS_ATTRIBUTES } from "./explicitNaming/ExplicitNamingFilterConstants.js";
|
|
15
17
|
import * as yup from "yup";
|
|
16
18
|
const emptyFormData = {
|
|
17
19
|
[FieldConstants.NAME]: "",
|
|
@@ -10,9 +10,11 @@ import { CustomMuiDialog } from "../../dialogs/customMuiDialog/CustomMuiDialog.j
|
|
|
10
10
|
import { FilterType, NO_ITEM_SELECTION_FOR_COPY } from "../constants/FilterConstants.js";
|
|
11
11
|
import { FilterForm } from "../FilterForm.js";
|
|
12
12
|
import { saveExpertFilter } from "../utils/filterApi.js";
|
|
13
|
-
import { expertFilterSchema
|
|
13
|
+
import { expertFilterSchema } from "./ExpertFilterForm.js";
|
|
14
14
|
import { importExpertRules } from "./expertFilterUtils.js";
|
|
15
15
|
import { HeaderFilterSchema } from "../HeaderFilterForm.js";
|
|
16
|
+
import { catchErrorHandler } from "../../../services/utils.js";
|
|
17
|
+
import { EXPERT_FILTER_QUERY } from "./expertFilterConstants.js";
|
|
16
18
|
import * as yup from "yup";
|
|
17
19
|
const formSchema = yup.object().shape({
|
|
18
20
|
...HeaderFilterSchema,
|
|
@@ -58,10 +60,12 @@ function ExpertFilterEditionDialog({
|
|
|
58
60
|
[EXPERT_FILTER_QUERY]: importExpertRules(response[EXPERT_FILTER_QUERY])
|
|
59
61
|
});
|
|
60
62
|
}).catch((error) => {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
catchErrorHandler(error, (message) => {
|
|
64
|
+
setDataFetchStatus(FetchStatus.FETCH_ERROR);
|
|
65
|
+
snackError({
|
|
66
|
+
messageTxt: message,
|
|
67
|
+
headerId: "cannotRetrieveFilter"
|
|
68
|
+
});
|
|
65
69
|
});
|
|
66
70
|
});
|
|
67
71
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { FieldType } from '../../../utils/types/fieldType';
|
|
2
2
|
|
|
3
3
|
import * as yup from 'yup';
|
|
4
|
-
export declare const EXPERT_FILTER_QUERY = "rules";
|
|
5
4
|
export declare const rqbQuerySchemaValidator: (schema: yup.Schema) => yup.Schema<any, any, any, "">;
|
|
6
5
|
export declare const expertFilterSchema: {
|
|
7
6
|
rules: yup.ObjectSchema<{}, yup.AnyObject, {}, "">;
|
|
@@ -7,7 +7,7 @@ import * as yup from "yup";
|
|
|
7
7
|
import { v4 } from "uuid";
|
|
8
8
|
import { Box } from "@mui/material";
|
|
9
9
|
import { testQuery } from "./expertFilterUtils.js";
|
|
10
|
-
import { COMBINATOR_OPTIONS, OPERATOR_OPTIONS, EXPERT_FILTER_EQUIPMENTS, RULES, EXPERT_FILTER_FIELDS } from "./expertFilterConstants.js";
|
|
10
|
+
import { EXPERT_FILTER_QUERY, COMBINATOR_OPTIONS, OPERATOR_OPTIONS, EXPERT_FILTER_EQUIPMENTS, RULES, EXPERT_FILTER_FIELDS } from "./expertFilterConstants.js";
|
|
11
11
|
import { FieldConstants } from "../../../utils/constants/fieldConstants.js";
|
|
12
12
|
import { InputWithPopupConfirmation } from "../../inputs/reactHookForm/selectInputs/InputWithPopupConfirmation.js";
|
|
13
13
|
import { SelectInput } from "../../inputs/reactHookForm/selectInputs/SelectInput.js";
|
|
@@ -38,7 +38,6 @@ yup.setLocale({
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
|
-
const EXPERT_FILTER_QUERY = "rules";
|
|
42
41
|
function isSupportedEquipmentType(equipmentType) {
|
|
43
42
|
return Object.values(EXPERT_FILTER_EQUIPMENTS).map((equipments) => equipments.id).includes(equipmentType);
|
|
44
43
|
}
|
|
@@ -115,7 +114,6 @@ function ExpertFilterForm() {
|
|
|
115
114
|
] });
|
|
116
115
|
}
|
|
117
116
|
export {
|
|
118
|
-
EXPERT_FILTER_QUERY,
|
|
119
117
|
ExpertFilterForm,
|
|
120
118
|
expertFilterSchema,
|
|
121
119
|
getExpertFilterEmptyFormData,
|
|
@@ -8,6 +8,7 @@ var RULES = /* @__PURE__ */ ((RULES2) => {
|
|
|
8
8
|
RULES2["BETWEEN_RULE"] = "betweenRule";
|
|
9
9
|
return RULES2;
|
|
10
10
|
})(RULES || {});
|
|
11
|
+
const EXPERT_FILTER_QUERY = "rules";
|
|
11
12
|
const EXPERT_FILTER_EQUIPMENTS = {
|
|
12
13
|
SUBSTATION: {
|
|
13
14
|
id: "SUBSTATION",
|
|
@@ -1416,6 +1417,7 @@ export {
|
|
|
1416
1417
|
ENERGY_SOURCE_OPTIONS,
|
|
1417
1418
|
EXPERT_FILTER_EQUIPMENTS,
|
|
1418
1419
|
EXPERT_FILTER_FIELDS,
|
|
1420
|
+
EXPERT_FILTER_QUERY,
|
|
1419
1421
|
FIELDS_OPTIONS,
|
|
1420
1422
|
LOAD_TYPE_OPTIONS,
|
|
1421
1423
|
OPERATOR_OPTIONS,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ExpertFilterEditionDialog } from "./ExpertFilterEditionDialog.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData, rqbQuerySchemaValidator } from "./ExpertFilterForm.js";
|
|
3
3
|
import { CombinatorType, DataType, OperatorType } from "./expertFilter.type.js";
|
|
4
|
-
import { COMBINATOR_OPTIONS, CONVERTERS_MODE_OPTIONS, ENERGY_SOURCE_OPTIONS, EXPERT_FILTER_EQUIPMENTS, EXPERT_FILTER_FIELDS, FIELDS_OPTIONS, LOAD_TYPE_OPTIONS, OPERATOR_OPTIONS, PHASE_REGULATION_MODE_OPTIONS, RATIO_REGULATION_MODE_OPTIONS, REGULATION_TYPE_OPTIONS, RULES, SHUNT_COMPENSATOR_TYPE_OPTIONS, SVAR_REGULATION_MODE_OPTIONS } from "./expertFilterConstants.js";
|
|
4
|
+
import { COMBINATOR_OPTIONS, CONVERTERS_MODE_OPTIONS, ENERGY_SOURCE_OPTIONS, EXPERT_FILTER_EQUIPMENTS, EXPERT_FILTER_FIELDS, EXPERT_FILTER_QUERY, FIELDS_OPTIONS, LOAD_TYPE_OPTIONS, OPERATOR_OPTIONS, PHASE_REGULATION_MODE_OPTIONS, RATIO_REGULATION_MODE_OPTIONS, REGULATION_TYPE_OPTIONS, RULES, SHUNT_COMPENSATOR_TYPE_OPTIONS, SVAR_REGULATION_MODE_OPTIONS } from "./expertFilterConstants.js";
|
|
5
5
|
import { countRules, exportExpertRules, getNumberOfSiblings, getOperators, importExpertRules, queryValidator, recursiveRemove, testQuery } from "./expertFilterUtils.js";
|
|
6
6
|
export {
|
|
7
7
|
COMBINATOR_OPTIONS,
|
|
@@ -0,0 +1,7 @@
|
|
|
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 const FILTER_EQUIPMENTS_ATTRIBUTES = "filterEquipmentsAttributes";
|
|
@@ -9,11 +9,12 @@ import { FieldConstants } from "../../../utils/constants/fieldConstants.js";
|
|
|
9
9
|
import "../../../utils/yupConfig.js";
|
|
10
10
|
import { CustomMuiDialog } from "../../dialogs/customMuiDialog/CustomMuiDialog.js";
|
|
11
11
|
import { saveExplicitNamingFilter } from "../utils/filterApi.js";
|
|
12
|
-
import { explicitNamingFilterSchema
|
|
12
|
+
import { explicitNamingFilterSchema } from "./ExplicitNamingFilterForm.js";
|
|
13
13
|
import { FetchStatus } from "../../../utils/constants/fetchStatus.js";
|
|
14
14
|
import { FilterForm } from "../FilterForm.js";
|
|
15
15
|
import { FilterType, NO_ITEM_SELECTION_FOR_COPY } from "../constants/FilterConstants.js";
|
|
16
16
|
import { HeaderFilterSchema } from "../HeaderFilterForm.js";
|
|
17
|
+
import { FILTER_EQUIPMENTS_ATTRIBUTES } from "./ExplicitNamingFilterConstants.js";
|
|
17
18
|
import * as yup from "yup";
|
|
18
19
|
const formSchema = yup.object().shape({
|
|
19
20
|
...HeaderFilterSchema,
|
|
@@ -50,13 +51,14 @@ function ExplicitNamingFilterEditionDialog({
|
|
|
50
51
|
if (id && open) {
|
|
51
52
|
setDataFetchStatus(FetchStatus.FETCHING);
|
|
52
53
|
getFilterById(id).then((response) => {
|
|
54
|
+
var _a2;
|
|
53
55
|
setDataFetchStatus(FetchStatus.FETCH_SUCCESS);
|
|
54
56
|
reset({
|
|
55
57
|
[FieldConstants.NAME]: name,
|
|
56
58
|
[FieldConstants.DESCRIPTION]: description,
|
|
57
59
|
[FieldConstants.FILTER_TYPE]: FilterType.EXPLICIT_NAMING.id,
|
|
58
60
|
[FieldConstants.EQUIPMENT_TYPE]: response[FieldConstants.EQUIPMENT_TYPE],
|
|
59
|
-
[FILTER_EQUIPMENTS_ATTRIBUTES]: response[FILTER_EQUIPMENTS_ATTRIBUTES].map((row) => ({
|
|
61
|
+
[FILTER_EQUIPMENTS_ATTRIBUTES]: (_a2 = response[FILTER_EQUIPMENTS_ATTRIBUTES]) == null ? void 0 : _a2.map((row) => ({
|
|
60
62
|
[FieldConstants.AG_GRID_ROW_UUID]: v4(),
|
|
61
63
|
...row
|
|
62
64
|
}))
|
|
@@ -3,7 +3,6 @@ import { default as yup } from '../../../utils/yupConfig';
|
|
|
3
3
|
import { FieldConstants } from '../../../utils/constants/fieldConstants';
|
|
4
4
|
import { UUID } from 'crypto';
|
|
5
5
|
|
|
6
|
-
export declare const FILTER_EQUIPMENTS_ATTRIBUTES = "filterEquipmentsAttributes";
|
|
7
6
|
export declare const explicitNamingFilterSchema: {
|
|
8
7
|
filterEquipmentsAttributes: yup.ArraySchema<{
|
|
9
8
|
equipmentID?: string | null | undefined;
|
|
@@ -6,7 +6,7 @@ import { Box } from "@mui/material";
|
|
|
6
6
|
import { v4 } from "uuid";
|
|
7
7
|
import { FieldConstants } from "../../../utils/constants/fieldConstants.js";
|
|
8
8
|
import "../../../utils/yupConfig.js";
|
|
9
|
-
import {
|
|
9
|
+
import { CustomAgGridTable } from "../../inputs/reactHookForm/agGridTable/CustomAgGridTable.js";
|
|
10
10
|
import { SelectInput } from "../../inputs/reactHookForm/selectInputs/SelectInput.js";
|
|
11
11
|
import { Generator, Load } from "../../../utils/types/equipmentTypes.js";
|
|
12
12
|
import { NumericEditor } from "../../inputs/reactHookForm/agGridTable/cellEditors/numericEditor.js";
|
|
@@ -26,8 +26,8 @@ import "@mui/material/DialogContent";
|
|
|
26
26
|
import "@mui/material/DialogActions";
|
|
27
27
|
import "@mui/material/Button";
|
|
28
28
|
import "@mui/material/styles";
|
|
29
|
+
import { FILTER_EQUIPMENTS_ATTRIBUTES } from "./ExplicitNamingFilterConstants.js";
|
|
29
30
|
import * as yup from "yup";
|
|
30
|
-
const FILTER_EQUIPMENTS_ATTRIBUTES = "filterEquipmentsAttributes";
|
|
31
31
|
function isGeneratorOrLoad(equipmentType) {
|
|
32
32
|
return equipmentType === Generator.type || equipmentType === Load.type;
|
|
33
33
|
}
|
|
@@ -86,11 +86,11 @@ function ExplicitNamingFilterForm({ sourceFilterForExplicitNamingConversion }) {
|
|
|
86
86
|
}, [sourceFilterForExplicitNamingConversion, setValue]);
|
|
87
87
|
const columnDefs = useMemo(() => {
|
|
88
88
|
const newColumnDefs = [
|
|
89
|
-
...ROW_DRAGGING_SELECTION_COLUMN_DEF,
|
|
90
89
|
{
|
|
91
90
|
headerName: intl.formatMessage({
|
|
92
91
|
id: FieldConstants.EQUIPMENT_ID
|
|
93
92
|
}),
|
|
93
|
+
rowDrag: true,
|
|
94
94
|
field: FieldConstants.EQUIPMENT_ID,
|
|
95
95
|
editable: true,
|
|
96
96
|
singleClickEdit: true,
|
|
@@ -200,7 +200,12 @@ function ExplicitNamingFilterForm({ sourceFilterForExplicitNamingConversion }) {
|
|
|
200
200
|
makeDefaultRowData,
|
|
201
201
|
pagination: true,
|
|
202
202
|
paginationPageSize: 100,
|
|
203
|
-
|
|
203
|
+
rowSelection: {
|
|
204
|
+
mode: "multiRow",
|
|
205
|
+
enableClickSelection: false,
|
|
206
|
+
checkboxes: true,
|
|
207
|
+
headerCheckbox: true
|
|
208
|
+
},
|
|
204
209
|
alwaysShowVerticalScroll: true,
|
|
205
210
|
stopEditingWhenCellsLoseFocus: true,
|
|
206
211
|
csvProps: {
|
|
@@ -222,7 +227,6 @@ function ExplicitNamingFilterForm({ sourceFilterForExplicitNamingConversion }) {
|
|
|
222
227
|
}
|
|
223
228
|
export {
|
|
224
229
|
ExplicitNamingFilterForm,
|
|
225
|
-
FILTER_EQUIPMENTS_ATTRIBUTES,
|
|
226
230
|
explicitNamingFilterSchema,
|
|
227
231
|
getExplicitNamingFilterEmptyFormData
|
|
228
232
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ExplicitNamingFilterEditionDialog } from "./ExplicitNamingFilterEditionDialog.js";
|
|
2
|
-
import { ExplicitNamingFilterForm,
|
|
2
|
+
import { ExplicitNamingFilterForm, explicitNamingFilterSchema, getExplicitNamingFilterEmptyFormData } from "./ExplicitNamingFilterForm.js";
|
|
3
|
+
import { FILTER_EQUIPMENTS_ATTRIBUTES } from "./ExplicitNamingFilterConstants.js";
|
|
3
4
|
export {
|
|
4
5
|
ExplicitNamingFilterEditionDialog,
|
|
5
6
|
ExplicitNamingFilterForm,
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FILTER_EQUIPMENTS_ATTRIBUTES } from './explicitNaming/ExplicitNamingFilterConstants';
|
|
2
|
+
import { EXPERT_FILTER_QUERY } from './expert/expertFilterConstants';
|
|
3
|
+
import { RuleGroupTypeExport } from './expert/expertFilter.type';
|
|
4
|
+
import { ElementExistsType, FieldConstants } from '../../utils';
|
|
2
5
|
import { UUID } from 'crypto';
|
|
3
6
|
|
|
4
7
|
/**
|
|
@@ -12,6 +15,10 @@ export type ItemSelectionForCopy = {
|
|
|
12
15
|
parentDirectoryUuid: UUID | null;
|
|
13
16
|
specificTypeItem: string | null;
|
|
14
17
|
};
|
|
18
|
+
type EquipmentsFilter = {
|
|
19
|
+
equipmentID: string;
|
|
20
|
+
distributionKey?: number;
|
|
21
|
+
};
|
|
15
22
|
export interface FilterEditionProps {
|
|
16
23
|
id: string;
|
|
17
24
|
name: string;
|
|
@@ -22,10 +29,20 @@ export interface FilterEditionProps {
|
|
|
22
29
|
itemSelectionForCopy: ItemSelectionForCopy;
|
|
23
30
|
setItemSelectionForCopy: (selection: ItemSelectionForCopy) => void;
|
|
24
31
|
getFilterById: (id: string) => Promise<{
|
|
25
|
-
[
|
|
32
|
+
[FieldConstants.EQUIPMENT_TYPE]: string;
|
|
33
|
+
[EXPERT_FILTER_QUERY]?: RuleGroupTypeExport;
|
|
34
|
+
[FILTER_EQUIPMENTS_ATTRIBUTES]?: EquipmentsFilter[];
|
|
26
35
|
}>;
|
|
27
36
|
activeDirectory?: UUID;
|
|
28
37
|
elementExists?: ElementExistsType;
|
|
29
38
|
language?: string;
|
|
30
39
|
description?: string;
|
|
31
40
|
}
|
|
41
|
+
export interface NewFilterType {
|
|
42
|
+
id: string | null;
|
|
43
|
+
type: string;
|
|
44
|
+
equipmentType: string;
|
|
45
|
+
rules?: RuleGroupTypeExport;
|
|
46
|
+
filterEquipmentsAttributes?: EquipmentsFilter[];
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
@@ -4,12 +4,13 @@ import { DISTRIBUTION_KEY, FilterType, NO_ITEM_SELECTION_FOR_COPY } from "./cons
|
|
|
4
4
|
import { CriteriaBasedForm } from "../contingencyList/criteriaBased/CriteriaBasedForm.js";
|
|
5
5
|
import { getCriteriaBasedFormData, getCriteriaBasedSchema } from "../contingencyList/criteriaBased/criteriaBasedUtils.js";
|
|
6
6
|
import { ExpertFilterEditionDialog } from "./expert/ExpertFilterEditionDialog.js";
|
|
7
|
-
import {
|
|
7
|
+
import { ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData, rqbQuerySchemaValidator } from "./expert/ExpertFilterForm.js";
|
|
8
8
|
import { CombinatorType, DataType, OperatorType } from "./expert/expertFilter.type.js";
|
|
9
|
-
import { COMBINATOR_OPTIONS, CONVERTERS_MODE_OPTIONS, ENERGY_SOURCE_OPTIONS, EXPERT_FILTER_EQUIPMENTS, EXPERT_FILTER_FIELDS, FIELDS_OPTIONS, LOAD_TYPE_OPTIONS, OPERATOR_OPTIONS, PHASE_REGULATION_MODE_OPTIONS, RATIO_REGULATION_MODE_OPTIONS, REGULATION_TYPE_OPTIONS, RULES, SHUNT_COMPENSATOR_TYPE_OPTIONS, SVAR_REGULATION_MODE_OPTIONS } from "./expert/expertFilterConstants.js";
|
|
9
|
+
import { COMBINATOR_OPTIONS, CONVERTERS_MODE_OPTIONS, ENERGY_SOURCE_OPTIONS, EXPERT_FILTER_EQUIPMENTS, EXPERT_FILTER_FIELDS, EXPERT_FILTER_QUERY, FIELDS_OPTIONS, LOAD_TYPE_OPTIONS, OPERATOR_OPTIONS, PHASE_REGULATION_MODE_OPTIONS, RATIO_REGULATION_MODE_OPTIONS, REGULATION_TYPE_OPTIONS, RULES, SHUNT_COMPENSATOR_TYPE_OPTIONS, SVAR_REGULATION_MODE_OPTIONS } from "./expert/expertFilterConstants.js";
|
|
10
10
|
import { countRules, exportExpertRules, getNumberOfSiblings, getOperators, importExpertRules, queryValidator, recursiveRemove, testQuery } from "./expert/expertFilterUtils.js";
|
|
11
11
|
import { ExplicitNamingFilterEditionDialog } from "./explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
12
|
-
import { ExplicitNamingFilterForm,
|
|
12
|
+
import { ExplicitNamingFilterForm, explicitNamingFilterSchema, getExplicitNamingFilterEmptyFormData } from "./explicitNaming/ExplicitNamingFilterForm.js";
|
|
13
|
+
import { FILTER_EQUIPMENTS_ATTRIBUTES } from "./explicitNaming/ExplicitNamingFilterConstants.js";
|
|
13
14
|
import { saveExpertFilter, saveExplicitNamingFilter } from "./utils/filterApi.js";
|
|
14
15
|
import { CONTINGENCY_LIST_EQUIPMENTS, FILTER_EQUIPMENTS } from "./utils/filterFormUtils.js";
|
|
15
16
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { UUID } from 'crypto';
|
|
2
2
|
|
|
3
3
|
export declare const saveExplicitNamingFilter: (tableValues: any[], isFilterCreation: boolean, equipmentType: string, name: string, description: string, id: string | null, setCreateFilterErr: (value?: string) => void, handleClose: () => void, activeDirectory?: UUID, token?: string) => void;
|
|
4
|
-
export declare const saveExpertFilter: (id: string | null, query: any, equipmentType: string, name: string, description: string, isFilterCreation: boolean, activeDirectory:
|
|
4
|
+
export declare const saveExpertFilter: (id: string | null, query: any, equipmentType: string, name: string, description: string, isFilterCreation: boolean, activeDirectory: UUID | undefined | null, onClose: () => void, onError: (message: string) => void, token?: string) => void;
|
|
@@ -3,6 +3,7 @@ import { Generator, Load } from "../../../utils/types/equipmentTypes.js";
|
|
|
3
3
|
import { exportExpertRules } from "../expert/expertFilterUtils.js";
|
|
4
4
|
import { DISTRIBUTION_KEY, FilterType } from "../constants/FilterConstants.js";
|
|
5
5
|
import { createFilter, saveFilter } from "../../../services/explore.js";
|
|
6
|
+
import { catchErrorHandler } from "../../../services/utils.js";
|
|
6
7
|
const saveExplicitNamingFilter = (tableValues, isFilterCreation, equipmentType, name, description, id, setCreateFilterErr, handleClose, activeDirectory, token) => {
|
|
7
8
|
let cleanedTableValues;
|
|
8
9
|
const isGeneratorOrLoad = equipmentType === Generator.type || equipmentType === Load.type;
|
|
@@ -19,6 +20,7 @@ const saveExplicitNamingFilter = (tableValues, isFilterCreation, equipmentType,
|
|
|
19
20
|
if (isFilterCreation) {
|
|
20
21
|
createFilter(
|
|
21
22
|
{
|
|
23
|
+
id: null,
|
|
22
24
|
type: FilterType.EXPLICIT_NAMING.id,
|
|
23
25
|
equipmentType,
|
|
24
26
|
filterEquipmentsAttributes: cleanedTableValues
|
|
@@ -54,6 +56,7 @@ const saveExpertFilter = (id, query, equipmentType, name, description, isFilterC
|
|
|
54
56
|
if (isFilterCreation) {
|
|
55
57
|
createFilter(
|
|
56
58
|
{
|
|
59
|
+
id: null,
|
|
57
60
|
type: FilterType.EXPERT.id,
|
|
58
61
|
equipmentType,
|
|
59
62
|
rules: exportExpertRules(query)
|
|
@@ -65,7 +68,9 @@ const saveExpertFilter = (id, query, equipmentType, name, description, isFilterC
|
|
|
65
68
|
).then(() => {
|
|
66
69
|
onClose();
|
|
67
70
|
}).catch((error) => {
|
|
68
|
-
|
|
71
|
+
catchErrorHandler(error, (message) => {
|
|
72
|
+
onError(message);
|
|
73
|
+
});
|
|
69
74
|
});
|
|
70
75
|
} else {
|
|
71
76
|
saveFilter(
|
|
@@ -81,7 +86,9 @@ const saveExpertFilter = (id, query, equipmentType, name, description, isFilterC
|
|
|
81
86
|
).then(() => {
|
|
82
87
|
onClose();
|
|
83
88
|
}).catch((error) => {
|
|
84
|
-
|
|
89
|
+
catchErrorHandler(error, (message) => {
|
|
90
|
+
onError(message);
|
|
91
|
+
});
|
|
85
92
|
});
|
|
86
93
|
}
|
|
87
94
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { TextFieldProps } from '@mui/material';
|
|
2
2
|
|
|
3
|
-
export declare function extractDefault(paramDescription:
|
|
3
|
+
export declare function extractDefault(paramDescription: Parameter): any;
|
|
4
4
|
export type Parameter = {
|
|
5
5
|
type: 'BOOLEAN' | 'DOUBLE' | 'INTEGER' | 'STRING_LIST' | 'STRING';
|
|
6
6
|
description?: string;
|
|
7
7
|
name: string;
|
|
8
|
-
possibleValues:
|
|
8
|
+
possibleValues: string[];
|
|
9
9
|
defaultValue: any;
|
|
10
10
|
};
|
|
11
11
|
export interface FlatParametersProps {
|
package/dist/components/index.js
CHANGED
|
@@ -29,12 +29,13 @@ import { DISTRIBUTION_KEY, FilterType, NO_ITEM_SELECTION_FOR_COPY } from "./filt
|
|
|
29
29
|
import { CriteriaBasedForm } from "./contingencyList/criteriaBased/CriteriaBasedForm.js";
|
|
30
30
|
import { getCriteriaBasedFormData, getCriteriaBasedSchema } from "./contingencyList/criteriaBased/criteriaBasedUtils.js";
|
|
31
31
|
import { ExpertFilterEditionDialog } from "./filter/expert/ExpertFilterEditionDialog.js";
|
|
32
|
-
import {
|
|
32
|
+
import { ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData, rqbQuerySchemaValidator } from "./filter/expert/ExpertFilterForm.js";
|
|
33
33
|
import { CombinatorType, DataType, OperatorType } from "./filter/expert/expertFilter.type.js";
|
|
34
|
-
import { COMBINATOR_OPTIONS, CONVERTERS_MODE_OPTIONS, ENERGY_SOURCE_OPTIONS, EXPERT_FILTER_EQUIPMENTS, EXPERT_FILTER_FIELDS, FIELDS_OPTIONS, LOAD_TYPE_OPTIONS, OPERATOR_OPTIONS, PHASE_REGULATION_MODE_OPTIONS, RATIO_REGULATION_MODE_OPTIONS, REGULATION_TYPE_OPTIONS, RULES, SHUNT_COMPENSATOR_TYPE_OPTIONS, SVAR_REGULATION_MODE_OPTIONS } from "./filter/expert/expertFilterConstants.js";
|
|
34
|
+
import { COMBINATOR_OPTIONS, CONVERTERS_MODE_OPTIONS, ENERGY_SOURCE_OPTIONS, EXPERT_FILTER_EQUIPMENTS, EXPERT_FILTER_FIELDS, EXPERT_FILTER_QUERY, FIELDS_OPTIONS, LOAD_TYPE_OPTIONS, OPERATOR_OPTIONS, PHASE_REGULATION_MODE_OPTIONS, RATIO_REGULATION_MODE_OPTIONS, REGULATION_TYPE_OPTIONS, RULES, SHUNT_COMPENSATOR_TYPE_OPTIONS, SVAR_REGULATION_MODE_OPTIONS } from "./filter/expert/expertFilterConstants.js";
|
|
35
35
|
import { countRules, exportExpertRules, getNumberOfSiblings, getOperators, importExpertRules, queryValidator, recursiveRemove, testQuery } from "./filter/expert/expertFilterUtils.js";
|
|
36
36
|
import { ExplicitNamingFilterEditionDialog } from "./filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
37
|
-
import { ExplicitNamingFilterForm,
|
|
37
|
+
import { ExplicitNamingFilterForm, explicitNamingFilterSchema, getExplicitNamingFilterEmptyFormData } from "./filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
38
|
+
import { FILTER_EQUIPMENTS_ATTRIBUTES } from "./filter/explicitNaming/ExplicitNamingFilterConstants.js";
|
|
38
39
|
import { saveExpertFilter, saveExplicitNamingFilter } from "./filter/utils/filterApi.js";
|
|
39
40
|
import { CONTINGENCY_LIST_EQUIPMENTS, FILTER_EQUIPMENTS } from "./filter/utils/filterFormUtils.js";
|
|
40
41
|
import { FlatParameters, extractDefault } from "./flatParameters/FlatParameters.js";
|
|
@@ -42,7 +43,7 @@ import { SelectClearable } from "./inputs/SelectClearable.js";
|
|
|
42
43
|
import { DirectoryItemsInput, NAME } from "./inputs/reactHookForm/DirectoryItemsInput.js";
|
|
43
44
|
import { RawReadOnlyInput } from "./inputs/reactHookForm/RawReadOnlyInput.js";
|
|
44
45
|
import { BottomRightButtons } from "./inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
45
|
-
import { CustomAgGridTable
|
|
46
|
+
import { CustomAgGridTable } from "./inputs/reactHookForm/agGridTable/CustomAgGridTable.js";
|
|
46
47
|
import { NumericEditor } from "./inputs/reactHookForm/agGridTable/cellEditors/numericEditor.js";
|
|
47
48
|
import { CsvUploader } from "./inputs/reactHookForm/agGridTable/csvUploader/CsvUploader.js";
|
|
48
49
|
import { AutocompleteInput } from "./inputs/reactHookForm/autocompleteInputs/AutocompleteInput.js";
|
|
@@ -189,7 +190,6 @@ export {
|
|
|
189
190
|
PropertyValueEditor,
|
|
190
191
|
RATIO_REGULATION_MODE_OPTIONS,
|
|
191
192
|
REGULATION_TYPE_OPTIONS,
|
|
192
|
-
ROW_DRAGGING_SELECTION_COLUMN_DEF,
|
|
193
193
|
RULES,
|
|
194
194
|
RadioInput,
|
|
195
195
|
RangeInput,
|
|
@@ -2,7 +2,7 @@ import { SelectClearable } from "./SelectClearable.js";
|
|
|
2
2
|
import { DirectoryItemsInput, NAME } from "./reactHookForm/DirectoryItemsInput.js";
|
|
3
3
|
import { RawReadOnlyInput } from "./reactHookForm/RawReadOnlyInput.js";
|
|
4
4
|
import { BottomRightButtons } from "./reactHookForm/agGridTable/BottomRightButtons.js";
|
|
5
|
-
import { CustomAgGridTable
|
|
5
|
+
import { CustomAgGridTable } from "./reactHookForm/agGridTable/CustomAgGridTable.js";
|
|
6
6
|
import { NumericEditor } from "./reactHookForm/agGridTable/cellEditors/numericEditor.js";
|
|
7
7
|
import { CsvUploader } from "./reactHookForm/agGridTable/csvUploader/CsvUploader.js";
|
|
8
8
|
import { AutocompleteInput } from "./reactHookForm/autocompleteInputs/AutocompleteInput.js";
|
|
@@ -84,7 +84,6 @@ export {
|
|
|
84
84
|
NAME,
|
|
85
85
|
NumericEditor,
|
|
86
86
|
PropertyValueEditor,
|
|
87
|
-
ROW_DRAGGING_SELECTION_COLUMN_DEF,
|
|
88
87
|
RadioInput,
|
|
89
88
|
RangeInput,
|
|
90
89
|
RangeType,
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
*/
|
|
1
|
+
import { ElementAttributes } from '../../../utils';
|
|
2
|
+
|
|
7
3
|
export declare const NAME = "name";
|
|
8
4
|
export interface DirectoryItemsInputProps {
|
|
9
5
|
label: string | undefined;
|
|
10
6
|
name: string;
|
|
11
7
|
elementType: string;
|
|
12
8
|
equipmentTypes?: string[];
|
|
13
|
-
itemFilter?:
|
|
9
|
+
itemFilter?: (val: ElementAttributes) => boolean;
|
|
14
10
|
titleId?: string;
|
|
15
11
|
hideErrorMessage?: boolean;
|
|
16
12
|
onRowChanged?: (a: boolean) => void;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
+
import { AgGridReactProps } from 'ag-grid-react';
|
|
1
2
|
|
|
2
|
-
export declare const ROW_DRAGGING_SELECTION_COLUMN_DEF: {
|
|
3
|
-
rowDrag: boolean;
|
|
4
|
-
headerCheckboxSelection: boolean;
|
|
5
|
-
checkboxSelection: boolean;
|
|
6
|
-
maxWidth: number;
|
|
7
|
-
}[];
|
|
8
3
|
export interface CustomAgGridTableProps {
|
|
9
4
|
name: string;
|
|
10
5
|
columnDefs: any;
|
|
@@ -14,8 +9,8 @@ export interface CustomAgGridTableProps {
|
|
|
14
9
|
defaultColDef: unknown;
|
|
15
10
|
pagination: boolean;
|
|
16
11
|
paginationPageSize: number;
|
|
17
|
-
|
|
12
|
+
rowSelection?: AgGridReactProps['rowSelection'];
|
|
18
13
|
alwaysShowVerticalScroll: boolean;
|
|
19
14
|
stopEditingWhenCellsLoseFocus: boolean;
|
|
20
15
|
}
|
|
21
|
-
export declare function CustomAgGridTable({ name, columnDefs, makeDefaultRowData, csvProps, cssProps, defaultColDef, pagination, paginationPageSize,
|
|
16
|
+
export declare function CustomAgGridTable({ name, columnDefs, makeDefaultRowData, csvProps, cssProps, defaultColDef, pagination, paginationPageSize, rowSelection, alwaysShowVerticalScroll, stopEditingWhenCellsLoseFocus, ...props }: Readonly<CustomAgGridTableProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,14 +8,6 @@ import { useTheme, Box } from "@mui/material";
|
|
|
8
8
|
import { useIntl } from "react-intl";
|
|
9
9
|
import { BottomRightButtons } from "./BottomRightButtons.js";
|
|
10
10
|
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
11
|
-
const ROW_DRAGGING_SELECTION_COLUMN_DEF = [
|
|
12
|
-
{
|
|
13
|
-
rowDrag: true,
|
|
14
|
-
headerCheckboxSelection: true,
|
|
15
|
-
checkboxSelection: true,
|
|
16
|
-
maxWidth: 50
|
|
17
|
-
}
|
|
18
|
-
];
|
|
19
11
|
const style = (customProps) => ({
|
|
20
12
|
grid: (theme) => ({
|
|
21
13
|
width: "auto",
|
|
@@ -80,7 +72,7 @@ function CustomAgGridTable({
|
|
|
80
72
|
defaultColDef,
|
|
81
73
|
pagination,
|
|
82
74
|
paginationPageSize,
|
|
83
|
-
|
|
75
|
+
rowSelection,
|
|
84
76
|
alwaysShowVerticalScroll,
|
|
85
77
|
stopEditingWhenCellsLoseFocus,
|
|
86
78
|
...props
|
|
@@ -190,11 +182,10 @@ function CustomAgGridTable({
|
|
|
190
182
|
onGridReady,
|
|
191
183
|
getLocaleText,
|
|
192
184
|
cacheOverflowSize: 10,
|
|
193
|
-
rowSelection: "multiple",
|
|
185
|
+
rowSelection: rowSelection ?? "multiple",
|
|
194
186
|
rowDragEntireRow: true,
|
|
195
187
|
rowDragManaged: true,
|
|
196
188
|
onRowDragEnd: (e) => move(getIndex(e.node.data), e.overIndex),
|
|
197
|
-
suppressBrowserResizeObserver: true,
|
|
198
189
|
columnDefs,
|
|
199
190
|
detailRowAutoHeight: true,
|
|
200
191
|
onSelectionChanged: () => {
|
|
@@ -206,9 +197,9 @@ function CustomAgGridTable({
|
|
|
206
197
|
getRowId: (row) => row.data[FieldConstants.AG_GRID_ROW_UUID],
|
|
207
198
|
pagination,
|
|
208
199
|
paginationPageSize,
|
|
209
|
-
suppressRowClickSelection,
|
|
210
200
|
alwaysShowVerticalScroll,
|
|
211
201
|
stopEditingWhenCellsLoseFocus,
|
|
202
|
+
theme: "legacy",
|
|
212
203
|
...props
|
|
213
204
|
}
|
|
214
205
|
) }),
|
|
@@ -230,6 +221,5 @@ function CustomAgGridTable({
|
|
|
230
221
|
] });
|
|
231
222
|
}
|
|
232
223
|
export {
|
|
233
|
-
CustomAgGridTable
|
|
234
|
-
ROW_DRAGGING_SELECTION_COLUMN_DEF
|
|
224
|
+
CustomAgGridTable
|
|
235
225
|
};
|
|
@@ -11,13 +11,13 @@ export declare class NumericEditor implements ICellEditorComp {
|
|
|
11
11
|
eInput: HTMLInputElement;
|
|
12
12
|
cancelBeforeStart: boolean;
|
|
13
13
|
init(params: ICellEditorParams): void;
|
|
14
|
-
static isBackspace(event:
|
|
15
|
-
static isNavigationKey(event:
|
|
14
|
+
static isBackspace(event: KeyboardEvent): boolean;
|
|
15
|
+
static isNavigationKey(event: KeyboardEvent): boolean;
|
|
16
16
|
getGui(): HTMLInputElement;
|
|
17
17
|
afterGuiAttached(): void;
|
|
18
18
|
isCancelBeforeStart(): boolean;
|
|
19
19
|
getValue(): number | null;
|
|
20
20
|
static isCharNumeric(charStr: string | null): boolean | "" | null;
|
|
21
|
-
static isNumericKey(event:
|
|
21
|
+
static isNumericKey(event: KeyboardEvent): boolean | "" | null;
|
|
22
22
|
static focusOut(): boolean;
|
|
23
23
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { BottomRightButtons } from "./BottomRightButtons.js";
|
|
2
|
-
import { CustomAgGridTable
|
|
2
|
+
import { CustomAgGridTable } from "./CustomAgGridTable.js";
|
|
3
3
|
import { NumericEditor } from "./cellEditors/numericEditor.js";
|
|
4
4
|
import { CsvUploader } from "./csvUploader/CsvUploader.js";
|
|
5
5
|
export {
|
|
6
6
|
BottomRightButtons,
|
|
7
7
|
CsvUploader,
|
|
8
8
|
CustomAgGridTable,
|
|
9
|
-
NumericEditor
|
|
10
|
-
ROW_DRAGGING_SELECTION_COLUMN_DEF
|
|
9
|
+
NumericEditor
|
|
11
10
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Checkbox, Switch } from '@mui/material';
|
|
1
|
+
import { Checkbox, CheckboxProps, Switch, SwitchProps } from '@mui/material';
|
|
2
2
|
|
|
3
3
|
export interface BooleanInputProps {
|
|
4
4
|
name: string;
|
|
5
5
|
label?: string;
|
|
6
|
-
formProps?:
|
|
6
|
+
formProps?: SwitchProps | CheckboxProps;
|
|
7
7
|
Input: typeof Switch | typeof Checkbox;
|
|
8
8
|
}
|
|
9
9
|
export declare function BooleanInput({ name, label, formProps, Input }: BooleanInputProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DirectoryItemsInput, NAME } from "./DirectoryItemsInput.js";
|
|
2
2
|
import { RawReadOnlyInput } from "./RawReadOnlyInput.js";
|
|
3
3
|
import { BottomRightButtons } from "./agGridTable/BottomRightButtons.js";
|
|
4
|
-
import { CustomAgGridTable
|
|
4
|
+
import { CustomAgGridTable } from "./agGridTable/CustomAgGridTable.js";
|
|
5
5
|
import { NumericEditor } from "./agGridTable/cellEditors/numericEditor.js";
|
|
6
6
|
import { CsvUploader } from "./agGridTable/csvUploader/CsvUploader.js";
|
|
7
7
|
import { AutocompleteInput } from "./autocompleteInputs/AutocompleteInput.js";
|
|
@@ -59,7 +59,6 @@ export {
|
|
|
59
59
|
MultipleAutocompleteInput,
|
|
60
60
|
NAME,
|
|
61
61
|
NumericEditor,
|
|
62
|
-
ROW_DRAGGING_SELECTION_COLUMN_DEF,
|
|
63
62
|
RadioInput,
|
|
64
63
|
RangeInput,
|
|
65
64
|
RangeType,
|
|
@@ -2,6 +2,6 @@ import { SliderProps } from '@mui/material';
|
|
|
2
2
|
|
|
3
3
|
export interface SliderInputProps extends SliderProps {
|
|
4
4
|
name: string;
|
|
5
|
-
onValueChanged: (value:
|
|
5
|
+
onValueChanged: (value: number | number[]) => void;
|
|
6
6
|
}
|
|
7
7
|
export declare function SliderInput({ name, min, max, step, size, onValueChanged }: SliderInputProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
*/
|
|
1
|
+
import { ElementAttributes } from '../../../utils';
|
|
2
|
+
|
|
7
3
|
interface ElementValueEditorProps {
|
|
8
4
|
name: string;
|
|
9
5
|
elementType: string;
|
|
@@ -11,7 +7,7 @@ interface ElementValueEditorProps {
|
|
|
11
7
|
titleId: string;
|
|
12
8
|
hideErrorMessage: boolean;
|
|
13
9
|
onChange?: (e: any) => void;
|
|
14
|
-
itemFilter?:
|
|
10
|
+
itemFilter?: (val: ElementAttributes) => boolean;
|
|
15
11
|
defaultValue?: any;
|
|
16
12
|
}
|
|
17
13
|
export declare function ElementValueEditor(props: ElementValueEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
6
|
*/
|
|
7
7
|
export declare const useNotificationsListener: (listenerKey: string, { listenerCallbackMessage, listenerCallbackOnReopen, propsId, }: {
|
|
8
|
-
listenerCallbackMessage?: ((event: MessageEvent
|
|
8
|
+
listenerCallbackMessage?: ((event: MessageEvent) => void) | undefined;
|
|
9
9
|
listenerCallbackOnReopen?: (() => void) | undefined;
|
|
10
10
|
propsId?: string | undefined;
|
|
11
11
|
}) => void;
|
|
@@ -3,9 +3,7 @@ import { OptionsObject, closeSnackbar as closeSnackbarFromNotistack } from 'noti
|
|
|
3
3
|
interface SnackInputs extends Omit<OptionsObject, 'variant' | 'style'> {
|
|
4
4
|
messageTxt?: string;
|
|
5
5
|
messageId?: string;
|
|
6
|
-
messageValues?:
|
|
7
|
-
[key: string]: string;
|
|
8
|
-
};
|
|
6
|
+
messageValues?: Record<string, string>;
|
|
9
7
|
headerTxt?: string;
|
|
10
8
|
headerId?: string;
|
|
11
9
|
headerValues?: Record<string, string>;
|
package/dist/index.js
CHANGED
|
@@ -30,12 +30,13 @@ import { DISTRIBUTION_KEY, FilterType, NO_ITEM_SELECTION_FOR_COPY } from "./comp
|
|
|
30
30
|
import { CriteriaBasedForm } from "./components/contingencyList/criteriaBased/CriteriaBasedForm.js";
|
|
31
31
|
import { getCriteriaBasedFormData, getCriteriaBasedSchema } from "./components/contingencyList/criteriaBased/criteriaBasedUtils.js";
|
|
32
32
|
import { ExpertFilterEditionDialog } from "./components/filter/expert/ExpertFilterEditionDialog.js";
|
|
33
|
-
import {
|
|
33
|
+
import { ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData, rqbQuerySchemaValidator } from "./components/filter/expert/ExpertFilterForm.js";
|
|
34
34
|
import { CombinatorType, DataType, OperatorType } from "./components/filter/expert/expertFilter.type.js";
|
|
35
|
-
import { COMBINATOR_OPTIONS, CONVERTERS_MODE_OPTIONS, ENERGY_SOURCE_OPTIONS, EXPERT_FILTER_EQUIPMENTS, EXPERT_FILTER_FIELDS, FIELDS_OPTIONS, LOAD_TYPE_OPTIONS, OPERATOR_OPTIONS, PHASE_REGULATION_MODE_OPTIONS, RATIO_REGULATION_MODE_OPTIONS, REGULATION_TYPE_OPTIONS, RULES, SHUNT_COMPENSATOR_TYPE_OPTIONS, SVAR_REGULATION_MODE_OPTIONS } from "./components/filter/expert/expertFilterConstants.js";
|
|
35
|
+
import { COMBINATOR_OPTIONS, CONVERTERS_MODE_OPTIONS, ENERGY_SOURCE_OPTIONS, EXPERT_FILTER_EQUIPMENTS, EXPERT_FILTER_FIELDS, EXPERT_FILTER_QUERY, FIELDS_OPTIONS, LOAD_TYPE_OPTIONS, OPERATOR_OPTIONS, PHASE_REGULATION_MODE_OPTIONS, RATIO_REGULATION_MODE_OPTIONS, REGULATION_TYPE_OPTIONS, RULES, SHUNT_COMPENSATOR_TYPE_OPTIONS, SVAR_REGULATION_MODE_OPTIONS } from "./components/filter/expert/expertFilterConstants.js";
|
|
36
36
|
import { countRules, exportExpertRules, getNumberOfSiblings, getOperators, importExpertRules, queryValidator, recursiveRemove, testQuery } from "./components/filter/expert/expertFilterUtils.js";
|
|
37
37
|
import { ExplicitNamingFilterEditionDialog } from "./components/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
38
|
-
import { ExplicitNamingFilterForm,
|
|
38
|
+
import { ExplicitNamingFilterForm, explicitNamingFilterSchema, getExplicitNamingFilterEmptyFormData } from "./components/filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
39
|
+
import { FILTER_EQUIPMENTS_ATTRIBUTES } from "./components/filter/explicitNaming/ExplicitNamingFilterConstants.js";
|
|
39
40
|
import { saveExpertFilter, saveExplicitNamingFilter } from "./components/filter/utils/filterApi.js";
|
|
40
41
|
import { CONTINGENCY_LIST_EQUIPMENTS, FILTER_EQUIPMENTS } from "./components/filter/utils/filterFormUtils.js";
|
|
41
42
|
import { FlatParameters, extractDefault } from "./components/flatParameters/FlatParameters.js";
|
|
@@ -43,7 +44,7 @@ import { SelectClearable } from "./components/inputs/SelectClearable.js";
|
|
|
43
44
|
import { DirectoryItemsInput, NAME } from "./components/inputs/reactHookForm/DirectoryItemsInput.js";
|
|
44
45
|
import { RawReadOnlyInput } from "./components/inputs/reactHookForm/RawReadOnlyInput.js";
|
|
45
46
|
import { BottomRightButtons } from "./components/inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
46
|
-
import { CustomAgGridTable
|
|
47
|
+
import { CustomAgGridTable } from "./components/inputs/reactHookForm/agGridTable/CustomAgGridTable.js";
|
|
47
48
|
import { NumericEditor } from "./components/inputs/reactHookForm/agGridTable/cellEditors/numericEditor.js";
|
|
48
49
|
import { CsvUploader } from "./components/inputs/reactHookForm/agGridTable/csvUploader/CsvUploader.js";
|
|
49
50
|
import { AutocompleteInput } from "./components/inputs/reactHookForm/autocompleteInputs/AutocompleteInput.js";
|
|
@@ -305,7 +306,6 @@ export {
|
|
|
305
306
|
RATIO_REGULATION_MODE_OPTIONS,
|
|
306
307
|
REGULATION_TYPE_OPTIONS,
|
|
307
308
|
RESET_AUTHENTICATION_ROUTER_ERROR,
|
|
308
|
-
ROW_DRAGGING_SELECTION_COLUMN_DEF,
|
|
309
309
|
RULES,
|
|
310
310
|
RadioInput,
|
|
311
311
|
RangeInput,
|
package/dist/module-mui.d.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import "@mui/material/Switch";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { NewFilterType } from '../components/filter/filter.type';
|
|
1
2
|
import { ElementAttributes } from '../utils/types/types';
|
|
2
3
|
import { UUID } from 'crypto';
|
|
3
4
|
|
|
4
|
-
export declare function createFilter(newFilter:
|
|
5
|
-
export declare function saveFilter(filter:
|
|
5
|
+
export declare function createFilter(newFilter: NewFilterType, name: string, description: string, parentDirectoryUuid: UUID | undefined | null, token?: string): Promise<Response>;
|
|
6
|
+
export declare function saveFilter(filter: NewFilterType, name: string, description: string, token?: string): Promise<Response>;
|
|
6
7
|
export declare function fetchElementsInfos(ids: UUID[], elementTypes?: string[], equipmentTypes?: string[]): Promise<ElementAttributes[]>;
|
package/dist/services/utils.d.ts
CHANGED
|
@@ -4,7 +4,13 @@
|
|
|
4
4
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
5
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
8
|
-
|
|
7
|
+
export interface BackendFetchInit {
|
|
8
|
+
method: string;
|
|
9
|
+
headers?: HeadersInit;
|
|
10
|
+
body?: string | FormData;
|
|
11
|
+
signal?: AbortSignal;
|
|
12
|
+
}
|
|
13
|
+
export declare const backendFetch: (url: string, init: BackendFetchInit, token?: string) => Promise<Response>;
|
|
14
|
+
export declare const backendFetchJson: (url: string, init: BackendFetchInit, token?: string) => Promise<any>;
|
|
9
15
|
export declare const getRequestParamFromList: (paramName: string, params?: string[]) => URLSearchParams;
|
|
10
16
|
export declare const catchErrorHandler: (error: unknown, callback: (message: string) => void) => void;
|
package/dist/services/utils.js
CHANGED
|
@@ -28,7 +28,7 @@ const handleError = (response) => {
|
|
|
28
28
|
customError.status = errorJson.status;
|
|
29
29
|
} else {
|
|
30
30
|
customError = new Error(`${errorName + response.status} ${response.statusText}, message : ${text}`);
|
|
31
|
-
customError.status = response.
|
|
31
|
+
customError.status = response.statusText;
|
|
32
32
|
}
|
|
33
33
|
throw customError;
|
|
34
34
|
});
|
package/dist/utils/algos.d.ts
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
5
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
6
|
*/
|
|
7
|
-
export declare function equalsArray(a:
|
|
7
|
+
export declare function equalsArray<T>(a: T[] | null, b: T[]): boolean;
|
package/dist/utils/algos.js
CHANGED
|
@@ -9,11 +9,13 @@ function equalsArray(a, b) {
|
|
|
9
9
|
return false;
|
|
10
10
|
}
|
|
11
11
|
for (let i = 0, l = a.length; i < l; i++) {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
const newA = a[i];
|
|
13
|
+
const newB = b[i];
|
|
14
|
+
if (newA instanceof Array && newB instanceof Array) {
|
|
15
|
+
if (!equalsArray(newA, newB)) {
|
|
14
16
|
return false;
|
|
15
17
|
}
|
|
16
|
-
} else if (
|
|
18
|
+
} else if (newA !== newB) {
|
|
17
19
|
return false;
|
|
18
20
|
}
|
|
19
21
|
}
|
|
@@ -19,6 +19,7 @@ function getFileIcon(type, style) {
|
|
|
19
19
|
case ElementType.LOADFLOW_PARAMETERS:
|
|
20
20
|
case ElementType.SENSITIVITY_PARAMETERS:
|
|
21
21
|
case ElementType.SHORT_CIRCUIT_PARAMETERS:
|
|
22
|
+
case ElementType.NETWORK_VISUALIZATIONS_PARAMETERS:
|
|
22
23
|
return /* @__PURE__ */ jsx(Settings, { sx: style });
|
|
23
24
|
case ElementType.SPREADSHEET_CONFIG:
|
|
24
25
|
return /* @__PURE__ */ jsx(Calculate, { sx: style });
|
|
@@ -13,6 +13,7 @@ export declare enum ElementType {
|
|
|
13
13
|
LOADFLOW_PARAMETERS = "LOADFLOW_PARAMETERS",
|
|
14
14
|
SENSITIVITY_PARAMETERS = "SENSITIVITY_PARAMETERS",
|
|
15
15
|
SHORT_CIRCUIT_PARAMETERS = "SHORT_CIRCUIT_PARAMETERS",
|
|
16
|
+
NETWORK_VISUALIZATIONS_PARAMETERS = "NETWORK_VISUALIZATIONS_PARAMETERS",
|
|
16
17
|
SPREADSHEET_CONFIG = "SPREADSHEET_CONFIG",
|
|
17
18
|
SPREADSHEET_CONFIG_COLLECTION = "SPREADSHEET_CONFIG_COLLECTION"
|
|
18
19
|
}
|
|
@@ -11,6 +11,7 @@ var ElementType = /* @__PURE__ */ ((ElementType2) => {
|
|
|
11
11
|
ElementType2["LOADFLOW_PARAMETERS"] = "LOADFLOW_PARAMETERS";
|
|
12
12
|
ElementType2["SENSITIVITY_PARAMETERS"] = "SENSITIVITY_PARAMETERS";
|
|
13
13
|
ElementType2["SHORT_CIRCUIT_PARAMETERS"] = "SHORT_CIRCUIT_PARAMETERS";
|
|
14
|
+
ElementType2["NETWORK_VISUALIZATIONS_PARAMETERS"] = "NETWORK_VISUALIZATIONS_PARAMETERS";
|
|
14
15
|
ElementType2["SPREADSHEET_CONFIG"] = "SPREADSHEET_CONFIG";
|
|
15
16
|
ElementType2["SPREADSHEET_CONFIG_COLLECTION"] = "SPREADSHEET_CONFIG_COLLECTION";
|
|
16
17
|
return ElementType2;
|
|
@@ -17,9 +17,14 @@ export type ElementAttributes = {
|
|
|
17
17
|
lastModificationDate: string;
|
|
18
18
|
lastModifiedBy: string;
|
|
19
19
|
lastModifiedByLabel?: string;
|
|
20
|
-
children:
|
|
20
|
+
children: ElementAttributes[];
|
|
21
21
|
parentUuid: null | UUID;
|
|
22
|
-
specificMetadata:
|
|
22
|
+
specificMetadata: {
|
|
23
|
+
type: string;
|
|
24
|
+
equipmentType: string;
|
|
25
|
+
sheetType?: string;
|
|
26
|
+
format?: string;
|
|
27
|
+
};
|
|
23
28
|
uploading?: boolean;
|
|
24
29
|
hasMetadata?: boolean;
|
|
25
30
|
subtype?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridsuite/commons-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.80.0",
|
|
4
4
|
"description": "common react components for gridsuite applications",
|
|
5
5
|
"engines": {
|
|
6
6
|
"npm": ">=9",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"@mui/material": "^5.15.14",
|
|
55
55
|
"@mui/system": "^5.15.15",
|
|
56
56
|
"@mui/x-tree-view": "^6.17.0",
|
|
57
|
-
"ag-grid-community": "^
|
|
58
|
-
"ag-grid-react": "^
|
|
57
|
+
"ag-grid-community": "^33.0.3",
|
|
58
|
+
"ag-grid-react": "^33.0.3",
|
|
59
59
|
"notistack": "^3.0.1",
|
|
60
60
|
"papaparse": "^5.4.1",
|
|
61
61
|
"react": "^18.2.0",
|
|
@@ -101,8 +101,8 @@
|
|
|
101
101
|
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
102
102
|
"@typescript-eslint/parser": "^7.0.0",
|
|
103
103
|
"@vitejs/plugin-react": "^4.2.1",
|
|
104
|
-
"ag-grid-community": "^
|
|
105
|
-
"ag-grid-react": "^
|
|
104
|
+
"ag-grid-community": "^33.0.3",
|
|
105
|
+
"ag-grid-react": "^33.0.3",
|
|
106
106
|
"babel-eslint": "^10.1.0",
|
|
107
107
|
"babel-preset-airbnb": "^5.0.0",
|
|
108
108
|
"babel-preset-vite": "^1.1.3",
|