@mui/x-data-grid-pro 5.9.0 → 5.11.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 +284 -10
- package/DataGridPro/DataGridPro.d.ts +1 -1
- package/DataGridPro/DataGridPro.js +50 -2
- package/DataGridPro/useDataGridProComponent.js +6 -2
- package/DataGridPro/useDataGridProProps.js +20 -5
- package/LICENSE +4 -4
- package/README.md +5 -4
- package/components/DataGridProColumnHeaders.js +2 -2
- package/components/DataGridProVirtualScroller.js +7 -4
- package/components/GridGroupingCriteriaCell.js +2 -2
- package/components/GridRowReorderCell.d.ts +5 -0
- package/components/GridRowReorderCell.js +72 -0
- package/components/GridTreeDataGroupingCell.js +2 -2
- package/hooks/features/columnPinning/useGridColumnPinning.js +4 -4
- package/hooks/features/columnReorder/useGridColumnReorder.d.ts +0 -1
- package/hooks/features/columnReorder/useGridColumnReorder.js +8 -9
- package/hooks/features/columnResize/useGridColumnResize.d.ts +0 -1
- package/hooks/features/columnResize/useGridColumnResize.js +13 -14
- package/hooks/features/detailPanel/useGridDetailPanel.js +4 -4
- package/hooks/features/detailPanel/useGridDetailPanelCache.js +2 -2
- package/hooks/features/index.d.ts +1 -1
- package/hooks/features/index.js +1 -1
- package/hooks/features/infiniteLoader/useGridInfiniteLoader.d.ts +0 -1
- package/hooks/features/infiniteLoader/useGridInfiniteLoader.js +4 -5
- package/hooks/features/rowGrouping/createGroupingColDef.d.ts +1 -1
- package/hooks/features/rowGrouping/gridRowGroupingInterfaces.d.ts +1 -1
- package/hooks/features/rowGrouping/gridRowGroupingUtils.js +4 -4
- package/hooks/features/rowGrouping/useGridRowGrouping.d.ts +0 -2
- package/hooks/features/rowGrouping/useGridRowGrouping.js +6 -8
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +2 -2
- package/hooks/features/rowReorder/gridRowReorderColDef.d.ts +2 -0
- package/hooks/features/rowReorder/gridRowReorderColDef.js +18 -0
- package/hooks/features/rowReorder/index.d.ts +1 -0
- package/hooks/features/rowReorder/index.js +1 -0
- package/hooks/features/rowReorder/useGridRowReorder.d.ts +8 -0
- package/hooks/features/rowReorder/useGridRowReorder.js +111 -0
- package/hooks/features/rowReorder/useGridRowReorderPreProcessors.d.ts +4 -0
- package/hooks/features/rowReorder/useGridRowReorderPreProcessors.js +51 -0
- package/hooks/features/treeData/useGridTreeData.d.ts +0 -3
- package/hooks/features/treeData/useGridTreeData.js +2 -6
- package/index.d.ts +6 -1
- package/index.js +7 -3
- package/internals/index.d.ts +19 -0
- package/internals/index.js +17 -0
- package/internals/package.json +6 -0
- package/legacy/DataGridPro/DataGridPro.js +50 -2
- package/legacy/DataGridPro/useDataGridProComponent.js +6 -2
- package/legacy/DataGridPro/useDataGridProProps.js +20 -5
- package/legacy/components/DataGridProColumnHeaders.js +2 -2
- package/legacy/components/DataGridProVirtualScroller.js +7 -4
- package/legacy/components/GridGroupingCriteriaCell.js +2 -2
- package/legacy/components/GridRowReorderCell.js +74 -0
- package/legacy/components/GridTreeDataGroupingCell.js +2 -2
- package/legacy/hooks/features/columnPinning/useGridColumnPinning.js +4 -4
- package/legacy/hooks/features/columnReorder/useGridColumnReorder.js +8 -9
- package/legacy/hooks/features/columnResize/useGridColumnResize.js +13 -14
- package/legacy/hooks/features/detailPanel/useGridDetailPanel.js +4 -4
- package/legacy/hooks/features/detailPanel/useGridDetailPanelCache.js +2 -2
- package/legacy/hooks/features/index.js +1 -1
- package/legacy/hooks/features/infiniteLoader/useGridInfiniteLoader.js +4 -5
- package/legacy/hooks/features/rowGrouping/gridRowGroupingUtils.js +5 -5
- package/legacy/hooks/features/rowGrouping/useGridRowGrouping.js +6 -8
- package/legacy/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +2 -2
- package/legacy/hooks/features/rowReorder/gridRowReorderColDef.js +20 -0
- package/legacy/hooks/features/rowReorder/index.js +1 -0
- package/legacy/hooks/features/rowReorder/useGridRowReorder.js +115 -0
- package/legacy/hooks/features/rowReorder/useGridRowReorderPreProcessors.js +52 -0
- package/legacy/hooks/features/treeData/useGridTreeData.js +2 -6
- package/legacy/index.js +7 -3
- package/legacy/internals/index.js +17 -0
- package/legacy/models/gridRowOrderChangeParams.js +1 -0
- package/legacy/models/index.js +1 -2
- package/legacy/typeOverloads/index.js +1 -0
- package/legacy/utils/index.js +1 -0
- package/legacy/utils/releaseInfo.js +1 -1
- package/legacy/utils/tree/buildRowTree.js +11 -4
- package/legacy/utils/tree/index.js +1 -0
- package/models/dataGridProProps.d.ts +36 -24
- package/models/gridApiPro.d.ts +3 -2
- package/models/gridRowOrderChangeParams.d.ts +18 -0
- package/models/gridRowOrderChangeParams.js +1 -0
- package/models/gridStatePro.d.ts +4 -3
- package/models/index.d.ts +1 -2
- package/models/index.js +1 -2
- package/modern/DataGridPro/DataGridPro.js +50 -2
- package/modern/DataGridPro/useDataGridProComponent.js +6 -2
- package/modern/DataGridPro/useDataGridProProps.js +16 -3
- package/modern/components/DataGridProColumnHeaders.js +2 -2
- package/modern/components/DataGridProVirtualScroller.js +7 -4
- package/modern/components/GridGroupingCriteriaCell.js +2 -2
- package/modern/components/GridRowReorderCell.js +72 -0
- package/modern/components/GridTreeDataGroupingCell.js +2 -2
- package/modern/hooks/features/columnPinning/useGridColumnPinning.js +4 -4
- package/modern/hooks/features/columnReorder/useGridColumnReorder.js +8 -9
- package/modern/hooks/features/columnResize/useGridColumnResize.js +13 -14
- package/modern/hooks/features/detailPanel/useGridDetailPanel.js +4 -4
- package/modern/hooks/features/detailPanel/useGridDetailPanelCache.js +2 -2
- package/modern/hooks/features/index.js +1 -1
- package/modern/hooks/features/infiniteLoader/useGridInfiniteLoader.js +4 -5
- package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.js +4 -4
- package/modern/hooks/features/rowGrouping/useGridRowGrouping.js +6 -8
- package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +2 -2
- package/modern/hooks/features/rowReorder/gridRowReorderColDef.js +18 -0
- package/modern/hooks/features/rowReorder/index.js +1 -0
- package/modern/hooks/features/rowReorder/useGridRowReorder.js +111 -0
- package/modern/hooks/features/rowReorder/useGridRowReorderPreProcessors.js +51 -0
- package/modern/hooks/features/treeData/useGridTreeData.js +2 -6
- package/modern/index.js +7 -3
- package/modern/internals/index.js +17 -0
- package/modern/models/gridRowOrderChangeParams.js +1 -0
- package/modern/models/index.js +1 -2
- package/modern/typeOverloads/index.js +1 -0
- package/modern/utils/index.js +1 -0
- package/modern/utils/releaseInfo.js +1 -1
- package/modern/utils/tree/buildRowTree.js +9 -2
- package/modern/utils/tree/index.js +1 -0
- package/node/DataGridPro/DataGridPro.js +50 -2
- package/node/DataGridPro/useDataGridProComponent.js +10 -4
- package/node/DataGridPro/useDataGridProProps.js +21 -5
- package/node/components/DataGridProColumnHeaders.js +1 -1
- package/node/components/DataGridProVirtualScroller.js +6 -3
- package/node/components/GridGroupingCriteriaCell.js +1 -1
- package/node/components/GridRowReorderCell.js +92 -0
- package/node/components/GridTreeDataGroupingCell.js +1 -1
- package/node/hooks/features/columnPinning/useGridColumnPinning.js +3 -3
- package/node/hooks/features/columnReorder/useGridColumnReorder.js +7 -8
- package/node/hooks/features/columnResize/useGridColumnResize.js +12 -13
- package/node/hooks/features/detailPanel/useGridDetailPanel.js +3 -3
- package/node/hooks/features/detailPanel/useGridDetailPanelCache.js +1 -1
- package/node/hooks/features/index.js +4 -4
- package/node/hooks/features/infiniteLoader/useGridInfiniteLoader.js +3 -4
- package/node/hooks/features/rowGrouping/gridRowGroupingUtils.js +4 -4
- package/node/hooks/features/rowGrouping/useGridRowGrouping.js +5 -7
- package/node/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +4 -4
- package/node/hooks/features/rowReorder/gridRowReorderColDef.js +31 -0
- package/node/hooks/features/rowReorder/index.js +18 -0
- package/node/hooks/features/rowReorder/useGridRowReorder.js +126 -0
- package/node/hooks/features/rowReorder/useGridRowReorderPreProcessors.js +70 -0
- package/node/hooks/features/treeData/useGridTreeData.js +1 -4
- package/node/index.js +45 -3
- package/node/internals/index.js +193 -0
- package/node/models/gridRowOrderChangeParams.js +5 -0
- package/node/models/index.js +4 -4
- package/node/typeOverloads/index.js +18 -0
- package/node/utils/index.js +18 -0
- package/node/utils/releaseInfo.js +1 -1
- package/node/utils/tree/buildRowTree.js +12 -2
- package/node/utils/tree/index.js +13 -0
- package/package.json +6 -5
- package/typeOverloads/index.d.ts +1 -0
- package/typeOverloads/index.js +1 -0
- package/typeOverloads/modules.d.ts +41 -15
- package/typeOverloads/package.json +6 -0
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/utils/package.json +6 -0
- package/utils/releaseInfo.js +1 -1
- package/utils/tree/buildRowTree.d.ts +1 -0
- package/utils/tree/buildRowTree.js +9 -2
- package/utils/tree/index.d.ts +1 -0
- package/utils/tree/index.js +1 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "getGroupRowIdFromPath", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _buildRowTree.getGroupRowIdFromPath;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _buildRowTree = require("./buildRowTree");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-pro",
|
|
3
|
-
"version": "5.
|
|
4
|
-
"description": "The
|
|
3
|
+
"version": "5.11.1",
|
|
4
|
+
"description": "The Pro plan edition of the data grid component (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
7
7
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -31,9 +31,10 @@
|
|
|
31
31
|
"directory": "packages/grid/x-data-grid-pro"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@
|
|
35
|
-
"@mui/
|
|
36
|
-
"@mui/x-
|
|
34
|
+
"@babel/runtime": "^7.17.2",
|
|
35
|
+
"@mui/utils": "^5.7.0",
|
|
36
|
+
"@mui/x-data-grid": "5.11.1",
|
|
37
|
+
"@mui/x-license-pro": "5.11.1",
|
|
37
38
|
"@types/format-util": "^1.0.2",
|
|
38
39
|
"clsx": "^1.0.4",
|
|
39
40
|
"prop-types": "^15.8.1",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './modules';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './modules';
|
|
@@ -1,19 +1,53 @@
|
|
|
1
|
-
import { GridKeyValue, GridValidRowModel } from '@mui/x-data-grid';
|
|
2
|
-
import type { GridRowScrollEndParams,
|
|
3
|
-
import type { GridPinnedColumns
|
|
1
|
+
import { GridKeyValue, GridRowId, GridValidRowModel } from '@mui/x-data-grid';
|
|
2
|
+
import type { GridRowScrollEndParams, GridRowOrderChangeParams } from '../models';
|
|
3
|
+
import type { GridPinnedColumns } from '../hooks';
|
|
4
4
|
import type { GridCanBeReorderedPreProcessingContext } from '../hooks/features/columnReorder/columnReorderInterfaces';
|
|
5
|
+
import { GridGroupingValueGetterParams } from '../models/gridGroupingValueGetterParams';
|
|
6
|
+
import { GridRowGroupingModel } from '../hooks/features/rowGrouping';
|
|
5
7
|
export interface GridControlledStateEventLookupPro {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Fired when the open detail panels are changed.
|
|
10
|
+
* @ignore - do not document.
|
|
11
|
+
*/
|
|
12
|
+
detailPanelsExpandedRowIdsChange: {
|
|
13
|
+
params: GridRowId[];
|
|
8
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* Fired when the pinned columns is changed.
|
|
17
|
+
* @ignore - do not document.
|
|
18
|
+
*/
|
|
9
19
|
pinnedColumnsChange: {
|
|
10
20
|
params: GridPinnedColumns;
|
|
11
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* Fired when the row grouping model changes.
|
|
24
|
+
* TODO: Add back on premium when removing it from pro
|
|
25
|
+
*/
|
|
26
|
+
rowGroupingModelChange: {
|
|
27
|
+
params: GridRowGroupingModel;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export interface GridColDefPro<R extends GridValidRowModel = any, V = any, F = V> {
|
|
31
|
+
/**
|
|
32
|
+
* Function that transforms a complex cell value into a key that be used for grouping the rows.
|
|
33
|
+
* @param {GridGroupingValueGetterParams} params Object containing parameters for the getter.
|
|
34
|
+
* @returns {GridKeyValue | null | undefined} The cell key.
|
|
35
|
+
*/
|
|
36
|
+
groupingValueGetter?: (params: GridGroupingValueGetterParams<V, R>) => GridKeyValue | null | undefined;
|
|
12
37
|
}
|
|
13
38
|
export interface GridEventLookupPro {
|
|
39
|
+
/**
|
|
40
|
+
* Fired when scrolling to the bottom of the grid viewport.
|
|
41
|
+
*/
|
|
14
42
|
rowsScrollEnd: {
|
|
15
43
|
params: GridRowScrollEndParams;
|
|
16
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* Fired when the user ends reordering a row.
|
|
47
|
+
*/
|
|
48
|
+
rowOrderChange: {
|
|
49
|
+
params: GridRowOrderChangeParams;
|
|
50
|
+
};
|
|
17
51
|
}
|
|
18
52
|
export interface GridPipeProcessingLookupPro {
|
|
19
53
|
canBeReordered: {
|
|
@@ -21,19 +55,11 @@ export interface GridPipeProcessingLookupPro {
|
|
|
21
55
|
context: GridCanBeReorderedPreProcessingContext;
|
|
22
56
|
};
|
|
23
57
|
}
|
|
24
|
-
export interface GridColDefPro<R extends GridValidRowModel = any, V = any, F = V> {
|
|
25
|
-
/**
|
|
26
|
-
* Function that transforms a complex cell value into a key that be used for grouping the rows.
|
|
27
|
-
* @param {GridGroupingValueGetterParams} params Object containing parameters for the getter.
|
|
28
|
-
* @returns {GridKeyValue | null | undefined} The cell key.
|
|
29
|
-
*/
|
|
30
|
-
groupingValueGetter?: (params: GridGroupingValueGetterParams<V, R>) => GridKeyValue | null | undefined;
|
|
31
|
-
}
|
|
32
58
|
declare module '@mui/x-data-grid' {
|
|
33
|
-
interface GridColDef<R extends GridValidRowModel = any, V = any, F = V> extends GridColDefPro<R, V, F> {
|
|
34
|
-
}
|
|
35
59
|
interface GridEventLookup extends GridEventLookupPro {
|
|
36
60
|
}
|
|
61
|
+
interface GridColDef<R extends GridValidRowModel = any, V = any, F = V> extends GridColDefPro<R, V, F> {
|
|
62
|
+
}
|
|
37
63
|
interface GridControlledStateEventLookup extends GridControlledStateEventLookupPro {
|
|
38
64
|
}
|
|
39
65
|
interface GridPipeProcessingLookup extends GridPipeProcessingLookupPro {
|
package/utils/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tree';
|
package/utils/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tree';
|
package/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 = "MTY1Mjk5NzYwMDAwMA==";
|
|
4
4
|
|
|
5
5
|
if (process.env.NODE_ENV !== 'production') {
|
|
6
6
|
// A simple hack to set the value in the test environment (has no build step).
|
|
@@ -14,6 +14,7 @@ interface BuildRowTreeParams extends GridRowTreeCreationParams {
|
|
|
14
14
|
groupingName: string;
|
|
15
15
|
onDuplicatePath?: (firstId: GridRowId, secondId: GridRowId, path: BuildRowTreeGroupingCriteria[]) => void;
|
|
16
16
|
}
|
|
17
|
+
export declare const getGroupRowIdFromPath: (path: BuildRowTreeGroupingCriteria[]) => string;
|
|
17
18
|
/**
|
|
18
19
|
* Transform a list of rows into a tree structure where each row references its parent and children.
|
|
19
20
|
* If a row have a parent which does not exist in the input rows, creates an auto generated row
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
|
|
2
|
+
export const getGroupRowIdFromPath = path => {
|
|
3
|
+
const pathStr = path.map(groupingCriteria => `${groupingCriteria.field}/${groupingCriteria.key}`).join('-');
|
|
4
|
+
return `auto-generated-row-${pathStr}`;
|
|
5
|
+
};
|
|
3
6
|
/**
|
|
4
7
|
* Transform a list of rows into a tree structure where each row references its parent and children.
|
|
5
8
|
* If a row have a parent which does not exist in the input rows, creates an auto generated row
|
|
@@ -29,6 +32,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
29
32
|
}
|
|
30
33
|
```
|
|
31
34
|
*/
|
|
35
|
+
|
|
32
36
|
export const buildRowTree = params => {
|
|
33
37
|
// During the build, we store the children as a Record to avoid linear complexity when checking if a children is already defined.
|
|
34
38
|
const tempTree = {};
|
|
@@ -37,6 +41,8 @@ export const buildRowTree = params => {
|
|
|
37
41
|
|
|
38
42
|
const idRowsLookup = _extends({}, params.idRowsLookup);
|
|
39
43
|
|
|
44
|
+
const idToIdLookup = _extends({}, params.idToIdLookup);
|
|
45
|
+
|
|
40
46
|
const groupingCriteriaToIdTree = {};
|
|
41
47
|
|
|
42
48
|
const isGroupExpandedByDefault = node => {
|
|
@@ -92,7 +98,7 @@ export const buildRowTree = params => {
|
|
|
92
98
|
if (depth === row.path.length - 1) {
|
|
93
99
|
nodeId = row.id;
|
|
94
100
|
} else {
|
|
95
|
-
nodeId =
|
|
101
|
+
nodeId = getGroupRowIdFromPath(row.path.slice(0, depth + 1));
|
|
96
102
|
}
|
|
97
103
|
|
|
98
104
|
keyConfig = {
|
|
@@ -174,6 +180,7 @@ export const buildRowTree = params => {
|
|
|
174
180
|
treeDepth,
|
|
175
181
|
ids,
|
|
176
182
|
idRowsLookup,
|
|
183
|
+
idToIdLookup,
|
|
177
184
|
groupingName: params.groupingName
|
|
178
185
|
};
|
|
179
186
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getGroupRowIdFromPath } from './buildRowTree';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getGroupRowIdFromPath } from './buildRowTree';
|