@mui/x-data-grid-premium 8.0.0-alpha.5 → 8.0.0-alpha.6
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 +79 -0
- package/DataGridPremium/DataGridPremium.js +4 -3
- package/components/GridDataSourceGroupingCriteriaCell.js +1 -2
- package/components/GridPremiumColumnMenu.d.ts +1 -1
- package/components/GridPremiumColumnMenu.js +5 -5
- package/esm/DataGridPremium/DataGridPremium.js +4 -3
- package/esm/components/GridDataSourceGroupingCriteriaCell.js +1 -2
- package/esm/components/GridPremiumColumnMenu.js +5 -5
- package/esm/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +9 -4
- package/esm/utils/releaseInfo.js +1 -1
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +9 -4
- package/index.js +1 -1
- package/modern/DataGridPremium/DataGridPremium.js +4 -3
- package/modern/components/GridDataSourceGroupingCriteriaCell.js +1 -2
- package/modern/components/GridPremiumColumnMenu.js +5 -5
- package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +9 -4
- package/modern/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/package.json +5 -5
- package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,85 @@
|
|
|
5
5
|
All notable changes to this project will be documented in this file.
|
|
6
6
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
7
7
|
|
|
8
|
+
## 8.0.0-alpha.6
|
|
9
|
+
|
|
10
|
+
_Dec 26, 2024_
|
|
11
|
+
|
|
12
|
+
We'd like to offer a big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 🏎️ Improve Data Grid scrolling performance
|
|
15
|
+
- 🌍 Improve Dutch (nl-NL) locale on the Data Grid
|
|
16
|
+
- 🐞 Bugfixes
|
|
17
|
+
|
|
18
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
19
|
+
@JoepVerkoelen, @k-rajat19, @lauri865.
|
|
20
|
+
Following are all team members who have contributed to this release:
|
|
21
|
+
@flaviendelangle, @JCQuintas, @LukasTy, @MBilalShafi, @romgrk.
|
|
22
|
+
|
|
23
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
24
|
+
|
|
25
|
+
### Data Grid
|
|
26
|
+
|
|
27
|
+
#### Breaking changes
|
|
28
|
+
|
|
29
|
+
- The `sanitizeFilterItemValue()` utility is not exported anymore.
|
|
30
|
+
|
|
31
|
+
#### `@mui/x-data-grid@8.0.0-alpha.6`
|
|
32
|
+
|
|
33
|
+
- [DataGrid] Avoid subscribing to `renderContext` state in grid root for better scroll performance (#15986) @lauri865
|
|
34
|
+
- [DataGrid] Fix header filters showing clear button while empty (#15829) @k-rajat19
|
|
35
|
+
- [DataGrid] Improve test coverage of server side data source (#15942) @MBilalShafi
|
|
36
|
+
- [DataGrid] Move progress components to leaf import (#15914) @romgrk
|
|
37
|
+
- [DataGrid] Move skeleton to leaf import (#15931) @romgrk
|
|
38
|
+
- [DataGrid] Replace `forwardRef` with a shim for forward compatibility (#15955) @lauri865
|
|
39
|
+
- [l10n] Improve Dutch (nl-NL) locale (#15994) @JoepVerkoelen
|
|
40
|
+
|
|
41
|
+
#### `@mui/x-data-grid-pro@8.0.0-alpha.6` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
42
|
+
|
|
43
|
+
Same changes as in `@mui/x-data-grid@8.0.0-alpha.6`.
|
|
44
|
+
|
|
45
|
+
#### `@mui/x-data-grid-premium@8.0.0-alpha.6` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
46
|
+
|
|
47
|
+
Same changes as in `@mui/x-data-grid-pro@8.0.0-alpha.6`, plus:
|
|
48
|
+
|
|
49
|
+
- [DataGridPremium] Fix column unpinning with row grouping (#15908) @k-rajat19
|
|
50
|
+
|
|
51
|
+
### Date and Time Pickers
|
|
52
|
+
|
|
53
|
+
#### `@mui/x-date-pickers@8.0.0-alpha.6`
|
|
54
|
+
|
|
55
|
+
- [pickers] Use `usePickerContext()` and `usePickerActionsContext()` to get the actions in the `actionBar` slot and in internal components (#15843) @flaviendelangle
|
|
56
|
+
- [pickers] Use `usePickerContext()` to get the view-related props in the layout, toolbar and tabs slots (#15606) @flaviendelangle
|
|
57
|
+
|
|
58
|
+
#### `@mui/x-date-pickers-pro@8.0.0-alpha.6` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
59
|
+
|
|
60
|
+
Same changes as in `@mui/x-date-pickers@8.0.0-alpha.6`.
|
|
61
|
+
|
|
62
|
+
### Charts
|
|
63
|
+
|
|
64
|
+
#### `@mui/x-charts@8.0.0-alpha.6`
|
|
65
|
+
|
|
66
|
+
No changes since `@mui/x-charts@v8.0.0-alpha.5`.
|
|
67
|
+
|
|
68
|
+
#### `@mui/x-charts-pro@8.0.0-alpha.6` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
69
|
+
|
|
70
|
+
Same changes as in `@mui/x-charts@8.0.0-alpha.6`.
|
|
71
|
+
|
|
72
|
+
### Tree View
|
|
73
|
+
|
|
74
|
+
#### `@mui/x-tree-view@8.0.0-alpha.6`
|
|
75
|
+
|
|
76
|
+
No changes since `@mui/x-tree-view-pro@v8.0.0-alpha.5`.
|
|
77
|
+
|
|
78
|
+
#### `@mui/x-tree-view-pro@8.0.0-alpha.6` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
79
|
+
|
|
80
|
+
Same changes as in `@mui/x-tree-view@8.0.0-alpha.6`.
|
|
81
|
+
|
|
82
|
+
### Docs
|
|
83
|
+
|
|
84
|
+
- [docs] Remove production profiler from docs build (#15959) @lauri865
|
|
85
|
+
- [code-infra] Add new `next-env.d.ts` changes (#15947) @JCQuintas
|
|
86
|
+
|
|
8
87
|
## 8.0.0-alpha.5
|
|
9
88
|
|
|
10
89
|
_Dec 19, 2024_
|
|
@@ -13,6 +13,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
13
13
|
var _xLicense = require("@mui/x-license");
|
|
14
14
|
var _xDataGridPro = require("@mui/x-data-grid-pro");
|
|
15
15
|
var _internals = require("@mui/x-data-grid-pro/internals");
|
|
16
|
+
var _forwardRef = require("@mui/x-internals/forwardRef");
|
|
16
17
|
var _useDataGridPremiumComponent = require("./useDataGridPremiumComponent");
|
|
17
18
|
var _useDataGridPremiumProps = require("./useDataGridPremiumProps");
|
|
18
19
|
var _releaseInfo = require("../utils/releaseInfo");
|
|
@@ -30,7 +31,7 @@ let dataGridPremiumPropValidators;
|
|
|
30
31
|
if (process.env.NODE_ENV !== 'production') {
|
|
31
32
|
dataGridPremiumPropValidators = [..._internals.propValidatorsDataGrid, ..._internals.propValidatorsDataGridPro];
|
|
32
33
|
}
|
|
33
|
-
const DataGridPremiumRaw =
|
|
34
|
+
const DataGridPremiumRaw = (0, _forwardRef.forwardRef)(function DataGridPremium(inProps, ref) {
|
|
34
35
|
const props = (0, _useDataGridPremiumProps.useDataGridPremiumProps)(inProps);
|
|
35
36
|
const privateApiRef = (0, _useDataGridPremiumComponent.useDataGridPremiumComponent)(props.apiRef, props);
|
|
36
37
|
(0, _xLicense.useLicenseVerifier)('x-data-grid-premium', releaseInfo);
|
|
@@ -44,9 +45,9 @@ const DataGridPremiumRaw = /*#__PURE__*/React.forwardRef(function DataGridPremiu
|
|
|
44
45
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_xDataGridPro.GridRoot, (0, _extends2.default)({
|
|
45
46
|
className: props.className,
|
|
46
47
|
style: props.style,
|
|
47
|
-
sx: props.sx
|
|
48
|
-
ref: ref
|
|
48
|
+
sx: props.sx
|
|
49
49
|
}, props.slotProps?.root, {
|
|
50
|
+
ref: ref,
|
|
50
51
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_xDataGridPro.GridHeader, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_xDataGridPro.GridBody, {
|
|
51
52
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_xLicense.Watermark, {
|
|
52
53
|
packageName: "x-data-grid-premium",
|
|
@@ -10,7 +10,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _utils = require("@mui/utils");
|
|
12
12
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
13
|
-
var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
|
|
14
13
|
var _internals = require("@mui/x-data-grid-pro/internals");
|
|
15
14
|
var _xDataGridPro = require("@mui/x-data-grid-pro");
|
|
16
15
|
var _useGridApiContext = require("../hooks/utils/useGridApiContext");
|
|
@@ -55,7 +54,7 @@ function GridGroupingCriteriaCellIcon(props) {
|
|
|
55
54
|
if (isDataLoading) {
|
|
56
55
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
57
56
|
className: classes.loadingContainer,
|
|
58
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
57
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseCircularProgress, {
|
|
59
58
|
size: "1rem",
|
|
60
59
|
color: "inherit"
|
|
61
60
|
})
|
|
@@ -30,4 +30,4 @@ export declare const GRID_COLUMN_MENU_SLOT_PROPS_PREMIUM: {
|
|
|
30
30
|
displayOrder: number;
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
|
-
export declare const GridPremiumColumnMenu: React.ForwardRefExoticComponent<GridColumnMenuProps & React.RefAttributes<HTMLUListElement>>;
|
|
33
|
+
export declare const GridPremiumColumnMenu: React.ForwardRefExoticComponent<GridColumnMenuProps> | React.ForwardRefExoticComponent<GridColumnMenuProps & React.RefAttributes<HTMLUListElement>>;
|
|
@@ -11,6 +11,7 @@ exports.GridPremiumColumnMenu = void 0;
|
|
|
11
11
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
12
|
var React = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _xDataGridPro = require("@mui/x-data-grid-pro");
|
|
14
|
+
var _forwardRef = require("@mui/x-internals/forwardRef");
|
|
14
15
|
var _GridColumnMenuAggregationItem = require("./GridColumnMenuAggregationItem");
|
|
15
16
|
var _rowGrouping = require("../hooks/features/rowGrouping");
|
|
16
17
|
var _GridColumnMenuRowGroupItem = require("./GridColumnMenuRowGroupItem");
|
|
@@ -37,11 +38,10 @@ const GRID_COLUMN_MENU_SLOT_PROPS_PREMIUM = exports.GRID_COLUMN_MENU_SLOT_PROPS_
|
|
|
37
38
|
displayOrder: 27
|
|
38
39
|
}
|
|
39
40
|
});
|
|
40
|
-
const GridPremiumColumnMenu = exports.GridPremiumColumnMenu =
|
|
41
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_xDataGridPro.GridGenericColumnMenu, (0, _extends2.default)({
|
|
42
|
-
ref: ref
|
|
43
|
-
}, props, {
|
|
41
|
+
const GridPremiumColumnMenu = exports.GridPremiumColumnMenu = (0, _forwardRef.forwardRef)(function GridPremiumColumnMenuSimple(props, ref) {
|
|
42
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_xDataGridPro.GridGenericColumnMenu, (0, _extends2.default)({}, props, {
|
|
44
43
|
defaultSlots: GRID_COLUMN_MENU_SLOTS_PREMIUM,
|
|
45
|
-
defaultSlotProps: GRID_COLUMN_MENU_SLOT_PROPS_PREMIUM
|
|
44
|
+
defaultSlotProps: GRID_COLUMN_MENU_SLOT_PROPS_PREMIUM,
|
|
45
|
+
ref: ref
|
|
46
46
|
}));
|
|
47
47
|
});
|
|
@@ -6,6 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import { useLicenseVerifier, Watermark } from '@mui/x-license';
|
|
7
7
|
import { GridBody, GridFooterPlaceholder, GridHeader, GridRoot, GridContextProvider } from '@mui/x-data-grid-pro';
|
|
8
8
|
import { propValidatorsDataGrid, propValidatorsDataGridPro, validateProps } from '@mui/x-data-grid-pro/internals';
|
|
9
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
9
10
|
import { useDataGridPremiumComponent } from "./useDataGridPremiumComponent.js";
|
|
10
11
|
import { useDataGridPremiumProps } from "./useDataGridPremiumProps.js";
|
|
11
12
|
import { getReleaseInfo } from "../utils/releaseInfo.js";
|
|
@@ -23,7 +24,7 @@ let dataGridPremiumPropValidators;
|
|
|
23
24
|
if (process.env.NODE_ENV !== 'production') {
|
|
24
25
|
dataGridPremiumPropValidators = [...propValidatorsDataGrid, ...propValidatorsDataGridPro];
|
|
25
26
|
}
|
|
26
|
-
const DataGridPremiumRaw =
|
|
27
|
+
const DataGridPremiumRaw = forwardRef(function DataGridPremium(inProps, ref) {
|
|
27
28
|
const props = useDataGridPremiumProps(inProps);
|
|
28
29
|
const privateApiRef = useDataGridPremiumComponent(props.apiRef, props);
|
|
29
30
|
useLicenseVerifier('x-data-grid-premium', releaseInfo);
|
|
@@ -37,9 +38,9 @@ const DataGridPremiumRaw = /*#__PURE__*/React.forwardRef(function DataGridPremiu
|
|
|
37
38
|
children: /*#__PURE__*/_jsxs(GridRoot, _extends({
|
|
38
39
|
className: props.className,
|
|
39
40
|
style: props.style,
|
|
40
|
-
sx: props.sx
|
|
41
|
-
ref: ref
|
|
41
|
+
sx: props.sx
|
|
42
42
|
}, props.slotProps?.root, {
|
|
43
|
+
ref: ref,
|
|
43
44
|
children: [/*#__PURE__*/_jsx(GridHeader, {}), /*#__PURE__*/_jsx(GridBody, {
|
|
44
45
|
children: /*#__PURE__*/_jsx(Watermark, {
|
|
45
46
|
packageName: "x-data-grid-premium",
|
|
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
4
4
|
import Box from '@mui/material/Box';
|
|
5
|
-
import CircularProgress from '@mui/material/CircularProgress';
|
|
6
5
|
import { useGridPrivateApiContext } from '@mui/x-data-grid-pro/internals';
|
|
7
6
|
import { useGridSelector, getDataGridUtilityClass } from '@mui/x-data-grid-pro';
|
|
8
7
|
import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
|
|
@@ -47,7 +46,7 @@ function GridGroupingCriteriaCellIcon(props) {
|
|
|
47
46
|
if (isDataLoading) {
|
|
48
47
|
return /*#__PURE__*/_jsx("div", {
|
|
49
48
|
className: classes.loadingContainer,
|
|
50
|
-
children: /*#__PURE__*/_jsx(
|
|
49
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.baseCircularProgress, {
|
|
51
50
|
size: "1rem",
|
|
52
51
|
color: "inherit"
|
|
53
52
|
})
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { GridGenericColumnMenu, GRID_COLUMN_MENU_SLOTS, GRID_COLUMN_MENU_SLOT_PROPS } from '@mui/x-data-grid-pro';
|
|
4
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
4
5
|
import { GridColumnMenuAggregationItem } from "./GridColumnMenuAggregationItem.js";
|
|
5
6
|
import { isGroupingColumn } from "../hooks/features/rowGrouping/index.js";
|
|
6
7
|
import { GridColumnMenuRowGroupItem } from "./GridColumnMenuRowGroupItem.js";
|
|
@@ -27,11 +28,10 @@ export const GRID_COLUMN_MENU_SLOT_PROPS_PREMIUM = _extends({}, GRID_COLUMN_MENU
|
|
|
27
28
|
displayOrder: 27
|
|
28
29
|
}
|
|
29
30
|
});
|
|
30
|
-
export const GridPremiumColumnMenu =
|
|
31
|
-
return /*#__PURE__*/_jsx(GridGenericColumnMenu, _extends({
|
|
32
|
-
ref: ref
|
|
33
|
-
}, props, {
|
|
31
|
+
export const GridPremiumColumnMenu = forwardRef(function GridPremiumColumnMenuSimple(props, ref) {
|
|
32
|
+
return /*#__PURE__*/_jsx(GridGenericColumnMenu, _extends({}, props, {
|
|
34
33
|
defaultSlots: GRID_COLUMN_MENU_SLOTS_PREMIUM,
|
|
35
|
-
defaultSlotProps: GRID_COLUMN_MENU_SLOT_PROPS_PREMIUM
|
|
34
|
+
defaultSlotProps: GRID_COLUMN_MENU_SLOT_PROPS_PREMIUM,
|
|
35
|
+
ref: ref
|
|
36
36
|
}));
|
|
37
37
|
});
|
|
@@ -48,10 +48,13 @@ export const useGridRowGroupingPreProcessors = (apiRef, props) => {
|
|
|
48
48
|
const groupingColDefs = getGroupingColDefs(columnsState);
|
|
49
49
|
let newColumnFields = [];
|
|
50
50
|
const newColumnsLookup = {};
|
|
51
|
+
const prevGroupingfields = [];
|
|
51
52
|
|
|
52
53
|
// We only keep the non-grouping columns
|
|
53
54
|
columnsState.orderedFields.forEach(field => {
|
|
54
|
-
if (
|
|
55
|
+
if (isGroupingColumn(field)) {
|
|
56
|
+
prevGroupingfields.push(field);
|
|
57
|
+
} else {
|
|
55
58
|
newColumnFields.push(field);
|
|
56
59
|
newColumnsLookup[field] = columnsState.lookup[field];
|
|
57
60
|
}
|
|
@@ -66,9 +69,11 @@ export const useGridRowGroupingPreProcessors = (apiRef, props) => {
|
|
|
66
69
|
}
|
|
67
70
|
newColumnsLookup[groupingColDef.field] = groupingColDef;
|
|
68
71
|
});
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
if (prevGroupingfields.length !== groupingColDefs.length) {
|
|
73
|
+
const startIndex = newColumnFields[0] === GRID_CHECKBOX_SELECTION_FIELD ? 1 : 0;
|
|
74
|
+
newColumnFields = [...newColumnFields.slice(0, startIndex), ...groupingColDefs.map(colDef => colDef.field), ...newColumnFields.slice(startIndex)];
|
|
75
|
+
columnsState.orderedFields = newColumnFields;
|
|
76
|
+
}
|
|
72
77
|
columnsState.lookup = newColumnsLookup;
|
|
73
78
|
return columnsState;
|
|
74
79
|
}, [getGroupingColDefs]);
|
package/esm/utils/releaseInfo.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTczNTE2NDAwMDAwMA==";
|
|
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
|
|
@@ -55,10 +55,13 @@ const useGridRowGroupingPreProcessors = (apiRef, props) => {
|
|
|
55
55
|
const groupingColDefs = getGroupingColDefs(columnsState);
|
|
56
56
|
let newColumnFields = [];
|
|
57
57
|
const newColumnsLookup = {};
|
|
58
|
+
const prevGroupingfields = [];
|
|
58
59
|
|
|
59
60
|
// We only keep the non-grouping columns
|
|
60
61
|
columnsState.orderedFields.forEach(field => {
|
|
61
|
-
if (
|
|
62
|
+
if ((0, _gridRowGroupingUtils.isGroupingColumn)(field)) {
|
|
63
|
+
prevGroupingfields.push(field);
|
|
64
|
+
} else {
|
|
62
65
|
newColumnFields.push(field);
|
|
63
66
|
newColumnsLookup[field] = columnsState.lookup[field];
|
|
64
67
|
}
|
|
@@ -73,9 +76,11 @@ const useGridRowGroupingPreProcessors = (apiRef, props) => {
|
|
|
73
76
|
}
|
|
74
77
|
newColumnsLookup[groupingColDef.field] = groupingColDef;
|
|
75
78
|
});
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
if (prevGroupingfields.length !== groupingColDefs.length) {
|
|
80
|
+
const startIndex = newColumnFields[0] === _xDataGridPro.GRID_CHECKBOX_SELECTION_FIELD ? 1 : 0;
|
|
81
|
+
newColumnFields = [...newColumnFields.slice(0, startIndex), ...groupingColDefs.map(colDef => colDef.field), ...newColumnFields.slice(startIndex)];
|
|
82
|
+
columnsState.orderedFields = newColumnFields;
|
|
83
|
+
}
|
|
79
84
|
columnsState.lookup = newColumnsLookup;
|
|
80
85
|
return columnsState;
|
|
81
86
|
}, [getGroupingColDefs]);
|
package/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import { useLicenseVerifier, Watermark } from '@mui/x-license';
|
|
7
7
|
import { GridBody, GridFooterPlaceholder, GridHeader, GridRoot, GridContextProvider } from '@mui/x-data-grid-pro';
|
|
8
8
|
import { propValidatorsDataGrid, propValidatorsDataGridPro, validateProps } from '@mui/x-data-grid-pro/internals';
|
|
9
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
9
10
|
import { useDataGridPremiumComponent } from "./useDataGridPremiumComponent.js";
|
|
10
11
|
import { useDataGridPremiumProps } from "./useDataGridPremiumProps.js";
|
|
11
12
|
import { getReleaseInfo } from "../utils/releaseInfo.js";
|
|
@@ -23,7 +24,7 @@ let dataGridPremiumPropValidators;
|
|
|
23
24
|
if (process.env.NODE_ENV !== 'production') {
|
|
24
25
|
dataGridPremiumPropValidators = [...propValidatorsDataGrid, ...propValidatorsDataGridPro];
|
|
25
26
|
}
|
|
26
|
-
const DataGridPremiumRaw =
|
|
27
|
+
const DataGridPremiumRaw = forwardRef(function DataGridPremium(inProps, ref) {
|
|
27
28
|
const props = useDataGridPremiumProps(inProps);
|
|
28
29
|
const privateApiRef = useDataGridPremiumComponent(props.apiRef, props);
|
|
29
30
|
useLicenseVerifier('x-data-grid-premium', releaseInfo);
|
|
@@ -37,9 +38,9 @@ const DataGridPremiumRaw = /*#__PURE__*/React.forwardRef(function DataGridPremiu
|
|
|
37
38
|
children: /*#__PURE__*/_jsxs(GridRoot, _extends({
|
|
38
39
|
className: props.className,
|
|
39
40
|
style: props.style,
|
|
40
|
-
sx: props.sx
|
|
41
|
-
ref: ref
|
|
41
|
+
sx: props.sx
|
|
42
42
|
}, props.slotProps?.root, {
|
|
43
|
+
ref: ref,
|
|
43
44
|
children: [/*#__PURE__*/_jsx(GridHeader, {}), /*#__PURE__*/_jsx(GridBody, {
|
|
44
45
|
children: /*#__PURE__*/_jsx(Watermark, {
|
|
45
46
|
packageName: "x-data-grid-premium",
|
|
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
4
4
|
import Box from '@mui/material/Box';
|
|
5
|
-
import CircularProgress from '@mui/material/CircularProgress';
|
|
6
5
|
import { useGridPrivateApiContext } from '@mui/x-data-grid-pro/internals';
|
|
7
6
|
import { useGridSelector, getDataGridUtilityClass } from '@mui/x-data-grid-pro';
|
|
8
7
|
import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
|
|
@@ -47,7 +46,7 @@ function GridGroupingCriteriaCellIcon(props) {
|
|
|
47
46
|
if (isDataLoading) {
|
|
48
47
|
return /*#__PURE__*/_jsx("div", {
|
|
49
48
|
className: classes.loadingContainer,
|
|
50
|
-
children: /*#__PURE__*/_jsx(
|
|
49
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.baseCircularProgress, {
|
|
51
50
|
size: "1rem",
|
|
52
51
|
color: "inherit"
|
|
53
52
|
})
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { GridGenericColumnMenu, GRID_COLUMN_MENU_SLOTS, GRID_COLUMN_MENU_SLOT_PROPS } from '@mui/x-data-grid-pro';
|
|
4
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
4
5
|
import { GridColumnMenuAggregationItem } from "./GridColumnMenuAggregationItem.js";
|
|
5
6
|
import { isGroupingColumn } from "../hooks/features/rowGrouping/index.js";
|
|
6
7
|
import { GridColumnMenuRowGroupItem } from "./GridColumnMenuRowGroupItem.js";
|
|
@@ -27,11 +28,10 @@ export const GRID_COLUMN_MENU_SLOT_PROPS_PREMIUM = _extends({}, GRID_COLUMN_MENU
|
|
|
27
28
|
displayOrder: 27
|
|
28
29
|
}
|
|
29
30
|
});
|
|
30
|
-
export const GridPremiumColumnMenu =
|
|
31
|
-
return /*#__PURE__*/_jsx(GridGenericColumnMenu, _extends({
|
|
32
|
-
ref: ref
|
|
33
|
-
}, props, {
|
|
31
|
+
export const GridPremiumColumnMenu = forwardRef(function GridPremiumColumnMenuSimple(props, ref) {
|
|
32
|
+
return /*#__PURE__*/_jsx(GridGenericColumnMenu, _extends({}, props, {
|
|
34
33
|
defaultSlots: GRID_COLUMN_MENU_SLOTS_PREMIUM,
|
|
35
|
-
defaultSlotProps: GRID_COLUMN_MENU_SLOT_PROPS_PREMIUM
|
|
34
|
+
defaultSlotProps: GRID_COLUMN_MENU_SLOT_PROPS_PREMIUM,
|
|
35
|
+
ref: ref
|
|
36
36
|
}));
|
|
37
37
|
});
|
|
@@ -48,10 +48,13 @@ export const useGridRowGroupingPreProcessors = (apiRef, props) => {
|
|
|
48
48
|
const groupingColDefs = getGroupingColDefs(columnsState);
|
|
49
49
|
let newColumnFields = [];
|
|
50
50
|
const newColumnsLookup = {};
|
|
51
|
+
const prevGroupingfields = [];
|
|
51
52
|
|
|
52
53
|
// We only keep the non-grouping columns
|
|
53
54
|
columnsState.orderedFields.forEach(field => {
|
|
54
|
-
if (
|
|
55
|
+
if (isGroupingColumn(field)) {
|
|
56
|
+
prevGroupingfields.push(field);
|
|
57
|
+
} else {
|
|
55
58
|
newColumnFields.push(field);
|
|
56
59
|
newColumnsLookup[field] = columnsState.lookup[field];
|
|
57
60
|
}
|
|
@@ -66,9 +69,11 @@ export const useGridRowGroupingPreProcessors = (apiRef, props) => {
|
|
|
66
69
|
}
|
|
67
70
|
newColumnsLookup[groupingColDef.field] = groupingColDef;
|
|
68
71
|
});
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
if (prevGroupingfields.length !== groupingColDefs.length) {
|
|
73
|
+
const startIndex = newColumnFields[0] === GRID_CHECKBOX_SELECTION_FIELD ? 1 : 0;
|
|
74
|
+
newColumnFields = [...newColumnFields.slice(0, startIndex), ...groupingColDefs.map(colDef => colDef.field), ...newColumnFields.slice(startIndex)];
|
|
75
|
+
columnsState.orderedFields = newColumnFields;
|
|
76
|
+
}
|
|
72
77
|
columnsState.lookup = newColumnsLookup;
|
|
73
78
|
return columnsState;
|
|
74
79
|
}, [getGroupingColDefs]);
|
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 = "MTczNTE2NDAwMDAwMA==";
|
|
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-premium",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.6",
|
|
4
4
|
"description": "The Premium plan edition of the Data Grid Components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"exceljs": "^4.4.0",
|
|
41
41
|
"prop-types": "^15.8.1",
|
|
42
42
|
"reselect": "^5.1.1",
|
|
43
|
-
"@mui/x-data-grid": "8.0.0-alpha.
|
|
44
|
-
"@mui/x-data-grid-pro": "8.0.0-alpha.
|
|
45
|
-
"@mui/x-internals": "8.0.0-alpha.
|
|
46
|
-
"@mui/x-license": "8.0.0-alpha.
|
|
43
|
+
"@mui/x-data-grid": "8.0.0-alpha.6",
|
|
44
|
+
"@mui/x-data-grid-pro": "8.0.0-alpha.6",
|
|
45
|
+
"@mui/x-internals": "8.0.0-alpha.6",
|
|
46
|
+
"@mui/x-license": "8.0.0-alpha.6"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@emotion/react": "^11.9.0",
|
package/utils/releaseInfo.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getReleaseInfo = void 0;
|
|
7
7
|
var _utils = require("@mui/utils");
|
|
8
8
|
const getReleaseInfo = () => {
|
|
9
|
-
const releaseInfo = "
|
|
9
|
+
const releaseInfo = "MTczNTE2NDAwMDAwMA==";
|
|
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
|