Skip to content
New issue

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

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

Already on GitHub? # to your account

[DataGrid] Include api in gridCellParams interface #14201

Merged
merged 5 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 1 addition & 4 deletions packages/x-data-grid/src/components/cell/GridCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
unstable_ownerDocument as ownerDocument,
unstable_capitalize as capitalize,
} from '@mui/utils';
import type { GridApiCommunity } from '../../internals';
import { fastMemo } from '../../utils/fastMemo';
import { doesSupportPreventScroll } from '../../utils/doesSupportPreventScroll';
import { getDataGridUtilityClass, gridClasses } from '../../constants/gridClasses';
Expand Down Expand Up @@ -75,9 +74,7 @@ export type GridCellProps = {
[x: string]: any; // TODO v7: remove this - it breaks type safety
};

type CellParamsWithAPI = GridCellParams<any, any, any, GridTreeNodeWithRender> & {
api: GridApiCommunity;
};
type CellParamsWithAPI = GridCellParams<any, any, any, GridTreeNodeWithRender>;

const EMPTY_CELL_PARAMS: CellParamsWithAPI = {
id: -1,
Expand Down
4 changes: 4 additions & 0 deletions packages/x-data-grid/src/models/params/gridCellParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ export interface GridCellParams<
* the tabIndex value.
*/
tabIndex: 0 | -1;
/**
* The api of `DataGrid`.
*/
api: GridApiCommunity;
}

export interface FocusElement {
Expand Down
Loading