@mui/x-data-grid 8.18.0 → 8.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +175 -0
- package/DataGrid/useDataGridComponent.js +4 -3
- package/components/GridRow.js +5 -2
- package/components/GridRowDragAndDropOverlay.d.ts +7 -0
- package/components/GridRowDragAndDropOverlay.js +73 -0
- package/components/cell/GridActionsCell.d.ts +9 -0
- package/components/cell/GridActionsCell.js +54 -34
- package/components/cell/GridBooleanCell.js +0 -10
- package/components/cell/GridCell.js +4 -10
- package/components/columnHeaders/GridColumnHeaderItem.js +2 -2
- package/components/columnSelection/GridCellCheckboxRenderer.js +37 -22
- package/components/containers/GridRootStyles.js +17 -40
- package/components/toolbarV8/Toolbar.js +1 -1
- package/components/virtualization/GridVirtualScrollbar.d.ts +1 -0
- package/components/virtualization/GridVirtualScrollbar.js +13 -8
- package/components/virtualization/GridVirtualScroller.js +2 -1
- package/components/virtualization/GridVirtualScrollerRenderZone.js +1 -1
- package/constants/dataGridPropsDefaultValues.js +2 -1
- package/constants/gridClasses.d.ts +0 -8
- package/constants/gridClasses.js +1 -1
- package/esm/DataGrid/useDataGridComponent.js +5 -4
- package/esm/components/GridRow.js +5 -2
- package/esm/components/GridRowDragAndDropOverlay.d.ts +7 -0
- package/esm/components/GridRowDragAndDropOverlay.js +66 -0
- package/esm/components/cell/GridActionsCell.d.ts +9 -0
- package/esm/components/cell/GridActionsCell.js +55 -34
- package/esm/components/cell/GridBooleanCell.js +0 -10
- package/esm/components/cell/GridCell.js +4 -10
- package/esm/components/columnHeaders/GridColumnHeaderItem.js +2 -2
- package/esm/components/columnSelection/GridCellCheckboxRenderer.js +37 -22
- package/esm/components/containers/GridRootStyles.js +17 -40
- package/esm/components/toolbarV8/Toolbar.js +1 -1
- package/esm/components/virtualization/GridVirtualScrollbar.d.ts +1 -0
- package/esm/components/virtualization/GridVirtualScrollbar.js +12 -7
- package/esm/components/virtualization/GridVirtualScroller.js +2 -1
- package/esm/components/virtualization/GridVirtualScrollerRenderZone.js +1 -1
- package/esm/constants/dataGridPropsDefaultValues.js +2 -1
- package/esm/constants/gridClasses.d.ts +0 -8
- package/esm/constants/gridClasses.js +1 -1
- package/esm/hooks/core/gridPropsSelectors.d.ts +2 -1
- package/esm/hooks/core/gridPropsSelectors.js +3 -0
- package/esm/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +4 -3
- package/esm/hooks/core/useGridProps.js +8 -2
- package/esm/hooks/core/useGridVirtualizer.d.ts +80 -6
- package/esm/hooks/core/useGridVirtualizer.js +27 -12
- package/esm/hooks/features/columnGrouping/useGridColumnGrouping.js +6 -1
- package/esm/hooks/features/columnMenu/useGridColumnMenu.js +14 -4
- package/esm/hooks/features/columns/useGridColumnSpanning.js +9 -4
- package/esm/hooks/features/dataSource/useGridDataSourceBase.js +2 -2
- package/esm/hooks/features/dimensions/useGridDimensions.js +12 -6
- package/esm/hooks/features/editing/useGridCellEditing.js +1 -1
- package/esm/hooks/features/editing/useGridRowEditing.js +1 -1
- package/esm/hooks/features/export/serializers/csvSerializer.js +2 -4
- package/esm/hooks/features/export/useGridPrintExport.js +18 -18
- package/esm/hooks/features/filter/gridFilterUtils.js +5 -11
- package/esm/hooks/features/filter/index.d.ts +1 -1
- package/esm/hooks/features/filter/index.js +1 -1
- package/esm/hooks/features/filter/useGridFilter.d.ts +1 -1
- package/esm/hooks/features/filter/useGridFilter.js +3 -1
- package/esm/hooks/features/focus/useGridFocus.js +0 -1
- package/esm/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
- package/esm/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +189 -25
- package/esm/hooks/features/pagination/useGridPaginationMeta.js +3 -3
- package/esm/hooks/features/pagination/useGridPaginationModel.js +7 -4
- package/esm/hooks/features/pagination/useGridRowCount.js +31 -15
- package/esm/hooks/features/rowReorder/gridRowReorderInterfaces.d.ts +19 -0
- package/esm/hooks/features/rowReorder/gridRowReorderSelector.d.ts +20 -1
- package/esm/hooks/features/rowReorder/gridRowReorderSelector.js +19 -1
- package/esm/hooks/features/rowSelection/useGridRowSelection.js +17 -8
- package/esm/hooks/features/rowSelection/utils.d.ts +1 -0
- package/esm/hooks/features/rowSelection/utils.js +17 -4
- package/esm/hooks/features/rows/useGridRowSpanning.js +23 -60
- package/esm/hooks/features/rows/useGridRows.js +3 -1
- package/esm/hooks/features/rows/useGridRowsOverridableMethods.d.ts +1 -0
- package/esm/hooks/features/rows/useGridRowsOverridableMethods.js +57 -7
- package/esm/hooks/features/scroll/useGridScroll.js +2 -3
- package/esm/hooks/features/sorting/gridSortingUtils.js +1 -3
- package/esm/hooks/features/sorting/useGridSorting.d.ts +1 -1
- package/esm/hooks/features/sorting/useGridSorting.js +3 -1
- package/esm/hooks/features/virtualization/useGridVirtualization.js +24 -5
- package/esm/hooks/utils/useGridEvent.js +6 -2
- package/esm/hooks/utils/useGridSelector.js +2 -4
- package/esm/hooks/utils/useRunOncePerLoop.d.ts +4 -1
- package/esm/hooks/utils/useRunOncePerLoop.js +28 -18
- package/esm/index.js +1 -1
- package/esm/internals/index.d.ts +5 -4
- package/esm/internals/index.js +3 -3
- package/esm/material/index.js +1 -4
- package/esm/models/api/gridRowApi.d.ts +14 -1
- package/esm/models/api/index.d.ts +1 -1
- package/esm/models/api/index.js +0 -1
- package/esm/models/colDef/gridColDef.d.ts +14 -0
- package/esm/models/configuration/gridConfiguration.d.ts +2 -2
- package/esm/models/configuration/gridRowConfiguration.d.ts +6 -5
- package/esm/models/events/gridEventLookup.d.ts +5 -0
- package/esm/models/gridStateCommunity.d.ts +1 -1
- package/esm/models/params/gridCellParams.d.ts +0 -10
- package/esm/models/props/DataGridProps.d.ts +13 -6
- package/esm/utils/keyboardUtils.d.ts +1 -8
- package/esm/utils/keyboardUtils.js +0 -7
- package/hooks/core/gridPropsSelectors.d.ts +2 -1
- package/hooks/core/gridPropsSelectors.js +4 -1
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +4 -3
- package/hooks/core/useGridProps.js +8 -2
- package/hooks/core/useGridVirtualizer.d.ts +80 -6
- package/hooks/core/useGridVirtualizer.js +26 -11
- package/hooks/features/columnGrouping/useGridColumnGrouping.js +6 -1
- package/hooks/features/columnMenu/useGridColumnMenu.js +14 -4
- package/hooks/features/columns/useGridColumnSpanning.js +9 -4
- package/hooks/features/dataSource/useGridDataSourceBase.js +2 -2
- package/hooks/features/dimensions/useGridDimensions.js +12 -6
- package/hooks/features/editing/useGridCellEditing.js +1 -1
- package/hooks/features/editing/useGridRowEditing.js +1 -1
- package/hooks/features/export/serializers/csvSerializer.js +2 -4
- package/hooks/features/export/useGridPrintExport.js +18 -18
- package/hooks/features/filter/gridFilterUtils.js +5 -11
- package/hooks/features/filter/index.d.ts +1 -1
- package/hooks/features/filter/index.js +6 -0
- package/hooks/features/filter/useGridFilter.d.ts +1 -1
- package/hooks/features/filter/useGridFilter.js +3 -1
- package/hooks/features/focus/useGridFocus.js +0 -1
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +189 -25
- package/hooks/features/pagination/useGridPaginationMeta.js +2 -2
- package/hooks/features/pagination/useGridPaginationModel.js +7 -4
- package/hooks/features/pagination/useGridRowCount.js +30 -14
- package/hooks/features/rowReorder/gridRowReorderInterfaces.d.ts +19 -0
- package/hooks/features/rowReorder/gridRowReorderSelector.d.ts +20 -1
- package/hooks/features/rowReorder/gridRowReorderSelector.js +20 -2
- package/hooks/features/rowSelection/useGridRowSelection.js +17 -8
- package/hooks/features/rowSelection/utils.d.ts +1 -0
- package/hooks/features/rowSelection/utils.js +16 -3
- package/hooks/features/rows/useGridRowSpanning.js +23 -60
- package/hooks/features/rows/useGridRows.js +3 -1
- package/hooks/features/rows/useGridRowsOverridableMethods.d.ts +1 -0
- package/hooks/features/rows/useGridRowsOverridableMethods.js +57 -7
- package/hooks/features/scroll/useGridScroll.js +2 -3
- package/hooks/features/sorting/gridSortingUtils.js +1 -3
- package/hooks/features/sorting/useGridSorting.d.ts +1 -1
- package/hooks/features/sorting/useGridSorting.js +3 -1
- package/hooks/features/virtualization/useGridVirtualization.js +24 -5
- package/hooks/utils/useGridEvent.js +6 -2
- package/hooks/utils/useGridSelector.js +2 -4
- package/hooks/utils/useRunOncePerLoop.d.ts +4 -1
- package/hooks/utils/useRunOncePerLoop.js +27 -18
- package/index.js +1 -1
- package/internals/index.d.ts +5 -4
- package/internals/index.js +16 -9
- package/material/index.js +1 -4
- package/models/api/gridRowApi.d.ts +14 -1
- package/models/api/index.d.ts +1 -1
- package/models/api/index.js +0 -11
- package/models/colDef/gridColDef.d.ts +14 -0
- package/models/configuration/gridConfiguration.d.ts +2 -2
- package/models/configuration/gridRowConfiguration.d.ts +6 -5
- package/models/events/gridEventLookup.d.ts +5 -0
- package/models/gridStateCommunity.d.ts +1 -1
- package/models/params/gridCellParams.d.ts +0 -10
- package/models/props/DataGridProps.d.ts +13 -6
- package/package.json +3 -3
- package/utils/keyboardUtils.d.ts +1 -8
- package/utils/keyboardUtils.js +1 -13
package/internals/index.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export { useGridPrintExport } from "../hooks/features/export/useGridPrintExport.
|
|
|
41
41
|
export { useGridFilter, filterStateInitializer } from "../hooks/features/filter/useGridFilter.js";
|
|
42
42
|
export { defaultGridFilterLookup } from "../hooks/features/filter/gridFilterState.js";
|
|
43
43
|
export { passFilterLogic } from "../hooks/features/filter/gridFilterUtils.js";
|
|
44
|
-
export { gridFilteredChildrenCountLookupSelector, gridExpandedSortedRowTreeLevelPositionLookupSelector,
|
|
44
|
+
export { gridFilteredChildrenCountLookupSelector, gridExpandedSortedRowTreeLevelPositionLookupSelector, gridFilteredSortedDepthRowEntriesSelector } from "../hooks/features/filter/gridFilterSelector.js";
|
|
45
45
|
export { isSingleSelectColDef } from "../components/panel/filterPanel/filterPanelUtils.js";
|
|
46
46
|
export type { GridAggregatedFilterItemApplier, GridAggregatedFilterItemApplierResult } from "../hooks/features/filter/gridFilterState.js";
|
|
47
47
|
export { useGridFocus, focusStateInitializer } from "../hooks/features/focus/useGridFocus.js";
|
|
@@ -54,7 +54,7 @@ export { useGridRows, rowsStateInitializer } from "../hooks/features/rows/useGri
|
|
|
54
54
|
export { useGridRowSpanning, rowSpanningStateInitializer } from "../hooks/features/rows/useGridRowSpanning.js";
|
|
55
55
|
export { useGridAriaAttributes } from "../hooks/utils/useGridAriaAttributes.js";
|
|
56
56
|
export { useGridRowAriaAttributes } from "../hooks/features/rows/useGridRowAriaAttributes.js";
|
|
57
|
-
export { useGridRowsOverridableMethods } from "../hooks/features/rows/useGridRowsOverridableMethods.js";
|
|
57
|
+
export { useGridRowsOverridableMethods as useGridRowsOverridableMethodsCommunity } from "../hooks/features/rows/useGridRowsOverridableMethods.js";
|
|
58
58
|
export { useGridParamsOverridableMethods } from "../hooks/features/rows/useGridParamsOverridableMethods.js";
|
|
59
59
|
export { useIsCellEditable } from "../hooks/features/editing/useGridCellEditable.js";
|
|
60
60
|
export { useGridRowsPreProcessors } from "../hooks/features/rows/useGridRowsPreProcessors.js";
|
|
@@ -66,7 +66,7 @@ export { getRowIdFromRowModel, GRID_ID_AUTOGENERATED, getRowValue } from "../hoo
|
|
|
66
66
|
export { gridAdditionalRowGroupsSelector, gridPinnedRowsSelector, gridRowSelector } from "../hooks/features/rows/gridRowsSelector.js";
|
|
67
67
|
export { headerFilteringStateInitializer, useGridHeaderFiltering } from "../hooks/features/headerFiltering/useGridHeaderFiltering.js";
|
|
68
68
|
export { useGridRowSelection, rowSelectionStateInitializer } from "../hooks/features/rowSelection/useGridRowSelection.js";
|
|
69
|
-
export { gridIsRowDragActiveSelector } from "../hooks/features/rowReorder/gridRowReorderSelector.js";
|
|
69
|
+
export { gridIsRowDragActiveSelector, gridRowDropPositionSelector, gridRowDropTargetRowIdSelector } from "../hooks/features/rowReorder/gridRowReorderSelector.js";
|
|
70
70
|
export type { GridRowReorderState } from "../hooks/features/rowReorder/gridRowReorderInterfaces.js";
|
|
71
71
|
export { useGridRowSelectionPreProcessors } from "../hooks/features/rowSelection/useGridRowSelectionPreProcessors.js";
|
|
72
72
|
export { useGridSorting, sortingStateInitializer } from "../hooks/features/sorting/useGridSorting.js";
|
|
@@ -121,4 +121,5 @@ export type { GridConfiguration } from "../models/configuration/gridConfiguratio
|
|
|
121
121
|
export type { CellEditableConditionFn } from "../models/configuration/gridCellEditableConfiguration.js";
|
|
122
122
|
export * from "../hooks/features/pivoting/index.js";
|
|
123
123
|
export { createSvgIcon } from "../material/icons/createSvgIcon.js";
|
|
124
|
-
export { useGridPanelContext } from "../components/panel/GridPanelContext.js";
|
|
124
|
+
export { useGridPanelContext } from "../components/panel/GridPanelContext.js";
|
|
125
|
+
export type { RowReorderDropPosition, RowReorderDragDirection } from "../models/api/gridRowApi.js";
|
package/internals/index.js
CHANGED
|
@@ -46,7 +46,6 @@ var _exportNames = {
|
|
|
46
46
|
passFilterLogic: true,
|
|
47
47
|
gridFilteredChildrenCountLookupSelector: true,
|
|
48
48
|
gridExpandedSortedRowTreeLevelPositionLookupSelector: true,
|
|
49
|
-
gridExpandedSortedRowIndexLookupSelector: true,
|
|
50
49
|
gridFilteredSortedDepthRowEntriesSelector: true,
|
|
51
50
|
useGridFocus: true,
|
|
52
51
|
focusStateInitializer: true,
|
|
@@ -64,7 +63,7 @@ var _exportNames = {
|
|
|
64
63
|
rowSpanningStateInitializer: true,
|
|
65
64
|
useGridAriaAttributes: true,
|
|
66
65
|
useGridRowAriaAttributes: true,
|
|
67
|
-
|
|
66
|
+
useGridRowsOverridableMethodsCommunity: true,
|
|
68
67
|
useGridParamsOverridableMethods: true,
|
|
69
68
|
useIsCellEditable: true,
|
|
70
69
|
useGridRowsPreProcessors: true,
|
|
@@ -85,6 +84,8 @@ var _exportNames = {
|
|
|
85
84
|
useGridRowSelection: true,
|
|
86
85
|
rowSelectionStateInitializer: true,
|
|
87
86
|
gridIsRowDragActiveSelector: true,
|
|
87
|
+
gridRowDropPositionSelector: true,
|
|
88
|
+
gridRowDropTargetRowIdSelector: true,
|
|
88
89
|
useGridRowSelectionPreProcessors: true,
|
|
89
90
|
useGridSorting: true,
|
|
90
91
|
sortingStateInitializer: true,
|
|
@@ -396,12 +397,6 @@ Object.defineProperty(exports, "gridEditRowsStateSelector", {
|
|
|
396
397
|
return _gridEditingSelectors.gridEditRowsStateSelector;
|
|
397
398
|
}
|
|
398
399
|
});
|
|
399
|
-
Object.defineProperty(exports, "gridExpandedSortedRowIndexLookupSelector", {
|
|
400
|
-
enumerable: true,
|
|
401
|
-
get: function () {
|
|
402
|
-
return _gridFilterSelector.gridExpandedSortedRowIndexLookupSelector;
|
|
403
|
-
}
|
|
404
|
-
});
|
|
405
400
|
Object.defineProperty(exports, "gridExpandedSortedRowTreeLevelPositionLookupSelector", {
|
|
406
401
|
enumerable: true,
|
|
407
402
|
get: function () {
|
|
@@ -450,6 +445,18 @@ Object.defineProperty(exports, "gridPinnedRowsSelector", {
|
|
|
450
445
|
return _gridRowsSelector.gridPinnedRowsSelector;
|
|
451
446
|
}
|
|
452
447
|
});
|
|
448
|
+
Object.defineProperty(exports, "gridRowDropPositionSelector", {
|
|
449
|
+
enumerable: true,
|
|
450
|
+
get: function () {
|
|
451
|
+
return _gridRowReorderSelector.gridRowDropPositionSelector;
|
|
452
|
+
}
|
|
453
|
+
});
|
|
454
|
+
Object.defineProperty(exports, "gridRowDropTargetRowIdSelector", {
|
|
455
|
+
enumerable: true,
|
|
456
|
+
get: function () {
|
|
457
|
+
return _gridRowReorderSelector.gridRowDropTargetRowIdSelector;
|
|
458
|
+
}
|
|
459
|
+
});
|
|
453
460
|
Object.defineProperty(exports, "gridRowGroupsToFetchSelector", {
|
|
454
461
|
enumerable: true,
|
|
455
462
|
get: function () {
|
|
@@ -792,7 +799,7 @@ Object.defineProperty(exports, "useGridRowsMeta", {
|
|
|
792
799
|
return _useGridRowsMeta.useGridRowsMeta;
|
|
793
800
|
}
|
|
794
801
|
});
|
|
795
|
-
Object.defineProperty(exports, "
|
|
802
|
+
Object.defineProperty(exports, "useGridRowsOverridableMethodsCommunity", {
|
|
796
803
|
enumerable: true,
|
|
797
804
|
get: function () {
|
|
798
805
|
return _useGridRowsOverridableMethods.useGridRowsOverridableMethods;
|
package/material/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { GridRowModel, GridRowId, GridRowModelUpdate, GridValidRowModel, GridTreeNode } from "../gridRows.js";
|
|
2
|
+
export type RowReorderDropPosition = 'above' | 'below' | 'inside';
|
|
3
|
+
export type RowReorderDragDirection = 'up' | 'down';
|
|
2
4
|
export interface GridRowGroupChildrenGetterParams {
|
|
3
5
|
/**
|
|
4
6
|
* The row id of the group
|
|
@@ -96,10 +98,21 @@ export interface GridRowApi {
|
|
|
96
98
|
export interface GridRowProApi {
|
|
97
99
|
/**
|
|
98
100
|
* Moves a row from its original position to the position given by `targetIndex`.
|
|
101
|
+
* Doesn't support tree data ordering. Use `setRowPosition()` instead.
|
|
99
102
|
* @param {GridRowId} rowId The row id
|
|
100
103
|
* @param {number} targetIndex The new position (0-based).
|
|
104
|
+
* @returns {void | Promise<void>} Returns a Promise when async operations are involved (e.g., processRowUpdate)
|
|
105
|
+
* @deprecated Use `setRowPosition()` instead. This method will be removed in the next major version.
|
|
101
106
|
*/
|
|
102
|
-
setRowIndex: (rowId: GridRowId, targetIndex: number) => void
|
|
107
|
+
setRowIndex: (rowId: GridRowId, targetIndex: number) => void | Promise<void>;
|
|
108
|
+
/**
|
|
109
|
+
* Moves a row to a new position relative to another row.
|
|
110
|
+
* @param {GridRowId} sourceRowId The ID of the row to move
|
|
111
|
+
* @param {GridRowId} targetRowId The ID of the row to position relative to
|
|
112
|
+
* @param {DropPosition} position Where to place the source row: 'above', 'below', or 'over' (for tree data)
|
|
113
|
+
* @returns {void | Promise<void>} Returns a Promise when async operations are involved (e.g., processRowUpdate)
|
|
114
|
+
*/
|
|
115
|
+
setRowPosition: (sourceRowId: GridRowId, targetRowId: GridRowId, position: RowReorderDropPosition) => void | Promise<void>;
|
|
103
116
|
/**
|
|
104
117
|
* Gets the rows of a grouping criteria.
|
|
105
118
|
* Only contains the rows provided to the grid, not the rows automatically generated by it.
|
package/models/api/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type { GridParamsApi } from "./gridParamsApi.js";
|
|
|
3
3
|
export type { GridCoreApi } from "./gridCoreApi.js";
|
|
4
4
|
export * from "./gridColumnApi.js";
|
|
5
5
|
export * from "./gridDensityApi.js";
|
|
6
|
-
export
|
|
6
|
+
export type { GridRowGroupChildrenGetterParams, GridRowApi, GridRowProApi, GridRowProPrivateApi } from "./gridRowApi.js";
|
|
7
7
|
export type { GridRowsMetaApi } from "./gridRowsMetaApi.js";
|
|
8
8
|
export * from "./gridRowSelectionApi.js";
|
|
9
9
|
export * from "./gridSortApi.js";
|
package/models/api/index.js
CHANGED
|
@@ -25,17 +25,6 @@ Object.keys(_gridDensityApi).forEach(function (key) {
|
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
});
|
|
28
|
-
var _gridRowApi = require("./gridRowApi");
|
|
29
|
-
Object.keys(_gridRowApi).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _gridRowApi[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () {
|
|
35
|
-
return _gridRowApi[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
28
|
var _gridRowSelectionApi = require("./gridRowSelectionApi");
|
|
40
29
|
Object.keys(_gridRowSelectionApi).forEach(function (key) {
|
|
41
30
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -257,6 +257,20 @@ export interface GridActionsColDef<R extends GridValidRowModel = any, V = any, F
|
|
|
257
257
|
* Function that returns the actions to be shown.
|
|
258
258
|
* @param {GridRowParams} params The params for each row.
|
|
259
259
|
* @returns {readonly React.ReactElement<GridActionsCellItemProps>[]} An array of [[GridActionsCell]] elements.
|
|
260
|
+
* @deprecated Use `renderCell` instead
|
|
261
|
+
* @example
|
|
262
|
+
* // Before
|
|
263
|
+
* getActions: (params) => [
|
|
264
|
+
* <GridActionsCellItem icon={...} onClick={...} label="Delete" />,
|
|
265
|
+
* <GridActionsCellItem icon={...} onClick={...} label="Print" showInMenu />,
|
|
266
|
+
* ],
|
|
267
|
+
* // After
|
|
268
|
+
* renderCell: (params) => (
|
|
269
|
+
* <GridActionsCell {...params}>
|
|
270
|
+
* <GridActionsCellItem icon={...} onClick={...} label="Delete" />
|
|
271
|
+
* <GridActionsCellItem icon={...} onClick={...} label="Print" showInMenu />
|
|
272
|
+
* </GridActionsCell>
|
|
273
|
+
* ),
|
|
260
274
|
*/
|
|
261
275
|
getActions: (params: GridRowParams<R>) => readonly React.ReactElement<GridActionsCellItemProps>[];
|
|
262
276
|
}
|
|
@@ -3,14 +3,14 @@ import type { GridRowAriaAttributesInternalHook, GridRowsOverridableMethodsInter
|
|
|
3
3
|
import type { GridAggregationInternalHooks } from "./gridAggregationConfiguration.js";
|
|
4
4
|
import type { GridCellEditableInternalHook } from "./gridCellEditableConfiguration.js";
|
|
5
5
|
import type { GridCSSVariablesInterface } from "../../constants/cssVariables.js";
|
|
6
|
-
import { DataGridProcessedProps } from "../props/DataGridProps.js";
|
|
7
6
|
import type { GridPrivateApiCommon } from "../api/gridApiCommon.js";
|
|
8
7
|
import type { GridPrivateApiCommunity } from "../api/gridApiCommunity.js";
|
|
8
|
+
import type { DataGridProcessedProps } from "../props/DataGridProps.js";
|
|
9
9
|
import type { GridParamsOverridableMethodsInternalHook } from "./gridParamsConfiguration.js";
|
|
10
10
|
export interface GridAriaAttributesInternalHook {
|
|
11
11
|
useGridAriaAttributes: () => React.HTMLAttributes<HTMLElement>;
|
|
12
12
|
}
|
|
13
|
-
export interface GridInternalHook<Api, Props> extends GridAriaAttributesInternalHook, GridRowAriaAttributesInternalHook, GridCellEditableInternalHook<Api, Props>, GridAggregationInternalHooks<Api, Props>, GridRowsOverridableMethodsInternalHook<Api>, GridParamsOverridableMethodsInternalHook<Api> {
|
|
13
|
+
export interface GridInternalHook<Api, Props> extends GridAriaAttributesInternalHook, GridRowAriaAttributesInternalHook, GridCellEditableInternalHook<Api, Props>, GridAggregationInternalHooks<Api, Props>, GridRowsOverridableMethodsInternalHook<Api, Props>, GridParamsOverridableMethodsInternalHook<Api> {
|
|
14
14
|
useCSSVariables: () => {
|
|
15
15
|
id: string;
|
|
16
16
|
variables: GridCSSVariablesInterface;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { RefObject } from '@mui/x-internals/types';
|
|
3
|
-
import { GridTreeNode
|
|
4
|
-
import {
|
|
3
|
+
import { GridTreeNode } from "../gridRows.js";
|
|
4
|
+
import { GridRowProApi } from "../api/index.js";
|
|
5
5
|
/**
|
|
6
6
|
* Get the ARIA attributes for a row
|
|
7
7
|
* @param {GridTreeNode} rowNode The row node
|
|
@@ -15,8 +15,9 @@ export interface GridRowAriaAttributesInternalHook {
|
|
|
15
15
|
/**
|
|
16
16
|
* Overridable row methods interface, these methods could be overriden in a higher plan package.
|
|
17
17
|
*/
|
|
18
|
-
export interface GridRowsOverridableMethodsInternalHook<Api> {
|
|
19
|
-
useGridRowsOverridableMethods: (apiRef: RefObject<Api>, props:
|
|
20
|
-
setRowIndex:
|
|
18
|
+
export interface GridRowsOverridableMethodsInternalHook<Api, Props> {
|
|
19
|
+
useGridRowsOverridableMethods: (apiRef: RefObject<Api>, props: Props) => {
|
|
20
|
+
setRowIndex: GridRowProApi['setRowIndex'];
|
|
21
|
+
setRowPosition: GridRowProApi['setRowPosition'];
|
|
21
22
|
};
|
|
22
23
|
}
|
|
@@ -516,6 +516,11 @@ export interface GridEventLookup extends GridRowEventLookup, GridColumnHeaderEve
|
|
|
516
516
|
* @ignore - do not document
|
|
517
517
|
*/
|
|
518
518
|
sortedRowsSet: {};
|
|
519
|
+
/**
|
|
520
|
+
* Fired when the aggregations are done
|
|
521
|
+
* @ignore - do not document
|
|
522
|
+
*/
|
|
523
|
+
aggregationLookupSet: {};
|
|
519
524
|
/**
|
|
520
525
|
* Fired when the expansion of a row is changed. Called with a [[GridGroupNode]] object.
|
|
521
526
|
*/
|
|
@@ -13,7 +13,7 @@ import type { GridRowReorderState } from "../hooks/features/rowReorder/gridRowRe
|
|
|
13
13
|
* Some props are passed on the state to enable grid selectors to select
|
|
14
14
|
* and react to them.
|
|
15
15
|
*/
|
|
16
|
-
export type GridStateProps = Pick<DataGridProcessedProps, 'getRowId' | 'listView' | 'isCellEditable'>;
|
|
16
|
+
export type GridStateProps = Pick<DataGridProcessedProps, 'getRowId' | 'listView' | 'isCellEditable' | 'isRowSelectable'>;
|
|
17
17
|
/**
|
|
18
18
|
* The state of Data Grid.
|
|
19
19
|
*/
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import { GridCellMode } from "../gridCell.js";
|
|
3
2
|
import { GridRowId, GridRowModel, GridTreeNode, GridTreeNodeWithRender, GridValidRowModel } from "../gridRows.js";
|
|
4
3
|
import type { GridStateColDef } from "../colDef/gridColDef.js";
|
|
@@ -58,9 +57,6 @@ export interface GridCellParams<R extends GridValidRowModel = any, V = unknown,
|
|
|
58
57
|
*/
|
|
59
58
|
api: GridApiCommunity;
|
|
60
59
|
}
|
|
61
|
-
export interface FocusElement {
|
|
62
|
-
focus(): void;
|
|
63
|
-
}
|
|
64
60
|
/**
|
|
65
61
|
* GridCellParams containing api.
|
|
66
62
|
*/
|
|
@@ -69,12 +65,6 @@ export interface GridRenderCellParams<R extends GridValidRowModel = any, V = any
|
|
|
69
65
|
* GridApi that let you manipulate the grid.
|
|
70
66
|
*/
|
|
71
67
|
api: GridApiCommunity;
|
|
72
|
-
/**
|
|
73
|
-
* A ref allowing to set imperative focus.
|
|
74
|
-
* It can be passed to the element that should receive focus.
|
|
75
|
-
* @ignore - do not document.
|
|
76
|
-
*/
|
|
77
|
-
focusElementRef?: React.Ref<FocusElement>;
|
|
78
68
|
}
|
|
79
69
|
/**
|
|
80
70
|
* GridEditCellProps containing api.
|
|
@@ -79,13 +79,11 @@ export interface DataGridPropsWithComplexDefaultValueBeforeProcessing {
|
|
|
79
79
|
*/
|
|
80
80
|
export interface DataGridPropsWithDefaultValues<R extends GridValidRowModel = any> {
|
|
81
81
|
/**
|
|
82
|
-
* If `true`, the Data Grid height is dynamic and
|
|
82
|
+
* If `true`, the Data Grid height is dynamic and takes as much space as it needs to display all rows.
|
|
83
|
+
* Use it instead of a flex parent container approach, if:
|
|
84
|
+
* - you don't need to set a minimum or maximum height for the Data Grid
|
|
85
|
+
* - you want to avoid the scrollbar flickering when the content changes
|
|
83
86
|
* @default false
|
|
84
|
-
* @deprecated Use flex parent container instead: https://mui.com/x/react-data-grid/layout/#flex-parent-container
|
|
85
|
-
* @example
|
|
86
|
-
* <div style={{ display: 'flex', flexDirection: 'column' }}>
|
|
87
|
-
* <DataGrid />
|
|
88
|
-
* </div>
|
|
89
87
|
*/
|
|
90
88
|
autoHeight: boolean;
|
|
91
89
|
/**
|
|
@@ -381,6 +379,15 @@ export interface DataGridPropsWithDefaultValues<R extends GridValidRowModel = an
|
|
|
381
379
|
* @default false
|
|
382
380
|
*/
|
|
383
381
|
virtualizeColumnsWithAutoRowHeight: boolean;
|
|
382
|
+
/**
|
|
383
|
+
* Sets the tab navigation behavior for the Data Grid.
|
|
384
|
+
* - "none": No Data Grid specific tab navigation. Pressing the tab key will move the focus to the next element in the tab sequence.
|
|
385
|
+
* - "content": Pressing the tab key will move the focus to the next cell in the same row or the first cell in the next row. Shift+Tab will move the focus to the previous cell in the same row or the last cell in the previous row. Tab navigation is not enabled for the header.
|
|
386
|
+
* - "header": Pressing the tab key will move the focus to the next column group, column header or header filter. Shift+Tab will move the focus to the previous column group, column header or header filter. Tab navigation is not enabled for the content.
|
|
387
|
+
* - "all": Combines the "content" and "header" behavior.
|
|
388
|
+
* @default "none"
|
|
389
|
+
*/
|
|
390
|
+
tabNavigation: 'none' | 'content' | 'header' | 'all';
|
|
384
391
|
}
|
|
385
392
|
/**
|
|
386
393
|
* The Data Grid props with no default value.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.20.0",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "The Community plan edition of the MUI X Data Grid components.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"clsx": "^2.1.1",
|
|
43
43
|
"prop-types": "^15.8.1",
|
|
44
44
|
"use-sync-external-store": "^1.6.0",
|
|
45
|
-
"@mui/x-internals": "8.
|
|
46
|
-
"@mui/x-virtualizer": "0.2.
|
|
45
|
+
"@mui/x-internals": "8.19.0",
|
|
46
|
+
"@mui/x-virtualizer": "0.2.10"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@emotion/react": "^11.9.0",
|
package/utils/keyboardUtils.d.ts
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export declare function isPrintableKey(event: React.KeyboardEvent<HTMLElement>): boolean;
|
|
3
|
-
export declare const GRID_MULTIPLE_SELECTION_KEYS: string[];
|
|
4
|
-
export declare const GRID_CELL_EXIT_EDIT_MODE_KEYS: string[];
|
|
5
|
-
export declare const GRID_CELL_EDIT_COMMIT_KEYS: string[];
|
|
6
|
-
export declare const isMultipleKey: (key: string) => boolean;
|
|
7
|
-
export declare const isCellEnterEditModeKeys: (event: React.KeyboardEvent<HTMLElement>) => boolean;
|
|
8
|
-
export declare const isCellExitEditModeKeys: (key: string) => boolean;
|
|
9
|
-
export declare const isCellEditCommitKeys: (key: string) => boolean;
|
|
10
3
|
export declare const isNavigationKey: (key: string) => boolean;
|
|
11
4
|
export declare const isKeyboardEvent: (event: any) => event is React.KeyboardEvent<HTMLElement>;
|
|
12
|
-
export declare const isHideMenuKey: (key: React.KeyboardEvent["key"]) => key is "
|
|
5
|
+
export declare const isHideMenuKey: (key: React.KeyboardEvent["key"]) => key is "Tab" | "Escape";
|
|
13
6
|
export declare function isPasteShortcut(event: React.KeyboardEvent): boolean;
|
|
14
7
|
export declare function isCopyShortcut(event: KeyboardEvent): boolean;
|
package/utils/keyboardUtils.js
CHANGED
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.isCellExitEditModeKeys = exports.isCellEnterEditModeKeys = exports.isCellEditCommitKeys = exports.GRID_MULTIPLE_SELECTION_KEYS = exports.GRID_CELL_EXIT_EDIT_MODE_KEYS = exports.GRID_CELL_EDIT_COMMIT_KEYS = void 0;
|
|
7
6
|
exports.isCopyShortcut = isCopyShortcut;
|
|
8
|
-
exports.isNavigationKey = exports.
|
|
7
|
+
exports.isNavigationKey = exports.isKeyboardEvent = exports.isHideMenuKey = void 0;
|
|
9
8
|
exports.isPasteShortcut = isPasteShortcut;
|
|
10
9
|
exports.isPrintableKey = isPrintableKey;
|
|
11
10
|
// Non printable keys have a name, for example "ArrowRight", see the whole list:
|
|
@@ -18,17 +17,6 @@ exports.isPrintableKey = isPrintableKey;
|
|
|
18
17
|
function isPrintableKey(event) {
|
|
19
18
|
return event.key.length === 1 && !event.ctrlKey && !event.metaKey;
|
|
20
19
|
}
|
|
21
|
-
const GRID_MULTIPLE_SELECTION_KEYS = exports.GRID_MULTIPLE_SELECTION_KEYS = ['Meta', 'Control', 'Shift'];
|
|
22
|
-
const GRID_CELL_EXIT_EDIT_MODE_KEYS = exports.GRID_CELL_EXIT_EDIT_MODE_KEYS = ['Enter', 'Escape', 'Tab'];
|
|
23
|
-
const GRID_CELL_EDIT_COMMIT_KEYS = exports.GRID_CELL_EDIT_COMMIT_KEYS = ['Enter', 'Tab'];
|
|
24
|
-
const isMultipleKey = key => GRID_MULTIPLE_SELECTION_KEYS.indexOf(key) > -1;
|
|
25
|
-
exports.isMultipleKey = isMultipleKey;
|
|
26
|
-
const isCellEnterEditModeKeys = event => isPrintableKey(event) || event.key === 'Enter' || event.key === 'Backspace' || event.key === 'Delete';
|
|
27
|
-
exports.isCellEnterEditModeKeys = isCellEnterEditModeKeys;
|
|
28
|
-
const isCellExitEditModeKeys = key => GRID_CELL_EXIT_EDIT_MODE_KEYS.indexOf(key) > -1;
|
|
29
|
-
exports.isCellExitEditModeKeys = isCellExitEditModeKeys;
|
|
30
|
-
const isCellEditCommitKeys = key => GRID_CELL_EDIT_COMMIT_KEYS.indexOf(key) > -1;
|
|
31
|
-
exports.isCellEditCommitKeys = isCellEditCommitKeys;
|
|
32
20
|
const isNavigationKey = key => key.indexOf('Arrow') === 0 || key.indexOf('Page') === 0 || key === ' ' || key === 'Home' || key === 'End';
|
|
33
21
|
exports.isNavigationKey = isNavigationKey;
|
|
34
22
|
const isKeyboardEvent = event => !!event.key;
|