@mui/x-data-grid 7.19.0 → 7.20.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 +105 -13
- package/DataGrid/DataGrid.js +7 -0
- package/components/columnHeaders/GridColumnHeaderItem.js +1 -0
- package/hooks/core/useGridRefs.js +4 -0
- package/hooks/features/dimensions/useGridDimensions.js +2 -2
- package/hooks/features/editing/useGridCellEditing.js +3 -1
- package/hooks/features/editing/useGridRowEditing.js +3 -1
- package/hooks/features/events/useGridEvents.d.ts +1 -1
- package/hooks/features/events/useGridEvents.js +1 -0
- package/hooks/features/filter/gridFilterUtils.js +1 -1
- package/hooks/features/rowSelection/utils.js +6 -6
- package/hooks/features/rows/gridRowsUtils.js +1 -1
- package/hooks/features/rows/useGridRowSpanning.js +1 -1
- package/hooks/features/scroll/useGridScroll.js +7 -3
- package/hooks/features/sorting/gridSortingUtils.js +1 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
- package/hooks/utils/useGridApiContext.js +1 -1
- package/hooks/utils/useGridApiEventHandler.d.ts +1 -1
- package/hooks/utils/useGridApiEventHandler.js +1 -1
- package/hooks/utils/useGridConfiguration.js +1 -1
- package/hooks/utils/useGridPrivateApiContext.js +1 -1
- package/index.d.ts +2 -2
- package/index.js +3 -3
- package/joy/icons.js +0 -1
- package/locales/jaJP.js +4 -4
- package/models/api/gridApiCommunity.d.ts +1 -1
- package/models/api/gridCoreApi.d.ts +9 -1
- package/models/api/gridFilterApi.d.ts +1 -1
- package/models/events/gridEventLookup.d.ts +7 -0
- package/models/gridStateCommunity.d.ts +2 -2
- package/models/props/DataGridProps.d.ts +23 -14
- package/modern/DataGrid/DataGrid.js +7 -0
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +1 -0
- package/modern/hooks/core/useGridRefs.js +4 -0
- package/modern/hooks/features/dimensions/useGridDimensions.js +2 -2
- package/modern/hooks/features/editing/useGridCellEditing.js +3 -1
- package/modern/hooks/features/editing/useGridRowEditing.js +3 -1
- package/modern/hooks/features/events/useGridEvents.js +1 -0
- package/modern/hooks/features/filter/gridFilterUtils.js +1 -1
- package/modern/hooks/features/rowSelection/utils.js +6 -6
- package/modern/hooks/features/rows/gridRowsUtils.js +1 -1
- package/modern/hooks/features/rows/useGridRowSpanning.js +1 -1
- package/modern/hooks/features/scroll/useGridScroll.js +7 -3
- package/modern/hooks/features/sorting/gridSortingUtils.js +1 -1
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
- package/modern/hooks/utils/useGridApiContext.js +1 -1
- package/modern/hooks/utils/useGridApiEventHandler.js +1 -1
- package/modern/hooks/utils/useGridConfiguration.js +1 -1
- package/modern/hooks/utils/useGridPrivateApiContext.js +1 -1
- package/modern/index.js +3 -3
- package/modern/joy/icons.js +0 -1
- package/modern/locales/jaJP.js +4 -4
- package/modern/utils/domUtils.js +1 -1
- package/node/DataGrid/DataGrid.js +7 -0
- package/node/components/columnHeaders/GridColumnHeaderItem.js +1 -0
- package/node/hooks/core/useGridRefs.js +4 -0
- package/node/hooks/features/dimensions/useGridDimensions.js +2 -2
- package/node/hooks/features/editing/useGridCellEditing.js +3 -1
- package/node/hooks/features/editing/useGridRowEditing.js +3 -1
- package/node/hooks/features/events/useGridEvents.js +1 -0
- package/node/hooks/features/filter/gridFilterUtils.js +1 -1
- package/node/hooks/features/rowSelection/utils.js +6 -6
- package/node/hooks/features/rows/gridRowsUtils.js +1 -1
- package/node/hooks/features/rows/useGridRowSpanning.js +1 -1
- package/node/hooks/features/scroll/useGridScroll.js +7 -3
- package/node/hooks/features/sorting/gridSortingUtils.js +1 -1
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
- package/node/hooks/utils/useGridApiContext.js +1 -1
- package/node/hooks/utils/useGridApiEventHandler.js +1 -1
- package/node/hooks/utils/useGridConfiguration.js +1 -1
- package/node/hooks/utils/useGridPrivateApiContext.js +1 -1
- package/node/index.js +1 -1
- package/node/joy/icons.js +0 -1
- package/node/locales/jaJP.js +4 -4
- package/node/utils/domUtils.js +1 -1
- package/package.json +4 -4
- package/utils/domUtils.js +1 -1
|
@@ -53,6 +53,8 @@ const useGridScroll = (apiRef, props) => {
|
|
|
53
53
|
const logger = (0, _useGridLogger.useGridLogger)(apiRef, 'useGridScroll');
|
|
54
54
|
const colRef = apiRef.current.columnHeadersContainerRef;
|
|
55
55
|
const virtualScrollerRef = apiRef.current.virtualScrollerRef;
|
|
56
|
+
const virtualScrollbarHorizontalRef = apiRef.current.virtualScrollbarHorizontalRef;
|
|
57
|
+
const virtualScrollbarVerticalRef = apiRef.current.virtualScrollbarVerticalRef;
|
|
56
58
|
const visibleSortedRows = (0, _useGridSelector.useGridSelector)(apiRef, _gridFilterSelector.gridExpandedSortedRowEntriesSelector);
|
|
57
59
|
const scrollToIndexes = React.useCallback(params => {
|
|
58
60
|
const dimensions = (0, _dimensions.gridDimensionsSelector)(apiRef.current.state);
|
|
@@ -106,18 +108,20 @@ const useGridScroll = (apiRef, props) => {
|
|
|
106
108
|
return false;
|
|
107
109
|
}, [logger, apiRef, virtualScrollerRef, props.pagination, visibleSortedRows]);
|
|
108
110
|
const scroll = React.useCallback(params => {
|
|
109
|
-
if (virtualScrollerRef.current && params.left !== undefined && colRef.current) {
|
|
111
|
+
if (virtualScrollerRef.current && virtualScrollbarHorizontalRef.current && params.left !== undefined && colRef.current) {
|
|
110
112
|
const direction = isRtl ? -1 : 1;
|
|
111
113
|
colRef.current.scrollLeft = params.left;
|
|
112
114
|
virtualScrollerRef.current.scrollLeft = direction * params.left;
|
|
115
|
+
virtualScrollbarHorizontalRef.current.scrollLeft = direction * params.left;
|
|
113
116
|
logger.debug(`Scrolling left: ${params.left}`);
|
|
114
117
|
}
|
|
115
|
-
if (virtualScrollerRef.current && params.top !== undefined) {
|
|
118
|
+
if (virtualScrollerRef.current && virtualScrollbarVerticalRef.current && params.top !== undefined) {
|
|
116
119
|
virtualScrollerRef.current.scrollTop = params.top;
|
|
120
|
+
virtualScrollbarVerticalRef.current.scrollTop = params.top;
|
|
117
121
|
logger.debug(`Scrolling top: ${params.top}`);
|
|
118
122
|
}
|
|
119
123
|
logger.debug(`Scrolling, updating container, and viewport`);
|
|
120
|
-
}, [virtualScrollerRef, isRtl, colRef, logger]);
|
|
124
|
+
}, [virtualScrollerRef, virtualScrollbarHorizontalRef, virtualScrollbarVerticalRef, isRtl, colRef, logger]);
|
|
121
125
|
const getScrollPosition = React.useCallback(() => {
|
|
122
126
|
if (!virtualScrollerRef?.current) {
|
|
123
127
|
return {
|
|
@@ -10,7 +10,7 @@ var _warning = require("@mui/x-internals/warning");
|
|
|
10
10
|
const sanitizeSortModel = (model, disableMultipleColumnsSorting) => {
|
|
11
11
|
if (disableMultipleColumnsSorting && model.length > 1) {
|
|
12
12
|
if (process.env.NODE_ENV !== 'production') {
|
|
13
|
-
(0, _warning.warnOnce)(['MUI X: The `sortModel` can only contain a single item when the `disableMultipleColumnsSorting` prop is set to `true`.', 'If you are using the community version of the
|
|
13
|
+
(0, _warning.warnOnce)(['MUI X: The `sortModel` can only contain a single item when the `disableMultipleColumnsSorting` prop is set to `true`.', 'If you are using the community version of the Data Grid, this prop is always `true`.'], 'error');
|
|
14
14
|
}
|
|
15
15
|
return [model[0]];
|
|
16
16
|
}
|
|
@@ -84,8 +84,8 @@ const useGridVirtualScroller = () => {
|
|
|
84
84
|
const gridRootRef = apiRef.current.rootElementRef;
|
|
85
85
|
const mainRef = apiRef.current.mainElementRef;
|
|
86
86
|
const scrollerRef = apiRef.current.virtualScrollerRef;
|
|
87
|
-
const scrollbarVerticalRef =
|
|
88
|
-
const scrollbarHorizontalRef =
|
|
87
|
+
const scrollbarVerticalRef = apiRef.current.virtualScrollbarVerticalRef;
|
|
88
|
+
const scrollbarHorizontalRef = apiRef.current.virtualScrollbarHorizontalRef;
|
|
89
89
|
const contentHeight = dimensions.contentSize.height;
|
|
90
90
|
const columnsTotalWidth = dimensions.columnsTotalWidth;
|
|
91
91
|
const hasColSpan = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnsSelector.gridHasColSpanSelector);
|
|
@@ -10,7 +10,7 @@ var _GridApiContext = require("../../components/GridApiContext");
|
|
|
10
10
|
function useGridApiContext() {
|
|
11
11
|
const apiRef = React.useContext(_GridApiContext.GridApiContext);
|
|
12
12
|
if (apiRef === undefined) {
|
|
13
|
-
throw new Error(['MUI X: Could not find the
|
|
13
|
+
throw new Error(['MUI X: Could not find the Data Grid context.', 'It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.', 'This can also happen if you are bundling multiple versions of the Data Grid.'].join('\n'));
|
|
14
14
|
}
|
|
15
15
|
return apiRef;
|
|
16
16
|
}
|
|
@@ -13,7 +13,7 @@ var _TimerBasedCleanupTracking = require("../../utils/cleanupTracking/TimerBased
|
|
|
13
13
|
var _FinalizationRegistryBasedCleanupTracking = require("../../utils/cleanupTracking/FinalizationRegistryBasedCleanupTracking");
|
|
14
14
|
/**
|
|
15
15
|
* Signal to the underlying logic what version of the public component API
|
|
16
|
-
* of the
|
|
16
|
+
* of the Data Grid is exposed.
|
|
17
17
|
*/
|
|
18
18
|
var GridSignature = exports.GridSignature = /*#__PURE__*/function (GridSignature) {
|
|
19
19
|
GridSignature["DataGrid"] = "DataGrid";
|
|
@@ -10,7 +10,7 @@ var _GridConfigurationContext = require("../../components/GridConfigurationConte
|
|
|
10
10
|
const useGridConfiguration = () => {
|
|
11
11
|
const configuration = React.useContext(_GridConfigurationContext.GridConfigurationContext);
|
|
12
12
|
if (configuration === undefined) {
|
|
13
|
-
throw new Error(['MUI X: Could not find the
|
|
13
|
+
throw new Error(['MUI X: Could not find the Data Grid configuration context.', 'It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.', 'This can also happen if you are bundling multiple versions of the Data Grid.'].join('\n'));
|
|
14
14
|
}
|
|
15
15
|
return configuration;
|
|
16
16
|
};
|
|
@@ -14,7 +14,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
14
14
|
function useGridPrivateApiContext() {
|
|
15
15
|
const privateApiRef = React.useContext(GridPrivateApiContext);
|
|
16
16
|
if (privateApiRef === undefined) {
|
|
17
|
-
throw new Error(['MUI X: Could not find the
|
|
17
|
+
throw new Error(['MUI X: Could not find the Data Grid private context.', 'It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.', 'This can also happen if you are bundling multiple versions of the Data Grid.'].join('\n'));
|
|
18
18
|
}
|
|
19
19
|
return privateApiRef;
|
|
20
20
|
}
|
package/node/index.js
CHANGED
package/node/joy/icons.js
CHANGED
|
@@ -42,7 +42,6 @@ function createSvgIcon(path, displayName) {
|
|
|
42
42
|
} = _ref,
|
|
43
43
|
props = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
44
44
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SvgIcon.default, (0, _extends2.default)({
|
|
45
|
-
"data-testid": `${displayName}Icon`,
|
|
46
45
|
ref: ref,
|
|
47
46
|
fill: "none",
|
|
48
47
|
stroke: "currentColor",
|
package/node/locales/jaJP.js
CHANGED
|
@@ -53,9 +53,9 @@ const jaJPGrid = {
|
|
|
53
53
|
filterPanelInputPlaceholder: '値を入力…',
|
|
54
54
|
// Filter operators text
|
|
55
55
|
filterOperatorContains: '...を含む',
|
|
56
|
-
|
|
56
|
+
filterOperatorDoesNotContain: '...を含まない',
|
|
57
57
|
filterOperatorEquals: '...に等しい',
|
|
58
|
-
|
|
58
|
+
filterOperatorDoesNotEqual: '...に等しくない',
|
|
59
59
|
filterOperatorStartsWith: '...で始まる',
|
|
60
60
|
filterOperatorEndsWith: '...で終わる',
|
|
61
61
|
filterOperatorIs: '...である',
|
|
@@ -75,9 +75,9 @@ const jaJPGrid = {
|
|
|
75
75
|
'filterOperator<=': '<=',
|
|
76
76
|
// Header filter operators text
|
|
77
77
|
headerFilterOperatorContains: '含む',
|
|
78
|
-
|
|
78
|
+
headerFilterOperatorDoesNotContain: '含まない',
|
|
79
79
|
headerFilterOperatorEquals: '等しい',
|
|
80
|
-
|
|
80
|
+
headerFilterOperatorDoesNotEqual: '等しくない',
|
|
81
81
|
headerFilterOperatorStartsWith: 'で始まる',
|
|
82
82
|
headerFilterOperatorEndsWith: 'で終わる',
|
|
83
83
|
headerFilterOperatorIs: 'である',
|
package/node/utils/domUtils.js
CHANGED
|
@@ -213,7 +213,7 @@ function findGridCells(api, field) {
|
|
|
213
213
|
}
|
|
214
214
|
function queryRows(api) {
|
|
215
215
|
return api.virtualScrollerRef.current.querySelectorAll(
|
|
216
|
-
// Use > to ignore rows from nested
|
|
216
|
+
// Use > to ignore rows from nested Data Grids (for example in detail panel)
|
|
217
217
|
`:scope > div > div > .${_gridClasses.gridClasses.row}`);
|
|
218
218
|
}
|
|
219
219
|
function parseCellColIndex(col) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.20.0",
|
|
4
4
|
"description": "The Community plan edition of the Data Grid components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"directory": "packages/x-data-grid"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@babel/runtime": "^7.25.
|
|
41
|
-
"@mui/utils": "^5.16.6",
|
|
40
|
+
"@babel/runtime": "^7.25.7",
|
|
41
|
+
"@mui/utils": "^5.16.6 || ^6.0.0",
|
|
42
42
|
"clsx": "^2.1.1",
|
|
43
43
|
"prop-types": "^15.8.1",
|
|
44
44
|
"reselect": "^5.1.1",
|
|
45
|
-
"@mui/x-internals": "7.
|
|
45
|
+
"@mui/x-internals": "7.20.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@emotion/react": "^11.9.0",
|
package/utils/domUtils.js
CHANGED
|
@@ -187,7 +187,7 @@ export function findGridCells(api, field) {
|
|
|
187
187
|
}
|
|
188
188
|
function queryRows(api) {
|
|
189
189
|
return api.virtualScrollerRef.current.querySelectorAll(
|
|
190
|
-
// Use > to ignore rows from nested
|
|
190
|
+
// Use > to ignore rows from nested Data Grids (for example in detail panel)
|
|
191
191
|
`:scope > div > div > .${gridClasses.row}`);
|
|
192
192
|
}
|
|
193
193
|
function parseCellColIndex(col) {
|