Skip to content

Commit

Permalink
feat: Make table height optional
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwardBrunton committed Oct 11, 2024
1 parent 056616d commit cd4516f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/ag-grid/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@equinor/workspace-ag-grid",
"version": "3.0.2",
"version": "3.0.3",
"type": "module",
"private": false,
"sideEffects": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/ag-grid/src/lib/components/ClientGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Grid } from './Grid';
import { AgGridReactProps } from '@ag-grid-community/react';

export type ClientGridProps<TData> = {
height: number;
height?: number;
gridOptions?: GridOptions<TData>;
rowData: TData[];
colDefs: ColDef[];
Expand Down
6 changes: 4 additions & 2 deletions packages/ag-grid/src/lib/components/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { AgGridReact, AgGridReactProps } from '@ag-grid-community/react';
import { ThemeProvider, theme } from '@equinor/fusion-react-styles';

type GridProps<TData> = {
height: number;
height?: number; // height is now optional
} & AgGridReactProps<TData>;

ModuleRegistry.registerModules([ClientSideRowModelModule, ServerSideRowModelModule]);
Expand All @@ -23,8 +23,10 @@ export function Grid<TData>(props: GridProps<TData>) {
export function InnerGrid<TData>({ columnDefs, gridOptions, height, rowData, modules, ...rest }: GridProps<TData>) {
const styles = useStyles() as { root: string; grid: string };

const style = height ? { height } : {};

return (
<StyledGridWrapper style={{ height }} className={`${styles.root} ag-theme-alpine-fusion`}>
<StyledGridWrapper style={style} className={`${styles.root} ag-theme-alpine-fusion`}>
<AgGridReact
rowHeight={32}
groupDisplayType={'multipleColumns'}
Expand Down
2 changes: 1 addition & 1 deletion packages/workspace-fusion/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@equinor/workspace-fusion",
"version": "9.0.16",
"version": "9.0.17",
"type": "module",
"sideEffects": false,
"license": "MIT",
Expand Down

0 comments on commit cd4516f

Please sign in to comment.