@gridsuite/commons-ui 0.223.0 → 0.225.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 (121) hide show
  1. package/dist/components/composite/dnd-table/dnd-table.d.ts +8 -4
  2. package/dist/components/composite/dnd-table/dnd-table.js +100 -160
  3. package/dist/components/composite/dnd-table/dnd-table.type.d.ts +17 -3
  4. package/dist/components/composite/dnd-table/dnd-table.type.js +2 -0
  5. package/dist/components/composite/dnd-table/index.d.ts +6 -1
  6. package/dist/components/composite/dnd-table/index.js +6 -6
  7. package/dist/components/composite/index.js +6 -6
  8. package/dist/components/index.js +6 -6
  9. package/dist/components/ui/directoryItemSelector/DirectoryItemSelector.js +1 -1
  10. package/dist/components/ui/directoryItemSelector/utils.js +1 -1
  11. package/dist/components/ui/reactHookForm/DirectoryItemsInput.js +1 -1
  12. package/dist/features/index.js +16 -0
  13. package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/reactiveCapability.utils.d.ts +4 -3
  14. package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/reactiveCapability.utils.js +7 -30
  15. package/dist/features/network-modifications/common/reactiveLimits/reactiveLimits.utils.d.ts +2 -0
  16. package/dist/features/network-modifications/generator/generatorDialog.type.d.ts +0 -60
  17. package/dist/features/network-modifications/generator/index.js +17 -1
  18. package/dist/features/network-modifications/generator/modification/GeneratorDialogHeader.d.ts +6 -0
  19. package/dist/features/network-modifications/generator/modification/GeneratorDialogHeader.js +109 -0
  20. package/dist/features/network-modifications/generator/modification/GeneratorDialogTabs.d.ts +13 -0
  21. package/dist/features/network-modifications/generator/modification/GeneratorDialogTabs.js +55 -0
  22. package/dist/features/network-modifications/generator/modification/GeneratorDialogTabsContent.d.ts +12 -0
  23. package/dist/features/network-modifications/generator/modification/GeneratorDialogTabsContent.js +277 -0
  24. package/dist/features/network-modifications/generator/modification/GeneratorModificationForm.d.ts +10 -0
  25. package/dist/features/network-modifications/generator/modification/GeneratorModificationForm.js +52 -0
  26. package/dist/features/network-modifications/generator/modification/generatorModification.types.d.ts +3 -5
  27. package/dist/features/network-modifications/generator/modification/generatorModification.utils.d.ts +140 -0
  28. package/dist/features/network-modifications/generator/modification/generatorModification.utils.js +211 -0
  29. package/dist/features/network-modifications/generator/modification/generatorTabs.utils.d.ts +8 -0
  30. package/dist/features/network-modifications/generator/modification/generatorTabs.utils.js +56 -0
  31. package/dist/features/network-modifications/generator/modification/index.d.ts +6 -0
  32. package/dist/features/network-modifications/generator/modification/index.js +18 -1
  33. package/dist/features/network-modifications/index.js +16 -0
  34. package/dist/features/parameters/common/contingency-table/columns-definitions.d.ts +2 -2
  35. package/dist/features/parameters/common/contingency-table/columns-definitions.js +6 -6
  36. package/dist/features/parameters/common/contingency-table/contingency-table.js +1 -1
  37. package/dist/features/parameters/common/contingency-table/types.d.ts +6 -17
  38. package/dist/features/parameters/common/parameter-table-field/parameter-table-field.js +2 -2
  39. package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-inline.js +1 -1
  40. package/dist/features/parameters/dynamic-margin-calculation/loads-variations-parameters.js +1 -1
  41. package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-inline.js +1 -1
  42. package/dist/features/parameters/dynamic-simulation/dynamic-simulation-inline.js +1 -1
  43. package/dist/features/parameters/loadflow/load-flow-parameters-inline.js +1 -1
  44. package/dist/features/parameters/network-visualizations/network-visualizations-parameters-inline.js +1 -1
  45. package/dist/features/parameters/pcc-min/pcc-min-parameters-inline.js +1 -1
  46. package/dist/features/parameters/security-analysis/columns-definitions.d.ts +3 -3
  47. package/dist/features/parameters/security-analysis/columns-definitions.js +8 -8
  48. package/dist/features/parameters/security-analysis/security-analysis-parameters-inline.js +2 -2
  49. package/dist/features/parameters/security-analysis/security-analysis-parameters-selector.d.ts +1 -1
  50. package/dist/features/parameters/security-analysis/use-security-analysis-parameters-form.d.ts +1 -1
  51. package/dist/features/parameters/security-analysis/use-security-analysis-parameters-form.js +1 -1
  52. package/dist/features/parameters/sensi/columns-definitions.js +1 -1
  53. package/dist/features/parameters/sensi/constants.d.ts +0 -2
  54. package/dist/features/parameters/sensi/constants.js +0 -4
  55. package/dist/features/parameters/sensi/sensitivity-analysis-parameters-inline.js +1 -1
  56. package/dist/features/parameters/sensi/use-sensitivity-analysis-parameters.js +33 -32
  57. package/dist/features/parameters/sensi/utils.d.ts +31 -63
  58. package/dist/features/parameters/sensi/utils.js +49 -61
  59. package/dist/features/parameters/short-circuit/short-circuit-parameters-inline.js +1 -1
  60. package/dist/features/parameters/voltage-init/use-voltage-init-parameters-form.js +1 -1
  61. package/dist/features/parameters/voltage-init/voltage-init-form-utils.js +1 -1
  62. package/dist/features/parameters/voltage-init/voltage-init-parameters-inline.js +1 -1
  63. package/dist/features/parameters/voltage-init/voltage-limits-parameters.js +1 -1
  64. package/dist/hooks/use-unique-name-validation.js +1 -1
  65. package/dist/index.js +30 -11
  66. package/dist/services/directory.d.ts +1 -1
  67. package/dist/services/index.js +6 -3
  68. package/dist/services/pcc-min.d.ts +2 -1
  69. package/dist/services/pcc-min.js +27 -1
  70. package/dist/services/security-analysis.d.ts +2 -1
  71. package/dist/services/security-analysis.js +32 -1
  72. package/dist/services/sensitivity-analysis.d.ts +2 -1
  73. package/dist/services/sensitivity-analysis.js +87 -1
  74. package/dist/translations/en/networkModificationsEn.d.ts +2 -0
  75. package/dist/translations/en/networkModificationsEn.js +2 -0
  76. package/dist/translations/fr/networkModificationsFr.d.ts +2 -0
  77. package/dist/translations/fr/networkModificationsFr.js +2 -0
  78. package/dist/utils/constants/filterConstant.d.ts +1 -1
  79. package/dist/utils/index.js +4 -4
  80. package/dist/utils/types/dynamic-security-analysis.type.d.ts +3 -5
  81. package/dist/utils/types/index.d.ts +1 -0
  82. package/dist/utils/types/index.js +4 -4
  83. package/dist/utils/types/parameters.type.d.ts +1 -1
  84. package/dist/utils/types/pcc-min.type.d.ts +0 -1
  85. package/dist/utils/types/pcc-min.type.js +0 -21
  86. package/dist/utils/types/security-analysis.type.d.ts +26 -0
  87. package/dist/utils/types/security-analysis.type.js +14 -0
  88. package/dist/utils/types/sensitivity-analysis.type.d.ts +3 -7
  89. package/dist/utils/types/sensitivity-analysis.type.js +17 -103
  90. package/dist/utils/types/types.d.ts +7 -0
  91. package/package.json +1 -1
  92. package/dist/components/composite/dnd-table-v2/dnd-table-add-rows-dialog.d.ts +0 -13
  93. package/dist/components/composite/dnd-table-v2/dnd-table-add-rows-dialog.js +0 -69
  94. package/dist/components/composite/dnd-table-v2/dnd-table-bottom-left-buttons.d.ts +0 -17
  95. package/dist/components/composite/dnd-table-v2/dnd-table-bottom-left-buttons.js +0 -47
  96. package/dist/components/composite/dnd-table-v2/dnd-table-bottom-right-buttons.d.ts +0 -17
  97. package/dist/components/composite/dnd-table-v2/dnd-table-bottom-right-buttons.js +0 -100
  98. package/dist/components/composite/dnd-table-v2/dnd-table.d.ts +0 -32
  99. package/dist/components/composite/dnd-table-v2/dnd-table.js +0 -375
  100. package/dist/components/composite/dnd-table-v2/dnd-table.type.d.ts +0 -70
  101. package/dist/components/composite/dnd-table-v2/dnd-table.type.js +0 -19
  102. package/dist/components/composite/dnd-table-v2/index.d.ts +0 -12
  103. package/dist/components/composite/dnd-table-v2/index.js +0 -16
  104. package/dist/features/parameters/common/parameter-table/constants.d.ts +0 -11
  105. package/dist/features/parameters/common/parameter-table/constants.js +0 -12
  106. package/dist/features/parameters/common/parameter-table/parameter-table.d.ts +0 -15
  107. package/dist/features/parameters/common/parameter-table/parameter-table.js +0 -98
  108. package/dist/features/parameters/common/parameter-table/table-cell.d.ts +0 -8
  109. package/dist/features/parameters/common/parameter-table/table-cell.js +0 -83
  110. package/dist/features/parameters/common/parameter-table/table-row.d.ts +0 -11
  111. package/dist/features/parameters/common/parameter-table/table-row.js +0 -41
  112. package/dist/features/parameters/common/parameter-table/types.d.ts +0 -26
  113. package/dist/features/parameters/common/parameter-table/types.js +0 -1
  114. package/dist/features/parameters/security-analysis/types.d.ts +0 -20
  115. package/dist/features/parameters/security-analysis/types.js +0 -42
  116. /package/dist/components/composite/{dnd-table-v2 → dnd-table}/deletable-table-row.d.ts +0 -0
  117. /package/dist/components/composite/{dnd-table-v2 → dnd-table}/deletable-table-row.js +0 -0
  118. /package/dist/components/composite/{dnd-table-v2 → dnd-table}/dnd-table-row.d.ts +0 -0
  119. /package/dist/components/composite/{dnd-table-v2 → dnd-table}/dnd-table-row.js +0 -0
  120. /package/dist/components/composite/{dnd-table-v2 → dnd-table}/dnd-table-utils.d.ts +0 -0
  121. /package/dist/components/composite/{dnd-table-v2 → dnd-table}/dnd-table-utils.js +0 -0
@@ -1,83 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { TableCell } from "@mui/material";
3
- import "@mui/icons-material";
4
- import "react-intl";
5
- import "../../../../components/ui/overflowableText/OverflowableText.js";
6
- import "../../../../utils/conversionUtils.js";
7
- import "../../../../utils/types/equipmentType.js";
8
- import "react";
9
- import "react-hook-form";
10
- import "localized-countries";
11
- import "localized-countries/data/fr";
12
- import "localized-countries/data/en";
13
- import "notistack";
14
- import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
15
- import "yup";
16
- import { DirectoryItemsInput } from "../../../../components/ui/reactHookForm/DirectoryItemsInput.js";
17
- import { SwitchInput } from "../../../../components/ui/reactHookForm/booleans/SwitchInput.js";
18
- import { FloatInput } from "../../../../components/ui/reactHookForm/numbers/FloatInput.js";
19
- import { TextInput } from "../../../../components/ui/reactHookForm/text/TextInput.js";
20
- import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
21
- import { MuiSelectInput } from "../../../../components/ui/reactHookForm/selectInputs/MuiSelectInput.js";
22
- import { DescriptionInput } from "../../../../components/ui/reactHookForm/text/DescriptionInput.js";
23
- import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
24
- import "@hello-pangea/dnd";
25
- import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
26
- import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
27
- import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
28
- import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
29
- import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
30
- import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
31
- import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
32
- import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
33
- import "@material-symbols/svg-400/outlined/add_notes.svg?react";
34
- import "mui-nested-menu";
35
- import "react-resizable-panels";
36
- function EditableTableCell(arrayFormName, rowIndex, column, onRowChanged) {
37
- return /* @__PURE__ */ jsxs(
38
- TableCell,
39
- {
40
- sx: {
41
- width: column.width
42
- },
43
- children: [
44
- column.directoryItems && /* @__PURE__ */ jsx(
45
- DirectoryItemsInput,
46
- {
47
- name: `${arrayFormName}[${rowIndex}].${column.dataKey}`,
48
- equipmentTypes: column.equipmentTypes,
49
- elementType: column.elementType,
50
- titleId: column.titleId,
51
- hideErrorMessage: true,
52
- label: void 0,
53
- itemFilter: void 0,
54
- onChange: onRowChanged
55
- }
56
- ),
57
- column.menuItems && /* @__PURE__ */ jsx(
58
- MuiSelectInput,
59
- {
60
- name: `${arrayFormName}[${rowIndex}].${column.dataKey}`,
61
- options: column.equipmentTypes,
62
- size: "small",
63
- fullWidth: true
64
- }
65
- ),
66
- column.checkboxItems && /* @__PURE__ */ jsx("span", { onChange: onRowChanged, children: /* @__PURE__ */ jsx(SwitchInput, { name: `${arrayFormName}[${rowIndex}].${column.dataKey}` }) }),
67
- column.floatItems && /* @__PURE__ */ jsx(FloatInput, { name: `${arrayFormName}[${rowIndex}].${column.dataKey}` }),
68
- column.textItems && /* @__PURE__ */ jsx(
69
- TextInput,
70
- {
71
- name: `${arrayFormName}[${rowIndex}].${column.dataKey}`,
72
- formProps: { disabled: !column.editable }
73
- }
74
- ),
75
- column.descriptionItems && /* @__PURE__ */ jsx(DescriptionInput, { name: `${arrayFormName}[${rowIndex}].${column.dataKey}` })
76
- ]
77
- },
78
- column.dataKey
79
- );
80
- }
81
- export {
82
- EditableTableCell as default
83
- };
@@ -1,11 +0,0 @@
1
- import { ColumnsDef } from './types';
2
- interface TableRowComponentProps {
3
- arrayFormName: string;
4
- columnsDefinition: ColumnsDef[];
5
- index: number;
6
- handleDeleteButton: (index: number) => void;
7
- disableDelete: boolean;
8
- handleRowChanged: (a: number) => void;
9
- }
10
- export declare function TableRowComponent({ arrayFormName, columnsDefinition, index, handleDeleteButton, disableDelete, handleRowChanged, }: Readonly<TableRowComponentProps>): import("react/jsx-runtime").JSX.Element;
11
- export {};
@@ -1,41 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { TableRow, TableCell, IconButton } from "@mui/material";
3
- import { useState } from "react";
4
- import { useIntl } from "react-intl";
5
- import { Delete } from "@mui/icons-material";
6
- import { CustomTooltip } from "../../../../components/ui/tooltip/CustomTooltip.js";
7
- import EditableTableCell from "./table-cell.js";
8
- function TableRowComponent({
9
- arrayFormName,
10
- columnsDefinition,
11
- index,
12
- handleDeleteButton,
13
- disableDelete = false,
14
- handleRowChanged
15
- }) {
16
- const [isHover, setIsHover] = useState(false);
17
- const intl = useIntl();
18
- function handleHover(enter) {
19
- return setIsHover(enter);
20
- }
21
- const handleCellChanged = () => {
22
- handleRowChanged(index);
23
- };
24
- return /* @__PURE__ */ jsxs(TableRow, { onMouseEnter: () => handleHover(true), onMouseLeave: () => handleHover(false), children: [
25
- columnsDefinition.map(
26
- (column) => EditableTableCell(arrayFormName, index, column, handleCellChanged)
27
- ),
28
- !disableDelete && /* @__PURE__ */ jsx(TableCell, { sx: { width: "5rem", textAlign: "center" }, children: isHover && /* @__PURE__ */ jsx(
29
- CustomTooltip,
30
- {
31
- title: intl.formatMessage({
32
- id: "DeleteRows"
33
- }),
34
- children: /* @__PURE__ */ jsx(IconButton, { onClick: () => handleDeleteButton(index), children: /* @__PURE__ */ jsx(Delete, {}) })
35
- }
36
- ) })
37
- ] });
38
- }
39
- export {
40
- TableRowComponent
41
- };
@@ -1,26 +0,0 @@
1
- /**
2
- * Copyright (c) 2026, RTE (http://www.rte-france.com)
3
- * This Source Code Form is subject to the terms of the Mozilla Public
4
- * License, v. 2.0. If a copy of the MPL was not distributed with this
5
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
- */
7
- export interface Parameters {
8
- columnsDef: ColumnsDef[];
9
- name: string;
10
- }
11
- export interface ColumnsDef {
12
- label: string;
13
- dataKey: string;
14
- initialValue: boolean | string | string[] | number | null;
15
- editable?: boolean;
16
- directoryItems?: boolean;
17
- menuItems?: boolean;
18
- equipmentTypes?: any[];
19
- elementType?: string;
20
- titleId?: string;
21
- checkboxItems?: boolean;
22
- floatItems?: boolean;
23
- textItems?: boolean;
24
- descriptionItems?: boolean;
25
- width?: string;
26
- }
@@ -1,20 +0,0 @@
1
- import { UUID } from 'node:crypto';
2
- import { CONTINGENCY_LISTS_INFOS, PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_PROVIDER } from '../common/constants';
3
- import { ContingencyListsInfos, ContingencyListsInfosEnriched } from '../common/contingency-table/types';
4
- import { ILimitReductionsByVoltageLevel } from '../common/limitreductions/columns-definitions';
5
- export type SAParameters = {
6
- uuid?: UUID;
7
- [PARAM_SA_PROVIDER]: string;
8
- [CONTINGENCY_LISTS_INFOS]: ContingencyListsInfos[];
9
- limitReductions: ILimitReductionsByVoltageLevel[];
10
- [PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD]: number;
11
- [PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD]: number;
12
- [PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD]: number;
13
- [PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD]: number;
14
- [PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD]: number;
15
- };
16
- export type SAParametersEnriched = Omit<SAParameters, typeof CONTINGENCY_LISTS_INFOS> & {
17
- [CONTINGENCY_LISTS_INFOS]: ContingencyListsInfosEnriched[];
18
- };
19
- export declare function mapSecurityAnalysisParameters(parameters: SAParametersEnriched): SAParameters;
20
- export declare function enrichSecurityAnalysisParameters(parameters: SAParameters): Promise<SAParametersEnriched>;
@@ -1,42 +0,0 @@
1
- import { fetchElementNames } from "../../../services/directory.js";
2
- import { NAME, ID } from "../common/parameter-table/constants.js";
3
- function mapSecurityAnalysisParameters(parameters) {
4
- return {
5
- ...parameters,
6
- contingencyListsInfos: parameters.contingencyListsInfos?.map((clInfos) => {
7
- return {
8
- ...clInfos,
9
- contingencyLists: clInfos.contingencyLists.map((c) => c.id)
10
- };
11
- })
12
- };
13
- }
14
- function getEquipmentsContainerIds(params) {
15
- const allContainerIds = params.contingencyListsInfos ? params.contingencyListsInfos.flatMap((cli) => cli.contingencyLists ?? []) : [];
16
- return new Set(allContainerIds);
17
- }
18
- function enrichSecurityAnalysisParameters(parameters) {
19
- const allElementIds = getEquipmentsContainerIds(parameters);
20
- const elementNamesPromise = allElementIds.size === 0 ? Promise.resolve(null) : fetchElementNames(allElementIds);
21
- return elementNamesPromise.then((elementNames) => {
22
- const mapIdsToIdNames = (ids) => {
23
- return ids ? ids.map((id) => ({
24
- [ID]: id,
25
- [NAME]: elementNames?.[id] ?? null
26
- })) : [];
27
- };
28
- return {
29
- ...parameters,
30
- contingencyListsInfos: parameters.contingencyListsInfos ? parameters.contingencyListsInfos.map((cli) => {
31
- return {
32
- ...cli,
33
- contingencyLists: mapIdsToIdNames(cli.contingencyLists)
34
- };
35
- }) : []
36
- };
37
- });
38
- }
39
- export {
40
- enrichSecurityAnalysisParameters,
41
- mapSecurityAnalysisParameters
42
- };