import React from "react"; import CircularProgress from "@mui/material/CircularProgress"; import Icon from "@mui/material/Icon"; import Paper from "@mui/material/Paper"; import TablePagination from "@mui/material/TablePagination"; import * as MComponents from "./components"; import PropTypes from "prop-types"; import { alpha } from "@mui/material/styles"; const OverlayLoading = (props) => (
); OverlayLoading.propTypes = { theme: PropTypes.any, }; const OverlayError = (props) => (
{props.error.message}{" "}
); OverlayError.propTypes = { error: PropTypes.oneOfType([PropTypes.object, PropTypes.string]), retry: PropTypes.func, theme: PropTypes.any, icon: PropTypes.any, }; const Container = (props) => ; export const defaultProps = { actions: [], classes: {}, columns: [], components: { Action: MComponents.MTableAction, Actions: MComponents.MTableActions, Body: MComponents.MTableBody, Cell: MComponents.MTableCell, Container: Container, EditCell: MComponents.MTableEditCell, EditField: MComponents.MTableEditField, EditRow: MComponents.MTableEditRow, FilterRow: MComponents.MTableFilterRow, Groupbar: MComponents.MTableGroupbar, GroupRow: MComponents.MTableGroupRow, Header: MComponents.MTableHeader, OverlayLoading: OverlayLoading, OverlayError: OverlayError, Pagination: TablePagination, Row: MComponents.MTableBodyRow, Toolbar: MComponents.MTableToolbar, }, data: [], icons: { /* eslint-disable react/display-name */ Add: React.forwardRef((props, ref) => ( add_box )), Check: React.forwardRef((props, ref) => ( check )), Clear: React.forwardRef((props, ref) => ( clear )), Delete: React.forwardRef((props, ref) => ( delete_outline )), DetailPanel: React.forwardRef((props, ref) => ( chevron_right )), Edit: React.forwardRef((props, ref) => ( edit )), Export: React.forwardRef((props, ref) => ( save_alt )), Filter: React.forwardRef((props, ref) => ( filter_list )), FirstPage: React.forwardRef((props, ref) => ( first_page )), LastPage: React.forwardRef((props, ref) => ( last_page )), NextPage: React.forwardRef((props, ref) => ( chevron_right )), PreviousPage: React.forwardRef((props, ref) => ( chevron_left )), ResetSearch: React.forwardRef((props, ref) => ( clear )), Resize: React.forwardRef((props, ref) => ( drag_handle )), Search: React.forwardRef((props, ref) => ( search )), SortArrow: React.forwardRef((props, ref) => ( arrow_downward )), ThirdStateCheck: React.forwardRef((props, ref) => ( remove )), ViewColumn: React.forwardRef((props, ref) => ( view_column )), Retry: React.forwardRef((props, ref) => ( replay )), /* eslint-enable react/display-name */ }, isLoading: false, title: "Table Title", options: { actionsColumnIndex: 0, addRowPosition: "last", columnsButton: false, detailPanelType: "multiple", debounceInterval: 200, doubleHorizontalScroll: false, emptyRowsWhenPaging: true, exportAllData: false, exportButton: false, exportDelimiter: ",", filtering: false, groupTitle: false, header: true, headerSelectionProps: {}, hideFilterIcons: false, loadingType: "overlay", padding: "default", searchAutoFocus: false, paging: true, pageSize: 5, pageSizeOptions: [5, 10, 20], paginationType: "normal", paginationPosition: "bottom", showEmptyDataSourceMessage: true, showFirstLastPageButtons: true, showSelectAllCheckbox: true, search: true, showTitle: true, showTextRowsSelected: true, tableLayout: "auto", toolbarButtonAlignment: "right", searchFieldAlignment: "right", searchFieldStyle: {}, searchFieldVariant: "standard", selection: false, selectionProps: {}, sorting: true, toolbar: true, defaultExpanded: false, detailPanelColumnAlignment: "left", thirdSortClick: true, overflowY: "auto", }, localization: { error: "Data could not be retrieved", grouping: { groupedBy: "Grouped By:", placeholder: "Drag headers here to group by", }, pagination: { labelDisplayedRows: "{from}-{to} of {count}", labelRowsPerPage: "Rows per page:", labelRowsSelect: "rows", }, toolbar: {}, header: {}, body: { filterRow: {}, editRow: { saveTooltip: "Save", cancelTooltip: "Cancel", deleteText: "Are you sure you want to delete this row?", }, addTooltip: "Add", deleteTooltip: "Delete", editTooltip: "Edit", bulkEditTooltip: "Edit All", bulkEditApprove: "Save all changes", bulkEditCancel: "Discard all changes", }, }, style: {}, };