@gridsuite/commons-ui 0.136.1 → 0.138.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 (127) hide show
  1. package/README.md +1 -1
  2. package/dist/components/dialogs/elementSaveDialog/ElementSaveDialog.js +4 -4
  3. package/dist/components/dnd-table/dnd-table-add-rows-dialog.js +4 -4
  4. package/dist/components/dnd-table/dnd-table.js +1 -0
  5. package/dist/components/elementSearch/elementItem/EquipmentItem.js +2 -2
  6. package/dist/components/elementSearch/tagRenderer/TagRenderer.js +2 -2
  7. package/dist/components/filter/HeaderFilterForm.js +4 -4
  8. package/dist/components/filter/expert/expertFilterConstants.d.ts +2 -51
  9. package/dist/components/filter/utils/filterFormUtils.d.ts +2 -5
  10. package/dist/components/filter/utils/filterFormUtils.js +2 -5
  11. package/dist/components/index.js +7 -5
  12. package/dist/components/inputs/index.js +4 -0
  13. package/dist/components/inputs/reactHookForm/DirectoryItemsInput.d.ts +7 -4
  14. package/dist/components/inputs/reactHookForm/DirectoryItemsInput.js +28 -45
  15. package/dist/components/inputs/reactHookForm/OverflowableChip.d.ts +4 -0
  16. package/dist/components/inputs/reactHookForm/OverflowableChip.js +25 -0
  17. package/dist/components/inputs/reactHookForm/OverflowableChipWithHelperText.d.ts +5 -0
  18. package/dist/components/inputs/reactHookForm/OverflowableChipWithHelperText.js +15 -0
  19. package/dist/components/inputs/reactHookForm/index.d.ts +2 -0
  20. package/dist/components/inputs/reactHookForm/index.js +4 -0
  21. package/dist/components/menus/custom-nested-menu.js +25 -1
  22. package/dist/components/overflowableText/OverflowableText.d.ts +1 -1
  23. package/dist/components/overflowableText/OverflowableText.js +8 -10
  24. package/dist/components/parameters/common/ProviderParam.js +4 -4
  25. package/dist/components/parameters/common/limitreductions/limit-reduction-table-cell.js +4 -4
  26. package/dist/components/parameters/common/limitreductions/limit-reductions-table-form.js +4 -4
  27. package/dist/components/parameters/common/name-element-editor/name-element-editor-utils.js +4 -4
  28. package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table-cell.js +4 -4
  29. package/dist/components/parameters/common/widget/parameter-float.js +4 -4
  30. package/dist/components/parameters/common/widget/parameter-line-directory-items-input.d.ts +2 -1
  31. package/dist/components/parameters/common/widget/parameter-line-directory-items-input.js +5 -3
  32. package/dist/components/parameters/common/widget/parameter-line-slider.js +4 -4
  33. package/dist/components/parameters/index.d.ts +1 -0
  34. package/dist/components/parameters/index.js +3 -5
  35. package/dist/components/parameters/loadflow/load-flow-general-parameters.js +4 -4
  36. package/dist/components/parameters/loadflow/load-flow-parameter-field.js +4 -4
  37. package/dist/components/parameters/loadflow/load-flow-parameters-content.js +4 -4
  38. package/dist/components/parameters/loadflow/load-flow-parameters-dialog.js +4 -4
  39. package/dist/components/parameters/loadflow/load-flow-parameters-form.js +4 -4
  40. package/dist/components/parameters/loadflow/load-flow-parameters-header.js +4 -4
  41. package/dist/components/parameters/loadflow/load-flow-parameters-inline.js +4 -4
  42. package/dist/components/parameters/loadflow/load-flow-parameters-utils.js +4 -4
  43. package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +4 -4
  44. package/dist/components/parameters/network-visualizations/map-parameters.js +4 -4
  45. package/dist/components/parameters/network-visualizations/network-area-diagram-parameters.js +4 -4
  46. package/dist/components/parameters/network-visualizations/network-visualizations-form.js +4 -4
  47. package/dist/components/parameters/network-visualizations/network-visualizations-parameters-dialog.js +4 -4
  48. package/dist/components/parameters/network-visualizations/network-visualizations-parameters-inline.js +4 -4
  49. package/dist/components/parameters/network-visualizations/single-line-diagram-parameters.js +4 -4
  50. package/dist/components/parameters/network-visualizations/use-network-visualizations-parameters-form.js +4 -4
  51. package/dist/components/parameters/pcc-min/index.d.ts +7 -0
  52. package/dist/components/parameters/pcc-min/index.js +4 -0
  53. package/dist/components/parameters/pcc-min/pcc-min-form-utils.d.ts +4 -0
  54. package/dist/components/parameters/pcc-min/pcc-min-form-utils.js +54 -0
  55. package/dist/components/parameters/pcc-min/pcc-min-parameters-form.d.ts +29 -0
  56. package/dist/components/parameters/pcc-min/pcc-min-parameters-form.js +114 -0
  57. package/dist/components/parameters/pcc-min/pcc-min-parameters-inline.d.ts +7 -0
  58. package/dist/components/parameters/pcc-min/pcc-min-parameters-inline.js +98 -0
  59. package/dist/components/parameters/pcc-min/use-pcc-min-parameters-form.d.ts +19 -0
  60. package/dist/components/parameters/pcc-min/use-pcc-min-parameters-form.js +104 -0
  61. package/dist/components/parameters/security-analysis/security-analysis-parameters-dialog.js +4 -4
  62. package/dist/components/parameters/security-analysis/security-analysis-parameters-form.js +4 -4
  63. package/dist/components/parameters/security-analysis/security-analysis-parameters-inline.js +4 -4
  64. package/dist/components/parameters/security-analysis/security-analysis-parameters-selector.js +4 -4
  65. package/dist/components/parameters/security-analysis/security-analysis-violations-hiding.js +4 -4
  66. package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.js +4 -4
  67. package/dist/components/parameters/sensi/sensitivity-Flow-parameters.js +4 -4
  68. package/dist/components/parameters/sensi/sensitivity-analysis-parameters-dialog.js +4 -4
  69. package/dist/components/parameters/sensi/sensitivity-analysis-parameters-form.js +4 -4
  70. package/dist/components/parameters/sensi/sensitivity-analysis-parameters-inline.js +4 -4
  71. package/dist/components/parameters/sensi/sensitivity-parameters-selector.js +4 -4
  72. package/dist/components/parameters/sensi/sensitivity-table.js +4 -4
  73. package/dist/components/parameters/sensi/table-cell.js +1 -1
  74. package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +4 -4
  75. package/dist/components/parameters/sensi/utils.d.ts +1 -1
  76. package/dist/components/parameters/sensi/utils.js +5 -7
  77. package/dist/components/parameters/short-circuit/short-circuit-fields.js +4 -4
  78. package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.js +4 -4
  79. package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +4 -4
  80. package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.js +4 -4
  81. package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +4 -4
  82. package/dist/components/parameters/voltage-init/constants.d.ts +0 -4
  83. package/dist/components/parameters/voltage-init/constants.js +0 -8
  84. package/dist/components/parameters/voltage-init/equipment-selection-parameters.js +4 -4
  85. package/dist/components/parameters/voltage-init/general-parameters.js +4 -4
  86. package/dist/components/parameters/voltage-init/index.js +1 -5
  87. package/dist/components/parameters/voltage-init/use-voltage-init-parameters-form.js +6 -5
  88. package/dist/components/parameters/voltage-init/voltage-init-form-utils.js +6 -5
  89. package/dist/components/parameters/voltage-init/voltage-init-parameters-dialog.js +4 -4
  90. package/dist/components/parameters/voltage-init/voltage-init-parameters-form.js +4 -4
  91. package/dist/components/parameters/voltage-init/voltage-init-parameters-inline.js +4 -4
  92. package/dist/components/parameters/voltage-init/voltage-init.type.d.ts +2 -6
  93. package/dist/components/parameters/voltage-init/voltage-limits-parameters.js +6 -5
  94. package/dist/index.js +20 -3
  95. package/dist/services/index.d.ts +1 -0
  96. package/dist/services/index.js +3 -0
  97. package/dist/services/pcc-min.d.ts +7 -0
  98. package/dist/services/pcc-min.js +25 -0
  99. package/dist/translations/en/equipmentSearchEn.d.ts +0 -17
  100. package/dist/translations/en/equipmentSearchEn.js +1 -18
  101. package/dist/translations/en/equipmentShortEn.d.ts +28 -0
  102. package/dist/translations/en/equipmentShortEn.js +25 -0
  103. package/dist/translations/en/equipmentTagEn.d.ts +28 -0
  104. package/dist/translations/en/equipmentTagEn.js +25 -0
  105. package/dist/translations/en/index.d.ts +2 -0
  106. package/dist/translations/en/index.js +4 -0
  107. package/dist/translations/en/parameters.d.ts +3 -0
  108. package/dist/translations/en/parameters.js +4 -1
  109. package/dist/translations/fr/equipmentSearchFr.d.ts +0 -17
  110. package/dist/translations/fr/equipmentSearchFr.js +1 -18
  111. package/dist/translations/fr/equipmentShortFr.d.ts +28 -0
  112. package/dist/translations/fr/equipmentShortFr.js +25 -0
  113. package/dist/translations/fr/equipmentTagFr.d.ts +28 -0
  114. package/dist/translations/fr/equipmentTagFr.js +25 -0
  115. package/dist/translations/fr/index.d.ts +2 -0
  116. package/dist/translations/fr/index.js +4 -0
  117. package/dist/translations/fr/parameters.d.ts +3 -0
  118. package/dist/translations/fr/parameters.js +4 -1
  119. package/dist/utils/constants/filterConstant.d.ts +9 -0
  120. package/dist/utils/constants/filterConstant.js +10 -0
  121. package/dist/utils/constants/index.d.ts +1 -0
  122. package/dist/utils/constants/index.js +5 -0
  123. package/dist/utils/index.js +6 -2
  124. package/dist/utils/types/equipmentType.d.ts +7 -165
  125. package/dist/utils/types/equipmentType.js +90 -151
  126. package/dist/utils/types/index.js +1 -2
  127. package/package.json +1 -1
package/README.md CHANGED
@@ -46,7 +46,7 @@ Only in this case, you need to follow the steps below:
46
46
  - [Make a release action](https://github.com/gridsuite/commons-ui/actions/workflows/release.yml)
47
47
  - In the 'run workflow' combobox select, let the branch on main
48
48
  - Enter the type of evolution (major | minor | patch)
49
- - Enter your NPM access token (it must be an **automation** access token to bypass 2FA, see the [access token documentation](https://docs.npmjs.com/creating-and-viewing-access-tokens) for details)
49
+ - Enter your NPM access token (check the **Bypass two-factor authentication** checkbox to bypass 2FA, see the [access token documentation](https://docs.npmjs.com/creating-and-viewing-access-tokens) for details)
50
50
  - Click 'run workflow'
51
51
 
52
52
  Otherwise ask someone who has the permission.
@@ -5,6 +5,7 @@ import { Grid, Button, Typography, Box, CircularProgress } from "@mui/material";
5
5
  import { useForm } from "react-hook-form";
6
6
  import { yupResolver } from "@hookform/resolvers/yup";
7
7
  import "../../../utils/yupConfig.js";
8
+ import "../../overflowableText/OverflowableText.js";
8
9
  import "../../../utils/types/equipmentType.js";
9
10
  import { FieldConstants } from "../../../utils/constants/fieldConstants.js";
10
11
  import { MAX_CHAR_DESCRIPTION } from "../../../utils/constants/uiConstants.js";
@@ -17,11 +18,7 @@ import "localized-countries/data/en";
17
18
  import { useSnackMessage } from "../../../hooks/useSnackMessage.js";
18
19
  import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
19
20
  import * as yup from "yup";
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";
25
22
  import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
26
23
  import "../../customAGGrid/customAggrid.js";
27
24
  import "ag-grid-community";
@@ -32,8 +29,11 @@ import "../../inputs/reactHookForm/numbers/RangeInput.js";
32
29
  import { DescriptionField } from "../../inputs/reactHookForm/text/DescriptionField.js";
33
30
  import { UniqueNameInput } from "../../inputs/reactHookForm/text/UniqueNameInput.js";
34
31
  import "@react-querybuilder/material";
32
+ import "../../filter/expert/expertFilterConstants.js";
35
33
  import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
34
+ import "uuid";
36
35
  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) => {
@@ -2,6 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { Dialog, DialogTitle, DialogContent, TextField, DialogActions, Button } from "@mui/material";
3
3
  import { FormattedMessage } from "react-intl";
4
4
  import { useState } from "react";
5
+ import "../overflowableText/OverflowableText.js";
5
6
  import "react-hook-form";
6
7
  import "../../utils/types/equipmentType.js";
7
8
  import "../../utils/conversionUtils.js";
@@ -14,11 +15,7 @@ import "notistack";
14
15
  import "../inputs/reactHookForm/provider/CustomFormProvider.js";
15
16
  import { CancelButton } from "../inputs/reactHookForm/utils/CancelButton.js";
16
17
  import "yup";
17
- import "../overflowableText/OverflowableText.js";
18
18
  import "../treeViewFinder/TreeViewFinder.js";
19
- import "react-querybuilder";
20
- import "uuid";
21
- import "../filter/expert/expertFilterConstants.js";
22
19
  import "../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
23
20
  import "../customAGGrid/customAggrid.js";
24
21
  import "ag-grid-community";
@@ -26,8 +23,11 @@ import "react-papaparse";
26
23
  import "react-csv-downloader";
27
24
  import "../inputs/reactHookForm/numbers/RangeInput.js";
28
25
  import "@react-querybuilder/material";
26
+ import "../filter/expert/expertFilterConstants.js";
29
27
  import "../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
28
+ import "uuid";
30
29
  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 = () => {
@@ -9,6 +9,7 @@ import { MAX_ROWS_NUMBER, SELECTED, DndColumnType } from "./dnd-table.type.js";
9
9
  import { DndTableBottomLeftButtons } from "./dnd-table-bottom-left-buttons.js";
10
10
  import { DndTableBottomRightButtons } from "./dnd-table-bottom-right-buttons.js";
11
11
  import { DndTableAddRowsDialog } from "./dnd-table-add-rows-dialog.js";
12
+ import "../overflowableText/OverflowableText.js";
12
13
  import { ChipItemsInput } from "../inputs/reactHookForm/chip-items-input.js";
13
14
  import { DirectoryItemsInput } from "../inputs/reactHookForm/DirectoryItemsInput.js";
14
15
  import { RawReadOnlyInput } from "../inputs/reactHookForm/RawReadOnlyInput.js";
@@ -4,7 +4,7 @@ import parse from "autosuggest-highlight/parse";
4
4
  import clsx from "clsx";
5
5
  import { FormattedMessage } from "react-intl";
6
6
  import { Box } from "@mui/material";
7
- import { EQUIPMENT_TYPE } from "../../../utils/types/equipmentType.js";
7
+ import { ALL_EQUIPMENTS } from "../../../utils/types/equipmentType.js";
8
8
  import { TagRenderer } from "../tagRenderer/TagRenderer.js";
9
9
  import { OverflowableText } from "../../overflowableText/OverflowableText.js";
10
10
  import { mergeSx } from "../../../utils/styles.js";
@@ -27,7 +27,7 @@ function EquipmentItem({
27
27
  component: "span",
28
28
  className: clsx(props.classes?.equipmentTag, props.classes?.equipmentTypeTag),
29
29
  sx: mergeSx(props.styles?.equipmentTag, props.styles?.equipmentTypeTag),
30
- children: /* @__PURE__ */ jsx(FormattedMessage, { id: EQUIPMENT_TYPE[element.type]?.tagLabel })
30
+ children: /* @__PURE__ */ jsx(FormattedMessage, { id: ALL_EQUIPMENTS[element.type]?.tagLabel })
31
31
  }
32
32
  ),
33
33
  /* @__PURE__ */ jsx(
@@ -1,10 +1,10 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import clsx from "clsx";
3
3
  import { OverflowableText } from "../../overflowableText/OverflowableText.js";
4
- import { EQUIPMENT_TYPE } from "../../../utils/types/equipmentType.js";
4
+ import { EquipmentType } from "../../../utils/types/equipmentType.js";
5
5
  import { mergeSx } from "../../../utils/styles.js";
6
6
  function TagRenderer({ element, ...props }) {
7
- if (element.type !== EQUIPMENT_TYPE.SUBSTATION?.name && element.type !== EQUIPMENT_TYPE.VOLTAGE_LEVEL?.name) {
7
+ if (element.type !== EquipmentType.SUBSTATION && element.type !== EquipmentType.VOLTAGE_LEVEL) {
8
8
  return /* @__PURE__ */ jsx(
9
9
  OverflowableText,
10
10
  {
@@ -8,6 +8,7 @@ import { ElementType } from "../../utils/types/elementType.js";
8
8
  import "../../utils/types/equipmentType.js";
9
9
  import "../../utils/yupConfig.js";
10
10
  import "react-intl";
11
+ import "../overflowableText/OverflowableText.js";
11
12
  import "react";
12
13
  import "react-hook-form";
13
14
  import "localized-countries";
@@ -16,11 +17,7 @@ import "localized-countries/data/en";
16
17
  import "notistack";
17
18
  import "../inputs/reactHookForm/provider/CustomFormProvider.js";
18
19
  import * as yup from "yup";
19
- import "../overflowableText/OverflowableText.js";
20
20
  import "../treeViewFinder/TreeViewFinder.js";
21
- import "react-querybuilder";
22
- import "uuid";
23
- import "./expert/expertFilterConstants.js";
24
21
  import "../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
25
22
  import "../customAGGrid/customAggrid.js";
26
23
  import "ag-grid-community";
@@ -30,8 +27,11 @@ import "../inputs/reactHookForm/numbers/RangeInput.js";
30
27
  import { DescriptionField } from "../inputs/reactHookForm/text/DescriptionField.js";
31
28
  import { UniqueNameInput } from "../inputs/reactHookForm/text/UniqueNameInput.js";
32
29
  import "@react-querybuilder/material";
30
+ import "./expert/expertFilterConstants.js";
33
31
  import "../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
32
+ import "uuid";
34
33
  import "../inputs/reactQueryBuilder/PropertyValueEditor.js";
34
+ import "react-querybuilder";
35
35
  const filterStyles = {
36
36
  textField: {
37
37
  minWidth: "250px",
@@ -1,7 +1,7 @@
1
1
  import { Field } from 'react-querybuilder';
2
2
  import { CombinatorType, DataType, OperatorType } from './expertFilter.type';
3
3
  import { FieldType } from '../../../utils/types/fieldType';
4
- import { EquipmentType } from '../../../utils';
4
+ import { ALL_EQUIPMENTS } from '../../../utils';
5
5
  export declare enum RULES {
6
6
  EMPTY_RULE = "emptyRule",
7
7
  EMPTY_GROUP = "emptyGroup",
@@ -9,56 +9,7 @@ export declare enum RULES {
9
9
  BETWEEN_RULE = "betweenRule"
10
10
  }
11
11
  export declare const EXPERT_FILTER_QUERY = "rules";
12
- export declare const EXPERT_FILTER_EQUIPMENTS: {
13
- SUBSTATION: {
14
- id: EquipmentType;
15
- label: string;
16
- };
17
- VOLTAGE_LEVEL: {
18
- id: EquipmentType;
19
- label: string;
20
- };
21
- LINE: {
22
- id: EquipmentType;
23
- label: string;
24
- };
25
- TWO_WINDINGS_TRANSFORMER: {
26
- id: EquipmentType;
27
- label: string;
28
- };
29
- THREE_WINDINGS_TRANSFORMER: {
30
- id: EquipmentType;
31
- label: string;
32
- };
33
- GENERATOR: {
34
- id: EquipmentType;
35
- label: string;
36
- };
37
- BATTERY: {
38
- id: EquipmentType;
39
- label: string;
40
- };
41
- LOAD: {
42
- id: EquipmentType;
43
- label: string;
44
- };
45
- SHUNT_COMPENSATOR: {
46
- id: EquipmentType;
47
- label: string;
48
- };
49
- STATIC_VAR_COMPENSATOR: {
50
- id: EquipmentType;
51
- label: string;
52
- };
53
- HVDC_LINE: {
54
- id: EquipmentType;
55
- label: string;
56
- };
57
- DANGLING_LINE: {
58
- id: EquipmentType;
59
- label: string;
60
- };
61
- };
12
+ export declare const EXPERT_FILTER_EQUIPMENTS: typeof ALL_EQUIPMENTS;
62
13
  export declare const ENERGY_SOURCE_OPTIONS: {
63
14
  name: string;
64
15
  label: string;
@@ -1,10 +1,7 @@
1
- import { EquipmentType } from '../../../utils';
1
+ import { ALL_EQUIPMENTS, EquipmentType } from '../../../utils';
2
2
  export type ContingencyListEquipment = {
3
3
  id: string;
4
4
  label: string;
5
5
  };
6
6
  export declare const CONTINGENCY_LIST_EQUIPMENTS: Record<EquipmentType.BUSBAR_SECTION | EquipmentType.LINE | EquipmentType.TWO_WINDINGS_TRANSFORMER | EquipmentType.THREE_WINDINGS_TRANSFORMER | EquipmentType.GENERATOR | EquipmentType.BATTERY | EquipmentType.LOAD | EquipmentType.SHUNT_COMPENSATOR | EquipmentType.STATIC_VAR_COMPENSATOR | EquipmentType.HVDC_LINE | EquipmentType.DANGLING_LINE, ContingencyListEquipment>;
7
- export declare const FILTER_EQUIPMENTS: Partial<Record<EquipmentType, {
8
- id: EquipmentType;
9
- label: string;
10
- }>>;
7
+ export declare const FILTER_EQUIPMENTS: typeof ALL_EQUIPMENTS;
@@ -1,7 +1,7 @@
1
1
  import "../../../utils/conversionUtils.js";
2
2
  import "react/jsx-runtime";
3
3
  import "@mui/icons-material";
4
- import { EquipmentType, BASE_EQUIPMENTS } from "../../../utils/types/equipmentType.js";
4
+ import { EquipmentType, ALL_EQUIPMENTS, BASE_EQUIPMENTS } from "../../../utils/types/equipmentType.js";
5
5
  import "../../../utils/yupConfig.js";
6
6
  const CONTINGENCY_LIST_EQUIPMENTS = {
7
7
  BUSBAR_SECTION: {
@@ -51,10 +51,7 @@ const CONTINGENCY_LIST_EQUIPMENTS = {
51
51
  };
52
52
  const FILTER_EQUIPMENTS = {
53
53
  ...BASE_EQUIPMENTS,
54
- [EquipmentType.HVDC_LINE]: {
55
- id: EquipmentType.HVDC_LINE,
56
- label: "Hvdc"
57
- }
54
+ [EquipmentType.HVDC_LINE]: ALL_EQUIPMENTS[EquipmentType.HVDC_LINE]
58
55
  };
59
56
  export {
60
57
  CONTINGENCY_LIST_EQUIPMENTS,
@@ -54,6 +54,8 @@ import "react/jsx-runtime";
54
54
  import "@mui/material";
55
55
  import "react-intl";
56
56
  import { SelectClearable } from "./inputs/SelectClearable.js";
57
+ import { OverflowableChip } from "./inputs/reactHookForm/OverflowableChip.js";
58
+ import { OverflowableChipWithHelperText } from "./inputs/reactHookForm/OverflowableChipWithHelperText.js";
57
59
  import { ChipItemsInput } from "./inputs/reactHookForm/chip-items-input.js";
58
60
  import { DirectoryItemsInput } from "./inputs/reactHookForm/DirectoryItemsInput.js";
59
61
  import { RawReadOnlyInput } from "./inputs/reactHookForm/RawReadOnlyInput.js";
@@ -158,10 +160,11 @@ import { LoadFlowParametersEditionDialog } from "./parameters/loadflow/load-flow
158
160
  import { InitialVoltage, PredefinedParameters, SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, SHORT_CIRCUIT_PREDEFINED_PARAMS, SHORT_CIRCUIT_WITH_FEEDER_RESULT, SHORT_CIRCUIT_WITH_LOADS, SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, intlInitialVoltageProfileMode, intlPredefinedParametersOptions } from "./parameters/short-circuit/constants.js";
159
161
  import { ShortCircuitParametersInLine } from "./parameters/short-circuit/short-circuit-parameters-inline.js";
160
162
  import { ShortCircuitParametersEditionDialog } from "./parameters/short-circuit/short-circuit-parameters-dialog.js";
161
- import { DEFAULT_GENERAL_APPLY_MODIFICATIONS, DEFAULT_REACTIVE_SLACKS_THRESHOLD, DEFAULT_SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD, DEFAULT_UPDATE_BUS_VOLTAGE, FILTERS, FILTER_ID, FILTER_NAME, GENERAL, GENERAL_APPLY_MODIFICATIONS, GENERATORS_SELECTION_TYPE, HIGH_VOLTAGE_LIMIT, ID, LEG_SIDE, LOW_VOLTAGE_LIMIT, PRIORITY, RATIO_TAP_CHANGER_POSITION, RATIO_TAP_CHANGER_TARGET_V, REACTIVE_SLACKS_THRESHOLD, SELECTION_TYPE, SHUNT_COMPENSATORS_SELECTION_TYPE, SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD, TRANSFORMERS_SELECTION_TYPE, UPDATE_BUS_VOLTAGE, VARIABLE_Q_GENERATORS, VARIABLE_SHUNT_COMPENSATORS, VARIABLE_TRANSFORMERS, VOLTAGE_LIMITS_DEFAULT, VOLTAGE_LIMITS_MODIFICATION, VoltageInitTabValues } from "./parameters/voltage-init/constants.js";
163
+ import { DEFAULT_GENERAL_APPLY_MODIFICATIONS, DEFAULT_REACTIVE_SLACKS_THRESHOLD, DEFAULT_SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD, DEFAULT_UPDATE_BUS_VOLTAGE, GENERAL, GENERAL_APPLY_MODIFICATIONS, GENERATORS_SELECTION_TYPE, HIGH_VOLTAGE_LIMIT, LEG_SIDE, LOW_VOLTAGE_LIMIT, PRIORITY, RATIO_TAP_CHANGER_POSITION, RATIO_TAP_CHANGER_TARGET_V, REACTIVE_SLACKS_THRESHOLD, SELECTION_TYPE, SHUNT_COMPENSATORS_SELECTION_TYPE, SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD, TRANSFORMERS_SELECTION_TYPE, UPDATE_BUS_VOLTAGE, VARIABLE_Q_GENERATORS, VARIABLE_SHUNT_COMPENSATORS, VARIABLE_TRANSFORMERS, VOLTAGE_LIMITS_DEFAULT, VOLTAGE_LIMITS_MODIFICATION, VoltageInitTabValues } from "./parameters/voltage-init/constants.js";
162
164
  import { EquipmentsSelectionType } from "./parameters/voltage-init/voltage-init.type.js";
163
165
  import { VoltageInitParametersEditionDialog } from "./parameters/voltage-init/voltage-init-parameters-dialog.js";
164
166
  import { VoltageInitParametersInLine } from "./parameters/voltage-init/voltage-init-parameters-inline.js";
167
+ import { PccMinParametersInLine } from "./parameters/pcc-min/pcc-min-parameters-inline.js";
165
168
  import { SecurityAnalysisParametersInline } from "./parameters/security-analysis/security-analysis-parameters-inline.js";
166
169
  import { SecurityAnalysisParametersDialog } from "./parameters/security-analysis/security-analysis-parameters-dialog.js";
167
170
  import { SensitivityAnalysisParametersInline } from "./parameters/sensi/sensitivity-analysis-parameters-inline.js";
@@ -268,11 +271,8 @@ export {
268
271
  ExplicitNamingFilterForm,
269
272
  ExportCsvButton,
270
273
  FIELDS_OPTIONS,
271
- FILTERS,
272
274
  FILTER_EQUIPMENTS,
273
275
  FILTER_EQUIPMENTS_ATTRIBUTES,
274
- FILTER_ID,
275
- FILTER_NAME,
276
276
  FieldErrorAlert,
277
277
  FieldLabel,
278
278
  FilterCreationDialog,
@@ -289,7 +289,6 @@ export {
289
289
  HVDC_AC_EMULATION,
290
290
  HVDC_EQUIPMENT_TYPES,
291
291
  HelperPreviousValue,
292
- ID,
293
292
  INJECTIONS_EQUIPMENT_TYPES,
294
293
  INJECTION_DISTRIBUTION_TYPES,
295
294
  INTL_LINE_FLOW_MODE_OPTIONS,
@@ -347,6 +346,8 @@ export {
347
346
  NumericEditor,
348
347
  OPERATOR_OPTIONS,
349
348
  OperatorType,
349
+ OverflowableChip,
350
+ OverflowableChipWithHelperText,
350
351
  OverflowableText,
351
352
  PARAM_CENTER_LABEL,
352
353
  PARAM_COMPONENT_LIBRARY,
@@ -376,6 +377,7 @@ export {
376
377
  ParameterLineDirectoryItemsInput,
377
378
  ParameterLineSlider,
378
379
  ParameterSwitch,
380
+ PccMinParametersInLine,
379
381
  PhotoLibraryIcon,
380
382
  PopupConfirmationDialog,
381
383
  PredefinedParameters,
@@ -1,4 +1,6 @@
1
1
  import { SelectClearable } from "./SelectClearable.js";
2
+ import { OverflowableChip } from "./reactHookForm/OverflowableChip.js";
3
+ import { OverflowableChipWithHelperText } from "./reactHookForm/OverflowableChipWithHelperText.js";
2
4
  import { ChipItemsInput } from "./reactHookForm/chip-items-input.js";
3
5
  import { DirectoryItemsInput } from "./reactHookForm/DirectoryItemsInput.js";
4
6
  import { RawReadOnlyInput } from "./reactHookForm/RawReadOnlyInput.js";
@@ -93,6 +95,8 @@ export {
93
95
  MultipleAutocompleteInput,
94
96
  NAME,
95
97
  NumericEditor,
98
+ OverflowableChip,
99
+ OverflowableChipWithHelperText,
96
100
  PropertyValueEditor,
97
101
  RadioInput,
98
102
  RangeInput,
@@ -1,5 +1,7 @@
1
+ import { ComponentType } from 'react';
1
2
  import { ArrayAction, ElementAttributes } from '../../../utils';
2
- export interface DirectoryItemsInputProps {
3
+ import { OverflowableChipProps } from './OverflowableChip';
4
+ export interface DirectoryItemsInputProps<CP extends OverflowableChipProps = OverflowableChipProps> {
3
5
  label: string | undefined;
4
6
  name: string;
5
7
  elementType: string;
@@ -12,10 +14,11 @@ export interface DirectoryItemsInputProps {
12
14
  disable?: boolean;
13
15
  allowMultiSelect?: boolean;
14
16
  labelRequiredFromContext?: boolean;
15
- equipmentColorsMap?: Map<string, string>;
17
+ ChipComponent?: ComponentType<CP>;
18
+ chipProps?: Partial<CP>;
16
19
  }
17
- export declare function DirectoryItemsInput({ label, name, elementType, // Used to specify type of element (Filter, Contingency list, ...)
20
+ export declare function DirectoryItemsInput<CP extends OverflowableChipProps = OverflowableChipProps>({ label, name, elementType, // Used to specify type of element (Filter, Contingency list, ...)
18
21
  equipmentTypes, // Mostly used for filters, it allows the user to get elements of specific equipment only
19
22
  itemFilter, // Used to further filter the results displayed according to specific requirement
20
23
  titleId, // title of directory item selector dialogue
21
- hideErrorMessage, onRowChanged, onChange, disable, allowMultiSelect, labelRequiredFromContext, equipmentColorsMap, }: Readonly<DirectoryItemsInputProps>): import("react/jsx-runtime").JSX.Element;
24
+ hideErrorMessage, onRowChanged, onChange, disable, allowMultiSelect, labelRequiredFromContext, ChipComponent, chipProps, }: Readonly<DirectoryItemsInputProps<CP>>): import("react/jsx-runtime").JSX.Element;
@@ -1,30 +1,29 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { FormControl, Box, Chip, FormHelperText, Grid, Tooltip, IconButton } from "@mui/material";
2
+ import { FormControl, Grid, Tooltip, IconButton } from "@mui/material";
3
3
  import { Folder } from "@mui/icons-material";
4
4
  import { useState, useMemo, useCallback, useEffect } from "react";
5
5
  import { useFieldArray, useWatch, useController } from "react-hook-form";
6
- import { useIntl, FormattedMessage } from "react-intl";
7
- import { RawReadOnlyInput } from "./RawReadOnlyInput.js";
6
+ import { useIntl } from "react-intl";
8
7
  import { FieldLabel } from "./utils/FieldLabel.js";
9
8
  import { isFieldRequired } from "./utils/functions.js";
10
9
  import "./provider/CustomFormProvider.js";
11
10
  import { useCustomFormContext } from "./provider/useCustomFormContext.js";
12
11
  import { ErrorInput } from "./errorManagement/ErrorInput.js";
13
12
  import { MidFormError } from "./errorManagement/MidFormError.js";
14
- import "../../../utils/types/equipmentType.js";
13
+ import { ALL_EQUIPMENTS } from "../../../utils/types/equipmentType.js";
15
14
  import { fetchDirectoryElementPath } from "../../../services/directory.js";
16
15
  import "localized-countries";
17
16
  import "localized-countries/data/fr";
18
17
  import "localized-countries/data/en";
19
18
  import { useSnackMessage } from "../../../hooks/useSnackMessage.js";
20
- import { OverflowableText } from "../../overflowableText/OverflowableText.js";
21
19
  import { DirectoryItemSelector } from "../../directoryItemSelector/DirectoryItemSelector.js";
22
20
  import "../../../utils/conversionUtils.js";
23
21
  import { mergeSx } from "../../../utils/styles.js";
24
22
  import { ArrayAction } from "../../../utils/types/types.js";
25
23
  import "../../../utils/yupConfig.js";
26
24
  import { NAME } from "./constants.js";
27
- import { getFilterEquipmentTypeLabel } from "../../filter/expert/expertFilterUtils.js";
25
+ import { OverflowableChip } from "./OverflowableChip.js";
26
+ import { RawReadOnlyInput } from "./RawReadOnlyInput.js";
28
27
  const styles = {
29
28
  formDirectoryElements1: {
30
29
  display: "flex",
@@ -69,7 +68,8 @@ function DirectoryItemsInput({
69
68
  disable = false,
70
69
  allowMultiSelect = true,
71
70
  labelRequiredFromContext = true,
72
- equipmentColorsMap
71
+ ChipComponent = OverflowableChip,
72
+ chipProps
73
73
  }) {
74
74
  const { snackError } = useSnackMessage();
75
75
  const intl = useIntl();
@@ -187,45 +187,28 @@ function DirectoryItemsInput({
187
187
  ),
188
188
  elements?.length > 0 && /* @__PURE__ */ jsx(FormControl, { sx: styles.formDirectoryElements2, children: elements.map((item, index) => {
189
189
  const elementName = watchedElements?.[index]?.[NAME] ?? getValues(`${name}.${index}.${NAME}`) ?? item?.[NAME];
190
- return /* @__PURE__ */ jsxs(
191
- Box,
190
+ const equipmentTypeTagLabel = item?.specificMetadata?.equipmentType && ALL_EQUIPMENTS[item.specificMetadata.equipmentType]?.shortLabel || "";
191
+ const { sx: chipSx, ...otherChipProps } = chipProps ?? {};
192
+ return /* @__PURE__ */ jsx(
193
+ ChipComponent,
192
194
  {
193
- sx: { display: "flex", alignItems: "center", flexDirection: "column", gap: 1 },
194
- children: [
195
- /* @__PURE__ */ jsx(
196
- Chip,
197
- {
198
- size: "small",
199
- sx: mergeSx(
200
- {
201
- backgroundColor: item?.specificMetadata?.equipmentType && equipmentColorsMap?.get(item?.specificMetadata?.equipmentType)
202
- },
203
- !elementName ? (theme) => ({
204
- backgroundColor: theme.palette.error.light,
205
- borderColor: theme.palette.error.main,
206
- color: theme.palette.error.contrastText
207
- }) : void 0
208
- ),
209
- onDelete: () => removeElements(index),
210
- onClick: () => handleChipClick(index),
211
- label: /* @__PURE__ */ jsx(
212
- OverflowableText,
213
- {
214
- text: elementName ? /* @__PURE__ */ jsx(RawReadOnlyInput, { name: `${name}.${index}.${NAME}` }) : intl.formatMessage({ id: "elementNotFound" }),
215
- sx: { width: "100%" }
216
- }
217
- )
218
- }
219
- ),
220
- equipmentColorsMap && /* @__PURE__ */ jsx(FormHelperText, { children: item?.specificMetadata?.equipmentType ? /* @__PURE__ */ jsx(
221
- FormattedMessage,
222
- {
223
- id: getFilterEquipmentTypeLabel(
224
- item.specificMetadata.equipmentType
225
- )
226
- }
227
- ) : "" })
228
- ]
195
+ onDelete: () => removeElements(index),
196
+ onClick: () => handleChipClick(index),
197
+ label: elementName ? /* @__PURE__ */ jsx(RawReadOnlyInput, { name: `${name}.${index}.${NAME}` }) : intl.formatMessage({ id: "elementNotFound" }),
198
+ ...equipmentTypeTagLabel && {
199
+ helperText: intl.formatMessage({
200
+ id: equipmentTypeTagLabel
201
+ })
202
+ },
203
+ sx: mergeSx(
204
+ !elementName ? (theme) => ({
205
+ backgroundColor: theme.palette.error.light,
206
+ borderColor: theme.palette.error.main,
207
+ color: theme.palette.error.contrastText
208
+ }) : void 0,
209
+ chipSx
210
+ ),
211
+ ...otherChipProps
229
212
  },
230
213
  item.id
231
214
  );
@@ -0,0 +1,4 @@
1
+ import { ChipProps } from '@mui/material';
2
+ export interface OverflowableChipProps extends ChipProps {
3
+ }
4
+ export declare function OverflowableChip({ label, ...otherProps }: Readonly<OverflowableChipProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Chip, Box } from "@mui/material";
3
+ import { OverflowableText } from "../../overflowableText/OverflowableText.js";
4
+ function OverflowableChip({ label, ...otherProps }) {
5
+ return /* @__PURE__ */ jsx(
6
+ Chip,
7
+ {
8
+ size: "small",
9
+ label: /* @__PURE__ */ jsx(Box, { sx: { display: "flex" }, children: /* @__PURE__ */ jsx(
10
+ OverflowableText,
11
+ {
12
+ text: label,
13
+ sx: {
14
+ maxWidth: "20ch",
15
+ mx: "auto"
16
+ }
17
+ }
18
+ ) }),
19
+ ...otherProps
20
+ }
21
+ );
22
+ }
23
+ export {
24
+ OverflowableChip
25
+ };
@@ -0,0 +1,5 @@
1
+ import { OverflowableChipProps } from './OverflowableChip';
2
+ export interface OverflowableChipWithHelperTextProps extends OverflowableChipProps {
3
+ helperText?: string;
4
+ }
5
+ export declare function OverflowableChipWithHelperText({ helperText, ...otherProps }: Readonly<OverflowableChipWithHelperTextProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { Box, FormHelperText } from "@mui/material";
3
+ import { OverflowableChip } from "./OverflowableChip.js";
4
+ function OverflowableChipWithHelperText({
5
+ helperText,
6
+ ...otherProps
7
+ }) {
8
+ return /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "left", flexDirection: "column" }, children: [
9
+ /* @__PURE__ */ jsx(OverflowableChip, { ...otherProps }),
10
+ helperText && /* @__PURE__ */ jsx(FormHelperText, { sx: { paddingLeft: 1.5, fontSize: "x-small" }, children: helperText })
11
+ ] });
12
+ }
13
+ export {
14
+ OverflowableChipWithHelperText
15
+ };
@@ -4,6 +4,8 @@
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 * from './OverflowableChip';
8
+ export * from './OverflowableChipWithHelperText';
7
9
  export * from './chip-items-input';
8
10
  export * from './DirectoryItemsInput';
9
11
  export * from './RawReadOnlyInput';
@@ -1,3 +1,5 @@
1
+ import { OverflowableChip } from "./OverflowableChip.js";
2
+ import { OverflowableChipWithHelperText } from "./OverflowableChipWithHelperText.js";
1
3
  import { ChipItemsInput } from "./chip-items-input.js";
2
4
  import { DirectoryItemsInput } from "./DirectoryItemsInput.js";
3
5
  import { RawReadOnlyInput } from "./RawReadOnlyInput.js";
@@ -67,6 +69,8 @@ export {
67
69
  MultipleAutocompleteInput,
68
70
  NAME,
69
71
  NumericEditor,
72
+ OverflowableChip,
73
+ OverflowableChipWithHelperText,
70
74
  RadioInput,
71
75
  RangeInput,
72
76
  RangeType,
@@ -1,5 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { useState } from "react";
2
+ import { useState, useRef } from "react";
3
3
  import { NestedMenuItem } from "mui-nested-menu";
4
4
  import { Box, MenuItem } from "@mui/material";
5
5
  import { mergeSx } from "../../utils/styles.js";
@@ -19,11 +19,35 @@ const styles = {
19
19
  };
20
20
  function CustomNestedMenuItem({ sx, children, ...other }) {
21
21
  const [subMenuActive, setSubMenuActive] = useState(false);
22
+ const [shouldLiftLeft, setShouldLiftLeft] = useState(false);
23
+ const containerRef = useRef(null);
24
+ const calculatePosition = () => {
25
+ if (!containerRef.current) return;
26
+ const rect = containerRef.current.getBoundingClientRect();
27
+ const estimatedWidth = rect.width;
28
+ const spaceRight = window.innerWidth - rect.right;
29
+ setShouldLiftLeft(estimatedWidth > spaceRight);
30
+ };
31
+ const handleMouseEnter = () => {
32
+ calculatePosition();
33
+ };
22
34
  return /* @__PURE__ */ jsx(
23
35
  NestedMenuItem,
24
36
  {
25
37
  ...other,
26
38
  parentMenuOpen: true,
39
+ ref: containerRef,
40
+ onMouseEnter: handleMouseEnter,
41
+ MenuProps: {
42
+ anchorOrigin: {
43
+ vertical: "top",
44
+ horizontal: shouldLiftLeft ? "left" : "right"
45
+ },
46
+ transformOrigin: {
47
+ vertical: "top",
48
+ horizontal: shouldLiftLeft ? "right" : "left"
49
+ }
50
+ },
27
51
  sx: mergeSx(subMenuActive ? styles.highlightedParentLine : styles.highlightedLine, sx),
28
52
  children: /* @__PURE__ */ jsx(Box, { onMouseEnter: () => setSubMenuActive(true), onMouseLeave: () => setSubMenuActive(false), children })
29
53
  }
@@ -1,7 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { BoxProps } from '@mui/material';
3
3
  import { Style } from 'node:util';
4
- import { SxStyle } from '../../utils/styles';
4
+ import { SxStyle } from '../../utils';
5
5
  export interface OverflowableTextProps extends BoxProps {
6
6
  text?: ReactNode;
7
7
  maxLineCount?: number;
@@ -1,6 +1,11 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { useRef, useMemo, useState, useCallback, useLayoutEffect } from "react";
3
3
  import { styled, Tooltip, Box } from "@mui/material";
4
+ import "../../utils/conversionUtils.js";
5
+ import "@mui/icons-material";
6
+ import { mergeSx } from "../../utils/styles.js";
7
+ import "../../utils/types/equipmentType.js";
8
+ import "../../utils/yupConfig.js";
4
9
  const overflowStyle = {
5
10
  overflow: {
6
11
  display: "inline-block",
@@ -32,6 +37,7 @@ const OverflowableText = styled(
32
37
  tooltipSx,
33
38
  className,
34
39
  children,
40
+ sx,
35
41
  ...props
36
42
  }) => {
37
43
  const element = useRef();
@@ -65,22 +71,14 @@ const OverflowableText = styled(
65
71
  slotProps: { tooltip: { sx: finalTooltipSx } }
66
72
  }
67
73
  };
74
+ const boxSx = mergeSx(isMultiLine ? multilineOverflowStyle(maxLineCount) : overflowStyle.overflow, sx);
68
75
  return /* @__PURE__ */ jsx(
69
76
  Tooltip,
70
77
  {
71
78
  title: text || "",
72
79
  disableHoverListener: !overflowed,
73
80
  ...tooltipStyleProps,
74
- children: /* @__PURE__ */ jsx(
75
- Box,
76
- {
77
- ...props,
78
- ref: element,
79
- className,
80
- sx: isMultiLine ? multilineOverflowStyle(maxLineCount) : overflowStyle.overflow,
81
- children: children || text
82
- }
83
- )
81
+ children: /* @__PURE__ */ jsx(Box, { ref: element, className, sx: boxSx, ...props, children: children || text })
84
82
  }
85
83
  );
86
84
  }