@mui/x-data-grid-pro 7.24.0 → 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 +148 -0
- package/DataGridPro/useDataGridProComponent.d.ts +2 -2
- 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.d.ts +2 -2
- package/hooks/features/columnPinning/useGridColumnPinning.js +1 -1
- package/hooks/features/columnPinning/useGridColumnPinningPreProcessors.d.ts +2 -2
- package/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +1 -8
- package/hooks/features/columnReorder/useGridColumnReorder.d.ts +2 -2
- package/hooks/features/dataSource/cache.d.ts +1 -0
- package/hooks/features/dataSource/cache.js +1 -0
- package/hooks/features/dataSource/useGridDataSource.d.ts +2 -2
- package/hooks/features/dataSource/useGridDataSource.js +8 -6
- package/hooks/features/dataSource/utils.d.ts +2 -1
- package/hooks/features/detailPanel/useGridDetailPanel.d.ts +2 -2
- package/hooks/features/detailPanel/useGridDetailPanelPreProcessors.d.ts +2 -2
- package/hooks/features/index.d.ts +1 -1
- package/hooks/features/index.js +17 -11
- package/hooks/features/infiniteLoader/useGridInfiniteLoader.d.ts +2 -2
- package/hooks/features/lazyLoader/useGridLazyLoader.d.ts +2 -2
- package/hooks/features/lazyLoader/useGridLazyLoaderPreProcessors.d.ts +2 -2
- package/hooks/features/rowPinning/useGridRowPinning.d.ts +2 -2
- package/hooks/features/rowPinning/useGridRowPinningPreProcessors.d.ts +3 -3
- package/hooks/features/rowReorder/useGridRowReorder.d.ts +2 -2
- package/hooks/features/rowReorder/useGridRowReorderPreProcessors.d.ts +2 -2
- package/hooks/features/serverSideTreeData/useGridDataSourceTreeDataPreProcessors.d.ts +2 -2
- package/hooks/features/treeData/gridTreeDataUtils.d.ts +2 -1
- package/hooks/features/treeData/useGridTreeData.d.ts +2 -2
- package/hooks/features/treeData/useGridTreeDataPreProcessors.d.ts +2 -2
- package/hooks/utils/useGridApiRef.d.ts +3 -1
- package/index.js +1 -1
- package/models/dataGridProProps.d.ts +2 -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,154 @@
|
|
|
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
|
+
|
|
83
|
+
## 7.24.1
|
|
84
|
+
|
|
85
|
+
_Jan 24, 2025_
|
|
86
|
+
|
|
87
|
+
We'd like to offer a big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
|
|
88
|
+
|
|
89
|
+
- 🐞 Bugfixes
|
|
90
|
+
- 🌍 Improve Persian (fa-IR) locale on the Data Grid
|
|
91
|
+
|
|
92
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
93
|
+
@mostafaRoosta74, @lauri865.
|
|
94
|
+
Following are all team members who have contributed to this release:
|
|
95
|
+
@alexfauquette, @JCQuintas, @cherniavskii, @LukasTy, @arminmeh.
|
|
96
|
+
|
|
97
|
+
### Data Grid
|
|
98
|
+
|
|
99
|
+
#### `@mui/x-data-grid@7.24.1`
|
|
100
|
+
|
|
101
|
+
- [DataGrid] Fix toggling preference panel from toolbar (#16276) @lauri865
|
|
102
|
+
- [DataGrid] Only try to mount filter button if there are filters present (#16269) @lauri865
|
|
103
|
+
- [DataGrid] Revert `apiRef` to be `MutableRefObject` for React versions < 19 (#16320) @arminmeh
|
|
104
|
+
- [l10n] Improve Persian (fa-IR) locale (#15964) @mostafaRoosta74
|
|
105
|
+
|
|
106
|
+
#### `@mui/x-data-grid-pro@7.24.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
107
|
+
|
|
108
|
+
Same changes as in `@mui/x-data-grid@7.24.1`.
|
|
109
|
+
|
|
110
|
+
#### `@mui/x-data-grid-premium@7.24.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
111
|
+
|
|
112
|
+
Same changes as in `@mui/x-data-grid-pro@7.24.1`.
|
|
113
|
+
|
|
114
|
+
### Date and Time Pickers
|
|
115
|
+
|
|
116
|
+
#### `@mui/x-date-pickers@7.24.1`
|
|
117
|
+
|
|
118
|
+
- [fields] Reset `all` selected state on section edit (#16232) @LukasTy
|
|
119
|
+
|
|
120
|
+
#### `@mui/x-date-pickers-pro@7.24.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
121
|
+
|
|
122
|
+
Same changes as in `@mui/x-date-pickers@7.24.1`.
|
|
123
|
+
|
|
124
|
+
### Charts
|
|
125
|
+
|
|
126
|
+
#### `@mui/x-charts@7.24.1`
|
|
127
|
+
|
|
128
|
+
- [charts] Handle case where gradient stop `offset` could be `Infinite` (@JCQuintas) (#16309) @JCQuintas
|
|
129
|
+
|
|
130
|
+
#### `@mui/x-charts-pro@7.24.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
131
|
+
|
|
132
|
+
Same changes as in `@mui/x-charts@7.24.1`.
|
|
133
|
+
|
|
134
|
+
### Tree View
|
|
135
|
+
|
|
136
|
+
#### `@mui/x-tree-view@7.24.1`
|
|
137
|
+
|
|
138
|
+
Internal changes.
|
|
139
|
+
|
|
140
|
+
#### `@mui/x-tree-view-pro@7.24.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
141
|
+
|
|
142
|
+
Same changes as in `@mui/x-tree-view@7.24.1`.
|
|
143
|
+
|
|
144
|
+
### Docs
|
|
145
|
+
|
|
146
|
+
- [docs] Fix `domainLimit` definition (#16271) @alexfauquette
|
|
147
|
+
|
|
148
|
+
### Core
|
|
149
|
+
|
|
150
|
+
- [core] Make `@mui/x-internals` a dependency of `@mui/x-license` (#16265) @alexfauquette
|
|
151
|
+
- [test] Fix flaky column pinning tests (#16228) @cherniavskii
|
|
152
|
+
- [test] Fix flaky tests (#16264) @lauri865
|
|
153
|
+
|
|
6
154
|
## 7.24.0
|
|
7
155
|
|
|
8
156
|
_Jan 17, 2025_
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridApiPro, GridPrivateApiPro } from '../models/gridApiPro';
|
|
3
3
|
import { DataGridProProcessedProps } from '../models/dataGridProProps';
|
|
4
|
-
export declare const useDataGridProComponent: (inputApiRef:
|
|
4
|
+
export declare const useDataGridProComponent: (inputApiRef: RefObject<GridApiPro> | undefined, props: DataGridProProcessedProps) => import("react").RefObject<GridPrivateApiPro>;
|
|
@@ -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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridStateInitializer } from '@mui/x-data-grid/internals';
|
|
3
3
|
import { GridPrivateApiPro } from '../../../models/gridApiPro';
|
|
4
4
|
import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
5
5
|
export declare const columnPinningStateInitializer: GridStateInitializer<Pick<DataGridProProcessedProps, 'pinnedColumns' | 'initialState'>>;
|
|
6
|
-
export declare const useGridColumnPinning: (apiRef:
|
|
6
|
+
export declare const useGridColumnPinning: (apiRef: RefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "disableColumnPinning" | "initialState" | "pinnedColumns" | "onPinnedColumnsChange" | "slotProps" | "slots">) => void;
|
|
@@ -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 || [];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
3
3
|
import { GridPrivateApiPro } from '../../../models/gridApiPro';
|
|
4
|
-
export declare const useGridColumnPinningPreProcessors: (apiRef:
|
|
4
|
+
export declare const useGridColumnPinningPreProcessors: (apiRef: RefObject<GridPrivateApiPro>, props: DataGridProProcessedProps) => void;
|
|
@@ -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);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridStateInitializer } from '@mui/x-data-grid/internals';
|
|
3
3
|
import { GridPrivateApiPro } from '../../../models/gridApiPro';
|
|
4
4
|
import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
@@ -6,4 +6,4 @@ export declare const columnReorderStateInitializer: GridStateInitializer;
|
|
|
6
6
|
/**
|
|
7
7
|
* @requires useGridColumns (method)
|
|
8
8
|
*/
|
|
9
|
-
export declare const useGridColumnReorder: (apiRef:
|
|
9
|
+
export declare const useGridColumnReorder: (apiRef: RefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "disableColumnReorder" | "keepColumnPositionIfDraggedOutside" | "classes" | "onColumnOrderChange">) => void;
|
|
@@ -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
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridStateInitializer } from '@mui/x-data-grid/internals';
|
|
3
3
|
import { GridPrivateApiPro } from '../../../models/gridApiPro';
|
|
4
4
|
import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
5
5
|
export declare const dataSourceStateInitializer: GridStateInitializer;
|
|
6
|
-
export declare const useGridDataSource: (apiRef:
|
|
6
|
+
export declare const useGridDataSource: (apiRef: RefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "unstable_dataSource" | "unstable_dataSourceCache" | "unstable_onDataSourceError" | "sortingMode" | "filterMode" | "paginationMode" | "treeData">) => void;
|
|
@@ -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) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
1
2
|
import { GridRowId } from '@mui/x-data-grid';
|
|
2
3
|
import { GridPrivateApiPro } from '../../../models/gridApiPro';
|
|
3
4
|
export declare const runIfServerMode: (modeProp: "server" | "client", fn: Function) => () => void;
|
|
@@ -18,7 +19,7 @@ export declare class NestedDataManager {
|
|
|
18
19
|
private settledRequests;
|
|
19
20
|
private api;
|
|
20
21
|
private maxConcurrentRequests;
|
|
21
|
-
constructor(privateApiRef:
|
|
22
|
+
constructor(privateApiRef: RefObject<GridPrivateApiPro>, maxConcurrentRequests?: number);
|
|
22
23
|
private processQueue;
|
|
23
24
|
queue: (ids: GridRowId[]) => Promise<void>;
|
|
24
25
|
setRequestSettled: (id: GridRowId) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridStateInitializer } from '@mui/x-data-grid/internals';
|
|
3
3
|
import { GridPrivateApiPro } from '../../../models/gridApiPro';
|
|
4
4
|
import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
5
5
|
export declare const detailPanelStateInitializer: GridStateInitializer<Pick<DataGridProProcessedProps, 'initialState' | 'detailPanelExpandedRowIds'>>;
|
|
6
|
-
export declare const useGridDetailPanel: (apiRef:
|
|
6
|
+
export declare const useGridDetailPanel: (apiRef: RefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "getDetailPanelContent" | "getDetailPanelHeight" | "detailPanelExpandedRowIds" | "onDetailPanelExpandedRowIdsChange">) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
3
3
|
import { GridPrivateApiPro } from '../../../models/gridApiPro';
|
|
4
|
-
export declare const useGridDetailPanelPreProcessors: (privateApiRef:
|
|
4
|
+
export declare const useGridDetailPanelPreProcessors: (privateApiRef: RefObject<GridPrivateApiPro>, props: DataGridProProcessedProps) => void;
|
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,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridPrivateApiPro } from '../../../models/gridApiPro';
|
|
3
3
|
import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
4
4
|
/**
|
|
@@ -6,4 +6,4 @@ import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
|
6
6
|
* @requires useGridDimensions (method) - can be after
|
|
7
7
|
* @requires useGridScroll (method
|
|
8
8
|
*/
|
|
9
|
-
export declare const useGridInfiniteLoader: (apiRef:
|
|
9
|
+
export declare const useGridInfiniteLoader: (apiRef: RefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "onRowsScrollEnd" | "pagination" | "paginationMode" | "rowsLoadingMode" | "scrollEndThreshold">) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridPrivateApiPro } from '../../../models/gridApiPro';
|
|
3
3
|
import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
4
4
|
/**
|
|
@@ -7,4 +7,4 @@ import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
|
7
7
|
* @requires useGridDimensions (method) - can be after
|
|
8
8
|
* @requires useGridScroll (method
|
|
9
9
|
*/
|
|
10
|
-
export declare const useGridLazyLoader: (privateApiRef:
|
|
10
|
+
export declare const useGridLazyLoader: (privateApiRef: RefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "onFetchRows" | "rowsLoadingMode" | "pagination" | "paginationMode" | "experimentalFeatures">) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridPrivateApiPro } from '../../../models/gridApiPro';
|
|
3
3
|
import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
4
4
|
export declare const GRID_SKELETON_ROW_ROOT_ID = "auto-generated-skeleton-row-root";
|
|
5
|
-
export declare const useGridLazyLoaderPreProcessors: (privateApiRef:
|
|
5
|
+
export declare const useGridLazyLoaderPreProcessors: (privateApiRef: RefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "rowCount" | "rowsLoadingMode" | "experimentalFeatures">) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridStateInitializer } from '@mui/x-data-grid/internals';
|
|
3
3
|
import { GridPrivateApiPro } from '../../../models/gridApiPro';
|
|
4
4
|
import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
5
5
|
export declare const rowPinningStateInitializer: GridStateInitializer<Pick<DataGridProProcessedProps, 'pinnedRows' | 'getRowId' | 'experimentalFeatures'>>;
|
|
6
|
-
export declare const useGridRowPinning: (apiRef:
|
|
6
|
+
export declare const useGridRowPinning: (apiRef: RefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "pinnedRows" | "getRowId">) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridHydrateRowsValue } from '@mui/x-data-grid/internals';
|
|
3
3
|
import { GridRowId, GridRowModel } from '@mui/x-data-grid';
|
|
4
4
|
import { GridPrivateApiPro } from '../../../models/gridApiPro';
|
|
@@ -9,7 +9,7 @@ export declare function addPinnedRow({ groupingParams, rowModel, rowId, position
|
|
|
9
9
|
rowModel: GridRowModel;
|
|
10
10
|
rowId: GridRowId;
|
|
11
11
|
position: GridPinnedRowPosition;
|
|
12
|
-
apiRef:
|
|
12
|
+
apiRef: RefObject<GridPrivateApiPro>;
|
|
13
13
|
isAutoGenerated: boolean;
|
|
14
14
|
}): {
|
|
15
15
|
dataRowIdToModelLookup: {
|
|
@@ -30,5 +30,5 @@ export declare function addPinnedRow({ groupingParams, rowModel, rowId, position
|
|
|
30
30
|
pinnedRows?: import("@mui/x-data-grid/internals").GridPinnedRowsState;
|
|
31
31
|
} | undefined;
|
|
32
32
|
};
|
|
33
|
-
export declare const useGridRowPinningPreProcessors: (apiRef:
|
|
33
|
+
export declare const useGridRowPinningPreProcessors: (apiRef: RefObject<GridPrivateApiPro>) => void;
|
|
34
34
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridPrivateApiPro } from '../../../models/gridApiPro';
|
|
3
3
|
import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
4
4
|
/**
|
|
5
5
|
* Only available in DataGridPro
|
|
6
6
|
* @requires useGridRows (method)
|
|
7
7
|
*/
|
|
8
|
-
export declare const useGridRowReorder: (apiRef:
|
|
8
|
+
export declare const useGridRowReorder: (apiRef: RefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "rowReordering" | "onRowOrderChange" | "classes">) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
3
3
|
import { GridPrivateApiPro } from '../../../models/gridApiPro';
|
|
4
|
-
export declare const useGridRowReorderPreProcessors: (privateApiRef:
|
|
4
|
+
export declare const useGridRowReorderPreProcessors: (privateApiRef: RefObject<GridPrivateApiPro>, props: DataGridProProcessedProps) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
3
3
|
import { GridPrivateApiPro } from '../../../models/gridApiPro';
|
|
4
|
-
export declare const useGridDataSourceTreeDataPreProcessors: (privateApiRef:
|
|
4
|
+
export declare const useGridDataSourceTreeDataPreProcessors: (privateApiRef: RefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "treeData" | "groupingColDef" | "disableChildrenSorting" | "disableChildrenFiltering" | "defaultGroupingExpansionDepth" | "isGroupExpandedByDefault" | "unstable_dataSource">) => void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
1
2
|
import { GridRowTreeConfig, GridFilterState, GridFilterModel } from '@mui/x-data-grid';
|
|
2
3
|
import { GridAggregatedFilterItemApplier } from '@mui/x-data-grid/internals';
|
|
3
4
|
import type { GridPrivateApiPro } from '../../../models/gridApiPro';
|
|
@@ -6,7 +7,7 @@ interface FilterRowTreeFromTreeDataParams {
|
|
|
6
7
|
disableChildrenFiltering: boolean;
|
|
7
8
|
isRowMatchingFilters: GridAggregatedFilterItemApplier | null;
|
|
8
9
|
filterModel: GridFilterModel;
|
|
9
|
-
apiRef:
|
|
10
|
+
apiRef: RefObject<GridPrivateApiPro>;
|
|
10
11
|
}
|
|
11
12
|
export declare enum TreeDataStrategy {
|
|
12
13
|
Default = "tree-data",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridApiPro } from '../../../models/gridApiPro';
|
|
3
3
|
import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
4
|
-
export declare const useGridTreeData: (apiRef:
|
|
4
|
+
export declare const useGridTreeData: (apiRef: RefObject<GridApiPro>, props: Pick<DataGridProProcessedProps, "unstable_dataSource">) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
3
3
|
import { GridPrivateApiPro } from '../../../models/gridApiPro';
|
|
4
|
-
export declare const useGridTreeDataPreProcessors: (privateApiRef:
|
|
4
|
+
export declare const useGridTreeDataPreProcessors: (privateApiRef: RefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "treeData" | "groupingColDef" | "getTreeDataPath" | "disableChildrenSorting" | "disableChildrenFiltering" | "defaultGroupingExpansionDepth" | "isGroupExpandedByDefault" | "unstable_dataSource">) => void;
|
|
@@ -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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
3
|
import { GridEventListener, GridCallbackDetails, GridRowParams, GridRowId, GridValidRowModel, GridGroupNode, GridFeatureMode, GridListColDef } from '@mui/x-data-grid';
|
|
3
4
|
import type { GridExperimentalFeatures, DataGridPropsWithoutDefaultValue, DataGridPropsWithDefaultValues, DataGridPropsWithComplexDefaultValueAfterProcessing, DataGridPropsWithComplexDefaultValueBeforeProcessing, GridPinnedColumnFields, DataGridProSharedPropsWithDefaultValue, DataGridProSharedPropsWithoutDefaultValue, GridDataSourceCache, GridGetRowsParams } from '@mui/x-data-grid/internals';
|
|
4
5
|
import type { GridPinnedRowsProp } from '../hooks/features/rowPinning';
|
|
@@ -123,7 +124,7 @@ export interface DataGridProPropsWithoutDefaultValue<R extends GridValidRowModel
|
|
|
123
124
|
/**
|
|
124
125
|
* The ref object that allows grid manipulation. Can be instantiated with `useGridApiRef()`.
|
|
125
126
|
*/
|
|
126
|
-
apiRef?:
|
|
127
|
+
apiRef?: RefObject<GridApiPro>;
|
|
127
128
|
/**
|
|
128
129
|
* The initial state of the DataGridPro.
|
|
129
130
|
* The data in it will be set in the state on initialization but will not be controlled.
|
|
@@ -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-data-grid": "7.
|
|
43
|
-
"@mui/x-
|
|
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
|