-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[docs] Add missing API docs #2167
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fixes. It's easy to have this docs outdated, the sooner we upgrade the docs infra to v5, so we can use the docs generator of the main repository, the better.
@@ -143,8 +143,8 @@ export interface GridOptions { | |||
editRowsModel?: GridEditRowsModel; | |||
/** | |||
* Filtering can be processed on the server or client-side. | |||
* Set it to 'client' if you would like to handle filtering on the client-side. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still seem relevant, why remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default is client
, so I added @default
. I removed it from here as I thought we need not explicitly set it to client
because it is default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, we can move slower: only add the default mention, it's already an improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already have added the @default
tag.
@@ -84,6 +89,7 @@ import { DataGrid } from '@material-ui/data-grid'; | |||
| <span class="prop-name">onRowLeave</span> | <span class="prop-type">(param: GridRowParams, event: React.MouseEvent) => void</span> | | Callback fired when a mouse leave event comes from a row container element. | | |||
| <span class="prop-name">onSelectionModelChange</span> | <span class="prop-type">(param: GridSelectionModelChangeParams) => void</span> | | Callback fired when the selection state of one or multiple rows changes. | | |||
| <span class="prop-name">onSortModelChange</span> | <span class="prop-type">(param: GridSortModelParams) => void</span> | | Callback fired when the sort model changes before a column is sorted. | | |||
| <span class="prop-name">onStateChange</span> | <span class="prop-type">(params: any) => void</span> | | Callback fired when the state of the grid is updated. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Private API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's private we should consider removing this prop. It's not used internally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see it being used here https://github.com/mui-org/material-ui-x/blob/e6bed6b36d362810e49af90e4c6271d3c41ba93c/packages/grid/_modules_/grid/hooks/features/core/useGridApi.ts#L38
Am I incorrect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was talking about the prop. We don't use it internally. XGrid's users could still get state updates by subscribing to GRID_STATE_CHANGE
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@m4theushw We have mentioned it in some of the issues. I think that we should consider it experimental at this point (not documented). It's unclear what problem it solves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So based on this conversation there are 2 things:
- Remove the doc and the prop both.
- Only remove the doc.
What do we do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In any case, I removed this API from docs.
@@ -84,6 +89,7 @@ import { DataGrid } from '@material-ui/data-grid'; | |||
| <span class="prop-name">onRowLeave</span> | <span class="prop-type">(param: GridRowParams, event: React.MouseEvent) => void</span> | | Callback fired when a mouse leave event comes from a row container element. | | |||
| <span class="prop-name">onSelectionModelChange</span> | <span class="prop-type">(param: GridSelectionModelChangeParams) => void</span> | | Callback fired when the selection state of one or multiple rows changes. | | |||
| <span class="prop-name">onSortModelChange</span> | <span class="prop-type">(param: GridSortModelParams) => void</span> | | Callback fired when the sort model changes before a column is sorted. | | |||
| <span class="prop-name">onStateChange</span> | <span class="prop-type">(params: any) => void</span> | | Callback fired when the state of the grid is updated. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's private we should consider removing this prop. It's not used internally.
@@ -143,8 +143,8 @@ export interface GridOptions { | |||
editRowsModel?: GridEditRowsModel; | |||
/** | |||
* Filtering can be processed on the server or client-side. | |||
* Set it to 'client' if you would like to handle filtering on the client-side. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have also updated the |
I am a bit confused here that the https://material-ui.com/api/data-grid/data-grid/ is still showing While on master HEAD it has been updated: https://github.com/mui-org/material-ui-x/blob/master/docs/pages/api-docs/data-grid/data-grid.md. Did we release the docs? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work. 👍
We had a problem during the deploy. Now it's updated. |
Part of #2146 to add doc of
onCellFocusOut
prop.Also added some other props from
GridOptions
which were missing.Preview:
XGrid: https://deploy-preview-2167--material-ui-x.netlify.app/api/data-grid/x-grid/
DataGrid: https://deploy-preview-2167--material-ui-x.netlify.app/api/data-grid/data-grid/