@mui/x-data-grid 8.9.2 → 8.10.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 (40) hide show
  1. package/CHANGELOG.md +121 -6
  2. package/components/GridFooter.js +1 -1
  3. package/components/GridPagination.js +4 -3
  4. package/components/GridRow.js +3 -1
  5. package/esm/components/GridFooter.js +1 -1
  6. package/esm/components/GridPagination.js +3 -2
  7. package/esm/components/GridRow.js +3 -1
  8. package/esm/hooks/features/dataSource/models.d.ts +11 -2
  9. package/esm/hooks/features/dataSource/useGridDataSourceBase.d.ts +1 -1
  10. package/esm/hooks/features/dataSource/useGridDataSourceBase.js +9 -2
  11. package/esm/hooks/features/editing/useGridRowEditing.js +4 -1
  12. package/esm/hooks/features/rowReorder/gridRowReorderInterfaces.d.ts +9 -0
  13. package/esm/hooks/features/rowReorder/gridRowReorderInterfaces.js +1 -0
  14. package/esm/hooks/features/rowReorder/gridRowReorderSelector.d.ts +5 -0
  15. package/esm/hooks/features/rowReorder/gridRowReorderSelector.js +3 -0
  16. package/esm/hooks/features/rowSelection/useGridRowSelection.js +2 -2
  17. package/esm/hooks/features/rowSelection/utils.js +5 -0
  18. package/esm/index.js +1 -1
  19. package/esm/internals/index.d.ts +2 -0
  20. package/esm/internals/index.js +1 -0
  21. package/esm/locales/nnNO.js +96 -107
  22. package/esm/material/index.js +2 -2
  23. package/esm/models/gridStateCommunity.d.ts +2 -0
  24. package/hooks/features/dataSource/models.d.ts +11 -2
  25. package/hooks/features/dataSource/useGridDataSourceBase.d.ts +1 -1
  26. package/hooks/features/dataSource/useGridDataSourceBase.js +10 -3
  27. package/hooks/features/editing/useGridRowEditing.js +4 -1
  28. package/hooks/features/rowReorder/gridRowReorderInterfaces.d.ts +9 -0
  29. package/hooks/features/rowReorder/gridRowReorderInterfaces.js +5 -0
  30. package/hooks/features/rowReorder/gridRowReorderSelector.d.ts +5 -0
  31. package/hooks/features/rowReorder/gridRowReorderSelector.js +9 -0
  32. package/hooks/features/rowSelection/useGridRowSelection.js +2 -2
  33. package/hooks/features/rowSelection/utils.js +5 -0
  34. package/index.js +1 -1
  35. package/internals/index.d.ts +2 -0
  36. package/internals/index.js +8 -0
  37. package/locales/nnNO.js +96 -107
  38. package/material/index.js +2 -2
  39. package/models/gridStateCommunity.d.ts +2 -0
  40. package/package.json +3 -4
package/CHANGELOG.md CHANGED
@@ -5,6 +5,121 @@
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.10.0
9
+
10
+ _Aug 8, 2025_
11
+
12
+ We'd like to extend a big thank you to the 17 contributors who made this release possible. Here are some highlights ✨:
13
+
14
+ - 📊 [`FunnelChart`](https://mui.com/x/react-charts/funnel/) marked as stable
15
+ - 📈 [Zoom slider](https://mui.com/x/react-charts/zoom-and-pan/#zoom-slider) and [Preview](https://mui.com/x/react-charts/zoom-and-pan/#preview) marked as stable
16
+ - 📈 Supporting [label groups](https://mui.com/x/react-charts/axis/#grouped-axes) in band and point axis
17
+ - 🌎 Improve Norwegian Nynorsk (nn-NO) locale on the Data Grid
18
+ - 🐞 Bugfixes
19
+ - 📚 Documentation improvements
20
+
21
+ Special thanks go out to the community members for their valuable contributions:
22
+ @AnderzL7, @aqeelat, @dwrth, @noobyogi0010, @nusr, @sai6855
23
+
24
+ The following are all team members who have contributed to this release:
25
+ @arminmeh, @bernardobelchior, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @mapache-salvaje, @MBilalShafi, @oliviertassinari, @rita-codes, @romgrk
26
+
27
+ ### Data Grid
28
+
29
+ #### `@mui/x-data-grid@8.10.0`
30
+
31
+ - [DataGrid] Move spread operator in `BaseSelect` to allow `variant` change (#19026) @dwrth
32
+ - [DataGrid] Use `use-sync-external-store` shim (#19063) @romgrk
33
+ - [DataGrid] Allow skipping cache in `dataSource.fetchRows()` API method (#18904) @MBilalShafi
34
+ - [DataGrid] Do not call `preProcessEditCellProps()` if cell is not editable based on `isCellEditable()` (#18405) @nusr
35
+ - [DataGrid] Fix `renderCountry` throwing an error when used in tree data (#19068) @cherniavskii
36
+ - [DataGrid] Fix performance issue for root level "select all" (#19015) @MBilalShafi
37
+ - [DataGrid] Fix pagination `slotProps` being ignored by the grid (#19095) @romgrk
38
+ - [l10n] Improve Norwegian Nynorsk (nn-NO) locale (#19076) @AnderzL7
39
+
40
+ #### `@mui/x-data-grid-pro@8.10.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
41
+
42
+ Same changes as in `@mui/x-data-grid@8.10.0`, plus:
43
+
44
+ - [DataGridPro] Fix row reorder not working with column reorder disabled (#19016) @MBilalShafi
45
+ - [DataGridPro] Fix header filters cache sharing issue (#19090) @MBilalShafi
46
+
47
+ #### `@mui/x-data-grid-premium@8.10.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
48
+
49
+ Same changes as in `@mui/x-data-grid-pro@8.10.0`, plus:
50
+
51
+ - [DataGridPremium] Allow additional derived columns customization via `valueFormatter` (#18982) @arminmeh
52
+ - [DataGridPremium] Fix complex `singleSelect` columns not working in pivot model (#18971) @cherniavskii
53
+
54
+ ### Date and Time Pickers
55
+
56
+ #### `@mui/x-date-pickers@8.10.0`
57
+
58
+ - [pickers] `MuiPickersLayout-toolbar` is overlapping the Calendar in RTL `MobileDatePicker` variant (#18981) @rita-codes
59
+
60
+ #### `@mui/x-date-pickers-pro@8.10.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
61
+
62
+ Same changes as in `@mui/x-date-pickers@8.10.0`.
63
+
64
+ ### Charts
65
+
66
+ #### `@mui/x-charts@8.10.0`
67
+
68
+ - [charts] Add `groups` to `band` and `point` axis config (#18766) @JCQuintas
69
+ - [charts] Animation example using `motion` library (#18993) @JCQuintas
70
+ - [charts] Deprecate `Unstable_` radar exports (#19079) @JCQuintas
71
+ - [charts] Improve grouped axis logic (#19069) @JCQuintas
72
+ - [charts] Fix type assertion in axis highlight components (#19060) @sai6855
73
+ - [charts] Remove unnecessary type assertion in tooltip `valueFormatter` in heatmap (#19047) @sai6855
74
+
75
+ #### `@mui/x-charts-pro@8.10.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
76
+
77
+ Same changes as in `@mui/x-charts@8.10.0`, plus:
78
+
79
+ - [charts-pro] Fix `slotProps.tooltip.trigger` not respected in `ScatterChartPro` and `FunnelChart` (#18902) @bernardobelchior
80
+ - [charts-pro] Fix zoom filtering adjusting axis too soon (#18992) @bernardobelchior
81
+ - [charts-pro] Mark `FunnelChart` as stable (#19048) @JCQuintas
82
+ - [charts-pro] Mark zoom slider and preview as stable (#19049) @JCQuintas
83
+ - [charts-pro] Refactor `createAxisFilterMapper` (#18998) @bernardobelchior
84
+
85
+ ### Tree View
86
+
87
+ #### `@mui/x-tree-view@8.10.0`
88
+
89
+ Internal changes.
90
+
91
+ #### `@mui/x-tree-view-pro@8.10.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
92
+
93
+ Same changes as in `@mui/x-tree-view@8.10.0`.
94
+
95
+ ### Codemod
96
+
97
+ #### `@mui/x-codemod@8.10.0`
98
+
99
+ Internal changes.
100
+
101
+ ### Docs
102
+
103
+ - [docs] Add CSS bundler breaking change to migration guide (#17436) @romgrk
104
+ - [docs] `RichTreeViewPro` demo for dragging via custom drag-handle is not working properly (#19008) @rita-codes
105
+ - [docs] Fix broken link to D3 in Charts (#19020) @oliviertassinari
106
+ - [docs] Revise the Charts Animation doc (#18990) @mapache-salvaje
107
+ - [docs] Fix incorrect code in line chart preview (#19023) @noobyogi0010
108
+ - [docs] Improve bundling instructions for the Data Grid (#19065) @romgrk
109
+ - [docs] Reduce image size in the inventory grid demo (#19004) @arminmeh
110
+
111
+ ### Core
112
+
113
+ - [core] Fix ESLint reference name @oliviertassinari
114
+
115
+ ### Miscellaneous
116
+
117
+ - [infra] Remove bundle size tracking for subpaths (#19072) @Janpot
118
+ - [infra] Accept `PORT` env on `docs:dev` script (#19014) @JCQuintas
119
+ - [infra] Skip codesandbox iframe demos in regressions tests (#18970) @cherniavskii
120
+ - [infra] Remove package.json `module` field (#18961) @Janpot
121
+ - [internal] Remove peer dependency on `@mui/system` (#19062) @aqeelat
122
+
8
123
  ## 8.9.2
9
124
 
10
125
  _Jul 31, 2025_
@@ -418,8 +533,8 @@ Same changes as in `@mui/x-tree-view@8.7.0`, plus:
418
533
 
419
534
  - [code-infra] Bump code-infra version and fix breaking changes (#18653) @brijeshb42
420
535
  - [code-infra] Ensure `material-ui/disallow-react-api-in-server-components` ESLint rule is applied (#18570) @LukasTy
421
- - [code-infra] Migrate to flat eslint config (#18562) @brijeshb42
422
- - [code-infra] Refactor eslint config (#18643) @LukasTy
536
+ - [code-infra] Migrate to flat ESLint config (#18562) @brijeshb42
537
+ - [code-infra] Refactor ESLint config (#18643) @LukasTy
423
538
  - [infra] Add renovatebot rule for latest infra packages (#18609) @Janpot
424
539
  - [infra] Move pushArgos script to code-infra (#18667) @Janpot
425
540
  - [infra] Updates release script to fetch latest major version from upstream (#18552) @michelengelen
@@ -1333,7 +1448,7 @@ Same changes as in `@mui/x-tree-view@8.2.0`.
1333
1448
  - [core] Fix all Vale errors @oliviertassinari
1334
1449
  - [core] Move `loadStyleSheets` to internals and use it in data grid and charts (#17548) @bernardobelchior
1335
1450
  - [core] Remove empty version (#17582) @oliviertassinari
1336
- - [core] Remove eslint from codemod spec files (#17443) @alexfauquette
1451
+ - [core] Remove ESLint from codemod spec files (#17443) @alexfauquette
1337
1452
  - [core] Remove unnecessary versions (#17597) @oliviertassinari
1338
1453
  - [code-infra] Allow postinstall scripts for packages requesting it (#17635) @LukasTy
1339
1454
  - [code-infra] Data Grid `vitest` changes (#17619) @JCQuintas
@@ -6827,7 +6942,7 @@ Same changes as in `@mui/x-date-pickers@7.8.0`.
6827
6942
 
6828
6943
  ### Core
6829
6944
 
6830
- - [core] Add eslint rule to restrict import from `../internals` root (#13633) @JCQuintas
6945
+ - [core] Add ESLint rule to restrict import from `../internals` root (#13633) @JCQuintas
6831
6946
  - [docs-infra] Sync `\_app` folder with monorepo (#13582) @Janpot
6832
6947
  - [license] Allow usage of Charts and Tree View Pro package for old premium licenses (#13619) @flaviendelangle
6833
6948
 
@@ -6965,7 +7080,7 @@ Same changes as in `@mui/x-date-pickers@7.7.0`.
6965
7080
 
6966
7081
  - [charts] Add watermark on the pro `ResponsiveChartContainer` (#13398) @alexfauquette
6967
7082
  - [charts] Allow to specify y-axis configuration (#13438) @alexfauquette
6968
- - [charts] Fix eslint for react compiler (#13444) @alexfauquette
7083
+ - [charts] Fix ESLint for react compiler (#13444) @alexfauquette
6969
7084
  - [charts] Improve themeAugmentation typing (#13433) @noraleonte
6970
7085
  - [charts] Move the `ZAxisContextProvider` by default in the `ChartContainer` (#13465) @alexfauquette
6971
7086
  - [charts] Use plugins to define series extremum and colors (#13397) @alexfauquette
@@ -7512,7 +7627,7 @@ Same changes as in `@mui/x-date-pickers@7.3.1`.
7512
7627
  - [core] Use `describeTreeView` for focus tests (#12698) @flaviendelangle
7513
7628
  - [core] Use `describeTreeView` for type-ahead tests (#12811) @flaviendelangle
7514
7629
  - [code-infra] Change package manager to `pnpm` (#11875) @LukasTy
7515
- - [code-infra] Closer sync with eslint config of codebase (#12864) @oliviertassinari
7630
+ - [code-infra] Closer sync with ESLint config of codebase (#12864) @oliviertassinari
7516
7631
  - [support-infra] Add release announcement to GitHub workflows (#11867) (#12843) @michelengelen
7517
7632
 
7518
7633
  ## 7.3.0
@@ -32,7 +32,7 @@ const GridFooter = exports.GridFooter = (0, _forwardRef.forwardRef)(function Gri
32
32
  rowCount: totalTopLevelRowCount,
33
33
  visibleRowCount: visibleTopLevelRowCount
34
34
  })) : null;
35
- const paginationElement = rootProps.pagination && !rootProps.hideFooterPagination && rootProps.slots.pagination && /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.pagination, {});
35
+ const paginationElement = rootProps.pagination && !rootProps.hideFooterPagination && rootProps.slots.pagination && /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.pagination, (0, _extends2.default)({}, rootProps.slotProps?.pagination));
36
36
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_GridFooterContainer.GridFooterContainer, (0, _extends2.default)({}, props, {
37
37
  ref: ref,
38
38
  children: [selectedRowCountElement, rowCountElement, paginationElement]
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.GridPagination = GridPagination;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
10
  var React = _interopRequireWildcard(require("react"));
10
11
  var _styles = require("@mui/material/styles");
11
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -67,7 +68,7 @@ function GridPagination() {
67
68
  }
68
69
  }
69
70
  const pageSizeOptions = isPageSizeIncludedInPageSizeOptions(paginationModel.pageSize) ? rootProps.pageSizeOptions : [];
70
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(GridPaginationRoot, {
71
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(GridPaginationRoot, (0, _extends2.default)({
71
72
  as: rootProps.slots.basePagination,
72
73
  count: rowCount,
73
74
  page: computedPage,
@@ -76,7 +77,7 @@ function GridPagination() {
76
77
  onPageChange: handlePageChange,
77
78
  onRowsPerPageChange: handlePageSizeChange,
78
79
  disabled: disabled
79
- });
80
+ }, rootProps.slotProps?.basePagination));
80
81
  }
81
82
  process.env.NODE_ENV !== "production" ? GridPagination.propTypes = {
82
83
  // ----------------------------- Warning --------------------------------
@@ -31,6 +31,7 @@ var _constants = require("../internals/constants");
31
31
  var _gridSortingSelector = require("../hooks/features/sorting/gridSortingSelector");
32
32
  var _gridRowsSelector = require("../hooks/features/rows/gridRowsSelector");
33
33
  var _gridEditingSelectors = require("../hooks/features/editing/gridEditingSelectors");
34
+ var _gridRowReorderSelector = require("../hooks/features/rowReorder/gridRowReorderSelector");
34
35
  var _GridScrollbarFillerCell = require("./GridScrollbarFillerCell");
35
36
  var _getPinnedCellOffset = require("../internals/utils/getPinnedCellOffset");
36
37
  var _useGridConfiguration = require("../hooks/utils/useGridConfiguration");
@@ -85,6 +86,7 @@ const GridRow = (0, _forwardRef.forwardRef)(function GridRow(props, refProp) {
85
86
  const columnPositions = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnsSelector.gridColumnPositionsSelector);
86
87
  const rowReordering = rootProps.rowReordering;
87
88
  const isRowReorderingEnabled = (0, _useGridSelector.useGridSelector)(apiRef, isRowReorderingEnabledSelector, rowReordering);
89
+ const isRowDragActive = (0, _useGridSelector.useGridSelector)(apiRef, _gridRowReorderSelector.gridIsRowDragActiveSelector);
88
90
  const handleRef = (0, _useForkRef.default)(ref, refProp);
89
91
  const rowNode = (0, _gridRowsSelector.gridRowNodeSelector)(apiRef, rowId);
90
92
  const editing = (0, _useGridSelector.useGridSelector)(apiRef, _gridEditingSelectors.gridRowIsEditingSelector, {
@@ -237,7 +239,7 @@ const GridRow = (0, _forwardRef.forwardRef)(function GridRow(props, refProp) {
237
239
  const isReorderCell = column.field === '__reorder__';
238
240
  const canReorderColumn = !(disableColumnReorder || column.disableReorder);
239
241
  const canReorderRow = isRowReorderingEnabled && !sortModel.length && treeDepth <= 1;
240
- const disableDragEvents = !(canReorderColumn || isReorderCell && canReorderRow);
242
+ const disableDragEvents = !(canReorderColumn || isReorderCell && canReorderRow || isRowDragActive);
241
243
  const cellIsNotVisible = pinnedPosition === _constants.PinnedColumnPosition.VIRTUAL;
242
244
  const showLeftBorder = (0, _cellBorderUtils.shouldCellShowLeftBorder)(pinnedPosition, indexInSection);
243
245
  const showRightBorder = (0, _cellBorderUtils.shouldCellShowRightBorder)(pinnedPosition, indexInSection, sectionLength, rootProps.showCellVerticalBorder, gridHasFiller);
@@ -24,7 +24,7 @@ const GridFooter = forwardRef(function GridFooter(props, ref) {
24
24
  rowCount: totalTopLevelRowCount,
25
25
  visibleRowCount: visibleTopLevelRowCount
26
26
  })) : null;
27
- const paginationElement = rootProps.pagination && !rootProps.hideFooterPagination && rootProps.slots.pagination && /*#__PURE__*/_jsx(rootProps.slots.pagination, {});
27
+ const paginationElement = rootProps.pagination && !rootProps.hideFooterPagination && rootProps.slots.pagination && /*#__PURE__*/_jsx(rootProps.slots.pagination, _extends({}, rootProps.slotProps?.pagination));
28
28
  return /*#__PURE__*/_jsxs(GridFooterContainer, _extends({}, props, {
29
29
  ref: ref,
30
30
  children: [selectedRowCountElement, rowCountElement, paginationElement]
@@ -1,3 +1,4 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
1
2
  import * as React from 'react';
2
3
  import { styled } from '@mui/material/styles';
3
4
  import PropTypes from 'prop-types';
@@ -59,7 +60,7 @@ function GridPagination() {
59
60
  }
60
61
  }
61
62
  const pageSizeOptions = isPageSizeIncludedInPageSizeOptions(paginationModel.pageSize) ? rootProps.pageSizeOptions : [];
62
- return /*#__PURE__*/_jsx(GridPaginationRoot, {
63
+ return /*#__PURE__*/_jsx(GridPaginationRoot, _extends({
63
64
  as: rootProps.slots.basePagination,
64
65
  count: rowCount,
65
66
  page: computedPage,
@@ -68,7 +69,7 @@ function GridPagination() {
68
69
  onPageChange: handlePageChange,
69
70
  onRowsPerPageChange: handlePageSizeChange,
70
71
  disabled: disabled
71
- });
72
+ }, rootProps.slotProps?.basePagination));
72
73
  }
73
74
  process.env.NODE_ENV !== "production" ? GridPagination.propTypes = {
74
75
  // ----------------------------- Warning --------------------------------
@@ -25,6 +25,7 @@ import { GRID_DETAIL_PANEL_TOGGLE_FIELD, PinnedColumnPosition } from "../interna
25
25
  import { gridSortModelSelector } from "../hooks/features/sorting/gridSortingSelector.js";
26
26
  import { gridRowMaximumTreeDepthSelector, gridRowNodeSelector } from "../hooks/features/rows/gridRowsSelector.js";
27
27
  import { gridEditRowsStateSelector, gridRowIsEditingSelector } from "../hooks/features/editing/gridEditingSelectors.js";
28
+ import { gridIsRowDragActiveSelector } from "../hooks/features/rowReorder/gridRowReorderSelector.js";
28
29
  import { GridScrollbarFillerCell as ScrollbarFiller } from "./GridScrollbarFillerCell.js";
29
30
  import { getPinnedCellOffset } from "../internals/utils/getPinnedCellOffset.js";
30
31
  import { useGridConfiguration } from "../hooks/utils/useGridConfiguration.js";
@@ -78,6 +79,7 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
78
79
  const columnPositions = useGridSelector(apiRef, gridColumnPositionsSelector);
79
80
  const rowReordering = rootProps.rowReordering;
80
81
  const isRowReorderingEnabled = useGridSelector(apiRef, isRowReorderingEnabledSelector, rowReordering);
82
+ const isRowDragActive = useGridSelector(apiRef, gridIsRowDragActiveSelector);
81
83
  const handleRef = useForkRef(ref, refProp);
82
84
  const rowNode = gridRowNodeSelector(apiRef, rowId);
83
85
  const editing = useGridSelector(apiRef, gridRowIsEditingSelector, {
@@ -230,7 +232,7 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
230
232
  const isReorderCell = column.field === '__reorder__';
231
233
  const canReorderColumn = !(disableColumnReorder || column.disableReorder);
232
234
  const canReorderRow = isRowReorderingEnabled && !sortModel.length && treeDepth <= 1;
233
- const disableDragEvents = !(canReorderColumn || isReorderCell && canReorderRow);
235
+ const disableDragEvents = !(canReorderColumn || isReorderCell && canReorderRow || isRowDragActive);
234
236
  const cellIsNotVisible = pinnedPosition === PinnedColumnPosition.VIRTUAL;
235
237
  const showLeftBorder = shouldCellShowLeftBorder(pinnedPosition, indexInSection);
236
238
  const showRightBorder = shouldCellShowRightBorder(pinnedPosition, indexInSection, sectionLength, rootProps.showCellVerticalBorder, gridHasFiller);
@@ -1,15 +1,24 @@
1
1
  import type { GridDataSourceCache, GridGetRowsParams, GridUpdateRowParams } from "../../../models/gridDataSource.js";
2
2
  import type { GridRowId, GridRowModel } from "../../../models/gridRows.js";
3
3
  import type { GridDataSourceCacheDefaultConfig } from "./cache.js";
4
+ /**
5
+ * The parameters for the `fetchRows` method.
6
+ */
7
+ export interface GridDataSourceFetchRowsParams extends Partial<GridGetRowsParams> {
8
+ /**
9
+ * If `true`, bypasses the cache and forces a refetch of the rows from the server.
10
+ */
11
+ skipCache?: boolean;
12
+ }
4
13
  export interface GridDataSourceApiBase {
5
14
  /**
6
15
  * Fetches the rows from the server.
7
16
  * If no `parentId` option is provided, it fetches the root rows.
8
17
  * Any missing parameter from `params` will be filled from the state (sorting, filtering, etc.).
9
18
  * @param {GridRowId} parentId The id of the parent node (default: `GRID_ROOT_GROUP_ID`).
10
- * @param {Partial<GridGetRowsParams>} params Request parameters override.
19
+ * @param {GridDataSourceFetchRowsParams} params Request parameters override.
11
20
  */
12
- fetchRows: (parentId?: GridRowId, params?: Partial<GridGetRowsParams>) => void;
21
+ fetchRows: (parentId?: GridRowId, params?: GridDataSourceFetchRowsParams) => void;
13
22
  /**
14
23
  * The data source cache object.
15
24
  */
@@ -10,7 +10,7 @@ export declare const useGridDataSourceBase: <Api extends GridPrivateApiCommunity
10
10
  api: {
11
11
  public: GridDataSourceApi;
12
12
  };
13
- debouncedFetchRows: ((parentId?: import("@mui/x-data-grid").GridRowId, params?: Partial<import("@mui/x-data-grid").GridGetRowsParams>) => void) & import("@mui/utils/debounce").Cancelable;
13
+ debouncedFetchRows: ((parentId?: import("@mui/x-data-grid").GridRowId, params?: import("./models.js").GridDataSourceFetchRowsParams) => void) & import("@mui/utils/debounce").Cancelable;
14
14
  strategyProcessor: {
15
15
  strategyName: DataSourceRowsUpdateStrategy;
16
16
  group: "dataSourceRowsUpdate";
@@ -1,6 +1,8 @@
1
1
  'use client';
2
2
 
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
+ const _excluded = ["skipCache"];
4
6
  import * as React from 'react';
5
7
  import useLazyRef from '@mui/utils/useLazyRef';
6
8
  import debounce from '@mui/utils/debounce';
@@ -53,10 +55,15 @@ export const useGridDataSourceBase = (apiRef, props, options = {}) => {
53
55
  return;
54
56
  }
55
57
  options.clearDataSourceState?.();
56
- const fetchParams = _extends({}, gridGetRowsParamsSelector(apiRef), apiRef.current.unstable_applyPipeProcessors('getRowsParams', {}), params);
58
+ const _ref = params || {},
59
+ {
60
+ skipCache
61
+ } = _ref,
62
+ getRowsParams = _objectWithoutPropertiesLoose(_ref, _excluded);
63
+ const fetchParams = _extends({}, gridGetRowsParamsSelector(apiRef), apiRef.current.unstable_applyPipeProcessors('getRowsParams', {}), getRowsParams);
57
64
  const cacheKeys = cacheChunkManager.getCacheKeys(fetchParams);
58
65
  const responses = cacheKeys.map(cacheKey => cache.get(cacheKey));
59
- if (responses.every(response => response !== undefined)) {
66
+ if (!skipCache && responses.every(response => response !== undefined)) {
60
67
  apiRef.current.applyStrategyProcessor('dataSourceRowsUpdate', {
61
68
  response: CacheChunkManager.mergeResponses(responses),
62
69
  fetchParams
@@ -343,7 +343,10 @@ export const useGridRowEditing = (apiRef, props) => {
343
343
  if (fieldToFocus) {
344
344
  apiRef.current.setCellFocus(id, fieldToFocus);
345
345
  }
346
- columns.filter(column => column.editable && !!column.preProcessEditCellProps && deleteValue).forEach(column => {
346
+ columns.filter(column => {
347
+ const isCellEditable = apiRef.current.getCellParams(id, column.field).isEditable;
348
+ return isCellEditable && column.editable && !!column.preProcessEditCellProps && deleteValue;
349
+ }).forEach(column => {
347
350
  const field = column.field;
348
351
  const value = apiRef.current.getCellValue(id, field);
349
352
  const newValue = deleteValue ? getDefaultCellValue(column) : initialValue ?? value;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The row reorder state.
3
+ */
4
+ export interface GridRowReorderState {
5
+ /**
6
+ * Whether a row drag operation is currently active.
7
+ */
8
+ isActive: boolean;
9
+ }
@@ -0,0 +1,5 @@
1
+ import { GridStateCommunity } from "../../../models/gridStateCommunity.js";
2
+ export declare const gridRowReorderStateSelector: import("@mui/x-data-grid").OutputSelector<GridStateCommunity, unknown, import("./gridRowReorderInterfaces.js").GridRowReorderState>;
3
+ export declare const gridIsRowDragActiveSelector: (args_0: import("react").RefObject<{
4
+ state: GridStateCommunity;
5
+ } | null>) => boolean;
@@ -0,0 +1,3 @@
1
+ import { createRootSelector, createSelector } from "../../../utils/createSelector.js";
2
+ export const gridRowReorderStateSelector = createRootSelector(state => state.rowReorder);
3
+ export const gridIsRowDragActiveSelector = createSelector(gridRowReorderStateSelector, rowReorder => rowReorder?.isActive ?? false);
@@ -43,7 +43,8 @@ export const useGridRowSelection = (apiRef, props) => {
43
43
  callback(...args);
44
44
  }
45
45
  }, [props.rowSelection]);
46
- const applyAutoSelection = props.signature !== GridSignature.DataGrid && (props.rowSelectionPropagation?.parents || props.rowSelectionPropagation?.descendants);
46
+ const isNestedData = useGridSelector(apiRef, gridRowMaximumTreeDepthSelector) > 1;
47
+ const applyAutoSelection = props.signature !== GridSignature.DataGrid && (props.rowSelectionPropagation?.parents || props.rowSelectionPropagation?.descendants) && isNestedData;
47
48
  const propRowSelectionModel = React.useMemo(() => {
48
49
  return props.rowSelectionModel;
49
50
  }, [props.rowSelectionModel]);
@@ -62,7 +63,6 @@ export const useGridRowSelection = (apiRef, props) => {
62
63
  } = props;
63
64
  const canHaveMultipleSelection = isMultipleRowSelectionEnabled(props);
64
65
  const tree = useGridSelector(apiRef, gridRowTreeSelector);
65
- const isNestedData = useGridSelector(apiRef, gridRowMaximumTreeDepthSelector) > 1;
66
66
  const expandMouseRowRangeSelection = React.useCallback(id => {
67
67
  let endId = id;
68
68
  const startId = lastRowToggled.current ?? id;
@@ -137,6 +137,11 @@ export const findRowsToSelect = (apiRef, tree, selectedRow, autoSelectDescendant
137
137
  }
138
138
  }
139
139
  };
140
+ // For root level rows, we don't need to traverse parents
141
+ const rowNode = tree[selectedRow];
142
+ if (!rowNode || rowNode.parent === GRID_ROOT_GROUP_ID) {
143
+ return;
144
+ }
140
145
  traverseParents(selectedRow);
141
146
  }
142
147
  };
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v8.9.2
2
+ * @mui/x-data-grid v8.10.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -63,6 +63,8 @@ export { getRowIdFromRowModel, GRID_ID_AUTOGENERATED, getRowValue } from "../hoo
63
63
  export { gridAdditionalRowGroupsSelector, gridPinnedRowsSelector, gridRowSelector } from "../hooks/features/rows/gridRowsSelector.js";
64
64
  export { headerFilteringStateInitializer, useGridHeaderFiltering } from "../hooks/features/headerFiltering/useGridHeaderFiltering.js";
65
65
  export { useGridRowSelection, rowSelectionStateInitializer } from "../hooks/features/rowSelection/useGridRowSelection.js";
66
+ export { gridIsRowDragActiveSelector } from "../hooks/features/rowReorder/gridRowReorderSelector.js";
67
+ export type { GridRowReorderState } from "../hooks/features/rowReorder/gridRowReorderInterfaces.js";
66
68
  export { useGridRowSelectionPreProcessors } from "../hooks/features/rowSelection/useGridRowSelectionPreProcessors.js";
67
69
  export { useGridSorting, sortingStateInitializer } from "../hooks/features/sorting/useGridSorting.js";
68
70
  export type { GridSortingModelApplier } from "../hooks/features/sorting/gridSortingState.js";
@@ -51,6 +51,7 @@ export { getRowIdFromRowModel, GRID_ID_AUTOGENERATED, getRowValue } from "../hoo
51
51
  export { gridAdditionalRowGroupsSelector, gridPinnedRowsSelector, gridRowSelector } from "../hooks/features/rows/gridRowsSelector.js";
52
52
  export { headerFilteringStateInitializer, useGridHeaderFiltering } from "../hooks/features/headerFiltering/useGridHeaderFiltering.js";
53
53
  export { useGridRowSelection, rowSelectionStateInitializer } from "../hooks/features/rowSelection/useGridRowSelection.js";
54
+ export { gridIsRowDragActiveSelector } from "../hooks/features/rowReorder/gridRowReorderSelector.js";
54
55
  export { useGridRowSelectionPreProcessors } from "../hooks/features/rowSelection/useGridRowSelectionPreProcessors.js";
55
56
  export { useGridSorting, sortingStateInitializer } from "../hooks/features/sorting/useGridSorting.js";
56
57
  export { gridSortedRowIndexLookupSelector } from "../hooks/features/sorting/gridSortingSelector.js";