@mui/x-data-grid-pro 7.0.0-beta.7 → 7.0.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 +195 -12
- package/DataGridPro/DataGridPro.js +13 -17
- package/README.md +1 -1
- package/components/headerFiltering/GridHeaderFilterCell.js +2 -3
- package/esm/DataGridPro/DataGridPro.js +13 -17
- package/esm/components/GridDetailPanelToggleCell.js +1 -2
- package/esm/components/GridTreeDataGroupingCell.js +2 -3
- package/esm/components/headerFiltering/GridHeaderFilterCell.js +13 -18
- package/esm/components/headerFiltering/GridHeaderFilterClearButton.js +1 -2
- package/esm/components/headerFiltering/GridHeaderFilterMenu.js +1 -2
- package/esm/components/headerFiltering/GridHeaderFilterMenuContainer.js +1 -2
- package/esm/hooks/features/columnHeaders/useGridColumnHeaders.js +5 -6
- package/esm/hooks/features/columnPinning/useGridColumnPinning.js +7 -10
- package/esm/hooks/features/columnReorder/useGridColumnReorder.js +2 -4
- package/esm/hooks/features/detailPanel/useGridDetailPanel.js +5 -10
- package/esm/hooks/features/detailPanel/useGridDetailPanelCache.js +1 -2
- package/esm/hooks/features/infiniteLoader/useGridInfiniteLoader.js +4 -8
- package/esm/hooks/features/lazyLoader/useGridLazyLoader.js +2 -3
- package/esm/hooks/features/rowPinning/useGridRowPinning.js +3 -5
- package/esm/hooks/features/rowPinning/useGridRowPinningPreProcessors.js +5 -7
- package/esm/hooks/features/treeData/gridTreeDataGroupColDef.js +1 -1
- package/esm/hooks/features/treeData/gridTreeDataUtils.js +1 -2
- package/esm/hooks/features/treeData/useGridTreeDataPreProcessors.js +1 -2
- package/esm/utils/releaseInfo.js +1 -1
- package/esm/utils/tree/insertDataRowInTree.js +8 -9
- package/esm/utils/tree/removeDataRowFromTree.js +3 -3
- package/esm/utils/tree/sortRowTree.js +1 -1
- package/esm/utils/tree/updateRowTree.js +1 -1
- package/esm/utils/tree/utils.js +6 -9
- package/hooks/features/columnPinning/useGridColumnPinning.js +3 -3
- package/hooks/features/detailPanel/useGridDetailPanel.js +1 -1
- package/hooks/features/lazyLoader/useGridLazyLoader.d.ts +1 -1
- package/index.js +1 -1
- package/models/dataGridProProps.d.ts +3 -3
- package/models/dataSource.d.ts +1 -1
- package/models/gridApiPro.d.ts +1 -2
- package/modern/DataGridPro/DataGridPro.js +13 -17
- package/modern/components/headerFiltering/GridHeaderFilterCell.js +1 -2
- package/modern/hooks/features/columnPinning/useGridColumnPinning.js +3 -3
- package/modern/hooks/features/detailPanel/useGridDetailPanel.js +1 -1
- package/modern/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/package.json +6 -6
- package/utils/releaseInfo.js +1 -1
|
@@ -18,7 +18,7 @@ interface DataGridProPropsWithComplexDefaultValueBeforeProcessing extends Omit<D
|
|
|
18
18
|
/**
|
|
19
19
|
* The props users can give to the `DataGridProProps` component.
|
|
20
20
|
*/
|
|
21
|
-
export interface DataGridProProps<R extends GridValidRowModel = any> extends Omit<Partial<DataGridProPropsWithDefaultValue
|
|
21
|
+
export interface DataGridProProps<R extends GridValidRowModel = any> extends Omit<Partial<DataGridProPropsWithDefaultValue<R>> & DataGridProPropsWithComplexDefaultValueBeforeProcessing & DataGridProPropsWithoutDefaultValue<R>, DataGridProForcedPropsKey> {
|
|
22
22
|
}
|
|
23
23
|
interface DataGridProPropsWithComplexDefaultValueAfterProcessing extends Omit<DataGridPropsWithComplexDefaultValueAfterProcessing, 'slots'> {
|
|
24
24
|
slots: GridProSlotsComponent;
|
|
@@ -26,7 +26,7 @@ interface DataGridProPropsWithComplexDefaultValueAfterProcessing extends Omit<Da
|
|
|
26
26
|
/**
|
|
27
27
|
* The props of the `DataGridPro` component after the pre-processing phase.
|
|
28
28
|
*/
|
|
29
|
-
export interface DataGridProProcessedProps<R extends GridValidRowModel = any> extends DataGridProPropsWithDefaultValue
|
|
29
|
+
export interface DataGridProProcessedProps<R extends GridValidRowModel = any> extends DataGridProPropsWithDefaultValue<R>, DataGridProPropsWithComplexDefaultValueAfterProcessing, Omit<DataGridProPropsWithoutDefaultValue<R>, 'componentsProps'> {
|
|
30
30
|
}
|
|
31
31
|
export type DataGridProForcedPropsKey = 'signature';
|
|
32
32
|
/**
|
|
@@ -34,7 +34,7 @@ export type DataGridProForcedPropsKey = 'signature';
|
|
|
34
34
|
* None of the entry of this interface should be optional, they all have default values and `DataGridProps` already applies a `Partial<DataGridSimpleOptions>` for the public interface
|
|
35
35
|
* The controlled model do not have a default value at the prop processing level, so they must be defined in `DataGridOtherProps`
|
|
36
36
|
*/
|
|
37
|
-
export interface DataGridProPropsWithDefaultValue extends DataGridPropsWithDefaultValues {
|
|
37
|
+
export interface DataGridProPropsWithDefaultValue<R extends GridValidRowModel = any> extends DataGridPropsWithDefaultValues<R> {
|
|
38
38
|
/**
|
|
39
39
|
* Set the area in `px` at the bottom of the grid viewport where onRowsScrollEnd is called.
|
|
40
40
|
* @default 80
|
package/models/dataSource.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ interface GetRowsResponse {
|
|
|
29
29
|
rows: GridRowModel[];
|
|
30
30
|
/**
|
|
31
31
|
* To reflect updates in total `rowCount` (optional).
|
|
32
|
-
* Useful when the `rowCount` is inaccurate (
|
|
32
|
+
* Useful when the `rowCount` is inaccurate (for example when filtering) or not available upfront.
|
|
33
33
|
*/
|
|
34
34
|
rowCount?: number;
|
|
35
35
|
/**
|
package/models/gridApiPro.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { GridApiCommon, GridColumnReorderApi, GridRowMultiSelectionApi, GridRowProApi } from '@mui/x-data-grid';
|
|
2
|
-
import { GridPrivateOnlyApiCommon } from '@mui/x-data-grid/internals';
|
|
3
|
-
import type { GridInfiniteLoaderPrivateApi } from '@mui/x-data-grid/models/api/gridInfiniteLoaderApi';
|
|
2
|
+
import { GridPrivateOnlyApiCommon, GridInfiniteLoaderPrivateApi } from '@mui/x-data-grid/internals';
|
|
4
3
|
import { GridInitialStatePro, GridStatePro } from './gridStatePro';
|
|
5
4
|
import type { GridColumnPinningApi, GridDetailPanelApi, GridRowPinningApi, GridDetailPanelPrivateApi } from '../hooks';
|
|
6
5
|
import type { DataGridProProcessedProps } from './dataGridProProps';
|
|
@@ -113,10 +113,10 @@ DataGridProRaw.propTypes = {
|
|
|
113
113
|
*/
|
|
114
114
|
clipboardCopyCellDelimiter: PropTypes.string,
|
|
115
115
|
/**
|
|
116
|
-
*
|
|
117
|
-
* @default
|
|
116
|
+
* Column region in pixels to render before/after the viewport
|
|
117
|
+
* @default 150
|
|
118
118
|
*/
|
|
119
|
-
|
|
119
|
+
columnBufferPx: PropTypes.number,
|
|
120
120
|
columnGroupingModel: PropTypes.arrayOf(PropTypes.object),
|
|
121
121
|
/**
|
|
122
122
|
* Sets the height in pixel of the column headers in the Data Grid.
|
|
@@ -127,11 +127,6 @@ DataGridProRaw.propTypes = {
|
|
|
127
127
|
* Set of columns of type [[GridColDef]][].
|
|
128
128
|
*/
|
|
129
129
|
columns: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
130
|
-
/**
|
|
131
|
-
* Number of rows from the `columnBuffer` that can be visible before a new slice is rendered.
|
|
132
|
-
* @default 3
|
|
133
|
-
*/
|
|
134
|
-
columnThreshold: PropTypes.number,
|
|
135
130
|
/**
|
|
136
131
|
* Set the column visibility model of the Data Grid.
|
|
137
132
|
* If defined, the Data Grid will ignore the `hide` property in [[GridColDef]].
|
|
@@ -563,6 +558,11 @@ DataGridProRaw.propTypes = {
|
|
|
563
558
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
564
559
|
*/
|
|
565
560
|
onColumnWidthChange: PropTypes.func,
|
|
561
|
+
/**
|
|
562
|
+
* Callback fired when the density changes.
|
|
563
|
+
* @param {GridDensity} density New density value.
|
|
564
|
+
*/
|
|
565
|
+
onDensityChange: PropTypes.func,
|
|
566
566
|
/**
|
|
567
567
|
* Callback fired when the detail panel of a row is opened or closed.
|
|
568
568
|
* @param {GridRowId[]} ids The ids of the rows which have the detail panel open.
|
|
@@ -753,10 +753,10 @@ DataGridProRaw.propTypes = {
|
|
|
753
753
|
*/
|
|
754
754
|
processRowUpdate: PropTypes.func,
|
|
755
755
|
/**
|
|
756
|
-
*
|
|
757
|
-
* @default
|
|
756
|
+
* Row region in pixels to render before/after the viewport
|
|
757
|
+
* @default 150
|
|
758
758
|
*/
|
|
759
|
-
|
|
759
|
+
rowBufferPx: PropTypes.number,
|
|
760
760
|
/**
|
|
761
761
|
* Set the total number of rows, if it is different from the length of the value `rows` prop.
|
|
762
762
|
* If some rows have children (for instance in the tree data), this number represents the amount of top level rows.
|
|
@@ -785,8 +785,9 @@ DataGridProRaw.propTypes = {
|
|
|
785
785
|
rowReordering: PropTypes.bool,
|
|
786
786
|
/**
|
|
787
787
|
* Set of rows of type [[GridRowsProp]].
|
|
788
|
+
* @default []
|
|
788
789
|
*/
|
|
789
|
-
rows: PropTypes.arrayOf(PropTypes.object)
|
|
790
|
+
rows: PropTypes.arrayOf(PropTypes.object),
|
|
790
791
|
/**
|
|
791
792
|
* If `false`, the row selection mode is disabled.
|
|
792
793
|
* @default true
|
|
@@ -808,11 +809,6 @@ DataGridProRaw.propTypes = {
|
|
|
808
809
|
* @default "margin"
|
|
809
810
|
*/
|
|
810
811
|
rowSpacingType: PropTypes.oneOf(['border', 'margin']),
|
|
811
|
-
/**
|
|
812
|
-
* Number of rows from the `rowBuffer` that can be visible before a new slice is rendered.
|
|
813
|
-
* @default 3
|
|
814
|
-
*/
|
|
815
|
-
rowThreshold: PropTypes.number,
|
|
816
812
|
/**
|
|
817
813
|
* Override the height/width of the Data Grid inner scrollbar.
|
|
818
814
|
*/
|
|
@@ -6,8 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { unstable_useForkRef as useForkRef, unstable_composeClasses as composeClasses, unstable_capitalize as capitalize } from '@mui/utils';
|
|
8
8
|
import { gridVisibleColumnFieldsSelector, getDataGridUtilityClass, useGridSelector, gridFilterModelSelector, gridFilterableColumnLookupSelector } from '@mui/x-data-grid';
|
|
9
|
-
import { fastMemo, useGridPrivateApiContext, gridHeaderFilteringEditFieldSelector, gridHeaderFilteringMenuSelector, isNavigationKey } from '@mui/x-data-grid/internals';
|
|
10
|
-
import { shouldCellShowLeftBorder, shouldCellShowRightBorder } from '@mui/x-data-grid/utils/cellBorderUtils';
|
|
9
|
+
import { fastMemo, useGridPrivateApiContext, gridHeaderFilteringEditFieldSelector, gridHeaderFilteringMenuSelector, isNavigationKey, shouldCellShowLeftBorder, shouldCellShowRightBorder } from '@mui/x-data-grid/internals';
|
|
11
10
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
12
11
|
import { GridHeaderFilterMenuContainer } from './GridHeaderFilterMenuContainer';
|
|
13
12
|
import { GridHeaderFilterClearButton } from './GridHeaderFilterClearButton';
|
|
@@ -178,16 +178,16 @@ export const useGridColumnPinning = (apiRef, props) => {
|
|
|
178
178
|
* on must be moved to left or right to make room for it. The ^^^ below represents the column
|
|
179
179
|
* which gave space to receive X.
|
|
180
180
|
*
|
|
181
|
-
* | X | B | C | D | -> | B | C | D | X | (
|
|
181
|
+
* | X | B | C | D | -> | B | C | D | X | (for example X moved to after D, so delta=1)
|
|
182
182
|
* ^^^ ^^^
|
|
183
183
|
*
|
|
184
|
-
* | A | B | C | X | -> | X | A | B | C | (
|
|
184
|
+
* | A | B | C | X | -> | X | A | B | C | (for example X moved before A, so delta=-1)
|
|
185
185
|
* ^^^ ^^^
|
|
186
186
|
*
|
|
187
187
|
* If column P is pinned, it will not move to provide space. However, it will jump to the next
|
|
188
188
|
* non-pinned column.
|
|
189
189
|
*
|
|
190
|
-
* | X | B | P | D | -> | B | D | P | X | (
|
|
190
|
+
* | X | B | P | D | -> | B | D | P | X | (for example X moved to after D, with P pinned)
|
|
191
191
|
* ^^^ ^^^
|
|
192
192
|
*/
|
|
193
193
|
const siblingField = latestColumnFields[targetIndex - delta];
|
|
@@ -178,7 +178,7 @@ export const useGridDetailPanel = (apiRef, props) => {
|
|
|
178
178
|
}
|
|
179
179
|
updateCachesIfNeeded();
|
|
180
180
|
const heightCache = gridDetailPanelExpandedRowsHeightCacheSelector(apiRef);
|
|
181
|
-
initialValue.detail = heightCache[row.id] ?? 0; // Fallback to zero because the cache might not be ready yet (
|
|
181
|
+
initialValue.detail = heightCache[row.id] ?? 0; // Fallback to zero because the cache might not be ready yet (for example page was changed)
|
|
182
182
|
return initialValue;
|
|
183
183
|
}, [apiRef, expandedRowIds, updateCachesIfNeeded]);
|
|
184
184
|
useGridRegisterPipeProcessor(apiRef, 'rowHeight', addDetailHeight);
|
package/modern/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTcxMTA1ODQwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-pro",
|
|
3
|
-
"version": "7.0.0
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "The Pro plan edition of the data grid component (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@babel/runtime": "^7.24.0",
|
|
36
|
-
"@mui/system": "^5.15.
|
|
37
|
-
"@mui/utils": "^5.15.
|
|
38
|
-
"@mui/x-data-grid": "7.0.0
|
|
39
|
-
"@mui/x-license": "7.0.0
|
|
36
|
+
"@mui/system": "^5.15.14",
|
|
37
|
+
"@mui/utils": "^5.15.14",
|
|
38
|
+
"@mui/x-data-grid": "7.0.0",
|
|
39
|
+
"@mui/x-license": "7.0.0",
|
|
40
40
|
"@types/format-util": "^1.0.4",
|
|
41
41
|
"clsx": "^2.1.0",
|
|
42
42
|
"prop-types": "^15.8.1",
|
|
43
43
|
"reselect": "^4.1.8"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@mui/material": "^5.15.
|
|
46
|
+
"@mui/material": "^5.15.14",
|
|
47
47
|
"react": "^17.0.0 || ^18.0.0",
|
|
48
48
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
49
49
|
},
|
package/utils/releaseInfo.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getReleaseInfo = void 0;
|
|
7
7
|
var _utils = require("@mui/utils");
|
|
8
8
|
const getReleaseInfo = () => {
|
|
9
|
-
const releaseInfo = "
|
|
9
|
+
const releaseInfo = "MTcxMTA1ODQwMDAwMA==";
|
|
10
10
|
if (process.env.NODE_ENV !== 'production') {
|
|
11
11
|
// A simple hack to set the value in the test environment (has no build step).
|
|
12
12
|
// eslint-disable-next-line no-useless-concat
|