Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Make table height optional #645

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading