@mui/x-data-grid-pro 7.7.1 → 7.9.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 +166 -1
- package/DataGridPro/DataGridPro.js +13 -1
- package/DataGridPro/useDataGridProComponent.js +6 -1
- package/DataGridPro/useDataGridProProps.js +10 -3
- package/components/GridDataSourceTreeDataGroupingCell.d.ts +12 -0
- package/components/GridDataSourceTreeDataGroupingCell.js +120 -0
- package/components/GridDetailPanel.js +2 -2
- package/components/GridTreeDataGroupingCell.js +1 -4
- package/esm/DataGridPro/DataGridPro.js +13 -1
- package/esm/DataGridPro/useDataGridProComponent.js +6 -1
- package/esm/DataGridPro/useDataGridProProps.js +9 -3
- package/esm/components/GridDataSourceTreeDataGroupingCell.js +111 -0
- package/esm/components/GridDetailPanel.js +1 -1
- package/esm/components/GridTreeDataGroupingCell.js +1 -4
- package/esm/hooks/features/dataSource/cache.js +36 -0
- package/esm/hooks/features/dataSource/gridDataSourceSelector.js +24 -0
- package/esm/hooks/features/dataSource/useGridDataSource.js +218 -0
- package/esm/hooks/features/dataSource/utils.js +87 -0
- package/esm/hooks/features/index.js +3 -1
- package/esm/hooks/features/serverSideTreeData/useGridDataSourceTreeDataPreProcessors.js +148 -0
- package/esm/hooks/features/serverSideTreeData/utils.js +18 -0
- package/esm/hooks/features/treeData/useGridTreeData.js +6 -2
- package/esm/hooks/features/treeData/useGridTreeDataPreProcessors.js +6 -3
- package/esm/internals/index.js +2 -0
- package/esm/internals/propValidation.js +1 -1
- package/esm/models/index.js +2 -1
- package/esm/utils/releaseInfo.js +1 -1
- package/esm/utils/tree/createRowTree.js +6 -2
- package/esm/utils/tree/insertDataRowInTree.js +34 -10
- package/esm/utils/tree/updateRowTree.js +13 -5
- package/esm/utils/tree/utils.js +5 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +1 -1
- package/hooks/features/columnPinning/useGridColumnPinning.d.ts +1 -1
- package/hooks/features/columnReorder/useGridColumnReorder.d.ts +1 -1
- package/hooks/features/dataSource/cache.d.ts +18 -0
- package/hooks/features/dataSource/cache.js +43 -0
- package/hooks/features/dataSource/gridDataSourceSelector.d.ts +14 -0
- package/hooks/features/dataSource/gridDataSourceSelector.js +32 -0
- package/hooks/features/dataSource/interfaces.d.ts +50 -0
- package/hooks/features/dataSource/useGridDataSource.d.ts +6 -0
- package/hooks/features/dataSource/useGridDataSource.js +229 -0
- package/hooks/features/dataSource/utils.d.ts +29 -0
- package/hooks/features/dataSource/utils.js +95 -0
- package/hooks/features/detailPanel/gridDetailPanelSelector.d.ts +0 -1
- package/hooks/features/detailPanel/useGridDetailPanel.d.ts +1 -1
- package/hooks/features/index.d.ts +2 -0
- package/hooks/features/index.js +22 -0
- package/hooks/features/infiniteLoader/useGridInfiniteLoader.d.ts +1 -1
- package/hooks/features/lazyLoader/useGridLazyLoader.d.ts +1 -1
- package/hooks/features/lazyLoader/useGridLazyLoaderPreProcessors.d.ts +1 -1
- package/hooks/features/rowPinning/useGridRowPinning.d.ts +1 -1
- package/hooks/features/rowPinning/useGridRowPinningPreProcessors.d.ts +2 -2
- package/hooks/features/rowReorder/useGridRowReorder.d.ts +1 -1
- package/hooks/features/serverSideTreeData/useGridDataSourceTreeDataPreProcessors.d.ts +4 -0
- package/hooks/features/serverSideTreeData/useGridDataSourceTreeDataPreProcessors.js +158 -0
- package/hooks/features/serverSideTreeData/utils.d.ts +6 -0
- package/hooks/features/serverSideTreeData/utils.js +25 -0
- package/hooks/features/treeData/gridTreeDataUtils.d.ts +1 -2
- package/hooks/features/treeData/useGridTreeData.d.ts +2 -1
- package/hooks/features/treeData/useGridTreeData.js +6 -2
- package/hooks/features/treeData/useGridTreeDataPreProcessors.d.ts +1 -1
- package/hooks/features/treeData/useGridTreeDataPreProcessors.js +6 -3
- package/hooks/utils/useGridApiContext.d.ts +0 -1
- package/hooks/utils/useGridApiRef.d.ts +0 -1
- package/hooks/utils/useGridPrivateApiContext.d.ts +0 -1
- package/index.js +1 -1
- package/internals/index.d.ts +2 -0
- package/internals/index.js +23 -0
- package/internals/propValidation.js +1 -1
- package/material/index.d.ts +0 -1
- package/models/dataGridProProps.d.ts +17 -11
- package/models/gridApiPro.d.ts +3 -3
- package/models/gridProSlotsComponent.d.ts +0 -1
- package/models/gridStatePro.d.ts +2 -0
- package/models/index.d.ts +1 -0
- package/modern/DataGridPro/DataGridPro.js +13 -1
- package/modern/DataGridPro/useDataGridProComponent.js +6 -1
- package/modern/DataGridPro/useDataGridProProps.js +9 -3
- package/modern/components/GridDataSourceTreeDataGroupingCell.js +111 -0
- package/modern/components/GridDetailPanel.js +1 -1
- package/modern/components/GridTreeDataGroupingCell.js +1 -4
- package/modern/hooks/features/dataSource/cache.js +36 -0
- package/modern/hooks/features/dataSource/gridDataSourceSelector.js +24 -0
- package/modern/hooks/features/dataSource/useGridDataSource.js +218 -0
- package/modern/hooks/features/dataSource/utils.js +87 -0
- package/modern/hooks/features/index.js +3 -1
- package/modern/hooks/features/serverSideTreeData/useGridDataSourceTreeDataPreProcessors.js +148 -0
- package/modern/hooks/features/serverSideTreeData/utils.js +18 -0
- package/modern/hooks/features/treeData/useGridTreeData.js +6 -2
- package/modern/hooks/features/treeData/useGridTreeDataPreProcessors.js +6 -3
- package/modern/index.js +1 -1
- package/modern/internals/index.js +2 -0
- package/modern/internals/propValidation.js +1 -1
- package/modern/models/index.js +2 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/modern/utils/tree/createRowTree.js +6 -2
- package/modern/utils/tree/insertDataRowInTree.js +34 -10
- package/modern/utils/tree/updateRowTree.js +13 -5
- package/modern/utils/tree/utils.js +5 -1
- package/package.json +6 -5
- package/typeOverloads/modules.d.ts +0 -1
- package/utils/releaseInfo.js +1 -1
- package/utils/tree/createRowTree.js +6 -2
- package/utils/tree/insertDataRowInTree.d.ts +3 -1
- package/utils/tree/insertDataRowInTree.js +33 -9
- package/utils/tree/models.d.ts +1 -0
- package/utils/tree/updateRowTree.d.ts +1 -0
- package/utils/tree/updateRowTree.js +13 -5
- package/utils/tree/utils.d.ts +5 -4
- package/utils/tree/utils.js +7 -2
- package/models/dataSource.d.ts +0 -64
- /package/esm/{models/dataSource.js → hooks/features/dataSource/interfaces.js} +0 -0
- /package/{models/dataSource.js → hooks/features/dataSource/interfaces.js} +0 -0
- /package/modern/{models/dataSource.js → hooks/features/dataSource/interfaces.js} +0 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.runIfServerMode = exports.RequestStatus = exports.NestedDataManager = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
const MAX_CONCURRENT_REQUESTS = Infinity;
|
|
10
|
+
const runIfServerMode = (modeProp, fn) => () => {
|
|
11
|
+
if (modeProp === 'server') {
|
|
12
|
+
fn();
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
exports.runIfServerMode = runIfServerMode;
|
|
16
|
+
let RequestStatus = exports.RequestStatus = /*#__PURE__*/function (RequestStatus) {
|
|
17
|
+
RequestStatus[RequestStatus["QUEUED"] = 0] = "QUEUED";
|
|
18
|
+
RequestStatus[RequestStatus["PENDING"] = 1] = "PENDING";
|
|
19
|
+
RequestStatus[RequestStatus["SETTLED"] = 2] = "SETTLED";
|
|
20
|
+
RequestStatus[RequestStatus["UNKNOWN"] = 3] = "UNKNOWN";
|
|
21
|
+
return RequestStatus;
|
|
22
|
+
}({});
|
|
23
|
+
/**
|
|
24
|
+
* Fetches row children from the server with option to limit the number of concurrent requests
|
|
25
|
+
* Determines the status of a request based on the enum `RequestStatus`
|
|
26
|
+
* Uses `GridRowId` to uniquely identify a request
|
|
27
|
+
*/
|
|
28
|
+
class NestedDataManager {
|
|
29
|
+
constructor(privateApiRef, maxConcurrentRequests = MAX_CONCURRENT_REQUESTS) {
|
|
30
|
+
this.pendingRequests = new Set();
|
|
31
|
+
this.queuedRequests = new Set();
|
|
32
|
+
this.settledRequests = new Set();
|
|
33
|
+
this.api = void 0;
|
|
34
|
+
this.maxConcurrentRequests = void 0;
|
|
35
|
+
this.processQueue = async () => {
|
|
36
|
+
if (this.queuedRequests.size === 0 || this.pendingRequests.size >= this.maxConcurrentRequests) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const loopLength = Math.min(this.maxConcurrentRequests - this.pendingRequests.size, this.queuedRequests.size);
|
|
40
|
+
if (loopLength === 0) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const fetchQueue = Array.from(this.queuedRequests);
|
|
44
|
+
for (let i = 0; i < loopLength; i += 1) {
|
|
45
|
+
const id = fetchQueue[i];
|
|
46
|
+
this.queuedRequests.delete(id);
|
|
47
|
+
this.pendingRequests.add(id);
|
|
48
|
+
this.api.fetchRowChildren(id);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
this.queue = async ids => {
|
|
52
|
+
const loadingIds = {};
|
|
53
|
+
ids.forEach(id => {
|
|
54
|
+
this.queuedRequests.add(id);
|
|
55
|
+
loadingIds[id] = true;
|
|
56
|
+
});
|
|
57
|
+
this.api.setState(state => (0, _extends2.default)({}, state, {
|
|
58
|
+
dataSource: (0, _extends2.default)({}, state.dataSource, {
|
|
59
|
+
loading: (0, _extends2.default)({}, state.dataSource.loading, loadingIds)
|
|
60
|
+
})
|
|
61
|
+
}));
|
|
62
|
+
this.processQueue();
|
|
63
|
+
};
|
|
64
|
+
this.setRequestSettled = id => {
|
|
65
|
+
this.pendingRequests.delete(id);
|
|
66
|
+
this.settledRequests.add(id);
|
|
67
|
+
this.processQueue();
|
|
68
|
+
};
|
|
69
|
+
this.clear = () => {
|
|
70
|
+
this.queuedRequests.clear();
|
|
71
|
+
Array.from(this.pendingRequests).forEach(id => this.clearPendingRequest(id));
|
|
72
|
+
};
|
|
73
|
+
this.clearPendingRequest = id => {
|
|
74
|
+
this.api.unstable_dataSource.setChildrenLoading(id, false);
|
|
75
|
+
this.pendingRequests.delete(id);
|
|
76
|
+
this.processQueue();
|
|
77
|
+
};
|
|
78
|
+
this.getRequestStatus = id => {
|
|
79
|
+
if (this.pendingRequests.has(id)) {
|
|
80
|
+
return RequestStatus.PENDING;
|
|
81
|
+
}
|
|
82
|
+
if (this.queuedRequests.has(id)) {
|
|
83
|
+
return RequestStatus.QUEUED;
|
|
84
|
+
}
|
|
85
|
+
if (this.settledRequests.has(id)) {
|
|
86
|
+
return RequestStatus.SETTLED;
|
|
87
|
+
}
|
|
88
|
+
return RequestStatus.UNKNOWN;
|
|
89
|
+
};
|
|
90
|
+
this.getActiveRequestsCount = () => this.pendingRequests.size + this.queuedRequests.size;
|
|
91
|
+
this.api = privateApiRef.current;
|
|
92
|
+
this.maxConcurrentRequests = maxConcurrentRequests;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
exports.NestedDataManager = NestedDataManager;
|
|
@@ -3,4 +3,4 @@ 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: React.MutableRefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps,
|
|
6
|
+
export declare const useGridDetailPanel: (apiRef: React.MutableRefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "getDetailPanelContent" | "getDetailPanelHeight" | "detailPanelExpandedRowIds" | "onDetailPanelExpandedRowIdsChange">) => void;
|
package/hooks/features/index.js
CHANGED
|
@@ -68,4 +68,26 @@ Object.keys(_rowPinning).forEach(function (key) {
|
|
|
68
68
|
return _rowPinning[key];
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
|
+
});
|
|
72
|
+
var _interfaces = require("./dataSource/interfaces");
|
|
73
|
+
Object.keys(_interfaces).forEach(function (key) {
|
|
74
|
+
if (key === "default" || key === "__esModule") return;
|
|
75
|
+
if (key in exports && exports[key] === _interfaces[key]) return;
|
|
76
|
+
Object.defineProperty(exports, key, {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function () {
|
|
79
|
+
return _interfaces[key];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
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
|
+
});
|
|
71
93
|
});
|
|
@@ -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: React.MutableRefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps,
|
|
9
|
+
export declare const useGridInfiniteLoader: (apiRef: React.MutableRefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "onRowsScrollEnd" | "pagination" | "paginationMode" | "rowsLoadingMode" | "scrollEndThreshold">) => void;
|
|
@@ -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: React.MutableRefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps,
|
|
10
|
+
export declare const useGridLazyLoader: (privateApiRef: React.MutableRefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "onFetchRows" | "rowsLoadingMode" | "pagination" | "paginationMode" | "experimentalFeatures">) => void;
|
|
@@ -2,4 +2,4 @@ import * as React from 'react';
|
|
|
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: React.MutableRefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps,
|
|
5
|
+
export declare const useGridLazyLoaderPreProcessors: (privateApiRef: React.MutableRefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "rowCount" | "rowsLoadingMode" | "experimentalFeatures">) => void;
|
|
@@ -3,4 +3,4 @@ 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: React.MutableRefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps,
|
|
6
|
+
export declare const useGridRowPinning: (apiRef: React.MutableRefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "pinnedRows" | "getRowId">) => void;
|
|
@@ -27,8 +27,8 @@ export declare function addPinnedRow({ groupingParams, rowModel, rowId, position
|
|
|
27
27
|
};
|
|
28
28
|
dataRowIds: GridRowId[];
|
|
29
29
|
additionalRowGroups?: {
|
|
30
|
-
pinnedRows?: import("@mui/x-data-grid/internals").GridPinnedRowsState
|
|
31
|
-
}
|
|
30
|
+
pinnedRows?: import("@mui/x-data-grid/internals").GridPinnedRowsState;
|
|
31
|
+
};
|
|
32
32
|
};
|
|
33
33
|
export declare const useGridRowPinningPreProcessors: (apiRef: React.MutableRefObject<GridPrivateApiPro>) => void;
|
|
34
34
|
export {};
|
|
@@ -5,4 +5,4 @@ import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
|
5
5
|
* Only available in DataGridPro
|
|
6
6
|
* @requires useGridRows (method)
|
|
7
7
|
*/
|
|
8
|
-
export declare const useGridRowReorder: (apiRef: React.MutableRefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps,
|
|
8
|
+
export declare const useGridRowReorder: (apiRef: React.MutableRefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "rowReordering" | "onRowOrderChange" | "classes">) => void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
3
|
+
import { GridPrivateApiPro } from '../../../models/gridApiPro';
|
|
4
|
+
export declare const useGridDataSourceTreeDataPreProcessors: (privateApiRef: React.MutableRefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "treeData" | "groupingColDef" | "disableChildrenSorting" | "disableChildrenFiltering" | "defaultGroupingExpansionDepth" | "isGroupExpandedByDefault" | "unstable_dataSource">) => void;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useGridDataSourceTreeDataPreProcessors = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _xDataGrid = require("@mui/x-data-grid");
|
|
12
|
+
var _internals = require("@mui/x-data-grid/internals");
|
|
13
|
+
var _gridTreeDataGroupColDef = require("../treeData/gridTreeDataGroupColDef");
|
|
14
|
+
var _utils = require("./utils");
|
|
15
|
+
var _GridDataSourceTreeDataGroupingCell = require("../../../components/GridDataSourceTreeDataGroupingCell");
|
|
16
|
+
var _createRowTree = require("../../../utils/tree/createRowTree");
|
|
17
|
+
var _updateRowTree = require("../../../utils/tree/updateRowTree");
|
|
18
|
+
var _utils2 = require("../../../utils/tree/utils");
|
|
19
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
+
const _excluded = ["hideDescendantCount"];
|
|
21
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
22
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
|
+
const DATA_SOURCE_TREE_DATA_STRATEGY = 'dataSourceTreeData';
|
|
24
|
+
const useGridDataSourceTreeDataPreProcessors = (privateApiRef, props) => {
|
|
25
|
+
const setStrategyAvailability = React.useCallback(() => {
|
|
26
|
+
privateApiRef.current.setStrategyAvailability('rowTree', DATA_SOURCE_TREE_DATA_STRATEGY, props.treeData && props.unstable_dataSource ? () => true : () => false);
|
|
27
|
+
}, [privateApiRef, props.treeData, props.unstable_dataSource]);
|
|
28
|
+
const getGroupingColDef = React.useCallback(() => {
|
|
29
|
+
const groupingColDefProp = props.groupingColDef;
|
|
30
|
+
let colDefOverride;
|
|
31
|
+
if (typeof groupingColDefProp === 'function') {
|
|
32
|
+
const params = {
|
|
33
|
+
groupingName: DATA_SOURCE_TREE_DATA_STRATEGY,
|
|
34
|
+
fields: []
|
|
35
|
+
};
|
|
36
|
+
colDefOverride = groupingColDefProp(params);
|
|
37
|
+
} else {
|
|
38
|
+
colDefOverride = groupingColDefProp;
|
|
39
|
+
}
|
|
40
|
+
const _ref = colDefOverride ?? {},
|
|
41
|
+
{
|
|
42
|
+
hideDescendantCount
|
|
43
|
+
} = _ref,
|
|
44
|
+
colDefOverrideProperties = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
45
|
+
const commonProperties = (0, _extends2.default)({}, _gridTreeDataGroupColDef.GRID_TREE_DATA_GROUPING_COL_DEF, {
|
|
46
|
+
renderCell: params => /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridDataSourceTreeDataGroupingCell.GridDataSourceTreeDataGroupingCell, (0, _extends2.default)({}, params, {
|
|
47
|
+
hideDescendantCount: hideDescendantCount
|
|
48
|
+
})),
|
|
49
|
+
headerName: privateApiRef.current.getLocaleText('treeDataGroupingHeaderName')
|
|
50
|
+
});
|
|
51
|
+
return (0, _extends2.default)({}, commonProperties, colDefOverrideProperties, _gridTreeDataGroupColDef.GRID_TREE_DATA_GROUPING_COL_DEF_FORCED_PROPERTIES);
|
|
52
|
+
}, [privateApiRef, props.groupingColDef]);
|
|
53
|
+
const updateGroupingColumn = React.useCallback(columnsState => {
|
|
54
|
+
if (!props.unstable_dataSource) {
|
|
55
|
+
return columnsState;
|
|
56
|
+
}
|
|
57
|
+
const groupingColDefField = _gridTreeDataGroupColDef.GRID_TREE_DATA_GROUPING_COL_DEF_FORCED_PROPERTIES.field;
|
|
58
|
+
const shouldHaveGroupingColumn = props.treeData;
|
|
59
|
+
const prevGroupingColumn = columnsState.lookup[groupingColDefField];
|
|
60
|
+
if (shouldHaveGroupingColumn) {
|
|
61
|
+
const newGroupingColumn = getGroupingColDef();
|
|
62
|
+
if (prevGroupingColumn) {
|
|
63
|
+
newGroupingColumn.width = prevGroupingColumn.width;
|
|
64
|
+
newGroupingColumn.flex = prevGroupingColumn.flex;
|
|
65
|
+
}
|
|
66
|
+
columnsState.lookup[groupingColDefField] = newGroupingColumn;
|
|
67
|
+
if (prevGroupingColumn == null) {
|
|
68
|
+
const index = columnsState.orderedFields[0] === _xDataGrid.GRID_CHECKBOX_SELECTION_FIELD ? 1 : 0;
|
|
69
|
+
columnsState.orderedFields = [...columnsState.orderedFields.slice(0, index), groupingColDefField, ...columnsState.orderedFields.slice(index)];
|
|
70
|
+
}
|
|
71
|
+
} else if (!shouldHaveGroupingColumn && prevGroupingColumn) {
|
|
72
|
+
delete columnsState.lookup[groupingColDefField];
|
|
73
|
+
columnsState.orderedFields = columnsState.orderedFields.filter(field => field !== groupingColDefField);
|
|
74
|
+
}
|
|
75
|
+
return columnsState;
|
|
76
|
+
}, [props.treeData, props.unstable_dataSource, getGroupingColDef]);
|
|
77
|
+
const createRowTreeForTreeData = React.useCallback(params => {
|
|
78
|
+
const getGroupKey = props.unstable_dataSource?.getGroupKey;
|
|
79
|
+
if (!getGroupKey) {
|
|
80
|
+
throw new Error('MUI X: No `getGroupKey` method provided with the dataSource.');
|
|
81
|
+
}
|
|
82
|
+
const getChildrenCount = props.unstable_dataSource?.getChildrenCount;
|
|
83
|
+
if (!getChildrenCount) {
|
|
84
|
+
throw new Error('MUI X: No `getChildrenCount` method provided with the dataSource.');
|
|
85
|
+
}
|
|
86
|
+
const parentPath = params.updates.groupKeys ?? [];
|
|
87
|
+
const getRowTreeBuilderNode = rowId => {
|
|
88
|
+
const count = getChildrenCount(params.dataRowIdToModelLookup[rowId]);
|
|
89
|
+
return {
|
|
90
|
+
id: rowId,
|
|
91
|
+
path: [...parentPath, getGroupKey(params.dataRowIdToModelLookup[rowId])].map(key => ({
|
|
92
|
+
key,
|
|
93
|
+
field: null
|
|
94
|
+
})),
|
|
95
|
+
hasServerChildren: !!count && count !== 0
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
const onDuplicatePath = (firstId, secondId, path) => {
|
|
99
|
+
throw new Error(['MUI X: The values returned by `getGroupKey` for all the sibling rows should be unique.', `The rows with id #${firstId} and #${secondId} have the same.`, `Path: ${JSON.stringify(path.map(step => step.key))}.`].join('\n'));
|
|
100
|
+
};
|
|
101
|
+
if (params.updates.type === 'full') {
|
|
102
|
+
return (0, _createRowTree.createRowTree)({
|
|
103
|
+
previousTree: params.previousTree,
|
|
104
|
+
nodes: params.updates.rows.map(getRowTreeBuilderNode),
|
|
105
|
+
defaultGroupingExpansionDepth: props.defaultGroupingExpansionDepth,
|
|
106
|
+
isGroupExpandedByDefault: props.isGroupExpandedByDefault,
|
|
107
|
+
groupingName: DATA_SOURCE_TREE_DATA_STRATEGY,
|
|
108
|
+
onDuplicatePath
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
return (0, _updateRowTree.updateRowTree)({
|
|
112
|
+
nodes: {
|
|
113
|
+
inserted: params.updates.actions.insert.map(getRowTreeBuilderNode),
|
|
114
|
+
modified: params.updates.actions.modify.map(getRowTreeBuilderNode),
|
|
115
|
+
removed: params.updates.actions.remove
|
|
116
|
+
},
|
|
117
|
+
previousTree: params.previousTree,
|
|
118
|
+
previousGroupsToFetch: params.previousGroupsToFetch,
|
|
119
|
+
previousTreeDepth: params.previousTreeDepths,
|
|
120
|
+
defaultGroupingExpansionDepth: props.defaultGroupingExpansionDepth,
|
|
121
|
+
isGroupExpandedByDefault: props.isGroupExpandedByDefault,
|
|
122
|
+
groupingName: DATA_SOURCE_TREE_DATA_STRATEGY
|
|
123
|
+
});
|
|
124
|
+
}, [props.unstable_dataSource, props.defaultGroupingExpansionDepth, props.isGroupExpandedByDefault]);
|
|
125
|
+
const filterRows = React.useCallback(() => {
|
|
126
|
+
const rowTree = (0, _xDataGrid.gridRowTreeSelector)(privateApiRef);
|
|
127
|
+
return (0, _utils.skipFiltering)(rowTree);
|
|
128
|
+
}, [privateApiRef]);
|
|
129
|
+
const sortRows = React.useCallback(() => {
|
|
130
|
+
const rowTree = (0, _xDataGrid.gridRowTreeSelector)(privateApiRef);
|
|
131
|
+
return (0, _utils.skipSorting)(rowTree);
|
|
132
|
+
}, [privateApiRef]);
|
|
133
|
+
(0, _internals.useGridRegisterPipeProcessor)(privateApiRef, 'hydrateColumns', updateGroupingColumn);
|
|
134
|
+
(0, _internals.useGridRegisterStrategyProcessor)(privateApiRef, DATA_SOURCE_TREE_DATA_STRATEGY, 'rowTreeCreation', createRowTreeForTreeData);
|
|
135
|
+
(0, _internals.useGridRegisterStrategyProcessor)(privateApiRef, DATA_SOURCE_TREE_DATA_STRATEGY, 'filtering', filterRows);
|
|
136
|
+
(0, _internals.useGridRegisterStrategyProcessor)(privateApiRef, DATA_SOURCE_TREE_DATA_STRATEGY, 'sorting', sortRows);
|
|
137
|
+
(0, _internals.useGridRegisterStrategyProcessor)(privateApiRef, DATA_SOURCE_TREE_DATA_STRATEGY, 'visibleRowsLookupCreation', _utils2.getVisibleRowsLookup);
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* 1ST RENDER
|
|
141
|
+
*/
|
|
142
|
+
(0, _xDataGrid.useFirstRender)(() => {
|
|
143
|
+
setStrategyAvailability();
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* EFFECTS
|
|
148
|
+
*/
|
|
149
|
+
const isFirstRender = React.useRef(true);
|
|
150
|
+
React.useEffect(() => {
|
|
151
|
+
if (!isFirstRender.current) {
|
|
152
|
+
setStrategyAvailability();
|
|
153
|
+
} else {
|
|
154
|
+
isFirstRender.current = false;
|
|
155
|
+
}
|
|
156
|
+
}, [setStrategyAvailability]);
|
|
157
|
+
};
|
|
158
|
+
exports.useGridDataSourceTreeDataPreProcessors = useGridDataSourceTreeDataPreProcessors;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { GridRowId, GridRowTreeConfig } from '@mui/x-data-grid';
|
|
2
|
+
export declare function skipFiltering(rowTree: GridRowTreeConfig): {
|
|
3
|
+
filteredRowsLookup: Record<GridRowId, boolean>;
|
|
4
|
+
filteredDescendantCountLookup: Record<GridRowId, number>;
|
|
5
|
+
};
|
|
6
|
+
export declare function skipSorting(rowTree: GridRowTreeConfig): GridRowId[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.skipFiltering = skipFiltering;
|
|
7
|
+
exports.skipSorting = skipSorting;
|
|
8
|
+
var _xDataGrid = require("@mui/x-data-grid");
|
|
9
|
+
var _internals = require("@mui/x-data-grid/internals");
|
|
10
|
+
function skipFiltering(rowTree) {
|
|
11
|
+
const filteredRowsLookup = {};
|
|
12
|
+
const filteredDescendantCountLookup = {};
|
|
13
|
+
const nodes = Object.values(rowTree);
|
|
14
|
+
for (let i = 0; i < nodes.length; i += 1) {
|
|
15
|
+
const node = nodes[i];
|
|
16
|
+
filteredRowsLookup[node.id] = true;
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
filteredRowsLookup,
|
|
20
|
+
filteredDescendantCountLookup
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function skipSorting(rowTree) {
|
|
24
|
+
return (0, _internals.getTreeNodeDescendants)(rowTree, _xDataGrid.GRID_ROOT_GROUP_ID, false);
|
|
25
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { GridRowTreeConfig, GridFilterState, GridFilterModel } from '@mui/x-data-grid';
|
|
3
2
|
import { GridAggregatedFilterItemApplier } from '@mui/x-data-grid/internals';
|
|
4
3
|
import type { GridPrivateApiPro } from '../../../models/gridApiPro';
|
|
@@ -15,5 +14,5 @@ export declare const TREE_DATA_STRATEGY = "tree-data";
|
|
|
15
14
|
* - One of its children is passing the filter
|
|
16
15
|
* - It is passing the filter
|
|
17
16
|
*/
|
|
18
|
-
export declare const filterRowTreeFromTreeData: (params: FilterRowTreeFromTreeDataParams) => Omit<GridFilterState,
|
|
17
|
+
export declare const filterRowTreeFromTreeData: (params: FilterRowTreeFromTreeDataParams) => Omit<GridFilterState, "filterModel">;
|
|
19
18
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GridApiPro } from '../../../models/gridApiPro';
|
|
3
|
-
|
|
3
|
+
import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
4
|
+
export declare const useGridTreeData: (apiRef: React.MutableRefObject<GridApiPro>, props: Pick<DataGridProProcessedProps, "unstable_dataSource">) => void;
|
|
@@ -9,7 +9,7 @@ var _xDataGrid = require("@mui/x-data-grid");
|
|
|
9
9
|
var _gridTreeDataGroupColDef = require("./gridTreeDataGroupColDef");
|
|
10
10
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
11
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
-
const useGridTreeData = apiRef => {
|
|
12
|
+
const useGridTreeData = (apiRef, props) => {
|
|
13
13
|
/**
|
|
14
14
|
* EVENTS
|
|
15
15
|
*/
|
|
@@ -19,9 +19,13 @@ const useGridTreeData = apiRef => {
|
|
|
19
19
|
if (params.rowNode.type !== 'group') {
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
|
+
if (props.unstable_dataSource && !params.rowNode.childrenExpanded) {
|
|
23
|
+
apiRef.current.unstable_dataSource.fetchRows(params.id);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
22
26
|
apiRef.current.setRowChildrenExpansion(params.id, !params.rowNode.childrenExpanded);
|
|
23
27
|
}
|
|
24
|
-
}, [apiRef]);
|
|
28
|
+
}, [apiRef, props.unstable_dataSource]);
|
|
25
29
|
(0, _xDataGrid.useGridApiEventHandler)(apiRef, 'cellKeyDown', handleCellKeyDown);
|
|
26
30
|
};
|
|
27
31
|
exports.useGridTreeData = useGridTreeData;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
3
3
|
import { GridPrivateApiPro } from '../../../models/gridApiPro';
|
|
4
|
-
export declare const useGridTreeDataPreProcessors: (privateApiRef: React.MutableRefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps,
|
|
4
|
+
export declare const useGridTreeDataPreProcessors: (privateApiRef: React.MutableRefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, "treeData" | "groupingColDef" | "getTreeDataPath" | "disableChildrenSorting" | "disableChildrenFiltering" | "defaultGroupingExpansionDepth" | "isGroupExpandedByDefault" | "unstable_dataSource">) => void;
|
|
@@ -23,8 +23,8 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
23
23
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
24
24
|
const useGridTreeDataPreProcessors = (privateApiRef, props) => {
|
|
25
25
|
const setStrategyAvailability = React.useCallback(() => {
|
|
26
|
-
privateApiRef.current.setStrategyAvailability('rowTree', _gridTreeDataUtils.TREE_DATA_STRATEGY, props.treeData ? () => true : () => false);
|
|
27
|
-
}, [privateApiRef, props.treeData]);
|
|
26
|
+
privateApiRef.current.setStrategyAvailability('rowTree', _gridTreeDataUtils.TREE_DATA_STRATEGY, props.treeData && !props.unstable_dataSource ? () => true : () => false);
|
|
27
|
+
}, [privateApiRef, props.treeData, props.unstable_dataSource]);
|
|
28
28
|
const getGroupingColDef = React.useCallback(() => {
|
|
29
29
|
const groupingColDefProp = props.groupingColDef;
|
|
30
30
|
let colDefOverride;
|
|
@@ -51,6 +51,9 @@ const useGridTreeDataPreProcessors = (privateApiRef, props) => {
|
|
|
51
51
|
return (0, _extends2.default)({}, commonProperties, colDefOverrideProperties, _gridTreeDataGroupColDef.GRID_TREE_DATA_GROUPING_COL_DEF_FORCED_PROPERTIES);
|
|
52
52
|
}, [privateApiRef, props.groupingColDef]);
|
|
53
53
|
const updateGroupingColumn = React.useCallback(columnsState => {
|
|
54
|
+
if (props.unstable_dataSource) {
|
|
55
|
+
return columnsState;
|
|
56
|
+
}
|
|
54
57
|
const groupingColDefField = _gridTreeDataGroupColDef.GRID_TREE_DATA_GROUPING_COL_DEF_FORCED_PROPERTIES.field;
|
|
55
58
|
const shouldHaveGroupingColumn = props.treeData;
|
|
56
59
|
const prevGroupingColumn = columnsState.lookup[groupingColDefField];
|
|
@@ -70,7 +73,7 @@ const useGridTreeDataPreProcessors = (privateApiRef, props) => {
|
|
|
70
73
|
columnsState.orderedFields = columnsState.orderedFields.filter(field => field !== groupingColDefField);
|
|
71
74
|
}
|
|
72
75
|
return columnsState;
|
|
73
|
-
}, [props.treeData, getGroupingColDef]);
|
|
76
|
+
}, [props.treeData, props.unstable_dataSource, getGroupingColDef]);
|
|
74
77
|
const createRowTreeForTreeData = React.useCallback(params => {
|
|
75
78
|
if (!props.getTreeDataPath) {
|
|
76
79
|
throw new Error('MUI X: No getTreeDataPath given.');
|
package/index.js
CHANGED
package/internals/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { useGridColumnHeaders } from '../hooks/features/columnHeaders/useGridCol
|
|
|
5
5
|
export { useGridColumnPinning, columnPinningStateInitializer, } from '../hooks/features/columnPinning/useGridColumnPinning';
|
|
6
6
|
export { useGridColumnPinningPreProcessors } from '../hooks/features/columnPinning/useGridColumnPinningPreProcessors';
|
|
7
7
|
export { useGridColumnReorder, columnReorderStateInitializer, } from '../hooks/features/columnReorder/useGridColumnReorder';
|
|
8
|
+
export { useGridDataSourceTreeDataPreProcessors } from '../hooks/features/serverSideTreeData/useGridDataSourceTreeDataPreProcessors';
|
|
8
9
|
export { useGridDetailPanel, detailPanelStateInitializer, } from '../hooks/features/detailPanel/useGridDetailPanel';
|
|
9
10
|
export { useGridDetailPanelPreProcessors } from '../hooks/features/detailPanel/useGridDetailPanelPreProcessors';
|
|
10
11
|
export { useGridInfiniteLoader } from '../hooks/features/infiniteLoader/useGridInfiniteLoader';
|
|
@@ -17,6 +18,7 @@ export { useGridRowPinning, rowPinningStateInitializer, } from '../hooks/feature
|
|
|
17
18
|
export { useGridRowPinningPreProcessors, addPinnedRow, } from '../hooks/features/rowPinning/useGridRowPinningPreProcessors';
|
|
18
19
|
export { useGridLazyLoader } from '../hooks/features/lazyLoader/useGridLazyLoader';
|
|
19
20
|
export { useGridLazyLoaderPreProcessors } from '../hooks/features/lazyLoader/useGridLazyLoaderPreProcessors';
|
|
21
|
+
export { useGridDataSource, dataSourceStateInitializer, } from '../hooks/features/dataSource/useGridDataSource';
|
|
20
22
|
export type { GridExperimentalProFeatures, DataGridProPropsWithoutDefaultValue, DataGridProPropsWithDefaultValue, } from '../models/dataGridProProps';
|
|
21
23
|
export { createRowTree } from '../utils/tree/createRowTree';
|
|
22
24
|
export { updateRowTree } from '../utils/tree/updateRowTree';
|
package/internals/index.js
CHANGED
|
@@ -12,6 +12,7 @@ var _exportNames = {
|
|
|
12
12
|
useGridColumnPinningPreProcessors: true,
|
|
13
13
|
useGridColumnReorder: true,
|
|
14
14
|
columnReorderStateInitializer: true,
|
|
15
|
+
useGridDataSourceTreeDataPreProcessors: true,
|
|
15
16
|
useGridDetailPanel: true,
|
|
16
17
|
detailPanelStateInitializer: true,
|
|
17
18
|
useGridDetailPanelPreProcessors: true,
|
|
@@ -27,6 +28,8 @@ var _exportNames = {
|
|
|
27
28
|
addPinnedRow: true,
|
|
28
29
|
useGridLazyLoader: true,
|
|
29
30
|
useGridLazyLoaderPreProcessors: true,
|
|
31
|
+
useGridDataSource: true,
|
|
32
|
+
dataSourceStateInitializer: true,
|
|
30
33
|
createRowTree: true,
|
|
31
34
|
updateRowTree: true,
|
|
32
35
|
sortRowTree: true,
|
|
@@ -76,6 +79,12 @@ Object.defineProperty(exports, "createRowTree", {
|
|
|
76
79
|
return _createRowTree.createRowTree;
|
|
77
80
|
}
|
|
78
81
|
});
|
|
82
|
+
Object.defineProperty(exports, "dataSourceStateInitializer", {
|
|
83
|
+
enumerable: true,
|
|
84
|
+
get: function () {
|
|
85
|
+
return _useGridDataSource.dataSourceStateInitializer;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
79
88
|
Object.defineProperty(exports, "detailPanelStateInitializer", {
|
|
80
89
|
enumerable: true,
|
|
81
90
|
get: function () {
|
|
@@ -142,6 +151,18 @@ Object.defineProperty(exports, "useGridColumnReorder", {
|
|
|
142
151
|
return _useGridColumnReorder.useGridColumnReorder;
|
|
143
152
|
}
|
|
144
153
|
});
|
|
154
|
+
Object.defineProperty(exports, "useGridDataSource", {
|
|
155
|
+
enumerable: true,
|
|
156
|
+
get: function () {
|
|
157
|
+
return _useGridDataSource.useGridDataSource;
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
Object.defineProperty(exports, "useGridDataSourceTreeDataPreProcessors", {
|
|
161
|
+
enumerable: true,
|
|
162
|
+
get: function () {
|
|
163
|
+
return _useGridDataSourceTreeDataPreProcessors.useGridDataSourceTreeDataPreProcessors;
|
|
164
|
+
}
|
|
165
|
+
});
|
|
145
166
|
Object.defineProperty(exports, "useGridDetailPanel", {
|
|
146
167
|
enumerable: true,
|
|
147
168
|
get: function () {
|
|
@@ -226,6 +247,7 @@ var _useGridColumnHeaders = require("../hooks/features/columnHeaders/useGridColu
|
|
|
226
247
|
var _useGridColumnPinning = require("../hooks/features/columnPinning/useGridColumnPinning");
|
|
227
248
|
var _useGridColumnPinningPreProcessors = require("../hooks/features/columnPinning/useGridColumnPinningPreProcessors");
|
|
228
249
|
var _useGridColumnReorder = require("../hooks/features/columnReorder/useGridColumnReorder");
|
|
250
|
+
var _useGridDataSourceTreeDataPreProcessors = require("../hooks/features/serverSideTreeData/useGridDataSourceTreeDataPreProcessors");
|
|
229
251
|
var _useGridDetailPanel = require("../hooks/features/detailPanel/useGridDetailPanel");
|
|
230
252
|
var _useGridDetailPanelPreProcessors = require("../hooks/features/detailPanel/useGridDetailPanelPreProcessors");
|
|
231
253
|
var _useGridInfiniteLoader = require("../hooks/features/infiniteLoader/useGridInfiniteLoader");
|
|
@@ -238,6 +260,7 @@ var _useGridRowPinning = require("../hooks/features/rowPinning/useGridRowPinning
|
|
|
238
260
|
var _useGridRowPinningPreProcessors = require("../hooks/features/rowPinning/useGridRowPinningPreProcessors");
|
|
239
261
|
var _useGridLazyLoader = require("../hooks/features/lazyLoader/useGridLazyLoader");
|
|
240
262
|
var _useGridLazyLoaderPreProcessors = require("../hooks/features/lazyLoader/useGridLazyLoaderPreProcessors");
|
|
263
|
+
var _useGridDataSource = require("../hooks/features/dataSource/useGridDataSource");
|
|
241
264
|
var _createRowTree = require("../utils/tree/createRowTree");
|
|
242
265
|
var _updateRowTree = require("../utils/tree/updateRowTree");
|
|
243
266
|
var _sortRowTree = require("../utils/tree/sortRowTree");
|
|
@@ -5,4 +5,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.propValidatorsDataGridPro = void 0;
|
|
7
7
|
var _internals = require("@mui/x-data-grid/internals");
|
|
8
|
-
const propValidatorsDataGridPro = exports.propValidatorsDataGridPro = [..._internals.propValidatorsDataGrid, props => props.pagination && props.hideFooterRowCount && 'MUI X: The `hideFooterRowCount` prop has no effect when the pagination is enabled.' || undefined, props => props.treeData && props.filterMode === 'server' && 'MUI X: The `filterMode="server"` prop is not available when the `treeData` is enabled.' || undefined, props => !props.pagination && props.checkboxSelectionVisibleOnly && 'MUI X: The `checkboxSelectionVisibleOnly` prop has no effect when the pagination is not enabled.' || undefined, props => props.signature !== _internals.GridSignature.DataGrid && props.paginationMode === 'client' && props.rowsLoadingMode !== 'server' && (0, _internals.isNumber)(props.rowCount) && 'MUI X: Usage of the `rowCount` prop with client side pagination (`paginationMode="client"`) has no effect. `rowCount` is only meant to be used with `paginationMode="server"`.' || undefined];
|
|
8
|
+
const propValidatorsDataGridPro = exports.propValidatorsDataGridPro = [..._internals.propValidatorsDataGrid, props => props.pagination && props.hideFooterRowCount && 'MUI X: The `hideFooterRowCount` prop has no effect when the pagination is enabled.' || undefined, props => props.treeData && props.filterMode === 'server' && !props.unstable_dataSource && 'MUI X: The `filterMode="server"` prop is not available when the `treeData` is enabled.' || undefined, props => !props.pagination && props.checkboxSelectionVisibleOnly && 'MUI X: The `checkboxSelectionVisibleOnly` prop has no effect when the pagination is not enabled.' || undefined, props => props.signature !== _internals.GridSignature.DataGrid && props.paginationMode === 'client' && props.rowsLoadingMode !== 'server' && (0, _internals.isNumber)(props.rowCount) && 'MUI X: Usage of the `rowCount` prop with client side pagination (`paginationMode="client"`) has no effect. `rowCount` is only meant to be used with `paginationMode="server"`.' || undefined];
|
package/material/index.d.ts
CHANGED