@mui/x-data-grid-pro 6.7.0 → 6.8.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 CHANGED
@@ -3,6 +3,68 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 6.8.0
7
+
8
+ _Jun 16, 2023_
9
+
10
+ We'd like to offer a big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🌍 Add Greek (el-GR) locale on Pickers and improve on Data Grid
13
+ - 🚅 Performance improvements
14
+ - 🐞 Bugfixes
15
+ - 📚 Documentation improvements
16
+
17
+ ### `@mui/x-data-grid@6.8.0` / `@mui/x-data-grid-pro@6.8.0` / `@mui/x-data-grid-premium@6.8.0`
18
+
19
+ #### Changes
20
+
21
+ - [DataGrid] Add missing styles to `overridesResolver` (#9248) @mrmuhammadali
22
+ - [DataGrid] Keep column header menu icon always visible on touch devices (#9076) @cherniavskii
23
+ - [DataGrid] Correct the type for single digit edited number value (#9282) @MBilalShafi
24
+ - [DataGrid] Correct the type for single digit edited number for row edit (#9348) @MBilalShafi
25
+ - [DataGrid] Filtering performance: cache values (#9284) @romgrk
26
+ - [DataGrid] Fix tabbing between `actions` cells in edit mode (#9321) @md250721
27
+ - [DataGrid] Make autocompletion work for `GridColDef['type']` (#9320) @cherniavskii
28
+ - [DataGrid] Polish shortcut logic (#9220) @oliviertassinari
29
+ - [DataGrid] Row reordering fix for different row heights (#7006) @yaredtsy
30
+ - [DataGrid] Scroll performance improvements (#9037) @romgrk
31
+ - [l10n] Improve Greek (el-GR) locale (#9292) @clytras
32
+
33
+ ### `@mui/x-date-pickers@6.8.0` / `@mui/x-date-pickers-pro@6.8.0`
34
+
35
+ #### Changes
36
+
37
+ - [l10n] Add Greek (el-GR) locale (#9293) @clytras
38
+ - [pickers] Add a `referenceDate` prop on `DateCalendar`, `MonthCalendar` and `YearCalendar` (#9260) @flaviendelangle
39
+ - [pickers] Close the calendar when a shortcut is selected (#9080) @flaviendelangle
40
+ - [pickers] Fix disabling for digital clock (#9300) @alexfauquette
41
+
42
+ ### Docs
43
+
44
+ - [docs] Add header filters to the popular features demo (#9069) @MBilalShafi
45
+ - [docs] Fix `Date Calendar` dynamic data demo (#9290) @benzler
46
+ - [docs] Fix Data Grid header filter link (#9225) @oliviertassinari
47
+ - [docs] Fix missing docs version warning (#9221) @oliviertassinari
48
+ - [docs] Improve Chart overview (#9333) @oliviertassinari
49
+ - [docs] Improve Next.js license installation guide (#8975) @oliviertassinari
50
+ - [docs] Link pagination documentation to the migration guide (#9296) @MBilalShafi
51
+ - [docs] One step toward components -> slots (#9251) @oliviertassinari
52
+ - [docs] Improve and reorganize sections on editing page (#8431) @joserodolfofreitas
53
+ - [docs] Add clipboard paste to popular features demo (#9029) @cherniavskii
54
+
55
+ ### Core
56
+
57
+ - [core] Polish event name (#9336) @oliviertassinari
58
+ - [core] Re-enable `Argos` CI step (#9301) @LukasTy
59
+ - [core] Upgrade Node.js to v18 on CircleCI, CodeSandbox and Netlify (#9319) @ZeeshanTamboli
60
+ - [core] Upgrade Node.js v18 for l10n GitHub CI (#9355) @ZeeshanTamboli
61
+ - [charts] Add demonstration pages based on Recharts demo (#9175) @alexfauquette
62
+ - [charts] Add legend (#9024) @alexfauquette
63
+ - [charts] Complete the docs to introduce charts (#9153) @alexfauquette
64
+ - [charts] Manage elements highlights (#9242) @alexfauquette
65
+ - [charts] Prefix subcomponents with `Charts` (#9314) @alexfauquette
66
+ - [license] Improve annual license expiration message (#9135) @oliviertassinari
67
+
6
68
  ## 6.7.0
7
69
 
8
70
  _Jun 9, 2023_
@@ -17,11 +79,11 @@ We'd like to offer a big thanks to the 12 contributors who made this release pos
17
79
  <TimePicker views={['hours', 'minutes', 'seconds']} ampm />
18
80
  // Format before v6.7.0: `hh:mm aa`
19
81
  // Format after v6.7.0: `hh:mm:ss aa`
20
-
82
+
21
83
  <DatePicker views={['year']} />
22
84
  // Format before v6.7.0: `MM/DD/YYYY`
23
85
  // Format after v6.7.0: `YYYY`
24
-
86
+
25
87
  <DateTimePicker views={['day', 'hours', 'minutes']} ampm />
26
88
  // Format before v6.7.0: `MM/DD/YYYY hh:mm aa`
27
89
  // Format after v6.7.0: `DD hh:mm aa`
@@ -83,7 +145,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
83
145
 
84
146
  - 🚀 New date time picking UI on [`DesktopDateTimePicker`](https://mui.com/x/react-date-pickers/date-time-picker/)
85
147
 
86
- <img src="https://user-images.githubusercontent.com/4941090/242533399-2b106390-8158-4aba-9ca4-b621c6310977.gif" width="628" />
148
+ <img src="https://github.com/mui/mui-x/assets/3165635/4e1fe9f9-03eb-4f23-99dd-80212b21fb23" width="840" height="506" />
87
149
 
88
150
  - 🚀 Performance improvements
89
151
  - 🐞 Bugfixes
@@ -151,7 +213,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
151
213
  - [charts] Manage series stacking (#8888) @alexfauquette
152
214
  - [license] List side effects in the license package (#9092) @cherniavskii
153
215
 
154
- ## v6.5.0
216
+ ## 6.5.0
155
217
 
156
218
  _May 19, 2023_
157
219
 
@@ -159,9 +221,9 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
159
221
 
160
222
  - 💫 Introduce filtering on column headers for `DataGridPro` and `DataGridPremium`:
161
223
 
162
- https://github.com/mui/mui-x/assets/12609561/c4c2bfec-59cf-4cab-932d-dc1983081de9
224
+ <img src="https://github.com/mui/mui-x/releases/download/v6.5.0/recording.gif" width="840" height="506" />
163
225
 
164
- See [the documentation](https://mui.com/x/react-data-grid/filtering/#header-filters) for more information
226
+ See [the documentation](https://mui.com/x/react-data-grid/filtering/header-filters/) for more information
165
227
 
166
228
  - 🌍 Improve Hebrew (he-IL) and Czech (cs-CZ) locales
167
229
  - 📝 Support for editing on pinned rows
@@ -207,7 +269,7 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
207
269
  - [DataGrid] Memoize root props for better performance (#8942) @romgrk
208
270
  - [test] Skip flaky unit tests in JSDOM (#8994) @cherniavskii
209
271
 
210
- ## v6.4.0
272
+ ## 6.4.0
211
273
 
212
274
  _May 12, 2023_
213
275
 
@@ -4240,7 +4302,7 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
4240
4302
  - [docs] Revise and split up "Overview" page into "Introduction" (#4692) @samuelsycamore
4241
4303
  - [docs] Use `useKeepGroupedColumnsHiddren` from the grid package on remaining demo (#5382) @flaviendelangle
4242
4304
 
4243
- ## v5.12.3
4305
+ ## 5.12.3
4244
4306
 
4245
4307
  _Jun 23, 2022_
4246
4308
 
@@ -4291,7 +4353,7 @@ We'd like to offer a big thanks to the 8 contributors who made this release poss
4291
4353
  - [test] Throw if date adapter is not found (#5289) @cherniavskii
4292
4354
  - [test] Use mock for `ResizeObserver` (#5215) @m4theushw
4293
4355
 
4294
- ## v5.12.2
4356
+ ## 5.12.2
4295
4357
 
4296
4358
  _Jun 16, 2022_
4297
4359
 
@@ -4334,7 +4396,7 @@ We'd like to offer a big thanks to the 7 contributors who made this release poss
4334
4396
  - [core] Fix `GridColTypeDef` usage in demo (#5197) @cherniavskii
4335
4397
  - [test] Add `waitFor` before asserting height (#5203) @m4theushw
4336
4398
 
4337
- ## v5.12.1
4399
+ ## 5.12.1
4338
4400
 
4339
4401
  _Jun 9, 2022_
4340
4402
 
@@ -4391,7 +4453,7 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
4391
4453
  - [test] Fix dynamic row height test failing on Chrome (#5147) @m4theushw
4392
4454
  - [test] Remove delay on server demo for regression tests (#5131) @alexfauquette
4393
4455
 
4394
- ## v5.12.0
4456
+ ## 5.12.0
4395
4457
 
4396
4458
  _May 31, 2022_
4397
4459
 
@@ -4472,7 +4534,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
4472
4534
  - [test] Skip Safari and Firefox on broken tests (#4994) @alexfauquette
4473
4535
  - [test] Make argos screenshots stable (#5061) @m4theushw
4474
4536
 
4475
- ## v5.11.1
4537
+ ## 5.11.1
4476
4538
 
4477
4539
  _May 20, 2022_
4478
4540
 
@@ -4564,7 +4626,7 @@ We'd like to offer a big thanks to the 6 contributors who made this release poss
4564
4626
  - [core] Simplify rows cache management (#4933) @flaviendelangle
4565
4627
  - [core] Use internal icons for quick filter (#4912) @alexfauquette
4566
4628
 
4567
- ## v5.11.0
4629
+ ## 5.11.0
4568
4630
 
4569
4631
  _May 13, 2022_
4570
4632
 
@@ -4708,7 +4770,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
4708
4770
  - [test] Reset cleanup tracking on Karma tests (#4679) @m4theushw
4709
4771
  - [test] Restore `sinon` sandbox after each `karma` test (#4689) @m4theushw
4710
4772
 
4711
- ## v5.10.0
4773
+ ## 5.10.0
4712
4774
 
4713
4775
  _Apr 25, 2022_
4714
4776
 
@@ -4744,7 +4806,7 @@ We'd like to offer a big thanks to the 6 contributors who made this release poss
4744
4806
  - [core] Fix the README of the X packages (#4590) @flaviendelangle
4745
4807
  - [test] Fix test to not depend on screen resolution (#4587) @m4theushw
4746
4808
 
4747
- ## v5.9.0
4809
+ ## 5.9.0
4748
4810
 
4749
4811
  _Apr 14, 2022_
4750
4812
 
@@ -2,6 +2,16 @@ import * as React from 'react';
2
2
  import { unstable_composeClasses as composeClasses } from '@mui/utils';
3
3
  import { useGridLogger, useGridApiEventHandler, getDataGridUtilityClass, useGridSelector, gridSortModelSelector, gridRowMaximumTreeDepthSelector, useGridApiOptionHandler } from '@mui/x-data-grid';
4
4
  import { gridEditRowsStateSelector } from '@mui/x-data-grid/internals';
5
+ var Direction = /*#__PURE__*/function (Direction) {
6
+ Direction[Direction["UP"] = 0] = "UP";
7
+ Direction[Direction["DOWN"] = 1] = "DOWN";
8
+ return Direction;
9
+ }(Direction || {});
10
+ let previousMousePosition = null;
11
+ let previousReorderState = {
12
+ previousTargetId: null,
13
+ dragDirection: null
14
+ };
5
15
  const useUtilityClasses = ownerState => {
6
16
  const {
7
17
  classes
@@ -70,10 +80,24 @@ export const useGridRowReorder = (apiRef, props) => {
70
80
  // Prevent drag events propagation.
71
81
  // For more information check here https://github.com/mui/mui-x/issues/2680.
72
82
  event.stopPropagation();
83
+ const mouseMovementDiff = previousMousePosition ? previousMousePosition.y - event.clientY : event.clientY;
73
84
  if (params.id !== dragRowId) {
74
85
  const targetRowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(params.id);
75
- apiRef.current.setRowIndex(dragRowId, targetRowIndex);
86
+ const dragDirection = mouseMovementDiff > 0 ? Direction.DOWN : Direction.UP;
87
+ const currentReorderState = {
88
+ dragDirection,
89
+ previousTargetId: params.id
90
+ };
91
+ const isStateChanged = currentReorderState.dragDirection !== previousReorderState.dragDirection || currentReorderState.previousTargetId !== previousReorderState.previousTargetId;
92
+ if (previousReorderState.dragDirection === null || Math.abs(mouseMovementDiff) >= 1 && isStateChanged) {
93
+ apiRef.current.setRowIndex(dragRowId, targetRowIndex);
94
+ previousReorderState = currentReorderState;
95
+ }
76
96
  }
97
+ previousMousePosition = {
98
+ x: event.clientX,
99
+ y: event.clientY
100
+ };
77
101
  }, [apiRef, logger, dragRowId]);
78
102
  const handleDragEnd = React.useCallback((params, event) => {
79
103
  // Call the gridEditRowsStateSelector directly to avoid infnite loop
@@ -88,6 +112,7 @@ export const useGridRowReorder = (apiRef, props) => {
88
112
  event.stopPropagation();
89
113
  clearTimeout(removeDnDStylesTimeout.current);
90
114
  dragRowNode.current = null;
115
+ previousReorderState.dragDirection = null;
91
116
 
92
117
  // Check if the row was dropped outside the grid.
93
118
  if (event.dataTransfer.dropEffect === 'none') {
@@ -14,6 +14,7 @@ export const filterRowTreeFromTreeData = params => {
14
14
  } = params;
15
15
  const filteredRowsLookup = {};
16
16
  const filteredDescendantCountLookup = {};
17
+ const filterCache = {};
17
18
  const filterTreeNode = (node, isParentMatchingFilters, areAncestorsExpanded) => {
18
19
  const shouldSkipFilters = disableChildrenFiltering && node.depth > 0;
19
20
  let isMatchingFilters;
@@ -26,7 +27,7 @@ export const filterRowTreeFromTreeData = params => {
26
27
  passingFilterItems,
27
28
  passingQuickFilterValues
28
29
  } = isRowMatchingFilters(node.id);
29
- isMatchingFilters = passFilterLogic([passingFilterItems], [passingQuickFilterValues], params.filterModel, params.apiRef);
30
+ isMatchingFilters = passFilterLogic([passingFilterItems], [passingQuickFilterValues], params.filterModel, params.apiRef, filterCache);
30
31
  }
31
32
  let filteredDescendantCount = 0;
32
33
  if (node.type === 'group') {
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-pro v6.7.0
2
+ * @mui/x-data-grid-pro v6.8.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -3,6 +3,16 @@ import * as React from 'react';
3
3
  import { unstable_composeClasses as composeClasses } from '@mui/utils';
4
4
  import { useGridLogger, useGridApiEventHandler, getDataGridUtilityClass, useGridSelector, gridSortModelSelector, gridRowMaximumTreeDepthSelector, useGridApiOptionHandler } from '@mui/x-data-grid';
5
5
  import { gridEditRowsStateSelector } from '@mui/x-data-grid/internals';
6
+ var Direction = /*#__PURE__*/function (Direction) {
7
+ Direction[Direction["UP"] = 0] = "UP";
8
+ Direction[Direction["DOWN"] = 1] = "DOWN";
9
+ return Direction;
10
+ }(Direction || {});
11
+ var previousMousePosition = null;
12
+ var previousReorderState = {
13
+ previousTargetId: null,
14
+ dragDirection: null
15
+ };
6
16
  var useUtilityClasses = function useUtilityClasses(ownerState) {
7
17
  var classes = ownerState.classes;
8
18
  var slots = {
@@ -72,10 +82,24 @@ export var useGridRowReorder = function useGridRowReorder(apiRef, props) {
72
82
  // Prevent drag events propagation.
73
83
  // For more information check here https://github.com/mui/mui-x/issues/2680.
74
84
  event.stopPropagation();
85
+ var mouseMovementDiff = previousMousePosition ? previousMousePosition.y - event.clientY : event.clientY;
75
86
  if (params.id !== dragRowId) {
76
87
  var targetRowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(params.id);
77
- apiRef.current.setRowIndex(dragRowId, targetRowIndex);
88
+ var dragDirection = mouseMovementDiff > 0 ? Direction.DOWN : Direction.UP;
89
+ var currentReorderState = {
90
+ dragDirection: dragDirection,
91
+ previousTargetId: params.id
92
+ };
93
+ var isStateChanged = currentReorderState.dragDirection !== previousReorderState.dragDirection || currentReorderState.previousTargetId !== previousReorderState.previousTargetId;
94
+ if (previousReorderState.dragDirection === null || Math.abs(mouseMovementDiff) >= 1 && isStateChanged) {
95
+ apiRef.current.setRowIndex(dragRowId, targetRowIndex);
96
+ previousReorderState = currentReorderState;
97
+ }
78
98
  }
99
+ previousMousePosition = {
100
+ x: event.clientX,
101
+ y: event.clientY
102
+ };
79
103
  }, [apiRef, logger, dragRowId]);
80
104
  var handleDragEnd = React.useCallback(function (params, event) {
81
105
  // Call the gridEditRowsStateSelector directly to avoid infnite loop
@@ -90,6 +114,7 @@ export var useGridRowReorder = function useGridRowReorder(apiRef, props) {
90
114
  event.stopPropagation();
91
115
  clearTimeout(removeDnDStylesTimeout.current);
92
116
  dragRowNode.current = null;
117
+ previousReorderState.dragDirection = null;
93
118
 
94
119
  // Check if the row was dropped outside the grid.
95
120
  if (event.dataTransfer.dropEffect === 'none') {
@@ -12,6 +12,7 @@ export var filterRowTreeFromTreeData = function filterRowTreeFromTreeData(params
12
12
  isRowMatchingFilters = params.isRowMatchingFilters;
13
13
  var filteredRowsLookup = {};
14
14
  var filteredDescendantCountLookup = {};
15
+ var filterCache = {};
15
16
  var filterTreeNode = function filterTreeNode(node, isParentMatchingFilters, areAncestorsExpanded) {
16
17
  var shouldSkipFilters = disableChildrenFiltering && node.depth > 0;
17
18
  var isMatchingFilters;
@@ -23,7 +24,7 @@ export var filterRowTreeFromTreeData = function filterRowTreeFromTreeData(params
23
24
  var _isRowMatchingFilters = isRowMatchingFilters(node.id),
24
25
  passingFilterItems = _isRowMatchingFilters.passingFilterItems,
25
26
  passingQuickFilterValues = _isRowMatchingFilters.passingQuickFilterValues;
26
- isMatchingFilters = passFilterLogic([passingFilterItems], [passingQuickFilterValues], params.filterModel, params.apiRef);
27
+ isMatchingFilters = passFilterLogic([passingFilterItems], [passingQuickFilterValues], params.filterModel, params.apiRef, filterCache);
27
28
  }
28
29
  var filteredDescendantCount = 0;
29
30
  if (node.type === 'group') {
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-pro v6.7.0
2
+ * @mui/x-data-grid-pro v6.8.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export var getReleaseInfo = function getReleaseInfo() {
3
- var releaseInfo = "MTY4NjI2MTYwMDAwMA==";
3
+ var releaseInfo = "MTY4Njg2MjgwMDAwMA==";
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
@@ -2,6 +2,16 @@ import * as React from 'react';
2
2
  import { unstable_composeClasses as composeClasses } from '@mui/utils';
3
3
  import { useGridLogger, useGridApiEventHandler, getDataGridUtilityClass, useGridSelector, gridSortModelSelector, gridRowMaximumTreeDepthSelector, useGridApiOptionHandler } from '@mui/x-data-grid';
4
4
  import { gridEditRowsStateSelector } from '@mui/x-data-grid/internals';
5
+ var Direction = /*#__PURE__*/function (Direction) {
6
+ Direction[Direction["UP"] = 0] = "UP";
7
+ Direction[Direction["DOWN"] = 1] = "DOWN";
8
+ return Direction;
9
+ }(Direction || {});
10
+ let previousMousePosition = null;
11
+ let previousReorderState = {
12
+ previousTargetId: null,
13
+ dragDirection: null
14
+ };
5
15
  const useUtilityClasses = ownerState => {
6
16
  const {
7
17
  classes
@@ -70,10 +80,24 @@ export const useGridRowReorder = (apiRef, props) => {
70
80
  // Prevent drag events propagation.
71
81
  // For more information check here https://github.com/mui/mui-x/issues/2680.
72
82
  event.stopPropagation();
83
+ const mouseMovementDiff = previousMousePosition ? previousMousePosition.y - event.clientY : event.clientY;
73
84
  if (params.id !== dragRowId) {
74
85
  const targetRowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(params.id);
75
- apiRef.current.setRowIndex(dragRowId, targetRowIndex);
86
+ const dragDirection = mouseMovementDiff > 0 ? Direction.DOWN : Direction.UP;
87
+ const currentReorderState = {
88
+ dragDirection,
89
+ previousTargetId: params.id
90
+ };
91
+ const isStateChanged = currentReorderState.dragDirection !== previousReorderState.dragDirection || currentReorderState.previousTargetId !== previousReorderState.previousTargetId;
92
+ if (previousReorderState.dragDirection === null || Math.abs(mouseMovementDiff) >= 1 && isStateChanged) {
93
+ apiRef.current.setRowIndex(dragRowId, targetRowIndex);
94
+ previousReorderState = currentReorderState;
95
+ }
76
96
  }
97
+ previousMousePosition = {
98
+ x: event.clientX,
99
+ y: event.clientY
100
+ };
77
101
  }, [apiRef, logger, dragRowId]);
78
102
  const handleDragEnd = React.useCallback((params, event) => {
79
103
  // Call the gridEditRowsStateSelector directly to avoid infnite loop
@@ -88,6 +112,7 @@ export const useGridRowReorder = (apiRef, props) => {
88
112
  event.stopPropagation();
89
113
  clearTimeout(removeDnDStylesTimeout.current);
90
114
  dragRowNode.current = null;
115
+ previousReorderState.dragDirection = null;
91
116
 
92
117
  // Check if the row was dropped outside the grid.
93
118
  if (event.dataTransfer.dropEffect === 'none') {
@@ -14,6 +14,7 @@ export const filterRowTreeFromTreeData = params => {
14
14
  } = params;
15
15
  const filteredRowsLookup = {};
16
16
  const filteredDescendantCountLookup = {};
17
+ const filterCache = {};
17
18
  const filterTreeNode = (node, isParentMatchingFilters, areAncestorsExpanded) => {
18
19
  const shouldSkipFilters = disableChildrenFiltering && node.depth > 0;
19
20
  let isMatchingFilters;
@@ -26,7 +27,7 @@ export const filterRowTreeFromTreeData = params => {
26
27
  passingFilterItems,
27
28
  passingQuickFilterValues
28
29
  } = isRowMatchingFilters(node.id);
29
- isMatchingFilters = passFilterLogic([passingFilterItems], [passingQuickFilterValues], params.filterModel, params.apiRef);
30
+ isMatchingFilters = passFilterLogic([passingFilterItems], [passingQuickFilterValues], params.filterModel, params.apiRef, filterCache);
30
31
  }
31
32
  let filteredDescendantCount = 0;
32
33
  if (node.type === 'group') {
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-pro v6.7.0
2
+ * @mui/x-data-grid-pro v6.8.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTY4NjI2MTYwMDAwMA==";
3
+ const releaseInfo = "MTY4Njg2MjgwMDAwMA==";
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
@@ -10,6 +10,16 @@ var _xDataGrid = require("@mui/x-data-grid");
10
10
  var _internals = require("@mui/x-data-grid/internals");
11
11
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
12
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
+ var Direction = /*#__PURE__*/function (Direction) {
14
+ Direction[Direction["UP"] = 0] = "UP";
15
+ Direction[Direction["DOWN"] = 1] = "DOWN";
16
+ return Direction;
17
+ }(Direction || {});
18
+ let previousMousePosition = null;
19
+ let previousReorderState = {
20
+ previousTargetId: null,
21
+ dragDirection: null
22
+ };
13
23
  const useUtilityClasses = ownerState => {
14
24
  const {
15
25
  classes
@@ -78,10 +88,24 @@ const useGridRowReorder = (apiRef, props) => {
78
88
  // Prevent drag events propagation.
79
89
  // For more information check here https://github.com/mui/mui-x/issues/2680.
80
90
  event.stopPropagation();
91
+ const mouseMovementDiff = previousMousePosition ? previousMousePosition.y - event.clientY : event.clientY;
81
92
  if (params.id !== dragRowId) {
82
93
  const targetRowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(params.id);
83
- apiRef.current.setRowIndex(dragRowId, targetRowIndex);
94
+ const dragDirection = mouseMovementDiff > 0 ? Direction.DOWN : Direction.UP;
95
+ const currentReorderState = {
96
+ dragDirection,
97
+ previousTargetId: params.id
98
+ };
99
+ const isStateChanged = currentReorderState.dragDirection !== previousReorderState.dragDirection || currentReorderState.previousTargetId !== previousReorderState.previousTargetId;
100
+ if (previousReorderState.dragDirection === null || Math.abs(mouseMovementDiff) >= 1 && isStateChanged) {
101
+ apiRef.current.setRowIndex(dragRowId, targetRowIndex);
102
+ previousReorderState = currentReorderState;
103
+ }
84
104
  }
105
+ previousMousePosition = {
106
+ x: event.clientX,
107
+ y: event.clientY
108
+ };
85
109
  }, [apiRef, logger, dragRowId]);
86
110
  const handleDragEnd = React.useCallback((params, event) => {
87
111
  // Call the gridEditRowsStateSelector directly to avoid infnite loop
@@ -96,6 +120,7 @@ const useGridRowReorder = (apiRef, props) => {
96
120
  event.stopPropagation();
97
121
  clearTimeout(removeDnDStylesTimeout.current);
98
122
  dragRowNode.current = null;
123
+ previousReorderState.dragDirection = null;
99
124
 
100
125
  // Check if the row was dropped outside the grid.
101
126
  if (event.dataTransfer.dropEffect === 'none') {
@@ -21,6 +21,7 @@ const filterRowTreeFromTreeData = params => {
21
21
  } = params;
22
22
  const filteredRowsLookup = {};
23
23
  const filteredDescendantCountLookup = {};
24
+ const filterCache = {};
24
25
  const filterTreeNode = (node, isParentMatchingFilters, areAncestorsExpanded) => {
25
26
  const shouldSkipFilters = disableChildrenFiltering && node.depth > 0;
26
27
  let isMatchingFilters;
@@ -33,7 +34,7 @@ const filterRowTreeFromTreeData = params => {
33
34
  passingFilterItems,
34
35
  passingQuickFilterValues
35
36
  } = isRowMatchingFilters(node.id);
36
- isMatchingFilters = (0, _internals.passFilterLogic)([passingFilterItems], [passingQuickFilterValues], params.filterModel, params.apiRef);
37
+ isMatchingFilters = (0, _internals.passFilterLogic)([passingFilterItems], [passingQuickFilterValues], params.filterModel, params.apiRef, filterCache);
37
38
  }
38
39
  let filteredDescendantCount = 0;
39
40
  if (node.type === 'group') {
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-pro v6.7.0
2
+ * @mui/x-data-grid-pro v6.8.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -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 = "MTY4NjI2MTYwMDAwMA==";
9
+ const releaseInfo = "MTY4Njg2MjgwMDAwMA==";
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid-pro",
3
- "version": "6.7.0",
3
+ "version": "6.8.0",
4
4
  "description": "The Pro plan edition of the data grid component (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "@babel/runtime": "^7.21.0",
35
35
  "@mui/utils": "^5.13.1",
36
- "@mui/x-data-grid": "6.7.0",
36
+ "@mui/x-data-grid": "6.8.0",
37
37
  "@mui/x-license-pro": "6.6.0",
38
38
  "@types/format-util": "^1.0.2",
39
39
  "clsx": "^1.2.1",
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTY4NjI2MTYwMDAwMA==";
3
+ const releaseInfo = "MTY4Njg2MjgwMDAwMA==";
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