@gridsuite/commons-ui 0.107.1 → 0.108.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/elementSaveDialog/ElementSaveDialog.js +10 -10
- package/dist/components/dnd-table/dnd-table-add-rows-dialog.d.ts +13 -0
- package/dist/components/dnd-table/dnd-table-add-rows-dialog.js +69 -0
- package/dist/components/dnd-table/dnd-table-bottom-left-buttons.d.ts +17 -0
- package/dist/components/dnd-table/dnd-table-bottom-left-buttons.js +48 -0
- package/dist/components/dnd-table/dnd-table-bottom-right-buttons.d.ts +17 -0
- package/dist/components/dnd-table/dnd-table-bottom-right-buttons.js +104 -0
- package/dist/components/dnd-table/dnd-table.d.ts +28 -0
- package/dist/components/dnd-table/dnd-table.js +394 -0
- package/dist/components/dnd-table/dnd-table.type.d.ts +51 -0
- package/dist/components/dnd-table/dnd-table.type.js +16 -0
- package/dist/components/dnd-table/index.d.ts +11 -0
- package/dist/components/dnd-table/index.js +14 -0
- package/dist/components/filter/HeaderFilterForm.js +4 -4
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +57 -1
- package/dist/components/inputs/index.js +6 -0
- package/dist/components/inputs/reactHookForm/chip-items-input.d.ts +13 -0
- package/dist/components/inputs/reactHookForm/chip-items-input.js +129 -0
- package/dist/components/inputs/reactHookForm/index.d.ts +2 -0
- package/dist/components/inputs/reactHookForm/index.js +6 -0
- package/dist/components/inputs/reactHookForm/tableInputs/index.d.ts +8 -0
- package/dist/components/inputs/reactHookForm/tableInputs/index.js +6 -0
- package/dist/components/inputs/reactHookForm/tableInputs/table-numerical-input.d.ts +12 -0
- package/dist/components/inputs/reactHookForm/tableInputs/table-numerical-input.js +110 -0
- package/dist/components/inputs/reactHookForm/tableInputs/table-text-input.d.ts +8 -0
- package/dist/components/inputs/reactHookForm/tableInputs/table-text-input.js +43 -0
- package/dist/components/parameters/common/ProviderParam.js +6 -6
- package/dist/components/parameters/common/constant.d.ts +8 -0
- package/dist/components/parameters/common/constant.js +12 -1
- package/dist/components/parameters/common/index.js +3 -1
- package/dist/components/parameters/common/limitreductions/limit-reduction-table-cell.js +7 -7
- package/dist/components/parameters/common/limitreductions/limit-reductions-table-form.js +6 -6
- package/dist/components/parameters/common/name-element-editor/name-element-editor-form.js +8 -8
- package/dist/components/parameters/common/name-element-editor/name-element-editor-utils.js +11 -10
- package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table-cell.js +7 -7
- package/dist/components/parameters/common/widget/parameter-float.js +6 -6
- package/dist/components/parameters/common/widget/parameter-line-directory-items-input.js +11 -10
- package/dist/components/parameters/common/widget/parameter-line-slider.js +6 -6
- package/dist/components/parameters/index.d.ts +1 -0
- package/dist/components/parameters/index.js +39 -1
- package/dist/components/parameters/loadflow/load-flow-general-parameters.js +6 -6
- package/dist/components/parameters/loadflow/load-flow-parameter-field.js +6 -6
- package/dist/components/parameters/loadflow/load-flow-parameters-form.js +6 -6
- package/dist/components/parameters/loadflow/load-flow-parameters-header.js +6 -6
- package/dist/components/parameters/loadflow/load-flow-parameters-inline.js +3 -3
- package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +2 -1
- package/dist/components/parameters/network-visualizations/network-area-diagram-parameters.js +6 -6
- package/dist/components/parameters/network-visualizations/network-visualizations-form.js +7 -7
- package/dist/components/parameters/network-visualizations/network-visualizations-parameters-dialog.js +3 -3
- package/dist/components/parameters/network-visualizations/network-visualizations-parameters-inline.js +2 -2
- package/dist/components/parameters/network-visualizations/use-network-visualizations-parameters-form.js +12 -11
- package/dist/components/parameters/short-circuit/short-circuit-fields.js +5 -5
- package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.js +3 -3
- package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +6 -6
- package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.js +2 -2
- package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +11 -10
- package/dist/components/parameters/voltage-init/constants.d.ts +39 -0
- package/dist/components/parameters/voltage-init/constants.js +65 -0
- package/dist/components/parameters/voltage-init/equipment-selection-parameters.d.ts +7 -0
- package/dist/components/parameters/voltage-init/equipment-selection-parameters.js +119 -0
- package/dist/components/parameters/voltage-init/general-parameters.d.ts +4 -0
- package/dist/components/parameters/voltage-init/general-parameters.js +112 -0
- package/dist/components/parameters/voltage-init/index.d.ts +10 -0
- package/dist/components/parameters/voltage-init/index.js +38 -0
- package/dist/components/parameters/voltage-init/use-voltage-init-parameters-form.d.ts +32 -0
- package/dist/components/parameters/voltage-init/use-voltage-init-parameters-form.js +218 -0
- package/dist/components/parameters/voltage-init/voltage-init-form-utils.d.ts +4 -0
- package/dist/components/parameters/voltage-init/voltage-init-form-utils.js +220 -0
- package/dist/components/parameters/voltage-init/voltage-init-parameters-dialog.d.ts +2 -0
- package/dist/components/parameters/voltage-init/voltage-init-parameters-dialog.js +97 -0
- package/dist/components/parameters/voltage-init/voltage-init-parameters-form.d.ts +30 -0
- package/dist/components/parameters/voltage-init/voltage-init-parameters-form.js +150 -0
- package/dist/components/parameters/voltage-init/voltage-init-parameters-inline.d.ts +8 -0
- package/dist/components/parameters/voltage-init/voltage-init-parameters-inline.js +152 -0
- package/dist/components/parameters/voltage-init/voltage-init.type.d.ts +33 -0
- package/dist/components/parameters/voltage-init/voltage-init.type.js +8 -0
- package/dist/components/parameters/voltage-init/voltage-limits-parameters.d.ts +7 -0
- package/dist/components/parameters/voltage-init/voltage-limits-parameters.js +188 -0
- package/dist/index.js +69 -2
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.js +6 -2
- package/dist/services/study.d.ts +2 -0
- package/dist/services/study.js +15 -1
- package/dist/services/voltage-init.d.ts +4 -0
- package/dist/services/voltage-init.js +14 -0
- package/dist/translations/en/dndTableEn.d.ts +16 -0
- package/dist/translations/en/dndTableEn.js +13 -0
- package/dist/translations/en/index.d.ts +1 -0
- package/dist/translations/en/index.js +2 -0
- package/dist/translations/en/parameters.d.ts +30 -0
- package/dist/translations/en/parameters.js +31 -1
- package/dist/translations/fr/dndTableFr.d.ts +16 -0
- package/dist/translations/fr/dndTableFr.js +13 -0
- package/dist/translations/fr/index.d.ts +1 -0
- package/dist/translations/fr/index.js +2 -0
- package/dist/translations/fr/parameters.d.ts +31 -0
- package/dist/translations/fr/parameters.js +32 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/validation-functions.d.ts +8 -0
- package/dist/utils/validation-functions.js +23 -0
- package/package.json +1 -1
|
@@ -5,13 +5,17 @@ import { Grid, Button, Typography, Box, CircularProgress } from "@mui/material";
|
|
|
5
5
|
import { useForm } from "react-hook-form";
|
|
6
6
|
import { yupResolver } from "@hookform/resolvers/yup";
|
|
7
7
|
import "../../../utils/yupConfig.js";
|
|
8
|
-
import "
|
|
8
|
+
import "../../../utils/types/equipmentType.js";
|
|
9
|
+
import { fetchDirectoryElementPath } from "../../../services/directory.js";
|
|
10
|
+
import "localized-countries";
|
|
11
|
+
import "localized-countries/data/fr";
|
|
12
|
+
import "localized-countries/data/en";
|
|
13
|
+
import { useSnackMessage } from "../../../hooks/useSnackMessage.js";
|
|
9
14
|
import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
|
|
15
|
+
import "@mui/icons-material";
|
|
10
16
|
import * as yup from "yup";
|
|
11
|
-
import { useSnackMessage } from "../../../hooks/useSnackMessage.js";
|
|
12
17
|
import "../../overflowableText/OverflowableText.js";
|
|
13
18
|
import { DirectoryItemSelector } from "../../directoryItemSelector/DirectoryItemSelector.js";
|
|
14
|
-
import { fetchDirectoryElementPath } from "../../../services/directory.js";
|
|
15
19
|
import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
16
20
|
import { FieldConstants } from "../../../utils/constants/fieldConstants.js";
|
|
17
21
|
import "../../customAGGrid/customAggrid.js";
|
|
@@ -20,9 +24,9 @@ import "react-papaparse";
|
|
|
20
24
|
import "react-csv-downloader";
|
|
21
25
|
import { RadioInput } from "../../inputs/reactHookForm/booleans/RadioInput.js";
|
|
22
26
|
import "../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
23
|
-
import "
|
|
24
|
-
import "
|
|
25
|
-
import "
|
|
27
|
+
import { MAX_CHAR_DESCRIPTION } from "../../../utils/constants/uiConstants.js";
|
|
28
|
+
import "../../../utils/conversionUtils.js";
|
|
29
|
+
import { ElementType } from "../../../utils/types/elementType.js";
|
|
26
30
|
import { DescriptionField } from "../../inputs/reactHookForm/text/DescriptionField.js";
|
|
27
31
|
import { UniqueNameInput } from "../../inputs/reactHookForm/text/UniqueNameInput.js";
|
|
28
32
|
import "@react-querybuilder/material";
|
|
@@ -31,11 +35,7 @@ import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
|
31
35
|
import "uuid";
|
|
32
36
|
import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
33
37
|
import "react-querybuilder";
|
|
34
|
-
import "../../../utils/conversionUtils.js";
|
|
35
|
-
import { ElementType } from "../../../utils/types/elementType.js";
|
|
36
38
|
import { CustomMuiDialog } from "../customMuiDialog/CustomMuiDialog.js";
|
|
37
|
-
import { MAX_CHAR_DESCRIPTION } from "../../../utils/constants/uiConstants.js";
|
|
38
|
-
import "../../../utils/types/equipmentType.js";
|
|
39
39
|
var OperationType = /* @__PURE__ */ ((OperationType2) => {
|
|
40
40
|
OperationType2["CREATE"] = "CREATE";
|
|
41
41
|
OperationType2["UPDATE"] = "UPDATE";
|
|
@@ -0,0 +1,13 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,69 @@
|
|
|
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 "react-hook-form";
|
|
6
|
+
import "../../utils/types/equipmentType.js";
|
|
7
|
+
import "localized-countries";
|
|
8
|
+
import "localized-countries/data/fr";
|
|
9
|
+
import "localized-countries/data/en";
|
|
10
|
+
import "notistack";
|
|
11
|
+
import "../inputs/reactHookForm/provider/CustomFormProvider.js";
|
|
12
|
+
import { CancelButton } from "../inputs/reactHookForm/utils/CancelButton.js";
|
|
13
|
+
import "@mui/icons-material";
|
|
14
|
+
import "yup";
|
|
15
|
+
import "../overflowableText/OverflowableText.js";
|
|
16
|
+
import "../treeViewFinder/TreeViewFinder.js";
|
|
17
|
+
import "../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
18
|
+
import "../customAGGrid/customAggrid.js";
|
|
19
|
+
import "ag-grid-community";
|
|
20
|
+
import "react-papaparse";
|
|
21
|
+
import "react-csv-downloader";
|
|
22
|
+
import "../inputs/reactHookForm/numbers/RangeInput.js";
|
|
23
|
+
import "../../utils/conversionUtils.js";
|
|
24
|
+
import "../../utils/yupConfig.js";
|
|
25
|
+
import "@react-querybuilder/material";
|
|
26
|
+
import "../filter/expert/expertFilterConstants.js";
|
|
27
|
+
import "../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
28
|
+
import "uuid";
|
|
29
|
+
import "../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
30
|
+
import "react-querybuilder";
|
|
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
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Grid, Tooltip, IconButton } from "@mui/material";
|
|
3
|
+
import { Upload, Replay } from "@mui/icons-material";
|
|
4
|
+
import { useIntl } from "react-intl";
|
|
5
|
+
function DndTableBottomLeftButtons({
|
|
6
|
+
handleUploadButton,
|
|
7
|
+
uploadButtonMessageId,
|
|
8
|
+
handleResetButton,
|
|
9
|
+
resetButtonMessageId,
|
|
10
|
+
withResetButton,
|
|
11
|
+
disableUploadButton,
|
|
12
|
+
disabled
|
|
13
|
+
}) {
|
|
14
|
+
const intl = useIntl();
|
|
15
|
+
return /* @__PURE__ */ jsxs(Grid, { container: true, item: true, xs: true, spacing: 1, children: [
|
|
16
|
+
/* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
17
|
+
Tooltip,
|
|
18
|
+
{
|
|
19
|
+
title: intl.formatMessage({
|
|
20
|
+
id: uploadButtonMessageId
|
|
21
|
+
}),
|
|
22
|
+
placement: "top",
|
|
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
|
+
Tooltip,
|
|
36
|
+
{
|
|
37
|
+
title: intl.formatMessage({
|
|
38
|
+
id: resetButtonMessageId
|
|
39
|
+
}),
|
|
40
|
+
placement: "top",
|
|
41
|
+
children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(IconButton, { color: "primary", onClick: () => handleResetButton(), disabled, children: /* @__PURE__ */ jsx(Replay, {}) }) })
|
|
42
|
+
}
|
|
43
|
+
) })
|
|
44
|
+
] });
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
DndTableBottomLeftButtons
|
|
48
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
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;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Grid, Tooltip, 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 { SELECTED } from "./dnd-table.type.js";
|
|
7
|
+
function DndTableBottomRightButtons({
|
|
8
|
+
arrayFormName,
|
|
9
|
+
handleAddButton,
|
|
10
|
+
handleDeleteButton,
|
|
11
|
+
handleMoveUpButton,
|
|
12
|
+
handleMoveDownButton,
|
|
13
|
+
disableAddingRows,
|
|
14
|
+
showMoveArrow,
|
|
15
|
+
disabled
|
|
16
|
+
}) {
|
|
17
|
+
var _a, _b;
|
|
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 = (_a = currentRows[0]) == null ? void 0 : _a[SELECTED];
|
|
24
|
+
const lastRowSelected = (_b = currentRows[currentRows.length - 1]) == null ? void 0 : _b[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
|
+
Tooltip,
|
|
28
|
+
{
|
|
29
|
+
title: intl.formatMessage({
|
|
30
|
+
id: "DndAddRows"
|
|
31
|
+
}),
|
|
32
|
+
placement: "top",
|
|
33
|
+
children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
34
|
+
IconButton,
|
|
35
|
+
{
|
|
36
|
+
color: "primary",
|
|
37
|
+
onClick: () => handleAddButton(),
|
|
38
|
+
disabled: disabled || disableAddingRows,
|
|
39
|
+
children: /* @__PURE__ */ jsx(AddCircle, {})
|
|
40
|
+
}
|
|
41
|
+
) })
|
|
42
|
+
}
|
|
43
|
+
) }),
|
|
44
|
+
/* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
45
|
+
Tooltip,
|
|
46
|
+
{
|
|
47
|
+
title: intl.formatMessage({
|
|
48
|
+
id: "DndDeleteRows"
|
|
49
|
+
}),
|
|
50
|
+
placement: "top",
|
|
51
|
+
children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
52
|
+
IconButton,
|
|
53
|
+
{
|
|
54
|
+
color: "primary",
|
|
55
|
+
onClick: () => handleDeleteButton(),
|
|
56
|
+
disabled: disabled || noRowsSelected,
|
|
57
|
+
children: /* @__PURE__ */ jsx(Delete, {})
|
|
58
|
+
}
|
|
59
|
+
) })
|
|
60
|
+
}
|
|
61
|
+
) }),
|
|
62
|
+
showMoveArrow && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
63
|
+
/* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
64
|
+
Tooltip,
|
|
65
|
+
{
|
|
66
|
+
title: intl.formatMessage({
|
|
67
|
+
id: "MoveUpRows"
|
|
68
|
+
}),
|
|
69
|
+
placement: "top",
|
|
70
|
+
children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
71
|
+
IconButton,
|
|
72
|
+
{
|
|
73
|
+
color: "primary",
|
|
74
|
+
onClick: () => handleMoveUpButton(),
|
|
75
|
+
disabled: disabled || noRowsSelected || firstRowSelected,
|
|
76
|
+
children: /* @__PURE__ */ jsx(ArrowUpward, {})
|
|
77
|
+
}
|
|
78
|
+
) })
|
|
79
|
+
}
|
|
80
|
+
) }),
|
|
81
|
+
/* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
82
|
+
Tooltip,
|
|
83
|
+
{
|
|
84
|
+
title: intl.formatMessage({
|
|
85
|
+
id: "MoveDownRows"
|
|
86
|
+
}),
|
|
87
|
+
placement: "top",
|
|
88
|
+
children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
89
|
+
IconButton,
|
|
90
|
+
{
|
|
91
|
+
color: "primary",
|
|
92
|
+
onClick: () => handleMoveDownButton(),
|
|
93
|
+
disabled: disabled || noRowsSelected || lastRowSelected,
|
|
94
|
+
children: /* @__PURE__ */ jsx(ArrowDownward, {})
|
|
95
|
+
}
|
|
96
|
+
) })
|
|
97
|
+
}
|
|
98
|
+
) })
|
|
99
|
+
] })
|
|
100
|
+
] });
|
|
101
|
+
}
|
|
102
|
+
export {
|
|
103
|
+
DndTableBottomRightButtons
|
|
104
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { UseFieldArrayReturn } from 'react-hook-form';
|
|
2
|
+
import { DndColumn } from './dnd-table.type';
|
|
3
|
+
interface DndTableProps {
|
|
4
|
+
arrayFormName: 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, arrayFormName: string, temporaryLimits?: any[]) => boolean;
|
|
17
|
+
getPreviousValue?: (rowIndex: number, column: any, arrayFormName: string, temporaryLimits?: any[]) => number | undefined;
|
|
18
|
+
isValueModified?: (index: number, arrayFormName: string) => boolean;
|
|
19
|
+
disableAddingRows?: boolean;
|
|
20
|
+
showMoveArrow?: boolean;
|
|
21
|
+
disableDragAndDrop?: boolean;
|
|
22
|
+
handleUploadButton?: () => void;
|
|
23
|
+
uploadButtonMessageId?: string;
|
|
24
|
+
handleResetButton?: () => void;
|
|
25
|
+
resetButtonMessageId?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function DndTable(props: Readonly<DndTableProps>): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export {};
|