Skip to content

Commit

Permalink
[DataGrid] New virtualization implementation (#2673)
Browse files Browse the repository at this point in the history
  • Loading branch information
m4theushw committed Oct 19, 2021
1 parent c1f4202 commit ba15dcd
Show file tree
Hide file tree
Showing 52 changed files with 884 additions and 1,435 deletions.
6 changes: 0 additions & 6 deletions docs/pages/api-docs/data-grid/data-grid-pro.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ The name <code>MuiDataGrid</code> can be used when providing [default props](/cu
| <span class="prop-name">onRowsScrollEnd</span> | <span class="prop-type">(params: GridRowScrollEndParams, event: MuiEvent<{}>, details: GridCallbackDetails) => void</span> | | Callback fired when scrolling to the bottom of the grid viewport. |
| <span class="prop-name">onSelectionModelChange</span> | <span class="prop-type">(model: GridSelectionModel) => void</span> | | Callback fired when the selection state of one or multiple rows changes. |
| <span class="prop-name">onSortModelChange</span> | <span class="prop-type">(model: GridSortModel) => void</span> | | Callback fired when the sort model changes before a column is sorted. |
| <span class="prop-name">onViewportRowsChange</span> | <span class="prop-type">(params: GridViewportRowsChangeParams) => void</span> | | Callback fired when the rows in the viewport change. |
| <span class="prop-name">page</span> | <span class="prop-type">number</span> | 0 | The zero-based index of the current page. |
| <span class="prop-name">pageSize</span> | <span class="prop-type">number</span> | 100 | Set the number of rows in one page. |
| <span class="prop-name">pagination</span> | <span class="prop-type">boolean</span> | false | If `true`, pagination is enabled. |
Expand Down Expand Up @@ -186,7 +185,6 @@ You can use the [slots API](/components/data-grid/components/#overriding-compone
| <span class="prop-name">columnSeparator--resizable</span> | <span class="prop-name">.MuiDataGrid-columnSeparator--resizable</span> | Styles applied to the column header separator if the column is resizable. |
| <span class="prop-name">columnSeparator--resizing</span> | <span class="prop-name">.MuiDataGrid-columnSeparator--resizing</span> | Styles applied to the column header separator if the column is being resized. |
| <span class="prop-name">columnSeparator</span> | <span class="prop-name">.MuiDataGrid-columnSeparator</span> | Styles applied to the column header separator element. |
| <span class="prop-name">dataContainer</span> | <span class="prop-name">.MuiDataGrid-dataContainer</span> | Styles applied to the data container element. |
| <span class="prop-name">editBooleanCell</span> | <span class="prop-name">.MuiDataGrid-editBooleanCell</span> | Styles applied to root of the boolean edit component. |
| <span class="prop-name">editInputCell</span> | <span class="prop-name">.MuiDataGrid-editInputCell</span> | Styles applied to the root of the input component. |
| <span class="prop-name">filterIcon</span> | <span class="prop-name">.MuiDataGrid-filterIcon</span> | Styles applied to the filter icon element. |
Expand All @@ -198,7 +196,6 @@ You can use the [slots API](/components/data-grid/components/#overriding-compone
| <span class="prop-name">menuIconButton</span> | <span class="prop-name">.MuiDataGrid-menuIconButton</span> | Styles applied to the menu icon button element. |
| <span class="prop-name">menuOpen</span> | <span class="prop-name">.MuiDataGrid-menuOpen</span> | Styles applied to the menu icon element if the menu is open. |
| <span class="prop-name">overlay</span> | <span class="prop-name">.MuiDataGrid-overlay</span> | Styles applied to the overlay element. |
| <span class="prop-name">renderingZone</span> | <span class="prop-name">.MuiDataGrid-renderingZone</span> | Styles applied to the rendering zone element. |
| <span class="prop-name">root</span> | <span class="prop-name">.MuiDataGrid-root</span> | Styles applied to the root element. |
| <span class="prop-name">row--editable</span> | <span class="prop-name">.MuiDataGrid-row--editable</span> | Styles applied to the row element if the row is editable. |
| <span class="prop-name">row--editing</span> | <span class="prop-name">.MuiDataGrid-row--editing</span> | Styles applied to the row element if the row is in edit mode. |
Expand All @@ -210,9 +207,6 @@ You can use the [slots API](/components/data-grid/components/#overriding-compone
| <span class="prop-name">selectedRowCount</span> | <span class="prop-name">.MuiDataGrid-selectedRowCount</span> | Styles applied to the footer selected row count element. |
| <span class="prop-name">sortIcon</span> | <span class="prop-name">.MuiDataGrid-sortIcon</span> | Styles applied to the sort icon element. |
| <span class="prop-name">toolbarContainer</span> | <span class="prop-name">.MuiDataGrid-toolbarContainer</span> | Styles applied to the toolbar container element. |
| <span class="prop-name">viewport</span> | <span class="prop-name">.MuiDataGrid-viewport</span> | Styles applied to the viewport element. |
| <span class="prop-name">window</span> | <span class="prop-name">.MuiDataGrid-window</span> | Styles applied to the window element. |
| <span class="prop-name">windowContainer</span> | <span class="prop-name">.MuiDataGrid-windowContainer</span> | Styles applied to the window container element. |
| <span class="prop-name">withBorder</span> | <span class="prop-name">.MuiDataGrid-withBorder</span> | Styles applied to both the cell and the column header if `showColumnRightBorder={true}`. |

You can override the style of the component thanks to one of these customization points:
Expand Down
5 changes: 0 additions & 5 deletions docs/pages/api-docs/data-grid/data-grid.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ You can use the [slots API](/components/data-grid/components/#overriding-compone
| <span class="prop-name">columnSeparator--resizable</span> | <span class="prop-name">.MuiDataGrid-columnSeparator--resizable</span> | Styles applied to the column header separator if the column is resizable. |
| <span class="prop-name">columnSeparator--resizing</span> | <span class="prop-name">.MuiDataGrid-columnSeparator--resizing</span> | Styles applied to the column header separator if the column is being resized. |
| <span class="prop-name">columnSeparator</span> | <span class="prop-name">.MuiDataGrid-columnSeparator</span> | Styles applied to the column header separator element. |
| <span class="prop-name">dataContainer</span> | <span class="prop-name">.MuiDataGrid-dataContainer</span> | Styles applied to the data container element. |
| <span class="prop-name">editBooleanCell</span> | <span class="prop-name">.MuiDataGrid-editBooleanCell</span> | Styles applied to root of the boolean edit component. |
| <span class="prop-name">editInputCell</span> | <span class="prop-name">.MuiDataGrid-editInputCell</span> | Styles applied to the root of the input component. |
| <span class="prop-name">filterIcon</span> | <span class="prop-name">.MuiDataGrid-filterIcon</span> | Styles applied to the filter icon element. |
Expand All @@ -186,7 +185,6 @@ You can use the [slots API](/components/data-grid/components/#overriding-compone
| <span class="prop-name">menuIconButton</span> | <span class="prop-name">.MuiDataGrid-menuIconButton</span> | Styles applied to the menu icon button element. |
| <span class="prop-name">menuOpen</span> | <span class="prop-name">.MuiDataGrid-menuOpen</span> | Styles applied to the menu icon element if the menu is open. |
| <span class="prop-name">overlay</span> | <span class="prop-name">.MuiDataGrid-overlay</span> | Styles applied to the overlay element. |
| <span class="prop-name">renderingZone</span> | <span class="prop-name">.MuiDataGrid-renderingZone</span> | Styles applied to the rendering zone element. |
| <span class="prop-name">root</span> | <span class="prop-name">.MuiDataGrid-root</span> | Styles applied to the root element. |
| <span class="prop-name">row--editable</span> | <span class="prop-name">.MuiDataGrid-row--editable</span> | Styles applied to the row element if the row is editable. |
| <span class="prop-name">row--editing</span> | <span class="prop-name">.MuiDataGrid-row--editing</span> | Styles applied to the row element if the row is in edit mode. |
Expand All @@ -198,9 +196,6 @@ You can use the [slots API](/components/data-grid/components/#overriding-compone
| <span class="prop-name">selectedRowCount</span> | <span class="prop-name">.MuiDataGrid-selectedRowCount</span> | Styles applied to the footer selected row count element. |
| <span class="prop-name">sortIcon</span> | <span class="prop-name">.MuiDataGrid-sortIcon</span> | Styles applied to the sort icon element. |
| <span class="prop-name">toolbarContainer</span> | <span class="prop-name">.MuiDataGrid-toolbarContainer</span> | Styles applied to the toolbar container element. |
| <span class="prop-name">viewport</span> | <span class="prop-name">.MuiDataGrid-viewport</span> | Styles applied to the viewport element. |
| <span class="prop-name">window</span> | <span class="prop-name">.MuiDataGrid-window</span> | Styles applied to the window element. |
| <span class="prop-name">windowContainer</span> | <span class="prop-name">.MuiDataGrid-windowContainer</span> | Styles applied to the window container element. |
| <span class="prop-name">withBorder</span> | <span class="prop-name">.MuiDataGrid-withBorder</span> | Styles applied to both the cell and the column header if `showColumnRightBorder={true}`. |

You can override the style of the component thanks to one of these customization points:
Expand Down
1 change: 1 addition & 0 deletions docs/scripts/generateProptypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ async function generateProptypes(program: ttp.ts.Program, sourceFile: string) {
'renderedColumns',
'scrollBarState',
'renderState',
'visibleColumns',
'cellFocus',
'cellTabIndex',
'csvOptions',
Expand Down
6 changes: 1 addition & 5 deletions docs/src/pages/components/data-grid/events/events.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,5 @@
"name": "stateChange",
"description": "Fired when the state of the grid is updated. Called with a GridState object."
},
{ "name": "unmount", "description": "Fired when the grid is unmounted." },
{
"name": "viewportRowsChange",
"description": "Fired when the rows in the viewport is changed. Called with a GridViewportRowsChange object."
}
{ "name": "unmount", "description": "Fired when the grid is unmounted." }
]
12 changes: 0 additions & 12 deletions packages/grid/_modules_/grid/GridComponentProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import { GridRowParams } from './models/params/gridRowParams';
import { GridColumnOrderChangeParams } from './models/params/gridColumnOrderChangeParams';
import { GridColumnResizeParams } from './models/params/gridColumnResizeParams';
import { GridColumnVisibilityChangeParams } from './models/params/gridColumnVisibilityChangeParams';
import { GridViewportRowsChangeParams } from './models/params/gridViewportRowsChangeParams';
import { GridSlotsComponentsProps } from './models/gridSlotsComponentsProps';
import { GridClasses } from './gridClasses';
import { GridCallbackDetails } from './models/api/gridCallbackDetails';
Expand Down Expand Up @@ -375,17 +374,6 @@ interface GridComponentOtherProps {
* @internal
*/
onStateChange?: (state: GridState, event: MuiEvent<{}>, details: GridCallbackDetails) => void;
/**
* Callback fired when the rows in the viewport change.
* @param {GridViewportRowsChangeParams} params The viewport params.
* @param {MuiEvent<{}>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onViewportRowsChange?: (
params: GridViewportRowsChangeParams,
event: MuiEvent<{}>,
details: GridCallbackDetails,
) => void;
/**
* The zero-based index of the current page.
* @default 0
Expand Down
59 changes: 0 additions & 59 deletions packages/grid/_modules_/grid/components/GridRenderingZone.tsx

This file was deleted.

Loading

0 comments on commit ba15dcd

Please sign in to comment.