@mui/x-data-grid-premium 8.0.0-alpha.10 → 8.0.0-alpha.11
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 +107 -2
- package/DataGridPremium/DataGridPremium.js +5 -4
- package/DataGridPremium/useDataGridPremiumComponent.js +2 -2
- package/esm/DataGridPremium/DataGridPremium.js +5 -4
- package/esm/DataGridPremium/useDataGridPremiumComponent.js +2 -2
- package/esm/hooks/features/aggregation/gridAggregationUtils.js +1 -1
- package/esm/hooks/features/aggregation/useGridAggregation.js +0 -2
- package/esm/hooks/features/cellSelection/useGridCellSelection.js +13 -10
- package/esm/hooks/features/rowGrouping/gridRowGroupingUtils.js +3 -1
- package/esm/utils/releaseInfo.js +1 -1
- package/hooks/features/aggregation/gridAggregationUtils.js +1 -1
- package/hooks/features/aggregation/useGridAggregation.js +0 -2
- package/hooks/features/cellSelection/useGridCellSelection.js +11 -8
- package/hooks/features/rowGrouping/gridRowGroupingUtils.js +3 -1
- package/hooks/utils/useGridApiContext.d.ts +3 -1
- package/index.js +1 -1
- package/modern/DataGridPremium/DataGridPremium.js +5 -4
- package/modern/DataGridPremium/useDataGridPremiumComponent.js +2 -2
- package/modern/hooks/features/aggregation/gridAggregationUtils.js +1 -1
- package/modern/hooks/features/aggregation/useGridAggregation.js +0 -2
- package/modern/hooks/features/cellSelection/useGridCellSelection.js +13 -10
- package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.js +3 -1
- package/modern/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/package.json +5 -5
- package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,110 @@
|
|
|
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.0.0-alpha.11**
|
|
9
|
+
|
|
10
|
+
_Feb 7, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- ⚡ Mount and resize performance improvements for the Data Grid
|
|
15
|
+
|
|
16
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
17
|
+
@lauri865.
|
|
18
|
+
Following are all team members who have contributed to this release:
|
|
19
|
+
@alexfauquette, @arminmeh, @bernardobelchior, @flaviendelangle, @Janpot, @KenanYusuf, @LukasTy, @MBilalShafi, @noraleonte, @romgrk.
|
|
20
|
+
|
|
21
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
22
|
+
|
|
23
|
+
### Data Grid
|
|
24
|
+
|
|
25
|
+
#### Breaking changes
|
|
26
|
+
|
|
27
|
+
- `createUseGridApiEventHandler()` is not exported anymore.
|
|
28
|
+
- The `filteredRowsLookup` object of the filter state does not contain `true` values anymore. If the row is filtered out, the value is `false`. Otherwise, the row id is not present in the object.
|
|
29
|
+
This change only impacts you if you relied on `filteredRowsLookup` to get ids of filtered rows. In this case,use `gridDataRowIdsSelector` selector to get row ids and check `filteredRowsLookup` for `false` values:
|
|
30
|
+
|
|
31
|
+
```diff
|
|
32
|
+
const filteredRowsLookup = gridFilteredRowsLookupSelector(apiRef);
|
|
33
|
+
-const filteredRowIds = Object.keys(filteredRowsLookup).filter((rowId) => filteredRowsLookup[rowId] === true);
|
|
34
|
+
+const rowIds = gridDataRowIdsSelector(apiRef);
|
|
35
|
+
+const filteredRowIds = rowIds.filter((rowId) => filteredRowsLookup[rowId] !== false);
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
- The `visibleRowsLookup` state does not contain `true` values anymore. If the row is not visible, the value is `false`. Otherwise, the row id is not present in the object:
|
|
39
|
+
|
|
40
|
+
```diff
|
|
41
|
+
const visibleRowsLookup = gridVisibleRowsLookupSelector(apiRef);
|
|
42
|
+
-const isRowVisible = visibleRowsLookup[rowId] === true;
|
|
43
|
+
+const isRowVisible = visibleRowsLookup[rowId] !== false;
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
#### `@mui/x-data-grid@8.0.0-alpha.11`
|
|
47
|
+
|
|
48
|
+
- [DataGrid] Avoid `<GridRoot />` double-render pass on mount in SPA mode (#15648) @lauri865
|
|
49
|
+
- [DataGrid] Fix loading overlay not in sync with scroll (#16437) @MBilalShafi
|
|
50
|
+
- [DataGrid] Refactor: remove material `MenuList` import (#16444) @romgrk
|
|
51
|
+
- [DataGrid] Refactor: simplify `useGridApiEventHandler()` (#16479) @romgrk
|
|
52
|
+
|
|
53
|
+
#### `@mui/x-data-grid-pro@8.0.0-alpha.11` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
54
|
+
|
|
55
|
+
Same changes as in `@mui/x-data-grid@8.0.0-alpha.11`, plus:
|
|
56
|
+
|
|
57
|
+
- [DataGridPro] Fix the return type of `useGridApiContext()` for Pro and Premium packages on React < 19 (#16441) @arminmeh
|
|
58
|
+
|
|
59
|
+
#### `@mui/x-data-grid-premium@8.0.0-alpha.11` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
60
|
+
|
|
61
|
+
Same changes as in `@mui/x-data-grid-pro@8.0.0-alpha.11`, plus:
|
|
62
|
+
|
|
63
|
+
- [DataGridPremium] Fix "no rows" overlay not showing with active aggregation (#16466) @KenanYusuf
|
|
64
|
+
|
|
65
|
+
### Date and Time Pickers
|
|
66
|
+
|
|
67
|
+
#### `@mui/x-date-pickers@8.0.0-alpha.11`
|
|
68
|
+
|
|
69
|
+
Internal changes.
|
|
70
|
+
|
|
71
|
+
#### `@mui/x-date-pickers-pro@8.0.0-alpha.11` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
72
|
+
|
|
73
|
+
Same changes as in `@mui/x-date-pickers@8.0.0-alpha.11`, plus:
|
|
74
|
+
|
|
75
|
+
- [DateRangeCalendar] Support arrow navigation with multiple months rendered (#16363) @flaviendelangle
|
|
76
|
+
- [DateRangePicker] Fix `currentMonthCalendarPosition` prop behavior on mobile (#16455) @LukasTy
|
|
77
|
+
- [DateRangePicker] Fix vertical alignment for multi input fields (#16489) @noraleonte
|
|
78
|
+
|
|
79
|
+
### Charts
|
|
80
|
+
|
|
81
|
+
#### `@mui/x-charts@8.0.0-alpha.11`
|
|
82
|
+
|
|
83
|
+
- [charts] Add `color` prop to `Sparkline` and deprecate `colors` (#16477) @bernardobelchior
|
|
84
|
+
- [charts] Make typescript more flexible about plugins and their params (#16478) @alexfauquette
|
|
85
|
+
- [charts] Remove component for axis event listener (#16314) @alexfauquette
|
|
86
|
+
|
|
87
|
+
#### `@mui/x-charts-pro@8.0.0-alpha.11` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
88
|
+
|
|
89
|
+
Same changes as in `@mui/x-charts@8.0.0-alpha.11`.
|
|
90
|
+
|
|
91
|
+
### Tree View
|
|
92
|
+
|
|
93
|
+
#### `@mui/x-tree-view@8.0.0-alpha.11`
|
|
94
|
+
|
|
95
|
+
Internal changes.
|
|
96
|
+
|
|
97
|
+
#### `@mui/x-tree-view-pro@8.0.0-alpha.11` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
98
|
+
|
|
99
|
+
Same changes as in `@mui/x-tree-view@8.0.0-alpha.11`.
|
|
100
|
+
|
|
101
|
+
### Docs
|
|
102
|
+
|
|
103
|
+
- [docs] Update charts colors default value (#16484) @bernardobelchior
|
|
104
|
+
|
|
105
|
+
### Core
|
|
106
|
+
|
|
107
|
+
- [core] Fix corepack and pnpm installation in CircleCI (#16434) @flaviendelangle
|
|
108
|
+
- [code-infra] Update monorepo (#16112) @Janpot
|
|
109
|
+
- [test] Avoid test warning when running on React 18 (#16486) @LukasTy
|
|
110
|
+
- [test] Disable `react-transition-group` transitions in unit testing (#16288) @lauri865
|
|
111
|
+
|
|
8
112
|
## 8.0.0-alpha.10
|
|
9
113
|
|
|
10
114
|
_Jan 30, 2025_
|
|
@@ -50,6 +154,7 @@ Following are all team members who have contributed to this release:
|
|
|
50
154
|
+ },
|
|
51
155
|
});
|
|
52
156
|
```
|
|
157
|
+
|
|
53
158
|
- The `detailPanels`, `pinnedColumns`, and `pinnedRowsRenderZone` classes have been removed.
|
|
54
159
|
- Return type of the `useGridApiRef()` hook and the type of `apiRef` prop are updated to explicitly include the possibilty of `null`. In addition to this, `useGridApiRef()` returns a reference that is initialized with `null` instead of `{}`.
|
|
55
160
|
|
|
@@ -91,7 +196,7 @@ Same changes as in `@mui/x-data-grid-pro@8.0.0-alpha.10`.
|
|
|
91
196
|
|
|
92
197
|
#### Breaking changes
|
|
93
198
|
|
|
94
|
-
- The component passed to the `field` slot no longer receives the `ref`,
|
|
199
|
+
- The component passed to the `field` slot no longer receives the `ref`, `disabled`, `className`, `sx`, `label`, `name`, `formatDensity`, `enableAccessibleFieldDOMStructure`, `selectedSections`, `onSelectedSectionsChange` and `inputRef` props — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-field)
|
|
95
200
|
- The `MuiPickersPopper` theme entry have been renamed `MuiPickerPopper` and some of its props have been removed — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#muipickerspopper)
|
|
96
201
|
|
|
97
202
|
#### `@mui/x-date-pickers@8.0.0-alpha.10`
|
|
@@ -111,7 +216,7 @@ Same changes as in `@mui/x-date-pickers@8.0.0-alpha.10`.
|
|
|
111
216
|
|
|
112
217
|
- Replace `legend.position.horizontal` from `"left" | "middle" | "right"` to `"start" | "center" | "end"`.
|
|
113
218
|
This is to align with the CSS values and reflect the RTL ability of the legend component.
|
|
114
|
-
- The default colors have changed. To keep using the old palette. It is possible to import `blueberryTwilightPalette` from
|
|
219
|
+
- The default colors have changed. To keep using the old palette. It is possible to import `blueberryTwilightPalette` from `@mui/x-charts/colorPalettes` and set it on the `colors` property of charts.
|
|
115
220
|
- The `id` property is now optional on the `Pie` and `Scatter` data types.
|
|
116
221
|
|
|
117
222
|
#### `@mui/x-charts@8.0.0-alpha.10`
|
|
@@ -27,6 +27,10 @@ const configuration = {
|
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
const releaseInfo = (0, _releaseInfo.getReleaseInfo)();
|
|
30
|
+
const watermark = /*#__PURE__*/(0, _jsxRuntime.jsx)(_xLicense.Watermark, {
|
|
31
|
+
packageName: "x-data-grid-premium",
|
|
32
|
+
releaseInfo: releaseInfo
|
|
33
|
+
});
|
|
30
34
|
let dataGridPremiumPropValidators;
|
|
31
35
|
if (process.env.NODE_ENV !== 'production') {
|
|
32
36
|
dataGridPremiumPropValidators = [..._internals.propValidatorsDataGrid, ..._internals.propValidatorsDataGridPro];
|
|
@@ -48,10 +52,7 @@ const DataGridPremiumRaw = (0, _forwardRef.forwardRef)(function DataGridPremium(
|
|
|
48
52
|
sx: props.sx
|
|
49
53
|
}, props.slotProps?.root, {
|
|
50
54
|
ref: ref,
|
|
51
|
-
children:
|
|
52
|
-
packageName: "x-data-grid-premium",
|
|
53
|
-
releaseInfo: releaseInfo
|
|
54
|
-
})
|
|
55
|
+
children: watermark
|
|
55
56
|
}))
|
|
56
57
|
});
|
|
57
58
|
});
|
|
@@ -40,7 +40,6 @@ const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
40
40
|
/**
|
|
41
41
|
* Register all state initializers here.
|
|
42
42
|
*/
|
|
43
|
-
(0, _internals.useGridInitializeState)(_internals.dimensionsStateInitializer, apiRef, props);
|
|
44
43
|
(0, _internals.useGridInitializeState)(_internals.headerFilteringStateInitializer, apiRef, props);
|
|
45
44
|
(0, _internals.useGridInitializeState)(_useGridRowGrouping.rowGroupingStateInitializer, apiRef, props);
|
|
46
45
|
(0, _internals.useGridInitializeState)(_useGridAggregation.aggregationStateInitializer, apiRef, props);
|
|
@@ -61,11 +60,12 @@ const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
61
60
|
(0, _internals.useGridInitializeState)(_internals.densityStateInitializer, apiRef, props);
|
|
62
61
|
(0, _internals.useGridInitializeState)(_internals.columnReorderStateInitializer, apiRef, props);
|
|
63
62
|
(0, _internals.useGridInitializeState)(_internals.columnResizeStateInitializer, apiRef, props);
|
|
64
|
-
(0, _internals.useGridInitializeState)(_internals.rowsMetaStateInitializer, apiRef, props);
|
|
65
63
|
(0, _internals.useGridInitializeState)(_internals.columnMenuStateInitializer, apiRef, props);
|
|
66
64
|
(0, _internals.useGridInitializeState)(_internals.columnGroupsStateInitializer, apiRef, props);
|
|
67
65
|
(0, _internals.useGridInitializeState)(_internals.virtualizationStateInitializer, apiRef, props);
|
|
68
66
|
(0, _internals.useGridInitializeState)(_internals.dataSourceStateInitializer, apiRef, props);
|
|
67
|
+
(0, _internals.useGridInitializeState)(_internals.dimensionsStateInitializer, apiRef, props);
|
|
68
|
+
(0, _internals.useGridInitializeState)(_internals.rowsMetaStateInitializer, apiRef, props);
|
|
69
69
|
(0, _internals.useGridInitializeState)(_internals.listViewStateInitializer, apiRef, props);
|
|
70
70
|
(0, _useGridRowGrouping.useGridRowGrouping)(apiRef, props);
|
|
71
71
|
(0, _internals.useGridHeaderFiltering)(apiRef, props);
|
|
@@ -20,6 +20,10 @@ const configuration = {
|
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
const releaseInfo = getReleaseInfo();
|
|
23
|
+
const watermark = /*#__PURE__*/_jsx(Watermark, {
|
|
24
|
+
packageName: "x-data-grid-premium",
|
|
25
|
+
releaseInfo: releaseInfo
|
|
26
|
+
});
|
|
23
27
|
let dataGridPremiumPropValidators;
|
|
24
28
|
if (process.env.NODE_ENV !== 'production') {
|
|
25
29
|
dataGridPremiumPropValidators = [...propValidatorsDataGrid, ...propValidatorsDataGridPro];
|
|
@@ -41,10 +45,7 @@ const DataGridPremiumRaw = forwardRef(function DataGridPremium(inProps, ref) {
|
|
|
41
45
|
sx: props.sx
|
|
42
46
|
}, props.slotProps?.root, {
|
|
43
47
|
ref: ref,
|
|
44
|
-
children:
|
|
45
|
-
packageName: "x-data-grid-premium",
|
|
46
|
-
releaseInfo: releaseInfo
|
|
47
|
-
})
|
|
48
|
+
children: watermark
|
|
48
49
|
}))
|
|
49
50
|
});
|
|
50
51
|
});
|
|
@@ -33,7 +33,6 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
33
33
|
/**
|
|
34
34
|
* Register all state initializers here.
|
|
35
35
|
*/
|
|
36
|
-
useGridInitializeState(dimensionsStateInitializer, apiRef, props);
|
|
37
36
|
useGridInitializeState(headerFilteringStateInitializer, apiRef, props);
|
|
38
37
|
useGridInitializeState(rowGroupingStateInitializer, apiRef, props);
|
|
39
38
|
useGridInitializeState(aggregationStateInitializer, apiRef, props);
|
|
@@ -54,11 +53,12 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
54
53
|
useGridInitializeState(densityStateInitializer, apiRef, props);
|
|
55
54
|
useGridInitializeState(columnReorderStateInitializer, apiRef, props);
|
|
56
55
|
useGridInitializeState(columnResizeStateInitializer, apiRef, props);
|
|
57
|
-
useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
|
|
58
56
|
useGridInitializeState(columnMenuStateInitializer, apiRef, props);
|
|
59
57
|
useGridInitializeState(columnGroupsStateInitializer, apiRef, props);
|
|
60
58
|
useGridInitializeState(virtualizationStateInitializer, apiRef, props);
|
|
61
59
|
useGridInitializeState(dataSourceStateInitializer, apiRef, props);
|
|
60
|
+
useGridInitializeState(dimensionsStateInitializer, apiRef, props);
|
|
61
|
+
useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
|
|
62
62
|
useGridInitializeState(listViewStateInitializer, apiRef, props);
|
|
63
63
|
useGridRowGrouping(apiRef, props);
|
|
64
64
|
useGridHeaderFiltering(apiRef, props);
|
|
@@ -111,7 +111,7 @@ export const addFooterRows = ({
|
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
113
|
const updateRootGroupFooter = groupNode => {
|
|
114
|
-
const shouldHaveFooter = hasAggregationRule && getAggregationPosition(groupNode) === 'footer';
|
|
114
|
+
const shouldHaveFooter = hasAggregationRule && getAggregationPosition(groupNode) === 'footer' && groupNode.children.length > 0;
|
|
115
115
|
if (shouldHaveFooter) {
|
|
116
116
|
const rowId = getAggregationFooterRowIdFromGroupId(null);
|
|
117
117
|
newGroupingParams = addPinnedRow({
|
|
@@ -32,7 +32,6 @@ export const useGridAggregation = (apiRef, props) => {
|
|
|
32
32
|
const currentModel = gridAggregationModelSelector(apiRef);
|
|
33
33
|
if (currentModel !== model) {
|
|
34
34
|
apiRef.current.setState(mergeStateWithAggregationModel(model));
|
|
35
|
-
apiRef.current.forceUpdate();
|
|
36
35
|
}
|
|
37
36
|
}, [apiRef]);
|
|
38
37
|
const applyAggregation = React.useCallback(() => {
|
|
@@ -86,7 +85,6 @@ export const useGridAggregation = (apiRef, props) => {
|
|
|
86
85
|
|
|
87
86
|
// Re-apply the column hydration to wrap / unwrap the aggregated columns
|
|
88
87
|
if (!areAggregationRulesEqual(rulesOnLastColumnHydration, aggregationRules)) {
|
|
89
|
-
apiRef.current.caches.aggregation.rulesOnLastColumnHydration = aggregationRules;
|
|
90
88
|
apiRef.current.requestPipeProcessorsApplication('hydrateColumns');
|
|
91
89
|
}
|
|
92
90
|
}, [apiRef, applyAggregation, props.aggregationFunctions, props.disableAggregation, props.unstable_dataSource]);
|
|
@@ -2,8 +2,8 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import ownerDocument from '@mui/utils/ownerDocument';
|
|
4
4
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
5
|
-
import { getTotalHeaderHeight, getVisibleRows, isNavigationKey, serializeCellValue, useGridRegisterPipeProcessor
|
|
6
|
-
import { useGridApiEventHandler, useGridApiMethod, GRID_ACTIONS_COLUMN_TYPE, GRID_CHECKBOX_SELECTION_COL_DEF, GRID_DETAIL_PANEL_TOGGLE_FIELD, gridClasses, gridFocusCellSelector, GRID_REORDER_COL_DEF,
|
|
5
|
+
import { getTotalHeaderHeight, getVisibleRows, isNavigationKey, serializeCellValue, useGridRegisterPipeProcessor } from '@mui/x-data-grid-pro/internals';
|
|
6
|
+
import { useGridApiEventHandler, useGridApiMethod, GRID_ACTIONS_COLUMN_TYPE, GRID_CHECKBOX_SELECTION_COL_DEF, GRID_DETAIL_PANEL_TOGGLE_FIELD, gridClasses, gridFocusCellSelector, GRID_REORDER_COL_DEF, gridSortedRowIdsSelector, gridDimensionsSelector } from '@mui/x-data-grid-pro';
|
|
7
7
|
import { gridCellSelectionStateSelector } from "./gridCellSelectionSelector.js";
|
|
8
8
|
export const cellSelectionStateInitializer = (state, props) => _extends({}, state, {
|
|
9
9
|
cellSelection: _extends({}, props.cellSelectionModel ?? props.initialState?.cellSelection)
|
|
@@ -16,13 +16,10 @@ const AUTO_SCROLL_SPEED = 20; // The speed to scroll once the mouse enters the s
|
|
|
16
16
|
|
|
17
17
|
export const useGridCellSelection = (apiRef, props) => {
|
|
18
18
|
const hasRootReference = apiRef.current.rootElementRef.current !== null;
|
|
19
|
-
const visibleRows = useGridVisibleRows(apiRef, props);
|
|
20
19
|
const cellWithVirtualFocus = React.useRef(null);
|
|
21
20
|
const lastMouseDownCell = React.useRef(null);
|
|
22
21
|
const mousePosition = React.useRef(null);
|
|
23
22
|
const autoScrollRAF = React.useRef(null);
|
|
24
|
-
const sortedRowIds = useGridSelector(apiRef, gridSortedRowIdsSelector);
|
|
25
|
-
const dimensions = useGridSelector(apiRef, gridDimensionsSelector);
|
|
26
23
|
const totalHeaderHeight = getTotalHeaderHeight(apiRef, props);
|
|
27
24
|
const ignoreValueFormatterProp = props.ignoreValueFormatterDuringExport;
|
|
28
25
|
const ignoreValueFormatter = (typeof ignoreValueFormatterProp === 'object' ? ignoreValueFormatterProp?.clipboardExport : ignoreValueFormatterProp) || false;
|
|
@@ -76,6 +73,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
76
73
|
finalEndColumnIndex = startColumnIndex;
|
|
77
74
|
}
|
|
78
75
|
const visibleColumns = apiRef.current.getVisibleColumns();
|
|
76
|
+
const visibleRows = getVisibleRows(apiRef);
|
|
79
77
|
const rowsInRange = visibleRows.rows.slice(finalStartRowIndex, finalEndRowIndex + 1);
|
|
80
78
|
const columnsInRange = visibleColumns.slice(finalStartColumnIndex, finalEndColumnIndex + 1);
|
|
81
79
|
const newModel = keepOtherSelected ? _extends({}, apiRef.current.getCellSelectionModel()) : {};
|
|
@@ -88,7 +86,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
88
86
|
}, {});
|
|
89
87
|
});
|
|
90
88
|
apiRef.current.setCellSelectionModel(newModel);
|
|
91
|
-
}, [apiRef
|
|
89
|
+
}, [apiRef]);
|
|
92
90
|
const getSelectedCellsAsArray = React.useCallback(() => {
|
|
93
91
|
const selectionModel = apiRef.current.getCellSelectionModel();
|
|
94
92
|
const currentVisibleRows = getVisibleRows(apiRef, props);
|
|
@@ -186,6 +184,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
186
184
|
if (!mousePosition.current || !apiRef.current.virtualScrollerRef?.current) {
|
|
187
185
|
return;
|
|
188
186
|
}
|
|
187
|
+
const dimensions = gridDimensionsSelector(apiRef.current.state);
|
|
189
188
|
const {
|
|
190
189
|
x: mouseX,
|
|
191
190
|
y: mouseY
|
|
@@ -228,7 +227,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
228
227
|
autoScrollRAF.current = requestAnimationFrame(autoScroll);
|
|
229
228
|
}
|
|
230
229
|
autoScroll();
|
|
231
|
-
}, [apiRef,
|
|
230
|
+
}, [apiRef, totalHeaderHeight]);
|
|
232
231
|
const handleCellMouseOver = React.useCallback((params, event) => {
|
|
233
232
|
if (!lastMouseDownCell.current) {
|
|
234
233
|
return;
|
|
@@ -245,6 +244,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
245
244
|
if (!virtualScrollerRect) {
|
|
246
245
|
return;
|
|
247
246
|
}
|
|
247
|
+
const dimensions = gridDimensionsSelector(apiRef.current.state);
|
|
248
248
|
const {
|
|
249
249
|
x,
|
|
250
250
|
y
|
|
@@ -270,7 +270,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
270
270
|
// Mouse has left the sensitivity area while auto scroll is on
|
|
271
271
|
stopAutoScroll();
|
|
272
272
|
}
|
|
273
|
-
}, [apiRef, startAutoScroll, stopAutoScroll, totalHeaderHeight
|
|
273
|
+
}, [apiRef, startAutoScroll, stopAutoScroll, totalHeaderHeight]);
|
|
274
274
|
const handleCellClick = useEventCallback((params, event) => {
|
|
275
275
|
const {
|
|
276
276
|
id,
|
|
@@ -330,6 +330,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
330
330
|
} else if (event.key === 'ArrowLeft') {
|
|
331
331
|
endColumnIndex -= 1;
|
|
332
332
|
}
|
|
333
|
+
const visibleRows = getVisibleRows(apiRef);
|
|
333
334
|
if (endRowIndex < 0 || endRowIndex >= visibleRows.rows.length) {
|
|
334
335
|
return;
|
|
335
336
|
}
|
|
@@ -382,6 +383,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
382
383
|
id,
|
|
383
384
|
field
|
|
384
385
|
}) => {
|
|
386
|
+
const visibleRows = getVisibleRows(apiRef);
|
|
385
387
|
if (!visibleRows.range || !apiRef.current.isCellSelected(id, field)) {
|
|
386
388
|
return classes;
|
|
387
389
|
}
|
|
@@ -430,7 +432,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
430
432
|
newClasses.push(gridClasses['cell--rangeRight']);
|
|
431
433
|
}
|
|
432
434
|
return newClasses;
|
|
433
|
-
}, [apiRef
|
|
435
|
+
}, [apiRef]);
|
|
434
436
|
const canUpdateFocus = React.useCallback((initialValue, {
|
|
435
437
|
event,
|
|
436
438
|
cell
|
|
@@ -451,6 +453,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
451
453
|
if (apiRef.current.getSelectedCellsAsArray().length <= 1) {
|
|
452
454
|
return value;
|
|
453
455
|
}
|
|
456
|
+
const sortedRowIds = gridSortedRowIdsSelector(apiRef.current.state);
|
|
454
457
|
const cellSelectionModel = apiRef.current.getCellSelectionModel();
|
|
455
458
|
const unsortedSelectedRowIds = Object.keys(cellSelectionModel);
|
|
456
459
|
const sortedSelectedRowIds = sortedRowIds.filter(id => unsortedSelectedRowIds.includes(`${id}`));
|
|
@@ -476,7 +479,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
476
479
|
return acc === '' ? rowString : [acc, rowString].join('\r\n');
|
|
477
480
|
}, '');
|
|
478
481
|
return copyData;
|
|
479
|
-
}, [apiRef, ignoreValueFormatter, clipboardCopyCellDelimiter
|
|
482
|
+
}, [apiRef, ignoreValueFormatter, clipboardCopyCellDelimiter]);
|
|
480
483
|
useGridRegisterPipeProcessor(apiRef, 'isCellSelected', checkIfCellIsSelected);
|
|
481
484
|
useGridRegisterPipeProcessor(apiRef, 'cellClassName', addClassesToCells);
|
|
482
485
|
useGridRegisterPipeProcessor(apiRef, 'canUpdateFocus', canUpdateFocus);
|
|
@@ -75,7 +75,9 @@ export const filterRowTreeFromGroupingColumns = params => {
|
|
|
75
75
|
isPassingFiltering = passFilterLogic(allResults.map(result => result.passingFilterItems), allResults.map(result => result.passingQuickFilterValues), filterModel, params.apiRef, filterCache);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
if (!isPassingFiltering) {
|
|
79
|
+
filteredRowsLookup[node.id] = false;
|
|
80
|
+
}
|
|
79
81
|
if (!isPassingFiltering) {
|
|
80
82
|
return 0;
|
|
81
83
|
}
|
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 = "MTczODg4MjgwMDAwMA==";
|
|
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
|
|
@@ -123,7 +123,7 @@ const addFooterRows = ({
|
|
|
123
123
|
}
|
|
124
124
|
};
|
|
125
125
|
const updateRootGroupFooter = groupNode => {
|
|
126
|
-
const shouldHaveFooter = hasAggregationRule && getAggregationPosition(groupNode) === 'footer';
|
|
126
|
+
const shouldHaveFooter = hasAggregationRule && getAggregationPosition(groupNode) === 'footer' && groupNode.children.length > 0;
|
|
127
127
|
if (shouldHaveFooter) {
|
|
128
128
|
const rowId = getAggregationFooterRowIdFromGroupId(null);
|
|
129
129
|
newGroupingParams = (0, _internals2.addPinnedRow)({
|
|
@@ -41,7 +41,6 @@ const useGridAggregation = (apiRef, props) => {
|
|
|
41
41
|
const currentModel = (0, _gridAggregationSelectors.gridAggregationModelSelector)(apiRef);
|
|
42
42
|
if (currentModel !== model) {
|
|
43
43
|
apiRef.current.setState((0, _gridAggregationUtils.mergeStateWithAggregationModel)(model));
|
|
44
|
-
apiRef.current.forceUpdate();
|
|
45
44
|
}
|
|
46
45
|
}, [apiRef]);
|
|
47
46
|
const applyAggregation = React.useCallback(() => {
|
|
@@ -95,7 +94,6 @@ const useGridAggregation = (apiRef, props) => {
|
|
|
95
94
|
|
|
96
95
|
// Re-apply the column hydration to wrap / unwrap the aggregated columns
|
|
97
96
|
if (!(0, _gridAggregationUtils.areAggregationRulesEqual)(rulesOnLastColumnHydration, aggregationRules)) {
|
|
98
|
-
apiRef.current.caches.aggregation.rulesOnLastColumnHydration = aggregationRules;
|
|
99
97
|
apiRef.current.requestPipeProcessorsApplication('hydrateColumns');
|
|
100
98
|
}
|
|
101
99
|
}, [apiRef, applyAggregation, props.aggregationFunctions, props.disableAggregation, props.unstable_dataSource]);
|
|
@@ -25,13 +25,10 @@ const AUTO_SCROLL_SPEED = 20; // The speed to scroll once the mouse enters the s
|
|
|
25
25
|
|
|
26
26
|
const useGridCellSelection = (apiRef, props) => {
|
|
27
27
|
const hasRootReference = apiRef.current.rootElementRef.current !== null;
|
|
28
|
-
const visibleRows = (0, _internals.useGridVisibleRows)(apiRef, props);
|
|
29
28
|
const cellWithVirtualFocus = React.useRef(null);
|
|
30
29
|
const lastMouseDownCell = React.useRef(null);
|
|
31
30
|
const mousePosition = React.useRef(null);
|
|
32
31
|
const autoScrollRAF = React.useRef(null);
|
|
33
|
-
const sortedRowIds = (0, _xDataGridPro.useGridSelector)(apiRef, _xDataGridPro.gridSortedRowIdsSelector);
|
|
34
|
-
const dimensions = (0, _xDataGridPro.useGridSelector)(apiRef, _xDataGridPro.gridDimensionsSelector);
|
|
35
32
|
const totalHeaderHeight = (0, _internals.getTotalHeaderHeight)(apiRef, props);
|
|
36
33
|
const ignoreValueFormatterProp = props.ignoreValueFormatterDuringExport;
|
|
37
34
|
const ignoreValueFormatter = (typeof ignoreValueFormatterProp === 'object' ? ignoreValueFormatterProp?.clipboardExport : ignoreValueFormatterProp) || false;
|
|
@@ -85,6 +82,7 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
85
82
|
finalEndColumnIndex = startColumnIndex;
|
|
86
83
|
}
|
|
87
84
|
const visibleColumns = apiRef.current.getVisibleColumns();
|
|
85
|
+
const visibleRows = (0, _internals.getVisibleRows)(apiRef);
|
|
88
86
|
const rowsInRange = visibleRows.rows.slice(finalStartRowIndex, finalEndRowIndex + 1);
|
|
89
87
|
const columnsInRange = visibleColumns.slice(finalStartColumnIndex, finalEndColumnIndex + 1);
|
|
90
88
|
const newModel = keepOtherSelected ? (0, _extends2.default)({}, apiRef.current.getCellSelectionModel()) : {};
|
|
@@ -97,7 +95,7 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
97
95
|
}, {});
|
|
98
96
|
});
|
|
99
97
|
apiRef.current.setCellSelectionModel(newModel);
|
|
100
|
-
}, [apiRef
|
|
98
|
+
}, [apiRef]);
|
|
101
99
|
const getSelectedCellsAsArray = React.useCallback(() => {
|
|
102
100
|
const selectionModel = apiRef.current.getCellSelectionModel();
|
|
103
101
|
const currentVisibleRows = (0, _internals.getVisibleRows)(apiRef, props);
|
|
@@ -195,6 +193,7 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
195
193
|
if (!mousePosition.current || !apiRef.current.virtualScrollerRef?.current) {
|
|
196
194
|
return;
|
|
197
195
|
}
|
|
196
|
+
const dimensions = (0, _xDataGridPro.gridDimensionsSelector)(apiRef.current.state);
|
|
198
197
|
const {
|
|
199
198
|
x: mouseX,
|
|
200
199
|
y: mouseY
|
|
@@ -237,7 +236,7 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
237
236
|
autoScrollRAF.current = requestAnimationFrame(autoScroll);
|
|
238
237
|
}
|
|
239
238
|
autoScroll();
|
|
240
|
-
}, [apiRef,
|
|
239
|
+
}, [apiRef, totalHeaderHeight]);
|
|
241
240
|
const handleCellMouseOver = React.useCallback((params, event) => {
|
|
242
241
|
if (!lastMouseDownCell.current) {
|
|
243
242
|
return;
|
|
@@ -254,6 +253,7 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
254
253
|
if (!virtualScrollerRect) {
|
|
255
254
|
return;
|
|
256
255
|
}
|
|
256
|
+
const dimensions = (0, _xDataGridPro.gridDimensionsSelector)(apiRef.current.state);
|
|
257
257
|
const {
|
|
258
258
|
x,
|
|
259
259
|
y
|
|
@@ -279,7 +279,7 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
279
279
|
// Mouse has left the sensitivity area while auto scroll is on
|
|
280
280
|
stopAutoScroll();
|
|
281
281
|
}
|
|
282
|
-
}, [apiRef, startAutoScroll, stopAutoScroll, totalHeaderHeight
|
|
282
|
+
}, [apiRef, startAutoScroll, stopAutoScroll, totalHeaderHeight]);
|
|
283
283
|
const handleCellClick = (0, _useEventCallback.default)((params, event) => {
|
|
284
284
|
const {
|
|
285
285
|
id,
|
|
@@ -339,6 +339,7 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
339
339
|
} else if (event.key === 'ArrowLeft') {
|
|
340
340
|
endColumnIndex -= 1;
|
|
341
341
|
}
|
|
342
|
+
const visibleRows = (0, _internals.getVisibleRows)(apiRef);
|
|
342
343
|
if (endRowIndex < 0 || endRowIndex >= visibleRows.rows.length) {
|
|
343
344
|
return;
|
|
344
345
|
}
|
|
@@ -391,6 +392,7 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
391
392
|
id,
|
|
392
393
|
field
|
|
393
394
|
}) => {
|
|
395
|
+
const visibleRows = (0, _internals.getVisibleRows)(apiRef);
|
|
394
396
|
if (!visibleRows.range || !apiRef.current.isCellSelected(id, field)) {
|
|
395
397
|
return classes;
|
|
396
398
|
}
|
|
@@ -439,7 +441,7 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
439
441
|
newClasses.push(_xDataGridPro.gridClasses['cell--rangeRight']);
|
|
440
442
|
}
|
|
441
443
|
return newClasses;
|
|
442
|
-
}, [apiRef
|
|
444
|
+
}, [apiRef]);
|
|
443
445
|
const canUpdateFocus = React.useCallback((initialValue, {
|
|
444
446
|
event,
|
|
445
447
|
cell
|
|
@@ -460,6 +462,7 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
460
462
|
if (apiRef.current.getSelectedCellsAsArray().length <= 1) {
|
|
461
463
|
return value;
|
|
462
464
|
}
|
|
465
|
+
const sortedRowIds = (0, _xDataGridPro.gridSortedRowIdsSelector)(apiRef.current.state);
|
|
463
466
|
const cellSelectionModel = apiRef.current.getCellSelectionModel();
|
|
464
467
|
const unsortedSelectedRowIds = Object.keys(cellSelectionModel);
|
|
465
468
|
const sortedSelectedRowIds = sortedRowIds.filter(id => unsortedSelectedRowIds.includes(`${id}`));
|
|
@@ -485,7 +488,7 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
485
488
|
return acc === '' ? rowString : [acc, rowString].join('\r\n');
|
|
486
489
|
}, '');
|
|
487
490
|
return copyData;
|
|
488
|
-
}, [apiRef, ignoreValueFormatter, clipboardCopyCellDelimiter
|
|
491
|
+
}, [apiRef, ignoreValueFormatter, clipboardCopyCellDelimiter]);
|
|
489
492
|
(0, _internals.useGridRegisterPipeProcessor)(apiRef, 'isCellSelected', checkIfCellIsSelected);
|
|
490
493
|
(0, _internals.useGridRegisterPipeProcessor)(apiRef, 'cellClassName', addClassesToCells);
|
|
491
494
|
(0, _internals.useGridRegisterPipeProcessor)(apiRef, 'canUpdateFocus', canUpdateFocus);
|
|
@@ -102,7 +102,9 @@ const filterRowTreeFromGroupingColumns = params => {
|
|
|
102
102
|
isPassingFiltering = (0, _internals.passFilterLogic)(allResults.map(result => result.passingFilterItems), allResults.map(result => result.passingQuickFilterValues), filterModel, params.apiRef, filterCache);
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
|
|
105
|
+
if (!isPassingFiltering) {
|
|
106
|
+
filteredRowsLookup[node.id] = false;
|
|
107
|
+
}
|
|
106
108
|
if (!isPassingFiltering) {
|
|
107
109
|
return 0;
|
|
108
110
|
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
|
+
import { GridApiCommon } from '@mui/x-data-grid';
|
|
1
3
|
import { GridApiPremium } from '../../models/gridApiPremium';
|
|
2
|
-
export declare const useGridApiContext: () =>
|
|
4
|
+
export declare const useGridApiContext: <Api extends GridApiCommon = GridApiPremium>() => RefObject<Api>;
|
package/index.js
CHANGED
|
@@ -20,6 +20,10 @@ const configuration = {
|
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
const releaseInfo = getReleaseInfo();
|
|
23
|
+
const watermark = /*#__PURE__*/_jsx(Watermark, {
|
|
24
|
+
packageName: "x-data-grid-premium",
|
|
25
|
+
releaseInfo: releaseInfo
|
|
26
|
+
});
|
|
23
27
|
let dataGridPremiumPropValidators;
|
|
24
28
|
if (process.env.NODE_ENV !== 'production') {
|
|
25
29
|
dataGridPremiumPropValidators = [...propValidatorsDataGrid, ...propValidatorsDataGridPro];
|
|
@@ -41,10 +45,7 @@ const DataGridPremiumRaw = forwardRef(function DataGridPremium(inProps, ref) {
|
|
|
41
45
|
sx: props.sx
|
|
42
46
|
}, props.slotProps?.root, {
|
|
43
47
|
ref: ref,
|
|
44
|
-
children:
|
|
45
|
-
packageName: "x-data-grid-premium",
|
|
46
|
-
releaseInfo: releaseInfo
|
|
47
|
-
})
|
|
48
|
+
children: watermark
|
|
48
49
|
}))
|
|
49
50
|
});
|
|
50
51
|
});
|
|
@@ -33,7 +33,6 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
33
33
|
/**
|
|
34
34
|
* Register all state initializers here.
|
|
35
35
|
*/
|
|
36
|
-
useGridInitializeState(dimensionsStateInitializer, apiRef, props);
|
|
37
36
|
useGridInitializeState(headerFilteringStateInitializer, apiRef, props);
|
|
38
37
|
useGridInitializeState(rowGroupingStateInitializer, apiRef, props);
|
|
39
38
|
useGridInitializeState(aggregationStateInitializer, apiRef, props);
|
|
@@ -54,11 +53,12 @@ export const useDataGridPremiumComponent = (inputApiRef, props) => {
|
|
|
54
53
|
useGridInitializeState(densityStateInitializer, apiRef, props);
|
|
55
54
|
useGridInitializeState(columnReorderStateInitializer, apiRef, props);
|
|
56
55
|
useGridInitializeState(columnResizeStateInitializer, apiRef, props);
|
|
57
|
-
useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
|
|
58
56
|
useGridInitializeState(columnMenuStateInitializer, apiRef, props);
|
|
59
57
|
useGridInitializeState(columnGroupsStateInitializer, apiRef, props);
|
|
60
58
|
useGridInitializeState(virtualizationStateInitializer, apiRef, props);
|
|
61
59
|
useGridInitializeState(dataSourceStateInitializer, apiRef, props);
|
|
60
|
+
useGridInitializeState(dimensionsStateInitializer, apiRef, props);
|
|
61
|
+
useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
|
|
62
62
|
useGridInitializeState(listViewStateInitializer, apiRef, props);
|
|
63
63
|
useGridRowGrouping(apiRef, props);
|
|
64
64
|
useGridHeaderFiltering(apiRef, props);
|
|
@@ -111,7 +111,7 @@ export const addFooterRows = ({
|
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
113
|
const updateRootGroupFooter = groupNode => {
|
|
114
|
-
const shouldHaveFooter = hasAggregationRule && getAggregationPosition(groupNode) === 'footer';
|
|
114
|
+
const shouldHaveFooter = hasAggregationRule && getAggregationPosition(groupNode) === 'footer' && groupNode.children.length > 0;
|
|
115
115
|
if (shouldHaveFooter) {
|
|
116
116
|
const rowId = getAggregationFooterRowIdFromGroupId(null);
|
|
117
117
|
newGroupingParams = addPinnedRow({
|
|
@@ -32,7 +32,6 @@ export const useGridAggregation = (apiRef, props) => {
|
|
|
32
32
|
const currentModel = gridAggregationModelSelector(apiRef);
|
|
33
33
|
if (currentModel !== model) {
|
|
34
34
|
apiRef.current.setState(mergeStateWithAggregationModel(model));
|
|
35
|
-
apiRef.current.forceUpdate();
|
|
36
35
|
}
|
|
37
36
|
}, [apiRef]);
|
|
38
37
|
const applyAggregation = React.useCallback(() => {
|
|
@@ -86,7 +85,6 @@ export const useGridAggregation = (apiRef, props) => {
|
|
|
86
85
|
|
|
87
86
|
// Re-apply the column hydration to wrap / unwrap the aggregated columns
|
|
88
87
|
if (!areAggregationRulesEqual(rulesOnLastColumnHydration, aggregationRules)) {
|
|
89
|
-
apiRef.current.caches.aggregation.rulesOnLastColumnHydration = aggregationRules;
|
|
90
88
|
apiRef.current.requestPipeProcessorsApplication('hydrateColumns');
|
|
91
89
|
}
|
|
92
90
|
}, [apiRef, applyAggregation, props.aggregationFunctions, props.disableAggregation, props.unstable_dataSource]);
|
|
@@ -2,8 +2,8 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import ownerDocument from '@mui/utils/ownerDocument';
|
|
4
4
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
5
|
-
import { getTotalHeaderHeight, getVisibleRows, isNavigationKey, serializeCellValue, useGridRegisterPipeProcessor
|
|
6
|
-
import { useGridApiEventHandler, useGridApiMethod, GRID_ACTIONS_COLUMN_TYPE, GRID_CHECKBOX_SELECTION_COL_DEF, GRID_DETAIL_PANEL_TOGGLE_FIELD, gridClasses, gridFocusCellSelector, GRID_REORDER_COL_DEF,
|
|
5
|
+
import { getTotalHeaderHeight, getVisibleRows, isNavigationKey, serializeCellValue, useGridRegisterPipeProcessor } from '@mui/x-data-grid-pro/internals';
|
|
6
|
+
import { useGridApiEventHandler, useGridApiMethod, GRID_ACTIONS_COLUMN_TYPE, GRID_CHECKBOX_SELECTION_COL_DEF, GRID_DETAIL_PANEL_TOGGLE_FIELD, gridClasses, gridFocusCellSelector, GRID_REORDER_COL_DEF, gridSortedRowIdsSelector, gridDimensionsSelector } from '@mui/x-data-grid-pro';
|
|
7
7
|
import { gridCellSelectionStateSelector } from "./gridCellSelectionSelector.js";
|
|
8
8
|
export const cellSelectionStateInitializer = (state, props) => _extends({}, state, {
|
|
9
9
|
cellSelection: _extends({}, props.cellSelectionModel ?? props.initialState?.cellSelection)
|
|
@@ -16,13 +16,10 @@ const AUTO_SCROLL_SPEED = 20; // The speed to scroll once the mouse enters the s
|
|
|
16
16
|
|
|
17
17
|
export const useGridCellSelection = (apiRef, props) => {
|
|
18
18
|
const hasRootReference = apiRef.current.rootElementRef.current !== null;
|
|
19
|
-
const visibleRows = useGridVisibleRows(apiRef, props);
|
|
20
19
|
const cellWithVirtualFocus = React.useRef(null);
|
|
21
20
|
const lastMouseDownCell = React.useRef(null);
|
|
22
21
|
const mousePosition = React.useRef(null);
|
|
23
22
|
const autoScrollRAF = React.useRef(null);
|
|
24
|
-
const sortedRowIds = useGridSelector(apiRef, gridSortedRowIdsSelector);
|
|
25
|
-
const dimensions = useGridSelector(apiRef, gridDimensionsSelector);
|
|
26
23
|
const totalHeaderHeight = getTotalHeaderHeight(apiRef, props);
|
|
27
24
|
const ignoreValueFormatterProp = props.ignoreValueFormatterDuringExport;
|
|
28
25
|
const ignoreValueFormatter = (typeof ignoreValueFormatterProp === 'object' ? ignoreValueFormatterProp?.clipboardExport : ignoreValueFormatterProp) || false;
|
|
@@ -76,6 +73,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
76
73
|
finalEndColumnIndex = startColumnIndex;
|
|
77
74
|
}
|
|
78
75
|
const visibleColumns = apiRef.current.getVisibleColumns();
|
|
76
|
+
const visibleRows = getVisibleRows(apiRef);
|
|
79
77
|
const rowsInRange = visibleRows.rows.slice(finalStartRowIndex, finalEndRowIndex + 1);
|
|
80
78
|
const columnsInRange = visibleColumns.slice(finalStartColumnIndex, finalEndColumnIndex + 1);
|
|
81
79
|
const newModel = keepOtherSelected ? _extends({}, apiRef.current.getCellSelectionModel()) : {};
|
|
@@ -88,7 +86,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
88
86
|
}, {});
|
|
89
87
|
});
|
|
90
88
|
apiRef.current.setCellSelectionModel(newModel);
|
|
91
|
-
}, [apiRef
|
|
89
|
+
}, [apiRef]);
|
|
92
90
|
const getSelectedCellsAsArray = React.useCallback(() => {
|
|
93
91
|
const selectionModel = apiRef.current.getCellSelectionModel();
|
|
94
92
|
const currentVisibleRows = getVisibleRows(apiRef, props);
|
|
@@ -186,6 +184,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
186
184
|
if (!mousePosition.current || !apiRef.current.virtualScrollerRef?.current) {
|
|
187
185
|
return;
|
|
188
186
|
}
|
|
187
|
+
const dimensions = gridDimensionsSelector(apiRef.current.state);
|
|
189
188
|
const {
|
|
190
189
|
x: mouseX,
|
|
191
190
|
y: mouseY
|
|
@@ -228,7 +227,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
228
227
|
autoScrollRAF.current = requestAnimationFrame(autoScroll);
|
|
229
228
|
}
|
|
230
229
|
autoScroll();
|
|
231
|
-
}, [apiRef,
|
|
230
|
+
}, [apiRef, totalHeaderHeight]);
|
|
232
231
|
const handleCellMouseOver = React.useCallback((params, event) => {
|
|
233
232
|
if (!lastMouseDownCell.current) {
|
|
234
233
|
return;
|
|
@@ -245,6 +244,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
245
244
|
if (!virtualScrollerRect) {
|
|
246
245
|
return;
|
|
247
246
|
}
|
|
247
|
+
const dimensions = gridDimensionsSelector(apiRef.current.state);
|
|
248
248
|
const {
|
|
249
249
|
x,
|
|
250
250
|
y
|
|
@@ -270,7 +270,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
270
270
|
// Mouse has left the sensitivity area while auto scroll is on
|
|
271
271
|
stopAutoScroll();
|
|
272
272
|
}
|
|
273
|
-
}, [apiRef, startAutoScroll, stopAutoScroll, totalHeaderHeight
|
|
273
|
+
}, [apiRef, startAutoScroll, stopAutoScroll, totalHeaderHeight]);
|
|
274
274
|
const handleCellClick = useEventCallback((params, event) => {
|
|
275
275
|
const {
|
|
276
276
|
id,
|
|
@@ -330,6 +330,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
330
330
|
} else if (event.key === 'ArrowLeft') {
|
|
331
331
|
endColumnIndex -= 1;
|
|
332
332
|
}
|
|
333
|
+
const visibleRows = getVisibleRows(apiRef);
|
|
333
334
|
if (endRowIndex < 0 || endRowIndex >= visibleRows.rows.length) {
|
|
334
335
|
return;
|
|
335
336
|
}
|
|
@@ -382,6 +383,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
382
383
|
id,
|
|
383
384
|
field
|
|
384
385
|
}) => {
|
|
386
|
+
const visibleRows = getVisibleRows(apiRef);
|
|
385
387
|
if (!visibleRows.range || !apiRef.current.isCellSelected(id, field)) {
|
|
386
388
|
return classes;
|
|
387
389
|
}
|
|
@@ -430,7 +432,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
430
432
|
newClasses.push(gridClasses['cell--rangeRight']);
|
|
431
433
|
}
|
|
432
434
|
return newClasses;
|
|
433
|
-
}, [apiRef
|
|
435
|
+
}, [apiRef]);
|
|
434
436
|
const canUpdateFocus = React.useCallback((initialValue, {
|
|
435
437
|
event,
|
|
436
438
|
cell
|
|
@@ -451,6 +453,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
451
453
|
if (apiRef.current.getSelectedCellsAsArray().length <= 1) {
|
|
452
454
|
return value;
|
|
453
455
|
}
|
|
456
|
+
const sortedRowIds = gridSortedRowIdsSelector(apiRef.current.state);
|
|
454
457
|
const cellSelectionModel = apiRef.current.getCellSelectionModel();
|
|
455
458
|
const unsortedSelectedRowIds = Object.keys(cellSelectionModel);
|
|
456
459
|
const sortedSelectedRowIds = sortedRowIds.filter(id => unsortedSelectedRowIds.includes(`${id}`));
|
|
@@ -476,7 +479,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
476
479
|
return acc === '' ? rowString : [acc, rowString].join('\r\n');
|
|
477
480
|
}, '');
|
|
478
481
|
return copyData;
|
|
479
|
-
}, [apiRef, ignoreValueFormatter, clipboardCopyCellDelimiter
|
|
482
|
+
}, [apiRef, ignoreValueFormatter, clipboardCopyCellDelimiter]);
|
|
480
483
|
useGridRegisterPipeProcessor(apiRef, 'isCellSelected', checkIfCellIsSelected);
|
|
481
484
|
useGridRegisterPipeProcessor(apiRef, 'cellClassName', addClassesToCells);
|
|
482
485
|
useGridRegisterPipeProcessor(apiRef, 'canUpdateFocus', canUpdateFocus);
|
|
@@ -75,7 +75,9 @@ export const filterRowTreeFromGroupingColumns = params => {
|
|
|
75
75
|
isPassingFiltering = passFilterLogic(allResults.map(result => result.passingFilterItems), allResults.map(result => result.passingQuickFilterValues), filterModel, params.apiRef, filterCache);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
if (!isPassingFiltering) {
|
|
79
|
+
filteredRowsLookup[node.id] = false;
|
|
80
|
+
}
|
|
79
81
|
if (!isPassingFiltering) {
|
|
80
82
|
return 0;
|
|
81
83
|
}
|
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 = "MTczODg4MjgwMDAwMA==";
|
|
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": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.11",
|
|
4
4
|
"description": "The Premium plan edition of the Data Grid Components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"exceljs": "^4.4.0",
|
|
41
41
|
"prop-types": "^15.8.1",
|
|
42
42
|
"reselect": "^5.1.1",
|
|
43
|
-
"@mui/x-data-grid": "8.0.0-alpha.
|
|
44
|
-
"@mui/x-data-grid-pro": "8.0.0-alpha.
|
|
45
|
-
"@mui/x-license": "8.0.0-alpha.
|
|
46
|
-
"@mui/x-internals": "8.0.0-alpha.
|
|
43
|
+
"@mui/x-data-grid": "8.0.0-alpha.11",
|
|
44
|
+
"@mui/x-data-grid-pro": "8.0.0-alpha.11",
|
|
45
|
+
"@mui/x-license": "8.0.0-alpha.11",
|
|
46
|
+
"@mui/x-internals": "8.0.0-alpha.11"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@emotion/react": "^11.9.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 = "MTczODg4MjgwMDAwMA==";
|
|
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
|