@mui/x-data-grid-premium 7.0.0-beta.6 → 7.0.0-beta.7
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 +117 -1
- package/DataGridPremium/DataGridPremium.js +5 -1
- package/esm/DataGridPremium/DataGridPremium.js +5 -1
- package/esm/hooks/features/cellSelection/useGridCellSelection.js +17 -18
- package/esm/utils/releaseInfo.js +1 -1
- package/hooks/features/aggregation/wrapColumnWithAggregation.d.ts +1 -1
- package/hooks/features/cellSelection/useGridCellSelection.d.ts +1 -1
- package/hooks/features/cellSelection/useGridCellSelection.js +10 -11
- package/index.js +1 -1
- package/models/gridApiPremium.d.ts +2 -2
- package/modern/DataGridPremium/DataGridPremium.js +5 -1
- package/modern/hooks/features/cellSelection/useGridCellSelection.js +12 -13
- package/modern/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/package.json +3 -3
- package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,102 @@
|
|
|
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
|
+
## 7.0.0-beta.7
|
|
7
|
+
|
|
8
|
+
_Mar 14, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🦥 The Lazy loading feature is now stable and the `lazyLoading` feature flag was removed from the `experimentalFeatures` prop.
|
|
13
|
+
- 🌍 Improve Japanese (ja-JP) locale for the Data Grid
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
- 📚 Documentation improvements
|
|
16
|
+
|
|
17
|
+
### Data Grid
|
|
18
|
+
|
|
19
|
+
#### Breaking changes
|
|
20
|
+
|
|
21
|
+
- The `columnHeader--showColumnBorder` class was replaced by `columnHeader--withLeftBorder` and `columnHeader--withRightBorder`.
|
|
22
|
+
- The `columnHeadersInner`, `columnHeadersInner--scrollable`, and `columnHeaderDropZone` classes were removed since the inner wrapper was removed in our effort to simplify the DOM structure and improve accessibility.
|
|
23
|
+
- The `pinnedColumnHeaders`, `pinnedColumnHeaders--left`, and `pinnedColumnHeaders--right` classes were removed along with the element they were applied to.
|
|
24
|
+
The pinned column headers now use `position: 'sticky'` and are rendered in the same row element as the regular column headers.
|
|
25
|
+
|
|
26
|
+
#### `@mui/x-data-grid@7.0.0-beta.7`
|
|
27
|
+
|
|
28
|
+
- [DataGrid] Fix focus visible style on scrollbar (#12402) @oliviertassinari
|
|
29
|
+
- [DataGrid] Fix the issue where pressing the Delete key resets various cell values to an empty string. (#12216) @sooster910
|
|
30
|
+
- [DataGrid] Make `rowCount` part of the state (#12381) @MBilalShafi
|
|
31
|
+
- [DataGrid] Make column resizing and autosizing available in Community plan (#12420) @cherniavskii
|
|
32
|
+
- [DataGrid] Remove `baseSwitch` slot (#12439) @romgrk
|
|
33
|
+
- [l10n] Improve Japanese (ja-JP) locale (#12398) @makoto14
|
|
34
|
+
|
|
35
|
+
#### `@mui/x-data-grid-pro@7.0.0-beta.7` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
36
|
+
|
|
37
|
+
Same changes as in `@mui/x-data-grid@7.0.0-beta.7`, plus:
|
|
38
|
+
|
|
39
|
+
- [DataGridPro] Add `inputRef` to the props passed to `colDef.renderHeaderFilter` (#12328) @vovarudomanenko
|
|
40
|
+
- [DataGridPro] Fix filler rendered for no reason when there are pinned columns (#12440) @cherniavskii
|
|
41
|
+
- [DataGridPro] Make lazy loading feature stable (#12421) @cherniavskii
|
|
42
|
+
- [DataGridPro] Render pinned and non-pinned column headers in one row (#12376) @cherniavskii
|
|
43
|
+
|
|
44
|
+
#### `@mui/x-data-grid-premium@7.0.0-beta.7` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
45
|
+
|
|
46
|
+
Same changes as in `@mui/x-data-grid-pro@7.0.0-beta.7`, plus:
|
|
47
|
+
|
|
48
|
+
- [DataGridPremium] Fix auto-scroll not working when selecting cell range (#12267) @cherniavskii
|
|
49
|
+
|
|
50
|
+
### Date and Time Pickers
|
|
51
|
+
|
|
52
|
+
#### `@mui/x-date-pickers@7.0.0-beta.7`
|
|
53
|
+
|
|
54
|
+
- [fields] Fix `tabIndex` on accessible field DOM structure (#12311) @flaviendelangle
|
|
55
|
+
- [fields] Fix items alignment on multi input range fields (#12312) @flaviendelangle
|
|
56
|
+
- [pickers] Improve the customization of the range picker calendar header (#11988) @flaviendelangle
|
|
57
|
+
- [pickers] Keep the existing time when looking for closest enabled date (#12377) @LukasTy
|
|
58
|
+
|
|
59
|
+
#### `@mui/x-date-pickers-pro@7.0.0-beta.7` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
60
|
+
|
|
61
|
+
Same changes as in `@mui/x-date-pickers@7.0.0-beta.7`.
|
|
62
|
+
|
|
63
|
+
### Charts
|
|
64
|
+
|
|
65
|
+
#### `@mui/x-charts@7.0.0-beta.7`
|
|
66
|
+
|
|
67
|
+
- [charts] Fix axis highlight when axis is reversed (#12407) @alexfauquette
|
|
68
|
+
|
|
69
|
+
### Tree View
|
|
70
|
+
|
|
71
|
+
#### Breaking changes
|
|
72
|
+
|
|
73
|
+
The `onNodeFocus` callback has been renamed to `onItemFocus` for consistency:
|
|
74
|
+
|
|
75
|
+
```diff
|
|
76
|
+
<SimpleTreeView
|
|
77
|
+
- onNodeFocus={onNodeFocus}
|
|
78
|
+
+ onItemFocus={onItemFocus}
|
|
79
|
+
/>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
#### `@mui/x-tree-view@7.0.0-beta.7`
|
|
83
|
+
|
|
84
|
+
- [TreeView] Clean the usage of the term "item" and "node" in API introduced during v7 (#12368) @noraleonte
|
|
85
|
+
- [TreeView] Introduce a new `TreeItem2` component and a new `useTreeItem2` hook (#11721) @flaviendelangle
|
|
86
|
+
- [TreeView] Rename `onNodeFocus` to `onItemFocus` (#12419) @noraleonte
|
|
87
|
+
|
|
88
|
+
### Docs
|
|
89
|
+
|
|
90
|
+
- [docs] Add `legacy` bundle drop mention in migration pages (#12424) @LukasTy
|
|
91
|
+
- [docs] Add missing luxon `Info` import (#12427) @LukasTy
|
|
92
|
+
- [docs] Improve slots definitions for charts (#12408) @alexfauquette
|
|
93
|
+
- [docs] Polish What's new in MUI X blog titles (#12309) @oliviertassinari
|
|
94
|
+
- [docs] Replace `rel="noreferrer"` by `rel="noopener"` @oliviertassinari
|
|
95
|
+
- [docs] Update `date-fns` `weekStarsOn` overriding example (#12416) @LukasTy
|
|
96
|
+
|
|
97
|
+
### Core
|
|
98
|
+
|
|
99
|
+
- [core] Fix CI (#12414) @flaviendelangle
|
|
100
|
+
- [core] Fix PR deploy link for Tree View doc pages (#12411) @flaviendelangle
|
|
101
|
+
|
|
6
102
|
## 7.0.0-beta.6
|
|
7
103
|
|
|
8
104
|
_Mar 8, 2024_
|
|
@@ -1731,7 +1827,7 @@ Same changes as in `@mui/x-data-grid-pro@7.0.0-alpha.3`, plus:
|
|
|
1731
1827
|
The Firefox browser currently does not support this behavior because the [getWeekInfo](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getWeekInfo) API is not yet implemented.
|
|
1732
1828
|
|
|
1733
1829
|
```ts
|
|
1734
|
-
import { Settings } from 'luxon';
|
|
1830
|
+
import { Settings, Info } from 'luxon';
|
|
1735
1831
|
|
|
1736
1832
|
Settings.defaultWeekSettings = {
|
|
1737
1833
|
firstDay: 1,
|
|
@@ -2521,6 +2617,26 @@ Here is an example of the renaming for the `<ChartsTooltip />` component.
|
|
|
2521
2617
|
- [core] Update release instructions as per v7 configuration (#10962) @MBilalShafi
|
|
2522
2618
|
- [license] Correctly throw errors (#10924) @oliviertassinari
|
|
2523
2619
|
|
|
2620
|
+
## 6.19.7
|
|
2621
|
+
|
|
2622
|
+
_Mar 14, 2024_
|
|
2623
|
+
|
|
2624
|
+
We'd like to offer a big thanks to @LukasTy who made this release possible.
|
|
2625
|
+
|
|
2626
|
+
### Date Pickers
|
|
2627
|
+
|
|
2628
|
+
#### `@mui/x-date-pickers@6.19.7`
|
|
2629
|
+
|
|
2630
|
+
- [pickers] Keep the existing time when looking for closest enabled date (#12410) @LukasTy
|
|
2631
|
+
|
|
2632
|
+
#### `@mui/x-date-pickers-pro@6.19.7` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
2633
|
+
|
|
2634
|
+
Same changes as in `@mui/x-date-pickers@6.19.7`.
|
|
2635
|
+
|
|
2636
|
+
### Docs
|
|
2637
|
+
|
|
2638
|
+
- [docs] Add Pickers custom start of week section (#12425) @LukasTy
|
|
2639
|
+
|
|
2524
2640
|
## 6.19.6
|
|
2525
2641
|
|
|
2526
2642
|
_Mar 1, 2024_
|
|
@@ -295,7 +295,6 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
295
295
|
* For each feature, if the flag is not explicitly set to `true`, then the feature is fully disabled, and neither property nor method calls will have any effect.
|
|
296
296
|
*/
|
|
297
297
|
experimentalFeatures: _propTypes.default.shape({
|
|
298
|
-
lazyLoading: _propTypes.default.bool,
|
|
299
298
|
warnIfFocusStateIsNotSynced: _propTypes.default.bool
|
|
300
299
|
}),
|
|
301
300
|
/**
|
|
@@ -722,6 +721,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
722
721
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
723
722
|
*/
|
|
724
723
|
onRowClick: _propTypes.default.func,
|
|
724
|
+
/**
|
|
725
|
+
* Callback fired when the row count has changed.
|
|
726
|
+
* @param {number} count Updated row count.
|
|
727
|
+
*/
|
|
728
|
+
onRowCountChange: _propTypes.default.func,
|
|
725
729
|
/**
|
|
726
730
|
* Callback fired when a double click event comes from a row container element.
|
|
727
731
|
* @param {GridRowParams} params With all properties from [[RowParams]].
|
|
@@ -288,7 +288,6 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
288
288
|
* For each feature, if the flag is not explicitly set to `true`, then the feature is fully disabled, and neither property nor method calls will have any effect.
|
|
289
289
|
*/
|
|
290
290
|
experimentalFeatures: PropTypes.shape({
|
|
291
|
-
lazyLoading: PropTypes.bool,
|
|
292
291
|
warnIfFocusStateIsNotSynced: PropTypes.bool
|
|
293
292
|
}),
|
|
294
293
|
/**
|
|
@@ -715,6 +714,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
715
714
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
716
715
|
*/
|
|
717
716
|
onRowClick: PropTypes.func,
|
|
717
|
+
/**
|
|
718
|
+
* Callback fired when the row count has changed.
|
|
719
|
+
* @param {number} count Updated row count.
|
|
720
|
+
*/
|
|
721
|
+
onRowCountChange: PropTypes.func,
|
|
718
722
|
/**
|
|
719
723
|
* Callback fired when a double click event comes from a row container element.
|
|
720
724
|
* @param {GridRowParams} params With all properties from [[RowParams]].
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { ownerDocument, useEventCallback } from '@mui/material/utils';
|
|
4
|
-
import { isNavigationKey, serializeCellValue, useGridRegisterPipeProcessor, useGridVisibleRows } from '@mui/x-data-grid-pro/internals';
|
|
5
|
-
import { useGridApiEventHandler, useGridApiMethod, GRID_ACTIONS_COLUMN_TYPE, GRID_CHECKBOX_SELECTION_COL_DEF, GRID_DETAIL_PANEL_TOGGLE_FIELD, gridRowsDataRowIdToIdLookupSelector, gridClasses, gridFocusCellSelector, GRID_REORDER_COL_DEF, useGridSelector, gridSortedRowIdsSelector } from '@mui/x-data-grid-pro';
|
|
4
|
+
import { getTotalHeaderHeight, isNavigationKey, serializeCellValue, useGridRegisterPipeProcessor, useGridVisibleRows } from '@mui/x-data-grid-pro/internals';
|
|
5
|
+
import { useGridApiEventHandler, useGridApiMethod, GRID_ACTIONS_COLUMN_TYPE, GRID_CHECKBOX_SELECTION_COL_DEF, GRID_DETAIL_PANEL_TOGGLE_FIELD, gridRowsDataRowIdToIdLookupSelector, gridClasses, gridFocusCellSelector, GRID_REORDER_COL_DEF, useGridSelector, gridSortedRowIdsSelector, gridDimensionsSelector } from '@mui/x-data-grid-pro';
|
|
6
6
|
import { gridCellSelectionStateSelector } from './gridCellSelectionSelector';
|
|
7
7
|
export const cellSelectionStateInitializer = (state, props) => {
|
|
8
8
|
var _props$cellSelectionM, _props$initialState;
|
|
@@ -23,6 +23,8 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
23
23
|
const mousePosition = React.useRef(null);
|
|
24
24
|
const autoScrollRAF = React.useRef();
|
|
25
25
|
const sortedRowIds = useGridSelector(apiRef, gridSortedRowIdsSelector);
|
|
26
|
+
const dimensions = useGridSelector(apiRef, gridDimensionsSelector);
|
|
27
|
+
const totalHeaderHeight = getTotalHeaderHeight(apiRef, props.columnHeaderHeight);
|
|
26
28
|
const ignoreValueFormatterProp = props.ignoreValueFormatterDuringExport;
|
|
27
29
|
const ignoreValueFormatter = (typeof ignoreValueFormatterProp === 'object' ? ignoreValueFormatterProp == null ? void 0 : ignoreValueFormatterProp.clipboardExport : ignoreValueFormatterProp) || false;
|
|
28
30
|
const clipboardCopyCellDelimiter = props.clipboardCopyCellDelimiter;
|
|
@@ -165,20 +167,16 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
165
167
|
};
|
|
166
168
|
}, []);
|
|
167
169
|
const startAutoScroll = React.useCallback(() => {
|
|
168
|
-
var _apiRef$current$virtu
|
|
170
|
+
var _apiRef$current$virtu;
|
|
169
171
|
if (autoScrollRAF.current) {
|
|
170
172
|
return;
|
|
171
173
|
}
|
|
172
174
|
if (!((_apiRef$current$virtu = apiRef.current.virtualScrollerRef) != null && _apiRef$current$virtu.current)) {
|
|
173
175
|
return;
|
|
174
176
|
}
|
|
175
|
-
const virtualScrollerRect = (_apiRef$current$virtu2 = apiRef.current.virtualScrollerRef) == null || (_apiRef$current$virtu2 = _apiRef$current$virtu2.current) == null ? void 0 : _apiRef$current$virtu2.getBoundingClientRect();
|
|
176
|
-
if (!virtualScrollerRect) {
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
177
|
function autoScroll() {
|
|
180
|
-
var _apiRef$current$
|
|
181
|
-
if (!mousePosition.current || !((_apiRef$current$
|
|
178
|
+
var _apiRef$current$virtu2;
|
|
179
|
+
if (!mousePosition.current || !((_apiRef$current$virtu2 = apiRef.current.virtualScrollerRef) != null && _apiRef$current$virtu2.current)) {
|
|
182
180
|
return;
|
|
183
181
|
}
|
|
184
182
|
const {
|
|
@@ -188,11 +186,10 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
188
186
|
const {
|
|
189
187
|
height,
|
|
190
188
|
width
|
|
191
|
-
} =
|
|
189
|
+
} = dimensions.viewportInnerSize;
|
|
192
190
|
let deltaX = 0;
|
|
193
191
|
let deltaY = 0;
|
|
194
192
|
let factor = 0;
|
|
195
|
-
const dimensions = apiRef.current.getRootDimensions();
|
|
196
193
|
if (mouseY <= AUTO_SCROLL_SENSITIVITY && dimensions.hasScrollY) {
|
|
197
194
|
// When scrolling up, the multiplier increases going closer to the top edge
|
|
198
195
|
factor = (AUTO_SCROLL_SENSITIVITY - mouseY) / -AUTO_SCROLL_SENSITIVITY;
|
|
@@ -223,9 +220,9 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
223
220
|
autoScrollRAF.current = requestAnimationFrame(autoScroll);
|
|
224
221
|
}
|
|
225
222
|
autoScroll();
|
|
226
|
-
}, [apiRef]);
|
|
223
|
+
}, [apiRef, dimensions]);
|
|
227
224
|
const handleCellMouseOver = React.useCallback((params, event) => {
|
|
228
|
-
var _apiRef$current$
|
|
225
|
+
var _apiRef$current$virtu3;
|
|
229
226
|
if (!lastMouseDownCell.current) {
|
|
230
227
|
return;
|
|
231
228
|
}
|
|
@@ -237,18 +234,20 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
237
234
|
id,
|
|
238
235
|
field
|
|
239
236
|
}, event.ctrlKey || event.metaKey);
|
|
240
|
-
const virtualScrollerRect = (_apiRef$current$
|
|
237
|
+
const virtualScrollerRect = (_apiRef$current$virtu3 = apiRef.current.virtualScrollerRef) == null || (_apiRef$current$virtu3 = _apiRef$current$virtu3.current) == null ? void 0 : _apiRef$current$virtu3.getBoundingClientRect();
|
|
241
238
|
if (!virtualScrollerRect) {
|
|
242
239
|
return;
|
|
243
240
|
}
|
|
244
241
|
const {
|
|
245
|
-
height,
|
|
246
|
-
width,
|
|
247
242
|
x,
|
|
248
243
|
y
|
|
249
244
|
} = virtualScrollerRect;
|
|
245
|
+
const {
|
|
246
|
+
height,
|
|
247
|
+
width
|
|
248
|
+
} = dimensions.viewportInnerSize;
|
|
250
249
|
const mouseX = event.clientX - x;
|
|
251
|
-
const mouseY = event.clientY - y;
|
|
250
|
+
const mouseY = event.clientY - y - totalHeaderHeight;
|
|
252
251
|
mousePosition.current = {
|
|
253
252
|
x: mouseX,
|
|
254
253
|
y: mouseY
|
|
@@ -263,7 +262,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
263
262
|
// Mouse has left the sensitivity area while auto scroll is on
|
|
264
263
|
stopAutoScroll();
|
|
265
264
|
}
|
|
266
|
-
}, [apiRef, startAutoScroll, stopAutoScroll]);
|
|
265
|
+
}, [apiRef, startAutoScroll, stopAutoScroll, totalHeaderHeight, dimensions]);
|
|
267
266
|
const handleCellClick = useEventCallback((params, event) => {
|
|
268
267
|
const {
|
|
269
268
|
id,
|
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 = "MTcxMDM3MDgwMDAwMA==";
|
|
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
|
|
@@ -64,7 +64,7 @@ export declare const unwrapColumnFromAggregation: ({ column, }: {
|
|
|
64
64
|
disableReorder?: boolean | undefined;
|
|
65
65
|
disableExport?: boolean | undefined;
|
|
66
66
|
colSpan?: number | import("@mui/x-data-grid-pro").GridColSpanFn<import("@mui/x-data-grid-pro").GridValidRowModel, any, any> | undefined;
|
|
67
|
-
renderHeaderFilter?: ((params: import("@mui/x-data-grid-pro").
|
|
67
|
+
renderHeaderFilter?: ((params: import("@mui/x-data-grid-pro").GridRenderHeaderFilterProps) => React.ReactNode) | undefined;
|
|
68
68
|
aggregable?: boolean | undefined;
|
|
69
69
|
availableAggregationFunctions?: string[] | undefined;
|
|
70
70
|
groupingValueGetter?: import("../../..").GridGroupingValueGetter<import("@mui/x-data-grid-pro").GridValidRowModel> | undefined;
|
|
@@ -3,4 +3,4 @@ import { GridStateInitializer } from '@mui/x-data-grid-pro/internals';
|
|
|
3
3
|
import { DataGridPremiumProcessedProps } from '../../../models/dataGridPremiumProps';
|
|
4
4
|
import { GridPrivateApiPremium } from '../../../models/gridApiPremium';
|
|
5
5
|
export declare const cellSelectionStateInitializer: GridStateInitializer<Pick<DataGridPremiumProcessedProps, 'cellSelectionModel' | 'initialState'>>;
|
|
6
|
-
export declare const useGridCellSelection: (apiRef: React.MutableRefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, 'cellSelection' | 'cellSelectionModel' | 'onCellSelectionModelChange' | 'pagination' | 'paginationMode' | 'ignoreValueFormatterDuringExport' | 'clipboardCopyCellDelimiter'>) => void;
|
|
6
|
+
export declare const useGridCellSelection: (apiRef: React.MutableRefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, 'cellSelection' | 'cellSelectionModel' | 'onCellSelectionModelChange' | 'pagination' | 'paginationMode' | 'ignoreValueFormatterDuringExport' | 'clipboardCopyCellDelimiter' | 'columnHeaderHeight'>) => void;
|
|
@@ -30,6 +30,8 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
30
30
|
const mousePosition = React.useRef(null);
|
|
31
31
|
const autoScrollRAF = React.useRef();
|
|
32
32
|
const sortedRowIds = (0, _xDataGridPro.useGridSelector)(apiRef, _xDataGridPro.gridSortedRowIdsSelector);
|
|
33
|
+
const dimensions = (0, _xDataGridPro.useGridSelector)(apiRef, _xDataGridPro.gridDimensionsSelector);
|
|
34
|
+
const totalHeaderHeight = (0, _internals.getTotalHeaderHeight)(apiRef, props.columnHeaderHeight);
|
|
33
35
|
const ignoreValueFormatterProp = props.ignoreValueFormatterDuringExport;
|
|
34
36
|
const ignoreValueFormatter = (typeof ignoreValueFormatterProp === 'object' ? ignoreValueFormatterProp?.clipboardExport : ignoreValueFormatterProp) || false;
|
|
35
37
|
const clipboardCopyCellDelimiter = props.clipboardCopyCellDelimiter;
|
|
@@ -176,10 +178,6 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
176
178
|
if (!apiRef.current.virtualScrollerRef?.current) {
|
|
177
179
|
return;
|
|
178
180
|
}
|
|
179
|
-
const virtualScrollerRect = apiRef.current.virtualScrollerRef?.current?.getBoundingClientRect();
|
|
180
|
-
if (!virtualScrollerRect) {
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
181
|
function autoScroll() {
|
|
184
182
|
if (!mousePosition.current || !apiRef.current.virtualScrollerRef?.current) {
|
|
185
183
|
return;
|
|
@@ -191,11 +189,10 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
191
189
|
const {
|
|
192
190
|
height,
|
|
193
191
|
width
|
|
194
|
-
} =
|
|
192
|
+
} = dimensions.viewportInnerSize;
|
|
195
193
|
let deltaX = 0;
|
|
196
194
|
let deltaY = 0;
|
|
197
195
|
let factor = 0;
|
|
198
|
-
const dimensions = apiRef.current.getRootDimensions();
|
|
199
196
|
if (mouseY <= AUTO_SCROLL_SENSITIVITY && dimensions.hasScrollY) {
|
|
200
197
|
// When scrolling up, the multiplier increases going closer to the top edge
|
|
201
198
|
factor = (AUTO_SCROLL_SENSITIVITY - mouseY) / -AUTO_SCROLL_SENSITIVITY;
|
|
@@ -226,7 +223,7 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
226
223
|
autoScrollRAF.current = requestAnimationFrame(autoScroll);
|
|
227
224
|
}
|
|
228
225
|
autoScroll();
|
|
229
|
-
}, [apiRef]);
|
|
226
|
+
}, [apiRef, dimensions]);
|
|
230
227
|
const handleCellMouseOver = React.useCallback((params, event) => {
|
|
231
228
|
if (!lastMouseDownCell.current) {
|
|
232
229
|
return;
|
|
@@ -244,13 +241,15 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
244
241
|
return;
|
|
245
242
|
}
|
|
246
243
|
const {
|
|
247
|
-
height,
|
|
248
|
-
width,
|
|
249
244
|
x,
|
|
250
245
|
y
|
|
251
246
|
} = virtualScrollerRect;
|
|
247
|
+
const {
|
|
248
|
+
height,
|
|
249
|
+
width
|
|
250
|
+
} = dimensions.viewportInnerSize;
|
|
252
251
|
const mouseX = event.clientX - x;
|
|
253
|
-
const mouseY = event.clientY - y;
|
|
252
|
+
const mouseY = event.clientY - y - totalHeaderHeight;
|
|
254
253
|
mousePosition.current = {
|
|
255
254
|
x: mouseX,
|
|
256
255
|
y: mouseY
|
|
@@ -265,7 +264,7 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
265
264
|
// Mouse has left the sensitivity area while auto scroll is on
|
|
266
265
|
stopAutoScroll();
|
|
267
266
|
}
|
|
268
|
-
}, [apiRef, startAutoScroll, stopAutoScroll]);
|
|
267
|
+
}, [apiRef, startAutoScroll, stopAutoScroll, totalHeaderHeight, dimensions]);
|
|
269
268
|
const handleCellClick = (0, _utils.useEventCallback)((params, event) => {
|
|
270
269
|
const {
|
|
271
270
|
id,
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GridPrivateOnlyApiCommon } from '@mui/x-data-grid/internals';
|
|
2
|
-
import { GridApiCommon, GridColumnPinningApi,
|
|
2
|
+
import { GridApiCommon, GridColumnPinningApi, GridDetailPanelApi, GridDetailPanelPrivateApi, GridRowPinningApi, GridRowMultiSelectionApi, GridColumnReorderApi, GridRowProApi } from '@mui/x-data-grid-pro';
|
|
3
3
|
import { GridInitialStatePremium, GridStatePremium } from './gridStatePremium';
|
|
4
4
|
import type { GridRowGroupingApi, GridExcelExportApi, GridAggregationApi } from '../hooks';
|
|
5
5
|
import { GridCellSelectionApi } from '../hooks/features/cellSelection/gridCellSelectionInterfaces';
|
|
@@ -8,7 +8,7 @@ import type { DataGridPremiumProcessedProps } from './dataGridPremiumProps';
|
|
|
8
8
|
* The api of `DataGridPremium`.
|
|
9
9
|
* TODO: Do not redefine manually the pro features
|
|
10
10
|
*/
|
|
11
|
-
export interface GridApiPremium extends GridApiCommon<GridStatePremium, GridInitialStatePremium>, GridRowProApi, GridColumnPinningApi,
|
|
11
|
+
export interface GridApiPremium extends GridApiCommon<GridStatePremium, GridInitialStatePremium>, GridRowProApi, GridColumnPinningApi, GridDetailPanelApi, GridRowGroupingApi, GridExcelExportApi, GridAggregationApi, GridRowPinningApi, GridCellSelectionApi, GridRowMultiSelectionApi, GridColumnReorderApi {
|
|
12
12
|
}
|
|
13
13
|
export interface GridPrivateApiPremium extends GridApiPremium, GridPrivateOnlyApiCommon<GridApiPremium, GridPrivateApiPremium, DataGridPremiumProcessedProps>, GridDetailPanelPrivateApi {
|
|
14
14
|
}
|
|
@@ -288,7 +288,6 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
288
288
|
* For each feature, if the flag is not explicitly set to `true`, then the feature is fully disabled, and neither property nor method calls will have any effect.
|
|
289
289
|
*/
|
|
290
290
|
experimentalFeatures: PropTypes.shape({
|
|
291
|
-
lazyLoading: PropTypes.bool,
|
|
292
291
|
warnIfFocusStateIsNotSynced: PropTypes.bool
|
|
293
292
|
}),
|
|
294
293
|
/**
|
|
@@ -715,6 +714,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
715
714
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
716
715
|
*/
|
|
717
716
|
onRowClick: PropTypes.func,
|
|
717
|
+
/**
|
|
718
|
+
* Callback fired when the row count has changed.
|
|
719
|
+
* @param {number} count Updated row count.
|
|
720
|
+
*/
|
|
721
|
+
onRowCountChange: PropTypes.func,
|
|
718
722
|
/**
|
|
719
723
|
* Callback fired when a double click event comes from a row container element.
|
|
720
724
|
* @param {GridRowParams} params With all properties from [[RowParams]].
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { ownerDocument, useEventCallback } from '@mui/material/utils';
|
|
4
|
-
import { isNavigationKey, serializeCellValue, useGridRegisterPipeProcessor, useGridVisibleRows } from '@mui/x-data-grid-pro/internals';
|
|
5
|
-
import { useGridApiEventHandler, useGridApiMethod, GRID_ACTIONS_COLUMN_TYPE, GRID_CHECKBOX_SELECTION_COL_DEF, GRID_DETAIL_PANEL_TOGGLE_FIELD, gridRowsDataRowIdToIdLookupSelector, gridClasses, gridFocusCellSelector, GRID_REORDER_COL_DEF, useGridSelector, gridSortedRowIdsSelector } from '@mui/x-data-grid-pro';
|
|
4
|
+
import { getTotalHeaderHeight, isNavigationKey, serializeCellValue, useGridRegisterPipeProcessor, useGridVisibleRows } from '@mui/x-data-grid-pro/internals';
|
|
5
|
+
import { useGridApiEventHandler, useGridApiMethod, GRID_ACTIONS_COLUMN_TYPE, GRID_CHECKBOX_SELECTION_COL_DEF, GRID_DETAIL_PANEL_TOGGLE_FIELD, gridRowsDataRowIdToIdLookupSelector, gridClasses, gridFocusCellSelector, GRID_REORDER_COL_DEF, useGridSelector, gridSortedRowIdsSelector, gridDimensionsSelector } from '@mui/x-data-grid-pro';
|
|
6
6
|
import { gridCellSelectionStateSelector } from './gridCellSelectionSelector';
|
|
7
7
|
export const cellSelectionStateInitializer = (state, props) => _extends({}, state, {
|
|
8
8
|
cellSelection: _extends({}, props.cellSelectionModel ?? props.initialState?.cellSelection)
|
|
@@ -20,6 +20,8 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
20
20
|
const mousePosition = React.useRef(null);
|
|
21
21
|
const autoScrollRAF = React.useRef();
|
|
22
22
|
const sortedRowIds = useGridSelector(apiRef, gridSortedRowIdsSelector);
|
|
23
|
+
const dimensions = useGridSelector(apiRef, gridDimensionsSelector);
|
|
24
|
+
const totalHeaderHeight = getTotalHeaderHeight(apiRef, props.columnHeaderHeight);
|
|
23
25
|
const ignoreValueFormatterProp = props.ignoreValueFormatterDuringExport;
|
|
24
26
|
const ignoreValueFormatter = (typeof ignoreValueFormatterProp === 'object' ? ignoreValueFormatterProp?.clipboardExport : ignoreValueFormatterProp) || false;
|
|
25
27
|
const clipboardCopyCellDelimiter = props.clipboardCopyCellDelimiter;
|
|
@@ -166,10 +168,6 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
166
168
|
if (!apiRef.current.virtualScrollerRef?.current) {
|
|
167
169
|
return;
|
|
168
170
|
}
|
|
169
|
-
const virtualScrollerRect = apiRef.current.virtualScrollerRef?.current?.getBoundingClientRect();
|
|
170
|
-
if (!virtualScrollerRect) {
|
|
171
|
-
return;
|
|
172
|
-
}
|
|
173
171
|
function autoScroll() {
|
|
174
172
|
if (!mousePosition.current || !apiRef.current.virtualScrollerRef?.current) {
|
|
175
173
|
return;
|
|
@@ -181,11 +179,10 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
181
179
|
const {
|
|
182
180
|
height,
|
|
183
181
|
width
|
|
184
|
-
} =
|
|
182
|
+
} = dimensions.viewportInnerSize;
|
|
185
183
|
let deltaX = 0;
|
|
186
184
|
let deltaY = 0;
|
|
187
185
|
let factor = 0;
|
|
188
|
-
const dimensions = apiRef.current.getRootDimensions();
|
|
189
186
|
if (mouseY <= AUTO_SCROLL_SENSITIVITY && dimensions.hasScrollY) {
|
|
190
187
|
// When scrolling up, the multiplier increases going closer to the top edge
|
|
191
188
|
factor = (AUTO_SCROLL_SENSITIVITY - mouseY) / -AUTO_SCROLL_SENSITIVITY;
|
|
@@ -216,7 +213,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
216
213
|
autoScrollRAF.current = requestAnimationFrame(autoScroll);
|
|
217
214
|
}
|
|
218
215
|
autoScroll();
|
|
219
|
-
}, [apiRef]);
|
|
216
|
+
}, [apiRef, dimensions]);
|
|
220
217
|
const handleCellMouseOver = React.useCallback((params, event) => {
|
|
221
218
|
if (!lastMouseDownCell.current) {
|
|
222
219
|
return;
|
|
@@ -234,13 +231,15 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
234
231
|
return;
|
|
235
232
|
}
|
|
236
233
|
const {
|
|
237
|
-
height,
|
|
238
|
-
width,
|
|
239
234
|
x,
|
|
240
235
|
y
|
|
241
236
|
} = virtualScrollerRect;
|
|
237
|
+
const {
|
|
238
|
+
height,
|
|
239
|
+
width
|
|
240
|
+
} = dimensions.viewportInnerSize;
|
|
242
241
|
const mouseX = event.clientX - x;
|
|
243
|
-
const mouseY = event.clientY - y;
|
|
242
|
+
const mouseY = event.clientY - y - totalHeaderHeight;
|
|
244
243
|
mousePosition.current = {
|
|
245
244
|
x: mouseX,
|
|
246
245
|
y: mouseY
|
|
@@ -255,7 +254,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
255
254
|
// Mouse has left the sensitivity area while auto scroll is on
|
|
256
255
|
stopAutoScroll();
|
|
257
256
|
}
|
|
258
|
-
}, [apiRef, startAutoScroll, stopAutoScroll]);
|
|
257
|
+
}, [apiRef, startAutoScroll, stopAutoScroll, totalHeaderHeight, dimensions]);
|
|
259
258
|
const handleCellClick = useEventCallback((params, event) => {
|
|
260
259
|
const {
|
|
261
260
|
id,
|
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 = "MTcxMDM3MDgwMDAwMA==";
|
|
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": "7.0.0-beta.
|
|
3
|
+
"version": "7.0.0-beta.7",
|
|
4
4
|
"description": "The Premium plan edition of the data grid component (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@babel/runtime": "^7.24.0",
|
|
36
36
|
"@mui/system": "^5.15.9",
|
|
37
37
|
"@mui/utils": "^5.15.9",
|
|
38
|
-
"@mui/x-data-grid": "7.0.0-beta.
|
|
39
|
-
"@mui/x-data-grid-pro": "7.0.0-beta.
|
|
38
|
+
"@mui/x-data-grid": "7.0.0-beta.7",
|
|
39
|
+
"@mui/x-data-grid-pro": "7.0.0-beta.7",
|
|
40
40
|
"@mui/x-license": "7.0.0-beta.6",
|
|
41
41
|
"@types/format-util": "^1.0.4",
|
|
42
42
|
"clsx": "^2.1.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 = "MTcxMDM3MDgwMDAwMA==";
|
|
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
|