mirror of
https://github.com/Sea-Haven-Industries/seahaven-ap.git
synced 2026-10-01 09:43:17 +00:00
feat(web): support auto row height for multi-line invoice cells
Refs: AP-44
This commit is contained in:
parent
8b75835310
commit
e23ba0f4bb
1 changed files with 11 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ type MockDataGridProps<R extends GridValidRowModel> = DataGridProps<R> & {
|
|||
export function MockDataGrid<R extends GridValidRowModel>({
|
||||
"data-testid": testId,
|
||||
sx,
|
||||
getRowHeight,
|
||||
...props
|
||||
}: MockDataGridProps<R>) {
|
||||
return (
|
||||
|
|
@ -20,6 +21,7 @@ export function MockDataGrid<R extends GridValidRowModel>({
|
|||
pagination: { paginationModel: { pageSize: 10, page: 0 } },
|
||||
}}
|
||||
getRowId={(row) => row.id as string}
|
||||
getRowHeight={getRowHeight ?? (() => "auto")}
|
||||
sx={[
|
||||
{
|
||||
border: 1,
|
||||
|
|
@ -31,6 +33,15 @@ export function MockDataGrid<R extends GridValidRowModel>({
|
|||
"& .MuiDataGrid-cell": {
|
||||
borderBottom: "1px solid",
|
||||
borderColor: "divider",
|
||||
py: 1,
|
||||
alignItems: "flex-start",
|
||||
display: "flex",
|
||||
},
|
||||
"& .MuiDataGrid-cellContent": {
|
||||
whiteSpace: "normal",
|
||||
wordBreak: "break-word",
|
||||
lineHeight: 1.35,
|
||||
width: "100%",
|
||||
},
|
||||
"& .MuiDataGrid-row:last-of-type .MuiDataGrid-cell": {
|
||||
borderBottom: "none",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue