@mui/x-data-grid-pro 8.26.0 → 8.27.1
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 +153 -0
- package/DataGridPro/DataGridPro.d.ts +2 -2
- package/DataGridPro/DataGridPro.js +1 -1
- package/DataGridPro/useDataGridProComponent.d.ts +4 -4
- package/DataGridPro/useDataGridProProps.d.ts +2 -2
- package/components/GridColumnHeaders.d.ts +1 -1
- package/components/GridColumnMenuPinningItem.d.ts +1 -1
- package/components/GridDataSourceTreeDataGroupingCell.d.ts +1 -1
- package/components/GridDetailPanel.d.ts +1 -1
- package/components/GridDetailPanelToggleCell.d.ts +1 -1
- package/components/GridDetailPanels.d.ts +1 -1
- package/components/GridPinnedRows.d.ts +1 -1
- package/components/GridProColumnMenu.d.ts +2 -2
- package/components/GridProColumnMenu.js +3 -1
- package/components/GridRowReorderCell.d.ts +1 -1
- package/components/GridRowReorderCell.js +2 -2
- package/components/GridTreeDataGroupingCell.d.ts +1 -1
- package/components/headerFiltering/GridHeaderFilterCell.d.ts +2 -2
- package/components/headerFiltering/GridHeaderFilterCell.js +2 -1
- package/components/headerFiltering/GridHeaderFilterClearButton.d.ts +1 -1
- package/components/headerFiltering/GridHeaderFilterMenu.d.ts +1 -1
- package/components/headerFiltering/GridHeaderFilterMenuContainer.d.ts +1 -1
- package/esm/DataGridPro/DataGridPro.d.ts +2 -2
- package/esm/DataGridPro/DataGridPro.js +1 -1
- package/esm/DataGridPro/useDataGridProComponent.d.ts +4 -4
- package/esm/DataGridPro/useDataGridProProps.d.ts +2 -2
- package/esm/components/GridColumnHeaders.d.ts +1 -1
- package/esm/components/GridColumnMenuPinningItem.d.ts +1 -1
- package/esm/components/GridDataSourceTreeDataGroupingCell.d.ts +1 -1
- package/esm/components/GridDetailPanel.d.ts +1 -1
- package/esm/components/GridDetailPanelToggleCell.d.ts +1 -1
- package/esm/components/GridDetailPanels.d.ts +1 -1
- package/esm/components/GridPinnedRows.d.ts +1 -1
- package/esm/components/GridProColumnMenu.d.ts +2 -2
- package/esm/components/GridProColumnMenu.js +3 -1
- package/esm/components/GridRowReorderCell.d.ts +1 -1
- package/esm/components/GridRowReorderCell.js +1 -1
- package/esm/components/GridTreeDataGroupingCell.d.ts +1 -1
- package/esm/components/headerFiltering/GridHeaderFilterCell.d.ts +2 -2
- package/esm/components/headerFiltering/GridHeaderFilterCell.js +2 -1
- package/esm/components/headerFiltering/GridHeaderFilterClearButton.d.ts +1 -1
- package/esm/components/headerFiltering/GridHeaderFilterMenu.d.ts +1 -1
- package/esm/components/headerFiltering/GridHeaderFilterMenuContainer.d.ts +1 -1
- package/esm/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +1 -1
- package/esm/hooks/features/columnPinning/gridColumnPinningInterface.d.ts +2 -2
- package/esm/hooks/features/columnPinning/useGridColumnPinning.d.ts +4 -4
- package/esm/hooks/features/columnPinning/useGridColumnPinning.js +4 -0
- package/esm/hooks/features/columnPinning/useGridColumnPinningPreProcessors.d.ts +3 -3
- package/esm/hooks/features/columnReorder/columnReorderSelector.d.ts +1 -1
- package/esm/hooks/features/columnReorder/useGridColumnReorder.d.ts +4 -4
- package/esm/hooks/features/dataSource/gridDataSourceSelector.d.ts +1 -1
- package/esm/hooks/features/dataSource/useGridDataSourceBasePro.d.ts +6 -6
- package/esm/hooks/features/dataSource/useGridDataSourcePro.d.ts +4 -4
- package/esm/hooks/features/dataSource/utils.d.ts +3 -3
- package/esm/hooks/features/detailPanel/gridDetailPanelInterface.d.ts +2 -2
- package/esm/hooks/features/detailPanel/gridDetailPanelSelector.d.ts +1 -1
- package/esm/hooks/features/detailPanel/gridDetailPanelToggleColDef.d.ts +1 -1
- package/esm/hooks/features/detailPanel/useGridDetailPanel.d.ts +4 -4
- package/esm/hooks/features/detailPanel/useGridDetailPanelPreProcessors.d.ts +3 -3
- package/esm/hooks/features/infiniteLoader/useGridInfiniteLoader.d.ts +3 -3
- package/esm/hooks/features/lazyLoader/useGridLazyLoader.d.ts +3 -3
- package/esm/hooks/features/lazyLoader/useGridLazyLoaderPreProcessors.d.ts +3 -3
- package/esm/hooks/features/lazyLoader/utils.d.ts +23 -8
- package/esm/hooks/features/lazyLoader/utils.js +23 -0
- package/esm/hooks/features/rowPinning/gridRowPinningInterface.d.ts +1 -1
- package/esm/hooks/features/rowPinning/useGridRowPinning.d.ts +4 -4
- package/esm/hooks/features/rowPinning/useGridRowPinningPreProcessors.d.ts +4 -4
- package/esm/hooks/features/rowReorder/gridRowReorderColDef.d.ts +1 -1
- package/esm/hooks/features/rowReorder/models.d.ts +1 -1
- package/esm/hooks/features/rowReorder/reorderValidator.d.ts +1 -1
- package/esm/hooks/features/rowReorder/useGridRowReorder.d.ts +3 -3
- package/esm/hooks/features/rowReorder/useGridRowReorderPreProcessors.d.ts +3 -3
- package/esm/hooks/features/rowReorder/utils.d.ts +2 -2
- package/esm/hooks/features/rows/useGridRowAriaAttributes.d.ts +1 -1
- package/esm/hooks/features/serverSideLazyLoader/useGridDataSourceLazyLoader.d.ts +3 -3
- package/esm/hooks/features/serverSideLazyLoader/useGridDataSourceLazyLoader.js +23 -28
- package/esm/hooks/features/serverSideLazyLoader/useGridInfiniteLoadingIntersection.d.ts +3 -3
- package/esm/hooks/features/serverSideLazyLoader/useGridInfiniteLoadingIntersection.js +1 -1
- package/esm/hooks/features/serverSideTreeData/useGridDataSourceTreeDataPreProcessors.d.ts +3 -3
- package/esm/hooks/features/serverSideTreeData/utils.d.ts +5 -2
- package/esm/hooks/features/serverSideTreeData/utils.js +14 -2
- package/esm/hooks/features/treeData/gridTreeDataGroupColDef.d.ts +1 -1
- package/esm/hooks/features/treeData/gridTreeDataUtils.d.ts +3 -3
- package/esm/hooks/features/treeData/treeDataReorderExecutor.d.ts +1 -1
- package/esm/hooks/features/treeData/useGridTreeData.d.ts +1 -1
- package/esm/hooks/features/treeData/useGridTreeDataPreProcessors.d.ts +3 -3
- package/esm/hooks/utils/useGridApiContext.d.ts +3 -3
- package/esm/hooks/utils/useGridApiRef.d.ts +2 -2
- package/esm/hooks/utils/useGridAriaAttributes.d.ts +1 -1
- package/esm/hooks/utils/useGridPrivateApiContext.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/internals/propValidation.d.ts +2 -2
- package/esm/models/dataGridProProps.d.ts +4 -4
- package/esm/models/gridApiPro.d.ts +3 -3
- package/esm/models/gridFetchRowsParams.d.ts +1 -1
- package/esm/models/gridGroupingColDefOverride.d.ts +1 -1
- package/esm/models/gridProIconSlotsComponent.d.ts +2 -2
- package/esm/models/gridProSlotProps.d.ts +1 -1
- package/esm/models/gridProSlotsComponent.d.ts +2 -2
- package/esm/models/gridRowOrderChangeParams.d.ts +1 -1
- package/esm/models/gridRowScrollEndParams.d.ts +1 -1
- package/esm/models/gridStatePro.d.ts +1 -1
- package/esm/themeAugmentation/overrides.d.ts +1 -1
- package/esm/themeAugmentation/props.d.ts +2 -2
- package/esm/typeOverloads/modules.d.ts +2 -2
- package/esm/utils/tree/createRowTree.d.ts +4 -4
- package/esm/utils/tree/insertDataRowInTree.d.ts +4 -4
- package/esm/utils/tree/models.d.ts +1 -1
- package/esm/utils/tree/removeDataRowFromTree.d.ts +2 -2
- package/esm/utils/tree/sortRowTree.d.ts +2 -2
- package/esm/utils/tree/updateRowTree.d.ts +3 -3
- package/esm/utils/tree/utils.d.ts +4 -4
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +1 -1
- package/hooks/features/columnPinning/gridColumnPinningInterface.d.ts +2 -2
- package/hooks/features/columnPinning/useGridColumnPinning.d.ts +4 -4
- package/hooks/features/columnPinning/useGridColumnPinning.js +4 -0
- package/hooks/features/columnPinning/useGridColumnPinningPreProcessors.d.ts +3 -3
- package/hooks/features/columnReorder/columnReorderSelector.d.ts +1 -1
- package/hooks/features/columnReorder/useGridColumnReorder.d.ts +4 -4
- package/hooks/features/dataSource/gridDataSourceSelector.d.ts +1 -1
- package/hooks/features/dataSource/useGridDataSourceBasePro.d.ts +6 -6
- package/hooks/features/dataSource/useGridDataSourcePro.d.ts +4 -4
- package/hooks/features/dataSource/utils.d.ts +3 -3
- package/hooks/features/detailPanel/gridDetailPanelInterface.d.ts +2 -2
- package/hooks/features/detailPanel/gridDetailPanelSelector.d.ts +1 -1
- package/hooks/features/detailPanel/gridDetailPanelToggleColDef.d.ts +1 -1
- package/hooks/features/detailPanel/useGridDetailPanel.d.ts +4 -4
- package/hooks/features/detailPanel/useGridDetailPanelPreProcessors.d.ts +3 -3
- package/hooks/features/infiniteLoader/useGridInfiniteLoader.d.ts +3 -3
- package/hooks/features/lazyLoader/useGridLazyLoader.d.ts +3 -3
- package/hooks/features/lazyLoader/useGridLazyLoaderPreProcessors.d.ts +3 -3
- package/hooks/features/lazyLoader/utils.d.ts +23 -8
- package/hooks/features/lazyLoader/utils.js +26 -1
- package/hooks/features/rowPinning/gridRowPinningInterface.d.ts +1 -1
- package/hooks/features/rowPinning/useGridRowPinning.d.ts +4 -4
- package/hooks/features/rowPinning/useGridRowPinningPreProcessors.d.ts +4 -4
- package/hooks/features/rowReorder/gridRowReorderColDef.d.ts +1 -1
- package/hooks/features/rowReorder/models.d.ts +1 -1
- package/hooks/features/rowReorder/reorderValidator.d.ts +1 -1
- package/hooks/features/rowReorder/useGridRowReorder.d.ts +3 -3
- package/hooks/features/rowReorder/useGridRowReorderPreProcessors.d.ts +3 -3
- package/hooks/features/rowReorder/utils.d.ts +2 -2
- package/hooks/features/rows/useGridRowAriaAttributes.d.ts +1 -1
- package/hooks/features/serverSideLazyLoader/useGridDataSourceLazyLoader.d.ts +3 -3
- package/hooks/features/serverSideLazyLoader/useGridDataSourceLazyLoader.js +23 -28
- package/hooks/features/serverSideLazyLoader/useGridInfiniteLoadingIntersection.d.ts +3 -3
- package/hooks/features/serverSideLazyLoader/useGridInfiniteLoadingIntersection.js +2 -2
- package/hooks/features/serverSideTreeData/useGridDataSourceTreeDataPreProcessors.d.ts +3 -3
- package/hooks/features/serverSideTreeData/utils.d.ts +5 -2
- package/hooks/features/serverSideTreeData/utils.js +14 -2
- package/hooks/features/treeData/gridTreeDataGroupColDef.d.ts +1 -1
- package/hooks/features/treeData/gridTreeDataUtils.d.ts +3 -3
- package/hooks/features/treeData/treeDataReorderExecutor.d.ts +1 -1
- package/hooks/features/treeData/useGridTreeData.d.ts +1 -1
- package/hooks/features/treeData/useGridTreeDataPreProcessors.d.ts +3 -3
- package/hooks/utils/useGridApiContext.d.ts +3 -3
- package/hooks/utils/useGridApiRef.d.ts +2 -2
- package/hooks/utils/useGridAriaAttributes.d.ts +1 -1
- package/hooks/utils/useGridPrivateApiContext.d.ts +1 -1
- package/index.js +1 -1
- package/internals/propValidation.d.ts +2 -2
- package/models/dataGridProProps.d.ts +4 -4
- package/models/gridApiPro.d.ts +3 -3
- package/models/gridFetchRowsParams.d.ts +1 -1
- package/models/gridGroupingColDefOverride.d.ts +1 -1
- package/models/gridProIconSlotsComponent.d.ts +2 -2
- package/models/gridProSlotProps.d.ts +1 -1
- package/models/gridProSlotsComponent.d.ts +2 -2
- package/models/gridRowOrderChangeParams.d.ts +1 -1
- package/models/gridRowScrollEndParams.d.ts +1 -1
- package/models/gridStatePro.d.ts +1 -1
- package/package.json +4 -4
- package/themeAugmentation/overrides.d.ts +1 -1
- package/themeAugmentation/props.d.ts +2 -2
- package/typeOverloads/modules.d.ts +2 -2
- package/utils/tree/createRowTree.d.ts +4 -4
- package/utils/tree/insertDataRowInTree.d.ts +4 -4
- package/utils/tree/models.d.ts +1 -1
- package/utils/tree/removeDataRowFromTree.d.ts +2 -2
- package/utils/tree/sortRowTree.d.ts +2 -2
- package/utils/tree/updateRowTree.d.ts +3 -3
- package/utils/tree/utils.d.ts +4 -4
|
@@ -46,19 +46,6 @@ const useGridDataSourceLazyLoader = (privateApiRef, props) => {
|
|
|
46
46
|
privateApiRef.current.dataSource.fetchRows(_xDataGrid.GRID_ROOT_GROUP_ID, params);
|
|
47
47
|
}, [privateApiRef]);
|
|
48
48
|
const debouncedFetchRows = React.useMemo(() => (0, _debounce.default)(fetchRows, 0), [fetchRows]);
|
|
49
|
-
|
|
50
|
-
// Adjust the render context range to fit the pagination model's page size
|
|
51
|
-
// First row index should be decreased to the start of the page, end row index should be increased to the end of the page
|
|
52
|
-
const adjustRowParams = React.useCallback(params => {
|
|
53
|
-
if (typeof params.start !== 'number') {
|
|
54
|
-
return params;
|
|
55
|
-
}
|
|
56
|
-
const paginationModel = (0, _xDataGrid.gridPaginationModelSelector)(privateApiRef);
|
|
57
|
-
return (0, _extends2.default)({}, params, {
|
|
58
|
-
start: params.start - params.start % paginationModel.pageSize,
|
|
59
|
-
end: params.end + paginationModel.pageSize - params.end % paginationModel.pageSize - 1
|
|
60
|
-
});
|
|
61
|
-
}, [privateApiRef]);
|
|
62
49
|
const resetGrid = React.useCallback(() => {
|
|
63
50
|
privateApiRef.current.setLoading(true);
|
|
64
51
|
privateApiRef.current.dataSource.cache.clear();
|
|
@@ -109,9 +96,13 @@ const useGridDataSourceLazyLoader = (privateApiRef, props) => {
|
|
|
109
96
|
if (rootChildrenCount === 0) {
|
|
110
97
|
return;
|
|
111
98
|
}
|
|
112
|
-
const
|
|
99
|
+
const paginationModel = (0, _xDataGrid.gridPaginationModelSelector)(privateApiRef);
|
|
100
|
+
const pageToSkip = (0, _utils.adjustRowParams)({
|
|
113
101
|
start: renderedRowsIntervalCache.current.firstRowToRender,
|
|
114
102
|
end: renderedRowsIntervalCache.current.lastRowToRender
|
|
103
|
+
}, {
|
|
104
|
+
pageSize: paginationModel.pageSize,
|
|
105
|
+
rowCount: pageRowCount
|
|
115
106
|
});
|
|
116
107
|
let hasChanged = false;
|
|
117
108
|
const isInitialPage = renderedRowsIntervalCache.current.firstRowToRender === 0 && renderedRowsIntervalCache.current.lastRowToRender === 0;
|
|
@@ -164,7 +155,7 @@ const useGridDataSourceLazyLoader = (privateApiRef, props) => {
|
|
|
164
155
|
tree
|
|
165
156
|
})
|
|
166
157
|
}), 'addSkeletonRows');
|
|
167
|
-
}, [privateApiRef
|
|
158
|
+
}, [privateApiRef]);
|
|
168
159
|
const updateLoadingTrigger = React.useCallback(rowCount => {
|
|
169
160
|
const newLoadingTrigger = rowCount === -1 ? LoadingTrigger.SCROLL_END : LoadingTrigger.VIEWPORT;
|
|
170
161
|
if (loadingTrigger.current !== null) {
|
|
@@ -275,43 +266,47 @@ const useGridDataSourceLazyLoader = (privateApiRef, props) => {
|
|
|
275
266
|
filterModel
|
|
276
267
|
};
|
|
277
268
|
privateApiRef.current.setLoading(true);
|
|
278
|
-
fetchRows(adjustRowParams(getRowsParams
|
|
269
|
+
fetchRows((0, _utils.adjustRowParams)(getRowsParams, {
|
|
270
|
+
pageSize: paginationModel.pageSize,
|
|
271
|
+
rowCount: privateApiRef.current.state.pagination.rowCount
|
|
272
|
+
}));
|
|
279
273
|
});
|
|
280
|
-
const handleRenderedRowsIntervalChange = React.useCallback(
|
|
274
|
+
const handleRenderedRowsIntervalChange = React.useCallback(renderContext => {
|
|
281
275
|
if (rowsStale.current) {
|
|
282
276
|
return;
|
|
283
277
|
}
|
|
284
278
|
const sortModel = (0, _xDataGrid.gridSortModelSelector)(privateApiRef);
|
|
285
279
|
const filterModel = (0, _xDataGrid.gridFilterModelSelector)(privateApiRef);
|
|
286
280
|
const getRowsParams = {
|
|
287
|
-
start:
|
|
288
|
-
end:
|
|
281
|
+
start: renderContext.firstRowIndex,
|
|
282
|
+
end: renderContext.lastRowIndex - 1,
|
|
289
283
|
sortModel,
|
|
290
284
|
filterModel
|
|
291
285
|
};
|
|
292
|
-
if (renderedRowsIntervalCache.current.firstRowToRender ===
|
|
286
|
+
if (renderedRowsIntervalCache.current.firstRowToRender === renderContext.firstRowIndex && renderedRowsIntervalCache.current.lastRowToRender === renderContext.lastRowIndex) {
|
|
293
287
|
return;
|
|
294
288
|
}
|
|
295
289
|
renderedRowsIntervalCache.current = {
|
|
296
|
-
firstRowToRender:
|
|
297
|
-
lastRowToRender:
|
|
290
|
+
firstRowToRender: renderContext.firstRowIndex,
|
|
291
|
+
lastRowToRender: renderContext.lastRowIndex
|
|
298
292
|
};
|
|
299
293
|
const currentVisibleRows = (0, _internals.getVisibleRows)(privateApiRef);
|
|
300
294
|
const skeletonRowsSection = (0, _utils.findSkeletonRowsSection)({
|
|
301
295
|
apiRef: privateApiRef,
|
|
302
296
|
visibleRows: currentVisibleRows.rows,
|
|
303
|
-
range:
|
|
304
|
-
firstRowIndex: params.firstRowIndex,
|
|
305
|
-
lastRowIndex: params.lastRowIndex - 1
|
|
306
|
-
}
|
|
297
|
+
range: renderContext
|
|
307
298
|
});
|
|
308
299
|
if (!skeletonRowsSection) {
|
|
309
300
|
return;
|
|
310
301
|
}
|
|
311
302
|
getRowsParams.start = skeletonRowsSection.firstRowIndex;
|
|
312
303
|
getRowsParams.end = skeletonRowsSection.lastRowIndex;
|
|
313
|
-
|
|
314
|
-
|
|
304
|
+
const paginationModel = (0, _xDataGrid.gridPaginationModelSelector)(privateApiRef);
|
|
305
|
+
fetchRows((0, _utils.adjustRowParams)(getRowsParams, {
|
|
306
|
+
pageSize: paginationModel.pageSize,
|
|
307
|
+
rowCount: privateApiRef.current.state.pagination.rowCount
|
|
308
|
+
}));
|
|
309
|
+
}, [privateApiRef, fetchRows]);
|
|
315
310
|
const throttledHandleRenderedRowsIntervalChange = React.useMemo(() => (0, _throttle.throttle)(handleRenderedRowsIntervalChange, props.lazyLoadingRequestThrottleMs), [props.lazyLoadingRequestThrottleMs, handleRenderedRowsIntervalChange]);
|
|
316
311
|
React.useEffect(() => {
|
|
317
312
|
return () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
-
import { GridPrivateApiPro } from "../../../models/gridApiPro.js";
|
|
3
|
-
import { DataGridProProcessedProps } from "../../../models/dataGridProProps.js";
|
|
1
|
+
import type { RefObject } from '@mui/x-internals/types';
|
|
2
|
+
import type { GridPrivateApiPro } from "../../../models/gridApiPro.js";
|
|
3
|
+
import type { DataGridProProcessedProps } from "../../../models/dataGridProProps.js";
|
|
4
4
|
/**
|
|
5
5
|
* @requires useGridDimensions (method) - can be after
|
|
6
6
|
*/
|
|
@@ -11,9 +11,9 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var _xDataGrid = require("@mui/x-data-grid");
|
|
12
12
|
var _internals = require("@mui/x-data-grid/internals");
|
|
13
13
|
var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
|
|
14
|
-
var
|
|
14
|
+
var _styles = require("@mui/material/styles");
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
const InfiniteLoadingTriggerElement = (0,
|
|
16
|
+
const InfiniteLoadingTriggerElement = (0, _styles.styled)('div', {
|
|
17
17
|
slot: 'internal',
|
|
18
18
|
shouldForwardProp: undefined
|
|
19
19
|
})({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
-
import { DataGridProProcessedProps } from "../../../models/dataGridProProps.js";
|
|
3
|
-
import { GridPrivateApiPro } from "../../../models/gridApiPro.js";
|
|
1
|
+
import type { RefObject } from '@mui/x-internals/types';
|
|
2
|
+
import type { DataGridProProcessedProps } from "../../../models/dataGridProProps.js";
|
|
3
|
+
import type { GridPrivateApiPro } from "../../../models/gridApiPro.js";
|
|
4
4
|
export declare const useGridDataSourceTreeDataPreProcessors: (privateApiRef: RefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "treeData" | "groupingColDef" | "disableChildrenSorting" | "disableChildrenFiltering" | "defaultGroupingExpansionDepth" | "isGroupExpandedByDefault" | "dataSource">) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GridRowId, GridRowTreeConfig } from '@mui/x-data-grid';
|
|
2
|
-
import { GridRowTreeCreationParams } from '@mui/x-data-grid/internals';
|
|
1
|
+
import { type GridRowId, type GridRowTreeConfig } from '@mui/x-data-grid';
|
|
2
|
+
import { type GridRowTreeCreationParams } from '@mui/x-data-grid/internals';
|
|
3
3
|
export declare function skipFiltering(rowTree: GridRowTreeConfig): {
|
|
4
4
|
filteredRowsLookup: {};
|
|
5
5
|
filteredChildrenCountLookup: Record<GridRowId, number>;
|
|
@@ -9,5 +9,8 @@ export declare function skipSorting(rowTree: GridRowTreeConfig): GridRowId[];
|
|
|
9
9
|
/**
|
|
10
10
|
* Retrieves the parent path for a row from the previous tree state.
|
|
11
11
|
* Used during full tree updates to maintain correct hierarchy.
|
|
12
|
+
*
|
|
13
|
+
* Uses the parent node's `path` property, which stores the group keys
|
|
14
|
+
* representing the full path to the parent (i.e. the keys used to fetch the current node).
|
|
12
15
|
*/
|
|
13
16
|
export declare function getParentPath(rowId: GridRowId, treeCreationParams: GridRowTreeCreationParams): string[];
|
|
@@ -28,10 +28,22 @@ function skipSorting(rowTree) {
|
|
|
28
28
|
/**
|
|
29
29
|
* Retrieves the parent path for a row from the previous tree state.
|
|
30
30
|
* Used during full tree updates to maintain correct hierarchy.
|
|
31
|
+
*
|
|
32
|
+
* Uses the parent node's `path` property, which stores the group keys
|
|
33
|
+
* representing the full path to the parent (i.e. the keys used to fetch the current node).
|
|
31
34
|
*/
|
|
32
35
|
function getParentPath(rowId, treeCreationParams) {
|
|
33
|
-
if (treeCreationParams.updates.type !== 'full' || !treeCreationParams.previousTree?.[rowId] || treeCreationParams.previousTree[rowId].depth < 1
|
|
36
|
+
if (treeCreationParams.updates.type !== 'full' || !treeCreationParams.previousTree?.[rowId] || treeCreationParams.previousTree[rowId].depth < 1) {
|
|
34
37
|
return [];
|
|
35
38
|
}
|
|
36
|
-
|
|
39
|
+
const node = treeCreationParams.previousTree[rowId];
|
|
40
|
+
const parentId = node.parent;
|
|
41
|
+
if (parentId == null) {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
const parentNode = treeCreationParams.previousTree[parentId];
|
|
45
|
+
if (parentNode && 'path' in parentNode) {
|
|
46
|
+
return parentNode.path || [];
|
|
47
|
+
}
|
|
48
|
+
return [];
|
|
37
49
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
-
import { GridRowTreeConfig, GridFilterState, GridFilterModel, GridRowModel, GridColDef } from '@mui/x-data-grid';
|
|
3
|
-
import { GridAggregatedFilterItemApplier } from '@mui/x-data-grid/internals';
|
|
1
|
+
import type { RefObject } from '@mui/x-internals/types';
|
|
2
|
+
import type { GridRowTreeConfig, GridFilterState, GridFilterModel, GridRowModel, GridColDef } from '@mui/x-data-grid';
|
|
3
|
+
import { type GridAggregatedFilterItemApplier } from '@mui/x-data-grid/internals';
|
|
4
4
|
import type { GridPrivateApiPro } from "../../../models/gridApiPro.js";
|
|
5
5
|
interface FilterRowTreeFromTreeDataParams {
|
|
6
6
|
rowTree: GridRowTreeConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseReorderOperation, RowReorderExecutor } from "../rowReorder/reorderExecutor.js";
|
|
2
|
-
import {
|
|
2
|
+
import type { ReorderOperation, ReorderExecutionContext } from "../rowReorder/types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Handles reordering of items within the same parent group.
|
|
5
5
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RefObject } from '@mui/x-internals/types';
|
|
1
|
+
import type { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import type { GridPrivateApiPro } from "../../../models/gridApiPro.js";
|
|
3
3
|
import type { DataGridProProcessedProps } from "../../../models/dataGridProProps.js";
|
|
4
4
|
export declare const useGridTreeData: (apiRef: RefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "treeData" | "dataSource" | "isValidRowReorder">) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
-
import { DataGridProProcessedProps } from "../../../models/dataGridProProps.js";
|
|
3
|
-
import { GridPrivateApiPro } from "../../../models/gridApiPro.js";
|
|
1
|
+
import type { RefObject } from '@mui/x-internals/types';
|
|
2
|
+
import type { DataGridProProcessedProps } from "../../../models/dataGridProProps.js";
|
|
3
|
+
import type { GridPrivateApiPro } from "../../../models/gridApiPro.js";
|
|
4
4
|
export declare const useGridTreeDataPreProcessors: (privateApiRef: RefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "treeData" | "groupingColDef" | "getTreeDataPath" | "disableChildrenSorting" | "disableChildrenFiltering" | "defaultGroupingExpansionDepth" | "isGroupExpandedByDefault" | "dataSource">) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
-
import { GridApiCommon } from '@mui/x-data-grid';
|
|
3
|
-
import { GridApiPro } from "../../models/gridApiPro.js";
|
|
1
|
+
import type { RefObject } from '@mui/x-internals/types';
|
|
2
|
+
import { type GridApiCommon } from '@mui/x-data-grid';
|
|
3
|
+
import type { GridApiPro } from "../../models/gridApiPro.js";
|
|
4
4
|
export declare const useGridApiContext: <Api extends GridApiCommon = GridApiPro>() => RefObject<Api>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
-
import { GridApiPro } from "../../models/gridApiPro.js";
|
|
1
|
+
import type { RefObject } from '@mui/x-internals/types';
|
|
2
|
+
import type { GridApiPro } from "../../models/gridApiPro.js";
|
|
3
3
|
export declare const useGridApiRef: () => RefObject<GridApiPro | null>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
1
|
+
import type * as React from 'react';
|
|
2
2
|
export declare const useGridAriaAttributesPro: () => React.HTMLAttributes<HTMLElement>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { GridPrivateApiPro } from "../../models/gridApiPro.js";
|
|
1
|
+
import type { GridPrivateApiPro } from "../../models/gridApiPro.js";
|
|
2
2
|
export declare const useGridPrivateApiContext: () => import("react").RefObject<GridPrivateApiPro>;
|
package/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { PropValidator } from '@mui/x-data-grid/internals';
|
|
2
|
-
import { DataGridProProcessedProps } from "../models/dataGridProProps.js";
|
|
1
|
+
import { type PropValidator } from '@mui/x-data-grid/internals';
|
|
2
|
+
import type { DataGridProProcessedProps } from "../models/dataGridProProps.js";
|
|
3
3
|
export declare const propValidatorsDataGridPro: PropValidator<DataGridProProcessedProps>[];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { RefObject } from '@mui/x-internals/types';
|
|
3
|
-
import { GridEventListener, GridCallbackDetails, GridRowParams, GridRowId, GridValidRowModel, GridGroupNode, GridFeatureMode, GridListViewColDef, GridGetRowsError, GridUpdateRowError } from '@mui/x-data-grid';
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { RefObject } from '@mui/x-internals/types';
|
|
3
|
+
import type { GridEventListener, GridCallbackDetails, GridRowParams, GridRowId, GridValidRowModel, GridGroupNode, GridFeatureMode, GridListViewColDef, GridGetRowsError, GridUpdateRowError } from '@mui/x-data-grid';
|
|
4
4
|
import type { GridExperimentalFeatures, DataGridPropsWithoutDefaultValue, DataGridPropsWithDefaultValues, DataGridPropsWithComplexDefaultValueAfterProcessing, DataGridPropsWithComplexDefaultValueBeforeProcessing, GridPinnedColumnFields, DataGridProSharedPropsWithDefaultValue, DataGridProSharedPropsWithoutDefaultValue } from '@mui/x-data-grid/internals';
|
|
5
5
|
import type { GridPinnedRowsProp } from "../hooks/features/rowPinning/index.js";
|
|
6
6
|
import type { GridApiPro } from "./gridApiPro.js";
|
|
7
|
-
import { GridGroupingColDefOverride, GridGroupingColDefOverrideParams } from "./gridGroupingColDefOverride.js";
|
|
7
|
+
import type { GridGroupingColDefOverride, GridGroupingColDefOverrideParams } from "./gridGroupingColDefOverride.js";
|
|
8
8
|
import type { GridInitialStatePro } from "./gridStatePro.js";
|
|
9
9
|
import type { GridProSlotsComponent } from "./gridProSlotsComponent.js";
|
|
10
10
|
import type { GridProSlotProps } from "./gridProSlotProps.js";
|
package/models/gridApiPro.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { GridApiCommon, GridColumnReorderApi, GridRowMultiSelectionApi, GridRowProApi } from '@mui/x-data-grid';
|
|
2
|
-
import { GridPrivateOnlyApiCommon, GridInfiniteLoaderPrivateApi } from '@mui/x-data-grid/internals';
|
|
3
|
-
import { GridInitialStatePro, GridStatePro } from "./gridStatePro.js";
|
|
1
|
+
import type { GridApiCommon, GridColumnReorderApi, GridRowMultiSelectionApi, GridRowProApi } from '@mui/x-data-grid';
|
|
2
|
+
import type { GridPrivateOnlyApiCommon, GridInfiniteLoaderPrivateApi } from '@mui/x-data-grid/internals';
|
|
3
|
+
import type { GridInitialStatePro, GridStatePro } from "./gridStatePro.js";
|
|
4
4
|
import type { GridColumnPinningApi, GridDetailPanelApi, GridRowPinningApi, GridDetailPanelPrivateApi } from "../hooks/index.js";
|
|
5
5
|
import type { GridRowReorderPrivateApi } from "./gridRowReorderApi.js";
|
|
6
6
|
import type { GridDataSourceApiPro, GridDataSourcePrivateApiPro } from "../hooks/features/dataSource/models.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GridColDef, GridValidRowModel } from '@mui/x-data-grid';
|
|
1
|
+
import type { GridColDef, GridValidRowModel } from '@mui/x-data-grid';
|
|
2
2
|
export interface GridGroupingColDefOverride<R extends GridValidRowModel = any> extends Omit<GridColDef<R>, 'editable' | 'valueSetter' | 'field' | 'type' | 'preProcessEditCellProps' | 'renderEditCell' | 'groupable'> {
|
|
3
3
|
/**
|
|
4
4
|
* The field from which we want to apply the sorting and the filtering for the grouping column.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { BaseSlots } from '@mui/x-data-grid/internals';
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { BaseSlots } from '@mui/x-data-grid/internals';
|
|
3
3
|
type IconProps = BaseSlots.IconProps;
|
|
4
4
|
export interface GridProIconSlotsComponent {
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GridSlotsComponentsProps } from '@mui/x-data-grid/internals';
|
|
1
|
+
import type { GridSlotsComponentsProps } from '@mui/x-data-grid/internals';
|
|
2
2
|
import type { GridHeaderFilterCellProps } from "../components/headerFiltering/GridHeaderFilterCell.js";
|
|
3
3
|
export interface HeaderFilterCellPropsOverrides {}
|
|
4
4
|
type SlotProps<Props, Overrides> = Partial<Props & Overrides>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GridSlotsComponent } from '@mui/x-data-grid';
|
|
2
|
-
import { GridProIconSlotsComponent } from "./gridProIconSlotsComponent.js";
|
|
1
|
+
import type { GridSlotsComponent } from '@mui/x-data-grid';
|
|
2
|
+
import type { GridProIconSlotsComponent } from "./gridProIconSlotsComponent.js";
|
|
3
3
|
/**
|
|
4
4
|
* Grid components React prop interface containing all the overridable components
|
|
5
5
|
* for Pro package
|
package/models/gridStatePro.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GridInitialState as GridInitialStateCommunity, GridState as GridStateCommunity, GridColumnPinningState, GridPinnedColumnFields } from '@mui/x-data-grid';
|
|
1
|
+
import type { GridInitialState as GridInitialStateCommunity, GridState as GridStateCommunity, GridColumnPinningState, GridPinnedColumnFields } from '@mui/x-data-grid';
|
|
2
2
|
import type { GridDetailPanelState, GridDetailPanelInitialState, GridColumnReorderState } from "../hooks/index.js";
|
|
3
3
|
import type { GridDataSourceState } from "../hooks/features/dataSource/models.js";
|
|
4
4
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-pro",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.27.1",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "The Pro plan edition of the MUI X Data Grid components.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"@mui/utils": "^7.3.5",
|
|
38
38
|
"clsx": "^2.1.1",
|
|
39
39
|
"prop-types": "^15.8.1",
|
|
40
|
-
"@mui/x-data-grid": "8.
|
|
41
|
-
"@mui/x-
|
|
42
|
-
"@mui/x-
|
|
40
|
+
"@mui/x-data-grid": "8.27.1",
|
|
41
|
+
"@mui/x-internals": "8.26.0",
|
|
42
|
+
"@mui/x-license": "8.26.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@emotion/react": "^11.9.0",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComponentsOverrides, ComponentsProps } from '@mui/material/styles';
|
|
2
|
-
import { DataGridProProps } from "../models/dataGridProProps.js";
|
|
1
|
+
import type { ComponentsOverrides, ComponentsProps } from '@mui/material/styles';
|
|
2
|
+
import type { DataGridProProps } from "../models/dataGridProProps.js";
|
|
3
3
|
export interface DataGridProComponentsPropsList {
|
|
4
4
|
MuiDataGrid: DataGridProProps;
|
|
5
5
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { GridRowId, GridPinnedColumnFields } from '@mui/x-data-grid';
|
|
1
|
+
import type { GridRowId, GridPinnedColumnFields } from '@mui/x-data-grid';
|
|
2
2
|
import type { GridRowScrollEndParams, GridRowOrderChangeParams, GridFetchRowsParams } from "../models/index.js";
|
|
3
3
|
import type { GridRenderHeaderFilterProps } from "../components/headerFiltering/GridHeaderFilterCell.js";
|
|
4
4
|
import type { GridColumnPinningInternalCache } from "../hooks/features/columnPinning/gridColumnPinningInterface.js";
|
|
5
5
|
import type { GridCanBeReorderedPreProcessingContext } from "../hooks/features/columnReorder/columnReorderInterfaces.js";
|
|
6
|
-
import { GridRowPinningInternalCache } from "../hooks/features/rowPinning/gridRowPinningInterface.js";
|
|
6
|
+
import type { GridRowPinningInternalCache } from "../hooks/features/rowPinning/gridRowPinningInterface.js";
|
|
7
7
|
export interface GridColDefPro {
|
|
8
8
|
/**
|
|
9
9
|
* Allows to render a component in the column header filter cell.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { GridRowTreeConfig } from '@mui/x-data-grid';
|
|
2
|
-
import { GridRowTreeCreationValue } from '@mui/x-data-grid/internals';
|
|
3
|
-
import { RowTreeBuilderNode, GridTreePathDuplicateHandler } from "./models.js";
|
|
4
|
-
import { DataGridProProps } from "../../models/dataGridProProps.js";
|
|
1
|
+
import { type GridRowTreeConfig } from '@mui/x-data-grid';
|
|
2
|
+
import { type GridRowTreeCreationValue } from '@mui/x-data-grid/internals';
|
|
3
|
+
import type { RowTreeBuilderNode, GridTreePathDuplicateHandler } from "./models.js";
|
|
4
|
+
import type { DataGridProProps } from "../../models/dataGridProProps.js";
|
|
5
5
|
interface CreateRowTreeParams {
|
|
6
6
|
previousTree: GridRowTreeConfig | null;
|
|
7
7
|
nodes: RowTreeBuilderNode[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { GridRowId, GridRowTreeConfig } from '@mui/x-data-grid';
|
|
2
|
-
import { GridTreeDepths } from '@mui/x-data-grid/internals';
|
|
3
|
-
import { GridTreePathDuplicateHandler, RowTreeBuilderGroupingCriterion } from "./models.js";
|
|
4
|
-
import { DataGridProProps } from "../../models/dataGridProProps.js";
|
|
1
|
+
import { type GridRowId, type GridRowTreeConfig } from '@mui/x-data-grid';
|
|
2
|
+
import type { GridTreeDepths } from '@mui/x-data-grid/internals';
|
|
3
|
+
import type { GridTreePathDuplicateHandler, RowTreeBuilderGroupingCriterion } from "./models.js";
|
|
4
|
+
import type { DataGridProProps } from "../../models/dataGridProProps.js";
|
|
5
5
|
interface InsertDataRowInTreeParams {
|
|
6
6
|
/**
|
|
7
7
|
* ID of the data row to insert in the tree.
|
package/utils/tree/models.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GridRowId, GridRowTreeConfig } from '@mui/x-data-grid';
|
|
2
|
-
import { GridTreeDepths } from '@mui/x-data-grid/internals';
|
|
1
|
+
import { type GridRowId, type GridRowTreeConfig } from '@mui/x-data-grid';
|
|
2
|
+
import type { GridTreeDepths } from '@mui/x-data-grid/internals';
|
|
3
3
|
interface RemoveDataRowFromTreeParams {
|
|
4
4
|
/**
|
|
5
5
|
* ID of the data row to remove from the tree.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GridRowId, GridRowTreeConfig } from '@mui/x-data-grid';
|
|
2
|
-
import { GridSortingModelApplier } from '@mui/x-data-grid/internals';
|
|
1
|
+
import { type GridRowId, type GridRowTreeConfig } from '@mui/x-data-grid';
|
|
2
|
+
import type { GridSortingModelApplier } from '@mui/x-data-grid/internals';
|
|
3
3
|
interface SortRowTreeParams {
|
|
4
4
|
rowTree: GridRowTreeConfig;
|
|
5
5
|
disableChildrenSorting: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { GridGroupNode, GridRowId, GridRowTreeConfig } from '@mui/x-data-grid';
|
|
2
|
-
import { GridRowTreeCreationValue, GridTreeDepths } from '@mui/x-data-grid/internals';
|
|
3
|
-
import { GridTreePathDuplicateHandler, RowTreeBuilderNode } from "./models.js";
|
|
1
|
+
import { type GridGroupNode, type GridRowId, type GridRowTreeConfig } from '@mui/x-data-grid';
|
|
2
|
+
import { type GridRowTreeCreationValue, type GridTreeDepths } from '@mui/x-data-grid/internals';
|
|
3
|
+
import type { GridTreePathDuplicateHandler, RowTreeBuilderNode } from "./models.js";
|
|
4
4
|
export interface UpdateRowTreeNodes {
|
|
5
5
|
inserted: RowTreeBuilderNode[];
|
|
6
6
|
modified: RowTreeBuilderNode[];
|
package/utils/tree/utils.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { GridFilterState, GridGroupNode, GridRowId, GridRowTreeConfig, GridRowsState, GridTreeNode } from '@mui/x-data-grid';
|
|
2
|
-
import { GridTreeDepths } from '@mui/x-data-grid/internals';
|
|
3
|
-
import { RowTreeBuilderGroupingCriterion } from "./models.js";
|
|
4
|
-
import { DataGridProProps } from "../../models/dataGridProProps.js";
|
|
1
|
+
import { type GridFilterState, type GridGroupNode, type GridRowId, type GridRowTreeConfig, type GridRowsState, type GridTreeNode } from '@mui/x-data-grid';
|
|
2
|
+
import type { GridTreeDepths } from '@mui/x-data-grid/internals';
|
|
3
|
+
import type { RowTreeBuilderGroupingCriterion } from "./models.js";
|
|
4
|
+
import type { DataGridProProps } from "../../models/dataGridProProps.js";
|
|
5
5
|
import type { GridStatePro } from "../../models/gridStatePro.js";
|
|
6
6
|
export declare const getGroupRowIdFromPath: (path: RowTreeBuilderGroupingCriterion[]) => string;
|
|
7
7
|
export declare const getNodePathInTree: ({
|