@gridsuite/commons-ui 0.165.2 → 0.166.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 (139) hide show
  1. package/dist/components/dialogs/descriptionModificationDialog/DescriptionModificationDialog.d.ts +9 -4
  2. package/dist/components/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js +7 -4
  3. package/dist/components/dialogs/elementSaveDialog/ElementSaveDialog.js +5 -0
  4. package/dist/components/dnd-table/dnd-table-add-rows-dialog.js +5 -0
  5. package/dist/components/dnd-table/dnd-table.js +5 -0
  6. package/dist/components/filter/HeaderFilterForm.js +5 -0
  7. package/dist/components/filter/expert/ExpertFilterForm.js +4 -0
  8. package/dist/components/filter/explicitNaming/ExplicitNamingFilterForm.js +4 -0
  9. package/dist/components/index.js +7 -7
  10. package/dist/components/inputs/index.js +2 -0
  11. package/dist/components/inputs/reactHookForm/index.js +2 -0
  12. package/dist/components/inputs/reactHookForm/text/DescriptionInput.d.ts +4 -0
  13. package/dist/components/inputs/reactHookForm/text/DescriptionInput.js +85 -0
  14. package/dist/components/inputs/reactHookForm/text/index.d.ts +1 -0
  15. package/dist/components/inputs/reactHookForm/text/index.js +2 -0
  16. package/dist/components/network-modifications/common/properties/PropertiesForm.js +5 -0
  17. package/dist/components/network-modifications/common/properties/PropertyForm.js +5 -0
  18. package/dist/components/network-modifications/substation/creation/SubstationCreationForm.js +5 -0
  19. package/dist/components/parameters/common/ProviderParam.js +6 -1
  20. package/dist/components/parameters/common/{constant.d.ts → constants.d.ts} +3 -0
  21. package/dist/components/parameters/common/{constant.js → constants.js} +6 -0
  22. package/dist/components/parameters/common/contingency-table/columns-definitions.d.ts +27 -0
  23. package/dist/components/parameters/common/contingency-table/columns-definitions.js +102 -0
  24. package/dist/components/parameters/common/contingency-table/contingency-table.d.ts +5 -0
  25. package/dist/components/parameters/common/contingency-table/contingency-table.js +81 -0
  26. package/dist/components/parameters/common/contingency-table/index.d.ts +8 -0
  27. package/dist/components/parameters/common/contingency-table/index.js +9 -0
  28. package/dist/components/parameters/common/contingency-table/types.d.ts +12 -0
  29. package/dist/components/parameters/common/contingency-table/types.js +1 -0
  30. package/dist/components/parameters/common/index.d.ts +1 -1
  31. package/dist/components/parameters/common/index.js +5 -5
  32. package/dist/components/parameters/common/limitreductions/columns-definitions.d.ts +8 -34
  33. package/dist/components/parameters/common/limitreductions/columns-definitions.js +11 -32
  34. package/dist/components/parameters/common/limitreductions/index.d.ts +0 -1
  35. package/dist/components/parameters/common/limitreductions/index.js +1 -4
  36. package/dist/components/parameters/common/limitreductions/limit-reduction-table-cell.js +5 -0
  37. package/dist/components/parameters/common/limitreductions/limit-reductions-table-form.js +5 -0
  38. package/dist/components/parameters/common/name-element-editor/name-element-editor-utils.js +5 -0
  39. package/dist/components/parameters/common/parameter-table/constants.d.ts +11 -0
  40. package/dist/components/parameters/common/parameter-table/constants.js +12 -0
  41. package/dist/components/parameters/common/parameter-table/index.d.ts +9 -0
  42. package/dist/components/parameters/common/parameter-table/index.js +10 -0
  43. package/dist/components/parameters/common/parameter-table/parameter-table.d.ts +15 -0
  44. package/dist/components/parameters/{sensi/sensitivity-table.js → common/parameter-table/parameter-table.js} +11 -37
  45. package/dist/components/parameters/{sensi → common/parameter-table}/table-cell.js +19 -17
  46. package/dist/components/parameters/{sensi → common/parameter-table}/table-row.d.ts +2 -2
  47. package/dist/components/parameters/common/parameter-table/types.d.ts +26 -0
  48. package/dist/components/parameters/common/parameter-table/types.js +1 -0
  49. package/dist/components/parameters/common/utils.js +1 -1
  50. package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table-cell.js +6 -1
  51. package/dist/components/parameters/common/widget/parameter-float.js +5 -0
  52. package/dist/components/parameters/common/widget/parameter-line-directory-items-input.js +5 -0
  53. package/dist/components/parameters/common/widget/parameter-line-slider.js +5 -0
  54. package/dist/components/parameters/index.js +5 -7
  55. package/dist/components/parameters/loadflow/load-flow-general-parameters.js +6 -2
  56. package/dist/components/parameters/loadflow/load-flow-parameter-field.js +5 -1
  57. package/dist/components/parameters/loadflow/load-flow-parameters-content.js +4 -0
  58. package/dist/components/parameters/loadflow/load-flow-parameters-dialog.js +4 -0
  59. package/dist/components/parameters/loadflow/load-flow-parameters-form.js +5 -0
  60. package/dist/components/parameters/loadflow/load-flow-parameters-header.js +6 -2
  61. package/dist/components/parameters/loadflow/load-flow-parameters-inline.js +5 -1
  62. package/dist/components/parameters/loadflow/load-flow-parameters-utils.js +6 -3
  63. package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +6 -3
  64. package/dist/components/parameters/network-visualizations/map-parameters.js +4 -0
  65. package/dist/components/parameters/network-visualizations/network-area-diagram-parameters.js +5 -0
  66. package/dist/components/parameters/network-visualizations/network-visualizations-form.js +5 -1
  67. package/dist/components/parameters/network-visualizations/network-visualizations-parameters-dialog.js +4 -0
  68. package/dist/components/parameters/network-visualizations/network-visualizations-parameters-inline.js +5 -0
  69. package/dist/components/parameters/network-visualizations/single-line-diagram-parameters.js +4 -0
  70. package/dist/components/parameters/network-visualizations/use-network-visualizations-parameters-form.js +5 -0
  71. package/dist/components/parameters/pcc-min/pcc-min-form-utils.js +5 -0
  72. package/dist/components/parameters/pcc-min/pcc-min-parameters-dialog.js +4 -0
  73. package/dist/components/parameters/pcc-min/pcc-min-parameters-form.js +5 -1
  74. package/dist/components/parameters/pcc-min/pcc-min-parameters-inline.js +5 -1
  75. package/dist/components/parameters/pcc-min/use-pcc-min-parameters-form.js +5 -0
  76. package/dist/components/parameters/security-analysis/columns-definitions.d.ts +63 -0
  77. package/dist/components/parameters/security-analysis/columns-definitions.js +78 -0
  78. package/dist/components/parameters/security-analysis/security-analysis-parameters-dialog.js +5 -0
  79. package/dist/components/parameters/security-analysis/security-analysis-parameters-form.d.ts +4 -1
  80. package/dist/components/parameters/security-analysis/security-analysis-parameters-form.js +32 -13
  81. package/dist/components/parameters/security-analysis/security-analysis-parameters-inline.d.ts +2 -1
  82. package/dist/components/parameters/security-analysis/security-analysis-parameters-inline.js +9 -2
  83. package/dist/components/parameters/security-analysis/security-analysis-parameters-selector.d.ts +3 -2
  84. package/dist/components/parameters/security-analysis/security-analysis-parameters-selector.js +4 -0
  85. package/dist/components/parameters/security-analysis/security-analysis-violations-hiding.js +6 -2
  86. package/dist/components/parameters/security-analysis/types.d.ts +15 -0
  87. package/dist/components/parameters/security-analysis/types.js +1 -0
  88. package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.d.ts +5 -4
  89. package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.js +26 -7
  90. package/dist/components/parameters/sensi/columns-definitions.d.ts +7 -25
  91. package/dist/components/parameters/sensi/columns-definitions.js +35 -1
  92. package/dist/components/parameters/sensi/constants.d.ts +0 -2
  93. package/dist/components/parameters/sensi/constants.js +0 -4
  94. package/dist/components/parameters/sensi/index.d.ts +0 -1
  95. package/dist/components/parameters/sensi/index.js +1 -3
  96. package/dist/components/parameters/sensi/sensitivity-Flow-parameters.js +5 -0
  97. package/dist/components/parameters/sensi/sensitivity-analysis-parameters-dialog.js +4 -0
  98. package/dist/components/parameters/sensi/sensitivity-analysis-parameters-form.js +6 -2
  99. package/dist/components/parameters/sensi/sensitivity-analysis-parameters-inline.js +5 -1
  100. package/dist/components/parameters/sensi/sensitivity-parameters-selector.js +27 -19
  101. package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +7 -2
  102. package/dist/components/parameters/sensi/utils.d.ts +2 -1
  103. package/dist/components/parameters/sensi/utils.js +7 -2
  104. package/dist/components/parameters/short-circuit/short-circuit-fields.js +6 -2
  105. package/dist/components/parameters/short-circuit/short-circuit-icc-material-table-cell.js +5 -0
  106. package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.js +4 -0
  107. package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +5 -0
  108. package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.js +5 -1
  109. package/dist/components/parameters/short-circuit/short-circuit-parameters-utils.js +5 -1
  110. package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +6 -2
  111. package/dist/components/parameters/voltage-init/equipment-selection-parameters.js +5 -1
  112. package/dist/components/parameters/voltage-init/general-parameters.js +4 -0
  113. package/dist/components/parameters/voltage-init/use-voltage-init-parameters-form.js +5 -0
  114. package/dist/components/parameters/voltage-init/voltage-init-form-utils.js +5 -0
  115. package/dist/components/parameters/voltage-init/voltage-init-parameters-dialog.js +4 -0
  116. package/dist/components/parameters/voltage-init/voltage-init-parameters-form.js +5 -1
  117. package/dist/components/parameters/voltage-init/voltage-init-parameters-inline.js +5 -1
  118. package/dist/components/parameters/voltage-init/voltage-limits-parameters.js +5 -0
  119. package/dist/hooks/index.d.ts +1 -1
  120. package/dist/hooks/index.js +2 -2
  121. package/dist/hooks/use-create-row-data.d.ts +4 -0
  122. package/dist/hooks/{use-create-row-data-sensi.js → use-create-row-data.js} +5 -5
  123. package/dist/index.js +9 -9
  124. package/dist/translations/en/businessErrorsEn.d.ts +1 -0
  125. package/dist/translations/en/businessErrorsEn.js +1 -0
  126. package/dist/translations/en/parameters.d.ts +1 -0
  127. package/dist/translations/en/parameters.js +3 -2
  128. package/dist/translations/fr/businessErrorsFr.d.ts +1 -0
  129. package/dist/translations/fr/businessErrorsFr.js +1 -0
  130. package/dist/translations/fr/parameters.d.ts +1 -0
  131. package/dist/translations/fr/parameters.js +3 -2
  132. package/dist/utils/types/parameters.type.d.ts +3 -2
  133. package/package.json +1 -1
  134. package/dist/components/parameters/common/limitreductions/limit-reductions-form-util.d.ts +0 -29
  135. package/dist/components/parameters/common/limitreductions/limit-reductions-form-util.js +0 -27
  136. package/dist/components/parameters/sensi/sensitivity-table.d.ts +0 -14
  137. package/dist/hooks/use-create-row-data-sensi.d.ts +0 -4
  138. /package/dist/components/parameters/{sensi → common/parameter-table}/table-cell.d.ts +0 -0
  139. /package/dist/components/parameters/{sensi → common/parameter-table}/table-row.js +0 -0
@@ -0,0 +1,81 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { Stack, Alert } from "@mui/material";
3
+ import { useState, useCallback, useEffect } from "react";
4
+ import { useIntl, FormattedMessage } from "react-intl";
5
+ import { useWatch } from "react-hook-form";
6
+ import "../../../../utils/conversionUtils.js";
7
+ import "../../../../utils/types/equipmentType.js";
8
+ import "@mui/icons-material";
9
+ import "../../../../utils/yupConfig.js";
10
+ import "localized-countries";
11
+ import "localized-countries/data/fr";
12
+ import "localized-countries/data/en";
13
+ import "notistack";
14
+ import { useCreateRowData } from "../../../../hooks/use-create-row-data.js";
15
+ import { ACTIVATED, ID } from "../parameter-table/constants.js";
16
+ import { ParameterTable } from "../parameter-table/parameter-table.js";
17
+ import { CONTINGENCY_LISTS_INFOS, CONTINGENCY_LISTS } from "../constants.js";
18
+ import { ParamContingencyLists, COLUMNS_DEFINITIONS_CONTINGENCY_LISTS_INFOS } from "./columns-definitions.js";
19
+ function ContingencyTable({
20
+ showContingencyCount = false,
21
+ fetchContingencyCount
22
+ }) {
23
+ const intl = useIntl();
24
+ const [simulatedContingencyCount, setSimulatedContingencyCount] = useState(0);
25
+ const [rowData, useFieldArrayOutput] = useCreateRowData(ParamContingencyLists);
26
+ const contingencyListsInfos = useWatch({ name: CONTINGENCY_LISTS_INFOS });
27
+ const getColumnsDefinition = useCallback(
28
+ (columns) => {
29
+ if (columns) {
30
+ return columns.map((column) => ({
31
+ ...column,
32
+ label: intl.formatMessage({ id: column.label })
33
+ }));
34
+ }
35
+ return [];
36
+ },
37
+ [intl]
38
+ );
39
+ useEffect(() => {
40
+ if (showContingencyCount) {
41
+ if (!contingencyListsInfos || contingencyListsInfos.length === 0) {
42
+ setSimulatedContingencyCount(null);
43
+ return;
44
+ }
45
+ fetchContingencyCount?.(
46
+ contingencyListsInfos.filter((lists) => lists[ACTIVATED]).flatMap((lists) => lists[CONTINGENCY_LISTS]?.map((contingencyList) => contingencyList[ID]))
47
+ ).then((contingencyCount) => {
48
+ setSimulatedContingencyCount(contingencyCount);
49
+ }).catch(() => {
50
+ setSimulatedContingencyCount(null);
51
+ });
52
+ }
53
+ }, [contingencyListsInfos, fetchContingencyCount, showContingencyCount]);
54
+ return /* @__PURE__ */ jsxs(Stack, { spacing: 0, sx: { width: "100%" }, children: [
55
+ /* @__PURE__ */ jsx(
56
+ ParameterTable,
57
+ {
58
+ arrayFormName: CONTINGENCY_LISTS_INFOS,
59
+ useFieldArrayOutput,
60
+ columnsDefinition: getColumnsDefinition(COLUMNS_DEFINITIONS_CONTINGENCY_LISTS_INFOS),
61
+ tableHeight: 270,
62
+ createRows: rowData,
63
+ onFormChanged: () => {
64
+ },
65
+ isValidParameterRow: (row) => row[CONTINGENCY_LISTS]?.length > 0
66
+ }
67
+ ),
68
+ showContingencyCount && /* @__PURE__ */ jsx(Alert, { variant: "standard", severity: "info", children: /* @__PURE__ */ jsx(
69
+ FormattedMessage,
70
+ {
71
+ id: "xContingenciesWillBeSimulated",
72
+ values: {
73
+ x: simulatedContingencyCount ?? "..."
74
+ }
75
+ }
76
+ ) })
77
+ ] });
78
+ }
79
+ export {
80
+ ContingencyTable
81
+ };
@@ -0,0 +1,8 @@
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 https://mozilla.org/MPL/2.0/.
6
+ */
7
+ export * from './contingency-table';
8
+ export * from './columns-definitions';
@@ -0,0 +1,9 @@
1
+ import { ContingencyTable } from "./contingency-table.js";
2
+ import { COLUMNS_DEFINITIONS_CONTINGENCY_LISTS_INFOS, ParamContingencyLists, getContingencyListsInfosFormSchema, toFormValuesContingencyListsInfos } from "./columns-definitions.js";
3
+ export {
4
+ COLUMNS_DEFINITIONS_CONTINGENCY_LISTS_INFOS,
5
+ ContingencyTable,
6
+ ParamContingencyLists,
7
+ getContingencyListsInfosFormSchema,
8
+ toFormValuesContingencyListsInfos
9
+ };
@@ -0,0 +1,12 @@
1
+ import { UUID } from 'node:crypto';
2
+ import { ACTIVATED, DESCRIPTION, ID, NAME } from '../parameter-table/constants';
3
+ import { CONTINGENCY_LISTS } from '../constants';
4
+ export interface IdName {
5
+ [ID]: UUID;
6
+ [NAME]: string;
7
+ }
8
+ export interface ContingencyListsInfos {
9
+ [CONTINGENCY_LISTS]: IdName[];
10
+ [DESCRIPTION]: string;
11
+ [ACTIVATED]: boolean;
12
+ }
@@ -5,7 +5,7 @@
5
5
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
6
  */
7
7
  export * from './computing-type';
8
- export * from './constant';
8
+ export * from './constants';
9
9
  export * from './parameters-edition-dialog-props';
10
10
  export * from './line-separator';
11
11
  export * from './parameters';
@@ -1,5 +1,5 @@
1
1
  import { ComputingType, formatComputingTypeLabel, isValidComputingType } from "./computing-type.js";
2
- import { COMMON_PARAMETERS, 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, PROVIDER, SPECIFIC_PARAMETERS, VERSION_PARAMETER, VOLTAGE_LEVEL } from "./constant.js";
2
+ import { COMMON_PARAMETERS, CONTINGENCIES, CONTINGENCY_LISTS, 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, PROVIDER, SPECIFIC_PARAMETERS, VERSION_PARAMETER, VOLTAGE_LEVEL } from "./constants.js";
3
3
  import { LineSeparator } from "./line-separator.js";
4
4
  import { LabelledButton, SwitchWithLabel, TabPanel } from "./parameters.js";
5
5
  import { CreateParameterDialog } from "./parameters-creation-dialog.js";
@@ -12,14 +12,16 @@ import { ParameterSwitch } from "./widget/parameter-switch.js";
12
12
  import { CustomVoltageLevelTable } from "./voltage-level-table/custom-voltage-level-table.js";
13
13
  import { CustomVoltageLevelTableCell } from "./voltage-level-table/custom-voltage-level-table-cell.js";
14
14
  import { CustomVoltageLevelTableRow } from "./voltage-level-table/custom-voltage-level-table-row.js";
15
- import { COLUMNS_DEFINITIONS_LIMIT_REDUCTIONS, IST_FORM, LIMIT_DURATION_FORM, LIMIT_REDUCTIONS_FORM, TAB_INFO, TabValues, VOLTAGE_LEVELS_FORM, getLimitReductionsFormSchema, getSAParametersFromSchema } from "./limitreductions/columns-definitions.js";
16
- import { toFormValueSaParameters, toFormValuesLimitReductions } from "./limitreductions/limit-reductions-form-util.js";
15
+ import { COLUMNS_DEFINITIONS_LIMIT_REDUCTIONS, IST_FORM, LIMIT_DURATION_FORM, LIMIT_REDUCTIONS_FORM, TAB_INFO, TabValues, VOLTAGE_LEVELS_FORM, getLimitReductionsFormSchema, toFormValuesLimitReductions } from "./limitreductions/columns-definitions.js";
17
16
  import { LimitReductionsTableForm } from "./limitreductions/limit-reductions-table-form.js";
18
17
  import { LimitReductionTableRow } from "./limitreductions/limit-reduction-table-row.js";
19
18
  import { LimitReductionTableCell } from "./limitreductions/limit-reduction-table-cell.js";
20
19
  export {
21
20
  COLUMNS_DEFINITIONS_LIMIT_REDUCTIONS,
22
21
  COMMON_PARAMETERS,
22
+ CONTINGENCIES,
23
+ CONTINGENCY_LISTS,
24
+ CONTINGENCY_LISTS_INFOS,
23
25
  ComputingType,
24
26
  CreateParameterDialog,
25
27
  CustomVoltageLevelTable,
@@ -56,9 +58,7 @@ export {
56
58
  VOLTAGE_LEVELS_FORM,
57
59
  formatComputingTypeLabel,
58
60
  getLimitReductionsFormSchema,
59
- getSAParametersFromSchema,
60
61
  isValidComputingType,
61
62
  sanitizePercentageValue,
62
- toFormValueSaParameters,
63
63
  toFormValuesLimitReductions
64
64
  };
@@ -1,6 +1,4 @@
1
- import { UUID } from 'node:crypto';
2
1
  import { default as yup } from '../../../../utils/yupConfig';
3
- import { 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 '../constant';
4
2
  export declare const LIMIT_REDUCTIONS_FORM = "limitReductionsForm";
5
3
  export declare const VOLTAGE_LEVELS_FORM = "voltageLevelsForm";
6
4
  export declare const IST_FORM = "istForm";
@@ -25,16 +23,6 @@ export interface ILimitReductionsByVoltageLevel {
25
23
  permanentLimitReduction: number;
26
24
  temporaryLimitReductions: ITemporaryLimitReduction[];
27
25
  }
28
- export interface ISAParameters {
29
- uuid?: UUID;
30
- [PARAM_SA_PROVIDER]: string;
31
- limitReductions: ILimitReductionsByVoltageLevel[];
32
- [PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD]: number;
33
- [PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD]: number;
34
- [PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD]: number;
35
- [PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD]: number;
36
- [PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD]: number;
37
- }
38
26
  export declare enum TabValues {
39
27
  'General' = 0,
40
28
  'LimitReductions' = 1
@@ -58,25 +46,11 @@ export declare const getLimitReductionsFormSchema: (nbTemporaryLimits: number) =
58
46
  }, yup.AnyObject, {
59
47
  limitReductionsForm: "";
60
48
  }, "">;
61
- export declare const getSAParametersFromSchema: (name: string | null, limitReductions?: ILimitReductionsByVoltageLevel[]) => yup.ObjectSchema<{
62
- flowProportionalThreshold: unknown;
63
- lowVoltageProportionalThreshold: unknown;
64
- lowVoltageAbsoluteThreshold: unknown;
65
- highVoltageProportionalThreshold: unknown;
66
- highVoltageAbsoluteThreshold: unknown;
67
- limitReductionsForm: unknown;
68
- provider: unknown;
69
- } & {
70
- name: string | null | undefined;
71
- description: string | null | undefined;
72
- }, yup.AnyObject, {
73
- flowProportionalThreshold: undefined;
74
- lowVoltageProportionalThreshold: undefined;
75
- lowVoltageAbsoluteThreshold: undefined;
76
- highVoltageProportionalThreshold: undefined;
77
- highVoltageAbsoluteThreshold: undefined;
78
- limitReductionsForm: undefined;
79
- provider: undefined;
80
- name: undefined;
81
- description: undefined;
82
- }, "">;
49
+ export declare const toFormValuesLimitReductions: (limits: ILimitReductionsByVoltageLevel[]) => {
50
+ limitReductionsForm?: undefined;
51
+ } | {
52
+ limitReductionsForm: {
53
+ voltageLevelsForm: string;
54
+ istForm: number;
55
+ }[];
56
+ };
@@ -1,17 +1,5 @@
1
1
  import "../../../../utils/yupConfig.js";
2
- import { PARAM_SA_PROVIDER, 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_FLOW_PROPORTIONAL_THRESHOLD } from "../constant.js";
3
- import "react/jsx-runtime";
4
- import "@mui/material";
5
- import "react";
6
- import "react-intl";
7
- import "@mui/icons-material";
8
- import "react-hook-form";
9
- import "../../../inputs/reactHookForm/provider/CustomFormProvider.js";
10
2
  import * as yup from "yup";
11
- import "../../../../utils/conversionUtils.js";
12
- import "../../../../utils/types/equipmentType.js";
13
- import "../../../filter/HeaderFilterForm.js";
14
- import { getNameElementEditorSchema } from "../name-element-editor/name-element-editor-utils.js";
15
3
  const LIMIT_REDUCTIONS_FORM = "limitReductionsForm";
16
4
  const VOLTAGE_LEVELS_FORM = "voltageLevelsForm";
17
5
  const IST_FORM = "istForm";
@@ -61,25 +49,16 @@ const getLimitReductionsFormSchema = (nbTemporaryLimits) => {
61
49
  )
62
50
  }).required();
63
51
  };
64
- const getSAParametersFromSchema = (name, limitReductions) => {
65
- const providerSchema = yup.object().shape({
66
- [PARAM_SA_PROVIDER]: yup.string().required()
67
- });
68
- const limitReductionsSchema = getLimitReductionsFormSchema(
69
- limitReductions?.length ? limitReductions[0].temporaryLimitReductions.length : 0
70
- );
71
- const thresholdsSchema = yup.object().shape({
72
- [PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD]: yup.number().min(0, "NormalizedPercentage").max(100, "NormalizedPercentage").required(),
73
- [PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD]: yup.number().min(0, "NormalizedPercentage").max(100, "NormalizedPercentage").required(),
74
- [PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD]: yup.number().required(),
75
- [PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD]: yup.number().min(0, "NormalizedPercentage").max(100, "NormalizedPercentage").required(),
76
- [PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD]: yup.number().required()
77
- });
78
- return yup.object().shape({
79
- ...providerSchema.fields,
80
- ...limitReductionsSchema.fields,
81
- ...thresholdsSchema.fields
82
- }).concat(getNameElementEditorSchema(name));
52
+ const toFormValuesFromTemporaryLimits = (limits) => limits.reduce((acc, limit, index) => {
53
+ acc[LIMIT_DURATION_FORM + index] = limit.reduction;
54
+ return acc;
55
+ }, {});
56
+ const toFormValuesLimitReductions = (limits) => !limits ? {} : {
57
+ [LIMIT_REDUCTIONS_FORM]: limits.map((vlLimits) => ({
58
+ [VOLTAGE_LEVELS_FORM]: `${vlLimits.voltageLevel.nominalV} kV`,
59
+ [IST_FORM]: vlLimits.permanentLimitReduction,
60
+ ...toFormValuesFromTemporaryLimits(vlLimits.temporaryLimitReductions)
61
+ }))
83
62
  };
84
63
  export {
85
64
  COLUMNS_DEFINITIONS_LIMIT_REDUCTIONS,
@@ -90,5 +69,5 @@ export {
90
69
  TabValues,
91
70
  VOLTAGE_LEVELS_FORM,
92
71
  getLimitReductionsFormSchema,
93
- getSAParametersFromSchema
72
+ toFormValuesLimitReductions
94
73
  };
@@ -5,7 +5,6 @@
5
5
  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
6
  */
7
7
  export * from './columns-definitions';
8
- export * from './limit-reductions-form-util';
9
8
  export * from './limit-reductions-table-form';
10
9
  export * from './limit-reduction-table-row';
11
10
  export * from './limit-reduction-table-cell';
@@ -1,5 +1,4 @@
1
- import { COLUMNS_DEFINITIONS_LIMIT_REDUCTIONS, IST_FORM, LIMIT_DURATION_FORM, LIMIT_REDUCTIONS_FORM, TAB_INFO, TabValues, VOLTAGE_LEVELS_FORM, getLimitReductionsFormSchema, getSAParametersFromSchema } from "./columns-definitions.js";
2
- import { toFormValueSaParameters, toFormValuesLimitReductions } from "./limit-reductions-form-util.js";
1
+ import { COLUMNS_DEFINITIONS_LIMIT_REDUCTIONS, IST_FORM, LIMIT_DURATION_FORM, LIMIT_REDUCTIONS_FORM, TAB_INFO, TabValues, VOLTAGE_LEVELS_FORM, getLimitReductionsFormSchema, toFormValuesLimitReductions } from "./columns-definitions.js";
3
2
  import { LimitReductionsTableForm } from "./limit-reductions-table-form.js";
4
3
  import { LimitReductionTableRow } from "./limit-reduction-table-row.js";
5
4
  import { LimitReductionTableCell } from "./limit-reduction-table-cell.js";
@@ -15,7 +14,5 @@ export {
15
14
  TabValues,
16
15
  VOLTAGE_LEVELS_FORM,
17
16
  getLimitReductionsFormSchema,
18
- getSAParametersFromSchema,
19
- toFormValueSaParameters,
20
17
  toFormValuesLimitReductions
21
18
  };
@@ -24,6 +24,11 @@ import "react-papaparse";
24
24
  import "react-csv-downloader";
25
25
  import { FloatInput } from "../../../inputs/reactHookForm/numbers/FloatInput.js";
26
26
  import "../../../inputs/reactHookForm/numbers/RangeInput.js";
27
+ import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
28
+ import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
29
+ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
30
+ import "@material-symbols/svg-400/outlined/add_notes.svg?react";
31
+ import "../../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
27
32
  import "@react-querybuilder/material";
28
33
  import "../../../filter/expert/expertFilterConstants.js";
29
34
  import "../../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
@@ -23,6 +23,11 @@ import "ag-grid-community";
23
23
  import "react-papaparse";
24
24
  import "react-csv-downloader";
25
25
  import "../../../inputs/reactHookForm/numbers/RangeInput.js";
26
+ import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
27
+ import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
28
+ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
29
+ import "@material-symbols/svg-400/outlined/add_notes.svg?react";
30
+ import "../../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
26
31
  import "@react-querybuilder/material";
27
32
  import "../../../filter/expert/expertFilterConstants.js";
28
33
  import "../../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
@@ -22,6 +22,11 @@ import "ag-grid-community";
22
22
  import "react-papaparse";
23
23
  import "react-csv-downloader";
24
24
  import "../../../inputs/reactHookForm/numbers/RangeInput.js";
25
+ import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
26
+ import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
27
+ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
28
+ import "@material-symbols/svg-400/outlined/add_notes.svg?react";
29
+ import "../../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
25
30
  import "@react-querybuilder/material";
26
31
  import "../../../filter/expert/expertFilterConstants.js";
27
32
  import "../../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
@@ -0,0 +1,11 @@
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 declare const MAX_ROWS_NUMBER = 100;
8
+ export declare const NAME = "name";
9
+ export declare const ID = "id";
10
+ export declare const ACTIVATED = "activated";
11
+ export declare const DESCRIPTION = "description";
@@ -0,0 +1,12 @@
1
+ const MAX_ROWS_NUMBER = 100;
2
+ const NAME = "name";
3
+ const ID = "id";
4
+ const ACTIVATED = "activated";
5
+ const DESCRIPTION = "description";
6
+ export {
7
+ ACTIVATED,
8
+ DESCRIPTION,
9
+ ID,
10
+ MAX_ROWS_NUMBER,
11
+ NAME
12
+ };
@@ -0,0 +1,9 @@
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 https://mozilla.org/MPL/2.0/.
6
+ */
7
+ export * from './constants';
8
+ export * from './parameter-table';
9
+ export * from './types';
@@ -0,0 +1,10 @@
1
+ import { ACTIVATED, DESCRIPTION, ID, MAX_ROWS_NUMBER, NAME } from "./constants.js";
2
+ import { ParameterTable } from "./parameter-table.js";
3
+ export {
4
+ ACTIVATED,
5
+ DESCRIPTION,
6
+ ID,
7
+ MAX_ROWS_NUMBER,
8
+ NAME,
9
+ ParameterTable
10
+ };
@@ -0,0 +1,15 @@
1
+ import { FieldValues, UseFieldArrayReturn } from 'react-hook-form';
2
+ import { ColumnsDef } from './types';
3
+ interface ParameterTableProps {
4
+ arrayFormName: string;
5
+ useFieldArrayOutput: UseFieldArrayReturn;
6
+ columnsDefinition: ColumnsDef[];
7
+ tableHeight: number;
8
+ createRows: (a: number) => void;
9
+ disableAdd?: boolean;
10
+ disableDelete?: boolean;
11
+ onFormChanged: () => void;
12
+ isValidParameterRow: (fieldValue: FieldValues) => any;
13
+ }
14
+ export declare function ParameterTable({ arrayFormName, useFieldArrayOutput, columnsDefinition, tableHeight, createRows, disableAdd, disableDelete, onFormChanged, isValidParameterRow, }: Readonly<ParameterTableProps>): import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -5,33 +5,8 @@ import { useRef, useCallback } from "react";
5
5
  import { useIntl } from "react-intl";
6
6
  import { useFormContext } from "react-hook-form";
7
7
  import { TableRowComponent } from "./table-row.js";
8
- import "@hello-pangea/dnd";
9
- import { MAX_ROWS_NUMBER } from "../../dnd-table/dnd-table.type.js";
10
- import "../../overflowableText/OverflowableText.js";
11
- import "../../../utils/conversionUtils.js";
12
- import "../../../utils/types/equipmentType.js";
13
- import "../../../utils/yupConfig.js";
14
- import "localized-countries";
15
- import "localized-countries/data/fr";
16
- import "localized-countries/data/en";
17
- import "notistack";
18
- import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
19
- import "yup";
20
- import "../../treeViewFinder/TreeViewFinder.js";
21
- import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
22
- import "../../customAGGrid/customAggrid.js";
23
- import "ag-grid-community";
24
- import "react-papaparse";
25
- import "react-csv-downloader";
26
- import "../../inputs/reactHookForm/numbers/RangeInput.js";
27
- import "@react-querybuilder/material";
28
- import "../../filter/expert/expertFilterConstants.js";
29
- import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
30
- import "uuid";
31
- import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
32
- import "react-querybuilder";
33
- import { isValidSensiParameterRow } from "./utils.js";
34
- function SensitivityTable({
8
+ import { MAX_ROWS_NUMBER } from "./constants.js";
9
+ function ParameterTable({
35
10
  arrayFormName,
36
11
  useFieldArrayOutput,
37
12
  columnsDefinition,
@@ -39,28 +14,27 @@ function SensitivityTable({
39
14
  createRows,
40
15
  disableAdd,
41
16
  disableDelete = false,
42
- onFormChanged
17
+ onFormChanged,
18
+ isValidParameterRow
43
19
  }) {
44
20
  const intl = useIntl();
45
21
  const { getValues } = useFormContext();
46
22
  const { fields: currentRows, append, remove } = useFieldArrayOutput;
47
23
  const validRowCountRef = useRef(
48
- (getValues(arrayFormName) || []).filter((row) => isValidSensiParameterRow(row)).length
24
+ (getValues(arrayFormName) || []).filter((row) => isValidParameterRow(row)).length
49
25
  );
50
26
  const handleRowChanged = useCallback(
51
27
  (index) => {
52
28
  const currentRowValues = getValues(arrayFormName);
53
29
  const row = currentRowValues[index];
54
- const currentValidRowCount = currentRowValues.filter(
55
- (r) => isValidSensiParameterRow(r)
56
- ).length;
30
+ const currentValidRowCount = currentRowValues.filter((r) => isValidParameterRow(r)).length;
57
31
  const previousValidRowCount = validRowCountRef.current;
58
32
  validRowCountRef.current = currentValidRowCount;
59
- if (currentValidRowCount !== previousValidRowCount || isValidSensiParameterRow(row)) {
33
+ if (currentValidRowCount !== previousValidRowCount || isValidParameterRow(row)) {
60
34
  onFormChanged();
61
35
  }
62
36
  },
63
- [getValues, arrayFormName, onFormChanged]
37
+ [getValues, arrayFormName, isValidParameterRow, onFormChanged]
64
38
  );
65
39
  const handleAddRowsButton = useCallback(() => {
66
40
  if (currentRows.length >= MAX_ROWS_NUMBER) {
@@ -72,7 +46,7 @@ function SensitivityTable({
72
46
  (index) => {
73
47
  const currentRowsValues = getValues(arrayFormName);
74
48
  if (index >= 0 && index < currentRowsValues.length) {
75
- const wasValid = isValidSensiParameterRow(currentRowsValues[index]);
49
+ const wasValid = isValidParameterRow(currentRowsValues[index]);
76
50
  remove(index);
77
51
  if (wasValid) {
78
52
  validRowCountRef.current -= 1;
@@ -80,7 +54,7 @@ function SensitivityTable({
80
54
  }
81
55
  }
82
56
  },
83
- [arrayFormName, getValues, onFormChanged, remove]
57
+ [arrayFormName, getValues, isValidParameterRow, onFormChanged, remove]
84
58
  );
85
59
  return /* @__PURE__ */ jsx(
86
60
  TableContainer,
@@ -119,5 +93,5 @@ function SensitivityTable({
119
93
  );
120
94
  }
121
95
  export {
122
- SensitivityTable
96
+ ParameterTable
123
97
  };
@@ -1,35 +1,36 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { TableCell } from "@mui/material";
3
3
  import "react-intl";
4
- import "../../overflowableText/OverflowableText.js";
5
- import "../../../utils/conversionUtils.js";
6
- import "../../../utils/types/equipmentType.js";
4
+ import "../../../overflowableText/OverflowableText.js";
5
+ import "../../../../utils/conversionUtils.js";
6
+ import "../../../../utils/types/equipmentType.js";
7
7
  import "@mui/icons-material";
8
- import "../../../utils/yupConfig.js";
8
+ import "../../../../utils/yupConfig.js";
9
9
  import "react";
10
10
  import "react-hook-form";
11
11
  import "localized-countries";
12
12
  import "localized-countries/data/fr";
13
13
  import "localized-countries/data/en";
14
14
  import "notistack";
15
- import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
15
+ import "../../../inputs/reactHookForm/provider/CustomFormProvider.js";
16
16
  import "yup";
17
- import { DirectoryItemsInput } from "../../inputs/reactHookForm/DirectoryItemsInput.js";
18
- import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
19
- import "../../customAGGrid/customAggrid.js";
17
+ import { DirectoryItemsInput } from "../../../inputs/reactHookForm/DirectoryItemsInput.js";
18
+ import "../../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
19
+ import "../../../customAGGrid/customAggrid.js";
20
20
  import "ag-grid-community";
21
21
  import "react-papaparse";
22
22
  import "react-csv-downloader";
23
- import { SwitchInput } from "../../inputs/reactHookForm/booleans/SwitchInput.js";
24
- import { FloatInput } from "../../inputs/reactHookForm/numbers/FloatInput.js";
25
- import { TextInput } from "../../inputs/reactHookForm/text/TextInput.js";
26
- import "../../inputs/reactHookForm/numbers/RangeInput.js";
27
- import { MuiSelectInput } from "../../inputs/reactHookForm/selectInputs/MuiSelectInput.js";
23
+ import { SwitchInput } from "../../../inputs/reactHookForm/booleans/SwitchInput.js";
24
+ import { FloatInput } from "../../../inputs/reactHookForm/numbers/FloatInput.js";
25
+ import { TextInput } from "../../../inputs/reactHookForm/text/TextInput.js";
26
+ import "../../../inputs/reactHookForm/numbers/RangeInput.js";
27
+ import { MuiSelectInput } from "../../../inputs/reactHookForm/selectInputs/MuiSelectInput.js";
28
+ import { DescriptionInput } from "../../../inputs/reactHookForm/text/DescriptionInput.js";
28
29
  import "@react-querybuilder/material";
29
- import "../../filter/expert/expertFilterConstants.js";
30
- import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
30
+ import "../../../filter/expert/expertFilterConstants.js";
31
+ import "../../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
31
32
  import "uuid";
32
- import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
33
+ import "../../../inputs/reactQueryBuilder/PropertyValueEditor.js";
33
34
  import "react-querybuilder";
34
35
  function EditableTableCell(arrayFormName, rowIndex, column, onRowChanged) {
35
36
  return /* @__PURE__ */ jsxs(
@@ -69,7 +70,8 @@ function EditableTableCell(arrayFormName, rowIndex, column, onRowChanged) {
69
70
  name: `${arrayFormName}[${rowIndex}].${column.dataKey}`,
70
71
  formProps: { disabled: !column.editable }
71
72
  }
72
- )
73
+ ),
74
+ column.descriptionItems && /* @__PURE__ */ jsx(DescriptionInput, { name: `${arrayFormName}[${rowIndex}].${column.dataKey}` })
73
75
  ]
74
76
  },
75
77
  column.dataKey
@@ -1,7 +1,7 @@
1
- import { IColumnsDef } from './columns-definitions';
1
+ import { ColumnsDef } from './types';
2
2
  interface TableRowComponentProps {
3
3
  arrayFormName: string;
4
- columnsDefinition: IColumnsDef[];
4
+ columnsDefinition: ColumnsDef[];
5
5
  index: number;
6
6
  handleDeleteButton: (index: number) => void;
7
7
  disableDelete: boolean;
@@ -0,0 +1,26 @@
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
+ }
@@ -4,7 +4,7 @@ import { ParameterType } from "../../../utils/types/parameters.type.js";
4
4
  import "react/jsx-runtime";
5
5
  import "@mui/icons-material";
6
6
  import "../../../utils/yupConfig.js";
7
- import { SPECIFIC_PARAMETERS } from "./constant.js";
7
+ import { SPECIFIC_PARAMETERS } from "./constants.js";
8
8
  import * as yup from "yup";
9
9
  const getSpecificParametersFormSchema = (specificParameters) => {
10
10
  const shape = {};