neue Homepage auf react basis

This commit is contained in:
2026-08-07 21:39:30 +02:00
parent 164bdd19ad
commit ee89442c04
52191 changed files with 1230242 additions and 58 deletions
+38
View File
@@ -0,0 +1,38 @@
import type { Virtualizer } from '@mui/x-virtualizer';
import type { GridColumnApi } from "./gridColumnApi.mjs";
import type { GridColumnMenuApi } from "./gridColumnMenuApi.mjs";
import type { GridCoreApi, GridCorePrivateApi } from "./gridCoreApi.mjs";
import type { GridCsvExportApi } from "./gridCsvExportApi.mjs";
import type { GridDensityApi } from "./gridDensityApi.mjs";
import type { GridEditingApi, GridEditingPrivateApi } from "./gridEditingApi.mjs";
import type { GridFilterApi } from "./gridFilterApi.mjs";
import type { GridFocusApi, GridFocusPrivateApi } from "./gridFocusApi.mjs";
import type { GridLocaleTextApi } from "./gridLocaleTextApi.mjs";
import type { GridParamsApi, GridParamsPrivateApi } from "./gridParamsApi.mjs";
import type { GridPreferencesPanelApi } from "./gridPreferencesPanelApi.mjs";
import type { GridPrintExportApi } from "./gridPrintExportApi.mjs";
import type { GridRowApi, GridRowProPrivateApi } from "./gridRowApi.mjs";
import type { GridRowsMetaApi, GridRowsMetaPrivateApi } from "./gridRowsMetaApi.mjs";
import type { GridRowSelectionApi } from "./gridRowSelectionApi.mjs";
import type { GridSortApi } from "./gridSortApi.mjs";
import type { GridStateApi, GridStatePrivateApi } from "./gridStateApi.mjs";
import type { GridLoggerApi } from "./gridLoggerApi.mjs";
import type { GridScrollApi } from "./gridScrollApi.mjs";
import type { GridVirtualizationApi, GridVirtualizationPrivateApi } from "./gridVirtualizationApi.mjs";
import type { GridPipeProcessingApi, GridPipeProcessingPrivateApi } from "../../hooks/core/pipeProcessing/index.mjs";
import type { GridColumnSpanningApi, GridColumnSpanningPrivateApi } from "./gridColumnSpanning.mjs";
import type { GridStrategyProcessingApi } from "../../hooks/core/strategyProcessing/index.mjs";
import type { GridDimensionsApi, GridDimensionsPrivateApi } from "../../hooks/features/dimensions/gridDimensionsApi.mjs";
import type { GridPaginationApi } from "../../hooks/features/pagination/index.mjs";
import type { GridStatePersistenceApi } from "../../hooks/features/statePersistence/index.mjs";
import type { GridColumnGroupingApi } from "./gridColumnGroupingApi.mjs";
import type { GridInitialStateCommunity, GridStateCommunity } from "../gridStateCommunity.mjs";
import type { GridHeaderFilteringApi, GridHeaderFilteringPrivateApi } from "./gridHeaderFilteringApi.mjs";
import type { DataGridProcessedProps } from "../props/DataGridProps.mjs";
import type { GridColumnResizeApi } from "../../hooks/features/columnResize/index.mjs";
import type { GridPivotingPrivateApiCommunity } from "../../hooks/features/pivoting/gridPivotingInterfaces.mjs";
export interface GridApiCommon<GridState extends GridStateCommunity = GridStateCommunity, GridInitialState extends GridInitialStateCommunity = GridInitialStateCommunity> 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, GridColumnResizeApi {}
export interface GridPrivateOnlyApiCommon<Api extends GridApiCommon, PrivateApi extends GridPrivateApiCommon, Props extends DataGridProcessedProps> extends GridCorePrivateApi<Api, PrivateApi, Props>, GridStatePrivateApi<Api['state']>, GridPipeProcessingPrivateApi, GridStrategyProcessingApi, GridColumnSpanningPrivateApi, GridRowsMetaPrivateApi, GridDimensionsPrivateApi, GridEditingPrivateApi, GridLoggerApi, GridFocusPrivateApi, GridHeaderFilteringPrivateApi, GridVirtualizationPrivateApi, GridRowProPrivateApi, GridParamsPrivateApi, GridPivotingPrivateApiCommunity {
virtualizer: Virtualizer;
}
export interface GridPrivateApiCommon extends GridApiCommon, GridPrivateOnlyApiCommon<GridApiCommon, GridPrivateApiCommon, DataGridProcessedProps> {}
+38
View File
@@ -0,0 +1,38 @@
import type { Virtualizer } from '@mui/x-virtualizer';
import type { GridColumnApi } from "./gridColumnApi.js";
import type { GridColumnMenuApi } from "./gridColumnMenuApi.js";
import type { GridCoreApi, GridCorePrivateApi } from "./gridCoreApi.js";
import type { GridCsvExportApi } from "./gridCsvExportApi.js";
import type { GridDensityApi } from "./gridDensityApi.js";
import type { GridEditingApi, GridEditingPrivateApi } from "./gridEditingApi.js";
import type { GridFilterApi } from "./gridFilterApi.js";
import type { GridFocusApi, GridFocusPrivateApi } from "./gridFocusApi.js";
import type { GridLocaleTextApi } from "./gridLocaleTextApi.js";
import type { GridParamsApi, GridParamsPrivateApi } from "./gridParamsApi.js";
import type { GridPreferencesPanelApi } from "./gridPreferencesPanelApi.js";
import type { GridPrintExportApi } from "./gridPrintExportApi.js";
import type { GridRowApi, GridRowProPrivateApi } from "./gridRowApi.js";
import type { GridRowsMetaApi, GridRowsMetaPrivateApi } from "./gridRowsMetaApi.js";
import type { GridRowSelectionApi } from "./gridRowSelectionApi.js";
import type { GridSortApi } from "./gridSortApi.js";
import type { GridStateApi, GridStatePrivateApi } from "./gridStateApi.js";
import type { GridLoggerApi } from "./gridLoggerApi.js";
import type { GridScrollApi } from "./gridScrollApi.js";
import type { GridVirtualizationApi, GridVirtualizationPrivateApi } from "./gridVirtualizationApi.js";
import type { GridPipeProcessingApi, GridPipeProcessingPrivateApi } from "../../hooks/core/pipeProcessing/index.js";
import type { GridColumnSpanningApi, GridColumnSpanningPrivateApi } from "./gridColumnSpanning.js";
import type { GridStrategyProcessingApi } from "../../hooks/core/strategyProcessing/index.js";
import type { GridDimensionsApi, GridDimensionsPrivateApi } from "../../hooks/features/dimensions/gridDimensionsApi.js";
import type { GridPaginationApi } from "../../hooks/features/pagination/index.js";
import type { GridStatePersistenceApi } from "../../hooks/features/statePersistence/index.js";
import type { GridColumnGroupingApi } from "./gridColumnGroupingApi.js";
import type { GridInitialStateCommunity, GridStateCommunity } from "../gridStateCommunity.js";
import type { GridHeaderFilteringApi, GridHeaderFilteringPrivateApi } from "./gridHeaderFilteringApi.js";
import type { DataGridProcessedProps } from "../props/DataGridProps.js";
import type { GridColumnResizeApi } from "../../hooks/features/columnResize/index.js";
import type { GridPivotingPrivateApiCommunity } from "../../hooks/features/pivoting/gridPivotingInterfaces.js";
export interface GridApiCommon<GridState extends GridStateCommunity = GridStateCommunity, GridInitialState extends GridInitialStateCommunity = GridInitialStateCommunity> 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, GridColumnResizeApi {}
export interface GridPrivateOnlyApiCommon<Api extends GridApiCommon, PrivateApi extends GridPrivateApiCommon, Props extends DataGridProcessedProps> extends GridCorePrivateApi<Api, PrivateApi, Props>, GridStatePrivateApi<Api['state']>, GridPipeProcessingPrivateApi, GridStrategyProcessingApi, GridColumnSpanningPrivateApi, GridRowsMetaPrivateApi, GridDimensionsPrivateApi, GridEditingPrivateApi, GridLoggerApi, GridFocusPrivateApi, GridHeaderFilteringPrivateApi, GridVirtualizationPrivateApi, GridRowProPrivateApi, GridParamsPrivateApi, GridPivotingPrivateApiCommunity {
virtualizer: Virtualizer;
}
export interface GridPrivateApiCommon extends GridApiCommon, GridPrivateOnlyApiCommon<GridApiCommon, GridPrivateApiCommon, DataGridProcessedProps> {}
+5
View File
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
+1
View File
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,12 @@
import type { GridDataSourceApi } from "../../hooks/features/dataSource/models.mjs";
import type { GridInitialStateCommunity, GridStateCommunity } from "../gridStateCommunity.mjs";
import type { DataGridProcessedProps } from "../props/DataGridProps.mjs";
import type { GridApiCommon, GridPrivateOnlyApiCommon } from "./gridApiCommon.mjs";
import type { GridColumnReorderApi } from "./gridColumnApi.mjs";
import type { GridRowProApi } from "./gridRowApi.mjs";
import type { GridRowMultiSelectionApi } from "./gridRowSelectionApi.mjs";
/**
* The API of the community version of the Data Grid.
*/
export interface GridApiCommunity extends GridApiCommon<GridStateCommunity, GridInitialStateCommunity>, GridDataSourceApi {}
export interface GridPrivateApiCommunity extends GridApiCommunity, GridPrivateOnlyApiCommon<GridApiCommunity, GridPrivateApiCommunity, DataGridProcessedProps>, GridRowMultiSelectionApi, GridColumnReorderApi, GridRowProApi {}
+12
View File
@@ -0,0 +1,12 @@
import type { GridDataSourceApi } from "../../hooks/features/dataSource/models.js";
import type { GridInitialStateCommunity, GridStateCommunity } from "../gridStateCommunity.js";
import type { DataGridProcessedProps } from "../props/DataGridProps.js";
import type { GridApiCommon, GridPrivateOnlyApiCommon } from "./gridApiCommon.js";
import type { GridColumnReorderApi } from "./gridColumnApi.js";
import type { GridRowProApi } from "./gridRowApi.js";
import type { GridRowMultiSelectionApi } from "./gridRowSelectionApi.js";
/**
* The API of the community version of the Data Grid.
*/
export interface GridApiCommunity extends GridApiCommon<GridStateCommunity, GridInitialStateCommunity>, GridDataSourceApi {}
export interface GridPrivateApiCommunity extends GridApiCommunity, GridPrivateOnlyApiCommon<GridApiCommunity, GridPrivateApiCommunity, DataGridProcessedProps>, GridRowMultiSelectionApi, GridColumnReorderApi, GridRowProApi {}
+5
View File
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,15 @@
import type { GridControlledStateReasonLookup } from "../events/gridEventLookup.mjs";
import type { GridApiCommon } from "./gridApiCommon.mjs";
/**
* 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];
/**
* GridApi that let you manipulate the grid.
*/
api: GridApiCommon;
}
@@ -0,0 +1,15 @@
import type { GridControlledStateReasonLookup } from "../events/gridEventLookup.js";
import type { GridApiCommon } from "./gridApiCommon.js";
/**
* 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];
/**
* GridApi that let you manipulate the grid.
*/
api: GridApiCommon;
}
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
@@ -0,0 +1 @@
export {};
+74
View File
@@ -0,0 +1,74 @@
import type { GridColDef, GridStateColDef } from "../colDef/gridColDef.mjs";
import type { GridColumnVisibilityModel } from "../../hooks/features/columns/gridColumnsInterfaces.mjs";
/**
* 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 | undefined} The [[GridStateColDef]], or `undefined` if the field is not in the current column set.
*/
getColumn: (field: string) => GridStateColDef | undefined;
/**
* 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;
}
+74
View File
@@ -0,0 +1,74 @@
import type { GridColDef, GridStateColDef } from "../colDef/gridColDef.js";
import type { GridColumnVisibilityModel } from "../../hooks/features/columns/gridColumnsInterfaces.js";
/**
* 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 | undefined} The [[GridStateColDef]], or `undefined` if the field is not in the current column set.
*/
getColumn: (field: string) => GridStateColDef | undefined;
/**
* 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;
}
+5
View File
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
+1
View File
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,19 @@
import type { GridColumnGroupLookup } from "../../hooks/features/columnGrouping/gridColumnGroupsInterfaces.mjs";
import type { GridColumnGroup } from "../gridColumnGrouping.mjs";
/**
* 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.
*/
getColumnGroupPath: (field: string) => GridColumnGroup['groupId'][];
/**
* Returns the column group lookup.
* @returns {GridColumnGroupLookup} The column group lookup.
*/
getAllGroupDetails: () => GridColumnGroupLookup;
}
@@ -0,0 +1,19 @@
import type { GridColumnGroupLookup } from "../../hooks/features/columnGrouping/gridColumnGroupsInterfaces.js";
import type { GridColumnGroup } from "../gridColumnGrouping.js";
/**
* 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.
*/
getColumnGroupPath: (field: string) => GridColumnGroup['groupId'][];
/**
* Returns the column group lookup.
* @returns {GridColumnGroupLookup} The column group lookup.
*/
getAllGroupDetails: () => GridColumnGroupLookup;
}
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
@@ -0,0 +1 @@
export {};
@@ -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;
}
@@ -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;
}
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,28 @@
import type { GridStateColDef } from "../colDef/gridColDef.mjs";
import type { GridColumnIndex, GridCellColSpanInfo } from "../gridColumnSpanning.mjs";
import type { GridRowId } from "../gridRows.mjs";
/**
* 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 {
/** Reset the colspan cache */
resetColSpan: () => void;
/**
* Calculate column spanning for each cell in the row
* @param {GridRowId} rowId The row id
* @param {number} minFirstColumn First visible column index
* @param {number} maxLastColumn Last visible column index
* @param {GridStateColDef[]} columns List of columns to calculate colSpan for
*/
calculateColSpan: (rowId: GridRowId, minFirstColumn: number, maxLastColumn: number, columns: GridStateColDef[]) => void;
}
@@ -0,0 +1,28 @@
import type { GridStateColDef } from "../colDef/gridColDef.js";
import type { GridColumnIndex, GridCellColSpanInfo } from "../gridColumnSpanning.js";
import type { GridRowId } from "../gridRows.js";
/**
* 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 {
/** Reset the colspan cache */
resetColSpan: () => void;
/**
* Calculate column spanning for each cell in the row
* @param {GridRowId} rowId The row id
* @param {number} minFirstColumn First visible column index
* @param {number} maxLastColumn Last visible column index
* @param {GridStateColDef[]} columns List of columns to calculate colSpan for
*/
calculateColSpan: (rowId: GridRowId, minFirstColumn: number, maxLastColumn: number, columns: GridStateColDef[]) => void;
}
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
@@ -0,0 +1 @@
export {};
+96
View File
@@ -0,0 +1,96 @@
import type * as React from 'react';
import type { EventManager, EventListenerOptions } from '@mui/x-internals/EventManager';
import type { Store } from '@mui/x-internals/store';
import type { GridEventPublisher, GridEventListener, GridEvents } from "../events/index.mjs";
import type { GridApiCaches } from "../gridApiCaches.mjs";
import type { GridApiCommon, GridPrivateApiCommon } from "./gridApiCommon.mjs";
import type { DataGridProcessedProps } from "../props/DataGridProps.mjs";
/**
* 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 | null>;
/**
* 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 main container div element.
*/
mainElementRef: React.RefObject<HTMLDivElement | null>;
/**
* The React ref of the grid's virtual scroller container element.
*/
virtualScrollerRef: React.RefObject<HTMLDivElement | null>;
/**
* The React ref of the grid's vertical virtual scrollbar container element.
*/
virtualScrollbarVerticalRef: React.RefObject<HTMLDivElement | null>;
/**
* The React ref of the grid's horizontal virtual scrollbar container element.
*/
virtualScrollbarHorizontalRef: React.RefObject<HTMLDivElement | null>;
/**
* The React ref of the grid column container virtualized div element.
*/
columnHeadersContainerRef: React.RefObject<HTMLDivElement | null>;
/**
* The React ref of the grid header filter row element.
*/
headerFiltersElementRef?: React.RefObject<HTMLDivElement | null>;
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;
}
+96
View File
@@ -0,0 +1,96 @@
import type * as React from 'react';
import type { EventManager, EventListenerOptions } from '@mui/x-internals/EventManager';
import type { Store } from '@mui/x-internals/store';
import type { GridEventPublisher, GridEventListener, GridEvents } from "../events/index.js";
import type { GridApiCaches } from "../gridApiCaches.js";
import type { GridApiCommon, GridPrivateApiCommon } from "./gridApiCommon.js";
import type { DataGridProcessedProps } from "../props/DataGridProps.js";
/**
* 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 | null>;
/**
* 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 main container div element.
*/
mainElementRef: React.RefObject<HTMLDivElement | null>;
/**
* The React ref of the grid's virtual scroller container element.
*/
virtualScrollerRef: React.RefObject<HTMLDivElement | null>;
/**
* The React ref of the grid's vertical virtual scrollbar container element.
*/
virtualScrollbarVerticalRef: React.RefObject<HTMLDivElement | null>;
/**
* The React ref of the grid's horizontal virtual scrollbar container element.
*/
virtualScrollbarHorizontalRef: React.RefObject<HTMLDivElement | null>;
/**
* The React ref of the grid column container virtualized div element.
*/
columnHeadersContainerRef: React.RefObject<HTMLDivElement | null>;
/**
* The React ref of the grid header filter row element.
*/
headerFiltersElementRef?: React.RefObject<HTMLDivElement | null>;
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;
}
+5
View File
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
+1
View File
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,18 @@
import type { GridCsvExportOptions } from "../gridExport.mjs";
/**
* 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;
}
+18
View File
@@ -0,0 +1,18 @@
import type { GridCsvExportOptions } from "../gridExport.js";
/**
* 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;
}
+5
View File
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
@@ -0,0 +1 @@
export {};
+17
View File
@@ -0,0 +1,17 @@
import type * as React from 'react';
import type { GridDensity } from "../gridDensity.mjs";
export interface GridDensityOption {
icon: React.ReactElement<any>;
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;
}
+17
View File
@@ -0,0 +1,17 @@
import type * as React from 'react';
import type { GridDensity } from "../gridDensity.js";
export interface GridDensityOption {
icon: React.ReactElement<any>;
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;
}
+5
View File
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
+1
View File
@@ -0,0 +1 @@
export {};
+237
View File
@@ -0,0 +1,237 @@
import type { MuiBaseEvent } from '@mui/x-internals/types';
import type { GridCellMode, GridRowMode } from "../gridCell.mjs";
import type { GridCellModes, GridRowModes } from "../gridEditRowModel.mjs";
import type { GridRowId, GridRowModel } from "../gridRows.mjs";
import type { GridCellParams } from "../params/gridCellParams.mjs";
import type { GridEditCellValueParams } from "../params/gridEditCellParams.mjs";
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.
*/
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 {}
+237
View File
@@ -0,0 +1,237 @@
import type { MuiBaseEvent } from '@mui/x-internals/types';
import type { GridCellMode, GridRowMode } from "../gridCell.js";
import type { GridCellModes, GridRowModes } from "../gridEditRowModel.js";
import type { GridRowId, GridRowModel } from "../gridRows.js";
import type { GridCellParams } from "../params/gridCellParams.js";
import type { GridEditCellValueParams } from "../params/gridEditCellParams.js";
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.
*/
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 {}
+5
View File
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
+1
View File
@@ -0,0 +1 @@
export {};
+67
View File
@@ -0,0 +1,67 @@
import type { GridFilterModel } from "../gridFilterModel.mjs";
import type { GridFilterItem, GridLogicOperator } from "../gridFilterItem.mjs";
import type { GridControlledStateReasonLookup } from "../events/index.mjs";
import type { DataGridProcessedProps } from "../props/DataGridProps.mjs";
import type { GridStateCommunity } from "../gridStateCommunity.mjs";
/**
* 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'];
/**
* Returns the filter state for the given filter model without applying it to the Data Grid.
* @param {GridFilterModel} filterModel The filter model to get the state for.
* @returns {GridStateCommunity['filter']} The filter state.
*/
getFilterState: (filterModel: GridFilterModel) => GridStateCommunity['filter'];
}
+67
View File
@@ -0,0 +1,67 @@
import type { GridFilterModel } from "../gridFilterModel.js";
import type { GridFilterItem, GridLogicOperator } from "../gridFilterItem.js";
import type { GridControlledStateReasonLookup } from "../events/index.js";
import type { DataGridProcessedProps } from "../props/DataGridProps.js";
import type { GridStateCommunity } from "../gridStateCommunity.js";
/**
* 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'];
/**
* Returns the filter state for the given filter model without applying it to the Data Grid.
* @param {GridFilterModel} filterModel The filter model to get the state for.
* @returns {GridStateCommunity['filter']} The filter state.
*/
getFilterState: (filterModel: GridFilterModel) => GridStateCommunity['filter'];
}
+5
View File
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
+1
View File
@@ -0,0 +1 @@
export {};
+46
View File
@@ -0,0 +1,46 @@
import type { MuiBaseEvent } from '@mui/x-internals/types';
import type { GridRowId } from "../gridRows.mjs";
import type { GridColumnGroupIdentifier } from "../../hooks/features/focus/index.mjs";
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;
}
+46
View File
@@ -0,0 +1,46 @@
import type { MuiBaseEvent } from '@mui/x-internals/types';
import type { GridRowId } from "../gridRows.js";
import type { GridColumnGroupIdentifier } from "../../hooks/features/focus/index.js";
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;
}
+5
View File
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
+1
View File
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,30 @@
import type { GridColDef } from "../colDef/index.mjs";
import type { GridHeaderFilteringState } from "../gridHeaderFilteringModel.mjs";
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;
}
@@ -0,0 +1,30 @@
import type { GridColDef } from "../colDef/index.js";
import type { GridHeaderFilteringState } from "../gridHeaderFilteringModel.js";
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;
}
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,7 @@
export interface GridInfiniteLoaderPrivateApi {
getInfiniteLoadingTriggerElement?: ({
lastRowId
}: {
lastRowId: string | number;
}) => React.ReactNode;
}
@@ -0,0 +1,7 @@
export interface GridInfiniteLoaderPrivateApi {
getInfiniteLoadingTriggerElement?: ({
lastRowId
}: {
lastRowId: string | number;
}) => React.ReactNode;
}
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,247 @@
import type * as React from 'react';
import type { GridColDef } from "../colDef/index.mjs";
/**
* Set the types of the texts in the grid.
*/
export interface GridLocaleText {
noRowsLabel: string;
noResultsOverlayLabel: string;
noColumnsOverlayLabel: string;
noColumnsOverlayManageColumns: string;
emptyPivotOverlayLabel: string;
toolbarDensity: React.ReactNode;
toolbarDensityLabel: string;
toolbarDensityCompact: string;
toolbarDensityStandard: string;
toolbarDensityComfortable: string;
toolbarUndo: React.ReactNode;
toolbarRedo: React.ReactNode;
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;
toolbarPivot: string;
toolbarCharts: string;
toolbarAssistant: React.ReactNode;
columnsManagementSearchTitle: string;
columnsManagementNoColumns: string;
columnsManagementShowHideAllText: string;
columnsManagementReset: string;
columnsManagementDeleteIconLabel: string;
filterPanelAddFilter: React.ReactNode;
filterPanelRemoveAll: React.ReactNode;
filterPanelDeleteIconLabel: string;
filterPanelLogicOperator: string;
filterPanelOperator: React.ReactNode;
filterPanelOperatorAnd: React.ReactNode;
filterPanelOperatorOr: React.ReactNode;
filterPanelColumn: React.ReactNode;
filterPanelInputLabel: string;
filterPanelInputPlaceholder: string;
filterOperatorContains: string;
filterOperatorDoesNotContain: string;
filterOperatorEquals: string;
filterOperatorDoesNotEqual: 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;
headerFilterOperatorDoesNotContain: string;
headerFilterOperatorEquals: string;
headerFilterOperatorDoesNotEqual: 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;
headerFilterClear: string;
filterValueAny: string;
filterValueTrue: string;
filterValueFalse: string;
columnMenuLabel: string;
columnMenuAriaLabel: (columnName: string) => 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);
columnMenuManagePivot: string;
columnMenuManageCharts: string;
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;
longTextCellExpandLabel: string;
longTextCellCollapseLabel: 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;
aggregationFunctionLabelNone: string;
aggregationFunctionLabelSum: string;
aggregationFunctionLabelAvg: string;
aggregationFunctionLabelMin: string;
aggregationFunctionLabelMax: string;
aggregationFunctionLabelSize: string;
paginationRowsPerPage: string;
paginationDisplayedRows: (params: {
from: number;
to: number;
count: number;
estimated: number | undefined;
}) => string;
paginationItemAriaLabel: (type: 'first' | 'last' | 'previous' | 'next') => string;
pivotToggleLabel: string;
pivotCloseButton: string;
pivotSearchButton: string;
pivotSearchControlPlaceholder: string;
pivotSearchControlLabel: string;
pivotSearchControlClear: string;
pivotNoFields: string;
pivotRows: string;
pivotColumns: string;
pivotValues: string;
pivotMenuMoveUp: string;
pivotMenuMoveDown: string;
pivotMenuMoveToTop: string;
pivotMenuMoveToBottom: string;
pivotMenuRows: string;
pivotMenuColumns: string;
pivotMenuValues: string;
pivotMenuOptions: string;
pivotMenuAddToRows: string;
pivotMenuAddToColumns: string;
pivotMenuAddToValues: string;
pivotMenuRemove: string;
pivotDragToRows: string;
pivotDragToColumns: string;
pivotDragToValues: string;
pivotYearColumnHeaderName: string;
pivotQuarterColumnHeaderName: string;
chartsNoCharts: string;
chartsChartNotSelected: string;
chartsTabChart: string;
chartsTabFields: string;
chartsTabCustomize: string;
chartsCloseButton: string;
chartsSyncButtonLabel: string;
chartsSearchPlaceholder: string;
chartsSearchLabel: string;
chartsSearchClear: string;
chartsNoFields: string;
chartsFieldBlocked: string;
chartsCategories: string;
chartsSeries: string;
chartsMenuAddToDimensions: (dimensionLabel: string) => string;
chartsMenuAddToValues: (valuesLabel: string) => string;
chartsMenuMoveUp: string;
chartsMenuMoveDown: string;
chartsMenuMoveToTop: string;
chartsMenuMoveToBottom: string;
chartsMenuOptions: string;
chartsMenuRemove: string;
chartsDragToDimensions: (dimensionLabel: string) => string;
chartsDragToValues: (valuesLabel: string) => string;
aiAssistantPanelTitle: string;
aiAssistantPanelClose: string;
aiAssistantPanelConversationHistory: string;
aiAssistantPanelNewConversation: string;
aiAssistantPanelEmptyConversation: string;
aiAssistantSuggestions: string;
promptRerun: string;
promptProcessing: string;
promptAppliedChanges: string;
promptChangeGroupDescription: (column: string) => string;
promptChangeAggregationLabel: (column: string, aggregation: string) => string;
promptChangeAggregationDescription: (column: string, aggregation: string) => string;
promptChangeFilterLabel: (column: string, operator: string, value: string) => string;
promptChangeFilterDescription: (column: string, operator: string, value: string) => string;
promptChangeSortDescription: (column: string, direction: string) => string;
promptChangePivotEnableLabel: string;
promptChangePivotEnableDescription: string;
promptChangePivotColumnsLabel: (count: number) => string;
promptChangePivotColumnsDescription: (column: string, direction: string) => string;
promptChangePivotRowsLabel: (count: number) => string;
promptChangePivotValuesLabel: (count: number) => string;
promptChangePivotValuesDescription: (column: string, aggregation: string) => string;
promptChangeChartsLabel: (dimensionsCount: number, valuesCount: number) => string;
promptFieldLabel: string;
promptFieldPlaceholder: string;
promptFieldPlaceholderWithRecording: string;
promptFieldPlaceholderListening: string;
promptFieldSpeechRecognitionNotSupported: string;
promptFieldSend: string;
promptFieldRecord: string;
promptFieldStopRecording: string;
}
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];
}
+247
View File
@@ -0,0 +1,247 @@
import type * as React from 'react';
import type { GridColDef } from "../colDef/index.js";
/**
* Set the types of the texts in the grid.
*/
export interface GridLocaleText {
noRowsLabel: string;
noResultsOverlayLabel: string;
noColumnsOverlayLabel: string;
noColumnsOverlayManageColumns: string;
emptyPivotOverlayLabel: string;
toolbarDensity: React.ReactNode;
toolbarDensityLabel: string;
toolbarDensityCompact: string;
toolbarDensityStandard: string;
toolbarDensityComfortable: string;
toolbarUndo: React.ReactNode;
toolbarRedo: React.ReactNode;
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;
toolbarPivot: string;
toolbarCharts: string;
toolbarAssistant: React.ReactNode;
columnsManagementSearchTitle: string;
columnsManagementNoColumns: string;
columnsManagementShowHideAllText: string;
columnsManagementReset: string;
columnsManagementDeleteIconLabel: string;
filterPanelAddFilter: React.ReactNode;
filterPanelRemoveAll: React.ReactNode;
filterPanelDeleteIconLabel: string;
filterPanelLogicOperator: string;
filterPanelOperator: React.ReactNode;
filterPanelOperatorAnd: React.ReactNode;
filterPanelOperatorOr: React.ReactNode;
filterPanelColumn: React.ReactNode;
filterPanelInputLabel: string;
filterPanelInputPlaceholder: string;
filterOperatorContains: string;
filterOperatorDoesNotContain: string;
filterOperatorEquals: string;
filterOperatorDoesNotEqual: 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;
headerFilterOperatorDoesNotContain: string;
headerFilterOperatorEquals: string;
headerFilterOperatorDoesNotEqual: 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;
headerFilterClear: string;
filterValueAny: string;
filterValueTrue: string;
filterValueFalse: string;
columnMenuLabel: string;
columnMenuAriaLabel: (columnName: string) => 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);
columnMenuManagePivot: string;
columnMenuManageCharts: string;
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;
longTextCellExpandLabel: string;
longTextCellCollapseLabel: 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;
aggregationFunctionLabelNone: string;
aggregationFunctionLabelSum: string;
aggregationFunctionLabelAvg: string;
aggregationFunctionLabelMin: string;
aggregationFunctionLabelMax: string;
aggregationFunctionLabelSize: string;
paginationRowsPerPage: string;
paginationDisplayedRows: (params: {
from: number;
to: number;
count: number;
estimated: number | undefined;
}) => string;
paginationItemAriaLabel: (type: 'first' | 'last' | 'previous' | 'next') => string;
pivotToggleLabel: string;
pivotCloseButton: string;
pivotSearchButton: string;
pivotSearchControlPlaceholder: string;
pivotSearchControlLabel: string;
pivotSearchControlClear: string;
pivotNoFields: string;
pivotRows: string;
pivotColumns: string;
pivotValues: string;
pivotMenuMoveUp: string;
pivotMenuMoveDown: string;
pivotMenuMoveToTop: string;
pivotMenuMoveToBottom: string;
pivotMenuRows: string;
pivotMenuColumns: string;
pivotMenuValues: string;
pivotMenuOptions: string;
pivotMenuAddToRows: string;
pivotMenuAddToColumns: string;
pivotMenuAddToValues: string;
pivotMenuRemove: string;
pivotDragToRows: string;
pivotDragToColumns: string;
pivotDragToValues: string;
pivotYearColumnHeaderName: string;
pivotQuarterColumnHeaderName: string;
chartsNoCharts: string;
chartsChartNotSelected: string;
chartsTabChart: string;
chartsTabFields: string;
chartsTabCustomize: string;
chartsCloseButton: string;
chartsSyncButtonLabel: string;
chartsSearchPlaceholder: string;
chartsSearchLabel: string;
chartsSearchClear: string;
chartsNoFields: string;
chartsFieldBlocked: string;
chartsCategories: string;
chartsSeries: string;
chartsMenuAddToDimensions: (dimensionLabel: string) => string;
chartsMenuAddToValues: (valuesLabel: string) => string;
chartsMenuMoveUp: string;
chartsMenuMoveDown: string;
chartsMenuMoveToTop: string;
chartsMenuMoveToBottom: string;
chartsMenuOptions: string;
chartsMenuRemove: string;
chartsDragToDimensions: (dimensionLabel: string) => string;
chartsDragToValues: (valuesLabel: string) => string;
aiAssistantPanelTitle: string;
aiAssistantPanelClose: string;
aiAssistantPanelConversationHistory: string;
aiAssistantPanelNewConversation: string;
aiAssistantPanelEmptyConversation: string;
aiAssistantSuggestions: string;
promptRerun: string;
promptProcessing: string;
promptAppliedChanges: string;
promptChangeGroupDescription: (column: string) => string;
promptChangeAggregationLabel: (column: string, aggregation: string) => string;
promptChangeAggregationDescription: (column: string, aggregation: string) => string;
promptChangeFilterLabel: (column: string, operator: string, value: string) => string;
promptChangeFilterDescription: (column: string, operator: string, value: string) => string;
promptChangeSortDescription: (column: string, direction: string) => string;
promptChangePivotEnableLabel: string;
promptChangePivotEnableDescription: string;
promptChangePivotColumnsLabel: (count: number) => string;
promptChangePivotColumnsDescription: (column: string, direction: string) => string;
promptChangePivotRowsLabel: (count: number) => string;
promptChangePivotValuesLabel: (count: number) => string;
promptChangePivotValuesDescription: (column: string, aggregation: string) => string;
promptChangeChartsLabel: (dimensionsCount: number, valuesCount: number) => string;
promptFieldLabel: string;
promptFieldPlaceholder: string;
promptFieldPlaceholderWithRecording: string;
promptFieldPlaceholderListening: string;
promptFieldSpeechRecognitionNotSupported: string;
promptFieldSend: string;
promptFieldRecord: string;
promptFieldStopRecording: string;
}
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];
}
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
@@ -0,0 +1 @@
export {};
+11
View File
@@ -0,0 +1,11 @@
import type { Logger } from "../logger.mjs";
/**
* 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;
}
+11
View File
@@ -0,0 +1,11 @@
import type { Logger } from "../logger.js";
/**
* 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;
}
+5
View File
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
+1
View File
@@ -0,0 +1 @@
export {};
+111
View File
@@ -0,0 +1,111 @@
import type { GridColDef } from "../colDef/index.mjs";
import type { GridStateColDef } from "../colDef/gridColDef.mjs";
import type { GridCellMode } from "../gridCell.mjs";
import type { GridValidRowModel, GridRowId, GridTreeNode, GridRowModel } from "../gridRows.mjs";
import type { GridCellParams } from "../params/gridCellParams.mjs";
import type { GridColumnHeaderParams } from "../params/gridColumnHeaderParams.mjs";
import type { GridRowParams } from "../params/gridRowParams.mjs";
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 = 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 = 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 = any>(row: GridRowModel, colDef: GridColDef) => V;
/**
* 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.
*/
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;
}
export interface GridParamsPrivateApi {
/**
* @typedef {Object} CellParamsOverrides
* @property {GridCellMode} cellMode - The mode of the cell.
* @property {GridStateColDef} colDef - The column definition.
* @property {boolean} hasFocus - Indicates if the cell is in focus.
* @property {GridTreeNode} rowNode - The node of the row that the current cell belongs to.
* @property {0|-1} tabIndex - The tabIndex value.
*/
/**
* Used internally to render the cell based on existing row data provided by the GridRow.
* @param {GridRowId} id The id of the row.
* @param {string} field The column field.
* @param {GridValidRowModel} row The row model.
* @param {CellParamsOverrides} cellParams The cell params.
* @returns {GridCellParams} The cell params.
*/
getCellParamsForRow: <R extends GridValidRowModel = any, V = unknown, F = V, N extends GridTreeNode = GridTreeNode>(id: GridRowId, field: string, row: R, {
cellMode,
colDef,
hasFocus,
rowNode,
tabIndex,
value,
formattedValue
}: {
cellMode: GridCellMode;
colDef: GridStateColDef;
hasFocus: boolean;
rowNode: N;
tabIndex: 0 | -1;
value?: V;
formattedValue?: F;
}) => GridCellParams<R, V, F, N>;
}
+111
View File
@@ -0,0 +1,111 @@
import type { GridColDef } from "../colDef/index.js";
import type { GridStateColDef } from "../colDef/gridColDef.js";
import type { GridCellMode } from "../gridCell.js";
import type { GridValidRowModel, GridRowId, GridTreeNode, GridRowModel } from "../gridRows.js";
import type { GridCellParams } from "../params/gridCellParams.js";
import type { GridColumnHeaderParams } from "../params/gridColumnHeaderParams.js";
import type { GridRowParams } from "../params/gridRowParams.js";
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 = 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 = 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 = any>(row: GridRowModel, colDef: GridColDef) => V;
/**
* 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.
*/
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;
}
export interface GridParamsPrivateApi {
/**
* @typedef {Object} CellParamsOverrides
* @property {GridCellMode} cellMode - The mode of the cell.
* @property {GridStateColDef} colDef - The column definition.
* @property {boolean} hasFocus - Indicates if the cell is in focus.
* @property {GridTreeNode} rowNode - The node of the row that the current cell belongs to.
* @property {0|-1} tabIndex - The tabIndex value.
*/
/**
* Used internally to render the cell based on existing row data provided by the GridRow.
* @param {GridRowId} id The id of the row.
* @param {string} field The column field.
* @param {GridValidRowModel} row The row model.
* @param {CellParamsOverrides} cellParams The cell params.
* @returns {GridCellParams} The cell params.
*/
getCellParamsForRow: <R extends GridValidRowModel = any, V = unknown, F = V, N extends GridTreeNode = GridTreeNode>(id: GridRowId, field: string, row: R, {
cellMode,
colDef,
hasFocus,
rowNode,
tabIndex,
value,
formattedValue
}: {
cellMode: GridCellMode;
colDef: GridStateColDef;
hasFocus: boolean;
rowNode: N;
tabIndex: 0 | -1;
value?: V;
formattedValue?: F;
}) => GridCellParams<R, V, F, N>;
}
+5
View File
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
+1
View File
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,17 @@
import type { GridPreferencePanelsValue } from "../../hooks/features/preferencesPanel/gridPreferencePanelsValue.mjs";
/**
* 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.
* @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;
}
@@ -0,0 +1,17 @@
import type { GridPreferencePanelsValue } from "../../hooks/features/preferencesPanel/gridPreferencePanelsValue.js";
/**
* 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.
* @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;
}
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,11 @@
import type { GridPrintExportOptions } from "../gridExport.mjs";
/**
* 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;
}
@@ -0,0 +1,11 @@
import type { GridPrintExportOptions } from "../gridExport.js";
/**
* 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;
}
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
@@ -0,0 +1 @@
export {};
+147
View File
@@ -0,0 +1,147 @@
import type { GridRowModel, GridRowId, GridRowModelUpdate, GridValidRowModel, GridTreeNode } from "../gridRows.mjs";
export type RowReorderDropPosition = 'above' | 'below' | 'inside';
export type RowReorderDragDirection = 'up' | 'down';
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;
/**
* If `true`, the method will only return the direct leaf children of the group
* @default false
*/
directChildrenOnly?: 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 the internal loading state.
* @param {boolean} loading If `true` the loading indicator will be shown over the Data Grid.
*/
setLoading: (loading: boolean) => void;
/**
* 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.
* @deprecated Use `gridRowIdSelector` instead.
*/
getRowId: <R extends GridValidRowModel = any>(row: R) => GridRowId;
/**
* Gets the row node from the internal tree structure.
* @param {GridRowId} id The id of the row.
* @returns {GridTreeNode} The tree node.
* @deprecated Use `gridRowNodeSelector` instead.
*/
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`.
* Doesn't support tree data ordering. Use `setRowPosition()` instead.
* @param {GridRowId} rowId The row id
* @param {number} targetIndex The new position (0-based).
* @returns {void | Promise<void>} Returns a Promise when async operations are involved (e.g., processRowUpdate)
* @deprecated Use `setRowPosition()` instead. This method will be removed in the next major version.
*/
setRowIndex: (rowId: GridRowId, targetIndex: number) => void | Promise<void>;
/**
* Moves a row to a new position relative to another row.
* @param {GridRowId} sourceRowId The ID of the row to move
* @param {GridRowId} targetRowId The ID of the row to position relative to
* @param {DropPosition} position Where to place the source row: 'above', 'below', or 'over' (for tree data)
* @returns {void | Promise<void>} Returns a Promise when async operations are involved (e.g., processRowUpdate)
*/
setRowPosition: (sourceRowId: GridRowId, targetRowId: GridRowId, position: RowReorderDropPosition) => void | Promise<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.
* Only works for the client side data or to collapse already fetched server side rows.
* For server-side data, use `dataSource.fetchRows(childId)` to fetch and expand the 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;
/**
* Expand all rows. Works for the client side data only.
*/
expandAllRows: () => void;
/**
* Collapse all rows. Works for the client side data only.
*/
collapseAllRows: () => void;
}
export interface GridRowProPrivateApi {
/**
* Allows to update, insert and delete rows at a specific nested level.
* @param {GridRowModelUpdate[]} updates An array of rows with an `action` specifying what to do.
* @param {string[]} nestedLevel The nested level of the rows to update, it represents the path to the row in the tree based on `node.groupingKey`.
*/
updateNestedRows: (updates: GridRowModelUpdate[], nestedLevel?: string[]) => void;
}
+147
View File
@@ -0,0 +1,147 @@
import type { GridRowModel, GridRowId, GridRowModelUpdate, GridValidRowModel, GridTreeNode } from "../gridRows.js";
export type RowReorderDropPosition = 'above' | 'below' | 'inside';
export type RowReorderDragDirection = 'up' | 'down';
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;
/**
* If `true`, the method will only return the direct leaf children of the group
* @default false
*/
directChildrenOnly?: 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 the internal loading state.
* @param {boolean} loading If `true` the loading indicator will be shown over the Data Grid.
*/
setLoading: (loading: boolean) => void;
/**
* 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.
* @deprecated Use `gridRowIdSelector` instead.
*/
getRowId: <R extends GridValidRowModel = any>(row: R) => GridRowId;
/**
* Gets the row node from the internal tree structure.
* @param {GridRowId} id The id of the row.
* @returns {GridTreeNode} The tree node.
* @deprecated Use `gridRowNodeSelector` instead.
*/
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`.
* Doesn't support tree data ordering. Use `setRowPosition()` instead.
* @param {GridRowId} rowId The row id
* @param {number} targetIndex The new position (0-based).
* @returns {void | Promise<void>} Returns a Promise when async operations are involved (e.g., processRowUpdate)
* @deprecated Use `setRowPosition()` instead. This method will be removed in the next major version.
*/
setRowIndex: (rowId: GridRowId, targetIndex: number) => void | Promise<void>;
/**
* Moves a row to a new position relative to another row.
* @param {GridRowId} sourceRowId The ID of the row to move
* @param {GridRowId} targetRowId The ID of the row to position relative to
* @param {DropPosition} position Where to place the source row: 'above', 'below', or 'over' (for tree data)
* @returns {void | Promise<void>} Returns a Promise when async operations are involved (e.g., processRowUpdate)
*/
setRowPosition: (sourceRowId: GridRowId, targetRowId: GridRowId, position: RowReorderDropPosition) => void | Promise<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.
* Only works for the client side data or to collapse already fetched server side rows.
* For server-side data, use `dataSource.fetchRows(childId)` to fetch and expand the 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;
/**
* Expand all rows. Works for the client side data only.
*/
expandAllRows: () => void;
/**
* Collapse all rows. Works for the client side data only.
*/
collapseAllRows: () => void;
}
export interface GridRowProPrivateApi {
/**
* Allows to update, insert and delete rows at a specific nested level.
* @param {GridRowModelUpdate[]} updates An array of rows with an `action` specifying what to do.
* @param {string[]} nestedLevel The nested level of the rows to update, it represents the path to the row in the tree based on `node.groupingKey`.
*/
updateNestedRows: (updates: GridRowModelUpdate[], nestedLevel?: string[]) => void;
}
+5
View File
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
+1
View File
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,92 @@
import type { GridRowId, GridRowModel } from "../gridRows.mjs";
import type { GridRowSelectionModel } from "../gridRowSelectionModel.mjs";
import type { GridControlledStateReasonLookup } from "../events/index.mjs";
/**
* 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.
* @deprecated Use `gridRowSelectionIdsSelector`, `gridRowSelectionCountSelector`, or `gridRowSelectionManagerSelector` instead.
*/
getSelectedRows: () => Map<GridRowId, GridRowModel>;
/**
* Sets the new row selection model.
*
* ⚠️ Caution: `setRowSelectionModel` doesn't apply the selection propagation automatically.
* Pass model returned by API method `getPropagatedRowSelectionModel` instead to apply the selection propagation.
* @param {gridRowSelectionModel} rowSelectionModel The new row selection model.
* @param {string} reason The reason for the state change.
*/
setRowSelectionModel: (rowSelectionModel: GridRowSelectionModel, reason?: GridControlledStateReasonLookup['rowSelection']) => 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;
/**
* Returns the modified selection model after applying row selection propagation.
*
* Use this to achieve proper `rowSelectionPropagation` behavior when setting the selection model using `setRowSelectionModel`.
* @param {GridRowSelectionModel} inputSelectionModel The selection model to propagate.
* @returns {GridRowSelectionModel} The modified selection model.
*/
getPropagatedRowSelectionModel: (inputSelectionModel: GridRowSelectionModel) => GridRowSelectionModel;
}
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;
}
@@ -0,0 +1,92 @@
import type { GridRowId, GridRowModel } from "../gridRows.js";
import type { GridRowSelectionModel } from "../gridRowSelectionModel.js";
import type { GridControlledStateReasonLookup } from "../events/index.js";
/**
* 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.
* @deprecated Use `gridRowSelectionIdsSelector`, `gridRowSelectionCountSelector`, or `gridRowSelectionManagerSelector` instead.
*/
getSelectedRows: () => Map<GridRowId, GridRowModel>;
/**
* Sets the new row selection model.
*
* ⚠️ Caution: `setRowSelectionModel` doesn't apply the selection propagation automatically.
* Pass model returned by API method `getPropagatedRowSelectionModel` instead to apply the selection propagation.
* @param {gridRowSelectionModel} rowSelectionModel The new row selection model.
* @param {string} reason The reason for the state change.
*/
setRowSelectionModel: (rowSelectionModel: GridRowSelectionModel, reason?: GridControlledStateReasonLookup['rowSelection']) => 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;
/**
* Returns the modified selection model after applying row selection propagation.
*
* Use this to achieve proper `rowSelectionPropagation` behavior when setting the selection model using `setRowSelectionModel`.
* @param {GridRowSelectionModel} inputSelectionModel The selection model to propagate.
* @returns {GridRowSelectionModel} The modified selection model.
*/
getPropagatedRowSelectionModel: (inputSelectionModel: GridRowSelectionModel) => GridRowSelectionModel;
}
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;
}
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
@@ -0,0 +1 @@
export {};
+60
View File
@@ -0,0 +1,60 @@
import type { GridRowId } from "../gridRows.mjs";
import type { HeightEntry } from "../../hooks/features/rows/gridRowsMetaInterfaces.mjs";
/**
* 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;
/**
* 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) => 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 {
hydrateRowsMeta: () => void;
/**
* Observe row for 'auto' height changes.
* @param {Element} element The row element to observe.
* @param {GridRowId} rowId The id of the row.
* @returns {ReturnType<React.EffectCallback>} A dispose callback
*/
observeRowHeight: (element: Element, rowId: GridRowId) => ReturnType<React.EffectCallback>;
/**
* 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, for example first row has index=0 in all pages.
* @returns {number} The index of the last measured row.
*/
getLastMeasuredRowIndex: () => number;
/**
* Get the height entry from the cache or create one.
* @param {GridRowId} id The id of the row.
* @returns {HeightEntry} The height cache entry
*/
getRowHeightEntry: (id: GridRowId) => HeightEntry;
}
+60
View File
@@ -0,0 +1,60 @@
import type { GridRowId } from "../gridRows.js";
import type { HeightEntry } from "../../hooks/features/rows/gridRowsMetaInterfaces.js";
/**
* 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;
/**
* 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) => 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 {
hydrateRowsMeta: () => void;
/**
* Observe row for 'auto' height changes.
* @param {Element} element The row element to observe.
* @param {GridRowId} rowId The id of the row.
* @returns {ReturnType<React.EffectCallback>} A dispose callback
*/
observeRowHeight: (element: Element, rowId: GridRowId) => ReturnType<React.EffectCallback>;
/**
* 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, for example first row has index=0 in all pages.
* @returns {number} The index of the last measured row.
*/
getLastMeasuredRowIndex: () => number;
/**
* Get the height entry from the cache or create one.
* @param {GridRowId} id The id of the row.
* @returns {HeightEntry} The height cache entry
*/
getRowHeightEntry: (id: GridRowId) => HeightEntry;
}
+5
View File
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
+1
View File
@@ -0,0 +1 @@
export {};
+24
View File
@@ -0,0 +1,24 @@
import type { GridCellIndexCoordinates } from "../gridCell.mjs";
import type { GridScrollParams } from "../params/gridScrollParams.mjs";
/**
* 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;
}
+24
View File
@@ -0,0 +1,24 @@
import type { GridCellIndexCoordinates } from "../gridCell.js";
import type { GridScrollParams } from "../params/gridScrollParams.js";
/**
* 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;
}
+5
View File
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
+1
View File
@@ -0,0 +1 @@
export {};
+46
View File
@@ -0,0 +1,46 @@
import type { GridColDef } from "../colDef/gridColDef.mjs";
import type { GridRowId, GridRowModel } from "../gridRows.mjs";
import type { GridSortDirection, GridSortModel } from "../gridSortModel.mjs";
/**
* 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['field']} field The field identifier 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 [GridSortModel]. Default is `false`.
*/
sortColumn: (field: GridColDef['field'], 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;
}
+46
View File
@@ -0,0 +1,46 @@
import type { GridColDef } from "../colDef/gridColDef.js";
import type { GridRowId, GridRowModel } from "../gridRows.js";
import type { GridSortDirection, GridSortModel } from "../gridSortModel.js";
/**
* 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['field']} field The field identifier 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 [GridSortModel]. Default is `false`.
*/
sortColumn: (field: GridColDef['field'], 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;
}
+5
View File
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
+1
View File
@@ -0,0 +1 @@
export {};

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