@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.
Files changed (77) hide show
  1. package/CHANGELOG.md +105 -13
  2. package/DataGrid/DataGrid.js +7 -0
  3. package/components/columnHeaders/GridColumnHeaderItem.js +1 -0
  4. package/hooks/core/useGridRefs.js +4 -0
  5. package/hooks/features/dimensions/useGridDimensions.js +2 -2
  6. package/hooks/features/editing/useGridCellEditing.js +3 -1
  7. package/hooks/features/editing/useGridRowEditing.js +3 -1
  8. package/hooks/features/events/useGridEvents.d.ts +1 -1
  9. package/hooks/features/events/useGridEvents.js +1 -0
  10. package/hooks/features/filter/gridFilterUtils.js +1 -1
  11. package/hooks/features/rowSelection/utils.js +6 -6
  12. package/hooks/features/rows/gridRowsUtils.js +1 -1
  13. package/hooks/features/rows/useGridRowSpanning.js +1 -1
  14. package/hooks/features/scroll/useGridScroll.js +7 -3
  15. package/hooks/features/sorting/gridSortingUtils.js +1 -1
  16. package/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
  17. package/hooks/utils/useGridApiContext.js +1 -1
  18. package/hooks/utils/useGridApiEventHandler.d.ts +1 -1
  19. package/hooks/utils/useGridApiEventHandler.js +1 -1
  20. package/hooks/utils/useGridConfiguration.js +1 -1
  21. package/hooks/utils/useGridPrivateApiContext.js +1 -1
  22. package/index.d.ts +2 -2
  23. package/index.js +3 -3
  24. package/joy/icons.js +0 -1
  25. package/locales/jaJP.js +4 -4
  26. package/models/api/gridApiCommunity.d.ts +1 -1
  27. package/models/api/gridCoreApi.d.ts +9 -1
  28. package/models/api/gridFilterApi.d.ts +1 -1
  29. package/models/events/gridEventLookup.d.ts +7 -0
  30. package/models/gridStateCommunity.d.ts +2 -2
  31. package/models/props/DataGridProps.d.ts +23 -14
  32. package/modern/DataGrid/DataGrid.js +7 -0
  33. package/modern/components/columnHeaders/GridColumnHeaderItem.js +1 -0
  34. package/modern/hooks/core/useGridRefs.js +4 -0
  35. package/modern/hooks/features/dimensions/useGridDimensions.js +2 -2
  36. package/modern/hooks/features/editing/useGridCellEditing.js +3 -1
  37. package/modern/hooks/features/editing/useGridRowEditing.js +3 -1
  38. package/modern/hooks/features/events/useGridEvents.js +1 -0
  39. package/modern/hooks/features/filter/gridFilterUtils.js +1 -1
  40. package/modern/hooks/features/rowSelection/utils.js +6 -6
  41. package/modern/hooks/features/rows/gridRowsUtils.js +1 -1
  42. package/modern/hooks/features/rows/useGridRowSpanning.js +1 -1
  43. package/modern/hooks/features/scroll/useGridScroll.js +7 -3
  44. package/modern/hooks/features/sorting/gridSortingUtils.js +1 -1
  45. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
  46. package/modern/hooks/utils/useGridApiContext.js +1 -1
  47. package/modern/hooks/utils/useGridApiEventHandler.js +1 -1
  48. package/modern/hooks/utils/useGridConfiguration.js +1 -1
  49. package/modern/hooks/utils/useGridPrivateApiContext.js +1 -1
  50. package/modern/index.js +3 -3
  51. package/modern/joy/icons.js +0 -1
  52. package/modern/locales/jaJP.js +4 -4
  53. package/modern/utils/domUtils.js +1 -1
  54. package/node/DataGrid/DataGrid.js +7 -0
  55. package/node/components/columnHeaders/GridColumnHeaderItem.js +1 -0
  56. package/node/hooks/core/useGridRefs.js +4 -0
  57. package/node/hooks/features/dimensions/useGridDimensions.js +2 -2
  58. package/node/hooks/features/editing/useGridCellEditing.js +3 -1
  59. package/node/hooks/features/editing/useGridRowEditing.js +3 -1
  60. package/node/hooks/features/events/useGridEvents.js +1 -0
  61. package/node/hooks/features/filter/gridFilterUtils.js +1 -1
  62. package/node/hooks/features/rowSelection/utils.js +6 -6
  63. package/node/hooks/features/rows/gridRowsUtils.js +1 -1
  64. package/node/hooks/features/rows/useGridRowSpanning.js +1 -1
  65. package/node/hooks/features/scroll/useGridScroll.js +7 -3
  66. package/node/hooks/features/sorting/gridSortingUtils.js +1 -1
  67. package/node/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
  68. package/node/hooks/utils/useGridApiContext.js +1 -1
  69. package/node/hooks/utils/useGridApiEventHandler.js +1 -1
  70. package/node/hooks/utils/useGridConfiguration.js +1 -1
  71. package/node/hooks/utils/useGridPrivateApiContext.js +1 -1
  72. package/node/index.js +1 -1
  73. package/node/joy/icons.js +0 -1
  74. package/node/locales/jaJP.js +4 -4
  75. package/node/utils/domUtils.js +1 -1
  76. package/package.json +4 -4
  77. 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 `DataGrid`, this prop is always `true`.'], 'error');
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 = React.useRef(null);
88
- const scrollbarHorizontalRef = React.useRef(null);
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 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'));
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 data grid is exposed.
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 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'));
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 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'));
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
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v7.19.0
2
+ * @mui/x-data-grid v7.20.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
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",
@@ -53,9 +53,9 @@ const jaJPGrid = {
53
53
  filterPanelInputPlaceholder: '値を入力…',
54
54
  // Filter operators text
55
55
  filterOperatorContains: '...を含む',
56
- // filterOperatorDoesNotContain: 'does not contain',
56
+ filterOperatorDoesNotContain: '...を含まない',
57
57
  filterOperatorEquals: '...に等しい',
58
- // filterOperatorDoesNotEqual: 'does not equal',
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
- // headerFilterOperatorDoesNotContain: 'Does not contain',
78
+ headerFilterOperatorDoesNotContain: '含まない',
79
79
  headerFilterOperatorEquals: '等しい',
80
- // headerFilterOperatorDoesNotEqual: 'Does not equal',
80
+ headerFilterOperatorDoesNotEqual: '等しくない',
81
81
  headerFilterOperatorStartsWith: 'で始まる',
82
82
  headerFilterOperatorEndsWith: 'で終わる',
83
83
  headerFilterOperatorIs: 'である',
@@ -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 data grids (for example in detail panel)
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.19.0",
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.6",
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.18.0"
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 data grids (for example in detail panel)
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) {