@mui/x-data-grid-premium 7.12.1 → 7.14.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 +162 -1
- package/DataGridPremium/DataGridPremium.js +11 -1
- package/components/GridGroupingColumnLeafCell.js +7 -2
- package/components/GridGroupingCriteriaCell.js +7 -2
- package/esm/DataGridPremium/DataGridPremium.js +11 -1
- package/esm/components/GridGroupingColumnLeafCell.js +7 -2
- package/esm/components/GridGroupingCriteriaCell.js +7 -2
- package/esm/hooks/features/cellSelection/useGridCellSelection.js +1 -1
- package/esm/hooks/features/clipboard/useGridClipboardImport.js +7 -4
- package/esm/hooks/features/rowGrouping/gridRowGroupingUtils.js +7 -0
- package/esm/hooks/features/rows/index.js +1 -0
- package/esm/hooks/features/rows/useGridRowAriaAttributes.js +8 -0
- package/esm/hooks/utils/useGridAriaAttributes.js +15 -0
- package/esm/utils/releaseInfo.js +1 -1
- package/hooks/features/cellSelection/useGridCellSelection.js +1 -1
- package/hooks/features/clipboard/useGridClipboardImport.js +7 -4
- package/hooks/features/rowGrouping/gridRowGroupingUtils.js +7 -0
- package/hooks/features/rows/index.d.ts +1 -0
- package/hooks/features/rows/index.js +16 -0
- package/hooks/features/rows/useGridRowAriaAttributes.d.ts +1 -0
- package/hooks/features/rows/useGridRowAriaAttributes.js +15 -0
- package/hooks/utils/useGridAriaAttributes.d.ts +2 -0
- package/hooks/utils/useGridAriaAttributes.js +23 -0
- package/index.js +1 -1
- package/models/dataGridPremiumProps.d.ts +6 -0
- package/modern/DataGridPremium/DataGridPremium.js +11 -1
- package/modern/components/GridGroupingColumnLeafCell.js +7 -2
- package/modern/components/GridGroupingCriteriaCell.js +7 -2
- package/modern/hooks/features/cellSelection/useGridCellSelection.js +1 -1
- package/modern/hooks/features/clipboard/useGridClipboardImport.js +7 -4
- package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.js +7 -0
- package/modern/hooks/features/rows/index.js +1 -0
- package/modern/hooks/features/rows/useGridRowAriaAttributes.js +8 -0
- package/modern/hooks/utils/useGridAriaAttributes.js +15 -0
- package/modern/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/package.json +7 -7
- package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,167 @@
|
|
|
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.14.0
|
|
7
|
+
|
|
8
|
+
_Aug 23, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 💫 Allow [filtering the axis on zoom](https://mui.com/x/react-charts/zoom-and-pan/#zoom-filtering), making the axis adapt by removing values outside the view.
|
|
13
|
+
|
|
14
|
+
<img width="600" src="https://github.com/user-attachments/assets/e65bbd00-d2a8-4136-81cd-3598f1373c16" alt="filtering the axis on zoom" />
|
|
15
|
+
|
|
16
|
+
- 📊 Improve bar chart performances
|
|
17
|
+
- 🌍 Improve Czech (cs-CZ) and Hebrew (he-IL) locales on the Data Grid
|
|
18
|
+
- 🌍 Improve Chinese (zh-HK), Hebrew (he-IL), and Vietnamese (vi-VN) locales on the Date and Time Pickers
|
|
19
|
+
- 🐞 Bugfixes
|
|
20
|
+
|
|
21
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
22
|
+
|
|
23
|
+
### Data Grid
|
|
24
|
+
|
|
25
|
+
#### `@mui/x-data-grid@7.14.0`
|
|
26
|
+
|
|
27
|
+
- [DataGrid] Use readonly array result for `getTreeDataPath` (#11743) @pcorpet
|
|
28
|
+
- [DataGrid] Use `event.key` for `Tab` and `Escape` keys (#14170) @k-rajat19
|
|
29
|
+
- [DataGrid] Introduce selectors with arguments (#14236) @MBilalShafi
|
|
30
|
+
- [DataGrid] include `api` in `gridCellParams` interface (#14201) @k-rajat19
|
|
31
|
+
- [l10n] Improve Czech (cs-CZ) locale (#14135) @chirimiri22
|
|
32
|
+
- [l10n] Improve Hebrew (he-IL) locale (#14287) @rotembarsela
|
|
33
|
+
|
|
34
|
+
#### `@mui/x-data-grid-pro@7.14.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
35
|
+
|
|
36
|
+
Same changes as in `@mui/x-data-grid@7.14.0`.
|
|
37
|
+
|
|
38
|
+
#### `@mui/x-data-grid-premium@7.14.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
39
|
+
|
|
40
|
+
Same changes as in `@mui/x-data-grid-pro@7.14.0`, plus:
|
|
41
|
+
|
|
42
|
+
- [DataGridPremium] Fix clipboard paste not working for a single cell on non-first page (#14261) @arminmeh
|
|
43
|
+
- [DataGridPremium] Fix `onCellSelectionModelChange` not triggered when additional cell range is selected (#14199) @arminmeh
|
|
44
|
+
|
|
45
|
+
### Date and Time Pickers
|
|
46
|
+
|
|
47
|
+
#### `@mui/x-date-pickers@7.14.0`
|
|
48
|
+
|
|
49
|
+
- [l10n] Improve Chinese (zh-HK) locale (#13289) @yeeharn
|
|
50
|
+
- [l10n] Improve Hebrew (he-IL) locale (#14287) @rotembarsela
|
|
51
|
+
- [l10n] Improve Vietnamese (vi-VN) locale (#14238) @locnbk2002
|
|
52
|
+
- [TimePicker] Handle `Space` and `Enter` on the `TimeClock` component @arthurbalduini
|
|
53
|
+
|
|
54
|
+
#### `@mui/x-date-pickers-pro@7.14.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
55
|
+
|
|
56
|
+
Same changes as in `@mui/x-date-pickers@7.14.0`.
|
|
57
|
+
|
|
58
|
+
### Charts
|
|
59
|
+
|
|
60
|
+
#### `@mui/x-charts@7.14.0`
|
|
61
|
+
|
|
62
|
+
- [charts] Fix grid overflow with zooming (#14280) @alexfauquette
|
|
63
|
+
- [charts] Improve bar chart performances (#14278) @alexfauquette
|
|
64
|
+
- [charts] Test pointer events (#14042) @alexfauquette
|
|
65
|
+
- [charts] Use `isPointInside` function for both graphs and axis (#14222) @JCQuintas
|
|
66
|
+
|
|
67
|
+
#### `@mui/x-charts-pro@7.0.0-alpha.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
68
|
+
|
|
69
|
+
Same changes as in `@mui/x-charts@7.14.0`, plus:
|
|
70
|
+
|
|
71
|
+
- [charts-pro] Zoom axis filtering (#14121) @JCQuintas
|
|
72
|
+
|
|
73
|
+
### Docs
|
|
74
|
+
|
|
75
|
+
- [docs] Consistent use of UTC and timezones (#14250) @oliviertassinari
|
|
76
|
+
- [docs] Fix missing leading slashes in URLs (#14249) @oliviertassinari
|
|
77
|
+
- [docs] Dash usage revision on pickers pages (#14260) @arthurbalduini
|
|
78
|
+
|
|
79
|
+
### Core
|
|
80
|
+
|
|
81
|
+
- [core] Follow JSDocs convention @oliviertassinari
|
|
82
|
+
- [core] Prepare for material v6 (#14143) @LukasTy
|
|
83
|
+
- [code-infra] Set up `eslint-plugin-testing-library` (#14232) @LukasTy
|
|
84
|
+
- [infra] Updated mui-x roadmap links with new project URL (#14271) @michelengelen
|
|
85
|
+
|
|
86
|
+
## 7.13.0
|
|
87
|
+
|
|
88
|
+
_Aug 16, 2024_
|
|
89
|
+
|
|
90
|
+
We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
91
|
+
|
|
92
|
+
- 💫 Allow to [edit the label](https://mui.com/x/react-tree-view/rich-tree-view/editing/) of Tree View's items.
|
|
93
|
+
|
|
94
|
+
<img width="344" src="https://github.com/user-attachments/assets/1a6cf765-2dc8-4906-bd93-139086eed148" alt="Item label editing" />
|
|
95
|
+
|
|
96
|
+
- 🔧 Improve rows accessibility on the Data Grid features "Tree Data" and "Row Grouping". Certain "Row Grouping" accessibility updates will only be applied if experimental feature flag is enabled. See the [documentation](https://mui.com/x/react-data-grid/row-grouping/#accessibility-changes-in-v8) for more information.
|
|
97
|
+
- 🌍 Improve Vietnamese (vi-VN) locale on the Data Grid
|
|
98
|
+
- 🐞 Bugfixes
|
|
99
|
+
|
|
100
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
101
|
+
|
|
102
|
+
### Data Grid
|
|
103
|
+
|
|
104
|
+
#### `@mui/x-data-grid@7.13.0`
|
|
105
|
+
|
|
106
|
+
- [DataGrid] Fix CSV export for `null` and `undefined` values (#14166) @k-rajat19
|
|
107
|
+
- [DataGrid] Fix error logged during skeleton loading with nested data grid (#14186) @KenanYusuf
|
|
108
|
+
- [DataGrid] Remove needless check in `useGridStateInitialization` (#14181) @k-rajat19
|
|
109
|
+
- [DataGrid] Add recipe for persisting filters in local storage (#14208) @cherniavskii
|
|
110
|
+
- [l10n] Improve Vietnamese (vi-VN) locale (#14216) @hungnd-casso
|
|
111
|
+
|
|
112
|
+
#### `@mui/x-data-grid-pro@7.13.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
113
|
+
|
|
114
|
+
Same changes as in `@mui/x-data-grid@7.13.0`, plus:
|
|
115
|
+
|
|
116
|
+
- [DataGridPro] Fix Tree Data and Row Grouping rows accessibility (#13623) @arminmeh
|
|
117
|
+
|
|
118
|
+
#### `@mui/x-data-grid-premium@7.13.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
119
|
+
|
|
120
|
+
Same changes as in `@mui/x-data-grid-pro@7.13.0`.
|
|
121
|
+
|
|
122
|
+
### Date and Time Pickers
|
|
123
|
+
|
|
124
|
+
#### `@mui/x-date-pickers@7.13.0`
|
|
125
|
+
|
|
126
|
+
- [pickers] Fix date and time merging to retain milliseconds (#14173) @LukasTy
|
|
127
|
+
|
|
128
|
+
#### `@mui/x-date-pickers-pro@7.13.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
129
|
+
|
|
130
|
+
Same changes as in `@mui/x-date-pickers@7.13.0`.
|
|
131
|
+
|
|
132
|
+
### Charts
|
|
133
|
+
|
|
134
|
+
#### `@mui/x-charts@7.13.0`
|
|
135
|
+
|
|
136
|
+
- [charts] Add `baseline` property to the `LineChart` `series` (#14153) @JCQuintas
|
|
137
|
+
- [charts] Fix issue where tooltip would disappear on mouse click (#14187) @alexfauquette
|
|
138
|
+
- [charts] Rename `CartesianContextProvider` to `CartesianProvider` (#14102) @JCQuintas
|
|
139
|
+
- [charts] Support axis with the same value for all data points (#14191) @alexfauquette
|
|
140
|
+
|
|
141
|
+
#### `@mui/x-charts-pro@7.0.0-alpha.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
142
|
+
|
|
143
|
+
Same changes as in `@mui/x-charts@7.13.0`.
|
|
144
|
+
|
|
145
|
+
### Tree View
|
|
146
|
+
|
|
147
|
+
#### `@mui/x-tree-view@7.13.0`
|
|
148
|
+
|
|
149
|
+
- [TreeView] Add label editing feature (#13388) @noraleonte
|
|
150
|
+
- [TreeView] Fix the parameters passed for the `canMoveItemToNewPosition` prop (#14176) @flaviendelangle
|
|
151
|
+
|
|
152
|
+
### Docs
|
|
153
|
+
|
|
154
|
+
- [docs] Extract dataset in the Line chart docs (#14034) @alexfauquette
|
|
155
|
+
- [docs] Remove redundant encoding in the mock data source server (#14185) @MBilalShafi
|
|
156
|
+
- [docs] Use Netflix financial results to document bar charts (#13991) @alexfauquette
|
|
157
|
+
- [docs] Remove relience of abbreviations (#14226) @oliviertassinari
|
|
158
|
+
|
|
159
|
+
### Core
|
|
160
|
+
|
|
161
|
+
- [core] Bump monorepo (#14141) @Janpot
|
|
162
|
+
- [core] Fix ESLint issue (#14207) @LukasTy
|
|
163
|
+
- [core] Fix Netlify build cache issue (#14182) @cherniavskii
|
|
164
|
+
- [code-infra] Refactor Netlify `cache-docs` plugin setup (#14105) @LukasTy
|
|
165
|
+
- [internals] Move utils needed for tree view virtualization to shared package (#14202) @flaviendelangle
|
|
166
|
+
|
|
6
167
|
## 7.12.1
|
|
7
168
|
|
|
8
169
|
_Aug 8, 2024_
|
|
@@ -51,7 +212,7 @@ Same changes as in `@mui/x-date-pickers@7.12.1`.
|
|
|
51
212
|
- [charts] Fix charts vendor publish config (#14073) @JCQuintas
|
|
52
213
|
- [charts] Move `plugins` to `PluginProvider` (#14056) @JCQuintas
|
|
53
214
|
|
|
54
|
-
#### `@mui/x-
|
|
215
|
+
#### `@mui/x-charts-pro@7.0.0-alpha.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
55
216
|
|
|
56
217
|
Same changes as in `@mui/x-charts@7.12.1`, plus:
|
|
57
218
|
|
|
@@ -15,9 +15,17 @@ var _internals = require("@mui/x-data-grid-pro/internals");
|
|
|
15
15
|
var _useDataGridPremiumComponent = require("./useDataGridPremiumComponent");
|
|
16
16
|
var _useDataGridPremiumProps = require("./useDataGridPremiumProps");
|
|
17
17
|
var _releaseInfo = require("../utils/releaseInfo");
|
|
18
|
+
var _useGridAriaAttributes = require("../hooks/utils/useGridAriaAttributes");
|
|
19
|
+
var _useGridRowAriaAttributes = require("../hooks/features/rows/useGridRowAriaAttributes");
|
|
18
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
21
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
20
22
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
|
+
const configuration = {
|
|
24
|
+
hooks: {
|
|
25
|
+
useGridAriaAttributes: _useGridAriaAttributes.useGridAriaAttributes,
|
|
26
|
+
useGridRowAriaAttributes: _useGridRowAriaAttributes.useGridRowAriaAttributes
|
|
27
|
+
}
|
|
28
|
+
};
|
|
21
29
|
const releaseInfo = (0, _releaseInfo.getReleaseInfo)();
|
|
22
30
|
let dataGridPremiumPropValidators;
|
|
23
31
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -32,6 +40,7 @@ const DataGridPremiumRaw = /*#__PURE__*/React.forwardRef(function DataGridPremiu
|
|
|
32
40
|
}
|
|
33
41
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_xDataGridPro.GridContextProvider, {
|
|
34
42
|
privateApiRef: privateApiRef,
|
|
43
|
+
configuration: configuration,
|
|
35
44
|
props: props,
|
|
36
45
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_xDataGridPro.GridRoot, (0, _extends2.default)({
|
|
37
46
|
className: props.className,
|
|
@@ -293,6 +302,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
293
302
|
* 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.
|
|
294
303
|
*/
|
|
295
304
|
experimentalFeatures: _propTypes.default.shape({
|
|
305
|
+
ariaV8: _propTypes.default.bool,
|
|
296
306
|
warnIfFocusStateIsNotSynced: _propTypes.default.bool
|
|
297
307
|
}),
|
|
298
308
|
/**
|
|
@@ -462,7 +472,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
462
472
|
/**
|
|
463
473
|
* Determines if a row can be selected.
|
|
464
474
|
* @param {GridRowParams} params With all properties from [[GridRowParams]].
|
|
465
|
-
* @returns {boolean} A boolean indicating if the
|
|
475
|
+
* @returns {boolean} A boolean indicating if the row is selectable.
|
|
466
476
|
*/
|
|
467
477
|
isRowSelectable: _propTypes.default.func,
|
|
468
478
|
/**
|
|
@@ -17,8 +17,13 @@ function GridGroupingColumnLeafCell(props) {
|
|
|
17
17
|
} = props;
|
|
18
18
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
19
19
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
20
|
-
sx: {
|
|
21
|
-
ml:
|
|
20
|
+
sx: [rootProps.rowGroupingColumnMode === 'multiple' ? {
|
|
21
|
+
ml: 1
|
|
22
|
+
} : theme => ({
|
|
23
|
+
ml: `calc(var(--DataGrid-cellOffsetMultiplier) * var(--depth) * ${theme.spacing(1)})`
|
|
24
|
+
})],
|
|
25
|
+
style: {
|
|
26
|
+
'--depth': rowNode.depth
|
|
22
27
|
},
|
|
23
28
|
children: props.formattedValue ?? props.value
|
|
24
29
|
});
|
|
@@ -70,8 +70,13 @@ function GridGroupingCriteriaCell(props) {
|
|
|
70
70
|
}
|
|
71
71
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
72
72
|
className: classes.root,
|
|
73
|
-
sx: {
|
|
74
|
-
ml:
|
|
73
|
+
sx: [rootProps.rowGroupingColumnMode === 'multiple' ? {
|
|
74
|
+
ml: 0
|
|
75
|
+
} : theme => ({
|
|
76
|
+
ml: `calc(var(--DataGrid-cellOffsetMultiplier) * var(--depth) * ${theme.spacing(1)})`
|
|
77
|
+
})],
|
|
78
|
+
style: {
|
|
79
|
+
'--depth': rowNode.depth
|
|
75
80
|
},
|
|
76
81
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
77
82
|
className: classes.toggle,
|
|
@@ -9,7 +9,15 @@ import { propValidatorsDataGrid, propValidatorsDataGridPro, validateProps } from
|
|
|
9
9
|
import { useDataGridPremiumComponent } from './useDataGridPremiumComponent';
|
|
10
10
|
import { useDataGridPremiumProps } from './useDataGridPremiumProps';
|
|
11
11
|
import { getReleaseInfo } from '../utils/releaseInfo';
|
|
12
|
+
import { useGridAriaAttributes } from '../hooks/utils/useGridAriaAttributes';
|
|
13
|
+
import { useGridRowAriaAttributes } from '../hooks/features/rows/useGridRowAriaAttributes';
|
|
12
14
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
const configuration = {
|
|
16
|
+
hooks: {
|
|
17
|
+
useGridAriaAttributes,
|
|
18
|
+
useGridRowAriaAttributes
|
|
19
|
+
}
|
|
20
|
+
};
|
|
13
21
|
const releaseInfo = getReleaseInfo();
|
|
14
22
|
let dataGridPremiumPropValidators;
|
|
15
23
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -24,6 +32,7 @@ const DataGridPremiumRaw = /*#__PURE__*/React.forwardRef(function DataGridPremiu
|
|
|
24
32
|
}
|
|
25
33
|
return /*#__PURE__*/_jsx(GridContextProvider, {
|
|
26
34
|
privateApiRef: privateApiRef,
|
|
35
|
+
configuration: configuration,
|
|
27
36
|
props: props,
|
|
28
37
|
children: /*#__PURE__*/_jsxs(GridRoot, _extends({
|
|
29
38
|
className: props.className,
|
|
@@ -285,6 +294,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
285
294
|
* 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.
|
|
286
295
|
*/
|
|
287
296
|
experimentalFeatures: PropTypes.shape({
|
|
297
|
+
ariaV8: PropTypes.bool,
|
|
288
298
|
warnIfFocusStateIsNotSynced: PropTypes.bool
|
|
289
299
|
}),
|
|
290
300
|
/**
|
|
@@ -454,7 +464,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
454
464
|
/**
|
|
455
465
|
* Determines if a row can be selected.
|
|
456
466
|
* @param {GridRowParams} params With all properties from [[GridRowParams]].
|
|
457
|
-
* @returns {boolean} A boolean indicating if the
|
|
467
|
+
* @returns {boolean} A boolean indicating if the row is selectable.
|
|
458
468
|
*/
|
|
459
469
|
isRowSelectable: PropTypes.func,
|
|
460
470
|
/**
|
|
@@ -8,8 +8,13 @@ function GridGroupingColumnLeafCell(props) {
|
|
|
8
8
|
} = props;
|
|
9
9
|
const rootProps = useGridRootProps();
|
|
10
10
|
return /*#__PURE__*/_jsx(Box, {
|
|
11
|
-
sx: {
|
|
12
|
-
ml:
|
|
11
|
+
sx: [rootProps.rowGroupingColumnMode === 'multiple' ? {
|
|
12
|
+
ml: 1
|
|
13
|
+
} : theme => ({
|
|
14
|
+
ml: `calc(var(--DataGrid-cellOffsetMultiplier) * var(--depth) * ${theme.spacing(1)})`
|
|
15
|
+
})],
|
|
16
|
+
style: {
|
|
17
|
+
'--depth': rowNode.depth
|
|
13
18
|
},
|
|
14
19
|
children: props.formattedValue ?? props.value
|
|
15
20
|
});
|
|
@@ -61,8 +61,13 @@ export function GridGroupingCriteriaCell(props) {
|
|
|
61
61
|
}
|
|
62
62
|
return /*#__PURE__*/_jsxs(Box, {
|
|
63
63
|
className: classes.root,
|
|
64
|
-
sx: {
|
|
65
|
-
ml:
|
|
64
|
+
sx: [rootProps.rowGroupingColumnMode === 'multiple' ? {
|
|
65
|
+
ml: 0
|
|
66
|
+
} : theme => ({
|
|
67
|
+
ml: `calc(var(--DataGrid-cellOffsetMultiplier) * var(--depth) * ${theme.spacing(1)})`
|
|
68
|
+
})],
|
|
69
|
+
style: {
|
|
70
|
+
'--depth': rowNode.depth
|
|
66
71
|
},
|
|
67
72
|
children: [/*#__PURE__*/_jsx("div", {
|
|
68
73
|
className: classes.toggle,
|
|
@@ -76,7 +76,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
76
76
|
const visibleColumns = apiRef.current.getVisibleColumns();
|
|
77
77
|
const rowsInRange = visibleRows.rows.slice(finalStartRowIndex, finalEndRowIndex + 1);
|
|
78
78
|
const columnsInRange = visibleColumns.slice(finalStartColumnIndex, finalEndColumnIndex + 1);
|
|
79
|
-
const newModel = keepOtherSelected ? apiRef.current.getCellSelectionModel() : {};
|
|
79
|
+
const newModel = keepOtherSelected ? _extends({}, apiRef.current.getCellSelectionModel()) : {};
|
|
80
80
|
rowsInRange.forEach(row => {
|
|
81
81
|
if (!newModel[row.id]) {
|
|
82
82
|
newModel[row.id] = {};
|
|
@@ -151,7 +151,8 @@ function defaultPasteResolver({
|
|
|
151
151
|
pastedData,
|
|
152
152
|
apiRef,
|
|
153
153
|
updateCell,
|
|
154
|
-
pagination
|
|
154
|
+
pagination,
|
|
155
|
+
paginationMode
|
|
155
156
|
}) {
|
|
156
157
|
const isSingleValuePasted = pastedData.length === 1 && pastedData[0].length === 1;
|
|
157
158
|
const cellSelectionModel = apiRef.current.getCellSelectionModel();
|
|
@@ -228,7 +229,7 @@ function defaultPasteResolver({
|
|
|
228
229
|
}
|
|
229
230
|
const selectedRowId = selectedCell.id;
|
|
230
231
|
const selectedRowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(selectedRowId);
|
|
231
|
-
const visibleRowIds = pagination ? gridPaginatedVisibleSortedGridRowIdsSelector(apiRef) : gridExpandedSortedRowIdsSelector(apiRef);
|
|
232
|
+
const visibleRowIds = pagination && paginationMode === 'client' ? gridPaginatedVisibleSortedGridRowIdsSelector(apiRef) : gridExpandedSortedRowIdsSelector(apiRef);
|
|
232
233
|
const selectedFieldIndex = visibleColumnFields.indexOf(selectedCell.field);
|
|
233
234
|
pastedData.forEach((rowData, index) => {
|
|
234
235
|
const rowId = visibleRowIds[selectedRowIndex + index];
|
|
@@ -256,6 +257,7 @@ export const useGridClipboardImport = (apiRef, props) => {
|
|
|
256
257
|
const splitClipboardPastedText = props.splitClipboardPastedText;
|
|
257
258
|
const {
|
|
258
259
|
pagination,
|
|
260
|
+
paginationMode,
|
|
259
261
|
onBeforeClipboardPasteStart
|
|
260
262
|
} = props;
|
|
261
263
|
const handlePaste = React.useCallback(async (params, event) => {
|
|
@@ -309,10 +311,11 @@ export const useGridClipboardImport = (apiRef, props) => {
|
|
|
309
311
|
updateCell: (...args) => {
|
|
310
312
|
cellUpdater.updateCell(...args);
|
|
311
313
|
},
|
|
312
|
-
pagination
|
|
314
|
+
pagination,
|
|
315
|
+
paginationMode
|
|
313
316
|
});
|
|
314
317
|
cellUpdater.applyUpdates();
|
|
315
|
-
}, [apiRef, processRowUpdate, onProcessRowUpdateError, getRowId, enableClipboardPaste, rootEl, splitClipboardPastedText, pagination, onBeforeClipboardPasteStart, logger]);
|
|
318
|
+
}, [apiRef, processRowUpdate, onProcessRowUpdateError, getRowId, enableClipboardPaste, rootEl, splitClipboardPastedText, pagination, paginationMode, onBeforeClipboardPasteStart, logger]);
|
|
316
319
|
const checkIfCanStartEditing = React.useCallback((initialValue, {
|
|
317
320
|
event
|
|
318
321
|
}) => {
|
|
@@ -42,6 +42,7 @@ export const filterRowTreeFromGroupingColumns = params => {
|
|
|
42
42
|
filterModel
|
|
43
43
|
} = params;
|
|
44
44
|
const filteredRowsLookup = {};
|
|
45
|
+
const filteredChildrenCountLookup = {};
|
|
45
46
|
const filteredDescendantCountLookup = {};
|
|
46
47
|
const filterCache = {};
|
|
47
48
|
const filterTreeNode = (node, areAncestorsExpanded, ancestorsResults) => {
|
|
@@ -57,12 +58,16 @@ export const filterRowTreeFromGroupingColumns = params => {
|
|
|
57
58
|
} else {
|
|
58
59
|
isPassingFiltering = true;
|
|
59
60
|
}
|
|
61
|
+
let filteredChildrenCount = 0;
|
|
60
62
|
let filteredDescendantCount = 0;
|
|
61
63
|
if (node.type === 'group') {
|
|
62
64
|
node.children.forEach(childId => {
|
|
63
65
|
const childNode = rowTree[childId];
|
|
64
66
|
const childSubTreeSize = filterTreeNode(childNode, areAncestorsExpanded && !!node.childrenExpanded, [...ancestorsResults, filterResults]);
|
|
65
67
|
filteredDescendantCount += childSubTreeSize;
|
|
68
|
+
if (childSubTreeSize > 0) {
|
|
69
|
+
filteredChildrenCount += 1;
|
|
70
|
+
}
|
|
66
71
|
});
|
|
67
72
|
}
|
|
68
73
|
if (isPassingFiltering === false) {
|
|
@@ -78,6 +83,7 @@ export const filterRowTreeFromGroupingColumns = params => {
|
|
|
78
83
|
if (!isPassingFiltering) {
|
|
79
84
|
return 0;
|
|
80
85
|
}
|
|
86
|
+
filteredChildrenCountLookup[node.id] = filteredChildrenCount;
|
|
81
87
|
filteredDescendantCountLookup[node.id] = filteredDescendantCount;
|
|
82
88
|
if (node.type !== 'group') {
|
|
83
89
|
return filteredDescendantCount + 1;
|
|
@@ -93,6 +99,7 @@ export const filterRowTreeFromGroupingColumns = params => {
|
|
|
93
99
|
}
|
|
94
100
|
return {
|
|
95
101
|
filteredRowsLookup,
|
|
102
|
+
filteredChildrenCountLookup,
|
|
96
103
|
filteredDescendantCountLookup
|
|
97
104
|
};
|
|
98
105
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useGridRowAriaAttributes';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useGridRowAriaAttributes as useGridRowAriaAttributesPro, useGridSelector } from '@mui/x-data-grid-pro/internals';
|
|
2
|
+
import { useGridPrivateApiContext } from '../../utils/useGridPrivateApiContext';
|
|
3
|
+
import { gridRowGroupingSanitizedModelSelector } from '../rowGrouping/gridRowGroupingSelector';
|
|
4
|
+
export const useGridRowAriaAttributes = () => {
|
|
5
|
+
const apiRef = useGridPrivateApiContext();
|
|
6
|
+
const gridRowGroupingModel = useGridSelector(apiRef, gridRowGroupingSanitizedModelSelector);
|
|
7
|
+
return useGridRowAriaAttributesPro(gridRowGroupingModel.length > 0);
|
|
8
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import { useGridAriaAttributes as useGridAriaAttributesPro, useGridSelector } from '@mui/x-data-grid-pro/internals';
|
|
3
|
+
import { gridRowGroupingSanitizedModelSelector } from '../features/rowGrouping/gridRowGroupingSelector';
|
|
4
|
+
import { useGridPrivateApiContext } from './useGridPrivateApiContext';
|
|
5
|
+
import { useGridRootProps } from './useGridRootProps';
|
|
6
|
+
export const useGridAriaAttributes = () => {
|
|
7
|
+
const rootProps = useGridRootProps();
|
|
8
|
+
const ariaAttributesPro = useGridAriaAttributesPro();
|
|
9
|
+
const apiRef = useGridPrivateApiContext();
|
|
10
|
+
const gridRowGroupingModel = useGridSelector(apiRef, gridRowGroupingSanitizedModelSelector);
|
|
11
|
+
const ariaAttributesPremium = rootProps.experimentalFeatures?.ariaV8 && gridRowGroupingModel.length > 0 ? {
|
|
12
|
+
role: 'treegrid'
|
|
13
|
+
} : {};
|
|
14
|
+
return _extends({}, ariaAttributesPro, ariaAttributesPremium);
|
|
15
|
+
};
|
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 = "MTcyNDM2MDQwMDAwMA==";
|
|
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
|
|
@@ -86,7 +86,7 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
86
86
|
const visibleColumns = apiRef.current.getVisibleColumns();
|
|
87
87
|
const rowsInRange = visibleRows.rows.slice(finalStartRowIndex, finalEndRowIndex + 1);
|
|
88
88
|
const columnsInRange = visibleColumns.slice(finalStartColumnIndex, finalEndColumnIndex + 1);
|
|
89
|
-
const newModel = keepOtherSelected ? apiRef.current.getCellSelectionModel() : {};
|
|
89
|
+
const newModel = keepOtherSelected ? (0, _extends2.default)({}, apiRef.current.getCellSelectionModel()) : {};
|
|
90
90
|
rowsInRange.forEach(row => {
|
|
91
91
|
if (!newModel[row.id]) {
|
|
92
92
|
newModel[row.id] = {};
|
|
@@ -160,7 +160,8 @@ function defaultPasteResolver({
|
|
|
160
160
|
pastedData,
|
|
161
161
|
apiRef,
|
|
162
162
|
updateCell,
|
|
163
|
-
pagination
|
|
163
|
+
pagination,
|
|
164
|
+
paginationMode
|
|
164
165
|
}) {
|
|
165
166
|
const isSingleValuePasted = pastedData.length === 1 && pastedData[0].length === 1;
|
|
166
167
|
const cellSelectionModel = apiRef.current.getCellSelectionModel();
|
|
@@ -237,7 +238,7 @@ function defaultPasteResolver({
|
|
|
237
238
|
}
|
|
238
239
|
const selectedRowId = selectedCell.id;
|
|
239
240
|
const selectedRowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(selectedRowId);
|
|
240
|
-
const visibleRowIds = pagination ? (0, _xDataGrid.gridPaginatedVisibleSortedGridRowIdsSelector)(apiRef) : (0, _xDataGrid.gridExpandedSortedRowIdsSelector)(apiRef);
|
|
241
|
+
const visibleRowIds = pagination && paginationMode === 'client' ? (0, _xDataGrid.gridPaginatedVisibleSortedGridRowIdsSelector)(apiRef) : (0, _xDataGrid.gridExpandedSortedRowIdsSelector)(apiRef);
|
|
241
242
|
const selectedFieldIndex = visibleColumnFields.indexOf(selectedCell.field);
|
|
242
243
|
pastedData.forEach((rowData, index) => {
|
|
243
244
|
const rowId = visibleRowIds[selectedRowIndex + index];
|
|
@@ -265,6 +266,7 @@ const useGridClipboardImport = (apiRef, props) => {
|
|
|
265
266
|
const splitClipboardPastedText = props.splitClipboardPastedText;
|
|
266
267
|
const {
|
|
267
268
|
pagination,
|
|
269
|
+
paginationMode,
|
|
268
270
|
onBeforeClipboardPasteStart
|
|
269
271
|
} = props;
|
|
270
272
|
const handlePaste = React.useCallback(async (params, event) => {
|
|
@@ -318,10 +320,11 @@ const useGridClipboardImport = (apiRef, props) => {
|
|
|
318
320
|
updateCell: (...args) => {
|
|
319
321
|
cellUpdater.updateCell(...args);
|
|
320
322
|
},
|
|
321
|
-
pagination
|
|
323
|
+
pagination,
|
|
324
|
+
paginationMode
|
|
322
325
|
});
|
|
323
326
|
cellUpdater.applyUpdates();
|
|
324
|
-
}, [apiRef, processRowUpdate, onProcessRowUpdateError, getRowId, enableClipboardPaste, rootEl, splitClipboardPastedText, pagination, onBeforeClipboardPasteStart, logger]);
|
|
327
|
+
}, [apiRef, processRowUpdate, onProcessRowUpdateError, getRowId, enableClipboardPaste, rootEl, splitClipboardPastedText, pagination, paginationMode, onBeforeClipboardPasteStart, logger]);
|
|
325
328
|
const checkIfCanStartEditing = React.useCallback((initialValue, {
|
|
326
329
|
event
|
|
327
330
|
}) => {
|
|
@@ -52,6 +52,7 @@ const filterRowTreeFromGroupingColumns = params => {
|
|
|
52
52
|
filterModel
|
|
53
53
|
} = params;
|
|
54
54
|
const filteredRowsLookup = {};
|
|
55
|
+
const filteredChildrenCountLookup = {};
|
|
55
56
|
const filteredDescendantCountLookup = {};
|
|
56
57
|
const filterCache = {};
|
|
57
58
|
const filterTreeNode = (node, areAncestorsExpanded, ancestorsResults) => {
|
|
@@ -67,12 +68,16 @@ const filterRowTreeFromGroupingColumns = params => {
|
|
|
67
68
|
} else {
|
|
68
69
|
isPassingFiltering = true;
|
|
69
70
|
}
|
|
71
|
+
let filteredChildrenCount = 0;
|
|
70
72
|
let filteredDescendantCount = 0;
|
|
71
73
|
if (node.type === 'group') {
|
|
72
74
|
node.children.forEach(childId => {
|
|
73
75
|
const childNode = rowTree[childId];
|
|
74
76
|
const childSubTreeSize = filterTreeNode(childNode, areAncestorsExpanded && !!node.childrenExpanded, [...ancestorsResults, filterResults]);
|
|
75
77
|
filteredDescendantCount += childSubTreeSize;
|
|
78
|
+
if (childSubTreeSize > 0) {
|
|
79
|
+
filteredChildrenCount += 1;
|
|
80
|
+
}
|
|
76
81
|
});
|
|
77
82
|
}
|
|
78
83
|
if (isPassingFiltering === false) {
|
|
@@ -88,6 +93,7 @@ const filterRowTreeFromGroupingColumns = params => {
|
|
|
88
93
|
if (!isPassingFiltering) {
|
|
89
94
|
return 0;
|
|
90
95
|
}
|
|
96
|
+
filteredChildrenCountLookup[node.id] = filteredChildrenCount;
|
|
91
97
|
filteredDescendantCountLookup[node.id] = filteredDescendantCount;
|
|
92
98
|
if (node.type !== 'group') {
|
|
93
99
|
return filteredDescendantCount + 1;
|
|
@@ -103,6 +109,7 @@ const filterRowTreeFromGroupingColumns = params => {
|
|
|
103
109
|
}
|
|
104
110
|
return {
|
|
105
111
|
filteredRowsLookup,
|
|
112
|
+
filteredChildrenCountLookup,
|
|
106
113
|
filteredDescendantCountLookup
|
|
107
114
|
};
|
|
108
115
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useGridRowAriaAttributes';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _useGridRowAriaAttributes = require("./useGridRowAriaAttributes");
|
|
7
|
+
Object.keys(_useGridRowAriaAttributes).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _useGridRowAriaAttributes[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _useGridRowAriaAttributes[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useGridRowAriaAttributes: () => (rowNode: import("@mui/x-data-grid").GridTreeNode, index: number) => import("react").HTMLAttributes<HTMLElement>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useGridRowAriaAttributes = void 0;
|
|
7
|
+
var _internals = require("@mui/x-data-grid-pro/internals");
|
|
8
|
+
var _useGridPrivateApiContext = require("../../utils/useGridPrivateApiContext");
|
|
9
|
+
var _gridRowGroupingSelector = require("../rowGrouping/gridRowGroupingSelector");
|
|
10
|
+
const useGridRowAriaAttributes = () => {
|
|
11
|
+
const apiRef = (0, _useGridPrivateApiContext.useGridPrivateApiContext)();
|
|
12
|
+
const gridRowGroupingModel = (0, _internals.useGridSelector)(apiRef, _gridRowGroupingSelector.gridRowGroupingSanitizedModelSelector);
|
|
13
|
+
return (0, _internals.useGridRowAriaAttributes)(gridRowGroupingModel.length > 0);
|
|
14
|
+
};
|
|
15
|
+
exports.useGridRowAriaAttributes = useGridRowAriaAttributes;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useGridAriaAttributes = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _internals = require("@mui/x-data-grid-pro/internals");
|
|
10
|
+
var _gridRowGroupingSelector = require("../features/rowGrouping/gridRowGroupingSelector");
|
|
11
|
+
var _useGridPrivateApiContext = require("./useGridPrivateApiContext");
|
|
12
|
+
var _useGridRootProps = require("./useGridRootProps");
|
|
13
|
+
const useGridAriaAttributes = () => {
|
|
14
|
+
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
15
|
+
const ariaAttributesPro = (0, _internals.useGridAriaAttributes)();
|
|
16
|
+
const apiRef = (0, _useGridPrivateApiContext.useGridPrivateApiContext)();
|
|
17
|
+
const gridRowGroupingModel = (0, _internals.useGridSelector)(apiRef, _gridRowGroupingSelector.gridRowGroupingSanitizedModelSelector);
|
|
18
|
+
const ariaAttributesPremium = rootProps.experimentalFeatures?.ariaV8 && gridRowGroupingModel.length > 0 ? {
|
|
19
|
+
role: 'treegrid'
|
|
20
|
+
} : {};
|
|
21
|
+
return (0, _extends2.default)({}, ariaAttributesPro, ariaAttributesPremium);
|
|
22
|
+
};
|
|
23
|
+
exports.useGridAriaAttributes = useGridAriaAttributes;
|
package/index.js
CHANGED
|
@@ -8,6 +8,12 @@ import { GridInitialStatePremium } from './gridStatePremium';
|
|
|
8
8
|
import { GridApiPremium } from './gridApiPremium';
|
|
9
9
|
import { GridCellSelectionModel } from '../hooks/features/cellSelection';
|
|
10
10
|
export interface GridExperimentalPremiumFeatures extends GridExperimentalProFeatures {
|
|
11
|
+
/**
|
|
12
|
+
* Enables accessibility improvements that will be enabled by default in V8.
|
|
13
|
+
* If you rely on the v7 ARIA attributes (e.g. for CSS selectors), this might be a breaking change.
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
ariaV8: boolean;
|
|
11
17
|
}
|
|
12
18
|
export interface DataGridPremiumPropsWithComplexDefaultValueBeforeProcessing extends Pick<DataGridPropsWithComplexDefaultValueBeforeProcessing, 'localeText'> {
|
|
13
19
|
/**
|
|
@@ -9,7 +9,15 @@ import { propValidatorsDataGrid, propValidatorsDataGridPro, validateProps } from
|
|
|
9
9
|
import { useDataGridPremiumComponent } from './useDataGridPremiumComponent';
|
|
10
10
|
import { useDataGridPremiumProps } from './useDataGridPremiumProps';
|
|
11
11
|
import { getReleaseInfo } from '../utils/releaseInfo';
|
|
12
|
+
import { useGridAriaAttributes } from '../hooks/utils/useGridAriaAttributes';
|
|
13
|
+
import { useGridRowAriaAttributes } from '../hooks/features/rows/useGridRowAriaAttributes';
|
|
12
14
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
const configuration = {
|
|
16
|
+
hooks: {
|
|
17
|
+
useGridAriaAttributes,
|
|
18
|
+
useGridRowAriaAttributes
|
|
19
|
+
}
|
|
20
|
+
};
|
|
13
21
|
const releaseInfo = getReleaseInfo();
|
|
14
22
|
let dataGridPremiumPropValidators;
|
|
15
23
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -24,6 +32,7 @@ const DataGridPremiumRaw = /*#__PURE__*/React.forwardRef(function DataGridPremiu
|
|
|
24
32
|
}
|
|
25
33
|
return /*#__PURE__*/_jsx(GridContextProvider, {
|
|
26
34
|
privateApiRef: privateApiRef,
|
|
35
|
+
configuration: configuration,
|
|
27
36
|
props: props,
|
|
28
37
|
children: /*#__PURE__*/_jsxs(GridRoot, _extends({
|
|
29
38
|
className: props.className,
|
|
@@ -285,6 +294,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
285
294
|
* 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.
|
|
286
295
|
*/
|
|
287
296
|
experimentalFeatures: PropTypes.shape({
|
|
297
|
+
ariaV8: PropTypes.bool,
|
|
288
298
|
warnIfFocusStateIsNotSynced: PropTypes.bool
|
|
289
299
|
}),
|
|
290
300
|
/**
|
|
@@ -454,7 +464,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
|
|
|
454
464
|
/**
|
|
455
465
|
* Determines if a row can be selected.
|
|
456
466
|
* @param {GridRowParams} params With all properties from [[GridRowParams]].
|
|
457
|
-
* @returns {boolean} A boolean indicating if the
|
|
467
|
+
* @returns {boolean} A boolean indicating if the row is selectable.
|
|
458
468
|
*/
|
|
459
469
|
isRowSelectable: PropTypes.func,
|
|
460
470
|
/**
|
|
@@ -8,8 +8,13 @@ function GridGroupingColumnLeafCell(props) {
|
|
|
8
8
|
} = props;
|
|
9
9
|
const rootProps = useGridRootProps();
|
|
10
10
|
return /*#__PURE__*/_jsx(Box, {
|
|
11
|
-
sx: {
|
|
12
|
-
ml:
|
|
11
|
+
sx: [rootProps.rowGroupingColumnMode === 'multiple' ? {
|
|
12
|
+
ml: 1
|
|
13
|
+
} : theme => ({
|
|
14
|
+
ml: `calc(var(--DataGrid-cellOffsetMultiplier) * var(--depth) * ${theme.spacing(1)})`
|
|
15
|
+
})],
|
|
16
|
+
style: {
|
|
17
|
+
'--depth': rowNode.depth
|
|
13
18
|
},
|
|
14
19
|
children: props.formattedValue ?? props.value
|
|
15
20
|
});
|
|
@@ -61,8 +61,13 @@ export function GridGroupingCriteriaCell(props) {
|
|
|
61
61
|
}
|
|
62
62
|
return /*#__PURE__*/_jsxs(Box, {
|
|
63
63
|
className: classes.root,
|
|
64
|
-
sx: {
|
|
65
|
-
ml:
|
|
64
|
+
sx: [rootProps.rowGroupingColumnMode === 'multiple' ? {
|
|
65
|
+
ml: 0
|
|
66
|
+
} : theme => ({
|
|
67
|
+
ml: `calc(var(--DataGrid-cellOffsetMultiplier) * var(--depth) * ${theme.spacing(1)})`
|
|
68
|
+
})],
|
|
69
|
+
style: {
|
|
70
|
+
'--depth': rowNode.depth
|
|
66
71
|
},
|
|
67
72
|
children: [/*#__PURE__*/_jsx("div", {
|
|
68
73
|
className: classes.toggle,
|
|
@@ -76,7 +76,7 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
76
76
|
const visibleColumns = apiRef.current.getVisibleColumns();
|
|
77
77
|
const rowsInRange = visibleRows.rows.slice(finalStartRowIndex, finalEndRowIndex + 1);
|
|
78
78
|
const columnsInRange = visibleColumns.slice(finalStartColumnIndex, finalEndColumnIndex + 1);
|
|
79
|
-
const newModel = keepOtherSelected ? apiRef.current.getCellSelectionModel() : {};
|
|
79
|
+
const newModel = keepOtherSelected ? _extends({}, apiRef.current.getCellSelectionModel()) : {};
|
|
80
80
|
rowsInRange.forEach(row => {
|
|
81
81
|
if (!newModel[row.id]) {
|
|
82
82
|
newModel[row.id] = {};
|
|
@@ -151,7 +151,8 @@ function defaultPasteResolver({
|
|
|
151
151
|
pastedData,
|
|
152
152
|
apiRef,
|
|
153
153
|
updateCell,
|
|
154
|
-
pagination
|
|
154
|
+
pagination,
|
|
155
|
+
paginationMode
|
|
155
156
|
}) {
|
|
156
157
|
const isSingleValuePasted = pastedData.length === 1 && pastedData[0].length === 1;
|
|
157
158
|
const cellSelectionModel = apiRef.current.getCellSelectionModel();
|
|
@@ -228,7 +229,7 @@ function defaultPasteResolver({
|
|
|
228
229
|
}
|
|
229
230
|
const selectedRowId = selectedCell.id;
|
|
230
231
|
const selectedRowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(selectedRowId);
|
|
231
|
-
const visibleRowIds = pagination ? gridPaginatedVisibleSortedGridRowIdsSelector(apiRef) : gridExpandedSortedRowIdsSelector(apiRef);
|
|
232
|
+
const visibleRowIds = pagination && paginationMode === 'client' ? gridPaginatedVisibleSortedGridRowIdsSelector(apiRef) : gridExpandedSortedRowIdsSelector(apiRef);
|
|
232
233
|
const selectedFieldIndex = visibleColumnFields.indexOf(selectedCell.field);
|
|
233
234
|
pastedData.forEach((rowData, index) => {
|
|
234
235
|
const rowId = visibleRowIds[selectedRowIndex + index];
|
|
@@ -256,6 +257,7 @@ export const useGridClipboardImport = (apiRef, props) => {
|
|
|
256
257
|
const splitClipboardPastedText = props.splitClipboardPastedText;
|
|
257
258
|
const {
|
|
258
259
|
pagination,
|
|
260
|
+
paginationMode,
|
|
259
261
|
onBeforeClipboardPasteStart
|
|
260
262
|
} = props;
|
|
261
263
|
const handlePaste = React.useCallback(async (params, event) => {
|
|
@@ -309,10 +311,11 @@ export const useGridClipboardImport = (apiRef, props) => {
|
|
|
309
311
|
updateCell: (...args) => {
|
|
310
312
|
cellUpdater.updateCell(...args);
|
|
311
313
|
},
|
|
312
|
-
pagination
|
|
314
|
+
pagination,
|
|
315
|
+
paginationMode
|
|
313
316
|
});
|
|
314
317
|
cellUpdater.applyUpdates();
|
|
315
|
-
}, [apiRef, processRowUpdate, onProcessRowUpdateError, getRowId, enableClipboardPaste, rootEl, splitClipboardPastedText, pagination, onBeforeClipboardPasteStart, logger]);
|
|
318
|
+
}, [apiRef, processRowUpdate, onProcessRowUpdateError, getRowId, enableClipboardPaste, rootEl, splitClipboardPastedText, pagination, paginationMode, onBeforeClipboardPasteStart, logger]);
|
|
316
319
|
const checkIfCanStartEditing = React.useCallback((initialValue, {
|
|
317
320
|
event
|
|
318
321
|
}) => {
|
|
@@ -42,6 +42,7 @@ export const filterRowTreeFromGroupingColumns = params => {
|
|
|
42
42
|
filterModel
|
|
43
43
|
} = params;
|
|
44
44
|
const filteredRowsLookup = {};
|
|
45
|
+
const filteredChildrenCountLookup = {};
|
|
45
46
|
const filteredDescendantCountLookup = {};
|
|
46
47
|
const filterCache = {};
|
|
47
48
|
const filterTreeNode = (node, areAncestorsExpanded, ancestorsResults) => {
|
|
@@ -57,12 +58,16 @@ export const filterRowTreeFromGroupingColumns = params => {
|
|
|
57
58
|
} else {
|
|
58
59
|
isPassingFiltering = true;
|
|
59
60
|
}
|
|
61
|
+
let filteredChildrenCount = 0;
|
|
60
62
|
let filteredDescendantCount = 0;
|
|
61
63
|
if (node.type === 'group') {
|
|
62
64
|
node.children.forEach(childId => {
|
|
63
65
|
const childNode = rowTree[childId];
|
|
64
66
|
const childSubTreeSize = filterTreeNode(childNode, areAncestorsExpanded && !!node.childrenExpanded, [...ancestorsResults, filterResults]);
|
|
65
67
|
filteredDescendantCount += childSubTreeSize;
|
|
68
|
+
if (childSubTreeSize > 0) {
|
|
69
|
+
filteredChildrenCount += 1;
|
|
70
|
+
}
|
|
66
71
|
});
|
|
67
72
|
}
|
|
68
73
|
if (isPassingFiltering === false) {
|
|
@@ -78,6 +83,7 @@ export const filterRowTreeFromGroupingColumns = params => {
|
|
|
78
83
|
if (!isPassingFiltering) {
|
|
79
84
|
return 0;
|
|
80
85
|
}
|
|
86
|
+
filteredChildrenCountLookup[node.id] = filteredChildrenCount;
|
|
81
87
|
filteredDescendantCountLookup[node.id] = filteredDescendantCount;
|
|
82
88
|
if (node.type !== 'group') {
|
|
83
89
|
return filteredDescendantCount + 1;
|
|
@@ -93,6 +99,7 @@ export const filterRowTreeFromGroupingColumns = params => {
|
|
|
93
99
|
}
|
|
94
100
|
return {
|
|
95
101
|
filteredRowsLookup,
|
|
102
|
+
filteredChildrenCountLookup,
|
|
96
103
|
filteredDescendantCountLookup
|
|
97
104
|
};
|
|
98
105
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useGridRowAriaAttributes';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useGridRowAriaAttributes as useGridRowAriaAttributesPro, useGridSelector } from '@mui/x-data-grid-pro/internals';
|
|
2
|
+
import { useGridPrivateApiContext } from '../../utils/useGridPrivateApiContext';
|
|
3
|
+
import { gridRowGroupingSanitizedModelSelector } from '../rowGrouping/gridRowGroupingSelector';
|
|
4
|
+
export const useGridRowAriaAttributes = () => {
|
|
5
|
+
const apiRef = useGridPrivateApiContext();
|
|
6
|
+
const gridRowGroupingModel = useGridSelector(apiRef, gridRowGroupingSanitizedModelSelector);
|
|
7
|
+
return useGridRowAriaAttributesPro(gridRowGroupingModel.length > 0);
|
|
8
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import { useGridAriaAttributes as useGridAriaAttributesPro, useGridSelector } from '@mui/x-data-grid-pro/internals';
|
|
3
|
+
import { gridRowGroupingSanitizedModelSelector } from '../features/rowGrouping/gridRowGroupingSelector';
|
|
4
|
+
import { useGridPrivateApiContext } from './useGridPrivateApiContext';
|
|
5
|
+
import { useGridRootProps } from './useGridRootProps';
|
|
6
|
+
export const useGridAriaAttributes = () => {
|
|
7
|
+
const rootProps = useGridRootProps();
|
|
8
|
+
const ariaAttributesPro = useGridAriaAttributesPro();
|
|
9
|
+
const apiRef = useGridPrivateApiContext();
|
|
10
|
+
const gridRowGroupingModel = useGridSelector(apiRef, gridRowGroupingSanitizedModelSelector);
|
|
11
|
+
const ariaAttributesPremium = rootProps.experimentalFeatures?.ariaV8 && gridRowGroupingModel.length > 0 ? {
|
|
12
|
+
role: 'treegrid'
|
|
13
|
+
} : {};
|
|
14
|
+
return _extends({}, ariaAttributesPro, ariaAttributesPremium);
|
|
15
|
+
};
|
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 = "MTcyNDM2MDQwMDAwMA==";
|
|
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.
|
|
3
|
+
"version": "7.14.0",
|
|
4
4
|
"description": "The Premium plan edition of the Data Grid Components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -34,17 +34,17 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@babel/runtime": "^7.25.0",
|
|
37
|
-
"@mui/system": "^5.16.
|
|
38
|
-
"@mui/utils": "^5.16.
|
|
37
|
+
"@mui/system": "^5.16.7",
|
|
38
|
+
"@mui/utils": "^5.16.6",
|
|
39
39
|
"@types/format-util": "^1.0.4",
|
|
40
40
|
"clsx": "^2.1.1",
|
|
41
41
|
"exceljs": "^4.4.0",
|
|
42
42
|
"prop-types": "^15.8.1",
|
|
43
43
|
"reselect": "^4.1.8",
|
|
44
|
-
"@mui/x-data-grid": "7.
|
|
45
|
-
"@mui/x-data-grid-pro": "7.
|
|
46
|
-
"@mui/x-internals": "7.
|
|
47
|
-
"@mui/x-license": "7.
|
|
44
|
+
"@mui/x-data-grid": "7.14.0",
|
|
45
|
+
"@mui/x-data-grid-pro": "7.14.0",
|
|
46
|
+
"@mui/x-internals": "7.14.0",
|
|
47
|
+
"@mui/x-license": "7.14.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@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 = "MTcyNDM2MDQwMDAwMA==";
|
|
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
|