@gridsuite/commons-ui 0.223.0 → 0.225.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/components/ui/directoryItemSelector/DirectoryItemSelector.js +1 -1
- package/dist/components/ui/directoryItemSelector/utils.js +1 -1
- package/dist/components/ui/reactHookForm/DirectoryItemsInput.js +1 -1
- 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 +2 -2
- package/dist/features/parameters/common/contingency-table/columns-definitions.js +6 -6
- package/dist/features/parameters/common/contingency-table/contingency-table.js +1 -1
- package/dist/features/parameters/common/contingency-table/types.d.ts +6 -17
- 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/columns-definitions.d.ts +3 -3
- package/dist/features/parameters/security-analysis/columns-definitions.js +8 -8
- package/dist/features/parameters/security-analysis/security-analysis-parameters-inline.js +2 -2
- package/dist/features/parameters/security-analysis/security-analysis-parameters-selector.d.ts +1 -1
- package/dist/features/parameters/security-analysis/use-security-analysis-parameters-form.d.ts +1 -1
- package/dist/features/parameters/security-analysis/use-security-analysis-parameters-form.js +1 -1
- package/dist/features/parameters/sensi/columns-definitions.js +1 -1
- package/dist/features/parameters/sensi/constants.d.ts +0 -2
- package/dist/features/parameters/sensi/constants.js +0 -4
- package/dist/features/parameters/sensi/sensitivity-analysis-parameters-inline.js +1 -1
- package/dist/features/parameters/sensi/use-sensitivity-analysis-parameters.js +33 -32
- package/dist/features/parameters/sensi/utils.d.ts +31 -63
- package/dist/features/parameters/sensi/utils.js +49 -61
- 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/hooks/use-unique-name-validation.js +1 -1
- package/dist/index.js +30 -11
- package/dist/services/directory.d.ts +1 -1
- package/dist/services/index.js +6 -3
- package/dist/services/pcc-min.d.ts +2 -1
- package/dist/services/pcc-min.js +27 -1
- package/dist/services/security-analysis.d.ts +2 -1
- package/dist/services/security-analysis.js +32 -1
- package/dist/services/sensitivity-analysis.d.ts +2 -1
- package/dist/services/sensitivity-analysis.js +87 -1
- 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/dist/utils/constants/filterConstant.d.ts +1 -1
- package/dist/utils/index.js +4 -4
- package/dist/utils/types/dynamic-security-analysis.type.d.ts +3 -5
- package/dist/utils/types/index.d.ts +1 -0
- package/dist/utils/types/index.js +4 -4
- package/dist/utils/types/parameters.type.d.ts +1 -1
- package/dist/utils/types/pcc-min.type.d.ts +0 -1
- package/dist/utils/types/pcc-min.type.js +0 -21
- package/dist/utils/types/security-analysis.type.d.ts +26 -0
- package/dist/utils/types/security-analysis.type.js +14 -0
- package/dist/utils/types/sensitivity-analysis.type.d.ts +3 -7
- package/dist/utils/types/sensitivity-analysis.type.js +17 -103
- package/dist/utils/types/types.d.ts +7 -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/features/parameters/security-analysis/types.d.ts +0 -20
- package/dist/features/parameters/security-analysis/types.js +0 -42
- /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
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { fetchElementNames } from "../../services/directory.js";
|
|
2
1
|
var DistributionType = /* @__PURE__ */ ((DistributionType2) => {
|
|
3
2
|
DistributionType2["PROPORTIONAL"] = "PROPORTIONAL";
|
|
4
3
|
DistributionType2["PROPORTIONAL_MAXP"] = "PROPORTIONAL_MAXP";
|
|
@@ -12,140 +11,55 @@ var SensitivityType = /* @__PURE__ */ ((SensitivityType2) => {
|
|
|
12
11
|
return SensitivityType2;
|
|
13
12
|
})(SensitivityType || {});
|
|
14
13
|
function mapSensitivityAnalysisParameters(parameters) {
|
|
15
|
-
const
|
|
16
|
-
return
|
|
14
|
+
const mapIdNamesToIds = (objects) => {
|
|
15
|
+
return objects?.map((c) => c.id) ?? [];
|
|
17
16
|
};
|
|
18
17
|
return {
|
|
19
18
|
...parameters,
|
|
20
19
|
sensitivityInjectionsSet: parameters.sensitivityInjectionsSet?.map((injectionsSet) => {
|
|
21
20
|
return {
|
|
22
21
|
...injectionsSet,
|
|
23
|
-
monitoredBranches:
|
|
24
|
-
injections:
|
|
25
|
-
contingencies:
|
|
22
|
+
monitoredBranches: mapIdNamesToIds(injectionsSet.monitoredBranches),
|
|
23
|
+
injections: mapIdNamesToIds(injectionsSet.injections),
|
|
24
|
+
contingencies: mapIdNamesToIds(injectionsSet.contingencies)
|
|
26
25
|
};
|
|
27
26
|
}),
|
|
28
27
|
sensitivityInjection: parameters.sensitivityInjection?.map((injection) => {
|
|
29
28
|
return {
|
|
30
29
|
...injection,
|
|
31
|
-
monitoredBranches:
|
|
32
|
-
injections:
|
|
33
|
-
contingencies:
|
|
30
|
+
monitoredBranches: mapIdNamesToIds(injection.monitoredBranches),
|
|
31
|
+
injections: mapIdNamesToIds(injection.injections),
|
|
32
|
+
contingencies: mapIdNamesToIds(injection.contingencies)
|
|
34
33
|
};
|
|
35
34
|
}),
|
|
36
35
|
sensitivityHVDC: parameters.sensitivityHVDC?.map((hvdc) => {
|
|
37
36
|
return {
|
|
38
37
|
...hvdc,
|
|
39
|
-
monitoredBranches:
|
|
40
|
-
hvdcs:
|
|
41
|
-
contingencies:
|
|
38
|
+
monitoredBranches: mapIdNamesToIds(hvdc.monitoredBranches),
|
|
39
|
+
hvdcs: mapIdNamesToIds(hvdc.hvdcs),
|
|
40
|
+
contingencies: mapIdNamesToIds(hvdc.contingencies)
|
|
42
41
|
};
|
|
43
42
|
}),
|
|
44
43
|
sensitivityPST: parameters.sensitivityPST?.map((pst) => {
|
|
45
44
|
return {
|
|
46
45
|
...pst,
|
|
47
|
-
monitoredBranches:
|
|
48
|
-
psts:
|
|
49
|
-
contingencies:
|
|
46
|
+
monitoredBranches: mapIdNamesToIds(pst.monitoredBranches),
|
|
47
|
+
psts: mapIdNamesToIds(pst.psts),
|
|
48
|
+
contingencies: mapIdNamesToIds(pst.contingencies)
|
|
50
49
|
};
|
|
51
50
|
}),
|
|
52
51
|
sensitivityNodes: parameters.sensitivityNodes?.map((nodes) => {
|
|
53
52
|
return {
|
|
54
53
|
...nodes,
|
|
55
|
-
monitoredVoltageLevels:
|
|
56
|
-
equipmentsInVoltageRegulation:
|
|
57
|
-
contingencies:
|
|
54
|
+
monitoredVoltageLevels: mapIdNamesToIds(nodes.monitoredVoltageLevels),
|
|
55
|
+
equipmentsInVoltageRegulation: mapIdNamesToIds(nodes.equipmentsInVoltageRegulation),
|
|
56
|
+
contingencies: mapIdNamesToIds(nodes.contingencies)
|
|
58
57
|
};
|
|
59
58
|
})
|
|
60
59
|
};
|
|
61
60
|
}
|
|
62
|
-
function getEquipmentsContainerIds(parameters) {
|
|
63
|
-
const allContainerIds = /* @__PURE__ */ new Set();
|
|
64
|
-
parameters.sensitivityInjection?.forEach((i) => {
|
|
65
|
-
i.monitoredBranches?.forEach((id) => allContainerIds.add(id));
|
|
66
|
-
i.injections?.forEach((id) => allContainerIds.add(id));
|
|
67
|
-
i.contingencies?.forEach((id) => allContainerIds.add(id));
|
|
68
|
-
});
|
|
69
|
-
parameters.sensitivityInjectionsSet?.forEach((is) => {
|
|
70
|
-
is.monitoredBranches?.forEach((id) => allContainerIds.add(id));
|
|
71
|
-
is.injections?.forEach((id) => allContainerIds.add(id));
|
|
72
|
-
is.contingencies?.forEach((id) => allContainerIds.add(id));
|
|
73
|
-
});
|
|
74
|
-
parameters.sensitivityHVDC?.forEach((hvdc) => {
|
|
75
|
-
hvdc.monitoredBranches?.forEach((id) => allContainerIds.add(id));
|
|
76
|
-
hvdc.hvdcs?.forEach((id) => allContainerIds.add(id));
|
|
77
|
-
hvdc.contingencies?.forEach((id) => allContainerIds.add(id));
|
|
78
|
-
});
|
|
79
|
-
parameters.sensitivityPST?.forEach((pst) => {
|
|
80
|
-
pst.monitoredBranches?.forEach((id) => allContainerIds.add(id));
|
|
81
|
-
pst.psts?.forEach((id) => allContainerIds.add(id));
|
|
82
|
-
pst.contingencies?.forEach((id) => allContainerIds.add(id));
|
|
83
|
-
});
|
|
84
|
-
parameters.sensitivityNodes?.forEach((n) => {
|
|
85
|
-
n.monitoredVoltageLevels?.forEach((id) => allContainerIds.add(id));
|
|
86
|
-
n.equipmentsInVoltageRegulation?.forEach((id) => allContainerIds.add(id));
|
|
87
|
-
n.contingencies?.forEach((id) => allContainerIds.add(id));
|
|
88
|
-
});
|
|
89
|
-
return allContainerIds;
|
|
90
|
-
}
|
|
91
|
-
function enrichSensitivityAnalysisParameters(parameters) {
|
|
92
|
-
const allElementIds = getEquipmentsContainerIds(parameters);
|
|
93
|
-
const elementNamesPromise = allElementIds.size === 0 ? Promise.resolve(null) : fetchElementNames(allElementIds);
|
|
94
|
-
return elementNamesPromise.then((elementNames) => {
|
|
95
|
-
const mapIdsToEquipmentsContainer = (ids) => {
|
|
96
|
-
return ids ? ids.map((id) => ({
|
|
97
|
-
containerId: id,
|
|
98
|
-
containerName: elementNames?.[id] ?? null
|
|
99
|
-
})) : [];
|
|
100
|
-
};
|
|
101
|
-
return {
|
|
102
|
-
...parameters,
|
|
103
|
-
sensitivityInjectionsSet: parameters.sensitivityInjectionsSet ? parameters.sensitivityInjectionsSet.map((is) => {
|
|
104
|
-
return {
|
|
105
|
-
...is,
|
|
106
|
-
monitoredBranches: mapIdsToEquipmentsContainer(is.monitoredBranches),
|
|
107
|
-
injections: mapIdsToEquipmentsContainer(is.injections),
|
|
108
|
-
contingencies: mapIdsToEquipmentsContainer(is.contingencies)
|
|
109
|
-
};
|
|
110
|
-
}) : [],
|
|
111
|
-
sensitivityInjection: parameters.sensitivityInjection ? parameters.sensitivityInjection.map((i) => {
|
|
112
|
-
return {
|
|
113
|
-
...i,
|
|
114
|
-
monitoredBranches: mapIdsToEquipmentsContainer(i.monitoredBranches),
|
|
115
|
-
injections: mapIdsToEquipmentsContainer(i.injections),
|
|
116
|
-
contingencies: mapIdsToEquipmentsContainer(i.contingencies)
|
|
117
|
-
};
|
|
118
|
-
}) : [],
|
|
119
|
-
sensitivityHVDC: parameters.sensitivityHVDC ? parameters.sensitivityHVDC.map((hvdc) => {
|
|
120
|
-
return {
|
|
121
|
-
...hvdc,
|
|
122
|
-
monitoredBranches: mapIdsToEquipmentsContainer(hvdc.monitoredBranches),
|
|
123
|
-
hvdcs: mapIdsToEquipmentsContainer(hvdc.hvdcs),
|
|
124
|
-
contingencies: mapIdsToEquipmentsContainer(hvdc.contingencies)
|
|
125
|
-
};
|
|
126
|
-
}) : [],
|
|
127
|
-
sensitivityPST: parameters.sensitivityPST ? parameters.sensitivityPST.map((pst) => {
|
|
128
|
-
return {
|
|
129
|
-
...pst,
|
|
130
|
-
monitoredBranches: mapIdsToEquipmentsContainer(pst.monitoredBranches),
|
|
131
|
-
psts: mapIdsToEquipmentsContainer(pst.psts),
|
|
132
|
-
contingencies: mapIdsToEquipmentsContainer(pst.contingencies)
|
|
133
|
-
};
|
|
134
|
-
}) : [],
|
|
135
|
-
sensitivityNodes: parameters.sensitivityNodes ? parameters.sensitivityNodes.map((n) => {
|
|
136
|
-
return {
|
|
137
|
-
...n,
|
|
138
|
-
monitoredVoltageLevels: mapIdsToEquipmentsContainer(n.monitoredVoltageLevels),
|
|
139
|
-
equipmentsInVoltageRegulation: mapIdsToEquipmentsContainer(n.equipmentsInVoltageRegulation),
|
|
140
|
-
contingencies: mapIdsToEquipmentsContainer(n.contingencies)
|
|
141
|
-
};
|
|
142
|
-
}) : []
|
|
143
|
-
};
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
61
|
export {
|
|
147
62
|
DistributionType,
|
|
148
63
|
SensitivityType,
|
|
149
|
-
enrichSensitivityAnalysisParameters,
|
|
150
64
|
mapSensitivityAnalysisParameters
|
|
151
65
|
};
|
|
@@ -77,3 +77,10 @@ export type ItemSelectionForCopy = {
|
|
|
77
77
|
parentDirectoryUuid: UUID | null;
|
|
78
78
|
specificTypeItem: string | null;
|
|
79
79
|
};
|
|
80
|
+
/**
|
|
81
|
+
* A directory element uuid but enriched with the corresponding name.
|
|
82
|
+
*/
|
|
83
|
+
export interface IdName {
|
|
84
|
+
id: UUID;
|
|
85
|
+
name?: string;
|
|
86
|
+
}
|
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;
|