@gridsuite/commons-ui 0.79.0 → 0.81.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.
Files changed (46) hide show
  1. package/dist/components/authentication/utils/userManagerMock.d.ts +3 -3
  2. package/dist/components/authentication/utils/userManagerMock.js +1 -2
  3. package/dist/components/directoryItemSelector/DirectoryItemSelector.d.ts +2 -11
  4. package/dist/components/directoryItemSelector/DirectoryItemSelector.js +3 -1
  5. package/dist/components/filter/FilterCreationDialog.js +4 -2
  6. package/dist/components/filter/expert/ExpertFilterEditionDialog.js +9 -5
  7. package/dist/components/filter/expert/ExpertFilterForm.d.ts +0 -1
  8. package/dist/components/filter/expert/ExpertFilterForm.js +1 -3
  9. package/dist/components/filter/expert/expertFilterConstants.d.ts +1 -0
  10. package/dist/components/filter/expert/expertFilterConstants.js +2 -0
  11. package/dist/components/filter/expert/index.js +2 -2
  12. package/dist/components/filter/explicitNaming/ExplicitNamingFilterConstants.d.ts +7 -0
  13. package/dist/components/filter/explicitNaming/ExplicitNamingFilterConstants.js +4 -0
  14. package/dist/components/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js +4 -2
  15. package/dist/components/filter/explicitNaming/ExplicitNamingFilterForm.d.ts +0 -1
  16. package/dist/components/filter/explicitNaming/ExplicitNamingFilterForm.js +1 -2
  17. package/dist/components/filter/explicitNaming/index.d.ts +1 -0
  18. package/dist/components/filter/explicitNaming/index.js +2 -1
  19. package/dist/components/filter/filter.type.d.ts +19 -2
  20. package/dist/components/filter/index.js +4 -3
  21. package/dist/components/filter/utils/filterApi.d.ts +1 -1
  22. package/dist/components/filter/utils/filterApi.js +9 -2
  23. package/dist/components/flatParameters/FlatParameters.d.ts +2 -2
  24. package/dist/components/index.js +4 -3
  25. package/dist/components/inputs/reactHookForm/DirectoryItemsInput.d.ts +3 -7
  26. package/dist/components/inputs/reactHookForm/agGridTable/cellEditors/numericEditor.d.ts +3 -3
  27. package/dist/components/inputs/reactHookForm/agGridTable/csvUploader/CsvUploader.d.ts +1 -1
  28. package/dist/components/inputs/reactHookForm/booleans/BooleanInput.d.ts +2 -2
  29. package/dist/components/inputs/reactHookForm/numbers/SliderInput.d.ts +1 -1
  30. package/dist/components/inputs/reactHookForm/selectInputs/MuiSelectInput.d.ts +1 -1
  31. package/dist/components/inputs/reactHookForm/selectInputs/MuiSelectInput.js +7 -1
  32. package/dist/components/inputs/reactQueryBuilder/ElementValueEditor.d.ts +3 -7
  33. package/dist/components/notifications/hooks/useNotificationsListener.d.ts +1 -1
  34. package/dist/hooks/useSnackMessage.d.ts +1 -3
  35. package/dist/index.js +4 -3
  36. package/dist/module-mui.d.js +1 -1
  37. package/dist/services/explore.d.ts +3 -2
  38. package/dist/services/utils.d.ts +8 -2
  39. package/dist/services/utils.js +1 -1
  40. package/dist/utils/algos.d.ts +1 -1
  41. package/dist/utils/algos.js +5 -3
  42. package/dist/utils/mapper/getFileIcon.js +1 -0
  43. package/dist/utils/types/elementType.d.ts +1 -0
  44. package/dist/utils/types/elementType.js +1 -0
  45. package/dist/utils/types/types.d.ts +7 -2
  46. package/package.json +1 -1
@@ -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: any) => void)[];
5
- addUserLoaded(callback: (data: any) => void): void;
6
- addSilentRenewError(callback: (data: any) => void): void;
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;
@@ -5,8 +5,7 @@ class Events {
5
5
  addUserLoaded(callback) {
6
6
  this.userLoadedCallbacks.push(callback);
7
7
  }
8
- // eslint-disable-next-line
9
- addSilentRenewError(callback) {
8
+ addSilentRenewError() {
10
9
  }
11
10
  load() {
12
11
  }
@@ -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?: any;
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((item) => contentFilter().has(item.type));
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, FILTER_EQUIPMENTS_ATTRIBUTES } from "./explicitNaming/ExplicitNamingFilterForm.js";
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, EXPERT_FILTER_QUERY } from "./expert/ExpertFilterForm.js";
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, EXPERT_FILTER_QUERY } from "./ExpertFilterForm.js";
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
- setDataFetchStatus(FetchStatus.FETCH_ERROR);
62
- snackError({
63
- messageTxt: error.message,
64
- headerId: "cannotRetrieveFilter"
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 @@ export declare enum RULES {
8
8
  INCORRECT_RULE = "incorrectRule",
9
9
  BETWEEN_RULE = "betweenRule"
10
10
  }
11
+ export declare const EXPERT_FILTER_QUERY = "rules";
11
12
  export declare const EXPERT_FILTER_EQUIPMENTS: {
12
13
  SUBSTATION: {
13
14
  id: string;
@@ -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 { EXPERT_FILTER_QUERY, ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData, rqbQuerySchemaValidator } from "./ExpertFilterForm.js";
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";
@@ -0,0 +1,4 @@
1
+ const FILTER_EQUIPMENTS_ATTRIBUTES = "filterEquipmentsAttributes";
2
+ export {
3
+ FILTER_EQUIPMENTS_ATTRIBUTES
4
+ };
@@ -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, FILTER_EQUIPMENTS_ATTRIBUTES } from "./ExplicitNamingFilterForm.js";
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;
@@ -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
  }
@@ -227,7 +227,6 @@ function ExplicitNamingFilterForm({ sourceFilterForExplicitNamingConversion }) {
227
227
  }
228
228
  export {
229
229
  ExplicitNamingFilterForm,
230
- FILTER_EQUIPMENTS_ATTRIBUTES,
231
230
  explicitNamingFilterSchema,
232
231
  getExplicitNamingFilterEmptyFormData
233
232
  };
@@ -6,3 +6,4 @@
6
6
  */
7
7
  export * from './ExplicitNamingFilterEditionDialog';
8
8
  export * from './ExplicitNamingFilterForm';
9
+ export * from './ExplicitNamingFilterConstants';
@@ -1,5 +1,6 @@
1
1
  import { ExplicitNamingFilterEditionDialog } from "./ExplicitNamingFilterEditionDialog.js";
2
- import { ExplicitNamingFilterForm, FILTER_EQUIPMENTS_ATTRIBUTES, explicitNamingFilterSchema, getExplicitNamingFilterEmptyFormData } from "./ExplicitNamingFilterForm.js";
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 { ElementExistsType } from '../../utils';
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
- [prop: string]: any;
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 { EXPERT_FILTER_QUERY, ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData, rqbQuerySchemaValidator } from "./expert/ExpertFilterForm.js";
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, FILTER_EQUIPMENTS_ATTRIBUTES, explicitNamingFilterSchema, getExplicitNamingFilterEmptyFormData } from "./explicitNaming/ExplicitNamingFilterForm.js";
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: any, onClose: () => void, onError: (message: string) => void, token?: string) => void;
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
- onError(error.message);
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
- onError(error.message);
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: any): any;
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: any;
8
+ possibleValues: string[];
9
9
  defaultValue: any;
10
10
  };
11
11
  export interface FlatParametersProps {
@@ -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 { EXPERT_FILTER_QUERY, ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData, rqbQuerySchemaValidator } from "./filter/expert/ExpertFilterForm.js";
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, FILTER_EQUIPMENTS_ATTRIBUTES, explicitNamingFilterSchema, getExplicitNamingFilterEmptyFormData } from "./filter/explicitNaming/ExplicitNamingFilterForm.js";
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";
@@ -1,16 +1,12 @@
1
- /**
2
- * Copyright (c) 2023, 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
- */
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?: any;
9
+ itemFilter?: (val: ElementAttributes) => boolean;
14
10
  titleId?: string;
15
11
  hideErrorMessage?: boolean;
16
12
  onRowChanged?: (a: boolean) => void;
@@ -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: any): boolean;
15
- static isNavigationKey(event: any): boolean;
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: any): boolean | "" | null;
21
+ static isNumericKey(event: KeyboardEvent): boolean | "" | null;
22
22
  static focusOut(): boolean;
23
23
  }
@@ -7,7 +7,7 @@
7
7
  export interface CsvUploaderProps {
8
8
  name: string;
9
9
  onClose: () => void;
10
- open: true;
10
+ open: boolean;
11
11
  title: string[];
12
12
  fileHeaders: string[];
13
13
  fileName: string;
@@ -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?: any;
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;
@@ -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: any) => void;
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;
@@ -5,6 +5,6 @@ export type MuiSelectInputProps = SelectProps & {
5
5
  options: {
6
6
  id: string;
7
7
  label: string;
8
- }[];
8
+ }[] | string[];
9
9
  };
10
10
  export declare function MuiSelectInput({ name, options, ...props }: MuiSelectInputProps): import("react/jsx-runtime").JSX.Element;
@@ -2,13 +2,19 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { FormattedMessage } from "react-intl";
3
3
  import { Select, MenuItem } from "@mui/material";
4
4
  import { useController } from "react-hook-form";
5
+ function renderMenuItem(option) {
6
+ const key = typeof option === "string" ? option : option.id;
7
+ const value = key;
8
+ const label = typeof option === "string" ? option : /* @__PURE__ */ jsx(FormattedMessage, { id: option.label });
9
+ return /* @__PURE__ */ jsx(MenuItem, { value, children: label }, key);
10
+ }
5
11
  function MuiSelectInput({ name, options, ...props }) {
6
12
  const {
7
13
  field: { value, onChange }
8
14
  } = useController({
9
15
  name
10
16
  });
11
- return /* @__PURE__ */ jsx(Select, { value, onChange, ...props, children: options.map((option) => /* @__PURE__ */ jsx(MenuItem, { value: option.id ?? option, children: /* @__PURE__ */ jsx(FormattedMessage, { id: option.label ?? option }) }, option.id ?? option.label)) });
17
+ return /* @__PURE__ */ jsx(Select, { value, onChange, ...props, children: options.map(renderMenuItem) });
12
18
  }
13
19
  export {
14
20
  MuiSelectInput
@@ -1,9 +1,5 @@
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
- */
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?: any;
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<any>) => void) | undefined;
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 { EXPERT_FILTER_QUERY, ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData, rqbQuerySchemaValidator } from "./components/filter/expert/ExpertFilterForm.js";
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, FILTER_EQUIPMENTS_ATTRIBUTES, explicitNamingFilterSchema, getExplicitNamingFilterEmptyFormData } from "./components/filter/explicitNaming/ExplicitNamingFilterForm.js";
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";
@@ -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: any, name: string, description: string, parentDirectoryUuid?: UUID, token?: string): Promise<any>;
5
- export declare function saveFilter(filter: any, name: string, description: string, token?: string): Promise<any>;
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[]>;
@@ -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 declare const backendFetch: (url: string, init: any, token?: string) => Promise<any>;
8
- export declare const backendFetchJson: (url: string, init: any, token?: string) => Promise<any>;
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;
@@ -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.status;
31
+ customError.status = response.statusText;
32
32
  }
33
33
  throw customError;
34
34
  });
@@ -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: Array<any>, b: Array<any>): boolean;
7
+ export declare function equalsArray<T>(a: T[] | null, b: T[]): boolean;
@@ -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
- if (a[i] instanceof Array && b[i] instanceof Array) {
13
- if (!equalsArray(a[i], b[i])) {
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 (a[i] !== b[i]) {
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: any[];
20
+ children: ElementAttributes[];
21
21
  parentUuid: null | UUID;
22
- specificMetadata: Record<string, object>;
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.79.0",
3
+ "version": "0.81.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "engines": {
6
6
  "npm": ">=9",