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,36 @@
import { GridColumnApi } from './gridColumnApi';
import { GridColumnMenuApi } from './gridColumnMenuApi';
import { GridCoreApi, GridCorePrivateApi } from './gridCoreApi';
import { GridCsvExportApi } from './gridCsvExportApi';
import { GridDensityApi } from './gridDensityApi';
import { GridEditingApi, GridEditingPrivateApi } from './gridEditingApi';
import { GridFilterApi } from './gridFilterApi';
import { GridFocusApi, GridFocusPrivateApi } from './gridFocusApi';
import { GridLocaleTextApi } from './gridLocaleTextApi';
import type { GridParamsApi } from './gridParamsApi';
import { GridPreferencesPanelApi } from './gridPreferencesPanelApi';
import { GridPrintExportApi } from './gridPrintExportApi';
import { GridRowApi } from './gridRowApi';
import { GridRowsMetaApi, GridRowsMetaPrivateApi } from './gridRowsMetaApi';
import { GridRowSelectionApi } from './gridRowSelectionApi';
import { GridSortApi } from './gridSortApi';
import { GridStateApi, GridStatePrivateApi } from './gridStateApi';
import { GridLoggerApi } from './gridLoggerApi';
import { GridScrollApi } from './gridScrollApi';
import { GridVirtualizationApi, GridVirtualizationPrivateApi } from './gridVirtualizationApi';
import type { GridPipeProcessingApi, GridPipeProcessingPrivateApi } from '../../hooks/core/pipeProcessing';
import { GridColumnSpanningApi, GridColumnSpanningPrivateApi } from './gridColumnSpanning';
import type { GridStrategyProcessingApi } from '../../hooks/core/strategyProcessing';
import type { GridDimensionsApi, GridDimensionsPrivateApi } from '../../hooks/features/dimensions/gridDimensionsApi';
import type { GridPaginationApi } from '../../hooks/features/pagination';
import type { GridStatePersistenceApi } from '../../hooks/features/statePersistence';
import { GridColumnGroupingApi } from './gridColumnGroupingApi';
import type { GridInitialStateCommunity, GridStateCommunity } from '../gridStateCommunity';
import { GridHeaderFilteringApi, GridHeaderFilteringPrivateApi } from './gridHeaderFilteringApi';
import type { DataGridProcessedProps } from '../props/DataGridProps';
export interface GridApiCommon<GridState extends GridStateCommunity = any, GridInitialState extends GridInitialStateCommunity = any> extends GridCoreApi, GridPipeProcessingApi, GridDensityApi, GridDimensionsApi, GridRowApi, GridRowsMetaApi, GridEditingApi, GridParamsApi, GridColumnApi, GridRowSelectionApi, GridSortApi, GridPaginationApi, GridCsvExportApi, GridFocusApi, GridFilterApi, GridColumnMenuApi, GridPreferencesPanelApi, GridPrintExportApi, GridVirtualizationApi, GridLocaleTextApi, GridScrollApi, GridColumnSpanningApi, GridStateApi<GridState>, GridStatePersistenceApi<GridInitialState>, GridColumnGroupingApi, GridHeaderFilteringApi {
}
export interface GridPrivateOnlyApiCommon<Api extends GridApiCommon, PrivateApi extends GridPrivateApiCommon, Props extends DataGridProcessedProps> extends GridCorePrivateApi<Api, PrivateApi, Props>, GridStatePrivateApi<PrivateApi['state']>, GridPipeProcessingPrivateApi, GridStrategyProcessingApi, GridColumnSpanningPrivateApi, GridRowsMetaPrivateApi, GridDimensionsPrivateApi, GridEditingPrivateApi, GridLoggerApi, GridFocusPrivateApi, GridHeaderFilteringPrivateApi, GridVirtualizationPrivateApi {
}
export interface GridPrivateApiCommon extends GridApiCommon, GridPrivateOnlyApiCommon<GridApiCommon, GridPrivateApiCommon, DataGridProcessedProps> {
}

View File

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

View File

@@ -0,0 +1,13 @@
import type { GridInitialStateCommunity, GridStateCommunity } from '../gridStateCommunity';
import type { DataGridProcessedProps } from '../props/DataGridProps';
import type { GridApiCommon, GridPrivateOnlyApiCommon } from './gridApiCommon';
import type { GridColumnReorderApi } from './gridColumnApi';
import { GridRowProApi } from './gridRowApi';
import { GridRowMultiSelectionApi } from './gridRowSelectionApi';
/**
* The api of `DataGrid`.
*/
export interface GridApiCommunity extends GridApiCommon<GridStateCommunity, GridInitialStateCommunity> {
}
export interface GridPrivateApiCommunity extends GridApiCommunity, GridPrivateOnlyApiCommon<GridApiCommunity, GridPrivateApiCommunity, DataGridProcessedProps>, GridRowMultiSelectionApi, GridColumnReorderApi, GridRowProApi {
}

View File

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

View File

@@ -0,0 +1,10 @@
import { GridControlledStateReasonLookup } from '../events/gridEventLookup';
/**
* Additional details passed to the callbacks
*/
export interface GridCallbackDetails<K extends keyof GridControlledStateReasonLookup = any> {
/**
* The reason for this callback to have been called.
*/
reason?: GridControlledStateReasonLookup[K];
}

View File

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

View File

@@ -0,0 +1,74 @@
import { GridColDef, GridStateColDef } from '../colDef/gridColDef';
import type { GridColumnVisibilityModel } from '../../hooks/features/columns/gridColumnsInterfaces';
/**
* The column API interface that is available in the grid [[apiRef]].
* TODO: Differentiate interfaces based on the plan
*/
export interface GridColumnApi {
/**
* Returns the [[GridColDef]] for the given `field`.
* @param {string} field The column field.
* @returns {{GridStateColDef}} The [[GridStateColDef]].
*/
getColumn: (field: string) => GridStateColDef;
/**
* Returns an array of [[GridColDef]] containing all the column definitions.
* @returns {GridStateColDef[]} An array of [[GridStateColDef]].
*/
getAllColumns: () => GridStateColDef[];
/**
* Returns the currently visible columns.
* @returns {GridStateColDef[]} An array of [[GridStateColDef]].
*/
getVisibleColumns: () => GridStateColDef[];
/**
* Returns the index position of a column. By default, only the visible columns are considered.
* Pass `false` to `useVisibleColumns` to consider all columns.
* @param {string} field The column field.
* @param {boolean} useVisibleColumns Determines if all columns or the visible ones should be considered. Default is `true`.
* @returns {number} The index position.
*/
getColumnIndex: (field: string, useVisibleColumns?: boolean) => number;
/**
* Returns the left-position of a column relative to the inner border of the grid.
* @param {string} field The column field.
* @returns {number} The position in pixels.
*/
getColumnPosition: (field: string) => number;
/**
* Updates the definition of multiple columns at the same time.
* @param {GridColDef[]} cols The new column [[GridColDef]] objects.
*/
updateColumns: (cols: GridColDef[]) => void;
/**
* Sets the column visibility model to the one given by `model`.
* @param {GridColumnVisibilityModel} model The new visible columns model.
*/
setColumnVisibilityModel: (model: GridColumnVisibilityModel) => void;
/**
* Changes the visibility of the column referred by `field`.
* @param {string} field The column to change visibility.
* @param {boolean} isVisible Pass `true` to show the column, or `false` to hide it. Default is `false`
*/
setColumnVisibility: (field: string, isVisible: boolean) => void;
/**
* Updates the width of a column.
* @param {string} field The column field.
* @param {number} width The new width.
*/
setColumnWidth: (field: string, width: number) => void;
/**
* Gets the index of a column relative to the columns that are reachable by scroll.
* @param {string} field The column field.
* @returns {number} The index of the column.
*/
getColumnIndexRelativeToVisibleColumns: (field: string) => number;
}
export interface GridColumnReorderApi {
/**
* Moves a column from its original position to the position given by `targetIndexPosition`.
* @param {string} field The field name
* @param {number} targetIndexPosition The new position (0-based).
*/
setColumnIndex: (field: string, targetIndexPosition: number) => void;
}

View File

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

View File

@@ -0,0 +1,19 @@
import { GridColumnGroupLookup } from '../../hooks/features/columnGrouping/gridColumnGroupsInterfaces';
import { GridColumnGroup } from '../gridColumnGrouping';
/**
* The column grouping API interface that is available in the grid [[apiRef]].
*/
export interface GridColumnGroupingApi {
/**
* Returns the id of the groups leading to the requested column.
* The array is ordered by increasing depth (the last element is the direct parent of the column).
* @param {string} field The field of of the column requested.
* @returns {string[]} The id of the groups leading to the requested column.
*/
unstable_getColumnGroupPath: (field: string) => GridColumnGroup['groupId'][];
/**
* Returns the column group lookup.
* @returns {GridColumnGroupLookup} The column group lookup.
*/
unstable_getAllGroupDetails: () => GridColumnGroupLookup;
}

View File

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

View File

@@ -0,0 +1,19 @@
/**
* The column menu API interface that is available in the grid [[apiRef]].
*/
export interface GridColumnMenuApi {
/**
* Display the column menu under the `field` column.
* @param {string} field The column to display the menu.
*/
showColumnMenu: (field: string) => void;
/**
* Hides the column menu that is open.
*/
hideColumnMenu: () => void;
/**
* Toggles the column menu under the `field` column.
* @param {string} field The field name to toggle the column menu.
*/
toggleColumnMenu: (field: string) => void;
}

View File

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

View File

@@ -0,0 +1,32 @@
import { GridStateColDef } from '../colDef/gridColDef';
import { GridColumnIndex, GridCellColSpanInfo } from '../gridColumnSpanning';
import { GridRowId } from '../gridRows';
/**
* The Column Spanning API interface that is available in the grid `apiRef`.
*/
export interface GridColumnSpanningApi {
/**
* Returns cell colSpan info.
* @param {GridRowId} rowId The row id
* @param {number} columnIndex The column index (0-based)
* @returns {GridCellColSpanInfo|undefined} Cell colSpan info
* @ignore - do not document.
*/
unstable_getCellColSpanInfo: (rowId: GridRowId, columnIndex: GridColumnIndex) => GridCellColSpanInfo | undefined;
}
export interface GridColumnSpanningPrivateApi {
/**
* Calculate column spanning for each cell in the row
* @param {Object} options The options to apply on the calculation.
* @param {GridRowId} options.rowId The row id
* @param {number} options.minFirstColumn First visible column index
* @param {number} options.maxLastColumn Last visible column index
* @param {GridStateColDef[]} options.columns List of columns to calculate colSpan for
*/
calculateColSpan: (options: {
rowId: GridRowId;
minFirstColumn: number;
maxLastColumn: number;
columns: GridStateColDef[];
}) => void;
}

View File

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

View File

@@ -0,0 +1,92 @@
import * as React from 'react';
import { GridEventPublisher, GridEventListener, GridEvents } from '../events';
import { Store } from '../../utils/Store';
import { EventManager, EventListenerOptions } from '../../utils/EventManager';
import { GridApiCaches } from '../gridApiCaches';
import type { GridApiCommon, GridPrivateApiCommon } from './gridApiCommon';
import type { DataGridProcessedProps } from '../props/DataGridProps';
/**
* The core API interface that is available in the grid `apiRef`.
*/
export interface GridCoreApi {
/**
* The React ref of the grid root container div element.
* @ignore - do not document.
*/
rootElementRef?: React.RefObject<HTMLDivElement>;
/**
* Registers a handler for an event.
* @param {string} event The name of the event.
* @param {function} handler The handler to be called.
* @param {object} options Additional options for this listener.
* @returns {function} A function to unsubscribe from this event.
*/
subscribeEvent: <E extends GridEvents>(event: E, handler: GridEventListener<E>, options?: EventListenerOptions) => () => void;
/**
* Emits an event.
* @param {GridEvents} name The name of the event.
* @param {any} params Arguments to be passed to the handlers.
* @param {MuiEvent<MuiBaseEvent>} event The event object to pass forward.
*/
publishEvent: GridEventPublisher;
/**
* Unique identifier for each component instance in a page.
* @ignore - do not document.
*/
instanceId: {
id: number;
};
/**
* The pub/sub store containing a reference to the public state.
* @ignore - do not document.
*/
store: Store<GridApiCommon['state']>;
}
export interface GridCorePrivateApi<GridPublicApi extends GridApiCommon, GridPrivateApi extends GridPrivateApiCommon, GridProps extends DataGridProcessedProps> {
/**
* The caches used by hooks and state initializers.
*/
caches: GridApiCaches;
/**
* Registers a method on the public or private API.
* @param {'public' | 'private'} visibility The visibility of the methods.
* @param {Partial<GridApiRef>} methods The methods to register.
*/
/**
* The generic event emitter manager.
*/
eventManager: EventManager;
/**
* The React ref of the grid virtual scroller container element.
*/
virtualScrollerRef?: React.RefObject<HTMLDivElement>;
/**
* The React ref of the grid main container div element.
*/
mainElementRef?: React.RefObject<HTMLDivElement>;
register: <V extends 'public' | 'private', T extends V extends 'public' ? Partial<GridPublicApi> : Partial<Omit<GridPrivateApi, keyof GridPublicApi>>>(visibility: V, methods: T) => void;
/**
* Returns the public API.
* Can be useful on a feature hook if we want to pass the `apiRef` to a callback.
* Do not use it to access the public method in private parts of the codebase.
* @returns {GridPublicApi} The public api.
*/
getPublicApi: () => GridPublicApi;
/**
* Allows to access the root props outside of the React component.
* Do not use in React components - use the `useGridRootProps` hook instead.
*/
rootProps: GridProps;
/**
* The React ref of the grid column container virtualized div element.
*/
columnHeadersContainerElementRef?: React.RefObject<HTMLDivElement>;
/**
* The React ref of the grid header filter row element.
*/
headerFiltersElementRef?: React.RefObject<HTMLDivElement>;
/**
* The React ref of the grid column headers container element.
*/
columnHeadersElementRef?: React.RefObject<HTMLDivElement>;
}

View File

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

View File

@@ -0,0 +1,18 @@
import { GridCsvExportOptions } from '../gridExport';
/**
* The CSV export API interface that is available in the grid [[apiRef]].
*/
export interface GridCsvExportApi {
/**
* Returns the grid data as a CSV string.
* This method is used internally by `exportDataAsCsv`.
* @param {GridCsvExportOptions} options The options to apply on the export.
* @returns {string} The data in the CSV format.
*/
getDataAsCsv: (options?: GridCsvExportOptions) => string;
/**
* Downloads and exports a CSV of the grid's data.
* @param {GridCsvExportOptions} options The options to apply on the export.
*/
exportDataAsCsv: (options?: GridCsvExportOptions) => void;
}

View File

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

View File

@@ -0,0 +1,17 @@
import * as React from 'react';
import { GridDensity } from '../gridDensity';
export interface GridDensityOption {
icon: React.ReactElement;
label: string;
value: GridDensity;
}
/**
* The density API interface that is available in the grid `apiRef`.
*/
export interface GridDensityApi {
/**
* Sets the density of the grid.
* @param {string} density Can be: `"compact"`, `"standard"`, `"comfortable"`.
*/
setDensity: (density: GridDensity) => void;
}

View File

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

View File

@@ -0,0 +1,240 @@
import { GridCellMode, GridRowMode } from '../gridCell';
import { GridCellModes, GridRowModes } from '../gridEditRowModel';
import { GridRowId, GridRowModel } from '../gridRows';
import { GridCellParams } from '../params/gridCellParams';
import { GridEditCellValueParams } from '../params/gridEditCellParams';
import { MuiBaseEvent } from '../muiEvent';
export type GridCellModesModelProps = ({
mode: GridCellModes.View;
} & Omit<GridStopCellEditModeParams, 'id' | 'field'>) | ({
mode: GridCellModes.Edit;
} & Omit<GridStartCellEditModeParams, 'id' | 'field'>);
export type GridCellModesModel = Record<GridRowId, Record<string, GridCellModesModelProps>>;
export type GridRowModesModelProps = ({
mode: GridRowModes.View;
} & Omit<GridStopRowEditModeParams, 'id' | 'field'>) | ({
mode: GridRowModes.Edit;
} & Omit<GridStartRowEditModeParams, 'id' | 'field'>);
export type GridRowModesModel = Record<GridRowId, GridRowModesModelProps>;
export interface GridEditCellMeta {
changeReason?: 'debouncedSetEditCellValue' | 'setEditCellValue';
}
export interface GridEditingSharedApi {
/**
* Controls if a cell is editable.
* @param {GridCellParams} params The cell params.
* @returns {boolean} A boolean value determining if the cell is editable.
*/
isCellEditable: (params: GridCellParams) => boolean;
/**
* Sets the value of the edit cell.
* Commonly used inside the edit cell component.
* @param {GridEditCellValueParams} params Contains the id, field and value to set.
* @param {React.SyntheticEvent} event The event to pass forward.
* @returns {Promise<boolean> | void} A promise with the validation status.
*/
setEditCellValue: (params: GridEditCellValueParams, event?: MuiBaseEvent) => Promise<boolean> | void;
/**
* Returns the row with the values that were set by editing the cells.
* In row editing, `field` is ignored and all fields are considered.
* @param {GridRowId} id The row id being edited.
* @param {string} field The field being edited.
* @returns {GridRowModel} The row with edited values.
*/
getRowWithUpdatedValues: (id: GridRowId, field: string) => GridRowModel;
/**
* Gets the meta information for the edit cell.
* @param {GridRowId} id The row id being edited.
* @param {string} field The field being edited.
* @ignore - do not document.
*/
unstable_getEditCellMeta: (id: GridRowId, field: string) => GridEditCellMeta | null;
}
export interface GridEditingSharedPrivateApi {
/**
* Immediately updates the value of the cell, without waiting for the debounce.
* @param {GridRowId} id The row id.
* @param {string} field The field to update. If not passed, updates all fields in the given row id.
*/
runPendingEditCellValueMutation: (id: GridRowId, field?: string) => void;
}
/**
* Params passed to `apiRef.current.startCellEditMode`.
*/
export interface GridStartCellEditModeParams {
/**
* The row id.
*/
id: GridRowId;
/**
* The field.
*/
field: string;
/**
* If `true`, the value will be deleted before entering the edit mode.
*/
deleteValue?: boolean;
/**
* The initial value for the field.
* If `deleteValue` is also true, this value is not used.
* @deprecated No longer needed.
*/
initialValue?: any;
}
/**
* Params passed to `apiRef.current.stopCellEditMode`.
*/
export interface GridStopCellEditModeParams {
/**
* The row id.
*/
id: GridRowId;
/**
* The field.
*/
field: string;
/**
* Whether or not to ignore the modifications made on this cell.
* @default false
*/
ignoreModifications?: boolean;
/**
* To which cell to move focus after finishing editing.
* @default "none"
*/
cellToFocusAfter?: 'none' | 'below' | 'right' | 'left';
}
/**
* Params passed to `apiRef.current.startRowEditMode`.
*/
export interface GridStartRowEditModeParams {
/**
* The row id.
*/
id: GridRowId;
/**
* The field to put focus.
*/
fieldToFocus?: string;
/**
* If `true`, the value in `fieldToFocus` will be deleted before entering the edit mode.
*/
deleteValue?: boolean;
/**
* The initial value for the given `fieldToFocus`.
* If `deleteValue` is also true, this value is not used.
* @deprecated No longer needed.
*/
initialValue?: string;
}
/**
* Params passed to `apiRef.current.stopRowEditMode`.
*/
export interface GridStopRowEditModeParams {
/**
* The row id.
*/
id: GridRowId;
/**
* Whether or not to ignore the modifications made on this cell.
* @default false
*/
ignoreModifications?: boolean;
/**
* The field that has focus when the editing is stopped.
* Used to calculate which cell to move the focus to after finishing editing.
*/
field?: string;
/**
* To which cell to move focus after finishing editing.
* Only works if the field is also specified, otherwise focus stay in the same cell.
* @default "none"
*/
cellToFocusAfter?: 'none' | 'below' | 'right' | 'left';
}
/**
* The cell editing API interface.
*/
export interface GridCellEditingApi extends GridEditingSharedApi {
/**
* Gets the mode of a cell.
* @param {GridRowId} id The id of the row.
* @param {string} field The field to get the mode.
* @returns {GridCellMode} Returns `"edit"` or `"view"`.
*/
getCellMode: (id: GridRowId, field: string) => GridCellMode;
/**
* Puts the cell corresponding to the given row id and field into edit mode.
* @param {GridStartCellEditModeParams} params The row id and field of the cell to edit.
*/
startCellEditMode(params: GridStartCellEditModeParams): void;
/**
* Puts the cell corresponding to the given row id and field into view mode and updates the original row with the new value stored.
* If `params.ignoreModifications` is `true` it will discard the modifications made.
* @param {GridStopCellEditModeParams} params The row id and field of the cell to stop editing.
*/
stopCellEditMode(params: GridStopCellEditModeParams): void;
}
export interface GridCellEditingPrivateApi extends GridEditingSharedPrivateApi {
/**
* Updates the value of a cell being edited.
* Don't call this method directly, prefer `setEditCellValue`.
* @param {GridCommitCellChangeParams} params Object with the new value and id and field to update.
* @returns {Promise<boolean>} Resolves with `true` when the new value is valid.
*/
setCellEditingEditCellValue: (params: GridEditCellValueParams) => Promise<boolean>;
/**
* Returns the row with the new value that was set by editing the cell.
* @param {GridRowId} id The row id being edited.
* @param {string} field The field being edited.
* @returns {GridRowModel} The data model of the row.
*/
getRowWithUpdatedValuesFromCellEditing: (id: GridRowId, field: string) => GridRowModel;
}
/**
* The row editing API interface.
*/
export interface GridRowEditingApi extends GridEditingSharedApi {
/**
* Gets the mode of a row.
* @param {GridRowId} id The id of the row.
* @returns {GridRowMode} Returns `"edit"` or `"view"`.
*/
getRowMode: (id: GridRowId) => GridRowMode;
/**
* Puts the row corresponding to the given id into edit mode.
* @param {GridStartCellEditModeParams} params The row id edit.
*/
startRowEditMode(params: GridStartRowEditModeParams): void;
/**
* Puts the row corresponding to the given id and into view mode and updates the original row with the new values stored.
* If `params.ignoreModifications` is `true` it will discard the modifications made.
* @param {GridStopCellEditModeParams} params The row id and field of the cell to stop editing.
*/
stopRowEditMode(params: GridStopRowEditModeParams): void;
}
export interface GridRowEditingPrivateApi extends GridEditingSharedPrivateApi {
/**
* Updates the value of a cell being edited.
* Don't call this method directly, prefer `setEditCellValue`.
* @param {GridCommitCellChangeParams} params Object with the new value and id and field to update.
* @returns {Promise<boolean>} Resolves with `true` when all values in the row are valid.
*/
setRowEditingEditCellValue: (params: GridEditCellValueParams) => Promise<boolean>;
/**
* Returns the row with the values that were set by editing all cells.
* @param {GridRowId} id The row id being edited.
* @returns {GridRowModel} The data model of the row.
*/
getRowWithUpdatedValuesFromRowEditing: (id: GridRowId) => GridRowModel;
}
/**
* The editing API interface that is available in the grid `apiRef`.
*/
export interface GridEditingApi extends GridCellEditingApi, GridRowEditingApi {
}
/**
* The private editing API interface that is available in the grid `privateApiRef`.
*/
export interface GridEditingPrivateApi extends GridCellEditingPrivateApi, GridRowEditingPrivateApi {
}

View File

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

View File

@@ -0,0 +1,60 @@
import { GridFilterModel } from '../gridFilterModel';
import { GridFilterItem, GridLogicOperator } from '../gridFilterItem';
import { GridControlledStateReasonLookup } from '../events';
import { DataGridProcessedProps } from '../props/DataGridProps';
/**
* The filter API interface that is available in the grid [[apiRef]].
*/
export interface GridFilterApi {
/**
* Shows the filter panel. If `targetColumnField` is given, a filter for this field is also added.
* @param {string} targetColumnField The column field to add a filter.
* @param {string} panelId The unique panel id
* @param {string} labelId The unique button id
*/
showFilterPanel: (targetColumnField?: string, panelId?: string, labelId?: string) => void;
/**
* Hides the filter panel.
*/
hideFilterPanel: () => void;
/**
* Updates or inserts a [[GridFilterItem]].
* @param {GridFilterItem} item The filter to update.
*/
upsertFilterItem: (item: GridFilterItem) => void;
/**
* Updates or inserts many [[GridFilterItem]].
* @param {GridFilterItem[]} items The filters to update.
*/
upsertFilterItems: (items: GridFilterItem[]) => void;
/**
* Applies all filters on all rows.
* @ignore - do not document.
*/
unstable_applyFilters: () => void;
/**
* Deletes a [[GridFilterItem]].
* @param {GridFilterItem} item The filter to delete.
*/
deleteFilterItem: (item: GridFilterItem) => void;
/**
* Changes the [[GridLogicOperator]] used to connect the filters.
* @param {GridLogicOperator} operator The new logic operator. It can be: `"and"` or `"or`".
*/
setFilterLogicOperator: (operator: GridLogicOperator) => void;
/**
* Sets the filter model to the one given by `model`.
* @param {GridFilterModel} model The new filter model.
* @param {string} reason The reason for the model to have changed.
*/
setFilterModel: (model: GridFilterModel, reason?: GridControlledStateReasonLookup['filter']) => void;
/**
* Set the quick filter values to the one given by `values`
* @param {any[]} values The list of element to quick filter
*/
setQuickFilterValues: (values: any[]) => void;
/**
* Returns the value of the `ignoreDiacritics` prop.
*/
ignoreDiacritics: DataGridProcessedProps['ignoreDiacritics'];
}

View File

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

View File

@@ -0,0 +1,46 @@
import { GridRowId } from '../gridRows';
import { MuiBaseEvent } from '../muiEvent';
import { GridColumnGroupIdentifier } from '../../hooks/features/focus';
export interface GridFocusApi {
/**
* Sets the focus to the cell at the given `id` and `field`.
* @param {GridRowId} id The row id.
* @param {string} field The column field.
*/
setCellFocus: (id: GridRowId, field: string) => void;
/**
* Sets the focus to the column header at the given `field`.
* @param {string} field The column field.
* @param {string} event The event that triggers the action.
*/
setColumnHeaderFocus: (field: string, event?: MuiBaseEvent) => void;
/**
* Sets the focus to the column header filter at the given `field`.
* @param {string} field The column field.
* @param {string} event The event that triggers the action.
*/
setColumnHeaderFilterFocus: (field: string, event?: MuiBaseEvent) => void;
}
export interface GridFocusPrivateApi {
/**
* Sets the focus to the column group header at the given `field` and given depth.
* @param {string} field The column field.
* @param {number} depth The group depth.
* @param {object} event The event that triggers the action.
*/
setColumnGroupHeaderFocus: (field: string, depth: number, event?: MuiBaseEvent) => void;
/**
* Gets the focus to the column group header at the given `field` and given depth.
* @returns {GridColumnGroupIdentifier | null} focused
*/
getColumnGroupHeaderFocus: () => GridColumnGroupIdentifier | null;
/**
* Moves the focus to the cell situated at the given direction.
* If field is the last and direction=right, the focus goes to the next row.
* If field is the first and direction=left, the focus goes to the previous row.
* @param {GridRowId} id The base row id.
* @param {string} field The base column field.
* @param {'below' | 'right' | 'left'} direction Which direction is the next cell to focus.
*/
moveFocusToRelativeCell: (id: GridRowId, field: string, direction: 'below' | 'right' | 'left') => void;
}

View File

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

View File

@@ -0,0 +1,30 @@
import { GridColDef } from '../colDef';
import { GridHeaderFilteringState } from '../gridHeaderFilteringModel';
export interface GridHeaderFilteringPrivateApi {
/**
* Internal function to set the header filter state.
* @param {Partial<GridHeaderFilteringState>} headerFilterState The field to be edited.
* @ignore - do not document.
*/
setHeaderFilterState: (headerFilterState: Partial<GridHeaderFilteringState>) => void;
}
export interface GridHeaderFilteringApi {
/**
* Puts the cell corresponding to the given row id and field into edit mode.
* @param {GridColDef['field']} field The field of the header filter to put in edit mode.
*/
startHeaderFilterEditMode: (field: GridColDef['field']) => void;
/**
* Stops the edit mode for the current field.
*/
stopHeaderFilterEditMode: () => void;
/**
* Opens the header filter menu for the given field.
* @param {GridColDef['field']} field The field of the header filter to open menu for.
*/
showHeaderFilterMenu: (field: GridColDef['field']) => void;
/**
* Hides the header filter menu.
*/
hideHeaderFilterMenu: () => void;
}

View File

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

View File

@@ -0,0 +1,140 @@
import * as React from 'react';
import { ComponentsPropsList } from '@mui/material/styles';
import { GridColDef } from '../colDef';
/**
* Set the types of the texts in the grid.
*/
export interface GridLocaleText {
noRowsLabel: string;
noResultsOverlayLabel: string;
toolbarDensity: React.ReactNode;
toolbarDensityLabel: string;
toolbarDensityCompact: string;
toolbarDensityStandard: string;
toolbarDensityComfortable: string;
toolbarColumns: React.ReactNode;
toolbarColumnsLabel: string;
toolbarFilters: React.ReactNode;
toolbarFiltersLabel: string;
toolbarFiltersTooltipHide: React.ReactNode;
toolbarFiltersTooltipShow: React.ReactNode;
toolbarFiltersTooltipActive: (count: number) => React.ReactNode;
toolbarQuickFilterPlaceholder: string;
toolbarQuickFilterLabel: string;
toolbarQuickFilterDeleteIconLabel: string;
toolbarExport: React.ReactNode;
toolbarExportLabel: string;
toolbarExportCSV: React.ReactNode;
toolbarExportPrint: React.ReactNode;
toolbarExportExcel: string;
columnsPanelTextFieldLabel: string;
columnsPanelTextFieldPlaceholder: string;
columnsPanelDragIconLabel: string;
columnsPanelShowAllButton: React.ReactNode;
columnsPanelHideAllButton: React.ReactNode;
filterPanelAddFilter: React.ReactNode;
filterPanelRemoveAll: React.ReactNode;
filterPanelDeleteIconLabel: string;
filterPanelLogicOperator: string;
filterPanelOperator: React.ReactNode;
filterPanelOperatorAnd: React.ReactNode;
filterPanelOperatorOr: React.ReactNode;
filterPanelColumns: React.ReactNode;
filterPanelInputLabel: string;
filterPanelInputPlaceholder: string;
filterOperatorContains: string;
filterOperatorEquals: string;
filterOperatorStartsWith: string;
filterOperatorEndsWith: string;
filterOperatorIs: string;
filterOperatorNot: string;
filterOperatorAfter: string;
filterOperatorOnOrAfter: string;
filterOperatorBefore: string;
filterOperatorOnOrBefore: string;
filterOperatorIsEmpty: string;
filterOperatorIsNotEmpty: string;
filterOperatorIsAnyOf: string;
'filterOperator=': string;
'filterOperator!=': string;
'filterOperator>': string;
'filterOperator>=': string;
'filterOperator<': string;
'filterOperator<=': string;
headerFilterOperatorContains: string;
headerFilterOperatorEquals: string;
headerFilterOperatorStartsWith: string;
headerFilterOperatorEndsWith: string;
headerFilterOperatorIs: string;
headerFilterOperatorNot: string;
headerFilterOperatorAfter: string;
headerFilterOperatorOnOrAfter: string;
headerFilterOperatorBefore: string;
headerFilterOperatorOnOrBefore: string;
headerFilterOperatorIsEmpty: string;
headerFilterOperatorIsNotEmpty: string;
headerFilterOperatorIsAnyOf: string;
'headerFilterOperator=': string;
'headerFilterOperator!=': string;
'headerFilterOperator>': string;
'headerFilterOperator>=': string;
'headerFilterOperator<': string;
'headerFilterOperator<=': string;
filterValueAny: string;
filterValueTrue: string;
filterValueFalse: string;
columnMenuLabel: string;
columnMenuShowColumns: React.ReactNode;
columnMenuManageColumns: React.ReactNode;
columnMenuFilter: React.ReactNode;
columnMenuHideColumn: React.ReactNode;
columnMenuUnsort: React.ReactNode;
columnMenuSortAsc: React.ReactNode | ((colDef: GridColDef) => React.ReactNode);
columnMenuSortDesc: React.ReactNode | ((colDef: GridColDef) => React.ReactNode);
columnHeaderFiltersTooltipActive: (count: number) => React.ReactNode;
columnHeaderFiltersLabel: string;
columnHeaderSortIconLabel: string;
footerRowSelected: (count: number) => React.ReactNode;
footerTotalRows: React.ReactNode;
footerTotalVisibleRows: (visibleCount: number, totalCount: number) => React.ReactNode;
checkboxSelectionHeaderName: string;
checkboxSelectionSelectAllRows: string;
checkboxSelectionUnselectAllRows: string;
checkboxSelectionSelectRow: string;
checkboxSelectionUnselectRow: string;
booleanCellTrueLabel: string;
booleanCellFalseLabel: string;
actionsCellMore: string;
pinToLeft: string;
pinToRight: string;
unpin: string;
treeDataGroupingHeaderName: string;
treeDataExpand: string;
treeDataCollapse: string;
groupingColumnHeaderName: string;
groupColumn: (name: string) => string;
unGroupColumn: (name: string) => string;
detailPanelToggle: string;
expandDetailPanel: string;
collapseDetailPanel: string;
rowReorderingHeaderName: string;
aggregationMenuItemHeader: string;
aggregationFunctionLabelSum: string;
aggregationFunctionLabelAvg: string;
aggregationFunctionLabelMin: string;
aggregationFunctionLabelMax: string;
aggregationFunctionLabelSize: string;
MuiTablePagination: Omit<ComponentsPropsList['MuiTablePagination'], 'page' | 'count' | 'onChangePage' | 'rowsPerPage' | 'onPageChange'>;
}
export type GridTranslationKeys = keyof GridLocaleText;
/**
* The grid locale text API [[apiRef]].
*/
export interface GridLocaleTextApi {
/**
* Returns the translation for the `key`.
* @param {T} key One of the keys in [[GridLocaleText]].
* @returns {GridLocaleText[T]} The translated value.
*/
getLocaleText: <T extends GridTranslationKeys>(key: T) => GridLocaleText[T];
}

View File

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

View File

@@ -0,0 +1,11 @@
import { Logger } from '../logger';
/**
* The logger API interface that is available in the grid `apiRef`.
*/
export interface GridLoggerApi {
/**
* @param {string} name The name of the logger
* @returns {Logger} Instance of the logger
*/
getLogger: (name: string) => Logger;
}

View File

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

View File

@@ -0,0 +1,74 @@
import { GridColDef } from '../colDef';
import { GridValidRowModel, GridRowId, GridTreeNode, GridRowModel } from '../gridRows';
import { GridCellParams } from '../params/gridCellParams';
import { GridColumnHeaderParams } from '../params/gridColumnHeaderParams';
import { GridRowParams } from '../params/gridRowParams';
export interface GridParamsApi {
/**
* Gets the value of a cell at the given `id` and `field`.
* @template V
* @param {GridRowId} id The id of the row.
* @param {string} field The column field.
* @returns {v} The cell value.
*/
getCellValue: <V extends any = any>(id: GridRowId, field: string) => V;
/**
* Gets the cell value.
* Use it instead of `getCellValue` for better performance if you have `row` and `colDef`.
* @template V
* @param {GridRowModel} row The row model.
* @param {GridColDef} colDef The column definition.
* @returns {v} The cell value.
* @ignore - do not document
*/
getRowValue: <V extends any = any>(row: GridRowModel, colDef: GridColDef) => V;
/**
* Gets the cell formatted value
* Use it instead of `getCellParams` for better performance if you only need the formatted value.
* @template V
* @param {GridRowModel} row The row model.
* @param {GridColDef} colDef The column definition.
* @returns {v} The cell value.
* @ignore - do not document
*/
getRowFormattedValue: <V extends any = any>(row: GridRowModel, colDef: GridColDef) => V;
/**
* Gets the underlying DOM element for a cell at the given `id` and `field`.
* @param {GridRowId} id The id of the row.
* @param {string} field The column field.
* @returns {HTMLDivElement | null} The DOM element or `null`.
*/
getCellElement: (id: GridRowId, field: string) => HTMLDivElement | null;
/**
* Gets the [[GridCellParams]] object that is passed as argument in events.
* @param {GridRowId} id The id of the row.
* @param {string} field The column field.
* @returns {GridCellParams} The cell params.
*/
getCellParams: <R extends GridValidRowModel = any, V = unknown, F = V, N extends GridTreeNode = GridTreeNode>(id: GridRowId, field: string) => GridCellParams<R, V, F, N>;
/**
* Gets the [[GridRowParams]] object that is passed as argument in events.
* @param {GridRowId} id The id of the row.
* @param {string} field The column field.
* @returns {GridRowParams} The row params.
*/
getRowParams: (id: GridRowId) => GridRowParams;
/**
* Gets the underlying DOM element for a row at the given `id`.
* @param {GridRowId} id The id of the row.
* @returns {HTMLDivElement | null} The DOM element or `null`.
*/
getRowElement: (id: GridRowId) => HTMLDivElement | null;
/**
* Gets the underlying DOM element for the column header with the given `field`.
* @param {string} field The column field.
* @returns {HTMLDivElement | null} The DOM element or `null`.
*/
getColumnHeaderElement: (field: string) => HTMLDivElement | null;
/**
* Gets the [[GridColumnHeaderParams]] object that is passed as argument in events.
* @param {string} field The column field.
* @returns {GridColumnHeaderParams} The cell params.
*/
getColumnHeaderParams: (field: string) => GridColumnHeaderParams;
}

View File

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

View File

@@ -0,0 +1,17 @@
import { GridPreferencePanelsValue } from '../../hooks/features/preferencesPanel/gridPreferencePanelsValue';
/**
* The preferences panel API interface that is available in the grid [[apiRef]].
*/
export interface GridPreferencesPanelApi {
/**
* Displays the preferences panel. The `newValue` argument controls the content of the panel.
* @param {GridPreferencePanelsValue} newValue The panel to open. Use `"filters"` or `"columns"`.
* @param {string} panelId The unique panel id
* @param {string} labelId The unique button id
*/
showPreferences: (newValue: GridPreferencePanelsValue, panelId?: string, labelId?: string) => void;
/**
* Hides the preferences panel.
*/
hidePreferences: () => void;
}

View File

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

View File

@@ -0,0 +1,11 @@
import { GridPrintExportOptions } from '../gridExport';
/**
* The Print export API interface that is available in the grid [[apiRef]].
*/
export interface GridPrintExportApi {
/**
* Print the grid's data.
* @param {GridPrintExportOptions} options The options to apply on the export.
*/
exportDataAsPrint: (options?: GridPrintExportOptions) => void;
}

View File

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

View File

@@ -0,0 +1,105 @@
import { GridRowModel, GridRowId, GridRowModelUpdate, GridValidRowModel, GridTreeNode } from '../gridRows';
export interface GridRowGroupChildrenGetterParams {
/**
* The row id of the group
*/
groupId: GridRowId;
/**
* If `true`, the method will not return the generated rows generated by the grid (aggregation footers, groups, ...)
* @default true
*/
skipAutoGeneratedRows?: boolean;
/**
* If `true`, the method will only return the rows that are matching the current filters
* @default false
*/
applyFiltering?: boolean;
/**
* If `true`, the method will order the returned rows according to the current sorting rules
* @default false
*/
applySorting?: boolean;
}
/**
* The Row API interface that is available in the grid `apiRef`.
*/
export interface GridRowApi {
/**
* Gets the full set of rows as [[Map<GridRowId, GridRowModel>]].
* @returns {Map<GridRowId, GridRowModel>} The full set of rows.
*/
getRowModels: () => Map<GridRowId, GridRowModel>;
/**
* Gets the total number of rows in the grid.
* @returns {number} The number of rows.
*/
getRowsCount: () => number;
/**
* Gets the list of row ids.
* TODO rows v6: Rename or remove ?
* @returns {GridRowId[]} A list of ids.
*/
getAllRowIds: () => GridRowId[];
/**
* Sets a new set of rows.
* @param {GridRowModel[]} rows The new rows.
*/
setRows: (rows: GridRowModel[]) => void;
/**
* Allows to update, insert and delete rows.
* @param {GridRowModelUpdate[]} updates An array of rows with an `action` specifying what to do.
*/
updateRows: (updates: GridRowModelUpdate[]) => void;
/**
* Gets the row data with a given id.
* @param {GridRowId} id The id of the row.
* @returns {GridRowModel} The row data.
*/
getRow: <R extends GridValidRowModel = any>(id: GridRowId) => R | null;
/**
* Gets the ID of a row given its data.
* @param {GridRowModel} row The row data.
* @returns {GridRowId} The id of the row.
*/
getRowId: <R extends GridValidRowModel = any>(row: R) => GridRowId;
/**
* Gets the row node from the internal tree structure.
* TODO rows v6: Rename `getTreeNode`
* @param {GridRowId} id The id of the row.
* @returns {GridTreeNode} The tree node.
*/
getRowNode: <N extends GridTreeNode>(id: GridRowId) => N | null;
/**
* Gets the index of a row relative to the rows that are reachable by scroll.
* @param {GridRowId} id The row id.
* @returns {number} The index of the row.
*/
getRowIndexRelativeToVisibleRows: (id: GridRowId) => number;
/**
* Replace a set of rows with new rows.
* @param {number} firstRowToReplace The index of the first row to be replaced.
* @param {GridRowModel[]} newRows The new rows.
*/
unstable_replaceRows: (firstRowToReplace: number, newRows: GridRowModel[]) => void;
}
export interface GridRowProApi {
/**
* Moves a row from its original position to the position given by `targetIndex`.
* @param {GridRowId} rowId The row id
* @param {number} targetIndex The new position (0-based).
*/
setRowIndex: (rowId: GridRowId, targetIndex: number) => void;
/**
* Gets the rows of a grouping criteria.
* Only contains the rows provided to the grid, not the rows automatically generated by it.
* @param {GridRowGroupChildrenGetterParams} params Object containing parameters for the getter.
* @returns {GridRowId[]} The id of each row in the grouping criteria.
*/
getRowGroupChildren: (params: GridRowGroupChildrenGetterParams) => GridRowId[];
/**
* Expand or collapse a row children.
* @param {GridRowId} id the ID of the row to expand or collapse.
* @param {boolean} isExpanded A boolean indicating if the row must be expanded or collapsed.
*/
setRowChildrenExpansion: (id: GridRowId, isExpanded: boolean) => void;
}

View File

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

View File

@@ -0,0 +1,78 @@
import { GridRowId, GridRowModel } from '../gridRows';
/**
* The selection API interface that is available in the grid [[apiRef]].
*/
export interface GridRowSelectionApi {
/**
* Change the selection state of a row.
* @param {GridRowId} id The id of the row.
* @param {boolean} isSelected Pass `false` to unselect a row. Default is `true`.
* @param {boolean} resetSelection Whether to reset the already selected rows or not. Default is `false`.
*/
selectRow: (id: GridRowId, isSelected?: boolean, resetSelection?: boolean) => void;
/**
* Determines if a row is selected or not.
* @param {GridRowId} id The id of the row.
* @returns {boolean} A boolean indicating if the row is selected.
*/
isRowSelected: (id: GridRowId) => boolean;
/**
* Determines if a row can be selected or not.
* @param {GridRowId} id The id of the row.
* @returns {boolean} A boolean indicating if the row can be selected.
*/
isRowSelectable: (id: GridRowId) => boolean;
/**
* Returns an array of the selected rows.
* @returns {Map<GridRowId, GridRowModel>} A `Map` with the selected rows.
*/
getSelectedRows: () => Map<GridRowId, GridRowModel>;
/**
* Updates the selected rows to be those passed to the `rowIds` argument.
* Any row already selected will be unselected.
* @param {GridRowId[]} rowIds The row ids to select.
*/
setRowSelectionModel: (rowIds: GridRowId[]) => void;
}
export interface GridRowMultiSelectionApi {
/**
* Change the selection state of multiple rows.
* @param {GridRowId[]} ids The row ids.
* @param {boolean} isSelected The new selection state. Default is `true`.
* @param {boolean} resetSelection Whether to reset the already selected rows or not. Default is `false`.
*/
selectRows: (ids: GridRowId[], isSelected?: boolean, resetSelection?: boolean) => void;
/**
* Change the selection state of all the selectable rows in a range.
* @param {Object} range The range of rows to select.
* @param {GridRowId} range.startId The first row id.
* @param {GridRowId} range.endId The last row id.
* @param {boolean} isSelected The new selection state. Default is `true`.
* @param {boolean} resetSelection Whether to reset the selected rows outside of the range or not. Default is `false`.
*/
selectRowRange: (range: {
startId: GridRowId;
endId: GridRowId;
}, isSelected?: boolean, resetSelection?: boolean) => void;
}
export interface GridMultiSelectionApi {
/**
* Change the selection state of multiple rows.
* @param {GridRowId[]} ids The row ids.
* @param {boolean} isSelected The new selection state. Default is `true`.
* @param {boolean} resetSelection Whether to reset the already selected rows or not. Default is `false`.
*/
selectRows: (ids: GridRowId[], isSelected?: boolean, resetSelection?: boolean) => void;
/**
* Change the selection state of all the selectable rows in a range.
* @param {Object} range The range of rows to select.
* @param {GridRowId} range.startId The first row id.
* @param {GridRowId} range.endId The last row id.
* @param {boolean} isSelected The new selection state. Default is `true`.
* @param {boolean} resetSelection Whether to reset the selected rows outside of the range or not. Default is `false`.
*/
selectRowRange: (range: {
startId: GridRowId;
endId: GridRowId;
}, isSelected?: boolean, resetSelection?: boolean) => void;
}

View File

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

View File

@@ -0,0 +1,59 @@
import { GridRowId } from '../gridRows';
/**
* The Row Meta API interface that is available in the grid `apiRef`.
*/
export interface GridRowsMetaApi {
/**
* Gets base row height without considering additional height a row may take.
* @param {GridRowId} id The id of the row.
* @returns {number} The target row height.
* @ignore - do not document.
*/
unstable_getRowHeight: (id: GridRowId) => number;
/**
* Gets all sizes that compose the total height that the given row takes.
* @param {GridRowId} id The id of the row.
* @returns {Record<string, number>} The object containing the sizes.
* @ignore - do not document.
*/
unstable_getRowInternalSizes: (id: GridRowId) => Record<string, number> | undefined;
/**
* Updates the base height of a row.
* @param {GridRowId} id The id of the row.
* @param {number} height The new height.
* @ignore - do not document.
*/
unstable_setRowHeight: (id: GridRowId, height: number) => void;
/**
* Stores the row height measurement and triggers an hydration, if needed.
* @param {GridRowId} id The id of the row.
* @param {number} height The new height.
* @param {string} position The position to it the row belongs to.
* @ignore - do not document.
*/
unstable_storeRowHeightMeasurement: (id: GridRowId, height: number, position: 'left' | 'center' | 'right') => void;
/**
* Updates the index of the last row measured.
* @param {number} index The row index.
* @ignore - do not document.
*/
unstable_setLastMeasuredRowIndex: (index: number) => void;
/**
* Forces the recalculation of the heights of all rows.
*/
resetRowHeights: () => void;
}
export interface GridRowsMetaPrivateApi {
/**
* Determines if the height of a row is "auto".
* @param {GridRowId} id The id of the row.
* @returns {boolean} True if the row height is "auto", false otherwise.
*/
rowHasAutoHeight: (id: GridRowId) => boolean;
/**
* Returns the index of the last row measured.
* The value considers only the rows reachable by scroll, e.g. first row has index=0 in all pages.
* @returns {number} The index of the last measured row.
*/
getLastMeasuredRowIndex: () => number;
}

View File

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

View File

@@ -0,0 +1,24 @@
import { GridCellIndexCoordinates } from '../gridCell';
import { GridScrollParams } from '../params/gridScrollParams';
/**
* The scroll API interface that is available in the grid [[apiRef]].
*/
export interface GridScrollApi {
/**
* Triggers the viewport to scroll to the given positions (in pixels).
* @param {GridScrollParams} params An object containing the `left` or `top` position to scroll.
*/
scroll: (params: Partial<GridScrollParams>) => void;
/**
* Returns the current scroll position.
* @returns {GridScrollParams} The scroll positions.
*/
getScrollPosition: () => GridScrollParams;
/**
* Triggers the viewport to scroll to the cell at indexes given by `params`.
* Returns `true` if the grid had to scroll to reach the target.
* @param {GridCellIndexCoordinates} params The indexes where the cell is.
* @returns {boolean} Returns `true` if the index was outside of the viewport and the grid had to scroll to reach the target.
*/
scrollToIndexes: (params: Partial<GridCellIndexCoordinates>) => boolean;
}

View File

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

View File

@@ -0,0 +1,46 @@
import { GridColDef } from '../colDef/gridColDef';
import { GridRowId, GridRowModel } from '../gridRows';
import { GridSortDirection, GridSortModel } from '../gridSortModel';
/**
* The sort API interface that is available in the grid [[apiRef]].
*/
export interface GridSortApi {
/**
* Returns the sort model currently applied to the grid.
* @returns {GridSortModel} The `GridSortModel`.
*/
getSortModel: () => GridSortModel;
/**
* Applies the current sort model to the rows.
*/
applySorting: () => void;
/**
* Updates the sort model and triggers the sorting of rows.
* @param {GridSortModel} model The `GridSortModel` to be applied.
*/
setSortModel: (model: GridSortModel) => void;
/**
* Sorts a column.
* @param {GridColDef} column The [[GridColDef]] of the column to be sorted.
* @param {GridSortDirection} direction The direction to be sorted. By default, the next in the `sortingOrder` prop.
* @param {boolean} allowMultipleSorting Whether to keep the existing [[GridSortItem]]. Default is `false`.
*/
sortColumn: (column: GridColDef, direction?: GridSortDirection, allowMultipleSorting?: boolean) => void;
/**
* Returns all rows sorted according to the active sort model.
* @returns {GridRowModel[]} The sorted [[GridRowModel]] objects.
*/
getSortedRows: () => GridRowModel[];
/**
* Returns all row ids sorted according to the active sort model.
* @returns {GridRowId[]} The sorted [[GridRowId]] values.
*/
getSortedRowIds: () => GridRowId[];
/**
* Gets the `GridRowId` of a row at a specific index.
* The index is based on the sorted but unfiltered row list.
* @param {number} index The index of the row
* @returns {GridRowId} The `GridRowId` of the row.
*/
getRowIdFromRowIndex: (index: number) => GridRowId;
}

View File

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

View File

@@ -0,0 +1,37 @@
import { GridStateCommunity } from '../gridStateCommunity';
import { GridControlledStateEventLookup, GridControlledStateReasonLookup } from '../events';
import { GridControlStateItem } from '../controlStateItem';
export interface GridStateApi<State extends GridStateCommunity> {
/**
* Property that contains the whole state of the grid.
*/
state: State;
/**
* Forces the grid to rerender. It's often used after a state update.
*/
forceUpdate: () => void;
/**
* Sets the whole state of the grid.
* @param {GridState | (oldState: GridState) => GridState} state The new state or the callback creating the new state.
* @param {string} reason The reason for this change to happen.
* @returns {boolean} Has the state been updated.
* @ignore - do not document.
*/
setState: <S extends State, K extends keyof GridControlledStateReasonLookup>(state: S | ((previousState: S) => S), reason?: GridControlledStateReasonLookup[K]) => boolean;
}
export interface GridStatePrivateApi<State extends GridStateCommunity> {
/**
* Updates a single sub-state.
* Publishes the `xxxChange` event and calls the `onXXXChange` prop.
* @param {K} key Which key of the state to update.
* @param {(oldState: GridState) => GridState} state The new state of the sub-state to update.
* @param {GridControlledStateReasonLookup[K]} reason The reason to pass to the callback prop and event.
* @returns {boolean} `true` if the state has been successfully updated.
*/
updateControlState: <K extends keyof GridControlledStateReasonLookup>(key: K, state: (oldState: State[K]) => State[K], reason?: GridControlledStateReasonLookup[K]) => boolean;
/**
* Updates a control state that binds the model, the onChange prop, and the grid state together.
* @param {GridControlStateItem>} controlState The [[GridControlStateItem]] to be registered.
*/
registerControlState: <E extends keyof GridControlledStateEventLookup>(controlState: GridControlStateItem<State, E>) => void;
}

View File

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

View File

@@ -0,0 +1,20 @@
import { GridRenderContext } from '../params';
export interface GridVirtualizationApi {
/**
* Enable/disable virtualization.
* @param {boolean} enabled The enabled value for virtualization
*/
unstable_setVirtualization: (enabled: boolean) => void;
/**
* Enable/disable column virtualization.
* @param {boolean} enabled The enabled value for column virtualization
*/
unstable_setColumnVirtualization: (enabled: boolean) => void;
}
export interface GridVirtualizationPrivateApi {
/**
* Get the current grid rendering context.
* @returns {GridRenderContext} The `GridRenderContext`.
*/
getRenderContext: () => GridRenderContext;
}

View File

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

View File

@@ -0,0 +1,23 @@
import type { GridEditingApi } from './gridEditingApi';
export * from './gridParamsApi';
export type { GridCoreApi } from './gridCoreApi';
export * from './gridColumnApi';
export * from './gridDensityApi';
export * from './gridRowApi';
export type { GridRowsMetaApi } from './gridRowsMetaApi';
export * from './gridRowSelectionApi';
export * from './gridSortApi';
export type { GridStateApi } from './gridStateApi';
export * from './gridLocaleTextApi';
export * from './gridCsvExportApi';
export type { GridFocusApi } from './gridFocusApi';
export * from './gridFilterApi';
export * from './gridColumnMenuApi';
export * from './gridPreferencesPanelApi';
export * from './gridPrintExportApi';
export * from './gridCallbackDetails';
export * from './gridScrollApi';
export * from './gridVirtualizationApi';
export type { GridApiCommon } from './gridApiCommon';
export type { GridEditingApi, GridCellModesModel, GridRowModesModel } from './gridEditingApi';
export type GridEditRowApi = GridEditingApi;

View File

@@ -0,0 +1,16 @@
export * from './gridParamsApi';
export * from './gridColumnApi';
export * from './gridDensityApi';
export * from './gridRowApi';
export * from './gridRowSelectionApi';
export * from './gridSortApi';
export * from './gridLocaleTextApi';
export * from './gridCsvExportApi';
export * from './gridFilterApi';
export * from './gridColumnMenuApi';
export * from './gridPreferencesPanelApi';
export * from './gridPrintExportApi';
export * from './gridCallbackDetails';
export * from './gridScrollApi';
export * from './gridVirtualizationApi';
export {};

View File

@@ -0,0 +1,305 @@
import * as React from 'react';
import { GridCellClassNamePropType } from '../gridCellClass';
import { GridColumnHeaderClassNamePropType } from '../gridColumnHeaderClass';
import type { GridFilterOperator } from '../gridFilterOperator';
import { GridCellParams, GridRenderCellParams, GridRenderEditCellParams, GridValueFormatterParams, GridValueGetterParams, GridValueSetterParams, GridPreProcessEditCellProps } from '../params/gridCellParams';
import { GridColumnHeaderParams } from '../params/gridColumnHeaderParams';
import { GridComparatorFn, GridSortDirection } from '../gridSortModel';
import { GridColType } from './gridColType';
import { GridRowParams } from '../params/gridRowParams';
import { GridValueOptionsParams } from '../params/gridValueOptionsParams';
import { GridActionsCellItemProps } from '../../components/cell/GridActionsCellItem';
import { GridEditCellProps } from '../gridEditRowModel';
import type { GridValidRowModel } from '../gridRows';
import { GridApiCommunity } from '../api/gridApiCommunity';
/**
* Alignment used in position elements in Cells.
*/
export type GridAlignment = 'left' | 'right' | 'center';
export type ValueOptions = string | number | {
value: any;
label: string;
} | Record<string, any>;
/**
* Value that can be used as a key for grouping rows
*/
export type GridKeyValue = string | number | boolean;
export type GridApplyQuickFilterV7<R extends GridValidRowModel = GridValidRowModel, V = any> = (value: V, row: R, column: GridColDef, apiRef: React.MutableRefObject<GridApiCommunity>) => boolean;
export type GetApplyQuickFilterFnLegacy<R extends GridValidRowModel = GridValidRowModel, V = any, F = V> = (value: any, colDef: GridStateColDef, apiRef: React.MutableRefObject<GridApiCommunity>) => null | ((params: GridCellParams<R, V, F>) => boolean);
export type GetApplyQuickFilterFnV7<R extends GridValidRowModel = GridValidRowModel, V = any> = (value: any, colDef: GridStateColDef, apiRef: React.MutableRefObject<GridApiCommunity>) => null | GridApplyQuickFilterV7<R, V>;
/**
* Column Definition base interface.
*/
export interface GridBaseColDef<R extends GridValidRowModel = GridValidRowModel, V = any, F = V> {
/**
* The column identifier. It's used to map with [[GridRowModel]] values.
*/
field: string;
/**
* The title of the column rendered in the column header cell.
*/
headerName?: string;
/**
* The description of the column rendered as tooltip if the column header name is not fully displayed.
*/
description?: string;
/**
* Set the width of the column.
* @default 100
*/
width?: number;
/**
* If set, it indicates that a column has fluid width. Range [0, ∞).
*/
flex?: number;
/**
* Sets the minimum width of a column.
* @default 50
*/
minWidth?: number;
/**
* Sets the maximum width of a column.
* @default Infinity
*/
maxWidth?: number;
/**
* If `false`, removes the buttons for hiding this column.
* @default true
*/
hideable?: boolean;
/**
* If `true`, the column is sortable.
* @default true
*/
sortable?: boolean;
/**
* The order of the sorting sequence.
*/
sortingOrder?: GridSortDirection[];
/**
* If `true`, the column is resizable.
* @default true
*/
resizable?: boolean;
/**
* If `true`, the cells of the column are editable.
* @default false
*/
editable?: boolean;
/**
* If `true`, the rows can be grouped based on this column values (pro-plan only).
* Only available in DataGridPremium.
* TODO: Use module augmentation to move it to `@mui/x-data-grid-premium` (need to modify how we handle column types default values).
* @default true
*/
groupable?: boolean;
/**
* If `false`, the menu items for column pinning menu will not be rendered.
* Only available in DataGridPro.
* TODO: Use module augmentation to move it to `@mui/x-data-grid-pro` (need to modify how we handle column types default values).
* @default true
*/
pinnable?: boolean;
/**
* A comparator function used to sort rows.
*/
sortComparator?: GridComparatorFn<V>;
/**
* The type of the column.
* @default 'string'
* @see See {@link https://mui.com/x/react-data-grid/column-definition/#column-types column types docs} for more details.
*/
type?: GridColType;
/**
* Allows to align the column values in cells.
*/
align?: GridAlignment;
/**
* Function that allows to get a specific data instead of field to render in the cell.
* @template R, V
* @param {GridValueGetterParams<R, any>} params Object containing parameters for the getter.
* @returns {V} The cell value.
*/
valueGetter?: (params: GridValueGetterParams<R, any>) => V;
/**
* Function that allows to customize how the entered value is stored in the row.
* It only works with cell/row editing.
* @template R, V
* @param {GridValueSetterParams<R, V>} params Object containing parameters for the setter.
* @returns {R} The row with the updated field.
*/
valueSetter?: (params: GridValueSetterParams<R, V>) => R;
/**
* Function that allows to apply a formatter before rendering its value.
* @template V, F
* @param {GridValueFormatterParams<V>} params Object containing parameters for the formatter.
* @returns {F} The formatted value.
*/
valueFormatter?: (params: GridValueFormatterParams<V>) => F;
/**
* Function that takes the user-entered value and converts it to a value used internally.
* @template R, V, F
* @param {F | undefined} value The user-entered value.
* @param {GridCellParams<R, V, F>} params The params when called before saving the value.
* @returns {V} The converted value to use internally.
*/
valueParser?: (value: F | undefined, params?: GridCellParams<R, V, F>) => V;
/**
* Class name that will be added in cells for that column.
*/
cellClassName?: GridCellClassNamePropType<R, V>;
/**
* Allows to override the component rendered as cell for this column.
* @template R, V, F
* @param {GridRenderCellParams<R, V, F>} params Object containing parameters for the renderer.
* @returns {React.ReactNode} The element to be rendered.
*/
renderCell?: (params: GridRenderCellParams<R, V, F>) => React.ReactNode;
/**
* Allows to override the component rendered in edit cell mode for this column.
* @param {GridRenderEditCellParams} params Object containing parameters for the renderer.
* @returns {React.ReactNode} The element to be rendered.
*/
renderEditCell?: (params: GridRenderEditCellParams<R, V, F>) => React.ReactNode;
/**
* Callback fired when the edit props of the cell changes.
* It allows to process the props that saved into the state.
* @param {GridPreProcessEditCellProps} params Object containing parameters of the cell being edited.
* @returns {GridEditCellProps | Promise<GridEditCellProps>} The new edit cell props.
*/
preProcessEditCellProps?: (params: GridPreProcessEditCellProps) => GridEditCellProps | Promise<GridEditCellProps>;
/**
* Class name that will be added in the column header cell.
*/
headerClassName?: GridColumnHeaderClassNamePropType;
/**
* Allows to render a component in the column header cell.
* @template R, V, F
* @param {GridColumnHeaderParams<R, V, F>} params Object containing parameters for the renderer.
* @returns {React.ReactNode} The element to be rendered.
*/
renderHeader?: (params: GridColumnHeaderParams<R, V, F>) => React.ReactNode;
/**
* Header cell element alignment.
*/
headerAlign?: GridAlignment;
/**
* Toggle the visibility of the sort icons.
* @default false
*/
hideSortIcons?: boolean;
/**
* If `true`, the column menu is disabled for this column.
* @default false
*/
disableColumnMenu?: boolean;
/**
* If `true`, the column is filterable.
* @default true
*/
filterable?: boolean;
/**
* Allows setting the filter operators for this column.
*/
filterOperators?: GridFilterOperator<R, V, F>[];
/**
* The callback that generates a filtering function for a given quick filter value.
* This function can return `null` to skip filtering for this value and column.
* @param {any} value The value with which we want to filter the column.
* @param {GridStateColDef} colDef The column from which we want to filter the rows.
* @param {React.MutableRefObject<GridApiCommunity>} apiRef Deprecated: The API of the grid.
* @returns {null | ((params: GridCellParams) => boolean)} The function to call to check if a row pass this filter value or not.
*/
getApplyQuickFilterFn?: GetApplyQuickFilterFnLegacy<R, V, F>;
/**
* The callback that generates a filtering function for a given quick filter value.
* This function can return `null` to skip filtering for this value and column.
* @param {any} value The value with which we want to filter the column.
* @param {GridStateColDef} colDef The column from which we want to filter the rows.
* @param {React.MutableRefObject<GridApiCommunity>} apiRef Deprecated: The API of the grid.
* @returns {null | GridApplyQuickFilterV7} The function to call to check if a row pass this filter value or not.
*/
getApplyQuickFilterFnV7?: GetApplyQuickFilterFnV7<R, V>;
/**
* If `true`, this column cannot be reordered.
* @default false
*/
disableReorder?: boolean;
/**
* If `true`, this column will not be included in exports.
* @default false
*/
disableExport?: boolean;
/**
* Number of columns a cell should span.
* @default 1
*/
colSpan?: number | ((params: GridCellParams<R, V, F>) => number | undefined);
}
/**
* Column Definition interface used for columns with the `actions` type.
* @demos
* - [Special column properties](/x/react-data-grid/column-definition/#special-properties)
*/
export interface GridActionsColDef<R extends GridValidRowModel = any, V = any, F = V> extends GridBaseColDef<R, V, F> {
/**
* The type of the column.
* @default 'actions'
*/
type: 'actions';
/**
* Function that returns the actions to be shown.
* @param {GridRowParams} params The params for each row.
* @returns {React.ReactElement<GridActionsCellItemProps>[]} An array of [[GridActionsCell]] elements.
*/
getActions: (params: GridRowParams<R>) => React.ReactElement<GridActionsCellItemProps>[];
}
/**
* Column Definition interface used for columns with the `singleSelect` type.
* @demos
* - [Special column properties](/x/react-data-grid/column-definition/#special-properties)
*/
export interface GridSingleSelectColDef<R extends GridValidRowModel = any, V = any, F = V> extends GridBaseColDef<R, V, F> {
/**
* The type of the column.
* @default 'singleSelect'
*/
type: 'singleSelect';
/**
* To be used in combination with `type: 'singleSelect'`. This is an array (or a function returning an array) of the possible cell values and labels.
*/
valueOptions?: Array<ValueOptions> | ((params: GridValueOptionsParams<R>) => Array<ValueOptions>);
/**
* Used to determine the label displayed for a given value option.
* @param {ValueOptions} value The current value option.
* @returns {string} The text to be displayed.
*/
getOptionLabel?: (value: ValueOptions) => string;
/**
* Used to determine the value used for a value option.
* @param {ValueOptions} value The current value option.
* @returns {string} The value to be used.
*/
getOptionValue?: (value: ValueOptions) => any;
}
/**
* Column Definition interface.
* @demos
* - [Column definition](/x/react-data-grid/column-definition/)
*/
export type GridColDef<R extends GridValidRowModel = any, V = any, F = V> = GridBaseColDef<R, V, F> | GridActionsColDef<R, V, F> | GridSingleSelectColDef<R, V, F>;
export type GridColTypeDef<V = any, F = V> = Omit<GridBaseColDef<any, V, F>, 'field'>;
export type GridStateColDef<R extends GridValidRowModel = any, V = any, F = V> = GridColDef<R, V, F> & {
computedWidth: number;
/**
* If `true`, it means that at least one of the dimension's property of this column has been modified since the last time the column prop has changed.
*/
hasBeenResized?: boolean;
};
/**
* Meta Info about columns.
*/
export interface GridColumnsMeta {
totalWidth: number;
positions: number[];
}

View File

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

View File

@@ -0,0 +1,4 @@
type LiteralUnion<LiteralType, BaseType> = LiteralType | (BaseType & Record<never, never>);
export type GridNativeColTypes = 'string' | 'number' | 'date' | 'dateTime' | 'boolean' | 'singleSelect' | 'actions';
export type GridColType = LiteralUnion<GridNativeColTypes, string>;
export {};

View File

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

View File

@@ -0,0 +1,3 @@
import { GridColTypeDef } from './gridColDef';
import { GridColType } from './gridColType';
export type GridColumnTypesRecord = Record<GridColType, GridColTypeDef>;

View File

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

View File

@@ -0,0 +1,3 @@
export type { GridAlignment, ValueOptions, GridKeyValue, GridColDef, GridColTypeDef, GridColumnsMeta, GridSingleSelectColDef, GridActionsColDef, } from './gridColDef';
export * from './gridColType';
export * from './gridColumnTypesRecord';

View File

@@ -0,0 +1,6 @@
// ColDef
// Other types
export * from './gridColType';
export * from './gridColumnTypesRecord';
export {};

View File

@@ -0,0 +1,14 @@
import { GridCallbackDetails } from './api/gridCallbackDetails';
import type { GridEventLookup, GridControlledStateEventLookup } from './events';
import type { OutputSelector } from '../utils/createSelector';
import { GridStateCommunity } from './gridStateCommunity';
export interface GridControlStateItem<State extends GridStateCommunity, E extends keyof GridControlledStateEventLookup> {
stateId: string;
propModel?: GridEventLookup[E]['params'];
stateSelector: OutputSelector<{
state: State;
instanceId: string;
}, GridControlledStateEventLookup[E]['params']> | ((state: State) => GridControlledStateEventLookup[E]['params']);
propOnChange?: (model: GridControlledStateEventLookup[E]['params'], details: GridCallbackDetails) => void;
changeEvent: E;
}

View File

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

View File

@@ -0,0 +1,4 @@
export interface CursorCoordinates {
x: number;
y: number;
}

View File

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

View File

@@ -0,0 +1,13 @@
/**
* The size of a container.
*/
export interface ElementSize {
/**
* The height of a container or HTMLElement.
*/
height: number;
/**
* The width of a container or HTMLElement.
*/
width: number;
}

View File

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

View File

@@ -0,0 +1,8 @@
import { MuiBaseEvent, MuiEvent } from '../muiEvent';
import { GridCallbackDetails } from '../api/gridCallbackDetails';
import { GridEventLookup, GridEvents } from './gridEventLookup';
export type GridEventListener<E extends GridEvents> = (params: GridEventLookup[E] extends {
params: any;
} ? GridEventLookup[E]['params'] : undefined, event: GridEventLookup[E] extends {
event: MuiBaseEvent;
} ? MuiEvent<GridEventLookup[E]['event']> : MuiEvent<{}>, details: GridCallbackDetails) => void;

View File

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

View File

@@ -0,0 +1,629 @@
import * as React from 'react';
import type { GridColumnHeaderParams, GridColumnOrderChangeParams, GridColumnResizeParams, GridHeaderSelectionCheckboxParams, GridMenuParams, GridPreferencePanelParams, GridRenderedRowsIntervalChangeParams, GridRowParams, GridRowSelectionCheckboxParams, GridScrollParams, GridColumnGroupHeaderParams } from '../params';
import { GridCellEditStartParams, GridCellEditStopParams } from '../params/gridEditCellParams';
import { GridCellParams } from '../params/gridCellParams';
import type { GridFilterModel } from '../gridFilterModel';
import type { GridSortModel } from '../gridSortModel';
import type { GridRowSelectionModel } from '../gridRowSelectionModel';
import type { ElementSize } from '../elementSize';
import type { MuiBaseEvent } from '../muiEvent';
import type { GridGroupNode } from '../gridRows';
import type { GridColumnVisibilityModel } from '../../hooks/features/columns';
import type { GridStrategyProcessorName } from '../../hooks/core/strategyProcessing';
import { GridRowEditStartParams, GridRowEditStopParams } from '../params/gridRowParams';
import { GridCellModesModel, GridRowModesModel } from '../api/gridEditingApi';
import { GridPaginationModel } from '../gridPaginationProps';
export interface GridRowEventLookup {
/**
* Fired when a row is clicked.
* Not fired if the cell clicked is from an interactive column (actions, checkbox, etc).
*/
rowClick: {
params: GridRowParams;
event: React.MouseEvent<HTMLElement>;
};
/**
* Fired when a row is double-clicked.
*/
rowDoubleClick: {
params: GridRowParams;
event: React.MouseEvent<HTMLElement>;
};
/**
* Fired when the mouse enters the row. Called with a [[GridRowParams]] object.
*/
rowMouseEnter: {
params: GridRowParams;
event: React.MouseEvent<HTMLElement>;
};
/**
* Fired when the mouse leaves the row. Called with a [[GridRowParams]] object.
*/
rowMouseLeave: {
params: GridRowParams;
event: React.MouseEvent<HTMLElement>;
};
/**
* @ignore - do not document.
*/
rowMouseOut: {
params: GridRowParams;
event: React.MouseEvent<HTMLElement>;
};
/**
* @ignore - do not document.
*/
rowMouseOver: {
params: GridRowParams;
event: React.MouseEvent<HTMLElement>;
};
/**
* Fired when the user starts dragging a row. It's mapped to the `dragstart` DOM event.
* @ignore - do not document.
*/
rowDragStart: {
params: GridRowParams;
event: React.DragEvent<HTMLElement>;
};
/**
* Fired while an element or text selection is dragged over the row.
* It's mapped to the `dragover` DOM event.
* @ignore - do not document.
*/
rowDragOver: {
params: GridRowParams;
event: React.DragEvent<HTMLElement>;
};
/**
* Fired when the dragging of a row ends.
* @ignore - do not document.
*/
rowDragEnd: {
params: GridRowParams;
event: React.DragEvent<HTMLElement>;
};
}
export interface GridColumnHeaderEventLookup {
/**
* Fired when a column header is clicked
*/
columnHeaderClick: {
params: GridColumnHeaderParams;
event: React.MouseEvent<HTMLElement>;
};
/**
* Fired when a column header is double-clicked.
*/
columnHeaderDoubleClick: {
params: GridColumnHeaderParams;
event: React.MouseEvent<HTMLElement>;
};
/**
* Fired when a `mouseover` event happens in a column header.
* @ignore - do not document.
*/
columnHeaderOver: {
params: GridColumnHeaderParams;
event: React.MouseEvent<HTMLElement>;
};
/**
* Fired when a `mouseout` event happens in a column header.
* @ignore - do not document.
*/
columnHeaderOut: {
params: GridColumnHeaderParams;
event: React.MouseEvent<HTMLElement>;
};
/**
* Fired when a `mouseenter` event happens in a column header.
* @ignore - do not document.
*/
columnHeaderEnter: {
params: GridColumnHeaderParams;
event: React.MouseEvent<HTMLElement>;
};
/**
* Fired when a `mouseleave` event happens in a column header.
* @ignore - do not document.*
*/
columnHeaderLeave: {
params: GridColumnHeaderParams;
event: React.MouseEvent<HTMLElement>;
};
/**
* Fired when a key is pressed in a column header. It's mapped do the `keydown` DOM event.
*/
columnHeaderKeyDown: {
params: GridColumnHeaderParams;
event: React.KeyboardEvent<HTMLElement>;
};
/**
* Fired when a column header gains focus.
* @ignore - do not document.
*/
columnHeaderFocus: {
params: GridColumnHeaderParams;
event: React.FocusEvent<HTMLElement>;
};
/**
* Fired when a column header loses focus.
* @ignore - do not document.
*/
columnHeaderBlur: {
params: GridColumnHeaderParams;
event: React.FocusEvent<HTMLElement>;
};
/**
* Fired when the user starts dragging a column header. It's mapped to the `dragstart` DOM event.
* @ignore - do not document.
*/
columnHeaderDragStart: {
params: GridColumnHeaderParams;
event: React.DragEvent<HTMLElement>;
};
/**
* Fired when the dragged column header enters a valid drop target.
* It's mapped to the `dragend` DOM event.
* @ignore - do not document.
*/
columnHeaderDragEnter: {
params: GridColumnHeaderParams;
event: React.DragEvent<HTMLElement>;
};
/**
* Fired while an element or text selection is dragged over the column header.
* It's mapped to the `dragover` DOM event.
* @ignore - do not document.
*/
columnHeaderDragOver: {
params: GridColumnHeaderParams;
event: React.DragEvent<HTMLElement>;
};
/**
* Fired when the dragging of a column header ends.
* @ignore - do not document.
*/
columnHeaderDragEnd: {
params: GridColumnHeaderParams;
event: React.DragEvent<HTMLElement>;
};
/**
* Fired when a `dblclick` DOM event happens in the column header separator.
* @ignore - do not document.
*/
columnSeparatorDoubleClick: {
params: GridColumnHeaderParams;
event: React.MouseEvent<HTMLElement>;
};
/**
* Fired when a `mousedown` DOM event happens in the column header separator.
* @ignore - do not document.
*/
columnSeparatorMouseDown: {
params: GridColumnHeaderParams;
event: React.MouseEvent<HTMLElement>;
};
/**
* Fired when the index of a column changes.
* @ignore - do not document.
*/
columnIndexChange: {
params: GridColumnOrderChangeParams;
};
}
export interface GridHeaderFilterEventLookup {
/**
* Fired when a column header filter is clicked
* @ignore - do not document.
*/
headerFilterClick: {
params: GridColumnHeaderParams;
event: React.MouseEvent<HTMLElement>;
};
/**
* Fired when a key is pressed in a column header filter. It's mapped to the `keydown` DOM event.
* @ignore - do not document.
*/
headerFilterKeyDown: {
params: GridColumnHeaderParams;
event: React.KeyboardEvent<HTMLElement>;
};
/**
* Fired when a mouse is pressed in a column header filter. It's mapped to the `mousedown` DOM event.
* @ignore - do not document.
*/
headerFilterMouseDown: {
params: GridColumnHeaderParams;
event: React.KeyboardEvent<HTMLElement>;
};
/**
* Fired when a column header filter is blurred.
* @ignore - do not document.
*/
headerFilterBlur: {
params: GridColumnHeaderParams;
event: React.KeyboardEvent<HTMLElement>;
};
}
export interface GridColumnGroupHeaderEventLookup {
/**
* Fired when a key is pressed in a column group header. It's mapped do the `keydown` DOM event.
*/
columnGroupHeaderKeyDown: {
params: GridColumnGroupHeaderParams;
event: React.KeyboardEvent<HTMLElement>;
};
/**
* Fired when a column group header gains focus.
* @ignore - do not document.
*/
columnGroupHeaderFocus: {
params: GridColumnGroupHeaderParams;
event: React.FocusEvent<HTMLElement>;
};
/**
* Fired when a column group header loses focus.
* @ignore - do not document.
*/
columnGroupHeaderBlur: {
params: GridColumnGroupHeaderParams;
event: React.FocusEvent<HTMLElement>;
};
}
export interface GridCellEventLookup {
/**
* Fired when a cell is clicked.
*/
cellClick: {
params: GridCellParams<any>;
event: React.MouseEvent<HTMLElement>;
};
/**
* Fired when a cell is double-clicked.
*/
cellDoubleClick: {
params: GridCellParams<any>;
event: React.MouseEvent<HTMLElement>;
};
/**
* Fired when a `mousedown` event happens in a cell.
*/
cellMouseDown: {
params: GridCellParams<any>;
event: React.MouseEvent<HTMLElement>;
};
/**
* Fired when a `mouseup` event happens in a cell.
*/
cellMouseUp: {
params: GridCellParams<any>;
event: React.MouseEvent<HTMLElement>;
};
/**
* Fired when a `mouseover` event happens in a cell.
*/
cellMouseOver: {
params: GridCellParams<any>;
event: React.MouseEvent<HTMLElement>;
};
/**
* Fired when a `keydown` event happens in a cell.
*/
cellKeyDown: {
params: GridCellParams<any>;
event: React.KeyboardEvent<HTMLElement>;
};
/**
* Fired when a `keyup` event happens in a cell.
*/
cellKeyUp: {
params: GridCellParams<any>;
event: React.KeyboardEvent<HTMLElement>;
};
/**
* Fired when the dragged cell enters a valid drop target. It's mapped to the `dragend` DOM event.
* @ignore - do not document.
*/
cellDragEnter: {
params: GridCellParams<any>;
event: React.DragEvent<HTMLElement>;
};
/**
* Fired while an element or text selection is dragged over the cell.
* It's mapped to the `dragover` DOM event.
* @ignore - do not document.
*/
cellDragOver: {
params: GridCellParams<any>;
event: React.DragEvent<HTMLElement>;
};
}
export interface GridControlledStateEventLookup {
/**
* Fired when the pagination model changes.
*/
paginationModelChange: {
params: GridPaginationModel;
};
/**
* Fired when the filter model changes.
*/
filterModelChange: {
params: GridFilterModel;
};
/**
* Fired when the sort model changes.
*/
sortModelChange: {
params: GridSortModel;
};
/**
* Fired when the selection state of one or multiple rows changes.
*/
rowSelectionChange: {
params: GridRowSelectionModel;
};
/**
* Fired when the column visibility model changes.
*/
columnVisibilityModelChange: {
params: GridColumnVisibilityModel;
};
/**
* Fired when the row count change.
*/
rowCountChange: {
params: number;
};
}
export interface GridControlledStateReasonLookup {
filter: 'upsertFilterItem' | 'upsertFilterItems' | 'deleteFilterItem' | 'changeLogicOperator' | 'restoreState';
pagination: 'setPaginationModel' | 'stateRestorePreProcessing';
}
export interface GridEventLookup extends GridRowEventLookup, GridColumnHeaderEventLookup, GridHeaderFilterEventLookup, GridColumnGroupHeaderEventLookup, GridCellEventLookup, GridControlledStateEventLookup {
/**
* Fired when the grid is unmounted.
*/
unmount: {};
/**
* Fired when the state of the grid is updated.
*/
stateChange: {
params: any;
};
/**
* Fired when the grid is resized.
*/
resize: {
params: ElementSize;
};
/**
* Fired when the inner size of the viewport changes. Called with an [[ElementSize]] object.
*/
viewportInnerSizeChange: {
params: ElementSize;
};
/**
* Fired when the grid is resized with a debounced time of 60ms.
*/
debouncedResize: {
params: ElementSize;
};
/**
* Fired when a processor of the active strategy changes.
* @ignore - do not document.
*/
activeStrategyProcessorChange: {
params: GridStrategyProcessorName;
};
/**
* Fired when the callback to decide if a strategy is available or not changes.
* @ignore - do not document.
*/
strategyAvailabilityChange: {};
/**
* Fired when the columns state is changed.
*/
columnsChange: {
params: string[];
};
/**
* Fired when the width of a column is changed.
*/
columnWidthChange: {
params: GridColumnResizeParams;
event: MouseEvent | {};
};
/**
* Fired when the user starts resizing a column.
*/
columnResizeStart: {
params: {
field: string;
};
event: React.MouseEvent<HTMLElement>;
};
/**
* Fired when the user stops resizing a column.
*/
columnResizeStop: {
params: null;
event: MouseEvent;
};
/**
* Fired during the resizing of a column.
*/
columnResize: {
params: GridColumnResizeParams;
event: MouseEvent;
};
/**
* Fired when the user ends reordering a column.
*/
columnOrderChange: {
params: GridColumnOrderChangeParams;
};
/**
* Fired when the rows are updated.
* @ignore - do not document.
*/
rowsSet: {};
/**
* Fired when the filtered rows are updated
* @ignore - do not document.
*/
filteredRowsSet: {};
/**
* Fired when the sorted rows are updated
* @ignore - do not document
*/
sortedRowsSet: {};
/**
* Fired when the expansion of a row is changed. Called with a [[GridGroupNode]] object.
*/
rowExpansionChange: {
params: GridGroupNode;
};
/**
* Fired when the rendered rows index interval changes. Called with a [[GridRenderedRowsIntervalChangeParams]] object.
*/
renderedRowsIntervalChange: {
params: GridRenderedRowsIntervalChangeParams;
};
/**
* Fired when the mode of a cell changes.
* @ignore - do not document
*/
cellModeChange: {
params: GridCellParams<any>;
};
/**
* Fired when the model that controls the cell modes changes.
*/
cellModesModelChange: {
params: GridCellModesModel;
};
/**
* Fired when the model that controls the row modes changes.
*/
rowModesModelChange: {
params: GridRowModesModel;
};
/**
* Fired when the cell turns to edit mode.
*/
cellEditStart: {
params: GridCellEditStartParams;
event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>;
};
/**
* Fired when the cell turns back to view mode.
*/
cellEditStop: {
params: GridCellEditStopParams;
event: MuiBaseEvent;
};
/**
* Fired when the row turns to edit mode.
*/
rowEditStart: {
params: GridRowEditStartParams;
event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>;
};
/**
* Fired when the row turns back to view mode.
*/
rowEditStop: {
params: GridRowEditStopParams;
event: MuiBaseEvent;
};
/**
* Fired when a cell gains focus.
* @ignore - do not document.
*/
cellFocusIn: {
params: GridCellParams<any>;
};
/**
* Fired when a cell loses focus.
* @ignore - do not document.
*/
cellFocusOut: {
params: GridCellParams<any>;
event: MuiBaseEvent;
};
/**
* Fired during the scroll of the grid viewport.
*/
scrollPositionChange: {
params: GridScrollParams;
event: React.UIEvent | MuiBaseEvent;
};
/**
* Fired when the content size used by the `GridVirtualScroller` changes.
* @ignore - do not document.
*/
virtualScrollerContentSizeChange: {};
/**
* Fired when the content is scrolled by the mouse wheel.
* It's attached to the "mousewheel" event.
* @ignore - do not document.
*/
virtualScrollerWheel: {
params: {};
event: React.WheelEvent;
};
/**
* Fired when the content is moved using a touch device.
* It's attached to the "touchmove" event.
* @ignore - do not document.
*/
virtualScrollerTouchMove: {
params: {};
event: React.TouchEvent;
};
/**
* Fired when the value of the selection checkbox of the header is changed.
*/
headerSelectionCheckboxChange: {
params: GridHeaderSelectionCheckboxParams;
};
/**
* Fired when the value of the selection checkbox of a row is changed.
*/
rowSelectionCheckboxChange: {
params: GridRowSelectionCheckboxParams;
event: React.ChangeEvent<HTMLElement>;
};
/**
* Fired when the data is copied to the clipboard.
*/
clipboardCopy: {
params: string;
};
/**
* Fired when the preference panel is closed.
*/
preferencePanelClose: {
params: GridPreferencePanelParams;
};
/**
* Fired when the preference panel is opened.
*/
preferencePanelOpen: {
params: GridPreferencePanelParams;
};
/**
* Fired when the menu is opened.
*/
menuOpen: {
params: GridMenuParams;
};
/**
* Fired when the grid menu is closed.
*/
menuClose: {
params: GridMenuParams;
};
}
export type GridEvents = keyof GridEventLookup;

View File

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

View File

@@ -0,0 +1,29 @@
import { MuiBaseEvent } from '../muiEvent';
import { GridEventLookup, GridEvents } from './gridEventLookup';
type PublisherArgsNoEvent<E extends GridEvents, T extends {
params: any;
}> = [E, T['params']];
type PublisherArgsRequiredEvent<E extends GridEvents, T extends {
params: any;
event: MuiBaseEvent;
}> = [E, T['params'], T['event']];
type PublisherArgsOptionalEvent<E extends GridEvents, T extends {
params: any;
event: MuiBaseEvent;
}> = PublisherArgsRequiredEvent<E, T> | PublisherArgsNoEvent<E, T>;
type PublisherArgsEvent<E extends GridEvents, T extends {
params: any;
event: MuiBaseEvent;
}> = {} extends T['event'] ? PublisherArgsOptionalEvent<E, T> : PublisherArgsRequiredEvent<E, T>;
type PublisherArgsParams<E extends GridEvents, T extends {
params: any;
}> = [E, T['params']];
type PublisherArgsNoParams<E extends GridEvents> = [E];
type GridEventPublisherArg<E extends GridEvents, T> = T extends {
params: any;
event: MuiBaseEvent;
} ? PublisherArgsEvent<E, T> : T extends {
params: any;
} ? PublisherArgsParams<E, T> : PublisherArgsNoParams<E>;
export type GridEventPublisher = <E extends GridEvents>(...params: GridEventPublisherArg<E, GridEventLookup[E]>) => void;
export {};

View File

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

View File

@@ -0,0 +1,3 @@
export * from './gridEventListener';
export * from './gridEventPublisher';
export * from './gridEventLookup';

View File

@@ -0,0 +1,3 @@
export * from './gridEventListener';
export * from './gridEventPublisher';
export * from './gridEventLookup';

View File

@@ -0,0 +1,4 @@
import { GridRowsInternalCache } from '../hooks/features/rows/gridRowsInterfaces';
export interface GridApiCaches {
rows: GridRowsInternalCache;
}

View File

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

View File

@@ -0,0 +1,30 @@
import type { GridColDef } from './colDef';
import { GridRowId } from './gridRows';
/**
* The mode of the cell.
*/
export type GridCellMode = 'edit' | 'view';
/**
* The mode of the row.
*/
export type GridRowMode = 'edit' | 'view';
/**
* The coordinates of cell represented by their row and column indexes.
*/
export interface GridCellIndexCoordinates {
colIndex: number;
rowIndex: number;
}
/**
* The coordinates of a cell represented by their row ID and column field.
*/
export interface GridCellCoordinates {
id: GridRowId;
field: GridColDef['field'];
}
/**
* The coordinates of column header represented by their row and column indexes.
*/
export interface GridColumnHeaderIndexCoordinates {
colIndex: number;
}

View File

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

View File

@@ -0,0 +1,10 @@
import { GridValidRowModel } from './gridRows';
import { GridCellParams } from './params/gridCellParams';
/**
* A function used to process cellClassName params.
*/
export type GridCellClassFn<R extends GridValidRowModel = any, V = unknown> = (params: GridCellParams<R, V>) => string;
/**
* The union type representing the [[GridColDef]] cell class type.
*/
export type GridCellClassNamePropType<R extends GridValidRowModel = any, V = unknown> = string | GridCellClassFn<R, V>;

View File

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

View File

@@ -0,0 +1,42 @@
/// <reference types="react" />
import { GridColDef } from './colDef';
import type { GridColumnGroupHeaderParams } from './params/gridColumnGroupHeaderParams';
export interface GridLeafColumn {
field: GridColDef['field'];
}
export type GridColumnNode = GridColumnGroup | GridLeafColumn;
export declare function isLeaf(node: GridColumnNode): node is GridLeafColumn;
/**
* A function used to process headerClassName params.
*/
export type GridColumnGroupHeaderClassFn = (params: GridColumnGroupHeaderParams) => string;
/**
* The union type representing the [[GridColDef]] column header class type.
*/
export type GridColumnGroupHeaderClassNamePropType = string | GridColumnGroupHeaderClassFn;
export interface GridColumnGroup extends Pick<GridColDef, 'headerName' | 'description' | 'headerAlign'> {
/**
* A unique string identifying the group.
*/
groupId: string;
/**
* The groups and columns included in this group.
*/
children: GridColumnNode[];
/**
* If `true`, allows reordering columns outside of the group.
* @default false
*/
freeReordering?: boolean;
/**
* Allows to render a component in the column group header cell.
* @param {GridColumnGroupHeaderParams} params Object containing parameters for the renderer.
* @returns {React.ReactNode} The element to be rendered.
*/
renderHeaderGroup?: (params: GridColumnGroupHeaderParams) => React.ReactNode;
/**
* Class name that will be added in the column group header cell.
*/
headerClassName?: GridColumnGroupHeaderClassNamePropType;
}
export type GridColumnGroupingModel = GridColumnGroup[];

View File

@@ -0,0 +1,11 @@
export function isLeaf(node) {
return node.field !== undefined;
}
/**
* A function used to process headerClassName params.
*/
/**
* The union type representing the [[GridColDef]] column header class type.
*/

View File

@@ -0,0 +1,9 @@
import { GridColumnHeaderParams } from './params/gridColumnHeaderParams';
/**
* A function used to process headerClassName params.
*/
export type GridColumnHeaderClassFn = (params: GridColumnHeaderParams) => string;
/**
* The union type representing the [[GridColDef]] column header class type.
*/
export type GridColumnHeaderClassNamePropType = string | GridColumnHeaderClassFn;

View File

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

View File

@@ -0,0 +1,12 @@
export type GridColumnIndex = number;
export type GridCellColSpanInfo = {
spannedByColSpan: true;
rightVisibleCellIndex: GridColumnIndex;
leftVisibleCellIndex: GridColumnIndex;
} | {
spannedByColSpan: false;
cellProps: {
colSpan: number;
width: number;
};
};

View File

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

View File

@@ -0,0 +1,4 @@
/**
* Available densities.
*/
export type GridDensity = 'compact' | 'standard' | 'comfortable';

View File

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

View File

@@ -0,0 +1,28 @@
import type { GridEditCellMeta } from './api/gridEditingApi';
export interface GridEditCellProps<V = any> {
value?: V | undefined;
isValidating?: boolean;
isProcessingProps?: boolean;
changeReason?: GridEditCellMeta['changeReason'];
[prop: string]: any;
}
export type GridEditRowProps = {
[field: string]: GridEditCellProps;
};
export type GridEditingState = {
[rowId: string]: GridEditRowProps;
};
export type GridEditMode = 'cell' | 'row';
declare enum GridEditModes {
Cell = "cell",
Row = "row"
}
declare enum GridCellModes {
Edit = "edit",
View = "view"
}
declare enum GridRowModes {
Edit = "edit",
View = "view"
}
export { GridEditModes, GridCellModes, GridRowModes };

View File

@@ -0,0 +1,16 @@
var GridEditModes = /*#__PURE__*/function (GridEditModes) {
GridEditModes["Cell"] = "cell";
GridEditModes["Row"] = "row";
return GridEditModes;
}(GridEditModes || {});
var GridCellModes = /*#__PURE__*/function (GridCellModes) {
GridCellModes["Edit"] = "edit";
GridCellModes["View"] = "view";
return GridCellModes;
}(GridCellModes || {});
var GridRowModes = /*#__PURE__*/function (GridRowModes) {
GridRowModes["Edit"] = "edit";
GridRowModes["View"] = "view";
return GridRowModes;
}(GridRowModes || {});
export { GridEditModes, GridCellModes, GridRowModes };

View File

@@ -0,0 +1,159 @@
import * as React from 'react';
import { GridRowId } from './gridRows';
import type { GridApiCommon } from './api';
import type { GridApiCommunity } from './api/gridApiCommunity';
/**
* The options applicable to any export format.
*/
export interface GridExportOptions {
/**
* The columns exported.
* This should only be used if you want to restrict the columns exports.
*/
fields?: string[];
/**
* If `true`, the hidden columns will also be exported.
* @default false
*/
allColumns?: boolean;
}
/**
* The options applicable to any document export format (CSV and Excel).
*/
export interface GridFileExportOptions<Api extends GridApiCommon = GridApiCommunity> extends GridExportOptions {
/**
* The string used as the file name.
* @default `document.title`
*/
fileName?: string;
/**
* If `true`, the first row of the file will include the headers of the grid.
* @default true
*/
includeHeaders?: boolean;
/**
* Function that returns the list of row ids to export on the order they should be exported.
* @param {GridGetRowsToExportParams} params With all properties from [[GridGetRowsToExportParams]].
* @returns {GridRowId[]} The list of row ids to export.
*/
getRowsToExport?: (params: GridGetRowsToExportParams<Api>) => GridRowId[];
/**
* If `false`, the formulas in the cells will not be escaped.
* It is not recommended to disable this option as it exposes the user to potential CSV injection attacks.
* See https://owasp.org/www-community/attacks/CSV_Injection for more information.
* @default true
*/
escapeFormulas?: boolean;
}
export interface GridGetRowsToExportParams<Api extends GridApiCommon = GridApiCommunity> {
/**
* The API of the grid.
*/
apiRef: React.MutableRefObject<Api>;
}
export interface GridCsvGetRowsToExportParams<Api extends GridApiCommon = GridApiCommunity> extends GridGetRowsToExportParams<Api> {
}
export interface GridPrintGetRowsToExportParams<Api extends GridApiCommon = GridApiCommunity> extends GridGetRowsToExportParams<Api> {
}
/**
* The options to apply on the CSV export.
* @demos
* - [CSV export](/x/react-data-grid/export/#csv-export)
*/
export interface GridCsvExportOptions extends GridFileExportOptions {
/**
* The character used to separate fields.
* @default ','
*/
delimiter?: string;
/**
* The string used as the file name.
* @default `document.title`
*/
fileName?: string;
/**
* If `true`, the UTF-8 Byte Order Mark (BOM) prefixes the exported file.
* This can allow Excel to automatically detect file encoding as UTF-8.
* @default false
*/
utf8WithBom?: boolean;
/**
* If `true`, the CSV will include the column headers and column groups.
* Use `includeColumnGroupsHeaders` to control whether the column groups are included.
* @default true
*/
includeHeaders?: boolean;
/**
* If `true`, the CSV will include the column groups.
* @see See {@link https://mui.com/x/react-data-grid/column-groups/ column groups docs} for more details.
* @default true
*/
includeColumnGroupsHeaders?: boolean;
/**
* Function that returns the list of row ids to export on the order they should be exported.
* @param {GridCsvGetRowsToExportParams} params With all properties from [[GridCsvGetRowsToExportParams]].
* @returns {GridRowId[]} The list of row ids to export.
*/
getRowsToExport?: (params: GridCsvGetRowsToExportParams) => GridRowId[];
/**
* @ignore
* If `false`, the quotes will not be appended to the cell value.
* @default true
*/
shouldAppendQuotes?: boolean;
}
/**
* The options to apply on the Print export.
* @demos
* - [Print export](/x/react-data-grid/export/#print-export)
*/
export interface GridPrintExportOptions extends GridExportOptions {
/**
* The value to be used as the print window title.
* @default The title of the page.
*/
fileName?: string;
/**
* If `true`, the toolbar is removed for when printing.
* @default false
*/
hideToolbar?: boolean;
/**
* If `true`, the footer is removed for when printing.
* @default false
*/
hideFooter?: boolean;
/**
* If `true`, the selection checkboxes will be included when printing.
* @default false
*/
includeCheckboxes?: boolean;
/**
* If `false`, all <style> and <link type="stylesheet" /> tags from the <head> will not be copied
* to the print window.
* @default true
*/
copyStyles?: boolean;
/**
* One or more classes passed to the print window.
*/
bodyClassName?: string;
/**
* Provide Print specific styles to the print window.
*/
pageStyle?: string | Function;
/**
* Function that returns the list of row ids to export in the order they should be exported.
* @param {GridPrintGetRowsToExportParams} params With all properties from [[GridPrintGetRowsToExportParams]].
* @returns {GridRowId[]} The list of row ids to export.
*/
getRowsToExport?: (params: GridPrintGetRowsToExportParams) => GridRowId[];
}
/**
* Available export formats.
*/
export type GridExportFormat = 'csv' | 'print';
/**
* Available export extensions.
*/
export type GridExportExtension = 'csv';

View File

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

View File

@@ -0,0 +1 @@
export type GridFeatureMode = 'client' | 'server';

View File

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

View File

@@ -0,0 +1,30 @@
/**
* Filter item definition interface.
* @demos
* - [Custom filter operator](/x/react-data-grid/filtering/customization/#create-a-custom-operator)
*/
export interface GridFilterItem {
/**
* Must be unique.
* Only useful when the model contains several items.
*/
id?: number | string;
/**
* The column from which we want to filter the rows.
*/
field: string;
/**
* The filtering value.
* The operator filtering function will decide for each row if the row values is correct compared to this value.
*/
value?: any;
/**
* The name of the operator we want to apply.
*/
operator: string;
}
declare enum GridLogicOperator {
And = "and",
Or = "or"
}
export { GridLogicOperator };

View File

@@ -0,0 +1,11 @@
/**
* Filter item definition interface.
* @demos
* - [Custom filter operator](/x/react-data-grid/filtering/customization/#create-a-custom-operator)
*/
var GridLogicOperator = /*#__PURE__*/function (GridLogicOperator) {
GridLogicOperator["And"] = "and";
GridLogicOperator["Or"] = "or";
return GridLogicOperator;
}(GridLogicOperator || {});
export { GridLogicOperator };

View File

@@ -0,0 +1,34 @@
import { GridFilterItem, GridLogicOperator } from './gridFilterItem';
/**
* Model describing the filters to apply to the grid.
* @demos
* - [Pass filters to the grid](/x/react-data-grid/filtering/#pass-filters-to-the-data-grid)
*/
export interface GridFilterModel {
/**
* @default []
*/
items: GridFilterItem[];
/**
* - `GridLogicOperator.And`: the row must pass all the filter items.
* - `GridLogicOperator.Or`: the row must pass at least on filter item.
* @default `GridLogicOperator.Or`
*/
logicOperator?: GridLogicOperator;
/**
* values used to quick filter rows
* @default `[]`
*/
quickFilterValues?: any[];
/**
* - `GridLogicOperator.And`: the row must pass all the values.
* - `GridLogicOperator.Or`: the row must pass at least one value.
* @default `GridLogicOperator.And`
*/
quickFilterLogicOperator?: GridLogicOperator;
/**
* If `true`, the quick filter will skip cell values from hidden columns.
* @default false
*/
quickFilterExcludeHiddenColumns?: boolean;
}

View File

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

Some files were not shown because too many files have changed in this diff Show More