|
|
|
@@ -1,7 +1,7 @@ |
|
|
|
import { styled } from "@mui/material"; |
|
|
|
import { DataGrid } from "@mui/x-data-grid"; |
|
|
|
|
|
|
|
const StyledDataGrid = styled(DataGrid)(({ theme }) => ({ |
|
|
|
import { DataGrid ,DataGridProps,zhTW} from "@mui/x-data-grid"; |
|
|
|
import { forwardRef } from "react"; |
|
|
|
const StyledDataGridBase = styled(DataGrid)(({ theme }) => ({ |
|
|
|
"--unstable_DataGrid-radius": 0, |
|
|
|
// "& .MuiDataGrid-columnHeader": { |
|
|
|
// height: "unset !important" |
|
|
|
@@ -31,5 +31,16 @@ const StyledDataGrid = styled(DataGrid)(({ theme }) => ({ |
|
|
|
padding: '1px 6px', |
|
|
|
}, |
|
|
|
})); |
|
|
|
|
|
|
|
const StyledDataGrid = forwardRef<HTMLDivElement, DataGridProps>((props, ref) => { |
|
|
|
return ( |
|
|
|
<StyledDataGridBase |
|
|
|
ref={ref} |
|
|
|
{...props} |
|
|
|
localeText={{ |
|
|
|
...zhTW.components.MuiDataGrid.defaultProps.localeText, |
|
|
|
...props.localeText, // 允许覆盖 |
|
|
|
}} |
|
|
|
/> |
|
|
|
); |
|
|
|
}); |
|
|
|
export default StyledDataGrid; |