@gridsuite/commons-ui 0.165.1 → 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/hooks/use-unique-name-validation.js +18 -7
- 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/ts-utils.d.ts +1 -1
- package/dist/utils/ts-utils.js +13 -16
- 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
package/dist/components/dialogs/descriptionModificationDialog/DescriptionModificationDialog.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2023, 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
|
+
*/
|
|
2
7
|
export interface DescriptionModificationDialogProps {
|
|
3
|
-
elementUuid: UUID;
|
|
4
8
|
description: string;
|
|
5
9
|
open: boolean;
|
|
6
10
|
onClose: () => void;
|
|
7
|
-
updateElement
|
|
11
|
+
updateElement?: (data: Record<string, string>) => Promise<Response>;
|
|
12
|
+
updateForm?: (data: Record<string, string>) => void;
|
|
8
13
|
}
|
|
9
|
-
export declare function DescriptionModificationDialog({
|
|
14
|
+
export declare function DescriptionModificationDialog({ description, open, onClose, updateElement, updateForm, }: Readonly<DescriptionModificationDialogProps>): import("react/jsx-runtime").JSX.Element;
|
package/dist/components/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js
CHANGED
|
@@ -15,11 +15,11 @@ const schema = yup.object().shape({
|
|
|
15
15
|
[FieldConstants.DESCRIPTION]: yup.string().max(MAX_CHAR_DESCRIPTION, "descriptionLimitError")
|
|
16
16
|
});
|
|
17
17
|
function DescriptionModificationDialog({
|
|
18
|
-
elementUuid,
|
|
19
18
|
description,
|
|
20
19
|
open,
|
|
21
20
|
onClose,
|
|
22
|
-
updateElement
|
|
21
|
+
updateElement,
|
|
22
|
+
updateForm
|
|
23
23
|
}) {
|
|
24
24
|
const { snackError } = useSnackMessage();
|
|
25
25
|
const emptyFormData = {
|
|
@@ -38,13 +38,16 @@ function DescriptionModificationDialog({
|
|
|
38
38
|
};
|
|
39
39
|
const onSubmit = useCallback(
|
|
40
40
|
(data) => {
|
|
41
|
-
updateElement(
|
|
41
|
+
updateElement?.({
|
|
42
42
|
[FieldConstants.DESCRIPTION]: data[FieldConstants.DESCRIPTION]?.trim() ?? ""
|
|
43
43
|
}).catch((error) => {
|
|
44
44
|
snackWithFallback(snackError, error, { headerId: "descriptionModificationError" });
|
|
45
45
|
});
|
|
46
|
+
updateForm?.({
|
|
47
|
+
[FieldConstants.DESCRIPTION]: data[FieldConstants.DESCRIPTION]?.trim() ?? ""
|
|
48
|
+
});
|
|
46
49
|
},
|
|
47
|
-
[
|
|
50
|
+
[updateElement, updateForm, snackError]
|
|
48
51
|
);
|
|
49
52
|
return /* @__PURE__ */ jsx(
|
|
50
53
|
CustomMuiDialog,
|
|
@@ -28,6 +28,11 @@ import { RadioInput } from "../../inputs/reactHookForm/booleans/RadioInput.js";
|
|
|
28
28
|
import "../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
29
29
|
import { DescriptionField } from "../../inputs/reactHookForm/text/DescriptionField.js";
|
|
30
30
|
import { UniqueNameInput } from "../../inputs/reactHookForm/text/UniqueNameInput.js";
|
|
31
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
32
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
33
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
34
|
+
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
35
|
+
import "../descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
31
36
|
import "@react-querybuilder/material";
|
|
32
37
|
import "../../filter/expert/expertFilterConstants.js";
|
|
33
38
|
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";
|
|
@@ -33,6 +33,11 @@ import "localized-countries/data/fr";
|
|
|
33
33
|
import "localized-countries/data/en";
|
|
34
34
|
import { TableNumericalInput } from "../inputs/reactHookForm/tableInputs/table-numerical-input.js";
|
|
35
35
|
import { TableTextInput } from "../inputs/reactHookForm/tableInputs/table-text-input.js";
|
|
36
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
37
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
38
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
39
|
+
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
40
|
+
import "../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
36
41
|
import "notistack";
|
|
37
42
|
import "@react-querybuilder/material";
|
|
38
43
|
import "../filter/expert/expertFilterConstants.js";
|
|
@@ -26,6 +26,11 @@ import "react-csv-downloader";
|
|
|
26
26
|
import "../inputs/reactHookForm/numbers/RangeInput.js";
|
|
27
27
|
import { DescriptionField } from "../inputs/reactHookForm/text/DescriptionField.js";
|
|
28
28
|
import { UniqueNameInput } from "../inputs/reactHookForm/text/UniqueNameInput.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/left_panel_close.svg?react";
|
|
32
|
+
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
33
|
+
import "../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
29
34
|
import "@react-querybuilder/material";
|
|
30
35
|
import "./expert/expertFilterConstants.js";
|
|
31
36
|
import "../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
@@ -36,6 +36,10 @@ import "ag-grid-community";
|
|
|
36
36
|
import "react-papaparse";
|
|
37
37
|
import "react-csv-downloader";
|
|
38
38
|
import "../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
39
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
40
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
41
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
42
|
+
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
39
43
|
import "@react-querybuilder/material";
|
|
40
44
|
import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
41
45
|
yup.setLocale({
|
|
@@ -38,6 +38,10 @@ import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
|
38
38
|
import "react-papaparse";
|
|
39
39
|
import "react-csv-downloader";
|
|
40
40
|
import "../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
41
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
42
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
43
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
44
|
+
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
41
45
|
import "@react-querybuilder/material";
|
|
42
46
|
import "../expert/expertFilterConstants.js";
|
|
43
47
|
import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
package/dist/components/index.js
CHANGED
|
@@ -91,6 +91,7 @@ import { DescriptionField } from "./inputs/reactHookForm/text/DescriptionField.j
|
|
|
91
91
|
import { ExpandingTextField } from "./inputs/reactHookForm/text/ExpandingTextField.js";
|
|
92
92
|
import { TextInput } from "./inputs/reactHookForm/text/TextInput.js";
|
|
93
93
|
import { UniqueNameInput } from "./inputs/reactHookForm/text/UniqueNameInput.js";
|
|
94
|
+
import { DescriptionInput } from "./inputs/reactHookForm/text/DescriptionInput.js";
|
|
94
95
|
import { CancelButton } from "./inputs/reactHookForm/utils/CancelButton.js";
|
|
95
96
|
import { FieldLabel } from "./inputs/reactHookForm/utils/FieldLabel.js";
|
|
96
97
|
import { SubmitButton } from "./inputs/reactHookForm/utils/SubmitButton.js";
|
|
@@ -135,7 +136,7 @@ import { ArrowsOutputIcon } from "./icons/ArrowsOutputIcon.js";
|
|
|
135
136
|
import { LeftPanelCloseIcon } from "./icons/LeftPanelCloseIcon.js";
|
|
136
137
|
import { EditNoteIcon } from "./icons/EditNoteIcon.js";
|
|
137
138
|
import { ComputingType, formatComputingTypeLabel, isValidComputingType } from "./parameters/common/computing-type.js";
|
|
138
|
-
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 "./parameters/common/
|
|
139
|
+
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 "./parameters/common/constants.js";
|
|
139
140
|
import { LineSeparator } from "./parameters/common/line-separator.js";
|
|
140
141
|
import { LabelledButton, SwitchWithLabel, TabPanel } from "./parameters/common/parameters.js";
|
|
141
142
|
import { CreateParameterDialog } from "./parameters/common/parameters-creation-dialog.js";
|
|
@@ -148,8 +149,7 @@ import { ParameterSwitch } from "./parameters/common/widget/parameter-switch.js"
|
|
|
148
149
|
import { CustomVoltageLevelTable } from "./parameters/common/voltage-level-table/custom-voltage-level-table.js";
|
|
149
150
|
import { CustomVoltageLevelTableCell } from "./parameters/common/voltage-level-table/custom-voltage-level-table-cell.js";
|
|
150
151
|
import { CustomVoltageLevelTableRow } from "./parameters/common/voltage-level-table/custom-voltage-level-table-row.js";
|
|
151
|
-
import { COLUMNS_DEFINITIONS_LIMIT_REDUCTIONS, IST_FORM, LIMIT_DURATION_FORM, LIMIT_REDUCTIONS_FORM, TAB_INFO, TabValues, VOLTAGE_LEVELS_FORM, getLimitReductionsFormSchema,
|
|
152
|
-
import { toFormValueSaParameters, toFormValuesLimitReductions } from "./parameters/common/limitreductions/limit-reductions-form-util.js";
|
|
152
|
+
import { COLUMNS_DEFINITIONS_LIMIT_REDUCTIONS, IST_FORM, LIMIT_DURATION_FORM, LIMIT_REDUCTIONS_FORM, TAB_INFO, TabValues, VOLTAGE_LEVELS_FORM, getLimitReductionsFormSchema, toFormValuesLimitReductions } from "./parameters/common/limitreductions/columns-definitions.js";
|
|
153
153
|
import { LimitReductionsTableForm } from "./parameters/common/limitreductions/limit-reductions-table-form.js";
|
|
154
154
|
import { LimitReductionTableRow } from "./parameters/common/limitreductions/limit-reduction-table-row.js";
|
|
155
155
|
import { LimitReductionTableCell } from "./parameters/common/limitreductions/limit-reduction-table-cell.js";
|
|
@@ -174,7 +174,6 @@ import { SecurityAnalysisParametersDialog } from "./parameters/security-analysis
|
|
|
174
174
|
import { SensitivityAnalysisParametersInline } from "./parameters/sensi/sensitivity-analysis-parameters-inline.js";
|
|
175
175
|
import { SensitivityAnalysisParametersDialog } from "./parameters/sensi/sensitivity-analysis-parameters-dialog.js";
|
|
176
176
|
import { COLUMNS_DEFINITIONS_HVDCS, COLUMNS_DEFINITIONS_INJECTIONS, COLUMNS_DEFINITIONS_INJECTIONS_SET, COLUMNS_DEFINITIONS_NODES, COLUMNS_DEFINITIONS_PSTS, EQUIPMENTS_IN_VOLTAGE_REGULATION_TYPES, HVDC_EQUIPMENT_TYPES, INJECTIONS_EQUIPMENT_TYPES, INJECTION_DISTRIBUTION_TYPES, MONITORED_BRANCHES_EQUIPMENT_TYPES, MONITORED_VOLTAGE_LEVELS_EQUIPMENT_TYPES, PSTS_EQUIPMENT_TYPES, SENSITIVITY_TYPES, SensiBranchesTabValues, SensiHvdcs, SensiInjection, SensiInjectionsSet, SensiNodes, SensiPsts, SensiTabValues } from "./parameters/sensi/columns-definitions.js";
|
|
177
|
-
import { SensitivityTable } from "./parameters/sensi/sensitivity-table.js";
|
|
178
177
|
import { CustomMenuItem, CustomNestedMenuItem } from "./menus/custom-nested-menu.js";
|
|
179
178
|
import { OverflowableTableCell } from "./muiTable/OverflowableTableCell.js";
|
|
180
179
|
import { OverflowableTableCellWithCheckbox } from "./muiTable/OverflowableTableCellWithCheckbox.js";
|
|
@@ -212,6 +211,9 @@ export {
|
|
|
212
211
|
COMMON_PARAMETERS,
|
|
213
212
|
COMPONENT_LIBRARY,
|
|
214
213
|
CONNECTED_MODE,
|
|
214
|
+
CONTINGENCIES,
|
|
215
|
+
CONTINGENCY_LISTS,
|
|
216
|
+
CONTINGENCY_LISTS_INFOS,
|
|
215
217
|
CONTINGENCY_LIST_EQUIPMENTS,
|
|
216
218
|
CONVERTERS_MODE_OPTIONS,
|
|
217
219
|
COUNTRIES_TO_BALANCE,
|
|
@@ -258,6 +260,7 @@ export {
|
|
|
258
260
|
DataType,
|
|
259
261
|
DefaultCellRenderer,
|
|
260
262
|
DescriptionField,
|
|
263
|
+
DescriptionInput,
|
|
261
264
|
DescriptionModificationDialog,
|
|
262
265
|
DevModeBanner,
|
|
263
266
|
DirectoryItemSelector,
|
|
@@ -457,7 +460,6 @@ export {
|
|
|
457
460
|
SensiTabValues,
|
|
458
461
|
SensitivityAnalysisParametersDialog,
|
|
459
462
|
SensitivityAnalysisParametersInline,
|
|
460
|
-
SensitivityTable,
|
|
461
463
|
SeparatorCellRenderer,
|
|
462
464
|
ShortCircuitParametersEditionDialog,
|
|
463
465
|
ShortCircuitParametersInLine,
|
|
@@ -532,7 +534,6 @@ export {
|
|
|
532
534
|
getPropertiesFromModification,
|
|
533
535
|
getPropertyValue,
|
|
534
536
|
getRangeInputSchema,
|
|
535
|
-
getSAParametersFromSchema,
|
|
536
537
|
gridItem,
|
|
537
538
|
handleSigninCallback,
|
|
538
539
|
handleSilentRenewCallback,
|
|
@@ -567,7 +568,6 @@ export {
|
|
|
567
568
|
substationCreationFormToDto,
|
|
568
569
|
testQuery,
|
|
569
570
|
toFloatOrNullValue,
|
|
570
|
-
toFormValueSaParameters,
|
|
571
571
|
toFormValuesLimitReductions,
|
|
572
572
|
toModificationProperties,
|
|
573
573
|
unscrollableDialogStyles,
|
|
@@ -34,6 +34,7 @@ import { DescriptionField } from "./reactHookForm/text/DescriptionField.js";
|
|
|
34
34
|
import { ExpandingTextField } from "./reactHookForm/text/ExpandingTextField.js";
|
|
35
35
|
import { TextInput } from "./reactHookForm/text/TextInput.js";
|
|
36
36
|
import { UniqueNameInput } from "./reactHookForm/text/UniqueNameInput.js";
|
|
37
|
+
import { DescriptionInput } from "./reactHookForm/text/DescriptionInput.js";
|
|
37
38
|
import { CancelButton } from "./reactHookForm/utils/CancelButton.js";
|
|
38
39
|
import { FieldLabel } from "./reactHookForm/utils/FieldLabel.js";
|
|
39
40
|
import { SubmitButton } from "./reactHookForm/utils/SubmitButton.js";
|
|
@@ -82,6 +83,7 @@ export {
|
|
|
82
83
|
DEFAULT_RANGE_VALUE,
|
|
83
84
|
DESCRIPTION,
|
|
84
85
|
DescriptionField,
|
|
86
|
+
DescriptionInput,
|
|
85
87
|
DirectoryItemsInput,
|
|
86
88
|
ElementValueEditor,
|
|
87
89
|
ErrorInput,
|
|
@@ -33,6 +33,7 @@ import { DescriptionField } from "./text/DescriptionField.js";
|
|
|
33
33
|
import { ExpandingTextField } from "./text/ExpandingTextField.js";
|
|
34
34
|
import { TextInput } from "./text/TextInput.js";
|
|
35
35
|
import { UniqueNameInput } from "./text/UniqueNameInput.js";
|
|
36
|
+
import { DescriptionInput } from "./text/DescriptionInput.js";
|
|
36
37
|
import { CancelButton } from "./utils/CancelButton.js";
|
|
37
38
|
import { FieldLabel } from "./utils/FieldLabel.js";
|
|
38
39
|
import { SubmitButton } from "./utils/SubmitButton.js";
|
|
@@ -58,6 +59,7 @@ export {
|
|
|
58
59
|
DEFAULT_RANGE_VALUE,
|
|
59
60
|
DESCRIPTION,
|
|
60
61
|
DescriptionField,
|
|
62
|
+
DescriptionInput,
|
|
61
63
|
DirectoryItemsInput,
|
|
62
64
|
ErrorInput,
|
|
63
65
|
ExpandableInput,
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Tooltip, IconButton } from "@mui/material";
|
|
3
|
+
import { useController } from "react-hook-form";
|
|
4
|
+
import { useState, useCallback } from "react";
|
|
5
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
6
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
7
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
8
|
+
import { EditNoteIcon } from "../../../icons/EditNoteIcon.js";
|
|
9
|
+
import "../provider/CustomFormProvider.js";
|
|
10
|
+
import { useCustomFormContext } from "../provider/useCustomFormContext.js";
|
|
11
|
+
import { DescriptionModificationDialog } from "../../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
12
|
+
const styles = {
|
|
13
|
+
descriptionTooltip: {
|
|
14
|
+
display: "inline-block",
|
|
15
|
+
whiteSpace: "pre",
|
|
16
|
+
textOverflow: "ellipsis",
|
|
17
|
+
overflow: "hidden",
|
|
18
|
+
maxWidth: "250px",
|
|
19
|
+
maxHeight: "50px",
|
|
20
|
+
cursor: "pointer"
|
|
21
|
+
},
|
|
22
|
+
coloredButton: (theme) => ({
|
|
23
|
+
color: theme.palette.text.primary
|
|
24
|
+
})
|
|
25
|
+
};
|
|
26
|
+
function DescriptionInput({ name }) {
|
|
27
|
+
const {
|
|
28
|
+
field: { value }
|
|
29
|
+
} = useController({ name });
|
|
30
|
+
const formContext = useCustomFormContext();
|
|
31
|
+
const [openDescModificationDialog, setOpenDescModificationDialog] = useState(false);
|
|
32
|
+
const updateModification = useCallback(
|
|
33
|
+
(descriptionRecord) => {
|
|
34
|
+
const newDescription = descriptionRecord?.description ?? "";
|
|
35
|
+
formContext.setValue(name, newDescription, {
|
|
36
|
+
shouldValidate: true,
|
|
37
|
+
shouldDirty: true
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
[formContext, name]
|
|
41
|
+
);
|
|
42
|
+
const handleDescDialogClose = useCallback(() => {
|
|
43
|
+
setOpenDescModificationDialog(false);
|
|
44
|
+
}, [setOpenDescModificationDialog]);
|
|
45
|
+
const handleModifyDescription = useCallback(() => {
|
|
46
|
+
setOpenDescModificationDialog(true);
|
|
47
|
+
}, [setOpenDescModificationDialog]);
|
|
48
|
+
const descriptionLines = value?.split("\n");
|
|
49
|
+
if (descriptionLines?.length > 3) {
|
|
50
|
+
descriptionLines[2] = "...";
|
|
51
|
+
}
|
|
52
|
+
const tooltipBox = value ? /* @__PURE__ */ jsxs(Box, { sx: styles.descriptionTooltip, children: [
|
|
53
|
+
" ",
|
|
54
|
+
descriptionLines?.join("\n"),
|
|
55
|
+
" "
|
|
56
|
+
] }) : void 0;
|
|
57
|
+
const icon = /* @__PURE__ */ jsx(Tooltip, { title: tooltipBox, arrow: true, placement: "right", children: /* @__PURE__ */ jsx(IconButton, { onClick: handleModifyDescription, sx: styles.coloredButton, children: /* @__PURE__ */ jsx(EditNoteIcon, { empty: !value }) }) });
|
|
58
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
59
|
+
openDescModificationDialog && /* @__PURE__ */ jsx(
|
|
60
|
+
DescriptionModificationDialog,
|
|
61
|
+
{
|
|
62
|
+
open: true,
|
|
63
|
+
description: value ?? "",
|
|
64
|
+
onClose: handleDescDialogClose,
|
|
65
|
+
updateForm: updateModification
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
/* @__PURE__ */ jsx(
|
|
69
|
+
Box,
|
|
70
|
+
{
|
|
71
|
+
sx: {
|
|
72
|
+
display: "flex",
|
|
73
|
+
justifyContent: "center",
|
|
74
|
+
alignItems: "center",
|
|
75
|
+
verticalAlign: "middle",
|
|
76
|
+
cursor: void 0
|
|
77
|
+
},
|
|
78
|
+
children: icon
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
] });
|
|
82
|
+
}
|
|
83
|
+
export {
|
|
84
|
+
DescriptionInput
|
|
85
|
+
};
|
|
@@ -2,8 +2,10 @@ import { DescriptionField } from "./DescriptionField.js";
|
|
|
2
2
|
import { ExpandingTextField } from "./ExpandingTextField.js";
|
|
3
3
|
import { TextInput } from "./TextInput.js";
|
|
4
4
|
import { UniqueNameInput } from "./UniqueNameInput.js";
|
|
5
|
+
import { DescriptionInput } from "./DescriptionInput.js";
|
|
5
6
|
export {
|
|
6
7
|
DescriptionField,
|
|
8
|
+
DescriptionInput,
|
|
7
9
|
ExpandingTextField,
|
|
8
10
|
TextInput,
|
|
9
11
|
UniqueNameInput
|
|
@@ -25,6 +25,11 @@ import "ag-grid-community";
|
|
|
25
25
|
import "react-papaparse";
|
|
26
26
|
import "react-csv-downloader";
|
|
27
27
|
import "../../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
28
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
29
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
30
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
31
|
+
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
32
|
+
import "../../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
28
33
|
import { ExpandableInput } from "../../../inputs/reactHookForm/expandableInput/ExpandableInput.js";
|
|
29
34
|
import "@react-querybuilder/material";
|
|
30
35
|
import "../../../filter/expert/expertFilterConstants.js";
|
|
@@ -25,6 +25,11 @@ import "react-csv-downloader";
|
|
|
25
25
|
import { AutocompleteInput } from "../../../inputs/reactHookForm/autocompleteInputs/AutocompleteInput.js";
|
|
26
26
|
import { TextInput } from "../../../inputs/reactHookForm/text/TextInput.js";
|
|
27
27
|
import "../../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
28
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
29
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
30
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
31
|
+
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
32
|
+
import "../../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
28
33
|
import "@react-querybuilder/material";
|
|
29
34
|
import "../../../filter/expert/expertFilterConstants.js";
|
|
30
35
|
import "../../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
@@ -24,6 +24,11 @@ import "react-papaparse";
|
|
|
24
24
|
import "react-csv-downloader";
|
|
25
25
|
import { TextInput } from "../../../inputs/reactHookForm/text/TextInput.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 { CountrySelectionInput } from "../../../inputs/reactHookForm/CountrySelectionInput.js";
|
|
28
33
|
import "@react-querybuilder/material";
|
|
29
34
|
import "../../../filter/expert/expertFilterConstants.js";
|
|
@@ -24,13 +24,18 @@ import "react-papaparse";
|
|
|
24
24
|
import "react-csv-downloader";
|
|
25
25
|
import "../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
26
26
|
import { MuiSelectInput } from "../../inputs/reactHookForm/selectInputs/MuiSelectInput.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";
|
|
30
35
|
import "uuid";
|
|
31
36
|
import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
32
37
|
import "react-querybuilder";
|
|
33
|
-
import { PROVIDER } from "./
|
|
38
|
+
import { PROVIDER } from "./constants.js";
|
|
34
39
|
const styles = {
|
|
35
40
|
providerParam: {
|
|
36
41
|
height: "fit-content",
|
|
@@ -9,3 +9,6 @@ export declare const PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD = "highVoltageAbso
|
|
|
9
9
|
export declare const VERSION_PARAMETER = "version";
|
|
10
10
|
export declare const COMMON_PARAMETERS = "commonParameters";
|
|
11
11
|
export declare const SPECIFIC_PARAMETERS = "specificParametersPerProvider";
|
|
12
|
+
export declare const CONTINGENCY_LISTS_INFOS = "contingencyListsInfos";
|
|
13
|
+
export declare const CONTINGENCY_LISTS = "contingencyLists";
|
|
14
|
+
export declare const CONTINGENCIES = "contingencies";
|
|
@@ -9,8 +9,14 @@ const PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD = "highVoltageAbsoluteThreshold";
|
|
|
9
9
|
const VERSION_PARAMETER = "version";
|
|
10
10
|
const COMMON_PARAMETERS = "commonParameters";
|
|
11
11
|
const SPECIFIC_PARAMETERS = "specificParametersPerProvider";
|
|
12
|
+
const CONTINGENCY_LISTS_INFOS = "contingencyListsInfos";
|
|
13
|
+
const CONTINGENCY_LISTS = "contingencyLists";
|
|
14
|
+
const CONTINGENCIES = "contingencies";
|
|
12
15
|
export {
|
|
13
16
|
COMMON_PARAMETERS,
|
|
17
|
+
CONTINGENCIES,
|
|
18
|
+
CONTINGENCY_LISTS,
|
|
19
|
+
CONTINGENCY_LISTS_INFOS,
|
|
14
20
|
PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD,
|
|
15
21
|
PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD,
|
|
16
22
|
PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Parameters, ColumnsDef } from '../parameter-table';
|
|
2
|
+
import { default as yup } from '../../../../utils/yupConfig';
|
|
3
|
+
import { ContingencyListsInfos } from './types';
|
|
4
|
+
export declare const COLUMNS_DEFINITIONS_CONTINGENCY_LISTS_INFOS: ColumnsDef[];
|
|
5
|
+
export declare const ParamContingencyLists: Parameters;
|
|
6
|
+
export declare const getContingencyListsInfosFormSchema: () => yup.ObjectSchema<{
|
|
7
|
+
contingencyListsInfos: {
|
|
8
|
+
description?: string | undefined;
|
|
9
|
+
contingencyLists: {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
}[];
|
|
13
|
+
activated: NonNullable<boolean | undefined>;
|
|
14
|
+
}[] | undefined;
|
|
15
|
+
}, yup.AnyObject, {
|
|
16
|
+
contingencyListsInfos: "";
|
|
17
|
+
}, "">;
|
|
18
|
+
export declare const toFormValuesContingencyListsInfos: (contingencyListsInfos: ContingencyListsInfos[]) => {
|
|
19
|
+
contingencyListsInfos: {
|
|
20
|
+
contingencyLists: {
|
|
21
|
+
name: string;
|
|
22
|
+
id: `${string}-${string}-${string}-${string}-${string}`;
|
|
23
|
+
}[];
|
|
24
|
+
description: string;
|
|
25
|
+
activated: boolean;
|
|
26
|
+
}[];
|
|
27
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { DESCRIPTION, ACTIVATED, ID, NAME } from "../parameter-table/constants.js";
|
|
2
|
+
import "react/jsx-runtime";
|
|
3
|
+
import "@mui/material";
|
|
4
|
+
import "@mui/icons-material";
|
|
5
|
+
import "react";
|
|
6
|
+
import "react-intl";
|
|
7
|
+
import "react-hook-form";
|
|
8
|
+
import "../../../overflowableText/OverflowableText.js";
|
|
9
|
+
import "../../../../utils/conversionUtils.js";
|
|
10
|
+
import { ElementType } from "../../../../utils/types/elementType.js";
|
|
11
|
+
import "../../../../utils/types/equipmentType.js";
|
|
12
|
+
import "../../../../utils/yupConfig.js";
|
|
13
|
+
import "localized-countries";
|
|
14
|
+
import "localized-countries/data/fr";
|
|
15
|
+
import "localized-countries/data/en";
|
|
16
|
+
import "notistack";
|
|
17
|
+
import "../../../inputs/reactHookForm/provider/CustomFormProvider.js";
|
|
18
|
+
import * as yup from "yup";
|
|
19
|
+
import "../../../treeViewFinder/TreeViewFinder.js";
|
|
20
|
+
import "../../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
21
|
+
import "../../../customAGGrid/customAggrid.js";
|
|
22
|
+
import "ag-grid-community";
|
|
23
|
+
import "react-papaparse";
|
|
24
|
+
import "react-csv-downloader";
|
|
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";
|
|
31
|
+
import "@react-querybuilder/material";
|
|
32
|
+
import "../../../filter/expert/expertFilterConstants.js";
|
|
33
|
+
import "../../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
34
|
+
import "uuid";
|
|
35
|
+
import "../../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
36
|
+
import "react-querybuilder";
|
|
37
|
+
import { CONTINGENCY_LISTS, CONTINGENCY_LISTS_INFOS } from "../constants.js";
|
|
38
|
+
const COLUMNS_DEFINITIONS_CONTINGENCY_LISTS_INFOS = [
|
|
39
|
+
{
|
|
40
|
+
label: "ContingencyLists",
|
|
41
|
+
dataKey: CONTINGENCY_LISTS,
|
|
42
|
+
initialValue: [],
|
|
43
|
+
editable: true,
|
|
44
|
+
directoryItems: true,
|
|
45
|
+
elementType: ElementType.CONTINGENCY_LIST,
|
|
46
|
+
titleId: "ContingencyListsSelection"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
label: "description",
|
|
50
|
+
dataKey: DESCRIPTION,
|
|
51
|
+
initialValue: "",
|
|
52
|
+
editable: true,
|
|
53
|
+
descriptionItems: true,
|
|
54
|
+
width: "8rem"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: "Active",
|
|
58
|
+
dataKey: ACTIVATED,
|
|
59
|
+
initialValue: true,
|
|
60
|
+
checkboxItems: true,
|
|
61
|
+
editable: true,
|
|
62
|
+
width: "4rem"
|
|
63
|
+
}
|
|
64
|
+
];
|
|
65
|
+
const ParamContingencyLists = {
|
|
66
|
+
columnsDef: COLUMNS_DEFINITIONS_CONTINGENCY_LISTS_INFOS,
|
|
67
|
+
name: CONTINGENCY_LISTS_INFOS
|
|
68
|
+
};
|
|
69
|
+
const getContingencyListsInfosFormSchema = () => {
|
|
70
|
+
return yup.object().shape({
|
|
71
|
+
[CONTINGENCY_LISTS_INFOS]: yup.array().of(
|
|
72
|
+
yup.object().shape({
|
|
73
|
+
[CONTINGENCY_LISTS]: yup.array().of(
|
|
74
|
+
yup.object().shape({
|
|
75
|
+
[ID]: yup.string().required(),
|
|
76
|
+
[NAME]: yup.string().required()
|
|
77
|
+
})
|
|
78
|
+
).required().min(1, "FieldIsRequired"),
|
|
79
|
+
[DESCRIPTION]: yup.string(),
|
|
80
|
+
[ACTIVATED]: yup.boolean().required()
|
|
81
|
+
})
|
|
82
|
+
)
|
|
83
|
+
}).required();
|
|
84
|
+
};
|
|
85
|
+
const toFormValuesContingencyListsInfos = (contingencyListsInfos) => {
|
|
86
|
+
return {
|
|
87
|
+
[CONTINGENCY_LISTS_INFOS]: contingencyListsInfos?.map((contingencyListInfos) => ({
|
|
88
|
+
[CONTINGENCY_LISTS]: contingencyListInfos[CONTINGENCY_LISTS]?.map((c) => ({
|
|
89
|
+
[NAME]: c[NAME],
|
|
90
|
+
[ID]: c[ID]
|
|
91
|
+
})),
|
|
92
|
+
[DESCRIPTION]: contingencyListInfos[DESCRIPTION],
|
|
93
|
+
[ACTIVATED]: contingencyListInfos[ACTIVATED]
|
|
94
|
+
}))
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
export {
|
|
98
|
+
COLUMNS_DEFINITIONS_CONTINGENCY_LISTS_INFOS,
|
|
99
|
+
ParamContingencyLists,
|
|
100
|
+
getContingencyListsInfosFormSchema,
|
|
101
|
+
toFormValuesContingencyListsInfos
|
|
102
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UUID } from 'node:crypto';
|
|
2
|
+
export declare function ContingencyTable({ showContingencyCount, fetchContingencyCount, }: Readonly<{
|
|
3
|
+
showContingencyCount: boolean;
|
|
4
|
+
fetchContingencyCount?: (contingencyLists: UUID[] | null) => Promise<number>;
|
|
5
|
+
}>): import("react/jsx-runtime").JSX.Element;
|