@gridsuite/commons-ui 0.126.0 → 0.128.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 (99) hide show
  1. package/dist/components/customAGGrid/index.d.ts +1 -0
  2. package/dist/components/customAGGrid/index.js +2 -0
  3. package/dist/components/customAGGrid/separatorCellRenderer.d.ts +11 -0
  4. package/dist/components/customAGGrid/separatorCellRenderer.js +16 -0
  5. package/dist/components/dialogs/elementSaveDialog/ElementSaveDialog.js +5 -5
  6. package/dist/components/dnd-table/dnd-table-add-rows-dialog.js +3 -3
  7. package/dist/components/filter/HeaderFilterForm.js +3 -3
  8. package/dist/components/filter/expert/expertFilterUtils.d.ts +1 -0
  9. package/dist/components/filter/expert/expertFilterUtils.js +9 -1
  10. package/dist/components/filter/expert/index.js +2 -1
  11. package/dist/components/filter/index.js +2 -1
  12. package/dist/components/index.js +4 -1
  13. package/dist/components/inputs/reactHookForm/DirectoryItemsInput.d.ts +2 -1
  14. package/dist/components/inputs/reactHookForm/DirectoryItemsInput.js +52 -23
  15. package/dist/components/inputs/reactHookForm/text/TextInput.d.ts +3 -1
  16. package/dist/components/inputs/reactHookForm/text/TextInput.js +3 -1
  17. package/dist/components/inputs/reactHookForm/text/UniqueNameInput.d.ts +2 -1
  18. package/dist/components/inputs/reactHookForm/text/UniqueNameInput.js +3 -1
  19. package/dist/components/notifications/NotificationsProvider.js +1 -1
  20. package/dist/components/notifications/contexts/NotificationsContext.d.ts +5 -3
  21. package/dist/components/notifications/hooks/useListenerManager.d.ts +3 -3
  22. package/dist/components/notifications/hooks/useListenerManager.js +2 -2
  23. package/dist/components/parameters/common/ProviderParam.js +3 -3
  24. package/dist/components/parameters/common/limitreductions/limit-reduction-table-cell.js +3 -3
  25. package/dist/components/parameters/common/limitreductions/limit-reductions-table-form.js +3 -3
  26. package/dist/components/parameters/common/limitreductions/limit-reductions-tooltip-column.js +4 -3
  27. package/dist/components/parameters/common/name-element-editor/name-element-editor-utils.js +3 -3
  28. package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table-cell.js +3 -3
  29. package/dist/components/parameters/common/widget/parameter-float.js +3 -3
  30. package/dist/components/parameters/common/widget/parameter-line-slider.js +3 -3
  31. package/dist/components/parameters/loadflow/load-flow-general-parameters.js +3 -3
  32. package/dist/components/parameters/loadflow/load-flow-parameter-field.js +3 -3
  33. package/dist/components/parameters/loadflow/load-flow-parameters-content.js +3 -3
  34. package/dist/components/parameters/loadflow/load-flow-parameters-dialog.js +3 -3
  35. package/dist/components/parameters/loadflow/load-flow-parameters-form.js +3 -3
  36. package/dist/components/parameters/loadflow/load-flow-parameters-header.js +3 -3
  37. package/dist/components/parameters/loadflow/load-flow-parameters-inline.js +3 -3
  38. package/dist/components/parameters/loadflow/load-flow-parameters-utils.js +3 -3
  39. package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +3 -3
  40. package/dist/components/parameters/network-visualizations/map-parameters.js +3 -3
  41. package/dist/components/parameters/network-visualizations/network-area-diagram-parameters.js +3 -3
  42. package/dist/components/parameters/network-visualizations/network-visualizations-form.js +3 -3
  43. package/dist/components/parameters/network-visualizations/network-visualizations-parameters-dialog.js +3 -3
  44. package/dist/components/parameters/network-visualizations/network-visualizations-parameters-inline.js +3 -3
  45. package/dist/components/parameters/network-visualizations/single-line-diagram-parameters.js +3 -3
  46. package/dist/components/parameters/network-visualizations/use-network-visualizations-parameters-form.js +3 -3
  47. package/dist/components/parameters/security-analysis/security-analysis-parameters-dialog.js +3 -3
  48. package/dist/components/parameters/security-analysis/security-analysis-parameters-form.js +3 -3
  49. package/dist/components/parameters/security-analysis/security-analysis-parameters-inline.js +3 -3
  50. package/dist/components/parameters/security-analysis/security-analysis-parameters-selector.js +3 -3
  51. package/dist/components/parameters/security-analysis/security-analysis-violations-hiding.js +3 -3
  52. package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.js +3 -3
  53. package/dist/components/parameters/sensi/sensitivity-Flow-parameters.js +3 -3
  54. package/dist/components/parameters/sensi/sensitivity-analysis-parameters-dialog.js +3 -3
  55. package/dist/components/parameters/sensi/sensitivity-analysis-parameters-form.js +3 -3
  56. package/dist/components/parameters/sensi/sensitivity-analysis-parameters-inline.js +3 -3
  57. package/dist/components/parameters/sensi/sensitivity-parameters-selector.js +3 -3
  58. package/dist/components/parameters/sensi/sensitivity-table.js +3 -3
  59. package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +3 -3
  60. package/dist/components/parameters/sensi/utils.js +3 -3
  61. package/dist/components/parameters/short-circuit/short-circuit-fields.js +3 -3
  62. package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.js +3 -3
  63. package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +3 -3
  64. package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.js +3 -3
  65. package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +3 -3
  66. package/dist/components/parameters/voltage-init/equipment-selection-parameters.js +3 -3
  67. package/dist/components/parameters/voltage-init/general-parameters.js +3 -3
  68. package/dist/components/parameters/voltage-init/use-voltage-init-parameters-form.js +3 -3
  69. package/dist/components/parameters/voltage-init/voltage-init-form-utils.js +3 -3
  70. package/dist/components/parameters/voltage-init/voltage-init-parameters-dialog.js +3 -3
  71. package/dist/components/parameters/voltage-init/voltage-init-parameters-form.js +3 -3
  72. package/dist/components/parameters/voltage-init/voltage-init-parameters-inline.js +3 -3
  73. package/dist/components/parameters/voltage-init/voltage-limits-parameters.js +3 -3
  74. package/dist/components/treeViewFinder/TreeViewFinder.d.ts +3 -0
  75. package/dist/hooks/use-parameters-backend.d.ts +1 -1
  76. package/dist/hooks/use-parameters-backend.js +4 -2
  77. package/dist/hooks/use-unique-name-validation.d.ts +2 -1
  78. package/dist/hooks/use-unique-name-validation.js +16 -8
  79. package/dist/index.js +8 -1
  80. package/dist/translations/en/filterEn.d.ts +1 -0
  81. package/dist/translations/en/filterEn.js +2 -1
  82. package/dist/translations/en/index.d.ts +1 -0
  83. package/dist/translations/en/index.js +3 -1
  84. package/dist/translations/en/parameters.d.ts +2 -0
  85. package/dist/translations/en/parameters.js +3 -1
  86. package/dist/translations/en/use-unique-name-validation-en.d.ts +12 -0
  87. package/dist/translations/en/use-unique-name-validation-en.js +9 -0
  88. package/dist/translations/fr/filterFr.d.ts +1 -0
  89. package/dist/translations/fr/filterFr.js +2 -1
  90. package/dist/translations/fr/index.d.ts +1 -0
  91. package/dist/translations/fr/index.js +3 -1
  92. package/dist/translations/fr/parameters.d.ts +2 -0
  93. package/dist/translations/fr/parameters.js +4 -2
  94. package/dist/translations/fr/use-unique-name-validation-fr.d.ts +12 -0
  95. package/dist/translations/fr/use-unique-name-validation-fr.js +9 -0
  96. package/dist/utils/constants/fieldConstants.d.ts +2 -0
  97. package/dist/utils/constants/fieldConstants.js +2 -0
  98. package/dist/utils/types/equipmentType.d.ts +2 -1
  99. package/package.json +1 -1
@@ -6,3 +6,4 @@
6
6
  */
7
7
  export * from './customAggrid.style';
8
8
  export * from './customAggrid';
9
+ export * from './separatorCellRenderer';
@@ -1,7 +1,9 @@
1
1
  import { CUSTOM_AGGRID_THEME, styles } from "./customAggrid.style.js";
2
2
  import { CustomAGGrid } from "./customAggrid.js";
3
+ import { SeparatorCellRenderer } from "./separatorCellRenderer.js";
3
4
  export {
4
5
  CUSTOM_AGGRID_THEME,
5
6
  CustomAGGrid,
7
+ SeparatorCellRenderer,
6
8
  styles
7
9
  };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright (c) 2025, 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
+ type SeparatorCellRendererProps = {
8
+ value: string;
9
+ };
10
+ export declare function SeparatorCellRenderer({ value }: Readonly<SeparatorCellRendererProps>): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,16 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Typography } from "@mui/material";
3
+ const styles = {
4
+ separator: (theme) => ({
5
+ fontWeight: "bold",
6
+ fontSize: "1rem",
7
+ width: "100%",
8
+ marginTop: theme.spacing(1)
9
+ })
10
+ };
11
+ function SeparatorCellRenderer({ value }) {
12
+ return /* @__PURE__ */ jsx(Typography, { variant: "subtitle1", color: "primary", sx: styles.separator, children: value });
13
+ }
14
+ export {
15
+ SeparatorCellRenderer
16
+ };
@@ -19,6 +19,9 @@ import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
19
19
  import * as yup from "yup";
20
20
  import "../../overflowableText/OverflowableText.js";
21
21
  import { DirectoryItemSelector } from "../../directoryItemSelector/DirectoryItemSelector.js";
22
+ import "react-querybuilder";
23
+ import "uuid";
24
+ import "../../filter/expert/expertFilterConstants.js";
22
25
  import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
23
26
  import "../../customAGGrid/customAggrid.js";
24
27
  import "ag-grid-community";
@@ -29,11 +32,8 @@ import "../../inputs/reactHookForm/numbers/RangeInput.js";
29
32
  import { DescriptionField } from "../../inputs/reactHookForm/text/DescriptionField.js";
30
33
  import { UniqueNameInput } from "../../inputs/reactHookForm/text/UniqueNameInput.js";
31
34
  import "@react-querybuilder/material";
32
- import "../../filter/expert/expertFilterConstants.js";
33
35
  import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
34
- import "uuid";
35
36
  import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
36
- import "react-querybuilder";
37
37
  import { CustomMuiDialog } from "../customMuiDialog/CustomMuiDialog.js";
38
38
  import { initializeDirectory } from "./utils.js";
39
39
  var OperationType = /* @__PURE__ */ ((OperationType2) => {
@@ -225,8 +225,8 @@ function ElementSaveDialog({
225
225
  {
226
226
  name: FieldConstants.OPERATION_TYPE,
227
227
  options: [
228
- { id: "CREATE", label: intl.formatMessage({ id: createLabelId }) },
229
- { id: "UPDATE", label: intl.formatMessage({ id: updateLabelId }) }
228
+ { id: "CREATE", label: createLabelId ?? "createLabelId" },
229
+ { id: "UPDATE", label: updateLabelId ?? "updateLabelId" }
230
230
  ],
231
231
  formProps: {
232
232
  sx: {
@@ -16,6 +16,9 @@ import { CancelButton } from "../inputs/reactHookForm/utils/CancelButton.js";
16
16
  import "yup";
17
17
  import "../overflowableText/OverflowableText.js";
18
18
  import "../treeViewFinder/TreeViewFinder.js";
19
+ import "react-querybuilder";
20
+ import "uuid";
21
+ import "../filter/expert/expertFilterConstants.js";
19
22
  import "../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
20
23
  import "../customAGGrid/customAggrid.js";
21
24
  import "ag-grid-community";
@@ -23,11 +26,8 @@ import "react-papaparse";
23
26
  import "react-csv-downloader";
24
27
  import "../inputs/reactHookForm/numbers/RangeInput.js";
25
28
  import "@react-querybuilder/material";
26
- import "../filter/expert/expertFilterConstants.js";
27
29
  import "../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
28
- import "uuid";
29
30
  import "../inputs/reactQueryBuilder/PropertyValueEditor.js";
30
- import "react-querybuilder";
31
31
  function DndTableAddRowsDialog({ open, handleAddButton, onClose }) {
32
32
  const [rowNumber, setRowNumber] = useState(1);
33
33
  const handleClose = () => {
@@ -18,6 +18,9 @@ import "../inputs/reactHookForm/provider/CustomFormProvider.js";
18
18
  import * as yup from "yup";
19
19
  import "../overflowableText/OverflowableText.js";
20
20
  import "../treeViewFinder/TreeViewFinder.js";
21
+ import "react-querybuilder";
22
+ import "uuid";
23
+ import "./expert/expertFilterConstants.js";
21
24
  import "../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
22
25
  import "../customAGGrid/customAggrid.js";
23
26
  import "ag-grid-community";
@@ -27,11 +30,8 @@ import "../inputs/reactHookForm/numbers/RangeInput.js";
27
30
  import { DescriptionField } from "../inputs/reactHookForm/text/DescriptionField.js";
28
31
  import { UniqueNameInput } from "../inputs/reactHookForm/text/UniqueNameInput.js";
29
32
  import "@react-querybuilder/material";
30
- import "./expert/expertFilterConstants.js";
31
33
  import "../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
32
- import "uuid";
33
34
  import "../inputs/reactQueryBuilder/PropertyValueEditor.js";
34
- import "react-querybuilder";
35
35
  const filterStyles = {
36
36
  textField: {
37
37
  minWidth: "250px",
@@ -12,3 +12,4 @@ export declare const queryValidator: QueryValidator;
12
12
  export declare const testQuery: (check: string, query: RuleGroupTypeAny) => boolean;
13
13
  export declare function getNumberOfSiblings(path: number[], query: RuleGroupTypeAny): number;
14
14
  export declare function recursiveRemove(query: RuleGroupTypeAny, path: number[]): RuleGroupTypeAny;
15
+ export declare function getFilterEquipmentTypeLabel(equipmentType: string | undefined): string;
@@ -1,7 +1,7 @@
1
1
  import { defaultOperators, getParentPath, findPath, remove } from "react-querybuilder";
2
2
  import { validate } from "uuid";
3
3
  import { DataType } from "./expertFilter.type.js";
4
- import { OPERATOR_OPTIONS, RULES, FIELDS_OPTIONS } from "./expertFilterConstants.js";
4
+ import { OPERATOR_OPTIONS, RULES, FIELDS_OPTIONS, EXPERT_FILTER_EQUIPMENTS } from "./expertFilterConstants.js";
5
5
  import { isBlankOrEmpty, convertOutputValue, convertInputValue } from "../../../utils/conversionUtils.js";
6
6
  import { FieldType } from "../../../utils/types/fieldType.js";
7
7
  const searchTree = (tree, key, value) => {
@@ -362,9 +362,17 @@ function recursiveRemove(query, path) {
362
362
  }
363
363
  return remove(query, path);
364
364
  }
365
+ function getFilterEquipmentTypeLabel(equipmentType) {
366
+ var _a;
367
+ if (!equipmentType) {
368
+ return "";
369
+ }
370
+ return ((_a = EXPERT_FILTER_EQUIPMENTS[equipmentType]) == null ? void 0 : _a.label) ?? "";
371
+ }
365
372
  export {
366
373
  countRules,
367
374
  exportExpertRules,
375
+ getFilterEquipmentTypeLabel,
368
376
  getNumberOfSiblings,
369
377
  getOperators,
370
378
  importExpertRules,
@@ -2,7 +2,7 @@ import { ExpertFilterEditionDialog } from "./ExpertFilterEditionDialog.js";
2
2
  import { ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData, rqbQuerySchemaValidator } from "./ExpertFilterForm.js";
3
3
  import { CombinatorType, DataType, OperatorType } from "./expertFilter.type.js";
4
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
- import { countRules, exportExpertRules, getNumberOfSiblings, getOperators, importExpertRules, queryValidator, recursiveRemove, testQuery } from "./expertFilterUtils.js";
5
+ import { countRules, exportExpertRules, getFilterEquipmentTypeLabel, getNumberOfSiblings, getOperators, importExpertRules, queryValidator, recursiveRemove, testQuery } from "./expertFilterUtils.js";
6
6
  export {
7
7
  COMBINATOR_OPTIONS,
8
8
  CONVERTERS_MODE_OPTIONS,
@@ -28,6 +28,7 @@ export {
28
28
  expertFilterSchema,
29
29
  exportExpertRules,
30
30
  getExpertFilterEmptyFormData,
31
+ getFilterEquipmentTypeLabel,
31
32
  getNumberOfSiblings,
32
33
  getOperators,
33
34
  importExpertRules,
@@ -7,7 +7,7 @@ import { ExpertFilterEditionDialog } from "./expert/ExpertFilterEditionDialog.js
7
7
  import { ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData, rqbQuerySchemaValidator } from "./expert/ExpertFilterForm.js";
8
8
  import { CombinatorType, DataType, OperatorType } from "./expert/expertFilter.type.js";
9
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
- import { countRules, exportExpertRules, getNumberOfSiblings, getOperators, importExpertRules, queryValidator, recursiveRemove, testQuery } from "./expert/expertFilterUtils.js";
10
+ import { countRules, exportExpertRules, getFilterEquipmentTypeLabel, getNumberOfSiblings, getOperators, importExpertRules, queryValidator, recursiveRemove, testQuery } from "./expert/expertFilterUtils.js";
11
11
  import { ExplicitNamingFilterEditionDialog } from "./explicitNaming/ExplicitNamingFilterEditionDialog.js";
12
12
  import { ExplicitNamingFilterForm, explicitNamingFilterSchema, getExplicitNamingFilterEmptyFormData } from "./explicitNaming/ExplicitNamingFilterForm.js";
13
13
  import { FILTER_EQUIPMENTS_ATTRIBUTES } from "./explicitNaming/ExplicitNamingFilterConstants.js";
@@ -53,6 +53,7 @@ export {
53
53
  getCriteriaBasedSchema,
54
54
  getExpertFilterEmptyFormData,
55
55
  getExplicitNamingFilterEmptyFormData,
56
+ getFilterEquipmentTypeLabel,
56
57
  getNumberOfSiblings,
57
58
  getOperators,
58
59
  importExpertRules,
@@ -19,6 +19,7 @@ import { ExportCsvButton } from "./csvDownloader/export-csv-button.js";
19
19
  import { useCsvExport } from "./csvDownloader/use-csv-export.js";
20
20
  import { CUSTOM_AGGRID_THEME, styles } from "./customAGGrid/customAggrid.style.js";
21
21
  import { CustomAGGrid } from "./customAGGrid/customAggrid.js";
22
+ import { SeparatorCellRenderer } from "./customAGGrid/separatorCellRenderer.js";
22
23
  import { CustomMuiDialog, unscrollableDialogStyles } from "./dialogs/customMuiDialog/CustomMuiDialog.js";
23
24
  import { DescriptionModificationDialog } from "./dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
24
25
  import { ElementSaveDialog } from "./dialogs/elementSaveDialog/ElementSaveDialog.js";
@@ -44,7 +45,7 @@ import { ExpertFilterEditionDialog } from "./filter/expert/ExpertFilterEditionDi
44
45
  import { ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData, rqbQuerySchemaValidator } from "./filter/expert/ExpertFilterForm.js";
45
46
  import { CombinatorType, DataType, OperatorType } from "./filter/expert/expertFilter.type.js";
46
47
  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";
47
- import { countRules, exportExpertRules, getNumberOfSiblings, getOperators, importExpertRules, queryValidator, recursiveRemove, testQuery } from "./filter/expert/expertFilterUtils.js";
48
+ import { countRules, exportExpertRules, getFilterEquipmentTypeLabel, getNumberOfSiblings, getOperators, importExpertRules, queryValidator, recursiveRemove, testQuery } from "./filter/expert/expertFilterUtils.js";
48
49
  import { ExplicitNamingFilterEditionDialog } from "./filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
49
50
  import { ExplicitNamingFilterForm, explicitNamingFilterSchema, getExplicitNamingFilterEmptyFormData } from "./filter/explicitNaming/ExplicitNamingFilterForm.js";
50
51
  import { FILTER_EQUIPMENTS_ATTRIBUTES } from "./filter/explicitNaming/ExplicitNamingFilterConstants.js";
@@ -428,6 +429,7 @@ export {
428
429
  SensitivityAnalysisParametersDialog,
429
430
  SensitivityAnalysisParametersInline,
430
431
  SensitivityTable,
432
+ SeparatorCellRenderer,
431
433
  ShortCircuitParametersEditionDialog,
432
434
  ShortCircuitParametersInLine,
433
435
  SignInCallbackHandler,
@@ -487,6 +489,7 @@ export {
487
489
  getCriteriaBasedSchema,
488
490
  getExpertFilterEmptyFormData,
489
491
  getExplicitNamingFilterEmptyFormData,
492
+ getFilterEquipmentTypeLabel,
490
493
  getLimitReductionsFormSchema,
491
494
  getNumberOfSiblings,
492
495
  getOperators,
@@ -12,9 +12,10 @@ export interface DirectoryItemsInputProps {
12
12
  disable?: boolean;
13
13
  allowMultiSelect?: boolean;
14
14
  labelRequiredFromContext?: boolean;
15
+ equipmentColorsMap?: Map<string, string>;
15
16
  }
16
17
  export declare function DirectoryItemsInput({ label, name, elementType, // Used to specify type of element (Filter, Contingency list, ...)
17
18
  equipmentTypes, // Mostly used for filters, it allows the user to get elements of specific equipment only
18
19
  itemFilter, // Used to further filter the results displayed according to specific requirement
19
20
  titleId, // title of directory item selector dialogue
20
- hideErrorMessage, onRowChanged, onChange, disable, allowMultiSelect, labelRequiredFromContext, }: Readonly<DirectoryItemsInputProps>): import("react/jsx-runtime").JSX.Element;
21
+ hideErrorMessage, onRowChanged, onChange, disable, allowMultiSelect, labelRequiredFromContext, equipmentColorsMap, }: Readonly<DirectoryItemsInputProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,21 +1,29 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { FormControl, Chip, Grid, Tooltip, IconButton } from "@mui/material";
2
+ import { FormControl, Box, Chip, FormHelperText, Grid, Tooltip, IconButton } from "@mui/material";
3
3
  import { Folder } from "@mui/icons-material";
4
4
  import { useState, useMemo, useCallback } from "react";
5
5
  import { useFieldArray, useController } from "react-hook-form";
6
- import { useIntl } from "react-intl";
6
+ import { useIntl, FormattedMessage } from "react-intl";
7
7
  import { RawReadOnlyInput } from "./RawReadOnlyInput.js";
8
8
  import { FieldLabel } from "./utils/FieldLabel.js";
9
- import { useCustomFormContext } from "./provider/useCustomFormContext.js";
10
9
  import { isFieldRequired } from "./utils/functions.js";
10
+ import "./provider/CustomFormProvider.js";
11
+ import { useCustomFormContext } from "./provider/useCustomFormContext.js";
11
12
  import { ErrorInput } from "./errorManagement/ErrorInput.js";
13
+ import { MidFormError } from "./errorManagement/MidFormError.js";
14
+ import "../../../utils/types/equipmentType.js";
15
+ import { fetchDirectoryElementPath } from "../../../services/directory.js";
16
+ import "localized-countries";
17
+ import "localized-countries/data/fr";
18
+ import "localized-countries/data/en";
12
19
  import { useSnackMessage } from "../../../hooks/useSnackMessage.js";
13
- import { mergeSx } from "../../../utils/styles.js";
14
20
  import { OverflowableText } from "../../overflowableText/OverflowableText.js";
15
- import { MidFormError } from "./errorManagement/MidFormError.js";
16
21
  import { DirectoryItemSelector } from "../../directoryItemSelector/DirectoryItemSelector.js";
17
- import { fetchDirectoryElementPath } from "../../../services/directory.js";
22
+ import "../../../utils/conversionUtils.js";
23
+ import { mergeSx } from "../../../utils/styles.js";
24
+ import "../../../utils/yupConfig.js";
18
25
  import { NAME } from "./constants.js";
26
+ import { getFilterEquipmentTypeLabel } from "../../filter/expert/expertFilterUtils.js";
19
27
  const styles = {
20
28
  formDirectoryElements1: {
21
29
  display: "flex",
@@ -59,7 +67,8 @@ function DirectoryItemsInput({
59
67
  onChange,
60
68
  disable = false,
61
69
  allowMultiSelect = true,
62
- labelRequiredFromContext = true
70
+ labelRequiredFromContext = true,
71
+ equipmentColorsMap
63
72
  }) {
64
73
  const { snackError } = useSnackMessage();
65
74
  const intl = useIntl();
@@ -156,22 +165,42 @@ function DirectoryItemsInput({
156
165
  optional: labelRequiredFromContext && !isFieldRequired(name, validationSchema, getValues())
157
166
  }
158
167
  ),
159
- (elements == null ? void 0 : elements.length) > 0 && /* @__PURE__ */ jsx(FormControl, { sx: styles.formDirectoryElements2, children: elements.map((item, index) => /* @__PURE__ */ jsx(
160
- Chip,
161
- {
162
- size: "small",
163
- onDelete: () => removeElements(index),
164
- onClick: () => handleChipClick(index),
165
- label: /* @__PURE__ */ jsx(
166
- OverflowableText,
167
- {
168
- text: /* @__PURE__ */ jsx(RawReadOnlyInput, { name: `${name}.${index}.${NAME}` }),
169
- sx: { width: "100%" }
170
- }
171
- )
172
- },
173
- item.id
174
- )) }),
168
+ (elements == null ? void 0 : elements.length) > 0 && /* @__PURE__ */ jsx(FormControl, { sx: styles.formDirectoryElements2, children: elements.map((item, index) => {
169
+ var _a, _b, _c;
170
+ return /* @__PURE__ */ jsxs(
171
+ Box,
172
+ {
173
+ sx: { display: "flex", alignItems: "center", flexDirection: "column", gap: 1 },
174
+ children: [
175
+ /* @__PURE__ */ jsx(
176
+ Chip,
177
+ {
178
+ size: "small",
179
+ sx: {
180
+ backgroundColor: ((_a = item == null ? void 0 : item.specificMetadata) == null ? void 0 : _a.equipmentType) && (equipmentColorsMap == null ? void 0 : equipmentColorsMap.get((_b = item == null ? void 0 : item.specificMetadata) == null ? void 0 : _b.equipmentType))
181
+ },
182
+ onDelete: () => removeElements(index),
183
+ onClick: () => handleChipClick(index),
184
+ label: /* @__PURE__ */ jsx(
185
+ OverflowableText,
186
+ {
187
+ text: getValues(`${name}.${index}.${NAME}`) ? /* @__PURE__ */ jsx(RawReadOnlyInput, { name: `${name}.${index}.${NAME}` }) : intl.formatMessage({ id: "elementNotFound" }),
188
+ sx: { width: "100%" }
189
+ }
190
+ )
191
+ }
192
+ ),
193
+ equipmentColorsMap && /* @__PURE__ */ jsx(FormHelperText, { children: ((_c = item == null ? void 0 : item.specificMetadata) == null ? void 0 : _c.equipmentType) ? /* @__PURE__ */ jsx(
194
+ FormattedMessage,
195
+ {
196
+ id: getFilterEquipmentTypeLabel(item.specificMetadata.equipmentType)
197
+ }
198
+ ) : "" })
199
+ ]
200
+ },
201
+ item.id
202
+ );
203
+ }) }),
175
204
  /* @__PURE__ */ jsx(Grid, { item: true, xs: true, children: /* @__PURE__ */ jsx(Grid, { container: true, direction: "row-reverse", children: /* @__PURE__ */ jsx(Tooltip, { title: intl.formatMessage({ id: titleId }), children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
176
205
  IconButton,
177
206
  {
@@ -19,9 +19,11 @@ export interface TextInputProps {
19
19
  clearable?: boolean;
20
20
  formProps?: Omit<TextFieldWithAdornmentProps | TextFieldProps, 'value' | 'onChange' | 'inputRef' | 'inputProps' | 'InputProps'>;
21
21
  disabledTooltip?: boolean;
22
+ disabled?: boolean;
22
23
  }
23
24
  export declare function TextInput({ name, label, labelValues, // this prop is used to add a value to label. this value is displayed without being translated
24
25
  id, adornment, customAdornment, outputTransform, // transform materialUi input value before sending it to react hook form, mostly used to deal with number fields
25
26
  inputTransform, // transform react hook form value before sending it to materialUi input, mostly used to deal with number fields
26
27
  acceptValue, // used to check user entry before committing the input change, used mostly to prevent user from typing a character in number field
27
- previousValue, clearable, formProps, disabledTooltip, }: TextInputProps): import("react/jsx-runtime").JSX.Element;
28
+ previousValue, clearable, formProps, disabledTooltip, // In case we don't want to show tooltip on the value and warning/info icons
29
+ disabled, }: TextInputProps): import("react/jsx-runtime").JSX.Element;
@@ -24,8 +24,9 @@ function TextInput({
24
24
  previousValue,
25
25
  clearable,
26
26
  formProps,
27
- disabledTooltip
27
+ disabledTooltip,
28
28
  // In case we don't want to show tooltip on the value and warning/info icons
29
+ disabled
29
30
  }) {
30
31
  const { validationSchema, getValues, removeOptional, isNodeBuilt, isUpdate } = useCustomFormContext();
31
32
  const {
@@ -60,6 +61,7 @@ function TextInput({
60
61
  label: fieldLabel,
61
62
  value: transformedValue,
62
63
  onChange: handleValueChanged,
64
+ disabled,
63
65
  InputProps: {
64
66
  endAdornment: /* @__PURE__ */ jsxs(InputAdornment, { position: "end", children: [
65
67
  clearable && transformedValue !== void 0 && transformedValue !== "" && /* @__PURE__ */ jsx(IconButton, { onClick: handleClearValue, children: /* @__PURE__ */ jsx(Clear, {}) }),
@@ -11,10 +11,11 @@ export interface UniqueNameInputProps {
11
11
  formProps?: Omit<TextFieldProps, 'value' | 'onChange' | 'name' | 'label' | 'inputRef' | 'inputProps' | 'InputProps'>;
12
12
  activeDirectory?: UUID;
13
13
  currentName?: string;
14
+ isPrefilled?: boolean;
14
15
  sx?: SxStyle;
15
16
  fullWidth?: boolean;
16
17
  }
17
18
  /**
18
19
  * Input component that constantly checks if the field's value is available or not
19
20
  */
20
- export declare function UniqueNameInput({ name, label, elementType, autoFocus, onManualChangeCallback, formProps, currentName, activeDirectory, sx, fullWidth, }: Readonly<UniqueNameInputProps>): import("react/jsx-runtime").JSX.Element;
21
+ export declare function UniqueNameInput({ name, label, elementType, autoFocus, onManualChangeCallback, formProps, currentName, isPrefilled, activeDirectory, sx, fullWidth, }: Readonly<UniqueNameInputProps>): import("react/jsx-runtime").JSX.Element;
@@ -12,6 +12,7 @@ function UniqueNameInput({
12
12
  onManualChangeCallback,
13
13
  formProps,
14
14
  currentName = "",
15
+ isPrefilled = false,
15
16
  activeDirectory,
16
17
  sx,
17
18
  fullWidth = true
@@ -26,7 +27,8 @@ function UniqueNameInput({
26
27
  name,
27
28
  currentName,
28
29
  elementType,
29
- activeDirectory
30
+ activeDirectory,
31
+ isPrefilled
30
32
  });
31
33
  const handleManualChange = (e) => {
32
34
  onChange(e.target.value);
@@ -33,7 +33,7 @@ function NotificationsProvider({ urls, children }) {
33
33
  };
34
34
  rws.onopen = () => {
35
35
  console.info(`${urlKey} Notification Websocket connected`);
36
- broadcastOnReopen(urlKey);
36
+ broadcastOnReopen(urlKey)();
37
37
  };
38
38
  return rws;
39
39
  });
@@ -4,12 +4,14 @@
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 type ListenerEventWS = {
7
+ export type ListenerEventBase = {
8
8
  id: string;
9
+ callback: (...args: any[]) => void;
10
+ };
11
+ export type ListenerEventWS = ListenerEventBase & {
9
12
  callback: (event: MessageEvent) => void;
10
13
  };
11
- export type ListenerOnReopen = {
12
- id: string;
14
+ export type ListenerOnReopen = ListenerEventBase & {
13
15
  callback: () => void;
14
16
  };
15
17
  export type NotificationsContextType = {
@@ -1,6 +1,6 @@
1
- import { ListenerEventWS, ListenerOnReopen } from '../contexts/NotificationsContext';
2
- export declare const useListenerManager: <TListener extends ListenerEventWS | ListenerOnReopen, TMessage extends MessageEvent>(urls: Record<string, string | undefined>) => {
1
+ import { ListenerEventBase } from '../contexts/NotificationsContext';
2
+ export declare const useListenerManager: <TListener extends ListenerEventBase>(urls: Record<string, string | undefined>) => {
3
3
  addListener: (urlKey: string, listener: TListener) => void;
4
4
  removeListener: (urlKey: string, id: string) => void;
5
- broadcast: (urlKey: string) => (event: TMessage) => void;
5
+ broadcast: (urlKey: string) => (...args: Parameters<TListener["callback"]>) => void;
6
6
  };
@@ -37,12 +37,12 @@ const useListenerManager = (urls) => {
37
37
  }
38
38
  }, []);
39
39
  const broadcast = useCallback(
40
- (urlKey) => (event) => {
40
+ (urlKey) => (...args) => {
41
41
  var _a;
42
42
  const listeners = (_a = urlsListenersRef.current) == null ? void 0 : _a[urlKey];
43
43
  if (listeners) {
44
44
  listeners.forEach(({ callback }) => {
45
- callback(event);
45
+ callback(...args);
46
46
  });
47
47
  }
48
48
  },
@@ -17,6 +17,9 @@ import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
17
17
  import "yup";
18
18
  import "../../overflowableText/OverflowableText.js";
19
19
  import "../../treeViewFinder/TreeViewFinder.js";
20
+ import "react-querybuilder";
21
+ import "uuid";
22
+ import "../../filter/expert/expertFilterConstants.js";
20
23
  import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
21
24
  import "../../customAGGrid/customAggrid.js";
22
25
  import "ag-grid-community";
@@ -25,11 +28,8 @@ import "react-csv-downloader";
25
28
  import "../../inputs/reactHookForm/numbers/RangeInput.js";
26
29
  import { MuiSelectInput } from "../../inputs/reactHookForm/selectInputs/MuiSelectInput.js";
27
30
  import "@react-querybuilder/material";
28
- import "../../filter/expert/expertFilterConstants.js";
29
31
  import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
30
- import "uuid";
31
32
  import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
32
- import "react-querybuilder";
33
33
  import { PROVIDER } from "./constant.js";
34
34
  const styles = {
35
35
  providerParam: {
@@ -17,6 +17,9 @@ import "yup";
17
17
  import "../../../overflowableText/OverflowableText.js";
18
18
  import { RawReadOnlyInput } from "../../../inputs/reactHookForm/RawReadOnlyInput.js";
19
19
  import "../../../treeViewFinder/TreeViewFinder.js";
20
+ import "react-querybuilder";
21
+ import "uuid";
22
+ import "../../../filter/expert/expertFilterConstants.js";
20
23
  import "../../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
21
24
  import "../../../customAGGrid/customAggrid.js";
22
25
  import "ag-grid-community";
@@ -25,11 +28,8 @@ import "react-csv-downloader";
25
28
  import { FloatInput } from "../../../inputs/reactHookForm/numbers/FloatInput.js";
26
29
  import "../../../inputs/reactHookForm/numbers/RangeInput.js";
27
30
  import "@react-querybuilder/material";
28
- import "../../../filter/expert/expertFilterConstants.js";
29
31
  import "../../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
30
- import "uuid";
31
32
  import "../../../inputs/reactQueryBuilder/PropertyValueEditor.js";
32
- import "react-querybuilder";
33
33
  function LimitReductionTableCell({
34
34
  rowIndex,
35
35
  column,
@@ -17,6 +17,9 @@ import "../../../inputs/reactHookForm/provider/CustomFormProvider.js";
17
17
  import "yup";
18
18
  import "../../../overflowableText/OverflowableText.js";
19
19
  import "../../../treeViewFinder/TreeViewFinder.js";
20
+ import "react-querybuilder";
21
+ import "uuid";
22
+ import "../../../filter/expert/expertFilterConstants.js";
20
23
  import "../../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
21
24
  import "../../../customAGGrid/customAggrid.js";
22
25
  import "ag-grid-community";
@@ -24,11 +27,8 @@ import "react-papaparse";
24
27
  import "react-csv-downloader";
25
28
  import "../../../inputs/reactHookForm/numbers/RangeInput.js";
26
29
  import "@react-querybuilder/material";
27
- import "../../../filter/expert/expertFilterConstants.js";
28
30
  import "../../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
29
- import "uuid";
30
31
  import "../../../inputs/reactQueryBuilder/PropertyValueEditor.js";
31
- import "react-querybuilder";
32
32
  import { LimitReductionsToolTipColumn } from "./limit-reductions-tooltip-column.js";
33
33
  import { LimitReductionsLabelColumn } from "./limit-reductions-label-column.js";
34
34
  function LimitReductionsTableForm({ limits }) {
@@ -1,11 +1,12 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { FormattedMessage } from "react-intl";
2
+ import { useIntl, FormattedMessage } from "react-intl";
3
3
  function LimitReductionsToolTipColumn({ limits }) {
4
+ const intl = useIntl();
4
5
  const lowBound = `${Math.trunc(limits.limitDuration.lowBound / 60)} min`;
5
6
  const highBoundValue = Math.trunc(limits.limitDuration.highBound / 60);
6
7
  const highBound = highBoundValue === 0 ? "∞" : `${Math.trunc(limits.limitDuration.highBound / 60)} min`;
7
- const lowerBoundClosed = limits.limitDuration.lowClosed ? "[" : "]";
8
- const higherBoundClosed = limits.limitDuration.highClosed || null ? "]" : "[";
8
+ const lowerBoundClosed = limits.limitDuration.lowClosed ? "[" : intl.formatMessage({ id: "leftOpenBracket" });
9
+ const higherBoundClosed = limits.limitDuration.highClosed || null ? "]" : intl.formatMessage({ id: "rightOpenBracket" });
9
10
  return /* @__PURE__ */ jsx(
10
11
  FormattedMessage,
11
12
  {
@@ -16,6 +16,9 @@ import * as yup from "yup";
16
16
  import "../../../overflowableText/OverflowableText.js";
17
17
  import "../../../treeViewFinder/TreeViewFinder.js";
18
18
  import { DESCRIPTION, NAME } from "../../../inputs/reactHookForm/constants.js";
19
+ import "react-querybuilder";
20
+ import "uuid";
21
+ import "../../../filter/expert/expertFilterConstants.js";
19
22
  import "../../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
20
23
  import "../../../customAGGrid/customAggrid.js";
21
24
  import "ag-grid-community";
@@ -23,11 +26,8 @@ import "react-papaparse";
23
26
  import "react-csv-downloader";
24
27
  import "../../../inputs/reactHookForm/numbers/RangeInput.js";
25
28
  import "@react-querybuilder/material";
26
- import "../../../filter/expert/expertFilterConstants.js";
27
29
  import "../../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
28
- import "uuid";
29
30
  import "../../../inputs/reactQueryBuilder/PropertyValueEditor.js";
30
- import "react-querybuilder";
31
31
  function getNameElementEditorEmptyFormData(initialElementName, initialElementdescripton) {
32
32
  return {
33
33
  [NAME]: initialElementName,
@@ -17,6 +17,9 @@ import "yup";
17
17
  import "../../../overflowableText/OverflowableText.js";
18
18
  import { RawReadOnlyInput } from "../../../inputs/reactHookForm/RawReadOnlyInput.js";
19
19
  import "../../../treeViewFinder/TreeViewFinder.js";
20
+ import "react-querybuilder";
21
+ import "uuid";
22
+ import "../../../filter/expert/expertFilterConstants.js";
20
23
  import "../../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
21
24
  import "../../../customAGGrid/customAggrid.js";
22
25
  import "ag-grid-community";
@@ -25,11 +28,8 @@ import "react-csv-downloader";
25
28
  import { FloatInput } from "../../../inputs/reactHookForm/numbers/FloatInput.js";
26
29
  import "../../../inputs/reactHookForm/numbers/RangeInput.js";
27
30
  import "@react-querybuilder/material";
28
- import "../../../filter/expert/expertFilterConstants.js";
29
31
  import "../../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
30
- import "uuid";
31
32
  import "../../../inputs/reactQueryBuilder/PropertyValueEditor.js";
32
- import "react-querybuilder";
33
33
  function CustomVoltageLevelTableCell({
34
34
  formName,
35
35
  rowIndex,
@@ -15,6 +15,9 @@ import "../../../inputs/reactHookForm/provider/CustomFormProvider.js";
15
15
  import "yup";
16
16
  import "../../../overflowableText/OverflowableText.js";
17
17
  import "../../../treeViewFinder/TreeViewFinder.js";
18
+ import "react-querybuilder";
19
+ import "uuid";
20
+ import "../../../filter/expert/expertFilterConstants.js";
18
21
  import "../../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
19
22
  import "../../../customAGGrid/customAggrid.js";
20
23
  import "ag-grid-community";
@@ -23,11 +26,8 @@ import "react-csv-downloader";
23
26
  import { FloatInput } from "../../../inputs/reactHookForm/numbers/FloatInput.js";
24
27
  import "../../../inputs/reactHookForm/numbers/RangeInput.js";
25
28
  import "@react-querybuilder/material";
26
- import "../../../filter/expert/expertFilterConstants.js";
27
29
  import "../../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
28
- import "uuid";
29
30
  import "../../../inputs/reactQueryBuilder/PropertyValueEditor.js";
30
- import "react-querybuilder";
31
31
  function ParameterFloat({
32
32
  name,
33
33
  label,