@mui/x-data-grid-premium 7.12.0 โ 7.13.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 +151 -2
- package/DataGridPremium/DataGridPremium.js +11 -1
- package/esm/DataGridPremium/DataGridPremium.js +11 -1
- 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/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/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 +15 -5
- package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,155 @@
|
|
|
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.13.0
|
|
7
|
+
|
|
8
|
+
_Aug 16, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights โจ:
|
|
11
|
+
|
|
12
|
+
- ๐ซ Allow to [edit the label](https://mui.com/x/react-tree-view/rich-tree-view/editing/) of Tree View's items.
|
|
13
|
+
|
|
14
|
+
<img width="344" src="https://github.com/user-attachments/assets/1a6cf765-2dc8-4906-bd93-139086eed148" alt="Item label editing" />
|
|
15
|
+
|
|
16
|
+
- ๐ง 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.
|
|
17
|
+
- ๐ Improve Vietnamese (vi-VN) locale on the Data Grid
|
|
18
|
+
- ๐ Bugfixes
|
|
19
|
+
|
|
20
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
21
|
+
|
|
22
|
+
### Data Grid
|
|
23
|
+
|
|
24
|
+
#### `@mui/x-data-grid@7.13.0`
|
|
25
|
+
|
|
26
|
+
- [DataGrid] Fix CSV export for `null` and `undefined` values (#14166) @k-rajat19
|
|
27
|
+
- [DataGrid] Fix error logged during skeleton loading with nested data grid (#14186) @KenanYusuf
|
|
28
|
+
- [DataGrid] Remove needless check in `useGridStateInitialization` (#14181) @k-rajat19
|
|
29
|
+
- [DataGrid] Add recipe for persisting filters in local storage (#14208) @cherniavskii
|
|
30
|
+
- [l10n] Improve Vietnamese (vi-VN) locale (#14216) @hungnd-casso
|
|
31
|
+
|
|
32
|
+
#### `@mui/x-data-grid-pro@7.13.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
33
|
+
|
|
34
|
+
Same changes as in `@mui/x-data-grid@7.13.0`, plus:
|
|
35
|
+
|
|
36
|
+
- [DataGridPro] Fix Tree Data and Row Grouping rows accessibility (#13623) @arminmeh
|
|
37
|
+
|
|
38
|
+
#### `@mui/x-data-grid-premium@7.13.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
39
|
+
|
|
40
|
+
Same changes as in `@mui/x-data-grid-pro@7.13.0`.
|
|
41
|
+
|
|
42
|
+
### Date and Time Pickers
|
|
43
|
+
|
|
44
|
+
#### `@mui/x-date-pickers@7.13.0`
|
|
45
|
+
|
|
46
|
+
- [pickers] Fix date and time merging to retain milliseconds (#14173) @LukasTy
|
|
47
|
+
|
|
48
|
+
#### `@mui/x-date-pickers-pro@7.13.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
49
|
+
|
|
50
|
+
Same changes as in `@mui/x-date-pickers@7.13.0`.
|
|
51
|
+
|
|
52
|
+
### Charts
|
|
53
|
+
|
|
54
|
+
#### `@mui/x-charts@7.13.0`
|
|
55
|
+
|
|
56
|
+
- [charts] Add `baseline` property to the `LineChart` `series` (#14153) @JCQuintas
|
|
57
|
+
- [charts] Fix issue where tooltip would disappear on mouse click (#14187) @alexfauquette
|
|
58
|
+
- [charts] Rename `CartesianContextProvider` to `CartesianProvider` (#14102) @JCQuintas
|
|
59
|
+
- [charts] Support axis with the same value for all data points (#14191) @alexfauquette
|
|
60
|
+
|
|
61
|
+
#### `@mui/x-date-charts-pro@7.0.0-alpha.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
62
|
+
|
|
63
|
+
Same changes as in `@mui/x-charts@7.13.0`.
|
|
64
|
+
|
|
65
|
+
### Tree View
|
|
66
|
+
|
|
67
|
+
#### `@mui/x-tree-view@7.13.0`
|
|
68
|
+
|
|
69
|
+
- [TreeView] Add label editing feature (#13388) @noraleonte
|
|
70
|
+
- [TreeView] Fix the parameters passed for the `canMoveItemToNewPosition` prop (#14176) @flaviendelangle
|
|
71
|
+
|
|
72
|
+
### Docs
|
|
73
|
+
|
|
74
|
+
- [docs] Extract dataset in the Line chart docs (#14034) @alexfauquette
|
|
75
|
+
- [docs] Remove redundant encoding in the mock data source server (#14185) @MBilalShafi
|
|
76
|
+
- [docs] Use Netflix financial results to document bar charts (#13991) @alexfauquette
|
|
77
|
+
- [docs] Remove relience of abbreviations (#14226) @oliviertassinari
|
|
78
|
+
|
|
79
|
+
### Core
|
|
80
|
+
|
|
81
|
+
- [core] Bump monorepo (#14141) @Janpot
|
|
82
|
+
- [core] Fix ESLint issue (#14207) @LukasTy
|
|
83
|
+
- [core] Fix Netlify build cache issue (#14182) @cherniavskii
|
|
84
|
+
- [code-infra] Refactor Netlify `cache-docs` plugin setup (#14105) @LukasTy
|
|
85
|
+
- [internals] Move utils needed for tree view virtualization to shared package (#14202) @flaviendelangle
|
|
86
|
+
|
|
87
|
+
## 7.12.1
|
|
88
|
+
|
|
89
|
+
_Aug 8, 2024_
|
|
90
|
+
|
|
91
|
+
We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights โจ:
|
|
92
|
+
|
|
93
|
+
- ๐จ Charts get a new component to display color mapping in the legend
|
|
94
|
+
- ๐ The `@mui/x-charts-pro` is released in alpha version ๐งช. This new package introduces two main features:
|
|
95
|
+
- The Heatmap component
|
|
96
|
+
- The zoom interaction on the bar, line, and scatter charts
|
|
97
|
+
- ๐ Improve Dutch (nl-NL) locale on the Date and Time Pickers
|
|
98
|
+
- ๐ Bugfixes
|
|
99
|
+
|
|
100
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
101
|
+
|
|
102
|
+
### Data Grid
|
|
103
|
+
|
|
104
|
+
#### `@mui/x-data-grid@7.12.1`
|
|
105
|
+
|
|
106
|
+
- [DataGrid] Fix `checkboxSelectionVisibleOnly` behavior with server-side pagination (#14083) @MBilalShafi
|
|
107
|
+
- [DataGrid] Fix `columnHeadersContainerRef` being `undefined` before mount (#14051) @samwato
|
|
108
|
+
- [DataGrid] Support Yarn PnP (#14126) @cherniavskii
|
|
109
|
+
|
|
110
|
+
#### `@mui/x-data-grid-pro@7.12.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
111
|
+
|
|
112
|
+
Same changes as in `@mui/x-data-grid@7.12.1`.
|
|
113
|
+
|
|
114
|
+
#### `@mui/x-data-grid-premium@7.12.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
115
|
+
|
|
116
|
+
Same changes as in `@mui/x-data-grid-pro@7.12.1`.
|
|
117
|
+
|
|
118
|
+
### Date and Time Pickers
|
|
119
|
+
|
|
120
|
+
#### `@mui/x-date-pickers@7.12.1`
|
|
121
|
+
|
|
122
|
+
- [l10n] Improve Dutch (nlNL) locale (pickers) (#14036) @Robin1896
|
|
123
|
+
|
|
124
|
+
#### `@mui/x-date-pickers-pro@7.12.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
125
|
+
|
|
126
|
+
Same changes as in `@mui/x-date-pickers@7.12.1`.
|
|
127
|
+
|
|
128
|
+
### Charts
|
|
129
|
+
|
|
130
|
+
#### `@mui/x-charts@7.12.1`
|
|
131
|
+
|
|
132
|
+
- [charts] Fix charts vendor publish config (#14073) @JCQuintas
|
|
133
|
+
- [charts] Move `plugins` to `PluginProvider` (#14056) @JCQuintas
|
|
134
|
+
|
|
135
|
+
#### `@mui/x-date-charts-pro@7.0.0-alpha.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
136
|
+
|
|
137
|
+
Same changes as in `@mui/x-charts@7.12.1`, plus:
|
|
138
|
+
|
|
139
|
+
- [charts-pro] Release the pro package in alpha (#13859) @alexfauquette
|
|
140
|
+
|
|
141
|
+
### Tree View
|
|
142
|
+
|
|
143
|
+
#### `@mui/x-tree-view@7.12.1`
|
|
144
|
+
|
|
145
|
+
### Docs
|
|
146
|
+
|
|
147
|
+
- [docs] Add a warning to promote the usage of `updateRows` (#14027) @MBilalShafi
|
|
148
|
+
- [docs] Disable ad in `Rich Tree View-Ordering` page (#14123) @oliviertassinari
|
|
149
|
+
- [docs] Redesign Date and Time Pickers overview page (#13241) @noraleonte
|
|
150
|
+
|
|
151
|
+
- [CHANGELOG] Polish details @oliviertassinari
|
|
152
|
+
- [code-infra] Use concurrency 1 in CircleCI (#14110) @JCQuintas
|
|
153
|
+
- [infra] Re-added the removal of `Latest Version` section (#14132) @michelengelen
|
|
154
|
+
|
|
6
155
|
## 7.12.0
|
|
7
156
|
|
|
8
157
|
_Aug 1, 2024_
|
|
@@ -24,9 +173,9 @@ We'd like to offer a big thanks to the 12 contributors who made this release pos
|
|
|
24
173
|
|
|
25
174
|
- ๐ Introduce [item reordering using drag and drop](https://mui.com/x/react-tree-view/rich-tree-view/ordering/) on the `RichTreeViewPro` component
|
|
26
175
|
|
|
27
|
-
<img width="
|
|
176
|
+
<img width="287" src="https://github.com/user-attachments/assets/78bd83c5-7ce4-4ed7-acf9-be70b2dbce54" alt="Item reordering using drag and drop" />
|
|
28
177
|
|
|
29
|
-
- ๐ฆ Support
|
|
178
|
+
- ๐ฆ Support CommonJS bundle out of the box on `@mui/x-charts` by adding vendored D3 dependencies.
|
|
30
179
|
|
|
31
180
|
- This modifies how the package imports D3.js. It will impact you if you use `d3` packages installed by `@mui/x-charts` and don't have them in your `package.json`. You shouldn't be affected otherwise.
|
|
32
181
|
- For more context, the initial issue is caused by D3 only exporting ESM.
|
|
@@ -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
|
/**
|
|
@@ -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
|
/**
|
|
@@ -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 = "MTcyMzc1NTYwMDAwMA==";
|
|
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
|
|
@@ -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
|
/**
|
|
@@ -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 = "MTcyMzc1NTYwMDAwMA==";
|
|
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.13.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",
|
|
@@ -41,16 +41,26 @@
|
|
|
41
41
|
"exceljs": "^4.4.0",
|
|
42
42
|
"prop-types": "^15.8.1",
|
|
43
43
|
"reselect": "^4.1.8",
|
|
44
|
-
"@mui/x-data-grid
|
|
45
|
-
"@mui/x-
|
|
46
|
-
"@mui/x-
|
|
47
|
-
"@mui/x-
|
|
44
|
+
"@mui/x-data-grid": "7.13.0",
|
|
45
|
+
"@mui/x-data-grid-pro": "7.13.0",
|
|
46
|
+
"@mui/x-license": "7.13.0",
|
|
47
|
+
"@mui/x-internals": "7.13.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
+
"@emotion/react": "^11.9.0",
|
|
51
|
+
"@emotion/styled": "^11.8.1",
|
|
50
52
|
"@mui/material": "^5.15.14",
|
|
51
53
|
"react": "^17.0.0 || ^18.0.0",
|
|
52
54
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
53
55
|
},
|
|
56
|
+
"peerDependenciesMeta": {
|
|
57
|
+
"@emotion/react": {
|
|
58
|
+
"optional": true
|
|
59
|
+
},
|
|
60
|
+
"@emotion/styled": {
|
|
61
|
+
"optional": true
|
|
62
|
+
}
|
|
63
|
+
},
|
|
54
64
|
"engines": {
|
|
55
65
|
"node": ">=14.0.0"
|
|
56
66
|
},
|
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 = "MTcyMzc1NTYwMDAwMA==";
|
|
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
|