Add rowHeight prop to Datagrid component (#3888)
* Add rowHeight prop to Datagrid component * Add changeset
This commit is contained in:
parent
6d6d1588b3
commit
093388c46f
2 changed files with 8 additions and 1 deletions
5
.changeset/curly-pears-end.md
Normal file
5
.changeset/curly-pears-end.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
"saleor-dashboard": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Add rowHeight prop to Datagrid component
|
|
@ -105,6 +105,7 @@ export interface DatagridProps {
|
||||||
columnSelect?: DataEditorProps["columnSelect"];
|
columnSelect?: DataEditorProps["columnSelect"];
|
||||||
showEmptyDatagrid?: boolean;
|
showEmptyDatagrid?: boolean;
|
||||||
rowAnchor?: (item: Item) => string;
|
rowAnchor?: (item: Item) => string;
|
||||||
|
rowHeight?: number | ((index: number) => number);
|
||||||
actionButtonPosition?: "left" | "right";
|
actionButtonPosition?: "left" | "right";
|
||||||
recentlyAddedColumn?: string; // Enables scroll to recently added column
|
recentlyAddedColumn?: string; // Enables scroll to recently added column
|
||||||
}
|
}
|
||||||
|
@ -139,6 +140,7 @@ export const Datagrid: React.FC<DatagridProps> = ({
|
||||||
onRowSelectionChange,
|
onRowSelectionChange,
|
||||||
actionButtonPosition = "left",
|
actionButtonPosition = "left",
|
||||||
recentlyAddedColumn,
|
recentlyAddedColumn,
|
||||||
|
rowHeight = cellHeight,
|
||||||
...datagridProps
|
...datagridProps
|
||||||
}): ReactElement => {
|
}): ReactElement => {
|
||||||
const classes = useStyles({ actionButtonPosition });
|
const classes = useStyles({ actionButtonPosition });
|
||||||
|
@ -523,7 +525,7 @@ export const Datagrid: React.FC<DatagridProps> = ({
|
||||||
onItemHovered={handleRowHover}
|
onItemHovered={handleRowHover}
|
||||||
getRowThemeOverride={handleGetThemeOverride}
|
getRowThemeOverride={handleGetThemeOverride}
|
||||||
gridSelection={selection}
|
gridSelection={selection}
|
||||||
rowHeight={cellHeight}
|
rowHeight={rowHeight}
|
||||||
headerHeight={cellHeight}
|
headerHeight={cellHeight}
|
||||||
ref={editor}
|
ref={editor}
|
||||||
onPaste
|
onPaste
|
||||||
|
|
Loading…
Reference in a new issue