|
|
|
@ -9,6 +9,8 @@ import Box from '@mui/material/Box';
|
|
|
|
|
import { useTheme } from '@mui/styles';
|
|
|
|
|
import dataGridKoKR from './defaultDataGridLocale';
|
|
|
|
|
import CustomPagination from './CustomPagination';
|
|
|
|
|
import { IconButton, Toolbar, Tooltip, Typography } from '@mui/material';
|
|
|
|
|
import DeleteIcon from '@mui/icons-material/Delete';
|
|
|
|
|
|
|
|
|
|
// TODO : grid style
|
|
|
|
|
/*
|
|
|
|
@ -91,9 +93,27 @@ const styles = (theme) => ({
|
|
|
|
|
});
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
const EnhancedTableToolbar = ({ children }) => (
|
|
|
|
|
<Toolbar
|
|
|
|
|
sx={{
|
|
|
|
|
p: 0,
|
|
|
|
|
pl: 1,
|
|
|
|
|
pr: 1
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
{children}
|
|
|
|
|
</Toolbar>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
EnhancedTableToolbar.propTypes = {
|
|
|
|
|
children: PropTypes.node
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// project imports
|
|
|
|
|
const MuiDataGrid = ({
|
|
|
|
|
// apiRef = () => {},
|
|
|
|
|
isToolbar = false,
|
|
|
|
|
children = <div />,
|
|
|
|
|
isCheckbox = false,
|
|
|
|
|
// isDisableSelection = true,
|
|
|
|
|
columns,
|
|
|
|
@ -107,6 +127,7 @@ const MuiDataGrid = ({
|
|
|
|
|
}) => {
|
|
|
|
|
const theme = useTheme();
|
|
|
|
|
const { pageSize } = rowsState;
|
|
|
|
|
const numSelected = selectionModel.length;
|
|
|
|
|
|
|
|
|
|
const getRowSpacing = useCallback(
|
|
|
|
|
(params) => ({
|
|
|
|
@ -141,6 +162,7 @@ const MuiDataGrid = ({
|
|
|
|
|
}
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
{isToolbar && <EnhancedTableToolbar>{children}</EnhancedTableToolbar>}
|
|
|
|
|
<DataGrid
|
|
|
|
|
// apiRef={apiRef}
|
|
|
|
|
// showCellRightBorder
|
|
|
|
@ -166,7 +188,7 @@ const MuiDataGrid = ({
|
|
|
|
|
Footer: CustomPagination
|
|
|
|
|
}}
|
|
|
|
|
componentsProps={{
|
|
|
|
|
footer: { totalCount, pageSize }
|
|
|
|
|
footer: { totalCount, pageSize, numSelected }
|
|
|
|
|
}}
|
|
|
|
|
hideFooterRowCount={false}
|
|
|
|
|
hideFooterSelectedRowCount={false}
|
|
|
|
@ -201,6 +223,8 @@ const MuiDataGrid = ({
|
|
|
|
|
|
|
|
|
|
MuiDataGrid.propTypes = {
|
|
|
|
|
// apiRef: PropTypes.func,
|
|
|
|
|
isToolbar: PropTypes.bool.isRequired,
|
|
|
|
|
children: PropTypes.node,
|
|
|
|
|
isCheckbox: PropTypes.bool,
|
|
|
|
|
// isDisableSelection: PropTypes.bool,
|
|
|
|
|
columns: PropTypes.array.isRequired,
|
|
|
|
|