@mui/x-data-grid 7.0.0-alpha.3 → 7.0.0-alpha.4
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 +123 -0
- package/colDef/gridCheckboxSelectionColDef.js +1 -1
- package/colDef/gridDefaultColumnTypes.d.ts +2 -2
- package/colDef/gridDefaultColumnTypes.js +2 -2
- package/components/GridRow.js +7 -2
- package/components/base/GridOverlays.js +0 -2
- package/components/cell/GridActionsCell.js +0 -1
- package/components/cell/GridCell.js +0 -2
- package/components/virtualization/GridVirtualScroller.js +0 -1
- package/hooks/features/editing/useGridCellEditing.js +0 -2
- package/hooks/features/editing/useGridRowEditing.js +0 -1
- package/hooks/features/focus/gridFocusStateSelector.d.ts +2 -2
- package/hooks/features/focus/gridFocusStateSelector.js +2 -6
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +3 -3
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +3 -4
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +7 -5
- package/hooks/features/rows/useGridRowsMeta.js +0 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +0 -1
- package/index.js +1 -1
- package/internals/index.d.ts +1 -1
- package/internals/index.js +1 -1
- package/legacy/colDef/gridCheckboxSelectionColDef.js +1 -1
- package/legacy/colDef/gridDefaultColumnTypes.js +2 -2
- package/legacy/components/GridRow.js +7 -2
- package/legacy/components/base/GridOverlays.js +0 -2
- package/legacy/components/cell/GridActionsCell.js +0 -1
- package/legacy/components/cell/GridCell.js +0 -2
- package/legacy/components/virtualization/GridVirtualScroller.js +0 -1
- package/legacy/hooks/features/editing/useGridCellEditing.js +0 -2
- package/legacy/hooks/features/editing/useGridRowEditing.js +0 -1
- package/legacy/hooks/features/focus/gridFocusStateSelector.js +2 -6
- package/legacy/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +3 -4
- package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +7 -5
- package/legacy/hooks/features/rows/useGridRowsMeta.js +0 -1
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +0 -1
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +1 -1
- package/legacy/locales/coreLocales.js +1 -0
- package/legacy/locales/daDK.js +37 -39
- package/legacy/locales/plPL.js +0 -1
- package/legacy/utils/utils.js +0 -1
- package/locales/coreLocales.js +1 -0
- package/locales/daDK.js +37 -39
- package/locales/plPL.js +0 -1
- package/models/colDef/gridColType.d.ts +2 -4
- package/modern/colDef/gridCheckboxSelectionColDef.js +1 -1
- package/modern/colDef/gridDefaultColumnTypes.js +2 -2
- package/modern/components/GridRow.js +7 -2
- package/modern/components/base/GridOverlays.js +0 -2
- package/modern/components/cell/GridActionsCell.js +0 -1
- package/modern/components/cell/GridCell.js +0 -2
- package/modern/components/virtualization/GridVirtualScroller.js +0 -1
- package/modern/hooks/features/editing/useGridCellEditing.js +0 -2
- package/modern/hooks/features/editing/useGridRowEditing.js +0 -1
- package/modern/hooks/features/focus/gridFocusStateSelector.js +2 -6
- package/modern/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +3 -4
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +7 -5
- package/modern/hooks/features/rows/useGridRowsMeta.js +0 -1
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +0 -1
- package/modern/index.js +1 -1
- package/modern/internals/index.js +1 -1
- package/modern/locales/coreLocales.js +1 -0
- package/modern/locales/daDK.js +37 -39
- package/modern/locales/plPL.js +0 -1
- package/modern/utils/utils.js +0 -1
- package/node/colDef/gridCheckboxSelectionColDef.js +1 -1
- package/node/colDef/gridDefaultColumnTypes.js +2 -2
- package/node/components/GridRow.js +7 -2
- package/node/components/base/GridOverlays.js +0 -2
- package/node/components/cell/GridActionsCell.js +0 -1
- package/node/components/cell/GridCell.js +0 -2
- package/node/components/virtualization/GridVirtualScroller.js +0 -1
- package/node/hooks/features/editing/useGridCellEditing.js +0 -2
- package/node/hooks/features/editing/useGridRowEditing.js +0 -1
- package/node/hooks/features/focus/gridFocusStateSelector.js +3 -7
- package/node/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +5 -7
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +6 -4
- package/node/hooks/features/rows/useGridRowsMeta.js +0 -1
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +0 -1
- package/node/index.js +1 -1
- package/node/internals/index.js +14 -14
- package/node/locales/daDK.js +37 -39
- package/node/locales/plPL.js +0 -1
- package/node/utils/utils.js +0 -1
- package/package.json +4 -4
- package/utils/utils.js +0 -1
|
@@ -14,7 +14,7 @@ import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from '../../../constants/gridDetailPan
|
|
|
14
14
|
import { gridPinnedRowsSelector } from '../rows/gridRowsSelector';
|
|
15
15
|
import { unstable_gridFocusColumnGroupHeaderSelector } from '../focus';
|
|
16
16
|
import { gridColumnGroupsHeaderMaxDepthSelector } from '../columnGrouping/gridColumnGroupsSelector';
|
|
17
|
-
import {
|
|
17
|
+
import { gridHeaderFilteringEditFieldSelector, gridHeaderFilteringMenuSelector } from '../headerFiltering/gridHeaderFilteringSelectors';
|
|
18
18
|
import { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';
|
|
19
19
|
import { isEventTargetInPortal } from '../../../utils/domUtils';
|
|
20
20
|
function enrichPageRowsWithPinnedRows(apiRef, rows) {
|
|
@@ -72,7 +72,7 @@ export var useGridKeyboardNavigation = function useGridKeyboardNavigation(apiRef
|
|
|
72
72
|
}, [apiRef, initialCurrentPageRows]);
|
|
73
73
|
var headerFilteringEnabled =
|
|
74
74
|
// @ts-expect-error // TODO move relevant code to the `DataGridPro`
|
|
75
|
-
props.signature !== 'DataGrid' && props.
|
|
75
|
+
props.signature !== 'DataGrid' && props.headerFilters;
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
78
|
* @param {number} colIndex Index of the column to focus
|
|
@@ -240,8 +240,8 @@ export var useGridKeyboardNavigation = function useGridKeyboardNavigation(apiRef
|
|
|
240
240
|
if (!dimensions) {
|
|
241
241
|
return;
|
|
242
242
|
}
|
|
243
|
-
var isEditing =
|
|
244
|
-
var isHeaderMenuOpen =
|
|
243
|
+
var isEditing = gridHeaderFilteringEditFieldSelector(apiRef) === params.field;
|
|
244
|
+
var isHeaderMenuOpen = gridHeaderFilteringMenuSelector(apiRef) === params.field;
|
|
245
245
|
if (isEditing || isHeaderMenuOpen || !isNavigationKey(event.key)) {
|
|
246
246
|
return;
|
|
247
247
|
}
|
|
@@ -507,7 +507,9 @@ export var useGridKeyboardNavigation = function useGridKeyboardNavigation(apiRef
|
|
|
507
507
|
break;
|
|
508
508
|
}
|
|
509
509
|
var colDef = params.colDef;
|
|
510
|
-
if (colDef &&
|
|
510
|
+
if (colDef &&
|
|
511
|
+
// `GRID_TREE_DATA_GROUPING_FIELD` from the Pro package
|
|
512
|
+
colDef.field === '__tree_data_group__') {
|
|
511
513
|
break;
|
|
512
514
|
}
|
|
513
515
|
if (!event.shiftKey && rowIndexBefore < lastRowIndexInPage) {
|
|
@@ -68,7 +68,6 @@ export var useGridRowsMeta = function useGridRowsMeta(apiRef, props) {
|
|
|
68
68
|
needsFirstMeasurement: true // Assume all rows will need to be measured by default
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
|
|
72
71
|
var _rowsHeightLookup$cur = rowsHeightLookup.current[row.id],
|
|
73
72
|
isResized = _rowsHeightLookup$cur.isResized,
|
|
74
73
|
needsFirstMeasurement = _rowsHeightLookup$cur.needsFirstMeasurement,
|
|
@@ -585,7 +585,6 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
|
|
|
585
585
|
if (rootProps.autoHeight && currentPage.rows.length === 0) {
|
|
586
586
|
size.height = getMinimalContentHeight(apiRef, rootProps.rowHeight); // Give room to show the overlay when there no rows.
|
|
587
587
|
}
|
|
588
|
-
|
|
589
588
|
return size;
|
|
590
589
|
}, [apiRef, rootRef, columnsTotalWidth, rowsMeta.currentPageTotalHeight, needsHorizontalScrollbar, rootProps.autoHeight, rootProps.rowHeight, currentPage.rows.length]);
|
|
591
590
|
React.useEffect(function () {
|
package/legacy/index.js
CHANGED
|
@@ -11,7 +11,7 @@ export { useGridInitialization } from '../hooks/core/useGridInitialization';
|
|
|
11
11
|
export { unwrapPrivateAPI } from '../hooks/core/useGridApiInitialization';
|
|
12
12
|
export { useGridClipboard } from '../hooks/features/clipboard/useGridClipboard';
|
|
13
13
|
export { useGridColumnHeaders } from '../hooks/features/columnHeaders/useGridColumnHeaders';
|
|
14
|
-
export {
|
|
14
|
+
export { gridHeaderFilteringEditFieldSelector, gridHeaderFilteringMenuSelector } from '../hooks/features/headerFiltering/gridHeaderFilteringSelectors';
|
|
15
15
|
export { useGridColumnMenu, columnMenuStateInitializer } from '../hooks/features/columnMenu/useGridColumnMenu';
|
|
16
16
|
export { useGridColumns, columnsStateInitializer } from '../hooks/features/columns/useGridColumns';
|
|
17
17
|
export { getTotalHeaderHeight } from '../hooks/features/columns/gridColumnsUtils';
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// This allows not to bump the minimal version of `@mui/material` in peerDependencies which results
|
|
4
4
|
// in broader compatibility between the packages.
|
|
5
5
|
// See https://github.com/mui/mui-x/pull/7646#issuecomment-1404605556 for additional context.
|
|
6
|
+
|
|
6
7
|
export var beBYCore = {
|
|
7
8
|
components: {
|
|
8
9
|
MuiTablePagination: {
|
package/legacy/locales/daDK.js
CHANGED
|
@@ -49,47 +49,45 @@ var daDKGrid = {
|
|
|
49
49
|
filterPanelInputLabel: 'Værdi',
|
|
50
50
|
filterPanelInputPlaceholder: 'Filter værdi',
|
|
51
51
|
// Filter operators text
|
|
52
|
-
filterOperatorContains: '
|
|
53
|
-
filterOperatorEquals: '
|
|
54
|
-
filterOperatorStartsWith: '
|
|
55
|
-
filterOperatorEndsWith: '
|
|
56
|
-
filterOperatorIs: '
|
|
57
|
-
filterOperatorNot: '
|
|
58
|
-
filterOperatorAfter: '
|
|
59
|
-
filterOperatorOnOrAfter: '
|
|
60
|
-
filterOperatorBefore: '
|
|
61
|
-
filterOperatorOnOrBefore: '
|
|
62
|
-
filterOperatorIsEmpty: '
|
|
63
|
-
filterOperatorIsNotEmpty: '
|
|
52
|
+
filterOperatorContains: 'indeholder',
|
|
53
|
+
filterOperatorEquals: 'lig med',
|
|
54
|
+
filterOperatorStartsWith: 'begynder med',
|
|
55
|
+
filterOperatorEndsWith: 'ender med',
|
|
56
|
+
filterOperatorIs: 'er lig med',
|
|
57
|
+
filterOperatorNot: 'er ikke lig med',
|
|
58
|
+
filterOperatorAfter: 'efter',
|
|
59
|
+
filterOperatorOnOrAfter: 'på eller efter',
|
|
60
|
+
filterOperatorBefore: 'før',
|
|
61
|
+
filterOperatorOnOrBefore: 'på eller før',
|
|
62
|
+
filterOperatorIsEmpty: 'indeholder ikke data',
|
|
63
|
+
filterOperatorIsNotEmpty: 'indeholder data',
|
|
64
64
|
filterOperatorIsAnyOf: 'indeholder en af',
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
'filterOperator=': '=',
|
|
66
|
+
'filterOperator!=': '!=',
|
|
67
|
+
'filterOperator>': '>',
|
|
68
|
+
'filterOperator>=': '>=',
|
|
69
|
+
'filterOperator<': '<',
|
|
70
|
+
'filterOperator<=': '<=',
|
|
72
71
|
// Header filter operators text
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
72
|
+
headerFilterOperatorContains: 'Indeholder',
|
|
73
|
+
headerFilterOperatorEquals: 'Lig med',
|
|
74
|
+
headerFilterOperatorStartsWith: 'Begynder med',
|
|
75
|
+
headerFilterOperatorEndsWith: 'Ender med',
|
|
76
|
+
headerFilterOperatorIs: 'Er lig med',
|
|
77
|
+
headerFilterOperatorNot: 'Er ikke lig med',
|
|
78
|
+
headerFilterOperatorAfter: 'Efter',
|
|
79
|
+
headerFilterOperatorOnOrAfter: 'På eller efter',
|
|
80
|
+
headerFilterOperatorBefore: 'Før',
|
|
81
|
+
headerFilterOperatorOnOrBefore: 'På eller før',
|
|
82
|
+
headerFilterOperatorIsEmpty: 'Indeholder ikke data',
|
|
83
|
+
headerFilterOperatorIsNotEmpty: 'Indeholder data',
|
|
84
|
+
headerFilterOperatorIsAnyOf: 'Indeholder en af',
|
|
85
|
+
'headerFilterOperator=': 'Lig med',
|
|
86
|
+
'headerFilterOperator!=': 'Ikke lig med',
|
|
87
|
+
'headerFilterOperator>': 'Større end',
|
|
88
|
+
'headerFilterOperator>=': 'Større end eller lig med',
|
|
89
|
+
'headerFilterOperator<': 'Mindre end',
|
|
90
|
+
'headerFilterOperator<=': 'Mindre end eller lig med',
|
|
93
91
|
// Filter values text
|
|
94
92
|
filterValueAny: 'hvilken som helst',
|
|
95
93
|
filterValueTrue: 'positiv',
|
package/legacy/locales/plPL.js
CHANGED
package/legacy/utils/utils.js
CHANGED
package/locales/coreLocales.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// This allows not to bump the minimal version of `@mui/material` in peerDependencies which results
|
|
4
4
|
// in broader compatibility between the packages.
|
|
5
5
|
// See https://github.com/mui/mui-x/pull/7646#issuecomment-1404605556 for additional context.
|
|
6
|
+
|
|
6
7
|
export const beBYCore = {
|
|
7
8
|
components: {
|
|
8
9
|
MuiTablePagination: {
|
package/locales/daDK.js
CHANGED
|
@@ -47,47 +47,45 @@ const daDKGrid = {
|
|
|
47
47
|
filterPanelInputLabel: 'Værdi',
|
|
48
48
|
filterPanelInputPlaceholder: 'Filter værdi',
|
|
49
49
|
// Filter operators text
|
|
50
|
-
filterOperatorContains: '
|
|
51
|
-
filterOperatorEquals: '
|
|
52
|
-
filterOperatorStartsWith: '
|
|
53
|
-
filterOperatorEndsWith: '
|
|
54
|
-
filterOperatorIs: '
|
|
55
|
-
filterOperatorNot: '
|
|
56
|
-
filterOperatorAfter: '
|
|
57
|
-
filterOperatorOnOrAfter: '
|
|
58
|
-
filterOperatorBefore: '
|
|
59
|
-
filterOperatorOnOrBefore: '
|
|
60
|
-
filterOperatorIsEmpty: '
|
|
61
|
-
filterOperatorIsNotEmpty: '
|
|
50
|
+
filterOperatorContains: 'indeholder',
|
|
51
|
+
filterOperatorEquals: 'lig med',
|
|
52
|
+
filterOperatorStartsWith: 'begynder med',
|
|
53
|
+
filterOperatorEndsWith: 'ender med',
|
|
54
|
+
filterOperatorIs: 'er lig med',
|
|
55
|
+
filterOperatorNot: 'er ikke lig med',
|
|
56
|
+
filterOperatorAfter: 'efter',
|
|
57
|
+
filterOperatorOnOrAfter: 'på eller efter',
|
|
58
|
+
filterOperatorBefore: 'før',
|
|
59
|
+
filterOperatorOnOrBefore: 'på eller før',
|
|
60
|
+
filterOperatorIsEmpty: 'indeholder ikke data',
|
|
61
|
+
filterOperatorIsNotEmpty: 'indeholder data',
|
|
62
62
|
filterOperatorIsAnyOf: 'indeholder en af',
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
'filterOperator=': '=',
|
|
64
|
+
'filterOperator!=': '!=',
|
|
65
|
+
'filterOperator>': '>',
|
|
66
|
+
'filterOperator>=': '>=',
|
|
67
|
+
'filterOperator<': '<',
|
|
68
|
+
'filterOperator<=': '<=',
|
|
70
69
|
// Header filter operators text
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
70
|
+
headerFilterOperatorContains: 'Indeholder',
|
|
71
|
+
headerFilterOperatorEquals: 'Lig med',
|
|
72
|
+
headerFilterOperatorStartsWith: 'Begynder med',
|
|
73
|
+
headerFilterOperatorEndsWith: 'Ender med',
|
|
74
|
+
headerFilterOperatorIs: 'Er lig med',
|
|
75
|
+
headerFilterOperatorNot: 'Er ikke lig med',
|
|
76
|
+
headerFilterOperatorAfter: 'Efter',
|
|
77
|
+
headerFilterOperatorOnOrAfter: 'På eller efter',
|
|
78
|
+
headerFilterOperatorBefore: 'Før',
|
|
79
|
+
headerFilterOperatorOnOrBefore: 'På eller før',
|
|
80
|
+
headerFilterOperatorIsEmpty: 'Indeholder ikke data',
|
|
81
|
+
headerFilterOperatorIsNotEmpty: 'Indeholder data',
|
|
82
|
+
headerFilterOperatorIsAnyOf: 'Indeholder en af',
|
|
83
|
+
'headerFilterOperator=': 'Lig med',
|
|
84
|
+
'headerFilterOperator!=': 'Ikke lig med',
|
|
85
|
+
'headerFilterOperator>': 'Større end',
|
|
86
|
+
'headerFilterOperator>=': 'Større end eller lig med',
|
|
87
|
+
'headerFilterOperator<': 'Mindre end',
|
|
88
|
+
'headerFilterOperator<=': 'Mindre end eller lig med',
|
|
91
89
|
// Filter values text
|
|
92
90
|
filterValueAny: 'hvilken som helst',
|
|
93
91
|
filterValueTrue: 'positiv',
|
package/locales/plPL.js
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
type
|
|
2
|
-
export type
|
|
3
|
-
export type GridColType = LiteralUnion<GridNativeColTypes, string>;
|
|
4
|
-
export {};
|
|
1
|
+
export type GridNativeColTypes = 'string' | 'number' | 'date' | 'dateTime' | 'boolean' | 'singleSelect' | 'actions' | 'custom';
|
|
2
|
+
export type GridColType = GridNativeColTypes;
|
|
@@ -7,8 +7,8 @@ import { GRID_BOOLEAN_COL_DEF } from './gridBooleanColDef';
|
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
8
|
export const GRID_CHECKBOX_SELECTION_FIELD = '__check__';
|
|
9
9
|
export const GRID_CHECKBOX_SELECTION_COL_DEF = _extends({}, GRID_BOOLEAN_COL_DEF, {
|
|
10
|
+
type: 'custom',
|
|
10
11
|
field: GRID_CHECKBOX_SELECTION_FIELD,
|
|
11
|
-
type: 'checkboxSelection',
|
|
12
12
|
width: 50,
|
|
13
13
|
resizable: false,
|
|
14
14
|
sortable: false,
|
|
@@ -4,7 +4,7 @@ import { GRID_DATE_COL_DEF, GRID_DATETIME_COL_DEF } from './gridDateColDef';
|
|
|
4
4
|
import { GRID_BOOLEAN_COL_DEF } from './gridBooleanColDef';
|
|
5
5
|
import { GRID_SINGLE_SELECT_COL_DEF } from './gridSingleSelectColDef';
|
|
6
6
|
import { GRID_ACTIONS_COL_DEF, GRID_ACTIONS_COLUMN_TYPE } from './gridActionsColDef';
|
|
7
|
-
export const DEFAULT_GRID_COL_TYPE_KEY = '
|
|
7
|
+
export const DEFAULT_GRID_COL_TYPE_KEY = 'string';
|
|
8
8
|
export const getGridDefaultColumnTypes = () => {
|
|
9
9
|
const nativeColumnTypes = {
|
|
10
10
|
string: GRID_STRING_COL_DEF,
|
|
@@ -14,7 +14,7 @@ export const getGridDefaultColumnTypes = () => {
|
|
|
14
14
|
boolean: GRID_BOOLEAN_COL_DEF,
|
|
15
15
|
singleSelect: GRID_SINGLE_SELECT_COL_DEF,
|
|
16
16
|
[GRID_ACTIONS_COLUMN_TYPE]: GRID_ACTIONS_COL_DEF,
|
|
17
|
-
|
|
17
|
+
custom: GRID_STRING_COL_DEF
|
|
18
18
|
};
|
|
19
19
|
return nativeColumnTypes;
|
|
20
20
|
};
|
|
@@ -53,7 +53,6 @@ function EmptyCell({
|
|
|
53
53
|
style: style
|
|
54
54
|
}); // TODO change to .MuiDataGrid-emptyCell or .MuiDataGrid-rowFiller
|
|
55
55
|
}
|
|
56
|
-
|
|
57
56
|
const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
58
57
|
const {
|
|
59
58
|
selected,
|
|
@@ -193,7 +192,13 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
193
192
|
const CellComponent = slots.cell === GridCellV7 ? GridCellV7 : GridCellWrapper;
|
|
194
193
|
const rowReordering = rootProps.rowReordering;
|
|
195
194
|
const getCell = (column, cellProps) => {
|
|
196
|
-
|
|
195
|
+
// when the cell is a reorder cell we are not allowing to reorder the col
|
|
196
|
+
// fixes https://github.com/mui/mui-x/issues/11126
|
|
197
|
+
const isReorderCell = column.field === '__reorder__';
|
|
198
|
+
const isEditingRows = Object.keys(editRowsState).length > 0;
|
|
199
|
+
const canReorderColumn = !(disableColumnReorder || column.disableReorder);
|
|
200
|
+
const canReorderRow = rowReordering && !sortModel.length && treeDepth <= 1 && !isEditingRows;
|
|
201
|
+
const disableDragEvents = !(canReorderColumn || isReorderCell && canReorderRow);
|
|
197
202
|
const editCellState = editRowsState[rowId]?.[column.field] ?? null;
|
|
198
203
|
let cellIsNotVisible = false;
|
|
199
204
|
if (focusedCellColumnIndexNotInRange !== undefined && visibleColumns[focusedCellColumnIndexNotInRange].field === column.field) {
|
|
@@ -31,7 +31,6 @@ const GridOverlayWrapperRoot = styled('div', {
|
|
|
31
31
|
zIndex: overlayType === 'loadingOverlay' ? 5 // Should be above pinned columns, pinned rows, and detail panel
|
|
32
32
|
: 4 // Should be above pinned columns and detail panel
|
|
33
33
|
}));
|
|
34
|
-
|
|
35
34
|
const GridOverlayWrapperInner = styled('div', {
|
|
36
35
|
name: 'MuiDataGrid',
|
|
37
36
|
slot: 'OverlayWrapperInner',
|
|
@@ -62,7 +61,6 @@ function GridOverlayWrapper(props) {
|
|
|
62
61
|
if (rootProps.autoHeight && height === 0) {
|
|
63
62
|
height = getMinimalContentHeight(apiRef, rootProps.rowHeight); // Give room to show the overlay when there no rows.
|
|
64
63
|
}
|
|
65
|
-
|
|
66
64
|
const classes = useUtilityClasses(_extends({}, props, {
|
|
67
65
|
classes: rootProps.classes
|
|
68
66
|
}));
|
|
@@ -126,7 +126,6 @@ function GridActionsCell(props) {
|
|
|
126
126
|
if (newIndex < 0 || newIndex >= numberOfButtons) {
|
|
127
127
|
return; // We're already in the first or last item = do nothing and let the grid listen the event
|
|
128
128
|
}
|
|
129
|
-
|
|
130
129
|
if (newIndex !== focusedButtonIndex) {
|
|
131
130
|
event.preventDefault(); // Prevent scrolling
|
|
132
131
|
event.stopPropagation(); // Don't stop propagation for other keys, e.g. ArrowUp
|
|
@@ -242,7 +242,6 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
242
242
|
minHeight: height,
|
|
243
243
|
maxHeight: height === 'auto' ? 'none' : height // max-height doesn't support "auto"
|
|
244
244
|
};
|
|
245
|
-
|
|
246
245
|
return cellStyle;
|
|
247
246
|
}, [width, height, isNotVisible]);
|
|
248
247
|
React.useEffect(() => {
|
|
@@ -510,7 +509,6 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
510
509
|
minHeight: height,
|
|
511
510
|
maxHeight: height === 'auto' ? 'none' : height // max-height doesn't support "auto"
|
|
512
511
|
};
|
|
513
|
-
|
|
514
512
|
return cellStyle;
|
|
515
513
|
}, [width, height, isNotVisible]);
|
|
516
514
|
React.useEffect(() => {
|
|
@@ -29,7 +29,6 @@ const VirtualScrollerRoot = styled('div', {
|
|
|
29
29
|
},
|
|
30
30
|
zIndex: 0 // See https://github.com/mui/mui-x/issues/10547
|
|
31
31
|
});
|
|
32
|
-
|
|
33
32
|
const GridVirtualScroller = /*#__PURE__*/React.forwardRef(function GridVirtualScroller(props, ref) {
|
|
34
33
|
const rootProps = useGridRootProps();
|
|
35
34
|
const classes = useUtilityClasses(rootProps);
|
|
@@ -81,7 +81,6 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
81
81
|
reason = event.shiftKey ? GridCellEditStopReasons.shiftTabKeyDown : GridCellEditStopReasons.tabKeyDown;
|
|
82
82
|
event.preventDefault(); // Prevent going to the next element in the tab sequence
|
|
83
83
|
}
|
|
84
|
-
|
|
85
84
|
if (reason) {
|
|
86
85
|
const newParams = _extends({}, params, {
|
|
87
86
|
reason
|
|
@@ -175,7 +174,6 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
175
174
|
if (props.cellModesModel && isNewModelDifferentFromProp) {
|
|
176
175
|
return; // The prop always win
|
|
177
176
|
}
|
|
178
|
-
|
|
179
177
|
setCellModesModel(newModel);
|
|
180
178
|
cellModesModelRef.current = newModel;
|
|
181
179
|
apiRef.current.publishEvent('cellModesModelChange', newModel);
|
|
@@ -239,7 +239,6 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
239
239
|
if (props.rowModesModel && isNewModelDifferentFromProp) {
|
|
240
240
|
return; // The prop always win
|
|
241
241
|
}
|
|
242
|
-
|
|
243
242
|
setRowModesModel(newModel);
|
|
244
243
|
rowModesModelRef.current = newModel;
|
|
245
244
|
apiRef.current.publishEvent('rowModesModelChange', newModel);
|
|
@@ -2,18 +2,14 @@ import { createSelector } from '../../../utils/createSelector';
|
|
|
2
2
|
export const gridFocusStateSelector = state => state.focus;
|
|
3
3
|
export const gridFocusCellSelector = createSelector(gridFocusStateSelector, focusState => focusState.cell);
|
|
4
4
|
export const gridFocusColumnHeaderSelector = createSelector(gridFocusStateSelector, focusState => focusState.columnHeader);
|
|
5
|
-
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
|
-
export const unstable_gridFocusColumnHeaderFilterSelector = createSelector(gridFocusStateSelector, focusState => focusState.columnHeaderFilter);
|
|
5
|
+
export const gridFocusColumnHeaderFilterSelector = createSelector(gridFocusStateSelector, focusState => focusState.columnHeaderFilter);
|
|
8
6
|
|
|
9
7
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
10
8
|
export const unstable_gridFocusColumnGroupHeaderSelector = createSelector(gridFocusStateSelector, focusState => focusState.columnGroupHeader);
|
|
11
9
|
export const gridTabIndexStateSelector = state => state.tabIndex;
|
|
12
10
|
export const gridTabIndexCellSelector = createSelector(gridTabIndexStateSelector, state => state.cell);
|
|
13
11
|
export const gridTabIndexColumnHeaderSelector = createSelector(gridTabIndexStateSelector, state => state.columnHeader);
|
|
14
|
-
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
16
|
-
export const unstable_gridTabIndexColumnHeaderFilterSelector = createSelector(gridTabIndexStateSelector, state => state.columnHeaderFilter);
|
|
12
|
+
export const gridTabIndexColumnHeaderFilterSelector = createSelector(gridTabIndexStateSelector, state => state.columnHeaderFilter);
|
|
17
13
|
|
|
18
14
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
19
15
|
export const unstable_gridTabIndexColumnGroupHeaderSelector = createSelector(gridTabIndexStateSelector, state => state.columnGroupHeader);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
1
|
import { createSelector } from '../../../utils/createSelector';
|
|
3
|
-
export const
|
|
4
|
-
export const
|
|
5
|
-
export const
|
|
2
|
+
export const gridHeaderFilteringStateSelector = state => state.headerFiltering;
|
|
3
|
+
export const gridHeaderFilteringEditFieldSelector = createSelector(gridHeaderFilteringStateSelector, headerFilteringState => headerFilteringState.editing);
|
|
4
|
+
export const gridHeaderFilteringMenuSelector = createSelector(gridHeaderFilteringStateSelector, headerFilteringState => headerFilteringState.menuOpen);
|
|
@@ -13,7 +13,7 @@ import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from '../../../constants/gridDetailPan
|
|
|
13
13
|
import { gridPinnedRowsSelector } from '../rows/gridRowsSelector';
|
|
14
14
|
import { unstable_gridFocusColumnGroupHeaderSelector } from '../focus';
|
|
15
15
|
import { gridColumnGroupsHeaderMaxDepthSelector } from '../columnGrouping/gridColumnGroupsSelector';
|
|
16
|
-
import {
|
|
16
|
+
import { gridHeaderFilteringEditFieldSelector, gridHeaderFilteringMenuSelector } from '../headerFiltering/gridHeaderFilteringSelectors';
|
|
17
17
|
import { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';
|
|
18
18
|
import { isEventTargetInPortal } from '../../../utils/domUtils';
|
|
19
19
|
function enrichPageRowsWithPinnedRows(apiRef, rows) {
|
|
@@ -71,7 +71,7 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
|
|
|
71
71
|
const currentPageRows = React.useMemo(() => enrichPageRowsWithPinnedRows(apiRef, initialCurrentPageRows), [apiRef, initialCurrentPageRows]);
|
|
72
72
|
const headerFilteringEnabled =
|
|
73
73
|
// @ts-expect-error // TODO move relevant code to the `DataGridPro`
|
|
74
|
-
props.signature !== 'DataGrid' && props.
|
|
74
|
+
props.signature !== 'DataGrid' && props.headerFilters;
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* @param {number} colIndex Index of the column to focus
|
|
@@ -237,8 +237,8 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
|
|
|
237
237
|
if (!dimensions) {
|
|
238
238
|
return;
|
|
239
239
|
}
|
|
240
|
-
const isEditing =
|
|
241
|
-
const isHeaderMenuOpen =
|
|
240
|
+
const isEditing = gridHeaderFilteringEditFieldSelector(apiRef) === params.field;
|
|
241
|
+
const isHeaderMenuOpen = gridHeaderFilteringMenuSelector(apiRef) === params.field;
|
|
242
242
|
if (isEditing || isHeaderMenuOpen || !isNavigationKey(event.key)) {
|
|
243
243
|
return;
|
|
244
244
|
}
|
|
@@ -506,7 +506,9 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
|
|
|
506
506
|
break;
|
|
507
507
|
}
|
|
508
508
|
const colDef = params.colDef;
|
|
509
|
-
if (colDef &&
|
|
509
|
+
if (colDef &&
|
|
510
|
+
// `GRID_TREE_DATA_GROUPING_FIELD` from the Pro package
|
|
511
|
+
colDef.field === '__tree_data_group__') {
|
|
510
512
|
break;
|
|
511
513
|
}
|
|
512
514
|
if (!event.shiftKey && rowIndexBefore < lastRowIndexInPage) {
|
|
@@ -550,7 +550,6 @@ export const useGridVirtualScroller = props => {
|
|
|
550
550
|
if (rootProps.autoHeight && currentPage.rows.length === 0) {
|
|
551
551
|
size.height = getMinimalContentHeight(apiRef, rootProps.rowHeight); // Give room to show the overlay when there no rows.
|
|
552
552
|
}
|
|
553
|
-
|
|
554
553
|
return size;
|
|
555
554
|
}, [apiRef, rootRef, columnsTotalWidth, rowsMeta.currentPageTotalHeight, needsHorizontalScrollbar, rootProps.autoHeight, rootProps.rowHeight, currentPage.rows.length]);
|
|
556
555
|
React.useEffect(() => {
|
package/modern/index.js
CHANGED
|
@@ -11,7 +11,7 @@ export { useGridInitialization } from '../hooks/core/useGridInitialization';
|
|
|
11
11
|
export { unwrapPrivateAPI } from '../hooks/core/useGridApiInitialization';
|
|
12
12
|
export { useGridClipboard } from '../hooks/features/clipboard/useGridClipboard';
|
|
13
13
|
export { useGridColumnHeaders } from '../hooks/features/columnHeaders/useGridColumnHeaders';
|
|
14
|
-
export {
|
|
14
|
+
export { gridHeaderFilteringEditFieldSelector, gridHeaderFilteringMenuSelector } from '../hooks/features/headerFiltering/gridHeaderFilteringSelectors';
|
|
15
15
|
export { useGridColumnMenu, columnMenuStateInitializer } from '../hooks/features/columnMenu/useGridColumnMenu';
|
|
16
16
|
export { useGridColumns, columnsStateInitializer } from '../hooks/features/columns/useGridColumns';
|
|
17
17
|
export { getTotalHeaderHeight } from '../hooks/features/columns/gridColumnsUtils';
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// This allows not to bump the minimal version of `@mui/material` in peerDependencies which results
|
|
4
4
|
// in broader compatibility between the packages.
|
|
5
5
|
// See https://github.com/mui/mui-x/pull/7646#issuecomment-1404605556 for additional context.
|
|
6
|
+
|
|
6
7
|
export const beBYCore = {
|
|
7
8
|
components: {
|
|
8
9
|
MuiTablePagination: {
|