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

[DataGrid] Differenciate the pro and community versions of GridState, GridApi and GridApiRef #3648

Merged
merged 73 commits into from
Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
595aed8
[DataGrid] Differenciate the pro and community versions of GridState,…
flaviendelangle Jan 17, 2022
0e08bf9
Work
flaviendelangle Jan 17, 2022
e252740
Gen docs
flaviendelangle Jan 17, 2022
e02f987
Work
flaviendelangle Jan 17, 2022
dad3f3e
Work
flaviendelangle Jan 17, 2022
3e43030
Gen docs
flaviendelangle Jan 17, 2022
9233647
Gen docs
flaviendelangle Jan 17, 2022
2ce5214
Gen docs
flaviendelangle Jan 17, 2022
6c5e8b6
Gen docs
flaviendelangle Jan 17, 2022
84a7091
Gen docs
flaviendelangle Jan 17, 2022
6382544
Merge branch 'master' into state-pro-community
flaviendelangle Jan 18, 2022
5a4306c
Merge
flaviendelangle Jan 18, 2022
b02633a
Merge
flaviendelangle Jan 18, 2022
9e27a6b
Work
flaviendelangle Jan 18, 2022
915f766
Gen docs
flaviendelangle Jan 18, 2022
2da1d6e
Merge branch 'master' into state-pro-community
flaviendelangle Jan 19, 2022
4da768f
[DataGrid] Remove function overloading for useGridApiRef
flaviendelangle Jan 19, 2022
25b74c7
Work
flaviendelangle Jan 19, 2022
1f62ce5
Work
flaviendelangle Jan 19, 2022
f867509
Work
flaviendelangle Jan 19, 2022
5decdc6
Work
flaviendelangle Jan 19, 2022
c8927cc
Merge
flaviendelangle Jan 20, 2022
7035d40
Merge branch 'master' into apiRef-init
flaviendelangle Jan 20, 2022
a3c5d8e
Merge branch 'master' into state-pro-community
flaviendelangle Jan 21, 2022
69d45df
Work
flaviendelangle Jan 24, 2022
fa75075
Work
flaviendelangle Jan 24, 2022
56f5ed2
Work
flaviendelangle Jan 24, 2022
7fc072b
Merge
flaviendelangle Jan 25, 2022
b7ebe1a
Fix
flaviendelangle Jan 25, 2022
a442f74
Fix
flaviendelangle Jan 25, 2022
0cdaf38
Fix
flaviendelangle Jan 25, 2022
8fc3666
Work
flaviendelangle Jan 25, 2022
b4a992c
Merge branch 'master' into state-pro-community
flaviendelangle Jan 26, 2022
13f6e78
Code review: Andrew
flaviendelangle Jan 26, 2022
8a28913
Merge
flaviendelangle Jan 26, 2022
35f2d0e
Work
flaviendelangle Jan 27, 2022
7a7402c
Work
flaviendelangle Jan 27, 2022
b7086f2
Merge
flaviendelangle Jan 28, 2022
3eba08a
Merge
flaviendelangle Jan 31, 2022
7f52894
Work
flaviendelangle Jan 31, 2022
62aa35f
Work
flaviendelangle Jan 31, 2022
3517c3e
Work
flaviendelangle Jan 31, 2022
4e74315
Work
flaviendelangle Jan 31, 2022
98eaee7
Work
flaviendelangle Jan 31, 2022
a10a1ae
Work
flaviendelangle Jan 31, 2022
83ee0fe
Fix
flaviendelangle Jan 31, 2022
da77134
Merge branch 'master' into state-pro-community
flaviendelangle Feb 1, 2022
69cec52
Merge
flaviendelangle Feb 1, 2022
9f6dd01
Merge
flaviendelangle Feb 2, 2022
4b3ccdd
Work
flaviendelangle Feb 2, 2022
10297c1
Merge branch 'master' into state-pro-community
flaviendelangle Feb 2, 2022
d886de0
Work
flaviendelangle Feb 2, 2022
8bf1126
Merge branch 'master' into state-pro-community
flaviendelangle Feb 2, 2022
cb9497e
Work
flaviendelangle Feb 2, 2022
37646e2
Work
flaviendelangle Feb 2, 2022
702b849
Work
flaviendelangle Feb 2, 2022
88286a2
Fix
flaviendelangle Feb 2, 2022
f4d45a0
Work
flaviendelangle Feb 2, 2022
c3a4493
Work
flaviendelangle Feb 2, 2022
41904ba
Work
flaviendelangle Feb 2, 2022
892eb4b
Work
flaviendelangle Feb 2, 2022
96a0a02
Work
flaviendelangle Feb 2, 2022
13840c7
Work
flaviendelangle Feb 3, 2022
a1a8ccf
Merge
flaviendelangle Feb 3, 2022
1be427c
Work
flaviendelangle Feb 3, 2022
27398f8
Merge branch 'master' into state-pro-community
flaviendelangle Feb 7, 2022
23d759b
Merge branch 'master' into state-pro-community
flaviendelangle Feb 8, 2022
ff455b5
Work
flaviendelangle Feb 8, 2022
5fabdaf
work
flaviendelangle Feb 9, 2022
cd5ee8a
Work
flaviendelangle Feb 9, 2022
9b536a1
Merge branch 'master' into state-pro-community
flaviendelangle Feb 10, 2022
176cef5
Merge branch 'master' into state-pro-community
flaviendelangle Feb 11, 2022
694bfdc
Merge branch 'master' into state-pro-community
flaviendelangle Feb 14, 2022
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
3 changes: 1 addition & 2 deletions docs/data/data-grid/editing/CatchEditingEventsGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as React from 'react';
import Alert from '@mui/material/Alert';
import {
GridEvents,
GridCellParams,
GridColumns,
GridRowsProp,
useGridApiRef,
Expand All @@ -21,7 +20,7 @@ export default function CatchEditingEventsGrid() {
React.useEffect(() => {
return apiRef.current.subscribeEvent(
GridEvents.cellEditStart,
(params: GridCellParams, event) => {
(params, event) => {
setMessage(
`Editing cell with value: ${params.value} and row id: ${
params.id
Expand Down
20 changes: 10 additions & 10 deletions docs/data/data-grid/events/events.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
{
"name": "cellClick",
"description": "Fired when a cell is clicked.",
"params": "GridCellParams",
"params": "GridCellParams<any, any, any, any>",
"event": "MuiEvent<React.MouseEvent<HTMLElement>>"
},
{
"name": "cellDoubleClick",
"description": "Fired when a cell is double-clicked.",
"params": "GridCellParams",
"params": "GridCellParams<any, any, any, any>",
"event": "MuiEvent<React.MouseEvent<HTMLElement>>"
},
{
Expand All @@ -20,43 +20,43 @@
{
"name": "cellEditStart",
"description": "Fired when the cell turns to edit mode.",
"params": "GridCellParams",
"params": "GridCellParams<any, any, any, any>",
"event": "MuiEvent<React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>>"
},
{
"name": "cellEditStop",
"description": "Fired when the cell turns back to view mode.",
"params": "GridCellParams",
"params": "GridCellParams<any, any, any>",
"event": "MuiEvent<MuiBaseEvent>"
},
{
"name": "cellFocusIn",
"description": "Fired when a cell gains focus.",
"params": "GridCellParams",
"params": "GridCellParams<any, any, any, any>",
"event": "MuiEvent<{}>"
},
{
"name": "cellFocusOut",
"description": "Fired when a cell loses focus.",
"params": "GridCellParams",
"params": "GridCellParams<any, any, any, any>",
"event": "MuiEvent<MuiBaseEvent>"
},
{
"name": "cellKeyDown",
"description": "Fired when a <code>keydown</code> event happens in a cell.",
"params": "GridCellParams",
"params": "GridCellParams<any, any, any, any>",
"event": "MuiEvent<React.KeyboardEvent<HTMLElement>>"
},
{
"name": "cellMouseDown",
"description": "Fired when a <code>mousedown</code> event happens in a cell..",
"params": "GridCellParams",
"params": "GridCellParams<any, any, any, any>",
"event": "MuiEvent<React.MouseEvent<HTMLElement>>"
},
{
"name": "cellMouseUp",
"description": "Fired when a <code>mouseup</code> event happens in a cell..",
"params": "GridCellParams",
"params": "GridCellParams<any, any, any, any>",
"event": "MuiEvent<React.MouseEvent<HTMLElement>>"
},
{
Expand Down Expand Up @@ -260,7 +260,7 @@
{
"name": "stateChange",
"description": "Fired when the state of the grid is updated.",
"params": "GridState",
"params": "any",
"event": "MuiEvent<{}>"
},
{
Expand Down
10 changes: 8 additions & 2 deletions docs/data/data-grid/pagination/CursorPaginationGrid.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import * as React from 'react';
import { GridRowsProp, DataGrid, GridRowId, GridRowModel } from '@mui/x-data-grid';
import {
GridRowsProp,
DataGrid,
GridRowId,
GridRowModel,
GridApi,
} from '@mui/x-data-grid';
import { useDemoData, GridDemoData } from '@mui/x-data-grid-generator';

interface ServerBasedGridResponse {
Expand All @@ -11,7 +17,7 @@ const PAGE_SIZE = 5;

function loadServerRows(
cursor: GridRowId | null | undefined,
data: GridDemoData,
data: GridDemoData<GridApi>,
): Promise<ServerBasedGridResponse> {
return new Promise<ServerBasedGridResponse>((resolve) => {
setTimeout(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import * as React from 'react';
import { DataGrid, GridRowsProp, GridSelectionModel } from '@mui/x-data-grid';
import {
DataGrid,
GridApi,
GridRowsProp,
GridSelectionModel,
} from '@mui/x-data-grid';
import { GridDemoData, useDemoData } from '@mui/x-data-grid-generator';

function loadServerRows(page: number, data: GridDemoData): Promise<any> {
function loadServerRows(page: number, data: GridDemoData<GridApi>): Promise<any> {
return new Promise((resolve) => {
setTimeout(() => {
resolve(data.rows.slice(page * 5, (page + 1) * 5));
Expand Down
7 changes: 5 additions & 2 deletions docs/data/data-grid/sorting/ServerSortingGrid.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import * as React from 'react';
import { GridRowsProp, DataGrid, GridSortModel } from '@mui/x-data-grid';
import { GridRowsProp, DataGrid, GridSortModel, GridApi } from '@mui/x-data-grid';
import { useDemoData, GridDemoData } from '@mui/x-data-grid-generator';

const VISIBLE_FIELDS = ['name', 'rating', 'country', 'dateCreated', 'isAdmin'];

function loadServerRows(sortModel: GridSortModel, data: GridDemoData): Promise<any> {
function loadServerRows(
sortModel: GridSortModel,
data: GridDemoData<GridApi>,
): Promise<any> {
return new Promise<any>((resolve) => {
setTimeout(() => {
if (sortModel.length === 0) {
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/api-docs/data-grid/grid-cell-params.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { GridCellParams } from '@mui/x-data-grid';
| Name | Type | Description |
| :------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------- | :--------------------------------------------------------------- |
| <span class="prop-name">cellMode</span> | <span class="prop-type">GridCellMode</span> | The mode of the cell. |
| <span class="prop-name">colDef</span> | <span class="prop-type">GridStateColDef</span> | The column of the row that the current cell belongs to. |
| <span class="prop-name">colDef</span> | <span class="prop-type">GridStateColDef&lt;GridApi&gt;</span> | The column of the row that the current cell belongs to. |
| <span class="prop-name">field</span> | <span class="prop-type">string</span> | The column field of the cell that triggered the event. |
| <span class="prop-name">formattedValue</span> | <span class="prop-type">F</span> | The cell value formatted with the column valueFormatter. |
| <span class="prop-name">getValue</span> | <span class="prop-type">(id: GridRowId, field: string) =&gt; GridCellValue</span> | Get the cell value of a row and field. |
Expand Down
Loading