@gridsuite/commons-ui 0.224.0 → 0.226.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/composite/dnd-table/dnd-table.d.ts +8 -4
- package/dist/components/composite/dnd-table/dnd-table.js +100 -160
- package/dist/components/composite/dnd-table/dnd-table.type.d.ts +17 -3
- package/dist/components/composite/dnd-table/dnd-table.type.js +2 -0
- package/dist/components/composite/dnd-table/index.d.ts +6 -1
- package/dist/components/composite/dnd-table/index.js +6 -6
- package/dist/components/composite/index.js +6 -6
- package/dist/components/index.js +6 -6
- package/dist/features/index.js +16 -0
- package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/reactiveCapability.utils.d.ts +4 -3
- package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/reactiveCapability.utils.js +7 -30
- package/dist/features/network-modifications/common/reactiveLimits/reactiveLimits.utils.d.ts +2 -0
- package/dist/features/network-modifications/generator/generatorDialog.type.d.ts +0 -60
- package/dist/features/network-modifications/generator/index.js +17 -1
- package/dist/features/network-modifications/generator/modification/GeneratorDialogHeader.d.ts +6 -0
- package/dist/features/network-modifications/generator/modification/GeneratorDialogHeader.js +109 -0
- package/dist/features/network-modifications/generator/modification/GeneratorDialogTabs.d.ts +13 -0
- package/dist/features/network-modifications/generator/modification/GeneratorDialogTabs.js +55 -0
- package/dist/features/network-modifications/generator/modification/GeneratorDialogTabsContent.d.ts +12 -0
- package/dist/features/network-modifications/generator/modification/GeneratorDialogTabsContent.js +277 -0
- package/dist/features/network-modifications/generator/modification/GeneratorModificationForm.d.ts +10 -0
- package/dist/features/network-modifications/generator/modification/GeneratorModificationForm.js +52 -0
- package/dist/features/network-modifications/generator/modification/generatorModification.types.d.ts +3 -5
- package/dist/features/network-modifications/generator/modification/generatorModification.utils.d.ts +140 -0
- package/dist/features/network-modifications/generator/modification/generatorModification.utils.js +211 -0
- package/dist/features/network-modifications/generator/modification/generatorTabs.utils.d.ts +8 -0
- package/dist/features/network-modifications/generator/modification/generatorTabs.utils.js +56 -0
- package/dist/features/network-modifications/generator/modification/index.d.ts +6 -0
- package/dist/features/network-modifications/generator/modification/index.js +18 -1
- package/dist/features/network-modifications/index.js +16 -0
- package/dist/features/parameters/common/contingency-table/columns-definitions.d.ts +1 -1
- package/dist/features/parameters/common/contingency-table/columns-definitions.js +1 -1
- package/dist/features/parameters/common/parameter-table-field/parameter-table-field.js +2 -2
- package/dist/features/parameters/dynamic-margin-calculation/dynamic-margin-calculation-inline.js +1 -1
- package/dist/features/parameters/dynamic-margin-calculation/loads-variations-parameters.js +1 -1
- package/dist/features/parameters/dynamic-security-analysis/dynamic-security-analysis-inline.js +1 -1
- package/dist/features/parameters/dynamic-simulation/dynamic-simulation-inline.js +1 -1
- package/dist/features/parameters/loadflow/load-flow-parameters-inline.js +1 -1
- package/dist/features/parameters/network-visualizations/network-visualizations-parameters-inline.js +1 -1
- package/dist/features/parameters/pcc-min/pcc-min-parameters-inline.js +1 -1
- package/dist/features/parameters/security-analysis/security-analysis-parameters-inline.js +1 -1
- package/dist/features/parameters/sensi/columns-definitions.js +1 -1
- package/dist/features/parameters/sensi/sensitivity-analysis-parameters-inline.js +1 -1
- package/dist/features/parameters/short-circuit/short-circuit-parameters-inline.js +1 -1
- package/dist/features/parameters/voltage-init/use-voltage-init-parameters-form.js +1 -1
- package/dist/features/parameters/voltage-init/voltage-init-form-utils.js +1 -1
- package/dist/features/parameters/voltage-init/voltage-init-parameters-inline.js +1 -1
- package/dist/features/parameters/voltage-init/voltage-limits-parameters.js +1 -1
- package/dist/index.js +22 -6
- package/dist/services/security-analysis.js +2 -3
- package/dist/translations/en/networkModificationsEn.d.ts +2 -0
- package/dist/translations/en/networkModificationsEn.js +2 -0
- package/dist/translations/fr/networkModificationsFr.d.ts +2 -0
- package/dist/translations/fr/networkModificationsFr.js +2 -0
- package/package.json +1 -1
- package/dist/components/composite/dnd-table-v2/dnd-table-add-rows-dialog.d.ts +0 -13
- package/dist/components/composite/dnd-table-v2/dnd-table-add-rows-dialog.js +0 -69
- package/dist/components/composite/dnd-table-v2/dnd-table-bottom-left-buttons.d.ts +0 -17
- package/dist/components/composite/dnd-table-v2/dnd-table-bottom-left-buttons.js +0 -47
- package/dist/components/composite/dnd-table-v2/dnd-table-bottom-right-buttons.d.ts +0 -17
- package/dist/components/composite/dnd-table-v2/dnd-table-bottom-right-buttons.js +0 -100
- package/dist/components/composite/dnd-table-v2/dnd-table.d.ts +0 -32
- package/dist/components/composite/dnd-table-v2/dnd-table.js +0 -375
- package/dist/components/composite/dnd-table-v2/dnd-table.type.d.ts +0 -70
- package/dist/components/composite/dnd-table-v2/dnd-table.type.js +0 -19
- package/dist/components/composite/dnd-table-v2/index.d.ts +0 -12
- package/dist/components/composite/dnd-table-v2/index.js +0 -16
- package/dist/features/parameters/common/parameter-table/constants.d.ts +0 -11
- package/dist/features/parameters/common/parameter-table/constants.js +0 -12
- package/dist/features/parameters/common/parameter-table/parameter-table.d.ts +0 -15
- package/dist/features/parameters/common/parameter-table/parameter-table.js +0 -98
- package/dist/features/parameters/common/parameter-table/table-cell.d.ts +0 -8
- package/dist/features/parameters/common/parameter-table/table-cell.js +0 -83
- package/dist/features/parameters/common/parameter-table/table-row.d.ts +0 -11
- package/dist/features/parameters/common/parameter-table/table-row.js +0 -41
- package/dist/features/parameters/common/parameter-table/types.d.ts +0 -26
- package/dist/features/parameters/common/parameter-table/types.js +0 -1
- /package/dist/components/composite/{dnd-table-v2 → dnd-table}/deletable-table-row.d.ts +0 -0
- /package/dist/components/composite/{dnd-table-v2 → dnd-table}/deletable-table-row.js +0 -0
- /package/dist/components/composite/{dnd-table-v2 → dnd-table}/dnd-table-row.d.ts +0 -0
- /package/dist/components/composite/{dnd-table-v2 → dnd-table}/dnd-table-row.js +0 -0
- /package/dist/components/composite/{dnd-table-v2 → dnd-table}/dnd-table-utils.d.ts +0 -0
- /package/dist/components/composite/{dnd-table-v2 → dnd-table}/dnd-table-utils.js +0 -0
|
@@ -79,7 +79,7 @@ function PccMinParametersInLine({
|
|
|
79
79
|
setOpenResetConfirmation(false);
|
|
80
80
|
}, []);
|
|
81
81
|
useEffect(() => {
|
|
82
|
-
setHaveDirtyFields(
|
|
82
|
+
setHaveDirtyFields(formState.isDirty);
|
|
83
83
|
}, [formState, setHaveDirtyFields]);
|
|
84
84
|
const handleLoadParameters = useCallback(
|
|
85
85
|
(newParams) => {
|
|
@@ -95,7 +95,7 @@ function SecurityAnalysisParametersInline({
|
|
|
95
95
|
[reset, snackError]
|
|
96
96
|
);
|
|
97
97
|
useEffect(() => {
|
|
98
|
-
setHaveDirtyFields(
|
|
98
|
+
setHaveDirtyFields(formState.isDirty);
|
|
99
99
|
}, [formState, setHaveDirtyFields]);
|
|
100
100
|
return /* @__PURE__ */ jsx(
|
|
101
101
|
SecurityAnalysisParametersForm,
|
|
@@ -38,7 +38,7 @@ import "@hookform/resolvers/yup";
|
|
|
38
38
|
import "../../../components/composite/filter/HeaderFilterForm.js";
|
|
39
39
|
import { ACTIVATED } from "../common/parameter-table-field/constants.js";
|
|
40
40
|
import "react-dom";
|
|
41
|
-
import { DndColumnType } from "../../../components/composite/dnd-table
|
|
41
|
+
import { DndColumnType } from "../../../components/composite/dnd-table/dnd-table.type.js";
|
|
42
42
|
const MONITORED_BRANCHES_EQUIPMENT_TYPES = [EquipmentType.LINE, EquipmentType.TWO_WINDINGS_TRANSFORMER];
|
|
43
43
|
const INJECTION_DISTRIBUTION_TYPES = [
|
|
44
44
|
{ id: "PROPORTIONAL", label: "Proportional" },
|
|
@@ -108,7 +108,7 @@ function SensitivityAnalysisParametersInline({
|
|
|
108
108
|
setOpenResetConfirmation(false);
|
|
109
109
|
}, []);
|
|
110
110
|
useEffect(() => {
|
|
111
|
-
setHaveDirtyFields(
|
|
111
|
+
setHaveDirtyFields(formState.isDirty);
|
|
112
112
|
}, [formState, setHaveDirtyFields]);
|
|
113
113
|
return /* @__PURE__ */ jsx(
|
|
114
114
|
SensitivityAnalysisParametersForm,
|
|
@@ -96,7 +96,7 @@ function ShortCircuitParametersInLine({
|
|
|
96
96
|
setPendingResetAction(null);
|
|
97
97
|
}, []);
|
|
98
98
|
useEffect(() => {
|
|
99
|
-
setHaveDirtyFields(
|
|
99
|
+
setHaveDirtyFields(formState.isDirty);
|
|
100
100
|
}, [formState, setHaveDirtyFields]);
|
|
101
101
|
return /* @__PURE__ */ jsx(
|
|
102
102
|
ShortCircuitParametersForm,
|
|
@@ -41,7 +41,7 @@ import "../../../components/composite/filter/HeaderFilterForm.js";
|
|
|
41
41
|
import { getNameElementEditorSchema, getNameElementEditorEmptyFormData } from "../common/name-element-editor/name-element-editor-utils.js";
|
|
42
42
|
import { fromVoltageInitParametersFormToParamValues, fromVoltageInitParamsDataToFormValues, fromStudyVoltageInitParamsDataToFormValues } from "./voltage-init-form-utils.js";
|
|
43
43
|
import "react-dom";
|
|
44
|
-
import { SELECTED } from "../../../components/composite/dnd-table
|
|
44
|
+
import { SELECTED } from "../../../components/composite/dnd-table/dnd-table.type.js";
|
|
45
45
|
const useVoltageInitParametersForm = ({
|
|
46
46
|
parametersUuid,
|
|
47
47
|
name,
|
|
@@ -32,7 +32,7 @@ import "../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
|
32
32
|
import "mui-nested-menu";
|
|
33
33
|
import "react-resizable-panels";
|
|
34
34
|
import "react-dom";
|
|
35
|
-
import { SELECTED } from "../../../components/composite/dnd-table
|
|
35
|
+
import { SELECTED } from "../../../components/composite/dnd-table/dnd-table.type.js";
|
|
36
36
|
const fromVoltageInitParametersFormToParamValues = (newParams) => {
|
|
37
37
|
return {
|
|
38
38
|
applyModifications: newParams?.[VoltageInitTabValues.GENERAL]?.[GENERAL_APPLY_MODIFICATIONS] ?? DEFAULT_GENERAL_APPLY_MODIFICATIONS,
|
|
@@ -98,7 +98,7 @@ function VoltageInitParametersInLine({
|
|
|
98
98
|
setOpenResetConfirmation(false);
|
|
99
99
|
}, []);
|
|
100
100
|
useEffect(() => {
|
|
101
|
-
setHaveDirtyFields(
|
|
101
|
+
setHaveDirtyFields(formState.isDirty);
|
|
102
102
|
}, [formState, setHaveDirtyFields]);
|
|
103
103
|
const handleOpenSaveDialog = useCallback(() => {
|
|
104
104
|
trigger().then((isValid) => {
|
|
@@ -13,7 +13,7 @@ import { EquipmentType } from "../../../utils/types/equipmentType.js";
|
|
|
13
13
|
import "react-dom";
|
|
14
14
|
import "react-hook-form";
|
|
15
15
|
import "@hello-pangea/dnd";
|
|
16
|
-
import { DndColumnType, SELECTED } from "../../../components/composite/dnd-table
|
|
16
|
+
import { DndColumnType, SELECTED } from "../../../components/composite/dnd-table/dnd-table.type.js";
|
|
17
17
|
import "../../../components/ui/overflowableText/OverflowableText.js";
|
|
18
18
|
import "localized-countries";
|
|
19
19
|
import "localized-countries/data/fr";
|
package/dist/index.js
CHANGED
|
@@ -72,12 +72,12 @@ import { fetchCsvSeparator, useCsvExport } from "./components/ui/csvDownloader/u
|
|
|
72
72
|
import { TreeViewFinder, generateTreeViewFinderClass } from "./components/ui/treeViewFinder/TreeViewFinder.js";
|
|
73
73
|
import { doesNodeHasChildren } from "./components/ui/treeViewFinder/TreeViewUtils.js";
|
|
74
74
|
import { DirectoryItemSelector } from "./components/ui/directoryItemSelector/DirectoryItemSelector.js";
|
|
75
|
-
import { DndTable } from "./components/composite/dnd-table
|
|
76
|
-
import { DndColumnType, MAX_ROWS_NUMBER, SELECTED } from "./components/composite/dnd-table
|
|
77
|
-
import { getDefaultRowData } from "./components/composite/dnd-table
|
|
78
|
-
import { DndTableAddRowsDialog } from "./components/composite/dnd-table
|
|
79
|
-
import { DndTableBottomLeftButtons } from "./components/composite/dnd-table
|
|
80
|
-
import { DndTableBottomRightButtons } from "./components/composite/dnd-table
|
|
75
|
+
import { DndTable } from "./components/composite/dnd-table/dnd-table.js";
|
|
76
|
+
import { DndColumnType, MAX_ROWS_NUMBER, SELECTED } from "./components/composite/dnd-table/dnd-table.type.js";
|
|
77
|
+
import { getDefaultRowData } from "./components/composite/dnd-table/dnd-table-utils.js";
|
|
78
|
+
import { DndTableAddRowsDialog } from "./components/composite/dnd-table/dnd-table-add-rows-dialog.js";
|
|
79
|
+
import { DndTableBottomLeftButtons } from "./components/composite/dnd-table/dnd-table-bottom-left-buttons.js";
|
|
80
|
+
import { DndTableBottomRightButtons } from "./components/composite/dnd-table/dnd-table-bottom-right-buttons.js";
|
|
81
81
|
import { EquipmentItem } from "./components/composite/elementSearch/elementItem/EquipmentItem.js";
|
|
82
82
|
import { ElementSearchDialog } from "./components/composite/elementSearch/elementSearchDialog/ElementSearchDialog.js";
|
|
83
83
|
import { ElementSearchInput } from "./components/composite/elementSearch/elementSearchInput/ElementSearchInput.js";
|
|
@@ -315,6 +315,12 @@ import { emptyModificationByAssignmentFormData, modificationByAssignmentDtoToFor
|
|
|
315
315
|
import { DataType as DataType2 } from "./features/network-modifications/by-filter/assignment/assignment/assignment.type.js";
|
|
316
316
|
import { generatorCreationDtoToForm, generatorCreationEmptyFormData, generatorCreationFormSchema, generatorCreationFormToDto } from "./features/network-modifications/generator/creation/generatorCreation.utils.js";
|
|
317
317
|
import { GeneratorCreationForm } from "./features/network-modifications/generator/creation/GeneratorCreationForm.js";
|
|
318
|
+
import { generatorModificationDtoToForm, generatorModificationEmptyFormData, generatorModificationFormSchema, generatorModificationFormToDto } from "./features/network-modifications/generator/modification/generatorModification.utils.js";
|
|
319
|
+
import { GENERATOR_TAB_FIELDS, GeneratorDialogTab } from "./features/network-modifications/generator/modification/generatorTabs.utils.js";
|
|
320
|
+
import { GeneratorDialogHeader } from "./features/network-modifications/generator/modification/GeneratorDialogHeader.js";
|
|
321
|
+
import { GeneratorDialogTabs } from "./features/network-modifications/generator/modification/GeneratorDialogTabs.js";
|
|
322
|
+
import { GeneratorDialogTabsContent } from "./features/network-modifications/generator/modification/GeneratorDialogTabsContent.js";
|
|
323
|
+
import { GeneratorModificationForm } from "./features/network-modifications/generator/modification/GeneratorModificationForm.js";
|
|
318
324
|
import { batteryCreationDtoToForm, batteryCreationEmptyFormData, batteryCreationFormSchema, batteryCreationFormToDto } from "./features/network-modifications/battery/creation/batteryCreation.utils.js";
|
|
319
325
|
import { BatteryCreationForm } from "./features/network-modifications/battery/creation/BatteryCreationForm.js";
|
|
320
326
|
import { batteryModificationDtoToForm, batteryModificationEmptyFormData, batteryModificationFormSchema, batteryModificationFormToDto } from "./features/network-modifications/battery/modification/batteryModification.utils.js";
|
|
@@ -635,9 +641,15 @@ export {
|
|
|
635
641
|
GENERAL,
|
|
636
642
|
GENERAL_APPLY_MODIFICATIONS,
|
|
637
643
|
GENERATORS_SELECTION_TYPE,
|
|
644
|
+
GENERATOR_TAB_FIELDS,
|
|
638
645
|
GRIDSUITE_DEFAULT_PRECISION,
|
|
639
646
|
Generator,
|
|
640
647
|
GeneratorCreationForm,
|
|
648
|
+
GeneratorDialogHeader,
|
|
649
|
+
GeneratorDialogTab,
|
|
650
|
+
GeneratorDialogTabs,
|
|
651
|
+
GeneratorDialogTabsContent,
|
|
652
|
+
GeneratorModificationForm,
|
|
641
653
|
GridLogo,
|
|
642
654
|
GroupValueEditor,
|
|
643
655
|
HIGH_VOLTAGE_LIMIT,
|
|
@@ -1131,6 +1143,10 @@ export {
|
|
|
1131
1143
|
generatorCreationEmptyFormData,
|
|
1132
1144
|
generatorCreationFormSchema,
|
|
1133
1145
|
generatorCreationFormToDto,
|
|
1146
|
+
generatorModificationDtoToForm,
|
|
1147
|
+
generatorModificationEmptyFormData,
|
|
1148
|
+
generatorModificationFormSchema,
|
|
1149
|
+
generatorModificationFormToDto,
|
|
1134
1150
|
getActivePowerControlEmptyFormData,
|
|
1135
1151
|
getActivePowerControlSchema,
|
|
1136
1152
|
getActivePowerSetPointSchema,
|
|
@@ -6,7 +6,6 @@ import { mapSecurityAnalysisParameters } from "../utils/types/security-analysis.
|
|
|
6
6
|
import "react/jsx-runtime";
|
|
7
7
|
import "@mui/icons-material";
|
|
8
8
|
import { fetchElementNames } from "./directory.js";
|
|
9
|
-
import { NAME, ID } from "../features/parameters/common/parameter-table/constants.js";
|
|
10
9
|
const PREFIX_SECURITY_ANALYSIS_SERVER_QUERIES = `${"api/gateway"}/security-analysis`;
|
|
11
10
|
const getStudyUrl = (studyUuid) => `${PREFIX_STUDY_QUERIES}/v1/studies/${safeEncodeURIComponent(studyUuid)}`;
|
|
12
11
|
function getSecurityAnalysisUrl() {
|
|
@@ -28,8 +27,8 @@ function enrichSecurityAnalysisParameters(parameters) {
|
|
|
28
27
|
return elementNamesPromise.then((elementNames) => {
|
|
29
28
|
const mapIdsToIdNames = (ids) => {
|
|
30
29
|
return ids ? ids.map((id) => ({
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
id,
|
|
31
|
+
name: elementNames?.[id] ?? void 0
|
|
33
32
|
})) : [];
|
|
34
33
|
};
|
|
35
34
|
return {
|
|
@@ -268,6 +268,8 @@ export declare const networkModificationsEn: {
|
|
|
268
268
|
GenerationDispatch: string;
|
|
269
269
|
generatorMinimumActivePowerMaxValueError: string;
|
|
270
270
|
PlannedActivePowerSetPointMustBeBetweenMinAndMaxActivePower: string;
|
|
271
|
+
ModifyGenerator: string;
|
|
272
|
+
GeneratorModificationError: string;
|
|
271
273
|
NoBusbarSectionFound: string;
|
|
272
274
|
SubstationTab: string;
|
|
273
275
|
ConnectivityTab: string;
|
|
@@ -273,6 +273,8 @@ const networkModificationsEn = {
|
|
|
273
273
|
GenerationDispatch: "Generation dispatch",
|
|
274
274
|
generatorMinimumActivePowerMaxValueError: "Minimum active power must be inferior to maximum active power",
|
|
275
275
|
PlannedActivePowerSetPointMustBeBetweenMinAndMaxActivePower: "Planned active power set point must be between minimum and maximum active power values",
|
|
276
|
+
ModifyGenerator: "Modify generator",
|
|
277
|
+
GeneratorModificationError: "Error while modifying generator",
|
|
276
278
|
NoBusbarSectionFound: "No busbar section found for this voltage level",
|
|
277
279
|
// Tabs
|
|
278
280
|
SubstationTab: "Substation",
|
|
@@ -268,6 +268,8 @@ export declare const networkModificationsFr: {
|
|
|
268
268
|
GenerationDispatch: string;
|
|
269
269
|
generatorMinimumActivePowerMaxValueError: string;
|
|
270
270
|
PlannedActivePowerSetPointMustBeBetweenMinAndMaxActivePower: string;
|
|
271
|
+
ModifyGenerator: string;
|
|
272
|
+
GeneratorModificationError: string;
|
|
271
273
|
NoBusbarSectionFound: string;
|
|
272
274
|
SubstationTab: string;
|
|
273
275
|
ConnectivityTab: string;
|
|
@@ -273,6 +273,8 @@ const networkModificationsFr = {
|
|
|
273
273
|
GenerationDispatch: "Démarrage de groupes",
|
|
274
274
|
generatorMinimumActivePowerMaxValueError: "La puissance active min doit être inférieure à la puissance active max",
|
|
275
275
|
PlannedActivePowerSetPointMustBeBetweenMinAndMaxActivePower: "La valeur de la puissance imposée doit être comprise entre la valeur de la puissance active min et la valeur de la puissance active max",
|
|
276
|
+
ModifyGenerator: "Modifier un groupe",
|
|
277
|
+
GeneratorModificationError: "Erreur lors de la modification d'un générateur ",
|
|
276
278
|
NoBusbarSectionFound: "Aucun jeu de barres trouvé pour ce poste",
|
|
277
279
|
// Tabs
|
|
278
280
|
SubstationTab: "Site",
|
package/package.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
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
|
-
*/
|
|
7
|
-
interface DndTableAddRowsDialogProps {
|
|
8
|
-
open: boolean;
|
|
9
|
-
handleAddButton: (rowNumber: number) => void;
|
|
10
|
-
onClose: () => void;
|
|
11
|
-
}
|
|
12
|
-
export declare function DndTableAddRowsDialog({ open, handleAddButton, onClose }: Readonly<DndTableAddRowsDialogProps>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export {};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Dialog, DialogTitle, DialogContent, TextField, DialogActions, Button } from "@mui/material";
|
|
3
|
-
import { FormattedMessage } from "react-intl";
|
|
4
|
-
import { useState } from "react";
|
|
5
|
-
import "@mui/icons-material";
|
|
6
|
-
import "../../ui/overflowableText/OverflowableText.js";
|
|
7
|
-
import "../../../utils/conversionUtils.js";
|
|
8
|
-
import "../../../utils/types/equipmentType.js";
|
|
9
|
-
import "react-hook-form";
|
|
10
|
-
import "localized-countries";
|
|
11
|
-
import "localized-countries/data/fr";
|
|
12
|
-
import "localized-countries/data/en";
|
|
13
|
-
import "notistack";
|
|
14
|
-
import "../../ui/reactHookForm/provider/CustomFormProvider.js";
|
|
15
|
-
import { CancelButton } from "../../ui/reactHookForm/utils/CancelButton.js";
|
|
16
|
-
import "yup";
|
|
17
|
-
import "../../ui/treeViewFinder/TreeViewFinder.js";
|
|
18
|
-
import "../../ui/reactHookForm/numbers/RangeInput.js";
|
|
19
|
-
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
20
|
-
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
21
|
-
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
22
|
-
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
23
|
-
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
24
|
-
import "../../ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
25
|
-
import "../../ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
26
|
-
import "@hello-pangea/dnd";
|
|
27
|
-
import "../../ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
28
|
-
import "../../ui/snackbarProvider/SnackbarProvider.js";
|
|
29
|
-
import "mui-nested-menu";
|
|
30
|
-
import "react-resizable-panels";
|
|
31
|
-
function DndTableAddRowsDialog({ open, handleAddButton, onClose }) {
|
|
32
|
-
const [rowNumber, setRowNumber] = useState(1);
|
|
33
|
-
const handleClose = () => {
|
|
34
|
-
setRowNumber(1);
|
|
35
|
-
onClose();
|
|
36
|
-
};
|
|
37
|
-
return /* @__PURE__ */ jsxs(Dialog, { open, onClose: handleClose, children: [
|
|
38
|
-
/* @__PURE__ */ jsx(DialogTitle, { children: /* @__PURE__ */ jsx(FormattedMessage, { id: "AddRowsDialogTitle" }) }),
|
|
39
|
-
/* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsx(
|
|
40
|
-
TextField,
|
|
41
|
-
{
|
|
42
|
-
autoFocus: true,
|
|
43
|
-
type: "Number",
|
|
44
|
-
value: rowNumber,
|
|
45
|
-
onChange: (event) => {
|
|
46
|
-
setRowNumber(!event.target.value ? 0 : parseInt(event.target.value, 10));
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
) }),
|
|
50
|
-
/* @__PURE__ */ jsxs(DialogActions, { children: [
|
|
51
|
-
/* @__PURE__ */ jsx(CancelButton, { onClick: handleClose }),
|
|
52
|
-
/* @__PURE__ */ jsx(
|
|
53
|
-
Button,
|
|
54
|
-
{
|
|
55
|
-
onClick: () => {
|
|
56
|
-
handleAddButton(rowNumber);
|
|
57
|
-
handleClose();
|
|
58
|
-
},
|
|
59
|
-
variant: "outlined",
|
|
60
|
-
disabled: rowNumber <= 0,
|
|
61
|
-
children: /* @__PURE__ */ jsx(FormattedMessage, { id: "AddRowsButton" })
|
|
62
|
-
}
|
|
63
|
-
)
|
|
64
|
-
] })
|
|
65
|
-
] });
|
|
66
|
-
}
|
|
67
|
-
export {
|
|
68
|
-
DndTableAddRowsDialog
|
|
69
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
*/
|
|
7
|
-
interface DndTableBottomLeftButtonsProps {
|
|
8
|
-
handleUploadButton: () => void;
|
|
9
|
-
uploadButtonMessageId: string;
|
|
10
|
-
handleResetButton: () => void;
|
|
11
|
-
resetButtonMessageId: string;
|
|
12
|
-
withResetButton?: boolean;
|
|
13
|
-
disableUploadButton?: boolean;
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
}
|
|
16
|
-
export declare function DndTableBottomLeftButtons({ handleUploadButton, uploadButtonMessageId, handleResetButton, resetButtonMessageId, withResetButton, disableUploadButton, disabled, }: Readonly<DndTableBottomLeftButtonsProps>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export {};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Grid, IconButton } from "@mui/material";
|
|
3
|
-
import { Upload, Replay } from "@mui/icons-material";
|
|
4
|
-
import { useIntl } from "react-intl";
|
|
5
|
-
import { CustomTooltip } from "../../ui/tooltip/CustomTooltip.js";
|
|
6
|
-
function DndTableBottomLeftButtons({
|
|
7
|
-
handleUploadButton,
|
|
8
|
-
uploadButtonMessageId,
|
|
9
|
-
handleResetButton,
|
|
10
|
-
resetButtonMessageId,
|
|
11
|
-
withResetButton,
|
|
12
|
-
disableUploadButton,
|
|
13
|
-
disabled
|
|
14
|
-
}) {
|
|
15
|
-
const intl = useIntl();
|
|
16
|
-
return /* @__PURE__ */ jsxs(Grid, { container: true, item: true, xs: true, spacing: 1, children: [
|
|
17
|
-
/* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
18
|
-
CustomTooltip,
|
|
19
|
-
{
|
|
20
|
-
title: intl.formatMessage({
|
|
21
|
-
id: uploadButtonMessageId
|
|
22
|
-
}),
|
|
23
|
-
children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
24
|
-
IconButton,
|
|
25
|
-
{
|
|
26
|
-
color: "primary",
|
|
27
|
-
onClick: () => handleUploadButton(),
|
|
28
|
-
disabled: disabled || disableUploadButton,
|
|
29
|
-
children: /* @__PURE__ */ jsx(Upload, {})
|
|
30
|
-
}
|
|
31
|
-
) })
|
|
32
|
-
}
|
|
33
|
-
) }),
|
|
34
|
-
withResetButton && /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
35
|
-
CustomTooltip,
|
|
36
|
-
{
|
|
37
|
-
title: intl.formatMessage({
|
|
38
|
-
id: resetButtonMessageId
|
|
39
|
-
}),
|
|
40
|
-
children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(IconButton, { color: "primary", onClick: () => handleResetButton(), disabled, children: /* @__PURE__ */ jsx(Replay, {}) }) })
|
|
41
|
-
}
|
|
42
|
-
) })
|
|
43
|
-
] });
|
|
44
|
-
}
|
|
45
|
-
export {
|
|
46
|
-
DndTableBottomLeftButtons
|
|
47
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
*/
|
|
7
|
-
export interface DndTableBottomRightButtonsProps {
|
|
8
|
-
arrayFormName: string;
|
|
9
|
-
handleAddButton: () => void;
|
|
10
|
-
handleDeleteButton: () => void;
|
|
11
|
-
handleMoveUpButton: () => void;
|
|
12
|
-
handleMoveDownButton: () => void;
|
|
13
|
-
disableAddingRows?: boolean;
|
|
14
|
-
showMoveArrow?: boolean;
|
|
15
|
-
disabled?: boolean;
|
|
16
|
-
}
|
|
17
|
-
export declare function DndTableBottomRightButtons({ arrayFormName, handleAddButton, handleDeleteButton, handleMoveUpButton, handleMoveDownButton, disableAddingRows, showMoveArrow, disabled, }: Readonly<DndTableBottomRightButtonsProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Grid, IconButton } from "@mui/material";
|
|
3
|
-
import { AddCircle, Delete, ArrowUpward, ArrowDownward } from "@mui/icons-material";
|
|
4
|
-
import { useWatch } from "react-hook-form";
|
|
5
|
-
import { useIntl } from "react-intl";
|
|
6
|
-
import { CustomTooltip } from "../../ui/tooltip/CustomTooltip.js";
|
|
7
|
-
import { SELECTED } from "./dnd-table.type.js";
|
|
8
|
-
function DndTableBottomRightButtons({
|
|
9
|
-
arrayFormName,
|
|
10
|
-
handleAddButton,
|
|
11
|
-
handleDeleteButton,
|
|
12
|
-
handleMoveUpButton,
|
|
13
|
-
handleMoveDownButton,
|
|
14
|
-
disableAddingRows,
|
|
15
|
-
showMoveArrow,
|
|
16
|
-
disabled
|
|
17
|
-
}) {
|
|
18
|
-
const intl = useIntl();
|
|
19
|
-
const currentRows = useWatch({
|
|
20
|
-
name: arrayFormName
|
|
21
|
-
});
|
|
22
|
-
const noRowsSelected = currentRows ? !currentRows.some((row) => row[SELECTED]) : true;
|
|
23
|
-
const firstRowSelected = noRowsSelected ? void 0 : currentRows[0]?.[SELECTED];
|
|
24
|
-
const lastRowSelected = noRowsSelected ? void 0 : currentRows[currentRows.length - 1]?.[SELECTED];
|
|
25
|
-
return /* @__PURE__ */ jsxs(Grid, { container: true, item: true, xs: true, spacing: 1, sx: { justifyContent: "flex-end" }, children: [
|
|
26
|
-
/* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
27
|
-
CustomTooltip,
|
|
28
|
-
{
|
|
29
|
-
title: intl.formatMessage({
|
|
30
|
-
id: "DndAddRows"
|
|
31
|
-
}),
|
|
32
|
-
children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
33
|
-
IconButton,
|
|
34
|
-
{
|
|
35
|
-
color: "primary",
|
|
36
|
-
onClick: () => handleAddButton(),
|
|
37
|
-
disabled: disabled || disableAddingRows,
|
|
38
|
-
children: /* @__PURE__ */ jsx(AddCircle, {})
|
|
39
|
-
}
|
|
40
|
-
) })
|
|
41
|
-
}
|
|
42
|
-
) }),
|
|
43
|
-
/* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
44
|
-
CustomTooltip,
|
|
45
|
-
{
|
|
46
|
-
title: intl.formatMessage({
|
|
47
|
-
id: "DndDeleteRows"
|
|
48
|
-
}),
|
|
49
|
-
children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
50
|
-
IconButton,
|
|
51
|
-
{
|
|
52
|
-
color: "primary",
|
|
53
|
-
onClick: () => handleDeleteButton(),
|
|
54
|
-
disabled: disabled || noRowsSelected,
|
|
55
|
-
children: /* @__PURE__ */ jsx(Delete, {})
|
|
56
|
-
}
|
|
57
|
-
) })
|
|
58
|
-
}
|
|
59
|
-
) }),
|
|
60
|
-
showMoveArrow && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
61
|
-
/* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
62
|
-
CustomTooltip,
|
|
63
|
-
{
|
|
64
|
-
title: intl.formatMessage({
|
|
65
|
-
id: "MoveUpRows"
|
|
66
|
-
}),
|
|
67
|
-
children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
68
|
-
IconButton,
|
|
69
|
-
{
|
|
70
|
-
color: "primary",
|
|
71
|
-
onClick: () => handleMoveUpButton(),
|
|
72
|
-
disabled: disabled || noRowsSelected || firstRowSelected,
|
|
73
|
-
children: /* @__PURE__ */ jsx(ArrowUpward, {})
|
|
74
|
-
}
|
|
75
|
-
) })
|
|
76
|
-
}
|
|
77
|
-
) }),
|
|
78
|
-
/* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
79
|
-
CustomTooltip,
|
|
80
|
-
{
|
|
81
|
-
title: intl.formatMessage({
|
|
82
|
-
id: "MoveDownRows"
|
|
83
|
-
}),
|
|
84
|
-
children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
85
|
-
IconButton,
|
|
86
|
-
{
|
|
87
|
-
color: "primary",
|
|
88
|
-
onClick: () => handleMoveDownButton(),
|
|
89
|
-
disabled: disabled || noRowsSelected || lastRowSelected,
|
|
90
|
-
children: /* @__PURE__ */ jsx(ArrowDownward, {})
|
|
91
|
-
}
|
|
92
|
-
) })
|
|
93
|
-
}
|
|
94
|
-
) })
|
|
95
|
-
] })
|
|
96
|
-
] });
|
|
97
|
-
}
|
|
98
|
-
export {
|
|
99
|
-
DndTableBottomRightButtons
|
|
100
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { UseFieldArrayReturn } from 'react-hook-form';
|
|
2
|
-
import { DndColumn } from './dnd-table.type';
|
|
3
|
-
export interface DndTableProps {
|
|
4
|
-
name: string;
|
|
5
|
-
useFieldArrayOutput: UseFieldArrayReturn;
|
|
6
|
-
columnsDefinition: DndColumn[];
|
|
7
|
-
tableHeight?: number;
|
|
8
|
-
allowedToAddRows?: () => Promise<boolean>;
|
|
9
|
-
createRows?: (numberOfRows: number) => {
|
|
10
|
-
[key: string]: any;
|
|
11
|
-
}[];
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
withResetButton?: boolean;
|
|
14
|
-
withAddRowsDialog?: boolean;
|
|
15
|
-
previousValues?: any[];
|
|
16
|
-
disableTableCell?: (rowIndex: number, column: any, tableName: string, previousValues?: any[]) => boolean;
|
|
17
|
-
getPreviousValue?: (rowIndex: number, column: any, tableName: string, previousValues?: any[]) => number | undefined;
|
|
18
|
-
isValueModified?: (index: number, tableName: string) => boolean;
|
|
19
|
-
disableAddingRows?: boolean;
|
|
20
|
-
showMoveArrow?: boolean;
|
|
21
|
-
disableDragAndDrop?: boolean;
|
|
22
|
-
handleUploadButton?: () => void;
|
|
23
|
-
uploadButtonMessageId?: string;
|
|
24
|
-
handleResetButton?: () => void;
|
|
25
|
-
resetButtonMessageId?: string;
|
|
26
|
-
maxRows?: number;
|
|
27
|
-
disabledDeletion?: boolean;
|
|
28
|
-
multiselect?: boolean;
|
|
29
|
-
onChange?: (changedRow: any) => void;
|
|
30
|
-
onDelete?: (removedRows: any[]) => void;
|
|
31
|
-
}
|
|
32
|
-
export declare function DndTable(props: Readonly<DndTableProps>): import("react/jsx-runtime").JSX.Element;
|