@mui/x-data-grid-premium 7.11.0 → 7.12.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 +194 -4
- package/DataGridPremium/DataGrid.js +2 -2
- package/DataGridPremium/useDataGridPremiumProps.js +1 -1
- package/components/GridAggregationHeader.js +2 -2
- package/components/GridColumnMenuAggregationItem.js +1 -1
- package/components/GridFooterCell.js +2 -2
- package/components/GridGroupingCriteriaCell.js +2 -2
- package/esm/DataGridPremium/DataGrid.js +2 -2
- package/esm/DataGridPremium/useDataGridPremiumProps.js +2 -2
- package/esm/components/GridAggregationHeader.js +1 -1
- package/esm/components/GridColumnMenuAggregationItem.js +1 -1
- package/esm/components/GridFooterCell.js +1 -1
- package/esm/components/GridGroupingCriteriaCell.js +1 -1
- package/esm/hooks/features/cellSelection/useGridCellSelection.js +22 -9
- package/esm/hooks/features/clipboard/useGridClipboardImport.js +17 -9
- package/esm/hooks/features/export/serializer/excelSerializer.js +3 -4
- package/esm/utils/releaseInfo.js +1 -1
- package/hooks/features/cellSelection/useGridCellSelection.js +21 -8
- package/hooks/features/clipboard/useGridClipboardImport.js +16 -8
- package/hooks/features/export/serializer/excelSerializer.js +2 -3
- package/index.js +1 -1
- package/modern/DataGridPremium/DataGrid.js +2 -2
- package/modern/DataGridPremium/useDataGridPremiumProps.js +2 -2
- package/modern/components/GridAggregationHeader.js +1 -1
- package/modern/components/GridColumnMenuAggregationItem.js +1 -1
- package/modern/components/GridFooterCell.js +1 -1
- package/modern/components/GridGroupingCriteriaCell.js +1 -1
- package/modern/hooks/features/cellSelection/useGridCellSelection.js +22 -9
- package/modern/hooks/features/clipboard/useGridClipboardImport.js +17 -9
- package/modern/hooks/features/export/serializer/excelSerializer.js +3 -4
- package/modern/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/package.json +8 -8
- package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,196 @@
|
|
|
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.12.0
|
|
7
|
+
|
|
8
|
+
_Aug 1, 2024_
|
|
9
|
+
|
|
10
|
+
### 💵 Our commercial offering is evolving
|
|
11
|
+
|
|
12
|
+
The [Pro plan](https://mui.com/x/introduction/licensing/#pro-plan) is receiving two new packages:
|
|
13
|
+
|
|
14
|
+
- `@mui/x-tree-view-pro` (available today!)
|
|
15
|
+
- `@mui/x-charts-pro` (available in the coming weeks)
|
|
16
|
+
|
|
17
|
+
As always, every feature released as part of the MIT plan will remain free and MIT licensed forever.
|
|
18
|
+
|
|
19
|
+
This expansion of the Pro plan comes with some adjustments to our pricing strategy. Learn more about those in the [Upcoming changes to MUI X pricing in 2024](https://mui.com/blog/mui-x-sep-2024-price-update/) blog post.
|
|
20
|
+
|
|
21
|
+
### Highlights
|
|
22
|
+
|
|
23
|
+
We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
24
|
+
|
|
25
|
+
- 🎁 Introduce [item reordering using drag and drop](https://mui.com/x/react-tree-view/rich-tree-view/ordering/) on the `RichTreeViewPro` component
|
|
26
|
+
|
|
27
|
+
<img width="384" src="https://github.com/user-attachments/assets/78bd83c5-7ce4-4ed7-acf9-be70b2dbce54" alt="Item reordering using drag and drop" />
|
|
28
|
+
|
|
29
|
+
- 📦 Support Common JS bundle out of the box on `@mui/x-charts` by adding vendored D3 dependencies.
|
|
30
|
+
|
|
31
|
+
- 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
|
+
- For more context, the initial issue is caused by D3 only exporting ESM.
|
|
33
|
+
|
|
34
|
+

|
|
35
|
+
|
|
36
|
+
- The solution up until now was to export charts with only ESM. But some frameworks are confused by this configuration.
|
|
37
|
+
|
|
38
|
+

|
|
39
|
+
|
|
40
|
+
- So in order to fix this, we are providing a CJS version of D3.
|
|
41
|
+
|
|
42
|
+

|
|
43
|
+
|
|
44
|
+
- 🌍 Improve Turkish (tr-TR) locale on the Data Grid
|
|
45
|
+
- 🌍 Improve Finnish (fi-FI) locale on the Date and Time Pickers
|
|
46
|
+
- 🐞 Bugfixes
|
|
47
|
+
- 📚 Documentation improvements
|
|
48
|
+
|
|
49
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
50
|
+
|
|
51
|
+
### Data Grid
|
|
52
|
+
|
|
53
|
+
#### `@mui/x-data-grid@7.12.0`
|
|
54
|
+
|
|
55
|
+
- [DataGrid] Fix crash when updating columns immediately after scrolling (#13781) @cherniavskii
|
|
56
|
+
- [DataGrid] Fix `role=presentation` a11y issue (#13891) @romgrk
|
|
57
|
+
- [DataGrid] Fix top corner pixels & outline radius (#13943) @romgrk
|
|
58
|
+
- [DataGrid] Refactor: remove useless copy (#14039) @romgrk
|
|
59
|
+
- [l10n] Improve Turkish (tr-TR) locale (#13996) @bagcivan
|
|
60
|
+
|
|
61
|
+
#### `@mui/x-data-grid-pro@7.12.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
62
|
+
|
|
63
|
+
Same changes as in `@mui/x-data-grid@7.12.0`.
|
|
64
|
+
|
|
65
|
+
#### `@mui/x-data-grid-premium@7.12.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
66
|
+
|
|
67
|
+
Same changes as in `@mui/x-data-grid-pro@7.12.0`.
|
|
68
|
+
|
|
69
|
+
### Date and Time Pickers
|
|
70
|
+
|
|
71
|
+
#### `@mui/x-date-pickers@7.12.0`
|
|
72
|
+
|
|
73
|
+
- [l10n] Improve Finnish (fi-FI) locale (#14054) @frozenzia
|
|
74
|
+
|
|
75
|
+
#### `@mui/x-date-pickers-pro@7.12.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
76
|
+
|
|
77
|
+
Same changes as in `@mui/x-date-pickers@7.12.0`.
|
|
78
|
+
|
|
79
|
+
### Charts
|
|
80
|
+
|
|
81
|
+
#### `@mui/x-charts@7.12.0`
|
|
82
|
+
|
|
83
|
+
- [charts] Fix incorrect `axisId` prop being allowed in xAxis/yAxis config. Use `id` instead. (#13986) @JCQuintas
|
|
84
|
+
- [charts] Use vendor to have Common JS bundle working out of the box (#13608) @alexfauquette
|
|
85
|
+
- [charts] Divide the `SeriesProvider` to use in filtering (#14026) @JCQuintas
|
|
86
|
+
|
|
87
|
+
### Tree View
|
|
88
|
+
|
|
89
|
+
#### `@mui/x-tree-view@7.12.0`
|
|
90
|
+
|
|
91
|
+
- [TreeView] Add new prop `onItemClick` on the Tree View components (#14018) @flaviendelangle
|
|
92
|
+
- [TreeView] Add new utility function `isEventTargetInDescendants` (#13982) @flaviendelangle
|
|
93
|
+
- [TreeView] Support item reordering using drag and drop (#12213) @flaviendelangle
|
|
94
|
+
|
|
95
|
+
### Docs
|
|
96
|
+
|
|
97
|
+
- [docs] Add Pickers `minDate` and `maxDate` `default` description (#14024) @LukasTy
|
|
98
|
+
- [docs] Fix 404 (#13989) @alexfauquette
|
|
99
|
+
- [docs] Fix Vale errors (#14025) @oliviertassinari
|
|
100
|
+
- [docs] Update on `renderCell` & autogenerated rows (#13879) @romgrk
|
|
101
|
+
|
|
102
|
+
### Core
|
|
103
|
+
|
|
104
|
+
- [core] Fix event naming convention @oliviertassinari
|
|
105
|
+
- [core] Replace @mui/base with @mui/utils + @mui/material (#13823) @mnajdova
|
|
106
|
+
- [core] Test `charts` performance with codspeed (#13952) @JCQuintas
|
|
107
|
+
- [infra] Consolidate issue cleanup and support labeling action (#14031) @michelengelen
|
|
108
|
+
- [infra] Revert `vale` action `paths` filtering (#14038) @LukasTy
|
|
109
|
+
- [test] Fix adapters code coverage (#13969) @alexfauquette
|
|
110
|
+
- [test] Fix mocha config to run charts tests (#14041) @alexfauquette
|
|
111
|
+
|
|
112
|
+
## 7.11.1
|
|
113
|
+
|
|
114
|
+
_Jul 25, 2024_
|
|
115
|
+
|
|
116
|
+
We'd like to offer a big thanks to the 18 contributors who made this release possible. Here are some highlights ✨:
|
|
117
|
+
|
|
118
|
+
- 🔎 Allow `Zoom` to be controllable for charts (#13858) @JCQuintas
|
|
119
|
+
- 🌍 Add Icelandic (is-IS) and Norwegian Nynorsk (nn-NO) locales on the Data Grid
|
|
120
|
+
- 🌍 Improve Norwegian Bokmål (nb-NO) and German (de-DE) locales on the Data Grid
|
|
121
|
+
- 🌍 Add Norwegian Nynorsk (nn-NO) locale on the Date and Time Pickers
|
|
122
|
+
- 🐞 Bugfixes
|
|
123
|
+
- 📚 Documentation improvements
|
|
124
|
+
|
|
125
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
126
|
+
|
|
127
|
+
### Data Grid
|
|
128
|
+
|
|
129
|
+
#### `@mui/x-data-grid@7.11.1`
|
|
130
|
+
|
|
131
|
+
- [DataGrid] Remove dead code in internal `GridPreferencesPanel` (#13934) @k-rajat19
|
|
132
|
+
- [DataGrid] Do not miss to escape formulas in CSV export (#13888) @arminmeh
|
|
133
|
+
- [l10n] Add Icelandic (is-IS) locale (#13283) @magnimarels
|
|
134
|
+
- [l10n] Add Norwegian nynorsk (nn-NO) locale and improve Norwegian bokmål (nb-NO) locale (#13588) @AnderzL7
|
|
135
|
+
- [l10n] Improve German (de-DE) locale (#13910) @lhilgert9
|
|
136
|
+
|
|
137
|
+
#### `@mui/x-data-grid-pro@7.11.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
138
|
+
|
|
139
|
+
Same changes as in `@mui/x-data-grid@7.11.1`.
|
|
140
|
+
|
|
141
|
+
#### `@mui/x-data-grid-premium@7.11.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
142
|
+
|
|
143
|
+
Same changes as in `@mui/x-data-grid-pro@7.11.1`, plus:
|
|
144
|
+
|
|
145
|
+
- [DataGridPremium] Pass the `api` object to events (#13893) @pcorpet
|
|
146
|
+
- [DataGridPremium] Fix paste to selected cells (#13967) @romgrk
|
|
147
|
+
|
|
148
|
+
### Date and Time Pickers
|
|
149
|
+
|
|
150
|
+
#### `@mui/x-date-pickers@7.11.1`
|
|
151
|
+
|
|
152
|
+
- [fields] Prevent keyboard editing when disabled (#13900) @arthurbalduini
|
|
153
|
+
- [l10n] Add Norwegian Nynorsk (nn-NO) locale (#13946) @AnderzL7
|
|
154
|
+
|
|
155
|
+
#### `@mui/x-date-pickers-pro@7.11.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
156
|
+
|
|
157
|
+
Same changes as in `@mui/x-date-pickers@7.11.1`.
|
|
158
|
+
|
|
159
|
+
### Charts
|
|
160
|
+
|
|
161
|
+
#### `@mui/x-charts@7.11.1`
|
|
162
|
+
|
|
163
|
+
- [charts] Add `ownerState` function to `slotProps` typing when available (#13965) @alexfauquette
|
|
164
|
+
- [charts] Allow `Zoom` to be controllable (#13858) @JCQuintas
|
|
165
|
+
- [charts] Deprecate `xAxisKey` /`zAxisKey` in favor of `xAxisId`/`zAxisId` (#13940) @alexfauquette
|
|
166
|
+
- [charts] Hide empty arcs in the PieChart (#13897) @alexfauquette
|
|
167
|
+
- [charts] Limit the trigger of exit charts (#13682) @alexfauquette
|
|
168
|
+
|
|
169
|
+
### Tree View
|
|
170
|
+
|
|
171
|
+
#### `@mui/x-tree-view@7.11.1`
|
|
172
|
+
|
|
173
|
+
- [TreeView] Allow the plugins to enrich the props passed to the item slots (#13953) @flaviendelangle
|
|
174
|
+
|
|
175
|
+
### Docs
|
|
176
|
+
|
|
177
|
+
- [docs] Bump pnpm priority as a package manager (#13894) @oliviertassinari
|
|
178
|
+
- [docs] Explicitly mark charts pro as not released (#13905) @alexfauquette
|
|
179
|
+
- [docs] Fix dot consistency a11y table @oliviertassinari
|
|
180
|
+
- [docs] Fix some typos in charts docs (#13906) @cratiu222
|
|
181
|
+
- [docs] Fix spelling (#13902) @nnsW3
|
|
182
|
+
- [docs] Improve error message when moving between plans (#13874) @oliviertassinari
|
|
183
|
+
- [docs] Update `SparkLineChart` reference not being correctly capitalised (#13960) @duckboy81
|
|
184
|
+
- [docs] Fix scroll demos disorientation (#13909) @oliviertassinari
|
|
185
|
+
|
|
186
|
+
### Core
|
|
187
|
+
|
|
188
|
+
- [core] Add `@mui/material-nextjs` to `MUI Core` renovate group (#13966) @LukasTy
|
|
189
|
+
- [core] Remove warning message in production (#13911) @oliviertassinari
|
|
190
|
+
- [code-infra] Reuse `useReactVersion` script from the monorepo (#13710) @cherniavskii
|
|
191
|
+
- [infra] Adds order id validation action (#13957) @michelengelen
|
|
192
|
+
- [infra] Fix order id validator action (#13971) @michelengelen
|
|
193
|
+
- [infra] Fix regex in order id validation (#13976) @michelengelen
|
|
194
|
+
- [infra] Issue template improvement (#13954) @michelengelen
|
|
195
|
+
|
|
6
196
|
## 7.11.0
|
|
7
197
|
|
|
8
198
|
_Jul 18, 2024_
|
|
@@ -59,8 +249,8 @@ Same changes as in `@mui/x-date-pickers@7.11.0`, plus:
|
|
|
59
249
|
- [charts] Defaultize axis on top level `useChartContainerProps` (#13817) @JCQuintas
|
|
60
250
|
- [charts] Fix charts not passing `className` to root element (#13647) @JCQuintas
|
|
61
251
|
- [charts] Generate API documentation for pro components (#13822) @alexfauquette
|
|
62
|
-
- [charts] Improve zoomed highlight
|
|
63
|
-
- [charts] Allow zoom on Y axis and add zoom options to configure zooming
|
|
252
|
+
- [charts] Improve zoomed highlight behavior (unreleased) (#13868) @JCQuintas
|
|
253
|
+
- [charts] Allow zoom on Y axis and add zoom options to configure zooming behavior (unreleased) (#13726) @JCQuintas
|
|
64
254
|
- [charts] Disable animations while zooming (unreleased) (#13807) @JCQuintas
|
|
65
255
|
|
|
66
256
|
### Tree View
|
|
@@ -533,7 +723,7 @@ Same changes as in `@mui/x-date-pickers@7.6.2`.
|
|
|
533
723
|
|
|
534
724
|
#### `@mui/x-charts@7.6.2`
|
|
535
725
|
|
|
536
|
-
- [charts] Add `Initializable` type and
|
|
726
|
+
- [charts] Add `Initializable` type and behavior to allow checking if a complex context has been initialized. (#13365) @JCQuintas
|
|
537
727
|
- [charts] Fix some props not working in `xAxis` and `yAxis` (#13372) @Valyok26
|
|
538
728
|
- [charts] Harmonize charts types (#13366) @alexfauquette
|
|
539
729
|
- [charts] Introduce plugins system (#13367) @alexfauquette
|
|
@@ -541,7 +731,7 @@ Same changes as in `@mui/x-date-pickers@7.6.2`.
|
|
|
541
731
|
|
|
542
732
|
### Docs
|
|
543
733
|
|
|
544
|
-
- [docs] Add badges like in Material
|
|
734
|
+
- [docs] Add badges like in Material UI @oliviertassinari
|
|
545
735
|
- [docs] Update twitter.com to x.com @oliviertassinari
|
|
546
736
|
- [docs] Fix the description of `tickInterval` (#13355) @alexfauquette
|
|
547
737
|
- [docs] Adjust the code example for `quickFilterValues` (#12919) @michelengelen
|
|
@@ -12,7 +12,7 @@ function DataGrid() {
|
|
|
12
12
|
if (process.env.NODE_ENV === 'production') {
|
|
13
13
|
return null;
|
|
14
14
|
}
|
|
15
|
-
throw new Error(["You try to import `DataGrid` from @mui/x-data-grid-premium but this module
|
|
15
|
+
throw new Error(["You try to import `DataGrid` from @mui/x-data-grid-premium but this module isn't exported from this npm package.", '', "Instead, you can do `import { DataGridPremium } from '@mui/x-data-grid-premium'`.", ''].join('\n'));
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -22,5 +22,5 @@ function DataGridPro() {
|
|
|
22
22
|
if (process.env.NODE_ENV === 'production') {
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
25
|
-
throw new Error(["You try to import `DataGridPro` from @mui/x-data-grid-premium but this module
|
|
25
|
+
throw new Error(["You try to import `DataGridPro` from @mui/x-data-grid-premium but this module isn't exported from this npm package.", '', "Instead, you can do `import { DataGridPremium } from '@mui/x-data-grid-premium'`.", ''].join('\n'));
|
|
26
26
|
}
|
|
@@ -15,7 +15,7 @@ var _dataGridPremiumDefaultSlotsComponents = require("../constants/dataGridPremi
|
|
|
15
15
|
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); }
|
|
16
16
|
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; }
|
|
17
17
|
const getDataGridPremiumForcedProps = themedProps => (0, _extends2.default)({
|
|
18
|
-
signature:
|
|
18
|
+
signature: _xDataGridPro.GridSignature.DataGridPremium
|
|
19
19
|
}, themedProps.unstable_dataSource ? {
|
|
20
20
|
filterMode: 'server',
|
|
21
21
|
sortingMode: 'server',
|
|
@@ -8,7 +8,7 @@ exports.GridAggregationHeader = GridAggregationHeader;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
var
|
|
11
|
+
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
12
12
|
var _styles = require("@mui/material/styles");
|
|
13
13
|
var _xDataGrid = require("@mui/x-data-grid");
|
|
14
14
|
var _gridAggregationUtils = require("../hooks/features/aggregation/gridAggregationUtils");
|
|
@@ -58,7 +58,7 @@ const useUtilityClasses = ownerState => {
|
|
|
58
58
|
root: ['aggregationColumnHeader', colDef.headerAlign === 'left' && 'aggregationColumnHeader--alignLeft', colDef.headerAlign === 'center' && 'aggregationColumnHeader--alignCenter', colDef.headerAlign === 'right' && 'aggregationColumnHeader--alignRight'],
|
|
59
59
|
aggregationLabel: ['aggregationColumnHeaderLabel']
|
|
60
60
|
};
|
|
61
|
-
return (0,
|
|
61
|
+
return (0, _composeClasses.default)(slots, _xDataGrid.getDataGridUtilityClass, classes);
|
|
62
62
|
};
|
|
63
63
|
function GridAggregationHeader(props) {
|
|
64
64
|
const {
|
|
@@ -86,7 +86,7 @@ function GridColumnMenuAggregationItem(props) {
|
|
|
86
86
|
label: label,
|
|
87
87
|
color: "primary",
|
|
88
88
|
onChange: handleAggregationItemChange,
|
|
89
|
-
onBlur:
|
|
89
|
+
onBlur: event => event.stopPropagation(),
|
|
90
90
|
fullWidth: true,
|
|
91
91
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuItem.default, {
|
|
92
92
|
value: "",
|
|
@@ -10,7 +10,7 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _xDataGrid = require("@mui/x-data-grid");
|
|
12
12
|
var _styles = require("@mui/material/styles");
|
|
13
|
-
var
|
|
13
|
+
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
14
14
|
var _useGridRootProps = require("../hooks/utils/useGridRootProps");
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
16
|
const _excluded = ["formattedValue", "colDef", "cellMode", "row", "api", "id", "value", "rowNode", "field", "focusElementRef", "hasFocus", "tabIndex", "isEditable"];
|
|
@@ -33,7 +33,7 @@ const useUtilityClasses = ownerState => {
|
|
|
33
33
|
const slots = {
|
|
34
34
|
root: ['footerCell']
|
|
35
35
|
};
|
|
36
|
-
return (0,
|
|
36
|
+
return (0, _composeClasses.default)(slots, _xDataGrid.getDataGridUtilityClass, classes);
|
|
37
37
|
};
|
|
38
38
|
function GridFooterCell(props) {
|
|
39
39
|
const {
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.GridGroupingCriteriaCell = GridGroupingCriteriaCell;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
|
-
var
|
|
10
|
+
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
11
11
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
12
12
|
var _xDataGridPro = require("@mui/x-data-grid-pro");
|
|
13
13
|
var _useGridApiContext = require("../hooks/utils/useGridApiContext");
|
|
@@ -23,7 +23,7 @@ const useUtilityClasses = ownerState => {
|
|
|
23
23
|
root: ['groupingCriteriaCell'],
|
|
24
24
|
toggle: ['groupingCriteriaCellToggle']
|
|
25
25
|
};
|
|
26
|
-
return (0,
|
|
26
|
+
return (0, _composeClasses.default)(slots, _xDataGridPro.getDataGridUtilityClass, classes);
|
|
27
27
|
};
|
|
28
28
|
function GridGroupingCriteriaCell(props) {
|
|
29
29
|
const {
|
|
@@ -5,7 +5,7 @@ export function DataGrid() {
|
|
|
5
5
|
if (process.env.NODE_ENV === 'production') {
|
|
6
6
|
return null;
|
|
7
7
|
}
|
|
8
|
-
throw new Error(["You try to import `DataGrid` from @mui/x-data-grid-premium but this module
|
|
8
|
+
throw new Error(["You try to import `DataGrid` from @mui/x-data-grid-premium but this module isn't exported from this npm package.", '', "Instead, you can do `import { DataGridPremium } from '@mui/x-data-grid-premium'`.", ''].join('\n'));
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -15,5 +15,5 @@ export function DataGridPro() {
|
|
|
15
15
|
if (process.env.NODE_ENV === 'production') {
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
18
|
-
throw new Error(["You try to import `DataGridPro` from @mui/x-data-grid-premium but this module
|
|
18
|
+
throw new Error(["You try to import `DataGridPro` from @mui/x-data-grid-premium but this module isn't exported from this npm package.", '', "Instead, you can do `import { DataGridPremium } from '@mui/x-data-grid-premium'`.", ''].join('\n'));
|
|
19
19
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useThemeProps } from '@mui/material/styles';
|
|
4
|
-
import { DATA_GRID_PRO_PROPS_DEFAULT_VALUES, GRID_DEFAULT_LOCALE_TEXT } from '@mui/x-data-grid-pro';
|
|
4
|
+
import { DATA_GRID_PRO_PROPS_DEFAULT_VALUES, GRID_DEFAULT_LOCALE_TEXT, GridSignature } from '@mui/x-data-grid-pro';
|
|
5
5
|
import { computeSlots, useProps } from '@mui/x-data-grid-pro/internals';
|
|
6
6
|
import { GRID_AGGREGATION_FUNCTIONS } from '../hooks/features/aggregation';
|
|
7
7
|
import { DATA_GRID_PREMIUM_DEFAULT_SLOTS_COMPONENTS } from '../constants/dataGridPremiumDefaultSlotsComponents';
|
|
8
8
|
const getDataGridPremiumForcedProps = themedProps => _extends({
|
|
9
|
-
signature:
|
|
9
|
+
signature: GridSignature.DataGridPremium
|
|
10
10
|
}, themedProps.unstable_dataSource ? {
|
|
11
11
|
filterMode: 'server',
|
|
12
12
|
sortingMode: 'server',
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["renderHeader"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import
|
|
5
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
6
6
|
import { styled } from '@mui/material/styles';
|
|
7
7
|
import { getDataGridUtilityClass, gridClasses, GridColumnHeaderTitle } from '@mui/x-data-grid';
|
|
8
8
|
import { getAggregationFunctionLabel } from '../hooks/features/aggregation/gridAggregationUtils';
|
|
@@ -77,7 +77,7 @@ function GridColumnMenuAggregationItem(props) {
|
|
|
77
77
|
label: label,
|
|
78
78
|
color: "primary",
|
|
79
79
|
onChange: handleAggregationItemChange,
|
|
80
|
-
onBlur:
|
|
80
|
+
onBlur: event => event.stopPropagation(),
|
|
81
81
|
fullWidth: true,
|
|
82
82
|
children: [/*#__PURE__*/_jsx(MenuItem, {
|
|
83
83
|
value: "",
|
|
@@ -4,7 +4,7 @@ const _excluded = ["formattedValue", "colDef", "cellMode", "row", "api", "id", "
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { getDataGridUtilityClass } from '@mui/x-data-grid';
|
|
6
6
|
import { styled } from '@mui/material/styles';
|
|
7
|
-
import
|
|
7
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
8
8
|
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
const GridFooterCellRoot = styled('div', {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import
|
|
3
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
4
4
|
import Box from '@mui/material/Box';
|
|
5
5
|
import { useGridSelector, gridFilteredDescendantCountLookupSelector, getDataGridUtilityClass } from '@mui/x-data-grid-pro';
|
|
6
6
|
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { ownerDocument, useEventCallback } from '@mui/material/utils';
|
|
4
|
-
import { getTotalHeaderHeight, isNavigationKey, serializeCellValue, useGridRegisterPipeProcessor, useGridVisibleRows } from '@mui/x-data-grid-pro/internals';
|
|
4
|
+
import { getTotalHeaderHeight, getVisibleRows, isNavigationKey, serializeCellValue, useGridRegisterPipeProcessor, useGridVisibleRows } from '@mui/x-data-grid-pro/internals';
|
|
5
5
|
import { useGridApiEventHandler, useGridApiMethod, GRID_ACTIONS_COLUMN_TYPE, GRID_CHECKBOX_SELECTION_COL_DEF, GRID_DETAIL_PANEL_TOGGLE_FIELD, gridRowsDataRowIdToIdLookupSelector, gridClasses, gridFocusCellSelector, GRID_REORDER_COL_DEF, useGridSelector, gridSortedRowIdsSelector, gridDimensionsSelector } from '@mui/x-data-grid-pro';
|
|
6
6
|
import { gridCellSelectionStateSelector } from './gridCellSelectionSelector';
|
|
7
7
|
export const cellSelectionStateInitializer = (state, props) => _extends({}, state, {
|
|
@@ -88,15 +88,28 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
88
88
|
apiRef.current.setCellSelectionModel(newModel);
|
|
89
89
|
}, [apiRef, visibleRows.rows]);
|
|
90
90
|
const getSelectedCellsAsArray = React.useCallback(() => {
|
|
91
|
-
const
|
|
91
|
+
const selectionModel = apiRef.current.getCellSelectionModel();
|
|
92
92
|
const idToIdLookup = gridRowsDataRowIdToIdLookupSelector(apiRef);
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
93
|
+
const currentVisibleRows = getVisibleRows(apiRef, props);
|
|
94
|
+
const sortedEntries = currentVisibleRows.rows.reduce((result, row) => {
|
|
95
|
+
if (row.id in selectionModel) {
|
|
96
|
+
result.push([row.id, selectionModel[row.id]]);
|
|
97
|
+
}
|
|
98
|
+
return result;
|
|
99
|
+
}, []);
|
|
100
|
+
return sortedEntries.reduce((selectedCells, [id, fields]) => {
|
|
101
|
+
selectedCells.push(...Object.entries(fields).reduce((selectedFields, [field, isSelected]) => {
|
|
102
|
+
if (isSelected) {
|
|
103
|
+
selectedFields.push({
|
|
104
|
+
id: idToIdLookup[id],
|
|
105
|
+
field
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
return selectedFields;
|
|
109
|
+
}, []));
|
|
110
|
+
return selectedCells;
|
|
111
|
+
}, []);
|
|
112
|
+
}, [apiRef, props]);
|
|
100
113
|
const cellSelectionApi = {
|
|
101
114
|
isCellSelected,
|
|
102
115
|
getCellSelectionModel,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { GRID_CHECKBOX_SELECTION_FIELD, gridFocusCellSelector, gridVisibleColumnFieldsSelector, useGridApiOptionHandler, useGridApiEventHandler, gridPaginatedVisibleSortedGridRowIdsSelector, gridExpandedSortedRowIdsSelector } from '@mui/x-data-grid';
|
|
4
|
-
import {
|
|
4
|
+
import { warnOnce, getRowIdFromRowModel, getActiveElement, useGridRegisterPipeProcessor, getPublicApiRef, isPasteShortcut, useGridLogger } from '@mui/x-data-grid/internals';
|
|
5
5
|
import { GRID_DETAIL_PANEL_TOGGLE_FIELD, GRID_REORDER_COL_DEF } from '@mui/x-data-grid-pro';
|
|
6
6
|
import { unstable_debounce as debounce } from '@mui/utils';
|
|
7
|
-
const missingOnProcessRowUpdateErrorWarning = buildWarning(['MUI X: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.', 'To handle the error pass a callback to the `onProcessRowUpdateError` prop, for example `<DataGrid onProcessRowUpdateError={(error) => ...} />`.', 'For more detail, see https://mui.com/x/react-data-grid/editing/#server-side-persistence.'], 'error');
|
|
8
7
|
const columnFieldsToExcludeFromPaste = [GRID_CHECKBOX_SELECTION_FIELD, GRID_REORDER_COL_DEF.field, GRID_DETAIL_PANEL_TOGGLE_FIELD];
|
|
9
8
|
|
|
10
9
|
// Batches rows that are updated during clipboard paste to reduce `updateRows` calls
|
|
@@ -121,7 +120,7 @@ class CellValueUpdater {
|
|
|
121
120
|
if (onProcessRowUpdateError) {
|
|
122
121
|
onProcessRowUpdateError(errorThrown);
|
|
123
122
|
} else if (process.env.NODE_ENV !== 'production') {
|
|
124
|
-
|
|
123
|
+
warnOnce(['MUI X: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.', 'To handle the error pass a callback to the `onProcessRowUpdateError` prop, for example `<DataGrid onProcessRowUpdateError={(error) => ...} />`.', 'For more detail, see https://mui.com/x/react-data-grid/editing/#server-side-persistence.'], 'error');
|
|
125
124
|
}
|
|
126
125
|
};
|
|
127
126
|
try {
|
|
@@ -158,20 +157,29 @@ function defaultPasteResolver({
|
|
|
158
157
|
const cellSelectionModel = apiRef.current.getCellSelectionModel();
|
|
159
158
|
const selectedCellsArray = apiRef.current.getSelectedCellsAsArray();
|
|
160
159
|
if (cellSelectionModel && selectedCellsArray.length > 1) {
|
|
161
|
-
|
|
160
|
+
let lastRowId = selectedCellsArray[0].id;
|
|
161
|
+
let rowIndex = 0;
|
|
162
|
+
let colIndex = 0;
|
|
163
|
+
selectedCellsArray.forEach(({
|
|
164
|
+
id: rowId,
|
|
165
|
+
field
|
|
166
|
+
}) => {
|
|
167
|
+
if (rowId !== lastRowId) {
|
|
168
|
+
lastRowId = rowId;
|
|
169
|
+
rowIndex += 1;
|
|
170
|
+
colIndex = 0;
|
|
171
|
+
}
|
|
162
172
|
const rowDataArr = pastedData[isSingleValuePasted ? 0 : rowIndex];
|
|
163
173
|
const hasRowData = isSingleValuePasted ? true : rowDataArr !== undefined;
|
|
164
|
-
if (
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
Object.keys(cellSelectionModel[rowId]).forEach((field, colIndex) => {
|
|
174
|
+
if (hasRowData) {
|
|
168
175
|
const cellValue = isSingleValuePasted ? rowDataArr[0] : rowDataArr[colIndex];
|
|
169
176
|
updateCell({
|
|
170
177
|
rowId,
|
|
171
178
|
field,
|
|
172
179
|
pastedCellValue: cellValue
|
|
173
180
|
});
|
|
174
|
-
}
|
|
181
|
+
}
|
|
182
|
+
colIndex += 1;
|
|
175
183
|
});
|
|
176
184
|
return;
|
|
177
185
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { GRID_DATE_COL_DEF, GRID_DATETIME_COL_DEF } from '@mui/x-data-grid-pro';
|
|
3
|
-
import {
|
|
3
|
+
import { warnOnce, isObject, isSingleSelectColDef, gridHasColSpanSelector } from '@mui/x-data-grid/internals';
|
|
4
4
|
const getExcelJs = async () => {
|
|
5
5
|
const excelJsModule = await import('exceljs');
|
|
6
6
|
return excelJsModule.default ?? excelJsModule;
|
|
7
7
|
};
|
|
8
|
-
const warnInvalidFormattedValue = buildWarning(['MUI X: When the value of a field is an object or a `renderCell` is provided, the Excel export might not display the value correctly.', 'You can provide a `valueFormatter` with a string representation to be used.']);
|
|
9
8
|
const getFormattedValueOptions = (colDef, row, valueOptions, api) => {
|
|
10
9
|
if (!colDef.valueOptions) {
|
|
11
10
|
return [];
|
|
@@ -89,7 +88,7 @@ export const serializeRowUnsafe = (id, columns, apiRef, defaultValueOptionsFormu
|
|
|
89
88
|
const formattedValue = apiRef.current.getCellParams(id, castColumn.field).formattedValue;
|
|
90
89
|
if (process.env.NODE_ENV !== 'production') {
|
|
91
90
|
if (String(cellParams.formattedValue) === '[object Object]') {
|
|
92
|
-
|
|
91
|
+
warnOnce(['MUI X: When the value of a field is an object or a `renderCell` is provided, the Excel export might not display the value correctly.', 'You can provide a `valueFormatter` with a string representation to be used.']);
|
|
93
92
|
}
|
|
94
93
|
}
|
|
95
94
|
if (isObject(formattedValue)) {
|
|
@@ -124,7 +123,7 @@ export const serializeRowUnsafe = (id, columns, apiRef, defaultValueOptionsFormu
|
|
|
124
123
|
cellValue = apiRef.current.getCellParams(id, column.field).formattedValue;
|
|
125
124
|
if (process.env.NODE_ENV !== 'production') {
|
|
126
125
|
if (String(cellParams.formattedValue) === '[object Object]') {
|
|
127
|
-
|
|
126
|
+
warnOnce(['MUI X: When the value of a field is an object or a `renderCell` is provided, the Excel export might not display the value correctly.', 'You can provide a `valueFormatter` with a string representation to be used.']);
|
|
128
127
|
}
|
|
129
128
|
}
|
|
130
129
|
break;
|
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 = "MTcyMjQ2MzIwMDAwMA==";
|
|
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
|
|
@@ -98,15 +98,28 @@ const useGridCellSelection = (apiRef, props) => {
|
|
|
98
98
|
apiRef.current.setCellSelectionModel(newModel);
|
|
99
99
|
}, [apiRef, visibleRows.rows]);
|
|
100
100
|
const getSelectedCellsAsArray = React.useCallback(() => {
|
|
101
|
-
const
|
|
101
|
+
const selectionModel = apiRef.current.getCellSelectionModel();
|
|
102
102
|
const idToIdLookup = (0, _xDataGridPro.gridRowsDataRowIdToIdLookupSelector)(apiRef);
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
103
|
+
const currentVisibleRows = (0, _internals.getVisibleRows)(apiRef, props);
|
|
104
|
+
const sortedEntries = currentVisibleRows.rows.reduce((result, row) => {
|
|
105
|
+
if (row.id in selectionModel) {
|
|
106
|
+
result.push([row.id, selectionModel[row.id]]);
|
|
107
|
+
}
|
|
108
|
+
return result;
|
|
109
|
+
}, []);
|
|
110
|
+
return sortedEntries.reduce((selectedCells, [id, fields]) => {
|
|
111
|
+
selectedCells.push(...Object.entries(fields).reduce((selectedFields, [field, isSelected]) => {
|
|
112
|
+
if (isSelected) {
|
|
113
|
+
selectedFields.push({
|
|
114
|
+
id: idToIdLookup[id],
|
|
115
|
+
field
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
return selectedFields;
|
|
119
|
+
}, []));
|
|
120
|
+
return selectedCells;
|
|
121
|
+
}, []);
|
|
122
|
+
}, [apiRef, props]);
|
|
110
123
|
const cellSelectionApi = {
|
|
111
124
|
isCellSelected,
|
|
112
125
|
getCellSelectionModel,
|
|
@@ -13,7 +13,6 @@ var _xDataGridPro = require("@mui/x-data-grid-pro");
|
|
|
13
13
|
var _utils = require("@mui/utils");
|
|
14
14
|
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); }
|
|
15
15
|
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; }
|
|
16
|
-
const missingOnProcessRowUpdateErrorWarning = (0, _internals.buildWarning)(['MUI X: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.', 'To handle the error pass a callback to the `onProcessRowUpdateError` prop, for example `<DataGrid onProcessRowUpdateError={(error) => ...} />`.', 'For more detail, see https://mui.com/x/react-data-grid/editing/#server-side-persistence.'], 'error');
|
|
17
16
|
const columnFieldsToExcludeFromPaste = [_xDataGrid.GRID_CHECKBOX_SELECTION_FIELD, _xDataGridPro.GRID_REORDER_COL_DEF.field, _xDataGridPro.GRID_DETAIL_PANEL_TOGGLE_FIELD];
|
|
18
17
|
|
|
19
18
|
// Batches rows that are updated during clipboard paste to reduce `updateRows` calls
|
|
@@ -130,7 +129,7 @@ class CellValueUpdater {
|
|
|
130
129
|
if (onProcessRowUpdateError) {
|
|
131
130
|
onProcessRowUpdateError(errorThrown);
|
|
132
131
|
} else if (process.env.NODE_ENV !== 'production') {
|
|
133
|
-
|
|
132
|
+
(0, _internals.warnOnce)(['MUI X: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.', 'To handle the error pass a callback to the `onProcessRowUpdateError` prop, for example `<DataGrid onProcessRowUpdateError={(error) => ...} />`.', 'For more detail, see https://mui.com/x/react-data-grid/editing/#server-side-persistence.'], 'error');
|
|
134
133
|
}
|
|
135
134
|
};
|
|
136
135
|
try {
|
|
@@ -167,20 +166,29 @@ function defaultPasteResolver({
|
|
|
167
166
|
const cellSelectionModel = apiRef.current.getCellSelectionModel();
|
|
168
167
|
const selectedCellsArray = apiRef.current.getSelectedCellsAsArray();
|
|
169
168
|
if (cellSelectionModel && selectedCellsArray.length > 1) {
|
|
170
|
-
|
|
169
|
+
let lastRowId = selectedCellsArray[0].id;
|
|
170
|
+
let rowIndex = 0;
|
|
171
|
+
let colIndex = 0;
|
|
172
|
+
selectedCellsArray.forEach(({
|
|
173
|
+
id: rowId,
|
|
174
|
+
field
|
|
175
|
+
}) => {
|
|
176
|
+
if (rowId !== lastRowId) {
|
|
177
|
+
lastRowId = rowId;
|
|
178
|
+
rowIndex += 1;
|
|
179
|
+
colIndex = 0;
|
|
180
|
+
}
|
|
171
181
|
const rowDataArr = pastedData[isSingleValuePasted ? 0 : rowIndex];
|
|
172
182
|
const hasRowData = isSingleValuePasted ? true : rowDataArr !== undefined;
|
|
173
|
-
if (
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
Object.keys(cellSelectionModel[rowId]).forEach((field, colIndex) => {
|
|
183
|
+
if (hasRowData) {
|
|
177
184
|
const cellValue = isSingleValuePasted ? rowDataArr[0] : rowDataArr[colIndex];
|
|
178
185
|
updateCell({
|
|
179
186
|
rowId,
|
|
180
187
|
field,
|
|
181
188
|
pastedCellValue: cellValue
|
|
182
189
|
});
|
|
183
|
-
}
|
|
190
|
+
}
|
|
191
|
+
colIndex += 1;
|
|
184
192
|
});
|
|
185
193
|
return;
|
|
186
194
|
}
|
|
@@ -19,7 +19,6 @@ const getExcelJs = async () => {
|
|
|
19
19
|
const excelJsModule = await Promise.resolve().then(() => _interopRequireWildcard(require('exceljs')));
|
|
20
20
|
return excelJsModule.default ?? excelJsModule;
|
|
21
21
|
};
|
|
22
|
-
const warnInvalidFormattedValue = (0, _internals.buildWarning)(['MUI X: When the value of a field is an object or a `renderCell` is provided, the Excel export might not display the value correctly.', 'You can provide a `valueFormatter` with a string representation to be used.']);
|
|
23
22
|
const getFormattedValueOptions = (colDef, row, valueOptions, api) => {
|
|
24
23
|
if (!colDef.valueOptions) {
|
|
25
24
|
return [];
|
|
@@ -103,7 +102,7 @@ const serializeRowUnsafe = (id, columns, apiRef, defaultValueOptionsFormulae, op
|
|
|
103
102
|
const formattedValue = apiRef.current.getCellParams(id, castColumn.field).formattedValue;
|
|
104
103
|
if (process.env.NODE_ENV !== 'production') {
|
|
105
104
|
if (String(cellParams.formattedValue) === '[object Object]') {
|
|
106
|
-
|
|
105
|
+
(0, _internals.warnOnce)(['MUI X: When the value of a field is an object or a `renderCell` is provided, the Excel export might not display the value correctly.', 'You can provide a `valueFormatter` with a string representation to be used.']);
|
|
107
106
|
}
|
|
108
107
|
}
|
|
109
108
|
if ((0, _internals.isObject)(formattedValue)) {
|
|
@@ -138,7 +137,7 @@ const serializeRowUnsafe = (id, columns, apiRef, defaultValueOptionsFormulae, op
|
|
|
138
137
|
cellValue = apiRef.current.getCellParams(id, column.field).formattedValue;
|
|
139
138
|
if (process.env.NODE_ENV !== 'production') {
|
|
140
139
|
if (String(cellParams.formattedValue) === '[object Object]') {
|
|
141
|
-
|
|
140
|
+
(0, _internals.warnOnce)(['MUI X: When the value of a field is an object or a `renderCell` is provided, the Excel export might not display the value correctly.', 'You can provide a `valueFormatter` with a string representation to be used.']);
|
|
142
141
|
}
|
|
143
142
|
}
|
|
144
143
|
break;
|
package/index.js
CHANGED
|
@@ -5,7 +5,7 @@ export function DataGrid() {
|
|
|
5
5
|
if (process.env.NODE_ENV === 'production') {
|
|
6
6
|
return null;
|
|
7
7
|
}
|
|
8
|
-
throw new Error(["You try to import `DataGrid` from @mui/x-data-grid-premium but this module
|
|
8
|
+
throw new Error(["You try to import `DataGrid` from @mui/x-data-grid-premium but this module isn't exported from this npm package.", '', "Instead, you can do `import { DataGridPremium } from '@mui/x-data-grid-premium'`.", ''].join('\n'));
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -15,5 +15,5 @@ export function DataGridPro() {
|
|
|
15
15
|
if (process.env.NODE_ENV === 'production') {
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
18
|
-
throw new Error(["You try to import `DataGridPro` from @mui/x-data-grid-premium but this module
|
|
18
|
+
throw new Error(["You try to import `DataGridPro` from @mui/x-data-grid-premium but this module isn't exported from this npm package.", '', "Instead, you can do `import { DataGridPremium } from '@mui/x-data-grid-premium'`.", ''].join('\n'));
|
|
19
19
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useThemeProps } from '@mui/material/styles';
|
|
4
|
-
import { DATA_GRID_PRO_PROPS_DEFAULT_VALUES, GRID_DEFAULT_LOCALE_TEXT } from '@mui/x-data-grid-pro';
|
|
4
|
+
import { DATA_GRID_PRO_PROPS_DEFAULT_VALUES, GRID_DEFAULT_LOCALE_TEXT, GridSignature } from '@mui/x-data-grid-pro';
|
|
5
5
|
import { computeSlots, useProps } from '@mui/x-data-grid-pro/internals';
|
|
6
6
|
import { GRID_AGGREGATION_FUNCTIONS } from '../hooks/features/aggregation';
|
|
7
7
|
import { DATA_GRID_PREMIUM_DEFAULT_SLOTS_COMPONENTS } from '../constants/dataGridPremiumDefaultSlotsComponents';
|
|
8
8
|
const getDataGridPremiumForcedProps = themedProps => _extends({
|
|
9
|
-
signature:
|
|
9
|
+
signature: GridSignature.DataGridPremium
|
|
10
10
|
}, themedProps.unstable_dataSource ? {
|
|
11
11
|
filterMode: 'server',
|
|
12
12
|
sortingMode: 'server',
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["renderHeader"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import
|
|
5
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
6
6
|
import { styled } from '@mui/material/styles';
|
|
7
7
|
import { getDataGridUtilityClass, gridClasses, GridColumnHeaderTitle } from '@mui/x-data-grid';
|
|
8
8
|
import { getAggregationFunctionLabel } from '../hooks/features/aggregation/gridAggregationUtils';
|
|
@@ -77,7 +77,7 @@ function GridColumnMenuAggregationItem(props) {
|
|
|
77
77
|
label: label,
|
|
78
78
|
color: "primary",
|
|
79
79
|
onChange: handleAggregationItemChange,
|
|
80
|
-
onBlur:
|
|
80
|
+
onBlur: event => event.stopPropagation(),
|
|
81
81
|
fullWidth: true,
|
|
82
82
|
children: [/*#__PURE__*/_jsx(MenuItem, {
|
|
83
83
|
value: "",
|
|
@@ -4,7 +4,7 @@ const _excluded = ["formattedValue", "colDef", "cellMode", "row", "api", "id", "
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { getDataGridUtilityClass } from '@mui/x-data-grid';
|
|
6
6
|
import { styled } from '@mui/material/styles';
|
|
7
|
-
import
|
|
7
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
8
8
|
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
const GridFooterCellRoot = styled('div', {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import
|
|
3
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
4
4
|
import Box from '@mui/material/Box';
|
|
5
5
|
import { useGridSelector, gridFilteredDescendantCountLookupSelector, getDataGridUtilityClass } from '@mui/x-data-grid-pro';
|
|
6
6
|
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { ownerDocument, useEventCallback } from '@mui/material/utils';
|
|
4
|
-
import { getTotalHeaderHeight, isNavigationKey, serializeCellValue, useGridRegisterPipeProcessor, useGridVisibleRows } from '@mui/x-data-grid-pro/internals';
|
|
4
|
+
import { getTotalHeaderHeight, getVisibleRows, isNavigationKey, serializeCellValue, useGridRegisterPipeProcessor, useGridVisibleRows } from '@mui/x-data-grid-pro/internals';
|
|
5
5
|
import { useGridApiEventHandler, useGridApiMethod, GRID_ACTIONS_COLUMN_TYPE, GRID_CHECKBOX_SELECTION_COL_DEF, GRID_DETAIL_PANEL_TOGGLE_FIELD, gridRowsDataRowIdToIdLookupSelector, gridClasses, gridFocusCellSelector, GRID_REORDER_COL_DEF, useGridSelector, gridSortedRowIdsSelector, gridDimensionsSelector } from '@mui/x-data-grid-pro';
|
|
6
6
|
import { gridCellSelectionStateSelector } from './gridCellSelectionSelector';
|
|
7
7
|
export const cellSelectionStateInitializer = (state, props) => _extends({}, state, {
|
|
@@ -88,15 +88,28 @@ export const useGridCellSelection = (apiRef, props) => {
|
|
|
88
88
|
apiRef.current.setCellSelectionModel(newModel);
|
|
89
89
|
}, [apiRef, visibleRows.rows]);
|
|
90
90
|
const getSelectedCellsAsArray = React.useCallback(() => {
|
|
91
|
-
const
|
|
91
|
+
const selectionModel = apiRef.current.getCellSelectionModel();
|
|
92
92
|
const idToIdLookup = gridRowsDataRowIdToIdLookupSelector(apiRef);
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
93
|
+
const currentVisibleRows = getVisibleRows(apiRef, props);
|
|
94
|
+
const sortedEntries = currentVisibleRows.rows.reduce((result, row) => {
|
|
95
|
+
if (row.id in selectionModel) {
|
|
96
|
+
result.push([row.id, selectionModel[row.id]]);
|
|
97
|
+
}
|
|
98
|
+
return result;
|
|
99
|
+
}, []);
|
|
100
|
+
return sortedEntries.reduce((selectedCells, [id, fields]) => {
|
|
101
|
+
selectedCells.push(...Object.entries(fields).reduce((selectedFields, [field, isSelected]) => {
|
|
102
|
+
if (isSelected) {
|
|
103
|
+
selectedFields.push({
|
|
104
|
+
id: idToIdLookup[id],
|
|
105
|
+
field
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
return selectedFields;
|
|
109
|
+
}, []));
|
|
110
|
+
return selectedCells;
|
|
111
|
+
}, []);
|
|
112
|
+
}, [apiRef, props]);
|
|
100
113
|
const cellSelectionApi = {
|
|
101
114
|
isCellSelected,
|
|
102
115
|
getCellSelectionModel,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { GRID_CHECKBOX_SELECTION_FIELD, gridFocusCellSelector, gridVisibleColumnFieldsSelector, useGridApiOptionHandler, useGridApiEventHandler, gridPaginatedVisibleSortedGridRowIdsSelector, gridExpandedSortedRowIdsSelector } from '@mui/x-data-grid';
|
|
4
|
-
import {
|
|
4
|
+
import { warnOnce, getRowIdFromRowModel, getActiveElement, useGridRegisterPipeProcessor, getPublicApiRef, isPasteShortcut, useGridLogger } from '@mui/x-data-grid/internals';
|
|
5
5
|
import { GRID_DETAIL_PANEL_TOGGLE_FIELD, GRID_REORDER_COL_DEF } from '@mui/x-data-grid-pro';
|
|
6
6
|
import { unstable_debounce as debounce } from '@mui/utils';
|
|
7
|
-
const missingOnProcessRowUpdateErrorWarning = buildWarning(['MUI X: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.', 'To handle the error pass a callback to the `onProcessRowUpdateError` prop, for example `<DataGrid onProcessRowUpdateError={(error) => ...} />`.', 'For more detail, see https://mui.com/x/react-data-grid/editing/#server-side-persistence.'], 'error');
|
|
8
7
|
const columnFieldsToExcludeFromPaste = [GRID_CHECKBOX_SELECTION_FIELD, GRID_REORDER_COL_DEF.field, GRID_DETAIL_PANEL_TOGGLE_FIELD];
|
|
9
8
|
|
|
10
9
|
// Batches rows that are updated during clipboard paste to reduce `updateRows` calls
|
|
@@ -121,7 +120,7 @@ class CellValueUpdater {
|
|
|
121
120
|
if (onProcessRowUpdateError) {
|
|
122
121
|
onProcessRowUpdateError(errorThrown);
|
|
123
122
|
} else if (process.env.NODE_ENV !== 'production') {
|
|
124
|
-
|
|
123
|
+
warnOnce(['MUI X: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.', 'To handle the error pass a callback to the `onProcessRowUpdateError` prop, for example `<DataGrid onProcessRowUpdateError={(error) => ...} />`.', 'For more detail, see https://mui.com/x/react-data-grid/editing/#server-side-persistence.'], 'error');
|
|
125
124
|
}
|
|
126
125
|
};
|
|
127
126
|
try {
|
|
@@ -158,20 +157,29 @@ function defaultPasteResolver({
|
|
|
158
157
|
const cellSelectionModel = apiRef.current.getCellSelectionModel();
|
|
159
158
|
const selectedCellsArray = apiRef.current.getSelectedCellsAsArray();
|
|
160
159
|
if (cellSelectionModel && selectedCellsArray.length > 1) {
|
|
161
|
-
|
|
160
|
+
let lastRowId = selectedCellsArray[0].id;
|
|
161
|
+
let rowIndex = 0;
|
|
162
|
+
let colIndex = 0;
|
|
163
|
+
selectedCellsArray.forEach(({
|
|
164
|
+
id: rowId,
|
|
165
|
+
field
|
|
166
|
+
}) => {
|
|
167
|
+
if (rowId !== lastRowId) {
|
|
168
|
+
lastRowId = rowId;
|
|
169
|
+
rowIndex += 1;
|
|
170
|
+
colIndex = 0;
|
|
171
|
+
}
|
|
162
172
|
const rowDataArr = pastedData[isSingleValuePasted ? 0 : rowIndex];
|
|
163
173
|
const hasRowData = isSingleValuePasted ? true : rowDataArr !== undefined;
|
|
164
|
-
if (
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
Object.keys(cellSelectionModel[rowId]).forEach((field, colIndex) => {
|
|
174
|
+
if (hasRowData) {
|
|
168
175
|
const cellValue = isSingleValuePasted ? rowDataArr[0] : rowDataArr[colIndex];
|
|
169
176
|
updateCell({
|
|
170
177
|
rowId,
|
|
171
178
|
field,
|
|
172
179
|
pastedCellValue: cellValue
|
|
173
180
|
});
|
|
174
|
-
}
|
|
181
|
+
}
|
|
182
|
+
colIndex += 1;
|
|
175
183
|
});
|
|
176
184
|
return;
|
|
177
185
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { GRID_DATE_COL_DEF, GRID_DATETIME_COL_DEF } from '@mui/x-data-grid-pro';
|
|
3
|
-
import {
|
|
3
|
+
import { warnOnce, isObject, isSingleSelectColDef, gridHasColSpanSelector } from '@mui/x-data-grid/internals';
|
|
4
4
|
const getExcelJs = async () => {
|
|
5
5
|
const excelJsModule = await import('exceljs');
|
|
6
6
|
return excelJsModule.default ?? excelJsModule;
|
|
7
7
|
};
|
|
8
|
-
const warnInvalidFormattedValue = buildWarning(['MUI X: When the value of a field is an object or a `renderCell` is provided, the Excel export might not display the value correctly.', 'You can provide a `valueFormatter` with a string representation to be used.']);
|
|
9
8
|
const getFormattedValueOptions = (colDef, row, valueOptions, api) => {
|
|
10
9
|
if (!colDef.valueOptions) {
|
|
11
10
|
return [];
|
|
@@ -89,7 +88,7 @@ export const serializeRowUnsafe = (id, columns, apiRef, defaultValueOptionsFormu
|
|
|
89
88
|
const formattedValue = apiRef.current.getCellParams(id, castColumn.field).formattedValue;
|
|
90
89
|
if (process.env.NODE_ENV !== 'production') {
|
|
91
90
|
if (String(cellParams.formattedValue) === '[object Object]') {
|
|
92
|
-
|
|
91
|
+
warnOnce(['MUI X: When the value of a field is an object or a `renderCell` is provided, the Excel export might not display the value correctly.', 'You can provide a `valueFormatter` with a string representation to be used.']);
|
|
93
92
|
}
|
|
94
93
|
}
|
|
95
94
|
if (isObject(formattedValue)) {
|
|
@@ -124,7 +123,7 @@ export const serializeRowUnsafe = (id, columns, apiRef, defaultValueOptionsFormu
|
|
|
124
123
|
cellValue = apiRef.current.getCellParams(id, column.field).formattedValue;
|
|
125
124
|
if (process.env.NODE_ENV !== 'production') {
|
|
126
125
|
if (String(cellParams.formattedValue) === '[object Object]') {
|
|
127
|
-
|
|
126
|
+
warnOnce(['MUI X: When the value of a field is an object or a `renderCell` is provided, the Excel export might not display the value correctly.', 'You can provide a `valueFormatter` with a string representation to be used.']);
|
|
128
127
|
}
|
|
129
128
|
}
|
|
130
129
|
break;
|
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 = "MTcyMjQ2MzIwMDAwMA==";
|
|
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.12.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",
|
|
@@ -33,18 +33,18 @@
|
|
|
33
33
|
"directory": "packages/x-data-grid-premium"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@babel/runtime": "^7.
|
|
37
|
-
"@mui/system": "^5.16.
|
|
38
|
-
"@mui/utils": "^5.16.
|
|
36
|
+
"@babel/runtime": "^7.25.0",
|
|
37
|
+
"@mui/system": "^5.16.5",
|
|
38
|
+
"@mui/utils": "^5.16.5",
|
|
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-
|
|
45
|
-
"@mui/x-
|
|
46
|
-
"@mui/x-data-grid
|
|
47
|
-
"@mui/x-
|
|
44
|
+
"@mui/x-data-grid-pro": "7.12.0",
|
|
45
|
+
"@mui/x-internals": "7.12.0",
|
|
46
|
+
"@mui/x-data-grid": "7.12.0",
|
|
47
|
+
"@mui/x-license": "7.12.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@mui/material": "^5.15.14",
|
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 = "MTcyMjQ2MzIwMDAwMA==";
|
|
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
|