formatted
This commit is contained in:
@@ -1,27 +1,27 @@
|
||||
import {parseFromValuesOrFunc} from "@/core/utils/utils";
|
||||
import {Paper} from "@mui/material";
|
||||
import { parseFromValuesOrFunc } from "@/core/utils/utils";
|
||||
import { Paper } from "@mui/material";
|
||||
import DataTable_BottomToolbar from "../toolbar/BottomToolbar";
|
||||
import DataTable_TopToolbar from "../toolbar/TopToolbar";
|
||||
import DataTable_TableContainer from "./TableContainer";
|
||||
|
||||
const DataTable_Paper = ({table, ...rest}) => {
|
||||
const DataTable_Paper = ({ table, ...rest }) => {
|
||||
const {
|
||||
getState,
|
||||
options: {
|
||||
enableBottomToolbar,
|
||||
enableTopToolbar,
|
||||
mrtTheme: {baseBackgroundColor},
|
||||
mrtTheme: { baseBackgroundColor },
|
||||
muiTablePaperProps,
|
||||
renderBottomToolbar,
|
||||
renderTopToolbar,
|
||||
},
|
||||
refs: {tablePaperRef},
|
||||
refs: { tablePaperRef },
|
||||
} = table;
|
||||
|
||||
const {isFullScreen} = getState();
|
||||
const { isFullScreen } = getState();
|
||||
|
||||
const paperProps = {
|
||||
...parseFromValuesOrFunc(muiTablePaperProps, {table}),
|
||||
...parseFromValuesOrFunc(muiTablePaperProps, { table }),
|
||||
...rest,
|
||||
};
|
||||
|
||||
@@ -39,42 +39,44 @@ const DataTable_Paper = ({table, ...rest}) => {
|
||||
style={{
|
||||
...(isFullScreen
|
||||
? {
|
||||
bottom: 0,
|
||||
height: '100dvh',
|
||||
left: 0,
|
||||
margin: 0,
|
||||
maxHeight: '100dvh',
|
||||
maxWidth: '100dvw',
|
||||
padding: 0,
|
||||
position: 'fixed',
|
||||
right: 0,
|
||||
top: 0,
|
||||
width: '100dvw',
|
||||
zIndex: 999,
|
||||
}
|
||||
bottom: 0,
|
||||
height: "100dvh",
|
||||
left: 0,
|
||||
margin: 0,
|
||||
maxHeight: "100dvh",
|
||||
maxWidth: "100dvw",
|
||||
padding: 0,
|
||||
position: "fixed",
|
||||
right: 0,
|
||||
top: 0,
|
||||
width: "100dvw",
|
||||
zIndex: 999,
|
||||
}
|
||||
: {}),
|
||||
...paperProps?.style,
|
||||
}}
|
||||
sx={(theme) => ({
|
||||
backgroundColor: baseBackgroundColor,
|
||||
backgroundImage: 'unset',
|
||||
overflow: 'hidden',
|
||||
transition: 'all 100ms ease-in-out',
|
||||
...(parseFromValuesOrFunc(paperProps?.sx, theme)),
|
||||
backgroundImage: "unset",
|
||||
overflow: "hidden",
|
||||
transition: "all 100ms ease-in-out",
|
||||
...parseFromValuesOrFunc(paperProps?.sx, theme),
|
||||
})}
|
||||
>
|
||||
{enableTopToolbar &&
|
||||
(parseFromValuesOrFunc(renderTopToolbar, {table}) ?? (
|
||||
<DataTable_TopToolbar table={table} columns={paperProps.columns} table_url={paperProps.table_url}
|
||||
user_id={paperProps.user_id}
|
||||
page_name={paperProps.page_name}
|
||||
table_name={paperProps.table_name}/>
|
||||
(parseFromValuesOrFunc(renderTopToolbar, { table }) ?? (
|
||||
<DataTable_TopToolbar
|
||||
table={table}
|
||||
columns={paperProps.columns}
|
||||
table_url={paperProps.table_url}
|
||||
user_id={paperProps.user_id}
|
||||
page_name={paperProps.page_name}
|
||||
table_name={paperProps.table_name}
|
||||
/>
|
||||
))}
|
||||
<DataTable_TableContainer table={table}/>
|
||||
<DataTable_TableContainer table={table} />
|
||||
{enableBottomToolbar &&
|
||||
(parseFromValuesOrFunc(renderBottomToolbar, {table}) ?? (
|
||||
<DataTable_BottomToolbar table={table}/>
|
||||
))}
|
||||
(parseFromValuesOrFunc(renderBottomToolbar, { table }) ?? <DataTable_BottomToolbar table={table} />)}
|
||||
</Paper>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user