@mui/x-data-grid-pro 7.23.1 → 7.23.3
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 +129 -0
- package/DataGridPro/DataGridPro.js +3 -1
- package/esm/DataGridPro/DataGridPro.js +3 -1
- package/esm/hooks/features/rowReorder/useGridRowReorder.js +8 -7
- package/esm/utils/releaseInfo.js +1 -1
- package/hooks/features/rowReorder/useGridRowReorder.js +7 -6
- package/index.js +1 -1
- package/modern/DataGridPro/DataGridPro.js +3 -1
- package/modern/hooks/features/rowReorder/useGridRowReorder.js +8 -7
- package/modern/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/package.json +3 -3
- package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,135 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 7.23.3
|
|
7
|
+
|
|
8
|
+
_Dec 19, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🌍 Improve Korean (ko-KR) locale on the Data Grid
|
|
13
|
+
- 🐞 Bugfixes
|
|
14
|
+
|
|
15
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
16
|
+
@k-rajat19, @good-jinu.
|
|
17
|
+
Following are all team members who have contributed to this release:
|
|
18
|
+
@KenanYusuf, @MBilalShafi, @arminmeh, @flaviendelangle.
|
|
19
|
+
|
|
20
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
21
|
+
|
|
22
|
+
### Data Grid
|
|
23
|
+
|
|
24
|
+
#### `@mui/x-data-grid@7.23.3`
|
|
25
|
+
|
|
26
|
+
- [DataGrid] Allow passing custom props to `.main` element (#15919) @MBilalShafi
|
|
27
|
+
- [DataGrid] Consider `columnGroupHeaderHeight` prop in `getTotalHeaderHeight` method (#15927) @k-rajat19
|
|
28
|
+
- [DataGrid] Deprecate `indeterminateCheckboxAction` prop (#15862) @MBilalShafi
|
|
29
|
+
- [DataGrid] Fix `aria-label` value for group checkboxes (#15861) @MBilalShafi
|
|
30
|
+
- [DataGrid] Fix autosizing with virtualized columns (#15929) @k-rajat19
|
|
31
|
+
- [DataGrid] Round dimensions to avoid subpixel rendering error (#15873) @KenanYusuf
|
|
32
|
+
- [DataGrid] Toggle menu on click in `<GridActionsCell />` (#15871) @k-rajat19
|
|
33
|
+
- [DataGrid] Trigger row spanning computation on rows update (#15872) @MBilalShafi
|
|
34
|
+
- [l10n] Improve Korean (ko-KR) locale (#15906) @good-jinu
|
|
35
|
+
|
|
36
|
+
#### `@mui/x-data-grid-pro@7.23.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
37
|
+
|
|
38
|
+
Same changes as in `@mui/x-data-grid@7.23.3`.
|
|
39
|
+
|
|
40
|
+
#### `@mui/x-data-grid-premium@7.23.3` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
41
|
+
|
|
42
|
+
Same changes as in `@mui/x-data-grid-pro@7.23.3`.
|
|
43
|
+
|
|
44
|
+
### Date and Time Pickers
|
|
45
|
+
|
|
46
|
+
#### `@mui/x-date-pickers@7.23.3`
|
|
47
|
+
|
|
48
|
+
- [pickers] Add verification to disable skipped hours in spring forward DST (#15918) @flaviendelangle
|
|
49
|
+
|
|
50
|
+
#### `@mui/x-date-pickers-pro@7.23.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
51
|
+
|
|
52
|
+
Same changes as in `@mui/x-date-pickers@7.23.3`.
|
|
53
|
+
|
|
54
|
+
## 7.23.2
|
|
55
|
+
|
|
56
|
+
_Dec 12, 2024_
|
|
57
|
+
|
|
58
|
+
We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
|
|
59
|
+
|
|
60
|
+
- 🌍 Improve Romanian and Turkish locales on the Data Grid
|
|
61
|
+
- 🌍 Improve Romanian locale on the Pickers
|
|
62
|
+
- 📚 Documentation improvements
|
|
63
|
+
- 🐞 Bugfixes
|
|
64
|
+
|
|
65
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
66
|
+
@ihsanberkozcan, @k-rajat19, @lhilgert9, @nusr, @rares985.
|
|
67
|
+
|
|
68
|
+
Following are all team members who have contributed to this release:
|
|
69
|
+
@alexfauquette, @arminmeh, @flaviendelangle, @JCQuintas, @KenanYusuf, @LukasTy.
|
|
70
|
+
|
|
71
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
72
|
+
|
|
73
|
+
### Data Grid
|
|
74
|
+
|
|
75
|
+
#### `@mui/x-data-grid@7.23.2`
|
|
76
|
+
|
|
77
|
+
- [DataGrid] Fix "No rows" displaying when all rows are pinned (#15851) @nusr
|
|
78
|
+
- [DataGrid] Use `columnsManagement` slot (#15821) @k-rajat19
|
|
79
|
+
- [l10n] Improve Romanian (ro-RO) locale (#15751) @rares985
|
|
80
|
+
- [l10n] Improve Turkish (tr-TR) locale (#15748) @ihsanberkozcan
|
|
81
|
+
|
|
82
|
+
#### `@mui/x-data-grid-pro@7.23.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
83
|
+
|
|
84
|
+
Same changes as in `@mui/x-data-grid@7.23.2`, plus:
|
|
85
|
+
|
|
86
|
+
- [DataGridPro] Make Row reordering work with pagination (#15782) @k-rajat19
|
|
87
|
+
|
|
88
|
+
#### `@mui/x-data-grid-premium@7.23.2` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
89
|
+
|
|
90
|
+
Same changes as in `@mui/x-data-grid-pro@7.23.2`, plus:
|
|
91
|
+
|
|
92
|
+
- [DataGridPremium] Fix group column ignoring `valueOptions` for `singleSelect` column type (#15754) @arminmeh
|
|
93
|
+
|
|
94
|
+
### Date and Time Pickers
|
|
95
|
+
|
|
96
|
+
#### `@mui/x-date-pickers@7.23.2`
|
|
97
|
+
|
|
98
|
+
- [l10n] Improve Romanian (ro-RO) locale (#15751) @rares985
|
|
99
|
+
|
|
100
|
+
#### `@mui/x-date-pickers-pro@7.23.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
101
|
+
|
|
102
|
+
Same changes as in `@mui/x-date-pickers@7.23.2`.
|
|
103
|
+
|
|
104
|
+
### Charts
|
|
105
|
+
|
|
106
|
+
#### `@mui/x-charts@7.23.2`
|
|
107
|
+
|
|
108
|
+
- [charts] Fix key generation for the ChartsGrid (#15864) @alexfauquette
|
|
109
|
+
- [charts] Fix scatter dataset with missing data (#15804) @alexfauquette
|
|
110
|
+
|
|
111
|
+
#### `@mui/x-charts-pro@7.23.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
112
|
+
|
|
113
|
+
Same changes as in `@mui/x-charts@7.23.2`.
|
|
114
|
+
|
|
115
|
+
#### `@mui/x-tree-view@v7.23.2`
|
|
116
|
+
|
|
117
|
+
No changes, releasing to keep the versions in sync.
|
|
118
|
+
|
|
119
|
+
#### `@mui/x-tree-view-pro@7.23.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
120
|
+
|
|
121
|
+
Releasing to benefit from license package fix (#15818).
|
|
122
|
+
|
|
123
|
+
### Docs
|
|
124
|
+
|
|
125
|
+
- [docs] Fix typo in charts axis documentation (#15746) @JCQuintas
|
|
126
|
+
- [docs] Improve Pickers accessible DOM structure description (#15752) @LukasTy
|
|
127
|
+
- [docs] Use `updateRows` method for list view demos (#15824) @KenanYusuf
|
|
128
|
+
- [docs] Use date library version from package dev dependencies for sandboxes (#15767) @LukasTy
|
|
129
|
+
|
|
130
|
+
### Core
|
|
131
|
+
|
|
132
|
+
- [core] Add `@mui/x-tree-view-pro` to `releaseChangelog` (#15747) @flaviendelangle
|
|
133
|
+
- [license] Use `console.log` for the error message on Codesandbox to avoid rendering error (#15818) @arminmeh
|
|
134
|
+
|
|
6
135
|
## 7.23.1
|
|
7
136
|
|
|
8
137
|
_Dec 5, 2024_
|
|
@@ -43,7 +43,7 @@ const DataGridProRaw = /*#__PURE__*/React.forwardRef(function DataGridPro(inProp
|
|
|
43
43
|
style: props.style,
|
|
44
44
|
sx: props.sx,
|
|
45
45
|
ref: ref
|
|
46
|
-
}, props.forwardedProps, {
|
|
46
|
+
}, props.forwardedProps, props.slotProps?.root, {
|
|
47
47
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_xDataGrid.GridHeader, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_xDataGrid.GridBody, {
|
|
48
48
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_xLicense.Watermark, {
|
|
49
49
|
packageName: "x-data-grid-pro",
|
|
@@ -105,6 +105,7 @@ DataGridProRaw.propTypes = {
|
|
|
105
105
|
*/
|
|
106
106
|
autosizeOptions: _propTypes.default.shape({
|
|
107
107
|
columns: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
108
|
+
disableColumnVirtualization: _propTypes.default.bool,
|
|
108
109
|
expand: _propTypes.default.bool,
|
|
109
110
|
includeHeaders: _propTypes.default.bool,
|
|
110
111
|
includeOutliers: _propTypes.default.bool,
|
|
@@ -422,6 +423,7 @@ DataGridProRaw.propTypes = {
|
|
|
422
423
|
* If `deselect`, it will deselect all the rows under it.
|
|
423
424
|
* Works only if `checkboxSelection` is enabled.
|
|
424
425
|
* @default "deselect"
|
|
426
|
+
* @deprecated `select` will be the default behavior from v8 onwards
|
|
425
427
|
*/
|
|
426
428
|
indeterminateCheckboxAction: _propTypes.default.oneOf(['deselect', 'select']),
|
|
427
429
|
/**
|
|
@@ -36,7 +36,7 @@ const DataGridProRaw = /*#__PURE__*/React.forwardRef(function DataGridPro(inProp
|
|
|
36
36
|
style: props.style,
|
|
37
37
|
sx: props.sx,
|
|
38
38
|
ref: ref
|
|
39
|
-
}, props.forwardedProps, {
|
|
39
|
+
}, props.forwardedProps, props.slotProps?.root, {
|
|
40
40
|
children: [/*#__PURE__*/_jsx(GridHeader, {}), /*#__PURE__*/_jsx(GridBody, {
|
|
41
41
|
children: /*#__PURE__*/_jsx(Watermark, {
|
|
42
42
|
packageName: "x-data-grid-pro",
|
|
@@ -98,6 +98,7 @@ DataGridProRaw.propTypes = {
|
|
|
98
98
|
*/
|
|
99
99
|
autosizeOptions: PropTypes.shape({
|
|
100
100
|
columns: PropTypes.arrayOf(PropTypes.string),
|
|
101
|
+
disableColumnVirtualization: PropTypes.bool,
|
|
101
102
|
expand: PropTypes.bool,
|
|
102
103
|
includeHeaders: PropTypes.bool,
|
|
103
104
|
includeOutliers: PropTypes.bool,
|
|
@@ -415,6 +416,7 @@ DataGridProRaw.propTypes = {
|
|
|
415
416
|
* If `deselect`, it will deselect all the rows under it.
|
|
416
417
|
* Works only if `checkboxSelection` is enabled.
|
|
417
418
|
* @default "deselect"
|
|
419
|
+
* @deprecated `select` will be the default behavior from v8 onwards
|
|
418
420
|
*/
|
|
419
421
|
indeterminateCheckboxAction: PropTypes.oneOf(['deselect', 'select']),
|
|
420
422
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import composeClasses from '@mui/utils/composeClasses';
|
|
3
3
|
import { useGridLogger, useGridApiEventHandler, getDataGridUtilityClass, useGridSelector, gridSortModelSelector, gridRowMaximumTreeDepthSelector, useGridApiOptionHandler } from '@mui/x-data-grid';
|
|
4
|
-
import { gridEditRowsStateSelector } from '@mui/x-data-grid/internals';
|
|
4
|
+
import { gridEditRowsStateSelector, gridSortedRowIndexLookupSelector } from '@mui/x-data-grid/internals';
|
|
5
5
|
import { GRID_REORDER_COL_DEF } from "./gridRowReorderColDef.js";
|
|
6
6
|
var Direction = /*#__PURE__*/function (Direction) {
|
|
7
7
|
Direction[Direction["UP"] = 0] = "UP";
|
|
@@ -39,6 +39,7 @@ export const useGridRowReorder = (apiRef, props) => {
|
|
|
39
39
|
};
|
|
40
40
|
const classes = useUtilityClasses(ownerState);
|
|
41
41
|
const [dragRowId, setDragRowId] = React.useState('');
|
|
42
|
+
const sortedRowIndexLookup = useGridSelector(apiRef, gridSortedRowIndexLookupSelector);
|
|
42
43
|
React.useEffect(() => {
|
|
43
44
|
return () => {
|
|
44
45
|
clearTimeout(removeDnDStylesTimeout.current);
|
|
@@ -66,9 +67,9 @@ export const useGridRowReorder = (apiRef, props) => {
|
|
|
66
67
|
removeDnDStylesTimeout.current = setTimeout(() => {
|
|
67
68
|
dragRowNode.current.classList.remove(classes.rowDragging);
|
|
68
69
|
});
|
|
69
|
-
originRowIndex.current =
|
|
70
|
+
originRowIndex.current = sortedRowIndexLookup[params.id];
|
|
70
71
|
apiRef.current.setCellFocus(params.id, GRID_REORDER_COL_DEF.field);
|
|
71
|
-
}, [isRowReorderDisabled, classes.rowDragging,
|
|
72
|
+
}, [apiRef, isRowReorderDisabled, logger, classes.rowDragging, sortedRowIndexLookup]);
|
|
72
73
|
const handleDragOver = React.useCallback((params, event) => {
|
|
73
74
|
if (dragRowId === '') {
|
|
74
75
|
return;
|
|
@@ -84,7 +85,7 @@ export const useGridRowReorder = (apiRef, props) => {
|
|
|
84
85
|
event.stopPropagation();
|
|
85
86
|
const mouseMovementDiff = previousMousePosition ? previousMousePosition.y - event.clientY : event.clientY;
|
|
86
87
|
if (params.id !== dragRowId) {
|
|
87
|
-
const targetRowIndex =
|
|
88
|
+
const targetRowIndex = sortedRowIndexLookup[params.id];
|
|
88
89
|
const dragDirection = mouseMovementDiff > 0 ? Direction.DOWN : Direction.UP;
|
|
89
90
|
const currentReorderState = {
|
|
90
91
|
dragDirection,
|
|
@@ -100,7 +101,7 @@ export const useGridRowReorder = (apiRef, props) => {
|
|
|
100
101
|
x: event.clientX,
|
|
101
102
|
y: event.clientY
|
|
102
103
|
};
|
|
103
|
-
}, [apiRef, logger,
|
|
104
|
+
}, [dragRowId, apiRef, logger, sortedRowIndexLookup]);
|
|
104
105
|
const handleDragEnd = React.useCallback((params, event) => {
|
|
105
106
|
// Call the gridEditRowsStateSelector directly to avoid infnite loop
|
|
106
107
|
const editRowsState = gridEditRowsStateSelector(apiRef.current.state);
|
|
@@ -125,13 +126,13 @@ export const useGridRowReorder = (apiRef, props) => {
|
|
|
125
126
|
// Emit the rowOrderChange event only once when the reordering stops.
|
|
126
127
|
const rowOrderChangeParams = {
|
|
127
128
|
row: apiRef.current.getRow(dragRowId),
|
|
128
|
-
targetIndex:
|
|
129
|
+
targetIndex: sortedRowIndexLookup[params.id],
|
|
129
130
|
oldIndex: originRowIndex.current
|
|
130
131
|
};
|
|
131
132
|
apiRef.current.publishEvent('rowOrderChange', rowOrderChangeParams);
|
|
132
133
|
}
|
|
133
134
|
setDragRowId('');
|
|
134
|
-
}, [isRowReorderDisabled, logger,
|
|
135
|
+
}, [apiRef, dragRowId, isRowReorderDisabled, logger, sortedRowIndexLookup]);
|
|
135
136
|
useGridApiEventHandler(apiRef, 'rowDragStart', handleDragStart);
|
|
136
137
|
useGridApiEventHandler(apiRef, 'rowDragOver', handleDragOver);
|
|
137
138
|
useGridApiEventHandler(apiRef, 'rowDragEnd', handleDragEnd);
|
package/esm/utils/releaseInfo.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTczNDU2NjQwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -47,6 +47,7 @@ const useGridRowReorder = (apiRef, props) => {
|
|
|
47
47
|
};
|
|
48
48
|
const classes = useUtilityClasses(ownerState);
|
|
49
49
|
const [dragRowId, setDragRowId] = React.useState('');
|
|
50
|
+
const sortedRowIndexLookup = (0, _xDataGrid.useGridSelector)(apiRef, _internals.gridSortedRowIndexLookupSelector);
|
|
50
51
|
React.useEffect(() => {
|
|
51
52
|
return () => {
|
|
52
53
|
clearTimeout(removeDnDStylesTimeout.current);
|
|
@@ -74,9 +75,9 @@ const useGridRowReorder = (apiRef, props) => {
|
|
|
74
75
|
removeDnDStylesTimeout.current = setTimeout(() => {
|
|
75
76
|
dragRowNode.current.classList.remove(classes.rowDragging);
|
|
76
77
|
});
|
|
77
|
-
originRowIndex.current =
|
|
78
|
+
originRowIndex.current = sortedRowIndexLookup[params.id];
|
|
78
79
|
apiRef.current.setCellFocus(params.id, _gridRowReorderColDef.GRID_REORDER_COL_DEF.field);
|
|
79
|
-
}, [isRowReorderDisabled, classes.rowDragging,
|
|
80
|
+
}, [apiRef, isRowReorderDisabled, logger, classes.rowDragging, sortedRowIndexLookup]);
|
|
80
81
|
const handleDragOver = React.useCallback((params, event) => {
|
|
81
82
|
if (dragRowId === '') {
|
|
82
83
|
return;
|
|
@@ -92,7 +93,7 @@ const useGridRowReorder = (apiRef, props) => {
|
|
|
92
93
|
event.stopPropagation();
|
|
93
94
|
const mouseMovementDiff = previousMousePosition ? previousMousePosition.y - event.clientY : event.clientY;
|
|
94
95
|
if (params.id !== dragRowId) {
|
|
95
|
-
const targetRowIndex =
|
|
96
|
+
const targetRowIndex = sortedRowIndexLookup[params.id];
|
|
96
97
|
const dragDirection = mouseMovementDiff > 0 ? Direction.DOWN : Direction.UP;
|
|
97
98
|
const currentReorderState = {
|
|
98
99
|
dragDirection,
|
|
@@ -108,7 +109,7 @@ const useGridRowReorder = (apiRef, props) => {
|
|
|
108
109
|
x: event.clientX,
|
|
109
110
|
y: event.clientY
|
|
110
111
|
};
|
|
111
|
-
}, [apiRef, logger,
|
|
112
|
+
}, [dragRowId, apiRef, logger, sortedRowIndexLookup]);
|
|
112
113
|
const handleDragEnd = React.useCallback((params, event) => {
|
|
113
114
|
// Call the gridEditRowsStateSelector directly to avoid infnite loop
|
|
114
115
|
const editRowsState = (0, _internals.gridEditRowsStateSelector)(apiRef.current.state);
|
|
@@ -133,13 +134,13 @@ const useGridRowReorder = (apiRef, props) => {
|
|
|
133
134
|
// Emit the rowOrderChange event only once when the reordering stops.
|
|
134
135
|
const rowOrderChangeParams = {
|
|
135
136
|
row: apiRef.current.getRow(dragRowId),
|
|
136
|
-
targetIndex:
|
|
137
|
+
targetIndex: sortedRowIndexLookup[params.id],
|
|
137
138
|
oldIndex: originRowIndex.current
|
|
138
139
|
};
|
|
139
140
|
apiRef.current.publishEvent('rowOrderChange', rowOrderChangeParams);
|
|
140
141
|
}
|
|
141
142
|
setDragRowId('');
|
|
142
|
-
}, [isRowReorderDisabled, logger,
|
|
143
|
+
}, [apiRef, dragRowId, isRowReorderDisabled, logger, sortedRowIndexLookup]);
|
|
143
144
|
(0, _xDataGrid.useGridApiEventHandler)(apiRef, 'rowDragStart', handleDragStart);
|
|
144
145
|
(0, _xDataGrid.useGridApiEventHandler)(apiRef, 'rowDragOver', handleDragOver);
|
|
145
146
|
(0, _xDataGrid.useGridApiEventHandler)(apiRef, 'rowDragEnd', handleDragEnd);
|
package/index.js
CHANGED
|
@@ -36,7 +36,7 @@ const DataGridProRaw = /*#__PURE__*/React.forwardRef(function DataGridPro(inProp
|
|
|
36
36
|
style: props.style,
|
|
37
37
|
sx: props.sx,
|
|
38
38
|
ref: ref
|
|
39
|
-
}, props.forwardedProps, {
|
|
39
|
+
}, props.forwardedProps, props.slotProps?.root, {
|
|
40
40
|
children: [/*#__PURE__*/_jsx(GridHeader, {}), /*#__PURE__*/_jsx(GridBody, {
|
|
41
41
|
children: /*#__PURE__*/_jsx(Watermark, {
|
|
42
42
|
packageName: "x-data-grid-pro",
|
|
@@ -98,6 +98,7 @@ DataGridProRaw.propTypes = {
|
|
|
98
98
|
*/
|
|
99
99
|
autosizeOptions: PropTypes.shape({
|
|
100
100
|
columns: PropTypes.arrayOf(PropTypes.string),
|
|
101
|
+
disableColumnVirtualization: PropTypes.bool,
|
|
101
102
|
expand: PropTypes.bool,
|
|
102
103
|
includeHeaders: PropTypes.bool,
|
|
103
104
|
includeOutliers: PropTypes.bool,
|
|
@@ -415,6 +416,7 @@ DataGridProRaw.propTypes = {
|
|
|
415
416
|
* If `deselect`, it will deselect all the rows under it.
|
|
416
417
|
* Works only if `checkboxSelection` is enabled.
|
|
417
418
|
* @default "deselect"
|
|
419
|
+
* @deprecated `select` will be the default behavior from v8 onwards
|
|
418
420
|
*/
|
|
419
421
|
indeterminateCheckboxAction: PropTypes.oneOf(['deselect', 'select']),
|
|
420
422
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import composeClasses from '@mui/utils/composeClasses';
|
|
3
3
|
import { useGridLogger, useGridApiEventHandler, getDataGridUtilityClass, useGridSelector, gridSortModelSelector, gridRowMaximumTreeDepthSelector, useGridApiOptionHandler } from '@mui/x-data-grid';
|
|
4
|
-
import { gridEditRowsStateSelector } from '@mui/x-data-grid/internals';
|
|
4
|
+
import { gridEditRowsStateSelector, gridSortedRowIndexLookupSelector } from '@mui/x-data-grid/internals';
|
|
5
5
|
import { GRID_REORDER_COL_DEF } from "./gridRowReorderColDef.js";
|
|
6
6
|
var Direction = /*#__PURE__*/function (Direction) {
|
|
7
7
|
Direction[Direction["UP"] = 0] = "UP";
|
|
@@ -39,6 +39,7 @@ export const useGridRowReorder = (apiRef, props) => {
|
|
|
39
39
|
};
|
|
40
40
|
const classes = useUtilityClasses(ownerState);
|
|
41
41
|
const [dragRowId, setDragRowId] = React.useState('');
|
|
42
|
+
const sortedRowIndexLookup = useGridSelector(apiRef, gridSortedRowIndexLookupSelector);
|
|
42
43
|
React.useEffect(() => {
|
|
43
44
|
return () => {
|
|
44
45
|
clearTimeout(removeDnDStylesTimeout.current);
|
|
@@ -66,9 +67,9 @@ export const useGridRowReorder = (apiRef, props) => {
|
|
|
66
67
|
removeDnDStylesTimeout.current = setTimeout(() => {
|
|
67
68
|
dragRowNode.current.classList.remove(classes.rowDragging);
|
|
68
69
|
});
|
|
69
|
-
originRowIndex.current =
|
|
70
|
+
originRowIndex.current = sortedRowIndexLookup[params.id];
|
|
70
71
|
apiRef.current.setCellFocus(params.id, GRID_REORDER_COL_DEF.field);
|
|
71
|
-
}, [isRowReorderDisabled, classes.rowDragging,
|
|
72
|
+
}, [apiRef, isRowReorderDisabled, logger, classes.rowDragging, sortedRowIndexLookup]);
|
|
72
73
|
const handleDragOver = React.useCallback((params, event) => {
|
|
73
74
|
if (dragRowId === '') {
|
|
74
75
|
return;
|
|
@@ -84,7 +85,7 @@ export const useGridRowReorder = (apiRef, props) => {
|
|
|
84
85
|
event.stopPropagation();
|
|
85
86
|
const mouseMovementDiff = previousMousePosition ? previousMousePosition.y - event.clientY : event.clientY;
|
|
86
87
|
if (params.id !== dragRowId) {
|
|
87
|
-
const targetRowIndex =
|
|
88
|
+
const targetRowIndex = sortedRowIndexLookup[params.id];
|
|
88
89
|
const dragDirection = mouseMovementDiff > 0 ? Direction.DOWN : Direction.UP;
|
|
89
90
|
const currentReorderState = {
|
|
90
91
|
dragDirection,
|
|
@@ -100,7 +101,7 @@ export const useGridRowReorder = (apiRef, props) => {
|
|
|
100
101
|
x: event.clientX,
|
|
101
102
|
y: event.clientY
|
|
102
103
|
};
|
|
103
|
-
}, [apiRef, logger,
|
|
104
|
+
}, [dragRowId, apiRef, logger, sortedRowIndexLookup]);
|
|
104
105
|
const handleDragEnd = React.useCallback((params, event) => {
|
|
105
106
|
// Call the gridEditRowsStateSelector directly to avoid infnite loop
|
|
106
107
|
const editRowsState = gridEditRowsStateSelector(apiRef.current.state);
|
|
@@ -125,13 +126,13 @@ export const useGridRowReorder = (apiRef, props) => {
|
|
|
125
126
|
// Emit the rowOrderChange event only once when the reordering stops.
|
|
126
127
|
const rowOrderChangeParams = {
|
|
127
128
|
row: apiRef.current.getRow(dragRowId),
|
|
128
|
-
targetIndex:
|
|
129
|
+
targetIndex: sortedRowIndexLookup[params.id],
|
|
129
130
|
oldIndex: originRowIndex.current
|
|
130
131
|
};
|
|
131
132
|
apiRef.current.publishEvent('rowOrderChange', rowOrderChangeParams);
|
|
132
133
|
}
|
|
133
134
|
setDragRowId('');
|
|
134
|
-
}, [isRowReorderDisabled, logger,
|
|
135
|
+
}, [apiRef, dragRowId, isRowReorderDisabled, logger, sortedRowIndexLookup]);
|
|
135
136
|
useGridApiEventHandler(apiRef, 'rowDragStart', handleDragStart);
|
|
136
137
|
useGridApiEventHandler(apiRef, 'rowDragOver', handleDragOver);
|
|
137
138
|
useGridApiEventHandler(apiRef, 'rowDragEnd', handleDragEnd);
|
package/modern/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTczNDU2NjQwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-pro",
|
|
3
|
-
"version": "7.23.
|
|
3
|
+
"version": "7.23.3",
|
|
4
4
|
"description": "The Pro plan edition of the Data Grid components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"prop-types": "^15.8.1",
|
|
41
41
|
"reselect": "^5.1.1",
|
|
42
42
|
"@mui/x-internals": "7.23.0",
|
|
43
|
-
"@mui/x-
|
|
44
|
-
"@mui/x-
|
|
43
|
+
"@mui/x-data-grid": "7.23.3",
|
|
44
|
+
"@mui/x-license": "7.23.2"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@emotion/react": "^11.9.0",
|
package/utils/releaseInfo.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getReleaseInfo = void 0;
|
|
7
7
|
var _utils = require("@mui/utils");
|
|
8
8
|
const getReleaseInfo = () => {
|
|
9
|
-
const releaseInfo = "
|
|
9
|
+
const releaseInfo = "MTczNDU2NjQwMDAwMA==";
|
|
10
10
|
if (process.env.NODE_ENV !== 'production') {
|
|
11
11
|
// A simple hack to set the value in the test environment (has no build step).
|
|
12
12
|
// eslint-disable-next-line no-useless-concat
|