@mui/x-data-grid-pro 7.24.1 → 7.25.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 +77 -0
- package/components/GridDetailPanelToggleCell.js +10 -1
- package/esm/components/GridDetailPanelToggleCell.js +11 -2
- package/esm/hooks/features/columnPinning/useGridColumnPinning.js +1 -1
- package/esm/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +2 -9
- package/esm/hooks/features/dataSource/cache.js +1 -1
- package/esm/hooks/features/dataSource/useGridDataSource.js +6 -4
- package/esm/hooks/features/index.js +1 -1
- package/esm/utils/releaseInfo.js +1 -1
- package/hooks/features/columnPinning/useGridColumnPinning.js +1 -1
- package/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +1 -8
- package/hooks/features/dataSource/cache.d.ts +1 -0
- package/hooks/features/dataSource/cache.js +1 -0
- package/hooks/features/dataSource/useGridDataSource.js +8 -6
- package/hooks/features/index.d.ts +1 -1
- package/hooks/features/index.js +17 -11
- package/hooks/utils/useGridApiRef.d.ts +3 -1
- package/index.js +1 -1
- package/modern/components/GridDetailPanelToggleCell.js +11 -2
- package/modern/hooks/features/columnPinning/useGridColumnPinning.js +1 -1
- package/modern/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +2 -9
- package/modern/hooks/features/dataSource/cache.js +1 -1
- package/modern/hooks/features/dataSource/useGridDataSource.js +6 -4
- package/modern/hooks/features/index.js +1 -1
- package/modern/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/package.json +4 -4
- package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,83 @@
|
|
|
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.25.0
|
|
7
|
+
|
|
8
|
+
_Jan 31, 2025_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 5 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🐞 Bugfixes
|
|
13
|
+
|
|
14
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
15
|
+
@k-rajat19, @lauri865.
|
|
16
|
+
Following are all team members who have contributed to this release:
|
|
17
|
+
@KenanYusuf, @MBilalShafi, @arminmeh.
|
|
18
|
+
|
|
19
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
20
|
+
|
|
21
|
+
### Data Grid
|
|
22
|
+
|
|
23
|
+
#### `@mui/x-data-grid@7.25.0`
|
|
24
|
+
|
|
25
|
+
- [DataGrid] Fix `renderContext` calculation with scroll bounce / over-scroll (#16368) @lauri865
|
|
26
|
+
- [DataGrid] Refactor row state propagation (#16351) @lauri865
|
|
27
|
+
- [DataGrid] Add missing style overrides (#16272) (#16358) @KenanYusuf
|
|
28
|
+
- [DataGrid] Fix header filters keyboard navigation when there are no rows (#16369) @k-rajat19
|
|
29
|
+
- [DataGrid] Fix order of `onClick` prop on toolbar buttons (#16364) @KenanYusuf
|
|
30
|
+
- [DataGrid] Improve test coverage of server side data source (#15988) @MBilalShafi
|
|
31
|
+
- [DataGrid] Remove outdated warning (#16370) @MBilalShafi
|
|
32
|
+
- [DataGrid] Respect width of `iconContainer` during autosizing (#16409) @michelengelen
|
|
33
|
+
|
|
34
|
+
#### `@mui/x-data-grid-pro@7.25.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
35
|
+
|
|
36
|
+
Same changes as in `@mui/x-data-grid@7.25.0`, plus:
|
|
37
|
+
|
|
38
|
+
- [DataGridPro] Fix the return type of `useGridApiRef` for Pro and Premium packages on React < 19 (#16348) @arminmeh
|
|
39
|
+
- [DataGridPro] Fetch new rows only once when multiple models are changed in one cycle (#16382) @arminmeh
|
|
40
|
+
|
|
41
|
+
#### `@mui/x-data-grid-premium@7.25.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
42
|
+
|
|
43
|
+
Same changes as in `@mui/x-data-grid-pro@7.25.0`.
|
|
44
|
+
|
|
45
|
+
### Date and Time Pickers
|
|
46
|
+
|
|
47
|
+
#### `@mui/x-date-pickers@7.25.0`
|
|
48
|
+
|
|
49
|
+
Internal changes.
|
|
50
|
+
|
|
51
|
+
#### `@mui/x-date-pickers-pro@7.25.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
52
|
+
|
|
53
|
+
Same changes as in `@mui/x-date-pickers@7.25.0`.
|
|
54
|
+
|
|
55
|
+
### Charts
|
|
56
|
+
|
|
57
|
+
#### `@mui/x-charts@7.25.0`
|
|
58
|
+
|
|
59
|
+
Internal changes.
|
|
60
|
+
|
|
61
|
+
#### `@mui/x-charts-pro@7.25.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
62
|
+
|
|
63
|
+
Same changes as in `@mui/x-charts@7.25.0`.
|
|
64
|
+
|
|
65
|
+
### Tree View
|
|
66
|
+
|
|
67
|
+
#### `@mui/x-tree-view@7.25.0`
|
|
68
|
+
|
|
69
|
+
Internal changes.
|
|
70
|
+
|
|
71
|
+
#### `@mui/x-tree-view-pro@7.25.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
72
|
+
|
|
73
|
+
Same changes as in `@mui/x-tree-view@7.25.0`.
|
|
74
|
+
|
|
75
|
+
### Docs
|
|
76
|
+
|
|
77
|
+
- [docs] Improve release documentation (#16322) @MBilalShafi
|
|
78
|
+
|
|
79
|
+
### Core
|
|
80
|
+
|
|
81
|
+
- [test] Fix flaky data source tests in DataGrid (#16382) @lauri865
|
|
82
|
+
|
|
6
83
|
## 7.24.1
|
|
7
84
|
|
|
8
85
|
_Jan 24, 2025_
|
|
@@ -11,6 +11,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
13
13
|
var _xDataGrid = require("@mui/x-data-grid");
|
|
14
|
+
var _internals = require("@mui/x-data-grid/internals");
|
|
14
15
|
var _useGridRootProps = require("../hooks/utils/useGridRootProps");
|
|
15
16
|
var _useGridApiContext = require("../hooks/utils/useGridApiContext");
|
|
16
17
|
var _gridDetailPanelSelector = require("../hooks/features/detailPanel/gridDetailPanelSelector");
|
|
@@ -25,11 +26,19 @@ const useUtilityClasses = ownerState => {
|
|
|
25
26
|
};
|
|
26
27
|
return (0, _composeClasses.default)(slots, _xDataGrid.getDataGridUtilityClass, classes);
|
|
27
28
|
};
|
|
29
|
+
const isExpandedSelector = (0, _internals.createSelectorV8)(_gridDetailPanelSelector.gridDetailPanelExpandedRowIdsSelector, (expandedRowIds, rowId) => {
|
|
30
|
+
return expandedRowIds.includes(rowId);
|
|
31
|
+
});
|
|
28
32
|
function GridDetailPanelToggleCell(props) {
|
|
29
33
|
const {
|
|
30
34
|
id,
|
|
31
|
-
|
|
35
|
+
row,
|
|
36
|
+
api
|
|
32
37
|
} = props;
|
|
38
|
+
const rowId = api.getRowId(row);
|
|
39
|
+
const isExpanded = (0, _internals.useGridSelectorV8)({
|
|
40
|
+
current: api
|
|
41
|
+
}, isExpandedSelector, rowId);
|
|
33
42
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
34
43
|
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
35
44
|
const ownerState = {
|
|
@@ -3,9 +3,10 @@ import * as React from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import composeClasses from '@mui/utils/composeClasses';
|
|
5
5
|
import { getDataGridUtilityClass, useGridSelector } from '@mui/x-data-grid';
|
|
6
|
+
import { createSelectorV8, useGridSelectorV8 } from '@mui/x-data-grid/internals';
|
|
6
7
|
import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
|
|
7
8
|
import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
|
|
8
|
-
import { gridDetailPanelExpandedRowsContentCacheSelector } from "../hooks/features/detailPanel/gridDetailPanelSelector.js";
|
|
9
|
+
import { gridDetailPanelExpandedRowIdsSelector, gridDetailPanelExpandedRowsContentCacheSelector } from "../hooks/features/detailPanel/gridDetailPanelSelector.js";
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
11
|
const useUtilityClasses = ownerState => {
|
|
11
12
|
const {
|
|
@@ -17,11 +18,19 @@ const useUtilityClasses = ownerState => {
|
|
|
17
18
|
};
|
|
18
19
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
19
20
|
};
|
|
21
|
+
const isExpandedSelector = createSelectorV8(gridDetailPanelExpandedRowIdsSelector, (expandedRowIds, rowId) => {
|
|
22
|
+
return expandedRowIds.includes(rowId);
|
|
23
|
+
});
|
|
20
24
|
function GridDetailPanelToggleCell(props) {
|
|
21
25
|
const {
|
|
22
26
|
id,
|
|
23
|
-
|
|
27
|
+
row,
|
|
28
|
+
api
|
|
24
29
|
} = props;
|
|
30
|
+
const rowId = api.getRowId(row);
|
|
31
|
+
const isExpanded = useGridSelectorV8({
|
|
32
|
+
current: api
|
|
33
|
+
}, isExpandedSelector, rowId);
|
|
25
34
|
const rootProps = useGridRootProps();
|
|
26
35
|
const apiRef = useGridApiContext();
|
|
27
36
|
const ownerState = {
|
|
@@ -140,7 +140,7 @@ export const useGridColumnPinning = (apiRef, props) => {
|
|
|
140
140
|
}, [apiRef]);
|
|
141
141
|
const setPinnedColumns = React.useCallback(newPinnedColumns => {
|
|
142
142
|
setState(apiRef, newPinnedColumns);
|
|
143
|
-
apiRef.current.
|
|
143
|
+
apiRef.current.requestPipeProcessorsApplication('hydrateColumns');
|
|
144
144
|
}, [apiRef]);
|
|
145
145
|
const isColumnPinned = React.useCallback(field => {
|
|
146
146
|
const leftPinnedColumns = pinnedColumns.left || [];
|
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { useGridRegisterPipeProcessor, gridVisiblePinnedColumnDefinitionsSelector } from '@mui/x-data-grid/internals';
|
|
4
4
|
export const useGridColumnPinningPreProcessors = (apiRef, props) => {
|
|
5
5
|
const {
|
|
6
6
|
disableColumnPinning
|
|
7
7
|
} = props;
|
|
8
|
-
let pinnedColumns;
|
|
9
|
-
if (apiRef.current.state.columns) {
|
|
10
|
-
pinnedColumns = gridPinnedColumnsSelector(apiRef.current.state);
|
|
11
|
-
} else {
|
|
12
|
-
pinnedColumns = null;
|
|
13
|
-
}
|
|
14
8
|
const prevAllPinnedColumns = React.useRef([]);
|
|
15
9
|
const reorderPinnedColumns = React.useCallback(columnsState => {
|
|
16
|
-
eslintUseValue(pinnedColumns);
|
|
17
10
|
if (columnsState.orderedFields.length === 0 || disableColumnPinning) {
|
|
18
11
|
return columnsState;
|
|
19
12
|
}
|
|
@@ -105,7 +98,7 @@ export const useGridColumnPinningPreProcessors = (apiRef, props) => {
|
|
|
105
98
|
return _extends({}, columnsState, {
|
|
106
99
|
orderedFields: [...leftPinnedColumns, ...centerColumns, ...rightPinnedColumns]
|
|
107
100
|
});
|
|
108
|
-
}, [apiRef, disableColumnPinning
|
|
101
|
+
}, [apiRef, disableColumnPinning]);
|
|
109
102
|
useGridRegisterPipeProcessor(apiRef, 'hydrateColumns', reorderPinnedColumns);
|
|
110
103
|
const isColumnPinned = React.useCallback((initialValue, field) => apiRef.current.isColumnPinned(field), [apiRef]);
|
|
111
104
|
useGridRegisterPipeProcessor(apiRef, 'isColumnPinned', isColumnPinned);
|
|
@@ -3,8 +3,9 @@ import * as React from 'react';
|
|
|
3
3
|
import useLazyRef from '@mui/utils/useLazyRef';
|
|
4
4
|
import { useGridApiEventHandler, gridRowsLoadingSelector, useGridApiMethod, useGridSelector } from '@mui/x-data-grid';
|
|
5
5
|
import { gridRowGroupsToFetchSelector } from '@mui/x-data-grid/internals';
|
|
6
|
+
import { unstable_debounce as debounce } from '@mui/utils';
|
|
6
7
|
import { gridGetRowsParamsSelector, gridDataSourceErrorsSelector } from "./gridDataSourceSelector.js";
|
|
7
|
-
import {
|
|
8
|
+
import { NestedDataManager, RequestStatus, runIfServerMode } from "./utils.js";
|
|
8
9
|
import { GridDataSourceCacheDefault } from "./cache.js";
|
|
9
10
|
const INITIAL_STATE = {
|
|
10
11
|
loading: {},
|
|
@@ -177,6 +178,7 @@ export const useGridDataSource = (apiRef, props) => {
|
|
|
177
178
|
});
|
|
178
179
|
});
|
|
179
180
|
}, [apiRef]);
|
|
181
|
+
const debouncedFetchRows = React.useMemo(() => debounce(fetchRows, 0), [fetchRows]);
|
|
180
182
|
const dataSourceApi = {
|
|
181
183
|
unstable_dataSource: {
|
|
182
184
|
setChildrenLoading,
|
|
@@ -191,9 +193,9 @@ export const useGridDataSource = (apiRef, props) => {
|
|
|
191
193
|
};
|
|
192
194
|
useGridApiMethod(apiRef, dataSourceApi, 'public');
|
|
193
195
|
useGridApiMethod(apiRef, dataSourcePrivateApi, 'private');
|
|
194
|
-
useGridApiEventHandler(apiRef, 'sortModelChange', runIfServerMode(props.sortingMode,
|
|
195
|
-
useGridApiEventHandler(apiRef, 'filterModelChange', runIfServerMode(props.filterMode,
|
|
196
|
-
useGridApiEventHandler(apiRef, 'paginationModelChange', runIfServerMode(props.paginationMode,
|
|
196
|
+
useGridApiEventHandler(apiRef, 'sortModelChange', runIfServerMode(props.sortingMode, debouncedFetchRows));
|
|
197
|
+
useGridApiEventHandler(apiRef, 'filterModelChange', runIfServerMode(props.filterMode, debouncedFetchRows));
|
|
198
|
+
useGridApiEventHandler(apiRef, 'paginationModelChange', runIfServerMode(props.paginationMode, debouncedFetchRows));
|
|
197
199
|
const isFirstRender = React.useRef(true);
|
|
198
200
|
React.useEffect(() => {
|
|
199
201
|
if (isFirstRender.current) {
|
|
@@ -6,4 +6,4 @@ export * from "./treeData/index.js";
|
|
|
6
6
|
export * from "./detailPanel/index.js";
|
|
7
7
|
export * from "./rowPinning/index.js";
|
|
8
8
|
export * from "./dataSource/interfaces.js";
|
|
9
|
-
export
|
|
9
|
+
export { GridDataSourceCacheDefault } from "./dataSource/cache.js";
|
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 = "MTczODI5OTYwMDAwMA==";
|
|
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
|
|
@@ -149,7 +149,7 @@ const useGridColumnPinning = (apiRef, props) => {
|
|
|
149
149
|
}, [apiRef]);
|
|
150
150
|
const setPinnedColumns = React.useCallback(newPinnedColumns => {
|
|
151
151
|
setState(apiRef, newPinnedColumns);
|
|
152
|
-
apiRef.current.
|
|
152
|
+
apiRef.current.requestPipeProcessorsApplication('hydrateColumns');
|
|
153
153
|
}, [apiRef]);
|
|
154
154
|
const isColumnPinned = React.useCallback(field => {
|
|
155
155
|
const leftPinnedColumns = pinnedColumns.left || [];
|
|
@@ -13,15 +13,8 @@ const useGridColumnPinningPreProcessors = (apiRef, props) => {
|
|
|
13
13
|
const {
|
|
14
14
|
disableColumnPinning
|
|
15
15
|
} = props;
|
|
16
|
-
let pinnedColumns;
|
|
17
|
-
if (apiRef.current.state.columns) {
|
|
18
|
-
pinnedColumns = (0, _internals.gridPinnedColumnsSelector)(apiRef.current.state);
|
|
19
|
-
} else {
|
|
20
|
-
pinnedColumns = null;
|
|
21
|
-
}
|
|
22
16
|
const prevAllPinnedColumns = React.useRef([]);
|
|
23
17
|
const reorderPinnedColumns = React.useCallback(columnsState => {
|
|
24
|
-
(0, _internals.eslintUseValue)(pinnedColumns);
|
|
25
18
|
if (columnsState.orderedFields.length === 0 || disableColumnPinning) {
|
|
26
19
|
return columnsState;
|
|
27
20
|
}
|
|
@@ -113,7 +106,7 @@ const useGridColumnPinningPreProcessors = (apiRef, props) => {
|
|
|
113
106
|
return (0, _extends2.default)({}, columnsState, {
|
|
114
107
|
orderedFields: [...leftPinnedColumns, ...centerColumns, ...rightPinnedColumns]
|
|
115
108
|
});
|
|
116
|
-
}, [apiRef, disableColumnPinning
|
|
109
|
+
}, [apiRef, disableColumnPinning]);
|
|
117
110
|
(0, _internals.useGridRegisterPipeProcessor)(apiRef, 'hydrateColumns', reorderPinnedColumns);
|
|
118
111
|
const isColumnPinned = React.useCallback((initialValue, field) => apiRef.current.isColumnPinned(field), [apiRef]);
|
|
119
112
|
(0, _internals.useGridRegisterPipeProcessor)(apiRef, 'isColumnPinned', isColumnPinned);
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.GridDataSourceCacheDefault = void 0;
|
|
7
|
+
exports.getKey = getKey;
|
|
7
8
|
function getKey(params) {
|
|
8
9
|
return JSON.stringify([params.paginationModel, params.filterModel, params.sortModel, params.groupKeys, params.groupFields]);
|
|
9
10
|
}
|
|
@@ -11,8 +11,9 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var _useLazyRef = _interopRequireDefault(require("@mui/utils/useLazyRef"));
|
|
12
12
|
var _xDataGrid = require("@mui/x-data-grid");
|
|
13
13
|
var _internals = require("@mui/x-data-grid/internals");
|
|
14
|
+
var _utils = require("@mui/utils");
|
|
14
15
|
var _gridDataSourceSelector = require("./gridDataSourceSelector");
|
|
15
|
-
var
|
|
16
|
+
var _utils2 = require("./utils");
|
|
16
17
|
var _cache = require("./cache");
|
|
17
18
|
const INITIAL_STATE = {
|
|
18
19
|
loading: {},
|
|
@@ -36,7 +37,7 @@ const dataSourceStateInitializer = state => {
|
|
|
36
37
|
};
|
|
37
38
|
exports.dataSourceStateInitializer = dataSourceStateInitializer;
|
|
38
39
|
const useGridDataSource = (apiRef, props) => {
|
|
39
|
-
const nestedDataManager = (0, _useLazyRef.default)(() => new
|
|
40
|
+
const nestedDataManager = (0, _useLazyRef.default)(() => new _utils2.NestedDataManager(apiRef)).current;
|
|
40
41
|
const groupsToAutoFetch = (0, _xDataGrid.useGridSelector)(apiRef, _internals.gridRowGroupsToFetchSelector);
|
|
41
42
|
const scheduledGroups = React.useRef(0);
|
|
42
43
|
const onError = props.unstable_onDataSourceError;
|
|
@@ -126,7 +127,7 @@ const useGridDataSource = (apiRef, props) => {
|
|
|
126
127
|
nestedDataManager.clearPendingRequest(id);
|
|
127
128
|
return;
|
|
128
129
|
}
|
|
129
|
-
if (nestedDataManager.getRequestStatus(id) ===
|
|
130
|
+
if (nestedDataManager.getRequestStatus(id) === _utils2.RequestStatus.UNKNOWN) {
|
|
130
131
|
apiRef.current.unstable_dataSource.setChildrenLoading(id, false);
|
|
131
132
|
return;
|
|
132
133
|
}
|
|
@@ -186,6 +187,7 @@ const useGridDataSource = (apiRef, props) => {
|
|
|
186
187
|
});
|
|
187
188
|
});
|
|
188
189
|
}, [apiRef]);
|
|
190
|
+
const debouncedFetchRows = React.useMemo(() => (0, _utils.unstable_debounce)(fetchRows, 0), [fetchRows]);
|
|
189
191
|
const dataSourceApi = {
|
|
190
192
|
unstable_dataSource: {
|
|
191
193
|
setChildrenLoading,
|
|
@@ -200,9 +202,9 @@ const useGridDataSource = (apiRef, props) => {
|
|
|
200
202
|
};
|
|
201
203
|
(0, _xDataGrid.useGridApiMethod)(apiRef, dataSourceApi, 'public');
|
|
202
204
|
(0, _xDataGrid.useGridApiMethod)(apiRef, dataSourcePrivateApi, 'private');
|
|
203
|
-
(0, _xDataGrid.useGridApiEventHandler)(apiRef, 'sortModelChange', (0,
|
|
204
|
-
(0, _xDataGrid.useGridApiEventHandler)(apiRef, 'filterModelChange', (0,
|
|
205
|
-
(0, _xDataGrid.useGridApiEventHandler)(apiRef, 'paginationModelChange', (0,
|
|
205
|
+
(0, _xDataGrid.useGridApiEventHandler)(apiRef, 'sortModelChange', (0, _utils2.runIfServerMode)(props.sortingMode, debouncedFetchRows));
|
|
206
|
+
(0, _xDataGrid.useGridApiEventHandler)(apiRef, 'filterModelChange', (0, _utils2.runIfServerMode)(props.filterMode, debouncedFetchRows));
|
|
207
|
+
(0, _xDataGrid.useGridApiEventHandler)(apiRef, 'paginationModelChange', (0, _utils2.runIfServerMode)(props.paginationMode, debouncedFetchRows));
|
|
206
208
|
const isFirstRender = React.useRef(true);
|
|
207
209
|
React.useEffect(() => {
|
|
208
210
|
if (isFirstRender.current) {
|
package/hooks/features/index.js
CHANGED
|
@@ -3,9 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
GridDataSourceCacheDefault: true
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "GridDataSourceCacheDefault", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return _cache.GridDataSourceCacheDefault;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
6
15
|
var _columnPinning = require("./columnPinning");
|
|
7
16
|
Object.keys(_columnPinning).forEach(function (key) {
|
|
8
17
|
if (key === "default" || key === "__esModule") return;
|
|
18
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
9
19
|
if (key in exports && exports[key] === _columnPinning[key]) return;
|
|
10
20
|
Object.defineProperty(exports, key, {
|
|
11
21
|
enumerable: true,
|
|
@@ -17,6 +27,7 @@ Object.keys(_columnPinning).forEach(function (key) {
|
|
|
17
27
|
var _columnReorder = require("./columnReorder");
|
|
18
28
|
Object.keys(_columnReorder).forEach(function (key) {
|
|
19
29
|
if (key === "default" || key === "__esModule") return;
|
|
30
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
20
31
|
if (key in exports && exports[key] === _columnReorder[key]) return;
|
|
21
32
|
Object.defineProperty(exports, key, {
|
|
22
33
|
enumerable: true,
|
|
@@ -28,6 +39,7 @@ Object.keys(_columnReorder).forEach(function (key) {
|
|
|
28
39
|
var _rowReorder = require("./rowReorder");
|
|
29
40
|
Object.keys(_rowReorder).forEach(function (key) {
|
|
30
41
|
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
31
43
|
if (key in exports && exports[key] === _rowReorder[key]) return;
|
|
32
44
|
Object.defineProperty(exports, key, {
|
|
33
45
|
enumerable: true,
|
|
@@ -39,6 +51,7 @@ Object.keys(_rowReorder).forEach(function (key) {
|
|
|
39
51
|
var _treeData = require("./treeData");
|
|
40
52
|
Object.keys(_treeData).forEach(function (key) {
|
|
41
53
|
if (key === "default" || key === "__esModule") return;
|
|
54
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
42
55
|
if (key in exports && exports[key] === _treeData[key]) return;
|
|
43
56
|
Object.defineProperty(exports, key, {
|
|
44
57
|
enumerable: true,
|
|
@@ -50,6 +63,7 @@ Object.keys(_treeData).forEach(function (key) {
|
|
|
50
63
|
var _detailPanel = require("./detailPanel");
|
|
51
64
|
Object.keys(_detailPanel).forEach(function (key) {
|
|
52
65
|
if (key === "default" || key === "__esModule") return;
|
|
66
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
53
67
|
if (key in exports && exports[key] === _detailPanel[key]) return;
|
|
54
68
|
Object.defineProperty(exports, key, {
|
|
55
69
|
enumerable: true,
|
|
@@ -61,6 +75,7 @@ Object.keys(_detailPanel).forEach(function (key) {
|
|
|
61
75
|
var _rowPinning = require("./rowPinning");
|
|
62
76
|
Object.keys(_rowPinning).forEach(function (key) {
|
|
63
77
|
if (key === "default" || key === "__esModule") return;
|
|
78
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
64
79
|
if (key in exports && exports[key] === _rowPinning[key]) return;
|
|
65
80
|
Object.defineProperty(exports, key, {
|
|
66
81
|
enumerable: true,
|
|
@@ -72,6 +87,7 @@ Object.keys(_rowPinning).forEach(function (key) {
|
|
|
72
87
|
var _interfaces = require("./dataSource/interfaces");
|
|
73
88
|
Object.keys(_interfaces).forEach(function (key) {
|
|
74
89
|
if (key === "default" || key === "__esModule") return;
|
|
90
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
75
91
|
if (key in exports && exports[key] === _interfaces[key]) return;
|
|
76
92
|
Object.defineProperty(exports, key, {
|
|
77
93
|
enumerable: true,
|
|
@@ -80,14 +96,4 @@ Object.keys(_interfaces).forEach(function (key) {
|
|
|
80
96
|
}
|
|
81
97
|
});
|
|
82
98
|
});
|
|
83
|
-
var _cache = require("./dataSource/cache");
|
|
84
|
-
Object.keys(_cache).forEach(function (key) {
|
|
85
|
-
if (key === "default" || key === "__esModule") return;
|
|
86
|
-
if (key in exports && exports[key] === _cache[key]) return;
|
|
87
|
-
Object.defineProperty(exports, key, {
|
|
88
|
-
enumerable: true,
|
|
89
|
-
get: function () {
|
|
90
|
-
return _cache[key];
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
});
|
|
99
|
+
var _cache = require("./dataSource/cache");
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
+
import { GridApiCommon } from '@mui/x-data-grid';
|
|
1
3
|
import { GridApiPro } from '../../models/gridApiPro';
|
|
2
|
-
export declare const useGridApiRef: () =>
|
|
4
|
+
export declare const useGridApiRef: <Api extends GridApiCommon = GridApiPro>() => RefObject<Api>;
|
package/index.js
CHANGED
|
@@ -3,9 +3,10 @@ import * as React from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import composeClasses from '@mui/utils/composeClasses';
|
|
5
5
|
import { getDataGridUtilityClass, useGridSelector } from '@mui/x-data-grid';
|
|
6
|
+
import { createSelectorV8, useGridSelectorV8 } from '@mui/x-data-grid/internals';
|
|
6
7
|
import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
|
|
7
8
|
import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
|
|
8
|
-
import { gridDetailPanelExpandedRowsContentCacheSelector } from "../hooks/features/detailPanel/gridDetailPanelSelector.js";
|
|
9
|
+
import { gridDetailPanelExpandedRowIdsSelector, gridDetailPanelExpandedRowsContentCacheSelector } from "../hooks/features/detailPanel/gridDetailPanelSelector.js";
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
11
|
const useUtilityClasses = ownerState => {
|
|
11
12
|
const {
|
|
@@ -17,11 +18,19 @@ const useUtilityClasses = ownerState => {
|
|
|
17
18
|
};
|
|
18
19
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
19
20
|
};
|
|
21
|
+
const isExpandedSelector = createSelectorV8(gridDetailPanelExpandedRowIdsSelector, (expandedRowIds, rowId) => {
|
|
22
|
+
return expandedRowIds.includes(rowId);
|
|
23
|
+
});
|
|
20
24
|
function GridDetailPanelToggleCell(props) {
|
|
21
25
|
const {
|
|
22
26
|
id,
|
|
23
|
-
|
|
27
|
+
row,
|
|
28
|
+
api
|
|
24
29
|
} = props;
|
|
30
|
+
const rowId = api.getRowId(row);
|
|
31
|
+
const isExpanded = useGridSelectorV8({
|
|
32
|
+
current: api
|
|
33
|
+
}, isExpandedSelector, rowId);
|
|
25
34
|
const rootProps = useGridRootProps();
|
|
26
35
|
const apiRef = useGridApiContext();
|
|
27
36
|
const ownerState = {
|
|
@@ -140,7 +140,7 @@ export const useGridColumnPinning = (apiRef, props) => {
|
|
|
140
140
|
}, [apiRef]);
|
|
141
141
|
const setPinnedColumns = React.useCallback(newPinnedColumns => {
|
|
142
142
|
setState(apiRef, newPinnedColumns);
|
|
143
|
-
apiRef.current.
|
|
143
|
+
apiRef.current.requestPipeProcessorsApplication('hydrateColumns');
|
|
144
144
|
}, [apiRef]);
|
|
145
145
|
const isColumnPinned = React.useCallback(field => {
|
|
146
146
|
const leftPinnedColumns = pinnedColumns.left || [];
|
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { useGridRegisterPipeProcessor, gridVisiblePinnedColumnDefinitionsSelector } from '@mui/x-data-grid/internals';
|
|
4
4
|
export const useGridColumnPinningPreProcessors = (apiRef, props) => {
|
|
5
5
|
const {
|
|
6
6
|
disableColumnPinning
|
|
7
7
|
} = props;
|
|
8
|
-
let pinnedColumns;
|
|
9
|
-
if (apiRef.current.state.columns) {
|
|
10
|
-
pinnedColumns = gridPinnedColumnsSelector(apiRef.current.state);
|
|
11
|
-
} else {
|
|
12
|
-
pinnedColumns = null;
|
|
13
|
-
}
|
|
14
8
|
const prevAllPinnedColumns = React.useRef([]);
|
|
15
9
|
const reorderPinnedColumns = React.useCallback(columnsState => {
|
|
16
|
-
eslintUseValue(pinnedColumns);
|
|
17
10
|
if (columnsState.orderedFields.length === 0 || disableColumnPinning) {
|
|
18
11
|
return columnsState;
|
|
19
12
|
}
|
|
@@ -105,7 +98,7 @@ export const useGridColumnPinningPreProcessors = (apiRef, props) => {
|
|
|
105
98
|
return _extends({}, columnsState, {
|
|
106
99
|
orderedFields: [...leftPinnedColumns, ...centerColumns, ...rightPinnedColumns]
|
|
107
100
|
});
|
|
108
|
-
}, [apiRef, disableColumnPinning
|
|
101
|
+
}, [apiRef, disableColumnPinning]);
|
|
109
102
|
useGridRegisterPipeProcessor(apiRef, 'hydrateColumns', reorderPinnedColumns);
|
|
110
103
|
const isColumnPinned = React.useCallback((initialValue, field) => apiRef.current.isColumnPinned(field), [apiRef]);
|
|
111
104
|
useGridRegisterPipeProcessor(apiRef, 'isColumnPinned', isColumnPinned);
|
|
@@ -3,8 +3,9 @@ import * as React from 'react';
|
|
|
3
3
|
import useLazyRef from '@mui/utils/useLazyRef';
|
|
4
4
|
import { useGridApiEventHandler, gridRowsLoadingSelector, useGridApiMethod, useGridSelector } from '@mui/x-data-grid';
|
|
5
5
|
import { gridRowGroupsToFetchSelector } from '@mui/x-data-grid/internals';
|
|
6
|
+
import { unstable_debounce as debounce } from '@mui/utils';
|
|
6
7
|
import { gridGetRowsParamsSelector, gridDataSourceErrorsSelector } from "./gridDataSourceSelector.js";
|
|
7
|
-
import {
|
|
8
|
+
import { NestedDataManager, RequestStatus, runIfServerMode } from "./utils.js";
|
|
8
9
|
import { GridDataSourceCacheDefault } from "./cache.js";
|
|
9
10
|
const INITIAL_STATE = {
|
|
10
11
|
loading: {},
|
|
@@ -177,6 +178,7 @@ export const useGridDataSource = (apiRef, props) => {
|
|
|
177
178
|
});
|
|
178
179
|
});
|
|
179
180
|
}, [apiRef]);
|
|
181
|
+
const debouncedFetchRows = React.useMemo(() => debounce(fetchRows, 0), [fetchRows]);
|
|
180
182
|
const dataSourceApi = {
|
|
181
183
|
unstable_dataSource: {
|
|
182
184
|
setChildrenLoading,
|
|
@@ -191,9 +193,9 @@ export const useGridDataSource = (apiRef, props) => {
|
|
|
191
193
|
};
|
|
192
194
|
useGridApiMethod(apiRef, dataSourceApi, 'public');
|
|
193
195
|
useGridApiMethod(apiRef, dataSourcePrivateApi, 'private');
|
|
194
|
-
useGridApiEventHandler(apiRef, 'sortModelChange', runIfServerMode(props.sortingMode,
|
|
195
|
-
useGridApiEventHandler(apiRef, 'filterModelChange', runIfServerMode(props.filterMode,
|
|
196
|
-
useGridApiEventHandler(apiRef, 'paginationModelChange', runIfServerMode(props.paginationMode,
|
|
196
|
+
useGridApiEventHandler(apiRef, 'sortModelChange', runIfServerMode(props.sortingMode, debouncedFetchRows));
|
|
197
|
+
useGridApiEventHandler(apiRef, 'filterModelChange', runIfServerMode(props.filterMode, debouncedFetchRows));
|
|
198
|
+
useGridApiEventHandler(apiRef, 'paginationModelChange', runIfServerMode(props.paginationMode, debouncedFetchRows));
|
|
197
199
|
const isFirstRender = React.useRef(true);
|
|
198
200
|
React.useEffect(() => {
|
|
199
201
|
if (isFirstRender.current) {
|
|
@@ -6,4 +6,4 @@ export * from "./treeData/index.js";
|
|
|
6
6
|
export * from "./detailPanel/index.js";
|
|
7
7
|
export * from "./rowPinning/index.js";
|
|
8
8
|
export * from "./dataSource/interfaces.js";
|
|
9
|
-
export
|
|
9
|
+
export { GridDataSourceCacheDefault } from "./dataSource/cache.js";
|
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 = "MTczODI5OTYwMDAwMA==";
|
|
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.
|
|
3
|
+
"version": "7.25.0",
|
|
4
4
|
"description": "The Pro plan edition of the Data Grid components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"clsx": "^2.1.1",
|
|
40
40
|
"prop-types": "^15.8.1",
|
|
41
41
|
"reselect": "^5.1.1",
|
|
42
|
-
"@mui/x-
|
|
43
|
-
"@mui/x-license": "7.
|
|
44
|
-
"@mui/x-
|
|
42
|
+
"@mui/x-data-grid": "7.25.0",
|
|
43
|
+
"@mui/x-license": "7.25.0",
|
|
44
|
+
"@mui/x-internals": "7.25.0"
|
|
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 = "MTczODI5OTYwMDAwMA==";
|
|
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
|