mirror of
https://github.com/Sea-Haven-Industries/seahaven-ap.git
synced 2026-10-06 15:51:56 +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>({
|
export function MockDataGrid<R extends GridValidRowModel>({
|
||||||
"data-testid": testId,
|
"data-testid": testId,
|
||||||
sx,
|
sx,
|
||||||
|
getRowHeight,
|
||||||
...props
|
...props
|
||||||
}: MockDataGridProps<R>) {
|
}: MockDataGridProps<R>) {
|
||||||
return (
|
return (
|
||||||
|
|
@ -20,6 +21,7 @@ export function MockDataGrid<R extends GridValidRowModel>({
|
||||||
pagination: { paginationModel: { pageSize: 10, page: 0 } },
|
pagination: { paginationModel: { pageSize: 10, page: 0 } },
|
||||||
}}
|
}}
|
||||||
getRowId={(row) => row.id as string}
|
getRowId={(row) => row.id as string}
|
||||||
|
getRowHeight={getRowHeight ?? (() => "auto")}
|
||||||
sx={[
|
sx={[
|
||||||
{
|
{
|
||||||
border: 1,
|
border: 1,
|
||||||
|
|
@ -31,6 +33,15 @@ export function MockDataGrid<R extends GridValidRowModel>({
|
||||||
"& .MuiDataGrid-cell": {
|
"& .MuiDataGrid-cell": {
|
||||||
borderBottom: "1px solid",
|
borderBottom: "1px solid",
|
||||||
borderColor: "divider",
|
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": {
|
"& .MuiDataGrid-row:last-of-type .MuiDataGrid-cell": {
|
||||||
borderBottom: "none",
|
borderBottom: "none",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue