@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.
- package/dist/components/dialogs/descriptionModificationDialog/DescriptionModificationDialog.d.ts +9 -4
- package/dist/components/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js +7 -4
- package/dist/components/dialogs/elementSaveDialog/ElementSaveDialog.js +5 -0
- package/dist/components/dnd-table/dnd-table-add-rows-dialog.js +5 -0
- package/dist/components/dnd-table/dnd-table.js +5 -0
- package/dist/components/filter/HeaderFilterForm.js +5 -0
- package/dist/components/filter/expert/ExpertFilterForm.js +4 -0
- package/dist/components/filter/explicitNaming/ExplicitNamingFilterForm.js +4 -0
- package/dist/components/index.js +7 -7
- package/dist/components/inputs/index.js +2 -0
- package/dist/components/inputs/reactHookForm/index.js +2 -0
- package/dist/components/inputs/reactHookForm/text/DescriptionInput.d.ts +4 -0
- package/dist/components/inputs/reactHookForm/text/DescriptionInput.js +85 -0
- package/dist/components/inputs/reactHookForm/text/index.d.ts +1 -0
- package/dist/components/inputs/reactHookForm/text/index.js +2 -0
- package/dist/components/network-modifications/common/properties/PropertiesForm.js +5 -0
- package/dist/components/network-modifications/common/properties/PropertyForm.js +5 -0
- package/dist/components/network-modifications/substation/creation/SubstationCreationForm.js +5 -0
- package/dist/components/parameters/common/ProviderParam.js +6 -1
- package/dist/components/parameters/common/{constant.d.ts → constants.d.ts} +3 -0
- package/dist/components/parameters/common/{constant.js → constants.js} +6 -0
- package/dist/components/parameters/common/contingency-table/columns-definitions.d.ts +27 -0
- package/dist/components/parameters/common/contingency-table/columns-definitions.js +102 -0
- package/dist/components/parameters/common/contingency-table/contingency-table.d.ts +5 -0
- package/dist/components/parameters/common/contingency-table/contingency-table.js +81 -0
- package/dist/components/parameters/common/contingency-table/index.d.ts +8 -0
- package/dist/components/parameters/common/contingency-table/index.js +9 -0
- package/dist/components/parameters/common/contingency-table/types.d.ts +12 -0
- package/dist/components/parameters/common/contingency-table/types.js +1 -0
- package/dist/components/parameters/common/index.d.ts +1 -1
- package/dist/components/parameters/common/index.js +5 -5
- package/dist/components/parameters/common/limitreductions/columns-definitions.d.ts +8 -34
- package/dist/components/parameters/common/limitreductions/columns-definitions.js +11 -32
- package/dist/components/parameters/common/limitreductions/index.d.ts +0 -1
- package/dist/components/parameters/common/limitreductions/index.js +1 -4
- package/dist/components/parameters/common/limitreductions/limit-reduction-table-cell.js +5 -0
- package/dist/components/parameters/common/limitreductions/limit-reductions-table-form.js +5 -0
- package/dist/components/parameters/common/name-element-editor/name-element-editor-utils.js +5 -0
- package/dist/components/parameters/common/parameter-table/constants.d.ts +11 -0
- package/dist/components/parameters/common/parameter-table/constants.js +12 -0
- package/dist/components/parameters/common/parameter-table/index.d.ts +9 -0
- package/dist/components/parameters/common/parameter-table/index.js +10 -0
- package/dist/components/parameters/common/parameter-table/parameter-table.d.ts +15 -0
- package/dist/components/parameters/{sensi/sensitivity-table.js → common/parameter-table/parameter-table.js} +11 -37
- package/dist/components/parameters/{sensi → common/parameter-table}/table-cell.js +19 -17
- package/dist/components/parameters/{sensi → common/parameter-table}/table-row.d.ts +2 -2
- package/dist/components/parameters/common/parameter-table/types.d.ts +26 -0
- package/dist/components/parameters/common/parameter-table/types.js +1 -0
- package/dist/components/parameters/common/utils.js +1 -1
- package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table-cell.js +6 -1
- package/dist/components/parameters/common/widget/parameter-float.js +5 -0
- package/dist/components/parameters/common/widget/parameter-line-directory-items-input.js +5 -0
- package/dist/components/parameters/common/widget/parameter-line-slider.js +5 -0
- package/dist/components/parameters/index.js +5 -7
- package/dist/components/parameters/loadflow/load-flow-general-parameters.js +6 -2
- package/dist/components/parameters/loadflow/load-flow-parameter-field.js +5 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-content.js +4 -0
- package/dist/components/parameters/loadflow/load-flow-parameters-dialog.js +4 -0
- package/dist/components/parameters/loadflow/load-flow-parameters-form.js +5 -0
- package/dist/components/parameters/loadflow/load-flow-parameters-header.js +6 -2
- package/dist/components/parameters/loadflow/load-flow-parameters-inline.js +5 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-utils.js +6 -3
- package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +6 -3
- package/dist/components/parameters/network-visualizations/map-parameters.js +4 -0
- package/dist/components/parameters/network-visualizations/network-area-diagram-parameters.js +5 -0
- package/dist/components/parameters/network-visualizations/network-visualizations-form.js +5 -1
- package/dist/components/parameters/network-visualizations/network-visualizations-parameters-dialog.js +4 -0
- package/dist/components/parameters/network-visualizations/network-visualizations-parameters-inline.js +5 -0
- package/dist/components/parameters/network-visualizations/single-line-diagram-parameters.js +4 -0
- package/dist/components/parameters/network-visualizations/use-network-visualizations-parameters-form.js +5 -0
- package/dist/components/parameters/pcc-min/pcc-min-form-utils.js +5 -0
- package/dist/components/parameters/pcc-min/pcc-min-parameters-dialog.js +4 -0
- package/dist/components/parameters/pcc-min/pcc-min-parameters-form.js +5 -1
- package/dist/components/parameters/pcc-min/pcc-min-parameters-inline.js +5 -1
- package/dist/components/parameters/pcc-min/use-pcc-min-parameters-form.js +5 -0
- package/dist/components/parameters/security-analysis/columns-definitions.d.ts +63 -0
- package/dist/components/parameters/security-analysis/columns-definitions.js +78 -0
- package/dist/components/parameters/security-analysis/security-analysis-parameters-dialog.js +5 -0
- package/dist/components/parameters/security-analysis/security-analysis-parameters-form.d.ts +4 -1
- package/dist/components/parameters/security-analysis/security-analysis-parameters-form.js +32 -13
- package/dist/components/parameters/security-analysis/security-analysis-parameters-inline.d.ts +2 -1
- package/dist/components/parameters/security-analysis/security-analysis-parameters-inline.js +9 -2
- package/dist/components/parameters/security-analysis/security-analysis-parameters-selector.d.ts +3 -2
- package/dist/components/parameters/security-analysis/security-analysis-parameters-selector.js +4 -0
- package/dist/components/parameters/security-analysis/security-analysis-violations-hiding.js +6 -2
- package/dist/components/parameters/security-analysis/types.d.ts +15 -0
- package/dist/components/parameters/security-analysis/types.js +1 -0
- package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.d.ts +5 -4
- package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.js +26 -7
- package/dist/components/parameters/sensi/columns-definitions.d.ts +7 -25
- package/dist/components/parameters/sensi/columns-definitions.js +35 -1
- package/dist/components/parameters/sensi/constants.d.ts +0 -2
- package/dist/components/parameters/sensi/constants.js +0 -4
- package/dist/components/parameters/sensi/index.d.ts +0 -1
- package/dist/components/parameters/sensi/index.js +1 -3
- package/dist/components/parameters/sensi/sensitivity-Flow-parameters.js +5 -0
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-dialog.js +4 -0
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-form.js +6 -2
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-inline.js +5 -1
- package/dist/components/parameters/sensi/sensitivity-parameters-selector.js +27 -19
- package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +7 -2
- package/dist/components/parameters/sensi/utils.d.ts +2 -1
- package/dist/components/parameters/sensi/utils.js +7 -2
- package/dist/components/parameters/short-circuit/short-circuit-fields.js +6 -2
- package/dist/components/parameters/short-circuit/short-circuit-icc-material-table-cell.js +5 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.js +4 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +5 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.js +5 -1
- package/dist/components/parameters/short-circuit/short-circuit-parameters-utils.js +5 -1
- package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +6 -2
- package/dist/components/parameters/voltage-init/equipment-selection-parameters.js +5 -1
- package/dist/components/parameters/voltage-init/general-parameters.js +4 -0
- package/dist/components/parameters/voltage-init/use-voltage-init-parameters-form.js +5 -0
- package/dist/components/parameters/voltage-init/voltage-init-form-utils.js +5 -0
- package/dist/components/parameters/voltage-init/voltage-init-parameters-dialog.js +4 -0
- package/dist/components/parameters/voltage-init/voltage-init-parameters-form.js +5 -1
- package/dist/components/parameters/voltage-init/voltage-init-parameters-inline.js +5 -1
- package/dist/components/parameters/voltage-init/voltage-limits-parameters.js +5 -0
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +2 -2
- package/dist/hooks/use-create-row-data.d.ts +4 -0
- package/dist/hooks/{use-create-row-data-sensi.js → use-create-row-data.js} +5 -5
- package/dist/index.js +9 -9
- package/dist/translations/en/businessErrorsEn.d.ts +1 -0
- package/dist/translations/en/businessErrorsEn.js +1 -0
- package/dist/translations/en/parameters.d.ts +1 -0
- package/dist/translations/en/parameters.js +3 -2
- package/dist/translations/fr/businessErrorsFr.d.ts +1 -0
- package/dist/translations/fr/businessErrorsFr.js +1 -0
- package/dist/translations/fr/parameters.d.ts +1 -0
- package/dist/translations/fr/parameters.js +3 -2
- package/dist/utils/types/parameters.type.d.ts +3 -2
- package/package.json +1 -1
- package/dist/components/parameters/common/limitreductions/limit-reductions-form-util.d.ts +0 -29
- package/dist/components/parameters/common/limitreductions/limit-reductions-form-util.js +0 -27
- package/dist/components/parameters/sensi/sensitivity-table.d.ts +0 -14
- package/dist/hooks/use-create-row-data-sensi.d.ts +0 -4
- /package/dist/components/parameters/{sensi → common/parameter-table}/table-cell.d.ts +0 -0
- /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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -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 './
|
|
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 "./
|
|
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,
|
|
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
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
|
|
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,
|
|
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,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,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 "
|
|
9
|
-
|
|
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) =>
|
|
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 ||
|
|
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 =
|
|
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
|
-
|
|
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 "
|
|
5
|
-
import "
|
|
6
|
-
import "
|
|
4
|
+
import "../../../overflowableText/OverflowableText.js";
|
|
5
|
+
import "../../../../utils/conversionUtils.js";
|
|
6
|
+
import "../../../../utils/types/equipmentType.js";
|
|
7
7
|
import "@mui/icons-material";
|
|
8
|
-
import "
|
|
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 "
|
|
15
|
+
import "../../../inputs/reactHookForm/provider/CustomFormProvider.js";
|
|
16
16
|
import "yup";
|
|
17
|
-
import { DirectoryItemsInput } from "
|
|
18
|
-
import "
|
|
19
|
-
import "
|
|
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 "
|
|
24
|
-
import { FloatInput } from "
|
|
25
|
-
import { TextInput } from "
|
|
26
|
-
import "
|
|
27
|
-
import { MuiSelectInput } from "
|
|
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 "
|
|
30
|
-
import "
|
|
30
|
+
import "../../../filter/expert/expertFilterConstants.js";
|
|
31
|
+
import "../../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
31
32
|
import "uuid";
|
|
32
|
-
import "
|
|
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 {
|
|
1
|
+
import { ColumnsDef } from './types';
|
|
2
2
|
interface TableRowComponentProps {
|
|
3
3
|
arrayFormName: string;
|
|
4
|
-
columnsDefinition:
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -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 "./
|
|
7
|
+
import { SPECIFIC_PARAMETERS } from "./constants.js";
|
|
8
8
|
import * as yup from "yup";
|
|
9
9
|
const getSpecificParametersFormSchema = (specificParameters) => {
|
|
10
10
|
const shape = {};
|