wip:milestone 0 fixes
Some checks failed
CI/CD Pipeline / unit-tests (push) Failing after 1m16s
CI/CD Pipeline / integration-tests (push) Failing after 2m32s
CI/CD Pipeline / lint (push) Successful in 5m22s
CI/CD Pipeline / e2e-tests (push) Has been skipped
CI/CD Pipeline / build (push) Has been skipped

This commit is contained in:
2026-03-15 12:35:42 +02:00
parent 6708cf28a7
commit cffdf8af86
61266 changed files with 4511646 additions and 1938 deletions

View File

@@ -0,0 +1,157 @@
import * as React from 'react';
import { GridCellMode } from '../gridCell';
import { GridRowId, GridRowModel, GridTreeNode, GridTreeNodeWithRender, GridValidRowModel } from '../gridRows';
import type { GridStateColDef } from '../colDef/gridColDef';
import { GridEditCellProps } from '../gridEditRowModel';
import { GridApiCommunity } from '../api/gridApiCommunity';
/**
* Object passed as parameter in the column [[GridColDef]] cell renderer.
*/
export interface GridCellParams<R extends GridValidRowModel = any, V = unknown, F = V, N extends GridTreeNode = GridTreeNode> {
/**
* The grid row id.
*/
id: GridRowId;
/**
* The column field of the cell that triggered the event.
*/
field: string;
/**
* The cell value.
* If the column has `valueGetter`, use `params.row` to directly access the fields.
*/
value?: V | undefined;
/**
* The cell value formatted with the column valueFormatter.
*/
formattedValue?: F | undefined;
/**
* The row model of the row that the current cell belongs to.
*/
row: GridRowModel<R>;
/**
* The node of the row that the current cell belongs to.
*/
rowNode: N;
/**
* The column of the row that the current cell belongs to.
*/
colDef: GridStateColDef;
/**
* If true, the cell is editable.
*/
isEditable?: boolean;
/**
* The mode of the cell.
*/
cellMode: GridCellMode;
/**
* If true, the cell is the active element.
*/
hasFocus: boolean;
/**
* the tabIndex value.
*/
tabIndex: 0 | -1;
}
export interface FocusElement {
focus(): void;
}
/**
* GridCellParams containing api.
*/
export interface GridRenderCellParams<R extends GridValidRowModel = any, V = any, F = V, N extends GridTreeNodeWithRender = GridTreeNodeWithRender> extends GridCellParams<R, V, F, N> {
/**
* GridApi that let you manipulate the grid.
*/
api: GridApiCommunity;
/**
* A ref allowing to set imperative focus.
* It can be passed to the element that should receive focus.
* @ignore - do not document.
*/
focusElementRef?: React.Ref<FocusElement>;
}
/**
* GridEditCellProps containing api.
*/
export interface GridRenderEditCellParams<R extends GridValidRowModel = any, V = any, F = V, N extends GridTreeNodeWithRender = GridTreeNodeWithRender> extends GridCellParams<R, V, F, N>, GridEditCellProps<V> {
/**
* GridApi that let you manipulate the grid.
*/
api: GridApiCommunity;
}
/**
* Parameters passed to `colDef.valueGetter`.
*/
export interface GridValueGetterParams<R extends GridValidRowModel = any, V = any, N extends GridTreeNodeWithRender = GridTreeNodeWithRender> extends Omit<GridCellParams<R, V, any, N>, 'formattedValue' | 'isEditable'> {
/**
* GridApi that let you manipulate the grid.
*/
api: GridApiCommunity;
/**
* The default value for the cell that the `valueGetter` is overriding.
*/
value: GridCellParams<R, V, any>['value'];
}
/**
* Object passed as parameter in the column [[GridColDef]] value setter callback.
*/
export interface GridValueSetterParams<R extends GridValidRowModel = any, V = any> {
/**
* The new cell value.
*/
value: V;
/**
* The row that is being edited.
*/
row: R;
}
/**
* Object passed as parameter in the column [[GridColDef]] value formatter callback.
*/
export interface GridValueFormatterParams<V = any> {
/**
* The grid row id.
* It is not available when the value formatter is called by the filter panel.
*/
id?: GridRowId;
/**
* The column field of the cell that triggered the event.
*/
field: string;
/**
* The cell value, if the column has valueGetter it is the value returned by it.
*/
value: V;
/**
* GridApi that let you manipulate the grid.
*/
api: GridApiCommunity;
}
/**
* Object passed as parameter in the column [[GridColDef]] edit cell props change callback.
*/
export interface GridPreProcessEditCellProps<V = any, R extends GridValidRowModel = any> {
/**
* The grid row id.
*/
id: GridRowId;
/**
* The row that is being edited.
*/
row: GridRowModel<R>;
/**
* The edit cell props.
*/
props: GridEditCellProps<V>;
/**
* Whether the new value is different from the stored value or not.
*/
hasChanged?: boolean;
/**
* Object containing the props of the other fields.
* Only available for row editing and when using the new editing API.
*/
otherFieldsProps?: Record<string, GridEditCellProps<V>>;
}

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,30 @@
import { GridColumnGroup } from '../gridColumnGrouping';
/**
* Object passed as parameter in the column group header renderer.
*/
export interface GridColumnGroupHeaderParams extends Pick<GridColumnGroup, 'headerName' | 'description'> {
/**
* A unique string identifying the group.
*/
groupId: GridColumnGroup['groupId'] | null;
/**
* The number parent the group have.
*/
depth: number;
/**
* The maximal depth among visible columns.
*/
maxDepth: number;
/**
* The column fields included in the group (including nested ones).
*/
fields: string[];
/**
* The column index (0 based).
*/
colIndex: number;
/**
* Indicate if the group is the last one for the given depth.
*/
isLastColumn: boolean;
}

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,15 @@
import type { GridStateColDef } from '../colDef/gridColDef';
import { GridValidRowModel } from '../gridRows';
/**
* Object passed as parameter in the column [[GridColDef]] header renderer.
*/
export interface GridColumnHeaderParams<R extends GridValidRowModel = GridValidRowModel, V = any, F = V> {
/**
* The column field of the column that triggered the event
*/
field: string;
/**
* The column of the current header component.
*/
colDef: GridStateColDef<R, V, F>;
}

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,18 @@
import type { GridColDef } from '../colDef/gridColDef';
/**
* Object passed as parameter of the column order change event.
*/
export interface GridColumnOrderChangeParams {
/**
* The column of the current header component.
*/
column: GridColDef;
/**
* The target column index.
*/
targetIndex: number;
/**
* The old column index.
*/
oldIndex: number;
}

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,19 @@
import type { GridStateColDef } from '../colDef/gridColDef';
/**
* Object passed as parameter of the column resize event.
* TODO: Move to `x-data-grid-pro` folder
*/
export interface GridColumnResizeParams {
/**
* The HTMLElement column header element.
*/
element?: HTMLElement | null;
/**
* The column of the current header component.
*/
colDef: GridStateColDef;
/**
* The width of the column.
*/
width: number;
}

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,65 @@
import { GridRowId, GridValidRowModel } from '../gridRows';
import { GridCellParams } from './gridCellParams';
/**
* Params passed to `apiRef.current.setEditCellValue`.
*/
export interface GridEditCellValueParams {
/**
* The row id.
*/
id: GridRowId;
/**
* The field.
*/
field: string;
/**
* The new value for the cell.
*/
value: any;
/**
* The debounce time in milliseconds.
*/
debounceMs?: number;
/**
* TBD
*/
unstable_skipValueParser?: boolean;
}
declare enum GridCellEditStartReasons {
enterKeyDown = "enterKeyDown",
cellDoubleClick = "cellDoubleClick",
printableKeyDown = "printableKeyDown",
deleteKeyDown = "deleteKeyDown",
pasteKeyDown = "pasteKeyDown"
}
/**
* Params passed to the `cellEditStart` event.
*/
export interface GridCellEditStartParams<R extends GridValidRowModel = any, V = any, F = V> extends GridCellParams<R, V, F> {
/**
* The reason for this event to be triggered.
*/
reason?: GridCellEditStartReasons;
/**
* If the reason is related to a keyboard event, it contains which key was pressed.
* @deprecated No longer needed.
*/
key?: string;
}
declare enum GridCellEditStopReasons {
cellFocusOut = "cellFocusOut",
escapeKeyDown = "escapeKeyDown",
enterKeyDown = "enterKeyDown",
tabKeyDown = "tabKeyDown",
shiftTabKeyDown = "shiftTabKeyDown"
}
/**
* Params passed to the `cellEditStop event.
*/
export interface GridCellEditStopParams<R extends GridValidRowModel = any, V = any, F = V> extends GridCellParams<R, V, F> {
/**
* The reason for this event to be triggered.
*/
reason?: GridCellEditStopReasons;
}
export { GridCellEditStartReasons, GridCellEditStopReasons };

View File

@@ -0,0 +1,27 @@
/**
* Params passed to `apiRef.current.setEditCellValue`.
*/
var GridCellEditStartReasons = /*#__PURE__*/function (GridCellEditStartReasons) {
GridCellEditStartReasons["enterKeyDown"] = "enterKeyDown";
GridCellEditStartReasons["cellDoubleClick"] = "cellDoubleClick";
GridCellEditStartReasons["printableKeyDown"] = "printableKeyDown";
GridCellEditStartReasons["deleteKeyDown"] = "deleteKeyDown";
GridCellEditStartReasons["pasteKeyDown"] = "pasteKeyDown";
return GridCellEditStartReasons;
}(GridCellEditStartReasons || {});
/**
* Params passed to the `cellEditStart` event.
*/
var GridCellEditStopReasons = /*#__PURE__*/function (GridCellEditStopReasons) {
GridCellEditStopReasons["cellFocusOut"] = "cellFocusOut";
GridCellEditStopReasons["escapeKeyDown"] = "escapeKeyDown";
GridCellEditStopReasons["enterKeyDown"] = "enterKeyDown";
GridCellEditStopReasons["tabKeyDown"] = "tabKeyDown";
GridCellEditStopReasons["shiftTabKeyDown"] = "shiftTabKeyDown";
return GridCellEditStopReasons;
}(GridCellEditStopReasons || {});
/**
* Params passed to the `cellEditStop event.
*/
// https://github.com/mui/mui-x/pull/3738#discussion_r798504277
export { GridCellEditStartReasons, GridCellEditStopReasons };

View File

@@ -0,0 +1,3 @@
export interface GridHeaderSelectionCheckboxParams {
value: boolean;
}

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,6 @@
export interface GridMenuParams {
/**
* The element that opens the menu.
*/
target: HTMLElement | null;
}

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,3 @@
import { GridPreferencePanelState } from '../../hooks/features/preferencesPanel/gridPreferencePanelState';
export interface GridPreferencePanelParams extends Omit<GridPreferencePanelState, 'open'> {
}

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,10 @@
export interface GridRenderedRowsIntervalChangeParams {
/**
* The index of the first row to render.
*/
firstRowToRender: number;
/**
* The index of the last row to render.
*/
lastRowToRender: number;
}

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,112 @@
import { GridValidRowModel, GridRowEntry, GridRowId } from '../gridRows';
import type { GridColDef } from '../colDef/gridColDef';
/**
* Object passed as parameter in the row callbacks.
* @demos
* - [Master detail](/x/react-data-grid/master-detail/)
*/
export interface GridRowParams<R extends GridValidRowModel = any> {
/**
* The grid row id.
*/
id: GridRowId;
/**
* The row model of the row that the current cell belongs to.
*/
row: R;
/**
* All grid columns.
*/
columns: GridColDef[];
}
interface GridRowVisibilityParams {
/**
* Whether this row is the first visible or not.
*/
isFirstVisible: boolean;
/**
* Whether this row is the last visible or not.
*/
isLastVisible: boolean;
/**
* Index of the row in the current page.
* If the pagination is disabled, it will be the index relative to all filtered rows.
*/
indexRelativeToCurrentPage: number;
}
/**
* Object passed as parameter in the row `getRowClassName` callback prop.
* @demos
* - [Styling rows](/x/react-data-grid/style/#styling-rows)
*/
export interface GridRowClassNameParams<R extends GridValidRowModel = any> extends GridRowParams<R>, GridRowVisibilityParams {
}
/**
* Object passed as parameter in the row `getRowHeight` callback prop.
*/
export interface GridRowHeightParams extends GridRowEntry {
/**
* The grid current density factor.
*/
densityFactor: number;
}
/**
* The getRowHeight return value.
*/
export type GridRowHeightReturnValue = number | null | undefined | 'auto';
declare enum GridRowEditStartReasons {
enterKeyDown = "enterKeyDown",
cellDoubleClick = "cellDoubleClick",
printableKeyDown = "printableKeyDown",
deleteKeyDown = "deleteKeyDown"
}
/**
* Params passed to the `rowEditStart` event.
*/
export interface GridRowEditStartParams<R extends GridValidRowModel = any> extends GridRowParams<R> {
/**
* Which field triggered this event.
*/
field?: string;
/**
* The reason for this event to be triggered.
*/
reason?: GridRowEditStartReasons;
/**
* If the reason is related to a keyboard event, it contains which key was pressed.
* @deprecated No longer needed.
*/
key?: string;
}
declare enum GridRowEditStopReasons {
rowFocusOut = "rowFocusOut",
escapeKeyDown = "escapeKeyDown",
enterKeyDown = "enterKeyDown",
tabKeyDown = "tabKeyDown",
shiftTabKeyDown = "shiftTabKeyDown"
}
export interface GridRowEditStopParams<R extends GridValidRowModel = any> extends GridRowParams<R> {
/**
* Which field triggered this event.
*/
field?: string;
/**
* The reason for this event to be triggered.
*/
reason?: GridRowEditStopReasons;
}
/**
* Object passed as parameter in the row `getRowSpacing` callback prop.
* @demos
* - [Row spacing](/x/react-data-grid/row-height/#row-spacing)
*/
export interface GridRowSpacingParams extends GridRowEntry, GridRowVisibilityParams {
}
/**
* The getRowSpacing return value.
*/
export interface GridRowSpacing {
top?: number;
bottom?: number;
}
export { GridRowEditStartReasons, GridRowEditStopReasons };

View File

@@ -0,0 +1,44 @@
/**
* Object passed as parameter in the row callbacks.
* @demos
* - [Master detail](/x/react-data-grid/master-detail/)
*/
/**
* Object passed as parameter in the row `getRowClassName` callback prop.
* @demos
* - [Styling rows](/x/react-data-grid/style/#styling-rows)
*/
/**
* Object passed as parameter in the row `getRowHeight` callback prop.
*/
/**
* The getRowHeight return value.
*/
var GridRowEditStartReasons = /*#__PURE__*/function (GridRowEditStartReasons) {
GridRowEditStartReasons["enterKeyDown"] = "enterKeyDown";
GridRowEditStartReasons["cellDoubleClick"] = "cellDoubleClick";
GridRowEditStartReasons["printableKeyDown"] = "printableKeyDown";
GridRowEditStartReasons["deleteKeyDown"] = "deleteKeyDown";
return GridRowEditStartReasons;
}(GridRowEditStartReasons || {});
/**
* Params passed to the `rowEditStart` event.
*/
var GridRowEditStopReasons = /*#__PURE__*/function (GridRowEditStopReasons) {
GridRowEditStopReasons["rowFocusOut"] = "rowFocusOut";
GridRowEditStopReasons["escapeKeyDown"] = "escapeKeyDown";
GridRowEditStopReasons["enterKeyDown"] = "enterKeyDown";
GridRowEditStopReasons["tabKeyDown"] = "tabKeyDown";
GridRowEditStopReasons["shiftTabKeyDown"] = "shiftTabKeyDown";
return GridRowEditStopReasons;
}(GridRowEditStopReasons || {});
/**
* Object passed as parameter in the row `getRowSpacing` callback prop.
* @demos
* - [Row spacing](/x/react-data-grid/row-height/#row-spacing)
*/
/**
* The getRowSpacing return value.
*/
// https://github.com/mui/mui-x/pull/3738#discussion_r798504277
export { GridRowEditStartReasons, GridRowEditStopReasons };

View File

@@ -0,0 +1,5 @@
import { GridRowId } from '../gridRows';
export interface GridRowSelectionCheckboxParams {
value: boolean;
id: GridRowId;
}

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,12 @@
export interface GridRenderContext {
firstRowIndex: number;
lastRowIndex: number;
firstColumnIndex: number;
lastColumnIndex: number;
}
export interface GridScrollParams {
left: number;
top: number;
renderContext?: GridRenderContext;
}
export type GridScrollFn = (v: GridScrollParams) => void;

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,18 @@
import { GridRowId, GridValidRowModel } from '../gridRows';
/**
* Object passed as parameter of the valueOptions function for singleSelect column.
*/
export interface GridValueOptionsParams<R extends GridValidRowModel = any> {
/**
* The field of the column to which options will be provided
*/
field: string;
/**
* The grid row id.
*/
id?: GridRowId;
/**
* The row model of the row that the current cell belongs to.
*/
row?: R;
}

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,14 @@
export * from './gridColumnHeaderParams';
export * from './gridColumnGroupHeaderParams';
export * from './gridColumnOrderChangeParams';
export * from './gridColumnResizeParams';
export * from './gridEditCellParams';
export * from './gridRowParams';
export * from './gridScrollParams';
export * from './gridRowSelectionCheckboxParams';
export * from './gridHeaderSelectionCheckboxParams';
export * from './gridValueOptionsParams';
export * from './gridCellParams';
export * from './gridPreferencePanelParams';
export * from './gridMenuParams';
export * from './gridRenderedRowsIntervalChangeParams';

View File

@@ -0,0 +1,14 @@
export * from './gridColumnHeaderParams';
export * from './gridColumnGroupHeaderParams';
export * from './gridColumnOrderChangeParams';
export * from './gridColumnResizeParams';
export * from './gridEditCellParams';
export * from './gridRowParams';
export * from './gridScrollParams';
export * from './gridRowSelectionCheckboxParams';
export * from './gridHeaderSelectionCheckboxParams';
export * from './gridValueOptionsParams';
export * from './gridCellParams';
export * from './gridPreferencePanelParams';
export * from './gridMenuParams';
export * from './gridRenderedRowsIntervalChangeParams';