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"];
|
||||
showEmptyDatagrid?: boolean;
|
||||
rowAnchor?: (item: Item) => string;
|
||||
rowHeight?: number | ((index: number) => number);
|
||||
actionButtonPosition?: "left" | "right";
|
||||
recentlyAddedColumn?: string; // Enables scroll to recently added column
|
||||
}
|
||||
|
@ -139,6 +140,7 @@ export const Datagrid: React.FC<DatagridProps> = ({
|
|||
onRowSelectionChange,
|
||||
actionButtonPosition = "left",
|
||||
recentlyAddedColumn,
|
||||
rowHeight = cellHeight,
|
||||
...datagridProps
|
||||
}): ReactElement => {
|
||||
const classes = useStyles({ actionButtonPosition });
|
||||
|
@ -523,7 +525,7 @@ export const Datagrid: React.FC<DatagridProps> = ({
|
|||
onItemHovered={handleRowHover}
|
||||
getRowThemeOverride={handleGetThemeOverride}
|
||||
gridSelection={selection}
|
||||
rowHeight={cellHeight}
|
||||
rowHeight={rowHeight}
|
||||
headerHeight={cellHeight}
|
||||
ref={editor}
|
||||
onPaste
|
||||
|
|
Loading…
Reference in a new issue